@visactor/react-vtable 1.18.0 → 1.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/radio/radio.js +2 -1
- package/cjs/components/tag/tag.js +1 -2
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/react-vtable.js +30 -26
- package/dist/react-vtable.min.js +2 -2
- package/es/components/radio/radio.js +2 -1
- package/es/components/tag/tag.js +1 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +2 -2
package/dist/react-vtable.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable"),require("react")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactVTable={},t.VTable,t.React)}(this,(function(t,e,n){"use strict";const i=n.createContext(null);function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}i.displayName="TableContext";var s={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,s||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,a=new Array(s);r<s;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,r,s,a){var o=n?n+t:t;if(!this._events[o])return!1;var l,h,u=this._events[o],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,s),!0;case 6:return u.fn.call(u.context,e,i,r,s,a),!0}for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u.fn.apply(u.context,l)}else{var d,f=u.length;for(h=0;h<f;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),c){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,i);break;case 4:u[h].fn.call(u[h].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u[h].fn.apply(u[h].context,l)}}return!0},o.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},o.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},o.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||i&&o.context!==i||a(this,s);else{for(var l=0,h=[],u=o.length;l<u;l++)(o[l].fn!==e||r&&!o[l].once||i&&o[l].context!==i)&&h.push(o[l]);h.length?this._events[s]=1===h.length?h[0]:h:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o}(s);var a=r(s.exports);var o=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var l=t=>"function"==typeof t;var h=t=>null==t;var u=t=>null!=t;var c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var d=t=>"object"==typeof t&&null!==t;var f=function(t){if(!d(t)||!o(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 p=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||o(t,"String")};var g=t=>Array.isArray?Array.isArray(t):o(t,"Array");var m=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var b=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||o(t,"Number")};function y(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(u(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!u(r[a])||"object"!=typeof r[a]||i&&g(t[a])?x(t,a,r[a]):v(t,e,a,n,i)}}}}function v(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=t[n],a=e[n];let o=e[n],l=!0;if(g(a)){if(i)o=[];else if(g(s))o=s;else if(m(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else f(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&y(o,a,i,r),x(t,n,o)}function x(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function _(t){let e=-1;const n=arguments.length<=1?0:arguments.length-1;for(;++e<n;)y(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function S(t,e){if(!t||!f(t))return t;const n={};return Object.keys(t).forEach((i=>{const r=t[i];let s=!1;e.forEach((t=>{(p(t)&&t===i||t instanceof RegExp&&i.match(t))&&(s=!0)})),s||(n[i]=r)})),n}function A(t){return Object.prototype.toString.call(t)}function w(t){return Object.keys(t)}function T(t,e,n){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(A(t)!==A(e))return!1;if(l(t))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof t)return!1;if(g(t)){if(t.length!==e.length)return!1;for(let i=t.length-1;i>=0;i--)if(!T(t[i],e[i],n))return!1;return!0}if(!f(t))return!1;const i=w(t),r=w(e);if(i.length!==r.length)return!1;i.sort(),r.sort();for(let t=i.length-1;t>=0;t--)if(i[t]!=r[t])return!1;for(let r=i.length-1;r>=0;r--){const s=i[r];if(!T(t[s],e[s],n))return!1}return!0}const B=function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const n=e.split(":");if(2===n.length){const e=n[0].trim(),i=n[1].trim();e&&i&&(t[e]=i)}}})),t};var C,k={exports:{}},M={};k.exports=function(){if(C)return M;C=1;var t,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function g(t){if("object"==typeof t&&null!==t){var p=t.$$typeof;switch(p){case e:switch(t=t.type){case i:case s:case r:case u:case c:return t;default:switch(t=t&&t.$$typeof){case l:case o:case h:case f:case d:case a:return t;default:return p}}case n:return p}}}return t=Symbol.for("react.module.reference"),M.ContextConsumer=o,M.ContextProvider=a,M.Element=e,M.ForwardRef=h,M.Fragment=i,M.Lazy=f,M.Memo=d,M.Portal=n,M.Profiler=s,M.StrictMode=r,M.Suspense=u,M.SuspenseList=c,M.isAsyncMode=function(){return!1},M.isConcurrentMode=function(){return!1},M.isContextConsumer=function(t){return g(t)===o},M.isContextProvider=function(t){return g(t)===a},M.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},M.isForwardRef=function(t){return g(t)===h},M.isFragment=function(t){return g(t)===i},M.isLazy=function(t){return g(t)===f},M.isMemo=function(t){return g(t)===d},M.isPortal=function(t){return g(t)===n},M.isProfiler=function(t){return g(t)===s},M.isStrictMode=function(t){return g(t)===r},M.isSuspense=function(t){return g(t)===u},M.isSuspenseList=function(t){return g(t)===c},M.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===r||e===u||e===c||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===o||e.$$typeof===h||e.$$typeof===t||void 0!==e.getModuleId)},M.typeOf=g,M}();var P=k.exports;const E=t=>{let e=[];return n.Children.forEach(t,(t=>{h(t)||(P.isFragment(t)?e=e.concat(E(t.props.children)):e.push(t))})),e},O={...e.TABLE_EVENT_TYPE,...e.PIVOT_TABLE_EVENT_TYPE,...e.PIVOT_CHART_EVENT_TYPE},L={onClickCell:O.CLICK_CELL,onDblClickCell:O.DBLCLICK_CELL,onMouseDownCell:O.MOUSEDOWN_CELL,onMouseUpCell:O.MOUSEUP_CELL,onSelectedCell:O.SELECTED_CELL,onSelectedClear:O.SELECTED_CLEAR,onKeyDown:O.KEYDOWN,onMouseEnterTable:O.MOUSEENTER_TABLE,onMouseLeaveTable:O.MOUSELEAVE_TABLE,onMouseDownTable:O.MOUSEDOWN_TABLE,onMouseMoveCell:O.MOUSEMOVE_CELL,onMouseMoveTable:O.MOUSEMOVE_TABLE,onMouseEnterCell:O.MOUSEENTER_CELL,onMouseLeaveCell:O.MOUSELEAVE_CELL,onContextMenuCell:O.CONTEXTMENU_CELL,onResizeColumn:O.RESIZE_COLUMN,onResizeColumnEnd:O.RESIZE_COLUMN_END,onResizeRow:O.RESIZE_ROW,onResizeRowEnd:O.RESIZE_ROW_END,onChangeHeaderPositionStart:O.CHANGE_HEADER_POSITION_START,onChangeHeaderPosition:O.CHANGE_HEADER_POSITION,onChangeHeaderPositionFail:O.CHANGE_HEADER_POSITION_FAIL,onSortClick:O.SORT_CLICK,onAfterSort:O.AFTER_SORT,onFreezeClick:O.FREEZE_CLICK,onScroll:O.SCROLL,onScrollHorizontalEnd:O.SCROLL_HORIZONTAL_END,onScrollVerticalEnd:O.SCROLL_VERTICAL_END,onDropdownMenuClick:O.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:O.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:O.DRAG_SELECT_END,onCopyData:O.COPY_DATA,onDropdownIconClick:O.DROPDOWN_ICON_CLICK,onDropdownMenuClear:O.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:O.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:O.SHOW_MENU,onHideMenu:O.HIDE_MENU,onIconClick:O.ICON_CLICK,onLegendItemClick:O.LEGEND_ITEM_CLICK,onLegendItemHover:O.LEGEND_ITEM_HOVER,onLegendItemUnHover:O.LEGEND_ITEM_UNHOVER,onLegendChange:O.LEGEND_CHANGE,onMouseEnterAxis:O.MOUSEENTER_AXIS,onMouseLeaveAxis:O.MOUSELEAVE_AXIS,onCheckboxStateChange:O.CHECKBOX_STATE_CHANGE,onRadioStateChange:O.RADIO_STATE_CHANGE,onSwitchStateChange:O.SWITCH_STATE_CHANGE,onAfterRender:O.AFTER_RENDER,onInitialized:O.INITIALIZED,onChangeCellValue:O.CHANGE_CELL_VALUE,onDragFillHandleEnd:O.DRAG_FILL_HANDLE_END,onMousedownFillHandle:O.MOUSEDOWN_FILL_HANDLE,onDblclickFillHandle:O.DBLCLICK_FILL_HANDLE,onPivotSortClick:O.PIVOT_SORT_CLICK,onDrillMenuClick:O.DRILLMENU_CLICK,onVChartEventType:O.VCHART_EVENT_TYPE,onChangCellValue:O.CHANGE_CELL_VALUE,onEmptyTipClick:O.EMPTY_TIP_CLICK,onEmptyTipDblClick:O.EMPTY_TIP_DBLCLICK,onButtonClick:O.BUTTON_CLICK,onBeforeCacheChartImage:O.BEFORE_CACHE_CHART_IMAGE},R=Object.keys(L),I=(t,e=L)=>{const n={};return Object.keys(t).forEach((i=>{e[i]&&t[i]&&(n[i]=t[i])})),n},N=(t,e,n,i=L)=>{if(!e&&!n||!t)return!1;const r=n?I(n,i):null,s=e?I(e,i):null;return r&&Object.keys(r).forEach((e=>{s&&s[e]&&s[e]===r[e]||t.off(i[e],n[e])})),s&&Object.keys(s).forEach((e=>{r&&r[e]&&r[e]===s[e]||t.on(i[e],s[e])})),!0};class D{static GenAutoIncrementId(){return D.auto_increment_id++}}D.auto_increment_id=0;class U{constructor(t){this.id=D.GenAutoIncrementId(),this.registry=t}}const z="named",W="inject",F="inversify:tagged",j="inversify:paramtypes";class H{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===z?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var G=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=Object.getPrototypeOf(Function),i=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function s(t,e,n){let s=r.get(t);if(h(s)){if(!n)return;s=new i,r.set(t,s)}let a=s.get(e);if(h(a)){if(!n)return;a=new i,s.set(e,a)}return a}function a(t,e,n){if(o(t,e,n))return!0;const i=g(e);return!u(i)&&a(t,i,n)}function o(t,e,n){const i=s(e,n,!1);return!h(i)&&!!i.has(t)}function l(t,e,n){if(o(t,e,n))return function(t,e,n){const i=s(e,n,!1);if(!h(i))return i.get(t)}(t,e,n);const i=g(e);return u(i)?void 0:l(t,i,n)}function h(t){return void 0===t}function u(t){return null===t}function c(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,n){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 i=3===n?"string":5===n?"number":"default",r=function(t,e){const n=t[e];if(null!=n){if(!p(n))throw new TypeError;return n}}(t,e);if(void 0!==r){const e=r.call(t,i);if(c(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(p(e)){const n=e.call(t);if(!c(n))return n}const n=t.valueOf;if(p(n)){const e=n.call(t);if(!c(e))return e}}else{const e=t.valueOf;if(p(e)){const n=e.call(t);if(!c(n))return n}const n=t.toString;if(p(n)){const e=n.call(t);if(!c(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function f(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function p(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===n)return e;if(e!==n)return e;const i=t.prototype,r=i&&Object.getPrototypeOf(i);if(null==r||r===Object.prototype)return e;const s=r.constructor;return"function"!=typeof s||s===t?e:s}t("defineMetadata",(function(t,e,n,i){if(!c(n))throw new TypeError;return r=t,a=e,void s(n,i,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return h(n)||(n=f(n)),a(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return h(n)||(n=f(n)),o(t,e,n)})),t("getMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return h(n)||(n=f(n)),l(t,e,n)}))}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})})),t}({});function $(t,e,n,i){!function(t,e,n,i){const r=[i];let s={};G.hasOwnMetadata(t,e)&&(s=G.getMetadata(t,e));let a=s[n];void 0===a&&(a=[]),a.push(...r),s[n]=a,G.defineMetadata(t,s,e)}(F,t,n.toString(),i)}function V(t){return(e,n,i)=>{$(e,0,i,t)}}const X=(Y=W,t=>(e,n,i)=>V(new H(Y,t))(e,n,i));var Y;function K(){return function(t){return G.defineMetadata(j,null,t),t}}function q(t){return V(new H(z,t))}const Q="Singleton",Z="Transient",J="ConstantValue",tt="DynamicValue",et="Factory",nt="Function",it="Instance",rt="Invalid";class st{constructor(t,e){this.id=D.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=rt,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new st(this.serviceIdentifier,this.scope);return t.activated=t.scope===Q&&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 at{getConstructorMetadata(t){return{compilerGeneratedMetadata:G.getMetadata(j,t),userGeneratedMetadata:G.getMetadata(F,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const ot=(lt=z,t=>{const e=e=>{if(null==e)return!1;if(e.key===lt&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const n=e.constructorArgsMetadata;for(let e=0;e<n.length;e++)if(n[e].key===lt&&n[e].value===t)return!0;return!1};return e.metaData=new H(lt,t),e});var lt;class ht{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Q,this}inTransientScope(){return this._binding.scope=Z,this}whenTargetNamed(t){return this._binding.constraint=ot(t),this}}class ut{constructor(t){this._binding=t}to(t){return this._binding.type=it,this._binding.implementationType=t,new ht(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=tt,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ht(this._binding)}toConstantValue(t){return this._binding.type=J,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Q,new ht(this._binding)}toFactory(t){return this._binding.type=et,this._binding.factory=t,this._binding.scope=Q,new ht(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const ct=Symbol("ContributionProvider");class dt{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 ft(t,e){t(ct).toDynamicValue((t=>{let{container:n}=t;return new dt(e,n)})).inSingletonScope().whenTargetNamed(e)}class pt{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>!(t.name===n&&(!e||t.fn===e)))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>n)){i++;break}}this.taps[i]=t}}class gt extends pt{call(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const mt=Symbol.for("EnvContribution");var bt;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(bt||(bt={}));var yt=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var vt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||yt(t,"Boolean")};var xt=t=>"function"==typeof t;var _t=t=>null==t;var St=t=>null!=t;var At=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var wt=t=>"object"==typeof t&&null!==t;var Tt=function(t){if(!wt(t)||!yt(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 Bt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||yt(t,"String")};var Ct=t=>Array.isArray?Array.isArray(t):yt(t,"Array");var kt=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var Mt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||yt(t,"Number")};var Pt=t=>Mt(t)&&Number.isFinite(t);var Et=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var Ot=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 Lt=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const Rt=Object.prototype;var It=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)};const Nt=Object.prototype.hasOwnProperty;function Dt(t){if(_t(t))return!0;if(kt(t))return!t.length;const e=Lt(t);if("Map"===e||"Set"===e)return!t.size;if(It(t))return!Object.keys(t).length;for(const e in t)if(Nt.call(t,e))return!1;return!0}const Ut=Object.prototype.hasOwnProperty;var zt=(t,e)=>null!=t&&Ut.call(t,e);function Wt(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(St(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!St(r[a])||"object"!=typeof r[a]||i&&Ct(t[a])?jt(t,a,r[a]):Ft(t,e,a,n,i)}}}}function Ft(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=t[n],a=e[n];let o=e[n],l=!0;if(Ct(a)){if(i)o=[];else if(Ct(s))o=s;else if(kt(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else Tt(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&Wt(o,a,i,r),jt(t,n,o)}function jt(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function Ht(t){let e=-1;const n=arguments.length<=1?0:arguments.length-1;for(;++e<n;)Wt(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function Gt(t,e){if(!Ct(t)||!Ct(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const $t="undefined"!=typeof console;function Vt(t,e,n){const i=[e].concat([].slice.call(n));$t&&console[t].apply(console,i)}var Xt;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Xt||(Xt={}));class Yt{static getInstance(t,e){return Yt._instance&&Mt(t)?Yt._instance.level(t):Yt._instance||(Yt._instance=new Yt(t,e)),Yt._instance}static setInstance(t){return Yt._instance=t}static setInstanceLevel(t){Yt._instance?Yt._instance.level(t):Yt._instance=new Yt(t)}static clearInstance(){Yt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=Xt.Info}canLogDebug(){return this._level>=Xt.Debug}canLogError(){return this._level>=Xt.Error}canLogWarn(){return this._level>=Xt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this._level>=Xt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...n):Vt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",n)),this}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Xt.Warn&&Vt(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Xt.Info&&Vt(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Xt.Debug&&Vt(this._method||"log","DEBUG",e),this}}Yt._instance=null;var Kt=function(t,e,n){return t<e?e:t>n?n:t};const qt=1e-12,Qt=Math.PI,Zt=Qt/2,Jt=2*Qt,te=2*Math.PI,ee=Math.abs,ne=Math.atan2,ie=Math.cos,re=Math.max,se=Math.min,ae=Math.sin,oe=Math.sqrt,le=Math.pow;function he(t){return t>=1?Zt:t<=-1?-Zt:Math.asin(t)}class ue{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new ue(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 Mt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return Mt(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 ce{static distancePP(t,e){return oe(le(t.x-e.x,2)+le(t.y-e.y,2))}static distanceNN(t,e,n,i){return oe(le(t-n,2)+le(e-i,2))}static distancePN(t,e,n){return oe(le(e-t.x,2)+le(n-t.y,2))}static pointAtPP(t,e,n){return new ue((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function de(t){return t*(Math.PI/180)}const fe=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Jt;)t+=Jt;else if(t>0)for(;t>Jt;)t-=Jt;return t};var pe;function ge(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function me(t,e){let{x:n,y:i}=t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(n-r.x)*Math.cos(e)-(i-r.y)*Math.sin(e)+r.x,y:(n-r.x)*Math.sin(e)+(i-r.y)*Math.cos(e)+r.y}}function be(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ye(t,e){const n=e?de(t.angle):t.angle,i=be(t);return[me({x:t.x1,y:t.y1},n,i),me({x:t.x2,y:t.y1},n,i),me({x:t.x2,y:t.y2},n,i),me({x:t.x1,y:t.y2},n,i)]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(pe||(pe={}));function ve(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*a+n.e,n.b*s+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f),e)}class xe{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new xe(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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),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 Ct(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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return ve(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,n){const{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+n*l,u=n-e*l-n*o;return[o*i-l*r+h,l*i+o*r+u,o*i-l*a+h,l*i+o*a+u,o*s-l*r+h,l*s+o*r+u,o*s-l*a+h,l*s+o*a+u]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:a,y2:o}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*a+(1-t)*n,e*o+(1-e)*i]}}class _e extends xe{}class Se extends xe{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var n;super(t),t&&(this.angle=null!==(n=t.angle)&&void 0!==n?n:e)}intersects(t){return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=ye(t,n),r=ye(e,n),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(be(t),be(e)),o=s(i[0],i[1]),l=s(i[1],i[2]),h=s(r[0],r[1]),u=s(r[1],r[2]),c=n?de(t.angle):t.angle;let d=n?de(90-t.angle):t.angle+Zt;const f=n?de(e.angle):e.angle;let p=n?de(90-e.angle):e.angle+Zt;d>te&&(d-=te),p>te&&(p-=te);const g=(t,e,n,i)=>{const r=[Math.cos(e),Math.sin(e)];return t+(ge(r,n)+ge(r,i))/2>ge(r,a)};return g((t.x2-t.x1)/2,c,h,u)&&g((t.y2-t.y1)/2,d,h,u)&&g((e.x2-e.x1)/2,f,o,l)&&g((e.y2-e.y1)/2,p,o,l)}(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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,n,i),this.angle=r,this}clone(){return new Se(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[me({x:this.x1,y:this.y1},this.angle,t),me({x:this.x2,y:this.y1},this.angle,t),me({x:this.x1,y:this.y2},this.angle,t),me({x:this.x2,y:this.y2},this.angle,t)]}}class Ae{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,a=new Ae,o=t*i-e*n;return a.a=i/o,a.b=-e/o,a.c=-n/o,a.d=t/o,a.e=(n*s-i*r)/o,a.f=-(t*s-e*r)/o,a}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,a=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=a,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,a=(1-i)*n-r*e,o=i*this.a-r*this.b,l=r*this.a+i*this.b,h=i*this.c-r*this.d,u=r*this.c+i*this.d,c=i*this.e-r*this.f+s,d=r*this.e+i*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=u,this.e=c,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const a=this.a,o=this.b,l=this.c,h=this.d,u=a*t+l*e,c=o*t+h*e,d=a*n+l*i,f=o*n+h*i,p=a*r+l*s+this.e,g=o*r+h*s+this.f;return this.a=u,this.b=c,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new Ae;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:a,f:o}=this,l=n*s-i*r,h=s/l,u=-i/l,c=-r/l,d=n/l,f=(r*o-s*a)/l,p=-(n*o-i*a)/l,{x:g,y:m}=t;e.x=g*h+m*c+f,e.y=g*u+m*d+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 Ae(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const a=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/a):-Math.acos(n/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}function we(t,e,n){e/=100,n/=100;const i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),s=n-i/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=i,o=r,l=0):60<=t&&t<120?(a=r,o=i,l=0):120<=t&&t<180?(a=0,o=i,l=r):180<=t&&t<240?(a=0,o=r,l=i):240<=t&&t<300?(a=r,o=0,l=i):300<=t&&t<360&&(a=i,o=0,l=r),a=Math.round(255*(a+s)),o=Math.round(255*(o+s)),l=Math.round(255*(l+s)),{r:a,g:o,b:l}}function Te(t,e,n){t/=255,e/=255,n/=255;const i=Math.min(t,e,n),r=Math.max(t,e,n),s=r-i;let a=0,o=0,l=0;return a=0===s?0:r===t?(e-n)/s%6:r===e?(n-t)/s+2:(t-e)/s+4,a=Math.round(60*a),a<0&&(a+=360),l=(r+i)/2,o=0===s?0:s/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l:l}}const Be=/^#([0-9a-f]{3,8})$/,Ce={transparent:4294967040},ke={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 Me(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pe(t){return Mt(t)?new Ie(t>>16,t>>8&255,255&t,1):Ct(t)?new Ie(t[0],t[1],t[2]):new Ie(255,255,255)}function Ee(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Oe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Le=(t,e)=>{const n=Be.exec(t);if(e||n){const t=parseInt(n[1],16),e=n[1].length;return 3===e?new Ie((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?Pe(t):8===e?new Ie(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Re{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Re(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Re(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const n=t instanceof Re?t:new Re(t);switch(e){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3();case"wcag":return n.getLuminanceWCAG()}}static parseColorString(t){if(St(Ce[t]))return function(t){return Mt(t)?new Ie(t>>>24,t>>>16&255,t>>>8&255,255&t):Ct(t)?new Ie(t[0],t[1],t[2],t[3]):new Ie(255,255,255,1)}(Ce[t]);if(St(ke[t]))return Pe(ke[t]);const e=`${t}`.trim().toLowerCase(),n=Le(e);if(void 0!==n)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Ie(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(","),n=we(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Ie(n.r,n.g,n.b,parseFloat(t[3]))}}constructor(t){const e=Re.parseColorString(t);this.color=e||new Ie(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:n,b:i}=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(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t))),this}add(t){const{r:e,g:n,b:i}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,i+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:n,b:i}=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(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*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,n){const i=this.color.opacity,r=Te(this.color.r,this.color.g,this.color.b),s=we(_t(t)?r.h:Kt(t,0,360),_t(e)?r.s:e>=0&&e<=1?100*e:e,_t(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new Ie(s.r,s.g,s.b,i),this}setRGB(t,e,n){return!_t(t)&&(this.color.r=t),!_t(e)&&(this.color.g=e),!_t(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=Le(e,!0);return null!=n?n:this}setColorName(t){const e=ke[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,n=this.color.b/255;let i,r,s;return i=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),r=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),s=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),.2126*i+.7152*r+.0722*s}clone(){return new Re(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 n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Ee(t.color.r),this.color.g=Ee(t.color.g),this.color.b=Ee(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Oe(t.color.r),this.color.g=Oe(t.color.g),this.color.b=Oe(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Ie{constructor(t,e,n,i){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(+n)?255:Math.max(0,Math.min(255,+n)),St(i)?this.opacity=isNaN(+i)?1:Math.max(0,Math.min(1,+i)):this.opacity=1}formatHex(){return`#${Me(this.r)+Me(this.g)+Me(this.b)+(1===this.opacity?"":Me(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:n,l:i}=Te(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${n}%,${i}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const Ne=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),De=Jt-1e-8;class Ue{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>De)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let a,o,l,h,u=1/0,c=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),h=n*Math.sin(t),l<u&&(u=l),l>c&&(c=l),h<d&&(d=h),h>f&&(f=h)}if(p(i),p(r),r!==i)if((i%=Jt)<0&&(i+=Jt),(r%=Jt)<0&&(r+=Jt),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=Jt,a=i-i%Zt,o=0;o<4&&a>r;++o,a-=Zt)p(a);else for(a=i-i%Zt+Zt,o=0;o<4&&a<r;++o,a+=Zt)p(a);this.bounds.add(t+u,e+d),this.bounds.add(t+c,e+f)}arcTo(t,e,n,i,r){this.bounds.add(t,e)}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(){}}class ze{constructor(){this._curves=[],this.bounds=new _e}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const We=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Fe={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},je=0,He=1,Ge=2,$e=3,Ve=4,Xe=5,Ye=6,Ke=7,qe=8;let Qe,Ze,Je,tn,en,nn;var rn,sn,an,on,ln,hn,un,cn,dn;function fn(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=l*s,u=-o*a,c=o*s,d=l*a,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),m=Math.sin(r),b=.5*(r-i),y=Math.sin(.5*b),v=8/3*y*y/Math.sin(b),x=e+f-v*p,_=n+p+v*f,S=e+g,A=n+m,w=S+v*m,T=A-v*g;return[h*x+u*_,c*x+d*_,h*w+u*T,c*w+d*T,h*S+u*A,c*S+d*A]}function pn(t,e,n,i){const r=function(t,e,n,i,r,s,a,o,l){const h=de(a),u=Math.sin(h),c=Math.cos(h),d=c*(o-t)*.5+u*(l-e)*.5,f=c*(l-e)*.5-u*(o-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=c/n,m=u/n,b=-u/i,y=c/i,v=g*o+m*l,x=b*o+y*l,_=g*t+m*e,S=b*t+y*e;let A=1/((_-v)*(_-v)+(S-x)*(S-x))-.25;A<0&&(A=0);let w=Math.sqrt(A);s===r&&(w=-w);const T=.5*(v+_)-w*(S-x),B=.5*(x+S)+w*(_-v),C=Math.atan2(x-B,v-T);let k=Math.atan2(S-B,_-T)-C;k<0&&1===s?k+=Jt:k>0&&0===s&&(k-=Jt);const M=Math.ceil(Math.abs(k/(Zt+.001))),P=[];for(let t=0;t<M;++t){const e=C+t*k/M,r=C+(t+1)*k/M;P[t]=[T,B,e,r,n,i,u,c]}return P}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=fn(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[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"}(rn||(rn={})),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"}(sn||(sn={})),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"}(an||(an={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(on||(on={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(ln||(ln={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(hn||(hn={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(un||(un={})),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"}(cn||(cn={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(dn||(dn={}));const gn=[(t,e,n,i,r,s,a)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,n,i,r,s,a)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,a),(t,e,n,i,r,s,a)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,a),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,a)=>e.lineTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.moveTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,a),(t,e,n,i,r,s,a)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,a)];function mn(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];gn[l[0]](l,e,n,i,r,s,a)}}class bn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function yn(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],a=e[r],o=t[(r+1)%i],l=e[(r+1)%i];n+=ce.distanceNN(s,a,o,l)}return n/2}function vn(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function xn(t,e,n,i,r){const s=vn(t.x,e.x,n.x,i.x,r),a=vn(t.y,e.y,n.y,i.y,r);return new ue(s,a)}function _n(t,e,n,i){const r=1-i;return r*r*t+2*r*i*e+i*i*n}function Sn(t,e,n,i){const r=_n(t.x,e.x,n.x,i),s=_n(t.y,e.y,n.y,i);return new ue(r,s)}class An extends bn{constructor(t,e,n){super(),this.type=cn.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Sn(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,yn([t.x,e.x,n.x],[t.y,e.y,n.y])):60;var t,e,n}calcProjLength(t){return t===un.ROW?ee(this.p0.x-this.p2.x):t===un.COLUMN?ee(this.p0.y-this.p2.y):0}getAngleAt(t){const e=re(t-.01,0),n=se(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ne(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.quadraticCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r}=t,s=Sn(n,i,r,e),a=ce.pointAtPP(n,i,e),o=ce.pointAtPP(i,r,e);return[new An(n,a,s),new An(s,o,r)]}(this,s);t.quadraticCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class wn extends bn{constructor(t,e,n,i){super(),this.type=cn.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_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 xn(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,i=this.p3,yn([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])):60;var t,e,n,i}calcProjLength(t){return t===un.ROW?ee(this.p0.x-this.p3.x):t===un.COLUMN?ee(this.p0.y-this.p3.y):0}getAngleAt(t){const e=re(t-.01,0),n=se(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ne(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.bezierCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n,this.p3.x*i+e,this.p3.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,a=xn(n,i,r,s,e),o=ce.pointAtPP(n,i,e),l=ce.pointAtPP(i,r,e),h=ce.pointAtPP(r,s,e),u=ce.pointAtPP(o,l,e),c=ce.pointAtPP(l,h,e);return[new wn(n,o,u,a),new wn(a,c,h,s)]}(this,s);t.bezierCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n,a.p3.x*i+e,a.p3.y*r+n)}}includeX(t){const e=se(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=re(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=n}getYAt(t){const e=se(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=(t-e)/(re(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(n).y}}class Tn extends bn{constructor(t,e){super(),this.type=cn.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return ce.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()?ce.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===un.ROW?ee(this.p0.x-this.p1.x):t===un.COLUMN?ee(this.p0.y-this.p1.y):0}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.lineTo(this.p1.x*i+e,this.p1.y*r+n);else if(s>0){const a=this.getPointAt(s);t.lineTo(a.x*i+e,a.y*r+n)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,n=this.p1;this.p0.x>this.p1.x&&(e=this.p1,n=this.p0);const i=(t-e.x)/(n.x-e.x);return e.y+i*(n.y-e.y)}return 1/0}}class Bn{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,n,i,r,s,a,o){const l=new wn(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i),new ue(r,s));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new Tn(new ue(this._lastX,this._lastY),new ue(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===un.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return ee(t.p0.y-i.y)}if(t===un.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return ee(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Cn extends Bn{bezierCurveTo(t,e,n,i,r,s,a,o){return super.bezierCurveTo(e,t,i,n,s,r,a,o)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function kn(t,e){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function Mn(t,e,n){const i=null!=e?e:ee(n[n.length-1].x-n[0].x)>ee(n[n.length-1].y-n[0].y)?un.ROW:un.COLUMN;return"monotoneY"===t?new Cn(t,i):new Bn(t,i)}class Pn{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function En(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=Mn("linear",n,t);return function(t,e){kn(t,e)}(new Pn(r,i),t),r}function On(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class Ln{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&&On(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:On(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Rn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return En(t,e);const r=Mn("basis",n,t);return function(t,e){kn(t,e)}(new Ln(r,i),t),r}function In(t){return t<0?-1:1}function Nn(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),a=(n-t._y1)/(r||Number(i<0&&-0)),o=(s*r+a*i)/(i+r);return(In(s)+In(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Dn(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Un(t,e,n,i,r){const s=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-s)/3;t.context.bezierCurveTo(s+h,a+h*e,o-h,l-h*n,o,l,i,t.lastPoint1)}class zn{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:Un(this,this._t0,Dn(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 n=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,Un(this,Dn(this,e=Nn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Un(this,this._t0,e=Nn(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,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 Wn extends zn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Fn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return En(t,e);const r=Mn("monotoneX",n,t);return function(t,e){kn(t,e)}(new zn(r,i),t),r}function jn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return En(t,e);const r=Mn("monotoneY",n,t);return function(t,e){kn(t,e)}(new Wn(r,i),t),r}let Hn=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=n}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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(i,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function Gn(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new Bn("step",null!=i?i:ee(t[t.length-1].x-t[0].x)>ee(t[t.length-1].y-t[0].y)?un.ROW:un.COLUMN);return function(t,e){kn(t,e)}(new Hn(s,e,r),t),s}class $n extends Pn{lineEnd(){this.context.closePath()}}function Vn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=Mn("linear",n,t);return function(t,e){kn(t,e)}(new $n(r,i),t),r}function Xn(t,e,n,i,r){let s=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>qt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,n=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/n,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/n}if(t._l23_a>qt){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*i+t._x1*t._l23_2a-e*t._l12_2a)/r,l=(l*i+t._y1*t._l23_2a-n*t._l12_2a)/r}t.context.bezierCurveTo(s,a,o,l,t._x2,t._y2,i,t.lastPoint1)}function Yn(t,e){return function(n,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:a}=r;if(n.length<2-Number(!!a))return null;if(n.length<3-Number(!!a))return En(n,r);const o=Mn(t,s,n);return kn(new e(o,i,a),n),o}}const Kn=Yn("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=n,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:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Xn(this,e,n,!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=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const qn=Yn("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=n,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:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=n;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=n,t);break;case 2:this._point=3,this._x5=e,this._y5=n;break;default:Xn(this,e,n,!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=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class Qn{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const n=this.addLinearCurve(t,e);this.path.addCurve(n),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Tn(new ue(this._lastX,this._lastY),new ue(t,e))}quadraticCurveTo(t,e,n,i){const r=new An(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i));this.path.addCurve(r),this._lastX=n,this._lastY=i}bezierCurveTo(t,e,n,i,r,s){const a=new wn(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i),new ue(r,s));this.path.addCurve(a),this._lastX=r,this._lastY=s}arcTo(t,e,n,i,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,n,i,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,n,i){throw new Error("CurveContext不支持调用rect")}arc(t,e,n,i,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}class Zn extends ze{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Ue(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Ye,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Xe,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Ke,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.commandList.push([Ge,t,e,n,i,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,s),this}arcTo(t,e,n,i,r){return this.commandList.push([He,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,s,a,o){return this.commandList.push([Ve,t,e,n,i,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,s,a,o),this}rect(t,e,n,i){return this.commandList.push([qe,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}arc(t,e,n,i,r,s){return this.commandList.push([je,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([$e]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new Qn(this);mn(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[Ye]=t=>`M${t[1]} ${t[2]}`,t[Xe]=t=>`L${t[1]} ${t[2]}`,t[Ke]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Ge]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[je]=t=>{const e=[];((t,e,n,i,r,s,a)=>{const o=Math.abs(n-e),l=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,h=(n-e)/l;for(let n=0;n<l;n++){const o=e+h*n,l=e+h*(n+1),u=4*Math.tan(Math.abs(h)/4)/3,c=l<o?-1:1,d=Math.cos(o),f=Math.sin(o),p=Math.cos(l),g=Math.sin(l),m=d*s+i,b=f*a+r,y=p*s+i,v=g*a+r,x=s*u*c,_=a*u*c;t.push(m-x*f,b+_*d,y+x*g,v-_*p,y,v)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let n="";for(let t=0;t<e.length;t+=6)n+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return n},t[qe]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[$e]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((n=>{e+=t[n[0]](n)})),e}fromString(t,e,n,i,r){this.clear();const s=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let n,i;const r=[];for(let t=0,s=e.length;t<s;t++)if(Qe=e[t],Ze=Qe.slice(1),Je=Qe[0],n=[Je],i=Ze.match(We),null!==i){for(let t=0,e=i.length;t<e;t++)tn=i[t],en=parseFloat(tn),Number.isNaN(en)||n.push(en);if(nn=Fe[Je],n.length-1>nn){let t,e=Je;for(let i=1,s=n.length;i<s;i+=nn){t=[e];for(let e=i,r=i+nn;e<r;e++)t.push(n[e]);r.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else r.push(n)}else r.push(n);return r}(t);return this._runCommandStrList(s,e,n,i,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:i}=t.attribute;if(!e)return;const r=function(t,e,n){var i,r;switch(e){case"linear":default:return En(t,n);case"basis":return Rn(t,n);case"monotoneX":return Fn(t,n);case"monotoneY":return jn(t,n);case"step":return Gn(t,.5,n);case"stepBefore":return Gn(t,0,n);case"stepAfter":return Gn(t,1,n);case"catmullRom":return Kn(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return qn(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Vn(t,n)}}(e,n);"x"===i?this.direction=un.ROW:"y"===i?this.direction=un.COLUMN:"auto"===i&&(this.direction=r.direction),this._curves=r.curves}fromCustomPath2D(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}transform(t,e,n,i){const r=this.commandList;if(!this.transformCbList){const t=[];t[Ye]=this.moveToTransform,t[Xe]=this.lineToTransform,t[Ke]=this.quadraticCurveToTransform,t[Ge]=this.bezierCurveToTransform,t[He]=this.arcToTransform,t[Ve]=this.ellipseTransform,t[qe]=this.rectTransform,t[je]=this.arcTransform,t[$e]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,n,i)})),this._updateBounds()}moveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}ellipseTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}rectTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}arcTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}closePathTransform(){}_runCommandStrList(t){let e,n,i,r,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=null,c=0,d=0,f=0,p=0;for(let g=0,m=t.length;g<m;++g){switch(e=t[g],1===l&&1===h||(e=ti(e,l,h)),e[0]){case"l":c+=e[1],d+=e[2],this.lineTo(c+a,d+o);break;case"L":c=e[1],d=e[2],this.lineTo(c+a,d+o);break;case"h":c+=e[1],this.lineTo(c+a,d+o);break;case"H":c=e[1],this.lineTo(c+a,d+o);break;case"v":d+=e[1],this.lineTo(c+a,d+o);break;case"V":d=e[1],this.lineTo(c+a,d+o);break;case"m":c+=e[1],d+=e[2],this.moveTo(c+a,d+o);break;case"M":c=e[1],d=e[2],this.moveTo(c+a,d+o);break;case"c":n=c+e[5],i=d+e[6],f=c+e[3],p=d+e[4],this.bezierCurveTo(c+e[1]+a,d+e[2]+o,f+a,p+o,n+a,i+o),c=n,d=i;break;case"C":c=e[5],d=e[6],f=e[3],p=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,f+a,p+o,c+a,d+o);break;case"s":n=c+e[3],i=d+e[4],null===u[0].match(/[CcSs]/)?(f=c,p=d):(f=2*c-f,p=2*d-p),r=c+e[1],s=d+e[2],this.bezierCurveTo(f+a,p+o,r+a,s+o,n+a,i+o),f=r,p=s,c=n,d=i;break;case"S":n=e[3],i=e[4],null===u[0].match(/[CcSs]/)?(f=c,p=d):(f=2*c-f,p=2*d-p),r=e[1],s=e[2],this.bezierCurveTo(f+a,p+o,r+a,s+o,n+a,i+o),f=r,p=s,c=n,d=i;break;case"q":n=c+e[3],i=d+e[4],f=c+e[1],p=d+e[2],this.quadraticCurveTo(f+a,p+o,n+a,i+o),c=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,n+a,i+o),c=n,d=i,f=e[1],p=e[2];break;case"t":n=c+e[1],i=d+e[2],null===u[0].match(/[QqTt]/)?(f=c,p=d):"t"===u[0]?(f=2*c-r,p=2*d-s):"q"===u[0]&&(f=2*c-f,p=2*d-p),r=f,s=p,this.quadraticCurveTo(f+a,p+o,n+a,i+o),c=n,d=i,f=c+e[1],p=d+e[2];break;case"T":n=e[1],i=e[2],f=2*c-f,p=2*d-p,this.quadraticCurveTo(f+a,p+o,n+a,i+o),c=n,d=i;break;case"a":pn(this,c+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+c+a,e[7]+d+o]),c+=e[6],d+=e[7];break;case"A":pn(this,c+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),c=e[6],d=e[7];break;case"z":case"Z":this.closePath()}u=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Xe:this.lineToTransform(a,e,n,i,r);break;case Ye:this.moveToTransform(a,e,n,i,r);break;case Ge:this.bezierCurveToTransform(a,e,n,i,r);break;case Ke:this.quadraticCurveToTransform(a,e,n,i,r);break;case je:this.arcToTransform(a,e,n,i,r);break;case Ve:this.ellipseTransform(a,e,n,i,r);break;case qe:this.rectTransform(a,e,n,i,r);break;case He:this.arcToTransform(a,e,n,i,r);break;case $e:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),mn(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===un.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ee(t.p0.y-e.p1.y)}if(this.direction===un.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ee(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const n=this.curves[e];if(n.includeX(t))return n.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,n=0;for(let i=0;i<this._curves.length;i++){e=this._curves[i];const r=e.getLength(this.direction);if(n+r>=t)break;n+=r}const i=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(i),angle:e.getAngleAt(i)}}drawWithClipRange(t,e,n,i,r){this.tryBuildCurves();const s=this.getLength()*r;let a=0;for(let r=0;r<this._curves.length;r++){const o=this._curves[r],l=o.getLength(this.direction);if(!(a+l<=s)){const r=1-(a+l-s)/l;o.draw(t,n,i,e,e,r);break}o.draw(t,n,i,e,e,1),a+=l}}}const Jn=["l",0,0,0,0,0,0,0];function ti(t,e,n){const i=Jn[0]=t[0];if("a"===i||"A"===i)Jn[1]=e*t[1],Jn[2]=n*t[2],Jn[3]=t[3],Jn[4]=t[4],Jn[5]=t[5],Jn[6]=e*t[6],Jn[7]=n*t[7];else if("h"===i||"H"===i)Jn[1]=e*t[1];else if("v"===i||"V"===i)Jn[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)Jn[i]=(i%2==1?e:n)*t[i];return Jn}const ei={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new Ae},ni={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ii=Object.assign({outerBorder:Object.assign(Object.assign({},ni),{distance:0}),innerBorder:Object.assign(Object.assign({},ni),{distance:0})},ni),ri={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:bt.fontBounding,keepCenterInLine:!1},si=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),ii),{alignSelf:"auto"}),{pickStrokeBuffer:0}),ai={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},oi=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null},{_debug_bounds:!1}),si),ei),li=Object.assign(Object.assign({},oi),{startAngle:0,endAngle:te,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),hi=Object.assign(Object.assign(Object.assign({},oi),ai),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),ui=Object.assign(Object.assign({},oi),{radius:1,startAngle:0,endAngle:te}),ci=Object.assign(Object.assign({},oi),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),di=Object.assign(Object.assign({},oi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),fi=Object.assign(Object.assign(Object.assign({},oi),ai),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),pi=Object.assign(Object.assign({},oi),{path:new Zn,fillStrokeOrder:1,clipRange:1,customPath:()=>{Yt.getInstance().warn("空函数")}}),gi=Object.assign(Object.assign({},oi),{points:[],cornerRadius:0,closePath:!0}),mi=Object.assign(Object.assign({},oi),{width:100,height:100,spikes:5,thickness:.5}),bi=Object.assign(Object.assign({},oi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},oi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const yi=Object.assign(Object.assign({},oi),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),vi=Object.assign(Object.assign(Object.assign({},oi),ri),{strokeBoundsBuffer:0,keepDirIn3d:!0}),xi=Object.assign(Object.assign(Object.assign({},oi),ri),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),_i=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},oi),{fill:!0,cornerRadius:0,cornerType:"round"}),Si=Object.assign(Object.assign({},_i),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const Ai=new class{},wi=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 n(t){const n=new Error(e+": "+t);throw n.source=e,n}function i(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,o)||r("conic",t.conicGradient,a)}function r(e,i,r){return function(i,s){const a=b(i);if(a){b(t.startCall)||n("Missing (");const i=function(i){const s=r();return s&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(f)}}();return b(t.endCall)||n("Missing )"),i}}(i)}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let n,i,r=l();return r&&(n=[],n.push(r),i=e,b(t.comma)&&(r=l(),r?n.push(r):e=i)),n}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=g()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=p()||h()),t}();if(t)t.at=u();else{const e=h();if(e){t=e;const n=u();n&&(t.at=n)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function u(){if(m("position",/^at/,0)){const t=c();return t||n("Missing positioning value"),t}}function c(){const t={x:p(),y:p()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let i=e();const r=[];if(i)for(r.push(i);b(t.comma);)i=e(),i?r.push(i):n("One extra comma");return r}function f(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=p(),e}function p(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){const i=b(e);if(i)return{type:t,value:i[n]}}function b(t){const n=/^[\n\r\t\s]+/.exec(e);n&&y(n[0].length);const i=t.exec(e);return i&&y(i[0].length),i}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(i);return e.length>0&&n("Invalid input not EOF"),t}()}}();class Ti{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Ti.IsGradientStr(t))try{const e=wi(t)[0];if(e){if("linear"===e.type)return Ti.ParseLinear(e);if("radial"===e.type)return Ti.ParseRadial(e);if("conic"===e.type)return Ti.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,i=Qt/2,r=parseFloat(e.value)/180*Qt-i;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+te,stops:n.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:n=[]}=t,i=Qt/2;let r="angular"===e.type?parseFloat(e.value)/180*Qt:0;for(;r<0;)r+=te;for(;r>=te;)r-=te;let s=0,a=0,o=0,l=0;return r<i?(s=0,a=1,o=Math.sin(r),l=a-Math.cos(r)):r<Qt?(s=0,a=0,o=Math.cos(r-i),l=Math.sin(r-i)):r<Qt+i?(s=1,a=0,o=s-Math.sin(r-Qt),l=Math.cos(r-Qt)):(s=1,o=s-Math.cos(r-i-Qt),l-=Math.sin(r-i-Qt)),{gradient:"linear",x0:s,y0:a,x1:o,y1:l,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Bi(t,e,n){let i=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(i=i/Math.abs(l+h)*2*n,i)}function Ci(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,a;if(!e||!0===e)return"black";let o,l;if(Ct(e))for(let t=0;t<e.length&&(l=e[t],!l);t++);else l=e;if(l=Ti.Parse(l),"string"==typeof l)return l;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let h=e.x2-e.x1,u=e.y2-e.y1,c=e.x1-i,d=e.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1,angle:i=0}=n.attribute;h/=t,u/=e,c/=t,d/=e,(i||1!==t||1!==e)&&(c=0,d=0,h=null!==(s=n.widthWithoutTransform)&&void 0!==s?s:h,u=null!==(a=n.heightWithoutTransform)&&void 0!==a?a:u)}"linear"===l.gradient?o=function(t,e,n,i,r,s){var a,o,l,h;const u=t.createLinearGradient(n+(null!==(a=e.x0)&&void 0!==a?a:0)*r,i+(null!==(o=e.y0)&&void 0!==o?o:0)*s,n+(null!==(l=e.x1)&&void 0!==l?l:1)*r,i+(null!==(h=e.y1)&&void 0!==h?h:0)*s);return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,l,c,d,h,u):"conical"===l.gradient?o=function(t,e,n,i,r,s){var a,o;const l=t.createConicGradient(n+(null!==(a=e.x)&&void 0!==a?a:0)*r,i+(null!==(o=e.y)&&void 0!==o?o:0)*s,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern(r+n,s+i,void 0)}(t,l,c,d,h,u):"radial"===l.gradient&&(o=function(t,e,n,i,r,s){var a,o,l,h,u,c;const d=t.createRadialGradient(n+(null!==(a=e.x0)&&void 0!==a?a:.5)*r,i+(null!==(o=e.y0)&&void 0!==o?o:.5)*s,Math.max(r,s)*(null!==(l=e.r0)&&void 0!==l?l:0),n+(null!==(h=e.x1)&&void 0!==h?h:.5)*r,i+(null!==(u=e.y1)&&void 0!==u?u:.5)*s,Math.max(r,s)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,l,c,d,h,u))}return o||"orange"}const ki={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"}},Mi=!0,Pi=!1,Ei=/\w|\(|\)|-/,Oi=/[.?!,;:/,。?!、;:]/,Li=/\S/,Ri=(t,e)=>{let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily})};function Ii(t,e,n,i,r){if(t.length<=1)return 0;if(!e||e<=0)return 0;const s=Ai.graphicUtil.textMeasure;let a=i,o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),h=t.slice(0,a+1),u=Math.floor(s.measureText(h,n).width);for(;l>e||u<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),h=t.slice(0,a+1),u=Math.floor(s.measureText(h,n).width)}return r&&(a=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e;for(;Ei.test(t[i-1])&&Ei.test(t[i])||Oi.test(t[i]);)if(i--,i<=0)return n?Ni(t,e):e;return i}(t,a)),a}function Ni(t,e){let n=e;for(;Ei.test(t[n+1])&&Ei.test(t[n])||Oi.test(t[n]);)if(n++,n>=t.length)return n;return n+1}function Di(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"actual";var i;if(""===t)return{ascent:0,height:0,descent:0,width:0};const r=Ai.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0},a="actual"===n?r.actualBoundingBoxAscent:r.fontBoundingBoxAscent,o="actual"===n?r.actualBoundingBoxDescent:r.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(s.width=Math.floor(r.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(r.width),s.height=Math.floor(a+o),s.ascent=Math.floor(a),s.descent=s.height-s.ascent);const l=null!==(i=e.space)&&void 0!==i?i:0;return s.width+=l,s}const Ui=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Z,this.options=e,this.id=D.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new at}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,n){const i=this._getNotAllArgs(t,!1,e,n);return this._get(i)}getNamed(t,e){return this.getTagged(t,z,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new st(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new ut(n)}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=>n=>{const i=this.bind(n);return t(i,e),i},n=()=>t=>this.unbind(t),i=()=>t=>this.isBound(t),r=e=>n=>{const i=this.rebind(n);return t(i,e),i};return t=>({bindFunction:e(t),isboundFunction:i(),rebindFunction:r(t),unbindFunction:n(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}}_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:n}=this._metadataReader.getConstructorMetadata(e),i=Object.keys(n),r=[];for(let t=0;t<i.length;t++){const e=n[t],i={};e.forEach((t=>{i[t.key]=t.value}));const s={inject:i[W],multiInject:i.multi_inject},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};r.push(t)}}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case J:case nt:e=t.cache;break;case it: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 n=this._getChildRequest(t);return this._createInstance(e,n)}_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===Q&&(t.cache=e,t.activated=!0)}},zi=Symbol.for("CanvasFactory");function Wi(t){return Ui.getNamed(zi,Ai.global.env)(t)}const Fi=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=Wi(Object.assign({nativeCanvas:Ai.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},n=Wi(Object.assign({nativeCanvas:Ai.global.createCanvas(e)},e));return this.allocatedCanvas.push(n),n}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=[]}},ji={arc:li,area:hi,circle:ui,line:fi,path:pi,symbol:yi,text:vi,rect:bi,polygon:gi,star:mi,richtext:xi,richtextIcon:Si,image:_i,group:ci,glyph:di},Hi=Object.keys(ji);function Gi(t,e){Object.keys(e).forEach((n=>{t[n]=e[n]}))}const $i={arc:Object.assign({},ji.arc),area:Object.assign({},ji.area),circle:Object.assign({},ji.circle),line:Object.assign({},ji.line),path:Object.assign({},ji.path),symbol:Object.assign({},ji.symbol),text:Object.assign({},ji.text),rect:Object.assign({},ji.rect),polygon:Object.assign({},ji.polygon),star:Object.assign({},ji.star),richtext:Object.assign({},ji.richtext),richtextIcon:Object.assign({},ji.richtextIcon),image:Object.assign({},ji.image),group:Object.assign({},ji.group),glyph:Object.assign({},ji.glyph)};class Vi{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Hi.forEach((t=>{this._defaultTheme[t]=Object.create($i[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.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 n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const i=this.getParentWithTheme(t);if(i){const t=i.theme;(t.dirty||n)&&t.applyTheme(i,e,!0)}this.userTheme?this.doCombine(i&&i.theme.combinedTheme):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,Yt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this.combinedTheme;Hi.forEach((i=>{const r=Object.create($i[i]);t&&t[i]&&Gi(r,t[i]),n[i]&&Gi(r,n[i]),e[i]&&Gi(r,e[i]),this.combinedTheme[i]=r})),e.common&&Hi.forEach((t=>{Gi(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach((e=>{n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,this.userTheme=n,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 Xi=new Vi;function Yi(t,e){return t.glyphHost?Yi(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)):Xi.getTheme()}return null}(t)||t.attachedThemeGraphic&&Yi(t.attachedThemeGraphic)||Xi.getTheme()}var Ki=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class qi extends a{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=D.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,n=0;for(;e;){if(t(e,n++))return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){if(t(e,n++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ki(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&Yt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let n=this._firstChild;for(let t=0;t<e;t++){if(!n)return null;t>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._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 n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}let n;this._nodeList[e]=t;for(let t=e-1;t>=0&&(n=this._nodeList[t],!n);t--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const i=this.insertInto(t,0);return this._ignoreWarn=!1,i}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],n=null;return this.forEachChildren(((e,i)=>!(e===this||!t(e,i)||(n=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren(((e,i)=>{e!==this&&t(e,i)&&n.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}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 n=0;n<t;n++){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 n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._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,n){const i=vt(n,!0)&&n||At(n)&&n.capture,r=At(n)&&n.once,s=xt(e)?void 0:e;return t=i?`${t}capture`:t,e=xt(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const i=vt(n,!0)&&n||At(n)&&n.capture,r=xt(e)?void 0:e;t=i?`${t}capture`:t,e=xt(e)?e:e.handleEvent;const s=At(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return At(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return super.emit(t.type,t,...n),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Qi{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=Qi.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const n=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(n),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&xt(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&&xt(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Zi extends Qi{constructor(t,e){super(),this.type=t,this.detail=e}}const Ji={dispatchEvent(t){var e;if(!(t instanceof Qi))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 Zi(t,e))}};class tr{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-tr.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*tr.bounceIn(2*t):.5*tr.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const i=e/te*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*te/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const i=e/te*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*te/e)+1}}static getElasticInOut(t,e){return function(n){const i=e/te*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*te/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*te/e)*.5+1}}static registerFunc(t,e){tr[t]=e}}function er(t,e){const n=1/e;let i=1;for(;t>n;)t-=n,i*=-1;const r=i*t/n;return r>0?r:1+r}tr.quadIn=tr.getPowIn(2),tr.quadOut=tr.getPowOut(2),tr.quadInOut=tr.getPowInOut(2),tr.cubicIn=tr.getPowIn(3),tr.cubicOut=tr.getPowOut(3),tr.cubicInOut=tr.getPowInOut(3),tr.quartIn=tr.getPowIn(4),tr.quartOut=tr.getPowOut(4),tr.quartInOut=tr.getPowInOut(4),tr.quintIn=tr.getPowIn(5),tr.quintOut=tr.getPowOut(5),tr.quintInOut=tr.getPowInOut(5),tr.backIn=tr.getBackIn(1.7),tr.backOut=tr.getBackOut(1.7),tr.backInOut=tr.getBackInOut(1.7),tr.elasticIn=tr.getElasticIn(1,.3),tr.elasticOut=tr.getElasticOut(1,.3),tr.elasticInOut=tr.getElasticInOut(1,.3*1.5),tr.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),tr.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},tr.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)tr[`flicker${t}`]=e=>er(e,t);for(let t=2;t<10;t++)tr[`aIn${t}`]=e=>t*e*e+(1-t)*e;const nr=new class{constructor(){this.id=D.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===on.END?this.removeAnimate(e):e.status===on.RUNNING||e.status===on.INITIAL?(this.animateCount++,e.advance(t)):e.status===on.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class ir{constructor(t,e,n,i,r){this.from=t,this.to=e,this.duration=n,this.easing=i,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,n){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(n[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,n),t&&this.onEnd()}}class rr extends ir{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class sr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:D.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nr,n=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||nr,this.status=on.INITIAL,this.tailAnimate=new ar(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=n}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=re(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){sr.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]:sr.mode;t&&e&ln.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:an.ANIMATE_PLAY})}runCb(t){const e=new rr((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,n,i,r,s){const a=sr.interpolateMap.get(t)||sr.interpolateMap.get("");return!!a&&a(t,e,n,i,r,s)}pause(){this.status===on.RUNNING&&(this.status=on.PAUSED)}resume(){this.status===on.PAUSED&&(this.status=on.RUNNING)}to(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),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 ar(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===on.INITIAL&&(this.status=on.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===on.RUNNING&&(this.status=on.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,n=0;const i=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===i)return s;for(let i=0;i<this.subAnimates.length&&(e=this.subAnimates[i],!(n+e.totalDuration>=t));i++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=on.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()}}sr.mode=ln.NORMAL,sr.interpolateMap=new Map;class ar{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 or(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 n=t.easing,i="string"==typeof n?tr[n]:n,r=this._addStep(e,null,i);return r.type=hn.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,n,i){(null==e||e<0)&&(e=0);const r="string"==typeof n?tr[n]:n,s=this._addStep(e,null,r);return s.type=hn.to,this._appendProps(t,s,!!i&&i.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),i&&i.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(s.propKeys)})),this}from(t,e,n,i){this.to(t,0,n,i);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{r[t]=this.getLastPropByName(t,this.stepTail)})),this.to(r,e,n,i),this.stepTail.type=hn.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=hn.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,n){const i=new or(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}_appendProps(t,e,n){e.props=n?t:Object.assign({},t);let i=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));i.prev;)i.props&&(i.propKeys||(i.propKeys=Object.keys(i.props)),i.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=i.props[t])}))),e.propKeys=Object.keys(e.props),i=i.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const n=this.duration,i=this.loop,r=this.rawPosition;let s,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,n<=0&&(o=!0,n<0))return o;if(s=Math.floor(t/n),a=t-s*n,o=t>=i*n+n,o&&(a=n,s=i,t=a*s+n),t===r)return o;const h=!this.reversed!=!(this.bounce&&s%2);return h&&(a=n-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let n=this.stepHead.next;const i=this.position,r=this.duration;if(this.target&&n){let s=n.next;for(;s&&s.position<=i;)n=s,s=n.next;let a=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(a=n.easing(a)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,a,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(n,a)))}}tryCallCustomAnimateLifeCycle(t,e,n){if(t!==e)if(n){let n=e.prev;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let n=e.next;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=n.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let n=e.prev;for(;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){const e=n.customAnimate.getEndProps()[t];if(void 0!==e)return e}n=n.prev}return Yt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}class or{constructor(t,e,n,i){this.duration=e,this.position=t,this.props=n,this.easing=i}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 lr=200,hr="cubicOut";var ur;!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"}(ur||(ur={}));const cr=[0,0,0,0],dr=t=>t?Ct(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(cr[0]=t[0],cr[2]=t[0],cr[1]=t[1],cr[3]=t[1],cr):t:t:0,fr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],pr=[1,2,3,0,1,2,3,0];function gr(t,e,n,i){for(;t>=te;)t-=te;for(;t<0;)t+=te;for(;t>e;)e+=te;fr[0].x=n,fr[1].y=n,fr[2].x=-n,fr[3].y=-n;const r=Math.ceil(t/Zt)%4,s=Math.ceil(e/Zt)%4;if(i.add(ie(t)*n,ae(t)*n),i.add(ie(e)*n,ae(e)*n),r!==s||e-t>Qt){let t=!1;for(let e=0;e<pr.length;e++)if(t||r!==pr[e]){if(t&&s===pr[e])break;if(t){const t=fr[pr[e]];i.add(t.x,t.y)}}else{t=!0;const e=fr[r];i.add(e.x,e.y)}}}const mr=(t,e)=>{const n=((t,e)=>Bt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(n)?n:Math.max(e,n)};var br;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(br||(br={}));class yr{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:br.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===br.Color1){const e=yr.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;const i=Re.parseColorString(t);if(i){const e=[i.r/255,i.g/255,i.b/255,i.opacity];yr.store1[t]=e,yr.store255[t]=[i.r,i.g,i.b,i.opacity],n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}const i=yr.store255[t];if(i)return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n;const r=Re.parseColorString(t);return r&&(yr.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],yr.store255[t]=[r.r,r.g,r.b,r.opacity],n[0]=r.r,n[1]=r.g,n[2]=r.b,n[3]=r.opacity),n}static Set(t,e,n){if(e===br.Color1){if(yr.store1[t])return;yr.store1[t]=n,yr.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(yr.store255[t])return;yr.store255[t]=n,yr.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function vr(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&Mt(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 xr(t,e,n,i,r){return Array.isArray(t)&&!Mt(t[0])||Array.isArray(e)&&!Mt(e[0])?new Array(4).fill(0).map(((r,s)=>_r(Ct(t)?t[s]:t,Ct(e)?e[s]:e,n,i))):_r(t,e,n,i,r)}function _r(t,e,n,i,r){if(!t||!e)return t&&vr(t)||e&&vr(e)||!1;let s,a,o=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=yr.Get(t,br.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=yr.Get(e,br.Color255):l=!0,o!==l){const s=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:vr(a)})))});return o?xr(s,l,n,i,r):xr(l,s,n,i,r)}if(o){if(t.gradient===e.gradient){const i=t,r=e,s=i.stops,a=r.stops;if(s.length!==a.length)return!1;if("linear"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:wr(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("radial"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:wr(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("conical"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:wr(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n)}return!1}return r&&r(s,a),vr(function(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}(s,a,n),i)}yr.store255={},yr.store1={};const Sr=[0,0,0,0],Ar=[0,0,0,0];function wr(t,e,n){return yr.Get(t,br.Color255,Sr),yr.Get(e,br.Color255,Ar),`rgba(${Math.round(Sr[0]+(Ar[0]-Sr[0])*n)},${Math.round(Sr[1]+(Ar[1]-Sr[1])*n)},${Math.round(Sr[2]+(Ar[2]-Sr[2])*n)},${Sr[3]+(Ar[3]-Sr[3])*n})`}class Tr{static GetImage(t,e){var n;const i=Tr.cache.get(t);i?"fail"===i.loadState?Ai.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):Tr.loadImage(t,e)}static GetSvg(t,e){var n;let i=Tr.cache.get(t);i?"fail"===i.loadState?Ai.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):(i={type:"image",loadState:"init"},Tr.cache.set(t,i),i.dataPromise=Ai.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))})),i.waitingMark&&(i.waitingMark=[])}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=Tr.cache.get(t);return n?"fail"===n.loadState?Promise.reject():"init"===n.loadState||"loading"===n.loadState?n.dataPromise.then((t=>t.data)):Promise.resolve(n.data):(n={type:e,loadState:"init"},Tr.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=Ai.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=Ai.global.loadBlob(t):"json"===e&&(n.dataPromise=Ai.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Tr.isLoading&&Tr.toLoadAueue.length){Tr.isLoading=!0;const t=Tr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:n,marks:i}=t,r={type:"image",loadState:"init"};if(Tr.cache.set(n,r),r.dataPromise=Ai.global.loadImage(n),r.dataPromise){r.waitingMark=i;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,i)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(n,t.data)):(r.loadState="fail",e.imageLoadFail(n))})),r.waitingMark&&(r.waitingMark=[])}));e.push(t)}else r.loadState="fail",i.forEach((t=>t.imageLoadFail(n)))})),Promise.all(e).then((()=>{Tr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Tr.loading()})).catch((t=>{Tr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Tr.loading()}))}}),0)}static loadImage(t,e){const n=Br(t,Tr.toLoadAueue);if(-1!==n)return Tr.toLoadAueue[n].marks.push(e),void Tr.loading();Tr.toLoadAueue.push({url:t,marks:[e]}),Tr.loading()}static improveImageLoading(t){const e=Br(t,Tr.toLoadAueue);if(-1!==e){const t=Tr.toLoadAueue.splice(e,1);Tr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Br(t,e){for(let n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}Tr.cache=new Map,Tr.isLoading=!1,Tr.toLoadAueue=[],Tr.onLoadSuccessCb=[];class Cr{bounds(t,e){if(Mt(t)){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return Mt(t)?t:Math.min(t[0],t[1])}}function kr(t,e,n,i,r){return r?t.arc(n,i,e,0,Jt,!1,r):t.arc(n,i,e,0,Jt),!1}var Mr=new class extends Cr{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,n,i,r){return kr(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return kr(t,this.parseSize(e)/2+r,n,i,s)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var Pr=new class extends Cr{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,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r)}drawOffset(t,e,n,i,r,s){return function(t,e,n,i,r,s){return t.moveTo(-3*e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-3*e+i-r,s),t.lineTo(e+n+r,-3*e+i-r,s),t.lineTo(e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,e+i+r,s),t.lineTo(e+n+r,e+i+r,s),t.lineTo(e+n+r,3*e+i+r,s),t.lineTo(-e+n-r,3*e+i+r,s),t.lineTo(-e+n-r,e+i+r,s),t.lineTo(-3*e+n-r,e+i+r,s),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r,s)}};function Er(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var Or=new class extends Cr{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,i,r){return Er(t,this.parseSize(e)/2,n,i,r)}drawFitDir(t,e,n,i,r){return Er(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return Er(t,this.parseSize(e)/2+r,n,i,s)}};function Lr(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var Rr=new class extends Cr{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return Lr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Lr(t,this.parseSize(e)/2+r,n,i)}};function Ir(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}class Nr extends Cr{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,i){return Ir(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ir(t,this.parseSize(e)/2,n,i,r)}}var Dr=new Nr;var Ur=new class extends Nr{constructor(){super(...arguments),this.type="triangle"}};const zr=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Wr=Math.sin(Jt/10)*zr,Fr=-Math.cos(Jt/10)*zr;function jr(t,e,n,i){const r=Wr*e,s=Fr*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let a=1;a<5;++a){const o=Jt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+n,-l*e+i),t.lineTo(l*r-h*s+n,h*r+l*s+i)}return t.closePath(),!0}var Hr=new class extends Cr{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,n,i){return jr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return jr(t,this.parseSize(e)/2+r,n,i)}};const Gr=oe(3);function $r(t,e,n,i){const r=e,s=r/Gr,a=s/5,o=e;return t.moveTo(0+n,-r+i),t.lineTo(s/2+n,i),t.lineTo(a/2+n,i),t.lineTo(a/2+n,o+i),t.lineTo(-a/2+n,o+i),t.lineTo(-a/2+n,i),t.lineTo(-s/2+n,i),t.closePath(),!0}var Vr=new class extends Cr{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,n,i){return $r(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return $r(t,this.parseSize(e)/2+r,n,i)}};function Xr(t,e,n,i){const r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var Yr=new class extends Cr{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return Xr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Xr(t,this.parseSize(e)/2+r,n,i)}};function Kr(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var qr=new class extends Cr{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,i){return Kr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Kr(t,this.parseSize(e)/2+r,n,i)}};const Qr=-.5,Zr=oe(3)/2,Jr=1/oe(12);function ts(t,e,n,i){const r=e/2,s=e*Jr,a=r,o=e*Jr+e,l=-a,h=o;return t.moveTo(r+n,s+i),t.lineTo(a+n,o+i),t.lineTo(l+n,h+i),t.lineTo(Qr*r-Zr*s+n,Zr*r+Qr*s+i),t.lineTo(Qr*a-Zr*o+n,Zr*a+Qr*o+i),t.lineTo(Qr*l-Zr*h+n,Zr*l+Qr*h+i),t.lineTo(Qr*r+Zr*s+n,Qr*s-Zr*r+i),t.lineTo(Qr*a+Zr*o+n,Qr*o-Zr*a+i),t.lineTo(Qr*l+Zr*h+n,Qr*h-Zr*l+i),t.closePath(),!1}var es=new class extends Cr{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,n,i){return ts(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return ts(t,this.parseSize(e)/2+r,n,i)}};function ns(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}var is=new class extends Cr{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,i){return ns(t,this.parseSize(e)/2,n,i,0)}drawOffset(t,e,n,i,r){return ns(t,this.parseSize(e)/2,n,i,r)}};function rs(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}var ss=new class extends Cr{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,n,i){return rs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return rs(t,this.parseSize(e)/2,n,i,r)}};function as(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}var os=new class extends Cr{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,i){return as(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return as(t,this.parseSize(e)/2,n,i,r)}};const ls=oe(3);function hs(t,e,n,i){const r=e*ls;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var us=new class extends Cr{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return hs(t,this.parseSize(e)/2/ls,n,i)}drawOffset(t,e,n,i,r){return hs(t,this.parseSize(e)/2/ls+r,n,i)}};function cs(t,e,n,i){const r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var ds=new class extends Cr{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,n,i){return cs(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return cs(t,this.parseSize(e)/4+r,n,i)}};function fs(t,e,n,i){const r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var ps=new class extends Cr{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,n,i){return fs(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return fs(t,this.parseSize(e)/4+r,n,i)}};function gs(t,e,n,i){const r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var ms=new class extends Cr{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,n,i){return gs(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return gs(t,this.parseSize(e)/4+r,n,i)}};function bs(t,e,n,i){const r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var ys=new class extends Cr{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,n,i){return bs(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return bs(t,this.parseSize(e)/4+r,n,i)}};function vs(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var xs=new class extends Cr{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return vs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return vs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e}, ${n-r} L ${e},${n+r}`}};function _s(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var Ss=new class extends Cr{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return _s(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return _s(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} L ${e+r},${n}`}};function As(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var ws=new class extends Cr{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,n,i,r){return As(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return As(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}};function Ts(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function Bs(t,e,n,i){const r=e,s=e/2;return t.rect(n-r/2,i-s/2,r,s),!1}var Cs=new class extends Cr{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,n,i){return Mt(e)?Bs(t,e,n,i):Ts(t,e,n,i)}drawWithClipRange(t,e,n,i,r,s,a){Mt(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*r,l=[{x:n+e[0]/2,y:i-e[1]/2},{x:n+e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i-e[1]/2}];let h=0,u=l[3];t.moveTo(u.x,u.y);for(let e=0;e<l.length;e++){const n=l[e],i=Math.sqrt((n.x-u.x)*(n.x-u.x)+(n.y-u.y)*(n.y-u.y));if(h+i>o){const e=(n.x-u.x)*(o-h)/i,r=(n.y-u.y)*(o-h)/i;t.lineTo(u.x+e,u.y+r);break}t.lineTo(n.x,n.y),u=n,h+=i}return!1}drawOffset(t,e,n,i,r){return Mt(e)?Bs(t,e+2*r,n,i):Ts(t,[e[0]+2*r,e[1]+2*r],n,i)}};const ks=new _e;class Ms{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,Ct(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),mn(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(mn(this.path.commandList,t,n,i,e+r,e+r),!1)}draw(t,e,n,i,r,s){return e=this.parseSize(e),this.drawOffset(t,e,n,i,0,r,s)}parseSize(t){return Mt(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{s.path.drawWithClipRange(t,e,n,i,r),a&&a(s.path,s.attribute)})),!1):(this.path.drawWithClipRange(t,e,n,i,r),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((n=>{let{path:i}=n;ks.x1=i.bounds.x1*t,ks.y1=i.bounds.y1*t,ks.x2=i.bounds.x2*t,ks.y2=i.bounds.y2*t,e.union(ks)}))}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 Ps={};[Mr,Pr,Or,Rr,us,Ur,Hr,Vr,Yr,qr,es,is,ss,Dr,os,ds,ps,ms,ys,Cs,xs,Ss,ws].forEach((t=>{Ps[t.type]=t}));const Es={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Os{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 Ls(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Rs(t,e,n){const i=function(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!i)return;let r=i.data;const s=i.index,a=r.search(/\s/);let o=r,l=!0;-1!==a&&(o=r.substr(0,a).replace(/\s\s*$/,""),r=r.substr(a+1));const h=o;if(n){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==i.data.substr(t+1))}return{tagName:o,tagExp:r,closeIndex:s,attrExpPresent:l,rawTagName:h}}const Is=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Ns{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,n){const i=e.tagname;"string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,n){const i={};if(!t)return;const r=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}(t,Is),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],n=r[t][4];e&&(i[e]=void 0===n||(isNaN(n)?n:Number(n)))}return i}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Os("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=Ls(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),n=this.tagsNodeStack.pop(),n&&n.child&&i&&n.child[n.child.length-1][":@"]&&(n.child[n.child.length-1][":@"].text=i),i="",s=e}else if("?"===t[s+1])s=Rs(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=Ls(t,"--\x3e",s+4,"Comment is not closed.");else{const a=Rs(t,s,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,u=a.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),l=o):l=l.substr(0,l.length-1);const t=new Os(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Os(o);this.tagsNodeStack.push(n),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),n=t}i="",s=u}else i+=t[s];return e.child}}function Ds(t,e){return Us(t)}function Us(t,e){const n={};for(let e=0;e<t.length;e++){const r=t[e],s=zs(r);if(void 0!==s&&r[s]){const t=Us(r[s]);i=t,Object.keys(i).length,r[":@"]&&Ws(t,r[":@"]),void 0!==n[s]&&n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[n[s]]),n[s].push(t)):n[s]=t}}var i;return n}function zs(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Ws(t,e,n){if(e){const n=Object.keys(e),i=n.length;for(let r=0;r<i;r++){const i=n[r];t[i]=e[i]}}}class Fs{constructor(t){this.options=Object.assign({},Fs.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Ds(new Ns(this.options).parseXml(t),this.options)}}function js(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}Fs.defaultOptions={};let Hs=0;function Gs(){return Hs++}var $s;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}($s||($s={}));const Vs=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Vs.set(t,!0)));const Xs=new Map;function Ys(t){if(Vs.has(t))return!0;if(Xs.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Xs.set(t,!0)));const Ks=Gs();Gs(),Gs(),Gs(),Gs();const qs=Gs(),Qs=Gs();Gs(),Gs(),Gs(),Gs();const Zs=Gs();Gs();const Js=Gs();Gs();const ta=Gs(),ea=Gs(),na=Symbol.for("GraphicCreator"),ia={"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"},ra=Object.keys(ia),sa=new _e,aa=new Ae,oa=new _e,la=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ha=["x","y"],ua=["scaleX","scaleY"],ca=["angle"],da=new ue,fa={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 pa extends qi{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(pa.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new _e,this._updateTag=rn.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 n,i;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;da.x=r+(null!==(n=t.scrollX)&&void 0!==n?n:0),da.y=s+(null!==(i=t.scrollY)&&void 0!==i?i:0)}else da.x=r,da.y=s;return da}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Ai.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return Ai.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new Se),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let n=this.clipPathMap.get(e)||null;return n||(this.clipPathMap.size>10&&this.clipPathMap.clear(),n=this.parsePath(e),n&&this.clipPathMap.set(e,n)),n}parsePath(t){if(!t)return null;let e=Ps[t];if(e)return e;if(e=pa.userSymbolMap[t],e)return e;if(!0===((n=t=Es[t]||t).startsWith("<svg")||n.startsWith("<?xml"))){const e=new Fs,{svg:n}=e.parse(t);if(!n)return null;const i=Ct(n.path)?n.path:[n.path];sa.clear();const r=[];i.forEach((t=>{const e=(new Zn).fromString(t.d),n={};ra.forEach((e=>{t[e]&&(n[ia[e]]=t[e])})),r.push({path:e,attribute:n}),sa.union(e.bounds)}));const s=sa.width(),a=sa.height(),o=1/re(s,a);r.forEach((t=>t.path.transform(0,0,o,o)));const l=new Ms(t,r,!0);return pa.userSymbolMap[t]=l,l}var n;const i=(new Zn).fromString(t),r=i.bounds.width(),s=i.bounds.height(),a=1/re(r,s);i.transform(0,0,a,a);const o=new Ms(t,i);return pa.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,i=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,s=dr(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const n=new Ue(t);return mn(e.commandList,n,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 Ae),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&rn.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&Ai.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&rn.UPDATE_BOUNDS)&&Ai.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&rn.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&rn.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&rn.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&rn.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=rn.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===sn.GLOBAL){const n=new ue(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,n)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=Object.keys(t);for(let e=0;e<i.length;e++){const n=i[e];this.attribute[n]=t[n]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,i){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);s?this._setAttributes(s,n,i):_t(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):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]:la;for(let n=0;n<e.length;n++){const i=e[n];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:la;for(let n=0;n<e.length;n++)if(t===e[n])return!0;return!1}initAttributes(t){const e={type:an.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=rn.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:an.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ha,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const a=this.attribute,o=a.postMatrix;return o?Ai.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:ei.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:ei.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const i={type:an.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ha,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}scale(t,e,n){var i,r;if(1===t&&1===e)return this;const s={type:an.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,ua,s);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(n){let{postMatrix:i}=this.attribute;i||(i=new Ae,o.postMatrix=i),Ai.transformUtil.fromMatrix(i,i).scale(t,e,n)}else o.scaleX=(null!==(i=o.scaleX)&&void 0!==i?i:ei.scaleX)*t,o.scaleY=(null!==(r=o.scaleY)&&void 0!==r?r:ei.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const i={type:an.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ua,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}rotate(t,e){var n;if(0===t)return this;const i={type:an.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,ca,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new Ae,s.postMatrix=n),Ai.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:ei.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:an.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,ca,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const n=new sr(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(n.bind(this),t){const{onStart:e,onFrame:i,onEnd:r,onRemove:s}=t;null!=e&&n.onStart(e),null!=i&&n.onFrame(i),null!=r&&n.onEnd(r),null!=s&&n.onRemove(s),n.interpolateFunc=t.interpolate}return this.animates.set(n.id,n),n.onRemove((()=>{n.stop(),this.animates.delete(n.id)})),n}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Ai.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!_t(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,n,i){var r,s,a,o;if(n){const n=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let u;n.forEach((e=>{l[e]?(u||(u={}),u[e]=t[e]):h[e]=i&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(h,null!==(s=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==s?s:lr,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:hr),u&&this.setAttributes(u,!1,{type:an.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:an.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((n=>{if(n.stateNames){const i=n.getEndProps();zt(i,t)&&(e=i[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const n=Ct(t)?e=>!t.includes(e):e=>e!==t,i=this.currentStates.filter(n);i.length!==this.currentStates.length&&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 n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var i;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{var n;const r=this.stateProxy?this.stateProxy(e,t):null===(n=this.states)||void 0===n?void 0:n[e];r&&Object.assign(i,r)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=rn.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=rn.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=rn.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&rn.UPDATE_SHAPE_AND_BOUNDS)===rn.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=rn.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=rn.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=rn.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=rn.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=rn.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=rn.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=rn.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&rn.UPDATE_LAYOUT)}getAnchor(t,e){const n=[0,0],i=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:n,angle:i,scaleCenter:r}=this.attribute;return oa.copy(this._AABBBounds),this.setAttributes({angle:0,scaleCenter:null}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(oa),this.setAttributes({scaleX:t,scaleY:n,angle:i,scaleCenter:r}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=i();n[0]=r.x1+(r.x2-r.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=i();n[1]=r.y1+(r.y2-r.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=ei.x,y:e=ei.y,scaleX:n=ei.scaleX,scaleY:i=ei.scaleY,angle:r=ei.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&r&&(l=this.getAnchor(a,h)),!s||1===n&&1===i)!function(t,e,n,i,r,s,a,o){const l=e.a,h=e.b,u=e.c,c=e.d,d=e.e,f=e.f,p=ie(a),g=ae(a);let m,b;o?(m=o[0],b=o[1]):(m=n,b=i);const y=m-n,v=b-i,x=l*p+u*g,_=h*p+c*g,S=u*p-l*g,A=c*p-h*g;t.a=r*x,t.b=r*_,t.c=s*S,t.d=s*A,t.e=d+l*m+u*b-x*y-S*v,t.f=f+h*m+c*b-_*y-A*v}(this._transMatrix,this._transMatrix.reset(),t,e,n,i,r,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(r),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(s,h),Ai.transformUtil.fromMatrix(a,a).scale(n,i,{x:l[0],y:l[1]})}const u=this.getOffsetXY(ei);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,o){const t=aa.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline===nr&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Ai.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:an.ANIMATE_END})}onStep(t,e,n,i,r){const s={};if(n.customAnimate)n.customAnimate.update(r,i,s);else{const a=n.props,o=n.parsedProps,l=n.propKeys;this.stepInterpolate(t,e,s,n,i,r,a,void 0,o,l)}this.setAttributes(s,!1,{type:an.ANIMATE_UPDATE,animationState:{ratio:i,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,n,i,r,s,a,o,l,h){h||(h=Object.keys(a),i.propKeys=h),s?i.propKeys.forEach((t=>{e.validAttr(t)&&(n[t]=a[t])})):h.forEach((s=>{var h;if(!e.validAttr(s))return;const u=a[s],c=null!==(h=o&&o[s])&&void 0!==h?h:t.getLastPropByName(s,i);if(null==u||null==c||u===c)return void(n[s]=u);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,c,u,n),d||(d=e.customInterpolate(s,r,c,u,this,n),d||this.defaultInterpolate(u,c,s,n,l,r)||this._interpolate(s,r,c,u,n))})),i.parsedProps=l}defaultInterpolate(t,e,n,i,r,s){if(Number.isFinite(t)&&Number.isFinite(e))return i[n]=e+(t-e)*s,!0;if("fill"===n){r||(r={});const a=r.fillColorArray,o=xr(e,null!=a?a:t,s,!1,((t,e)=>{r.fillColorArray=e}));return o&&(i[n]=o),!0}if("stroke"===n){r||(r={});const a=r.strokeColorArray,o=xr(e,null!=a?a:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return o&&(i[n]=o),!0}if("shadowColor"===n){r||(r={});const a=r.shadowColorArray,o=xr(e,null!=a?a:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(i[n]=o),!0}if(Array.isArray(t)&&t.length===e.length){const r=[];let a=!0;for(let n=0;n<t.length;n++){const i=e[n],o=i+(t[n]-i)*s;if(!Number.isFinite(o)){a=!1;break}r.push(o)}a&&(i[n]=r)}return!1}_interpolate(t,e,n,i,r){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Ai.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return Bt(t,!0)?this.pathProxy=(new Zn).fromString(t):this.pathProxy=new Zn,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 n=t;this.resources||(this.resources=new Map);const i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",t.startsWith("<svg")?(Tr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(Et(t)||t.includes("/")||Ot(t))&&(Tr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):At(t)?(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e):i.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,n){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),Ai.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new Zi(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}var ga;pa.userSymbolMap={},pa.mixin(Ji),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ga||(ga={}));let ma=class t extends pa{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=qs,this._childUpdateTag=rn.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 Vi),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Vi)}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,n){if(n===sn.GLOBAL){const n=new ue(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&rn.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Ai.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Ai.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=ei.x,y:e=ei.y,dx:n=ei.dx,dy:i=ei.dy,scaleX:r=ei.scaleX,scaleY:s=ei.scaleY,angle:a=ei.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==n||0!==i||1!==r||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Yi(this).group}updateAABBBounds(t,e,n){const i=n;n=n.clone();const{width:r,height:s,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{n.union(t.AABBBounds)})):null!=r&&null!=s&&n.set(0,0,Math.max(0,r),Math.max(0,s)),!o){this.forEachChildren((t=>{n.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:i=0}=t;n.translate(e,i)}return Ai.graphicService.updateTempAABBBounds(n),Ai.graphicService.transformAABBBounds(t,n,e,!1,this),i.copy(n),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=rn.CLEAR_BOUNDS,this._childUpdateTag&=rn.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=rn.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&rn.UPDATE_BOUNDS||(this._childUpdateTag|=rn.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(),Ai.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Ai.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 n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}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,Ai.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{Ai.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),Ai.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&rn.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,n){let i=this._getChildByName(t);return i?i.setAttributes(e):(i=Ai.graphicService.creator[n](e),i.name=t,this.add(i)),i}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}};function ba(t){return new ma(t)}function ya(t,e){return!(!t&&!e)}function va(t,e){let n;return n=Ct(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function xa(t,e,n){return n&&t*e>0}function _a(t,e){return t*e>0}ma.NOWORK_ANIMATE_ATTR=fa;const Sa=Symbol.for("ImageRenderContribution"),Aa=Symbol.for("RectRenderContribution"),wa=Symbol.for("SymbolRenderContribution"),Ta=Symbol.for("TextRenderContribution"),Ba=Symbol.for("InteractiveSubRenderContribution");function Ca(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function ka(t,e,n){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:(n||(n=e),-(e-n)/2-.79*n)}function Ma(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 Pa(t,e,n){const i=n[0],r=n[1],s=n[2];let a,o,l,h,u,c,d,f,p,g,m,b;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],u=e[4],c=e[5],d=e[6],f=e[7],p=e[8],g=e[9],m=e[10],b=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=u,t[5]=c,t[6]=d,t[7]=f,t[8]=p,t[9]=g,t[10]=m,t[11]=b,t[12]=a*i+u*r+p*s+e[12],t[13]=o*i+c*r+g*s+e[13],t[14]=l*i+d*r+m*s+e[14],t[15]=h*i+f*r+b*s+e[15]),t}function Ea(t,e,n){const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],h=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],b=e[14],y=e[15];let v=n[0],x=n[1],_=n[2],S=n[3];return t[0]=v*i+x*o+_*c+S*g,t[1]=v*r+x*l+_*d+S*m,t[2]=v*s+x*h+_*f+S*b,t[3]=v*a+x*u+_*p+S*y,v=n[4],x=n[5],_=n[6],S=n[7],t[4]=v*i+x*o+_*c+S*g,t[5]=v*r+x*l+_*d+S*m,t[6]=v*s+x*h+_*f+S*b,t[7]=v*a+x*u+_*p+S*y,v=n[8],x=n[9],_=n[10],S=n[11],t[8]=v*i+x*o+_*c+S*g,t[9]=v*r+x*l+_*d+S*m,t[10]=v*s+x*h+_*f+S*b,t[11]=v*a+x*u+_*p+S*y,v=n[12],x=n[13],_=n[14],S=n[15],t[12]=v*i+x*o+_*c+S*g,t[13]=v*r+x*l+_*d+S*m,t[14]=v*s+x*h+_*f+S*b,t[15]=v*a+x*u+_*p+S*y,t}class Oa{constructor(){this.pools=[]}static identity(t){return Ma(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 Oa.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 n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const La=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new Ae(t,e,n,i,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=n,a.d=i,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new Ae(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=[]}},Ra=new Oa;var Ia=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Na=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Da=function(t,e){return function(n,i){e(n,i,t)}};function Ua(t,e,n){var i;const{x:r=n.x,y:s=n.y,z:a=n.z,dx:o=n.dx,dy:l=n.dy,dz:h=n.dz,scaleX:u=n.scaleX,scaleY:c=n.scaleY,scaleZ:d=n.scaleZ,alpha:f=n.alpha,beta:p=n.beta,angle:g=n.angle,anchor3d:m=e.attribute.anchor,anchor:b}=e.attribute,y=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;y[0]=n.x1+(n.x2-n.x1)*t}else y[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;y[1]=n.x1+(n.x2-n.x1)*t}else y[1]=m[1];y[2]=null!==(i=m[2])&&void 0!==i?i:0}if(Ma(t),Pa(t,t,[r+o,s+l,a+h]),Pa(t,t,[y[0],y[1],y[2]]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=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]=s*r+h*i,t[5]=a*r+u*i,t[6]=o*r+c*i,t[7]=l*r+d*i,t[8]=h*r-s*i,t[9]=u*r-a*i,t[10]=c*r-o*i,t[11]=d*r-l*i}(t,t,p),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],h=e[8],u=e[9],c=e[10],d=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]=s*r-h*i,t[1]=a*r-u*i,t[2]=o*r-c*i,t[3]=l*r-d*i,t[8]=s*i+h*r,t[9]=a*i+u*r,t[10]=o*i+c*r,t[11]=l*i+d*r}(t,t,f),Pa(t,t,[-y[0],-y[1],y[2]]),function(t,e,n){const i=n[0],r=n[1],s=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[u,c,d]),g){const n=Ra.allocate(),i=[0,0];if(b){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;i[0]=n.x1+(n.x2-n.x1)*t}else i[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;i[1]=n.x1+(n.x2-n.x1)*t}else i[1]=m[1]}Pa(n,n,[i[0],i[1],0]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],h=e[4],u=e[5],c=e[6],d=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]=s*r+h*i,t[1]=a*r+u*i,t[2]=o*r+c*i,t[3]=l*r+d*i,t[4]=h*r-s*i,t[5]=u*r-a*i,t[6]=c*r-o*i,t[7]=d*r-l*i}(n,n,g),Pa(n,n,[-i[0],-i[1],0]),Ea(t,t,n)}}let za=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new gt(["graphic"]),onSetStage:new gt(["graphic","stage"]),onRemove:new gt(["graphic"]),onRelease:new gt(["graphic"]),onAddIncremental:new gt(["graphic","group","stage"]),onClearIncremental:new gt(["graphic","group","stage"]),beforeUpdateAABBBounds:new gt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new gt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new gt(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new _e,this.tempAABBBounds2=new _e}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,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}afterUpdateAABBBounds(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}clearAABBBounds(t,e,n){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,n)}updatePathProxyAABBBounds(t,e){const n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;const i=new Ue(t);return mn(n.commandList,i,0,0),!0}updateHTMLTextAABBBounds(t,e,n,i){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=Mt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),i=ka(s,e,e);n.set(n.x1,i,n.x2,i+e)}if(null!=t.forceBoundsWidth){const e=Mt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),i=Ca(r,e);n.set(i,n.y1,i+e,n.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const n=e.shadowRoot.AABBBounds;t.union(n)}}transformAABBBounds(t,e,n,i,r){if(!e.empty()){const{scaleX:r=n.scaleX,scaleY:s=n.scaleY,stroke:a=n.stroke,shadowBlur:o=n.shadowBlur,lineWidth:l=n.lineWidth,pickStrokeBuffer:h=n.pickStrokeBuffer,strokeBoundsBuffer:u=n.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){js(c,(l+h)/Math.abs(r+s),i,u),e.union(c),c.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:i=n.shadowOffsetX,shadowOffsetY:a=n.shadowOffsetY}=t;js(c,o/Math.abs(r+s)*2,!1,u+1),c.translate(i,a),e.union(c)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const a=r.transMatrix;r&&r.isContainer&&(s=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),s&&ve(e,e,a)}validCheck(t,e,n,i){if(!i)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(i.shadowRoot||i.isContainer)return!0;const{visible:r=e.visible}=t;return!(!i.valid||!r)||(n.empty()||(i.parent&&n.transformWithMatrix(i.parent.globalTransMatrix),Ai.graphicService.clearAABBBounds(i,i.stage,n),n.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,n=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),n.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:n}}};za=Ia([K(),Da(0,X(na)),Na("design:paramtypes",[Object])],za);const Wa=(t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur}=t;if(i){const t=e.outerBorder,{distance:s=t.distance,lineWidth:a=t.lineWidth}=i;n.expand(s+(r+a)/2)}return n};class Fa{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n,i){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===n)t.yOffset=0;else if("middle"===n)t.yOffset=t.height/-2;else if("alphabetic"===n){let e=.79;if(1===i.length){const t=i[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=bt.actualBounding,keepCenterInLine:u=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const c=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let n=0,i=t.length;n<i;n++){const i=this.textMeasure.measureTextPixelADscentAndWidth(t[n],this.textOptions,h);let a=t[n].toString();if(i.width>o){const i=this.textMeasure.clipTextWithSuffix(t[n],this.textOptions,o,r,s,l);a=i.str,e=i.width}else e=i.width;c.push({str:a,width:e,ascent:i.ascent,descent:i.descent,keepCenterInLine:u})}d[0]=o}else{let e,n,i=0;for(let r=0,s=t.length;r<s;r++){n=t[r];const s=this.textMeasure.measureTextPixelADscentAndWidth(t[r],this.textOptions,h);e=s.width,i=Math.max(i,e),c.push({str:n,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:u})}d[0]=i}d[1]=c.length*i,d[0]=c.reduce(((t,e)=>Math.max(t,e.width)),0);const f={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(f,e,n,c),this.layoutWithBBox(f,c,e,n,i)}layoutWithBBox(t,e,n,i,r){const s=[0,0],a=e.length*r;"top"===i||("middle"===i?s[1]=(t.height-a)/2:"bottom"===i&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],n,i,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}lineOffset(t,e,n,i,r,s){if("left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=r/2+(e.ascent-e.descent)/2+s[1],!e.keepCenterInLine){const t=0,n=e.ascent+e.descent+t;if(n<r-t&&("bottom"===i?e.topOffset+=(r-n)/2:"top"===i&&(e.topOffset-=(r-n)/2)),"alphabetic"===i){const t=r/(e.ascent+e.descent);e.topOffset=r/2+(e.ascent-e.descent)/2*t+s[1]}}return s[1]+=r,e}}const ja=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...la];let Ha=class t extends pa{get font(){const t=this.getGraphicTheme();return this._font||(this._font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);const{fontStyle:i=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(i?i+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*n+"px "+(o||"sans-serif")}(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=this.getGraphicTheme(),i=this.getMaxWidth(n);return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const n=this.getGraphicTheme(),i=this.attribute,r=this.getMaxWidth(n);if(!Number.isFinite(r))return!1;const{text:s}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(s)?s.join(""):s)!==t}return"vertical"===i.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==i.text.toString():null!=this.clipedText&&this.clipedText!==i.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=ea,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return Ct(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Yi(this).text}doUpdateOBBBounds(){const e=this.getGraphicTheme();this._OBBBounds.clear();const n=this.attribute,{angle:i=e.angle}=n;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 t({})),this.obbText.setAttributes(Object.assign(Object.assign({},n),{angle:0}));const r=this.obbText.AABBBounds,{x:s,y:a}=n,o={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2},l=me(o,i,{x:s,y:a});return this._OBBBounds.copy(r),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,n){const{text:i=e.text}=this.attribute;Array.isArray(i)?this.updateMultilineAABBBounds(i):this.updateSingallineAABBBounds(i);const{tb1:r}=Ai.graphicService.updateTempAABBBounds(n),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){js(r,o/Math.abs(s+a),!0,l),n.union(r)}return Ai.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Ai.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,ve(n,n,this.transMatrix),n}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:n=e.direction,underlineOffset:i=e.underlineOffset}=this.attribute,r="horizontal"===n?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===n&&i&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+i),r}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const n=this.getGraphicTheme(),i=this.attribute,{fontFamily:r=n.fontFamily,textAlign:s=n.textAlign,textBaseline:a=n.textBaseline,fontSize:o=n.fontSize,fontWeight:l=n.fontWeight,ellipsis:h=n.ellipsis,maxLineWidth:u,stroke:c=n.stroke,wrap:d=n.wrap,measureMode:f=n.measureMode,lineWidth:p=n.lineWidth,whiteSpace:g=n.whiteSpace,suffixPosition:m=n.suffixPosition,ignoreBuf:b=n.ignoreBuf,keepCenterInLine:y=n.keepCenterInLine}=i,v=b?0:this.guessLineHeightBuf(o),x=this.getLineHeight(i,n,v);if("normal"===g||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}const _=Ai.graphicUtil.textMeasure,S=new Fa(r,{fontSize:o,fontWeight:l,fontFamily:r,lineHeight:x},_).GetLayoutByLines(t,s,a,x,!0===h?n.ellipsis:h||void 0,!1,{lineWidth:u,suffixPosition:m,measureMode:f,keepCenterInLine:y}),{bbox:A}=S;return this.cache.layoutData=S,this.clearUpdateShapeTag(),this._AABBBounds.set(A.xOffset,A.yOffset,A.xOffset+A.width,A.yOffset+A.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}updateWrapAABBBounds(t){var e,n,i;const r=this.getGraphicTheme(),{fontFamily:s=r.fontFamily,textAlign:a=r.textAlign,textBaseline:o=r.textBaseline,fontSize:l=r.fontSize,ellipsis:h=r.ellipsis,maxLineWidth:u,stroke:c=r.stroke,lineWidth:d=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:p=r.fontWeight,ignoreBuf:g=r.ignoreBuf,measureMode:m=r.measureMode,suffixPosition:b=r.suffixPosition,heightLimit:y=0,lineClamp:v,keepCenterInLine:x=r.keepCenterInLine}=this.attribute,_=g?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,r,_);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(d/2),this._AABBBounds}const A=Ai.graphicUtil.textMeasure,w={fontSize:l,fontWeight:p,fontFamily:s,lineHeight:S},T=new Fa(s,w,A),B=Ct(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let M=1/0;if(y>0&&(M=Math.max(Math.floor(y/S),1)),v&&(M=Math.min(M,v)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<B.length;t++){const e=B[t];let r=!0;if(t===M-1){const n=A.clipTextWithSuffix(e,w,u,h,!1,b,t!==B.length-1),i=A.measureTextPixelADscentAndWidth(n.str,w,m);C.push({str:n.str,width:n.width,ascent:i.ascent,descent:i.descent,keepCenterInLine:x});break}const s=A.clipText(e,w,u,"break-all"!==f,"keep-all"===f);if(""!==e&&""===s.str||s.wordBreaked){if(h){const t=A.clipTextWithSuffix(e,w,u,h,!1,b);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(i=t.width)&&void 0!==i?i:0}else s.str="",s.width=0;r=!1}const a=A.measureTextPixelADscentAndWidth(s.str,w,m);C.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:x});let o=s.str.length;if(!s.wordBreaked||""!==e&&""===s.str||(r=!0,o=s.wordBreaked),s.str.length===e.length);else if(r){let n=e.substring(o);"keep-all"===f&&(n=n.replace(/^\s+/g,"")),B.splice(t+1,0,n)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,n=0;for(let i=0,r=B.length;i<r;i++){if(i===M-1){const t=A.clipTextWithSuffix(B[i],w,u,h,!1,b),e=A.measureTextPixelADscentAndWidth(t.str,w,m);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:x}),n=Math.max(n,t.width);break}e=B[i],t=A.measureTextWidth(e,w),n=Math.max(n,t);const r=A.measureTextPixelADscentAndWidth(e,w,m);C.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:x})}k[0]=n}k[1]=C.length*S;const P={xOffset:0,yOffset:0,width:k[0],height:k[1]};T.LayoutBBox(P,a,o,C);const E=T.layoutWithBBox(P,C,a,o,S);return this.cache.layoutData=E,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),c&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var n,i;const r=this.getGraphicTheme(),s=Ai.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=r.maxLineWidth,ellipsis:h=r.ellipsis,fontFamily:u=r.fontFamily,fontSize:c=r.fontSize,fontWeight:d=r.fontWeight,stroke:f=r.stroke,lineWidth:p=r.lineWidth,verticalMode:g=r.verticalMode,suffixPosition:m=r.suffixPosition}=o,b=this.getLineHeight(o,r,0);let{textAlign:y=r.textAlign,textBaseline:v=r.textBaseline}=o;if(!g){const e=y;y=null!==(n=t.baselineMapAlign[v])&&void 0!==n?n:"left",v=null!==(i=t.alignMapBaseline[e])&&void 0!==i?i:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=re(e,a)}));const t=Ca(y,a),e=this.cache.verticalList.length*b,n=ka(v,e,c);return this._AABBBounds.set(n,t,n+e,t+a),f&&this._AABBBounds.expand(p/2),this._AABBBounds}const x=e.map((t=>function(t){const e=[];let n=0,i="";for(let r=0;r<t.length;r++)Ys(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:$s.VERTICAL}),i="",n=0),e.push({text:t[r],direction:$s.HORIZONTAL}));return i&&e.push({text:i,direction:$s.VERTICAL}),e}(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const n=!0===h?r.ellipsis:h,i=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:d,fontFamily:u},l,n,!1,m);x[e]=i.verticalList,a=i.width}else{const n=s.clipTextVertical(t,{fontSize:c,fontWeight:d,fontFamily:u},l,!1);x[e]=n.verticalList,a=n.width}else a=0,t.forEach((t=>{const e=t.direction===$s.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:d,fontFamily:u});a+=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);a=re(e,a)}));const _=Ca(y,a),S=this.cache.verticalList.length*b,A=ka(v,S,c);return this._AABBBounds.set(A,_,A+S,_+a),f&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,n;const i=this.attribute;return null!==(n=null!==(e=i.maxLineWidth)&&void 0!==e?e:i.maxWidth)&&void 0!==n?n:t.maxWidth}getLineHeight(t,e,n){var i;return null!==(i=mr(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==i?i:(t.fontSize||e.fontSize)+n}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ja;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ja;return super.needUpdateTag(t,e)}_interpolate(t,e,n,i,r){"text"===t&&(r.text=i)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return t.baselineMapAlign}getAlignMapBaseline(){return t.alignMapBaseline}};function Ga(t){return new Ha(t)}Ha.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},fa),Ha.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Ha.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const $a=["heightLimit","lineClamp"];class Va extends Ha{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return Ct(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,n,i,r;const s=this.getGraphicTheme(),{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:c,stroke:d=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:m=s.ignoreBuf,heightLimit:b=0,suffixPosition:y=s.suffixPosition,lineClamp:v}=this.attribute,x=null!==(e=mr(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,_=m?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const S=Ai.graphicUtil.textMeasure,A=new Fa(a,{fontSize:h,fontWeight:g,fontFamily:a},S),w=t.map((t=>t.toString())),T=[],B=[0,0];let C=1/0;if(b>0&&(C=Math.max(Math.floor(b/x),1)),v&&(C=Math.min(C,v)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<w.length;t++){const e=w[t];let n=!0;if(t===C-1){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,c,u,!1,y);T.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1});break}const s=A.textMeasure.clipText(e,A.textOptions,c,"break-word"===p);if(""!==e&&""===s.str){if(u){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,c,u,!1,y);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;n=!1}if(T.push({str:s.str,width:s.width,ascent:0,descent:0,keepCenterInLine:!1}),s.str.length===e.length);else if(n){const n=e.substring(s.str.length);w.splice(t+1,0,n)}}let t=0;T.forEach((e=>{t=Math.max(t,e.width)})),B[0]=t}else{let t,e,n=0;for(let i=0,r=w.length;i<r;i++){if(i===C-1){const t=A.textMeasure.clipTextWithSuffix(w[i],A.textOptions,c,u,!1,y);T.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1}),n=Math.max(n,t.width);break}e=w[i],t=A.textMeasure.measureTextWidth(e,A.textOptions,"break-word"===p),n=Math.max(n,t),T.push({str:e,width:t,ascent:0,descent:0,keepCenterInLine:!1})}B[0]=n}B[1]=T.length*(x+_);const k={xOffset:0,yOffset:0,width:B[0],height:B[1]};A.LayoutBBox(k,o,l);const M=A.layoutWithBBox(k,T,o,l,x);return this.cache.layoutData=M,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<$a.length;e++){const n=$a[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<$a.length;e++)if(t===$a[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Va.NOWORK_ANIMATE_ATTR}}function Xa(t){return new Va(t)}const Ya=["symbolType","size",...la];let Ka=class t extends pa{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=ta}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=null;try{i=new Path2D}catch(t){return null}const r=this.getParsedPath();if(!r)return null;r.draw(i,n,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Ct(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Yi(this).symbol}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n):this.updateSymbolAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=Ai.graphicService.updateTempAABBBounds(n);((t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:s=e.strokeBoundsBuffer}=t;if(i){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=i;js(n,a+(r+o)/2,!0,s)}})(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1;const{lineJoin:a=e.lineJoin}=t;return Ai.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:i=e.size}=t;if(Ct(i))n.set(-i[0]/2,-i[1]/2,i[0]/2,i[1]/2);else{const t=i/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,n){const{size:i=e.size}=t;return this.getParsedPath().bounds(i,n),n}needUpdateTags(t){return super.needUpdateTags(t,Ya)}needUpdateTag(t){return super.needUpdateTag(t,Ya)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=Ct(e)?e:[e,e];return t.path?(new Zn).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Zn).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function qa(t){return new Ka(t)}Ka.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},fa);const Qa=["width","x1","y1","height","cornerRadius",...la];let Za=class t extends pa{constructor(t){super(t),this.type="rect",this.numberType=Zs}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Yi(this).rect}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){let{width:e,height:i}=t;const{x1:r,y1:s,x:a,y:o}=t;e=null!=e?e:r-a,i=null!=i?i:s-o,(isFinite(e)||isFinite(i)||isFinite(a)||isFinite(o))&&n.set(0,0,e||0,i||0)}const{tb1:i,tb2:r}=Ai.graphicService.updateTempAABBBounds(n);return Wa(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,Ai.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,Qa)}needUpdateTag(t){return super.needUpdateTag(t,Qa)}toCustomPath(){const t=this.attribute,{x:e,y:n,width:i,height:r}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=_t(t.width)?t.x1-t.x:t.width,n=_t(t.height)?t.y1-t.y:t.height,i=0,r=0;return e<0?(i=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:i,y:r,width:e,height:n}})(t),s=new Zn;return s.moveTo(e,n),s.rect(e,n,i,r),s}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ja(t){return new Za(t)}Za.NOWORK_ANIMATE_ATTR=fa;class to{constructor(t,e,n,i,r,s,a,o,l,h,u,c,d,f){this.left=t,this.top=e,this.width=n,this.height=i,this.actualHeight=0,this.bottom=e+i,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=ki[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=c,this.singleLine=d,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:i}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,i):this.height||i||0;s=Math.min(s,i);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-r:"center"===this.globalAlign&&(o=-r/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n];if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;let s=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[n].draw(t,s,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else{const n=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=n:a+=n;for(let n=0;n<this.lines.length;n++)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n],s=l-this.lines[n].top-this.lines[n].height;if(0===l)this.lines[n].draw(t,!1,o,s+a,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,h=!0),this.lines[n].draw(t,i,o,s+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let n=0;n<this.lines.length;n++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[n].height+this.lines[n].top);const{top:i,height:r}=this.lines[n];if(0===l)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e);else{if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(i=!0,h=!0),this.lines[n].draw(t,i,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:i}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else{Math.floor((r-this.actualHeight)/2);for(let n=0;n<this.lines.length;n++)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else if("bottom"===this.verticalDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n],a=r-this.lines[n].top-this.lines[n].height;if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[n+1]&&a-this.lines[n+1].height<this[this.directionKey.top]){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function eo(t,e,n,i){const r=Math.round(t),s=Math.round(n),a=Math.round(e),o=Math.round(i);return{left:t>r?r:r-.5,top:n>s?s:s-.5,right:a>e?a:a+.5,bottom:o>i?o:o+.5}}class no{constructor(t,e,n,i){var r,s;this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic",this.ascentDescentMode=i;const a=mr(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:u}=Di(t,n,this.ascentDescentMode);let c=0,d=0,f=0;this.height>l&&(c=(this.height-l)/2,d=Math.ceil(c),f=Math.floor(c)),"top"===this.textBaseline?(this.ascent=c,this.descent=l-c):"bottom"===this.textBaseline?(this.ascent=l-c,this.descent=c):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=h+f),this.length=t.length,this.width=u||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=n.space,this.dx=null!==(r=n.dx)&&void 0!==r?r:0,this.dy=null!==(s=n.dy)&&void 0!==s?s:0,"vertical"===n.direction&&(this.direction=n.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}=Di(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,n,i,r,s,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+n,l=this.text,h=this.left+i;o+=this.top;let u=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,u="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==s&&"end"!==s||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ii(l,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===u);else{const{width:e}=Di(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const c=eo(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},c),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,n,i,r,s,a){var o;let l=e+n,h=this.text,u=this.left+i+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let c=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,c="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==s&&"end"!==s||(u-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ii(h,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===c);else{const{width:e}=Di(this.text.slice(t),this.character,this.ascentDescentMode);u-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===c&&(t.save(),t.rotateAbout(Math.PI/2,u,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(u,l),u=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(h,u,l+this.dy),this.character.fill&&t.fillText(h,u,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,n=eo(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,n=eo(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,n=eo(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,n=eo(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===c&&t.restore()}getWidthWithEllips(t){let e=this.text;const n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Ii(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:i}=Di(this.text.slice(t),this.character,this.ascentDescentMode);return n+this.ellipsisWidth-i}return n}}const io=["width","height","image",...la];let ro=class t extends pa{constructor(t){super(t),this.type="image",this.numberType=Qs,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}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,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,n){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,n)}setAttribute(t,e,n,i){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,n,i)}getGraphicTheme(){return Yi(this).image}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){const{maxWidth:i=e.maxWidth,maxHeight:r=e.maxHeight}=t;let{width:s,height:a}=t;if(null==s||null==a){const t=this.getImageElement();if(t){const e=t.width,n=t.height;if(null!=s)a=s*(n/e);else if(null!=a)s=a*(e/n);else{const t=e/n;t>i/r?(s=i,a=i/t):(a=r,s=r*t)}}else s=i,a=r}this._actualWidth=s,this._actualHeight=a,n.set(0,0,s,a)}const{tb1:i,tb2:r}=Ai.graphicService.updateTempAABBBounds(n);return Wa(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,Ai.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return _i[t]}needUpdateTags(t){return super.needUpdateTags(t,io)}needUpdateTag(t){return super.needUpdateTag(t,io)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function so(t){return new ro(t)}ro.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},fa);class ao extends ro{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=dr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(Ct(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=dr(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=_i.width,height:e=_i.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:i=e}=this.attribute,r=(n-t)/2,s=(i-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class oo{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=ki[this.direction]}store(t){if(t instanceof ao){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}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,n=new class{constructor(t,e,n,i,r,s,a,o){this.left=t,this.width=e,this.baseline=n,this.ascent=i,this.descent=r,this.top=n-i,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof ao?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=ki[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof no){const e=Li.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],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const n=this.directionKey,i=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof ao?(t["_"+n.x]=r,r+=t[n.width]+s,t["_"+n.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?i-t.height:(i-t.height)/2):(t[n.left]=r,r+=t[n.width]+s)}))}draw(t,e,n,i,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,n=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i.overflow)t=t&&""===i.text;else if(t){n=!0;break}}let i=0;if(!n)for(let t=this.paragraphs.length-1;t>=0;t--){const n=this.paragraphs[t];if(n.overflow){if(""===n.text)break;continue}if(n instanceof ao)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:a}=Di(s,n.character,n.ascentDescentMode),o=a||0;if(o<=this.blankWidth+i){e&&(n.ellipsis="add");break}if(o<=this.blankWidth+i+n.width){n.ellipsis="replace",n.ellipsisWidth=o,n.ellipsisOtherParagraphWidth=this.blankWidth+i;break}n.ellipsis="hide",i+=n.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,r)=>{if(e instanceof ao)return;const s=e.drawBackground(t,i,this.ascent,n,0===r,this.textAlign,this.height);s&&(a===s.fillStyle&&o===s.globalAlpha||(l=[],h.push(l),a=s.fillStyle,o=s.globalAlpha),l.push(s))})),h.forEach((e=>{if(0===e.length)return;const n=e[0],i=e[e.length-1];t.fillStyle=n.fillStyle,t.globalAlpha=n.globalAlpha,t.fillRect(n.left,n.top,i.right-n.left,i.bottom-n.top)})),this.paragraphs.forEach(((e,r)=>{if(e instanceof ao)return e.setAttributes({x:n+e._x,y:i+e._y}),void s(e,t,n+e._x,i+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const n=e&&e.stroke||Pi;if(!n)return void(t.globalAlpha=0);const{strokeOpacity:i=1,opacity:r=1}=e;t.globalAlpha=i*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=n,Ri(t,e)})(t,e.character),function(t,e,n){const i=e&&e.fill||Mi;if(!i)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=n?Ci(t,i,{AABBBounds:n}):i,Ri(t,e)}(t,e.character,a),e.draw(t,i,this.ascent,n,0===r,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let n=this.paragraphs.length-1;n>=0;n--){const i=this.paragraphs[n];if(i instanceof ao)break;const{width:r}=Di(t,i.character,i.ascentDescentMode),s=r||0;if(s<=this.blankWidth+e){i.ellipsis="add",i.ellipsisWidth=s;break}if(s<=this.blankWidth+e+i.width){i.ellipsis="replace",i.ellipsisWidth=s,i.ellipsisOtherParagraphWidth=this.blankWidth+e;break}i.ellipsis="hide",e+=i.width}let n=0;return this.paragraphs.forEach(((t,e)=>{n+=t instanceof ao?t.width:t.getWidthWithEllips(this.direction)})),n}}(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(n),this.frame.actualHeight+=n.height,this.y+=n.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 ao?"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||this.newLine)&&("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 n=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(n/t[this.directionKey.width]*t.length)||0,r=Ii(t.text,n,t.character,i,"break-word"===this.frame.wordBreak);if(0!==r){const[n,i]=function(t,e){const n=t.text.slice(0,e),i=t.text.slice(e);return[new no(n,t.newLine,t.character,t.ascentDescentMode),new no(i,!0,t.character,t.ascentDescentMode)]}(t,r);this.store(n),e?this.send():this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let lo=!1;try{lo=Intl&&"function"==typeof Intl.Segmenter}catch(t){lo=!1}const ho=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...la];let uo=class t extends pa{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Js,this.onBeforeAttributeUpdate=(t,e,n)=>{for(const n in t)if("hoverIconId"===n){if(t[n]===e[n])continue;const i=this._frameCache.icons.get(t[n]);this.updateHoverIconState(i)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:xi.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:xi.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:xi.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:xi.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:xi.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:xi.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:xi.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:xi.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Yi(this).richtext}static AllSingleCharacter(e){return e.lines?e.lines.every((e=>e.paragraphs.every((e=>!(e.text&&Bt(e.text)&&t.splitText(e.text).length>1))))):e.every((e=>e.isComposing||!(e.text&&Bt(e.text)&&t.splitText(e.text).length>1)))}static splitText(t){if(lo){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),n=[];for(const{segment:i}of e.segment(t))n.push(i);return n}return Array.from(t)}static TransformTextConfig2SingleCharacter(e){const n=[];return e.forEach((e=>{const i=t.splitText(e.text.toString());if(Bt(e.text)&&i.length>1)for(let t=0;t<i.length;t++){const r=i[t];n.push(Object.assign(Object.assign({},e),{text:r}))}else n.push(e)})),n}updateAABBBounds(t,e,n){var i,r,s,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:u=e.maxHeight,textAlign:c=e.textAlign,textBaseline:d=(null!==(r=null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)&&void 0!==r?r:"top"),editOptions:f}=t;if(o>0&&l>0)n.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:i}=t.getActualSize();let r=o||e||0,s=l||i||0;s="number"==typeof u&&s>u?u:s||0,r="number"==typeof h&&r>h?h:r||0,n.set(0,0,r,s)}f&&f.keepHeightWhileEmpty&&!n.height()&&!(null===(s=t.textConfig)||void 0===s?void 0:s.length)&&(n.y2=n.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),n.x2=n.x1+2);let p=0;switch(d){case"top":p=0;break;case"middle":p=-n.height()/2;break;case"bottom":p=-n.height()}let g=0;switch(c){case"left":g=0;break;case"center":g=-n.width()/2;break;case"right":g=-n.width()}return n.translate(g,p),Ai.graphicService.updateTempAABBBounds(n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Ai.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,Ai.graphicService.transformAABBBounds(t,n,e,!1,this),0===n.width()&&0===n.height()&&n.clear(),n}needUpdateTags(t){return super.needUpdateTags(t,ho)}needUpdateTag(t){return super.needUpdateTag(t,ho)}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 n=t.lines[e];for(let t=0;t<n.paragraphs.length;t++){const e=n.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:u,strokeOpacity:c,upgradeAttrs:d}=this.attribute,f=Object.assign({fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:c},t);return(null==d?void 0:d.lineHeight)&&(f.lineHeight=u),f}doUpdateFrameCache(e){var n;const{maxWidth:i,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:l,verticalDirection:h,textAlign:u,textBaseline:c,layoutDirection:d,singleLine:f,disableAutoWrapLine:p,editable:g,ascentDescentMode:m,upgradeAttrs:b}=this.attribute,y=b&&b.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!t.AllSingleCharacter(v)&&(v=t.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=e?e:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const n=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(n)x.push(n);else{const t=new ao(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(Mt(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const n=e.text.split("\n");for(let i=0;i<n.length;i++)if(0===i)x.push(new no(n[i],!1,e,m));else if(n[i]||t===_.length-1)x.push(new no(n[i],!0,e,m));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new no(n[i],!0,e,m))}}else e.text&&x.push(new no(e.text,!1,e,m))}const S="number"==typeof i&&Number.isFinite(i)&&i>0,A="number"==typeof r&&Number.isFinite(r)&&r>0,w="number"==typeof s&&Number.isFinite(s)&&s>0&&(!S||s<=i),T="number"==typeof a&&Number.isFinite(a)&&a>0&&(!A||a<=r),B=new to(0,0,(w?s:S?i:0)||0,(T?a:A?r:0)||0,o,l,h,u,c,d||"horizontal",!w&&S,!T&&A,f||!1,null===(n=this._frameCache)||void 0===n?void 0:n.icons),C=new oo(B);if(C.newLine=y,p){let t=0,e=!1;for(let n=0;n<x.length;n++){const i=x[n];e?(i.overflow=!0,i.left=1/0,i.top=1/0,!i.newLine&&B.lines[B.lines.length-1].paragraphs.push(i)):C.deal(i,!0),B.lines.length!==t&&(t=B.lines.length,C.lineBuffer.length=0,i.overflow=!0,i.left=1e3,i.top=1e3,B.lines[B.lines.length-1].paragraphs.push(i),e=!0),i.newLine&&(e=!1,C.lineWidth=0),C.send()}}else for(let t=0;t<x.length;t++)C.deal(x[t]);if(C.send(),!("horizontal"===B.layoutDirection?w:T)){const t=B.getActualSizeWidthEllipsis();let e="horizontal"===B.layoutDirection?t.width:t.height;("horizontal"===B.layoutDirection?S:A)&&(e=Math.min(e,"horizontal"===B.layoutDirection?i:r)),B.lines.forEach((function(t){t.calcOffset(e,!1)}))}y&&B.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=B}clone(){return new t(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((n=>{n.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,n,i,r,s;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(n=this.stage)||void 0===n||n.setCursor(t.attribute.cursor),null===(i=this.stage)||void 0===i||i.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:n,f:i}=this.globalTransMatrix;let r;return e.icons.forEach(((e,s)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-n,y:t.y-i})&&(r=e,r.globalX=(null!==(a=r.attribute.x)&&void 0!==a?a:0)+n+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+i+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function co(t){return new uo(t)}uo.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},fa);const fo=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...la];let po=class t extends pa{constructor(t){super(t),this.type="arc",this.numberType=Ks}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:n,innerRadius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:n=t.innerPadding,outerPadding:i=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=i,s-=n,0===e||"0%"===e)return 0;const a=Math.abs(r-s),o=t=>Math.min(Mt(t,!0)?t:a*parseFloat(t)/100,a/2);if(Ct(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:i=t.cap}=this.attribute,r=n-e>=0?1:-1,s=n-e;if(e=fe(e),n=e+s,i&&ee(s)<te-qt){let s=1,a=1;i.length&&(s=Number(i[0]),a=Number(i[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:u=t.innerPadding}=this.attribute;o+=h,l-=u;const c=Math.abs(o-l)/2,d=c/o;if(c>qt&&o>qt)return{startAngle:e-r*d*s,endAngle:n+r*d*a,sc:r*d*s,ec:r*d*a}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=this.getGraphicTheme(),{innerPadding:i=n.innerPadding,outerPadding:r=n.outerPadding,padAngle:s=n.padAngle}=this.attribute;let{outerRadius:a=n.outerRadius,innerRadius:o=n.innerRadius}=this.attribute;a+=r,o-=i;const{padRadius:l=oe(a*a+o*o)}=this.attribute,h=ee(e-t);let u=t,c=e,d=t,f=e;const p=s/2;let g=h,m=h;if(p>qt&&l>qt){const n=e>t?1:-1;let i=he(Number(l)/o*ae(p)),r=he(Number(l)/a*ae(p));return(g-=2*i)>qt?(i*=n,d+=i,f-=i):(g=0,d=f=(t+e)/2),(m-=2*r)>qt?(r*=n,u+=r,c-=r):(m=0,u=c=(t+e)/2),{outerStartAngle:u,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}return{outerStartAngle:u,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}getGraphicTheme(){return Yi(this).arc}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateArcAABBBoundsImprecise(t,e,n):this.updateArcAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=Ai.graphicService.updateTempAABBBounds(n);Wa(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.setWidthHeightWithoutTransform(n);const{lineJoin:a=e.lineJoin}=t;return Ai.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateArcAABBBoundsImprecise(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;return i+=s,r-=a,i<r&&(i=r),n.set(-i,-i,i,i),n}updateArcAABBBoundsAccurate(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(i+=s,r-=a,i<r){const t=i;i=r,r=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return i<=qt?n.set(0,0,0,0):Math.abs(o-l)>te-qt?n.set(-i,-i,i,i):(gr(l,o,i,n),gr(l,o,r,n)),n}needUpdateTags(t){return super.needUpdateTags(t,fo)}needUpdateTag(t){return super.needUpdateTag(t,fo)}toCustomPath(){var t,e,n,i;const r=this.attribute,{startAngle:s,endAngle:a}=this.getParsedAngle();let o=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),l=(null!==(n=r.outerRadius)&&void 0!==n?n:0)-(null!==(i=r.outerPadding)&&void 0!==i?i:0);const h=ee(a-s),u=a>s;if(l<o){const t=l;l=o,o=t}const c=new Zn;if(l<=qt)c.moveTo(0,0);else if(h>=te-qt)c.moveTo(0+l*ie(s),0+l*ae(s)),c.arc(0,0,l,s,a,!u),o>qt&&(c.moveTo(0+o*ie(a),0+o*ae(a)),c.arc(0,0,o,a,s,u));else{const t=l*ie(s),e=l*ae(s),n=o*ie(a),i=o*ae(a);c.moveTo(0+t,0+e),c.arc(0,0,l,s,a,!u),c.lineTo(0+n,0+i),c.arc(0,0,o,a,s,u),c.closePath()}return c}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};po.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},fa);const go=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const n=this.store.get(t);return n?n(e):null}};let mo;function bo(t){return mo||(mo=go.CreateGraphic("text",{})),mo.initAttributes(t),mo.AABBBounds}var yo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},vo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xo=function(t,e){return function(n,i){e(n,i,t)}};class _o{constructor(){this.time=dn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){var f;const{background:p,backgroundOpacity:g=(null!==(f=t.attribute.fillOpacity)&&void 0!==f?f:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:b=l.backgroundMode,backgroundFit:y=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:S=l.backgroundOffsetY,backgroundClip:A=l.backgroundClip}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=Yi(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}A&&e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,this.doDrawImage(e,r.data,s,{backgroundMode:b,backgroundFit:y,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:S}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,n,i){const{backgroundMode:r,backgroundFit:s,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=i,u=n.width(),c=n.height();let d=u,f=c;if("no-repeat"===r)if(s)if(a){const i=Math.max(u/e.width,c/e.height);t.drawImage(e,n.x1+l,n.y1+h,e.width*i*o,e.height*i*o)}else t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{const i=e.width*o,r=e.height*o;t.drawImage(e,n.x1+l,n.y1+h,i,r)}else{if(s&&"repeat"!==r&&(e.width||e.height)){const n=e.width,i=e.height;"repeat-x"===r?(d=n*(c/i),f=c):"repeat-y"===r&&(f=i*(u/n),d=u);const s=t.dpr,a=Fi.allocate({width:d,height:f,dpr:s}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,f),o.drawImage(e,0,0,d,f),e=a.nativeCanvas),Fi.free(a)}const i=t.dpr,a=t.createPattern(e,r);a.setTransform&&a.setTransform(new DOMMatrix([1/i,0,0,1/i,0,0])),t.fillStyle=a,t.translate(n.x1,n.y1),t.fillRect(0,0,u,c),t.translate(-n.x1,-n.y1)}}}const So=new _o;let Ao=class{constructor(t){this.subRenderContribitions=t,this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,a,o,l,h,u,c,d)}))}};Ao=yo([K(),xo(0,X(ct)),xo(0,q(Ba)),vo("design:paramtypes",[Object])],Ao);const wo=new class{constructor(){this.time=dn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){var f,p;const{clipConfig:g}=t.attribute;if(!g)return;const m=t.getClipPath();if(!m)return;const b=!(u||c),y=t.AABBBounds,v=null!==(f=t.attribute.width)&&void 0!==f?f:y.width(),x=null!==(p=t.attribute.height)&&void 0!==p?p:y.height();b&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],n+v/2,i+x/2,0)&&e.closePath(),u&&u(e,t.attribute,l,!0),b&&e.clip()}};const To=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){const{clipConfig:f}=t.attribute;f&&t.getClipPath()&&(u||c||e.restore())}};const Bo=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,a=i.dpr,o=Fi.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(s,l);const h=i.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Fi.free(o),h}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,te),e.fill()}))}createDiamondPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{const r=t/2,s=r;i.fillStyle=n,i.moveTo(r,s-e),i.lineTo(e+r,s),i.lineTo(r,s+e),i.lineTo(r-e,s),i.closePath(),i.fill()}))}createRectPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(s,0,2*i,t)}))}createHorizontalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(0,s,t,2*i)}))}createBiasLRLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);const r=t/2,s=-r;i.moveTo(r,s),i.lineTo(r+t,s+t),i.moveTo(-r,-s),i.lineTo(-r+t,-s+t),i.stroke()}))}createBiasRLLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);const r=t/2,s=r;i.moveTo(t+r,s),i.lineTo(r,s+t),i.moveTo(t-r,-s),i.lineTo(-r,-s+t),i.stroke()}))}createGridPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,t,t),i.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=l.texture,textureColor:p=l.textureColor,textureSize:g=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;f&&this.drawTexture(f,t,e,n,i,l,p,g,m)}drawTexture(t,e,n,i,r,s,a,o,l){var h;const{textureRatio:u=s.textureRatio,textureOptions:c=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,n);break;case"diamond":d=this.createDiamondPattern(o,l,a,n);break;case"rect":d=this.createRectPattern(o,l,a,n);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,n);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,n);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,n);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,n);break;case"grid":d=this.createGridPattern(o,l,a,n)}if(c&&c.dynamicTexture){const{gridConfig:d={},useNewCanvas:f}=c,p=e.AABBBounds;i=p.x1,r=p.y1;const g=n;let m;if(f){m=Fi.allocate({width:p.width(),height:p.height(),dpr:n.dpr});const t=m.getContext("2d");t.clearRect(0,0,p.width(),p.height()),i=0,r=0,n=t}if(g.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:n=0}=e.parent.attribute;g.setTransformFromMatrix(e.parent.globalTransMatrix),g.translate(t,n,!0)}g.setCommonStyle(e,e.attribute,i,r,s),g.clip();const b=p.width(),y=p.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(b/x),S=d.rows?d.rows:Math.ceil(y/x),A=d.gutterColumn?d.gutterColumn:2*v,w=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=qa({}));const T=d.columns?b/d.columns:x,B=d.rows?y/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[T-A,B-w],symbolType:t});const C=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<S;t++)for(let s=0;s<_;s++){const o=i+x/2+s*x,l=r+x/2+t*x;null===(h=c.beforeDynamicTexture)||void 0===h||h.call(c,n,t,s,S,_,u,e,p.width(),p.height()),n.beginPath(),!1===C.draw(n,Math.min(T-A,B-w),o,l,0)&&n.closePath(),n.fillStyle=a,c.dynamicTexture(n,t,s,S,_,u,e,p.width(),p.height())}f&&(g.globalAlpha=1,g.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,p.x1,p.y1,p.width()*g.dpr,p.height()*g.dpr)),g.restore()}else if(d)n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,s),n.fillStyle=d,n.fill(),n.highPerformanceRestore();else if("wave"===t){n.save(),n.setCommonStyle(e,e.attribute,i,r,s),n.clip();const t=e.AABBBounds;(function(t,e,n,i,r,s,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:u,phi:c=0}=r;let{amplitude:d=10}=r;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const f=i*(1-l),p=n,g=Math.max(Math.round(p/70),2);t.beginPath(),t.moveTo(0+s,i+a),t.lineTo(0+s,f+a);const m=p/h*e,b=p/Math.PI/(2*h);for(let e=0;e<p;e+=g){const n=d*Math.sin((e+m+c)/b+c);t.lineTo(e+s,f+n+a)}t.lineTo(p+s,i+a),t.closePath(),t.fillStyle=o,isFinite(u)&&(t.globalAlpha=u),t.fill()})(n,u,t.width(),t.height(),Object.assign(Object.assign({},c||{}),{fill:a}),i+t.x1-i,r+t.y1-r),n.restore()}}},Co=Qt/2;function ko(t,e,n,i,r,s){let a,o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],l=arguments.length>7?arguments[7]:void 0;if(Array.isArray(o)&&(l=o,o=!0),i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),Mt(s,!0))a=[s=ee(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,n;switch(t.length){case 0:a=[0,0,0,0];break;case 1:e=ee(t[0]),a=[e,e,e,e];break;case 2:case 3:e=ee(t[0]),n=ee(t[1]),a=[e,n,e,n];break;default:a=t,a[0]=ee(a[0]),a[1]=ee(a[1]),a[2]=ee(a[2]),a[3]=ee(a[3])}}else a=[0,0,0,0];if(i<0||a[0]+a[1]+a[2]+a[3]<1e-12)return t.rect(e,n,i,r);const[h,u,c,d]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],f=Math.min(i/2,r/2),p=[Math.min(f,a[0]),Math.min(f,a[1]),Math.min(f,a[2]),Math.min(f,a[3])],g=[h[0]+p[0],h[1]],m=[h[0],h[1]+p[0]],b=[u[0]-p[1],u[1]],y=[u[0],u[1]+p[1]],v=[c[0]-p[2],c[1]],x=[c[0],c[1]-p[2]],_=[d[0]+p[3],d[1]],S=[d[0],d[1]-p[3]];if(t.moveTo(g[0],g[1]),o){if(l&&l[0]?l[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),!Gt(b,y)){l&&l[0]&&t.moveTo(b[0],b[1]);const e=b[0],n=b[1]+p[1];t.arc(e,n,p[1],-Co,0,!1)}if(l&&l[1]?l[1](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!Gt(v,x)){const e=x[0]-p[2],n=x[1];l&&l[1]&&t.moveTo(x[0],x[1]),t.arc(e,n,p[2],0,Co,!1)}if(l&&l[2]?l[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!Gt(_,S)){const e=_[0],n=_[1]-p[3];l&&l[2]&&t.moveTo(_[0],_[1]),t.arc(e,n,p[3],Co,Qt,!1)}if(l&&l[3]?l[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!Gt(g,m)){const e=g[0],n=g[1]+p[0];l&&l[3]&&t.moveTo(m[0],m[1]),t.arc(e,n,p[0],Qt,Qt+Co,!1)}}else l&&l[0]?l[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),l&&l[1]?l[1](b[0],b[1],v[0],v[1]):t.lineTo(v[0],v[1]),l&&l[2]?l[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),l&&l[2]?l[2](_[0],_[1],g[0],g[1]):t.lineTo(g[0],g[1]);return!l&&t.closePath(),t}var Mo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};class Po{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{cornerRadius:m=l.cornerRadius,cornerType:b=l.cornerType,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,x1:A,y1:w,keepStrokeScale:T=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:A-n)||0,C=(null!=C?C:w-i)||0;const k=(r,s)=>{const a=!(!r||!r.stroke),o="outerBorder"===s?-1:1,{distance:h=l[s].distance}=r,u=T?h:Bi(e,h,e.dpr),d=n+o*u,f=i+o*u,p=2*u;if(0===m||Ct(m)&&m.every((t=>0===t))?(e.beginPath(),e.rect(d,f,B-o*p,C-o*p)):(e.beginPath(),ko(e,d,f,B-o*p,C-o*p,m,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};p&&k(d,"outerBorder"),g&&k(f,"innerBorder")}}let Eo=class{constructor(){this.time=dn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};Eo=Mo([K()],Eo);let Oo=class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){const{x1:d,y1:f,x:p=l.x,y:g=l.y,stroke:m=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:y=l.cornerType}=t.attribute;let{width:v,height:x}=t.attribute;if(v=(null!=v?v:d-p)||0,x=(null!=x?x:f-g)||0,Array.isArray(m)&&m.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),!(0===b||Ct(b)&&b.every((t=>0===t)))){let r,s=0;return ko(e,n,i,v,x,b,"bevel"!==y,new Array(4).fill(0).map(((a,o)=>(a,h,u,c)=>{m[o]&&(s===o-1&&m[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:m[o]}),n,i,l),e.beginPath(),e.moveTo(a,h),r=m[o]),s=o,e.lineTo(u,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,i),m[0]?e.lineTo(n+v,i):e.moveTo(n+v,i),m[1]?e.lineTo(n+v,i+x):e.moveTo(n+v,i+x),m[2]?e.lineTo(n,i+x):e.moveTo(n,i+x),m[3]){const t=m[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};Oo=Mo([K()],Oo);const Lo=new Po,Ro=Bo,Io=So;const No=new class extends Po{constructor(){super(...arguments),this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){return super.drawShape(t,e,n,i,r,s,a,o,l,h,u,c)}},Do=So;const Uo=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){const d=t.getParsedPath();if(!d)return;const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{size:b=l.size,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,keepStrokeScale:A=l.keepStrokeScale}=t.attribute,w=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=l[s].distance}=r,h=A?o:Bi(e,o,e.dpr),u="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,b,n,i,u*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};g&&w(f,"outerBorder"),m&&w(p,"innerBorder")}},zo=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){const{clipRange:f=l.clipRange,x:p=l.x,y:g=l.y,z:m=l.z,size:b=l.size,scaleX:y=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&f<1&&f>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,b,n,i,f,m,((r,s)=>{var a,h,u,d;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(a=s.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=s.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(u=s.stroke)&&void 0!==u?u:t.attribute.stroke,e.lineWidth=null!==(d=s.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,s=e}s.stroke&&(c?c(e,t.attribute,l):o&&(e.setStrokeStyle(t,s,(p-n)/y,(g-i)/v,l),e.stroke()))})),s&&!x.isSvg&&(c?c(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(p-n)/y,(g-i)/v,l),e.stroke())))}},Wo=Bo,Fo=So,jo={x:0,y:0,z:0,lastModelMatrix:null};class Ho{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(wo),this.builtinContributions.push(To),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===dn.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===dn.afterFillStroke)))}beforeRenderStep(t,e,n,i,r,s,a,o,l,h,u,c,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d)}))}afterRenderStep(t,e,n,i,r,s,a,o,l,h,u,c,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d)}))}drawPathProxy(t,e,n,i,r,s,a,o){if(!t.pathProxy)return!1;const l=Yi(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:u=l.stroke,opacity:c=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:p=l.strokeOpacity,visible:g=l.visible,x:m=l.x,y:b=l.y}=t.attribute,y=xa(c,d,h),v=_a(c,p),x=ya(h),_=va(u,f);if(!g)return!0;if(!x&&!_)return!0;if(!(y||v||a||o))return!0;e.beginPath();return mn(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,n-m,i-b,l),e.stroke())),x&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,n-m,i-b,l),e.fill())),this.afterRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),!0}valid(t,e,n,i){const{fill:r=e.fill,background:s,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:c=e.visible}=t.attribute,d=xa(o,l,r),f=_a(o,u),p=ya(r,s),g=va(a,h);return!(!t.valid||!c)&&!(!p&&!g)&&!!(d||f||n||i||s)&&{fVisible:d,sVisible:f,doFill:p,doStroke:g}}transform(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:r=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:u}=t.attribute,c=n.modelMatrix,d=n.camera;jo.x=r,jo.y=s,jo.z=a,jo.lastModelMatrix=c;const f=d&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t)),p=f?t.transMatrix.onlyTranslate()&&!u:1===o&&1===l&&0===h&&!u;if(f){const i=Ra.allocate(),r=Ra.allocate();Ua(r,t,e),Ea(i,c||i,r),jo.x=0,jo.y=0,jo.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),Ra.free(r)}if(p&&!c){const i=t.getOffsetXY(e);jo.x+=i.x,jo.y+=i.y,jo.z=a,n.setTransformForCurrent()}else if(f)jo.x=0,jo.y=0,jo.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(d&&n.project){const i=t.getOffsetXY(e);jo.x+=i.x,jo.y+=i.y,this.transformWithoutTranslate(n,jo.x,jo.y,jo.z,o,l,h)}else n.transformFromMatrix(t.transMatrix,!0),jo.x=0,jo.y=0,jo.z=0;return jo}transformUseContext2d(t,e,n,i){const r=i.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=i.project(0,0,n),o=i.project(r,0,n),l=i.project(r,s,n),h={x:0,y:0},u={x:r,y:0},c={x:r,y:s};i.camera=null;const d=1/(h.x*(c.y-u.y)-u.x*c.y+c.x*u.y+(u.x-c.x)*h.y),f=-(h.y*(l.x-o.x)-u.y*l.x+c.y*o.x+(u.y-c.y)*a.x)*d,p=(u.y*l.y+h.y*(o.y-l.y)-c.y*o.y+(c.y-u.y)*a.y)*d,g=(h.x*(l.x-o.x)-u.x*l.x+c.x*o.x+(u.x-c.x)*a.x)*d,m=-(u.x*l.y+h.x*(o.y-l.y)-c.x*o.y+(c.x-u.x)*a.y)*d,b=(h.x*(c.y*o.x-u.y*l.x)+h.y*(u.x*l.x-c.x*o.x)+(c.x*u.y-u.x*c.y)*a.x)*d,y=(h.x*(c.y*o.y-u.y*l.y)+h.y*(u.x*l.y-c.x*o.y)+(c.x*u.y-u.x*c.y)*a.y)*d;i.setTransform(f,p,g,m,b,y,!0)}}restoreTransformUseContext2d(t,e,n,i){this.camera&&(i.camera=this.camera)}transformWithoutTranslate(t,e,n,i,r,s,a){const o=t.project(e,n,i);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,n,i,r){const{context:s}=i;if(!s)return;const{renderable:a}=t.attribute;if(!1===a)return;s.highPerformanceSave();const o=this.transform(t,e,s,n),{x:l,y:h,z:u,lastModelMatrix:c}=o;this.z=u,this.drawPathProxy(t,s,l,h,i,r)||(this.drawShape(t,s,l,h,i,r),this.z=0,s.modelMatrix!==c&&Ra.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}var Go=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},$o=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vo=function(t,e){return function(n,i){e(n,i,t)}};let Xo=class extends Ho{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Zs,this.builtinContributions=[Lo,Io,Ro],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:Yi(t,null==s?void 0:s.theme).rect,{fill:u=h.fill,background:c,stroke:d=h.stroke,cornerRadius:f=h.cornerRadius,cornerType:p=h.cornerType,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible,x1:x,y1:_,x:S=h.x,y:A=h.y,fillStrokeOrder:w=h.fillStrokeOrder}=t.attribute;let{width:T,height:B}=t.attribute;T=(null!=T?T:x-S)||0,B=(null!=B?B:_-A)||0;const C=function(t,e,n,i,r){return r&&t*e>0&&0!==n&&0!==i}(g,m,T,B,u),k=function(t,e,n,i){return t*e>0&&0!==n&&0!==i}(g,y,T,B),M=ya(u,c),P=va(d,b);if(!t.valid||!v)return;if(!M&&!P)return;if(!(C||k||a||o||c))return;0===f||Ct(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(n,i,T,B)):(e.beginPath(),ko(e,n,i,T,B,f,"bevel"!==p));const E={doFill:M,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,M,P,C,k,h,r,a,o,E);const O=()=>{E.doFill&&(a?a(e,t.attribute,h):C&&(e.setCommonStyle(t,t.attribute,S-n,A-i,h),e.fill()))},L=()=>{E.doStroke&&(o?o(e,t.attribute,h):k&&(e.setStrokeStyle(t,t.attribute,S-n,A-i,h),e.stroke()))};w?(L(),O()):(O(),L()),this.afterRenderStep(t,e,n,i,M,P,C,k,h,r,a,o)}draw(t,e,n,i){const r=Yi(t,null==i?void 0:i.theme).rect;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}};Xo=Go([K(),Vo(0,X(ct)),Vo(0,q(Aa)),$o("design:paramtypes",[Object])],Xo);var Yo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Ko=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qo=function(t,e){return function(n,i){e(n,i,t)}};let Qo=class extends Ho{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=ta,this.builtinContributions=[Uo,Fo,Wo,zo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const h=Yi(t,null==s?void 0:s.theme).symbol,{size:u=h.size,x:c=h.x,y:d=h.y,scaleX:f=h.scaleX,scaleY:p=h.scaleY,fillStrokeOrder:g=h.fillStrokeOrder,clipRange:m=h.clipRange}=t.attribute,b=this.valid(t,h,a,o);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:A=h.keepDirIn3d}=t.attribute,w=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();let T=n,B=i,C=w;const k=e.camera;if(A&&k&&e.project){const t=e.project(n,i,w);e.camera=null,Ct(u)&&(u[0],u[1]),T=t.x,B=t.y,C=void 0}!1===S.draw(e,u,T,B,C,((r,s)=>{var l,u,b,y;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(u=s.opacity)&&void 0!==u?u:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(b=s.stroke)&&void 0!==b?b:t.attribute.stroke,e.lineWidth=null!==(y=s.lineWidth)&&void 0!==y?y:t.attribute.lineWidth,s=e}const x=()=>{s.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,s,c-n,d-i,h),e.fill()))},_=()=>{s.stroke&&(o?o(e,t.attribute,h):v&&m>=1&&(e.setStrokeStyle(t,s,(c-n)/f,(d-i)/p,h),e.stroke()))};g?(_(),x()):(x(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,x,_,y,v,h,r,a,o);const M=()=>{x&&!S.isSvg&&(a?a(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,c-n,d-i,h),e.fill()))},P=()=>{_&&!S.isSvg&&(o?o(e,t.attribute,h):v&&m>=1&&(e.setStrokeStyle(t,t.attribute,(c-n)/f,(d-i)/p,h),e.stroke()))};g?(P(),M()):(M(),P()),this.afterRenderStep(t,e,n,i,x,_,y,v,h,r,a,o)}draw(t,e,n,i){const r=Yi(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}};Qo=Yo([K(),qo(0,X(ct)),qo(0,q(wa)),Ko("design:paramtypes",[Object])],Qo);const Zo=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new _e)}allocate(t,e,n,i){if(!this.pools.length)return(new _e).setValue(t,e,n,i);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=i,r}allocateByObj(t){if(!this.pools.length)return new _e(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 Jo=new class extends _o{constructor(){super(...arguments),this.time=dn.beforeFillStroke}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){var d,f,p,g,m,b,y,v,x,_;const{backgroundMode:S=l.backgroundMode,backgroundFit:A=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let T,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let k;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const M=At(B)&&B.background,P=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,n=(null!==(d=B.x)&&void 0!==d?d:e.x1)+(null!==(f=B.dx)&&void 0!==f?f:0),i=(null!==(p=B.y)&&void 0!==p?p:e.y1)+(null!==(g=B.dy)&&void 0!==g?g:0),r=null!==(m=B.width)&&void 0!==m?m:e.width(),s=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Zo.allocate(n,i,n+r,i+s),B=B.background,!P){const t=k.width(),e=k.height();k.set((null!==(y=B.x)&&void 0!==y?y:0)+(null!==(v=B.dx)&&void 0!==v?v:0),(null!==(x=B.y)&&void 0!==x?x:0)+(null!==(_=B.dy)&&void 0!==_?_:0),t,e)}}else k=t.AABBBounds,P||(k=bo(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(B);if("success"!==r.state||!r.data)return void C();e.highPerformanceSave(),P&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,i,l),this.doDrawImage(e,r.data,k,{backgroundMode:S,backgroundFit:A,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=B,r?(ko(e,k.x1,k.y1,k.width(),k.height(),r,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}M&&Zo.free(k),C()}};var tl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},el=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nl=function(t,e){return function(n,i){e(n,i,t)}};let il=class extends Ho{constructor(t){super(),this.textRenderContribitions=t,this.numberType=ea,this.builtinContributions=[Jo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l,h,u;const c=Yi(t,null==s?void 0:s.theme).text,{text:d,underline:f=c.underline,lineThrough:p=c.lineThrough,keepDirIn3d:g=c.keepDirIn3d,direction:m=c.direction,fontSize:b=c.fontSize,verticalMode:y=c.verticalMode,x:v=c.x,y:x=c.y}=t.attribute,_=null!==(l=mr(t.attribute.lineHeight,b))&&void 0!==l?l:b,S=this.valid(t,c,a,o);if(!S)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:B}=S,C=!g,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,n,i,T,B,A,w,c,r,a,o),C&&this.transformUseContext2d(t,c,k,e);const M=(r,s,l,h)=>{let u=n+s;const d=i+l;if(h){e.highPerformanceSave(),u+=b;const t=La.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),La.free(t)}B&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,c),e.strokeText(r,u,d,k))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,c),e.fillText(r,u,d,k))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,k),"horizontal"===m){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;B&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,c),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+l+i,k)})))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,c),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,k),this.drawUnderLine(f,p,t,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,r.descent,(r.descent-r.ascent)/2,k,c,e,{width:r.width})}))))}else{let{textAlign:n=c.textAlign,textBaseline:i=c.textBaseline}=t.attribute;if(!y){const e=n;n=null!==(h=t.getBaselineMapAlign()[i])&&void 0!==h?h:"left",i=null!==(u=t.getAlignMapBaseline()[e])&&void 0!==u?u:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:s}=r;e.textAlign="left",e.textBaseline="top";const a=_*s.length;let o=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=re(e,o)}));let l=0,d=0;"bottom"===i?d=-a:"middle"===i&&(d=-a/2),"center"===n?l-=o/2:"right"===n&&(l-=o),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),r=o-i;let s=l;"center"===n?s+=r/2:"right"===n&&(s+=r),t.forEach((t=>{const{text:n,width:i,direction:r}=t;M(n,a-(e+1)*_+d,s,r),s+=i}))}))}C&&this.restoreTransformUseContext2d(t,c,k,e),this.afterRenderStep(t,e,n,i,T,B,A,w,c,r,a,o)}draw(t,e,n,i){const r=Yi(t,null==i?void 0:i.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,a=!s;this._draw(t,r,a,n,i)}drawUnderLine(t,e,n,i,r,s,a,o,l,h,u){if(e+t<=0)return;const{textAlign:c=l.textAlign,fill:d=l.fill,opacity:f=l.opacity,underlineOffset:p=l.underlineOffset,underlineDash:g=l.underlineDash,fillOpacity:m=l.fillOpacity}=n.attribute,b=!_t(u),y=b?u.width:n.clipedWidth,v=b?0:Ca(c,y),x={lineWidth:0,stroke:d,opacity:f,strokeOpacity:m};if(t){x.lineWidth=t,h.setStrokeStyle(n,x,i,r,l),g&&h.setLineDash(g),h.beginPath();const e=r+s+p;h.moveTo(i+v,e,o),h.lineTo(i+v+y,e,o),h.stroke()}if(e){x.lineWidth=e,h.setStrokeStyle(n,x,i,r,l),h.beginPath();const t=r+a;h.moveTo(i+v,t,o),h.lineTo(i+v+y,t,o),h.stroke()}}};il=tl([K(),nl(0,X(ct)),nl(0,q(Ta)),el("design:paramtypes",[Object])],il);var rl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},sl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},al=function(t,e){return function(n,i){e(n,i,t)}};const ol=["","repeat-x","repeat-y","repeat"];let ll=class extends Ho{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Qs,this.builtinContributions=[No,Do],this.init(t)}drawShape(t,e,n,i,r,s,a,o){const l=Yi(t).image,{repeatX:h=l.repeatX,repeatY:u=l.repeatY,x:c=l.x,y:d=l.y,cornerRadius:f=l.cornerRadius,fillStrokeOrder:p=l.fillStrokeOrder,cornerType:g=l.cornerType,image:m}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b;if(!m||!t.resources)return;const S=t.resources.get(m);if("success"!==S.state)return;const A=t.width,w=t.height;e.beginPath();let T=!1;0===f||Ct(f)&&f.every((t=>0===t))?e.rect(n,i,A,w):(ko(e,n,i,A,w,f,"bevel"!==g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(x)if(a)a(e,t.attribute,l);else if(y){e.setCommonStyle(t,t.attribute,n,i,l);let r=0;if("repeat"===h&&(r|=1),"repeat"===u&&(r|=2),r){const t=e.createPattern(S.data,ol[r]);e.fillStyle=t,e.translate(n,i,!0),e.fillRect(0,0,A,w),e.translate(-n,-i,!0)}else e.drawImage(S.data,n,i,A,w)}},C=()=>{_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,c-n,d-i,l),e.stroke()))};p?(C(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),B(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),B(),T&&e.restore(),C()),this.afterRenderStep(t,e,n,i,x,!1,y,!1,l,r,a)}draw(t,e,n){const{image:i}=t.attribute;if(!i||!t.resources)return;const r=t.resources.get(i);if("loading"===r.state&&Bt(i))return void Tr.improveImageLoading(i);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=Yi(t).image;this._draw(t,a,!1,n)}};ll=rl([K(),al(0,X(ct)),al(0,q(Sa)),sl("design:paramtypes",[Object])],ll);const hl=Symbol.for("GraphicRender"),ul=Symbol.for("RectRender"),cl=Symbol.for("SymbolRender"),dl=Symbol.for("TextRender"),fl=Symbol.for("RichTextRender"),pl=Symbol.for("ImageRender");let gl;function ml(){!function(){if(null==gl)try{const t=document.createElement("canvas"),e=t.getContext("2d");gl=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),gl&&(gl=!!document.createElement)}catch(t){gl=!1}}();const t=Ai.global&&Ai.global.env;return t?"browser"===t:gl}var bl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},yl=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};let vl=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new _e}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}loadFont(t,e,n){return yl(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}isMacOS(){return!1}copyToClipBoard(t){return Promise.resolve(null)}};vl=bl([K()],vl);let xl=!1;const _l=new U((t=>{xl||(xl=!0,t(Xo).toSelf().inSingletonScope(),t(ul).to(Xo).inSingletonScope(),t(hl).toService(ul),t(Oo).toSelf(),t(Eo).toSelf(),t(Aa).toService(Oo),t(Aa).toService(Eo),t(Aa).toService(Ao),ft(t,Aa))}));let Sl=!1;const Al=new U((t=>{Sl||(Sl=!0,t(Qo).toSelf().inSingletonScope(),t(cl).to(Qo).inSingletonScope(),t(hl).toService(cl),t(wa).toService(Ao),ft(t,wa))}));let wl=!1;const Tl=new U((t=>{wl||(wl=!0,t(dl).to(il).inSingletonScope(),t(hl).toService(dl),t(Ta).toService(Ao),ft(t,Ta))}));var Bl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Cl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let kl=class extends Ho{constructor(){super(),this.numberType=Js,this.builtinContributions=[Jo],this.init()}drawShape(t,e,n,i,r){const s=Yi(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:l=s.fillOpacity,visible:h=s.visible}=t.attribute;if(!t.valid||!h)return;const u=xa(o,l,!0),c=xa(o,a,!0);u&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(n,i),this.beforeRenderStep(t,e,n,i,u,c,u,c,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,u,c,u,c,s,r))}drawIcon(t,e,n,i,r){var s;const a=Yi(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:u,backgroundFill:c=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:f=a.backgroundStroke,backgroundStrokeOpacity:p=a.backgroundStrokeOpacity,backgroundRadius:g=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:b=o,backgroundHeight:y=l}=t.attribute;if(m&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){const t=(b-o)/2,r=(y-l)/2;0===g?(e.beginPath(),e.rect(n-t,i-r,b,y)):(e.beginPath(),ko(e,n-t,i-r,b,y,g,!0)),c&&(e.globalAlpha=d,e.fillStyle=c,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const v=u&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(u));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,n,i,o,l))}draw(t,e,n){const i=Yi(t).richtext;this._draw(t,i,!1,n)}};kl=Bl([K(),Cl("design:paramtypes",[])],kl);let Ml=!1;const Pl=new U((t=>{Ml||(Ml=!0,t(fl).to(kl).inSingletonScope(),t(hl).toService(fl))}));let El=!1;const Ol=new U((t=>{El||(El=!0,t(pl).to(ll).inSingletonScope(),t(hl).toService(pl),t(Sa).toService(Ao),ft(t,Sa))}));class Ll{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=D.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{const e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Ai.graphicService.hooks.onRemove.unTap(this.key),Ai.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?Ai.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Ai.global.createDom(Object.assign({tagName:"div",parent:i},n)),nativeContainer:i}}parseDefaultStyleFromGraphic(t){return function(t){const e={},n=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((n=>{t[n]&&(e[Ne(n)]=t[n])})),["fontSize","lineHeight"].forEach((i=>{const r=Ne(i);_t(t[i])||(e[r]=n(t[i]))})),St(t.maxLineWidth)&&(e["max-width"]=n(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&Bt(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:Yi(t).text)}getTransformOfText(t){const e=Yi(t).text,{textAlign:n=e.textAlign,textBaseline:i=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:a,scaleY:o}=r,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:n,transform:`translate(${l[n]},${l[i]}) rotate(${s}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${h[n]} ${h[i]}`}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&n.addEventListener("wheel",this.onWheel)}))),n.style.position||(n.style.position="absolute",i.style.position="relative");let l=0,h=0;const u=t.globalAABBBounds;let c=r.anchorType;if(_t(c)&&(c="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===c&&(c="top-left"),"position"===c||u.empty()){const e=t.globalTransMatrix;l=e.e,h=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,h=(r+s)/2,u=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,c=-.5;break;case"top-left":u=-.5,c=-.5;break;case"bottom-right":u=.5,c=.5;break;case"bottom-left":u=-.5,c=.5}return l+=u*a,h+=c*o,{x:l,y:h}})(u,c);l=t.x,h=t.y}const d=Ai.global.getElementTopLeft(i,!1),f=e.window.getTopLeft(!1),p=e.viewBox,g=l+f.left-d.left+p.x1,m=h+f.top-d.top+p.y1;if(o.left=`${g}px`,o.top=`${m}px`,"text"===t.type&&"position"===c&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),xt(r.style)){const e=r.style({top:m,left:g,width:u.width(),height:u.height()},t,n);e&&(o=Object.assign(Object.assign({},o),e))}else At(r.style)?o=Object.assign(Object.assign({},o),r.style):Bt(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const n=e.split(":");if(2===n.length){const e=n[0].trim(),i=n[1].trim();e&&i&&(t[e]=i)}}})),t}(r.style)));Ai.global.updateDom(n,{width:r.width,height:r.height,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===Ai.global.env&&(t.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:oi.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:oi.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&Ai.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;const{html:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const{dom:r,container:s}=n;if(!r)return;const a=_t(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof r?this.htmlMap[a].wrapContainer.innerHTML=r:r!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,i,o,l,n),this.htmlMap[a].renderId=this.renderId}release(){"browser"===Ai.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class Rl extends Ll{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=D.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:n,unmount:i}=this.htmlMap[t];e?Ai.global.getRequestAnimationFrame()((()=>{e.unmount()})):i&&i(),n&&Ai.global.removeDom(n),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const r=i.params.ReactDOM,{element:s,container:a}=n;if(!s||!r||!r.createRoot&&!r.render)return;const o=_t(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])r.createRoot?this.htmlMap[o].root.render(s):r.render(s,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,a);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const n=r.createRoot(t);n.render(s),this.htmlMap[o]={root:n,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else r.render(s,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,l,h,n),this.htmlMap[o].renderId=this.renderId}}const Il=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Nl extends ma{constructor(t,e){super(t),this._skipRenderAttributes=Il,(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,n,i){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);if(r)return this._setAttributes(r,n);Tt(this.attribute[t])&&Tt(e)&&!xt(this.attribute[t])&&!xt(e)?Ht(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,n){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t,this._setAttributes(t,e)}_setAttributes(t,e){const n=Object.keys(t);this._mergeAttributes(t,n),n.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){_t(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const i=e[n];!Tt(this.attribute[i])||xt(this.attribute[i])||xt(t[i])?this.attribute[i]=t[i]:Ht(this.attribute[i],t[i])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var n;const i=new Zi(t,e);i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}}const Dl=Symbol.for("MathPickerContribution"),Ul=Symbol.for("MathImagePicker"),zl=Symbol.for("MathRectPicker"),Wl=Symbol.for("MathSymbolPicker"),Fl=Symbol.for("MathTextPicker"),jl=Symbol.for("CanvasImagePicker"),Hl=Symbol.for("CanvasRectPicker"),Gl=Symbol.for("CanvasSymbolPicker"),$l=Symbol.for("CanvasTextPicker"),Vl=Symbol.for("CanvasRichTextPicker"),Xl=Symbol.for("CanvasPickerContribution"),Yl={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"};var Kl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},ql=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ql=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class Zl{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 Jl(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("img");if(Ai.global.isImageAnonymous&&(n.crossOrigin="anonymous"),e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return n.src=t,n.complete?Promise.resolve(n):new Promise(((t,e)=>{n.onload=()=>{t(n)},n.onerror=()=>{e(new Error("加载失败"))}}))}let th=class extends vl{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 n,i;let r=0,s=0,a=0,o=0;if(t.changedTouches){const e=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};r=e.clientX||0,s=e.clientY||0,a=r,o=s}else r=t.clientX||0,s=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=r,n=s,a=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let l,h;return o&&(l=a.width/o.offsetWidth,h=a.height/o.offsetHeight),{x:(t-a.left)/(Pt(l)?l:1),y:(n-a.top)/(Pt(h)?h:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Zl(t)}return new _e}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:n,height:i,style:r}=e;return r&&(Bt(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=n&&(t.style.width=`${n}px`),null!=i&&(t.style.height=`${i}px`),!0}createDom(t){const{tagName:e="div",parent:n}=t,i=document.createElement(e);if(this.updateDom(i,t),n){const t=Bt(n)?this.getElementById(n):n;t&&t.appendChild&&t.appendChild(i)}return i}loadImage(t){return Jl(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Jl(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,n;const i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:D.GenAutoIncrementId().toString());const r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,i.width=t.width*r,i.height=t.height*r),i}createOffscreenCanvas(t){var e;const n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}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,n){return document.addEventListener(t,e,n)}removeEventListener(t,e,n){return document.removeEventListener(t,e,n)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let n=t.offsetTop,i=t.offsetParent;for(;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}getElementLeft(t,e){let n=t.offsetLeft,i=t.offsetParent;for(;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}getElementTopLeft(t,e){let n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}loadFont(t,e,n){return Ql(this,void 0,void 0,(function*(){return new FontFace(t,Bt(e)?`url(${e})`:e,n).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return{loadState:"fail"}}))}))}isMacOS(){if(void 0===this._isMacOS)try{this._isMacOS=navigator.platform.toUpperCase().indexOf("MAC")>=0}catch(t){this._isMacOS=!1}return this._isMacOS}copyToClipBoard(t){return navigator.clipboard.writeText(t).then((()=>{})).catch((t=>{}))}};th=Kl([K(),ql("design:paramtypes",[])],th);class eh{contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,i.setTransformForCurrent()}else s=0,a=0,i.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,i,s,a,{},null,((t,n,i,r)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=r||l,o)),((t,n,r,s)=>{if(o||l)return!0;const a=n.lineWidth||r.lineWidth,h=n.pickStrokeBuffer||r.pickStrokeBuffer,u=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=u?a+h:Bi(i,a+h,i.dpr),o=t.isPointInStroke(e.x,e.y),l=s||l,o})),i.highPerformanceRestore(),o}}var nh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let ih=class{constructor(){this.type="image",this.numberType=Qs}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};ih=nh([K()],ih);let rh=!1;const sh=new U(((t,e,n,i)=>{rh||(rh=!0,t(Ul).to(ih).inSingletonScope(),t(ih).toService(Ul))})),ah=new _e;class oh{constructor(){this.type="rect",this.numberType=Zs}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme(),{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,i.setTransformForCurrent()}else a=0,o=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||Mt(s,!0)&&0!==s||Ct(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,a,o,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,o=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=o?s+a:Bi(i,s+a,i.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;ah.setValue(n.x1,n.y1,n.x2,n.y2),ah.expand(-s/2),h=!ah.containsPoint(e)}}return i.highPerformanceRestore(),h}}var lh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},hh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uh=function(t,e){return function(n,i){e(n,i,t)}};let ch=class extends oh{constructor(t){super(),this.canvasRenderer=t}};ch=lh([K(),uh(0,X(ul)),hh("design:paramtypes",[Object])],ch);let dh=!1;const fh=new U(((t,e,n,i)=>{dh||(dh=!0,t(zl).to(ch).inSingletonScope(),t(Dl).toService(zl))}));let ph=!1;const gh=new U(((t,e,n,i)=>{ph||(ph=!0,t(Ul).to(ih).inSingletonScope(),t(ih).toService(Ul))}));var mh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},bh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yh=function(t,e){return function(n,i){e(n,i,t)}};let vh=class extends eh{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ta}};vh=mh([K(),yh(0,X(cl)),bh("design:paramtypes",[Object])],vh);let xh=!1;const _h=new U(((t,e,n,i)=>{xh||(xh=!0,t(Wl).to(vh).inSingletonScope(),t(Dl).toService(Wl))}));var Sh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let Ah=class{constructor(){this.type="text",this.numberType=ea}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Ah=Sh([K()],Ah);let wh=!1;const Th=new U(((t,e,n,i)=>{wh||(wh=!0,t(Fl).to(Ah).inSingletonScope(),t(Dl).toService(Fl))}));var Bh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Ch=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kh=function(t,e){return function(n,i){e(n,i,t)}};let Mh=class extends oh{constructor(t){super(),this.canvasRenderer=t}};Mh=Bh([K(),kh(0,X(ul)),Ch("design:paramtypes",[Object])],Mh);let Ph=!1;const Eh=new U(((t,e,n,i)=>{Ph||(Ph=!0,t(Hl).to(Mh).inSingletonScope(),t(Xl).toService(Hl))}));class Oh extends Ho{contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();const s=this.transform(t,r,i),{x:a,y:o,z:l,lastModelMatrix:h}=s;let u=e;if(i.camera){u=e.clone();const n=t.parent.globalTransMatrix;u.x=n.a*e.x+n.c*e.y+n.e,u.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,i,a,o,n,null,((t,e,n)=>!!c||(c=t.isPointInPath(u.x,u.y),c))),this.canvasRenderer.z=0,i.modelMatrix!==h&&Ra.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),c}}var Lh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Rh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ih=function(t,e){return function(n,i){e(n,i,t)}};let Nh=class extends Oh{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ta}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();const s=t.getGraphicTheme(),a=this.transform(t,s,i),{x:o,y:l,z:h,lastModelMatrix:u}=a;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,i,o,l,{},null,((t,e,n)=>!!d||(d=t.isPointInPath(c.x,c.y),d)),((t,e,n)=>{if(d)return!0;const r=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer,a=e.keepStrokeScale||n.keepStrokeScale;return i.lineWidth=a?r+s:Bi(i,r+s,i.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==u&&Ra.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}};Nh=Lh([K(),Ih(0,X(cl)),Rh("design:paramtypes",[Object])],Nh);let Dh=!1;const Uh=new U(((t,e,n,i)=>{Dh||(Dh=!0,t(Gl).to(Nh).inSingletonScope(),t(Xl).toService(Gl))}));var zh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Wh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fh=function(t,e){return function(n,i){e(n,i,t)}};let jh=class extends Oh{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=ea}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();const s=t.getGraphicTheme(),{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,s,i,o),{x:h,y:u,z:c,lastModelMatrix:d}=l;this.canvasRenderer.z=c;let f=e;if(i.camera){f=e.clone();const n=t.parent.globalTransMatrix;f.x=n.a*e.x+n.c*e.y+n.e,f.y=n.b*e.x+n.d*e.y+n.f}let p=!1;return this.canvasRenderer.drawShape(t,i,h,u,{},null,((e,n,i)=>{if(p)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),m=ka(a,d,r),b=Ca(o,g);return e.rect(b+h,m+u,g,d,c),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&Ra.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};jh=zh([K(),Fh(0,X(dl)),Wh("design:paramtypes",[Object])],jh);let Hh=!1;const Gh=new U(((t,e,n,i)=>{Hh||(Hh=!0,t($l).to(jh).inSingletonScope(),t(Xl).toService($l))}));var $h=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Vh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xh=function(t,e){return function(n,i){e(n,i,t)}};let Yh=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Js}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Yh=$h([K(),Xh(0,X(fl)),Vh("design:paramtypes",[Object])],Yh);let Kh=!1;const qh=new U(((t,e,n,i)=>{Kh||(Kh=!0,t(Vl).to(Yh).inSingletonScope(),t(Xl).toService(Vl))}));var Qh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Zh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jh=function(t,e){return function(n,i){e(n,i,t)}};let tu=class extends eh{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Qs}};tu=Qh([K(),Jh(0,X(pl)),Zh("design:paramtypes",[Object])],tu);let eu=!1;const nu=new U(((t,e,n,i)=>{eu||(eu=!0,t(jl).to(tu).inSingletonScope(),t(Xl).toService(jl))})),iu=ml();function ru(){ru.__loaded||(ru.__loaded=!0,go.RegisterGraphicCreator("group",ba))}ru.__loaded=!1;const su=ru;function au(){au.__loaded||(au.__loaded=!0,go.RegisterGraphicCreator("image",so),Ui.load(Ol),Ui.load(iu?nu:sh))}au.__loaded=!1;const ou=au;function lu(){lu.__loaded||(lu.__loaded=!0,go.RegisterGraphicCreator("rect",Ja),Ui.load(_l),Ui.load(iu?Eh:fh))}lu.__loaded=!1;const hu=lu;function uu(){uu.__loaded||(uu.__loaded=!0,go.RegisterGraphicCreator("richtext",co),Ui.load(Pl),Ui.load(iu?qh:gh))}uu.__loaded=!1;const cu=uu;function du(){du.__loaded||(du.__loaded=!0,go.RegisterGraphicCreator("symbol",qa),Ui.load(Al),Ui.load(iu?Uh:_h))}du.__loaded=!1;const fu=du;function pu(){pu.__loaded||(pu.__loaded=!0,go.RegisterGraphicCreator("text",Ga),Ui.load(Tl),Ui.load(iu?Gh:Th))}pu.__loaded=!1;const gu=pu;function mu(){mu.__loaded||(mu.__loaded=!0,go.RegisterGraphicCreator("wrapText",Xa))}mu.__loaded=!1;const bu=mu,yu="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 vu;function xu(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const i=bo({text:t,fontFamily:e.fontFamily||n.fontFamily||yu,fontSize:e.fontSize||n.fontSize||12,fontWeight:e.fontWeight||n.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||n.fontSize||12});return{width:i.width(),height:i.height()}}function _u(t){return"rich"===function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var n,i;return At(t.text)&&"type"in t.text?null!==(n=t.text.type)&&void 0!==n?n:"text":e in t&&null!==(i=t[e])&&void 0!==i?i:"text"}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type")}!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(vu||(vu={})),vu.selectedReverse,vu.selected,vu.hover,vu.hoverReverse;var Su=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};su(),hu(),fu(),cu(),gu();let Au=class t extends Nl{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,n;this.cacheStates();const{text:i="",textStyle:r={},shape:s={},panel:a={},space:o=4,minWidth:l,maxWidth:h,padding:u=4,visible:c,state:d,type:f,textAlwaysCenter:p,containerTextAlign:g}=this.attribute,m=function(t){if(Pt(t))return[t,t,t,t];if(Ct(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,n]=t;return[e,n,e,n]}if(3===e){const[e,n,i]=t;return[e,n,i,n]}if(4===e)return t}if(At(t)){const{top:e=0,right:n=0,bottom:i=0,left:r=0}=t;return[e,n,i,r]}return[0,0,0,0]}(u),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let y,v=-m[3],x=-m[0],_=m[1]+m[3],S=m[0]+m[2],A=0,w=0;const{visible:T}=s,B=Su(s,["visible"]);if(vt(T)){const t=(null==B?void 0:B.size)||10,e=Mt(t)?t:Math.max(t[0],t[1]);y=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},B),{visible:T,x:e/2,y:e/2}),"symbol"),Dt(null==d?void 0:d.shape)||(y.states=d.shape),T&&(w=e+o)}let C,k,M;if(_+=w,A+=w,_u({text:i})||"rich"===f){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return St(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(n=t.height)&&void 0!==n?n:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:f,text:i},r))),r),{visible:St(i)&&!1!==c,x:A,y:0});_t(t.lineHeight)&&(t.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",t,"richtext"),k=C.AABBBounds.width(),M=C.AABBBounds.height()}else{const n=Object.assign(Object.assign({text:At(i)&&"type"in i&&"text"===i.type?i.text:i,visible:St(i)&&!1!==c,lineHeight:null==r?void 0:r.fontSize},r),{x:A,y:0});_t(n.lineHeight)&&(n.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",n,"text");const s=xu(n.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);k=s.width,M=s.height}_+=k;const P=null!==(n=s.size)&&void 0!==n?n:10,E=Mt(P)?P:Math.max(P[0],P[1]);S+=Math.max(M,s.visible?E:0);const{textAlign:O,textBaseline:L}=r;(St(l)||St(h))&&(St(l)&&_<l&&(_=l),St(h)&&_>h&&(_=h,C.setAttribute("maxLineWidth",h-m[1]-m[2]))),v=0,x=0;let R=0;"left"===O||"start"===O?R=1:"right"===O||"end"===O?R=-1:"center"===O&&(R=0),R?R<0?(v-=_,y&&y.setAttribute("x",(y.attribute.x||0)-k),b.setAttribute("x",-m[1]-w)):R>0&&b.setAttribute("x",m[3]):(v-=_/2,y&&y.setAttribute("x",(y.attribute.x||0)-k/2),b.setAttribute("x",-w/2));const I="right"===g||"end"===g,N="left"===g||"start"===g,D=(t,e)=>{var n;"richtext"===C.type?C.setAttributes({x:t,textAlign:e,textConfig:(n=C.attribute.textConfig,St(n)?Ct(n)?n:[n]:[]).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):C.setAttributes({x:t,textAlign:e})};if((g?"center"===g:p)&&R){const t=_-m[1]-m[3],e=k+w,n=1===R?(t-e)/2+w+k/2:m[0]+w-(_/2+e/2-w)+k/2;if(D(n,"center"),y){const t=n-k/2-w+E/2;y.setAttributes({x:t})}}if(N&&1!==R){const t=_-m[1]-m[3],e=0===R?-t/2+w/2:-_+m[3]+m[1]+w;if(D(e+w,"left"),y){const t=e+E/2;y.setAttributes({x:t})}}if(I&&-1!==R){const t=_-m[1]-m[3],e=0===R?t/2+w/2:t;if(D(e,"right"),y){const t=e-k-w+E/2;y.setAttributes({x:t})}}"middle"===L?(x-=S/2,y&&y.setAttribute("y",0)):"bottom"===L?(x-=S,y&&y.setAttribute("y",-M/2),b.setAttribute("y",-m[2])):"top"===L&&(b.setAttribute("y",m[0]),y&&y.setAttribute("y",M/2)),Dt(null==d?void 0:d.text)||(C.states=d.text);const{visible:U}=a,z=Su(a,["visible"]);if(c&&vt(U)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},z),{visible:U&&!!i,width:_,height:S,x:v,y:x}),"rect");if(Dt(null==d?void 0:d.panel)||(t.states=d.panel),z.customShape){const e=z.customShape;t.pathProxy=t=>e(this,t,new Zn)}this._bgRect=t}this._textShape=C,this._symbol=y,this.resetStates()}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e),super.initAttributes(e),this.render()}addState(t,e,n){super.addState(t,e,n),this._textShape&&this._textShape.addState(t,e,n),this._bgRect&&this._bgRect.addState(t,e,n),this._symbol&&this._symbol.addState(t,e,n)}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,n,i,r,s,a,o,l,h,u,c,d,f;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(r=null===(i=null===(n=this._bgRect)||void 0===n?void 0:n.currentStates)||void 0===i?void 0:i.slice())&&void 0!==r?r:[],this._symbolStates=null!==(o=null===(a=null===(s=this._symbol)||void 0===s?void 0:s.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(u=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==u?u:[],this.clearStates(),null===(c=this._bgRect)||void 0===c||c.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(f=this._textShape)||void 0===f||f.clearStates()}resetStates(){var t,e,n;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===(n=this._textShape)||void 0===n||n.useStates(this._textStates))}};Au.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};su(),hu(),gu(),ou();class wu extends Nl{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:Ht({},wu.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,n)=>{"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 Za(Ht({},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 ro(Ht({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new ro(Ht({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 Ha(Ht({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,n=this._text.AABBBounds.height(),i=Math.max(t,e,n),r=i/2-t/2,s=i/2-e/2,a=i/2-n/2,o=this.attribute.box.width,l=this.attribute.icon.width,h=Math.max(o,l),u=h/2-o/2,c=h/2-l/2,d=h+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:u,y:r}),this._checkIcon.setAttributes({x:c,y:s}),this._indeterminateIcon.setAttributes({x:c,y:s}),this._text.setAttributes({x:d,y:a})}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:Ht({},wu.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}wu.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}},su(),hu(),bu(),ou();let Tu=class t extends Nl{constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e)),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,n)=>{"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 po(Ht({},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 Ha(Ht({},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(),n=Math.max(t,e),i=n/2-t/2+this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,r=n/2-e/2,s=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),a=this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,o=s+this.attribute.spaceBetweenTextAndIcon;this._circle.setAttributes({x:a,y:i}),this._text.setAttributes({x:o,y:r})}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e),super.initAttributes(e),this.renderGroup(),this.render()}};Tu.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}};class Bu extends Rl{removeElement(t){super.removeElement(t),delete this.htmlMap[t]}renderGraphicHTML(t){const{react:e}=t.attribute;if(!e)return;const n=t.stage;if(!n)return;const i=n.params.ReactDOM,{element:r}=e;let{container:s}=e;if(s&&(s=function(t){const e=function(t){for(;t&&t.parent;){if("custom-container"===t.name)return t;t=t.parent}return null}(t);if(!e)return null;const{col:n,row:i,stage:r}=e;let{container:s}=t.attribute.react;const{table:a}=r;s===a.bodyDomContainer&&n<a.frozenColCount&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.bottomFrozenBodyDomContainer:s===a.bodyDomContainer&&n>=a.colCount-a.rightFrozenColCount&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.rightFrozenBottomDomContainer:s===a.bodyDomContainer&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.bottomFrozenBodyDomContainer:s===a.bodyDomContainer&&n<a.frozenColCount?s=a.frozenBodyDomContainer:s===a.bodyDomContainer&&n>=a.colCount-a.rightFrozenColCount?s=a.rightFrozenBodyDomContainer:s===a.headerDomContainer&&n<a.frozenColCount?s=a.frozenHeaderDomContainer:s===a.headerDomContainer&&n>=a.colCount-a.rightFrozenColCount&&(s=a.rightFrozenHeaderDomContainer);return s}(t)),!r||!i||!i.createRoot&&!i.render)return;const a=h(e.id)?`${t.id??t._uid}_react`:e.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])i.createRoot?this.htmlMap[a].root.render(r):i.render(r,this.htmlMap[a].wrapContainer);else{const{wrapContainer:e,nativeContainer:o}=this.getWrapContainer(n,s);if(e)if(this.htmlMap||(this.htmlMap={}),i.createRoot){const n=i.createRoot(e);n.render(r),this.htmlMap[a]={root:n,wrapContainer:e,nativeContainer:o,container:s,renderId:this.renderId,graphic:t}}else i.render(r,e),this.htmlMap[a]={wrapContainer:e,nativeContainer:o,container:s,renderId:this.renderId,unmount:()=>{i.unmountComponentAtNode(e)},graphic:t}}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,n,o,l,e),this.htmlMap[a].renderId=this.renderId}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?Ai.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Ai.global.createDom({tagName:"div",parent:i,...n}),nativeContainer:i}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&(n.addEventListener("wheel",this.onWheel),n.addEventListener("wheel",(t=>{t.preventDefault()}),!0))}))),n.style.position||(n.style.position="absolute");let u=0,d=0;const f=t.globalAABBBounds;let g=r.anchorType;if(h(g)&&(g="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===g&&(g="top-left"),"position"===g||f.empty()){const e=t.globalTransMatrix;u=e.e,d=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,h=(r+s)/2,u=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,c=-.5;break;case"top-left":u=-.5,c=-.5;break;case"bottom-right":u=.5,c=.5;break;case"bottom-left":u=-.5,c=.5}return l+=u*a,h+=c*o,{x:l,y:h}})(f,g);u=t.x,d=t.y}const m=Ai.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=u+b.left-m.left,v=d+b.top-m.top;if(o.left=`${y}px`,o.top=`${v}px`,"text"===t.type&&"position"===g&&(o={...o,...this.getTransformOfText(t)}),l(r.style)){const e=r.style({top:v,left:y,width:f.width(),height:f.height()},t,n);e&&(o={...o,...e})}else c(r.style)?o={...o,...r.style}:p(r.style)&&r.style&&(o={...o,...B(r.style)});Ai.global.updateDom(n,{width:r.width,height:r.height,style:o,graphic:t})}drawHTML(){"browser"===Ai?.global?.env&&(this.pluginService.stage.children.sort(((t,e)=>(t.attribute.zIndex??oi.zIndex)-(e.attribute.zIndex??oi.zIndex))).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}}const Cu=new U(((t,e,n,i)=>{t(ku).toSelf().inSingletonScope(),n(mt)?i(mt).toService(ku):t(mt).toService(ku)}));class ku extends th{updateDom(t,n){const i=t.parentElement;if(i&&n.graphic){const r=parseInt(n.style.top,10),s=parseInt(n.style.left,10);let a,o;if(t.style.display="none"){const t=e.getTargetCell(n.graphic);a=t.attribute.width??1,o=t.attribute.height??1}else a=t.offsetWidth,o=t.offsetHeight;if(r+o<0||s+a<0||r>i.offsetHeight||s>i.offsetWidth)return t.style.display="none",!1}const{width:r,height:s,style:a}=n;return a&&(p(a)?t.setAttribute("style",a):Object.keys(a).forEach((e=>{t.style[e]=a[e]}))),null!=r&&(t.style.width=`${r}px`),null!=s&&(t.style.height=`${s}px`),!0}}ml()&&Ui.load(Cu);const Mu=["children","hooks","ref",...R,"skipFunctionDiff","onError","onReady","option","records","container","vtableConstrouctor"],Pu=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,Eu=n.forwardRef(((t,e)=>{const[r,s]=n.useState(0),a=n.useRef({});n.useImperativeHandle(e,(()=>a.current?.table));const o=!!t.option,l=!!t.records,u=n.useRef(!1),c=n.useRef(S(t,Mu)),d=n.useRef(null),f=n.useRef(t.records),p=n.useRef(null),g=!!t.skipFunctionDiff,m=!!t.keepColumnWidthChange,b=n.useRef(new Map),y=n.useRef([]),v=n.useRef([]),x=n.useCallback((t=>o&&t.option?l&&t.records?{...t.option,clearDOM:!1,records:t.records}:{...t.option,clearDOM:!1}:{records:t.records,...c.current,...d.current,clearDOM:!1,customConfig:{...c.current.customConfig,createReactContainer:!0}}),[o,l]),_=n.useCallback((t=>{const e=new t.vtableConstrouctor(t.container,x(t));e.scenegraph.stage.reactAttribute=t.ReactDOM,e.scenegraph.stage.pluginService.register(t.reactAttributePlugin??new Bu),e.scenegraph.stage.params.ReactDOM=t.ReactDOM,a.current={...a.current,table:e},u.current=!1,b.current.clear(),y.current=[],v.current=[],e.on("resize_column_end",(t=>{const n=a.current.table;if(!m)return;const{col:i,colWidths:r}=t,s=r[i];if(e.isPivotTable()){const t=n.getCellHeaderPaths(i,n.columnHeaderLevelCount);let e;e="rowHeader"===t.cellLocation?t.rowHeaderPaths:t.colHeaderPaths;let r=!1;y.current.forEach((t=>{JSON.stringify(t.dimensions)===JSON.stringify(e)&&(t.width=s,r=!0)})),r||y.current.push({dimensions:e,width:s})}else{const t=n.getBodyColumnDefine(i,0);t?.key&&b.current.set(t.key,s)}}))}),[x]),A=n.useCallback((()=>{if(!u.current){if(!a.current||!a.current.table)return;N(a.current.table,t,p.current,L),s(r+1),t.onReady&&t.onReady(a.current.table,0===r)}}),[r,s,t]),w=n.useCallback((()=>{a.current.table&&(a.current.table.render(),A())}),[A]);return n.useEffect((()=>{const e=o?null:(t=>{const e={};return E(t.children).map(((t,n)=>{const i=t&&t.type&&t.type.parseOption;if(i&&t.props){const r=i(h(t.props.componentId)?{...t.props,componentId:Pu(t,n)}:t.props);t.key&&(r.option.key=t.key),r.isSingle?e[r.optionName]=r.option:(e[r.optionName]||(e[r.optionName]=[]),e[r.optionName].push(r.option))}})),e})(t);if(!a.current?.table)return o||(d.current=e),_(t),w(),void(p.current=t);if(o){if(T(p.current.option,t.option,{skipFunction:g})){if(l&&!T(p.current.records,t.records,{skipFunction:g})){if(m){const t=Lu(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{const e=x(t);if(m){const t=Lu(b.current,y.current,a.current.table);e.columnWidthConfig=t,e.columnWidthConfigForRowHeader=t}a.current.table.updateOption(e),A(),p.current=t}return}const n=S(t,Mu);if(T(n,c.current,{skipFunction:g})&&T(e,d.current,{skipFunction:g})){if(l&&!T(t.records,f.current,{skipFunction:g})){if(f.current=t.records,m){const t=Lu(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{c.current=n,d.current=e;const i=x(t);if(m){const t=Lu(b.current,y.current,a.current.table);i.columnWidthConfig=t,i.columnWidthConfigForRowHeader=t}a.current.table.updateOption(i),A(),p.current=t}}),[_,o,l,x,A,w,g,t]),n.useEffect((()=>()=>{a&&a.current&&a.current.table&&(a.current.table.release(),a.current=null),p.current=null,u.current=!0}),[]),n.createElement(i.Provider,{value:a.current},E(t.children).map(((t,e)=>{if("string"==typeof t)return;const i=Pu(t,e);return n.createElement(n.Fragment,{key:i},n.cloneElement(t,{updateId:r,componentId:i,componentIndex:e}))})))})),Ou=(t,e,i)=>{const r=function(t,e="TableContainer",i){const r=n.forwardRef(((e,r)=>{const s=n.useRef(),[a,o]=n.useState(!1),{className:l,style:h,width:u,...c}=e;return n.useLayoutEffect((()=>{o(!0)}),[]),n.createElement("div",{ref:s,className:l,style:{position:"relative",height:e.height||"100%",width:e.width||"100%",...h}},a?n.createElement(t,{ref:r,container:s.current,...i?i(c):c}):n.createElement(n.Fragment,null))}));return r.displayName=e||t.name,r}(Eu,t,(t=>e?Object.assign(t,e):t));return r.displayName=t,r};function Lu(t,e,n){if(n.isPivotTable())return e;const i=[];return t.forEach(((t,e)=>{i.push({key:e,width:t})})),i}const Ru=Ou("ListTable",{type:"list-table",vtableConstrouctor:e.ListTable}),Iu=Ou("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTable}),Nu=Ou("PivotChart",{type:"pivot-chart",vtableConstrouctor:e.PivotChart});const Du=Ou("ListTable",{type:"list-table",vtableConstrouctor:e.ListTableSimple}),Uu=Ou("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTableSimple});var zu,Wu,Fu,ju,Hu={exports:{}},Gu={exports:{}},$u={};function Vu(){return Wu||(Wu=1,Gu.exports=(zu||(zu=1,function(t){function e(t,e){var n=t.length;t.push(e);t:for(;0<n;){var i=n-1>>>1,s=t[i];if(!(0<r(s,e)))break t;t[i]=e,t[n]=s,n=i}}function n(t){return 0===t.length?null:t[0]}function i(t){if(0===t.length)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;t:for(var i=0,s=t.length,a=s>>>1;i<a;){var o=2*(i+1)-1,l=t[o],h=o+1,u=t[h];if(0>r(l,n))h<s&&0>r(u,l)?(t[i]=u,t[h]=n,i=h):(t[i]=l,t[o]=n,i=o);else{if(!(h<s&&0>r(u,n)))break t;t[i]=u,t[h]=n,i=h}}}return e}function r(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],h=[],u=1,c=null,d=3,f=!1,p=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function v(t){for(var r=n(h);null!==r;){if(null===r.callback)i(h);else{if(!(r.startTime<=t))break;i(h),r.sortIndex=r.expirationTime,e(l,r)}r=n(h)}}function x(t){if(g=!1,v(t),!p)if(null!==n(l))p=!0,O(_);else{var e=n(h);null!==e&&L(x,e.startTime-t)}}function _(e,r){p=!1,g&&(g=!1,b(T),T=-1),f=!0;var s=d;try{for(v(r),c=n(l);null!==c&&(!(c.expirationTime>r)||e&&!k());){var a=c.callback;if("function"==typeof a){c.callback=null,d=c.priorityLevel;var o=a(c.expirationTime<=r);r=t.unstable_now(),"function"==typeof o?c.callback=o:c===n(l)&&i(l),v(r)}else i(l);c=n(l)}if(null!==c)var u=!0;else{var m=n(h);null!==m&&L(x,m.startTime-r),u=!1}return u}finally{c=null,d=s,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,A=!1,w=null,T=-1,B=5,C=-1;function k(){return!(t.unstable_now()-C<B)}function M(){if(null!==w){var e=t.unstable_now();C=e;var n=!0;try{n=w(!0,e)}finally{n?S():(A=!1,w=null)}}else A=!1}if("function"==typeof y)S=function(){y(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,E=P.port2;P.port1.onmessage=M,S=function(){E.postMessage(null)}}else S=function(){m(M,0)};function O(t){w=t,A||(A=!0,S())}function L(e,n){T=m((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(t){t.callback=null},t.unstable_continueExecution=function(){p||f||(p=!0,O(_))},t.unstable_forceFrameRate=function(t){0>t||125<t||(B=0<t?Math.floor(1e3/t):5)},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(t){switch(d){case 1:case 2:case 3:var e=3;break;default:e=d}var n=d;d=e;try{return t()}finally{d=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=d;d=t;try{return e()}finally{d=n}},t.unstable_scheduleCallback=function(i,r,s){var a=t.unstable_now();switch(s="object"==typeof s&&null!==s&&"number"==typeof(s=s.delay)&&0<s?a+s:a,i){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return i={id:u++,callback:r,priorityLevel:i,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(i.sortIndex=s,e(h,i),null===n(l)&&i===n(h)&&(g?(b(T),T=-1):g=!0,L(x,s-a))):(i.sortIndex=o,e(l,i),p||f||(p=!0,O(_))),i},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(t){var e=d;return function(){var n=d;d=e;try{return t.apply(this,arguments)}finally{d=n}}}}($u)),$u)),Gu.exports}
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable"),require("react")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactVTable={},t.VTable,t.React)}(this,(function(t,e,n){"use strict";const i=n.createContext(null);function r(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}i.displayName="TableContext";var s={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,s||t,a),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,a=new Array(s);r<s;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},o.prototype.emit=function(t,e,i,r,s,a){var o=n?n+t:t;if(!this._events[o])return!1;var l,h,u=this._events[o],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,r),!0;case 5:return u.fn.call(u.context,e,i,r,s),!0;case 6:return u.fn.call(u.context,e,i,r,s,a),!0}for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u.fn.apply(u.context,l)}else{var d,f=u.length;for(h=0;h<f;h++)switch(u[h].once&&this.removeListener(t,u[h].fn,void 0,!0),c){case 1:u[h].fn.call(u[h].context);break;case 2:u[h].fn.call(u[h].context,e);break;case 3:u[h].fn.call(u[h].context,e,i);break;case 4:u[h].fn.call(u[h].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u[h].fn.apply(u[h].context,l)}}return!0},o.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},o.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},o.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||i&&o.context!==i||a(this,s);else{for(var l=0,h=[],u=o.length;l<u;l++)(o[l].fn!==e||r&&!o[l].once||i&&o[l].context!==i)&&h.push(o[l]);h.length?this._events[s]=1===h.length?h[0]:h:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o}(s);var a=r(s.exports);var o=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var l=t=>"function"==typeof t;var h=t=>null==t;var u=t=>null!=t;var c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var d=t=>"object"==typeof t&&null!==t;var f=function(t){if(!d(t)||!o(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 p=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||o(t,"String")};var g=t=>Array.isArray?Array.isArray(t):o(t,"Array");var m=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var b=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||o(t,"Number")};function y(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(u(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!u(r[a])||"object"!=typeof r[a]||i&&g(t[a])?x(t,a,r[a]):v(t,e,a,n,i)}}}}function v(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=t[n],a=e[n];let o=e[n],l=!0;if(g(a)){if(i)o=[];else if(g(s))o=s;else if(m(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else f(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&y(o,a,i,r),x(t,n,o)}function x(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function _(t){let e=-1;const n=arguments.length<=1?0:arguments.length-1;for(;++e<n;)y(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function S(t,e){if(!t||!f(t))return t;const n={};return Object.keys(t).forEach((i=>{const r=t[i];let s=!1;e.forEach((t=>{(p(t)&&t===i||t instanceof RegExp&&i.match(t))&&(s=!0)})),s||(n[i]=r)})),n}function A(t){return Object.prototype.toString.call(t)}function w(t){return Object.keys(t)}function T(t,e,n){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(A(t)!==A(e))return!1;if(l(t))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof t)return!1;if(g(t)){if(t.length!==e.length)return!1;for(let i=t.length-1;i>=0;i--)if(!T(t[i],e[i],n))return!1;return!0}if(!f(t))return!1;const i=w(t),r=w(e);if(i.length!==r.length)return!1;i.sort(),r.sort();for(let t=i.length-1;t>=0;t--)if(i[t]!=r[t])return!1;for(let r=i.length-1;r>=0;r--){const s=i[r];if(!T(t[s],e[s],n))return!1}return!0}const B=function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const n=e.split(":");if(2===n.length){const e=n[0].trim(),i=n[1].trim();e&&i&&(t[e]=i)}}})),t};var C,k={exports:{}},M={};k.exports=function(){if(C)return M;C=1;var t,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),h=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function g(t){if("object"==typeof t&&null!==t){var p=t.$$typeof;switch(p){case e:switch(t=t.type){case i:case s:case r:case u:case c:return t;default:switch(t=t&&t.$$typeof){case l:case o:case h:case f:case d:case a:return t;default:return p}}case n:return p}}}return t=Symbol.for("react.module.reference"),M.ContextConsumer=o,M.ContextProvider=a,M.Element=e,M.ForwardRef=h,M.Fragment=i,M.Lazy=f,M.Memo=d,M.Portal=n,M.Profiler=s,M.StrictMode=r,M.Suspense=u,M.SuspenseList=c,M.isAsyncMode=function(){return!1},M.isConcurrentMode=function(){return!1},M.isContextConsumer=function(t){return g(t)===o},M.isContextProvider=function(t){return g(t)===a},M.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},M.isForwardRef=function(t){return g(t)===h},M.isFragment=function(t){return g(t)===i},M.isLazy=function(t){return g(t)===f},M.isMemo=function(t){return g(t)===d},M.isPortal=function(t){return g(t)===n},M.isProfiler=function(t){return g(t)===s},M.isStrictMode=function(t){return g(t)===r},M.isSuspense=function(t){return g(t)===u},M.isSuspenseList=function(t){return g(t)===c},M.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===r||e===u||e===c||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===o||e.$$typeof===h||e.$$typeof===t||void 0!==e.getModuleId)},M.typeOf=g,M}();var P=k.exports;const E=t=>{let e=[];return n.Children.forEach(t,(t=>{h(t)||(P.isFragment(t)?e=e.concat(E(t.props.children)):e.push(t))})),e},O={...e.TABLE_EVENT_TYPE,...e.PIVOT_TABLE_EVENT_TYPE,...e.PIVOT_CHART_EVENT_TYPE},L={onClickCell:O.CLICK_CELL,onDblClickCell:O.DBLCLICK_CELL,onMouseDownCell:O.MOUSEDOWN_CELL,onMouseUpCell:O.MOUSEUP_CELL,onSelectedCell:O.SELECTED_CELL,onSelectedClear:O.SELECTED_CLEAR,onKeyDown:O.KEYDOWN,onMouseEnterTable:O.MOUSEENTER_TABLE,onMouseLeaveTable:O.MOUSELEAVE_TABLE,onMouseDownTable:O.MOUSEDOWN_TABLE,onMouseMoveCell:O.MOUSEMOVE_CELL,onMouseMoveTable:O.MOUSEMOVE_TABLE,onMouseEnterCell:O.MOUSEENTER_CELL,onMouseLeaveCell:O.MOUSELEAVE_CELL,onContextMenuCell:O.CONTEXTMENU_CELL,onResizeColumn:O.RESIZE_COLUMN,onResizeColumnEnd:O.RESIZE_COLUMN_END,onResizeRow:O.RESIZE_ROW,onResizeRowEnd:O.RESIZE_ROW_END,onChangeHeaderPositionStart:O.CHANGE_HEADER_POSITION_START,onChangeHeaderPosition:O.CHANGE_HEADER_POSITION,onChangeHeaderPositionFail:O.CHANGE_HEADER_POSITION_FAIL,onSortClick:O.SORT_CLICK,onAfterSort:O.AFTER_SORT,onFreezeClick:O.FREEZE_CLICK,onScroll:O.SCROLL,onScrollHorizontalEnd:O.SCROLL_HORIZONTAL_END,onScrollVerticalEnd:O.SCROLL_VERTICAL_END,onDropdownMenuClick:O.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:O.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:O.DRAG_SELECT_END,onCopyData:O.COPY_DATA,onDropdownIconClick:O.DROPDOWN_ICON_CLICK,onDropdownMenuClear:O.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:O.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:O.SHOW_MENU,onHideMenu:O.HIDE_MENU,onIconClick:O.ICON_CLICK,onLegendItemClick:O.LEGEND_ITEM_CLICK,onLegendItemHover:O.LEGEND_ITEM_HOVER,onLegendItemUnHover:O.LEGEND_ITEM_UNHOVER,onLegendChange:O.LEGEND_CHANGE,onMouseEnterAxis:O.MOUSEENTER_AXIS,onMouseLeaveAxis:O.MOUSELEAVE_AXIS,onCheckboxStateChange:O.CHECKBOX_STATE_CHANGE,onRadioStateChange:O.RADIO_STATE_CHANGE,onSwitchStateChange:O.SWITCH_STATE_CHANGE,onAfterRender:O.AFTER_RENDER,onInitialized:O.INITIALIZED,onChangeCellValue:O.CHANGE_CELL_VALUE,onDragFillHandleEnd:O.DRAG_FILL_HANDLE_END,onMousedownFillHandle:O.MOUSEDOWN_FILL_HANDLE,onDblclickFillHandle:O.DBLCLICK_FILL_HANDLE,onPivotSortClick:O.PIVOT_SORT_CLICK,onDrillMenuClick:O.DRILLMENU_CLICK,onVChartEventType:O.VCHART_EVENT_TYPE,onChangCellValue:O.CHANGE_CELL_VALUE,onEmptyTipClick:O.EMPTY_TIP_CLICK,onEmptyTipDblClick:O.EMPTY_TIP_DBLCLICK,onButtonClick:O.BUTTON_CLICK,onBeforeCacheChartImage:O.BEFORE_CACHE_CHART_IMAGE},R=Object.keys(L),I=(t,e=L)=>{const n={};return Object.keys(t).forEach((i=>{e[i]&&t[i]&&(n[i]=t[i])})),n},N=(t,e,n,i=L)=>{if(!e&&!n||!t)return!1;const r=n?I(n,i):null,s=e?I(e,i):null;return r&&Object.keys(r).forEach((e=>{s&&s[e]&&s[e]===r[e]||t.off(i[e],n[e])})),s&&Object.keys(s).forEach((e=>{r&&r[e]&&r[e]===s[e]||t.on(i[e],s[e])})),!0};class U{static GenAutoIncrementId(){return U.auto_increment_id++}}U.auto_increment_id=0;class D{constructor(t){this.id=U.GenAutoIncrementId(),this.registry=t}}const z="named",W="inject",F="inversify:tagged",j="inversify:paramtypes";class H{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===z?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var G=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",n=Object.getPrototypeOf(Function),i=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function s(t,e,n){let s=r.get(t);if(h(s)){if(!n)return;s=new i,r.set(t,s)}let a=s.get(e);if(h(a)){if(!n)return;a=new i,s.set(e,a)}return a}function a(t,e,n){if(o(t,e,n))return!0;const i=g(e);return!u(i)&&a(t,i,n)}function o(t,e,n){const i=s(e,n,!1);return!h(i)&&!!i.has(t)}function l(t,e,n){if(o(t,e,n))return function(t,e,n){const i=s(e,n,!1);if(!h(i))return i.get(t)}(t,e,n);const i=g(e);return u(i)?void 0:l(t,i,n)}function h(t){return void 0===t}function u(t){return null===t}function c(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,n){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 i=3===n?"string":5===n?"number":"default",r=function(t,e){const n=t[e];if(null!=n){if(!p(n))throw new TypeError;return n}}(t,e);if(void 0!==r){const e=r.call(t,i);if(c(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(p(e)){const n=e.call(t);if(!c(n))return n}const n=t.valueOf;if(p(n)){const e=n.call(t);if(!c(e))return e}}else{const e=t.valueOf;if(p(e)){const n=e.call(t);if(!c(n))return n}const n=t.toString;if(p(n)){const e=n.call(t);if(!c(e))return e}}throw new TypeError}(t,"default"===i?"number":i)}function f(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function p(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===n)return e;if(e!==n)return e;const i=t.prototype,r=i&&Object.getPrototypeOf(i);if(null==r||r===Object.prototype)return e;const s=r.constructor;return"function"!=typeof s||s===t?e:s}t("defineMetadata",(function(t,e,n,i){if(!c(n))throw new TypeError;return r=t,a=e,void s(n,i,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return h(n)||(n=f(n)),a(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return h(n)||(n=f(n)),o(t,e,n)})),t("getMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return h(n)||(n=f(n)),l(t,e,n)}))}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})})),t}({});function $(t,e,n,i){!function(t,e,n,i){const r=[i];let s={};G.hasOwnMetadata(t,e)&&(s=G.getMetadata(t,e));let a=s[n];void 0===a&&(a=[]),a.push(...r),s[n]=a,G.defineMetadata(t,s,e)}(F,t,n.toString(),i)}function V(t){return(e,n,i)=>{$(e,0,i,t)}}const X=(Y=W,t=>(e,n,i)=>V(new H(Y,t))(e,n,i));var Y;function K(){return function(t){return G.defineMetadata(j,null,t),t}}function q(t){return V(new H(z,t))}const Q="Singleton",Z="Transient",J="ConstantValue",tt="DynamicValue",et="Factory",nt="Function",it="Instance",rt="Invalid";class st{constructor(t,e){this.id=U.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=rt,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new st(this.serviceIdentifier,this.scope);return t.activated=t.scope===Q&&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 at{getConstructorMetadata(t){return{compilerGeneratedMetadata:G.getMetadata(j,t),userGeneratedMetadata:G.getMetadata(F,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const ot=(lt=z,t=>{const e=e=>{if(null==e)return!1;if(e.key===lt&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const n=e.constructorArgsMetadata;for(let e=0;e<n.length;e++)if(n[e].key===lt&&n[e].value===t)return!0;return!1};return e.metaData=new H(lt,t),e});var lt;class ht{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Q,this}inTransientScope(){return this._binding.scope=Z,this}whenTargetNamed(t){return this._binding.constraint=ot(t),this}}class ut{constructor(t){this._binding=t}to(t){return this._binding.type=it,this._binding.implementationType=t,new ht(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=tt,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ht(this._binding)}toConstantValue(t){return this._binding.type=J,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Q,new ht(this._binding)}toFactory(t){return this._binding.type=et,this._binding.factory=t,this._binding.scope=Q,new ht(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const ct=Symbol("ContributionProvider");class dt{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 ft(t,e){t(ct).toDynamicValue((t=>{let{container:n}=t;return new dt(e,n)})).inSingletonScope().whenTargetNamed(e)}class pt{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>!(t.name===n&&(!e||t.fn===e)))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>n)){i++;break}}this.taps[i]=t}}class gt extends pt{call(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const mt=Symbol.for("EnvContribution");var bt;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(bt||(bt={}));var yt=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var vt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||yt(t,"Boolean")};var xt=t=>"function"==typeof t;var _t=t=>null==t;var St=t=>null!=t;var At=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var wt=t=>"object"==typeof t&&null!==t;var Tt=function(t){if(!wt(t)||!yt(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 Bt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||yt(t,"String")};var Ct=t=>Array.isArray?Array.isArray(t):yt(t,"Array");var kt=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var Mt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||yt(t,"Number")};var Pt=t=>Mt(t)&&Number.isFinite(t);var Et=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var Ot=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 Lt=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const Rt=Object.prototype;var It=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Rt)};const Nt=Object.prototype.hasOwnProperty;function Ut(t){if(_t(t))return!0;if(kt(t))return!t.length;const e=Lt(t);if("Map"===e||"Set"===e)return!t.size;if(It(t))return!Object.keys(t).length;for(const e in t)if(Nt.call(t,e))return!1;return!0}const Dt=Object.prototype.hasOwnProperty;var zt=(t,e)=>null!=t&&Dt.call(t,e);function Wt(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(St(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!St(r[a])||"object"!=typeof r[a]||i&&Ct(t[a])?jt(t,a,r[a]):Ft(t,e,a,n,i)}}}}function Ft(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=t[n],a=e[n];let o=e[n],l=!0;if(Ct(a)){if(i)o=[];else if(Ct(s))o=s;else if(kt(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else Tt(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&Wt(o,a,i,r),jt(t,n,o)}function jt(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function Ht(t){let e=-1;const n=arguments.length<=1?0:arguments.length-1;for(;++e<n;)Wt(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function Gt(t,e){if(!Ct(t)||!Ct(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}const $t="undefined"!=typeof console;function Vt(t,e,n){const i=[e].concat([].slice.call(n));$t&&console[t].apply(console,i)}var Xt;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Xt||(Xt={}));class Yt{static getInstance(t,e){return Yt._instance&&Mt(t)?Yt._instance.level(t):Yt._instance||(Yt._instance=new Yt(t,e)),Yt._instance}static setInstance(t){return Yt._instance=t}static setInstanceLevel(t){Yt._instance?Yt._instance.level(t):Yt._instance=new Yt(t)}static clearInstance(){Yt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=Xt.Info}canLogDebug(){return this._level>=Xt.Debug}canLogError(){return this._level>=Xt.Error}canLogWarn(){return this._level>=Xt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this._level>=Xt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...n):Vt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",n)),this}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Xt.Warn&&Vt(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Xt.Info&&Vt(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Xt.Debug&&Vt(this._method||"log","DEBUG",e),this}}Yt._instance=null;var Kt=function(t,e,n){return t<e?e:t>n?n:t};const qt=1e-12,Qt=Math.PI,Zt=Qt/2,Jt=2*Qt,te=2*Math.PI,ee=Math.abs,ne=Math.atan2,ie=Math.cos,re=Math.max,se=Math.min,ae=Math.sin,oe=Math.sqrt,le=Math.pow;function he(t){return t>=1?Zt:t<=-1?-Zt:Math.asin(t)}class ue{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new ue(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 Mt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return Mt(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 ce{static distancePP(t,e){return oe(le(t.x-e.x,2)+le(t.y-e.y,2))}static distanceNN(t,e,n,i){return oe(le(t-n,2)+le(e-i,2))}static distancePN(t,e,n){return oe(le(e-t.x,2)+le(n-t.y,2))}static pointAtPP(t,e,n){return new ue((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function de(t){return t*(Math.PI/180)}const fe=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Jt;)t+=Jt;else if(t>0)for(;t>Jt;)t-=Jt;return t};var pe;function ge(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function me(t,e){let{x:n,y:i}=t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(n-r.x)*Math.cos(e)-(i-r.y)*Math.sin(e)+r.x,y:(n-r.x)*Math.sin(e)+(i-r.y)*Math.cos(e)+r.y}}function be(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ye(t,e){const n=e?de(t.angle):t.angle,i=be(t);return[me({x:t.x1,y:t.y1},n,i),me({x:t.x2,y:t.y1},n,i),me({x:t.x2,y:t.y2},n,i),me({x:t.x1,y:t.y2},n,i)]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(pe||(pe={}));function ve(t,e,n){const{x1:i,y1:r,x2:s,y2:a}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*a+n.e,n.b*s+n.d*a+n.f),t.add(n.a*i+n.c*a+n.e,n.b*i+n.d*a+n.f),e)}class xe{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new xe(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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),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 Ct(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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return ve(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,n){const{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+n*l,u=n-e*l-n*o;return[o*i-l*r+h,l*i+o*r+u,o*i-l*a+h,l*i+o*a+u,o*s-l*r+h,l*s+o*r+u,o*s-l*a+h,l*s+o*a+u]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:a,y2:o}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*a+(1-t)*n,e*o+(1-e)*i]}}class _e extends xe{}class Se extends xe{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var n;super(t),t&&(this.angle=null!==(n=t.angle)&&void 0!==n?n:e)}intersects(t){return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=ye(t,n),r=ye(e,n),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(be(t),be(e)),o=s(i[0],i[1]),l=s(i[1],i[2]),h=s(r[0],r[1]),u=s(r[1],r[2]),c=n?de(t.angle):t.angle;let d=n?de(90-t.angle):t.angle+Zt;const f=n?de(e.angle):e.angle;let p=n?de(90-e.angle):e.angle+Zt;d>te&&(d-=te),p>te&&(p-=te);const g=(t,e,n,i)=>{const r=[Math.cos(e),Math.sin(e)];return t+(ge(r,n)+ge(r,i))/2>ge(r,a)};return g((t.x2-t.x1)/2,c,h,u)&&g((t.y2-t.y1)/2,d,h,u)&&g((e.x2-e.x1)/2,f,o,l)&&g((e.y2-e.y1)/2,p,o,l)}(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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,n,i),this.angle=r,this}clone(){return new Se(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[me({x:this.x1,y:this.y1},this.angle,t),me({x:this.x2,y:this.y1},this.angle,t),me({x:this.x1,y:this.y2},this.angle,t),me({x:this.x2,y:this.y2},this.angle,t)]}}class Ae{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,a=new Ae,o=t*i-e*n;return a.a=i/o,a.b=-e/o,a.c=-n/o,a.d=t/o,a.e=(n*s-i*r)/o,a.f=-(t*s-e*r)/o,a}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,a=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=a,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,a=(1-i)*n-r*e,o=i*this.a-r*this.b,l=r*this.a+i*this.b,h=i*this.c-r*this.d,u=r*this.c+i*this.d,c=i*this.e-r*this.f+s,d=r*this.e+i*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=u,this.e=c,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const a=this.a,o=this.b,l=this.c,h=this.d,u=a*t+l*e,c=o*t+h*e,d=a*n+l*i,f=o*n+h*i,p=a*r+l*s+this.e,g=o*r+h*s+this.f;return this.a=u,this.b=c,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new Ae;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:a,f:o}=this,l=n*s-i*r,h=s/l,u=-i/l,c=-r/l,d=n/l,f=(r*o-s*a)/l,p=-(n*o-i*a)/l,{x:g,y:m}=t;e.x=g*h+m*c+f,e.y=g*u+m*d+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 Ae(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const a=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/a):-Math.acos(n/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}function we(t,e,n){e/=100,n/=100;const i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),s=n-i/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=i,o=r,l=0):60<=t&&t<120?(a=r,o=i,l=0):120<=t&&t<180?(a=0,o=i,l=r):180<=t&&t<240?(a=0,o=r,l=i):240<=t&&t<300?(a=r,o=0,l=i):300<=t&&t<360&&(a=i,o=0,l=r),a=Math.round(255*(a+s)),o=Math.round(255*(o+s)),l=Math.round(255*(l+s)),{r:a,g:o,b:l}}function Te(t,e,n){t/=255,e/=255,n/=255;const i=Math.min(t,e,n),r=Math.max(t,e,n),s=r-i;let a=0,o=0,l=0;return a=0===s?0:r===t?(e-n)/s%6:r===e?(n-t)/s+2:(t-e)/s+4,a=Math.round(60*a),a<0&&(a+=360),l=(r+i)/2,o=0===s?0:s/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l:l}}const Be=/^#([0-9a-f]{3,8})$/,Ce={transparent:4294967040},ke={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 Me(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Pe(t){return Mt(t)?new Ie(t>>16,t>>8&255,255&t,1):Ct(t)?new Ie(t[0],t[1],t[2]):new Ie(255,255,255)}function Ee(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Oe(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Le=(t,e)=>{const n=Be.exec(t);if(e||n){const t=parseInt(n[1],16),e=n[1].length;return 3===e?new Ie((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?Pe(t):8===e?new Ie(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Re{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Re(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Re(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const n=t instanceof Re?t:new Re(t);switch(e){case"hsv":default:return n.getHSVBrightness();case"hsl":return n.getHSLBrightness();case"lum":return n.getLuminance();case"lum2":return n.getLuminance2();case"lum3":return n.getLuminance3();case"wcag":return n.getLuminanceWCAG()}}static parseColorString(t){if(St(Ce[t]))return function(t){return Mt(t)?new Ie(t>>>24,t>>>16&255,t>>>8&255,255&t):Ct(t)?new Ie(t[0],t[1],t[2],t[3]):new Ie(255,255,255,1)}(Ce[t]);if(St(ke[t]))return Pe(ke[t]);const e=`${t}`.trim().toLowerCase(),n=Le(e);if(void 0!==n)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Ie(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(","),n=we(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Ie(n.r,n.g,n.b,parseFloat(t[3]))}}constructor(t){const e=Re.parseColorString(t);this.color=e||new Ie(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:n,b:i}=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(n*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*t))),this}add(t){const{r:e,g:n,b:i}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,n+t.color.g),this.color.b+=Math.min(255,i+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:n,b:i}=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(n*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(i*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,n){const i=this.color.opacity,r=Te(this.color.r,this.color.g,this.color.b),s=we(_t(t)?r.h:Kt(t,0,360),_t(e)?r.s:e>=0&&e<=1?100*e:e,_t(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new Ie(s.r,s.g,s.b,i),this}setRGB(t,e,n){return!_t(t)&&(this.color.r=t),!_t(e)&&(this.color.g=e),!_t(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=Le(e,!0);return null!=n?n:this}setColorName(t){const e=ke[t.toLowerCase()];return void 0!==e&&this.setHex(e),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,n=this.color.b/255;let i,r,s;return i=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),r=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),s=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),.2126*i+.7152*r+.0722*s}clone(){return new Re(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 n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Ee(t.color.r),this.color.g=Ee(t.color.g),this.color.b=Ee(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Oe(t.color.r),this.color.g=Oe(t.color.g),this.color.b=Oe(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Ie{constructor(t,e,n,i){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(+n)?255:Math.max(0,Math.min(255,+n)),St(i)?this.opacity=isNaN(+i)?1:Math.max(0,Math.min(1,+i)):this.opacity=1}formatHex(){return`#${Me(this.r)+Me(this.g)+Me(this.b)+(1===this.opacity?"":Me(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:n,l:i}=Te(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${n}%,${i}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const Ne=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),Ue=Jt-1e-8;class De{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>Ue)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let a,o,l,h,u=1/0,c=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),h=n*Math.sin(t),l<u&&(u=l),l>c&&(c=l),h<d&&(d=h),h>f&&(f=h)}if(p(i),p(r),r!==i)if((i%=Jt)<0&&(i+=Jt),(r%=Jt)<0&&(r+=Jt),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=Jt,a=i-i%Zt,o=0;o<4&&a>r;++o,a-=Zt)p(a);else for(a=i-i%Zt+Zt,o=0;o<4&&a<r;++o,a+=Zt)p(a);this.bounds.add(t+u,e+d),this.bounds.add(t+c,e+f)}arcTo(t,e,n,i,r){this.bounds.add(t,e)}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(){}}class ze{constructor(){this._curves=[],this.bounds=new _e}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const We=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Fe={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},je=0,He=1,Ge=2,$e=3,Ve=4,Xe=5,Ye=6,Ke=7,qe=8;let Qe,Ze,Je,tn,en,nn;var rn,sn,an,on,ln,hn,un,cn,dn;function fn(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=l*s,u=-o*a,c=o*s,d=l*a,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),m=Math.sin(r),b=.5*(r-i),y=Math.sin(.5*b),v=8/3*y*y/Math.sin(b),x=e+f-v*p,_=n+p+v*f,S=e+g,A=n+m,w=S+v*m,T=A-v*g;return[h*x+u*_,c*x+d*_,h*w+u*T,c*w+d*T,h*S+u*A,c*S+d*A]}function pn(t,e,n,i){const r=function(t,e,n,i,r,s,a,o,l){const h=de(a),u=Math.sin(h),c=Math.cos(h),d=c*(o-t)*.5+u*(l-e)*.5,f=c*(l-e)*.5-u*(o-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=c/n,m=u/n,b=-u/i,y=c/i,v=g*o+m*l,x=b*o+y*l,_=g*t+m*e,S=b*t+y*e;let A=1/((_-v)*(_-v)+(S-x)*(S-x))-.25;A<0&&(A=0);let w=Math.sqrt(A);s===r&&(w=-w);const T=.5*(v+_)-w*(S-x),B=.5*(x+S)+w*(_-v),C=Math.atan2(x-B,v-T);let k=Math.atan2(S-B,_-T)-C;k<0&&1===s?k+=Jt:k>0&&0===s&&(k-=Jt);const M=Math.ceil(Math.abs(k/(Zt+.001))),P=[];for(let t=0;t<M;++t){const e=C+t*k/M,r=C+(t+1)*k/M;P[t]=[T,B,e,r,n,i,u,c]}return P}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=fn(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[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"}(rn||(rn={})),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"}(sn||(sn={})),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"}(an||(an={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(on||(on={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(ln||(ln={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(hn||(hn={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(un||(un={})),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"}(cn||(cn={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(dn||(dn={}));const gn=[(t,e,n,i,r,s,a)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,n,i,r,s,a)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,a),(t,e,n,i,r,s,a)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,a),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,a)=>e.lineTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.moveTo(t[1]*r+n,t[2]*s+i,a),(t,e,n,i,r,s,a)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,a),(t,e,n,i,r,s,a)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,a)];function mn(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];gn[l[0]](l,e,n,i,r,s,a)}}class bn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function yn(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],a=e[r],o=t[(r+1)%i],l=e[(r+1)%i];n+=ce.distanceNN(s,a,o,l)}return n/2}function vn(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function xn(t,e,n,i,r){const s=vn(t.x,e.x,n.x,i.x,r),a=vn(t.y,e.y,n.y,i.y,r);return new ue(s,a)}function _n(t,e,n,i){const r=1-i;return r*r*t+2*r*i*e+i*i*n}function Sn(t,e,n,i){const r=_n(t.x,e.x,n.x,i),s=_n(t.y,e.y,n.y,i);return new ue(r,s)}class An extends bn{constructor(t,e,n){super(),this.type=cn.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Sn(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,yn([t.x,e.x,n.x],[t.y,e.y,n.y])):60;var t,e,n}calcProjLength(t){return t===un.ROW?ee(this.p0.x-this.p2.x):t===un.COLUMN?ee(this.p0.y-this.p2.y):0}getAngleAt(t){const e=re(t-.01,0),n=se(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ne(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.quadraticCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r}=t,s=Sn(n,i,r,e),a=ce.pointAtPP(n,i,e),o=ce.pointAtPP(i,r,e);return[new An(n,a,s),new An(s,o,r)]}(this,s);t.quadraticCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class wn extends bn{constructor(t,e,n,i){super(),this.type=cn.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_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 xn(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,n=this.p2,i=this.p3,yn([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])):60;var t,e,n,i}calcProjLength(t){return t===un.ROW?ee(this.p0.x-this.p3.x):t===un.COLUMN?ee(this.p0.y-this.p3.y):0}getAngleAt(t){const e=re(t-.01,0),n=se(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return ne(r.y-i.y,r.x-i.x)}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.bezierCurveTo(this.p1.x*i+e,this.p1.y*r+n,this.p2.x*i+e,this.p2.y*r+n,this.p3.x*i+e,this.p3.y*r+n);else if(s>0){const[a]=function(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,a=xn(n,i,r,s,e),o=ce.pointAtPP(n,i,e),l=ce.pointAtPP(i,r,e),h=ce.pointAtPP(r,s,e),u=ce.pointAtPP(o,l,e),c=ce.pointAtPP(l,h,e);return[new wn(n,o,u,a),new wn(a,c,h,s)]}(this,s);t.bezierCurveTo(a.p1.x*i+e,a.p1.y*r+n,a.p2.x*i+e,a.p2.y*r+n,a.p3.x*i+e,a.p3.y*r+n)}}includeX(t){const e=se(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=re(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=n}getYAt(t){const e=se(this.p0.x,this.p1.x,this.p2.x,this.p3.x),n=(t-e)/(re(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(n).y}}class Tn extends bn{constructor(t,e){super(),this.type=cn.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return ce.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()?ce.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===un.ROW?ee(this.p0.x-this.p1.x):t===un.COLUMN?ee(this.p0.y-this.p1.y):0}draw(t,e,n,i,r,s){if(t.moveTo(this.p0.x*i+e,this.p0.y*r+n),s>=1)t.lineTo(this.p1.x*i+e,this.p1.y*r+n);else if(s>0){const a=this.getPointAt(s);t.lineTo(a.x*i+e,a.y*r+n)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,n=this.p1;this.p0.x>this.p1.x&&(e=this.p1,n=this.p0);const i=(t-e.x)/(n.x-e.x);return e.y+i*(n.y-e.y)}return 1/0}}class Bn{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,n,i,r,s,a,o){const l=new wn(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i),new ue(r,s));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new Tn(new ue(this._lastX,this._lastY),new ue(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===un.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return ee(t.p0.y-i.y)}if(t===un.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return ee(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Cn extends Bn{bezierCurveTo(t,e,n,i,r,s,a,o){return super.bezierCurveTo(e,t,i,n,s,r,a,o)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function kn(t,e){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function Mn(t,e,n){const i=null!=e?e:ee(n[n.length-1].x-n[0].x)>ee(n[n.length-1].y-n[0].y)?un.ROW:un.COLUMN;return"monotoneY"===t?new Cn(t,i):new Bn(t,i)}class Pn{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function En(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=Mn("linear",n,t);return function(t,e){kn(t,e)}(new Pn(r,i),t),r}function On(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class Ln{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&&On(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:On(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Rn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return En(t,e);const r=Mn("basis",n,t);return function(t,e){kn(t,e)}(new Ln(r,i),t),r}function In(t){return t<0?-1:1}function Nn(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),a=(n-t._y1)/(r||Number(i<0&&-0)),o=(s*r+a*i)/(i+r);return(In(s)+In(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function Un(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Dn(t,e,n,i,r){const s=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-s)/3;t.context.bezierCurveTo(s+h,a+h*e,o-h,l-h*n,o,l,i,t.lastPoint1)}class zn{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:Dn(this,this._t0,Un(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 n=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,Dn(this,Un(this,e=Nn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Dn(this,this._t0,e=Nn(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,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 Wn extends zn{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Fn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return En(t,e);const r=Mn("monotoneX",n,t);return function(t,e){kn(t,e)}(new zn(r,i),t),r}function jn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return En(t,e);const r=Mn("monotoneY",n,t);return function(t,e){kn(t,e)}(new Wn(r,i),t),r}let Hn=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=n}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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(i,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class Gn extends Hn{lineEnd(){this.context.closePath()}}function $n(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new Bn("step",null!=i?i:ee(t[t.length-1].x-t[0].x)>ee(t[t.length-1].y-t[0].y)?un.ROW:un.COLUMN);return Vn(new Hn(s,e,r),t),s}function Vn(t,e){return kn(t,e)}class Xn extends Pn{lineEnd(){this.context.closePath()}}function Yn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=Mn("linear",n,t);return function(t,e){kn(t,e)}(new Xn(r,i),t),r}function Kn(t,e,n,i,r){let s=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>qt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,n=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/n,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/n}if(t._l23_a>qt){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*i+t._x1*t._l23_2a-e*t._l12_2a)/r,l=(l*i+t._y1*t._l23_2a-n*t._l12_2a)/r}t.context.bezierCurveTo(s,a,o,l,t._x2,t._y2,i,t.lastPoint1)}function qn(t,e){return function(n,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:a}=r;if(n.length<2-Number(!!a))return null;if(n.length<3-Number(!!a))return En(n,r);const o=Mn(t,s,n);return kn(new e(o,i,a),n),o}}const Qn=qn("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=n,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:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Kn(this,e,n,!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=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Zn=qn("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=n,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:n}=t;if(this._point){const t=this._x2-e,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=n;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=n,t);break;case 2:this._point=3,this._x5=e,this._y5=n;break;default:Kn(this,e,n,!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=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class Jn{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const n=this.addLinearCurve(t,e);this.path.addCurve(n),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Tn(new ue(this._lastX,this._lastY),new ue(t,e))}quadraticCurveTo(t,e,n,i){const r=new An(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i));this.path.addCurve(r),this._lastX=n,this._lastY=i}bezierCurveTo(t,e,n,i,r,s){const a=new wn(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i),new ue(r,s));this.path.addCurve(a),this._lastX=r,this._lastY=s}arcTo(t,e,n,i,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,n,i,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,n,i){throw new Error("CurveContext不支持调用rect")}arc(t,e,n,i,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function ti(t,e,n){var i,r;switch(e){case"linear":default:return En(t,n);case"basis":return Rn(t,n);case"monotoneX":return Fn(t,n);case"monotoneY":return jn(t,n);case"step":return $n(t,.5,n);case"stepClosed":return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new Bn("step",null!=i?i:ee(t[t.length-1].x-t[0].x)>ee(t[t.length-1].y-t[0].y)?un.ROW:un.COLUMN);return Vn(new Gn(s,e,r),t),s}(t,.5,n);case"stepBefore":return $n(t,0,n);case"stepAfter":return $n(t,1,n);case"catmullRom":return Qn(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return Zn(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Yn(t,n)}}class ei extends ze{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new De(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Ye,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Xe,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Ke,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.commandList.push([Ge,t,e,n,i,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,s),this}arcTo(t,e,n,i,r){return this.commandList.push([He,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,s,a,o){return this.commandList.push([Ve,t,e,n,i,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,s,a,o),this}rect(t,e,n,i){return this.commandList.push([qe,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}arc(t,e,n,i,r,s){return this.commandList.push([je,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([$e]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new Jn(this);mn(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[Ye]=t=>`M${t[1]} ${t[2]}`,t[Xe]=t=>`L${t[1]} ${t[2]}`,t[Ke]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Ge]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[je]=t=>{const e=[];((t,e,n,i,r,s,a)=>{const o=Math.abs(n-e),l=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,h=(n-e)/l;for(let n=0;n<l;n++){const o=e+h*n,l=e+h*(n+1),u=4*Math.tan(Math.abs(h)/4)/3,c=l<o?-1:1,d=Math.cos(o),f=Math.sin(o),p=Math.cos(l),g=Math.sin(l),m=d*s+i,b=f*a+r,y=p*s+i,v=g*a+r,x=s*u*c,_=a*u*c;t.push(m-x*f,b+_*d,y+x*g,v-_*p,y,v)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let n="";for(let t=0;t<e.length;t+=6)n+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return n},t[qe]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[$e]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((n=>{e+=t[n[0]](n)})),e}fromString(t,e,n,i,r){this.clear();const s=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let n,i;const r=[];for(let t=0,s=e.length;t<s;t++)if(Qe=e[t],Ze=Qe.slice(1),Je=Qe[0],n=[Je],i=Ze.match(We),null!==i){for(let t=0,e=i.length;t<e;t++)tn=i[t],en=parseFloat(tn),Number.isNaN(en)||n.push(en);if(nn=Fe[Je],n.length-1>nn){let t,e=Je;for(let i=1,s=n.length;i<s;i+=nn){t=[e];for(let e=i,r=i+nn;e<r;e++)t.push(n[e]);r.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else r.push(n)}else r.push(n);return r}(t);return this._runCommandStrList(s,e,n,i,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:i}=t.attribute;if(!e)return;const r=ti(e,n);"x"===i?this.direction=un.ROW:"y"===i?this.direction=un.COLUMN:"auto"===i&&(this.direction=r.direction),this._curves=r.curves}fromCustomPath2D(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}transform(t,e,n,i){const r=this.commandList;if(!this.transformCbList){const t=[];t[Ye]=this.moveToTransform,t[Xe]=this.lineToTransform,t[Ke]=this.quadraticCurveToTransform,t[Ge]=this.bezierCurveToTransform,t[He]=this.arcToTransform,t[Ve]=this.ellipseTransform,t[qe]=this.rectTransform,t[je]=this.arcTransform,t[$e]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,n,i)})),this._updateBounds()}moveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}ellipseTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}rectTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}arcTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}closePathTransform(){}_runCommandStrList(t){let e,n,i,r,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,u=null,c=0,d=0,f=0,p=0;for(let g=0,m=t.length;g<m;++g){switch(e=t[g],1===l&&1===h||(e=ii(e,l,h)),e[0]){case"l":c+=e[1],d+=e[2],this.lineTo(c+a,d+o);break;case"L":c=e[1],d=e[2],this.lineTo(c+a,d+o);break;case"h":c+=e[1],this.lineTo(c+a,d+o);break;case"H":c=e[1],this.lineTo(c+a,d+o);break;case"v":d+=e[1],this.lineTo(c+a,d+o);break;case"V":d=e[1],this.lineTo(c+a,d+o);break;case"m":c+=e[1],d+=e[2],this.moveTo(c+a,d+o);break;case"M":c=e[1],d=e[2],this.moveTo(c+a,d+o);break;case"c":n=c+e[5],i=d+e[6],f=c+e[3],p=d+e[4],this.bezierCurveTo(c+e[1]+a,d+e[2]+o,f+a,p+o,n+a,i+o),c=n,d=i;break;case"C":c=e[5],d=e[6],f=e[3],p=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,f+a,p+o,c+a,d+o);break;case"s":n=c+e[3],i=d+e[4],null===u[0].match(/[CcSs]/)?(f=c,p=d):(f=2*c-f,p=2*d-p),r=c+e[1],s=d+e[2],this.bezierCurveTo(f+a,p+o,r+a,s+o,n+a,i+o),f=r,p=s,c=n,d=i;break;case"S":n=e[3],i=e[4],null===u[0].match(/[CcSs]/)?(f=c,p=d):(f=2*c-f,p=2*d-p),r=e[1],s=e[2],this.bezierCurveTo(f+a,p+o,r+a,s+o,n+a,i+o),f=r,p=s,c=n,d=i;break;case"q":n=c+e[3],i=d+e[4],f=c+e[1],p=d+e[2],this.quadraticCurveTo(f+a,p+o,n+a,i+o),c=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,n+a,i+o),c=n,d=i,f=e[1],p=e[2];break;case"t":n=c+e[1],i=d+e[2],null===u[0].match(/[QqTt]/)?(f=c,p=d):"t"===u[0]?(f=2*c-r,p=2*d-s):"q"===u[0]&&(f=2*c-f,p=2*d-p),r=f,s=p,this.quadraticCurveTo(f+a,p+o,n+a,i+o),c=n,d=i,f=c+e[1],p=d+e[2];break;case"T":n=e[1],i=e[2],f=2*c-f,p=2*d-p,this.quadraticCurveTo(f+a,p+o,n+a,i+o),c=n,d=i;break;case"a":pn(this,c+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+c+a,e[7]+d+o]),c+=e[6],d+=e[7];break;case"A":pn(this,c+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),c=e[6],d=e[7];break;case"z":case"Z":this.closePath()}u=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Xe:this.lineToTransform(a,e,n,i,r);break;case Ye:this.moveToTransform(a,e,n,i,r);break;case Ge:this.bezierCurveToTransform(a,e,n,i,r);break;case Ke:this.quadraticCurveToTransform(a,e,n,i,r);break;case je:this.arcToTransform(a,e,n,i,r);break;case Ve:this.ellipseTransform(a,e,n,i,r);break;case qe:this.rectTransform(a,e,n,i,r);break;case He:this.arcToTransform(a,e,n,i,r);break;case $e:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),mn(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===un.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ee(t.p0.y-e.p1.y)}if(this.direction===un.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ee(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const n=this.curves[e];if(n.includeX(t))return n.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,n=0;for(let i=0;i<this._curves.length;i++){e=this._curves[i];const r=e.getLength(this.direction);if(n+r>=t)break;n+=r}const i=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(i),angle:e.getAngleAt(i)}}drawWithClipRange(t,e,n,i,r){this.tryBuildCurves();const s=this.getLength()*r;let a=0;for(let r=0;r<this._curves.length;r++){const o=this._curves[r],l=o.getLength(this.direction);if(!(a+l<=s)){const r=1-(a+l-s)/l;o.draw(t,n,i,e,e,r);break}o.draw(t,n,i,e,e,1),a+=l}}}const ni=["l",0,0,0,0,0,0,0];function ii(t,e,n){const i=ni[0]=t[0];if("a"===i||"A"===i)ni[1]=e*t[1],ni[2]=n*t[2],ni[3]=t[3],ni[4]=t[4],ni[5]=t[5],ni[6]=e*t[6],ni[7]=n*t[7];else if("h"===i||"H"===i)ni[1]=e*t[1];else if("v"===i||"V"===i)ni[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)ni[i]=(i%2==1?e:n)*t[i];return ni}const ri={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 Ae},si={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ai=Object.assign({outerBorder:Object.assign(Object.assign({},si),{distance:0}),innerBorder:Object.assign(Object.assign({},si),{distance:0})},si),oi={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:bt.fontBounding,keepCenterInLine:!1},li=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),ai),{alignSelf:"auto"}),{pickStrokeBuffer:0}),hi={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},ui=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null},{_debug_bounds:!1}),li),ri),ci=Object.assign(Object.assign({},ui),{startAngle:0,endAngle:te,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),di=Object.assign(Object.assign(Object.assign({},ui),hi),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),fi=Object.assign(Object.assign({},ui),{radius:1,startAngle:0,endAngle:te}),pi=Object.assign(Object.assign({},ui),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),gi=Object.assign(Object.assign({},ui),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),mi=Object.assign(Object.assign(Object.assign({},ui),hi),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),bi=Object.assign(Object.assign({},ui),{path:new ei,fillStrokeOrder:1,clipRange:1,customPath:()=>{Yt.getInstance().warn("空函数")}}),yi=Object.assign(Object.assign({},ui),{points:[],cornerRadius:0,closePath:!0}),vi=Object.assign(Object.assign({},ui),{width:100,height:100,spikes:5,thickness:.5}),xi=Object.assign(Object.assign({},ui),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},ui),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const _i=Object.assign(Object.assign({},ui),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),Si=Object.assign(Object.assign(Object.assign({},ui),oi),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Ai=Object.assign(Object.assign(Object.assign({},ui),oi),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),wi=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},ui),{fill:!0,cornerRadius:0,cornerType:"round"}),Ti=Object.assign(Object.assign({},wi),{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 Bi=new class{},Ci=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 n(t){const n=new Error(e+": "+t);throw n.source=e,n}function i(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,o)||r("conic",t.conicGradient,a)}function r(e,i,r){return function(i,s){const a=b(i);if(a){b(t.startCall)||n("Missing (");const i=function(i){const s=r();return s&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(f)}}();return b(t.endCall)||n("Missing )"),i}}(i)}function s(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let n,i,r=l();return r&&(n=[],n.push(r),i=e,b(t.comma)&&(r=l(),r?n.push(r):e=i)),n}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=g()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=p()||h()),t}();if(t)t.at=u();else{const e=h();if(e){t=e;const n=u();n&&(t.at=n)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function u(){if(m("position",/^at/,0)){const t=c();return t||n("Missing positioning value"),t}}function c(){const t={x:p(),y:p()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let i=e();const r=[];if(i)for(r.push(i);b(t.comma);)i=e(),i?r.push(i):n("One extra comma");return r}function f(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=p(),e}function p(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||g()}function g(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){const i=b(e);if(i)return{type:t,value:i[n]}}function b(t){const n=/^[\n\r\t\s]+/.exec(e);n&&y(n[0].length);const i=t.exec(e);return i&&y(i[0].length),i}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(i);return e.length>0&&n("Invalid input not EOF"),t}()}}();class ki{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(ki.IsGradientStr(t))try{const e=Ci(t)[0];if(e){if("linear"===e.type)return ki.ParseLinear(e);if("radial"===e.type)return ki.ParseRadial(e);if("conic"===e.type)return ki.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,i=Qt/2,r=parseFloat(e.value)/180*Qt-i;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+te,stops:n.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:n=[]}=t,i=Qt/2;let r="angular"===e.type?parseFloat(e.value)/180*Qt:0;for(;r<0;)r+=te;for(;r>=te;)r-=te;let s=0,a=0,o=0,l=0;return r<i?(s=0,a=1,o=Math.sin(r),l=a-Math.cos(r)):r<Qt?(s=0,a=0,o=Math.cos(r-i),l=Math.sin(r-i)):r<Qt+i?(s=1,a=0,o=s-Math.sin(r-Qt),l=Math.cos(r-Qt)):(s=1,o=s-Math.cos(r-i-Qt),l-=Math.sin(r-i-Qt)),{gradient:"linear",x0:s,y0:a,x1:o,y1:l,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Mi(t,e,n){let i=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(i=i/Math.abs(l+h)*2*n,i)}function Pi(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,a,o,l;if(!e||!0===e)return"black";let h,u;if(Ct(e))for(let t=0;t<e.length&&(u=e[t],!u);t++);else u=e;if(u=ki.Parse(u),"string"==typeof u)return u;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let c=e.x2-e.x1,d=e.y2-e.y1,f=e.x1-i,p=e.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1,angle:i=0}=n.attribute;c/=t,d/=e,f/=t,p/=e,(i||1!==t||1!==e)&&(f=null!==(s=n.x1WithoutTransform)&&void 0!==s?s:0,p=null!==(a=n.y1WithoutTransform)&&void 0!==a?a:0,c=null!==(o=n.widthWithoutTransform)&&void 0!==o?o:c,d=null!==(l=n.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===u.gradient?h=function(t,e,n,i,r,s){var a,o,l,h;const u=t.createLinearGradient(n+(null!==(a=e.x0)&&void 0!==a?a:0)*r,i+(null!==(o=e.y0)&&void 0!==o?o:0)*s,n+(null!==(l=e.x1)&&void 0!==l?l:1)*r,i+(null!==(h=e.y1)&&void 0!==h?h:0)*s);return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,u,f,p,c,d):"conical"===u.gradient?h=function(t,e,n,i,r,s){var a,o;const l=t.createConicGradient(n+(null!==(a=e.x)&&void 0!==a?a:0)*r,i+(null!==(o=e.y)&&void 0!==o?o:0)*s,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(r+n,s+i,void 0):l}(t,u,f,p,c,d):"radial"===u.gradient&&(h=function(t,e,n,i,r,s){var a,o,l,h,u,c;const d=t.createRadialGradient(n+(null!==(a=e.x0)&&void 0!==a?a:.5)*r,i+(null!==(o=e.y0)&&void 0!==o?o:.5)*s,Math.max(r,s)*(null!==(l=e.r0)&&void 0!==l?l:0),n+(null!==(h=e.x1)&&void 0!==h?h:.5)*r,i+(null!==(u=e.y1)&&void 0!==u?u:.5)*s,Math.max(r,s)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,u,f,p,c,d))}return h||"orange"}const Ei={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"}},Oi=!0,Li=!1,Ri=/\w|\(|\)|-/,Ii=/[.?!,;:/,。?!、;:]/,Ni=/\S/,Ui=(t,e)=>{let n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily})};function Di(t,e,n,i,r){if(t.length<=1)return 0;if(!e||e<=0)return 0;const s=Bi.graphicUtil.textMeasure;let a=i,o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),h=t.slice(0,a+1),u=Math.floor(s.measureText(h,n).width);for(;l>e||u<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),h=t.slice(0,a+1),u=Math.floor(s.measureText(h,n).width)}return r&&(a=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e;for(;Ri.test(t[i-1])&&Ri.test(t[i])||Ii.test(t[i]);)if(i--,i<=0)return n?zi(t,e):e;return i}(t,a)),a}function zi(t,e){let n=e;for(;Ri.test(t[n+1])&&Ri.test(t[n])||Ii.test(t[n]);)if(n++,n>=t.length)return n;return n+1}function Wi(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"actual";var i;if(""===t)return{ascent:0,height:0,descent:0,width:0};const r=Bi.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0},a="actual"===n?r.actualBoundingBoxAscent:r.fontBoundingBoxAscent,o="actual"===n?r.actualBoundingBoxDescent:r.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(s.width=Math.floor(r.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(r.width),s.height=Math.floor(a+o),s.ascent=Math.floor(a),s.descent=s.height-s.ascent);const l=null!==(i=e.space)&&void 0!==i?i:0;return s.width+=l,s}const Fi=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Z,this.options=e,this.id=U.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new at}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,n){const i=this._getNotAllArgs(t,!1,e,n);return this._get(i)}getNamed(t,e){return this.getTagged(t,z,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new st(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new ut(n)}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=>n=>{const i=this.bind(n);return t(i,e),i},n=()=>t=>this.unbind(t),i=()=>t=>this.isBound(t),r=e=>n=>{const i=this.rebind(n);return t(i,e),i};return t=>({bindFunction:e(t),isboundFunction:i(),rebindFunction:r(t),unbindFunction:n(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}}_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:n}=this._metadataReader.getConstructorMetadata(e),i=Object.keys(n),r=[];for(let t=0;t<i.length;t++){const e=n[t],i={};e.forEach((t=>{i[t.key]=t.value}));const s={inject:i[W],multiInject:i.multi_inject},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};r.push(t)}}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case J:case nt:e=t.cache;break;case it: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 n=this._getChildRequest(t);return this._createInstance(e,n)}_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===Q&&(t.cache=e,t.activated=!0)}},ji=Symbol.for("CanvasFactory");function Hi(t){return Fi.getNamed(ji,Bi.global.env)(t)}const Gi=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=Hi(Object.assign({nativeCanvas:Bi.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},n=Hi(Object.assign({nativeCanvas:Bi.global.createCanvas(e)},e));return this.allocatedCanvas.push(n),n}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=[]}},$i={arc:ci,area:di,circle:fi,line:mi,path:bi,symbol:_i,text:Si,rect:xi,polygon:yi,star:vi,richtext:Ai,richtextIcon:Ti,image:wi,group:pi,glyph:gi},Vi=Object.keys($i);function Xi(t,e){Object.keys(e).forEach((n=>{t[n]=e[n]}))}const Yi={arc:Object.assign({},$i.arc),area:Object.assign({},$i.area),circle:Object.assign({},$i.circle),line:Object.assign({},$i.line),path:Object.assign({},$i.path),symbol:Object.assign({},$i.symbol),text:Object.assign({},$i.text),rect:Object.assign({},$i.rect),polygon:Object.assign({},$i.polygon),star:Object.assign({},$i.star),richtext:Object.assign({},$i.richtext),richtextIcon:Object.assign({},$i.richtextIcon),image:Object.assign({},$i.image),group:Object.assign({},$i.group),glyph:Object.assign({},$i.glyph)};class Ki{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Vi.forEach((t=>{this._defaultTheme[t]=Object.create(Yi[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.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 n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const i=this.getParentWithTheme(t);if(i){const t=i.theme;(t.dirty||n)&&t.applyTheme(i,e,!0)}this.userTheme?this.doCombine(i&&i.theme.combinedTheme):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,Yt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this.combinedTheme;Vi.forEach((i=>{const r=Object.create(Yi[i]);t&&t[i]&&Xi(r,t[i]),n[i]&&Xi(r,n[i]),e[i]&&Xi(r,e[i]),this.combinedTheme[i]=r})),e.common&&Vi.forEach((t=>{Xi(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach((e=>{n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,this.userTheme=n,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 qi=new Ki;function Qi(t,e){return t.glyphHost?Qi(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)):qi.getTheme()}return null}(t)||t.attachedThemeGraphic&&Qi(t.attachedThemeGraphic)||qi.getTheme()}var Zi=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class Ji extends a{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=U.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,n=0;for(;e;){if(t(e,n++))return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){if(t(e,n++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Zi(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&Yt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let n=this._firstChild;for(let t=0;t<e;t++){if(!n)return null;t>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._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 n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}let n;this._nodeList[e]=t;for(let t=e-1;t>=0&&(n=this._nodeList[t],!n);t--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const i=this.insertInto(t,0);return this._ignoreWarn=!1,i}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],n=null;return this.forEachChildren(((e,i)=>!(e===this||!t(e,i)||(n=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren(((e,i)=>{e!==this&&t(e,i)&&n.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}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 n=0;n<t;n++){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 n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._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,n){const i=vt(n,!0)&&n||At(n)&&n.capture,r=At(n)&&n.once,s=xt(e)?void 0:e;return t=i?`${t}capture`:t,e=xt(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const i=vt(n,!0)&&n||At(n)&&n.capture,r=xt(e)?void 0:e;t=i?`${t}capture`:t,e=xt(e)?e:e.handleEvent;const s=At(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return At(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return super.emit(t.type,t,...n),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class tr{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=tr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const n=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(n),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&xt(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&&xt(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class er extends tr{constructor(t,e){super(),this.type=t,this.detail=e}}const nr={dispatchEvent(t){var e;if(!(t instanceof tr))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 er(t,e))}};class ir{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-ir.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ir.bounceIn(2*t):.5*ir.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const i=e/te*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*te/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const i=e/te*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*te/e)+1}}static getElasticInOut(t,e){return function(n){const i=e/te*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*te/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*te/e)*.5+1}}static registerFunc(t,e){ir[t]=e}}function rr(t,e){const n=1/e;let i=1;for(;t>n;)t-=n,i*=-1;const r=i*t/n;return r>0?r:1+r}ir.quadIn=ir.getPowIn(2),ir.quadOut=ir.getPowOut(2),ir.quadInOut=ir.getPowInOut(2),ir.cubicIn=ir.getPowIn(3),ir.cubicOut=ir.getPowOut(3),ir.cubicInOut=ir.getPowInOut(3),ir.quartIn=ir.getPowIn(4),ir.quartOut=ir.getPowOut(4),ir.quartInOut=ir.getPowInOut(4),ir.quintIn=ir.getPowIn(5),ir.quintOut=ir.getPowOut(5),ir.quintInOut=ir.getPowInOut(5),ir.backIn=ir.getBackIn(1.7),ir.backOut=ir.getBackOut(1.7),ir.backInOut=ir.getBackInOut(1.7),ir.elasticIn=ir.getElasticIn(1,.3),ir.elasticOut=ir.getElasticOut(1,.3),ir.elasticInOut=ir.getElasticInOut(1,.3*1.5),ir.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),ir.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},ir.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)ir[`flicker${t}`]=e=>rr(e,t);for(let t=2;t<10;t++)ir[`aIn${t}`]=e=>t*e*e+(1-t)*e;const sr=new class{constructor(){this.id=U.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===on.END?this.removeAnimate(e):e.status===on.RUNNING||e.status===on.INITIAL?(this.animateCount++,e.advance(t)):e.status===on.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class ar{constructor(t,e,n,i,r){this.from=t,this.to=e,this.duration=n,this.easing=i,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,n){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(n[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,n),t&&this.onEnd()}}class or extends ar{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class lr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sr,n=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||sr,this.status=on.INITIAL,this.tailAnimate=new hr(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=n}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=re(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){lr.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]:lr.mode;t&&e&ln.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:an.ANIMATE_PLAY})}runCb(t){const e=new or((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,n,i,r,s){const a=lr.interpolateMap.get(t)||lr.interpolateMap.get("");return!!a&&a(t,e,n,i,r,s)}pause(){this.status===on.RUNNING&&(this.status=on.PAUSED)}resume(){this.status===on.PAUSED&&(this.status=on.RUNNING)}to(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),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 hr(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===on.INITIAL&&(this.status=on.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===on.RUNNING&&(this.status=on.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,n=0;const i=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===i)return s;for(let i=0;i<this.subAnimates.length&&(e=this.subAnimates[i],!(n+e.totalDuration>=t));i++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=on.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()}}lr.mode=ln.NORMAL,lr.interpolateMap=new Map;class hr{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 ur(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 n=t.easing,i="string"==typeof n?ir[n]:n,r=this._addStep(e,null,i);return r.type=hn.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,n,i){(null==e||e<0)&&(e=0);const r="string"==typeof n?ir[n]:n,s=this._addStep(e,null,r);return s.type=hn.to,this._appendProps(t,s,!!i&&i.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),i&&i.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(s.propKeys)})),this}from(t,e,n,i){this.to(t,0,n,i);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{r[t]=this.getLastPropByName(t,this.stepTail)})),this.to(r,e,n,i),this.stepTail.type=hn.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=hn.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,n){const i=new ur(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}_appendProps(t,e,n){e.props=n?t:Object.assign({},t);let i=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));i.prev;)i.props&&(i.propKeys||(i.propKeys=Object.keys(i.props)),i.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=i.props[t])}))),e.propKeys=Object.keys(e.props),i=i.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const n=this.duration,i=this.loop,r=this.rawPosition;let s,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,n<=0&&(o=!0,n<0))return o;if(s=Math.floor(t/n),a=t-s*n,o=t>=i*n+n,o&&(a=n,s=i,t=a*s+n),t===r)return o;const h=!this.reversed!=!(this.bounce&&s%2);return h&&(a=n-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let n=this.stepHead.next;const i=this.position,r=this.duration;if(this.target&&n){let s=n.next;for(;s&&s.position<=i;)n=s,s=n.next;let a=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(a=n.easing(a)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,a,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(n,a)))}}tryCallCustomAnimateLifeCycle(t,e,n){if(t!==e)if(n){let n=e.prev;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let n=e.next;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=n.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let n=e.prev;for(;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){const e=n.customAnimate.getEndProps()[t];if(void 0!==e)return e}n=n.prev}return Yt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}class ur{constructor(t,e,n,i){this.duration=e,this.position=t,this.props=n,this.easing=i}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 cr=200,dr="cubicOut";var fr;!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"}(fr||(fr={}));const pr=[0,0,0,0],gr=t=>t?Ct(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(pr[0]=t[0],pr[2]=t[0],pr[1]=t[1],pr[3]=t[1],pr):t:t:0,mr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],br=[1,2,3,0,1,2,3,0];function yr(t,e,n,i){for(;t>=te;)t-=te;for(;t<0;)t+=te;for(;t>e;)e+=te;mr[0].x=n,mr[1].y=n,mr[2].x=-n,mr[3].y=-n;const r=Math.ceil(t/Zt)%4,s=Math.ceil(e/Zt)%4;if(i.add(ie(t)*n,ae(t)*n),i.add(ie(e)*n,ae(e)*n),r!==s||e-t>Qt){let t=!1;for(let e=0;e<br.length;e++)if(t||r!==br[e]){if(t&&s===br[e])break;if(t){const t=mr[br[e]];i.add(t.x,t.y)}}else{t=!0;const e=mr[r];i.add(e.x,e.y)}}}const vr=(t,e)=>{const n=((t,e)=>Bt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(n)?n:Math.max(e,n)};var xr;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(xr||(xr={}));class _r{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xr.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===xr.Color1){const e=_r.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;const i=Re.parseColorString(t);if(i){const e=[i.r/255,i.g/255,i.b/255,i.opacity];_r.store1[t]=e,_r.store255[t]=[i.r,i.g,i.b,i.opacity],n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}const i=_r.store255[t];if(i)return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n;const r=Re.parseColorString(t);return r&&(_r.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],_r.store255[t]=[r.r,r.g,r.b,r.opacity],n[0]=r.r,n[1]=r.g,n[2]=r.b,n[3]=r.opacity),n}static Set(t,e,n){if(e===xr.Color1){if(_r.store1[t])return;_r.store1[t]=n,_r.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(_r.store255[t])return;_r.store255[t]=n,_r.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Sr(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&Mt(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 Ar(t,e,n,i,r){return Array.isArray(t)&&!Mt(t[0])||Array.isArray(e)&&!Mt(e[0])?new Array(4).fill(0).map(((r,s)=>wr(Ct(t)?t[s]:t,Ct(e)?e[s]:e,n,i))):wr(t,e,n,i,r)}function wr(t,e,n,i,r){if(!t||!e)return t&&Sr(t)||e&&Sr(e)||!1;let s,a,o=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=_r.Get(t,xr.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=_r.Get(e,xr.Color255):l=!0,o!==l){const s=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:Sr(a)})))});return o?Ar(s,l,n,i,r):Ar(l,s,n,i,r)}if(o){if(t.gradient===e.gradient){const i=t,r=e,s=i.stops,a=r.stops;if(s.length!==a.length)return!1;if("linear"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:Cr(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("radial"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:Cr(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("conical"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:Cr(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n)}return!1}return r&&r(s,a),Sr(function(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}(s,a,n),i)}_r.store255={},_r.store1={};const Tr=[0,0,0,0],Br=[0,0,0,0];function Cr(t,e,n){return _r.Get(t,xr.Color255,Tr),_r.Get(e,xr.Color255,Br),`rgba(${Math.round(Tr[0]+(Br[0]-Tr[0])*n)},${Math.round(Tr[1]+(Br[1]-Tr[1])*n)},${Math.round(Tr[2]+(Br[2]-Tr[2])*n)},${Tr[3]+(Br[3]-Tr[3])*n})`}class kr{static GetImage(t,e){var n;const i=kr.cache.get(t);i?"fail"===i.loadState?Bi.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):kr.loadImage(t,e)}static GetSvg(t,e){var n;let i=kr.cache.get(t);i?"fail"===i.loadState?Bi.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&e.imageLoadSuccess(t,i.data):(i={type:"image",loadState:"init"},kr.cache.set(t,i),i.dataPromise=Bi.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))})),i.waitingMark&&(i.waitingMark=[])}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=kr.cache.get(t);return n?"fail"===n.loadState?Promise.reject():"init"===n.loadState||"loading"===n.loadState?n.dataPromise.then((t=>t.data)):Promise.resolve(n.data):(n={type:e,loadState:"init"},kr.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=Bi.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=Bi.global.loadBlob(t):"json"===e&&(n.dataPromise=Bi.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!kr.isLoading&&kr.toLoadAueue.length){kr.isLoading=!0;const t=kr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:n,marks:i}=t,r={type:"image",loadState:"init"};if(kr.cache.set(n,r),r.dataPromise=Bi.global.loadImage(n),r.dataPromise){r.waitingMark=i;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,i)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(n,t.data)):(r.loadState="fail",e.imageLoadFail(n))})),r.waitingMark&&(r.waitingMark=[])}));e.push(t)}else r.loadState="fail",i.forEach((t=>t.imageLoadFail(n)))})),Promise.all(e).then((()=>{kr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),kr.loading()})).catch((t=>{kr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),kr.loading()}))}}),0)}static loadImage(t,e){const n=Mr(t,kr.toLoadAueue);if(-1!==n)return kr.toLoadAueue[n].marks.push(e),void kr.loading();kr.toLoadAueue.push({url:t,marks:[e]}),kr.loading()}static improveImageLoading(t){const e=Mr(t,kr.toLoadAueue);if(-1!==e){const t=kr.toLoadAueue.splice(e,1);kr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Mr(t,e){for(let n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}kr.cache=new Map,kr.isLoading=!1,kr.toLoadAueue=[],kr.onLoadSuccessCb=[];class Pr{bounds(t,e){if(Mt(t)){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return Mt(t)?t:Math.min(t[0],t[1])}}function Er(t,e,n,i,r){return r?t.arc(n,i,e,0,Jt,!1,r):t.arc(n,i,e,0,Jt),!1}var Or=new class extends Pr{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,n,i,r){return Er(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return Er(t,this.parseSize(e)/2+r,n,i,s)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var Lr=new class extends Pr{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,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r)}drawOffset(t,e,n,i,r,s){return function(t,e,n,i,r,s){return t.moveTo(-3*e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-3*e+i-r,s),t.lineTo(e+n+r,-3*e+i-r,s),t.lineTo(e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,e+i+r,s),t.lineTo(e+n+r,e+i+r,s),t.lineTo(e+n+r,3*e+i+r,s),t.lineTo(-e+n-r,3*e+i+r,s),t.lineTo(-e+n-r,e+i+r,s),t.lineTo(-3*e+n-r,e+i+r,s),t.closePath(),!0}(t,this.parseSize(e)/6,n,i,r,s)}};function Rr(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var Ir=new class extends Pr{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,i,r){return Rr(t,this.parseSize(e)/2,n,i,r)}drawFitDir(t,e,n,i,r){return Rr(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return Rr(t,this.parseSize(e)/2+r,n,i,s)}};function Nr(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var Ur=new class extends Pr{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return Nr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Nr(t,this.parseSize(e)/2+r,n,i)}};function Dr(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}class zr extends Pr{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,i){return Dr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Dr(t,this.parseSize(e)/2,n,i,r)}}var Wr=new zr;var Fr=new class extends zr{constructor(){super(...arguments),this.type="triangle"}};const jr=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Hr=Math.sin(Jt/10)*jr,Gr=-Math.cos(Jt/10)*jr;function $r(t,e,n,i){const r=Hr*e,s=Gr*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let a=1;a<5;++a){const o=Jt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+n,-l*e+i),t.lineTo(l*r-h*s+n,h*r+l*s+i)}return t.closePath(),!0}var Vr=new class extends Pr{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,n,i){return $r(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return $r(t,this.parseSize(e)/2+r,n,i)}};const Xr=oe(3);function Yr(t,e,n,i){const r=e,s=r/Xr,a=s/5,o=e;return t.moveTo(0+n,-r+i),t.lineTo(s/2+n,i),t.lineTo(a/2+n,i),t.lineTo(a/2+n,o+i),t.lineTo(-a/2+n,o+i),t.lineTo(-a/2+n,i),t.lineTo(-s/2+n,i),t.closePath(),!0}var Kr=new class extends Pr{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,n,i){return Yr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Yr(t,this.parseSize(e)/2+r,n,i)}};function qr(t,e,n,i){const r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var Qr=new class extends Pr{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return qr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return qr(t,this.parseSize(e)/2+r,n,i)}};function Zr(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Jr=new class extends Pr{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,i){return Zr(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Zr(t,this.parseSize(e)/2+r,n,i)}};const ts=-.5,es=oe(3)/2,ns=1/oe(12);function is(t,e,n,i){const r=e/2,s=e*ns,a=r,o=e*ns+e,l=-a,h=o;return t.moveTo(r+n,s+i),t.lineTo(a+n,o+i),t.lineTo(l+n,h+i),t.lineTo(ts*r-es*s+n,es*r+ts*s+i),t.lineTo(ts*a-es*o+n,es*a+ts*o+i),t.lineTo(ts*l-es*h+n,es*l+ts*h+i),t.lineTo(ts*r+es*s+n,ts*s-es*r+i),t.lineTo(ts*a+es*o+n,ts*o-es*a+i),t.lineTo(ts*l+es*h+n,ts*h-es*l+i),t.closePath(),!1}var rs=new class extends Pr{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,n,i){return is(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return is(t,this.parseSize(e)/2+r,n,i)}};function ss(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}var as=new class extends Pr{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,i){return ss(t,this.parseSize(e)/2,n,i,0)}drawOffset(t,e,n,i,r){return ss(t,this.parseSize(e)/2,n,i,r)}};function os(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}var ls=new class extends Pr{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,n,i){return os(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return os(t,this.parseSize(e)/2,n,i,r)}};function hs(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}var us=new class extends Pr{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,i){return hs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return hs(t,this.parseSize(e)/2,n,i,r)}};const cs=oe(3);function ds(t,e,n,i){const r=e*cs;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var fs=new class extends Pr{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return ds(t,this.parseSize(e)/2/cs,n,i)}drawOffset(t,e,n,i,r){return ds(t,this.parseSize(e)/2/cs+r,n,i)}};function ps(t,e,n,i){const r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var gs=new class extends Pr{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,n,i){return ps(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ps(t,this.parseSize(e)/4+r,n,i)}};function ms(t,e,n,i){const r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var bs=new class extends Pr{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,n,i){return ms(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ms(t,this.parseSize(e)/4+r,n,i)}};function ys(t,e,n,i){const r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var vs=new class extends Pr{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,n,i){return ys(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ys(t,this.parseSize(e)/4+r,n,i)}};function xs(t,e,n,i){const r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var _s=new class extends Pr{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,n,i){return xs(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return xs(t,this.parseSize(e)/4+r,n,i)}};function Ss(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var As=new class extends Pr{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return Ss(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return Ss(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e}, ${n-r} L ${e},${n+r}`}};function ws(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var Ts=new class extends Pr{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return ws(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return ws(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n} L ${e+r},${n}`}};function Bs(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var Cs=new class extends Pr{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,n,i,r){return Bs(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return Bs(t,this.parseSize(e)/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=this.parseSize(t)/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}};function ks(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function Ms(t,e,n,i){const r=e,s=e/2;return t.rect(n-r/2,i-s/2,r,s),!1}var Ps=new class extends Pr{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,n,i){return Mt(e)?Ms(t,e,n,i):ks(t,e,n,i)}drawWithClipRange(t,e,n,i,r,s,a){Mt(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*r,l=[{x:n+e[0]/2,y:i-e[1]/2},{x:n+e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i+e[1]/2},{x:n-e[0]/2,y:i-e[1]/2}];let h=0,u=l[3];t.moveTo(u.x,u.y);for(let e=0;e<l.length;e++){const n=l[e],i=Math.sqrt((n.x-u.x)*(n.x-u.x)+(n.y-u.y)*(n.y-u.y));if(h+i>o){const e=(n.x-u.x)*(o-h)/i,r=(n.y-u.y)*(o-h)/i;t.lineTo(u.x+e,u.y+r);break}t.lineTo(n.x,n.y),u=n,h+=i}return!1}drawOffset(t,e,n,i,r){return Mt(e)?Ms(t,e+2*r,n,i):ks(t,[e[0]+2*r,e[1]+2*r],n,i)}};const Es=new _e;class Os{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,Ct(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),mn(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(mn(this.path.commandList,t,n,i,e+r,e+r),!1)}draw(t,e,n,i,r,s){return e=this.parseSize(e),this.drawOffset(t,e,n,i,0,r,s)}parseSize(t){return Mt(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,n,i,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{s.path.drawWithClipRange(t,e,n,i,r),a&&a(s.path,s.attribute)})),!1):(this.path.drawWithClipRange(t,e,n,i,r),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((n=>{let{path:i}=n;Es.x1=i.bounds.x1*t,Es.y1=i.bounds.y1*t,Es.x2=i.bounds.x2*t,Es.y2=i.bounds.y2*t,e.union(Es)}))}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 Ls={};[Or,Lr,Ir,Ur,fs,Fr,Vr,Kr,Qr,Jr,rs,as,ls,Wr,us,gs,bs,vs,_s,Ps,As,Ts,Cs].forEach((t=>{Ls[t.type]=t}));const Rs={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class Is{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 Ns(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function Us(t,e,n){const i=function(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!i)return;let r=i.data;const s=i.index,a=r.search(/\s/);let o=r,l=!0;-1!==a&&(o=r.substr(0,a).replace(/\s\s*$/,""),r=r.substr(a+1));const h=o;if(n){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==i.data.substr(t+1))}return{tagName:o,tagExp:r,closeIndex:s,attrExpPresent:l,rawTagName:h}}const Ds=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class zs{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,n){const i=e.tagname;"string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,n){const i={};if(!t)return;const r=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n}(t,Ds),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],n=r[t][4];e&&(i[e]=void 0===n||(isNaN(n)?n:Number(n)))}return i}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Is("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=Ns(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),n=this.tagsNodeStack.pop(),n&&n.child&&i&&n.child[n.child.length-1][":@"]&&(n.child[n.child.length-1][":@"].text=i),i="",s=e}else if("?"===t[s+1])s=Us(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=Ns(t,"--\x3e",s+4,"Comment is not closed.");else{const a=Us(t,s,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,u=a.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),l=o):l=l.substr(0,l.length-1);const t=new Is(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Is(o);this.tagsNodeStack.push(n),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),n=t}i="",s=u}else i+=t[s];return e.child}}function Ws(t,e){return Fs(t)}function Fs(t,e){const n={};for(let e=0;e<t.length;e++){const r=t[e],s=js(r);if(void 0!==s&&r[s]){const t=Fs(r[s]);i=t,Object.keys(i).length,r[":@"]&&Hs(t,r[":@"]),void 0!==n[s]&&n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[n[s]]),n[s].push(t)):n[s]=t}}var i;return n}function js(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Hs(t,e,n){if(e){const n=Object.keys(e),i=n.length;for(let r=0;r<i;r++){const i=n[r];t[i]=e[i]}}}class Gs{constructor(t){this.options=Object.assign({},Gs.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Ws(new zs(this.options).parseXml(t),this.options)}}function $s(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}Gs.defaultOptions={};let Vs=0;function Xs(){return Vs++}var Ys;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Ys||(Ys={}));const Ks=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ks.set(t,!0)));const qs=new Map;function Qs(t){if(Ks.has(t))return!0;if(qs.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>qs.set(t,!0)));const Zs=Xs();Xs(),Xs(),Xs(),Xs();const Js=Xs(),ta=Xs();Xs(),Xs(),Xs(),Xs();const ea=Xs();Xs();const na=Xs();Xs();const ia=Xs(),ra=Xs(),sa=Symbol.for("GraphicCreator"),aa={"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"},oa=Object.keys(aa),la=new _e,ha=new Ae;new _e;const ua=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ca=["x","y"],da=["scaleX","scaleY"],fa=["angle"],pa=new ue,ga={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 ma extends Ji{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(ma.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new _e,this._updateTag=rn.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 n,i;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;pa.x=r+(null!==(n=t.scrollX)&&void 0!==n?n:0),pa.y=s+(null!==(i=t.scrollY)&&void 0!==i?i:0)}else pa.x=r,pa.y=s;return pa}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Bi.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return Bi.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new Se),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let n=this.clipPathMap.get(e)||null;return n||(this.clipPathMap.size>10&&this.clipPathMap.clear(),n=this.parsePath(e),n&&this.clipPathMap.set(e,n)),n}parsePath(t){if(!t)return null;let e=Ls[t];if(e)return e;if(e=ma.userSymbolMap[t],e)return e;if(!0===((n=t=Rs[t]||t).startsWith("<svg")||n.startsWith("<?xml"))){const e=new Gs,{svg:n}=e.parse(t);if(!n)return null;const i=Ct(n.path)?n.path:[n.path];la.clear();const r=[];i.forEach((t=>{const e=(new ei).fromString(t.d),n={};oa.forEach((e=>{t[e]&&(n[aa[e]]=t[e])})),r.push({path:e,attribute:n}),la.union(e.bounds)}));const s=la.width(),a=la.height(),o=1/re(s,a);r.forEach((t=>t.path.transform(0,0,o,o)));const l=new Os(t,r,!0);return ma.userSymbolMap[t]=l,l}var n;const i=(new ei).fromString(t),r=i.bounds.width(),s=i.bounds.height(),a=1/re(r,s);i.transform(0,0,a,a);const o=new Os(t,i);return ma.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,i=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,s=gr(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const n=new De(t);return mn(e.commandList,n,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 Ae),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&rn.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&Bi.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&rn.UPDATE_BOUNDS)&&Bi.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&rn.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&rn.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&rn.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&rn.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=rn.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===sn.GLOBAL){const n=new ue(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,n)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=Object.keys(t);for(let e=0;e<i.length;e++){const n=i[e];this.attribute[n]=t[n]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,i){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);s?this._setAttributes(s,n,i):_t(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):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]:ua;for(let n=0;n<e.length;n++){const i=e[n];if(-1!==t.indexOf(i))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ua;for(let n=0;n<e.length;n++)if(t===e[n])return!0;return!1}initAttributes(t){const e={type:an.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=rn.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:an.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ca,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const a=this.attribute,o=a.postMatrix;return o?Bi.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:ri.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:ri.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const i={type:an.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ca,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}scale(t,e,n){var i,r;if(1===t&&1===e)return this;const s={type:an.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,da,s);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(n){let{postMatrix:i}=this.attribute;i||(i=new Ae,o.postMatrix=i),Bi.transformUtil.fromMatrix(i,i).scale(t,e,n)}else o.scaleX=(null!==(i=o.scaleX)&&void 0!==i?i:ri.scaleX)*t,o.scaleY=(null!==(r=o.scaleY)&&void 0!==r?r:ri.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const i={type:an.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,da,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}rotate(t,e){var n;if(0===t)return this;const i={type:an.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,fa,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new Ae,s.postMatrix=n),Bi.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:ri.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:an.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,fa,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const n=new lr(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(n.bind(this),t){const{onStart:e,onFrame:i,onEnd:r,onRemove:s}=t;null!=e&&n.onStart(e),null!=i&&n.onFrame(i),null!=r&&n.onEnd(r),null!=s&&n.onRemove(s),n.interpolateFunc=t.interpolate}return this.animates.set(n.id,n),n.onRemove((()=>{n.stop(),this.animates.delete(n.id)})),n}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Bi.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!_t(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,n,i){var r,s,a,o;if(n){const n=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let u;n.forEach((e=>{l[e]?(u||(u={}),u[e]=t[e]):h[e]=i&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(h,null!==(s=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==s?s:cr,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:dr),u&&this.setAttributes(u,!1,{type:an.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:an.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((n=>{if(n.stateNames){const i=n.getEndProps();zt(i,t)&&(e=i[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const n=Ct(t)?e=>!t.includes(e):e=>e!==t,i=this.currentStates.filter(n);i.length!==this.currentStates.length&&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 n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var i;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{var n;const r=this.stateProxy?this.stateProxy(e,t):null===(n=this.states)||void 0===n?void 0:n[e];r&&Object.assign(i,r)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=rn.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=rn.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=rn.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&rn.UPDATE_SHAPE_AND_BOUNDS)===rn.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=rn.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=rn.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=rn.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=rn.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=rn.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=rn.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=rn.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&rn.UPDATE_LAYOUT)}getAnchor(t,e,n){const i=[0,0],r=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,n&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=r();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=r();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=ri.x,y:e=ri.y,scaleX:n=ri.scaleX,scaleY:i=ri.scaleY,angle:r=ri.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&r&&(l=this.getAnchor(a,h)),!s||1===n&&1===i)!function(t,e,n,i,r,s,a,o){const l=e.a,h=e.b,u=e.c,c=e.d,d=e.e,f=e.f,p=ie(a),g=ae(a);let m,b;o?(m=o[0],b=o[1]):(m=n,b=i);const y=m-n,v=b-i,x=l*p+u*g,_=h*p+c*g,S=u*p-l*g,A=c*p-h*g;t.a=r*x,t.b=r*_,t.c=s*S,t.d=s*A,t.e=d+l*m+u*b-x*y-S*v,t.f=f+h*m+c*b-_*y-A*v}(this._transMatrix,this._transMatrix.reset(),t,e,n,i,r,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(r),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(s,h,!0),Bi.transformUtil.fromMatrix(a,a).scale(n,i,{x:l[0],y:l[1]})}const u=this.getOffsetXY(ri);if(this._transMatrix.e+=u.x,this._transMatrix.f+=u.y,o){const t=ha.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline===sr&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Bi.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:an.ANIMATE_END})}onStep(t,e,n,i,r){const s={};if(n.customAnimate)n.customAnimate.update(r,i,s);else{const a=n.props,o=n.parsedProps,l=n.propKeys;this.stepInterpolate(t,e,s,n,i,r,a,void 0,o,l)}this.setAttributes(s,!1,{type:an.ANIMATE_UPDATE,animationState:{ratio:i,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,n,i,r,s,a,o,l,h){h||(h=Object.keys(a),i.propKeys=h),s?i.propKeys.forEach((t=>{e.validAttr(t)&&(n[t]=a[t])})):h.forEach((s=>{var h;if(!e.validAttr(s))return;const u=a[s],c=null!==(h=o&&o[s])&&void 0!==h?h:t.getLastPropByName(s,i);if(null==u||null==c||u===c)return void(n[s]=u);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,c,u,n),d||(d=e.customInterpolate(s,r,c,u,this,n),d||this.defaultInterpolate(u,c,s,n,l,r)||this._interpolate(s,r,c,u,n))})),i.parsedProps=l}defaultInterpolate(t,e,n,i,r,s){if(Number.isFinite(t)&&Number.isFinite(e))return i[n]=e+(t-e)*s,!0;if("fill"===n){r||(r={});const a=r.fillColorArray,o=Ar(e,null!=a?a:t,s,!1,((t,e)=>{r.fillColorArray=e}));return o&&(i[n]=o),!0}if("stroke"===n){r||(r={});const a=r.strokeColorArray,o=Ar(e,null!=a?a:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return o&&(i[n]=o),!0}if("shadowColor"===n){r||(r={});const a=r.shadowColorArray,o=Ar(e,null!=a?a:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(i[n]=o),!0}if(Array.isArray(t)&&t.length===e.length){const r=[];let a=!0;for(let n=0;n<t.length;n++){const i=e[n],o=i+(t[n]-i)*s;if(!Number.isFinite(o)){a=!1;break}r.push(o)}a&&(i[n]=r)}return!1}_interpolate(t,e,n,i,r){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Bi.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return Bt(t,!0)?this.pathProxy=(new ei).fromString(t):this.pathProxy=new ei,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 n=t;this.resources||(this.resources=new Map);const i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",t.startsWith("<svg")?(kr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(Et(t)||t.includes("/")||Ot(t))&&(kr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):At(t)?(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e):i.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,n){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),Bi.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new er(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}var ba;ma.userSymbolMap={},ma.mixin(nr),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ba||(ba={}));let ya=class t extends ma{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Js,this._childUpdateTag=rn.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 Ki),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Ki)}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,n){if(n===sn.GLOBAL){const n=new ue(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&rn.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Bi.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Bi.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=ri.x,y:e=ri.y,dx:n=ri.dx,dy:i=ri.dy,scaleX:r=ri.scaleX,scaleY:s=ri.scaleY,angle:a=ri.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==n||0!==i||1!==r||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Qi(this).group}updateAABBBounds(t,e,n){const i=n;n=n.clone();const{width:r,height:s,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{n.union(t.AABBBounds)})):null!=r&&null!=s&&n.set(0,0,Math.max(0,r),Math.max(0,s)),!o){this.forEachChildren((t=>{n.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:i=0}=t;n.translate(e,i)}return Bi.graphicService.updateTempAABBBounds(n),Bi.graphicService.transformAABBBounds(t,n,e,!1,this),i.copy(n),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=rn.CLEAR_BOUNDS,this._childUpdateTag&=rn.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=rn.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&rn.UPDATE_BOUNDS||(this._childUpdateTag|=rn.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(),Bi.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Bi.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 n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}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,Bi.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{Bi.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),Bi.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&rn.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,n){let i=this._getChildByName(t);return i?i.setAttributes(e):(i=Bi.graphicService.creator[n](e),i.name=t,this.add(i)),i}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}};function va(t){return new ya(t)}function xa(t,e){return!(!t&&!e)}function _a(t,e){let n;return n=Ct(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function Sa(t,e,n){return n&&t*e>0}function Aa(t,e){return t*e>0}ya.NOWORK_ANIMATE_ATTR=ga;const wa=Symbol.for("ImageRenderContribution"),Ta=Symbol.for("RectRenderContribution"),Ba=Symbol.for("SymbolRenderContribution"),Ca=Symbol.for("TextRenderContribution"),ka=Symbol.for("InteractiveSubRenderContribution");function Ma(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Pa(t,e,n){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:(n||(n=e),-(e-n)/2-.79*n)}function Ea(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 Oa(t,e,n){const i=n[0],r=n[1],s=n[2];let a,o,l,h,u,c,d,f,p,g,m,b;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],u=e[4],c=e[5],d=e[6],f=e[7],p=e[8],g=e[9],m=e[10],b=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=u,t[5]=c,t[6]=d,t[7]=f,t[8]=p,t[9]=g,t[10]=m,t[11]=b,t[12]=a*i+u*r+p*s+e[12],t[13]=o*i+c*r+g*s+e[13],t[14]=l*i+d*r+m*s+e[14],t[15]=h*i+f*r+b*s+e[15]),t}function La(t,e,n){const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],h=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],b=e[14],y=e[15];let v=n[0],x=n[1],_=n[2],S=n[3];return t[0]=v*i+x*o+_*c+S*g,t[1]=v*r+x*l+_*d+S*m,t[2]=v*s+x*h+_*f+S*b,t[3]=v*a+x*u+_*p+S*y,v=n[4],x=n[5],_=n[6],S=n[7],t[4]=v*i+x*o+_*c+S*g,t[5]=v*r+x*l+_*d+S*m,t[6]=v*s+x*h+_*f+S*b,t[7]=v*a+x*u+_*p+S*y,v=n[8],x=n[9],_=n[10],S=n[11],t[8]=v*i+x*o+_*c+S*g,t[9]=v*r+x*l+_*d+S*m,t[10]=v*s+x*h+_*f+S*b,t[11]=v*a+x*u+_*p+S*y,v=n[12],x=n[13],_=n[14],S=n[15],t[12]=v*i+x*o+_*c+S*g,t[13]=v*r+x*l+_*d+S*m,t[14]=v*s+x*h+_*f+S*b,t[15]=v*a+x*u+_*p+S*y,t}class Ra{constructor(){this.pools=[]}static identity(t){return Ea(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 Ra.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 n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const Ia=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new Ae(t,e,n,i,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=n,a.d=i,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new Ae(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=[]}},Na=new Ra;var Ua=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Da=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},za=function(t,e){return function(n,i){e(n,i,t)}};function Wa(t,e,n){var i;const{x:r=n.x,y:s=n.y,z:a=n.z,dx:o=n.dx,dy:l=n.dy,dz:h=n.dz,scaleX:u=n.scaleX,scaleY:c=n.scaleY,scaleZ:d=n.scaleZ,alpha:f=n.alpha,beta:p=n.beta,angle:g=n.angle,anchor3d:m=e.attribute.anchor,anchor:b}=e.attribute,y=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;y[0]=n.x1+(n.x2-n.x1)*t}else y[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;y[1]=n.x1+(n.x2-n.x1)*t}else y[1]=m[1];y[2]=null!==(i=m[2])&&void 0!==i?i:0}if(Ea(t),Oa(t,t,[r+o,s+l,a+h]),Oa(t,t,[y[0],y[1],y[2]]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[4],a=e[5],o=e[6],l=e[7],h=e[8],u=e[9],c=e[10],d=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]=s*r+h*i,t[5]=a*r+u*i,t[6]=o*r+c*i,t[7]=l*r+d*i,t[8]=h*r-s*i,t[9]=u*r-a*i,t[10]=c*r-o*i,t[11]=d*r-l*i}(t,t,p),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],h=e[8],u=e[9],c=e[10],d=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]=s*r-h*i,t[1]=a*r-u*i,t[2]=o*r-c*i,t[3]=l*r-d*i,t[8]=s*i+h*r,t[9]=a*i+u*r,t[10]=o*i+c*r,t[11]=l*i+d*r}(t,t,f),Oa(t,t,[-y[0],-y[1],y[2]]),function(t,e,n){const i=n[0],r=n[1],s=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[u,c,d]),g){const n=Na.allocate(),i=[0,0];if(b){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,n=e.AABBBounds;i[0]=n.x1+(n.x2-n.x1)*t}else i[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,n=e.AABBBounds;i[1]=n.x1+(n.x2-n.x1)*t}else i[1]=m[1]}Oa(n,n,[i[0],i[1],0]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],a=e[1],o=e[2],l=e[3],h=e[4],u=e[5],c=e[6],d=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]=s*r+h*i,t[1]=a*r+u*i,t[2]=o*r+c*i,t[3]=l*r+d*i,t[4]=h*r-s*i,t[5]=u*r-a*i,t[6]=c*r-o*i,t[7]=d*r-l*i}(n,n,g),Oa(n,n,[-i[0],-i[1],0]),La(t,t,n)}}let Fa=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new gt(["graphic"]),onSetStage:new gt(["graphic","stage"]),onRemove:new gt(["graphic"]),onRelease:new gt(["graphic"]),onAddIncremental:new gt(["graphic","group","stage"]),onClearIncremental:new gt(["graphic","group","stage"]),beforeUpdateAABBBounds:new gt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new gt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new gt(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new _e,this.tempAABBBounds2=new _e}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,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}afterUpdateAABBBounds(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}clearAABBBounds(t,e,n){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,n)}updatePathProxyAABBBounds(t,e){const n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;const i=new De(t);return mn(n.commandList,i,0,0),!0}updateHTMLTextAABBBounds(t,e,n,i){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=Mt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),i=Pa(s,e,e);n.set(n.x1,i,n.x2,i+e)}if(null!=t.forceBoundsWidth){const e=Mt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),i=Ma(r,e);n.set(i,n.y1,i+e,n.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const n=e.shadowRoot.AABBBounds;t.union(n)}}transformAABBBounds(t,e,n,i,r){if(!e.empty()){const{scaleX:r=n.scaleX,scaleY:s=n.scaleY,stroke:a=n.stroke,shadowBlur:o=n.shadowBlur,lineWidth:l=n.lineWidth,pickStrokeBuffer:h=n.pickStrokeBuffer,strokeBoundsBuffer:u=n.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){$s(c,(l+h)/Math.abs(r+s),i,u),e.union(c),c.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:i=n.shadowOffsetX,shadowOffsetY:a=n.shadowOffsetY}=t;$s(c,o/Math.abs(r+s)*2,!1,u+1),c.translate(i,a),e.union(c)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const a=r.transMatrix;r&&r.isContainer&&(s=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),s&&ve(e,e,a)}validCheck(t,e,n,i){if(!i)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(i.shadowRoot||i.isContainer)return!0;const{visible:r=e.visible}=t;return!(!i.valid||!r)||(n.empty()||(i.parent&&n.transformWithMatrix(i.parent.globalTransMatrix),Bi.graphicService.clearAABBBounds(i,i.stage,n),n.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,n=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),n.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:n}}};Fa=Ua([K(),za(0,X(sa)),Da("design:paramtypes",[Object])],Fa);const ja=(t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur}=t;if(i){const t=e.outerBorder,{distance:s=t.distance,lineWidth:a=t.lineWidth}=i;n.expand(s+(r+a)/2)}return n};class Ha{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n,i){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===n)t.yOffset=0;else if("middle"===n)t.yOffset=t.height/-2;else if("alphabetic"===n){let e=.79;if(1===i.length){const t=i[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=bt.actualBounding,keepCenterInLine:u=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const c=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let n=0,i=t.length;n<i;n++){const i=this.textMeasure.measureTextPixelADscentAndWidth(t[n],this.textOptions,h);let a=t[n].toString();if(i.width>o){const i=this.textMeasure.clipTextWithSuffix(t[n],this.textOptions,o,r,s,l);a=i.str,e=i.width}else e=i.width;c.push({str:a,width:e,ascent:i.ascent,descent:i.descent,keepCenterInLine:u})}d[0]=o}else{let e,n,i=0;for(let r=0,s=t.length;r<s;r++){n=t[r];const s=this.textMeasure.measureTextPixelADscentAndWidth(t[r],this.textOptions,h);e=s.width,i=Math.max(i,e),c.push({str:n,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:u})}d[0]=i}d[1]=c.length*i,d[0]=c.reduce(((t,e)=>Math.max(t,e.width)),0);const f={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(f,e,n,c),this.layoutWithBBox(f,c,e,n,i)}layoutWithBBox(t,e,n,i,r){const s=[0,0],a=e.length*r;"top"===i||("middle"===i?s[1]=(t.height-a)/2:"bottom"===i&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],n,i,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}lineOffset(t,e,n,i,r,s){if("left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=r/2+(e.ascent-e.descent)/2+s[1],!e.keepCenterInLine){const t=0,n=e.ascent+e.descent+t;if(n<r-t&&("bottom"===i?e.topOffset+=(r-n)/2:"top"===i&&(e.topOffset-=(r-n)/2)),"alphabetic"===i){const t=r/(e.ascent+e.descent);e.topOffset=r/2+(e.ascent-e.descent)/2*t+s[1]}}return s[1]+=r,e}}const Ga=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...ua];let $a=class t extends ma{get font(){const t=this.getGraphicTheme();return this._font||(this._font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);const{fontStyle:i=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(i?i+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*n+"px "+(o||"sans-serif")}(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=this.getGraphicTheme(),i=this.getMaxWidth(n);return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const n=this.getGraphicTheme(),i=this.attribute,r=this.getMaxWidth(n);if(!Number.isFinite(r))return!1;const{text:s}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(s)?s.join(""):s)!==t}return"vertical"===i.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==i.text.toString():null!=this.clipedText&&this.clipedText!==i.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=ra,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return Ct(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Qi(this).text}doUpdateOBBBounds(){const e=this.getGraphicTheme();this._OBBBounds.clear();const n=this.attribute,{angle:i=e.angle}=n;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 t({})),this.obbText.setAttributes(Object.assign(Object.assign({},n),{angle:0}));const r=this.obbText.AABBBounds,{x:s,y:a}=n,o={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2},l=me(o,i,{x:s,y:a});return this._OBBBounds.copy(r),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,n){const{text:i=e.text}=this.attribute;Array.isArray(i)?this.updateMultilineAABBBounds(i):this.updateSingallineAABBBounds(i);const{tb1:r}=Bi.graphicService.updateTempAABBBounds(n),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){$s(r,o/Math.abs(s+a),!0,l),n.union(r)}return Bi.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Bi.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,ve(n,n,this.transMatrix),n}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:n=e.direction,underlineOffset:i=e.underlineOffset}=this.attribute,r="horizontal"===n?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===n&&i&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+i),r}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const n=this.getGraphicTheme(),i=this.attribute,{fontFamily:r=n.fontFamily,textAlign:s=n.textAlign,textBaseline:a=n.textBaseline,fontSize:o=n.fontSize,fontWeight:l=n.fontWeight,ellipsis:h=n.ellipsis,maxLineWidth:u,stroke:c=n.stroke,wrap:d=n.wrap,measureMode:f=n.measureMode,lineWidth:p=n.lineWidth,whiteSpace:g=n.whiteSpace,suffixPosition:m=n.suffixPosition,ignoreBuf:b=n.ignoreBuf,keepCenterInLine:y=n.keepCenterInLine}=i,v=b?0:this.guessLineHeightBuf(o),x=this.getLineHeight(i,n,v);if("normal"===g||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}const _=Bi.graphicUtil.textMeasure,S=new Ha(r,{fontSize:o,fontWeight:l,fontFamily:r,lineHeight:x},_).GetLayoutByLines(t,s,a,x,!0===h?n.ellipsis:h||void 0,!1,{lineWidth:u,suffixPosition:m,measureMode:f,keepCenterInLine:y}),{bbox:A}=S;return this.cache.layoutData=S,this.clearUpdateShapeTag(),this._AABBBounds.set(A.xOffset,A.yOffset,A.xOffset+A.width,A.yOffset+A.height),c&&this._AABBBounds.expand(p/2),this._AABBBounds}updateWrapAABBBounds(t){var e,n,i;const r=this.getGraphicTheme(),{fontFamily:s=r.fontFamily,textAlign:a=r.textAlign,textBaseline:o=r.textBaseline,fontSize:l=r.fontSize,ellipsis:h=r.ellipsis,maxLineWidth:u,stroke:c=r.stroke,lineWidth:d=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:p=r.fontWeight,ignoreBuf:g=r.ignoreBuf,measureMode:m=r.measureMode,suffixPosition:b=r.suffixPosition,heightLimit:y=0,lineClamp:v,keepCenterInLine:x=r.keepCenterInLine}=this.attribute,_=g?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,r,_);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(d/2),this._AABBBounds}const A=Bi.graphicUtil.textMeasure,w={fontSize:l,fontWeight:p,fontFamily:s,lineHeight:S},T=new Ha(s,w,A),B=Ct(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[0,0];let M=1/0;if(y>0&&(M=Math.max(Math.floor(y/S),1)),v&&(M=Math.min(M,v)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<B.length;t++){const e=B[t];let r=!0;if(t===M-1){const n=A.clipTextWithSuffix(e,w,u,h,!1,b,t!==B.length-1),i=A.measureTextPixelADscentAndWidth(n.str,w,m);C.push({str:n.str,width:n.width,ascent:i.ascent,descent:i.descent,keepCenterInLine:x});break}const s=A.clipText(e,w,u,"break-all"!==f,"keep-all"===f);if(""!==e&&""===s.str||s.wordBreaked){if(h){const t=A.clipTextWithSuffix(e,w,u,h,!1,b);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(i=t.width)&&void 0!==i?i:0}else s.str="",s.width=0;r=!1}const a=A.measureTextPixelADscentAndWidth(s.str,w,m);C.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:x});let o=s.str.length;if(!s.wordBreaked||""!==e&&""===s.str||(r=!0,o=s.wordBreaked),s.str.length===e.length);else if(r){let n=e.substring(o);"keep-all"===f&&(n=n.replace(/^\s+/g,"")),B.splice(t+1,0,n)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,n=0;for(let i=0,r=B.length;i<r;i++){if(i===M-1){const t=A.clipTextWithSuffix(B[i],w,u,h,!1,b),e=A.measureTextPixelADscentAndWidth(t.str,w,m);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:x}),n=Math.max(n,t.width);break}e=B[i],t=A.measureTextWidth(e,w),n=Math.max(n,t);const r=A.measureTextPixelADscentAndWidth(e,w,m);C.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:x})}k[0]=n}k[1]=C.length*S;const P={xOffset:0,yOffset:0,width:k[0],height:k[1]};T.LayoutBBox(P,a,o,C);const E=T.layoutWithBBox(P,C,a,o,S);return this.cache.layoutData=E,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),c&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var n,i;const r=this.getGraphicTheme(),s=Bi.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=r.maxLineWidth,ellipsis:h=r.ellipsis,fontFamily:u=r.fontFamily,fontSize:c=r.fontSize,fontWeight:d=r.fontWeight,stroke:f=r.stroke,lineWidth:p=r.lineWidth,verticalMode:g=r.verticalMode,suffixPosition:m=r.suffixPosition}=o,b=this.getLineHeight(o,r,0);let{textAlign:y=r.textAlign,textBaseline:v=r.textBaseline}=o;if(!g){const e=y;y=null!==(n=t.baselineMapAlign[v])&&void 0!==n?n:"left",v=null!==(i=t.alignMapBaseline[e])&&void 0!==i?i:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=re(e,a)}));const t=Ma(y,a),e=this.cache.verticalList.length*b,n=Pa(v,e,c);return this._AABBBounds.set(n,t,n+e,t+a),f&&this._AABBBounds.expand(p/2),this._AABBBounds}const x=e.map((t=>function(t){const e=[];let n=0,i="";for(let r=0;r<t.length;r++)Qs(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:Ys.VERTICAL}),i="",n=0),e.push({text:t[r],direction:Ys.HORIZONTAL}));return i&&e.push({text:i,direction:Ys.VERTICAL}),e}(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const n=!0===h?r.ellipsis:h,i=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:d,fontFamily:u},l,n,!1,m);x[e]=i.verticalList,a=i.width}else{const n=s.clipTextVertical(t,{fontSize:c,fontWeight:d,fontFamily:u},l,!1);x[e]=n.verticalList,a=n.width}else a=0,t.forEach((t=>{const e=t.direction===Ys.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:d,fontFamily:u});a+=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);a=re(e,a)}));const _=Ma(y,a),S=this.cache.verticalList.length*b,A=Pa(v,S,c);return this._AABBBounds.set(A,_,A+S,_+a),f&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,n;const i=this.attribute;return null!==(n=null!==(e=i.maxLineWidth)&&void 0!==e?e:i.maxWidth)&&void 0!==n?n:t.maxWidth}getLineHeight(t,e,n){var i;return null!==(i=vr(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==i?i:(t.fontSize||e.fontSize)+n}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ga;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ga;return super.needUpdateTag(t,e)}_interpolate(t,e,n,i,r){"text"===t&&(r.text=i)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return t.baselineMapAlign}getAlignMapBaseline(){return t.alignMapBaseline}};function Va(t){return new $a(t)}$a.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},ga),$a.baselineMapAlign={top:"left",bottom:"right",middle:"center"},$a.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Xa=["heightLimit","lineClamp"];class Ya extends $a{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return Ct(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,n,i,r;const s=this.getGraphicTheme(),{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,ellipsis:u=s.ellipsis,maxLineWidth:c,stroke:d=s.stroke,lineWidth:f=s.lineWidth,wordBreak:p=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:m=s.ignoreBuf,heightLimit:b=0,suffixPosition:y=s.suffixPosition,lineClamp:v}=this.attribute,x=null!==(e=vr(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,_=m?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const S=Bi.graphicUtil.textMeasure,A=new Ha(a,{fontSize:h,fontWeight:g,fontFamily:a},S),w=t.map((t=>t.toString())),T=[],B=[0,0];let C=1/0;if(b>0&&(C=Math.max(Math.floor(b/x),1)),v&&(C=Math.min(C,v)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<w.length;t++){const e=w[t];let n=!0;if(t===C-1){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,c,u,!1,y);T.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1});break}const s=A.textMeasure.clipText(e,A.textOptions,c,"break-word"===p);if(""!==e&&""===s.str){if(u){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,c,u,!1,y);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;n=!1}if(T.push({str:s.str,width:s.width,ascent:0,descent:0,keepCenterInLine:!1}),s.str.length===e.length);else if(n){const n=e.substring(s.str.length);w.splice(t+1,0,n)}}let t=0;T.forEach((e=>{t=Math.max(t,e.width)})),B[0]=t}else{let t,e,n=0;for(let i=0,r=w.length;i<r;i++){if(i===C-1){const t=A.textMeasure.clipTextWithSuffix(w[i],A.textOptions,c,u,!1,y);T.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1}),n=Math.max(n,t.width);break}e=w[i],t=A.textMeasure.measureTextWidth(e,A.textOptions,"break-word"===p),n=Math.max(n,t),T.push({str:e,width:t,ascent:0,descent:0,keepCenterInLine:!1})}B[0]=n}B[1]=T.length*(x+_);const k={xOffset:0,yOffset:0,width:B[0],height:B[1]};A.LayoutBBox(k,o,l);const M=A.layoutWithBBox(k,T,o,l,x);return this.cache.layoutData=M,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Xa.length;e++){const n=Xa[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Xa.length;e++)if(t===Xa[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Ya.NOWORK_ANIMATE_ATTR}}function Ka(t){return new Ya(t)}const qa=["symbolType","size",...ua];let Qa=class t extends ma{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=ia}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=null;try{i=new Path2D}catch(t){return null}const r=this.getParsedPath();if(!r)return null;r.draw(i,n,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return Ct(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Qi(this).symbol}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n):this.updateSymbolAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=Bi.graphicService.updateTempAABBBounds(n);((t,e,n)=>{const{outerBorder:i,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:s=e.strokeBoundsBuffer}=t;if(i){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=i;$s(n,a+(r+o)/2,!0,s)}})(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,this.x1WithoutTransform=n.x1,this.y1WithoutTransform=n.y1;const{lineJoin:a=e.lineJoin}=t;return Bi.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:i=e.size}=t;if(Ct(i))n.set(-i[0]/2,-i[1]/2,i[0]/2,i[1]/2);else{const t=i/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,n){const{size:i=e.size}=t;return this.getParsedPath().bounds(i,n),n}needUpdateTags(t){return super.needUpdateTags(t,qa)}needUpdateTag(t){return super.needUpdateTag(t,qa)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=Ct(e)?e:[e,e];return t.path?(new ei).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new ei).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Za(t){return new Qa(t)}Qa.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},ga);const Ja=["width","x1","y1","height","cornerRadius",...ua];let to=class t extends ma{constructor(t){super(t),this.type="rect",this.numberType=ea}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Qi(this).rect}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){let{width:e,height:i}=t;const{x1:r,y1:s,x:a,y:o}=t;e=null!=e?e:r-a,i=null!=i?i:s-o,(isFinite(e)||isFinite(i)||isFinite(a)||isFinite(o))&&n.set(0,0,e||0,i||0)}const{tb1:i,tb2:r}=Bi.graphicService.updateTempAABBBounds(n);return ja(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,Bi.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,Ja)}needUpdateTag(t){return super.needUpdateTag(t,Ja)}toCustomPath(){const t=this.attribute,{x:e,y:n,width:i,height:r}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=_t(t.width)?t.x1-t.x:t.width,n=_t(t.height)?t.y1-t.y:t.height,i=0,r=0;return e<0?(i=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:i,y:r,width:e,height:n}})(t),s=new ei;return s.moveTo(e,n),s.rect(e,n,i,r),s}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function eo(t){return new to(t)}to.NOWORK_ANIMATE_ATTR=ga;class no{constructor(t,e,n,i,r,s,a,o,l,h,u,c,d,f){this.left=t,this.top=e,this.width=n,this.height=i,this.actualHeight=0,this.bottom=e+i,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Ei[this.layoutDirection],this.isWidthMax=u,this.isHeightMax=c,this.singleLine=d,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:i}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,i):this.height||i||0;s=Math.min(s,i);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-r:"center"===this.globalAlign&&(o=-r/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n];if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;let s=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[n].draw(t,s,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else{const n=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=n:a+=n;for(let n=0;n<this.lines.length;n++)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n],s=l-this.lines[n].top-this.lines[n].height;if(0===l)this.lines[n].draw(t,!1,o,s+a,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,h=!0),this.lines[n].draw(t,i,o,s+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let n=0;n<this.lines.length;n++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[n].height+this.lines[n].top);const{top:i,height:r}=this.lines[n];if(0===l)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e);else{if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(i=!0,h=!0),this.lines[n].draw(t,i,this.lines[n][this.directionKey.left]+o,this.lines[n][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:i}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else{Math.floor((r-this.actualHeight)/2);for(let n=0;n<this.lines.length;n++)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else if("bottom"===this.verticalDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n],a=r-this.lines[n].top-this.lines[n].height;if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[n+1]&&a-this.lines[n+1].height<this[this.directionKey.top]){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[n].getWidthWithEllips(i);r>t&&(t=r),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function io(t,e,n,i){const r=Math.round(t),s=Math.round(n),a=Math.round(e),o=Math.round(i);return{left:t>r?r:r-.5,top:n>s?s:s-.5,right:a>e?a:a+.5,bottom:o>i?o:o+.5}}class ro{constructor(t,e,n,i){var r,s;this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic",this.ascentDescentMode=i;const a=vr(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:u}=Wi(t,n,this.ascentDescentMode);let c=0,d=0,f=0;this.height>l&&(c=(this.height-l)/2,d=Math.ceil(c),f=Math.floor(c)),"top"===this.textBaseline?(this.ascent=c,this.descent=l-c):"bottom"===this.textBaseline?(this.ascent=l-c,this.descent=c):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=h+f),this.length=t.length,this.width=u||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=n.space,this.dx=null!==(r=n.dx)&&void 0!==r?r:0,this.dy=null!==(s=n.dy)&&void 0!==s?s:0,"vertical"===n.direction&&(this.direction=n.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}=Wi(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,n,i,r,s,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+n,l=this.text,h=this.left+i;o+=this.top;let u=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,u="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==s&&"end"!==s||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Di(l,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===u);else{const{width:e}=Wi(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const c=io(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},c),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,n,i,r,s,a){var o;let l=e+n,h=this.text,u=this.left+i+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let c=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,c="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==s&&"end"!==s||(u-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Di(h,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===s||"end"===s)if("vertical"===c);else{const{width:e}=Wi(this.text.slice(t),this.character,this.ascentDescentMode);u-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===c&&(t.save(),t.rotateAbout(Math.PI/2,u,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(u,l),u=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(h,u,l+this.dy),this.character.fill&&t.fillText(h,u,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,n=io(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,n=io(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,n=io(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,n=io(u,u+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(n.left,1+l-this.ascent/2,n.right-n.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===c&&t.restore()}getWidthWithEllips(t){let e=this.text;const n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Di(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:i}=Wi(this.text.slice(t),this.character,this.ascentDescentMode);return n+this.ellipsisWidth-i}return n}}const so=["width","height","image",...ua];let ao=class t extends ma{constructor(t){super(t),this.type="image",this.numberType=ta,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}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,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,n){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,n)}setAttribute(t,e,n,i){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,n,i)}getGraphicTheme(){return Qi(this).image}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){const{maxWidth:i=e.maxWidth,maxHeight:r=e.maxHeight}=t;let{width:s,height:a}=t;if(null==s||null==a){const t=this.getImageElement();if(t){const e=t.width,n=t.height;if(null!=s)a=s*(n/e);else if(null!=a)s=a*(e/n);else{const t=e/n;t>i/r?(s=i,a=i/t):(a=r,s=r*t)}}else s=i,a=r}this._actualWidth=s,this._actualHeight=a,n.set(0,0,s,a)}const{tb1:i,tb2:r}=Bi.graphicService.updateTempAABBBounds(n);return ja(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,Bi.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return wi[t]}needUpdateTags(t){return super.needUpdateTags(t,so)}needUpdateTag(t){return super.needUpdateTag(t,so)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function oo(t){return new ao(t)}ao.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},ga);class lo extends ao{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=gr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(Ct(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=gr(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=wi.width,height:e=wi.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:i=e}=this.attribute,r=(n-t)/2,s=(i-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class ho{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=Ei[this.direction]}store(t){if(t instanceof lo){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}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,n=new class{constructor(t,e,n,i,r,s,a,o){this.left=t,this.width=e,this.baseline=n,this.ascent=i,this.descent=r,this.top=n-i,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof lo?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Ei[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof ro){const e=Ni.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],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const n=this.directionKey,i=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof lo?(t["_"+n.x]=r,r+=t[n.width]+s,t["_"+n.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?i-t.height:(i-t.height)/2):(t[n.left]=r,r+=t[n.width]+s)}))}draw(t,e,n,i,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,n=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const i=this.paragraphs[e];if(i.overflow)t=t&&""===i.text;else if(t){n=!0;break}}let i=0;if(!n)for(let t=this.paragraphs.length-1;t>=0;t--){const n=this.paragraphs[t];if(n.overflow){if(""===n.text)break;continue}if(n instanceof lo)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:a}=Wi(s,n.character,n.ascentDescentMode),o=a||0;if(o<=this.blankWidth+i){e&&(n.ellipsis="add");break}if(o<=this.blankWidth+i+n.width){n.ellipsis="replace",n.ellipsisWidth=o,n.ellipsisOtherParagraphWidth=this.blankWidth+i;break}n.ellipsis="hide",i+=n.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,r)=>{if(e instanceof lo)return;const s=e.drawBackground(t,i,this.ascent,n,0===r,this.textAlign,this.height);s&&(a===s.fillStyle&&o===s.globalAlpha||(l=[],h.push(l),a=s.fillStyle,o=s.globalAlpha),l.push(s))})),h.forEach((e=>{if(0===e.length)return;const n=e[0],i=e[e.length-1];t.fillStyle=n.fillStyle,t.globalAlpha=n.globalAlpha,t.fillRect(n.left,n.top,i.right-n.left,i.bottom-n.top)})),this.paragraphs.forEach(((e,r)=>{if(e instanceof lo)return e.setAttributes({x:n+e._x,y:i+e._y}),void s(e,t,n+e._x,i+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const n=e&&e.stroke||Li;if(!n)return void(t.globalAlpha=0);const{strokeOpacity:i=1,opacity:r=1}=e;t.globalAlpha=i*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=n,Ui(t,e)})(t,e.character),function(t,e,n){const i=e&&e.fill||Oi;if(!i)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=n?Pi(t,i,{AABBBounds:n}):i,Ui(t,e)}(t,e.character,a),e.draw(t,i,this.ascent,n,0===r,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let n=this.paragraphs.length-1;n>=0;n--){const i=this.paragraphs[n];if(i instanceof lo)break;const{width:r}=Wi(t,i.character,i.ascentDescentMode),s=r||0;if(s<=this.blankWidth+e){i.ellipsis="add",i.ellipsisWidth=s;break}if(s<=this.blankWidth+e+i.width){i.ellipsis="replace",i.ellipsisWidth=s,i.ellipsisOtherParagraphWidth=this.blankWidth+e;break}i.ellipsis="hide",e+=i.width}let n=0;return this.paragraphs.forEach(((t,e)=>{n+=t instanceof lo?t.width:t.getWidthWithEllips(this.direction)})),n}}(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(n),this.frame.actualHeight+=n.height,this.y+=n.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 lo?"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||this.newLine)&&("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 n=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(n/t[this.directionKey.width]*t.length)||0,r=Di(t.text,n,t.character,i,"break-word"===this.frame.wordBreak);if(0!==r){const[n,i]=function(t,e){const n=t.text.slice(0,e),i=t.text.slice(e);return[new ro(n,t.newLine,t.character,t.ascentDescentMode),new ro(i,!0,t.character,t.ascentDescentMode)]}(t,r);this.store(n),e?this.send():this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let uo=!1;try{uo=Intl&&"function"==typeof Intl.Segmenter}catch(t){uo=!1}const co=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...ua];let fo=class t extends ma{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=na,this.onBeforeAttributeUpdate=(t,e,n)=>{for(const n in t)if("hoverIconId"===n){if(t[n]===e[n])continue;const i=this._frameCache.icons.get(t[n]);this.updateHoverIconState(i)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Ai.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:Ai.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:Ai.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:Ai.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:Ai.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:Ai.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:Ai.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:Ai.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Qi(this).richtext}static AllSingleCharacter(e){return e.lines?e.lines.every((e=>e.paragraphs.every((e=>!(e.text&&Bt(e.text)&&t.splitText(e.text).length>1))))):e.every((e=>e.isComposing||!(e.text&&Bt(e.text)&&t.splitText(e.text).length>1)))}static splitText(t){if(uo){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),n=[];for(const{segment:i}of e.segment(t))n.push(i);return n}return Array.from(t)}static TransformTextConfig2SingleCharacter(e){const n=[];return e.forEach((e=>{const i=t.splitText(e.text.toString());if(Bt(e.text)&&i.length>1)for(let t=0;t<i.length;t++){const r=i[t];n.push(Object.assign(Object.assign({},e),{text:r}))}else n.push(e)})),n}updateAABBBounds(t,e,n){var i,r,s,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:u=e.maxHeight,textAlign:c=e.textAlign,textBaseline:d=(null!==(r=null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)&&void 0!==r?r:"top"),editOptions:f}=t;if(o>0&&l>0)n.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:i}=t.getActualSize();let r=o||e||0,s=l||i||0;s="number"==typeof u&&s>u?u:s||0,r="number"==typeof h&&r>h?h:r||0,n.set(0,0,r,s)}f&&f.keepHeightWhileEmpty&&!n.height()&&!(null===(s=t.textConfig)||void 0===s?void 0:s.length)&&(n.y2=n.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),n.x2=n.x1+2);let p=0;switch(d){case"top":p=0;break;case"middle":p=-n.height()/2;break;case"bottom":p=-n.height()}let g=0;switch(c){case"left":g=0;break;case"center":g=-n.width()/2;break;case"right":g=-n.width()}return n.translate(g,p),Bi.graphicService.updateTempAABBBounds(n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Bi.graphicService.updateHTMLTextAABBBounds(t,e,n),this.widthWithoutTransform=n.x2-n.x1,this.heightWithoutTransform=n.y2-n.y1,Bi.graphicService.transformAABBBounds(t,n,e,!1,this),0===n.width()&&0===n.height()&&n.clear(),n}needUpdateTags(t){return super.needUpdateTags(t,co)}needUpdateTag(t){return super.needUpdateTag(t,co)}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 n=t.lines[e];for(let t=0;t<n.paragraphs.length;t++){const e=n.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:u,strokeOpacity:c,upgradeAttrs:d}=this.attribute,f=Object.assign({fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:c},t);return(null==d?void 0:d.lineHeight)&&(f.lineHeight=u),f}doUpdateFrameCache(e){var n;const{maxWidth:i,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:l,verticalDirection:h,textAlign:u,textBaseline:c,layoutDirection:d,singleLine:f,disableAutoWrapLine:p,editable:g,ascentDescentMode:m,upgradeAttrs:b}=this.attribute,y=b&&b.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!t.AllSingleCharacter(v)&&(v=t.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=e?e:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const n=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(n)x.push(n);else{const t=new lo(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(Mt(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const n=e.text.split("\n");for(let i=0;i<n.length;i++)if(0===i)x.push(new ro(n[i],!1,e,m));else if(n[i]||t===_.length-1)x.push(new ro(n[i],!0,e,m));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new ro(n[i],!0,e,m))}}else e.text&&x.push(new ro(e.text,!1,e,m))}const S="number"==typeof i&&Number.isFinite(i)&&i>0,A="number"==typeof r&&Number.isFinite(r)&&r>0,w="number"==typeof s&&Number.isFinite(s)&&s>0&&(!S||s<=i),T="number"==typeof a&&Number.isFinite(a)&&a>0&&(!A||a<=r),B=new no(0,0,(w?s:S?i:0)||0,(T?a:A?r:0)||0,o,l,h,u,c,d||"horizontal",!w&&S,!T&&A,f||!1,null===(n=this._frameCache)||void 0===n?void 0:n.icons),C=new ho(B);if(C.newLine=y,p){let t=0,e=!1;for(let n=0;n<x.length;n++){const i=x[n];e?(i.overflow=!0,i.left=1/0,i.top=1/0,!i.newLine&&B.lines[B.lines.length-1].paragraphs.push(i)):C.deal(i,!0),B.lines.length!==t&&(t=B.lines.length,C.lineBuffer.length=0,i.overflow=!0,i.left=1e3,i.top=1e3,B.lines[B.lines.length-1].paragraphs.push(i),e=!0),i.newLine&&(e=!1,C.lineWidth=0),C.send()}}else for(let t=0;t<x.length;t++)C.deal(x[t]);if(C.send(),!("horizontal"===B.layoutDirection?w:T)){const t=B.getActualSizeWidthEllipsis();let e="horizontal"===B.layoutDirection?t.width:t.height;("horizontal"===B.layoutDirection?S:A)&&(e=Math.min(e,"horizontal"===B.layoutDirection?i:r)),B.lines.forEach((function(t){t.calcOffset(e,!1)}))}y&&B.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=B}clone(){return new t(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((n=>{n.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,n,i,r,s;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(n=this.stage)||void 0===n||n.setCursor(t.attribute.cursor),null===(i=this.stage)||void 0===i||i.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:n,f:i}=this.globalTransMatrix;let r;return e.icons.forEach(((e,s)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-n,y:t.y-i})&&(r=e,r.globalX=(null!==(a=r.attribute.x)&&void 0!==a?a:0)+n+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+i+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function po(t){return new fo(t)}fo.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},ga);const go=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...ua];let mo=class t extends ma{constructor(t){super(t),this.type="arc",this.numberType=Zs}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:n,innerRadius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:n=t.innerPadding,outerPadding:i=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=i,s-=n,0===e||"0%"===e)return 0;const a=Math.abs(r-s),o=t=>Math.min(Mt(t,!0)?t:a*parseFloat(t)/100,a/2);if(Ct(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:i=t.cap}=this.attribute,r=n-e>=0?1:-1,s=n-e;if(e=fe(e),n=e+s,i&&ee(s)<te-qt){let s=1,a=1;i.length&&(s=Number(i[0]),a=Number(i[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:u=t.innerPadding}=this.attribute;o+=h,l-=u;const c=Math.abs(o-l)/2,d=c/o;if(c>qt&&o>qt)return{startAngle:e-r*d*s,endAngle:n+r*d*a,sc:r*d*s,ec:r*d*a}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=this.getGraphicTheme(),{innerPadding:i=n.innerPadding,outerPadding:r=n.outerPadding,padAngle:s=n.padAngle}=this.attribute;let{outerRadius:a=n.outerRadius,innerRadius:o=n.innerRadius}=this.attribute;a+=r,o-=i;const{padRadius:l=oe(a*a+o*o)}=this.attribute,h=ee(e-t);let u=t,c=e,d=t,f=e;const p=s/2;let g=h,m=h;if(p>qt&&l>qt){const n=e>t?1:-1;let i=he(Number(l)/o*ae(p)),r=he(Number(l)/a*ae(p));return(g-=2*i)>qt?(i*=n,d+=i,f-=i):(g=0,d=f=(t+e)/2),(m-=2*r)>qt?(r*=n,u+=r,c-=r):(m=0,u=c=(t+e)/2),{outerStartAngle:u,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}return{outerStartAngle:u,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}getGraphicTheme(){return Qi(this).arc}updateAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n)||(i?this.updateArcAABBBoundsImprecise(t,e,n):this.updateArcAABBBoundsAccurate(t,e,n));const{tb1:r,tb2:s}=Bi.graphicService.updateTempAABBBounds(n);ja(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),this.setWidthHeightWithoutTransform(n);const{lineJoin:a=e.lineJoin}=t;return Bi.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateArcAABBBoundsImprecise(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;return i+=s,r-=a,i<r&&(i=r),n.set(-i,-i,i,i),n}updateArcAABBBoundsAccurate(t,e,n){let{outerRadius:i=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(i+=s,r-=a,i<r){const t=i;i=r,r=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return i<=qt?n.set(0,0,0,0):Math.abs(o-l)>te-qt?n.set(-i,-i,i,i):(yr(l,o,i,n),yr(l,o,r,n)),n}needUpdateTags(t){return super.needUpdateTags(t,go)}needUpdateTag(t){return super.needUpdateTag(t,go)}toCustomPath(){var t,e,n,i;const r=this.attribute,{startAngle:s,endAngle:a}=this.getParsedAngle();let o=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),l=(null!==(n=r.outerRadius)&&void 0!==n?n:0)-(null!==(i=r.outerPadding)&&void 0!==i?i:0);const h=ee(a-s),u=a>s;if(l<o){const t=l;l=o,o=t}const c=new ei;if(l<=qt)c.moveTo(0,0);else if(h>=te-qt)c.moveTo(0+l*ie(s),0+l*ae(s)),c.arc(0,0,l,s,a,!u),o>qt&&(c.moveTo(0+o*ie(a),0+o*ae(a)),c.arc(0,0,o,a,s,u));else{const t=l*ie(s),e=l*ae(s),n=o*ie(a),i=o*ae(a);c.moveTo(0+t,0+e),c.arc(0,0,l,s,a,!u),c.lineTo(0+n,0+i),c.arc(0,0,o,a,s,u),c.closePath()}return c}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};mo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},ga);const bo=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const n=this.store.get(t);return n?n(e):null}};let yo;function vo(t){return yo||(yo=bo.CreateGraphic("text",{})),yo.initAttributes(t),yo.AABBBounds}var xo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},_o=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},So=function(t,e){return function(n,i){e(n,i,t)}};class Ao{constructor(){this.time=dn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){var f;const{background:p,backgroundOpacity:g=(null!==(f=t.attribute.fillOpacity)&&void 0!==f?f:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:b=l.backgroundMode,backgroundFit:y=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:S=l.backgroundOffsetY,backgroundClip:A=l.backgroundClip}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const r=t.resources.get(p);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=Qi(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}A&&e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,this.doDrawImage(e,r.data,s,{backgroundMode:b,backgroundFit:y,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:S}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,n,i){const{backgroundMode:r,backgroundFit:s,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=i,u=n.width(),c=n.height();let d=u,f=c;if("no-repeat"===r)if(s)if(a){const i=Math.max(u/e.width,c/e.height);t.drawImage(e,n.x1+l,n.y1+h,e.width*i*o,e.height*i*o)}else t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{const i=e.width*o,r=e.height*o;t.drawImage(e,n.x1+l,n.y1+h,i,r)}else{if(s&&"repeat"!==r&&(e.width||e.height)){const n=e.width,i=e.height;"repeat-x"===r?(d=n*(c/i),f=c):"repeat-y"===r&&(f=i*(u/n),d=u);const s=t.dpr,a=Gi.allocate({width:d,height:f,dpr:s}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,f),o.drawImage(e,0,0,d,f),e=a.nativeCanvas),Gi.free(a)}const i=t.dpr,a=t.createPattern(e,r);a.setTransform&&a.setTransform(new DOMMatrix([1/i,0,0,1/i,0,0])),t.fillStyle=a,t.translate(n.x1,n.y1),t.fillRect(0,0,u,c),t.translate(-n.x1,-n.y1)}}}const wo=new Ao;let To=class{constructor(t){this.subRenderContribitions=t,this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,a,o,l,h,u,c,d)}))}};To=xo([K(),So(0,X(ct)),So(0,q(ka)),_o("design:paramtypes",[Object])],To);const Bo=new class{constructor(){this.time=dn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){var f,p;const{clipConfig:g}=t.attribute;if(!g)return;const m=t.getClipPath();if(!m)return;const b=!(u||c),y=t.AABBBounds,v=null!==(f=t.attribute.width)&&void 0!==f?f:y.width(),x=null!==(p=t.attribute.height)&&void 0!==p?p:y.height();b&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],n+v/2,i+x/2,0)&&e.closePath(),u&&u(e,t.attribute,l,!0),b&&e.clip()}};const Co=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){const{clipConfig:f}=t.attribute;f&&t.getClipPath()&&(u||c||e.restore())}};const ko=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,a=i.dpr,o=Gi.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(s,l);const h=i.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Gi.free(o),h}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,te),e.fill()}))}createDiamondPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{const r=t/2,s=r;i.fillStyle=n,i.moveTo(r,s-e),i.lineTo(e+r,s),i.lineTo(r,s+e),i.lineTo(r-e,s),i.closePath(),i.fill()}))}createRectPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(s,0,2*i,t)}))}createHorizontalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(0,s,t,2*i)}))}createBiasLRLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);const r=t/2,s=-r;i.moveTo(r,s),i.lineTo(r+t,s+t),i.moveTo(-r,-s),i.lineTo(-r+t,-s+t),i.stroke()}))}createBiasRLLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);const r=t/2,s=r;i.moveTo(t+r,s),i.lineTo(r,s+t),i.moveTo(t-r,-s),i.lineTo(-r,-s+t),i.stroke()}))}createGridPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,t,t),i.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=l.texture,textureColor:p=l.textureColor,textureSize:g=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;f&&this.drawTexture(f,t,e,n,i,l,p,g,m)}drawTexture(t,e,n,i,r,s,a,o,l){var h;const{textureRatio:u=s.textureRatio,textureOptions:c=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,n);break;case"diamond":d=this.createDiamondPattern(o,l,a,n);break;case"rect":d=this.createRectPattern(o,l,a,n);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,n);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,n);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,n);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,n);break;case"grid":d=this.createGridPattern(o,l,a,n)}if(c&&c.dynamicTexture){const{gridConfig:d={},useNewCanvas:f}=c,p=e.AABBBounds;i=p.x1,r=p.y1;const g=n;let m;if(f){m=Gi.allocate({width:p.width(),height:p.height(),dpr:n.dpr});const t=m.getContext("2d");t.clearRect(0,0,p.width(),p.height()),i=0,r=0,n=t}if(g.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:n=0}=e.parent.attribute;g.setTransformFromMatrix(e.parent.globalTransMatrix),g.translate(t,n,!0)}g.setCommonStyle(e,e.attribute,i,r,s),g.clip();const b=p.width(),y=p.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(b/x),S=d.rows?d.rows:Math.ceil(y/x),A=d.gutterColumn?d.gutterColumn:2*v,w=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=Za({}));const T=d.columns?b/d.columns:x,B=d.rows?y/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[T-A,B-w],symbolType:t});const C=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<S;t++)for(let s=0;s<_;s++){const o=i+x/2+s*x,l=r+x/2+t*x;null===(h=c.beforeDynamicTexture)||void 0===h||h.call(c,n,t,s,S,_,u,e,p.width(),p.height()),n.beginPath(),!1===C.draw(n,Math.min(T-A,B-w),o,l,0)&&n.closePath(),n.fillStyle=a,c.dynamicTexture(n,t,s,S,_,u,e,p.width(),p.height())}f&&(g.globalAlpha=1,g.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,p.x1,p.y1,p.width()*g.dpr,p.height()*g.dpr)),g.restore()}else if(d)n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,s),n.fillStyle=d,n.fill(),n.highPerformanceRestore();else if("wave"===t){n.save(),n.setCommonStyle(e,e.attribute,i,r,s),n.clip();const t=e.AABBBounds;(function(t,e,n,i,r,s,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:u,phi:c=0}=r;let{amplitude:d=10}=r;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const f=i*(1-l),p=n,g=Math.max(Math.round(p/70),2);t.beginPath(),t.moveTo(0+s,i+a),t.lineTo(0+s,f+a);const m=p/h*e,b=p/Math.PI/(2*h);for(let e=0;e<p;e+=g){const n=d*Math.sin((e+m+c)/b+c);t.lineTo(e+s,f+n+a)}t.lineTo(p+s,i+a),t.closePath(),t.fillStyle=o,isFinite(u)&&(t.globalAlpha=u),t.fill()})(n,u,t.width(),t.height(),Object.assign(Object.assign({},c||{}),{fill:a}),i+t.x1-i,r+t.y1-r),n.restore()}}},Mo=Qt/2;function Po(t,e,n,i,r,s){let a,o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],l=arguments.length>7?arguments[7]:void 0;if(Array.isArray(o)&&(l=o,o=!0),i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),Mt(s,!0))a=[s=ee(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,n;switch(t.length){case 0:a=[0,0,0,0];break;case 1:e=ee(t[0]),a=[e,e,e,e];break;case 2:case 3:e=ee(t[0]),n=ee(t[1]),a=[e,n,e,n];break;default:a=t,a[0]=ee(a[0]),a[1]=ee(a[1]),a[2]=ee(a[2]),a[3]=ee(a[3])}}else a=[0,0,0,0];if(i<0||a[0]+a[1]+a[2]+a[3]<1e-12)return t.rect(e,n,i,r);const[h,u,c,d]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],f=Math.min(i/2,r/2),p=[Math.min(f,a[0]),Math.min(f,a[1]),Math.min(f,a[2]),Math.min(f,a[3])],g=[h[0]+p[0],h[1]],m=[h[0],h[1]+p[0]],b=[u[0]-p[1],u[1]],y=[u[0],u[1]+p[1]],v=[c[0]-p[2],c[1]],x=[c[0],c[1]-p[2]],_=[d[0]+p[3],d[1]],S=[d[0],d[1]-p[3]];if(t.moveTo(g[0],g[1]),o){if(l&&l[0]?l[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),!Gt(b,y)){l&&l[0]&&t.moveTo(b[0],b[1]);const e=b[0],n=b[1]+p[1];t.arc(e,n,p[1],-Mo,0,!1)}if(l&&l[1]?l[1](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!Gt(v,x)){const e=x[0]-p[2],n=x[1];l&&l[1]&&t.moveTo(x[0],x[1]),t.arc(e,n,p[2],0,Mo,!1)}if(l&&l[2]?l[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!Gt(_,S)){const e=_[0],n=_[1]-p[3];l&&l[2]&&t.moveTo(_[0],_[1]),t.arc(e,n,p[3],Mo,Qt,!1)}if(l&&l[3]?l[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!Gt(g,m)){const e=g[0],n=g[1]+p[0];l&&l[3]&&t.moveTo(m[0],m[1]),t.arc(e,n,p[0],Qt,Qt+Mo,!1)}}else l&&l[0]?l[0](g[0],g[1],b[0],b[1]):t.lineTo(b[0],b[1]),l&&l[1]?l[1](b[0],b[1],v[0],v[1]):t.lineTo(v[0],v[1]),l&&l[2]?l[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),l&&l[2]?l[2](_[0],_[1],g[0],g[1]):t.lineTo(g[0],g[1]);return!l&&t.closePath(),t}var Eo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};class Oo{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{cornerRadius:m=l.cornerRadius,cornerType:b=l.cornerType,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,x1:A,y1:w,keepStrokeScale:T=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:A-n)||0,C=(null!=C?C:w-i)||0;const k=(r,s)=>{const a=!(!r||!r.stroke),o="outerBorder"===s?-1:1,{distance:h=l[s].distance}=r,u=T?h:Mi(e,h,e.dpr),d=n+o*u,f=i+o*u,p=2*u;if(0===m||Ct(m)&&m.every((t=>0===t))?(e.beginPath(),e.rect(d,f,B-o*p,C-o*p)):(e.beginPath(),Po(e,d,f,B-o*p,C-o*p,m,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};p&&k(d,"outerBorder"),g&&k(f,"innerBorder")}}let Lo=class{constructor(){this.time=dn.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};Lo=Eo([K()],Lo);let Ro=class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){const{x1:d,y1:f,x:p=l.x,y:g=l.y,stroke:m=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:y=l.cornerType}=t.attribute;let{width:v,height:x}=t.attribute;if(v=(null!=v?v:d-p)||0,x=(null!=x?x:f-g)||0,Array.isArray(m)&&m.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),!(0===b||Ct(b)&&b.every((t=>0===t)))){let r,s=0;return Po(e,n,i,v,x,b,"bevel"!==y,new Array(4).fill(0).map(((a,o)=>(a,h,u,c)=>{m[o]&&(s===o-1&&m[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:m[o]}),n,i,l),e.beginPath(),e.moveTo(a,h),r=m[o]),s=o,e.lineTo(u,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,i),m[0]?e.lineTo(n+v,i):e.moveTo(n+v,i),m[1]?e.lineTo(n+v,i+x):e.moveTo(n+v,i+x),m[2]?e.lineTo(n,i+x):e.moveTo(n,i+x),m[3]){const t=m[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};Ro=Eo([K()],Ro);const Io=new Oo,No=ko,Uo=wo;const Do=new class extends Oo{constructor(){super(...arguments),this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){return super.drawShape(t,e,n,i,r,s,a,o,l,h,u,c)}},zo=wo;const Wo=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){const d=t.getParsedPath();if(!d)return;const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{size:b=l.size,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:S=l.scaleY,keepStrokeScale:A=l.keepStrokeScale}=t.attribute,w=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=l[s].distance}=r,h=A?o:Mi(e,o,e.dpr),u="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,b,n,i,u*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,r,l[s]);else if(a){const a=l[s].opacity;l[s].opacity=y,e.setStrokeStyle(t,r,(v-n)/_,(x-i)/S,l[s]),l[s].opacity=a,e.stroke()}};g&&w(f,"outerBorder"),m&&w(p,"innerBorder")}},Fo=new class{constructor(){this.time=dn.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d){const{clipRange:f=l.clipRange,x:p=l.x,y:g=l.y,z:m=l.z,size:b=l.size,scaleX:y=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&f<1&&f>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,b,n,i,f,m,((r,s)=>{var a,h,u,d;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(a=s.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=s.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(u=s.stroke)&&void 0!==u?u:t.attribute.stroke,e.lineWidth=null!==(d=s.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,s=e}s.stroke&&(c?c(e,t.attribute,l):o&&(e.setStrokeStyle(t,s,(p-n)/y,(g-i)/v,l),e.stroke()))})),s&&!x.isSvg&&(c?c(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(p-n)/y,(g-i)/v,l),e.stroke())))}},jo=ko,Ho=wo,Go={x:0,y:0,z:0,lastModelMatrix:null};class $o{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Bo),this.builtinContributions.push(Co),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===dn.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===dn.afterFillStroke)))}beforeRenderStep(t,e,n,i,r,s,a,o,l,h,u,c,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d)}))}afterRenderStep(t,e,n,i,r,s,a,o,l,h,u,c,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((f=>{f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,s,a,o,l,h,u,c,d)}))}drawPathProxy(t,e,n,i,r,s,a,o){if(!t.pathProxy)return!1;const l=Qi(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:u=l.stroke,opacity:c=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:p=l.strokeOpacity,visible:g=l.visible,x:m=l.x,y:b=l.y}=t.attribute,y=Sa(c,d,h),v=Aa(c,p),x=xa(h),_=_a(u,f);if(!g)return!0;if(!x&&!_)return!0;if(!(y||v||a||o))return!0;e.beginPath();return mn(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,n-m,i-b,l),e.stroke())),x&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,n-m,i-b,l),e.fill())),this.afterRenderStep(t,e,n,i,x,_,y,v,l,r,a,o),!0}valid(t,e,n,i){const{fill:r=e.fill,background:s,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:u=e.strokeOpacity,visible:c=e.visible}=t.attribute,d=Sa(o,l,r),f=Aa(o,u),p=xa(r,s),g=_a(a,h);return!(!t.valid||!c)&&!(!p&&!g)&&!!(d||f||n||i||s)&&{fVisible:d,sVisible:f,doFill:p,doStroke:g}}transform(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:r=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:u}=t.attribute,c=n.modelMatrix,d=n.camera;Go.x=r,Go.y=s,Go.z=a,Go.lastModelMatrix=c;const f=d&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t)),p=f?t.transMatrix.onlyTranslate()&&!u:1===o&&1===l&&0===h&&!u;if(f){const i=Na.allocate(),r=Na.allocate();Wa(r,t,e),La(i,c||i,r),Go.x=0,Go.y=0,Go.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),Na.free(r)}if(p&&!c){const i=t.getOffsetXY(e);Go.x+=i.x,Go.y+=i.y,Go.z=a,n.setTransformForCurrent()}else if(f)Go.x=0,Go.y=0,Go.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(d&&n.project){const i=t.getOffsetXY(e);Go.x+=i.x,Go.y+=i.y,this.transformWithoutTranslate(n,Go.x,Go.y,Go.z,o,l,h)}else n.transformFromMatrix(t.transMatrix,!0),Go.x=0,Go.y=0,Go.z=0;return Go}transformUseContext2d(t,e,n,i){const r=i.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=i.project(0,0,n),o=i.project(r,0,n),l=i.project(r,s,n),h={x:0,y:0},u={x:r,y:0},c={x:r,y:s};i.camera=null;const d=1/(h.x*(c.y-u.y)-u.x*c.y+c.x*u.y+(u.x-c.x)*h.y),f=-(h.y*(l.x-o.x)-u.y*l.x+c.y*o.x+(u.y-c.y)*a.x)*d,p=(u.y*l.y+h.y*(o.y-l.y)-c.y*o.y+(c.y-u.y)*a.y)*d,g=(h.x*(l.x-o.x)-u.x*l.x+c.x*o.x+(u.x-c.x)*a.x)*d,m=-(u.x*l.y+h.x*(o.y-l.y)-c.x*o.y+(c.x-u.x)*a.y)*d,b=(h.x*(c.y*o.x-u.y*l.x)+h.y*(u.x*l.x-c.x*o.x)+(c.x*u.y-u.x*c.y)*a.x)*d,y=(h.x*(c.y*o.y-u.y*l.y)+h.y*(u.x*l.y-c.x*o.y)+(c.x*u.y-u.x*c.y)*a.y)*d;i.setTransform(f,p,g,m,b,y,!0)}}restoreTransformUseContext2d(t,e,n,i){this.camera&&(i.camera=this.camera)}transformWithoutTranslate(t,e,n,i,r,s,a){const o=t.project(e,n,i);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,n,i,r){const{context:s}=i;if(!s)return;const{renderable:a}=t.attribute;if(!1===a)return;s.highPerformanceSave();const o=this.transform(t,e,s,n),{x:l,y:h,z:u,lastModelMatrix:c}=o;this.z=u,this.drawPathProxy(t,s,l,h,i,r)||(this.drawShape(t,s,l,h,i,r),this.z=0,s.modelMatrix!==c&&Na.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}var Vo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Xo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yo=function(t,e){return function(n,i){e(n,i,t)}};let Ko=class extends $o{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=ea,this.builtinContributions=[Io,Uo,No],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:Qi(t,null==s?void 0:s.theme).rect,{fill:u=h.fill,background:c,stroke:d=h.stroke,cornerRadius:f=h.cornerRadius,cornerType:p=h.cornerType,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible,x1:x,y1:_,x:S=h.x,y:A=h.y,fillStrokeOrder:w=h.fillStrokeOrder}=t.attribute;let{width:T,height:B}=t.attribute;T=(null!=T?T:x-S)||0,B=(null!=B?B:_-A)||0;const C=function(t,e,n,i,r){return r&&t*e>0&&0!==n&&0!==i}(g,m,T,B,u),k=function(t,e,n,i){return t*e>0&&0!==n&&0!==i}(g,y,T,B),M=xa(u,c),P=_a(d,b);if(!t.valid||!v)return;if(!M&&!P)return;if(!(C||k||a||o||c))return;0===f||Ct(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(n,i,T,B)):(e.beginPath(),Po(e,n,i,T,B,f,"bevel"!==p));const E={doFill:M,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,M,P,C,k,h,r,a,o,E);const O=()=>{E.doFill&&(a?a(e,t.attribute,h):C&&(e.setCommonStyle(t,t.attribute,S-n,A-i,h),e.fill()))},L=()=>{E.doStroke&&(o?o(e,t.attribute,h):k&&(e.setStrokeStyle(t,t.attribute,S-n,A-i,h),e.stroke()))};w?(L(),O()):(O(),L()),this.afterRenderStep(t,e,n,i,M,P,C,k,h,r,a,o)}draw(t,e,n,i){const r=Qi(t,null==i?void 0:i.theme).rect;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}};Ko=Vo([K(),Yo(0,X(ct)),Yo(0,q(Ta)),Xo("design:paramtypes",[Object])],Ko);var qo=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zo=function(t,e){return function(n,i){e(n,i,t)}};let Jo=class extends $o{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=ia,this.builtinContributions=[Wo,Ho,jo,Fo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const h=Qi(t,null==s?void 0:s.theme).symbol,{size:u=h.size,x:c=h.x,y:d=h.y,scaleX:f=h.scaleX,scaleY:p=h.scaleY,fillStrokeOrder:g=h.fillStrokeOrder,clipRange:m=h.clipRange}=t.attribute,b=this.valid(t,h,a,o);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:A=h.keepDirIn3d}=t.attribute,w=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();let T=n,B=i,C=w;const k=e.camera;if(A&&k&&e.project){const t=e.project(n,i,w);e.camera=null,Ct(u)&&(u[0],u[1]),T=t.x,B=t.y,C=void 0}!1===S.draw(e,u,T,B,C,((r,s)=>{var l,u,b,y;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(l=s.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(u=s.opacity)&&void 0!==u?u:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(b=s.stroke)&&void 0!==b?b:t.attribute.stroke,e.lineWidth=null!==(y=s.lineWidth)&&void 0!==y?y:t.attribute.lineWidth,s=e}const x=()=>{s.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,s,c-n,d-i,h),e.fill()))},_=()=>{s.stroke&&(o?o(e,t.attribute,h):v&&m>=1&&(e.setStrokeStyle(t,s,(c-n)/f,(d-i)/p,h),e.stroke()))};g?(_(),x()):(x(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,x,_,y,v,h,r,a,o);const M=()=>{x&&!S.isSvg&&(a?a(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,c-n,d-i,h),e.fill()))},P=()=>{_&&!S.isSvg&&(o?o(e,t.attribute,h):v&&m>=1&&(e.setStrokeStyle(t,t.attribute,(c-n)/f,(d-i)/p,h),e.stroke()))};g?(P(),M()):(M(),P()),this.afterRenderStep(t,e,n,i,x,_,y,v,h,r,a,o)}draw(t,e,n,i){const r=Qi(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}};Jo=qo([K(),Zo(0,X(ct)),Zo(0,q(Ba)),Qo("design:paramtypes",[Object])],Jo);const tl=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new _e)}allocate(t,e,n,i){if(!this.pools.length)return(new _e).setValue(t,e,n,i);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=i,r}allocateByObj(t){if(!this.pools.length)return new _e(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 el=new class extends Ao{constructor(){super(...arguments),this.time=dn.beforeFillStroke}drawShape(t,e,n,i,r,s,a,o,l,h,u,c){var d,f,p,g,m,b,y,v,x,_;const{backgroundMode:S=l.backgroundMode,backgroundFit:A=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let T,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let k;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const M=At(B)&&B.background,P=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,n=(null!==(d=B.x)&&void 0!==d?d:e.x1)+(null!==(f=B.dx)&&void 0!==f?f:0),i=(null!==(p=B.y)&&void 0!==p?p:e.y1)+(null!==(g=B.dy)&&void 0!==g?g:0),r=null!==(m=B.width)&&void 0!==m?m:e.width(),s=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=tl.allocate(n,i,n+r,i+s),B=B.background,!P){const t=k.width(),e=k.height();k.set((null!==(y=B.x)&&void 0!==y?y:0)+(null!==(v=B.dx)&&void 0!==v?v:0),(null!==(x=B.y)&&void 0!==x?x:0)+(null!==(_=B.dy)&&void 0!==_?_:0),t,e)}}else k=t.AABBBounds,P||(k=vo(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(B);if("success"!==r.state||!r.data)return void C();e.highPerformanceSave(),P&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,i,l),this.doDrawImage(e,r.data,k,{backgroundMode:S,backgroundFit:A,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=B,r?(Po(e,k.x1,k.y1,k.width(),k.height(),r,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}M&&tl.free(k),C()}};var nl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},il=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rl=function(t,e){return function(n,i){e(n,i,t)}};let sl=class extends $o{constructor(t){super(),this.textRenderContribitions=t,this.numberType=ra,this.builtinContributions=[el],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l,h,u;const c=Qi(t,null==s?void 0:s.theme).text,{text:d,underline:f=c.underline,lineThrough:p=c.lineThrough,keepDirIn3d:g=c.keepDirIn3d,direction:m=c.direction,fontSize:b=c.fontSize,verticalMode:y=c.verticalMode,x:v=c.x,y:x=c.y}=t.attribute,_=null!==(l=vr(t.attribute.lineHeight,b))&&void 0!==l?l:b,S=this.valid(t,c,a,o);if(!S)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:B}=S,C=!g,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,n,i,T,B,A,w,c,r,a,o),C&&this.transformUseContext2d(t,c,k,e);const M=(r,s,l,h)=>{let u=n+s;const d=i+l;if(h){e.highPerformanceSave(),u+=b;const t=Ia.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),Ia.free(t)}B&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,c),e.strokeText(r,u,d,k))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,c),e.fillText(r,u,d,k))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,k),"horizontal"===m){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;B&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,c),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+l+i,k)})))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,c),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,k),this.drawUnderLine(f,p,t,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,r.descent,(r.descent-r.ascent)/2,k,c,e,{width:r.width})}))))}else{let{textAlign:n=c.textAlign,textBaseline:i=c.textBaseline}=t.attribute;if(!y){const e=n;n=null!==(h=t.getBaselineMapAlign()[i])&&void 0!==h?h:"left",i=null!==(u=t.getAlignMapBaseline()[e])&&void 0!==u?u:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:s}=r;e.textAlign="left",e.textBaseline="top";const a=_*s.length;let o=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=re(e,o)}));let l=0,d=0;"bottom"===i?d=-a:"middle"===i&&(d=-a/2),"center"===n?l-=o/2:"right"===n&&(l-=o),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),r=o-i;let s=l;"center"===n?s+=r/2:"right"===n&&(s+=r),t.forEach((t=>{const{text:n,width:i,direction:r}=t;M(n,a-(e+1)*_+d,s,r),s+=i}))}))}C&&this.restoreTransformUseContext2d(t,c,k,e),this.afterRenderStep(t,e,n,i,T,B,A,w,c,r,a,o)}draw(t,e,n,i){const r=Qi(t,null==i?void 0:i.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,a=!s;this._draw(t,r,a,n,i)}drawUnderLine(t,e,n,i,r,s,a,o,l,h,u){if(e+t<=0)return;const{textAlign:c=l.textAlign,fill:d=l.fill,opacity:f=l.opacity,underlineOffset:p=l.underlineOffset,underlineDash:g=l.underlineDash,fillOpacity:m=l.fillOpacity}=n.attribute,b=!_t(u),y=b?u.width:n.clipedWidth,v=b?0:Ma(c,y),x={lineWidth:0,stroke:d,opacity:f,strokeOpacity:m};if(t){x.lineWidth=t,h.setStrokeStyle(n,x,i,r,l),g&&h.setLineDash(g),h.beginPath();const e=r+s+p;h.moveTo(i+v,e,o),h.lineTo(i+v+y,e,o),h.stroke()}if(e){x.lineWidth=e,h.setStrokeStyle(n,x,i,r,l),h.beginPath();const t=r+a;h.moveTo(i+v,t,o),h.lineTo(i+v+y,t,o),h.stroke()}}};sl=nl([K(),rl(0,X(ct)),rl(0,q(Ca)),il("design:paramtypes",[Object])],sl);var al=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},ol=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ll=function(t,e){return function(n,i){e(n,i,t)}};const hl=["","repeat-x","repeat-y","repeat"];let ul=class extends $o{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=ta,this.builtinContributions=[Do,zo],this.init(t)}drawShape(t,e,n,i,r,s,a,o){const l=Qi(t).image,{repeatX:h=l.repeatX,repeatY:u=l.repeatY,x:c=l.x,y:d=l.y,cornerRadius:f=l.cornerRadius,fillStrokeOrder:p=l.fillStrokeOrder,cornerType:g=l.cornerType,image:m}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b;if(!m||!t.resources)return;const S=t.resources.get(m);if("success"!==S.state)return;const A=t.width,w=t.height;e.beginPath();let T=!1;0===f||Ct(f)&&f.every((t=>0===t))?e.rect(n,i,A,w):(Po(e,n,i,A,w,f,"bevel"!==g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(x)if(a)a(e,t.attribute,l);else if(y){e.setCommonStyle(t,t.attribute,n,i,l);let r=0;if("repeat"===h&&(r|=1),"repeat"===u&&(r|=2),r){const t=e.createPattern(S.data,hl[r]);e.fillStyle=t,e.translate(n,i,!0),e.fillRect(0,0,A,w),e.translate(-n,-i,!0)}else e.drawImage(S.data,n,i,A,w)}},C=()=>{_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,c-n,d-i,l),e.stroke()))};p?(C(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),B(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,x,!1,y,!1,l,r,a),B(),T&&e.restore(),C()),this.afterRenderStep(t,e,n,i,x,!1,y,!1,l,r,a)}draw(t,e,n){const{image:i}=t.attribute;if(!i||!t.resources)return;const r=t.resources.get(i);if("loading"===r.state&&Bt(i))return void kr.improveImageLoading(i);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=Qi(t).image;this._draw(t,a,!1,n)}};ul=al([K(),ll(0,X(ct)),ll(0,q(wa)),ol("design:paramtypes",[Object])],ul);const cl=Symbol.for("GraphicRender"),dl=Symbol.for("RectRender"),fl=Symbol.for("SymbolRender"),pl=Symbol.for("TextRender"),gl=Symbol.for("RichTextRender"),ml=Symbol.for("ImageRender");let bl;function yl(){!function(){if(null==bl)try{const t=document.createElement("canvas"),e=t.getContext("2d");bl=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),bl&&(bl=!!document.createElement)}catch(t){bl=!1}}();const t=Bi.global&&Bi.global.env;return t?"browser"===t:bl}var vl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},xl=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};let _l=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new _e}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}loadFont(t,e,n){return xl(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}isMacOS(){return!1}copyToClipBoard(t){return Promise.resolve(null)}};_l=vl([K()],_l);let Sl=!1;const Al=new D((t=>{Sl||(Sl=!0,t(Ko).toSelf().inSingletonScope(),t(dl).to(Ko).inSingletonScope(),t(cl).toService(dl),t(Ro).toSelf(),t(Lo).toSelf(),t(Ta).toService(Ro),t(Ta).toService(Lo),t(Ta).toService(To),ft(t,Ta))}));let wl=!1;const Tl=new D((t=>{wl||(wl=!0,t(Jo).toSelf().inSingletonScope(),t(fl).to(Jo).inSingletonScope(),t(cl).toService(fl),t(Ba).toService(To),ft(t,Ba))}));let Bl=!1;const Cl=new D((t=>{Bl||(Bl=!0,t(pl).to(sl).inSingletonScope(),t(cl).toService(pl),t(Ca).toService(To),ft(t,Ca))}));var kl=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Ml=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Pl=class extends $o{constructor(){super(),this.numberType=na,this.builtinContributions=[el],this.init()}drawShape(t,e,n,i,r){const s=Qi(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:l=s.fillOpacity,visible:h=s.visible}=t.attribute;if(!t.valid||!h)return;const u=Sa(o,l,!0),c=Sa(o,a,!0);u&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(n,i),this.beforeRenderStep(t,e,n,i,u,c,u,c,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,u,c,u,c,s,r))}drawIcon(t,e,n,i,r){var s;const a=Qi(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:u,backgroundFill:c=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:f=a.backgroundStroke,backgroundStrokeOpacity:p=a.backgroundStrokeOpacity,backgroundRadius:g=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:b=o,backgroundHeight:y=l}=t.attribute;if(m&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){const t=(b-o)/2,r=(y-l)/2;0===g?(e.beginPath(),e.rect(n-t,i-r,b,y)):(e.beginPath(),Po(e,n-t,i-r,b,y,g,!0)),c&&(e.globalAlpha=d,e.fillStyle=c,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const v=u&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(u));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,n,i,o,l))}draw(t,e,n){const i=Qi(t).richtext;this._draw(t,i,!1,n)}};Pl=kl([K(),Ml("design:paramtypes",[])],Pl);let El=!1;const Ol=new D((t=>{El||(El=!0,t(gl).to(Pl).inSingletonScope(),t(cl).toService(gl))}));let Ll=!1;const Rl=new D((t=>{Ll||(Ll=!0,t(ml).to(ul).inSingletonScope(),t(cl).toService(ml),t(wa).toService(To),ft(t,wa))}));class Il{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=U.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{const e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),Bi.graphicService.hooks.onRemove.unTap(this.key),Bi.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?Bi.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Bi.global.createDom(Object.assign({tagName:"div",parent:i},n)),nativeContainer:i}}parseDefaultStyleFromGraphic(t){return function(t){const e={},n=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((n=>{t[n]&&(e[Ne(n)]=t[n])})),["fontSize","lineHeight"].forEach((i=>{const r=Ne(i);_t(t[i])||(e[r]=n(t[i]))})),St(t.maxLineWidth)&&(e["max-width"]=n(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&Bt(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:Qi(t).text)}getTransformOfText(t){const e=Qi(t).text,{textAlign:n=e.textAlign,textBaseline:i=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:a,scaleY:o}=r,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:n,transform:`translate(${l[n]},${l[i]}) rotate(${s}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${h[n]} ${h[i]}`}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&n.addEventListener("wheel",this.onWheel)}))),n.style.position||(n.style.position="absolute",i.style.position="relative");let l=0,h=0;const u=t.globalAABBBounds;let c=r.anchorType;if(_t(c)&&(c="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===c&&(c="top-left"),"position"===c||u.empty()){const e=t.globalTransMatrix;l=e.e,h=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,h=(r+s)/2,u=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,c=-.5;break;case"top-left":u=-.5,c=-.5;break;case"bottom-right":u=.5,c=.5;break;case"bottom-left":u=-.5,c=.5}return l+=u*a,h+=c*o,{x:l,y:h}})(u,c);l=t.x,h=t.y}const d=Bi.global.getElementTopLeft(i,!1),f=e.window.getTopLeft(!1),p=e.viewBox,g=l+f.left-d.left+p.x1,m=h+f.top-d.top+p.y1;if(o.left=`${g}px`,o.top=`${m}px`,"text"===t.type&&"position"===c&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),xt(r.style)){const e=r.style({top:m,left:g,width:u.width(),height:u.height()},t,n);e&&(o=Object.assign(Object.assign({},o),e))}else At(r.style)?o=Object.assign(Object.assign({},o),r.style):Bt(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const n=e.split(":");if(2===n.length){const e=n[0].trim(),i=n[1].trim();e&&i&&(t[e]=i)}}})),t}(r.style)));Bi.global.updateDom(n,{width:r.width,height:r.height,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===Bi.global.env&&(t.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:ui.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:ui.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&Bi.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;const{html:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const{dom:r,container:s}=n;if(!r)return;const a=_t(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof r?this.htmlMap[a].wrapContainer.innerHTML=r:r!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,i,o,l,n),this.htmlMap[a].renderId=this.renderId}release(){"browser"===Bi.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class Nl extends Il{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=U.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:n,unmount:i}=this.htmlMap[t];e?Bi.global.getRequestAnimationFrame()((()=>{e.unmount()})):i&&i(),n&&Bi.global.removeDom(n),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:n}=t.attribute;if(!n)return;const i=t.stage;if(!i)return;const r=i.params.ReactDOM,{element:s,container:a}=n;if(!s||!r||!r.createRoot&&!r.render)return;const o=_t(n.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:n.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])r.createRoot?this.htmlMap[o].root.render(s):r.render(s,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(i,a);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const n=r.createRoot(t);n.render(s),this.htmlMap[o]={root:n,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else r.render(s,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,l,h,n),this.htmlMap[o].renderId=this.renderId}}const Ul=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Dl extends ya{constructor(t,e){super(t),this._skipRenderAttributes=Ul,(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,n,i){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);if(r)return this._setAttributes(r,n);Tt(this.attribute[t])&&Tt(e)&&!xt(this.attribute[t])&&!xt(e)?Ht(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,n){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t,this._setAttributes(t,e)}_setAttributes(t,e){const n=Object.keys(t);this._mergeAttributes(t,n),n.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){_t(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const i=e[n];!Tt(this.attribute[i])||xt(this.attribute[i])||xt(t[i])?this.attribute[i]=t[i]:Ht(this.attribute[i],t[i])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var n;const i=new er(t,e);i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}}const zl=Symbol.for("MathPickerContribution"),Wl=Symbol.for("MathImagePicker"),Fl=Symbol.for("MathRectPicker"),jl=Symbol.for("MathSymbolPicker"),Hl=Symbol.for("MathTextPicker"),Gl=Symbol.for("CanvasImagePicker"),$l=Symbol.for("CanvasRectPicker"),Vl=Symbol.for("CanvasSymbolPicker"),Xl=Symbol.for("CanvasTextPicker"),Yl=Symbol.for("CanvasRichTextPicker"),Kl=Symbol.for("CanvasPickerContribution"),ql={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"};var Ql=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Zl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jl=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function o(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,o)}l((i=i.apply(t,e||[])).next())}))};class th{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 eh(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("img");if(Bi.global.isImageAnonymous&&(n.crossOrigin="anonymous"),e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return n.src=t,n.complete?Promise.resolve(n):new Promise(((t,e)=>{n.onload=()=>{t(n)},n.onerror=()=>{e(new Error("加载失败"))}}))}let nh=class extends _l{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 n,i;let r=0,s=0,a=0,o=0;if(t.changedTouches){const e=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};r=e.clientX||0,s=e.clientY||0,a=r,o=s}else r=t.clientX||0,s=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=r,n=s,a=e.getBoundingClientRect(),o=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;let l,h;return o&&(l=a.width/o.offsetWidth,h=a.height/o.offsetHeight),{x:(t-a.left)/(Pt(l)?l:1),y:(n-a.top)/(Pt(h)?h:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new th(t)}return new _e}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:n,height:i,style:r}=e;return r&&(Bt(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=n&&(t.style.width=`${n}px`),null!=i&&(t.style.height=`${i}px`),!0}createDom(t){const{tagName:e="div",parent:n}=t,i=document.createElement(e);if(this.updateDom(i,t),n){const t=Bt(n)?this.getElementById(n):n;t&&t.appendChild&&t.appendChild(i)}return i}loadImage(t){return eh(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return eh(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,n;const i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:U.GenAutoIncrementId().toString());const r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,i.width=t.width*r,i.height=t.height*r),i}createOffscreenCanvas(t){var e;const n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}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,n){return document.addEventListener(t,e,n)}removeEventListener(t,e,n){return document.removeEventListener(t,e,n)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let n=t.offsetTop,i=t.offsetParent;for(;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}getElementLeft(t,e){let n=t.offsetLeft,i=t.offsetParent;for(;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}getElementTopLeft(t,e){let n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}loadFont(t,e,n){return Jl(this,void 0,void 0,(function*(){return new FontFace(t,Bt(e)?`url(${e})`:e,n).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return{loadState:"fail"}}))}))}isMacOS(){if(void 0===this._isMacOS)try{this._isMacOS=navigator.platform.toUpperCase().indexOf("MAC")>=0}catch(t){this._isMacOS=!1}return this._isMacOS}copyToClipBoard(t){return navigator.clipboard.writeText(t).then((()=>{})).catch((t=>{}))}};nh=Ql([K(),Zl("design:paramtypes",[])],nh);class ih{contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,i.setTransformForCurrent()}else s=0,a=0,i.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,i,s,a,{},null,((t,n,i,r)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=r||l,o)),((t,n,r,s)=>{if(o||l)return!0;const a=n.lineWidth||r.lineWidth,h=n.pickStrokeBuffer||r.pickStrokeBuffer,u=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=u?a+h:Mi(i,a+h,i.dpr),o=t.isPointInStroke(e.x,e.y),l=s||l,o})),i.highPerformanceRestore(),o}}var rh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let sh=class{constructor(){this.type="image",this.numberType=ta}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};sh=rh([K()],sh);let ah=!1;const oh=new D(((t,e,n,i)=>{ah||(ah=!0,t(Wl).to(sh).inSingletonScope(),t(sh).toService(Wl))})),lh=new _e;class hh{constructor(){this.type="rect",this.numberType=ea}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme(),{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,i.setTransformForCurrent()}else a=0,o=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||Mt(s,!0)&&0!==s||Ct(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,a,o,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,o=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=o?s+a:Mi(i,s+a,i.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;lh.setValue(n.x1,n.y1,n.x2,n.y2),lh.expand(-s/2),h=!lh.containsPoint(e)}}return i.highPerformanceRestore(),h}}var uh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},ch=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dh=function(t,e){return function(n,i){e(n,i,t)}};let fh=class extends hh{constructor(t){super(),this.canvasRenderer=t}};fh=uh([K(),dh(0,X(dl)),ch("design:paramtypes",[Object])],fh);let ph=!1;const gh=new D(((t,e,n,i)=>{ph||(ph=!0,t(Fl).to(fh).inSingletonScope(),t(zl).toService(Fl))}));let mh=!1;const bh=new D(((t,e,n,i)=>{mh||(mh=!0,t(Wl).to(sh).inSingletonScope(),t(sh).toService(Wl))}));var yh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},vh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xh=function(t,e){return function(n,i){e(n,i,t)}};let _h=class extends ih{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ia}};_h=yh([K(),xh(0,X(fl)),vh("design:paramtypes",[Object])],_h);let Sh=!1;const Ah=new D(((t,e,n,i)=>{Sh||(Sh=!0,t(jl).to(_h).inSingletonScope(),t(zl).toService(jl))}));var wh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a};let Th=class{constructor(){this.type="text",this.numberType=ra}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Th=wh([K()],Th);let Bh=!1;const Ch=new D(((t,e,n,i)=>{Bh||(Bh=!0,t(Hl).to(Th).inSingletonScope(),t(zl).toService(Hl))}));var kh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Mh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ph=function(t,e){return function(n,i){e(n,i,t)}};let Eh=class extends hh{constructor(t){super(),this.canvasRenderer=t}};Eh=kh([K(),Ph(0,X(dl)),Mh("design:paramtypes",[Object])],Eh);let Oh=!1;const Lh=new D(((t,e,n,i)=>{Oh||(Oh=!0,t($l).to(Eh).inSingletonScope(),t(Kl).toService($l))}));class Rh extends $o{contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getGraphicTheme();i.highPerformanceSave();const s=this.transform(t,r,i),{x:a,y:o,z:l,lastModelMatrix:h}=s;let u=e;if(i.camera){u=e.clone();const n=t.parent.globalTransMatrix;u.x=n.a*e.x+n.c*e.y+n.e,u.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,i,a,o,n,null,((t,e,n)=>!!c||(c=t.isPointInPath(u.x,u.y),c))),this.canvasRenderer.z=0,i.modelMatrix!==h&&Na.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),c}}var Ih=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Nh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uh=function(t,e){return function(n,i){e(n,i,t)}};let Dh=class extends Rh{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ia}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();const s=t.getGraphicTheme(),a=this.transform(t,s,i),{x:o,y:l,z:h,lastModelMatrix:u}=a;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,i,o,l,{},null,((t,e,n)=>!!d||(d=t.isPointInPath(c.x,c.y),d)),((t,e,n)=>{if(d)return!0;const r=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer,a=e.keepStrokeScale||n.keepStrokeScale;return i.lineWidth=a?r+s:Mi(i,r+s,i.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==u&&Na.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),d}};Dh=Ih([K(),Uh(0,X(fl)),Nh("design:paramtypes",[Object])],Dh);let zh=!1;const Wh=new D(((t,e,n,i)=>{zh||(zh=!0,t(Vl).to(Dh).inSingletonScope(),t(Kl).toService(Vl))}));var Fh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},jh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hh=function(t,e){return function(n,i){e(n,i,t)}};let Gh=class extends Rh{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=ra}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();const s=t.getGraphicTheme(),{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,s,i,o),{x:h,y:u,z:c,lastModelMatrix:d}=l;this.canvasRenderer.z=c;let f=e;if(i.camera){f=e.clone();const n=t.parent.globalTransMatrix;f.x=n.a*e.x+n.c*e.y+n.e,f.y=n.b*e.x+n.d*e.y+n.f}let p=!1;return this.canvasRenderer.drawShape(t,i,h,u,{},null,((e,n,i)=>{if(p)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),m=Pa(a,d,r),b=Ma(o,g);return e.rect(b+h,m+u,g,d,c),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&Na.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};Gh=Fh([K(),Hh(0,X(pl)),jh("design:paramtypes",[Object])],Gh);let $h=!1;const Vh=new D(((t,e,n,i)=>{$h||($h=!0,t(Xl).to(Gh).inSingletonScope(),t(Kl).toService(Xl))}));var Xh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},Yh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kh=function(t,e){return function(n,i){e(n,i,t)}};let qh=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=na}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};qh=Xh([K(),Kh(0,X(gl)),Yh("design:paramtypes",[Object])],qh);let Qh=!1;const Zh=new D(((t,e,n,i)=>{Qh||(Qh=!0,t(Yl).to(qh).inSingletonScope(),t(Kl).toService(Yl))}));var Jh=function(t,e,n,i){var r,s=arguments.length,a=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,n,a):r(e,n))||a);return s>3&&a&&Object.defineProperty(e,n,a),a},tu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},eu=function(t,e){return function(n,i){e(n,i,t)}};let nu=class extends ih{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=ta}};nu=Jh([K(),eu(0,X(ml)),tu("design:paramtypes",[Object])],nu);let iu=!1;const ru=new D(((t,e,n,i)=>{iu||(iu=!0,t(Gl).to(nu).inSingletonScope(),t(Kl).toService(Gl))})),su=yl();function au(){au.__loaded||(au.__loaded=!0,bo.RegisterGraphicCreator("group",va))}au.__loaded=!1;const ou=au;function lu(){lu.__loaded||(lu.__loaded=!0,bo.RegisterGraphicCreator("image",oo),Fi.load(Rl),Fi.load(su?ru:oh))}lu.__loaded=!1;const hu=lu;function uu(){uu.__loaded||(uu.__loaded=!0,bo.RegisterGraphicCreator("rect",eo),Fi.load(Al),Fi.load(su?Lh:gh))}uu.__loaded=!1;const cu=uu;function du(){du.__loaded||(du.__loaded=!0,bo.RegisterGraphicCreator("richtext",po),Fi.load(Ol),Fi.load(su?Zh:bh))}du.__loaded=!1;const fu=du;function pu(){pu.__loaded||(pu.__loaded=!0,bo.RegisterGraphicCreator("symbol",Za),Fi.load(Tl),Fi.load(su?Wh:Ah))}pu.__loaded=!1;const gu=pu;function mu(){mu.__loaded||(mu.__loaded=!0,bo.RegisterGraphicCreator("text",Va),Fi.load(Cl),Fi.load(su?Vh:Ch))}mu.__loaded=!1;const bu=mu;function yu(){yu.__loaded||(yu.__loaded=!0,bo.RegisterGraphicCreator("wrapText",Ka))}yu.__loaded=!1;const vu=yu,xu="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 _u;function Su(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const i=vo({text:t,fontFamily:e.fontFamily||n.fontFamily||xu,fontSize:e.fontSize||n.fontSize||12,fontWeight:e.fontWeight||n.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||n.fontSize||12});return{width:i.width(),height:i.height()}}function Au(t){return"rich"===function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var n,i;return At(t.text)&&"type"in t.text?null!==(n=t.text.type)&&void 0!==n?n:"text":e in t&&null!==(i=t[e])&&void 0!==i?i:"text"}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type")}!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(_u||(_u={})),_u.selectedReverse,_u.selected,_u.hover,_u.hoverReverse;var wu=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};ou(),cu(),gu(),fu(),bu();let Tu=class t extends Dl{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,n;this.cacheStates();const{text:i="",textStyle:r={},shape:s={},panel:a={},space:o=4,minWidth:l,maxWidth:h,padding:u=4,visible:c,state:d,type:f,textAlwaysCenter:p,containerTextAlign:g}=this.attribute,m=function(t){if(Pt(t))return[t,t,t,t];if(Ct(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,n]=t;return[e,n,e,n]}if(3===e){const[e,n,i]=t;return[e,n,i,n]}if(4===e)return t}if(At(t)){const{top:e=0,right:n=0,bottom:i=0,left:r=0}=t;return[e,n,i,r]}return[0,0,0,0]}(u),b=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let y,v=-m[3],x=-m[0],_=m[1]+m[3],S=m[0]+m[2],A=0,w=0;const{visible:T}=s,B=wu(s,["visible"]);if(vt(T)){const t=(null==B?void 0:B.size)||10,e=Mt(t)?t:Math.max(t[0],t[1]);y=b.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},B),{visible:T,x:e/2,y:e/2}),"symbol"),Ut(null==d?void 0:d.shape)||(y.states=d.shape),T&&(w=e+o)}let C,k,M;if(_+=w,A+=w,Au({text:i})||"rich"===f){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return St(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(n=t.height)&&void 0!==n?n:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:f,text:i},r))),r),{visible:St(i)&&!1!==c,x:A,y:0});_t(t.lineHeight)&&(t.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",t,"richtext"),k=C.AABBBounds.width(),M=C.AABBBounds.height()}else{const n=Object.assign(Object.assign({text:At(i)&&"type"in i&&"text"===i.type?i.text:i,visible:St(i)&&!1!==c,lineHeight:null==r?void 0:r.fontSize},r),{x:A,y:0});_t(n.lineHeight)&&(n.lineHeight=r.fontSize),C=b.createOrUpdateChild("tag-text",n,"text");const s=Su(n.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);k=s.width,M=s.height}_+=k;const P=null!==(n=s.size)&&void 0!==n?n:10,E=Mt(P)?P:Math.max(P[0],P[1]);S+=Math.max(M,s.visible?E:0);const{textAlign:O,textBaseline:L}=r;(St(l)||St(h))&&(St(l)&&_<l&&(_=l),St(h)&&_>h&&(_=h,C.setAttribute("maxLineWidth",h-m[1]-m[2]))),v=0,x=0;let R=0;"left"===O||"start"===O?R=1:"right"===O||"end"===O?R=-1:"center"===O&&(R=0),R?R<0?(v-=_,y&&y.setAttribute("x",(y.attribute.x||0)-k),b.setAttribute("x",-m[1]-w)):R>0&&b.setAttribute("x",m[3]):(v-=_/2,y&&y.setAttribute("x",(y.attribute.x||0)-k/2),b.setAttribute("x",-w/2));const I="right"===g||"end"===g,N="left"===g||"start"===g,U=(t,e)=>{var n;"richtext"===C.type?C.setAttributes({x:t,textAlign:e,textConfig:(n=C.attribute.textConfig,St(n)?Ct(n)?n:[n]:[]).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):C.setAttributes({x:t,textAlign:e})};if((g?"center"===g:p)&&R){const t=_-m[1]-m[3],e=k+w,n=1===R?(t-e)/2+w+k/2:m[0]+w-(_/2+e/2-w)+k/2;if(U(n,"center"),y){const t=n-k/2-w+E/2;y.setAttributes({x:t})}}if(N&&1!==R){const t=_-m[1]-m[3],e=0===R?-t/2+w/2:-_+m[3]+m[1]+w;if(U(e+w,"left"),y){const t=e+E/2;y.setAttributes({x:t})}}if(I&&-1!==R){const t=_-m[1]-m[3],e=0===R?t/2+w/2:t;if(U(e,"right"),y){const t=e-k-w+E/2;y.setAttributes({x:t})}}"middle"===L?(x-=S/2,y&&y.setAttribute("y",0)):"bottom"===L?(x-=S,y&&y.setAttribute("y",-M/2),b.setAttribute("y",-m[2])):"top"===L&&(b.setAttribute("y",m[0]),y&&y.setAttribute("y",M/2)),Ut(null==d?void 0:d.text)||(C.states=d.text);const{visible:D}=a,z=wu(a,["visible"]);if(c&&vt(D)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},z),{visible:D&&!!i,width:_,height:S,x:v,y:x}),"rect");if(Ut(null==d?void 0:d.panel)||(t.states=d.panel),z.customShape){const e=z.customShape;t.pathProxy=t=>e(this,t,new ei)}this._bgRect=t}this._textShape=C,this._symbol=y,this.resetStates()}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e),super.initAttributes(e),this.render()}addState(t,e,n){super.addState(t,e,n),this._textShape&&this._textShape.addState(t,e,n),this._bgRect&&this._bgRect.addState(t,e,n),this._symbol&&this._symbol.addState(t,e,n)}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,n,i,r,s,a,o,l,h,u,c,d,f;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(r=null===(i=null===(n=this._bgRect)||void 0===n?void 0:n.currentStates)||void 0===i?void 0:i.slice())&&void 0!==r?r:[],this._symbolStates=null!==(o=null===(a=null===(s=this._symbol)||void 0===s?void 0:s.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(u=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==u?u:[],this.clearStates(),null===(c=this._bgRect)||void 0===c||c.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(f=this._textShape)||void 0===f||f.clearStates()}resetStates(){var t,e,n;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===(n=this._textShape)||void 0===n||n.useStates(this._textStates))}};Tu.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};ou(),cu(),bu(),hu();class Bu extends Dl{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:Ht({},Bu.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,n)=>{"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 to(Ht({},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 ao(Ht({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new ao(Ht({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 $a(Ht({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,n=this._text.AABBBounds.height(),i=Math.max(t,e,n),r=i/2-t/2,s=i/2-e/2,a=i/2-n/2,o=this.attribute.box.width,l=this.attribute.icon.width,h=Math.max(o,l),u=h/2-o/2,c=h/2-l/2,d=h+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:u,y:r}),this._checkIcon.setAttributes({x:c,y:s}),this._indeterminateIcon.setAttributes({x:c,y:s}),this._text.setAttributes({x:d,y:a})}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:Ht({},Bu.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}Bu.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}},ou(),cu(),vu(),hu();let Cu=class t extends Dl{constructor(e,n){super((null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e)),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,n)=>{"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 mo(Ht({},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 $a(Ht({},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(),n=Math.max(t,e),i=n/2-t/2+this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,r=n/2-e/2,s=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),a=this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,o=s+this.attribute.spaceBetweenTextAndIcon;this._circle.setAttributes({x:a,y:i}),this._text.setAttributes({x:o,y:r})}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:Ht({},t.defaultAttributes,e),super.initAttributes(e),this.renderGroup(),this.render()}};Cu.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}};class ku extends Nl{removeElement(t){super.removeElement(t),delete this.htmlMap[t]}renderGraphicHTML(t){const{react:e}=t.attribute;if(!e)return;const n=t.stage;if(!n)return;const i=n.params.ReactDOM,{element:r}=e;let{container:s}=e;if(s&&(s=function(t){const e=function(t){for(;t&&t.parent;){if("custom-container"===t.name)return t;t=t.parent}return null}(t);if(!e)return null;const{col:n,row:i,stage:r}=e;let{container:s}=t.attribute.react;const{table:a}=r;s===a.bodyDomContainer&&n<a.frozenColCount&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.bottomFrozenBodyDomContainer:s===a.bodyDomContainer&&n>=a.colCount-a.rightFrozenColCount&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.rightFrozenBottomDomContainer:s===a.bodyDomContainer&&i>=a.rowCount-a.bottomFrozenRowCount?s=a.bottomFrozenBodyDomContainer:s===a.bodyDomContainer&&n<a.frozenColCount?s=a.frozenBodyDomContainer:s===a.bodyDomContainer&&n>=a.colCount-a.rightFrozenColCount?s=a.rightFrozenBodyDomContainer:s===a.headerDomContainer&&n<a.frozenColCount?s=a.frozenHeaderDomContainer:s===a.headerDomContainer&&n>=a.colCount-a.rightFrozenColCount&&(s=a.rightFrozenHeaderDomContainer);return s}(t)),!r||!i||!i.createRoot&&!i.render)return;const a=h(e.id)?`${t.id??t._uid}_react`:e.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])i.createRoot?this.htmlMap[a].root.render(r):i.render(r,this.htmlMap[a].wrapContainer);else{const{wrapContainer:e,nativeContainer:o}=this.getWrapContainer(n,s);if(e)if(this.htmlMap||(this.htmlMap={}),i.createRoot){const n=i.createRoot(e);n.render(r),this.htmlMap[a]={root:n,wrapContainer:e,nativeContainer:o,container:s,renderId:this.renderId,graphic:t}}else i.render(r,e),this.htmlMap[a]={wrapContainer:e,nativeContainer:o,container:s,renderId:this.renderId,unmount:()=>{i.unmountComponentAtNode(e)},graphic:t}}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,n,o,l,e),this.htmlMap[a].renderId=this.renderId}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?Bi.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Bi.global.createDom({tagName:"div",parent:i,...n}),nativeContainer:i}}updateStyleOfWrapContainer(t,e,n,i,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(n),a.forEach((t=>{"wheel"===t&&(n.addEventListener("wheel",this.onWheel),n.addEventListener("wheel",(t=>{t.preventDefault()}),!0))}))),n.style.position||(n.style.position="absolute");let u=0,d=0;const f=t.globalAABBBounds;let g=r.anchorType;if(h(g)&&(g="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===g&&(g="top-left"),"position"===g||f.empty()){const e=t.globalTransMatrix;u=e.e,d=e.f}else{const t=((t,e)=>{const{x1:n,x2:i,y1:r,y2:s}=t,a=Math.abs(i-n),o=Math.abs(s-r);let l=(n+i)/2,h=(r+s)/2,u=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":u=-.5;break;case"right":case"inside-right":u=.5;break;case"top-right":u=.5,c=-.5;break;case"top-left":u=-.5,c=-.5;break;case"bottom-right":u=.5,c=.5;break;case"bottom-left":u=-.5,c=.5}return l+=u*a,h+=c*o,{x:l,y:h}})(f,g);u=t.x,d=t.y}const m=Bi.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=u+b.left-m.left,v=d+b.top-m.top;if(o.left=`${y}px`,o.top=`${v}px`,"text"===t.type&&"position"===g&&(o={...o,...this.getTransformOfText(t)}),l(r.style)){const e=r.style({top:v,left:y,width:f.width(),height:f.height()},t,n);e&&(o={...o,...e})}else c(r.style)?o={...o,...r.style}:p(r.style)&&r.style&&(o={...o,...B(r.style)});Bi.global.updateDom(n,{width:r.width,height:r.height,style:o,graphic:t})}drawHTML(){"browser"===Bi?.global?.env&&(this.pluginService.stage.children.sort(((t,e)=>(t.attribute.zIndex??ui.zIndex)-(e.attribute.zIndex??ui.zIndex))).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}}const Mu=new D(((t,e,n,i)=>{t(Pu).toSelf().inSingletonScope(),n(mt)?i(mt).toService(Pu):t(mt).toService(Pu)}));class Pu extends nh{updateDom(t,n){const i=t.parentElement;if(i&&n.graphic){const r=parseInt(n.style.top,10),s=parseInt(n.style.left,10);let a,o;if(t.style.display="none"){const t=e.getTargetCell(n.graphic);a=t.attribute.width??1,o=t.attribute.height??1}else a=t.offsetWidth,o=t.offsetHeight;if(r+o<0||s+a<0||r>i.offsetHeight||s>i.offsetWidth)return t.style.display="none",!1}const{width:r,height:s,style:a}=n;return a&&(p(a)?t.setAttribute("style",a):Object.keys(a).forEach((e=>{t.style[e]=a[e]}))),null!=r&&(t.style.width=`${r}px`),null!=s&&(t.style.height=`${s}px`),!0}}yl()&&Fi.load(Mu);const Eu=["children","hooks","ref",...R,"skipFunctionDiff","onError","onReady","option","records","container","vtableConstrouctor"],Ou=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,Lu=n.forwardRef(((t,e)=>{const[r,s]=n.useState(0),a=n.useRef({});n.useImperativeHandle(e,(()=>a.current?.table));const o=!!t.option,l=!!t.records,u=n.useRef(!1),c=n.useRef(S(t,Eu)),d=n.useRef(null),f=n.useRef(t.records),p=n.useRef(null),g=!!t.skipFunctionDiff,m=!!t.keepColumnWidthChange,b=n.useRef(new Map),y=n.useRef([]),v=n.useRef([]),x=n.useCallback((t=>o&&t.option?l&&t.records?{...t.option,clearDOM:!1,records:t.records}:{...t.option,clearDOM:!1}:{records:t.records,...c.current,...d.current,clearDOM:!1,customConfig:{...c.current.customConfig,createReactContainer:!0}}),[o,l]),_=n.useCallback((t=>{const e=new t.vtableConstrouctor(t.container,x(t));e.scenegraph.stage.reactAttribute=t.ReactDOM,e.scenegraph.stage.pluginService.register(t.reactAttributePlugin??new ku),e.scenegraph.stage.params.ReactDOM=t.ReactDOM,a.current={...a.current,table:e},u.current=!1,b.current.clear(),y.current=[],v.current=[],e.on("resize_column_end",(t=>{const n=a.current.table;if(!m)return;const{col:i,colWidths:r}=t,s=r[i];if(e.isPivotTable()){const t=n.getCellHeaderPaths(i,n.columnHeaderLevelCount);let e;e="rowHeader"===t.cellLocation?t.rowHeaderPaths:t.colHeaderPaths;let r=!1;y.current.forEach((t=>{JSON.stringify(t.dimensions)===JSON.stringify(e)&&(t.width=s,r=!0)})),r||y.current.push({dimensions:e,width:s})}else{const t=n.getBodyColumnDefine(i,0);t?.key&&b.current.set(t.key,s)}}))}),[x]),A=n.useCallback((()=>{if(!u.current){if(!a.current||!a.current.table)return;N(a.current.table,t,p.current,L),s(r+1),t.onReady&&t.onReady(a.current.table,0===r)}}),[r,s,t]),w=n.useCallback((()=>{a.current.table&&(a.current.table.render(),A())}),[A]);return n.useEffect((()=>{const e=o?null:(t=>{const e={};return E(t.children).map(((t,n)=>{const i=t&&t.type&&t.type.parseOption;if(i&&t.props){const r=i(h(t.props.componentId)?{...t.props,componentId:Ou(t,n)}:t.props);t.key&&(r.option.key=t.key),r.isSingle?e[r.optionName]=r.option:(e[r.optionName]||(e[r.optionName]=[]),e[r.optionName].push(r.option))}})),e})(t);if(!a.current?.table)return o||(d.current=e),_(t),w(),void(p.current=t);if(o){if(T(p.current.option,t.option,{skipFunction:g})){if(l&&!T(p.current.records,t.records,{skipFunction:g})){if(m){const t=Iu(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{const e=x(t);if(m){const t=Iu(b.current,y.current,a.current.table);e.columnWidthConfig=t,e.columnWidthConfigForRowHeader=t}a.current.table.updateOption(e),A(),p.current=t}return}const n=S(t,Eu);if(T(n,c.current,{skipFunction:g})&&T(e,d.current,{skipFunction:g})){if(l&&!T(t.records,f.current,{skipFunction:g})){if(f.current=t.records,m){const t=Iu(b.current,y.current,a.current.table);a.current.table.internalProps.columnWidthConfig=t,a.current.table.internalProps.columnWidthConfigForRowHeader=t}a.current.table.setRecords(t.records),A(),p.current=t}}else{c.current=n,d.current=e;const i=x(t);if(m){const t=Iu(b.current,y.current,a.current.table);i.columnWidthConfig=t,i.columnWidthConfigForRowHeader=t}a.current.table.updateOption(i),A(),p.current=t}}),[_,o,l,x,A,w,g,t]),n.useEffect((()=>()=>{a&&a.current&&a.current.table&&(a.current.table.release(),a.current=null),p.current=null,u.current=!0}),[]),n.createElement(i.Provider,{value:a.current},E(t.children).map(((t,e)=>{if("string"==typeof t)return;const i=Ou(t,e);return n.createElement(n.Fragment,{key:i},n.cloneElement(t,{updateId:r,componentId:i,componentIndex:e}))})))})),Ru=(t,e,i)=>{const r=function(t,e="TableContainer",i){const r=n.forwardRef(((e,r)=>{const s=n.useRef(),[a,o]=n.useState(!1),{className:l,style:h,width:u,...c}=e;return n.useLayoutEffect((()=>{o(!0)}),[]),n.createElement("div",{ref:s,className:l,style:{position:"relative",height:e.height||"100%",width:e.width||"100%",...h}},a?n.createElement(t,{ref:r,container:s.current,...i?i(c):c}):n.createElement(n.Fragment,null))}));return r.displayName=e||t.name,r}(Lu,t,(t=>e?Object.assign(t,e):t));return r.displayName=t,r};function Iu(t,e,n){if(n.isPivotTable())return e;const i=[];return t.forEach(((t,e)=>{i.push({key:e,width:t})})),i}const Nu=Ru("ListTable",{type:"list-table",vtableConstrouctor:e.ListTable}),Uu=Ru("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTable}),Du=Ru("PivotChart",{type:"pivot-chart",vtableConstrouctor:e.PivotChart});const zu=Ru("ListTable",{type:"list-table",vtableConstrouctor:e.ListTableSimple}),Wu=Ru("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTableSimple});var Fu,ju,Hu,Gu,$u={exports:{}},Vu={exports:{}},Xu={};function Yu(){return ju||(ju=1,Vu.exports=(Fu||(Fu=1,function(t){function e(t,e){var n=t.length;t.push(e);t:for(;0<n;){var i=n-1>>>1,s=t[i];if(!(0<r(s,e)))break t;t[i]=e,t[n]=s,n=i}}function n(t){return 0===t.length?null:t[0]}function i(t){if(0===t.length)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;t:for(var i=0,s=t.length,a=s>>>1;i<a;){var o=2*(i+1)-1,l=t[o],h=o+1,u=t[h];if(0>r(l,n))h<s&&0>r(u,l)?(t[i]=u,t[h]=n,i=h):(t[i]=l,t[o]=n,i=o);else{if(!(h<s&&0>r(u,n)))break t;t[i]=u,t[h]=n,i=h}}}return e}function r(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var s=performance;t.unstable_now=function(){return s.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],h=[],u=1,c=null,d=3,f=!1,p=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,b="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function v(t){for(var r=n(h);null!==r;){if(null===r.callback)i(h);else{if(!(r.startTime<=t))break;i(h),r.sortIndex=r.expirationTime,e(l,r)}r=n(h)}}function x(t){if(g=!1,v(t),!p)if(null!==n(l))p=!0,O(_);else{var e=n(h);null!==e&&L(x,e.startTime-t)}}function _(e,r){p=!1,g&&(g=!1,b(T),T=-1),f=!0;var s=d;try{for(v(r),c=n(l);null!==c&&(!(c.expirationTime>r)||e&&!k());){var a=c.callback;if("function"==typeof a){c.callback=null,d=c.priorityLevel;var o=a(c.expirationTime<=r);r=t.unstable_now(),"function"==typeof o?c.callback=o:c===n(l)&&i(l),v(r)}else i(l);c=n(l)}if(null!==c)var u=!0;else{var m=n(h);null!==m&&L(x,m.startTime-r),u=!1}return u}finally{c=null,d=s,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,A=!1,w=null,T=-1,B=5,C=-1;function k(){return!(t.unstable_now()-C<B)}function M(){if(null!==w){var e=t.unstable_now();C=e;var n=!0;try{n=w(!0,e)}finally{n?S():(A=!1,w=null)}}else A=!1}if("function"==typeof y)S=function(){y(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,E=P.port2;P.port1.onmessage=M,S=function(){E.postMessage(null)}}else S=function(){m(M,0)};function O(t){w=t,A||(A=!0,S())}function L(e,n){T=m((function(){e(t.unstable_now())}),n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(t){t.callback=null},t.unstable_continueExecution=function(){p||f||(p=!0,O(_))},t.unstable_forceFrameRate=function(t){0>t||125<t||(B=0<t?Math.floor(1e3/t):5)},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(t){switch(d){case 1:case 2:case 3:var e=3;break;default:e=d}var n=d;d=e;try{return t()}finally{d=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=d;d=t;try{return e()}finally{d=n}},t.unstable_scheduleCallback=function(i,r,s){var a=t.unstable_now();switch(s="object"==typeof s&&null!==s&&"number"==typeof(s=s.delay)&&0<s?a+s:a,i){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return i={id:u++,callback:r,priorityLevel:i,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(i.sortIndex=s,e(h,i),null===n(l)&&i===n(h)&&(g?(b(T),T=-1):g=!0,L(x,s-a))):(i.sortIndex=o,e(l,i),p||f||(p=!0,O(_))),i},t.unstable_shouldYield=k,t.unstable_wrapCallback=function(t){var e=d;return function(){var n=d;d=e;try{return t.apply(this,arguments)}finally{d=n}}}}(Xu)),Xu)),Vu.exports}
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-reconciler.production.min.js
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/Hu.exports=(ju||(ju=1,Fu=function(t){var e={},i=n,r=Vu(),s=Object.assign;function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),h=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),_=Symbol.iterator;function S(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=_&&t[_]||t["@@iterator"])?t:null}function A(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case u:return"Fragment";case h:return"Portal";case d:return"Profiler";case c:return"StrictMode";case m:return"Suspense";case b:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case p:return(t.displayName||"Context")+".Consumer";case f:return(t._context.displayName||"Context")+".Provider";case g:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case y:return null!==(e=t.displayName||null)?e:A(t.type)||"Memo";case v:e=t._payload,t=t._init;try{return A(t(e))}catch(t){}}return null}function w(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=e.render).displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return A(e);case 8:return e===c?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e}return null}function T(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!=(4098&(e=t).flags)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function B(t){if(T(t)!==t)throw Error(a(188))}function C(t){var e=t.alternate;if(!e){if(null===(e=T(t)))throw Error(a(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return B(r),t;if(s===i)return B(r),e;s=s.sibling}throw Error(a(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?t:e}function k(t){return null!==(t=C(t))?M(t):null}function M(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var e=M(t);if(null!==e)return e;t=t.sibling}return null}function P(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){if(4!==t.tag){var e=P(t);if(null!==e)return e}t=t.sibling}return null}var E,O=Array.isArray,L=t.getPublicInstance,R=t.getRootHostContext,I=t.getChildHostContext,N=t.prepareForCommit,D=t.resetAfterCommit,U=t.createInstance,z=t.appendInitialChild,W=t.finalizeInitialChildren,F=t.prepareUpdate,j=t.shouldSetTextContent,H=t.createTextInstance,G=t.scheduleTimeout,$=t.cancelTimeout,V=t.noTimeout,X=t.isPrimaryRenderer,Y=t.supportsMutation,K=t.supportsPersistence,q=t.supportsHydration,Q=t.getInstanceFromNode,Z=t.preparePortalMount,J=t.getCurrentEventPriority,tt=t.detachDeletedInstance,et=t.supportsMicrotasks,nt=t.scheduleMicrotask,it=t.supportsTestSelectors,rt=t.findFiberRoot,st=t.getBoundingRect,at=t.getTextContent,ot=t.isHiddenSubtree,lt=t.matchAccessibilityRole,ht=t.setFocusIfFocusable,ut=t.setupIntersectionObserver,ct=t.appendChild,dt=t.appendChildToContainer,ft=t.commitTextUpdate,pt=t.commitMount,gt=t.commitUpdate,mt=t.insertBefore,bt=t.insertInContainerBefore,yt=t.removeChild,vt=t.removeChildFromContainer,xt=t.resetTextContent,_t=t.hideInstance,St=t.hideTextInstance,At=t.unhideInstance,wt=t.unhideTextInstance,Tt=t.clearContainer,Bt=t.cloneInstance,Ct=t.createContainerChildSet,kt=t.appendChildToContainerChildSet,Mt=t.finalizeContainerChildren,Pt=t.replaceContainerChildren,Et=t.cloneHiddenInstance,Ot=t.cloneHiddenTextInstance,Lt=t.canHydrateInstance,Rt=t.canHydrateTextInstance,It=t.canHydrateSuspenseInstance,Nt=t.isSuspenseInstancePending,Dt=t.isSuspenseInstanceFallback,Ut=t.getSuspenseInstanceFallbackErrorDetails,zt=t.registerSuspenseInstanceRetry,Wt=t.getNextHydratableSibling,Ft=t.getFirstHydratableChild,jt=t.getFirstHydratableChildWithinContainer,Ht=t.getFirstHydratableChildWithinSuspenseInstance,Gt=t.hydrateInstance,$t=t.hydrateTextInstance,Vt=t.hydrateSuspenseInstance,Xt=t.getNextHydratableInstanceAfterSuspenseInstance,Yt=t.commitHydratedContainer,Kt=t.commitHydratedSuspenseInstance,qt=t.clearSuspenseBoundary,Qt=t.clearSuspenseBoundaryFromContainer,Zt=t.shouldDeleteUnhydratedTailInstances,Jt=t.didNotMatchHydratedContainerTextInstance,te=t.didNotMatchHydratedTextInstance;function ee(t){if(void 0===E)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);E=e&&e[1]||""}return"\n"+E+t}var ne=!1;function ie(t,e){if(!t||ne)return"";ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(t){var i=t}Reflect.construct(t,[],e)}else{try{e.call()}catch(t){i=t}t.call(e.prototype)}else{try{throw Error()}catch(t){i=t}t()}}catch(e){if(e&&i&&"string"==typeof e.stack){for(var r=e.stack.split("\n"),s=i.stack.split("\n"),a=r.length-1,o=s.length-1;1<=a&&0<=o&&r[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(r[a]!==s[o]){if(1!==a||1!==o)do{if(a--,0>--o||r[a]!==s[o]){var l="\n"+r[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}}while(1<=a&&0<=o);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ee(t):""}var re=Object.prototype.hasOwnProperty,se=[],ae=-1;function oe(t){return{current:t}}function le(t){0>ae||(t.current=se[ae],se[ae]=null,ae--)}function he(t,e){ae++,se[ae]=t.current,t.current=e}var ue={},ce=oe(ue),de=oe(!1),fe=ue;function pe(t,e){var n=t.type.contextTypes;if(!n)return ue;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r,s={};for(r in n)s[r]=e[r];return i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function ge(t){return null!=t.childContextTypes}function me(){le(de),le(ce)}function be(t,e,n){if(ce.current!==ue)throw Error(a(168));he(ce,e),he(de,n)}function ye(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in e))throw Error(a(108,w(t)||"Unknown",r));return s({},n,i)}function ve(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ue,fe=ce.current,he(ce,t),he(de,de.current),!0}function xe(t,e,n){var i=t.stateNode;if(!i)throw Error(a(169));n?(t=ye(t,e,fe),i.__reactInternalMemoizedMergedChildContext=t,le(de),le(ce),he(ce,t)):le(de),he(de,n)}var _e=Math.clz32?Math.clz32:function(t){return 0==(t>>>=0)?32:31-(Se(t)/Ae|0)|0},Se=Math.log,Ae=Math.LN2,we=64,Te=4194304;function Be(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ce(t,e){var n=t.pendingLanes;if(0===n)return 0;var i=0,r=t.suspendedLanes,s=t.pingedLanes,a=268435455&n;if(0!==a){var o=a&~r;0!==o?i=Be(o):0!=(s&=a)&&(i=Be(s))}else 0!=(a=n&~r)?i=Be(a):0!==s&&(i=Be(s));if(0===i)return 0;if(0!==e&&e!==i&&0==(e&r)&&((r=i&-i)>=(s=e&-e)||16===r&&0!=(4194240&s)))return e;if(0!=(4&i)&&(i|=16&n),0!==(e=t.entangledLanes))for(t=t.entanglements,e&=i;0<e;)r=1<<(n=31-_e(e)),i|=t[n],e&=~r;return i}function ke(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function Me(t){return 0!=(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function Pe(){var t=we;return 0==(4194240&(we<<=1))&&(we=64),t}function Ee(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Oe(t,e,n){t.pendingLanes|=e,536870912!==e&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[e=31-_e(e)]=n}function Le(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-_e(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}var Re=0;function Ie(t){return 1<(t&=-t)?4<t?0!=(268435455&t)?16:536870912:4:1}var Ne=r.unstable_scheduleCallback,De=r.unstable_cancelCallback,Ue=r.unstable_shouldYield,ze=r.unstable_requestPaint,We=r.unstable_now,Fe=r.unstable_ImmediatePriority,je=r.unstable_UserBlockingPriority,He=r.unstable_NormalPriority,Ge=r.unstable_IdlePriority,$e=null,Ve=null,Xe="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},Ye=null,Ke=!1,qe=!1;function Qe(t){null===Ye?Ye=[t]:Ye.push(t)}function Ze(){if(!qe&&null!==Ye){qe=!0;var t=0,e=Re;try{var n=Ye;for(Re=1;t<n.length;t++){var i=n[t];do{i=i(!0)}while(null!==i)}Ye=null,Ke=!1}catch(e){throw null!==Ye&&(Ye=Ye.slice(t+1)),Ne(Fe,Ze),e}finally{Re=e,qe=!1}}return null}var Je=[],tn=0,en=null,nn=0,rn=[],sn=0,an=null,on=1,ln="";function hn(t,e){Je[tn++]=nn,Je[tn++]=en,en=t,nn=e}function un(t,e,n){rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,an=t;var i=on;t=ln;var r=32-_e(i)-1;i&=~(1<<r),n+=1;var s=32-_e(e)+r;if(30<s){var a=r-r%5;s=(i&(1<<a)-1).toString(32),i>>=a,r-=a,on=1<<32-_e(e)+r|n<<r|i,ln=s+t}else on=1<<s|n<<r|i,ln=t}function cn(t){null!==t.return&&(hn(t,1),un(t,1,0))}function dn(t){for(;t===en;)en=Je[--tn],Je[tn]=null,nn=Je[--tn],Je[tn]=null;for(;t===an;)an=rn[--sn],rn[sn]=null,ln=rn[--sn],rn[sn]=null,on=rn[--sn],rn[sn]=null}var fn=null,pn=null,gn=!1,mn=!1,bn=null;function yn(t,e){var n=ro(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,null===(e=t.deletions)?(t.deletions=[n],t.flags|=16):e.push(n)}function vn(t,e){switch(t.tag){case 5:return null!==(e=Lt(e,t.type,t.pendingProps))&&(t.stateNode=e,fn=t,pn=Ft(e),!0);case 6:return null!==(e=Rt(e,t.pendingProps))&&(t.stateNode=e,fn=t,pn=null,!0);case 13:if(null!==(e=It(e))){var n=null!==an?{id:on,overflow:ln}:null;return t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},(n=ro(18,null,null,0)).stateNode=e,n.return=t,t.child=n,fn=t,pn=null,!0}return!1;default:return!1}}function xn(t){return 0!=(1&t.mode)&&0==(128&t.flags)}function _n(t){if(gn){var e=pn;if(e){var n=e;if(!vn(t,e)){if(xn(t))throw Error(a(418));e=Wt(n);var i=fn;e&&vn(t,e)?yn(i,n):(t.flags=-4097&t.flags|2,gn=!1,fn=t)}}else{if(xn(t))throw Error(a(418));t.flags=-4097&t.flags|2,gn=!1,fn=t}}}function Sn(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;fn=t}function An(t){if(!q||t!==fn)return!1;if(!gn)return Sn(t),gn=!0,!1;if(3!==t.tag&&(5!==t.tag||Zt(t.type)&&!j(t.type,t.memoizedProps))){var e=pn;if(e){if(xn(t))throw wn(),Error(a(418));for(;e;)yn(t,e),e=Wt(e)}}if(Sn(t),13===t.tag){if(!q)throw Error(a(316));if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(a(317));pn=Xt(t)}else pn=fn?Wt(t.stateNode):null;return!0}function wn(){for(var t=pn;t;)t=Wt(t)}function Tn(){q&&(pn=fn=null,mn=gn=!1)}function Bn(t){null===bn?bn=[t]:bn.push(t)}var Cn=o.ReactCurrentBatchConfig;function kn(t,e){if(Xe(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!re.call(e,r)||!Xe(t[r],e[r]))return!1}return!0}function Mn(t){switch(t.tag){case 5:return ee(t.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return ie(t.type,!1);case 11:return ie(t.type.render,!1);case 1:return ie(t.type,!0);default:return""}}function Pn(t,e,n){if(null!==(t=n.ref)&&"function"!=typeof t&&"object"!=typeof t){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var i=n.stateNode}if(!i)throw Error(a(147,t));var r=i,s=""+t;return null!==e&&null!==e.ref&&"function"==typeof e.ref&&e.ref._stringRef===s?e.ref:(e=function(t){var e=r.refs;null===t?delete e[s]:e[s]=t},e._stringRef=s,e)}if("string"!=typeof t)throw Error(a(284));if(!n._owner)throw Error(a(290,t))}return t}function En(t,e){throw t=Object.prototype.toString.call(e),Error(a(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function On(t){return(0,t._init)(t._payload)}function Ln(t){function e(e,n){if(t){var i=e.deletions;null===i?(e.deletions=[n],e.flags|=16):i.push(n)}}function n(n,i){if(!t)return null;for(;null!==i;)e(n,i),i=i.sibling;return null}function i(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function r(t,e){return(t=ao(t,e)).index=0,t.sibling=null,t}function s(e,n,i){return e.index=i,t?null!==(i=e.alternate)?(i=i.index)<n?(e.flags|=2,n):i:(e.flags|=2,n):(e.flags|=1048576,n)}function o(e){return t&&null===e.alternate&&(e.flags|=2),e}function c(t,e,n,i){return null===e||6!==e.tag?((e=uo(n,t.mode,i)).return=t,e):((e=r(e,n)).return=t,e)}function d(t,e,n,i){var s=n.type;return s===u?p(t,e,n.props.children,i,n.key):null!==e&&(e.elementType===s||"object"==typeof s&&null!==s&&s.$$typeof===v&&On(s)===e.type)?((i=r(e,n.props)).ref=Pn(t,e,n),i.return=t,i):((i=oo(n.type,n.key,n.props,null,t.mode,i)).ref=Pn(t,e,n),i.return=t,i)}function f(t,e,n,i){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?((e=co(n,t.mode,i)).return=t,e):((e=r(e,n.children||[])).return=t,e)}function p(t,e,n,i,s){return null===e||7!==e.tag?((e=lo(n,t.mode,i,s)).return=t,e):((e=r(e,n)).return=t,e)}function g(t,e,n){if("string"==typeof e&&""!==e||"number"==typeof e)return(e=uo(""+e,t.mode,n)).return=t,e;if("object"==typeof e&&null!==e){switch(e.$$typeof){case l:return(n=oo(e.type,e.key,e.props,null,t.mode,n)).ref=Pn(t,null,e),n.return=t,n;case h:return(e=co(e,t.mode,n)).return=t,e;case v:return g(t,(0,e._init)(e._payload),n)}if(O(e)||S(e))return(e=lo(e,t.mode,n,null)).return=t,e;En(t,e)}return null}function m(t,e,n,i){var r=null!==e?e.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==r?null:c(t,e,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case l:return n.key===r?d(t,e,n,i):null;case h:return n.key===r?f(t,e,n,i):null;case v:return m(t,e,(r=n._init)(n._payload),i)}if(O(n)||S(n))return null!==r?null:p(t,e,n,i,null);En(t,n)}return null}function b(t,e,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i)return c(e,t=t.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case l:return d(e,t=t.get(null===i.key?n:i.key)||null,i,r);case h:return f(e,t=t.get(null===i.key?n:i.key)||null,i,r);case v:return b(t,e,n,(0,i._init)(i._payload),r)}if(O(i)||S(i))return p(e,t=t.get(n)||null,i,r,null);En(e,i)}return null}function y(r,a,o,l){for(var h=null,u=null,c=a,d=a=0,f=null;null!==c&&d<o.length;d++){c.index>d?(f=c,c=null):f=c.sibling;var p=m(r,c,o[d],l);if(null===p){null===c&&(c=f);break}t&&c&&null===p.alternate&&e(r,c),a=s(p,a,d),null===u?h=p:u.sibling=p,u=p,c=f}if(d===o.length)return n(r,c),gn&&hn(r,d),h;if(null===c){for(;d<o.length;d++)null!==(c=g(r,o[d],l))&&(a=s(c,a,d),null===u?h=c:u.sibling=c,u=c);return gn&&hn(r,d),h}for(c=i(r,c);d<o.length;d++)null!==(f=b(c,r,d,o[d],l))&&(t&&null!==f.alternate&&c.delete(null===f.key?d:f.key),a=s(f,a,d),null===u?h=f:u.sibling=f,u=f);return t&&c.forEach((function(t){return e(r,t)})),gn&&hn(r,d),h}function x(r,o,l,h){var u=S(l);if("function"!=typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var c=u=null,d=o,f=o=0,p=null,y=l.next();null!==d&&!y.done;f++,y=l.next()){d.index>f?(p=d,d=null):p=d.sibling;var v=m(r,d,y.value,h);if(null===v){null===d&&(d=p);break}t&&d&&null===v.alternate&&e(r,d),o=s(v,o,f),null===c?u=v:c.sibling=v,c=v,d=p}if(y.done)return n(r,d),gn&&hn(r,f),u;if(null===d){for(;!y.done;f++,y=l.next())null!==(y=g(r,y.value,h))&&(o=s(y,o,f),null===c?u=y:c.sibling=y,c=y);return gn&&hn(r,f),u}for(d=i(r,d);!y.done;f++,y=l.next())null!==(y=b(d,r,f,y.value,h))&&(t&&null!==y.alternate&&d.delete(null===y.key?f:y.key),o=s(y,o,f),null===c?u=y:c.sibling=y,c=y);return t&&d.forEach((function(t){return e(r,t)})),gn&&hn(r,f),u}return function t(i,s,a,c){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:t:{for(var d=a.key,f=s;null!==f;){if(f.key===d){if((d=a.type)===u){if(7===f.tag){n(i,f.sibling),(s=r(f,a.props.children)).return=i,i=s;break t}}else if(f.elementType===d||"object"==typeof d&&null!==d&&d.$$typeof===v&&On(d)===f.type){n(i,f.sibling),(s=r(f,a.props)).ref=Pn(i,f,a),s.return=i,i=s;break t}n(i,f);break}e(i,f),f=f.sibling}a.type===u?((s=lo(a.props.children,i.mode,c,a.key)).return=i,i=s):((c=oo(a.type,a.key,a.props,null,i.mode,c)).ref=Pn(i,s,a),c.return=i,i=c)}return o(i);case h:t:{for(f=a.key;null!==s;){if(s.key===f){if(4===s.tag&&s.stateNode.containerInfo===a.containerInfo&&s.stateNode.implementation===a.implementation){n(i,s.sibling),(s=r(s,a.children||[])).return=i,i=s;break t}n(i,s);break}e(i,s),s=s.sibling}(s=co(a,i.mode,c)).return=i,i=s}return o(i);case v:return t(i,s,(f=a._init)(a._payload),c)}if(O(a))return y(i,s,a,c);if(S(a))return x(i,s,a,c);En(i,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==s&&6===s.tag?(n(i,s.sibling),(s=r(s,a)).return=i,i=s):(n(i,s),(s=uo(a,i.mode,c)).return=i,i=s),o(i)):n(i,s)}}var Rn=Ln(!0),In=Ln(!1),Nn=oe(null),Dn=null,Un=null,zn=null;function Wn(){zn=Un=Dn=null}function Fn(t,e,n){X?(he(Nn,e._currentValue),e._currentValue=n):(he(Nn,e._currentValue2),e._currentValue2=n)}function jn(t){var e=Nn.current;le(Nn),X?t._currentValue=e:t._currentValue2=e}function Hn(t,e,n){for(;null!==t;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,null!==i&&(i.childLanes|=e)):null!==i&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Gn(t,e){Dn=t,zn=Un=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(0!=(t.lanes&e)&&(Or=!0),t.firstContext=null)}function $n(t){var e=X?t._currentValue:t._currentValue2;if(zn!==t)if(t={context:t,memoizedValue:e,next:null},null===Un){if(null===Dn)throw Error(a(308));Un=t,Dn.dependencies={lanes:0,firstContext:t}}else Un=Un.next=t;return e}var Vn=null;function Xn(t){null===Vn?Vn=[t]:Vn.push(t)}function Yn(t,e,n,i){var r=e.interleaved;return null===r?(n.next=n,Xn(e)):(n.next=r.next,r.next=n),e.interleaved=n,Kn(t,i)}function Kn(t,e){t.lanes|=e;var n=t.alternate;for(null!==n&&(n.lanes|=e),n=t,t=t.return;null!==t;)t.childLanes|=e,null!==(n=t.alternate)&&(n.childLanes|=e),n=t,t=t.return;return 3===n.tag?n.stateNode:null}var qn=!1;function Qn(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zn(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Jn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ti(t,e,n){var i=t.updateQueue;if(null===i)return null;if(i=i.shared,0!=(2&ta)){var r=i.pending;return null===r?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Kn(t,n)}return null===(r=i.interleaved)?(e.next=e,Xn(i)):(e.next=r.next,r.next=e),i.interleaved=e,Kn(t,n)}function ei(t,e,n){if(null!==(e=e.updateQueue)&&(e=e.shared,0!=(4194240&n))){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}function ni(t,e){var n=t.updateQueue,i=t.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?r=s=a:s=s.next=a,n=n.next}while(null!==n);null===s?r=s=e:s=s.next=e}else r=s=e;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},void(t.updateQueue=n)}null===(t=n.lastBaseUpdate)?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ii(t,e,n,i){var r=t.updateQueue;qn=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(null!==l){r.shared.pending=null;var h=l,u=h.next;h.next=null,null===o?a=u:o.next=u,o=h;var c=t.alternate;null!==c&&(l=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=h)}if(null!==a){var d=r.baseState;for(o=0,c=u=h=null,l=a;;){var f=l.lane,p=l.eventTime;if((i&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var g=t,m=l;switch(f=e,p=n,m.tag){case 1:if("function"==typeof(g=m.payload)){d=g.call(p,d,f);break t}d=g;break t;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(f="function"==typeof(g=m.payload)?g.call(p,d,f):g))break t;d=s({},d,f);break t;case 2:qn=!0}}null!==l.callback&&0!==l.lane&&(t.flags|=64,null===(f=r.effects)?r.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=p,h=d):c=c.next=p,o|=f;if(null===(l=l.next)){if(null===(l=r.shared.pending))break;l=(f=l).next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}if(null===c&&(h=d),r.baseState=h,r.firstBaseUpdate=u,r.lastBaseUpdate=c,null!==(e=r.shared.interleaved)){r=e;do{o|=r.lane,r=r.next}while(r!==e)}else null===a&&(r.shared.lanes=0);la|=o,t.lanes=o,t.memoizedState=d}}function ri(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var i=t[e],r=i.callback;if(null!==r){if(i.callback=null,i=n,"function"!=typeof r)throw Error(a(191,r));r.call(i)}}}var si={},ai=oe(si),oi=oe(si),li=oe(si);function hi(t){if(t===si)throw Error(a(174));return t}function ui(t,e){he(li,e),he(oi,t),he(ai,si),t=R(e),le(ai),he(ai,t)}function ci(){le(ai),le(oi),le(li)}function di(t){var e=hi(li.current),n=hi(ai.current);n!==(e=I(n,t.type,e))&&(he(oi,t),he(ai,e))}function fi(t){oi.current===t&&(le(ai),le(oi))}var pi=oe(0);function gi(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Nt(n)||Dt(n)))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!=(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var mi=[];function bi(){for(var t=0;t<mi.length;t++){var e=mi[t];X?e._workInProgressVersionPrimary=null:e._workInProgressVersionSecondary=null}mi.length=0}var yi=o.ReactCurrentDispatcher,vi=o.ReactCurrentBatchConfig,xi=0,_i=null,Si=null,Ai=null,wi=!1,Ti=!1,Bi=0,Ci=0;function ki(){throw Error(a(321))}function Mi(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Xe(t[n],e[n]))return!1;return!0}function Pi(t,e,n,i,r,s){if(xi=s,_i=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,yi.current=null===t||null===t.memoizedState?fr:pr,t=n(i,r),Ti){s=0;do{if(Ti=!1,Bi=0,25<=s)throw Error(a(301));s+=1,Ai=Si=null,e.updateQueue=null,yi.current=gr,t=n(i,r)}while(Ti)}if(yi.current=dr,e=null!==Si&&null!==Si.next,xi=0,Ai=Si=_i=null,wi=!1,e)throw Error(a(300));return t}function Ei(){var t=0!==Bi;return Bi=0,t}function Oi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t,Ai}function Li(){if(null===Si){var t=_i.alternate;t=null!==t?t.memoizedState:null}else t=Si.next;var e=null===Ai?_i.memoizedState:Ai.next;if(null!==e)Ai=e,Si=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Si=t).memoizedState,baseState:Si.baseState,baseQueue:Si.baseQueue,queue:Si.queue,next:null},null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t}return Ai}function Ri(t,e){return"function"==typeof e?e(t):e}function Ii(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=Si,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,n.pending=null}if(null!==r){s=r.next,i=i.baseState;var l=o=null,h=null,u=s;do{var c=u.lane;if((xi&c)===c)null!==h&&(h=h.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:t(i,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===h?(l=h=d,o=i):h=h.next=d,_i.lanes|=c,la|=c}u=u.next}while(null!==u&&u!==s);null===h?o=i:h.next=l,Xe(i,e.memoizedState)||(Or=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=h,n.lastRenderedState=i}if(null!==(t=n.interleaved)){r=t;do{s=r.lane,_i.lanes|=s,la|=s,r=r.next}while(r!==t)}else null===r&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Ni(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(null!==r){n.pending=null;var o=r=r.next;do{s=t(s,o.action),o=o.next}while(o!==r);Xe(s,e.memoizedState)||(Or=!0),e.memoizedState=s,null===e.baseQueue&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function Di(){}function Ui(t,e){var n=_i,i=Li(),r=e(),s=!Xe(i.memoizedState,r);if(s&&(i.memoizedState=r,Or=!0),i=i.queue,qi(Fi.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||null!==Ai&&1&Ai.memoizedState.tag){if(n.flags|=2048,$i(9,Wi.bind(null,n,i,r,e),void 0,null),null===ea)throw Error(a(349));0!=(30&xi)||zi(n,e,r)}return r}function zi(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.stores=[t]):null===(n=e.stores)?e.stores=[t]:n.push(t)}function Wi(t,e,n,i){e.value=n,e.getSnapshot=i,ji(e)&&Hi(t)}function Fi(t,e,n){return n((function(){ji(e)&&Hi(t)}))}function ji(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Xe(t,n)}catch(t){return!0}}function Hi(t){var e=Kn(t,1);null!==e&&Pa(e,t,1,-1)}function Gi(t){var e=Oi();return"function"==typeof t&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:t},e.queue=t,t=t.dispatch=lr.bind(null,_i,t),[e.memoizedState,t]}function $i(t,e,n,i){return t={tag:t,create:e,destroy:n,deps:i,next:null},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Vi(){return Li().memoizedState}function Xi(t,e,n,i){var r=Oi();_i.flags|=t,r.memoizedState=$i(1|e,n,void 0,void 0===i?null:i)}function Yi(t,e,n,i){var r=Li();i=void 0===i?null:i;var s=void 0;if(null!==Si){var a=Si.memoizedState;if(s=a.destroy,null!==i&&Mi(i,a.deps))return void(r.memoizedState=$i(e,n,s,i))}_i.flags|=t,r.memoizedState=$i(1|e,n,s,i)}function Ki(t,e){return Xi(8390656,8,t,e)}function qi(t,e){return Yi(2048,8,t,e)}function Qi(t,e){return Yi(4,2,t,e)}function Zi(t,e){return Yi(4,4,t,e)}function Ji(t,e){return"function"==typeof e?(t=t(),e(t),function(){e(null)}):null!=e?(t=t(),e.current=t,function(){e.current=null}):void 0}function tr(t,e,n){return n=null!=n?n.concat([t]):null,Yi(4,4,Ji.bind(null,e,t),n)}function er(){}function nr(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function ir(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(t=t(),n.memoizedState=[t,e],t)}function rr(t,e,n){return 0==(21&xi)?(t.baseState&&(t.baseState=!1,Or=!0),t.memoizedState=n):(Xe(n,e)||(n=Pe(),_i.lanes|=n,la|=n,t.baseState=!0),e)}function sr(t,e){var n=Re;Re=0!==n&&4>n?n:4,t(!0);var i=vi.transition;vi.transition={};try{t(!1),e()}finally{Re=n,vi.transition=i}}function ar(){return Li().memoizedState}function or(t,e,n){var i=Ma(t);n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},hr(t)?ur(e,n):null!==(n=Yn(t,e,n,i))&&(Pa(n,t,i,ka()),cr(n,e,i))}function lr(t,e,n){var i=Ma(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(hr(t))ur(e,r);else{var s=t.alternate;if(0===t.lanes&&(null===s||0===s.lanes)&&null!==(s=e.lastRenderedReducer))try{var a=e.lastRenderedState,o=s(a,n);if(r.hasEagerState=!0,r.eagerState=o,Xe(o,a)){var l=e.interleaved;return null===l?(r.next=r,Xn(e)):(r.next=l.next,l.next=r),void(e.interleaved=r)}}catch(t){}null!==(n=Yn(t,e,r,i))&&(Pa(n,t,i,r=ka()),cr(n,e,i))}}function hr(t){var e=t.alternate;return t===_i||null!==e&&e===_i}function ur(t,e){Ti=wi=!0;var n=t.pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function cr(t,e,n){if(0!=(4194240&n)){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}var dr={readContext:$n,useCallback:ki,useContext:ki,useEffect:ki,useImperativeHandle:ki,useInsertionEffect:ki,useLayoutEffect:ki,useMemo:ki,useReducer:ki,useRef:ki,useState:ki,useDebugValue:ki,useDeferredValue:ki,useTransition:ki,useMutableSource:ki,useSyncExternalStore:ki,useId:ki,unstable_isNewReconciler:!1},fr={readContext:$n,useCallback:function(t,e){return Oi().memoizedState=[t,void 0===e?null:e],t},useContext:$n,useEffect:Ki,useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,Xi(4194308,4,Ji.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Xi(4194308,4,t,e)},useInsertionEffect:function(t,e){return Xi(4,2,t,e)},useMemo:function(t,e){var n=Oi();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=Oi();return e=void 0!==n?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=or.bind(null,_i,t),[i.memoizedState,t]},useRef:function(t){return t={current:t},Oi().memoizedState=t},useState:Gi,useDebugValue:er,useDeferredValue:function(t){return Oi().memoizedState=t},useTransition:function(){var t=Gi(!1),e=t[0];return t=sr.bind(null,t[1]),Oi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=_i,r=Oi();if(gn){if(void 0===n)throw Error(a(407));n=n()}else{if(n=e(),null===ea)throw Error(a(349));0!=(30&xi)||zi(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Ki(Fi.bind(null,i,s,t),[t]),i.flags|=2048,$i(9,Wi.bind(null,i,s,n,e),void 0,null),n},useId:function(){var t=Oi(),e=ea.identifierPrefix;if(gn){var n=ln;e=":"+e+"R"+(n=(on&~(1<<32-_e(on)-1)).toString(32)+n),0<(n=Bi++)&&(e+="H"+n.toString(32)),e+=":"}else e=":"+e+"r"+(n=Ci++).toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},pr={readContext:$n,useCallback:nr,useContext:$n,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ii,useRef:Vi,useState:function(){return Ii(Ri)},useDebugValue:er,useDeferredValue:function(t){return rr(Li(),Si.memoizedState,t)},useTransition:function(){return[Ii(Ri)[0],Li().memoizedState]},useMutableSource:Di,useSyncExternalStore:Ui,useId:ar,unstable_isNewReconciler:!1},gr={readContext:$n,useCallback:nr,useContext:$n,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ni,useRef:Vi,useState:function(){return Ni(Ri)},useDebugValue:er,useDeferredValue:function(t){var e=Li();return null===Si?e.memoizedState=t:rr(e,Si.memoizedState,t)},useTransition:function(){return[Ni(Ri)[0],Li().memoizedState]},useMutableSource:Di,useSyncExternalStore:Ui,useId:ar,unstable_isNewReconciler:!1};function mr(t,e){if(t&&t.defaultProps){for(var n in e=s({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}return e}function br(t,e,n,i){n=null==(n=n(i,e=t.memoizedState))?e:s({},e,n),t.memoizedState=n,0===t.lanes&&(t.updateQueue.baseState=n)}var yr={isMounted:function(t){return!!(t=t._reactInternals)&&T(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.tag=1,s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ka(),i=Ma(t),r=Jn(n,i);r.tag=2,null!=e&&(r.callback=e),null!==(e=ti(t,r,i))&&(Pa(e,t,i,n),ei(e,t,i))}};function vr(t,e,n,i,r,s,a){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(i,s,a):!(e.prototype&&e.prototype.isPureReactComponent&&kn(n,i)&&kn(r,s))}function xr(t,e,n){var i=!1,r=ue,s=e.contextType;return"object"==typeof s&&null!==s?s=$n(s):(r=ge(e)?fe:ce.current,s=(i=null!=(i=e.contextTypes))?pe(t,r):ue),e=new e(n,s),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=yr,t.stateNode=e,e._reactInternals=t,i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=s),e}function _r(t,e,n,i){t=e.state,"function"==typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,i),"function"==typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&yr.enqueueReplaceState(e,e.state,null)}function Sr(t,e,n,i){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},Qn(t);var s=e.contextType;"object"==typeof s&&null!==s?r.context=$n(s):(s=ge(e)?fe:ce.current,r.context=pe(t,s)),r.state=t.memoizedState,"function"==typeof(s=e.getDerivedStateFromProps)&&(br(t,e,s,n),r.state=t.memoizedState),"function"==typeof e.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(e=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),e!==r.state&&yr.enqueueReplaceState(r,r.state,null),ii(t,n,r,i),r.state=t.memoizedState),"function"==typeof r.componentDidMount&&(t.flags|=4194308)}function Ar(t,e){try{var n="",i=e;do{n+=Mn(i),i=i.return}while(i);var r=n}catch(t){r="\nError generating stack: "+t.message+"\n"+t.stack}return{value:t,source:e,stack:r,digest:null}}function wr(t,e,n){return{value:t,source:null,stack:null!=n?n:null,digest:null!=e?e:null}}var Tr="function"==typeof WeakMap?WeakMap:Map;function Br(t,e,n){(n=Jn(-1,n)).tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){ya||(ya=!0,va=i)},n}function Cr(t,e,n){(n=Jn(-1,n)).tag=3;var i=t.type.getDerivedStateFromError;if("function"==typeof i){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){}}var s=t.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof i&&(null===xa?xa=new Set([this]):xa.add(this));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),n}function kr(t,e,n){var i=t.pingCache;if(null===i){i=t.pingCache=new Tr;var r=new Set;i.set(e,r)}else void 0===(r=i.get(e))&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=Za.bind(null,t,e,n),e.then(t,t))}function Mr(t){do{var e;if((e=13===t.tag)&&(e=null===(e=t.memoizedState)||null!==e.dehydrated),e)return t;t=t.return}while(null!==t);return null}function Pr(t,e,n,i,r){return 0==(1&t.mode)?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((e=Jn(-1,1)).tag=2,ti(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=r,t)}var Er=o.ReactCurrentOwner,Or=!1;function Lr(t,e,n,i){e.child=null===t?In(e,null,n,i):Rn(e,t.child,n,i)}function Rr(t,e,n,i,r){n=n.render;var s=e.ref;return Gn(e,r),i=Pi(t,e,n,i,s,r),n=Ei(),null===t||Or?(gn&&n&&cn(e),e.flags|=1,Lr(t,e,i,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Ir(t,e,n,i,r){if(null===t){var s=n.type;return"function"!=typeof s||so(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=oo(n.type,null,i,e,e.mode,r)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=s,Nr(t,e,s,i,r))}if(s=t.child,0==(t.lanes&r)){var a=s.memoizedProps;if((n=null!==(n=n.compare)?n:kn)(a,i)&&t.ref===e.ref)return is(t,e,r)}return e.flags|=1,(t=ao(s,i)).ref=e.ref,t.return=e,e.child=t}function Nr(t,e,n,i,r){if(null!==t){var s=t.memoizedProps;if(kn(s,i)&&t.ref===e.ref){if(Or=!1,e.pendingProps=i=s,0==(t.lanes&r))return e.lanes=t.lanes,is(t,e,r);0!=(131072&t.flags)&&(Or=!0)}}return zr(t,e,n,i,r)}function Dr(t,e,n){var i=e.pendingProps,r=i.children,s=null!==t?t.memoizedState:null;if("hidden"===i.mode)if(0==(1&e.mode))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(sa,ra),ra|=n;else{if(0==(1073741824&n))return t=null!==s?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,he(sa,ra),ra|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==s?s.baseLanes:n,he(sa,ra),ra|=i}else null!==s?(i=s.baseLanes|n,e.memoizedState=null):i=n,he(sa,ra),ra|=i;return Lr(t,e,r,n),e.child}function Ur(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function zr(t,e,n,i,r){var s=ge(n)?fe:ce.current;return s=pe(e,s),Gn(e,r),n=Pi(t,e,n,i,s,r),i=Ei(),null===t||Or?(gn&&i&&cn(e),e.flags|=1,Lr(t,e,n,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Wr(t,e,n,i,r){if(ge(n)){var s=!0;ve(e)}else s=!1;if(Gn(e,r),null===e.stateNode)ns(t,e),xr(e,n,i),Sr(e,n,i,r),i=!0;else if(null===t){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,h=n.contextType;h="object"==typeof h&&null!==h?$n(h):pe(e,h=ge(n)?fe:ce.current);var u=n.getDerivedStateFromProps,c="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;c||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==h)&&_r(e,a,i,h),qn=!1;var d=e.memoizedState;a.state=d,ii(e,i,a,r),l=e.memoizedState,o!==i||d!==l||de.current||qn?("function"==typeof u&&(br(e,n,u,i),l=e.memoizedState),(o=qn||vr(e,n,o,i,d,l,h))?(c||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(e.flags|=4194308)):("function"==typeof a.componentDidMount&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),a.props=i,a.state=l,a.context=h,i=o):("function"==typeof a.componentDidMount&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,Zn(t,e),o=e.memoizedProps,h=e.type===e.elementType?o:mr(e.type,o),a.props=h,c=e.pendingProps,d=a.context,l="object"==typeof(l=n.contextType)&&null!==l?$n(l):pe(e,l=ge(n)?fe:ce.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==c||d!==l)&&_r(e,a,i,l),qn=!1,d=e.memoizedState,a.state=d,ii(e,i,a,r);var p=e.memoizedState;o!==c||d!==p||de.current||qn?("function"==typeof f&&(br(e,n,f,i),p=e.memoizedState),(h=qn||vr(e,n,h,i,d,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof a.componentDidUpdate&&(e.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=p),a.props=i,a.state=p,a.context=l,i=h):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),i=!1)}return Fr(t,e,n,i,s,r)}function Fr(t,e,n,i,r,s){Ur(t,e);var a=0!=(128&e.flags);if(!i&&!a)return r&&xe(e,n,!1),is(t,e,s);i=e.stateNode,Er.current=e;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:i.render();return e.flags|=1,null!==t&&a?(e.child=Rn(e,t.child,null,s),e.child=Rn(e,null,o,s)):Lr(t,e,o,s),e.memoizedState=i.state,r&&xe(e,n,!0),e.child}function jr(t){var e=t.stateNode;e.pendingContext?be(0,e.pendingContext,e.pendingContext!==e.context):e.context&&be(0,e.context,!1),ui(t,e.containerInfo)}function Hr(t,e,n,i,r){return Tn(),Bn(r),e.flags|=256,Lr(t,e,n,i),e.child}var Gr,$r,Vr,Xr,Yr={dehydrated:null,treeContext:null,retryLane:0};function Kr(t){return{baseLanes:t,cachePool:null,transitions:null}}function qr(t,e,n){var i,r=e.pendingProps,s=pi.current,o=!1,l=0!=(128&e.flags);if((i=l)||(i=(null===t||null!==t.memoizedState)&&0!=(2&s)),i?(o=!0,e.flags&=-129):null!==t&&null===t.memoizedState||(s|=1),he(pi,1&s),null===t)return _n(e),null!==(t=e.memoizedState)&&null!==(t=t.dehydrated)?(0==(1&e.mode)?e.lanes=1:Dt(t)?e.lanes=8:e.lanes=1073741824,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},0==(1&r)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=ho(l,r,0,null),t=lo(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Kr(n),e.memoizedState=Yr,t):Qr(e,l));if(null!==(s=t.memoizedState)&&null!==(i=s.dehydrated))return function(t,e,n,i,r,s,o){if(n)return 256&e.flags?(e.flags&=-257,Zr(t,e,o,i=wr(Error(a(422))))):null!==e.memoizedState?(e.child=t.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=ho({mode:"visible",children:i.children},r,0,null),(s=lo(s,r,o,null)).flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,0!=(1&e.mode)&&Rn(e,t.child,null,o),e.child.memoizedState=Kr(o),e.memoizedState=Yr,s);if(0==(1&e.mode))return Zr(t,e,o,null);if(Dt(r))return i=Ut(r).digest,Zr(t,e,o,i=wr(s=Error(a(419)),i,void 0));if(n=0!=(o&t.childLanes),Or||n){if(null!==(i=ea)){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!=(r&(i.suspendedLanes|o))?0:r)&&r!==s.retryLane&&(s.retryLane=r,Kn(t,r),Pa(i,t,r,-1))}return ja(),Zr(t,e,o,i=wr(Error(a(421))))}return Nt(r)?(e.flags|=128,e.child=t.child,e=to.bind(null,t),zt(r,e),null):(t=s.treeContext,q&&(pn=Ht(r),fn=e,gn=!0,bn=null,mn=!1,null!==t&&(rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,on=t.id,ln=t.overflow,an=e)),(e=Qr(e,i.children)).flags|=4096,e)}(t,e,l,r,i,s,n);if(o){o=r.fallback,l=e.mode,i=(s=t.child).sibling;var h={mode:"hidden",children:r.children};return 0==(1&l)&&e.child!==s?((r=e.child).childLanes=0,r.pendingProps=h,e.deletions=null):(r=ao(s,h)).subtreeFlags=14680064&s.subtreeFlags,null!==i?o=ao(i,o):(o=lo(o,l,n,null)).flags|=2,o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=null===(l=t.child.memoizedState)?Kr(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=Yr,r}return t=(o=t.child).sibling,r=ao(o,{mode:"visible",children:r.children}),0==(1&e.mode)&&(r.lanes=n),r.return=e,r.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Qr(t,e){return(e=ho({mode:"visible",children:e},t.mode,0,null)).return=t,t.child=e}function Zr(t,e,n,i){return null!==i&&Bn(i),Rn(e,t.child,null,n),(t=Qr(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function Jr(t,e,n){t.lanes|=e;var i=t.alternate;null!==i&&(i.lanes|=e),Hn(t.return,e,n)}function ts(t,e,n,i,r){var s=t.memoizedState;null===s?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function es(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Lr(t,e,i.children,n),0!=(2&(i=pi.current)))i=1&i|2,e.flags|=128;else{if(null!==t&&0!=(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Jr(t,n,e);else if(19===t.tag)Jr(t,n,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(he(pi,i),0==(1&e.mode))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;null!==n;)null!==(t=n.alternate)&&null===gi(t)&&(r=n),n=n.sibling;null===(n=r)?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),ts(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;null!==r;){if(null!==(t=r.alternate)&&null===gi(t)){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}ts(e,!0,n,null,s);break;case"together":ts(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ns(t,e){0==(1&e.mode)&&null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2)}function is(t,e,n){if(null!==t&&(e.dependencies=t.dependencies),la|=e.lanes,0==(n&e.childLanes))return null;if(null!==t&&e.child!==t.child)throw Error(a(153));if(null!==e.child){for(n=ao(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=ao(t,t.pendingProps)).return=e;n.sibling=null}return e.child}function rs(t){t.flags|=4}function ss(t,e){if(null!==t&&t.child===e.child)return!0;if(0!=(16&e.flags))return!1;for(t=e.child;null!==t;){if(0!=(12854&t.flags)||0!=(12854&t.subtreeFlags))return!1;t=t.sibling}return!0}if(Y)Gr=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)z(t,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},$r=function(){},Vr=function(t,e,n,i,r){if((t=t.memoizedProps)!==i){var s=e.stateNode,a=hi(ai.current);n=F(s,n,t,i,r,a),(e.updateQueue=n)&&rs(e)}},Xr=function(t,e,n,i){n!==i&&rs(e)};else if(K){Gr=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),z(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),z(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),Gr(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};var as=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),kt(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),kt(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),as(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};$r=function(t,e){var n=e.stateNode;if(!ss(t,e)){t=n.containerInfo;var i=Ct(t);as(i,e,!1,!1),n.pendingChildren=i,rs(e),Mt(t,i)}},Vr=function(t,e,n,i,r){var s=t.stateNode,a=t.memoizedProps;if((t=ss(t,e))&&a===i)e.stateNode=s;else{var o=e.stateNode,l=hi(ai.current),h=null;a!==i&&(h=F(o,n,a,i,r,l)),t&&null===h?e.stateNode=s:(s=Bt(s,h,n,a,i,e,t,o),W(s,n,i,r,l)&&rs(e),e.stateNode=s,t?rs(e):Gr(s,e,!1,!1))}},Xr=function(t,e,n,i){n!==i?(t=hi(li.current),n=hi(ai.current),e.stateNode=H(i,t,n,e),rs(e)):e.stateNode=t.stateNode}}else $r=function(){},Vr=function(){},Xr=function(){};function os(t,e){if(!gn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?e||null===t.tail?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ls(t){var e=null!==t.alternate&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=14680064&r.subtreeFlags,i|=14680064&r.flags,r.return=t,r=r.sibling;else for(r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function hs(t,e,n){var i=e.pendingProps;switch(dn(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ls(e),null;case 1:case 17:return ge(e.type)&&me(),ls(e),null;case 3:return n=e.stateNode,ci(),le(de),le(ce),bi(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==t&&null!==t.child||(An(e)?rs(e):null===t||t.memoizedState.isDehydrated&&0==(256&e.flags)||(e.flags|=1024,null!==bn&&(Ra(bn),bn=null))),$r(t,e),ls(e),null;case 5:fi(e),n=hi(li.current);var r=e.type;if(null!==t&&null!=e.stateNode)Vr(t,e,r,i,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(null===e.stateNode)throw Error(a(166));return ls(e),null}if(t=hi(ai.current),An(e)){if(!q)throw Error(a(175));t=Gt(e.stateNode,e.type,e.memoizedProps,n,t,e,!mn),e.updateQueue=t,null!==t&&rs(e)}else{var s=U(r,i,n,t,e);Gr(s,e,!1,!1),e.stateNode=s,W(s,r,i,n,t)&&rs(e)}null!==e.ref&&(e.flags|=512,e.flags|=2097152)}return ls(e),null;case 6:if(t&&null!=e.stateNode)Xr(t,e,t.memoizedProps,i);else{if("string"!=typeof i&&null===e.stateNode)throw Error(a(166));if(t=hi(li.current),n=hi(ai.current),An(e)){if(!q)throw Error(a(176));if(t=e.stateNode,n=e.memoizedProps,(i=$t(t,n,e,!mn))&&null!==(r=fn))switch(r.tag){case 3:Jt(r.stateNode.containerInfo,t,n,0!=(1&r.mode));break;case 5:te(r.type,r.memoizedProps,r.stateNode,t,n,0!=(1&r.mode))}i&&rs(e)}else e.stateNode=H(i,t,n,e)}return ls(e),null;case 13:if(le(pi),i=e.memoizedState,null===t||null!==t.memoizedState&&null!==t.memoizedState.dehydrated){if(gn&&null!==pn&&0!=(1&e.mode)&&0==(128&e.flags))wn(),Tn(),e.flags|=98560,r=!1;else if(r=An(e),null!==i&&null!==i.dehydrated){if(null===t){if(!r)throw Error(a(318));if(!q)throw Error(a(344));if(!(r=null!==(r=e.memoizedState)?r.dehydrated:null))throw Error(a(317));Vt(r,e)}else Tn(),0==(128&e.flags)&&(e.memoizedState=null),e.flags|=4;ls(e),r=!1}else null!==bn&&(Ra(bn),bn=null),r=!0;if(!r)return 65536&e.flags?e:null}return 0!=(128&e.flags)?(e.lanes=n,e):((n=null!==i)!=(null!==t&&null!==t.memoizedState)&&n&&(e.child.flags|=8192,0!=(1&e.mode)&&(null===t||0!=(1&pi.current)?0===aa&&(aa=3):ja())),null!==e.updateQueue&&(e.flags|=4),ls(e),null);case 4:return ci(),$r(t,e),null===t&&Z(e.stateNode.containerInfo),ls(e),null;case 10:return jn(e.type._context),ls(e),null;case 19:if(le(pi),null===(r=e.memoizedState))return ls(e),null;if(i=0!=(128&e.flags),null===(s=r.rendering))if(i)os(r,!1);else{if(0!==aa||null!==t&&0!=(128&t.flags))for(t=e.child;null!==t;){if(null!==(s=gi(t))){for(e.flags|=128,os(r,!1),null!==(t=s.updateQueue)&&(e.updateQueue=t,e.flags|=4),e.subtreeFlags=0,t=n,n=e.child;null!==n;)r=t,(i=n).flags&=14680066,null===(s=i.alternate)?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,r=s.dependencies,i.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext}),n=n.sibling;return he(pi,1&pi.current|2),e.child}t=t.sibling}null!==r.tail&&We()>pa&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304)}else{if(!i)if(null!==(t=gi(s))){if(e.flags|=128,i=!0,null!==(t=t.updateQueue)&&(e.updateQueue=t,e.flags|=4),os(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!gn)return ls(e),null}else 2*We()-r.renderingStartTime>pa&&1073741824!==n&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(null!==(t=r.last)?t.sibling=s:e.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,t=pi.current,he(pi,i?1&t|2:1&t),e):(ls(e),null);case 22:case 23:return Ua(),n=null!==e.memoizedState,null!==t&&null!==t.memoizedState!==n&&(e.flags|=8192),n&&0!=(1&e.mode)?0!=(1073741824&ra)&&(ls(e),Y&&6&e.subtreeFlags&&(e.flags|=8192)):ls(e),null;case 24:case 25:return null}throw Error(a(156,e.tag))}function us(t,e){switch(dn(e),e.tag){case 1:return ge(e.type)&&me(),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return ci(),le(de),le(ce),bi(),0!=(65536&(t=e.flags))&&0==(128&t)?(e.flags=-65537&t|128,e):null;case 5:return fi(e),null;case 13:if(le(pi),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(a(340));Tn()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return le(pi),null;case 4:return ci(),null;case 10:return jn(e.type._context),null;case 22:case 23:return Ua(),null;default:return null}}var cs=!1,ds=!1,fs="function"==typeof WeakSet?WeakSet:Set,ps=null;function gs(t,e){var n=t.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Qa(t,e,n)}else n.current=null}function ms(t,e,n){try{n()}catch(n){Qa(t,e,n)}}var bs=!1;function ys(t,e,n){var i=e.updateQueue;if(null!==(i=null!==i?i.lastEffect:null)){var r=i=i.next;do{if((r.tag&t)===t){var s=r.destroy;r.destroy=void 0,void 0!==s&&ms(e,n,s)}r=r.next}while(r!==i)}}function vs(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function xs(t){var e=t.ref;if(null!==e){var n=t.stateNode;t=5===t.tag?L(n):n,"function"==typeof e?e(t):e.current=t}}function _s(t){var e=t.alternate;null!==e&&(t.alternate=null,_s(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(e=t.stateNode)&&tt(e),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Ss(t){return 5===t.tag||3===t.tag||4===t.tag}function As(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||Ss(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function ws(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?bt(n,t,e):dt(n,t);else if(4!==i&&null!==(t=t.child))for(ws(t,e,n),t=t.sibling;null!==t;)ws(t,e,n),t=t.sibling}function Ts(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?mt(n,t,e):ct(n,t);else if(4!==i&&null!==(t=t.child))for(Ts(t,e,n),t=t.sibling;null!==t;)Ts(t,e,n),t=t.sibling}var Bs=null,Cs=!1;function ks(t,e,n){for(n=n.child;null!==n;)Ms(t,e,n),n=n.sibling}function Ms(t,e,n){if(Ve&&"function"==typeof Ve.onCommitFiberUnmount)try{Ve.onCommitFiberUnmount($e,n)}catch(t){}switch(n.tag){case 5:ds||gs(n,e);case 6:if(Y){var i=Bs,r=Cs;Bs=null,ks(t,e,n),Cs=r,null!==(Bs=i)&&(Cs?vt(Bs,n.stateNode):yt(Bs,n.stateNode))}else ks(t,e,n);break;case 18:Y&&null!==Bs&&(Cs?Qt(Bs,n.stateNode):qt(Bs,n.stateNode));break;case 4:Y?(i=Bs,r=Cs,Bs=n.stateNode.containerInfo,Cs=!0,ks(t,e,n),Bs=i,Cs=r):(K&&(i=n.stateNode.containerInfo,r=Ct(i),Pt(i,r)),ks(t,e,n));break;case 0:case 11:case 14:case 15:if(!ds&&null!==(i=n.updateQueue)&&null!==(i=i.lastEffect)){r=i=i.next;do{var s=r,a=s.destroy;s=s.tag,void 0!==a&&(0!=(2&s)||0!=(4&s))&&ms(n,e,a),r=r.next}while(r!==i)}ks(t,e,n);break;case 1:if(!ds&&(gs(n,e),"function"==typeof(i=n.stateNode).componentWillUnmount))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(t){Qa(n,e,t)}ks(t,e,n);break;case 21:ks(t,e,n);break;case 22:1&n.mode?(ds=(i=ds)||null!==n.memoizedState,ks(t,e,n),ds=i):ks(t,e,n);break;default:ks(t,e,n)}}function Ps(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new fs),e.forEach((function(e){var i=eo.bind(null,t,e);n.has(e)||(n.add(e),e.then(i,i))}))}}function Es(t,e){var n=e.deletions;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];try{var s=t,o=e;if(Y){var l=o;t:for(;null!==l;){switch(l.tag){case 5:Bs=l.stateNode,Cs=!1;break t;case 3:case 4:Bs=l.stateNode.containerInfo,Cs=!0;break t}l=l.return}if(null===Bs)throw Error(a(160));Ms(s,o,r),Bs=null,Cs=!1}else Ms(s,o,r);var h=r.alternate;null!==h&&(h.return=null),r.return=null}catch(t){Qa(r,e,t)}}if(12854&e.subtreeFlags)for(e=e.child;null!==e;)Os(e,t),e=e.sibling}function Os(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Es(e,t),Ls(t),4&i){try{ys(3,t,t.return),vs(3,t)}catch(e){Qa(t,t.return,e)}try{ys(5,t,t.return)}catch(e){Qa(t,t.return,e)}}break;case 1:Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return);break;case 5:if(Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return),Y){if(32&t.flags){var r=t.stateNode;try{xt(r)}catch(e){Qa(t,t.return,e)}}if(4&i&&null!=(r=t.stateNode)){var s=t.memoizedProps;if(n=null!==n?n.memoizedProps:s,i=t.type,e=t.updateQueue,t.updateQueue=null,null!==e)try{gt(r,e,i,n,s,t)}catch(e){Qa(t,t.return,e)}}}break;case 6:if(Es(e,t),Ls(t),4&i&&Y){if(null===t.stateNode)throw Error(a(162));r=t.stateNode,s=t.memoizedProps,n=null!==n?n.memoizedProps:s;try{ft(r,n,s)}catch(e){Qa(t,t.return,e)}}break;case 3:if(Es(e,t),Ls(t),4&i){if(Y&&q&&null!==n&&n.memoizedState.isDehydrated)try{Yt(e.containerInfo)}catch(e){Qa(t,t.return,e)}if(K){r=e.containerInfo,s=e.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}}break;case 4:if(Es(e,t),Ls(t),4&i&&K){r=(s=t.stateNode).containerInfo,s=s.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}break;case 13:Es(e,t),Ls(t),8192&(r=t.child).flags&&(s=null!==r.memoizedState,r.stateNode.isHidden=s,!s||null!==r.alternate&&null!==r.alternate.memoizedState||(fa=We())),4&i&&Ps(t);break;case 22:var o=null!==n&&null!==n.memoizedState;if(1&t.mode?(ds=(n=ds)||o,Es(e,t),ds=n):Es(e,t),Ls(t),8192&i){if(n=null!==t.memoizedState,(t.stateNode.isHidden=n)&&!o&&0!=(1&t.mode))for(ps=t,i=t.child;null!==i;){for(e=ps=i;null!==ps;){var l=(o=ps).child;switch(o.tag){case 0:case 11:case 14:case 15:ys(4,o,o.return);break;case 1:gs(o,o.return);var h=o.stateNode;if("function"==typeof h.componentWillUnmount){var u=o,c=o.return;try{var d=u;h.props=d.memoizedProps,h.state=d.memoizedState,h.componentWillUnmount()}catch(t){Qa(u,c,t)}}break;case 5:gs(o,o.return);break;case 22:if(null!==o.memoizedState){Ds(e);continue}}null!==l?(l.return=o,ps=l):Ds(e)}i=i.sibling}if(Y)t:if(i=null,Y)for(e=t;;){if(5===e.tag){if(null===i){i=e;try{r=e.stateNode,n?_t(r):At(e.stateNode,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}}else if(6===e.tag){if(null===i)try{s=e.stateNode,n?St(s):wt(s,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}else if((22!==e.tag&&23!==e.tag||null===e.memoizedState||e===t)&&null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;null===e.sibling;){if(null===e.return||e.return===t)break t;i===e&&(i=null),e=e.return}i===e&&(i=null),e.sibling.return=e.return,e=e.sibling}}break;case 19:Es(e,t),Ls(t),4&i&&Ps(t);break;case 21:break;default:Es(e,t),Ls(t)}}function Ls(t){var e=t.flags;if(2&e){try{if(Y){t:{for(var n=t.return;null!==n;){if(Ss(n)){var i=n;break t}n=n.return}throw Error(a(160))}switch(i.tag){case 5:var r=i.stateNode;32&i.flags&&(xt(r),i.flags&=-33),Ts(t,As(t),r);break;case 3:case 4:var s=i.stateNode.containerInfo;ws(t,As(t),s);break;default:throw Error(a(161))}}}catch(e){Qa(t,t.return,e)}t.flags&=-3}4096&e&&(t.flags&=-4097)}function Rs(t,e,n){ps=t,Is(t)}function Is(t,e,n){for(var i=0!=(1&t.mode);null!==ps;){var r=ps,s=r.child;if(22===r.tag&&i){var a=null!==r.memoizedState||cs;if(!a){var o=r.alternate,l=null!==o&&null!==o.memoizedState||ds;o=cs;var h=ds;if(cs=a,(ds=l)&&!h)for(ps=r;null!==ps;)l=(a=ps).child,22===a.tag&&null!==a.memoizedState?Us(r):null!==l?(l.return=a,ps=l):Us(r);for(;null!==s;)ps=s,Is(s),s=s.sibling;ps=r,cs=o,ds=h}Ns(t)}else 0!=(8772&r.subtreeFlags)&&null!==s?(s.return=r,ps=s):Ns(t)}}function Ns(t){for(;null!==ps;){var e=ps;if(0!=(8772&e.flags)){var n=e.alternate;try{if(0!=(8772&e.flags))switch(e.tag){case 0:case 11:case 15:ds||vs(5,e);break;case 1:var i=e.stateNode;if(4&e.flags&&!ds)if(null===n)i.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:mr(e.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;null!==s&&ri(e,s,i);break;case 3:var o=e.updateQueue;if(null!==o){if(n=null,null!==e.child)switch(e.child.tag){case 5:n=L(e.child.stateNode);break;case 1:n=e.child.stateNode}ri(e,o,n)}break;case 5:var l=e.stateNode;null===n&&4&e.flags&&pt(l,e.type,e.memoizedProps,e);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(q&&null===e.memoizedState){var h=e.alternate;if(null!==h){var u=h.memoizedState;if(null!==u){var c=u.dehydrated;null!==c&&Kt(c)}}}break;default:throw Error(a(163))}ds||512&e.flags&&xs(e)}catch(t){Qa(e,e.return,t)}}if(e===t){ps=null;break}if(null!==(n=e.sibling)){n.return=e.return,ps=n;break}ps=e.return}}function Ds(t){for(;null!==ps;){var e=ps;if(e===t){ps=null;break}var n=e.sibling;if(null!==n){n.return=e.return,ps=n;break}ps=e.return}}function Us(t){for(;null!==ps;){var e=ps;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{vs(4,e)}catch(t){Qa(e,n,t)}break;case 1:var i=e.stateNode;if("function"==typeof i.componentDidMount){var r=e.return;try{i.componentDidMount()}catch(t){Qa(e,r,t)}}var s=e.return;try{xs(e)}catch(t){Qa(e,s,t)}break;case 5:var a=e.return;try{xs(e)}catch(t){Qa(e,a,t)}}}catch(t){Qa(e,e.return,t)}if(e===t){ps=null;break}var o=e.sibling;if(null!==o){o.return=e.return,ps=o;break}ps=e.return}}var zs=0,Ws=1,Fs=2,js=3,Hs=4;if("function"==typeof Symbol&&Symbol.for){var Gs=Symbol.for;zs=Gs("selector.component"),Ws=Gs("selector.has_pseudo_class"),Fs=Gs("selector.role"),js=Gs("selector.test_id"),Hs=Gs("selector.text")}function $s(t){var e=Q(t);if(null!=e){if("string"!=typeof e.memoizedProps["data-testname"])throw Error(a(364));return e}if(null===(t=rt(t)))throw Error(a(362));return t.stateNode.current}function Vs(t,e){switch(e.$$typeof){case zs:if(t.type===e.value)return!0;break;case Ws:t:{e=e.value,t=[t,0];for(var n=0;n<t.length;){var i=t[n++],r=t[n++],s=e[r];if(5!==i.tag||!ot(i)){for(;null!=s&&Vs(i,s);)s=e[++r];if(r===e.length){e=!0;break t}for(i=i.child;null!==i;)t.push(i,r),i=i.sibling}}e=!1}return e;case Fs:if(5===t.tag&<(t.stateNode,e.value))return!0;break;case Hs:if((5===t.tag||6===t.tag)&&null!==(t=at(t))&&0<=t.indexOf(e.value))return!0;break;case js:if(5===t.tag&&"string"==typeof(t=t.memoizedProps["data-testname"])&&t.toLowerCase()===e.value.toLowerCase())return!0;break;default:throw Error(a(365))}return!1}function Xs(t){switch(t.$$typeof){case zs:return"<"+(A(t.value)||"Unknown")+">";case Ws:return":has("+(Xs(t)||"")+")";case Fs:return'[role="'+t.value+'"]';case Hs:return'"'+t.value+'"';case js:return'[data-testname="'+t.value+'"]';default:throw Error(a(365))}}function Ys(t,e){var n=[];t=[t,0];for(var i=0;i<t.length;){var r=t[i++],s=t[i++],a=e[s];if(5!==r.tag||!ot(r)){for(;null!=a&&Vs(r,a);)a=e[++s];if(s===e.length)n.push(r);else for(r=r.child;null!==r;)t.push(r,s),r=r.sibling}}return n}function Ks(t,e){if(!it)throw Error(a(363));t=Ys(t=$s(t),e),e=[],t=Array.from(t);for(var n=0;n<t.length;){var i=t[n++];if(5===i.tag)ot(i)||e.push(i.stateNode);else for(i=i.child;null!==i;)t.push(i),i=i.sibling}return e}var qs=Math.ceil,Qs=o.ReactCurrentDispatcher,Zs=o.ReactCurrentOwner,Js=o.ReactCurrentBatchConfig,ta=0,ea=null,na=null,ia=0,ra=0,sa=oe(0),aa=0,oa=null,la=0,ha=0,ua=0,ca=null,da=null,fa=0,pa=1/0,ga=null;function ma(){pa=We()+500}var ba,ya=!1,va=null,xa=null,_a=!1,Sa=null,Aa=0,wa=0,Ta=null,Ba=-1,Ca=0;function ka(){return 0!=(6&ta)?We():-1!==Ba?Ba:Ba=We()}function Ma(t){return 0==(1&t.mode)?1:0!=(2&ta)&&0!==ia?ia&-ia:null!==Cn.transition?(0===Ca&&(Ca=Pe()),Ca):0!==(t=Re)?t:J()}function Pa(t,e,n,i){if(50<wa)throw wa=0,Ta=null,Error(a(185));Oe(t,n,i),0!=(2&ta)&&t===ea||(t===ea&&(0==(2&ta)&&(ha|=n),4===aa&&Ia(t,ia)),Ea(t,i),1===n&&0===ta&&0==(1&e.mode)&&(ma(),Ke&&Ze()))}function Ea(t,e){var n=t.callbackNode;!function(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-_e(s),o=1<<a,l=r[a];-1===l?0!=(o&n)&&0==(o&i)||(r[a]=ke(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}}(t,e);var i=Ce(t,t===ea?ia:0);if(0===i)null!==n&&De(n),t.callbackNode=null,t.callbackPriority=0;else if(e=i&-i,t.callbackPriority!==e){if(null!=n&&De(n),1===e)0===t.tag?function(t){Ke=!0,Qe(t)}(Na.bind(null,t)):Qe(Na.bind(null,t)),et?nt((function(){0==(6&ta)&&Ze()})):Ne(Fe,Ze),n=null;else{switch(Ie(i)){case 1:n=Fe;break;case 4:n=je;break;case 16:default:n=He;break;case 536870912:n=Ge}n=no(n,Oa.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Oa(t,e){if(Ba=-1,Ca=0,0!=(6&ta))throw Error(a(327));var n=t.callbackNode;if(Ka()&&t.callbackNode!==n)return null;var i=Ce(t,t===ea?ia:0);if(0===i)return null;if(0!=(30&i)||0!=(i&t.expiredLanes)||e)e=Ha(t,i);else{e=i;var r=ta;ta|=2;var s=Fa();for(ea===t&&ia===e||(ga=null,ma(),za(t,e));;)try{$a();break}catch(e){Wa(t,e)}Wn(),Qs.current=s,ta=r,null!==na?e=0:(ea=null,ia=0,e=aa)}if(0!==e){if(2===e&&0!==(r=Me(t))&&(i=r,e=La(t,r)),1===e)throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;if(6===e)Ia(t,i);else{if(r=t.current.alternate,0==(30&i)&&!function(t){for(var e=t;;){if(16384&e.flags){var n=e.updateQueue;if(null!==n&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!Xe(s(),r))return!1}catch(t){return!1}}}if(n=e.child,16384&e.subtreeFlags&&null!==n)n.return=e,e=n;else{if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}(r)&&(2===(e=Ha(t,i))&&0!==(s=Me(t))&&(i=s,e=La(t,s)),1===e))throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;switch(t.finishedWork=r,t.finishedLanes=i,e){case 0:case 1:throw Error(a(345));case 2:case 5:Ya(t,da,ga);break;case 3:if(Ia(t,i),(130023424&i)===i&&10<(e=fa+500-We())){if(0!==Ce(t,0))break;if(((r=t.suspendedLanes)&i)!==i){ka(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=G(Ya.bind(null,t,da,ga),e);break}Ya(t,da,ga);break;case 4:if(Ia(t,i),(4194240&i)===i)break;for(e=t.eventTimes,r=-1;0<i;){var o=31-_e(i);s=1<<o,(o=e[o])>r&&(r=o),i&=~s}if(i=r,10<(i=(120>(i=We()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qs(i/1960))-i)){t.timeoutHandle=G(Ya.bind(null,t,da,ga),i);break}Ya(t,da,ga);break;default:throw Error(a(329))}}}return Ea(t,We()),t.callbackNode===n?Oa.bind(null,t):null}function La(t,e){var n=ca;return t.current.memoizedState.isDehydrated&&(za(t,e).flags|=256),2!==(t=Ha(t,e))&&(e=da,da=n,null!==e&&Ra(e)),t}function Ra(t){null===da?da=t:da.push.apply(da,t)}function Ia(t,e){for(e&=~ua,e&=~ha,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-_e(e),i=1<<n;t[n]=-1,e&=~i}}function Na(t){if(0!=(6&ta))throw Error(a(327));Ka();var e=Ce(t,0);if(0==(1&e))return Ea(t,We()),null;var n=Ha(t,e);if(0!==t.tag&&2===n){var i=Me(t);0!==i&&(e=i,n=La(t,i))}if(1===n)throw n=oa,za(t,0),Ia(t,e),Ea(t,We()),n;if(6===n)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ya(t,da,ga),Ea(t,We()),null}function Da(t){null!==Sa&&0===Sa.tag&&0==(6&ta)&&Ka();var e=ta;ta|=1;var n=Js.transition,i=Re;try{if(Js.transition=null,Re=1,t)return t()}finally{Re=i,Js.transition=n,0==(6&(ta=e))&&Ze()}}function Ua(){ra=sa.current,le(sa)}function za(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==V&&(t.timeoutHandle=V,$(n)),null!==na)for(n=na.return;null!==n;){var i=n;switch(dn(i),i.tag){case 1:null!=(i=i.type.childContextTypes)&&me();break;case 3:ci(),le(de),le(ce),bi();break;case 5:fi(i);break;case 4:ci();break;case 13:case 19:le(pi);break;case 10:jn(i.type._context);break;case 22:case 23:Ua()}n=n.return}if(ea=t,na=t=ao(t.current,null),ia=ra=e,aa=0,oa=null,ua=ha=la=0,da=ca=null,null!==Vn){for(e=0;e<Vn.length;e++)if(null!==(i=(n=Vn[e]).interleaved)){n.interleaved=null;var r=i.next,s=n.pending;if(null!==s){var a=s.next;s.next=r,i.next=a}n.pending=i}Vn=null}return t}function Wa(t,e){for(;;){var n=na;try{if(Wn(),yi.current=dr,wi){for(var i=_i.memoizedState;null!==i;){var r=i.queue;null!==r&&(r.pending=null),i=i.next}wi=!1}if(xi=0,Ai=Si=_i=null,Ti=!1,Bi=0,Zs.current=null,null===n||null===n.return){aa=1,oa=e,na=null;break}t:{var s=t,o=n.return,l=n,h=e;if(e=ia,l.flags|=32768,null!==h&&"object"==typeof h&&"function"==typeof h.then){var u=h,c=l,d=c.tag;if(0==(1&c.mode)&&(0===d||11===d||15===d)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Mr(o);if(null!==p){p.flags&=-257,Pr(p,o,l,0,e),1&p.mode&&kr(s,u,e),h=u;var g=(e=p).updateQueue;if(null===g){var m=new Set;m.add(h),e.updateQueue=m}else g.add(h);break t}if(0==(1&e)){kr(s,u,e),ja();break t}h=Error(a(426))}else if(gn&&1&l.mode){var b=Mr(o);if(null!==b){0==(65536&b.flags)&&(b.flags|=256),Pr(b,o,l,0,e),Bn(Ar(h,l));break t}}s=h=Ar(h,l),4!==aa&&(aa=2),null===ca?ca=[s]:ca.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Br(0,h,e));break t;case 1:l=h;var y=s.type,v=s.stateNode;if(0==(128&s.flags)&&("function"==typeof y.getDerivedStateFromError||null!==v&&"function"==typeof v.componentDidCatch&&(null===xa||!xa.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Cr(s,l,e));break t}}s=s.return}while(null!==s)}Xa(n)}catch(t){e=t,na===n&&null!==n&&(na=n=n.return);continue}break}}function Fa(){var t=Qs.current;return Qs.current=dr,null===t?dr:t}function ja(){0!==aa&&3!==aa&&2!==aa||(aa=4),null===ea||0==(268435455&la)&&0==(268435455&ha)||Ia(ea,ia)}function Ha(t,e){var n=ta;ta|=2;var i=Fa();for(ea===t&&ia===e||(ga=null,za(t,e));;)try{Ga();break}catch(e){Wa(t,e)}if(Wn(),ta=n,Qs.current=i,null!==na)throw Error(a(261));return ea=null,ia=0,aa}function Ga(){for(;null!==na;)Va(na)}function $a(){for(;null!==na&&!Ue();)Va(na)}function Va(t){var e=ba(t.alternate,t,ra);t.memoizedProps=t.pendingProps,null===e?Xa(t):na=e,Zs.current=null}function Xa(t){var e=t;do{var n=e.alternate;if(t=e.return,0==(32768&e.flags)){if(null!==(n=hs(n,e,ra)))return void(na=n)}else{if(null!==(n=us(n,e)))return n.flags&=32767,void(na=n);if(null===t)return aa=6,void(na=null);t.flags|=32768,t.subtreeFlags=0,t.deletions=null}if(null!==(e=e.sibling))return void(na=e);na=e=t}while(null!==e);0===aa&&(aa=5)}function Ya(t,e,n){var i=Re,r=Js.transition;try{Js.transition=null,Re=1,function(t,e,n,i){do{Ka()}while(null!==Sa);if(0!=(6&ta))throw Error(a(327));n=t.finishedWork;var r=t.finishedLanes;if(null===n)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-_e(n),s=1<<r;e[r]=0,i[r]=-1,t[r]=-1,n&=~s}}(t,s),t===ea&&(na=ea=null,ia=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||_a||(_a=!0,no(He,(function(){return Ka(),null}))),s=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||s){s=Js.transition,Js.transition=null;var o=Re;Re=1;var l=ta;ta|=4,Zs.current=null,function(t,e){for(N(t.containerInfo),ps=e;null!==ps;)if(e=(t=ps).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ps=e;else for(;null!==ps;){t=ps;try{var n=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==n){var i=n.memoizedProps,r=n.memoizedState,s=t.stateNode,o=s.getSnapshotBeforeUpdate(t.elementType===t.type?i:mr(t.type,i),r);s.__reactInternalSnapshotBeforeUpdate=o}break;case 3:Y&&Tt(t.stateNode.containerInfo);break;default:throw Error(a(163))}}catch(e){Qa(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ps=e;break}ps=t.return}n=bs,bs=!1}(t,n),Os(n,t),D(t.containerInfo),t.current=n,Rs(n),ze(),ta=l,Re=o,Js.transition=s}else t.current=n;if(_a&&(_a=!1,Sa=t,Aa=r),0===(s=t.pendingLanes)&&(xa=null),function(t){if(Ve&&"function"==typeof Ve.onCommitFiberRoot)try{Ve.onCommitFiberRoot($e,t,void 0,128==(128&t.current.flags))}catch(t){}}(n.stateNode),Ea(t,We()),null!==e)for(i=t.onRecoverableError,n=0;n<e.length;n++)i((r=e[n]).value,{componentStack:r.stack,digest:r.digest});if(ya)throw ya=!1,t=va,va=null,t;0!=(1&Aa)&&0!==t.tag&&Ka(),0!=(1&(s=t.pendingLanes))?t===Ta?wa++:(wa=0,Ta=t):wa=0,Ze()}(t,e,n,i)}finally{Js.transition=r,Re=i}return null}function Ka(){if(null!==Sa){var t=Ie(Aa),e=Js.transition,n=Re;try{if(Js.transition=null,Re=16>t?16:t,null===Sa)var i=!1;else{if(t=Sa,Sa=null,Aa=0,0!=(6&ta))throw Error(a(331));var r=ta;for(ta|=4,ps=t.current;null!==ps;){var s=ps,o=s.child;if(0!=(16&ps.flags)){var l=s.deletions;if(null!==l){for(var h=0;h<l.length;h++){var u=l[h];for(ps=u;null!==ps;){var c=ps;switch(c.tag){case 0:case 11:case 15:ys(8,c,s)}var d=c.child;if(null!==d)d.return=c,ps=d;else for(;null!==ps;){var f=(c=ps).sibling,p=c.return;if(_s(c),c===u){ps=null;break}if(null!==f){f.return=p,ps=f;break}ps=p}}}var g=s.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(null!==m)}}ps=s}}if(0!=(2064&s.subtreeFlags)&&null!==o)o.return=s,ps=o;else t:for(;null!==ps;){if(0!=(2048&(s=ps).flags))switch(s.tag){case 0:case 11:case 15:ys(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,ps=y;break t}ps=s.return}}var v=t.current;for(ps=v;null!==ps;){var x=(o=ps).child;if(0!=(2064&o.subtreeFlags)&&null!==x)x.return=o,ps=x;else t:for(o=v;null!==ps;){if(0!=(2048&(l=ps).flags))try{switch(l.tag){case 0:case 11:case 15:vs(9,l)}}catch(t){Qa(l,l.return,t)}if(l===o){ps=null;break t}var _=l.sibling;if(null!==_){_.return=l.return,ps=_;break t}ps=l.return}}if(ta=r,Ze(),Ve&&"function"==typeof Ve.onPostCommitFiberRoot)try{Ve.onPostCommitFiberRoot($e,t)}catch(t){}i=!0}return i}finally{Re=n,Js.transition=e}}return!1}function qa(t,e,n){t=ti(t,e=Br(0,e=Ar(n,e),1),1),e=ka(),null!==t&&(Oe(t,1,e),Ea(t,e))}function Qa(t,e,n){if(3===t.tag)qa(t,t,n);else for(;null!==e;){if(3===e.tag){qa(e,t,n);break}if(1===e.tag){var i=e.stateNode;if("function"==typeof e.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===xa||!xa.has(i))){e=ti(e,t=Cr(e,t=Ar(n,t),1),1),t=ka(),null!==e&&(Oe(e,1,t),Ea(e,t));break}}e=e.return}}function Za(t,e,n){var i=t.pingCache;null!==i&&i.delete(e),e=ka(),t.pingedLanes|=t.suspendedLanes&n,ea===t&&(ia&n)===n&&(4===aa||3===aa&&(130023424&ia)===ia&&500>We()-fa?za(t,0):ua|=n),Ea(t,e)}function Ja(t,e){0===e&&(0==(1&t.mode)?e=1:(e=Te,0==(130023424&(Te<<=1))&&(Te=4194304)));var n=ka();null!==(t=Kn(t,e))&&(Oe(t,e,n),Ea(t,n))}function to(t){var e=t.memoizedState,n=0;null!==e&&(n=e.retryLane),Ja(t,n)}function eo(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(a(314))}null!==i&&i.delete(e),Ja(t,n)}function no(t,e){return Ne(t,e)}function io(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ro(t,e,n,i){return new io(t,e,n,i)}function so(t){return!(!(t=t.prototype)||!t.isReactComponent)}function ao(t,e){var n=t.alternate;return null===n?((n=ro(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&t.flags,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function oo(t,e,n,i,r,s){var o=2;if(i=t,"function"==typeof t)so(t)&&(o=1);else if("string"==typeof t)o=5;else t:switch(t){case u:return lo(n.children,r,s,e);case c:o=8,r|=8;break;case d:return(t=ro(12,n,e,2|r)).elementType=d,t.lanes=s,t;case m:return(t=ro(13,n,e,r)).elementType=m,t.lanes=s,t;case b:return(t=ro(19,n,e,r)).elementType=b,t.lanes=s,t;case x:return ho(n,r,s,e);default:if("object"==typeof t&&null!==t)switch(t.$$typeof){case f:o=10;break t;case p:o=9;break t;case g:o=11;break t;case y:o=14;break t;case v:o=16,i=null;break t}throw Error(a(130,null==t?t:typeof t,""))}return(e=ro(o,n,e,r)).elementType=t,e.type=i,e.lanes=s,e}function lo(t,e,n,i){return(t=ro(7,t,i,e)).lanes=n,t}function ho(t,e,n,i){return(t=ro(22,t,i,e)).elementType=x,t.lanes=n,t.stateNode={isHidden:!1},t}function uo(t,e,n){return(t=ro(6,t,null,e)).lanes=n,t}function co(t,e,n){return(e=ro(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function fo(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=V,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ee(0),this.expirationTimes=Ee(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ee(0),this.identifierPrefix=i,this.onRecoverableError=r,q&&(this.mutableSourceEagerHydrationData=null)}function po(t,e,n,i,r,s,a,o,l){return t=new fo(t,e,n,o,l),1===e?(e=1,!0===s&&(e|=8)):e=0,s=ro(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qn(s),t}function go(t){if(!t)return ue;t:{if(T(t=t._reactInternals)!==t||1!==t.tag)throw Error(a(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(ge(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(null!==e);throw Error(a(171))}if(1===t.tag){var n=t.type;if(ge(n))return ye(t,n,e)}return e}function mo(t){var e=t._reactInternals;if(void 0===e){if("function"==typeof t.render)throw Error(a(188));throw t=Object.keys(t).join(","),Error(a(268,t))}return null===(t=k(e))?null:t.stateNode}function bo(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n<e?n:e}}function yo(t,e){bo(t,e),(t=t.alternate)&&bo(t,e)}function vo(t){return null===(t=k(t))?null:t.stateNode}function xo(){return null}return ba=function(t,e,n){if(null!==t)if(t.memoizedProps!==e.pendingProps||de.current)Or=!0;else{if(0==(t.lanes&n)&&0==(128&e.flags))return Or=!1,function(t,e,n){switch(e.tag){case 3:jr(e),Tn();break;case 5:di(e);break;case 1:ge(e.type)&&ve(e);break;case 4:ui(e,e.stateNode.containerInfo);break;case 10:Fn(0,e.type._context,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(null!==i)return null!==i.dehydrated?(he(pi,1&pi.current),e.flags|=128,null):0!=(n&e.child.childLanes)?qr(t,e,n):(he(pi,1&pi.current),null!==(t=is(t,e,n))?t.sibling:null);he(pi,1&pi.current);break;case 19:if(i=0!=(n&e.childLanes),0!=(128&t.flags)){if(i)return es(t,e,n);e.flags|=128}var r=e.memoizedState;if(null!==r&&(r.rendering=null,r.tail=null,r.lastEffect=null),he(pi,pi.current),i)break;return null;case 22:case 23:return e.lanes=0,Dr(t,e,n)}return is(t,e,n)}(t,e,n);Or=0!=(131072&t.flags)}else Or=!1,gn&&0!=(1048576&e.flags)&&un(e,nn,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;ns(t,e),t=e.pendingProps;var r=pe(e,ce.current);Gn(e,n),r=Pi(null,e,i,t,r,n);var s=Ei();return e.flags|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ge(i)?(s=!0,ve(e)):s=!1,e.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Qn(e),r.updater=yr,e.stateNode=r,r._reactInternals=e,Sr(e,i,t,n),e=Fr(null,e,i,!0,s,n)):(e.tag=0,gn&&s&&cn(e),Lr(null,e,r,n),e=e.child),e;case 16:i=e.elementType;t:{switch(ns(t,e),t=e.pendingProps,i=(r=i._init)(i._payload),e.type=i,r=e.tag=function(t){if("function"==typeof t)return so(t)?1:0;if(null!=t){if((t=t.$$typeof)===g)return 11;if(t===y)return 14}return 2}(i),t=mr(i,t),r){case 0:e=zr(null,e,i,t,n);break t;case 1:e=Wr(null,e,i,t,n);break t;case 11:e=Rr(null,e,i,t,n);break t;case 14:e=Ir(null,e,i,mr(i.type,t),n);break t}throw Error(a(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,zr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 1:return i=e.type,r=e.pendingProps,Wr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 3:t:{if(jr(e),null===t)throw Error(a(387));i=e.pendingProps,r=(s=e.memoizedState).element,Zn(t,e),ii(e,i,null,n);var o=e.memoizedState;if(i=o.element,q&&s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,256&e.flags){e=Hr(t,e,i,n,r=Ar(Error(a(423)),e));break t}if(i!==r){e=Hr(t,e,i,n,r=Ar(Error(a(424)),e));break t}for(q&&(pn=jt(e.stateNode.containerInfo),fn=e,gn=!0,bn=null,mn=!1),n=In(e,null,i,n),e.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Tn(),i===r){e=is(t,e,n);break t}Lr(t,e,i,n)}e=e.child}return e;case 5:return di(e),null===t&&_n(e),i=e.type,r=e.pendingProps,s=null!==t?t.memoizedProps:null,o=r.children,j(i,r)?o=null:null!==s&&j(i,s)&&(e.flags|=32),Ur(t,e),Lr(t,e,o,n),e.child;case 6:return null===t&&_n(e),null;case 13:return qr(t,e,n);case 4:return ui(e,e.stateNode.containerInfo),i=e.pendingProps,null===t?e.child=Rn(e,null,i,n):Lr(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,Rr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 7:return Lr(t,e,e.pendingProps,n),e.child;case 8:case 12:return Lr(t,e,e.pendingProps.children,n),e.child;case 10:t:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,Fn(0,i,o=r.value),null!==s)if(Xe(s.value,o)){if(s.children===r.children&&!de.current){e=is(t,e,n);break t}}else for(null!==(s=e.child)&&(s.return=e);null!==s;){var l=s.dependencies;if(null!==l){o=s.child;for(var h=l.firstContext;null!==h;){if(h.context===i){if(1===s.tag){(h=Jn(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var c=(u=u.shared).pending;null===c?h.next=h:(h.next=c.next,c.next=h),u.pending=h}}s.lanes|=n,null!==(h=s.alternate)&&(h.lanes|=n),Hn(s.return,n,e),l.lanes|=n;break}h=h.next}}else if(10===s.tag)o=s.type===e.type?null:s.child;else if(18===s.tag){if(null===(o=s.return))throw Error(a(341));o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Hn(o,n,e),o=s.sibling}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===e){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}Lr(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Gn(e,n),i=i(r=$n(r)),e.flags|=1,Lr(t,e,i,n),e.child;case 14:return r=mr(i=e.type,e.pendingProps),Ir(t,e,i,r=mr(i.type,r),n);case 15:return Nr(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:mr(i,r),ns(t,e),e.tag=1,ge(i)?(t=!0,ve(e)):t=!1,Gn(e,n),xr(e,i,r),Sr(e,i,r,n),Fr(null,e,i,!0,t,n);case 19:return es(t,e,n);case 22:return Dr(t,e,n)}throw Error(a(156,e.tag))},e.attemptContinuousHydration=function(t){if(13===t.tag){var e=Kn(t,134217728);null!==e&&Pa(e,t,134217728,ka()),yo(t,134217728)}},e.attemptDiscreteHydration=function(t){if(13===t.tag){var e=Kn(t,1);null!==e&&Pa(e,t,1,ka()),yo(t,1)}},e.attemptHydrationAtCurrentPriority=function(t){if(13===t.tag){var e=Ma(t),n=Kn(t,e);null!==n&&Pa(n,t,e,ka()),yo(t,e)}},e.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Be(e.pendingLanes);0!==n&&(Le(e,1|n),Ea(e,We()),0==(6&ta)&&(ma(),Ze()))}break;case 13:Da((function(){var e=Kn(t,1);if(null!==e){var n=ka();Pa(e,t,1,n)}})),yo(t,1)}},e.batchedUpdates=function(t,e){var n=ta;ta|=1;try{return t(e)}finally{0===(ta=n)&&(ma(),Ke&&Ze())}},e.createComponentSelector=function(t){return{$$typeof:zs,value:t}},e.createContainer=function(t,e,n,i,r,s,a){return po(t,e,!1,null,0,i,0,s,a)},e.createHasPseudoClassSelector=function(t){return{$$typeof:Ws,value:t}},e.createHydrationContainer=function(t,e,n,i,r,s,a,o,l){return(t=po(n,i,!0,t,0,s,0,o,l)).context=go(null),n=t.current,(s=Jn(i=ka(),r=Ma(n))).callback=null!=e?e:null,ti(n,s,r),t.current.lanes=r,Oe(t,r,i),Ea(t,i),t},e.createPortal=function(t,e,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:h,key:null==i?null:""+i,children:t,containerInfo:e,implementation:n}},e.createRoleSelector=function(t){return{$$typeof:Fs,value:t}},e.createTestNameSelector=function(t){return{$$typeof:js,value:t}},e.createTextSelector=function(t){return{$$typeof:Hs,value:t}},e.deferredUpdates=function(t){var e=Re,n=Js.transition;try{return Js.transition=null,Re=16,t()}finally{Re=e,Js.transition=n}},e.discreteUpdates=function(t,e,n,i,r){var s=Re,a=Js.transition;try{return Js.transition=null,Re=1,t(e,n,i,r)}finally{Re=s,Js.transition=a,0===ta&&ma()}},e.findAllNodes=Ks,e.findBoundingRects=function(t,e){if(!it)throw Error(a(363));e=Ks(t,e),t=[];for(var n=0;n<e.length;n++)t.push(st(e[n]));for(e=t.length-1;0<e;e--)for(var i=(n=t[e]).x,r=i+n.width,s=n.y,o=s+n.height,l=e-1;0<=l;l--)if(e!==l){var h=t[l],u=h.x,c=u+h.width,d=h.y,f=d+h.height;if(i>=u&&s>=d&&r<=c&&o<=f){t.splice(e,1);break}if(!(i!==u||n.width!==h.width||f<s||d>o)){d>s&&(h.height+=d-s,h.y=s),f<o&&(h.height=o-d),t.splice(e,1);break}if(!(s!==d||n.height!==h.height||c<i||u>r)){u>i&&(h.width+=u-i,h.x=i),c<r&&(h.width=r-u),t.splice(e,1);break}}return t},e.findHostInstance=mo,e.findHostInstanceWithNoPortals=function(t){return null===(t=null!==(t=C(t))?P(t):null)?null:t.stateNode},e.findHostInstanceWithWarning=function(t){return mo(t)},e.flushControlled=function(t){var e=ta;ta|=1;var n=Js.transition,i=Re;try{Js.transition=null,Re=1,t()}finally{Re=i,Js.transition=n,0===(ta=e)&&(ma(),Ze())}},e.flushPassiveEffects=Ka,e.flushSync=Da,e.focusWithin=function(t,e){if(!it)throw Error(a(363));for(e=Ys(t=$s(t),e),e=Array.from(e),t=0;t<e.length;){var n=e[t++];if(!ot(n)){if(5===n.tag&&ht(n.stateNode))return!0;for(n=n.child;null!==n;)e.push(n),n=n.sibling}}return!1},e.getCurrentUpdatePriority=function(){return Re},e.getFindAllNodesFailureDescription=function(t,e){if(!it)throw Error(a(363));var n=0,i=[];t=[$s(t),0];for(var r=0;r<t.length;){var s=t[r++],o=t[r++],l=e[o];if((5!==s.tag||!ot(s))&&(Vs(s,l)&&(i.push(Xs(l)),++o>n&&(n=o)),o<e.length))for(s=s.child;null!==s;)t.push(s,o),s=s.sibling}if(n<e.length){for(t=[];n<e.length;n++)t.push(Xs(e[n]));return"findAllNodes was able to match part of the selector:\n "+i.join(" > ")+"\n\nNo matching component was found for:\n "+t.join(" > ")}return null},e.getPublicRootInstance=function(t){return(t=t.current).child?5===t.child.tag?L(t.child.stateNode):t.child.stateNode:null},e.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:vo,findFiberByHostInstance:t.findFiberByHostInstance||xo,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)t=!1;else{var e=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e.isDisabled||!e.supportsFiber)t=!0;else{try{$e=e.inject(t),Ve=e}catch(t){}t=!!e.checkDCE}}return t},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(t,e,n,i){if(!it)throw Error(a(363));t=Ks(t,e);var r=ut(t,n,i).disconnect;return{disconnect:function(){r()}}},e.registerMutableSourceForHydration=function(t,e){var n=e._getVersion;n=n(e._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[e,n]:t.mutableSourceEagerHydrationData.push(e,n)},e.runWithPriority=function(t,e){var n=Re;try{return Re=t,e()}finally{Re=n}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(t,e,n,i){var r=e.current,s=ka(),a=Ma(r);return n=go(n),null===e.context?e.context=n:e.pendingContext=n,(e=Jn(s,a)).payload={element:t},null!==(i=void 0===i?null:i)&&(e.callback=i),null!==(t=ti(r,e,a))&&(Pa(t,r,a,s),ei(t,r,a)),a},e}),Fu);var Xu,Yu=r(Hu.exports),Ku={exports:{}},qu={};Ku.exports=(Xu||(Xu=1,qu.ConcurrentRoot=1,qu.ContinuousEventPriority=4,qu.DefaultEventPriority=16,qu.DiscreteEventPriority=1,qu.IdleEventPriority=536870912,qu.LegacyRoot=0),qu);var Qu=Ku.exports;const Zu=Yu({supportsMutation:!0,supportsPersistence:!1,createInstance:(t,e,n)=>{const i=function(t,e){const n=function(t,e){if("tag"===t)return new Au(e.attribute?e.attribute:e);if("radio"===t)return new Tu(e.attribute?e.attribute:e);if("checkbox"===t)return new wu(e.attribute?e.attribute:e)}(t,e);if(n)return n;if(!Ai.graphicService.creator[t])return;const i=Ai.graphicService.creator[t](e.attribute);return i}(t,e);if(i)return function(t,e){for(const n in e)Ju(n,e)&&Yl[n]&&t.addEventListener(Yl[n],e[n])}(i,e),i},createTextInstance:(t,e)=>{},appendInitialChild:(t,e)=>{t.add(e)},finalizeInitialChildren:()=>!1,prepareUpdate:()=>!0,shouldSetTextContent:()=>!1,getRootHostContext:()=>null,getChildHostContext:()=>null,getPublicInstance:t=>t,prepareForCommit:()=>null,resetAfterCommit:()=>{},preparePortalMount:()=>null,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,isPrimaryRenderer:!1,getCurrentEventPriority:()=>Qu.DefaultEventPriority,getInstanceFromNode:t=>null,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},prepareScopeUpdate:()=>{},getInstanceFromScope:()=>{},detachDeletedInstance:()=>{},supportsHydration:!1,appendChild:(t,e)=>{t.add(e)},appendChildToContainer:(t,e)=>{t.add(e)},insertBefore:(t,e,n)=>{t.insertBefore(e,n)},insertInContainerBefore:(t,e,n)=>{t.insertBefore(e,n)},removeChild:(t,e)=>{e.delete()},removeChildFromContainer:(t,e)=>{e.delete()},commitUpdate:(t,e,n,i,r)=>{!function(t,e,n){for(const i in n)Ju(i,n)&&n[i]!==e[i]&&t.removeEventListener(Yl[i],n[i]);for(const i in e)Ju(i,e)&&n[i]!==e[i]&&t.addEventListener(Yl[i],e[i]);const i=e.attribute??_({},e);t.initAttributes(i),"image"===t.type&&t.loadImage(i.image);if("flex"===i.display&&void 0===i.width&&void 0===i.height&&b(n.attribute.width)&&b(n.attribute.height)){const e=t.stage.pluginService.findPluginsByName("FlexLayoutPlugin")[0];e&&e.tryLayoutChildren(t)}}(t,r,i)},hideInstance:t=>{t.setAttribute("visible",!1)},unhideInstance:(t,e)=>{t.setAttribute("visible",!0)},clearContainer:t=>{t.removeAllChild()},commitTextUpdate:(t,e,n)=>{}});function Ju(t,e){return t.startsWith("on")&&l(e[t])}Zu.injectIntoDevTools({bundleType:0,version:n.version,rendererPackageName:"react-vtable"});const tc=(t,e)=>{const{componentId:r,children:s}=t;if(!n.isValidElement(s))return null;const a=n.useContext(i),{table:o}=a,l="header-custom-layout"===s.props.role,h=n.useRef(new Map),u=n.useCallback((t=>{const e=`${t.originCol??t.col}-${t.originRow??t.row}${t.forComputation?"-forComputation":""}`;let n;if(h.current.has(e)){const i=h.current.get(e);ec(s,i,t),n=i.containerInfo}else{n=new ma({});const i=Zu.createContainer(n,Qu.LegacyRoot,null,null,null,"custom",null,null);h.current.set(e,i),ec(s,i,t)}return{rootContainer:n,renderDefault:!!s.props.renderDefault}}),[s]),c=n.useCallback(((t,e)=>{const n=`${t}-${e}`;if(h.current.has(n)){const t=h.current.get(n);Zu.updateContainer(null,t,null),t.containerInfo.delete(),h.current.delete(n)}}),[]),d=n.useCallback((()=>{h.current.forEach(((t,e)=>{const n=t;Zu.updateContainer(null,n,null),n.containerInfo.delete()})),h.current.clear()}),[]);return n.useLayoutEffect((()=>(console.log("init",t,o),()=>{console.log("release",t,o)})),[]),n.useLayoutEffect((()=>{console.log("update props",t,o),o?.checkReactCustomLayout(),o?.reactCustomLayout?.setReactRemoveAllGraphic(r,d,l),o&&!o.reactCustomLayout?.hasReactCreateGraphic(r,l)?(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),o.reactCustomLayout?.setReactRemoveGraphic(r,c,l),o.reactCustomLayout?.updateCustomCell(r,l)):o&&(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),h.current.forEach(((t,e)=>{const[n,i]=e.split("-").map(Number),{width:r,height:a}=function(t,e,n){const i=n.getCellRange(t,e),r=n.getCellsRect(i.start.col,i.start.row,i.end.col,i.end.row);return r}(n,i,o),l=t,h={col:n,row:i,dataValue:o.getCellOriginValue(n,i),value:o.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:a,width:r,height:a},table:o};l.containerInfo,ec(s,l,h),o.scenegraph.updateNextFrame()})))})),null};function ec(t,e,i){Zu.updateContainer(n.cloneElement(t,{...i}),e,null)}const nc=(t,e,r,s)=>{const a=["id","updateId","componentIndex","children"],o=r?Object.keys(r).concat(a):a,l=t=>{const e=n.useContext(i),s=n.useRef(null),a=n.useRef(t.updateId);if(t.updateId!==a.current){a.current=t.updateId;!!r&&N(e.table,t,s.current,r)&&(s.current=t)}return n.useEffect((()=>()=>{r&&N(e.table,null,s.current,r)}),[]),rc(t.children,t.componentId)};return l.displayName=t,l.parseOption=t=>{const i=S(t,o);if(t.children){const{children:e}=t;n.Children.map(e,((e,n)=>{ic(e,t,i,o,t.componentId+"-"+n)}))}return{option:i,optionName:e,isSingle:s}},l};function ic(t,e,i,r,s){if("custom-layout"===t.props.role&&(i.customLayout="react-custom-layout",i.customLayoutComponentId=s),"header-custom-layout"===t.props.role&&(i.headerCustomLayout="react-custom-layout",i.headerCustomLayoutComponentId=s),"ListColumn"===t.type.displayName){i.columns||(i.columns=[]);const a=S(t.props,r);i.columns.push(a),a.componentId=s,t.props.children&&n.Children.map(t.props.children,((t,n)=>{ic(t,e,a,r,s+"-"+n)}))}}function rc(t,e){return(i=t)&&i.$$typeof===Symbol.for("react.element")||Array.isArray(t)?n.Children.map(t,((t,i)=>t.props.children?rc(t.props.children,e+"-"+i):"custom-layout"===t.props.role||"header-custom-layout"===t.props.role?n.createElement(tc,{componentId:e},t):null)):null;var i}const sc=nc("ListColumn","columns"),ac=nc("PivotColumnDimension","columns"),oc=nc("PivotRowDimension","rows"),lc=nc("PivotIndicator","indicators"),hc=nc("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),uc=nc("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),cc=nc("PivotCorner","corner",void 0,!0),dc=nc("Menu","menu",void 0,!0),fc=nc("Tooltip","tooltip",void 0,!0),pc=nc("EmptyTip","emptyTip",void 0,!0),gc=nc("Title","title",void 0,!0);function mc(t,e){return b(t)?t:"string"==typeof t&&t.endsWith("%")?Number(t.slice(0,-1))/100*e:0}const bc="group",yc="text",vc="tag",xc={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"#165dff",lineWidth:1,cornerRadius:2},padding:10,state:{panelStyle:{hover:{fill:"#4080ff"},disabled:{fill:"#94bfff"}}}};const _c=n.forwardRef((function(t,e){const i=_({},xc,t),{disabled:r,onClick:s}=i;let a=n.useRef(null);a=e||a;const o=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():s&&s(t)}),[r,s]),l=function(t){const{textStyle:e,padding:n,panelStyle:i,minWidth:r,maxWidth:s,visible:a,cursor:o,disabled:l,state:h,children:u}=t,c={text:u,textStyle:e,padding:n,panel:i,minWidth:r,maxWidth:s,visible:a,cursor:o??l?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:h?.textStyle?.hover,disabled:h?.textStyle?.disabled},panel:{hover:h?.panelStyle?.hover,disabled:h?.panelStyle?.disabled}}};return c}(i);return n.useEffect((()=>{a.current.addEventListener("mouseenter",(()=>{r||(a.current.addState("hover",!0,!1),a.current.stage.renderNextFrame())})),a.current.addEventListener("mouseleave",(()=>{r||(a.current.removeState("hover",!1),a.current.stage.renderNextFrame())}))})),n.useEffect((()=>{r?(a.current.removeState("disabled",!1),a.current.addState("disabled",!0,!1)):a.current.removeState("disabled",!1),a.current.stage.renderNextFrame()})),n.createElement(vc,{ref:a,attribute:l,onClick:o})}));_c.displayName="Button";const Sc={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(64, 128, 255)"},panelStyle:{visible:!0,opacity:0,fill:"rgba(242, 243, 245, 0.5)",lineWidth:1,cornerRadius:2},padding:4,space:6,state:{textStyle:{disabled:{fill:"rgb(148, 191, 255)"}},panelStyle:{hover:{opacity:1}}}};const Ac=n.forwardRef((function(t,e){const i=_({},Sc,t),{disabled:r,href:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():(a&&a(t),s&&window.open(s))}),[r,s,a]),h=function(t){const{textStyle:e,padding:n,space:i,panelStyle:r,minWidth:s,maxWidth:a,visible:o,cursor:l,disabled:h,icon:u,state:c,children:d}=t,f={text:d,textStyle:e,padding:n,panel:r,minWidth:s,maxWidth:a,visible:o,cursor:l??h?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:c?.textStyle?.hover,disabled:c?.textStyle?.disabled},panel:{hover:c?.panelStyle?.hover,disabled:c?.panelStyle?.disabled}},space:i,shape:{visible:!!u,fill:!1,stroke:e.fill,symbolType:"M -0.2927 -15.4348 L -15.142 -0.5855 C -18.6567 2.9292 -18.6567 8.6277 -15.142 12.1424 V 12.1424 C -11.6273 15.6571 -5.9288 15.6571 -2.4141 12.1424 L 15.2636 -5.5353 C 17.6067 -7.8784 17.6067 -11.6774 15.2636 -14.0206 V -14.0206 C 12.9205 -16.3637 9.1215 -16.3637 6.7783 -14.0206 L -10.8993 3.6571 C -12.0709 4.8287 -12.0709 6.7282 -10.8993 7.8997 V 7.8997 C -9.7278 9.0713 -7.8283 9.0713 -6.6567 7.8997 L 8.1925 -6.9495"}};return f}(i);return n.useEffect((()=>{o.current.addEventListener("mouseenter",(()=>{r||(o.current.addState("hover",!0,!1),o.current.stage.renderNextFrame())})),o.current.addEventListener("mouseleave",(()=>{r||(o.current.removeState("hover",!1),o.current.stage.renderNextFrame())}))}),[]),n.useEffect((()=>{r?(o.current.removeState("disabled",!1),o.current.addState("disabled",!0,!1)):o.current.removeState("disabled",!1),o.current.stage.renderNextFrame()})),n.createElement(vc,{ref:o,attribute:h,onClick:l})}));Ac.displayName="Link";const wc={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"rgb(201, 205, 212)",lineWidth:1,cornerRadius:2},size:40,shape:"circle",autoFixFontSize:!0};const Tc=n.forwardRef((function(t,e){const i=_({},wc,t),{size:r,children:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{a&&a(t)}),[a]),h=function(t){const{panelStyle:e,size:n,shape:i}=t,r={...e,width:n,height:n,clip:!0,cornerRadius:"circle"===i?n/2:e.cornerRadius??2,display:"flex",alignItems:"center",justifyContent:"center",visibleAll:!0,path:void 0};return r}(i);if(p(s)){const t=function(t){const{textStyle:e,size:n,children:i,autoFixFontSize:r}=t,s={text:i,...e};r&&function(t,e){const n=xu(e.text,e).width,i=t/(n+8),r=Math.max(Math.floor(e.fontSize*i),6);e.fontSize=r}(n,s);return s}(i);return n.createElement(bc,{ref:o,attribute:h,onClick:l},n.createElement(yc,{attribute:t}))}return"image"===s.type&&(s.props.attribute.width=r,s.props.attribute.height=r),n.createElement(bc,{ref:o,attribute:h,onClick:l},s)}));Tc.displayName="Avatar";const Bc={defaultPopupVisible:!1,position:"top"},Cc={backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 4px 10px rgba(0, 0, 0, .1)",fontSize:"14px",borderRadius:"4px",lineHeight:"1.5715",boxSizing:"border-box",color:"rgb(78, 89, 105)",border:"1px solid rgb(229, 230, 235)",padding:"12px 16px"},kc=t=>{const e={content:"",height:"8px",width:"8px",position:"absolute",display:"block",boxSizing:"border-box",transform:"rotate(45deg)",transformOrigin:"50% 50% 0",backgroundColor:"rgb(255, 255, 255)",border:"1px solid rgb(229, 230, 235)",...Mc(t.position),...t.arrowStyle};return t.visible?n.createElement(n.Fragment,null,n.createElement("div",{style:_({},Cc,t.panelStyle)},t.content),n.createElement("div",{style:e})):n.createElement(n.Fragment,null)};function Mc(t){switch(t){case"top":return{top:"calc(100% - 5px)",left:"calc(50% - 5px)",borderTop:"none",borderLeft:"none"};case"tl":return{top:"calc(100% - 4px)",left:"14px",borderTop:"none",borderLeft:"none"};case"tr":return{top:"calc(100% - 4px)",left:"calc(100% - 24px)",borderTop:"none",borderLeft:"none"};case"bottom":return{top:"-4px",left:"calc(50% - 4px)",borderRight:"none",borderBottom:"none"};case"bl":return{top:"-4px",left:"14px",borderRight:"none",borderBottom:"none"};case"br":return{top:"-4px",left:"calc(100% - 24px)",borderRight:"none",borderBottom:"none"};case"left":return{top:"calc(50% - 4px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lt":return{top:"14px",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lb":return{top:"calc(100% - 24px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"right":return{top:"calc(50% - 4px)",left:"-4px",borderRight:"none",borderTop:"none"};case"rt":return{top:"14px",left:"-4px",borderRight:"none",borderTop:"none"};case"rb":return{top:"calc(100% - 24px)",left:"-4px",borderRight:"none",borderTop:"none"}}}const Pc=n.forwardRef((function(t,e){const i=_({},Bc,t),{content:r,position:s,popupVisible:a,defaultPopupVisible:o,panelStyle:l,arrowStyle:h,children:c}=i;let d=n.useRef(null);d=e||d;const[f,p]=n.useState(!1);n.useEffect((()=>{p(!!a),d.current.stage.renderNextFrame()}),[a]),n.useEffect((()=>{p(a??o??!1)}),[]);const{transform:g,anchorType:m}=function(t){switch(t){case"top":return{anchorType:"top",transform:"translate(-50%, calc(-100% - 10px))"};case"tl":return{anchorType:"top-left",transform:"translate(0, calc(-100% - 10px))"};case"tr":return{anchorType:"top-right",transform:"translate(-100%, calc(-100% - 10px))"};case"bottom":return{anchorType:"bottom",transform:"translate(-50%, 10px)"};case"bl":return{anchorType:"bottom-left",transform:"translate(0, 10px)"};case"br":return{anchorType:"bottom-right",transform:"translate(-100%, 10px)"};case"left":return{anchorType:"left",transform:"translate(calc(-100% - 10px), -50%)"};case"lt":return{anchorType:"top-left",transform:"translate(calc(-100% - 10px), 0)"};case"lb":return{anchorType:"bottom-left",transform:"translate(calc(-100% - 10px), -100%)"};case"right":return{anchorType:"right",transform:"translate(10px, -50%)"};case"rt":return{anchorType:"top-right",transform:"translate(10px, 0)"};case"rb":return{anchorType:"bottom-right",transform:"translate(10px, -100%)"}}}(s),b={react:{style:{transform:g},element:n.createElement(kc,{visible:f,content:r,position:s,panelStyle:l,arrowStyle:h}),container:null,visible:!0,pointerEvents:!1,anchorType:m}},y=n.useCallback((t=>{u(a)||(p(!0),t.currentTarget.stage.renderNextFrame())}),[]),v=n.useCallback((t=>{u(a)||(p(!1),t.currentTarget.stage.renderNextFrame())}),[]);return n.createElement(bc,{ref:d,attribute:b,onMouseEnter:y,onMouseLeave:v},c)}));Pc.displayName="Popover";const Ec={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(51, 101, 238)"},panelStyle:{visible:!0,fill:"#e6fffb",lineWidth:1,cornerRadius:4}};const Oc=n.forwardRef((function(t,e){const i=_({},Ec,t),{attribute:r,panelStyle:s,children:a,...o}=i;let l=n.useRef(null);return l=e||l,n.createElement(vc,{ref:l,attribute:r??{text:a,panel:s,...o},...o})}));Oc.displayName="Tag";const Lc={};const Rc=n.forwardRef((function(t,e){const i=_({},Lc,t),{textStyle:r,circleStyle:s,children:a,...o}=i;let l=n.useRef(null);l=e||l;const h=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(l.current?.addEventListener("radio_checked",h),()=>{l.current?.removeEventListener("radio_checked",h)})),[]),n.createElement("radio",{ref:l,attribute:{text:{...r,text:a},circle:s,...o},...o})}));Rc.displayName="Radio";const Ic={};const Nc=n.forwardRef((function(t,e){const i=_({},Ic,t),{textStyle:r,boxStyle:s,iconStyle:a,children:o,...l}=i;let h=n.useRef(null);h=e||h;const u=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(h.current?.addEventListener("checkbox_state_change",u),()=>{h.current?.removeEventListener("checkbox_state_change",u)})),[]),n.createElement("checkbox",{ref:h,attribute:{text:{...r,text:o},box:s,icon:a,...l},...l})}));Nc.displayName="Checkbox";Object.defineProperty(t,"register",{enumerable:!0,get:function(){return e.register}}),t.Arc="arc",t.Avatar=Tc,t.Button=_c,t.Checkbox=Nc,t.Circle="circle",t.CustomComponent=t=>{const e=n.useContext(i),{table:r}=e,s=function(t,e){const i=n.useMemo((()=>({...e})),[e]),r=n.useMemo((()=>{const e=_({},t);for(const t in i)void 0===e[t]&&(e[t]=i[t]);return e}),[t,i]);return r}(t,{style:{left:0,top:0},className:"vtable-custom-component",displayMode:"position",x:0,y:0,width:0,height:0,row:0,col:0,anchor:"top-left",dx:0,dy:0}),{displayMode:a,x:o,y:l,width:h,height:u,row:c,col:d,anchor:f,dx:p,dy:g,className:m,children:b,style:y}=s;let v,x,S,A;if("position"===a)v=o+p+"px",x=l+g+"px",S=h+"px",A=u+"px";else if("cell"===a){const t=r&&d>=0&&c>=0?r?.getCellRelativeRect(d,c):{width:0,height:0,left:-9999,top:-9999};S=mc(h,t.width)+"px",A=mc(u,t.height)+"px","top-left"===f?(v=t.left+mc(p,t.width)+"px",x=t.top+mc(g,t.height)+"px"):"top-right"===f?(v=t.left+mc(p,t.width)+t.width+"px",x=t.top+mc(g,t.height)+"px"):"bottom-left"===f?(v=t.left+mc(p,t.width)+"px",x=t.top+mc(g,t.height)+t.height+"px"):"bottom-right"===f&&(v=t.left+mc(p,t.width)+t.width+"px",x=t.top+mc(g,t.height)+t.height+"px")}const w=_({},y,{position:"absolute",zIndex:1e3,width:S,height:A,left:v,top:x});return n.createElement("div",{className:m,style:w},n.Children.map(b,(t=>t?n.cloneElement(t,{}):t)))},t.CustomLayout=tc,t.EmptyTip=pc,t.Group=bc,t.Image="image",t.Line="line",t.Link=Ac,t.ListColumn=sc,t.ListTable=Ru,t.ListTableSimple=Du,t.Menu=dc,t.Path="path",t.PivotChart=Nu,t.PivotColumnDimension=ac,t.PivotColumnHeaderTitle=hc,t.PivotCorner=cc,t.PivotIndicator=lc,t.PivotRowDimension=oc,t.PivotRowHeaderTitle=uc,t.PivotTable=Iu,t.PivotTableSimple=Uu,t.Polygon="polygon",t.Popover=Pc,t.Radio=Rc,t.Rect="rect",t.RichText="richtext",t.Symbol="symbol",t.Tag=Oc,t.Text=yc,t.Title=gc,t.Tooltip=fc,t.VTableReactAttributePlugin=Bu,t.registerChartModule=function(t,n){e.register.chartModule(t,n)},t.version="1.18.0"}));
|
|
10
|
+
*/$u.exports=(Gu||(Gu=1,Hu=function(t){var e={},i=n,r=Yu(),s=Object.assign;function a(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,l=Symbol.for("react.element"),h=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),b=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),_=Symbol.iterator;function S(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=_&&t[_]||t["@@iterator"])?t:null}function A(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case u:return"Fragment";case h:return"Portal";case d:return"Profiler";case c:return"StrictMode";case m:return"Suspense";case b:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case p:return(t.displayName||"Context")+".Consumer";case f:return(t._context.displayName||"Context")+".Provider";case g:var e=t.render;return(t=t.displayName)||(t=""!==(t=e.displayName||e.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case y:return null!==(e=t.displayName||null)?e:A(t.type)||"Memo";case v:e=t._payload,t=t._init;try{return A(t(e))}catch(t){}}return null}function w(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=(t=e.render).displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return A(e);case 8:return e===c?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e}return null}function T(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do{0!=(4098&(e=t).flags)&&(n=e.return),t=e.return}while(t)}return 3===e.tag?n:null}function B(t){if(T(t)!==t)throw Error(a(188))}function C(t){var e=t.alternate;if(!e){if(null===(e=T(t)))throw Error(a(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return B(r),t;if(s===i)return B(r),e;s=s.sibling}throw Error(a(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?t:e}function k(t){return null!==(t=C(t))?M(t):null}function M(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){var e=M(t);if(null!==e)return e;t=t.sibling}return null}function P(t){if(5===t.tag||6===t.tag)return t;for(t=t.child;null!==t;){if(4!==t.tag){var e=P(t);if(null!==e)return e}t=t.sibling}return null}var E,O=Array.isArray,L=t.getPublicInstance,R=t.getRootHostContext,I=t.getChildHostContext,N=t.prepareForCommit,U=t.resetAfterCommit,D=t.createInstance,z=t.appendInitialChild,W=t.finalizeInitialChildren,F=t.prepareUpdate,j=t.shouldSetTextContent,H=t.createTextInstance,G=t.scheduleTimeout,$=t.cancelTimeout,V=t.noTimeout,X=t.isPrimaryRenderer,Y=t.supportsMutation,K=t.supportsPersistence,q=t.supportsHydration,Q=t.getInstanceFromNode,Z=t.preparePortalMount,J=t.getCurrentEventPriority,tt=t.detachDeletedInstance,et=t.supportsMicrotasks,nt=t.scheduleMicrotask,it=t.supportsTestSelectors,rt=t.findFiberRoot,st=t.getBoundingRect,at=t.getTextContent,ot=t.isHiddenSubtree,lt=t.matchAccessibilityRole,ht=t.setFocusIfFocusable,ut=t.setupIntersectionObserver,ct=t.appendChild,dt=t.appendChildToContainer,ft=t.commitTextUpdate,pt=t.commitMount,gt=t.commitUpdate,mt=t.insertBefore,bt=t.insertInContainerBefore,yt=t.removeChild,vt=t.removeChildFromContainer,xt=t.resetTextContent,_t=t.hideInstance,St=t.hideTextInstance,At=t.unhideInstance,wt=t.unhideTextInstance,Tt=t.clearContainer,Bt=t.cloneInstance,Ct=t.createContainerChildSet,kt=t.appendChildToContainerChildSet,Mt=t.finalizeContainerChildren,Pt=t.replaceContainerChildren,Et=t.cloneHiddenInstance,Ot=t.cloneHiddenTextInstance,Lt=t.canHydrateInstance,Rt=t.canHydrateTextInstance,It=t.canHydrateSuspenseInstance,Nt=t.isSuspenseInstancePending,Ut=t.isSuspenseInstanceFallback,Dt=t.getSuspenseInstanceFallbackErrorDetails,zt=t.registerSuspenseInstanceRetry,Wt=t.getNextHydratableSibling,Ft=t.getFirstHydratableChild,jt=t.getFirstHydratableChildWithinContainer,Ht=t.getFirstHydratableChildWithinSuspenseInstance,Gt=t.hydrateInstance,$t=t.hydrateTextInstance,Vt=t.hydrateSuspenseInstance,Xt=t.getNextHydratableInstanceAfterSuspenseInstance,Yt=t.commitHydratedContainer,Kt=t.commitHydratedSuspenseInstance,qt=t.clearSuspenseBoundary,Qt=t.clearSuspenseBoundaryFromContainer,Zt=t.shouldDeleteUnhydratedTailInstances,Jt=t.didNotMatchHydratedContainerTextInstance,te=t.didNotMatchHydratedTextInstance;function ee(t){if(void 0===E)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);E=e&&e[1]||""}return"\n"+E+t}var ne=!1;function ie(t,e){if(!t||ne)return"";ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(t){var i=t}Reflect.construct(t,[],e)}else{try{e.call()}catch(t){i=t}t.call(e.prototype)}else{try{throw Error()}catch(t){i=t}t()}}catch(e){if(e&&i&&"string"==typeof e.stack){for(var r=e.stack.split("\n"),s=i.stack.split("\n"),a=r.length-1,o=s.length-1;1<=a&&0<=o&&r[a]!==s[o];)o--;for(;1<=a&&0<=o;a--,o--)if(r[a]!==s[o]){if(1!==a||1!==o)do{if(a--,0>--o||r[a]!==s[o]){var l="\n"+r[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}}while(1<=a&&0<=o);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?ee(t):""}var re=Object.prototype.hasOwnProperty,se=[],ae=-1;function oe(t){return{current:t}}function le(t){0>ae||(t.current=se[ae],se[ae]=null,ae--)}function he(t,e){ae++,se[ae]=t.current,t.current=e}var ue={},ce=oe(ue),de=oe(!1),fe=ue;function pe(t,e){var n=t.type.contextTypes;if(!n)return ue;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var r,s={};for(r in n)s[r]=e[r];return i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function ge(t){return null!=t.childContextTypes}function me(){le(de),le(ce)}function be(t,e,n){if(ce.current!==ue)throw Error(a(168));he(ce,e),he(de,n)}function ye(t,e,n){var i=t.stateNode;if(e=e.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in e))throw Error(a(108,w(t)||"Unknown",r));return s({},n,i)}function ve(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ue,fe=ce.current,he(ce,t),he(de,de.current),!0}function xe(t,e,n){var i=t.stateNode;if(!i)throw Error(a(169));n?(t=ye(t,e,fe),i.__reactInternalMemoizedMergedChildContext=t,le(de),le(ce),he(ce,t)):le(de),he(de,n)}var _e=Math.clz32?Math.clz32:function(t){return 0==(t>>>=0)?32:31-(Se(t)/Ae|0)|0},Se=Math.log,Ae=Math.LN2,we=64,Te=4194304;function Be(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&t;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&t;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Ce(t,e){var n=t.pendingLanes;if(0===n)return 0;var i=0,r=t.suspendedLanes,s=t.pingedLanes,a=268435455&n;if(0!==a){var o=a&~r;0!==o?i=Be(o):0!=(s&=a)&&(i=Be(s))}else 0!=(a=n&~r)?i=Be(a):0!==s&&(i=Be(s));if(0===i)return 0;if(0!==e&&e!==i&&0==(e&r)&&((r=i&-i)>=(s=e&-e)||16===r&&0!=(4194240&s)))return e;if(0!=(4&i)&&(i|=16&n),0!==(e=t.entangledLanes))for(t=t.entanglements,e&=i;0<e;)r=1<<(n=31-_e(e)),i|=t[n],e&=~r;return i}function ke(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function Me(t){return 0!=(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function Pe(){var t=we;return 0==(4194240&(we<<=1))&&(we=64),t}function Ee(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Oe(t,e,n){t.pendingLanes|=e,536870912!==e&&(t.suspendedLanes=0,t.pingedLanes=0),(t=t.eventTimes)[e=31-_e(e)]=n}function Le(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-_e(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}var Re=0;function Ie(t){return 1<(t&=-t)?4<t?0!=(268435455&t)?16:536870912:4:1}var Ne=r.unstable_scheduleCallback,Ue=r.unstable_cancelCallback,De=r.unstable_shouldYield,ze=r.unstable_requestPaint,We=r.unstable_now,Fe=r.unstable_ImmediatePriority,je=r.unstable_UserBlockingPriority,He=r.unstable_NormalPriority,Ge=r.unstable_IdlePriority,$e=null,Ve=null,Xe="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},Ye=null,Ke=!1,qe=!1;function Qe(t){null===Ye?Ye=[t]:Ye.push(t)}function Ze(){if(!qe&&null!==Ye){qe=!0;var t=0,e=Re;try{var n=Ye;for(Re=1;t<n.length;t++){var i=n[t];do{i=i(!0)}while(null!==i)}Ye=null,Ke=!1}catch(e){throw null!==Ye&&(Ye=Ye.slice(t+1)),Ne(Fe,Ze),e}finally{Re=e,qe=!1}}return null}var Je=[],tn=0,en=null,nn=0,rn=[],sn=0,an=null,on=1,ln="";function hn(t,e){Je[tn++]=nn,Je[tn++]=en,en=t,nn=e}function un(t,e,n){rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,an=t;var i=on;t=ln;var r=32-_e(i)-1;i&=~(1<<r),n+=1;var s=32-_e(e)+r;if(30<s){var a=r-r%5;s=(i&(1<<a)-1).toString(32),i>>=a,r-=a,on=1<<32-_e(e)+r|n<<r|i,ln=s+t}else on=1<<s|n<<r|i,ln=t}function cn(t){null!==t.return&&(hn(t,1),un(t,1,0))}function dn(t){for(;t===en;)en=Je[--tn],Je[tn]=null,nn=Je[--tn],Je[tn]=null;for(;t===an;)an=rn[--sn],rn[sn]=null,ln=rn[--sn],rn[sn]=null,on=rn[--sn],rn[sn]=null}var fn=null,pn=null,gn=!1,mn=!1,bn=null;function yn(t,e){var n=ro(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,null===(e=t.deletions)?(t.deletions=[n],t.flags|=16):e.push(n)}function vn(t,e){switch(t.tag){case 5:return null!==(e=Lt(e,t.type,t.pendingProps))&&(t.stateNode=e,fn=t,pn=Ft(e),!0);case 6:return null!==(e=Rt(e,t.pendingProps))&&(t.stateNode=e,fn=t,pn=null,!0);case 13:if(null!==(e=It(e))){var n=null!==an?{id:on,overflow:ln}:null;return t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},(n=ro(18,null,null,0)).stateNode=e,n.return=t,t.child=n,fn=t,pn=null,!0}return!1;default:return!1}}function xn(t){return 0!=(1&t.mode)&&0==(128&t.flags)}function _n(t){if(gn){var e=pn;if(e){var n=e;if(!vn(t,e)){if(xn(t))throw Error(a(418));e=Wt(n);var i=fn;e&&vn(t,e)?yn(i,n):(t.flags=-4097&t.flags|2,gn=!1,fn=t)}}else{if(xn(t))throw Error(a(418));t.flags=-4097&t.flags|2,gn=!1,fn=t}}}function Sn(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;fn=t}function An(t){if(!q||t!==fn)return!1;if(!gn)return Sn(t),gn=!0,!1;if(3!==t.tag&&(5!==t.tag||Zt(t.type)&&!j(t.type,t.memoizedProps))){var e=pn;if(e){if(xn(t))throw wn(),Error(a(418));for(;e;)yn(t,e),e=Wt(e)}}if(Sn(t),13===t.tag){if(!q)throw Error(a(316));if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(a(317));pn=Xt(t)}else pn=fn?Wt(t.stateNode):null;return!0}function wn(){for(var t=pn;t;)t=Wt(t)}function Tn(){q&&(pn=fn=null,mn=gn=!1)}function Bn(t){null===bn?bn=[t]:bn.push(t)}var Cn=o.ReactCurrentBatchConfig;function kn(t,e){if(Xe(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!re.call(e,r)||!Xe(t[r],e[r]))return!1}return!0}function Mn(t){switch(t.tag){case 5:return ee(t.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return ie(t.type,!1);case 11:return ie(t.type.render,!1);case 1:return ie(t.type,!0);default:return""}}function Pn(t,e,n){if(null!==(t=n.ref)&&"function"!=typeof t&&"object"!=typeof t){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var i=n.stateNode}if(!i)throw Error(a(147,t));var r=i,s=""+t;return null!==e&&null!==e.ref&&"function"==typeof e.ref&&e.ref._stringRef===s?e.ref:(e=function(t){var e=r.refs;null===t?delete e[s]:e[s]=t},e._stringRef=s,e)}if("string"!=typeof t)throw Error(a(284));if(!n._owner)throw Error(a(290,t))}return t}function En(t,e){throw t=Object.prototype.toString.call(e),Error(a(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function On(t){return(0,t._init)(t._payload)}function Ln(t){function e(e,n){if(t){var i=e.deletions;null===i?(e.deletions=[n],e.flags|=16):i.push(n)}}function n(n,i){if(!t)return null;for(;null!==i;)e(n,i),i=i.sibling;return null}function i(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function r(t,e){return(t=ao(t,e)).index=0,t.sibling=null,t}function s(e,n,i){return e.index=i,t?null!==(i=e.alternate)?(i=i.index)<n?(e.flags|=2,n):i:(e.flags|=2,n):(e.flags|=1048576,n)}function o(e){return t&&null===e.alternate&&(e.flags|=2),e}function c(t,e,n,i){return null===e||6!==e.tag?((e=uo(n,t.mode,i)).return=t,e):((e=r(e,n)).return=t,e)}function d(t,e,n,i){var s=n.type;return s===u?p(t,e,n.props.children,i,n.key):null!==e&&(e.elementType===s||"object"==typeof s&&null!==s&&s.$$typeof===v&&On(s)===e.type)?((i=r(e,n.props)).ref=Pn(t,e,n),i.return=t,i):((i=oo(n.type,n.key,n.props,null,t.mode,i)).ref=Pn(t,e,n),i.return=t,i)}function f(t,e,n,i){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?((e=co(n,t.mode,i)).return=t,e):((e=r(e,n.children||[])).return=t,e)}function p(t,e,n,i,s){return null===e||7!==e.tag?((e=lo(n,t.mode,i,s)).return=t,e):((e=r(e,n)).return=t,e)}function g(t,e,n){if("string"==typeof e&&""!==e||"number"==typeof e)return(e=uo(""+e,t.mode,n)).return=t,e;if("object"==typeof e&&null!==e){switch(e.$$typeof){case l:return(n=oo(e.type,e.key,e.props,null,t.mode,n)).ref=Pn(t,null,e),n.return=t,n;case h:return(e=co(e,t.mode,n)).return=t,e;case v:return g(t,(0,e._init)(e._payload),n)}if(O(e)||S(e))return(e=lo(e,t.mode,n,null)).return=t,e;En(t,e)}return null}function m(t,e,n,i){var r=null!==e?e.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==r?null:c(t,e,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case l:return n.key===r?d(t,e,n,i):null;case h:return n.key===r?f(t,e,n,i):null;case v:return m(t,e,(r=n._init)(n._payload),i)}if(O(n)||S(n))return null!==r?null:p(t,e,n,i,null);En(t,n)}return null}function b(t,e,n,i,r){if("string"==typeof i&&""!==i||"number"==typeof i)return c(e,t=t.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case l:return d(e,t=t.get(null===i.key?n:i.key)||null,i,r);case h:return f(e,t=t.get(null===i.key?n:i.key)||null,i,r);case v:return b(t,e,n,(0,i._init)(i._payload),r)}if(O(i)||S(i))return p(e,t=t.get(n)||null,i,r,null);En(e,i)}return null}function y(r,a,o,l){for(var h=null,u=null,c=a,d=a=0,f=null;null!==c&&d<o.length;d++){c.index>d?(f=c,c=null):f=c.sibling;var p=m(r,c,o[d],l);if(null===p){null===c&&(c=f);break}t&&c&&null===p.alternate&&e(r,c),a=s(p,a,d),null===u?h=p:u.sibling=p,u=p,c=f}if(d===o.length)return n(r,c),gn&&hn(r,d),h;if(null===c){for(;d<o.length;d++)null!==(c=g(r,o[d],l))&&(a=s(c,a,d),null===u?h=c:u.sibling=c,u=c);return gn&&hn(r,d),h}for(c=i(r,c);d<o.length;d++)null!==(f=b(c,r,d,o[d],l))&&(t&&null!==f.alternate&&c.delete(null===f.key?d:f.key),a=s(f,a,d),null===u?h=f:u.sibling=f,u=f);return t&&c.forEach((function(t){return e(r,t)})),gn&&hn(r,d),h}function x(r,o,l,h){var u=S(l);if("function"!=typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var c=u=null,d=o,f=o=0,p=null,y=l.next();null!==d&&!y.done;f++,y=l.next()){d.index>f?(p=d,d=null):p=d.sibling;var v=m(r,d,y.value,h);if(null===v){null===d&&(d=p);break}t&&d&&null===v.alternate&&e(r,d),o=s(v,o,f),null===c?u=v:c.sibling=v,c=v,d=p}if(y.done)return n(r,d),gn&&hn(r,f),u;if(null===d){for(;!y.done;f++,y=l.next())null!==(y=g(r,y.value,h))&&(o=s(y,o,f),null===c?u=y:c.sibling=y,c=y);return gn&&hn(r,f),u}for(d=i(r,d);!y.done;f++,y=l.next())null!==(y=b(d,r,f,y.value,h))&&(t&&null!==y.alternate&&d.delete(null===y.key?f:y.key),o=s(y,o,f),null===c?u=y:c.sibling=y,c=y);return t&&d.forEach((function(t){return e(r,t)})),gn&&hn(r,f),u}return function t(i,s,a,c){if("object"==typeof a&&null!==a&&a.type===u&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case l:t:{for(var d=a.key,f=s;null!==f;){if(f.key===d){if((d=a.type)===u){if(7===f.tag){n(i,f.sibling),(s=r(f,a.props.children)).return=i,i=s;break t}}else if(f.elementType===d||"object"==typeof d&&null!==d&&d.$$typeof===v&&On(d)===f.type){n(i,f.sibling),(s=r(f,a.props)).ref=Pn(i,f,a),s.return=i,i=s;break t}n(i,f);break}e(i,f),f=f.sibling}a.type===u?((s=lo(a.props.children,i.mode,c,a.key)).return=i,i=s):((c=oo(a.type,a.key,a.props,null,i.mode,c)).ref=Pn(i,s,a),c.return=i,i=c)}return o(i);case h:t:{for(f=a.key;null!==s;){if(s.key===f){if(4===s.tag&&s.stateNode.containerInfo===a.containerInfo&&s.stateNode.implementation===a.implementation){n(i,s.sibling),(s=r(s,a.children||[])).return=i,i=s;break t}n(i,s);break}e(i,s),s=s.sibling}(s=co(a,i.mode,c)).return=i,i=s}return o(i);case v:return t(i,s,(f=a._init)(a._payload),c)}if(O(a))return y(i,s,a,c);if(S(a))return x(i,s,a,c);En(i,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==s&&6===s.tag?(n(i,s.sibling),(s=r(s,a)).return=i,i=s):(n(i,s),(s=uo(a,i.mode,c)).return=i,i=s),o(i)):n(i,s)}}var Rn=Ln(!0),In=Ln(!1),Nn=oe(null),Un=null,Dn=null,zn=null;function Wn(){zn=Dn=Un=null}function Fn(t,e,n){X?(he(Nn,e._currentValue),e._currentValue=n):(he(Nn,e._currentValue2),e._currentValue2=n)}function jn(t){var e=Nn.current;le(Nn),X?t._currentValue=e:t._currentValue2=e}function Hn(t,e,n){for(;null!==t;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,null!==i&&(i.childLanes|=e)):null!==i&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function Gn(t,e){Un=t,zn=Dn=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(0!=(t.lanes&e)&&(Or=!0),t.firstContext=null)}function $n(t){var e=X?t._currentValue:t._currentValue2;if(zn!==t)if(t={context:t,memoizedValue:e,next:null},null===Dn){if(null===Un)throw Error(a(308));Dn=t,Un.dependencies={lanes:0,firstContext:t}}else Dn=Dn.next=t;return e}var Vn=null;function Xn(t){null===Vn?Vn=[t]:Vn.push(t)}function Yn(t,e,n,i){var r=e.interleaved;return null===r?(n.next=n,Xn(e)):(n.next=r.next,r.next=n),e.interleaved=n,Kn(t,i)}function Kn(t,e){t.lanes|=e;var n=t.alternate;for(null!==n&&(n.lanes|=e),n=t,t=t.return;null!==t;)t.childLanes|=e,null!==(n=t.alternate)&&(n.childLanes|=e),n=t,t=t.return;return 3===n.tag?n.stateNode:null}var qn=!1;function Qn(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zn(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Jn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ti(t,e,n){var i=t.updateQueue;if(null===i)return null;if(i=i.shared,0!=(2&ta)){var r=i.pending;return null===r?e.next=e:(e.next=r.next,r.next=e),i.pending=e,Kn(t,n)}return null===(r=i.interleaved)?(e.next=e,Xn(i)):(e.next=r.next,r.next=e),i.interleaved=e,Kn(t,n)}function ei(t,e,n){if(null!==(e=e.updateQueue)&&(e=e.shared,0!=(4194240&n))){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}function ni(t,e){var n=t.updateQueue,i=t.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,s=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===s?r=s=a:s=s.next=a,n=n.next}while(null!==n);null===s?r=s=e:s=s.next=e}else r=s=e;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,effects:i.effects},void(t.updateQueue=n)}null===(t=n.lastBaseUpdate)?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ii(t,e,n,i){var r=t.updateQueue;qn=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(null!==l){r.shared.pending=null;var h=l,u=h.next;h.next=null,null===o?a=u:o.next=u,o=h;var c=t.alternate;null!==c&&(l=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===l?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=h)}if(null!==a){var d=r.baseState;for(o=0,c=u=h=null,l=a;;){var f=l.lane,p=l.eventTime;if((i&f)===f){null!==c&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});t:{var g=t,m=l;switch(f=e,p=n,m.tag){case 1:if("function"==typeof(g=m.payload)){d=g.call(p,d,f);break t}d=g;break t;case 3:g.flags=-65537&g.flags|128;case 0:if(null==(f="function"==typeof(g=m.payload)?g.call(p,d,f):g))break t;d=s({},d,f);break t;case 2:qn=!0}}null!==l.callback&&0!==l.lane&&(t.flags|=64,null===(f=r.effects)?r.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},null===c?(u=c=p,h=d):c=c.next=p,o|=f;if(null===(l=l.next)){if(null===(l=r.shared.pending))break;l=(f=l).next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}if(null===c&&(h=d),r.baseState=h,r.firstBaseUpdate=u,r.lastBaseUpdate=c,null!==(e=r.shared.interleaved)){r=e;do{o|=r.lane,r=r.next}while(r!==e)}else null===a&&(r.shared.lanes=0);la|=o,t.lanes=o,t.memoizedState=d}}function ri(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var i=t[e],r=i.callback;if(null!==r){if(i.callback=null,i=n,"function"!=typeof r)throw Error(a(191,r));r.call(i)}}}var si={},ai=oe(si),oi=oe(si),li=oe(si);function hi(t){if(t===si)throw Error(a(174));return t}function ui(t,e){he(li,e),he(oi,t),he(ai,si),t=R(e),le(ai),he(ai,t)}function ci(){le(ai),le(oi),le(li)}function di(t){var e=hi(li.current),n=hi(ai.current);n!==(e=I(n,t.type,e))&&(he(oi,t),he(ai,e))}function fi(t){oi.current===t&&(le(ai),le(oi))}var pi=oe(0);function gi(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||Nt(n)||Ut(n)))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!=(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var mi=[];function bi(){for(var t=0;t<mi.length;t++){var e=mi[t];X?e._workInProgressVersionPrimary=null:e._workInProgressVersionSecondary=null}mi.length=0}var yi=o.ReactCurrentDispatcher,vi=o.ReactCurrentBatchConfig,xi=0,_i=null,Si=null,Ai=null,wi=!1,Ti=!1,Bi=0,Ci=0;function ki(){throw Error(a(321))}function Mi(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Xe(t[n],e[n]))return!1;return!0}function Pi(t,e,n,i,r,s){if(xi=s,_i=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,yi.current=null===t||null===t.memoizedState?fr:pr,t=n(i,r),Ti){s=0;do{if(Ti=!1,Bi=0,25<=s)throw Error(a(301));s+=1,Ai=Si=null,e.updateQueue=null,yi.current=gr,t=n(i,r)}while(Ti)}if(yi.current=dr,e=null!==Si&&null!==Si.next,xi=0,Ai=Si=_i=null,wi=!1,e)throw Error(a(300));return t}function Ei(){var t=0!==Bi;return Bi=0,t}function Oi(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t,Ai}function Li(){if(null===Si){var t=_i.alternate;t=null!==t?t.memoizedState:null}else t=Si.next;var e=null===Ai?_i.memoizedState:Ai.next;if(null!==e)Ai=e,Si=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Si=t).memoizedState,baseState:Si.baseState,baseQueue:Si.baseQueue,queue:Si.queue,next:null},null===Ai?_i.memoizedState=Ai=t:Ai=Ai.next=t}return Ai}function Ri(t,e){return"function"==typeof e?e(t):e}function Ii(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=Si,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var o=r.next;r.next=s.next,s.next=o}i.baseQueue=r=s,n.pending=null}if(null!==r){s=r.next,i=i.baseState;var l=o=null,h=null,u=s;do{var c=u.lane;if((xi&c)===c)null!==h&&(h=h.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:t(i,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===h?(l=h=d,o=i):h=h.next=d,_i.lanes|=c,la|=c}u=u.next}while(null!==u&&u!==s);null===h?o=i:h.next=l,Xe(i,e.memoizedState)||(Or=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=h,n.lastRenderedState=i}if(null!==(t=n.interleaved)){r=t;do{s=r.lane,_i.lanes|=s,la|=s,r=r.next}while(r!==t)}else null===r&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Ni(t){var e=Li(),n=e.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(null!==r){n.pending=null;var o=r=r.next;do{s=t(s,o.action),o=o.next}while(o!==r);Xe(s,e.memoizedState)||(Or=!0),e.memoizedState=s,null===e.baseQueue&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function Ui(){}function Di(t,e){var n=_i,i=Li(),r=e(),s=!Xe(i.memoizedState,r);if(s&&(i.memoizedState=r,Or=!0),i=i.queue,qi(Fi.bind(null,n,i,t),[t]),i.getSnapshot!==e||s||null!==Ai&&1&Ai.memoizedState.tag){if(n.flags|=2048,$i(9,Wi.bind(null,n,i,r,e),void 0,null),null===ea)throw Error(a(349));0!=(30&xi)||zi(n,e,r)}return r}function zi(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.stores=[t]):null===(n=e.stores)?e.stores=[t]:n.push(t)}function Wi(t,e,n,i){e.value=n,e.getSnapshot=i,ji(e)&&Hi(t)}function Fi(t,e,n){return n((function(){ji(e)&&Hi(t)}))}function ji(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Xe(t,n)}catch(t){return!0}}function Hi(t){var e=Kn(t,1);null!==e&&Pa(e,t,1,-1)}function Gi(t){var e=Oi();return"function"==typeof t&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:t},e.queue=t,t=t.dispatch=lr.bind(null,_i,t),[e.memoizedState,t]}function $i(t,e,n,i){return t={tag:t,create:e,destroy:n,deps:i,next:null},null===(e=_i.updateQueue)?(e={lastEffect:null,stores:null},_i.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Vi(){return Li().memoizedState}function Xi(t,e,n,i){var r=Oi();_i.flags|=t,r.memoizedState=$i(1|e,n,void 0,void 0===i?null:i)}function Yi(t,e,n,i){var r=Li();i=void 0===i?null:i;var s=void 0;if(null!==Si){var a=Si.memoizedState;if(s=a.destroy,null!==i&&Mi(i,a.deps))return void(r.memoizedState=$i(e,n,s,i))}_i.flags|=t,r.memoizedState=$i(1|e,n,s,i)}function Ki(t,e){return Xi(8390656,8,t,e)}function qi(t,e){return Yi(2048,8,t,e)}function Qi(t,e){return Yi(4,2,t,e)}function Zi(t,e){return Yi(4,4,t,e)}function Ji(t,e){return"function"==typeof e?(t=t(),e(t),function(){e(null)}):null!=e?(t=t(),e.current=t,function(){e.current=null}):void 0}function tr(t,e,n){return n=null!=n?n.concat([t]):null,Yi(4,4,Ji.bind(null,e,t),n)}function er(){}function nr(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function ir(t,e){var n=Li();e=void 0===e?null:e;var i=n.memoizedState;return null!==i&&null!==e&&Mi(e,i[1])?i[0]:(t=t(),n.memoizedState=[t,e],t)}function rr(t,e,n){return 0==(21&xi)?(t.baseState&&(t.baseState=!1,Or=!0),t.memoizedState=n):(Xe(n,e)||(n=Pe(),_i.lanes|=n,la|=n,t.baseState=!0),e)}function sr(t,e){var n=Re;Re=0!==n&&4>n?n:4,t(!0);var i=vi.transition;vi.transition={};try{t(!1),e()}finally{Re=n,vi.transition=i}}function ar(){return Li().memoizedState}function or(t,e,n){var i=Ma(t);n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},hr(t)?ur(e,n):null!==(n=Yn(t,e,n,i))&&(Pa(n,t,i,ka()),cr(n,e,i))}function lr(t,e,n){var i=Ma(t),r={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(hr(t))ur(e,r);else{var s=t.alternate;if(0===t.lanes&&(null===s||0===s.lanes)&&null!==(s=e.lastRenderedReducer))try{var a=e.lastRenderedState,o=s(a,n);if(r.hasEagerState=!0,r.eagerState=o,Xe(o,a)){var l=e.interleaved;return null===l?(r.next=r,Xn(e)):(r.next=l.next,l.next=r),void(e.interleaved=r)}}catch(t){}null!==(n=Yn(t,e,r,i))&&(Pa(n,t,i,r=ka()),cr(n,e,i))}}function hr(t){var e=t.alternate;return t===_i||null!==e&&e===_i}function ur(t,e){Ti=wi=!0;var n=t.pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function cr(t,e,n){if(0!=(4194240&n)){var i=e.lanes;n|=i&=t.pendingLanes,e.lanes=n,Le(t,n)}}var dr={readContext:$n,useCallback:ki,useContext:ki,useEffect:ki,useImperativeHandle:ki,useInsertionEffect:ki,useLayoutEffect:ki,useMemo:ki,useReducer:ki,useRef:ki,useState:ki,useDebugValue:ki,useDeferredValue:ki,useTransition:ki,useMutableSource:ki,useSyncExternalStore:ki,useId:ki,unstable_isNewReconciler:!1},fr={readContext:$n,useCallback:function(t,e){return Oi().memoizedState=[t,void 0===e?null:e],t},useContext:$n,useEffect:Ki,useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,Xi(4194308,4,Ji.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Xi(4194308,4,t,e)},useInsertionEffect:function(t,e){return Xi(4,2,t,e)},useMemo:function(t,e){var n=Oi();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var i=Oi();return e=void 0!==n?n(e):e,i.memoizedState=i.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},i.queue=t,t=t.dispatch=or.bind(null,_i,t),[i.memoizedState,t]},useRef:function(t){return t={current:t},Oi().memoizedState=t},useState:Gi,useDebugValue:er,useDeferredValue:function(t){return Oi().memoizedState=t},useTransition:function(){var t=Gi(!1),e=t[0];return t=sr.bind(null,t[1]),Oi().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var i=_i,r=Oi();if(gn){if(void 0===n)throw Error(a(407));n=n()}else{if(n=e(),null===ea)throw Error(a(349));0!=(30&xi)||zi(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Ki(Fi.bind(null,i,s,t),[t]),i.flags|=2048,$i(9,Wi.bind(null,i,s,n,e),void 0,null),n},useId:function(){var t=Oi(),e=ea.identifierPrefix;if(gn){var n=ln;e=":"+e+"R"+(n=(on&~(1<<32-_e(on)-1)).toString(32)+n),0<(n=Bi++)&&(e+="H"+n.toString(32)),e+=":"}else e=":"+e+"r"+(n=Ci++).toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},pr={readContext:$n,useCallback:nr,useContext:$n,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ii,useRef:Vi,useState:function(){return Ii(Ri)},useDebugValue:er,useDeferredValue:function(t){return rr(Li(),Si.memoizedState,t)},useTransition:function(){return[Ii(Ri)[0],Li().memoizedState]},useMutableSource:Ui,useSyncExternalStore:Di,useId:ar,unstable_isNewReconciler:!1},gr={readContext:$n,useCallback:nr,useContext:$n,useEffect:qi,useImperativeHandle:tr,useInsertionEffect:Qi,useLayoutEffect:Zi,useMemo:ir,useReducer:Ni,useRef:Vi,useState:function(){return Ni(Ri)},useDebugValue:er,useDeferredValue:function(t){var e=Li();return null===Si?e.memoizedState=t:rr(e,Si.memoizedState,t)},useTransition:function(){return[Ni(Ri)[0],Li().memoizedState]},useMutableSource:Ui,useSyncExternalStore:Di,useId:ar,unstable_isNewReconciler:!1};function mr(t,e){if(t&&t.defaultProps){for(var n in e=s({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}return e}function br(t,e,n,i){n=null==(n=n(i,e=t.memoizedState))?e:s({},e,n),t.memoizedState=n,0===t.lanes&&(t.updateQueue.baseState=n)}var yr={isMounted:function(t){return!!(t=t._reactInternals)&&T(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=ka(),r=Ma(t),s=Jn(i,r);s.tag=1,s.payload=e,null!=n&&(s.callback=n),null!==(e=ti(t,s,r))&&(Pa(e,t,r,i),ei(e,t,r))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ka(),i=Ma(t),r=Jn(n,i);r.tag=2,null!=e&&(r.callback=e),null!==(e=ti(t,r,i))&&(Pa(e,t,i,n),ei(e,t,i))}};function vr(t,e,n,i,r,s,a){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(i,s,a):!(e.prototype&&e.prototype.isPureReactComponent&&kn(n,i)&&kn(r,s))}function xr(t,e,n){var i=!1,r=ue,s=e.contextType;return"object"==typeof s&&null!==s?s=$n(s):(r=ge(e)?fe:ce.current,s=(i=null!=(i=e.contextTypes))?pe(t,r):ue),e=new e(n,s),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=yr,t.stateNode=e,e._reactInternals=t,i&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=s),e}function _r(t,e,n,i){t=e.state,"function"==typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,i),"function"==typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&yr.enqueueReplaceState(e,e.state,null)}function Sr(t,e,n,i){var r=t.stateNode;r.props=n,r.state=t.memoizedState,r.refs={},Qn(t);var s=e.contextType;"object"==typeof s&&null!==s?r.context=$n(s):(s=ge(e)?fe:ce.current,r.context=pe(t,s)),r.state=t.memoizedState,"function"==typeof(s=e.getDerivedStateFromProps)&&(br(t,e,s,n),r.state=t.memoizedState),"function"==typeof e.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(e=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),e!==r.state&&yr.enqueueReplaceState(r,r.state,null),ii(t,n,r,i),r.state=t.memoizedState),"function"==typeof r.componentDidMount&&(t.flags|=4194308)}function Ar(t,e){try{var n="",i=e;do{n+=Mn(i),i=i.return}while(i);var r=n}catch(t){r="\nError generating stack: "+t.message+"\n"+t.stack}return{value:t,source:e,stack:r,digest:null}}function wr(t,e,n){return{value:t,source:null,stack:null!=n?n:null,digest:null!=e?e:null}}var Tr="function"==typeof WeakMap?WeakMap:Map;function Br(t,e,n){(n=Jn(-1,n)).tag=3,n.payload={element:null};var i=e.value;return n.callback=function(){ya||(ya=!0,va=i)},n}function Cr(t,e,n){(n=Jn(-1,n)).tag=3;var i=t.type.getDerivedStateFromError;if("function"==typeof i){var r=e.value;n.payload=function(){return i(r)},n.callback=function(){}}var s=t.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof i&&(null===xa?xa=new Set([this]):xa.add(this));var t=e.stack;this.componentDidCatch(e.value,{componentStack:null!==t?t:""})}),n}function kr(t,e,n){var i=t.pingCache;if(null===i){i=t.pingCache=new Tr;var r=new Set;i.set(e,r)}else void 0===(r=i.get(e))&&(r=new Set,i.set(e,r));r.has(n)||(r.add(n),t=Za.bind(null,t,e,n),e.then(t,t))}function Mr(t){do{var e;if((e=13===t.tag)&&(e=null===(e=t.memoizedState)||null!==e.dehydrated),e)return t;t=t.return}while(null!==t);return null}function Pr(t,e,n,i,r){return 0==(1&t.mode)?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((e=Jn(-1,1)).tag=2,ti(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=r,t)}var Er=o.ReactCurrentOwner,Or=!1;function Lr(t,e,n,i){e.child=null===t?In(e,null,n,i):Rn(e,t.child,n,i)}function Rr(t,e,n,i,r){n=n.render;var s=e.ref;return Gn(e,r),i=Pi(t,e,n,i,s,r),n=Ei(),null===t||Or?(gn&&n&&cn(e),e.flags|=1,Lr(t,e,i,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Ir(t,e,n,i,r){if(null===t){var s=n.type;return"function"!=typeof s||so(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=oo(n.type,null,i,e,e.mode,r)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=s,Nr(t,e,s,i,r))}if(s=t.child,0==(t.lanes&r)){var a=s.memoizedProps;if((n=null!==(n=n.compare)?n:kn)(a,i)&&t.ref===e.ref)return is(t,e,r)}return e.flags|=1,(t=ao(s,i)).ref=e.ref,t.return=e,e.child=t}function Nr(t,e,n,i,r){if(null!==t){var s=t.memoizedProps;if(kn(s,i)&&t.ref===e.ref){if(Or=!1,e.pendingProps=i=s,0==(t.lanes&r))return e.lanes=t.lanes,is(t,e,r);0!=(131072&t.flags)&&(Or=!0)}}return zr(t,e,n,i,r)}function Ur(t,e,n){var i=e.pendingProps,r=i.children,s=null!==t?t.memoizedState:null;if("hidden"===i.mode)if(0==(1&e.mode))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},he(sa,ra),ra|=n;else{if(0==(1073741824&n))return t=null!==s?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,he(sa,ra),ra|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==s?s.baseLanes:n,he(sa,ra),ra|=i}else null!==s?(i=s.baseLanes|n,e.memoizedState=null):i=n,he(sa,ra),ra|=i;return Lr(t,e,r,n),e.child}function Dr(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function zr(t,e,n,i,r){var s=ge(n)?fe:ce.current;return s=pe(e,s),Gn(e,r),n=Pi(t,e,n,i,s,r),i=Ei(),null===t||Or?(gn&&i&&cn(e),e.flags|=1,Lr(t,e,n,r),e.child):(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~r,is(t,e,r))}function Wr(t,e,n,i,r){if(ge(n)){var s=!0;ve(e)}else s=!1;if(Gn(e,r),null===e.stateNode)ns(t,e),xr(e,n,i),Sr(e,n,i,r),i=!0;else if(null===t){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,h=n.contextType;h="object"==typeof h&&null!==h?$n(h):pe(e,h=ge(n)?fe:ce.current);var u=n.getDerivedStateFromProps,c="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;c||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==h)&&_r(e,a,i,h),qn=!1;var d=e.memoizedState;a.state=d,ii(e,i,a,r),l=e.memoizedState,o!==i||d!==l||de.current||qn?("function"==typeof u&&(br(e,n,u,i),l=e.memoizedState),(o=qn||vr(e,n,o,i,d,l,h))?(c||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(e.flags|=4194308)):("function"==typeof a.componentDidMount&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),a.props=i,a.state=l,a.context=h,i=o):("function"==typeof a.componentDidMount&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,Zn(t,e),o=e.memoizedProps,h=e.type===e.elementType?o:mr(e.type,o),a.props=h,c=e.pendingProps,d=a.context,l="object"==typeof(l=n.contextType)&&null!==l?$n(l):pe(e,l=ge(n)?fe:ce.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==c||d!==l)&&_r(e,a,i,l),qn=!1,d=e.memoizedState,a.state=d,ii(e,i,a,r);var p=e.memoizedState;o!==c||d!==p||de.current||qn?("function"==typeof f&&(br(e,n,f,i),p=e.memoizedState),(h=qn||vr(e,n,h,i,d,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof a.componentDidUpdate&&(e.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=p),a.props=i,a.state=p,a.context=l,i=h):("function"!=typeof a.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),i=!1)}return Fr(t,e,n,i,s,r)}function Fr(t,e,n,i,r,s){Dr(t,e);var a=0!=(128&e.flags);if(!i&&!a)return r&&xe(e,n,!1),is(t,e,s);i=e.stateNode,Er.current=e;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:i.render();return e.flags|=1,null!==t&&a?(e.child=Rn(e,t.child,null,s),e.child=Rn(e,null,o,s)):Lr(t,e,o,s),e.memoizedState=i.state,r&&xe(e,n,!0),e.child}function jr(t){var e=t.stateNode;e.pendingContext?be(0,e.pendingContext,e.pendingContext!==e.context):e.context&&be(0,e.context,!1),ui(t,e.containerInfo)}function Hr(t,e,n,i,r){return Tn(),Bn(r),e.flags|=256,Lr(t,e,n,i),e.child}var Gr,$r,Vr,Xr,Yr={dehydrated:null,treeContext:null,retryLane:0};function Kr(t){return{baseLanes:t,cachePool:null,transitions:null}}function qr(t,e,n){var i,r=e.pendingProps,s=pi.current,o=!1,l=0!=(128&e.flags);if((i=l)||(i=(null===t||null!==t.memoizedState)&&0!=(2&s)),i?(o=!0,e.flags&=-129):null!==t&&null===t.memoizedState||(s|=1),he(pi,1&s),null===t)return _n(e),null!==(t=e.memoizedState)&&null!==(t=t.dehydrated)?(0==(1&e.mode)?e.lanes=1:Ut(t)?e.lanes=8:e.lanes=1073741824,null):(l=r.children,t=r.fallback,o?(r=e.mode,o=e.child,l={mode:"hidden",children:l},0==(1&r)&&null!==o?(o.childLanes=0,o.pendingProps=l):o=ho(l,r,0,null),t=lo(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=Kr(n),e.memoizedState=Yr,t):Qr(e,l));if(null!==(s=t.memoizedState)&&null!==(i=s.dehydrated))return function(t,e,n,i,r,s,o){if(n)return 256&e.flags?(e.flags&=-257,Zr(t,e,o,i=wr(Error(a(422))))):null!==e.memoizedState?(e.child=t.child,e.flags|=128,null):(s=i.fallback,r=e.mode,i=ho({mode:"visible",children:i.children},r,0,null),(s=lo(s,r,o,null)).flags|=2,i.return=e,s.return=e,i.sibling=s,e.child=i,0!=(1&e.mode)&&Rn(e,t.child,null,o),e.child.memoizedState=Kr(o),e.memoizedState=Yr,s);if(0==(1&e.mode))return Zr(t,e,o,null);if(Ut(r))return i=Dt(r).digest,Zr(t,e,o,i=wr(s=Error(a(419)),i,void 0));if(n=0!=(o&t.childLanes),Or||n){if(null!==(i=ea)){switch(o&-o){case 4:r=2;break;case 16:r=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:r=32;break;case 536870912:r=268435456;break;default:r=0}0!==(r=0!=(r&(i.suspendedLanes|o))?0:r)&&r!==s.retryLane&&(s.retryLane=r,Kn(t,r),Pa(i,t,r,-1))}return ja(),Zr(t,e,o,i=wr(Error(a(421))))}return Nt(r)?(e.flags|=128,e.child=t.child,e=to.bind(null,t),zt(r,e),null):(t=s.treeContext,q&&(pn=Ht(r),fn=e,gn=!0,bn=null,mn=!1,null!==t&&(rn[sn++]=on,rn[sn++]=ln,rn[sn++]=an,on=t.id,ln=t.overflow,an=e)),(e=Qr(e,i.children)).flags|=4096,e)}(t,e,l,r,i,s,n);if(o){o=r.fallback,l=e.mode,i=(s=t.child).sibling;var h={mode:"hidden",children:r.children};return 0==(1&l)&&e.child!==s?((r=e.child).childLanes=0,r.pendingProps=h,e.deletions=null):(r=ao(s,h)).subtreeFlags=14680064&s.subtreeFlags,null!==i?o=ao(i,o):(o=lo(o,l,n,null)).flags|=2,o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,l=null===(l=t.child.memoizedState)?Kr(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=t.childLanes&~n,e.memoizedState=Yr,r}return t=(o=t.child).sibling,r=ao(o,{mode:"visible",children:r.children}),0==(1&e.mode)&&(r.lanes=n),r.return=e,r.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Qr(t,e){return(e=ho({mode:"visible",children:e},t.mode,0,null)).return=t,t.child=e}function Zr(t,e,n,i){return null!==i&&Bn(i),Rn(e,t.child,null,n),(t=Qr(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function Jr(t,e,n){t.lanes|=e;var i=t.alternate;null!==i&&(i.lanes|=e),Hn(t.return,e,n)}function ts(t,e,n,i,r){var s=t.memoizedState;null===s?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function es(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(Lr(t,e,i.children,n),0!=(2&(i=pi.current)))i=1&i|2,e.flags|=128;else{if(null!==t&&0!=(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&Jr(t,n,e);else if(19===t.tag)Jr(t,n,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}i&=1}if(he(pi,i),0==(1&e.mode))e.memoizedState=null;else switch(r){case"forwards":for(n=e.child,r=null;null!==n;)null!==(t=n.alternate)&&null===gi(t)&&(r=n),n=n.sibling;null===(n=r)?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),ts(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;null!==r;){if(null!==(t=r.alternate)&&null===gi(t)){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}ts(e,!0,n,null,s);break;case"together":ts(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ns(t,e){0==(1&e.mode)&&null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2)}function is(t,e,n){if(null!==t&&(e.dependencies=t.dependencies),la|=e.lanes,0==(n&e.childLanes))return null;if(null!==t&&e.child!==t.child)throw Error(a(153));if(null!==e.child){for(n=ao(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=ao(t,t.pendingProps)).return=e;n.sibling=null}return e.child}function rs(t){t.flags|=4}function ss(t,e){if(null!==t&&t.child===e.child)return!0;if(0!=(16&e.flags))return!1;for(t=e.child;null!==t;){if(0!=(12854&t.flags)||0!=(12854&t.subtreeFlags))return!1;t=t.sibling}return!0}if(Y)Gr=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)z(t,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},$r=function(){},Vr=function(t,e,n,i,r){if((t=t.memoizedProps)!==i){var s=e.stateNode,a=hi(ai.current);n=F(s,n,t,i,r,a),(e.updateQueue=n)&&rs(e)}},Xr=function(t,e,n,i){n!==i&&rs(e)};else if(K){Gr=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),z(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),z(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),Gr(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};var as=function(t,e,n,i){for(var r=e.child;null!==r;){if(5===r.tag){var s=r.stateNode;n&&i&&(s=Et(s,r.type,r.memoizedProps,r)),kt(t,s)}else if(6===r.tag)s=r.stateNode,n&&i&&(s=Ot(s,r.memoizedProps,r)),kt(t,s);else if(4!==r.tag)if(22===r.tag&&null!==r.memoizedState)null!==(s=r.child)&&(s.return=r),as(t,r,!0,!0);else if(null!==r.child){r.child.return=r,r=r.child;continue}if(r===e)break;for(;null===r.sibling;){if(null===r.return||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};$r=function(t,e){var n=e.stateNode;if(!ss(t,e)){t=n.containerInfo;var i=Ct(t);as(i,e,!1,!1),n.pendingChildren=i,rs(e),Mt(t,i)}},Vr=function(t,e,n,i,r){var s=t.stateNode,a=t.memoizedProps;if((t=ss(t,e))&&a===i)e.stateNode=s;else{var o=e.stateNode,l=hi(ai.current),h=null;a!==i&&(h=F(o,n,a,i,r,l)),t&&null===h?e.stateNode=s:(s=Bt(s,h,n,a,i,e,t,o),W(s,n,i,r,l)&&rs(e),e.stateNode=s,t?rs(e):Gr(s,e,!1,!1))}},Xr=function(t,e,n,i){n!==i?(t=hi(li.current),n=hi(ai.current),e.stateNode=H(i,t,n,e),rs(e)):e.stateNode=t.stateNode}}else $r=function(){},Vr=function(){},Xr=function(){};function os(t,e){if(!gn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?e||null===t.tail?t.tail=null:t.tail.sibling=null:i.sibling=null}}function ls(t){var e=null!==t.alternate&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=14680064&r.subtreeFlags,i|=14680064&r.flags,r.return=t,r=r.sibling;else for(r=t.child;null!==r;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function hs(t,e,n){var i=e.pendingProps;switch(dn(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ls(e),null;case 1:case 17:return ge(e.type)&&me(),ls(e),null;case 3:return n=e.stateNode,ci(),le(de),le(ce),bi(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==t&&null!==t.child||(An(e)?rs(e):null===t||t.memoizedState.isDehydrated&&0==(256&e.flags)||(e.flags|=1024,null!==bn&&(Ra(bn),bn=null))),$r(t,e),ls(e),null;case 5:fi(e),n=hi(li.current);var r=e.type;if(null!==t&&null!=e.stateNode)Vr(t,e,r,i,n),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(null===e.stateNode)throw Error(a(166));return ls(e),null}if(t=hi(ai.current),An(e)){if(!q)throw Error(a(175));t=Gt(e.stateNode,e.type,e.memoizedProps,n,t,e,!mn),e.updateQueue=t,null!==t&&rs(e)}else{var s=D(r,i,n,t,e);Gr(s,e,!1,!1),e.stateNode=s,W(s,r,i,n,t)&&rs(e)}null!==e.ref&&(e.flags|=512,e.flags|=2097152)}return ls(e),null;case 6:if(t&&null!=e.stateNode)Xr(t,e,t.memoizedProps,i);else{if("string"!=typeof i&&null===e.stateNode)throw Error(a(166));if(t=hi(li.current),n=hi(ai.current),An(e)){if(!q)throw Error(a(176));if(t=e.stateNode,n=e.memoizedProps,(i=$t(t,n,e,!mn))&&null!==(r=fn))switch(r.tag){case 3:Jt(r.stateNode.containerInfo,t,n,0!=(1&r.mode));break;case 5:te(r.type,r.memoizedProps,r.stateNode,t,n,0!=(1&r.mode))}i&&rs(e)}else e.stateNode=H(i,t,n,e)}return ls(e),null;case 13:if(le(pi),i=e.memoizedState,null===t||null!==t.memoizedState&&null!==t.memoizedState.dehydrated){if(gn&&null!==pn&&0!=(1&e.mode)&&0==(128&e.flags))wn(),Tn(),e.flags|=98560,r=!1;else if(r=An(e),null!==i&&null!==i.dehydrated){if(null===t){if(!r)throw Error(a(318));if(!q)throw Error(a(344));if(!(r=null!==(r=e.memoizedState)?r.dehydrated:null))throw Error(a(317));Vt(r,e)}else Tn(),0==(128&e.flags)&&(e.memoizedState=null),e.flags|=4;ls(e),r=!1}else null!==bn&&(Ra(bn),bn=null),r=!0;if(!r)return 65536&e.flags?e:null}return 0!=(128&e.flags)?(e.lanes=n,e):((n=null!==i)!=(null!==t&&null!==t.memoizedState)&&n&&(e.child.flags|=8192,0!=(1&e.mode)&&(null===t||0!=(1&pi.current)?0===aa&&(aa=3):ja())),null!==e.updateQueue&&(e.flags|=4),ls(e),null);case 4:return ci(),$r(t,e),null===t&&Z(e.stateNode.containerInfo),ls(e),null;case 10:return jn(e.type._context),ls(e),null;case 19:if(le(pi),null===(r=e.memoizedState))return ls(e),null;if(i=0!=(128&e.flags),null===(s=r.rendering))if(i)os(r,!1);else{if(0!==aa||null!==t&&0!=(128&t.flags))for(t=e.child;null!==t;){if(null!==(s=gi(t))){for(e.flags|=128,os(r,!1),null!==(t=s.updateQueue)&&(e.updateQueue=t,e.flags|=4),e.subtreeFlags=0,t=n,n=e.child;null!==n;)r=t,(i=n).flags&=14680066,null===(s=i.alternate)?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,r=s.dependencies,i.dependencies=null===r?null:{lanes:r.lanes,firstContext:r.firstContext}),n=n.sibling;return he(pi,1&pi.current|2),e.child}t=t.sibling}null!==r.tail&&We()>pa&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304)}else{if(!i)if(null!==(t=gi(s))){if(e.flags|=128,i=!0,null!==(t=t.updateQueue)&&(e.updateQueue=t,e.flags|=4),os(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate&&!gn)return ls(e),null}else 2*We()-r.renderingStartTime>pa&&1073741824!==n&&(e.flags|=128,i=!0,os(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(null!==(t=r.last)?t.sibling=s:e.child=s,r.last=s)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=We(),e.sibling=null,t=pi.current,he(pi,i?1&t|2:1&t),e):(ls(e),null);case 22:case 23:return Da(),n=null!==e.memoizedState,null!==t&&null!==t.memoizedState!==n&&(e.flags|=8192),n&&0!=(1&e.mode)?0!=(1073741824&ra)&&(ls(e),Y&&6&e.subtreeFlags&&(e.flags|=8192)):ls(e),null;case 24:case 25:return null}throw Error(a(156,e.tag))}function us(t,e){switch(dn(e),e.tag){case 1:return ge(e.type)&&me(),65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 3:return ci(),le(de),le(ce),bi(),0!=(65536&(t=e.flags))&&0==(128&t)?(e.flags=-65537&t|128,e):null;case 5:return fi(e),null;case 13:if(le(pi),null!==(t=e.memoizedState)&&null!==t.dehydrated){if(null===e.alternate)throw Error(a(340));Tn()}return 65536&(t=e.flags)?(e.flags=-65537&t|128,e):null;case 19:return le(pi),null;case 4:return ci(),null;case 10:return jn(e.type._context),null;case 22:case 23:return Da(),null;default:return null}}var cs=!1,ds=!1,fs="function"==typeof WeakSet?WeakSet:Set,ps=null;function gs(t,e){var n=t.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){Qa(t,e,n)}else n.current=null}function ms(t,e,n){try{n()}catch(n){Qa(t,e,n)}}var bs=!1;function ys(t,e,n){var i=e.updateQueue;if(null!==(i=null!==i?i.lastEffect:null)){var r=i=i.next;do{if((r.tag&t)===t){var s=r.destroy;r.destroy=void 0,void 0!==s&&ms(e,n,s)}r=r.next}while(r!==i)}}function vs(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==e)}}function xs(t){var e=t.ref;if(null!==e){var n=t.stateNode;t=5===t.tag?L(n):n,"function"==typeof e?e(t):e.current=t}}function _s(t){var e=t.alternate;null!==e&&(t.alternate=null,_s(e)),t.child=null,t.deletions=null,t.sibling=null,5===t.tag&&null!==(e=t.stateNode)&&tt(e),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Ss(t){return 5===t.tag||3===t.tag||4===t.tag}function As(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||Ss(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;5!==t.tag&&6!==t.tag&&18!==t.tag;){if(2&t.flags)continue t;if(null===t.child||4===t.tag)continue t;t.child.return=t,t=t.child}if(!(2&t.flags))return t.stateNode}}function ws(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?bt(n,t,e):dt(n,t);else if(4!==i&&null!==(t=t.child))for(ws(t,e,n),t=t.sibling;null!==t;)ws(t,e,n),t=t.sibling}function Ts(t,e,n){var i=t.tag;if(5===i||6===i)t=t.stateNode,e?mt(n,t,e):ct(n,t);else if(4!==i&&null!==(t=t.child))for(Ts(t,e,n),t=t.sibling;null!==t;)Ts(t,e,n),t=t.sibling}var Bs=null,Cs=!1;function ks(t,e,n){for(n=n.child;null!==n;)Ms(t,e,n),n=n.sibling}function Ms(t,e,n){if(Ve&&"function"==typeof Ve.onCommitFiberUnmount)try{Ve.onCommitFiberUnmount($e,n)}catch(t){}switch(n.tag){case 5:ds||gs(n,e);case 6:if(Y){var i=Bs,r=Cs;Bs=null,ks(t,e,n),Cs=r,null!==(Bs=i)&&(Cs?vt(Bs,n.stateNode):yt(Bs,n.stateNode))}else ks(t,e,n);break;case 18:Y&&null!==Bs&&(Cs?Qt(Bs,n.stateNode):qt(Bs,n.stateNode));break;case 4:Y?(i=Bs,r=Cs,Bs=n.stateNode.containerInfo,Cs=!0,ks(t,e,n),Bs=i,Cs=r):(K&&(i=n.stateNode.containerInfo,r=Ct(i),Pt(i,r)),ks(t,e,n));break;case 0:case 11:case 14:case 15:if(!ds&&null!==(i=n.updateQueue)&&null!==(i=i.lastEffect)){r=i=i.next;do{var s=r,a=s.destroy;s=s.tag,void 0!==a&&(0!=(2&s)||0!=(4&s))&&ms(n,e,a),r=r.next}while(r!==i)}ks(t,e,n);break;case 1:if(!ds&&(gs(n,e),"function"==typeof(i=n.stateNode).componentWillUnmount))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(t){Qa(n,e,t)}ks(t,e,n);break;case 21:ks(t,e,n);break;case 22:1&n.mode?(ds=(i=ds)||null!==n.memoizedState,ks(t,e,n),ds=i):ks(t,e,n);break;default:ks(t,e,n)}}function Ps(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new fs),e.forEach((function(e){var i=eo.bind(null,t,e);n.has(e)||(n.add(e),e.then(i,i))}))}}function Es(t,e){var n=e.deletions;if(null!==n)for(var i=0;i<n.length;i++){var r=n[i];try{var s=t,o=e;if(Y){var l=o;t:for(;null!==l;){switch(l.tag){case 5:Bs=l.stateNode,Cs=!1;break t;case 3:case 4:Bs=l.stateNode.containerInfo,Cs=!0;break t}l=l.return}if(null===Bs)throw Error(a(160));Ms(s,o,r),Bs=null,Cs=!1}else Ms(s,o,r);var h=r.alternate;null!==h&&(h.return=null),r.return=null}catch(t){Qa(r,e,t)}}if(12854&e.subtreeFlags)for(e=e.child;null!==e;)Os(e,t),e=e.sibling}function Os(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Es(e,t),Ls(t),4&i){try{ys(3,t,t.return),vs(3,t)}catch(e){Qa(t,t.return,e)}try{ys(5,t,t.return)}catch(e){Qa(t,t.return,e)}}break;case 1:Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return);break;case 5:if(Es(e,t),Ls(t),512&i&&null!==n&&gs(n,n.return),Y){if(32&t.flags){var r=t.stateNode;try{xt(r)}catch(e){Qa(t,t.return,e)}}if(4&i&&null!=(r=t.stateNode)){var s=t.memoizedProps;if(n=null!==n?n.memoizedProps:s,i=t.type,e=t.updateQueue,t.updateQueue=null,null!==e)try{gt(r,e,i,n,s,t)}catch(e){Qa(t,t.return,e)}}}break;case 6:if(Es(e,t),Ls(t),4&i&&Y){if(null===t.stateNode)throw Error(a(162));r=t.stateNode,s=t.memoizedProps,n=null!==n?n.memoizedProps:s;try{ft(r,n,s)}catch(e){Qa(t,t.return,e)}}break;case 3:if(Es(e,t),Ls(t),4&i){if(Y&&q&&null!==n&&n.memoizedState.isDehydrated)try{Yt(e.containerInfo)}catch(e){Qa(t,t.return,e)}if(K){r=e.containerInfo,s=e.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}}break;case 4:if(Es(e,t),Ls(t),4&i&&K){r=(s=t.stateNode).containerInfo,s=s.pendingChildren;try{Pt(r,s)}catch(e){Qa(t,t.return,e)}}break;case 13:Es(e,t),Ls(t),8192&(r=t.child).flags&&(s=null!==r.memoizedState,r.stateNode.isHidden=s,!s||null!==r.alternate&&null!==r.alternate.memoizedState||(fa=We())),4&i&&Ps(t);break;case 22:var o=null!==n&&null!==n.memoizedState;if(1&t.mode?(ds=(n=ds)||o,Es(e,t),ds=n):Es(e,t),Ls(t),8192&i){if(n=null!==t.memoizedState,(t.stateNode.isHidden=n)&&!o&&0!=(1&t.mode))for(ps=t,i=t.child;null!==i;){for(e=ps=i;null!==ps;){var l=(o=ps).child;switch(o.tag){case 0:case 11:case 14:case 15:ys(4,o,o.return);break;case 1:gs(o,o.return);var h=o.stateNode;if("function"==typeof h.componentWillUnmount){var u=o,c=o.return;try{var d=u;h.props=d.memoizedProps,h.state=d.memoizedState,h.componentWillUnmount()}catch(t){Qa(u,c,t)}}break;case 5:gs(o,o.return);break;case 22:if(null!==o.memoizedState){Us(e);continue}}null!==l?(l.return=o,ps=l):Us(e)}i=i.sibling}if(Y)t:if(i=null,Y)for(e=t;;){if(5===e.tag){if(null===i){i=e;try{r=e.stateNode,n?_t(r):At(e.stateNode,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}}else if(6===e.tag){if(null===i)try{s=e.stateNode,n?St(s):wt(s,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}else if((22!==e.tag&&23!==e.tag||null===e.memoizedState||e===t)&&null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;null===e.sibling;){if(null===e.return||e.return===t)break t;i===e&&(i=null),e=e.return}i===e&&(i=null),e.sibling.return=e.return,e=e.sibling}}break;case 19:Es(e,t),Ls(t),4&i&&Ps(t);break;case 21:break;default:Es(e,t),Ls(t)}}function Ls(t){var e=t.flags;if(2&e){try{if(Y){t:{for(var n=t.return;null!==n;){if(Ss(n)){var i=n;break t}n=n.return}throw Error(a(160))}switch(i.tag){case 5:var r=i.stateNode;32&i.flags&&(xt(r),i.flags&=-33),Ts(t,As(t),r);break;case 3:case 4:var s=i.stateNode.containerInfo;ws(t,As(t),s);break;default:throw Error(a(161))}}}catch(e){Qa(t,t.return,e)}t.flags&=-3}4096&e&&(t.flags&=-4097)}function Rs(t,e,n){ps=t,Is(t)}function Is(t,e,n){for(var i=0!=(1&t.mode);null!==ps;){var r=ps,s=r.child;if(22===r.tag&&i){var a=null!==r.memoizedState||cs;if(!a){var o=r.alternate,l=null!==o&&null!==o.memoizedState||ds;o=cs;var h=ds;if(cs=a,(ds=l)&&!h)for(ps=r;null!==ps;)l=(a=ps).child,22===a.tag&&null!==a.memoizedState?Ds(r):null!==l?(l.return=a,ps=l):Ds(r);for(;null!==s;)ps=s,Is(s),s=s.sibling;ps=r,cs=o,ds=h}Ns(t)}else 0!=(8772&r.subtreeFlags)&&null!==s?(s.return=r,ps=s):Ns(t)}}function Ns(t){for(;null!==ps;){var e=ps;if(0!=(8772&e.flags)){var n=e.alternate;try{if(0!=(8772&e.flags))switch(e.tag){case 0:case 11:case 15:ds||vs(5,e);break;case 1:var i=e.stateNode;if(4&e.flags&&!ds)if(null===n)i.componentDidMount();else{var r=e.elementType===e.type?n.memoizedProps:mr(e.type,n.memoizedProps);i.componentDidUpdate(r,n.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;null!==s&&ri(e,s,i);break;case 3:var o=e.updateQueue;if(null!==o){if(n=null,null!==e.child)switch(e.child.tag){case 5:n=L(e.child.stateNode);break;case 1:n=e.child.stateNode}ri(e,o,n)}break;case 5:var l=e.stateNode;null===n&&4&e.flags&&pt(l,e.type,e.memoizedProps,e);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(q&&null===e.memoizedState){var h=e.alternate;if(null!==h){var u=h.memoizedState;if(null!==u){var c=u.dehydrated;null!==c&&Kt(c)}}}break;default:throw Error(a(163))}ds||512&e.flags&&xs(e)}catch(t){Qa(e,e.return,t)}}if(e===t){ps=null;break}if(null!==(n=e.sibling)){n.return=e.return,ps=n;break}ps=e.return}}function Us(t){for(;null!==ps;){var e=ps;if(e===t){ps=null;break}var n=e.sibling;if(null!==n){n.return=e.return,ps=n;break}ps=e.return}}function Ds(t){for(;null!==ps;){var e=ps;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{vs(4,e)}catch(t){Qa(e,n,t)}break;case 1:var i=e.stateNode;if("function"==typeof i.componentDidMount){var r=e.return;try{i.componentDidMount()}catch(t){Qa(e,r,t)}}var s=e.return;try{xs(e)}catch(t){Qa(e,s,t)}break;case 5:var a=e.return;try{xs(e)}catch(t){Qa(e,a,t)}}}catch(t){Qa(e,e.return,t)}if(e===t){ps=null;break}var o=e.sibling;if(null!==o){o.return=e.return,ps=o;break}ps=e.return}}var zs=0,Ws=1,Fs=2,js=3,Hs=4;if("function"==typeof Symbol&&Symbol.for){var Gs=Symbol.for;zs=Gs("selector.component"),Ws=Gs("selector.has_pseudo_class"),Fs=Gs("selector.role"),js=Gs("selector.test_id"),Hs=Gs("selector.text")}function $s(t){var e=Q(t);if(null!=e){if("string"!=typeof e.memoizedProps["data-testname"])throw Error(a(364));return e}if(null===(t=rt(t)))throw Error(a(362));return t.stateNode.current}function Vs(t,e){switch(e.$$typeof){case zs:if(t.type===e.value)return!0;break;case Ws:t:{e=e.value,t=[t,0];for(var n=0;n<t.length;){var i=t[n++],r=t[n++],s=e[r];if(5!==i.tag||!ot(i)){for(;null!=s&&Vs(i,s);)s=e[++r];if(r===e.length){e=!0;break t}for(i=i.child;null!==i;)t.push(i,r),i=i.sibling}}e=!1}return e;case Fs:if(5===t.tag&<(t.stateNode,e.value))return!0;break;case Hs:if((5===t.tag||6===t.tag)&&null!==(t=at(t))&&0<=t.indexOf(e.value))return!0;break;case js:if(5===t.tag&&"string"==typeof(t=t.memoizedProps["data-testname"])&&t.toLowerCase()===e.value.toLowerCase())return!0;break;default:throw Error(a(365))}return!1}function Xs(t){switch(t.$$typeof){case zs:return"<"+(A(t.value)||"Unknown")+">";case Ws:return":has("+(Xs(t)||"")+")";case Fs:return'[role="'+t.value+'"]';case Hs:return'"'+t.value+'"';case js:return'[data-testname="'+t.value+'"]';default:throw Error(a(365))}}function Ys(t,e){var n=[];t=[t,0];for(var i=0;i<t.length;){var r=t[i++],s=t[i++],a=e[s];if(5!==r.tag||!ot(r)){for(;null!=a&&Vs(r,a);)a=e[++s];if(s===e.length)n.push(r);else for(r=r.child;null!==r;)t.push(r,s),r=r.sibling}}return n}function Ks(t,e){if(!it)throw Error(a(363));t=Ys(t=$s(t),e),e=[],t=Array.from(t);for(var n=0;n<t.length;){var i=t[n++];if(5===i.tag)ot(i)||e.push(i.stateNode);else for(i=i.child;null!==i;)t.push(i),i=i.sibling}return e}var qs=Math.ceil,Qs=o.ReactCurrentDispatcher,Zs=o.ReactCurrentOwner,Js=o.ReactCurrentBatchConfig,ta=0,ea=null,na=null,ia=0,ra=0,sa=oe(0),aa=0,oa=null,la=0,ha=0,ua=0,ca=null,da=null,fa=0,pa=1/0,ga=null;function ma(){pa=We()+500}var ba,ya=!1,va=null,xa=null,_a=!1,Sa=null,Aa=0,wa=0,Ta=null,Ba=-1,Ca=0;function ka(){return 0!=(6&ta)?We():-1!==Ba?Ba:Ba=We()}function Ma(t){return 0==(1&t.mode)?1:0!=(2&ta)&&0!==ia?ia&-ia:null!==Cn.transition?(0===Ca&&(Ca=Pe()),Ca):0!==(t=Re)?t:J()}function Pa(t,e,n,i){if(50<wa)throw wa=0,Ta=null,Error(a(185));Oe(t,n,i),0!=(2&ta)&&t===ea||(t===ea&&(0==(2&ta)&&(ha|=n),4===aa&&Ia(t,ia)),Ea(t,i),1===n&&0===ta&&0==(1&e.mode)&&(ma(),Ke&&Ze()))}function Ea(t,e){var n=t.callbackNode;!function(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes;0<s;){var a=31-_e(s),o=1<<a,l=r[a];-1===l?0!=(o&n)&&0==(o&i)||(r[a]=ke(o,e)):l<=e&&(t.expiredLanes|=o),s&=~o}}(t,e);var i=Ce(t,t===ea?ia:0);if(0===i)null!==n&&Ue(n),t.callbackNode=null,t.callbackPriority=0;else if(e=i&-i,t.callbackPriority!==e){if(null!=n&&Ue(n),1===e)0===t.tag?function(t){Ke=!0,Qe(t)}(Na.bind(null,t)):Qe(Na.bind(null,t)),et?nt((function(){0==(6&ta)&&Ze()})):Ne(Fe,Ze),n=null;else{switch(Ie(i)){case 1:n=Fe;break;case 4:n=je;break;case 16:default:n=He;break;case 536870912:n=Ge}n=no(n,Oa.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function Oa(t,e){if(Ba=-1,Ca=0,0!=(6&ta))throw Error(a(327));var n=t.callbackNode;if(Ka()&&t.callbackNode!==n)return null;var i=Ce(t,t===ea?ia:0);if(0===i)return null;if(0!=(30&i)||0!=(i&t.expiredLanes)||e)e=Ha(t,i);else{e=i;var r=ta;ta|=2;var s=Fa();for(ea===t&&ia===e||(ga=null,ma(),za(t,e));;)try{$a();break}catch(e){Wa(t,e)}Wn(),Qs.current=s,ta=r,null!==na?e=0:(ea=null,ia=0,e=aa)}if(0!==e){if(2===e&&0!==(r=Me(t))&&(i=r,e=La(t,r)),1===e)throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;if(6===e)Ia(t,i);else{if(r=t.current.alternate,0==(30&i)&&!function(t){for(var e=t;;){if(16384&e.flags){var n=e.updateQueue;if(null!==n&&null!==(n=n.stores))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!Xe(s(),r))return!1}catch(t){return!1}}}if(n=e.child,16384&e.subtreeFlags&&null!==n)n.return=e,e=n;else{if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}(r)&&(2===(e=Ha(t,i))&&0!==(s=Me(t))&&(i=s,e=La(t,s)),1===e))throw n=oa,za(t,0),Ia(t,i),Ea(t,We()),n;switch(t.finishedWork=r,t.finishedLanes=i,e){case 0:case 1:throw Error(a(345));case 2:case 5:Ya(t,da,ga);break;case 3:if(Ia(t,i),(130023424&i)===i&&10<(e=fa+500-We())){if(0!==Ce(t,0))break;if(((r=t.suspendedLanes)&i)!==i){ka(),t.pingedLanes|=t.suspendedLanes&r;break}t.timeoutHandle=G(Ya.bind(null,t,da,ga),e);break}Ya(t,da,ga);break;case 4:if(Ia(t,i),(4194240&i)===i)break;for(e=t.eventTimes,r=-1;0<i;){var o=31-_e(i);s=1<<o,(o=e[o])>r&&(r=o),i&=~s}if(i=r,10<(i=(120>(i=We()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*qs(i/1960))-i)){t.timeoutHandle=G(Ya.bind(null,t,da,ga),i);break}Ya(t,da,ga);break;default:throw Error(a(329))}}}return Ea(t,We()),t.callbackNode===n?Oa.bind(null,t):null}function La(t,e){var n=ca;return t.current.memoizedState.isDehydrated&&(za(t,e).flags|=256),2!==(t=Ha(t,e))&&(e=da,da=n,null!==e&&Ra(e)),t}function Ra(t){null===da?da=t:da.push.apply(da,t)}function Ia(t,e){for(e&=~ua,e&=~ha,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-_e(e),i=1<<n;t[n]=-1,e&=~i}}function Na(t){if(0!=(6&ta))throw Error(a(327));Ka();var e=Ce(t,0);if(0==(1&e))return Ea(t,We()),null;var n=Ha(t,e);if(0!==t.tag&&2===n){var i=Me(t);0!==i&&(e=i,n=La(t,i))}if(1===n)throw n=oa,za(t,0),Ia(t,e),Ea(t,We()),n;if(6===n)throw Error(a(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ya(t,da,ga),Ea(t,We()),null}function Ua(t){null!==Sa&&0===Sa.tag&&0==(6&ta)&&Ka();var e=ta;ta|=1;var n=Js.transition,i=Re;try{if(Js.transition=null,Re=1,t)return t()}finally{Re=i,Js.transition=n,0==(6&(ta=e))&&Ze()}}function Da(){ra=sa.current,le(sa)}function za(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==V&&(t.timeoutHandle=V,$(n)),null!==na)for(n=na.return;null!==n;){var i=n;switch(dn(i),i.tag){case 1:null!=(i=i.type.childContextTypes)&&me();break;case 3:ci(),le(de),le(ce),bi();break;case 5:fi(i);break;case 4:ci();break;case 13:case 19:le(pi);break;case 10:jn(i.type._context);break;case 22:case 23:Da()}n=n.return}if(ea=t,na=t=ao(t.current,null),ia=ra=e,aa=0,oa=null,ua=ha=la=0,da=ca=null,null!==Vn){for(e=0;e<Vn.length;e++)if(null!==(i=(n=Vn[e]).interleaved)){n.interleaved=null;var r=i.next,s=n.pending;if(null!==s){var a=s.next;s.next=r,i.next=a}n.pending=i}Vn=null}return t}function Wa(t,e){for(;;){var n=na;try{if(Wn(),yi.current=dr,wi){for(var i=_i.memoizedState;null!==i;){var r=i.queue;null!==r&&(r.pending=null),i=i.next}wi=!1}if(xi=0,Ai=Si=_i=null,Ti=!1,Bi=0,Zs.current=null,null===n||null===n.return){aa=1,oa=e,na=null;break}t:{var s=t,o=n.return,l=n,h=e;if(e=ia,l.flags|=32768,null!==h&&"object"==typeof h&&"function"==typeof h.then){var u=h,c=l,d=c.tag;if(0==(1&c.mode)&&(0===d||11===d||15===d)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Mr(o);if(null!==p){p.flags&=-257,Pr(p,o,l,0,e),1&p.mode&&kr(s,u,e),h=u;var g=(e=p).updateQueue;if(null===g){var m=new Set;m.add(h),e.updateQueue=m}else g.add(h);break t}if(0==(1&e)){kr(s,u,e),ja();break t}h=Error(a(426))}else if(gn&&1&l.mode){var b=Mr(o);if(null!==b){0==(65536&b.flags)&&(b.flags|=256),Pr(b,o,l,0,e),Bn(Ar(h,l));break t}}s=h=Ar(h,l),4!==aa&&(aa=2),null===ca?ca=[s]:ca.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Br(0,h,e));break t;case 1:l=h;var y=s.type,v=s.stateNode;if(0==(128&s.flags)&&("function"==typeof y.getDerivedStateFromError||null!==v&&"function"==typeof v.componentDidCatch&&(null===xa||!xa.has(v)))){s.flags|=65536,e&=-e,s.lanes|=e,ni(s,Cr(s,l,e));break t}}s=s.return}while(null!==s)}Xa(n)}catch(t){e=t,na===n&&null!==n&&(na=n=n.return);continue}break}}function Fa(){var t=Qs.current;return Qs.current=dr,null===t?dr:t}function ja(){0!==aa&&3!==aa&&2!==aa||(aa=4),null===ea||0==(268435455&la)&&0==(268435455&ha)||Ia(ea,ia)}function Ha(t,e){var n=ta;ta|=2;var i=Fa();for(ea===t&&ia===e||(ga=null,za(t,e));;)try{Ga();break}catch(e){Wa(t,e)}if(Wn(),ta=n,Qs.current=i,null!==na)throw Error(a(261));return ea=null,ia=0,aa}function Ga(){for(;null!==na;)Va(na)}function $a(){for(;null!==na&&!De();)Va(na)}function Va(t){var e=ba(t.alternate,t,ra);t.memoizedProps=t.pendingProps,null===e?Xa(t):na=e,Zs.current=null}function Xa(t){var e=t;do{var n=e.alternate;if(t=e.return,0==(32768&e.flags)){if(null!==(n=hs(n,e,ra)))return void(na=n)}else{if(null!==(n=us(n,e)))return n.flags&=32767,void(na=n);if(null===t)return aa=6,void(na=null);t.flags|=32768,t.subtreeFlags=0,t.deletions=null}if(null!==(e=e.sibling))return void(na=e);na=e=t}while(null!==e);0===aa&&(aa=5)}function Ya(t,e,n){var i=Re,r=Js.transition;try{Js.transition=null,Re=1,function(t,e,n,i){do{Ka()}while(null!==Sa);if(0!=(6&ta))throw Error(a(327));n=t.finishedWork;var r=t.finishedLanes;if(null===n)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(a(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(function(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0<n;){var r=31-_e(n),s=1<<r;e[r]=0,i[r]=-1,t[r]=-1,n&=~s}}(t,s),t===ea&&(na=ea=null,ia=0),0==(2064&n.subtreeFlags)&&0==(2064&n.flags)||_a||(_a=!0,no(He,(function(){return Ka(),null}))),s=0!=(15990&n.flags),0!=(15990&n.subtreeFlags)||s){s=Js.transition,Js.transition=null;var o=Re;Re=1;var l=ta;ta|=4,Zs.current=null,function(t,e){for(N(t.containerInfo),ps=e;null!==ps;)if(e=(t=ps).child,0!=(1028&t.subtreeFlags)&&null!==e)e.return=t,ps=e;else for(;null!==ps;){t=ps;try{var n=t.alternate;if(0!=(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==n){var i=n.memoizedProps,r=n.memoizedState,s=t.stateNode,o=s.getSnapshotBeforeUpdate(t.elementType===t.type?i:mr(t.type,i),r);s.__reactInternalSnapshotBeforeUpdate=o}break;case 3:Y&&Tt(t.stateNode.containerInfo);break;default:throw Error(a(163))}}catch(e){Qa(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ps=e;break}ps=t.return}n=bs,bs=!1}(t,n),Os(n,t),U(t.containerInfo),t.current=n,Rs(n),ze(),ta=l,Re=o,Js.transition=s}else t.current=n;if(_a&&(_a=!1,Sa=t,Aa=r),0===(s=t.pendingLanes)&&(xa=null),function(t){if(Ve&&"function"==typeof Ve.onCommitFiberRoot)try{Ve.onCommitFiberRoot($e,t,void 0,128==(128&t.current.flags))}catch(t){}}(n.stateNode),Ea(t,We()),null!==e)for(i=t.onRecoverableError,n=0;n<e.length;n++)i((r=e[n]).value,{componentStack:r.stack,digest:r.digest});if(ya)throw ya=!1,t=va,va=null,t;0!=(1&Aa)&&0!==t.tag&&Ka(),0!=(1&(s=t.pendingLanes))?t===Ta?wa++:(wa=0,Ta=t):wa=0,Ze()}(t,e,n,i)}finally{Js.transition=r,Re=i}return null}function Ka(){if(null!==Sa){var t=Ie(Aa),e=Js.transition,n=Re;try{if(Js.transition=null,Re=16>t?16:t,null===Sa)var i=!1;else{if(t=Sa,Sa=null,Aa=0,0!=(6&ta))throw Error(a(331));var r=ta;for(ta|=4,ps=t.current;null!==ps;){var s=ps,o=s.child;if(0!=(16&ps.flags)){var l=s.deletions;if(null!==l){for(var h=0;h<l.length;h++){var u=l[h];for(ps=u;null!==ps;){var c=ps;switch(c.tag){case 0:case 11:case 15:ys(8,c,s)}var d=c.child;if(null!==d)d.return=c,ps=d;else for(;null!==ps;){var f=(c=ps).sibling,p=c.return;if(_s(c),c===u){ps=null;break}if(null!==f){f.return=p,ps=f;break}ps=p}}}var g=s.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(null!==m)}}ps=s}}if(0!=(2064&s.subtreeFlags)&&null!==o)o.return=s,ps=o;else t:for(;null!==ps;){if(0!=(2048&(s=ps).flags))switch(s.tag){case 0:case 11:case 15:ys(9,s,s.return)}var y=s.sibling;if(null!==y){y.return=s.return,ps=y;break t}ps=s.return}}var v=t.current;for(ps=v;null!==ps;){var x=(o=ps).child;if(0!=(2064&o.subtreeFlags)&&null!==x)x.return=o,ps=x;else t:for(o=v;null!==ps;){if(0!=(2048&(l=ps).flags))try{switch(l.tag){case 0:case 11:case 15:vs(9,l)}}catch(t){Qa(l,l.return,t)}if(l===o){ps=null;break t}var _=l.sibling;if(null!==_){_.return=l.return,ps=_;break t}ps=l.return}}if(ta=r,Ze(),Ve&&"function"==typeof Ve.onPostCommitFiberRoot)try{Ve.onPostCommitFiberRoot($e,t)}catch(t){}i=!0}return i}finally{Re=n,Js.transition=e}}return!1}function qa(t,e,n){t=ti(t,e=Br(0,e=Ar(n,e),1),1),e=ka(),null!==t&&(Oe(t,1,e),Ea(t,e))}function Qa(t,e,n){if(3===t.tag)qa(t,t,n);else for(;null!==e;){if(3===e.tag){qa(e,t,n);break}if(1===e.tag){var i=e.stateNode;if("function"==typeof e.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===xa||!xa.has(i))){e=ti(e,t=Cr(e,t=Ar(n,t),1),1),t=ka(),null!==e&&(Oe(e,1,t),Ea(e,t));break}}e=e.return}}function Za(t,e,n){var i=t.pingCache;null!==i&&i.delete(e),e=ka(),t.pingedLanes|=t.suspendedLanes&n,ea===t&&(ia&n)===n&&(4===aa||3===aa&&(130023424&ia)===ia&&500>We()-fa?za(t,0):ua|=n),Ea(t,e)}function Ja(t,e){0===e&&(0==(1&t.mode)?e=1:(e=Te,0==(130023424&(Te<<=1))&&(Te=4194304)));var n=ka();null!==(t=Kn(t,e))&&(Oe(t,e,n),Ea(t,n))}function to(t){var e=t.memoizedState,n=0;null!==e&&(n=e.retryLane),Ja(t,n)}function eo(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;null!==r&&(n=r.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(a(314))}null!==i&&i.delete(e),Ja(t,n)}function no(t,e){return Ne(t,e)}function io(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ro(t,e,n,i){return new io(t,e,n,i)}function so(t){return!(!(t=t.prototype)||!t.isReactComponent)}function ao(t,e){var n=t.alternate;return null===n?((n=ro(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&t.flags,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function oo(t,e,n,i,r,s){var o=2;if(i=t,"function"==typeof t)so(t)&&(o=1);else if("string"==typeof t)o=5;else t:switch(t){case u:return lo(n.children,r,s,e);case c:o=8,r|=8;break;case d:return(t=ro(12,n,e,2|r)).elementType=d,t.lanes=s,t;case m:return(t=ro(13,n,e,r)).elementType=m,t.lanes=s,t;case b:return(t=ro(19,n,e,r)).elementType=b,t.lanes=s,t;case x:return ho(n,r,s,e);default:if("object"==typeof t&&null!==t)switch(t.$$typeof){case f:o=10;break t;case p:o=9;break t;case g:o=11;break t;case y:o=14;break t;case v:o=16,i=null;break t}throw Error(a(130,null==t?t:typeof t,""))}return(e=ro(o,n,e,r)).elementType=t,e.type=i,e.lanes=s,e}function lo(t,e,n,i){return(t=ro(7,t,i,e)).lanes=n,t}function ho(t,e,n,i){return(t=ro(22,t,i,e)).elementType=x,t.lanes=n,t.stateNode={isHidden:!1},t}function uo(t,e,n){return(t=ro(6,t,null,e)).lanes=n,t}function co(t,e,n){return(e=ro(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function fo(t,e,n,i,r){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=V,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ee(0),this.expirationTimes=Ee(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ee(0),this.identifierPrefix=i,this.onRecoverableError=r,q&&(this.mutableSourceEagerHydrationData=null)}function po(t,e,n,i,r,s,a,o,l){return t=new fo(t,e,n,o,l),1===e?(e=1,!0===s&&(e|=8)):e=0,s=ro(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qn(s),t}function go(t){if(!t)return ue;t:{if(T(t=t._reactInternals)!==t||1!==t.tag)throw Error(a(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break t;case 1:if(ge(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break t}}e=e.return}while(null!==e);throw Error(a(171))}if(1===t.tag){var n=t.type;if(ge(n))return ye(t,n,e)}return e}function mo(t){var e=t._reactInternals;if(void 0===e){if("function"==typeof t.render)throw Error(a(188));throw t=Object.keys(t).join(","),Error(a(268,t))}return null===(t=k(e))?null:t.stateNode}function bo(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n<e?n:e}}function yo(t,e){bo(t,e),(t=t.alternate)&&bo(t,e)}function vo(t){return null===(t=k(t))?null:t.stateNode}function xo(){return null}return ba=function(t,e,n){if(null!==t)if(t.memoizedProps!==e.pendingProps||de.current)Or=!0;else{if(0==(t.lanes&n)&&0==(128&e.flags))return Or=!1,function(t,e,n){switch(e.tag){case 3:jr(e),Tn();break;case 5:di(e);break;case 1:ge(e.type)&&ve(e);break;case 4:ui(e,e.stateNode.containerInfo);break;case 10:Fn(0,e.type._context,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(null!==i)return null!==i.dehydrated?(he(pi,1&pi.current),e.flags|=128,null):0!=(n&e.child.childLanes)?qr(t,e,n):(he(pi,1&pi.current),null!==(t=is(t,e,n))?t.sibling:null);he(pi,1&pi.current);break;case 19:if(i=0!=(n&e.childLanes),0!=(128&t.flags)){if(i)return es(t,e,n);e.flags|=128}var r=e.memoizedState;if(null!==r&&(r.rendering=null,r.tail=null,r.lastEffect=null),he(pi,pi.current),i)break;return null;case 22:case 23:return e.lanes=0,Ur(t,e,n)}return is(t,e,n)}(t,e,n);Or=0!=(131072&t.flags)}else Or=!1,gn&&0!=(1048576&e.flags)&&un(e,nn,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;ns(t,e),t=e.pendingProps;var r=pe(e,ce.current);Gn(e,n),r=Pi(null,e,i,t,r,n);var s=Ei();return e.flags|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ge(i)?(s=!0,ve(e)):s=!1,e.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Qn(e),r.updater=yr,e.stateNode=r,r._reactInternals=e,Sr(e,i,t,n),e=Fr(null,e,i,!0,s,n)):(e.tag=0,gn&&s&&cn(e),Lr(null,e,r,n),e=e.child),e;case 16:i=e.elementType;t:{switch(ns(t,e),t=e.pendingProps,i=(r=i._init)(i._payload),e.type=i,r=e.tag=function(t){if("function"==typeof t)return so(t)?1:0;if(null!=t){if((t=t.$$typeof)===g)return 11;if(t===y)return 14}return 2}(i),t=mr(i,t),r){case 0:e=zr(null,e,i,t,n);break t;case 1:e=Wr(null,e,i,t,n);break t;case 11:e=Rr(null,e,i,t,n);break t;case 14:e=Ir(null,e,i,mr(i.type,t),n);break t}throw Error(a(306,i,""))}return e;case 0:return i=e.type,r=e.pendingProps,zr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 1:return i=e.type,r=e.pendingProps,Wr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 3:t:{if(jr(e),null===t)throw Error(a(387));i=e.pendingProps,r=(s=e.memoizedState).element,Zn(t,e),ii(e,i,null,n);var o=e.memoizedState;if(i=o.element,q&&s.isDehydrated){if(s={element:i,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,256&e.flags){e=Hr(t,e,i,n,r=Ar(Error(a(423)),e));break t}if(i!==r){e=Hr(t,e,i,n,r=Ar(Error(a(424)),e));break t}for(q&&(pn=jt(e.stateNode.containerInfo),fn=e,gn=!0,bn=null,mn=!1),n=In(e,null,i,n),e.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(Tn(),i===r){e=is(t,e,n);break t}Lr(t,e,i,n)}e=e.child}return e;case 5:return di(e),null===t&&_n(e),i=e.type,r=e.pendingProps,s=null!==t?t.memoizedProps:null,o=r.children,j(i,r)?o=null:null!==s&&j(i,s)&&(e.flags|=32),Dr(t,e),Lr(t,e,o,n),e.child;case 6:return null===t&&_n(e),null;case 13:return qr(t,e,n);case 4:return ui(e,e.stateNode.containerInfo),i=e.pendingProps,null===t?e.child=Rn(e,null,i,n):Lr(t,e,i,n),e.child;case 11:return i=e.type,r=e.pendingProps,Rr(t,e,i,r=e.elementType===i?r:mr(i,r),n);case 7:return Lr(t,e,e.pendingProps,n),e.child;case 8:case 12:return Lr(t,e,e.pendingProps.children,n),e.child;case 10:t:{if(i=e.type._context,r=e.pendingProps,s=e.memoizedProps,Fn(0,i,o=r.value),null!==s)if(Xe(s.value,o)){if(s.children===r.children&&!de.current){e=is(t,e,n);break t}}else for(null!==(s=e.child)&&(s.return=e);null!==s;){var l=s.dependencies;if(null!==l){o=s.child;for(var h=l.firstContext;null!==h;){if(h.context===i){if(1===s.tag){(h=Jn(-1,n&-n)).tag=2;var u=s.updateQueue;if(null!==u){var c=(u=u.shared).pending;null===c?h.next=h:(h.next=c.next,c.next=h),u.pending=h}}s.lanes|=n,null!==(h=s.alternate)&&(h.lanes|=n),Hn(s.return,n,e),l.lanes|=n;break}h=h.next}}else if(10===s.tag)o=s.type===e.type?null:s.child;else if(18===s.tag){if(null===(o=s.return))throw Error(a(341));o.lanes|=n,null!==(l=o.alternate)&&(l.lanes|=n),Hn(o,n,e),o=s.sibling}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===e){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}Lr(t,e,r.children,n),e=e.child}return e;case 9:return r=e.type,i=e.pendingProps.children,Gn(e,n),i=i(r=$n(r)),e.flags|=1,Lr(t,e,i,n),e.child;case 14:return r=mr(i=e.type,e.pendingProps),Ir(t,e,i,r=mr(i.type,r),n);case 15:return Nr(t,e,e.type,e.pendingProps,n);case 17:return i=e.type,r=e.pendingProps,r=e.elementType===i?r:mr(i,r),ns(t,e),e.tag=1,ge(i)?(t=!0,ve(e)):t=!1,Gn(e,n),xr(e,i,r),Sr(e,i,r,n),Fr(null,e,i,!0,t,n);case 19:return es(t,e,n);case 22:return Ur(t,e,n)}throw Error(a(156,e.tag))},e.attemptContinuousHydration=function(t){if(13===t.tag){var e=Kn(t,134217728);null!==e&&Pa(e,t,134217728,ka()),yo(t,134217728)}},e.attemptDiscreteHydration=function(t){if(13===t.tag){var e=Kn(t,1);null!==e&&Pa(e,t,1,ka()),yo(t,1)}},e.attemptHydrationAtCurrentPriority=function(t){if(13===t.tag){var e=Ma(t),n=Kn(t,e);null!==n&&Pa(n,t,e,ka()),yo(t,e)}},e.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Be(e.pendingLanes);0!==n&&(Le(e,1|n),Ea(e,We()),0==(6&ta)&&(ma(),Ze()))}break;case 13:Ua((function(){var e=Kn(t,1);if(null!==e){var n=ka();Pa(e,t,1,n)}})),yo(t,1)}},e.batchedUpdates=function(t,e){var n=ta;ta|=1;try{return t(e)}finally{0===(ta=n)&&(ma(),Ke&&Ze())}},e.createComponentSelector=function(t){return{$$typeof:zs,value:t}},e.createContainer=function(t,e,n,i,r,s,a){return po(t,e,!1,null,0,i,0,s,a)},e.createHasPseudoClassSelector=function(t){return{$$typeof:Ws,value:t}},e.createHydrationContainer=function(t,e,n,i,r,s,a,o,l){return(t=po(n,i,!0,t,0,s,0,o,l)).context=go(null),n=t.current,(s=Jn(i=ka(),r=Ma(n))).callback=null!=e?e:null,ti(n,s,r),t.current.lanes=r,Oe(t,r,i),Ea(t,i),t},e.createPortal=function(t,e,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:h,key:null==i?null:""+i,children:t,containerInfo:e,implementation:n}},e.createRoleSelector=function(t){return{$$typeof:Fs,value:t}},e.createTestNameSelector=function(t){return{$$typeof:js,value:t}},e.createTextSelector=function(t){return{$$typeof:Hs,value:t}},e.deferredUpdates=function(t){var e=Re,n=Js.transition;try{return Js.transition=null,Re=16,t()}finally{Re=e,Js.transition=n}},e.discreteUpdates=function(t,e,n,i,r){var s=Re,a=Js.transition;try{return Js.transition=null,Re=1,t(e,n,i,r)}finally{Re=s,Js.transition=a,0===ta&&ma()}},e.findAllNodes=Ks,e.findBoundingRects=function(t,e){if(!it)throw Error(a(363));e=Ks(t,e),t=[];for(var n=0;n<e.length;n++)t.push(st(e[n]));for(e=t.length-1;0<e;e--)for(var i=(n=t[e]).x,r=i+n.width,s=n.y,o=s+n.height,l=e-1;0<=l;l--)if(e!==l){var h=t[l],u=h.x,c=u+h.width,d=h.y,f=d+h.height;if(i>=u&&s>=d&&r<=c&&o<=f){t.splice(e,1);break}if(!(i!==u||n.width!==h.width||f<s||d>o)){d>s&&(h.height+=d-s,h.y=s),f<o&&(h.height=o-d),t.splice(e,1);break}if(!(s!==d||n.height!==h.height||c<i||u>r)){u>i&&(h.width+=u-i,h.x=i),c<r&&(h.width=r-u),t.splice(e,1);break}}return t},e.findHostInstance=mo,e.findHostInstanceWithNoPortals=function(t){return null===(t=null!==(t=C(t))?P(t):null)?null:t.stateNode},e.findHostInstanceWithWarning=function(t){return mo(t)},e.flushControlled=function(t){var e=ta;ta|=1;var n=Js.transition,i=Re;try{Js.transition=null,Re=1,t()}finally{Re=i,Js.transition=n,0===(ta=e)&&(ma(),Ze())}},e.flushPassiveEffects=Ka,e.flushSync=Ua,e.focusWithin=function(t,e){if(!it)throw Error(a(363));for(e=Ys(t=$s(t),e),e=Array.from(e),t=0;t<e.length;){var n=e[t++];if(!ot(n)){if(5===n.tag&&ht(n.stateNode))return!0;for(n=n.child;null!==n;)e.push(n),n=n.sibling}}return!1},e.getCurrentUpdatePriority=function(){return Re},e.getFindAllNodesFailureDescription=function(t,e){if(!it)throw Error(a(363));var n=0,i=[];t=[$s(t),0];for(var r=0;r<t.length;){var s=t[r++],o=t[r++],l=e[o];if((5!==s.tag||!ot(s))&&(Vs(s,l)&&(i.push(Xs(l)),++o>n&&(n=o)),o<e.length))for(s=s.child;null!==s;)t.push(s,o),s=s.sibling}if(n<e.length){for(t=[];n<e.length;n++)t.push(Xs(e[n]));return"findAllNodes was able to match part of the selector:\n "+i.join(" > ")+"\n\nNo matching component was found for:\n "+t.join(" > ")}return null},e.getPublicRootInstance=function(t){return(t=t.current).child?5===t.child.tag?L(t.child.stateNode):t.child.stateNode:null},e.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:vo,findFiberByHostInstance:t.findFiberByHostInstance||xo,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)t=!1;else{var e=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(e.isDisabled||!e.supportsFiber)t=!0;else{try{$e=e.inject(t),Ve=e}catch(t){}t=!!e.checkDCE}}return t},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(t,e,n,i){if(!it)throw Error(a(363));t=Ks(t,e);var r=ut(t,n,i).disconnect;return{disconnect:function(){r()}}},e.registerMutableSourceForHydration=function(t,e){var n=e._getVersion;n=n(e._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[e,n]:t.mutableSourceEagerHydrationData.push(e,n)},e.runWithPriority=function(t,e){var n=Re;try{return Re=t,e()}finally{Re=n}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(t,e,n,i){var r=e.current,s=ka(),a=Ma(r);return n=go(n),null===e.context?e.context=n:e.pendingContext=n,(e=Jn(s,a)).payload={element:t},null!==(i=void 0===i?null:i)&&(e.callback=i),null!==(t=ti(r,e,a))&&(Pa(t,r,a,s),ei(t,r,a)),a},e}),Hu);var Ku,qu=r($u.exports),Qu={exports:{}},Zu={};Qu.exports=(Ku||(Ku=1,Zu.ConcurrentRoot=1,Zu.ContinuousEventPriority=4,Zu.DefaultEventPriority=16,Zu.DiscreteEventPriority=1,Zu.IdleEventPriority=536870912,Zu.LegacyRoot=0),Zu);var Ju=Qu.exports;const tc=qu({supportsMutation:!0,supportsPersistence:!1,createInstance:(t,e,n)=>{const i=function(t,e){const n=function(t,e){if("tag"===t)return new Tu(e.attribute?e.attribute:e);if("radio"===t)return new Cu(e.attribute?e.attribute:e);if("checkbox"===t)return new Bu(e.attribute?e.attribute:e)}(t,e);if(n)return n;if(!Bi.graphicService.creator[t])return;const i=Bi.graphicService.creator[t](e.attribute);return i}(t,e);if(i)return function(t,e){for(const n in e)ec(n,e)&&ql[n]&&t.addEventListener(ql[n],e[n])}(i,e),i},createTextInstance:(t,e)=>{},appendInitialChild:(t,e)=>{t.add(e)},finalizeInitialChildren:()=>!1,prepareUpdate:()=>!0,shouldSetTextContent:()=>!1,getRootHostContext:()=>null,getChildHostContext:()=>null,getPublicInstance:t=>t,prepareForCommit:()=>null,resetAfterCommit:()=>{},preparePortalMount:()=>null,scheduleTimeout:setTimeout,cancelTimeout:clearTimeout,noTimeout:-1,isPrimaryRenderer:!1,getCurrentEventPriority:()=>Ju.DefaultEventPriority,getInstanceFromNode:t=>null,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},prepareScopeUpdate:()=>{},getInstanceFromScope:()=>{},detachDeletedInstance:()=>{},supportsHydration:!1,appendChild:(t,e)=>{t.add(e)},appendChildToContainer:(t,e)=>{t.add(e)},insertBefore:(t,e,n)=>{t.insertBefore(e,n)},insertInContainerBefore:(t,e,n)=>{t.insertBefore(e,n)},removeChild:(t,e)=>{e.delete()},removeChildFromContainer:(t,e)=>{e.delete()},commitUpdate:(t,e,n,i,r)=>{!function(t,e,n){for(const i in n)ec(i,n)&&n[i]!==e[i]&&t.removeEventListener(ql[i],n[i]);for(const i in e)ec(i,e)&&n[i]!==e[i]&&t.addEventListener(ql[i],e[i]);const i=e.attribute??_({},e);t.initAttributes(i),"image"===t.type&&t.loadImage(i.image);if("flex"===i.display&&void 0===i.width&&void 0===i.height&&b(n.attribute.width)&&b(n.attribute.height)){const e=t.stage.pluginService.findPluginsByName("FlexLayoutPlugin")[0];e&&e.tryLayoutChildren(t)}}(t,r,i)},hideInstance:t=>{t.setAttribute("visible",!1)},unhideInstance:(t,e)=>{t.setAttribute("visible",!0)},clearContainer:t=>{t.removeAllChild()},commitTextUpdate:(t,e,n)=>{}});function ec(t,e){return t.startsWith("on")&&l(e[t])}tc.injectIntoDevTools({bundleType:0,version:n.version,rendererPackageName:"react-vtable"});const nc=(t,e)=>{const{componentId:r,children:s}=t;if(!n.isValidElement(s))return null;const a=n.useContext(i),{table:o}=a,l="header-custom-layout"===s.props.role,h=n.useRef(new Map),u=n.useCallback((t=>{const e=`${t.originCol??t.col}-${t.originRow??t.row}${t.forComputation?"-forComputation":""}`;let n;if(h.current.has(e)){const i=h.current.get(e);ic(s,i,t),n=i.containerInfo}else{n=new ya({});const i=tc.createContainer(n,Ju.LegacyRoot,null,null,null,"custom",null,null);h.current.set(e,i),ic(s,i,t)}return{rootContainer:n,renderDefault:!!s.props.renderDefault}}),[s]),c=n.useCallback(((t,e)=>{const n=`${t}-${e}`;if(h.current.has(n)){const t=h.current.get(n);tc.updateContainer(null,t,null),t.containerInfo.delete(),h.current.delete(n)}}),[]),d=n.useCallback((()=>{h.current.forEach(((t,e)=>{const n=t;tc.updateContainer(null,n,null),n.containerInfo.delete()})),h.current.clear()}),[]);return n.useLayoutEffect((()=>(console.log("init",t,o),()=>{console.log("release",t,o)})),[]),n.useLayoutEffect((()=>{console.log("update props",t,o),o?.checkReactCustomLayout(),o?.reactCustomLayout?.setReactRemoveAllGraphic(r,d,l),o&&!o.reactCustomLayout?.hasReactCreateGraphic(r,l)?(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),o.reactCustomLayout?.setReactRemoveGraphic(r,c,l),o.reactCustomLayout?.updateCustomCell(r,l)):o&&(o.reactCustomLayout?.setReactCreateGraphic(r,u,l),h.current.forEach(((t,e)=>{const[n,i]=e.split("-").map(Number),{width:r,height:a}=function(t,e,n){const i=n.getCellRange(t,e),r=n.getCellsRect(i.start.col,i.start.row,i.end.col,i.end.row);return r}(n,i,o),l=t,h={col:n,row:i,dataValue:o.getCellOriginValue(n,i),value:o.getCellValue(n,i)||"",rect:{left:0,top:0,right:r,bottom:a,width:r,height:a},table:o};l.containerInfo,ic(s,l,h),o.scenegraph.updateNextFrame()})))})),null};function ic(t,e,i){tc.updateContainer(n.cloneElement(t,{...i}),e,null)}const rc=(t,e,r,s)=>{const a=["id","updateId","componentIndex","children"],o=r?Object.keys(r).concat(a):a,l=t=>{const e=n.useContext(i),s=n.useRef(null),a=n.useRef(t.updateId);if(t.updateId!==a.current){a.current=t.updateId;!!r&&N(e.table,t,s.current,r)&&(s.current=t)}return n.useEffect((()=>()=>{r&&N(e.table,null,s.current,r)}),[]),ac(t.children,t.componentId)};return l.displayName=t,l.parseOption=t=>{const i=S(t,o);if(t.children){const{children:e}=t;n.Children.map(e,((e,n)=>{sc(e,t,i,o,t.componentId+"-"+n)}))}return{option:i,optionName:e,isSingle:s}},l};function sc(t,e,i,r,s){if("custom-layout"===t.props.role&&(i.customLayout="react-custom-layout",i.customLayoutComponentId=s),"header-custom-layout"===t.props.role&&(i.headerCustomLayout="react-custom-layout",i.headerCustomLayoutComponentId=s),"ListColumn"===t.type.displayName){i.columns||(i.columns=[]);const a=S(t.props,r);i.columns.push(a),a.componentId=s,t.props.children&&n.Children.map(t.props.children,((t,n)=>{sc(t,e,a,r,s+"-"+n)}))}}function ac(t,e){return(i=t)&&i.$$typeof===Symbol.for("react.element")||Array.isArray(t)?n.Children.map(t,((t,i)=>t.props.children?ac(t.props.children,e+"-"+i):"custom-layout"===t.props.role||"header-custom-layout"===t.props.role?n.createElement(nc,{componentId:e},t):null)):null;var i}const oc=rc("ListColumn","columns"),lc=rc("PivotColumnDimension","columns"),hc=rc("PivotRowDimension","rows"),uc=rc("PivotIndicator","indicators"),cc=rc("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),dc=rc("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),fc=rc("PivotCorner","corner",void 0,!0),pc=rc("Menu","menu",void 0,!0),gc=rc("Tooltip","tooltip",void 0,!0),mc=rc("EmptyTip","emptyTip",void 0,!0),bc=rc("Title","title",void 0,!0);function yc(t,e){return b(t)?t:"string"==typeof t&&t.endsWith("%")?Number(t.slice(0,-1))/100*e:0}const vc="group",xc="text",_c="tag",Sc={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"#165dff",lineWidth:1,cornerRadius:2},padding:10,state:{panelStyle:{hover:{fill:"#4080ff"},disabled:{fill:"#94bfff"}}}};const Ac=n.forwardRef((function(t,e){const i=_({},Sc,t),{disabled:r,onClick:s}=i;let a=n.useRef(null);a=e||a;const o=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():s&&s(t)}),[r,s]),l=function(t){const{textStyle:e,padding:n,panelStyle:i,minWidth:r,maxWidth:s,visible:a,cursor:o,disabled:l,state:h,children:u}=t,c={text:u,textStyle:e,padding:n,panel:i,minWidth:r,maxWidth:s,visible:a,cursor:o??l?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:h?.textStyle?.hover,disabled:h?.textStyle?.disabled},panel:{hover:h?.panelStyle?.hover,disabled:h?.panelStyle?.disabled}}};return c}(i);return n.useEffect((()=>{a.current.addEventListener("mouseenter",(()=>{r||(a.current.addState("hover",!0,!1),a.current.stage.renderNextFrame())})),a.current.addEventListener("mouseleave",(()=>{r||(a.current.removeState("hover",!1),a.current.stage.renderNextFrame())}))})),n.useEffect((()=>{r?(a.current.removeState("disabled",!1),a.current.addState("disabled",!0,!1)):a.current.removeState("disabled",!1),a.current.stage.renderNextFrame()})),n.createElement(_c,{ref:a,attribute:l,onClick:o})}));Ac.displayName="Button";const wc={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(64, 128, 255)"},panelStyle:{visible:!0,opacity:0,fill:"rgba(242, 243, 245, 0.5)",lineWidth:1,cornerRadius:2},padding:4,space:6,state:{textStyle:{disabled:{fill:"rgb(148, 191, 255)"}},panelStyle:{hover:{opacity:1}}}};const Tc=n.forwardRef((function(t,e){const i=_({},wc,t),{disabled:r,href:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{r?"function"==typeof t?.preventDefault&&t.preventDefault():(a&&a(t),s&&window.open(s))}),[r,s,a]),h=function(t){const{textStyle:e,padding:n,space:i,panelStyle:r,minWidth:s,maxWidth:a,visible:o,cursor:l,disabled:h,icon:u,state:c,children:d}=t,f={text:d,textStyle:e,padding:n,panel:r,minWidth:s,maxWidth:a,visible:o,cursor:l??h?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:c?.textStyle?.hover,disabled:c?.textStyle?.disabled},panel:{hover:c?.panelStyle?.hover,disabled:c?.panelStyle?.disabled}},space:i,shape:{visible:!!u,fill:!1,stroke:e.fill,symbolType:"M -0.2927 -15.4348 L -15.142 -0.5855 C -18.6567 2.9292 -18.6567 8.6277 -15.142 12.1424 V 12.1424 C -11.6273 15.6571 -5.9288 15.6571 -2.4141 12.1424 L 15.2636 -5.5353 C 17.6067 -7.8784 17.6067 -11.6774 15.2636 -14.0206 V -14.0206 C 12.9205 -16.3637 9.1215 -16.3637 6.7783 -14.0206 L -10.8993 3.6571 C -12.0709 4.8287 -12.0709 6.7282 -10.8993 7.8997 V 7.8997 C -9.7278 9.0713 -7.8283 9.0713 -6.6567 7.8997 L 8.1925 -6.9495"}};return f}(i);return n.useEffect((()=>{o.current.addEventListener("mouseenter",(()=>{r||(o.current.addState("hover",!0,!1),o.current.stage.renderNextFrame())})),o.current.addEventListener("mouseleave",(()=>{r||(o.current.removeState("hover",!1),o.current.stage.renderNextFrame())}))}),[]),n.useEffect((()=>{r?(o.current.removeState("disabled",!1),o.current.addState("disabled",!0,!1)):o.current.removeState("disabled",!1),o.current.stage.renderNextFrame()})),n.createElement(_c,{ref:o,attribute:h,onClick:l})}));Tc.displayName="Link";const Bc={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"#FFF"},panelStyle:{visible:!0,fill:"rgb(201, 205, 212)",lineWidth:1,cornerRadius:2},size:40,shape:"circle",autoFixFontSize:!0};const Cc=n.forwardRef((function(t,e){const i=_({},Bc,t),{size:r,children:s,onClick:a}=i;let o=n.useRef(null);o=e||o;const l=n.useCallback((t=>{a&&a(t)}),[a]),h=function(t){const{panelStyle:e,size:n,shape:i}=t,r={...e,width:n,height:n,clip:!0,cornerRadius:"circle"===i?n/2:e.cornerRadius??2,display:"flex",alignItems:"center",justifyContent:"center",visibleAll:!0,path:void 0};return r}(i);if(p(s)){const t=function(t){const{textStyle:e,size:n,children:i,autoFixFontSize:r}=t,s={text:i,...e};r&&function(t,e){const n=Su(e.text,e).width,i=t/(n+8),r=Math.max(Math.floor(e.fontSize*i),6);e.fontSize=r}(n,s);return s}(i);return n.createElement(vc,{ref:o,attribute:h,onClick:l},n.createElement(xc,{attribute:t}))}return"image"===s.type&&(s.props.attribute.width=r,s.props.attribute.height=r),n.createElement(vc,{ref:o,attribute:h,onClick:l},s)}));Cc.displayName="Avatar";const kc={defaultPopupVisible:!1,position:"top"},Mc={backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 4px 10px rgba(0, 0, 0, .1)",fontSize:"14px",borderRadius:"4px",lineHeight:"1.5715",boxSizing:"border-box",color:"rgb(78, 89, 105)",border:"1px solid rgb(229, 230, 235)",padding:"12px 16px"},Pc=t=>{const e={content:"",height:"8px",width:"8px",position:"absolute",display:"block",boxSizing:"border-box",transform:"rotate(45deg)",transformOrigin:"50% 50% 0",backgroundColor:"rgb(255, 255, 255)",border:"1px solid rgb(229, 230, 235)",...Ec(t.position),...t.arrowStyle};return t.visible?n.createElement(n.Fragment,null,n.createElement("div",{style:_({},Mc,t.panelStyle)},t.content),n.createElement("div",{style:e})):n.createElement(n.Fragment,null)};function Ec(t){switch(t){case"top":return{top:"calc(100% - 5px)",left:"calc(50% - 5px)",borderTop:"none",borderLeft:"none"};case"tl":return{top:"calc(100% - 4px)",left:"14px",borderTop:"none",borderLeft:"none"};case"tr":return{top:"calc(100% - 4px)",left:"calc(100% - 24px)",borderTop:"none",borderLeft:"none"};case"bottom":return{top:"-4px",left:"calc(50% - 4px)",borderRight:"none",borderBottom:"none"};case"bl":return{top:"-4px",left:"14px",borderRight:"none",borderBottom:"none"};case"br":return{top:"-4px",left:"calc(100% - 24px)",borderRight:"none",borderBottom:"none"};case"left":return{top:"calc(50% - 4px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lt":return{top:"14px",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"lb":return{top:"calc(100% - 24px)",left:"calc(100% - 5px)",borderLeft:"none",borderBottom:"none"};case"right":return{top:"calc(50% - 4px)",left:"-4px",borderRight:"none",borderTop:"none"};case"rt":return{top:"14px",left:"-4px",borderRight:"none",borderTop:"none"};case"rb":return{top:"calc(100% - 24px)",left:"-4px",borderRight:"none",borderTop:"none"}}}const Oc=n.forwardRef((function(t,e){const i=_({},kc,t),{content:r,position:s,popupVisible:a,defaultPopupVisible:o,panelStyle:l,arrowStyle:h,children:c}=i;let d=n.useRef(null);d=e||d;const[f,p]=n.useState(!1);n.useEffect((()=>{p(!!a),d.current.stage.renderNextFrame()}),[a]),n.useEffect((()=>{p(a??o??!1)}),[]);const{transform:g,anchorType:m}=function(t){switch(t){case"top":return{anchorType:"top",transform:"translate(-50%, calc(-100% - 10px))"};case"tl":return{anchorType:"top-left",transform:"translate(0, calc(-100% - 10px))"};case"tr":return{anchorType:"top-right",transform:"translate(-100%, calc(-100% - 10px))"};case"bottom":return{anchorType:"bottom",transform:"translate(-50%, 10px)"};case"bl":return{anchorType:"bottom-left",transform:"translate(0, 10px)"};case"br":return{anchorType:"bottom-right",transform:"translate(-100%, 10px)"};case"left":return{anchorType:"left",transform:"translate(calc(-100% - 10px), -50%)"};case"lt":return{anchorType:"top-left",transform:"translate(calc(-100% - 10px), 0)"};case"lb":return{anchorType:"bottom-left",transform:"translate(calc(-100% - 10px), -100%)"};case"right":return{anchorType:"right",transform:"translate(10px, -50%)"};case"rt":return{anchorType:"top-right",transform:"translate(10px, 0)"};case"rb":return{anchorType:"bottom-right",transform:"translate(10px, -100%)"}}}(s),b={react:{style:{transform:g},element:n.createElement(Pc,{visible:f,content:r,position:s,panelStyle:l,arrowStyle:h}),container:null,visible:!0,pointerEvents:!1,anchorType:m}},y=n.useCallback((t=>{u(a)||(p(!0),t.currentTarget.stage.renderNextFrame())}),[]),v=n.useCallback((t=>{u(a)||(p(!1),t.currentTarget.stage.renderNextFrame())}),[]);return n.createElement(vc,{ref:d,attribute:b,onMouseEnter:y,onMouseLeave:v},c)}));Oc.displayName="Popover";const Lc={textStyle:{fontSize:14,fontFamily:"sans-serif",fill:"rgb(51, 101, 238)"},panelStyle:{visible:!0,fill:"#e6fffb",lineWidth:1,cornerRadius:4}};const Rc=n.forwardRef((function(t,e){const i=_({},Lc,t),{attribute:r,panelStyle:s,children:a,...o}=i;let l=n.useRef(null);return l=e||l,n.createElement(_c,{ref:l,attribute:r??{text:a,panel:s,...o},...o})}));Rc.displayName="Tag";const Ic={};const Nc=n.forwardRef((function(t,e){const i=_({},Ic,t),{textStyle:r,circleStyle:s,children:a,...o}=i;let l=n.useRef(null);l=e||l;const h=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(l.current?.addEventListener("radio_checked",h),()=>{l.current?.removeEventListener("radio_checked",h)})),[]),n.createElement("radio",{ref:l,attribute:{text:{...r,text:a},circle:s,...o},...o})}));Nc.displayName="Radio";const Uc={};const Dc=n.forwardRef((function(t,e){const i=_({},Uc,t),{textStyle:r,boxStyle:s,iconStyle:a,children:o,...l}=i;let h=n.useRef(null);h=e||h;const u=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(h.current?.addEventListener("checkbox_state_change",u),()=>{h.current?.removeEventListener("checkbox_state_change",u)})),[]),n.createElement("checkbox",{ref:h,attribute:{text:{...r,text:o},box:s,icon:a,...l},...l})}));Dc.displayName="Checkbox";Object.defineProperty(t,"register",{enumerable:!0,get:function(){return e.register}}),t.Arc="arc",t.Avatar=Cc,t.Button=Ac,t.Checkbox=Dc,t.Circle="circle",t.CustomComponent=t=>{const e=n.useContext(i),{table:r}=e,s=function(t,e){const i=n.useMemo((()=>({...e})),[e]),r=n.useMemo((()=>{const e=_({},t);for(const t in i)void 0===e[t]&&(e[t]=i[t]);return e}),[t,i]);return r}(t,{style:{left:0,top:0},className:"vtable-custom-component",displayMode:"position",x:0,y:0,width:0,height:0,row:0,col:0,anchor:"top-left",dx:0,dy:0}),{displayMode:a,x:o,y:l,width:h,height:u,row:c,col:d,anchor:f,dx:p,dy:g,className:m,children:b,style:y}=s;let v,x,S,A;if("position"===a)v=o+p+"px",x=l+g+"px",S=h+"px",A=u+"px";else if("cell"===a){const t=r&&d>=0&&c>=0?r?.getCellRelativeRect(d,c):{width:0,height:0,left:-9999,top:-9999};S=yc(h,t.width)+"px",A=yc(u,t.height)+"px","top-left"===f?(v=t.left+yc(p,t.width)+"px",x=t.top+yc(g,t.height)+"px"):"top-right"===f?(v=t.left+yc(p,t.width)+t.width+"px",x=t.top+yc(g,t.height)+"px"):"bottom-left"===f?(v=t.left+yc(p,t.width)+"px",x=t.top+yc(g,t.height)+t.height+"px"):"bottom-right"===f&&(v=t.left+yc(p,t.width)+t.width+"px",x=t.top+yc(g,t.height)+t.height+"px")}const w=_({},y,{position:"absolute",zIndex:1e3,width:S,height:A,left:v,top:x});return n.createElement("div",{className:m,style:w},n.Children.map(b,(t=>t?n.cloneElement(t,{}):t)))},t.CustomLayout=nc,t.EmptyTip=mc,t.Group=vc,t.Image="image",t.Line="line",t.Link=Tc,t.ListColumn=oc,t.ListTable=Nu,t.ListTableSimple=zu,t.Menu=pc,t.Path="path",t.PivotChart=Du,t.PivotColumnDimension=lc,t.PivotColumnHeaderTitle=cc,t.PivotCorner=fc,t.PivotIndicator=uc,t.PivotRowDimension=hc,t.PivotRowHeaderTitle=dc,t.PivotTable=Uu,t.PivotTableSimple=Wu,t.Polygon="polygon",t.Popover=Oc,t.Radio=Nc,t.Rect="rect",t.RichText="richtext",t.Symbol="symbol",t.Tag=Rc,t.Text=xc,t.Title=bc,t.Tooltip=gc,t.VTableReactAttributePlugin=ku,t.registerChartModule=function(t,n){e.register.chartModule(t,n)},t.version="1.18.1"}));
|