@visactor/react-vtable 1.17.6 → 1.17.7-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,u,h=this._events[o],c=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,i),!0;case 4:return h.fn.call(h.context,e,i,r),!0;case 5:return h.fn.call(h.context,e,i,r,s),!0;case 6:return h.fn.call(h.context,e,i,r,s,a),!0}for(u=1,l=new Array(c-1);u<c;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var d,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),c){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,i);break;case 4:h[u].fn.call(h[u].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];h[u].fn.apply(h[u].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,u=[],h=o.length;l<h;l++)(o[l].fn!==e||r&&!o[l].once||i&&o[l].context!==i)&&u.push(o[l]);u.length?this._events[s]=1===u.length?u[0]:u: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=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||o(t,"Boolean")};var u=t=>"function"==typeof t;var h=t=>null==t;var c=t=>null!=t;var d=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var f=t=>"object"==typeof t&&null!==t;var p=function(t){if(!f(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 g=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||o(t,"String")};var m=t=>Array.isArray?Array.isArray(t):o(t,"Array");var b=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var y=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||o(t,"Number")};var v=t=>y(t)&&Number.isFinite(t);var x=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var _=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 S=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const A=Object.prototype;var w=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||A)};const T=Object.prototype.hasOwnProperty;function B(t){if(h(t))return!0;if(b(t))return!t.length;const e=S(t);if("Map"===e||"Set"===e)return!t.size;if(w(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}const C=Object.prototype.hasOwnProperty;var k=(t,e)=>null!=t&&C.call(t,e);function M(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(c(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];!c(r[a])||"object"!=typeof r[a]||i&&m(t[a])?E(t,a,r[a]):P(t,e,a,n,i)}}}}function P(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(m(a)){if(i)o=[];else if(m(s))o=s;else if(b(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else p(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&M(o,a,i,r),E(t,n,o)}function E(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 O(t){let e=-1;const n=arguments.length<=1?0:arguments.length-1;for(;++e<n;)M(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function L(t,e){if(!t||!p(t))return t;const n={};return Object.keys(t).forEach((i=>{const r=t[i];let s=!1;e.forEach((t=>{(g(t)&&t===i||t instanceof RegExp&&i.match(t))&&(s=!0)})),s||(n[i]=r)})),n}function R(t){return Object.prototype.toString.call(t)}function I(t){return Object.keys(t)}function N(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(R(t)!==R(e))return!1;if(u(t))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof t)return!1;if(m(t)){if(t.length!==e.length)return!1;for(let i=t.length-1;i>=0;i--)if(!N(t[i],e[i],n))return!1;return!0}if(!p(t))return!1;const i=I(t),r=I(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(!N(t[s],e[s],n))return!1}return!0}function U(t,e){if(!m(t)||!m(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 D="undefined"!=typeof console;function z(t,e,n){const i=[e].concat([].slice.call(n));D&&console[t].apply(console,i)}var W;!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"}(W||(W={}));class F{static getInstance(t,e){return F._instance&&y(t)?F._instance.level(t):F._instance||(F._instance=new F(t,e)),F._instance}static setInstance(t){return F._instance=t}static setInstanceLevel(t){F._instance?F._instance.level(t):F._instance=new F(t)}static clearInstance(){F._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W.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>=W.Info}canLogDebug(){return this._level>=W.Debug}canLogError(){return this._level>=W.Error}canLogWarn(){return this._level>=W.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>=W.Error&&(this._onErrorHandler.length?this.callErrorHandler(...n):z(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>=W.Warn&&z(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>=W.Info&&z(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>=W.Debug&&z(this._method||"log","DEBUG",e),this}}F._instance=null;var j=function(t,e,n){return t<e?e:t>n?n:t};const H=1e-12,G=Math.PI,$=G/2,V=2*G,X=2*Math.PI,Y=Math.abs,K=Math.atan2,q=Math.cos,Q=Math.max,Z=Math.min,J=Math.sin,tt=Math.sqrt,et=Math.pow;function nt(t){return t>=1?$:t<=-1?-$:Math.asin(t)}class it{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 it(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 y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(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 rt{static distancePP(t,e){return tt(et(t.x-e.x,2)+et(t.y-e.y,2))}static distanceNN(t,e,n,i){return tt(et(t-n,2)+et(e-i,2))}static distancePN(t,e,n){return tt(et(e-t.x,2)+et(n-t.y,2))}static pointAtPP(t,e,n){return new it((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function st(t){return t*(Math.PI/180)}const at=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-V;)t+=V;else if(t>0)for(;t>V;)t-=V;return t};var ot;function lt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function ut(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 ht(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ct(t,e){const n=e?st(t.angle):t.angle,i=ht(t);return[ut({x:t.x1,y:t.y1},n,i),ut({x:t.x2,y:t.y1},n,i),ut({x:t.x2,y:t.y2},n,i),ut({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"}(ot||(ot={}));const dt=(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,u=(r+s)/2,h=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":h=-.5;break;case"right":case"inside-right":h=.5;break;case"top-right":h=.5,c=-.5;break;case"top-left":h=-.5,c=-.5;break;case"bottom-right":h=.5,c=.5;break;case"bottom-left":h=-.5,c=.5}return l+=h*a,u+=c*o,{x:l,y:u}};function ft(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 pt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new pt(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 m(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 ft(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),u=e-e*o+n*l,h=n-e*l-n*o;return[o*i-l*r+u,l*i+o*r+h,o*i-l*a+u,l*i+o*a+h,o*s-l*r+u,l*s+o*r+h,o*s-l*a+u,l*s+o*a+h]}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 gt extends pt{}class mt extends pt{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=ct(t,n),r=ct(e,n),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(ht(t),ht(e)),o=s(i[0],i[1]),l=s(i[1],i[2]),u=s(r[0],r[1]),h=s(r[1],r[2]),c=n?st(t.angle):t.angle;let d=n?st(90-t.angle):t.angle+$;const f=n?st(e.angle):e.angle;let p=n?st(90-e.angle):e.angle+$;d>X&&(d-=X),p>X&&(p-=X);const g=(t,e,n,i)=>{const r=[Math.cos(e),Math.sin(e)];return t+(lt(r,n)+lt(r,i))/2>lt(r,a)};return g((t.x2-t.x1)/2,c,u,h)&&g((t.y2-t.y1)/2,d,u,h)&&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 mt(this)}}class bt{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 bt,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,u=i*this.c-r*this.d,h=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=u,this.d=h,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,u=this.d,h=a*t+l*e,c=o*t+u*e,d=a*n+l*i,f=o*n+u*i,p=a*r+l*s+this.e,g=o*r+u*s+this.f;return this.a=h,this.b=c,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new bt;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,u=s/l,h=-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*u+m*c+f,e.y=g*h+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 bt(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 yt(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 vt(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 xt=/^#([0-9a-f]{3,8})$/,_t={transparent:4294967040},St={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 At(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function wt(t){return y(t)?new Mt(t>>16,t>>8&255,255&t,1):m(t)?new Mt(t[0],t[1],t[2]):new Mt(255,255,255)}function Tt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Bt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Ct=(t,e)=>{const n=xt.exec(t);if(e||n){const t=parseInt(n[1],16),e=n[1].length;return 3===e?new Mt((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?wt(t):8===e?new Mt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class kt{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new kt(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new kt(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const n=t instanceof kt?t:new kt(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(c(_t[t]))return function(t){return y(t)?new Mt(t>>>24,t>>>16&255,t>>>8&255,255&t):m(t)?new Mt(t[0],t[1],t[2],t[3]):new Mt(255,255,255,1)}(_t[t]);if(c(St[t]))return wt(St[t]);const e=`${t}`.trim().toLowerCase(),n=Ct(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 Mt(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=yt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Mt(n.r,n.g,n.b,parseFloat(t[3]))}}constructor(t){const e=kt.parseColorString(t);this.color=e||new Mt(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=vt(this.color.r,this.color.g,this.color.b),s=yt(h(t)?r.h:j(t,0,360),h(e)?r.s:e>=0&&e<=1?100*e:e,h(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new Mt(s.r,s.g,s.b,i),this}setRGB(t,e,n){return!h(t)&&(this.color.r=t),!h(e)&&(this.color.g=e),!h(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=Ct(e,!0);return null!=n?n:this}setColorName(t){const e=St[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 kt(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=Tt(t.color.r),this.color.g=Tt(t.color.g),this.color.b=Tt(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Bt(t.color.r),this.color.g=Bt(t.color.g),this.color.b=Bt(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Mt{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)),c(i)?this.opacity=isNaN(+i)?1:Math.max(0,Math.min(1,+i)):this.opacity=1}formatHex(){return`#${At(this.r)+At(this.g)+At(this.b)+(1===this.opacity?"":At(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}=vt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${n}%,${i}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const Pt=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},Et=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();var Ot,Lt={exports:{}},Rt={};Lt.exports=function(){if(Ot)return Rt;Ot=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"),u=Symbol.for("react.forward_ref"),h=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 h:case c:return t;default:switch(t=t&&t.$$typeof){case l:case o:case u:case f:case d:case a:return t;default:return p}}case n:return p}}}return t=Symbol.for("react.module.reference"),Rt.ContextConsumer=o,Rt.ContextProvider=a,Rt.Element=e,Rt.ForwardRef=u,Rt.Fragment=i,Rt.Lazy=f,Rt.Memo=d,Rt.Portal=n,Rt.Profiler=s,Rt.StrictMode=r,Rt.Suspense=h,Rt.SuspenseList=c,Rt.isAsyncMode=function(){return!1},Rt.isConcurrentMode=function(){return!1},Rt.isContextConsumer=function(t){return g(t)===o},Rt.isContextProvider=function(t){return g(t)===a},Rt.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Rt.isForwardRef=function(t){return g(t)===u},Rt.isFragment=function(t){return g(t)===i},Rt.isLazy=function(t){return g(t)===f},Rt.isMemo=function(t){return g(t)===d},Rt.isPortal=function(t){return g(t)===n},Rt.isProfiler=function(t){return g(t)===s},Rt.isStrictMode=function(t){return g(t)===r},Rt.isSuspense=function(t){return g(t)===h},Rt.isSuspenseList=function(t){return g(t)===c},Rt.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===r||e===h||e===c||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===o||e.$$typeof===u||e.$$typeof===t||void 0!==e.getModuleId)},Rt.typeOf=g,Rt}();var It=Lt.exports;const Nt=t=>{let e=[];return n.Children.forEach(t,(t=>{h(t)||(It.isFragment(t)?e=e.concat(Nt(t.props.children)):e.push(t))})),e},Ut={...e.TABLE_EVENT_TYPE,...e.PIVOT_TABLE_EVENT_TYPE,...e.PIVOT_CHART_EVENT_TYPE},Dt={onClickCell:Ut.CLICK_CELL,onDblClickCell:Ut.DBLCLICK_CELL,onMouseDownCell:Ut.MOUSEDOWN_CELL,onMouseUpCell:Ut.MOUSEUP_CELL,onSelectedCell:Ut.SELECTED_CELL,onSelectedClear:Ut.SELECTED_CLEAR,onKeyDown:Ut.KEYDOWN,onMouseEnterTable:Ut.MOUSEENTER_TABLE,onMouseLeaveTable:Ut.MOUSELEAVE_TABLE,onMouseDownTable:Ut.MOUSEDOWN_TABLE,onMouseMoveCell:Ut.MOUSEMOVE_CELL,onMouseMoveTable:Ut.MOUSEMOVE_TABLE,onMouseEnterCell:Ut.MOUSEENTER_CELL,onMouseLeaveCell:Ut.MOUSELEAVE_CELL,onContextMenuCell:Ut.CONTEXTMENU_CELL,onResizeColumn:Ut.RESIZE_COLUMN,onResizeColumnEnd:Ut.RESIZE_COLUMN_END,onResizeRow:Ut.RESIZE_ROW,onResizeRowEnd:Ut.RESIZE_ROW_END,onChangeHeaderPositionStart:Ut.CHANGE_HEADER_POSITION_START,onChangeHeaderPosition:Ut.CHANGE_HEADER_POSITION,onChangeHeaderPositionFail:Ut.CHANGE_HEADER_POSITION_FAIL,onSortClick:Ut.SORT_CLICK,onAfterSort:Ut.AFTER_SORT,onFreezeClick:Ut.FREEZE_CLICK,onScroll:Ut.SCROLL,onScrollHorizontalEnd:Ut.SCROLL_HORIZONTAL_END,onScrollVerticalEnd:Ut.SCROLL_VERTICAL_END,onDropdownMenuClick:Ut.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:Ut.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:Ut.DRAG_SELECT_END,onCopyData:Ut.COPY_DATA,onDropdownIconClick:Ut.DROPDOWN_ICON_CLICK,onDropdownMenuClear:Ut.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:Ut.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:Ut.SHOW_MENU,onHideMenu:Ut.HIDE_MENU,onIconClick:Ut.ICON_CLICK,onLegendItemClick:Ut.LEGEND_ITEM_CLICK,onLegendItemHover:Ut.LEGEND_ITEM_HOVER,onLegendItemUnHover:Ut.LEGEND_ITEM_UNHOVER,onLegendChange:Ut.LEGEND_CHANGE,onMouseEnterAxis:Ut.MOUSEENTER_AXIS,onMouseLeaveAxis:Ut.MOUSELEAVE_AXIS,onCheckboxStateChange:Ut.CHECKBOX_STATE_CHANGE,onRadioStateChange:Ut.RADIO_STATE_CHANGE,onSwitchStateChange:Ut.SWITCH_STATE_CHANGE,onAfterRender:Ut.AFTER_RENDER,onInitialized:Ut.INITIALIZED,onChangeCellValue:Ut.CHANGE_CELL_VALUE,onDragFillHandleEnd:Ut.DRAG_FILL_HANDLE_END,onMousedownFillHandle:Ut.MOUSEDOWN_FILL_HANDLE,onDblclickFillHandle:Ut.DBLCLICK_FILL_HANDLE,onPivotSortClick:Ut.PIVOT_SORT_CLICK,onDrillMenuClick:Ut.DRILLMENU_CLICK,onVChartEventType:Ut.VCHART_EVENT_TYPE,onChangCellValue:Ut.CHANGE_CELL_VALUE,onEmptyTipClick:Ut.EMPTY_TIP_CLICK,onEmptyTipDblClick:Ut.EMPTY_TIP_DBLCLICK,onButtonClick:Ut.BUTTON_CLICK},zt=Object.keys(Dt),Wt=(t,e=Dt)=>{const n={};return Object.keys(t).forEach((i=>{e[i]&&t[i]&&(n[i]=t[i])})),n},Ft=(t,e,n,i=Dt)=>{if(!e&&!n||!t)return!1;const r=n?Wt(n,i):null,s=e?Wt(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 jt{static GenAutoIncrementId(){return jt.auto_increment_id++}}jt.auto_increment_id=0;class Ht{constructor(t){this.id=jt.GenAutoIncrementId(),this.registry=t}}const Gt="named",$t="inject",Vt="inversify:tagged",Xt="inversify:paramtypes";class Yt{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===Gt?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Kt=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(u(s)){if(!n)return;s=new i,r.set(t,s)}let a=s.get(e);if(u(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!h(i)&&a(t,i,n)}function o(t,e,n){const i=s(e,n,!1);return!u(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(!u(i))return i.get(t)}(t,e,n);const i=g(e);return h(i)?void 0:l(t,i,n)}function u(t){return void 0===t}function h(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 u(n)||(n=f(n)),a(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return u(n)||(n=f(n)),o(t,e,n)})),t("getMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return u(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 qt(t,e,n,i){!function(t,e,n,i){const r=[i];let s={};Kt.hasOwnMetadata(t,e)&&(s=Kt.getMetadata(t,e));let a=s[n];void 0===a&&(a=[]),a.push(...r),s[n]=a,Kt.defineMetadata(t,s,e)}(Vt,t,n.toString(),i)}function Qt(t){return(e,n,i)=>{qt(e,0,i,t)}}const Zt=(Jt=$t,t=>(e,n,i)=>Qt(new Yt(Jt,t))(e,n,i));var Jt;function te(){return function(t){return Kt.defineMetadata(Xt,null,t),t}}function ee(t){return Qt(new Yt(Gt,t))}const ne="Singleton",ie="Transient",re="ConstantValue",se="DynamicValue",ae="Factory",oe="Function",le="Instance",ue="Invalid";class he{constructor(t,e){this.id=jt.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=ue,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new he(this.serviceIdentifier,this.scope);return t.activated=t.scope===ne&&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 ce{getConstructorMetadata(t){return{compilerGeneratedMetadata:Kt.getMetadata(Xt,t),userGeneratedMetadata:Kt.getMetadata(Vt,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const de=(fe=Gt,t=>{const e=e=>{if(null==e)return!1;if(e.key===fe&&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===fe&&n[e].value===t)return!0;return!1};return e.metaData=new Yt(fe,t),e});var fe;class pe{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=ne,this}inTransientScope(){return this._binding.scope=ie,this}whenTargetNamed(t){return this._binding.constraint=de(t),this}}class ge{constructor(t){this._binding=t}to(t){return this._binding.type=le,this._binding.implementationType=t,new pe(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=se,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new pe(this._binding)}toConstantValue(t){return this._binding.type=re,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=ne,new pe(this._binding)}toFactory(t){return this._binding.type=ae,this._binding.factory=t,this._binding.scope=ne,new pe(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const me=Symbol("ContributionProvider");class be{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 ye(t,e){t(me).toDynamicValue((t=>{let{container:n}=t;return new be(e,n)})).inSingletonScope().whenTargetNamed(e)}class ve{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 xe extends ve{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 _e=Symbol.for("EnvContribution");var Se;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(Se||(Se={}));const Ae=V-1e-8;class we{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>Ae)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let a,o,l,u,h=1/0,c=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),u=n*Math.sin(t),l<h&&(h=l),l>c&&(c=l),u<d&&(d=u),u>f&&(f=u)}if(p(i),p(r),r!==i)if((i%=V)<0&&(i+=V),(r%=V)<0&&(r+=V),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=V,a=i-i%$,o=0;o<4&&a>r;++o,a-=$)p(a);else for(a=i-i%$+$,o=0;o<4&&a<r;++o,a+=$)p(a);this.bounds.add(t+h,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 Te{constructor(){this.curves=[],this.bounds=new gt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Be=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Ce={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},ke=0,Me=1,Pe=2,Ee=3,Oe=4,Le=5,Re=6,Ie=7,Ne=8;let Ue,De,ze,We,Fe,je;var He,Ge,$e,Ve,Xe,Ye,Ke,qe,Qe;function Ze(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],u=l*s,h=-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[u*x+h*_,c*x+d*_,u*w+h*T,c*w+d*T,u*S+h*A,c*S+d*A]}function Je(t,e,n,i){const r=function(t,e,n,i,r,s,a,o,l){const u=st(a),h=Math.sin(u),c=Math.cos(u),d=c*(o-t)*.5+h*(l-e)*.5,f=c*(l-e)*.5-h*(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=h/n,b=-h/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+=V:k>0&&0===s&&(k-=V);const M=Math.ceil(Math.abs(k/($+.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,h,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=Ze(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"}(He||(He={})),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"}(Ge||(Ge={})),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"}($e||($e={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Ve||(Ve={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Xe||(Xe={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Ye||(Ye={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ke||(Ke={})),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"}(qe||(qe={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Qe||(Qe={}));const tn=[(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 en(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];tn[l[0]](l,e,n,i,r,s,a)}}class nn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function rn(t,e,n,i,r){return function(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+=rt.distanceNN(s,a,o,l)}return n/2}([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function sn(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}class an extends nn{constructor(t,e,n,i){super(),this.type=qe.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 function(t,e,n,i,r){const s=sn(t.x,e.x,n.x,i.x,r),a=sn(t.y,e.y,n.y,i.y,r);return new it(s,a)}(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?rn(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Ke.ROW?Y(this.p0.x-this.p3.x):t===Ke.COLUMN?Y(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Q(t-.01,0),n=Z(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return K(r.y-i.y,r.x-i.x)}}class on extends nn{constructor(t,e){super(),this.type=qe.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return rt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=K(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()?rt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ke.ROW?Y(this.p0.x-this.p1.x):t===Ke.COLUMN?Y(this.p0.y-this.p1.y):0}}class ln{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 an(new it(this._lastX,this._lastY),new it(t,e),new it(n,i),new it(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 on(new it(this._lastX,this._lastY),new it(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===Ke.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 Y(t.p0.y-i.y)}if(t===Ke.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 Y(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class un extends ln{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 hn(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 cn(t,e,n){const i=null!=e?e:Y(n[n.length-1].x-n[0].x)>Y(n[n.length-1].y-n[0].y)?Ke.ROW:Ke.COLUMN;return"monotoneY"===t?new un(t,i):new ln(t,i)}class dn{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 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;const r=cn("linear",n,t);return function(t,e){hn(t,e)}(new dn(r,i),t),r}function pn(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 gn{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&&pn(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:pn(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 mn(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 fn(t,e);const r=cn("basis",n,t);return function(t,e){hn(t,e)}(new gn(r,i),t),r}function bn(t){return t<0?-1:1}function yn(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(bn(s)+bn(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function vn(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function xn(t,e,n,i,r){const s=t._x0,a=t._y0,o=t._x1,l=t._y1,u=(o-s)/3;t.context.bezierCurveTo(s+u,a+u*e,o-u,l-u*n,o,l,i,t.lastPoint1)}class _n{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:xn(this,this._t0,vn(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,xn(this,vn(this,e=yn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:xn(this,this._t0,e=yn(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 Sn extends _n{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function An(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 fn(t,e);const r=cn("monotoneX",n,t);return function(t,e){hn(t,e)}(new _n(r,i),t),r}function wn(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 fn(t,e);const r=cn("monotoneY",n,t);return function(t,e){hn(t,e)}(new Sn(r,i),t),r}let Tn=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;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 Bn(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 ln("step",null!=i?i:Y(t[t.length-1].x-t[0].x)>Y(t[t.length-1].y-t[0].y)?Ke.ROW:Ke.COLUMN);return function(t,e){hn(t,e)}(new Tn(s,e,r),t),s}class Cn extends dn{lineEnd(){this.context.closePath()}}function kn(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=cn("linear",n,t);return function(t,e){hn(t,e)}(new Cn(r,i),t),r}function Mn(t,e,n,i,r){let s=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>H){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>H){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 Pn(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 fn(n,r);const o=cn(t,s,n);return hn(new e(o,i,a),n),o}}const En=Pn("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:Mn(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 On=Pn("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:Mn(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 Ln extends Te{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new we(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Re,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Le,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Ie,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([Pe,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([Me,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([Oe,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([Ne,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([ke,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([Ee]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Re]=t=>`M${t[1]} ${t[2]}`,t[Le]=t=>`L${t[1]} ${t[2]}`,t[Ie]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Pe]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ke]=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,u=(n-e)/l;for(let n=0;n<l;n++){const o=e+u*n,l=e+u*(n+1),h=4*Math.tan(Math.abs(u)/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*h*c,_=a*h*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[Ne]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Ee]=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(Ue=e[t],De=Ue.slice(1),ze=Ue[0],n=[ze],i=De.match(Be),null!==i){for(let t=0,e=i.length;t<e;t++)We=i[t],Fe=parseFloat(We),Number.isNaN(Fe)||n.push(Fe);if(je=Ce[ze],n.length-1>je){let t,e=ze;for(let i=1,s=n.length;i<s;i+=je){t=[e];for(let e=i,r=i+je;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 fn(t,n);case"basis":return mn(t,n);case"monotoneX":return An(t,n);case"monotoneY":return wn(t,n);case"step":return Bn(t,.5,n);case"stepBefore":return Bn(t,0,n);case"stepAfter":return Bn(t,1,n);case"catmullRom":return En(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return On(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return kn(t,n)}}(e,n);"x"===i?this.direction=Ke.ROW:"y"===i?this.direction=Ke.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[Re]=this.moveToTransform,t[Le]=this.lineToTransform,t[Ie]=this.quadraticCurveToTransform,t[Pe]=this.bezierCurveToTransform,t[Me]=this.arcToTransform,t[Oe]=this.ellipseTransform,t[Ne]=this.rectTransform,t[ke]=this.arcTransform,t[Ee]=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,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,h=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===u||(e=In(e,l,u)),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],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+o,c+e[1]+a,d+e[2]+o,n+a,i+o),f=c+e[1],p=d+e[2],c=n,d=i;break;case"S":n=e[3],i=e[4],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+o,e[1]+a,e[2]+o,n+a,i+o),c=n,d=i,f=e[1],p=e[2];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===h[0].match(/[QqTt]/)?(f=c,p=d):"t"===h[0]?(f=2*c-r,p=2*d-s):"q"===h[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":Je(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":Je(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()}h=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 Le:this.lineToTransform(a,e,n,i,r);break;case Re:this.moveToTransform(a,e,n,i,r);break;case Pe:this.bezierCurveToTransform(a,e,n,i,r);break;case Ie:this.quadraticCurveToTransform(a,e,n,i,r);break;case ke:this.arcToTransform(a,e,n,i,r);break;case Oe:this.ellipseTransform(a,e,n,i,r);break;case Ne:this.rectTransform(a,e,n,i,r);break;case Me:this.arcToTransform(a,e,n,i,r);break;case Ee:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),en(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ke.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Y(t.p0.y-e.p1.y)}if(this.direction===Ke.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Y(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,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)}}}const Rn=["l",0,0,0,0,0,0,0];function In(t,e,n){const i=Rn[0]=t[0];if("a"===i||"A"===i)Rn[1]=e*t[1],Rn[2]=n*t[2],Rn[3]=t[3],Rn[4]=t[4],Rn[5]=t[5],Rn[6]=e*t[6],Rn[7]=n*t[7];else if("h"===i||"H"===i)Rn[1]=e*t[1];else if("v"===i||"V"===i)Rn[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)Rn[i]=(i%2==1?e:n)*t[i];return Rn}const Nn={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 bt},Un={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Dn=Object.assign({outerBorder:Object.assign(Object.assign({},Un),{distance:0}),innerBorder:Object.assign(Object.assign({},Un),{distance:0})},Un),zn={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:Se.fontBounding,keepCenterInLine:!1},Wn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Dn),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Fn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},jn=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},{_debug_bounds:!1}),Wn),Nn),Hn=Object.assign(Object.assign({},jn),{startAngle:0,endAngle:X,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Gn=Object.assign(Object.assign(Object.assign({},jn),Fn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),$n=Object.assign(Object.assign({},jn),{radius:1,startAngle:0,endAngle:X}),Vn=Object.assign(Object.assign({},jn),{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}),Xn=Object.assign(Object.assign({},jn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Yn=Object.assign(Object.assign(Object.assign({},jn),Fn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Kn=Object.assign(Object.assign({},jn),{path:new Ln,fillStrokeOrder:1,customPath:()=>{F.getInstance().warn("空函数")}}),qn=Object.assign(Object.assign({},jn),{points:[],cornerRadius:0,closePath:!0}),Qn=Object.assign(Object.assign({},jn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},jn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Zn=Object.assign(Object.assign({},jn),{symbolType:"circle",size:10,keepDirIn3d:!0}),Jn=Object.assign(Object.assign(Object.assign({},jn),zn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ti=Object.assign(Object.assign(Object.assign({},jn),zn),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),ei=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},jn),{fill:!0,cornerRadius:0}),ni=Object.assign(Object.assign({},ei),{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 ii=new class{},ri=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()||u()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=p()||u()),t}();if(t)t.at=h();else{const e=u();if(e){t=e;const n=h();n&&(t.at=n)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function u(){return m("extent-keyword",t.extentKeywords,1)}function h(){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 si{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(si.IsGradientStr(t))try{const e=ri(t)[0];if(e){if("linear"===e.type)return si.ParseLinear(e);if("radial"===e.type)return si.ParseRadial(e);if("conic"===e.type)return si.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,i=G/2,r=parseFloat(e.value)/180*G-i;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+X,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=G/2;let r="angular"===e.type?parseFloat(e.value)/180*G:0;for(;r<0;)r+=X;for(;r>=X;)r-=X;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<G?(s=0,a=0,o=Math.cos(r-i),l=Math.sin(r-i)):r<G+i?(s=1,a=0,o=s-Math.sin(r-G),l=Math.cos(r-G)):(s=1,o=s-Math.cos(r-i-G),l-=Math.sin(r-i-G)),{gradient:"linear",x0:s,y0:a,x1:o,y1:l,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function ai(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),u=Math.sign(o)*Math.sqrt(a*a+o*o);return l+u===0?0:(i=i/Math.abs(l+u)*2*n,i)}function oi(t,e,n){let i,r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e||!0===e)return"black";if(m(e))for(let t=0;t<e.length&&(r=e[t],!r);t++);else r=e;if(r=si.Parse(r),"string"==typeof r)return r;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let o=e.x2-e.x1,l=e.y2-e.y1,u=e.x1-s,h=e.y1-a;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;o/=t,l/=e,u/=t,h/=e}"linear"===r.gradient?i=function(t,e,n,i,r,s){var a,o,l,u;const h=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!==(u=e.y1)&&void 0!==u?u:0)*s);return e.stops.forEach((t=>{h.addColorStop(t.offset,t.color)})),h}(t,r,u,h,o,l):"conical"===r.gradient?i=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,r,u,h,o,l):"radial"===r.gradient&&(i=function(t,e,n,i,r,s){var a,o,l,u,h,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!==(u=e.x1)&&void 0!==u?u:.5)*r,i+(null!==(h=e.y1)&&void 0!==h?h:.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,r,u,h,o,l))}return i||"orange"}const li={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"}},ui=!0,hi=!1,ci=/\w|\(|\)|-/,di=/[.?!,;:/,。?!、;:]/,fi=/\S/,pi=(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 gi(t,e,n,i,r){if(!e||e<=0)return 0;const s=ii.graphicUtil.textMeasure;let a=i,o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),u=t.slice(0,a+1),h=Math.floor(s.measureText(u,n).width);for(;l>e||h<=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),u=t.slice(0,a+1),h=Math.floor(s.measureText(u,n).width)}return r&&(a=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e;for(;ci.test(t[i-1])&&ci.test(t[i])||di.test(t[i]);)if(i--,i<=0)return n?mi(t,e):e;return i}(t,a)),a}function mi(t,e){let n=e;for(;ci.test(t[n-1])&&ci.test(t[n])||di.test(t[n]);)if(n++,n>=t.length)return n;return n}function bi(t,e){const n=ii.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}const yi=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ie,this.options=e,this.id=jt.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new ce}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,Gt,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new he(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new ge(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[$t],multiInject:i.multi_inject},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};r.push(l)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case re:case oe:e=t.cache;break;case le: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===ne&&(t.cache=e,t.activated=!0)}},vi=Symbol.for("CanvasFactory");function xi(t){return yi.getNamed(vi,ii.global.env)(t)}const _i=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=xi(Object.assign({nativeCanvas:ii.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=xi(Object.assign({nativeCanvas:ii.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=[]}},Si={arc:Hn,area:Gn,circle:$n,line:Yn,path:Kn,symbol:Zn,text:Jn,rect:Qn,polygon:qn,richtext:ti,richtextIcon:ni,image:ei,group:Vn,glyph:Xn},Ai=Object.keys(Si);function wi(t,e){Object.keys(e).forEach((n=>{t[n]=e[n]}))}const Ti={arc:Object.assign({},Si.arc),area:Object.assign({},Si.area),circle:Object.assign({},Si.circle),line:Object.assign({},Si.line),path:Object.assign({},Si.path),symbol:Object.assign({},Si.symbol),text:Object.assign({},Si.text),rect:Object.assign({},Si.rect),polygon:Object.assign({},Si.polygon),richtext:Object.assign({},Si.richtext),richtextIcon:Object.assign({},Si.richtextIcon),image:Object.assign({},Si.image),group:Object.assign({},Si.group),glyph:Object.assign({},Si.glyph)};class Bi{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Ai.forEach((t=>{this._defaultTheme[t]=Object.create(Ti[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,F.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this.combinedTheme;Ai.forEach((i=>{const r=Object.create(Ti[i]);t&&t[i]&&wi(r,t[i]),n[i]&&wi(r,n[i]),e[i]&&wi(r,e[i]),this.combinedTheme[i]=r})),e.common&&Ai.forEach((t=>{wi(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 Ci=new Bi;function ki(t,e){return t.glyphHost?ki(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)):Ci.getTheme()}return null}(t)||t.attachedThemeGraphic&&ki(t.attachedThemeGraphic)||Ci.getTheme()}var Mi=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 Pi 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=jt.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 Mi(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&&F.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=l(n,!0)&&n||d(n)&&n.capture,r=d(n)&&n.once,s=u(e)?void 0:e;return t=i?`${t}capture`:t,e=u(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=l(n,!0)&&n||d(n)&&n.capture,r=u(e)?void 0:e;t=i?`${t}capture`:t,e=u(e)?e:e.handleEvent;const s=d(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 d(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 Ei{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=Ei.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const 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&&u(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&&u(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Oi extends Ei{constructor(t,e){super(),this.type=t,this.detail=e}}const Li={dispatchEvent(t){var e;if(!(t instanceof Ei))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 Oi(t,e))}};class Ri{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-Ri.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Ri.bounceIn(2*t):.5*Ri.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const i=e/X*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*X/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const i=e/X*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*X/e)+1}}static getElasticInOut(t,e){return function(n){const i=e/X*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*X/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*X/e)*.5+1}}}Ri.quadIn=Ri.getPowIn(2),Ri.quadOut=Ri.getPowOut(2),Ri.quadInOut=Ri.getPowInOut(2),Ri.cubicIn=Ri.getPowIn(3),Ri.cubicOut=Ri.getPowOut(3),Ri.cubicInOut=Ri.getPowInOut(3),Ri.quartIn=Ri.getPowIn(4),Ri.quartOut=Ri.getPowOut(4),Ri.quartInOut=Ri.getPowInOut(4),Ri.quintIn=Ri.getPowIn(5),Ri.quintOut=Ri.getPowOut(5),Ri.quintInOut=Ri.getPowInOut(5),Ri.backIn=Ri.getBackIn(1.7),Ri.backOut=Ri.getBackOut(1.7),Ri.backInOut=Ri.getBackInOut(1.7),Ri.elasticIn=Ri.getElasticIn(1,.3),Ri.elasticOut=Ri.getElasticOut(1,.3),Ri.elasticInOut=Ri.getElasticInOut(1,.3*1.5);const Ii=new class{constructor(){this.id=jt.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===Ve.END?this.removeAnimate(e):e.status===Ve.RUNNING||e.status===Ve.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ve.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 Ni{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 Ui extends Ni{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class Di{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jt.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ii,n=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e,this.status=Ve.INITIAL,this.tailAnimate=new zi(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=Q(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Di.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]:Di.mode;t&&e&Xe.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:$e.ANIMATE_PLAY})}runCb(t){const e=new Ui((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,n,i,r,s){const a=Di.interpolateMap.get(t)||Di.interpolateMap.get("");return!!a&&a(t,e,n,i,r,s)}pause(){this.status===Ve.RUNNING&&(this.status=Ve.PAUSED)}resume(){this.status===Ve.PAUSED&&(this.status=Ve.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 zi(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===Ve.INITIAL&&(this.status=Ve.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Ve.RUNNING&&(this.status=Ve.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=Ve.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()}}Di.mode=Xe.NORMAL,Di.interpolateMap=new Map;class zi{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 Wi(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?Ri[n]:n,r=this._addStep(e,null,i);return r.type=Ye.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?Ri[n]:n,s=this._addStep(e,null,r);return s.type=Ye.to,this._appendProps(t,s,!!i&&i.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),i&&i.noPreventAttrs||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=Ye.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=Ye.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 Wi(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 u=!this.reversed!=!(this.bounce&&s%2);return u&&(a=n-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,u),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 F.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 Wi{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 Fi=200,ji="cubicOut";var Hi;!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"}(Hi||(Hi={}));const Gi=[0,0,0,0],$i=t=>t?m(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Gi[0]=t[0],Gi[2]=t[0],Gi[1]=t[1],Gi[3]=t[1],Gi):t:t:0,Vi=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Xi=[1,2,3,0,1,2,3,0];function Yi(t,e,n,i){for(;t>=X;)t-=X;for(;t<0;)t+=X;for(;t>e;)e+=X;Vi[0].x=n,Vi[1].y=n,Vi[2].x=-n,Vi[3].y=-n;const r=Math.ceil(t/$)%4,s=Math.ceil(e/$)%4;if(i.add(q(t)*n,J(t)*n),i.add(q(e)*n,J(e)*n),r!==s||e-t>G){let t=!1;for(let e=0;e<Xi.length;e++)if(t||r!==Xi[e]){if(t&&s===Xi[e])break;if(t){const t=Vi[Xi[e]];i.add(t.x,t.y)}}else{t=!0;const e=Vi[r];i.add(e.x,e.y)}}}const Ki=(t,e)=>{const n=((t,e)=>g(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 qi;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(qi||(qi={}));class Qi{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qi.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===qi.Color1){const e=Qi.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;const i=kt.parseColorString(t);if(i){const e=[i.r/255,i.g/255,i.b/255,i.opacity];Qi.store1[t]=e,Qi.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=Qi.store255[t];if(i)return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n;const r=kt.parseColorString(t);return r&&(Qi.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],Qi.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===qi.Color1){if(Qi.store1[t])return;Qi.store1[t]=n,Qi.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Qi.store255[t])return;Qi.store255[t]=n,Qi.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Zi(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&y(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 Ji(t,e,n,i,r){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((r,s)=>tr(m(t)?t[s]:t,m(e)?e[s]:e,n,i))):tr(t,e,n,i,r)}function tr(t,e,n,i,r){if(!t||!e)return t&&Zi(t)||e&&Zi(e)||!1;let s,a,o=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Qi.Get(t,qi.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Qi.Get(e,qi.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:Zi(a)})))});return o?Ji(s,l,n,i,r):Ji(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:ir(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:ir(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:ir(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),Zi(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)}Qi.store255={},Qi.store1={};const er=[0,0,0,0],nr=[0,0,0,0];function ir(t,e,n){return Qi.Get(t,qi.Color255,er),Qi.Get(e,qi.Color255,nr),`rgba(${Math.round(er[0]+(nr[0]-er[0])*n)},${Math.round(er[1]+(nr[1]-er[1])*n)},${Math.round(er[2]+(nr[2]-er[2])*n)},${er[3]+(nr[3]-er[3])*n})`}class rr{static GetImage(t,e){var n;const i=rr.cache.get(t);i?"fail"===i.loadState?ii.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):rr.loadImage(t,e)}static GetSvg(t,e){var n;let i=rr.cache.get(t);i?"fail"===i.loadState?ii.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"},rr.cache.set(t,i),i.dataPromise=ii.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=rr.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"},rr.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=ii.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=ii.global.loadBlob(t):"json"===e&&(n.dataPromise=ii.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!rr.isLoading&&rr.toLoadAueue.length){rr.isLoading=!0;const t=rr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:n,marks:i}=t,r={type:"image",loadState:"init"};if(rr.cache.set(n,r),r.dataPromise=ii.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((()=>{rr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),rr.loading()})).catch((t=>{rr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),rr.loading()}))}}),0)}static loadImage(t,e){const n=sr(t,rr.toLoadAueue);if(-1!==n)return rr.toLoadAueue[n].marks.push(e),void rr.loading();rr.toLoadAueue.push({url:t,marks:[e]}),rr.loading()}static improveImageLoading(t){const e=sr(t,rr.toLoadAueue);if(-1!==e){const t=rr.toLoadAueue.splice(e,1);rr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function sr(t,e){for(let n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}rr.cache=new Map,rr.isLoading=!1,rr.toLoadAueue=[],rr.onLoadSuccessCb=[];const ar=new bt,or=new gt,lr=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ur=["x","y"],hr=["scaleX","scaleY"],cr=["angle"],dr=new it,fr={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 pr extends Pi{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(pr.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new gt,this._updateTag=He.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;dr.x=r+(null!==(n=t.scrollX)&&void 0!==n?n:0),dr.y=s+(null!==(i=t.scrollY)&&void 0!==i?i:0)}else dr.x=r,dr.y=s;return dr}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;ii.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return ii.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new mt),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,i=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,s=$i(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 we(t);return en(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 bt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&He.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&ii.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&He.UPDATE_BOUNDS)&&ii.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&He.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&He.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&He.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&He.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=He.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===Ge.GLOBAL){const n=new it(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}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):h(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]:lr;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]:lr;for(let n=0;n<e.length;n++)if(t===e[n])return!0;return!1}initAttributes(t){const e={type:$e.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=He.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:$e.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ur,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?ii.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:Nn.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:Nn.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:$e.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ur,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:$e.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,hr,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 bt,o.postMatrix=i),ii.transformUtil.fromMatrix(i,i).scale(t,e,n)}else o.scaleX=(null!==(i=o.scaleX)&&void 0!==i?i:Nn.scaleX)*t,o.scaleY=(null!==(r=o.scaleY)&&void 0!==r?r:Nn.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:$e.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,hr,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:$e.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,cr,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new bt,s.postMatrix=n),ii.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:Nn.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:$e.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,cr,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){this.animates||(this.animates=new Map);const e=new Di(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:n,onFrame:i,onEnd:r,onRemove:s}=t;null!=n&&e.onStart(n),null!=i&&e.onFrame(i),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(ii.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!h(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(),u={};let h;n.forEach((e=>{l[e]?(h||(h={}),h[e]=t[e]):u[e]=i&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(u,null!==(s=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==s?s:Fi,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:ji),h&&this.setAttributes(h,!1,{type:$e.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:$e.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();k(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?this.currentStates.indexOf(t):-1)>=0){const n=this.currentStates.filter((e=>e!==t));this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const 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|=He.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=He.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=He.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&He.UPDATE_SHAPE_AND_BOUNDS)===He.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=He.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=He.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=He.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=He.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=He.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=He.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=He.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&He.UPDATE_LAYOUT)}getAnchor(t,e){const n=[0,0],i=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:n,angle:i}=this.attribute;return or.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(or),this.setAttributes({scaleX:t,scaleY:n,angle:i}),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=Nn.x,y:e=Nn.y,scaleX:n=Nn.scaleX,scaleY:i=Nn.scaleY,angle:r=Nn.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const u={};if(a&&(l=this.getAnchor(a,u)),!s||1===n&&1===i)!function(t,e,n,i,r,s,a,o){const l=e.a,u=e.b,h=e.c,c=e.d,d=e.e,f=e.f,p=q(a),g=J(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+h*g,_=u*p+c*g,S=h*p-l*g,A=c*p-u*g;t.a=r*x,t.b=r*_,t.c=s*S,t.d=s*A,t.e=d+l*m+h*b-x*y-S*v,t.f=f+u*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,u),ii.transformUtil.fromMatrix(a,a).scale(n,i,{x:l[0],y:l[1]})}const h=this.getOffsetXY(Nn);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,o){const t=ar.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),ii.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:$e.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:$e.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,u){u||(u=Object.keys(a),i.propKeys=u),s?i.propKeys.forEach((t=>{e.validAttr(t)&&(n[t]=a[t])})):u.forEach((s=>{var u;if(!e.validAttr(s))return;const h=a[s],c=null!==(u=o&&o[s])&&void 0!==u?u:t.getLastPropByName(s,i);if(null==h||null==c||h===c)return void(n[s]=h);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,c,h,n),d||(d=e.customInterpolate(s,r,c,h,this,n),d||this.defaultInterpolate(h,c,s,n,l,r)||this._interpolate(s,r,c,h,n))})),i.parsedProps=l}defaultInterpolate(t,e,n,i,r,s){if(Number.isFinite(t))return i[n]=e+(t-e)*s,!0;if("fill"===n){r||(r={});const a=r.fillColorArray,o=Ji(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=Ji(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=Ji(e,null!=a?a:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(i[n]=o),!0}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:ii.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return g(t,!0)?this.pathProxy=(new Ln).fromString(t):this.pathProxy=new Ln,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")?(rr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(x(t)||t.includes("/")||_(t))&&(rr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):d(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",ii.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new Oi(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)}}}pr.mixin(Li);class gr{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 mr(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function br(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 u=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:u}}const yr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class vr{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,yr),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 gr("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=mr(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=br(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=mr(t,"--\x3e",s+4,"Comment is not closed.");else{const a=br(t,s,!1);let o=a.tagName,l=a.tagExp;const u=a.attrExpPresent,h=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 gr(o);o!==l&&u&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new gr(o);this.tagsNodeStack.push(n),o!==l&&u&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),n=t}i="",s=h}else i+=t[s];return e.child}}function xr(t,e){return _r(t)}function _r(t,e){const n={};for(let e=0;e<t.length;e++){const r=t[e],s=Sr(r);if(void 0!==s&&r[s]){const t=_r(r[s]);i=t,Object.keys(i).length,r[":@"]&&Ar(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 Sr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Ar(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 wr{constructor(t){this.options=Object.assign({},wr.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return xr(new vr(this.options).parseXml(t),this.options)}}function Tr(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}wr.defaultOptions={};let Br=0;function Cr(){return Br++}var kr;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(kr||(kr={}));const Mr=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Mr.set(t,!0)));const Pr=new Map;function Er(t){if(Mr.has(t))return!0;if(Pr.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Pr.set(t,!0)));const Or=Cr();Cr(),Cr(),Cr(),Cr();const Lr=Cr(),Rr=Cr();Cr(),Cr(),Cr(),Cr();const Ir=Cr();Cr();const Nr=Cr(),Ur=Cr(),Dr=Cr(),zr=Symbol.for("GraphicCreator"),Wr={"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"},Fr=Object.keys(Wr);var jr;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(jr||(jr={}));let Hr=class t extends pr{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Lr,this._childUpdateTag=He.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 Bi),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Bi)}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===Ge.GLOBAL){const n=new it(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&He.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;ii.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),ii.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Nn.x,y:e=Nn.y,dx:n=Nn.dx,dy:i=Nn.dy,scaleX:r=Nn.scaleX,scaleY:s=Nn.scaleY,angle:a=Nn.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 ki(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 ii.graphicService.updateTempAABBBounds(n),ii.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&=He.CLEAR_BOUNDS,this._childUpdateTag&=He.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=He.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&He.UPDATE_BOUNDS||(this._childUpdateTag|=He.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(),ii.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),ii.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,ii.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{ii.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),ii.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&He.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=ii.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}};function Gr(t){return new Hr(t)}function $r(t,e){return!(!t&&!e)}function Vr(t,e){let n;return n=m(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function Xr(t,e,n){return n&&t*e>0}function Yr(t,e){return t*e>0}Hr.NOWORK_ANIMATE_ATTR=fr;const Kr=Symbol.for("ImageRenderContribution"),qr=Symbol.for("RectRenderContribution"),Qr=Symbol.for("SymbolRenderContribution"),Zr=Symbol.for("TextRenderContribution"),Jr=Symbol.for("InteractiveSubRenderContribution");function ts(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function es(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 ns(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 is(t,e,n){const i=n[0],r=n[1],s=n[2];let a,o,l,u,h,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],u=e[3],h=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]=u,t[4]=h,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+h*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]=u*i+f*r+b*s+e[15]),t}function rs(t,e,n){const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],h=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*u+_*f+S*b,t[3]=v*a+x*h+_*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*u+_*f+S*b,t[7]=v*a+x*h+_*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*u+_*f+S*b,t[11]=v*a+x*h+_*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*u+_*f+S*b,t[15]=v*a+x*h+_*p+S*y,t}class ss{constructor(){this.pools=[]}static identity(t){return ns(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 ss.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 as=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new bt(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 bt(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=[]}},os=new ss;var ls=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},us=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hs=function(t,e){return function(n,i){e(n,i,t)}};function cs(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:u=n.dz,scaleX:h=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(ns(t),is(t,t,[r+o,s+l,a+u]),is(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],u=e[8],h=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+u*i,t[5]=a*r+h*i,t[6]=o*r+c*i,t[7]=l*r+d*i,t[8]=u*r-s*i,t[9]=h*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],u=e[8],h=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-u*i,t[1]=a*r-h*i,t[2]=o*r-c*i,t[3]=l*r-d*i,t[8]=s*i+u*r,t[9]=a*i+h*r,t[10]=o*i+c*r,t[11]=l*i+d*r}(t,t,f),is(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,[h,c,d]),g){const n=os.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]}is(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],u=e[4],h=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+u*i,t[1]=a*r+h*i,t[2]=o*r+c*i,t[3]=l*r+d*i,t[4]=u*r-s*i,t[5]=h*r-a*i,t[6]=c*r-o*i,t[7]=d*r-l*i}(n,n,g),is(n,n,[-i[0],-i[1],0]),rs(t,t,n)}}let ds=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new xe(["graphic"]),onSetStage:new xe(["graphic","stage"]),onRemove:new xe(["graphic"]),onRelease:new xe(["graphic"]),onAddIncremental:new xe(["graphic","group","stage"]),onClearIncremental:new xe(["graphic","group","stage"]),beforeUpdateAABBBounds:new xe(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new xe(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new xe(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new gt,this.tempAABBBounds2=new gt}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 we(t);return en(n.commandList,i,0,0),!0}updateHTMLTextAABBBounds(t,e,n,i){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=y(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),i=es(s,e,e);n.set(n.x1,i,n.x2,i+e)}if(null!=t.forceBoundsWidth){const e=y(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),i=ts(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:u=n.pickStrokeBuffer,strokeBoundsBuffer:h=n.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){Tr(c,(l+u)/Math.abs(r+s),i,h),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;Tr(c,o/Math.abs(r+s)*2,!1,h+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&&ft(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),ii.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}}};ds=ls([te(),hs(0,Zt(zr)),us("design:paramtypes",[Object])],ds);const fs={x:0,y:0,z:0,lastModelMatrix:null};class ps{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Qe.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Qe.afterFillStroke)))}beforeRenderStep(t,e,n,i,r,s,a,o,l,u,h,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,u,h,c,d)}))}afterRenderStep(t,e,n,i,r,s,a,o,l,u,h,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,u,h,c,d)}))}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:u=e.lineWidth,strokeOpacity:h=e.strokeOpacity,visible:c=e.visible}=t.attribute,d=Xr(o,l,r),f=Yr(o,h),p=$r(r,s),g=Vr(a,u);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:u=e.angle,postMatrix:h}=t.attribute,c=n.modelMatrix,d=n.camera;fs.x=r,fs.y=s,fs.z=a,fs.lastModelMatrix=c;const f=d&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t)),p=f?t.transMatrix.onlyTranslate()&&!h:1===o&&1===l&&0===u&&!h;if(f){const i=os.allocate(),r=os.allocate();cs(r,t,e),rs(i,c||i,r),fs.x=0,fs.y=0,fs.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),os.free(r)}if(p&&!c){const i=t.getOffsetXY(e);fs.x+=i.x,fs.y+=i.y,fs.z=a,n.setTransformForCurrent()}else if(f)fs.x=0,fs.y=0,fs.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(d&&n.project){const i=t.getOffsetXY(e);fs.x+=i.x,fs.y+=i.y,this.transformWithoutTranslate(n,fs.x,fs.y,fs.z,o,l,u)}else n.transformFromMatrix(t.transMatrix,!0),fs.x=0,fs.y=0,fs.z=0;return fs}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),u={x:0,y:0},h={x:r,y:0},c={x:r,y:s};i.camera=null;const d=1/(u.x*(c.y-h.y)-h.x*c.y+c.x*h.y+(h.x-c.x)*u.y),f=-(u.y*(l.x-o.x)-h.y*l.x+c.y*o.x+(h.y-c.y)*a.x)*d,p=(h.y*l.y+u.y*(o.y-l.y)-c.y*o.y+(c.y-h.y)*a.y)*d,g=(u.x*(l.x-o.x)-h.x*l.x+c.x*o.x+(h.x-c.x)*a.x)*d,m=-(h.x*l.y+u.x*(o.y-l.y)-c.x*o.y+(c.x-h.x)*a.y)*d,b=(u.x*(c.y*o.x-h.y*l.x)+u.y*(h.x*l.x-c.x*o.x)+(c.x*h.y-h.x*c.y)*a.x)*d,y=(u.x*(c.y*o.y-h.y*l.y)+u.y*(h.x*l.y-c.x*o.y)+(c.x*h.y-h.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:u,z:h,lastModelMatrix:c}=o;this.z=h,function(t,e,n,i,r,s,a,o){if(!t.pathProxy)return!1;const l=ki(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:u=l.fill,stroke:h=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=Xr(c,d,u),v=Yr(c,p),x=$r(u),_=Vr(h,f);return!g||(!x&&!_||(!(y||v||a||o)||(e.beginPath(),en(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),_&&(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())),!0)))}(t,s,l,u,0,r)||(this.drawShape(t,s,l,u,i,r),this.z=0,s.modelMatrix!==c&&os.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}var gs=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},ms=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bs=function(t,e){return function(n,i){e(n,i,t)}};class ys{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,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}=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=ki(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,this.doDrawImage(e,r.data,s,b,y),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,r){if("no-repeat"===i)t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{const s=n.width(),a=n.height();let o=s,l=a;if(r&&"repeat"!==i&&(e.width||e.height)){const n=e.width,r=e.height;"repeat-x"===i?(o=n*(a/r),l=a):"repeat-y"===i&&(l=r*(s/n),o=s);const u=t.dpr,h=_i.allocate({width:o,height:l,dpr:u}),c=h.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,o,l),c.drawImage(e,0,0,o,l),e=h.nativeCanvas),_i.free(h)}const u=t.dpr,h=t.createPattern(e,i);h.setTransform&&h.setTransform(new DOMMatrix([1/u,0,0,1/u,0,0])),t.fillStyle=h,t.translate(n.x1,n.y1),t.fillRect(0,0,s,a),t.translate(-n.x1,-n.y1)}}}const vs=new ys;let xs=class{constructor(t){this.subRenderContribitions=t,this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,a,o,l,u,h,c,d)}))}};xs=gs([te(),bs(0,Zt(me)),bs(0,ee(Jr)),ms("design:paramtypes",[Object])],xs);const _s=new class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,a=i.dpr,o=_i.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 u=i.createPattern(o.nativeCanvas,"repeat");return u.setTransform&&u.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),_i.free(o),u}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,X),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,u,h,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){let u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(o,l,a,n);break;case"diamond":u=this.createDiamondPattern(o,l,a,n);break;case"rect":u=this.createRectPattern(o,l,a,n);break;case"vertical-line":u=this.createVerticalLinePattern(o,l,a,n);break;case"horizontal-line":u=this.createHorizontalLinePattern(o,l,a,n);break;case"bias-lr":u=this.createBiasLRLinePattern(o,l,a,n);break;case"bias-rl":u=this.createBiasRLLinePattern(o,l,a,n);break;case"grid":u=this.createGridPattern(o,l,a,n)}u&&(n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,s),n.fillStyle=u,n.fill(),n.highPerformanceRestore())}},Ss=G/2;function As(t,e,n,i,r,s,a){let o;if(i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),y(s,!0))o=[s=Y(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,n;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=Y(t[0]),o=[e,e,e,e];break;case 2:case 3:e=Y(t[0]),n=Y(t[1]),o=[e,n,e,n];break;default:o=t,o[0]=Y(o[0]),o[1]=Y(o[1]),o[2]=Y(o[2]),o[3]=Y(o[3])}}else o=[0,0,0,0];if(i<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,n,i,r);const[l,u,h,c]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],d=Math.min(i/2,r/2),f=[Math.min(d,o[0]),Math.min(d,o[1]),Math.min(d,o[2]),Math.min(d,o[3])],p=[l[0]+f[0],l[1]],g=[l[0],l[1]+f[0]],m=[u[0]-f[1],u[1]],b=[u[0],u[1]+f[1]],v=[h[0]-f[2],h[1]],x=[h[0],h[1]-f[2]],_=[c[0]+f[3],c[1]],S=[c[0],c[1]-f[3]];if(t.moveTo(p[0],p[1]),a&&a[0]?a[0](p[0],p[1],m[0],m[1]):t.lineTo(m[0],m[1]),!U(m,b)){a&&a[0]&&t.moveTo(m[0],m[1]);const e=m[0],n=m[1]+f[1];t.arc(e,n,f[1],-Ss,0,!1)}if(a&&a[1]?a[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),!U(v,x)){const e=x[0]-f[2],n=x[1];a&&a[1]&&t.moveTo(x[0],x[1]),t.arc(e,n,f[2],0,Ss,!1)}if(a&&a[2]?a[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!U(_,S)){const e=_[0],n=_[1]-f[3];a&&a[2]&&t.moveTo(_[0],_[1]),t.arc(e,n,f[3],Ss,G,!1)}if(a&&a[3]?a[3](S[0],S[1],g[0],g[1]):t.lineTo(g[0],g[1]),!U(p,g)){const e=p[0],n=p[1]+f[0];a&&a[3]&&t.moveTo(g[0],g[1]),t.arc(e,n,f[0],G,G+Ss,!1)}return!a&&t.closePath(),t}var ws=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 Ts{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{cornerRadius:b=l.cornerRadius,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:u=l[s].distance}=r,h=T?u:ai(e,u,e.dpr),d=n+o*h,f=i+o*h,p=2*h;if(0===b||m(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(d,f,B-o*p,C-o*p)):(e.beginPath(),As(e,d,f,B-o*p,C-o*p,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 Bs=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};Bs=ws([te()],Bs);let Cs=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){const{x1:d,y1:f,x:p=l.x,y:g=l.y,stroke:b=l.stroke,cornerRadius:y=l.cornerRadius}=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(b)&&b.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),!(0===y||m(y)&&y.every((t=>0===t)))){let r,s=0;return As(e,n,i,v,x,y,new Array(4).fill(0).map(((a,o)=>(a,u,h,c)=>{b[o]&&(s===o-1&&b[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:b[o]}),n,i,l),e.beginPath(),e.moveTo(a,u),r=b[o]),s=o,e.lineTo(h,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,i),b[0]?e.lineTo(n+v,i):e.moveTo(n+v,i),b[1]?e.lineTo(n+v,i+x):e.moveTo(n+v,i+x),b[2]?e.lineTo(n,i+x):e.moveTo(n,i+x),b[3]){const t=b[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};Cs=ws([te()],Cs);const ks=new Ts,Ms=_s,Ps=vs;const Es=new class extends Ts{constructor(){super(...arguments),this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){return super.drawShape(t,e,n,i,r,s,a,o,l,u,h,c)}},Os=vs;const Ls=new class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,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,u=A?o:ai(e,o,e.dpr),h="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,b,n,i,h*u)&&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")}},Rs=_s,Is=vs;var Ns=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},Us=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ds=function(t,e){return function(n,i){e(n,i,t)}};let zs=class extends ps{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Ir,this.builtinContributions=[ks,Ps,Ms],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const u=null!==(l=this.tempTheme)&&void 0!==l?l:ki(t,null==s?void 0:s.theme).rect,{fill:h=u.fill,background:c,stroke:d=u.stroke,cornerRadius:f=u.cornerRadius,opacity:p=u.opacity,fillOpacity:g=u.fillOpacity,lineWidth:b=u.lineWidth,strokeOpacity:y=u.strokeOpacity,visible:v=u.visible,x1:x,y1:_,x:S=u.x,y:A=u.y,fillStrokeOrder:w=u.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}(p,g,T,B,h),k=function(t,e,n,i){return t*e>0&&0!==n&&0!==i}(p,y,T,B),M=$r(h,c),P=Vr(d,b);if(!t.valid||!v)return;if(!M&&!P)return;if(!(C||k||a||o||c))return;0===f||m(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(n,i,T,B)):(e.beginPath(),As(e,n,i,T,B,f));const E={doFill:M,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,M,P,C,k,u,r,a,o,E);const O=()=>{E.doFill&&(a?a(e,t.attribute,u):C&&(e.setCommonStyle(t,t.attribute,S-n,A-i,u),e.fill()))},L=()=>{E.doStroke&&(o?o(e,t.attribute,u):k&&(e.setStrokeStyle(t,t.attribute,S-n,A-i,u),e.stroke()))};w?(L(),O()):(O(),L()),this.afterRenderStep(t,e,n,i,M,P,C,k,u,r,a,o)}draw(t,e,n,i){const r=ki(t,null==i?void 0:i.theme).rect;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}};zs=Ns([te(),Ds(0,Zt(me)),Ds(0,ee(qr)),Us("design:paramtypes",[Object])],zs);var Ws=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},Fs=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},js=function(t,e){return function(n,i){e(n,i,t)}};let Hs=class extends ps{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Ur,this.builtinContributions=[Ls,Is,Rs],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const u=ki(t,null==s?void 0:s.theme).symbol,{size:h=u.size,x:c=u.x,y:d=u.y,scaleX:f=u.scaleX,scaleY:p=u.scaleY,fillStrokeOrder:g=u.fillStrokeOrder}=t.attribute,b=this.valid(t,u,a,o);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:A=u.keepDirIn3d}=t.attribute,w=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();const T=(r,s)=>{var l,h,m;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!==(h=s.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(m=s.stroke)&&void 0!==m?m:t.attribute.stroke,s=e}const b=()=>{s.fill&&(a?a(e,t.attribute,u):(e.setCommonStyle(t,s,c-n,d-i,u),e.fill()))},y=()=>{s.stroke&&(o?o(e,t.attribute,u):(e.setStrokeStyle(t,s,(c-n)/f,(d-i)/p,u),e.stroke()))};g?(y(),b()):(b(),y())};if(A&&e.camera&&e.project){const t=e.project(n,i,w),r=e.camera;e.camera=null,!1===S.draw(e,m(h)?[h[0]*f,h[1]*p]:h*f,t.x,t.y,void 0,T)&&e.closePath(),e.camera=r}else!1===S.draw(e,h,n,i,w,T)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,x,_,y,v,u,r,a,o);const B=()=>{x&&!S.isSvg&&(a?a(e,t.attribute,u):y&&(e.setCommonStyle(t,t.attribute,c-n,d-i,u),e.fill()))},C=()=>{_&&!S.isSvg&&(o?o(e,t.attribute,u):v&&(e.setStrokeStyle(t,t.attribute,(c-n)/f,(d-i)/p,u),e.stroke()))};g?(C(),B()):(B(),C()),this.afterRenderStep(t,e,n,i,x,_,y,v,u,r,a,o)}draw(t,e,n,i){const r=ki(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}};Hs=Ws([te(),js(0,Zt(me)),js(0,ee(Qr)),Fs("design:paramtypes",[Object])],Hs);const Gs=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new gt)}allocate(t,e,n,i){if(!this.pools.length)return(new gt).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 gt(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 $s=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 Vs;function Xs(t){return Vs||(Vs=$s.CreateGraphic("text",{})),Vs.initAttributes(t),Vs.AABBBounds}const Ys=new class extends ys{constructor(){super(...arguments),this.time=Qe.beforeFillStroke}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){var f,p,g,m,b,y,v,x,_,S;const{backgroundMode:A=l.backgroundMode,backgroundFit:w=l.backgroundFit}=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=d(B)&&B.background,P=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,n=(null!==(f=B.x)&&void 0!==f?f:e.x1)+(null!==(p=B.dx)&&void 0!==p?p:0),i=(null!==(g=B.y)&&void 0!==g?g:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),r=null!==(b=B.width)&&void 0!==b?b:e.width(),s=null!==(y=B.height)&&void 0!==y?y:e.height();if(k=Gs.allocate(n,i,n+r,i+s),B=B.background,!P){const t=k.width(),e=k.height();k.set((null!==(v=B.x)&&void 0!==v?v:0)+(null!==(x=B.dx)&&void 0!==x?x:0),(null!==(_=B.y)&&void 0!==_?_:0)+(null!==(S=B.dy)&&void 0!==S?S:0),t,e)}}else k=t.AABBBounds,P||(k=Xs(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,A,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?(As(e,k.x1,k.y1,k.width(),k.height(),r),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}M&&Gs.free(k),C()}};var Ks=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},qs=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qs=function(t,e){return function(n,i){e(n,i,t)}};let Zs=class extends ps{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Dr,this.builtinContributions=[Ys],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l,u,h;const c=ki(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=Ki(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,u)=>{let h=n+s;const d=i+l;if(u){e.highPerformanceSave(),h+=b;const t=as.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,h,d),e.transformFromMatrix(t,!0),as.free(t)}B&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,c),e.strokeText(r,h,d,k))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,v-n,x-i,c),e.fillText(r,h,d,k))),u&&(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!==(u=t.getBaselineMapAlign()[i])&&void 0!==u?u:"left",i=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"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=Q(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=ki(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,u,c){if(e+t<=0)return;const{textAlign:d=l.textAlign,fill:f=l.fill,opacity:p=l.opacity,underlineOffset:g=l.underlineOffset,underlineDash:m=l.underlineDash,fillOpacity:b=l.fillOpacity}=n.attribute,y=!h(c),v=y?c.width:n.clipedWidth,x=y?0:ts(d,v),_={lineWidth:0,stroke:f,opacity:p,strokeOpacity:b};if(t){_.lineWidth=t,u.setStrokeStyle(n,_,i,r,l),m&&u.setLineDash(m),u.beginPath();const e=r+s+g;u.moveTo(i+x,e,o),u.lineTo(i+x+v,e,o),u.stroke()}if(e){_.lineWidth=e,u.setStrokeStyle(n,_,i,r,l),u.beginPath();const t=r+a;u.moveTo(i+x,t,o),u.lineTo(i+x+v,t,o),u.stroke()}}};Zs=Ks([te(),Qs(0,Zt(me)),Qs(0,ee(Zr)),qs("design:paramtypes",[Object])],Zs);var Js=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},ta=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ea=function(t,e){return function(n,i){e(n,i,t)}};const na=["","repeat-x","repeat-y","repeat"];let ia=class extends ps{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Rr,this.builtinContributions=[Es,Os],this.init(t)}drawShape(t,e,n,i,r,s,a,o){const l=ki(t).image,{width:u=l.width,height:h=l.height,repeatX:c=l.repeatX,repeatY:d=l.repeatY,x:f=l.x,y:p=l.y,cornerRadius:g=l.cornerRadius,fillStrokeOrder:b=l.fillStrokeOrder,image:y}=t.attribute,v=this.valid(t,l,a);if(!v)return;const{fVisible:x,sVisible:_,doFill:S,doStroke:A}=v;if(!y||!t.resources)return;const w=t.resources.get(y);if("success"!==w.state)return;let T=!1;0===g||m(g)&&g.every((t=>0===t))||(e.beginPath(),As(e,n,i,u,h,g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(S)if(a)a(e,t.attribute,l);else if(x){e.setCommonStyle(t,t.attribute,n,i,l);let r=0;if("repeat"===c&&(r|=1),"repeat"===d&&(r|=2),r){const t=e.createPattern(w.data,na[r]);e.fillStyle=t,e.translate(n,i,!0),e.fillRect(0,0,u,h),e.translate(-n,-i,!0)}else e.drawImage(w.data,n,i,u,h)}},C=()=>{A&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,f-n,p-i,l),e.stroke()))};b?(C(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,S,!1,x,!1,l,r,a),B(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,S,!1,x,!1,l,r,a),B(),T&&e.restore(),C()),this.afterRenderStep(t,e,n,i,S,!1,x,!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&&g(i))return void rr.improveImageLoading(i);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=ki(t).image;this._draw(t,a,!1,n)}};ia=Js([te(),ea(0,Zt(me)),ea(0,ee(Kr)),ta("design:paramtypes",[Object])],ia);const ra=Symbol.for("GraphicRender"),sa=Symbol.for("RectRender"),aa=Symbol.for("SymbolRender"),oa=Symbol.for("TextRender"),la=Symbol.for("RichTextRender"),ua=Symbol.for("ImageRender"),ha=(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 ca{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:u=Se.actualBounding,keepCenterInLine:h=!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,u);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:h})}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,u);e=s.width,i=Math.max(i,e),c.push({str:n,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:h})}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 da=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...lr];let fa=class t extends pr{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=Dr,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return m(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return ki(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=ut(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}=ii.graphicService.updateTempAABBBounds(n),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){Tr(r,o/Math.abs(s+a),!0,l),n.union(r)}return ii.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ii.graphicService.updateHTMLTextAABBBounds(t,e,n),ft(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:u=n.ellipsis,maxLineWidth:h,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 _=ii.graphicUtil.textMeasure,S=new ca(r,{fontSize:o,fontWeight:l,fontFamily:r,lineHeight:x},_).GetLayoutByLines(t,s,a,x,!0===u?n.ellipsis:u||void 0,!1,{lineWidth:h,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:u=r.ellipsis,maxLineWidth:h,stroke:c=r.stroke,lineWidth:d=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:p=r.fontWeight,ignoreBuf:g=r.ignoreBuf,measureMode:b=r.measureMode,suffixPosition:y=r.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=r.keepCenterInLine}=this.attribute,S=g?0:this.guessLineHeightBuf(l),A=this.getLineHeight(this.attribute,r,S);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 w=ii.graphicUtil.textMeasure,T={fontSize:l,fontWeight:p,fontFamily:s,lineHeight:A},B=new ca(s,T,w),C=m(t)?t.map((t=>t.toString())):[t.toString()],k=[],M=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/A),1)),x&&(P=Math.min(P,x)),"number"==typeof h&&h!==1/0){if(h>0)for(let t=0;t<C.length;t++){const e=C[t];let r=!0;if(t===P-1){const n=w.clipTextWithSuffix(e,T,h,u,!1,y,t!==C.length-1),i=w.measureTextPixelADscentAndWidth(n.str,T,b);k.push({str:n.str,width:n.width,ascent:i.ascent,descent:i.descent,keepCenterInLine:_});break}const s=w.clipText(e,T,h,"break-all"!==f,"keep-all"===f);if(""!==e&&""===s.str||s.wordBreaked){if(u){const t=w.clipTextWithSuffix(e,T,h,u,!1,y);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=w.measureTextPixelADscentAndWidth(s.str,T,b);k.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});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,"")),C.splice(t+1,0,n)}}let t=0;k.forEach((e=>{t=Math.max(t,e.width)})),M[0]=t}else{let t,e,n=0;for(let i=0,r=C.length;i<r;i++){if(i===P-1){const t=w.clipTextWithSuffix(C[i],T,h,u,!1,y),e=w.measureTextPixelADscentAndWidth(t.str,T,b);k.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),n=Math.max(n,t.width);break}e=C[i],t=w.measureTextWidth(e,T),n=Math.max(n,t);const r=w.measureTextPixelADscentAndWidth(e,T,b);k.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:_})}M[0]=n}M[1]=k.length*A;const E={xOffset:0,yOffset:0,width:M[0],height:M[1]};B.LayoutBBox(E,a,o,k);const O=B.layoutWithBBox(E,k,a,o,A);return this.cache.layoutData=O,this.clearUpdateShapeTag(),this._AABBBounds.set(E.xOffset,E.yOffset,E.xOffset+E.width,E.yOffset+E.height),c&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var n,i;const r=this.getGraphicTheme(),s=ii.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=r.maxLineWidth,ellipsis:u=r.ellipsis,fontFamily:h=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=Q(e,a)}));const t=ts(y,a),e=this.cache.verticalList.length*b,n=es(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++)Er(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:kr.VERTICAL}),i="",n=0),e.push({text:t[r],direction:kr.HORIZONTAL}));return i&&e.push({text:i,direction:kr.VERTICAL}),e}(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(l))if(u){const n=!0===u?r.ellipsis:u,i=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:d,fontFamily:h},l,n,!1,m);x[e]=i.verticalList,a=i.width}else{const n=s.clipTextVertical(t,{fontSize:c,fontWeight:d,fontFamily:h},l,!1);x[e]=n.verticalList,a=n.width}else a=0,t.forEach((t=>{const e=t.direction===kr.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:d,fontFamily:h});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=Q(e,a)}));const _=ts(y,a),S=this.cache.verticalList.length*b,A=es(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=Ki(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]:da;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:da;return super.needUpdateTag(t,e)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return t.baselineMapAlign}getAlignMapBaseline(){return t.alignMapBaseline}};function pa(t){return new fa(t)}fa.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},fr),fa.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fa.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const ga=["heightLimit","lineClamp"];class ma extends fa{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return m(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:u=s.fontSize,ellipsis:h=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=Ki(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=ii.graphicUtil.textMeasure,A=new ca(a,{fontSize:u,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,h,!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(h){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,c,h,!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,h,!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<ga.length;e++){const n=ga[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<ga.length;e++)if(t===ga[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return ma.NOWORK_ANIMATE_ATTR}}function ba(t){return new ma(t)}class ya{bounds(t,e){if(y(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 y(t)?t:Math.min(t[0],t[1])}}function va(t,e,n,i,r){return r?t.arc(n,i,e,0,V,!1,r):t.arc(n,i,e,0,V),!1}var xa=new class extends ya{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 va(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return va(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 _a=new class extends ya{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 Sa(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 Aa=new class extends ya{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 Sa(t,this.parseSize(e)/2,n,i,r)}drawFitDir(t,e,n,i,r){return Sa(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return Sa(t,this.parseSize(e)/2+r,n,i,s)}};function wa(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var Ta=new class extends ya{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return wa(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return wa(t,this.parseSize(e)/2+r,n,i)}};function Ba(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 Ca extends ya{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 Ba(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ba(t,this.parseSize(e)/2,n,i,r)}}var ka=new Ca;var Ma=new class extends Ca{constructor(){super(...arguments),this.type="triangle"}};const Pa=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Ea=Math.sin(V/10)*Pa,Oa=-Math.cos(V/10)*Pa;function La(t,e,n,i){const r=Ea*e,s=Oa*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let a=1;a<5;++a){const o=V*a/5,l=Math.cos(o),u=Math.sin(o);t.lineTo(u*e+n,-l*e+i),t.lineTo(l*r-u*s+n,u*r+l*s+i)}return t.closePath(),!0}var Ra=new class extends ya{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 La(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return La(t,this.parseSize(e)/2+r,n,i)}};const Ia=tt(3);function Na(t,e,n,i){const r=e,s=r/Ia,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 Ua=new class extends ya{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 Na(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Na(t,this.parseSize(e)/2+r,n,i)}};function Da(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 za=new class extends ya{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return Da(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Da(t,this.parseSize(e)/2+r,n,i)}};function Wa(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Fa=new class extends ya{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,i){return Wa(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Wa(t,this.parseSize(e)/2+r,n,i)}};const ja=-.5,Ha=tt(3)/2,Ga=1/tt(12);function $a(t,e,n,i){const r=e/2,s=e*Ga,a=r,o=e*Ga+e,l=-a,u=o;return t.moveTo(r+n,s+i),t.lineTo(a+n,o+i),t.lineTo(l+n,u+i),t.lineTo(ja*r-Ha*s+n,Ha*r+ja*s+i),t.lineTo(ja*a-Ha*o+n,Ha*a+ja*o+i),t.lineTo(ja*l-Ha*u+n,Ha*l+ja*u+i),t.lineTo(ja*r+Ha*s+n,ja*s-Ha*r+i),t.lineTo(ja*a+Ha*o+n,ja*o-Ha*a+i),t.lineTo(ja*l+Ha*u+n,ja*u-Ha*l+i),t.closePath(),!1}var Va=new class extends ya{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 $a(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return $a(t,this.parseSize(e)/2+r,n,i)}};function Xa(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 Ya=new class extends ya{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 Xa(t,this.parseSize(e)/2,n,i,0)}drawOffset(t,e,n,i,r){return Xa(t,this.parseSize(e)/2,n,i,r)}};function Ka(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 qa=new class extends ya{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 Ka(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ka(t,this.parseSize(e)/2,n,i,r)}};function Qa(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 Za=new class extends ya{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 Qa(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Qa(t,this.parseSize(e)/2,n,i,r)}};const Ja=tt(3);function to(t,e,n,i){const r=e*Ja;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var eo=new class extends ya{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return to(t,this.parseSize(e)/2/Ja,n,i)}drawOffset(t,e,n,i,r){return to(t,this.parseSize(e)/2/Ja+r,n,i)}};function no(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 io=new class extends ya{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 no(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return no(t,this.parseSize(e)/4+r,n,i)}};function ro(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 so=new class extends ya{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 ro(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ro(t,this.parseSize(e)/4+r,n,i)}};function ao(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 oo=new class extends ya{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 ao(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ao(t,this.parseSize(e)/4+r,n,i)}};function lo(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 uo=new class extends ya{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 lo(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return lo(t,this.parseSize(e)/4+r,n,i)}};function ho(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var co=new class extends ya{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return ho(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return ho(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 fo(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var po=new class extends ya{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return fo(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return fo(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 go(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 mo=new class extends ya{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 go(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return go(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 bo(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function yo(t,e,n,i){const r=e,s=e/2;return t.rect(n-r/2,i-s/2,r,s),!1}var vo=new class extends ya{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 y(e)?yo(t,e,n,i):bo(t,e,n,i)}drawOffset(t,e,n,i,r){return y(e)?yo(t,e+2*r,n,i):bo(t,[e[0]+2*r,e[1]+2*r],n,i)}};const xo=new gt;class _o{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,m(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(),en(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(en(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 y(t)?t:Math.min(t[0],t[1])}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((n=>{let{path:i}=n;xo.x1=i.bounds.x1*t,xo.y1=i.bounds.y1*t,xo.x2=i.bounds.x2*t,xo.y2=i.bounds.y2*t,e.union(xo)}))}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 So={};[xa,_a,Aa,Ta,eo,Ma,Ra,Ua,za,Fa,Va,Ya,qa,ka,Za,io,so,oo,uo,vo,co,po,mo].forEach((t=>{So[t.type]=t}));const Ao={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"},wo=new gt,To=["symbolType","size",...lr];let Bo=class t extends pr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Ur}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return m(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:n=e.symbolType}=this.attribute,i=So[n];if(i)return this._parsedPath=i,i;if(i=t.userSymbolMap[n],i)return this._parsedPath=i,i;if(n=Ao[n]||n,!0===((r=n).startsWith("<svg")||r.startsWith("<?xml"))){const e=new wr,{svg:i}=e.parse(n);if(!i)return null;const r=m(i.path)?i.path:[i.path];wo.clear();const s=[];r.forEach((t=>{const e=(new Ln).fromString(t.d),n={};Fr.forEach((e=>{t[e]&&(n[Wr[e]]=t[e])})),s.push({path:e,attribute:n}),wo.union(e.bounds)}));const a=wo.width(),o=wo.height(),l=1/Q(a,o);return s.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new _o(n,s,!0),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}var r;const s=(new Ln).fromString(n),a=s.bounds.width(),o=s.bounds.height(),l=1/Q(a,o);return s.transform(0,0,l,l),this._parsedPath=new _o(n,s),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}getGraphicTheme(){return ki(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}=ii.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;Tr(n,a+(r+o)/2,!0,s)}})(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return ii.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:i=e.size}=t;if(m(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,To)}needUpdateTag(t){return super.needUpdateTag(t,To)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=m(e)?e:[e,e];return t.path?(new Ln).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Ln).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Co(t){return new Bo(t)}Bo.userSymbolMap={},Bo.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},fr);const ko=["width","x1","y1","height","cornerRadius",...lr];let Mo=class t extends pr{constructor(t){super(t),this.type="rect",this.numberType=Ir}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ki(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}=ii.graphicService.updateTempAABBBounds(n);return ha(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),ii.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,ko)}needUpdateTag(t){return super.needUpdateTag(t,ko)}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=h(t.width)?t.x1-t.x:t.width,n=h(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 Ln;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 Po(t){return new Mo(t)}Mo.NOWORK_ANIMATE_ATTR=fr;class Eo{constructor(t,e,n,i,r,s,a,o,l,u,h,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=u,this.directionKey=li[this.layoutDirection],this.isWidthMax=h,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 u=!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 u;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,u=!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 u;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,u=!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 u;{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,u=!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 u}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}}}class Oo{constructor(t,e,n){this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";const i=Ki(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof i?i>this.fontSize?i:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:a,width:o}=bi(t,n);let l=0,u=0,h=0;this.height>s&&(l=(this.height-s)/2,u=Math.ceil(l),h=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=s-l):"bottom"===this.textBaseline?(this.ascent=s-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+u,this.descent=a+h),this.length=t.length,this.width=o||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,"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}=bi(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,n,i,r){let s=this.text,a=this.left+n;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+=this.ellipsisStr,"right"!==r&&"end"!==r||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=gi(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+=this.ellipsisStr,"right"===r||"end"===r){const{width:e}=bi(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0);const{lineWidth:l=1}=this.character;this.character.stroke&&l&&t.strokeText(s,a,e),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const 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=gi(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:i}=bi(this.text.slice(t),this.character);return n+this.ellipsisWidth-i}return n}}const Lo=["width","height","image",...lr];let Ro=class t extends pr{constructor(t){super(t),this.type="image",this.numberType=Rr,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}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 ki(this).image}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const{tb1:i,tb2:r}=ii.graphicService.updateTempAABBBounds(n);return ha(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),ii.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return ei[t]}needUpdateTags(t){return super.needUpdateTags(t,Lo)}needUpdateTag(t){return super.needUpdateTag(t,Lo)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Io(t){return new Ro(t)}Ro.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},fr);class No 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=$i(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(m(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=$i(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=ei.width,height:e=ei.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 Uo{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=li[this.direction]}store(t){if(t instanceof No){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 No?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=li[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Oo){const e=fi.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 No?(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 No)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:a}=bi(s,n.character),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}}this.paragraphs.forEach(((e,r)=>{if(e instanceof No)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||hi;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,pi(t,e)})(t,e.character),function(t,e,n){const i=e&&e.fill||ui;if(!i)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=n?oi(t,i,{AABBBounds:n}):i,pi(t,e)}(t,e.character,a),e.draw(t,i+this.ascent,n,0===r,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let n=this.paragraphs.length-1;n>=0;n--){const i=this.paragraphs[n];if(i instanceof No)break;const{width:r}=bi(t,i.character),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 No?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 No?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const n=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(n/t[this.directionKey.width]*t.length)||0,r=gi(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 Oo(n,t.newLine,t.character),new Oo(i,!0,t.character)]}(t,r);this.store(n),e?this.send():this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Do=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...lr];let zo=class t extends pr{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Nr,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:ti.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:ti.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:ti.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:ti.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:ti.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:ti.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:ti.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:ti.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return ki(this).richtext}updateAABBBounds(t,e,n){const{width:i=e.width,height:r=e.height,maxWidth:s=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:l=e.textBaseline}=t;if(i>0&&r>0)n.set(0,0,i,r);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let l=i||e||0,u=r||o||0;u="number"==typeof a&&u>a?a:u||0,l="number"==typeof s&&l>s?s:l||0,n.set(0,0,l,u)}let u=0;switch(l){case"top":u=0;break;case"middle":u=-n.height()/2;break;case"bottom":u=-n.height()}let h=0;switch(o){case"left":h=0;break;case"center":h=-n.width()/2;break;case"right":h=-n.width()}return n.translate(h,u),ii.graphicService.updateTempAABBBounds(n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ii.graphicService.updateHTMLTextAABBBounds(t,e,n),ii.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,Do)}needUpdateTag(t){return super.needUpdateTag(t,Do)}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:u,strokeOpacity:h}=this.attribute;return Object.assign({fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:u,strokeOpacity:h},t)}doUpdateFrameCache(t){var e;const{textConfig:n=[],maxWidth:i,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:l,verticalDirection:u,textAlign:h,textBaseline:c,layoutDirection:d,singleLine:f,disableAutoWrapLine:p}=this.attribute,g=[],m=null!=t?t:n;for(let t=0;t<m.length;t++)if("image"in m[t]){const e=this.combinedStyleToCharacter(m[t]);e.lineWidth=void 0;const n=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(n)g.push(n);else{const t=new No(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,g.push(t)}}else{const e=this.combinedStyleToCharacter(m[t]);if(y(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let n=0;n<t.length;n++)g.push(new Oo(t[n],0!==n,e))}else e.text&&g.push(new Oo(e.text,!1,e))}const b="number"==typeof i&&Number.isFinite(i)&&i>0,v="number"==typeof r&&Number.isFinite(r)&&r>0,x="number"==typeof s&&Number.isFinite(s)&&s>0&&(!b||s<=i),_="number"==typeof a&&Number.isFinite(a)&&a>0&&(!v||a<=r),S=new Eo(0,0,(x?s:b?i:0)||0,(_?a:v?r:0)||0,o,l,u,h,c,d||"horizontal",!x&&b,!_&&v,f||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),A=new Uo(S);if(p){let t=0,e=!1;for(let n=0;n<g.length;n++){const i=g[n];e?(i.overflow=!0,i.left=1/0,i.top=1/0,!i.newLine&&S.lines[S.lines.length-1].paragraphs.push(i)):A.deal(i,!0),S.lines.length!==t&&(t=S.lines.length,A.lineBuffer.length=0,i.overflow=!0,i.left=1e3,i.top=1e3,S.lines[S.lines.length-1].paragraphs.push(i),e=!0),i.newLine&&(e=!1,A.lineWidth=0),A.send()}}else for(let t=0;t<g.length;t++)A.deal(g[t]);if(A.send(),!("horizontal"===S.layoutDirection?x:_)){const t=S.getActualSizeWidthEllipsis();let e="horizontal"===S.layoutDirection?t.width:t.height;("horizontal"===S.layoutDirection?b:v)&&(e=Math.min(e,"horizontal"===S.layoutDirection?i:r)),S.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=S}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 Wo(t){return new zo(t)}zo.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},fr);const Fo=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...lr];let jo,Ho=class t extends pr{constructor(t){super(t),this.type="arc",this.numberType=Or}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(y(t,!0)?t:a*parseFloat(t)/100,a/2);if(m(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=at(e),n=e+s,i&&Y(s)<X-H){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:u=t.outerPadding,innerPadding:h=t.innerPadding}=this.attribute;o+=u,l-=h;const c=Math.abs(o-l)/2,d=c/o;if(c>H&&o>H)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=tt(a*a+o*o)}=this.attribute,u=Y(e-t);let h=t,c=e,d=t,f=e;const p=s/2;let g=u,m=u;if(p>H&&l>H){const n=e>t?1:-1;let i=nt(Number(l)/o*J(p)),r=nt(Number(l)/a*J(p));return(g-=2*i)>H?(i*=n,d+=i,f-=i):(g=0,d=f=(t+e)/2),(m-=2*r)>H?(r*=n,h+=r,c-=r):(m=0,h=c=(t+e)/2),{outerStartAngle:h,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}return{outerStartAngle:h,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}getGraphicTheme(){return ki(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}=ii.graphicService.updateTempAABBBounds(n);ha(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return ii.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<=H?n.set(0,0,0,0):Math.abs(o-l)>X-H?n.set(-i,-i,i,i):(Yi(l,o,i,n),Yi(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 u=Y(a-s),h=a>s;if(l<o){const t=l;l=o,o=t}const c=new Ln;if(l<=H)c.moveTo(0,0);else if(u>=X-H)c.moveTo(0+l*q(s),0+l*J(s)),c.arc(0,0,l,s,a,!h),o>H&&(c.moveTo(0+o*q(a),0+o*J(a)),c.arc(0,0,o,a,s,h));else{const t=l*q(s),e=l*J(s),n=o*q(a),i=o*J(a);c.moveTo(0+t,0+e),c.arc(0,0,l,s,a,!h),c.lineTo(0+n,0+i),c.arc(0,0,o,a,s,h),c.closePath()}return c}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Go(){!function(){if(null==jo)try{const t=document.createElement("canvas"),e=t.getContext("2d");jo=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),jo&&(jo=!!document.createElement)}catch(t){jo=!1}}();const t=ii.global&&ii.global.env;return t?"browser"===t:jo}Ho.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},fr);var $o=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,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 Xo=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new gt}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 Vo(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}};Xo=$o([te()],Xo);let Yo=!1;const Ko=new Ht((t=>{Yo||(Yo=!0,t(zs).toSelf().inSingletonScope(),t(sa).to(zs).inSingletonScope(),t(ra).toService(sa),t(Cs).toSelf(),t(Bs).toSelf(),t(qr).toService(Cs),t(qr).toService(Bs),t(qr).toService(xs),ye(t,qr))}));let qo=!1;const Qo=new Ht((t=>{qo||(qo=!0,t(Hs).toSelf().inSingletonScope(),t(aa).to(Hs).inSingletonScope(),t(ra).toService(aa),t(Qr).toService(xs),ye(t,Qr))}));let Zo=!1;const Jo=new Ht((t=>{Zo||(Zo=!0,t(oa).to(Zs).inSingletonScope(),t(ra).toService(oa),t(Zr).toService(xs),ye(t,Zr))}));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)};let nl=class extends ps{constructor(){super(),this.numberType=Nr,this.builtinContributions=[Ys],this.init()}drawShape(t,e,n,i,r){const s=ki(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:l=s.fillOpacity,visible:u=s.visible}=t.attribute;if(!t.valid||!u)return;const h=Xr(o,l,!0),c=Xr(o,a,!0);h&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(n,i),this.beforeRenderStep(t,e,n,i,h,c,h,c,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,h,c,h,c,s,r))}drawIcon(t,e,n,i,r){var s;const a=ki(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:u=a.opacity,image:h,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(),As(e,n-t,i-r,b,y,g)),c&&(e.globalAlpha=d,e.fillStyle=c,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const v=h&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(h));v&&"success"===v.state&&(e.globalAlpha=u,e.drawImage(v.data,n,i,o,l))}draw(t,e,n){const i=ki(t).richtext;this._draw(t,i,!1,n)}};nl=tl([te(),el("design:paramtypes",[])],nl);let il=!1;const rl=new Ht((t=>{il||(il=!0,t(la).to(nl).inSingletonScope(),t(ra).toService(la))}));let sl=!1;const al=new Ht((t=>{sl||(sl=!0,t(ua).to(ia).inSingletonScope(),t(ra).toService(ua),t(Kr).toService(xs),ye(t,Kr))}));class ol{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=jt.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)),ii.graphicService.hooks.onRemove.unTap(this.key),ii.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?ii.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:ii.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[Et(n)]=t[n])})),["fontSize","lineHeight"].forEach((i=>{const r=Et(i);h(t[i])||(e[r]=n(t[i]))})),c(t.maxLineWidth)&&(e["max-width"]=n(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&g(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:ki(t).text)}getTransformOfText(t){const e=ki(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%"},u={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:`${u[n]} ${u[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,c=0;const f=t.globalAABBBounds;let p=r.anchorType;if(h(p)&&(p="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===p&&(p="top-left"),"position"===p||f.empty()){const e=t.globalTransMatrix;l=e.e,c=e.f}else{const t=dt(f,p);l=t.x,c=t.y}const m=ii.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=e.viewBox,v=l+b.left-m.left+y.x1,x=c+b.top-m.top+y.y1;if(o.left=`${v}px`,o.top=`${x}px`,"text"===t.type&&"position"===p&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),u(r.style)){const e=r.style({top:x,left:v,width:f.width(),height:f.height()},t,n);e&&(o=Object.assign(Object.assign({},o),e))}else d(r.style)?o=Object.assign(Object.assign({},o),r.style):g(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),Pt(r.style)));ii.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"===ii.global.env&&(t.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:jn.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:jn.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&&ii.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=h(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"===ii.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 ll extends ol{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=jt.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?ii.global.getRequestAnimationFrame()((()=>{e.unmount()})):i&&i(),n&&ii.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=h(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:u}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,l,u,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 hl extends Hr{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,n,i){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);if(r)return this._setAttributes(r,n);p(this.attribute[t])&&p(e)&&!u(this.attribute[t])&&!u(e)?O(this.attribute[t],e):this.attribute[t]=e,ul.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=>ul.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){h(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const i=e[n];!p(this.attribute[i])||u(this.attribute[i])||u(t[i])?this.attribute[i]=t[i]:O(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 Oi(t,e);i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}}const cl=Symbol.for("MathPickerContribution"),dl=Symbol.for("MathImagePicker"),fl=Symbol.for("MathRectPicker"),pl=Symbol.for("MathSymbolPicker"),gl=Symbol.for("MathTextPicker"),ml=Symbol.for("CanvasImagePicker"),bl=Symbol.for("CanvasRectPicker"),yl=Symbol.for("CanvasSymbolPicker"),vl=Symbol.for("CanvasTextPicker"),xl=Symbol.for("CanvasRichTextPicker"),_l=Symbol.for("CanvasPickerContribution"),Sl={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 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},wl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tl=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 Bl{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 Cl(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("img");if(ii.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 kl=class extends Xo{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,u;return o&&(l=a.width/o.offsetWidth,u=a.height/o.offsetHeight),{x:(t-a.left)/(v(l)?l:1),y:(n-a.top)/(v(u)?u: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 Bl(t)}return new gt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:n,height:i,style:r}=e;return r&&(g(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=g(n)?this.getElementById(n):n;t&&t.appendChild&&t.appendChild(i)}return i}loadImage(t){return Cl(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Cl(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:jt.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 Tl(this,void 0,void 0,(function*(){return new FontFace(t,g(e)?`url(${e})`:e,n).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return{loadState:"fail"}}))}))}};kl=Al([te(),wl("design:paramtypes",[])],kl);class Ml{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();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;return this.canvasRenderer.drawShape(t,i,s,a,{},null,((t,n,i)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,n,r)=>{if(o)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,l=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=l?s+a:ai(i,s+a,i.dpr),o=t.isPointInStroke(e.x,e.y),o})),i.highPerformanceRestore(),o}}var Pl=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 El=class{constructor(){this.type="image",this.numberType=Rr}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};El=Pl([te()],El);let Ol=!1;const Ll=new Ht(((t,e,n,i)=>{Ol||(Ol=!0,t(dl).to(El).inSingletonScope(),t(El).toService(dl))})),Rl=new gt;class Il{constructor(){this.type="rect",this.numberType=Ir}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 u=!0;if(!l||t.shadowRoot||y(s,!0)&&0!==s||m(s)&&s.some((t=>0!==t)))u=!1,this.canvasRenderer.drawShape(t,i,a,o,{},null,((t,n,i)=>!!u||(u=t.isPointInPath(e.x,e.y),u)),((t,n,r)=>{if(u)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,o=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=o?s+a:ai(i,s+a,i.dpr),u=t.isPointInStroke(e.x,e.y),u}));else{const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)u=!0;else if(i){const n=t.AABBBounds;Rl.setValue(n.x1,n.y1,n.x2,n.y2),Rl.expand(-s/2),u=!Rl.containsPoint(e)}}return i.highPerformanceRestore(),u}}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},Ul=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dl=function(t,e){return function(n,i){e(n,i,t)}};let zl=class extends Il{constructor(t){super(),this.canvasRenderer=t}};zl=Nl([te(),Dl(0,Zt(sa)),Ul("design:paramtypes",[Object])],zl);let Wl=!1;const Fl=new Ht(((t,e,n,i)=>{Wl||(Wl=!0,t(fl).to(zl).inSingletonScope(),t(cl).toService(fl))}));let jl=!1;const Hl=new Ht(((t,e,n,i)=>{jl||(jl=!0,t(dl).to(El).inSingletonScope(),t(El).toService(dl))}));var Gl=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},$l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vl=function(t,e){return function(n,i){e(n,i,t)}};let Xl=class extends Ml{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Ur}};Xl=Gl([te(),Vl(0,Zt(aa)),$l("design:paramtypes",[Object])],Xl);let Yl=!1;const Kl=new Ht(((t,e,n,i)=>{Yl||(Yl=!0,t(pl).to(Xl).inSingletonScope(),t(cl).toService(pl))}));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};let Ql=class{constructor(){this.type="text",this.numberType=Dr}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Ql=ql([te()],Ql);let Zl=!1;const Jl=new Ht(((t,e,n,i)=>{Zl||(Zl=!0,t(gl).to(Ql).inSingletonScope(),t(cl).toService(gl))}));var tu=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},eu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nu=function(t,e){return function(n,i){e(n,i,t)}};let iu=class extends Il{constructor(t){super(),this.canvasRenderer=t}};iu=tu([te(),nu(0,Zt(sa)),eu("design:paramtypes",[Object])],iu);let ru=!1;const su=new Ht(((t,e,n,i)=>{ru||(ru=!0,t(bl).to(iu).inSingletonScope(),t(_l).toService(bl))}));class au extends ps{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:u}=s;let h=e;if(i.camera){h=e.clone();const n=t.parent.globalTransMatrix;h.x=n.a*e.x+n.c*e.y+n.e,h.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(h.x,h.y),c))),this.canvasRenderer.z=0,i.modelMatrix!==u&&os.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),c}}var ou=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},lu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uu=function(t,e){return function(n,i){e(n,i,t)}};let hu=class extends au{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Ur}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:u,lastModelMatrix:h}=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=u;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:ai(i,r+s,i.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==h&&os.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}};hu=ou([te(),uu(0,Zt(aa)),lu("design:paramtypes",[Object])],hu);let cu=!1;const du=new Ht(((t,e,n,i)=>{cu||(cu=!0,t(yl).to(hu).inSingletonScope(),t(_l).toService(yl))}));var fu=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},pu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gu=function(t,e){return function(n,i){e(n,i,t)}};let mu=class extends au{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Dr}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:u,y:h,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,u,h,{},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=es(a,d,r),b=ts(o,g);return e.rect(b+u,m+h,g,d,c),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&os.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};mu=fu([te(),gu(0,Zt(oa)),pu("design:paramtypes",[Object])],mu);let bu=!1;const yu=new Ht(((t,e,n,i)=>{bu||(bu=!0,t(vl).to(mu).inSingletonScope(),t(_l).toService(vl))}));var vu=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},xu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_u=function(t,e){return function(n,i){e(n,i,t)}};let Su=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Nr}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Su=vu([te(),_u(0,Zt(la)),xu("design:paramtypes",[Object])],Su);let Au=!1;const wu=new Ht(((t,e,n,i)=>{Au||(Au=!0,t(xl).to(Su).inSingletonScope(),t(_l).toService(xl))}));var Tu=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 Bu=class{constructor(){this.type="image",this.numberType=Rr}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};Bu=Tu([te()],Bu);let Cu=!1;const ku=new Ht(((t,e,n,i)=>{Cu||(Cu=!0,t(ml).to(Bu).inSingletonScope(),t(_l).toService(ml))})),Mu=Go();function Pu(){Pu.__loaded||(Pu.__loaded=!0,$s.RegisterGraphicCreator("group",Gr))}Pu.__loaded=!1;const Eu=Pu;function Ou(){Ou.__loaded||(Ou.__loaded=!0,$s.RegisterGraphicCreator("image",Io),yi.load(al),yi.load(Mu?ku:Ll))}Ou.__loaded=!1;const Lu=Ou;function Ru(){Ru.__loaded||(Ru.__loaded=!0,$s.RegisterGraphicCreator("rect",Po),yi.load(Ko),yi.load(Mu?su:Fl))}Ru.__loaded=!1;const Iu=Ru;function Nu(){Nu.__loaded||(Nu.__loaded=!0,$s.RegisterGraphicCreator("richtext",Wo),yi.load(rl),yi.load(Mu?wu:Hl))}Nu.__loaded=!1;const Uu=Nu;function Du(){Du.__loaded||(Du.__loaded=!0,$s.RegisterGraphicCreator("symbol",Co),yi.load(Qo),yi.load(Mu?du:Kl))}Du.__loaded=!1;const zu=Du;function Wu(){Wu.__loaded||(Wu.__loaded=!0,$s.RegisterGraphicCreator("text",pa),yi.load(Jo),yi.load(Mu?yu:Jl))}Wu.__loaded=!1;const Fu=Wu;function ju(){ju.__loaded||(ju.__loaded=!0,$s.RegisterGraphicCreator("wrapText",ba))}ju.__loaded=!1;const Hu=ju,Gu="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 Vu(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const i=Xs({text:t,fontFamily:e.fontFamily||n.fontFamily||Gu,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 Xu(t){return"rich"===function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var n,i;return d(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 Yu=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};Eu(),Iu(),zu(),Uu(),Fu();let Ku=class t extends hl{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(e,n){super((null==n?void 0:n.skipDefault)?e:O({},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:u,maxWidth:f,padding:p=4,visible:g,state:b,type:x,textAlwaysCenter:_,containerTextAlign:S}=this.attribute,A=function(t){if(v(t))return[t,t,t,t];if(m(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(d(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]}(p),w=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let T,C=-A[3],k=-A[0],M=A[1]+A[3],P=A[0]+A[2],E=0,O=0;const{visible:L}=s,R=Yu(s,["visible"]);if(l(L)){const t=(null==R?void 0:R.size)||10,e=y(t)?t:Math.max(t[0],t[1]);T=w.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},R),{visible:L,x:e/2,y:e/2}),"symbol"),B(null==b?void 0:b.shape)||(T.states=b.shape),L&&(O=e+o)}let I;if(M+=O,E+=O,Xu({text:i})||"rich"===x){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return c(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:x,text:i},r))),r),{visible:c(i)&&!1!==g,x:E,y:0});I=w.createOrUpdateChild("tag-text",t,"richtext"),M+=I.AABBBounds.width(),P+=I.AABBBounds.height(),C+=I.AABBBounds.x1,k+=I.AABBBounds.y1}else{const a=Object.assign(Object.assign({text:d(i)&&"type"in i&&"text"===i.type?i.text:i,visible:c(i)&&!1!==g,lineHeight:null==r?void 0:r.fontSize},r),{x:E,y:0});h(a.lineHeight)&&(a.lineHeight=r.fontSize),I=w.createOrUpdateChild("tag-text",a,"text"),B(null==b?void 0:b.text)||(I.states=b.text);const o=Vu(a.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text),l=o.width,p=o.height;M+=l;const m=null!==(n=s.size)&&void 0!==n?n:10,v=y(m)?m:Math.max(m[0],m[1]);P+=Math.max(p,s.visible?v:0);const{textAlign:x,textBaseline:L}=r;(c(u)||c(f))&&(c(u)&&M<u&&(M=u),c(f)&&M>f&&(M=f,I.setAttribute("maxLineWidth",f-A[1]-A[2]))),C=0,k=0;let R=0;"left"===x||"start"===x?R=1:"right"===x||"end"===x?R=-1:"center"===x&&(R=0),R?R<0?(C-=M,T&&T.setAttribute("x",(T.attribute.x||0)-l),w.setAttribute("x",-A[1]-O)):R>0&&w.setAttribute("x",A[3]):(C-=M/2,T&&T.setAttribute("x",(T.attribute.x||0)-l/2),w.setAttribute("x",-O/2));const N="right"===S||"end"===S,U="left"===S||"start"===S;if((S?"center"===S:_)&&R){const t=M-A[1]-A[3],e=l+O,n=1===R?(t-e)/2+O+l/2:A[0]+O-(M/2+e/2-O)+l/2;if(I.setAttributes({x:n,textAlign:"center"}),T){const t=n-l/2-O+v/2;T.setAttributes({x:t})}}if(U&&1!==R){const t=M-A[1]-A[3],e=0===R?-t/2+O/2:-M+A[3]+A[1]+O,n=e+O;if(I.setAttributes({x:n,textAlign:"left"}),T){const t=e+v/2;T.setAttributes({x:t})}}if(N&&-1!==R){const t=M-A[1]-A[3],e=0===R?t/2+O/2:t;if(I.setAttributes({x:e,textAlign:"right"}),T){const t=e-l-O+v/2;T.setAttributes({x:t})}}"middle"===L?(k-=P/2,T&&T.setAttribute("y",0)):"bottom"===L?(k-=P,T&&T.setAttribute("y",-p/2),w.setAttribute("y",-A[2])):"top"===L&&(w.setAttribute("y",A[0]),T&&T.setAttribute("y",p/2))}const{visible:N}=a,U=Yu(a,["visible"]);if(g&&l(N)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},U),{visible:N&&!!i,width:M,height:P,x:C,y:k}),"rect");if(B(null==b?void 0:b.panel)||(t.states=b.panel),U.customShape){const e=U.customShape;t.pathProxy=t=>e(this,t,new Ln)}this._bgRect=t}this._textShape=I,this._symbol=T,this.resetStates()}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:O({},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,u,h,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!==(h=null===(u=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===u?void 0:u.slice())&&void 0!==h?h:[],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))}};Ku.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};Eu(),Iu(),Fu(),Lu();class qu extends hl{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},qu.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 Mo(O({},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(O({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Ro(O({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 fa(O({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,u=Math.max(o,l),h=u/2-o/2,c=u/2-l/2,d=u+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:h,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:O({},qu.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}qu.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}},Eu(),Iu(),Hu(),Lu();let Qu=class t extends hl{constructor(e,n){super((null==n?void 0:n.skipDefault)?e:O({},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 Ho(O({},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 fa(O({},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:O({},t.defaultAttributes,e),super.initAttributes(e),this.renderGroup(),this.render()}};Qu.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 Zu extends ll{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?ii.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:ii.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 l=0,c=0;const f=t.globalAABBBounds;let p=r.anchorType;if(h(p)&&(p="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===p&&(p="top-left"),"position"===p||f.empty()){const e=t.globalTransMatrix;l=e.e,c=e.f}else{const t=dt(f,p);l=t.x,c=t.y}const m=ii.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=l+b.left-m.left,v=c+b.top-m.top;if(o.left=`${y}px`,o.top=`${v}px`,"text"===t.type&&"position"===p&&(o={...o,...this.getTransformOfText(t)}),u(r.style)){const e=r.style({top:v,left:y,width:f.width(),height:f.height()},t,n);e&&(o={...o,...e})}else d(r.style)?o={...o,...r.style}:g(r.style)&&r.style&&(o={...o,...Pt(r.style)});ii.global.updateDom(n,{width:r.width,height:r.height,style:o,graphic:t})}drawHTML(){"browser"===ii?.global?.env&&(this.pluginService.stage.children.sort(((t,e)=>(t.attribute.zIndex??jn.zIndex)-(e.attribute.zIndex??jn.zIndex))).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}}const Ju=new Ht(((t,e,n,i)=>{t(th).toSelf().inSingletonScope(),n(_e)?i(_e).toService(th):t(_e).toService(th)}));class th extends kl{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&&(g(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}}Go()&&yi.load(Ju);const eh=["children","hooks","ref",...zt,"skipFunctionDiff","onError","onReady","option","records","container","vtableConstrouctor"],nh=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,ih=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(L(t,eh)),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 Zu),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]),S=n.useCallback((()=>{if(!u.current){if(!a.current||!a.current.table)return;Ft(a.current.table,t,p.current,Dt),s(r+1),t.onReady&&t.onReady(a.current.table,0===r)}}),[r,s,t]),A=n.useCallback((()=>{a.current.table&&(a.current.table.render(),S())}),[S]);return n.useEffect((()=>{const e=o?null:(t=>{const e={};return Nt(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:nh(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),A(),void(p.current=t);if(o){if(N(p.current.option,t.option,{skipFunction:g})){if(l&&!N(p.current.records,t.records,{skipFunction:g})){if(m){const t=sh(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),S(),p.current=t}}else{const e=x(t);if(m){const t=sh(b.current,y.current,a.current.table);e.columnWidthConfig=t,e.columnWidthConfigForRowHeader=t}a.current.table.updateOption(e),S(),p.current=t}return}const n=L(t,eh);if(N(n,c.current,{skipFunction:g})&&N(e,d.current,{skipFunction:g})){if(l&&!N(t.records,f.current,{skipFunction:g})){if(f.current=t.records,m){const t=sh(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),S(),p.current=t}}else{c.current=n,d.current=e;const i=x(t);if(m){const t=sh(b.current,y.current,a.current.table);i.columnWidthConfig=t,i.columnWidthConfigForRowHeader=t}a.current.table.updateOption(i),S(),p.current=t}}),[_,o,l,x,S,A,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},Nt(t.children).map(((t,e)=>{if("string"==typeof t)return;const i=nh(t,e);return n.createElement(n.Fragment,{key:i},n.cloneElement(t,{updateId:r,componentId:i,componentIndex:e}))})))})),rh=(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:u,width:h,...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%",...u}},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}(ih,t,(t=>e?Object.assign(t,e):t));return r.displayName=t,r};function sh(t,e,n){if(n.isPivotTable())return e;const i=[];return t.forEach(((t,e)=>{i.push({key:e,width:t})})),i}const ah=rh("ListTable",{type:"list-table",vtableConstrouctor:e.ListTable}),oh=rh("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTable}),lh=rh("PivotChart",{type:"pivot-chart",vtableConstrouctor:e.PivotChart});const uh=rh("ListTable",{type:"list-table",vtableConstrouctor:e.ListTableSimple}),hh=rh("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTableSimple});var ch,dh,fh,ph,gh={exports:{}},mh={exports:{}},bh={};function yh(){return dh||(dh=1,mh.exports=(ch||(ch=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],u=o+1,h=t[u];if(0>r(l,n))u<s&&0>r(h,l)?(t[i]=h,t[u]=n,i=u):(t[i]=l,t[o]=n,i=o);else{if(!(u<s&&0>r(h,n)))break t;t[i]=h,t[u]=n,i=u}}}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=[],u=[],h=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(u);null!==r;){if(null===r.callback)i(u);else{if(!(r.startTime<=t))break;i(u),r.sortIndex=r.expirationTime,e(l,r)}r=n(u)}}function x(t){if(g=!1,v(t),!p)if(null!==n(l))p=!0,O(_);else{var e=n(u);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 h=!0;else{var m=n(u);null!==m&&L(x,m.startTime-r),h=!1}return h}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:h++,callback:r,priorityLevel:i,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(i.sortIndex=s,e(u,i),null===n(l)&&i===n(u)&&(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}}}}(bh)),bh)),mh.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,u,h=this._events[o],c=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),c){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,i),!0;case 4:return h.fn.call(h.context,e,i,r),!0;case 5:return h.fn.call(h.context,e,i,r,s),!0;case 6:return h.fn.call(h.context,e,i,r,s,a),!0}for(u=1,l=new Array(c-1);u<c;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var d,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),c){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,i);break;case 4:h[u].fn.call(h[u].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];h[u].fn.apply(h[u].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,u=[],h=o.length;l<h;l++)(o[l].fn!==e||r&&!o[l].once||i&&o[l].context!==i)&&u.push(o[l]);u.length?this._events[s]=1===u.length?u[0]:u: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=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||o(t,"Boolean")};var u=t=>"function"==typeof t;var h=t=>null==t;var c=t=>null!=t;var d=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var f=t=>"object"==typeof t&&null!==t;var p=function(t){if(!f(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 g=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||o(t,"String")};var m=t=>Array.isArray?Array.isArray(t):o(t,"Array");var b=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var y=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||o(t,"Number")};var v=t=>y(t)&&Number.isFinite(t);var x=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var _=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 A=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const S=Object.prototype;var w=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||S)};const T=Object.prototype.hasOwnProperty;function B(t){if(h(t))return!0;if(b(t))return!t.length;const e=A(t);if("Map"===e||"Set"===e)return!t.size;if(w(t))return!Object.keys(t).length;for(const e in t)if(T.call(t,e))return!1;return!0}const C=Object.prototype.hasOwnProperty;var k=(t,e)=>null!=t&&C.call(t,e);function M(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(c(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];!c(r[a])||"object"!=typeof r[a]||i&&m(t[a])?E(t,a,r[a]):P(t,e,a,n,i)}}}}function P(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(m(a)){if(i)o=[];else if(m(s))o=s;else if(b(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else p(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):l=!1;l&&M(o,a,i,r),E(t,n,o)}function E(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 O(t){let e=-1;const n=arguments.length<=1?0:arguments.length-1;for(;++e<n;)M(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function L(t,e){if(!t||!p(t))return t;const n={};return Object.keys(t).forEach((i=>{const r=t[i];let s=!1;e.forEach((t=>{(g(t)&&t===i||t instanceof RegExp&&i.match(t))&&(s=!0)})),s||(n[i]=r)})),n}function R(t){return Object.prototype.toString.call(t)}function I(t){return Object.keys(t)}function N(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(R(t)!==R(e))return!1;if(u(t))return!!(null==n?void 0:n.skipFunction);if("object"!=typeof t)return!1;if(m(t)){if(t.length!==e.length)return!1;for(let i=t.length-1;i>=0;i--)if(!N(t[i],e[i],n))return!1;return!0}if(!p(t))return!1;const i=I(t),r=I(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(!N(t[s],e[s],n))return!1}return!0}function U(t,e){if(!m(t)||!m(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 D="undefined"!=typeof console;function z(t,e,n){const i=[e].concat([].slice.call(n));D&&console[t].apply(console,i)}var W;!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"}(W||(W={}));class F{static getInstance(t,e){return F._instance&&y(t)?F._instance.level(t):F._instance||(F._instance=new F(t,e)),F._instance}static setInstance(t){return F._instance=t}static setInstanceLevel(t){F._instance?F._instance.level(t):F._instance=new F(t)}static clearInstance(){F._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:W.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>=W.Info}canLogDebug(){return this._level>=W.Debug}canLogError(){return this._level>=W.Error}canLogWarn(){return this._level>=W.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>=W.Error&&(this._onErrorHandler.length?this.callErrorHandler(...n):z(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>=W.Warn&&z(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>=W.Info&&z(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>=W.Debug&&z(this._method||"log","DEBUG",e),this}}F._instance=null;var j=function(t,e,n){return t<e?e:t>n?n:t};const H=1e-12,G=Math.PI,$=G/2,V=2*G,X=2*Math.PI,Y=Math.abs,K=Math.atan2,q=Math.cos,Q=Math.max,Z=Math.min,J=Math.sin,tt=Math.sqrt,et=Math.pow;function nt(t){return t>=1?$:t<=-1?-$:Math.asin(t)}class it{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 it(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 y(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return y(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 rt{static distancePP(t,e){return tt(et(t.x-e.x,2)+et(t.y-e.y,2))}static distanceNN(t,e,n,i){return tt(et(t-n,2)+et(e-i,2))}static distancePN(t,e,n){return tt(et(e-t.x,2)+et(n-t.y,2))}static pointAtPP(t,e,n){return new it((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function st(t){return t*(Math.PI/180)}const at=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-V;)t+=V;else if(t>0)for(;t>V;)t-=V;return t};var ot;function lt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function ut(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 ht(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ct(t,e){const n=e?st(t.angle):t.angle,i=ht(t);return[ut({x:t.x1,y:t.y1},n,i),ut({x:t.x2,y:t.y1},n,i),ut({x:t.x2,y:t.y2},n,i),ut({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"}(ot||(ot={}));const dt=(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,u=(r+s)/2,h=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":h=-.5;break;case"right":case"inside-right":h=.5;break;case"top-right":h=.5,c=-.5;break;case"top-left":h=-.5,c=-.5;break;case"bottom-right":h=.5,c=.5;break;case"bottom-left":h=-.5,c=.5}return l+=h*a,u+=c*o,{x:l,y:u}};function ft(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 pt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new pt(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 m(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 ft(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),u=e-e*o+n*l,h=n-e*l-n*o;return[o*i-l*r+u,l*i+o*r+h,o*i-l*a+u,l*i+o*a+h,o*s-l*r+u,l*s+o*r+h,o*s-l*a+u,l*s+o*a+h]}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 gt extends pt{}class mt extends pt{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=ct(t,n),r=ct(e,n),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(ht(t),ht(e)),o=s(i[0],i[1]),l=s(i[1],i[2]),u=s(r[0],r[1]),h=s(r[1],r[2]),c=n?st(t.angle):t.angle;let d=n?st(90-t.angle):t.angle+$;const f=n?st(e.angle):e.angle;let p=n?st(90-e.angle):e.angle+$;d>X&&(d-=X),p>X&&(p-=X);const g=(t,e,n,i)=>{const r=[Math.cos(e),Math.sin(e)];return t+(lt(r,n)+lt(r,i))/2>lt(r,a)};return g((t.x2-t.x1)/2,c,u,h)&&g((t.y2-t.y1)/2,d,u,h)&&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 mt(this)}}class bt{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 bt,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,u=i*this.c-r*this.d,h=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=u,this.d=h,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,u=this.d,h=a*t+l*e,c=o*t+u*e,d=a*n+l*i,f=o*n+u*i,p=a*r+l*s+this.e,g=o*r+u*s+this.f;return this.a=h,this.b=c,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new bt;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,u=s/l,h=-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*u+m*c+f,e.y=g*h+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 bt(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 yt(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 vt(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 xt=/^#([0-9a-f]{3,8})$/,_t={transparent:4294967040},At={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 St(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function wt(t){return y(t)?new Mt(t>>16,t>>8&255,255&t,1):m(t)?new Mt(t[0],t[1],t[2]):new Mt(255,255,255)}function Tt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Bt(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Ct=(t,e)=>{const n=xt.exec(t);if(e||n){const t=parseInt(n[1],16),e=n[1].length;return 3===e?new Mt((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?wt(t):8===e?new Mt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class kt{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new kt(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new kt(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const n=t instanceof kt?t:new kt(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(c(_t[t]))return function(t){return y(t)?new Mt(t>>>24,t>>>16&255,t>>>8&255,255&t):m(t)?new Mt(t[0],t[1],t[2],t[3]):new Mt(255,255,255,1)}(_t[t]);if(c(At[t]))return wt(At[t]);const e=`${t}`.trim().toLowerCase(),n=Ct(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 Mt(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=yt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Mt(n.r,n.g,n.b,parseFloat(t[3]))}}constructor(t){const e=kt.parseColorString(t);this.color=e||new Mt(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=vt(this.color.r,this.color.g,this.color.b),s=yt(h(t)?r.h:j(t,0,360),h(e)?r.s:e>=0&&e<=1?100*e:e,h(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new Mt(s.r,s.g,s.b,i),this}setRGB(t,e,n){return!h(t)&&(this.color.r=t),!h(e)&&(this.color.g=e),!h(n)&&(this.color.b=n),this}setHex(t){const e=`${t}`.trim().toLowerCase(),n=Ct(e,!0);return null!=n?n:this}setColorName(t){const e=At[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 kt(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=Tt(t.color.r),this.color.g=Tt(t.color.g),this.color.b=Tt(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Bt(t.color.r),this.color.g=Bt(t.color.g),this.color.b=Bt(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Mt{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)),c(i)?this.opacity=isNaN(+i)?1:Math.max(0,Math.min(1,+i)):this.opacity=1}formatHex(){return`#${St(this.r)+St(this.g)+St(this.b)+(1===this.opacity?"":St(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}=vt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${n}%,${i}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const Pt=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},Et=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();var Ot,Lt={exports:{}},Rt={};Lt.exports=function(){if(Ot)return Rt;Ot=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"),u=Symbol.for("react.forward_ref"),h=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 h:case c:return t;default:switch(t=t&&t.$$typeof){case l:case o:case u:case f:case d:case a:return t;default:return p}}case n:return p}}}return t=Symbol.for("react.module.reference"),Rt.ContextConsumer=o,Rt.ContextProvider=a,Rt.Element=e,Rt.ForwardRef=u,Rt.Fragment=i,Rt.Lazy=f,Rt.Memo=d,Rt.Portal=n,Rt.Profiler=s,Rt.StrictMode=r,Rt.Suspense=h,Rt.SuspenseList=c,Rt.isAsyncMode=function(){return!1},Rt.isConcurrentMode=function(){return!1},Rt.isContextConsumer=function(t){return g(t)===o},Rt.isContextProvider=function(t){return g(t)===a},Rt.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Rt.isForwardRef=function(t){return g(t)===u},Rt.isFragment=function(t){return g(t)===i},Rt.isLazy=function(t){return g(t)===f},Rt.isMemo=function(t){return g(t)===d},Rt.isPortal=function(t){return g(t)===n},Rt.isProfiler=function(t){return g(t)===s},Rt.isStrictMode=function(t){return g(t)===r},Rt.isSuspense=function(t){return g(t)===h},Rt.isSuspenseList=function(t){return g(t)===c},Rt.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===s||e===r||e===h||e===c||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===a||e.$$typeof===o||e.$$typeof===u||e.$$typeof===t||void 0!==e.getModuleId)},Rt.typeOf=g,Rt}();var It=Lt.exports;const Nt=t=>{let e=[];return n.Children.forEach(t,(t=>{h(t)||(It.isFragment(t)?e=e.concat(Nt(t.props.children)):e.push(t))})),e},Ut={...e.TABLE_EVENT_TYPE,...e.PIVOT_TABLE_EVENT_TYPE,...e.PIVOT_CHART_EVENT_TYPE},Dt={onClickCell:Ut.CLICK_CELL,onDblClickCell:Ut.DBLCLICK_CELL,onMouseDownCell:Ut.MOUSEDOWN_CELL,onMouseUpCell:Ut.MOUSEUP_CELL,onSelectedCell:Ut.SELECTED_CELL,onSelectedClear:Ut.SELECTED_CLEAR,onKeyDown:Ut.KEYDOWN,onMouseEnterTable:Ut.MOUSEENTER_TABLE,onMouseLeaveTable:Ut.MOUSELEAVE_TABLE,onMouseDownTable:Ut.MOUSEDOWN_TABLE,onMouseMoveCell:Ut.MOUSEMOVE_CELL,onMouseMoveTable:Ut.MOUSEMOVE_TABLE,onMouseEnterCell:Ut.MOUSEENTER_CELL,onMouseLeaveCell:Ut.MOUSELEAVE_CELL,onContextMenuCell:Ut.CONTEXTMENU_CELL,onResizeColumn:Ut.RESIZE_COLUMN,onResizeColumnEnd:Ut.RESIZE_COLUMN_END,onResizeRow:Ut.RESIZE_ROW,onResizeRowEnd:Ut.RESIZE_ROW_END,onChangeHeaderPositionStart:Ut.CHANGE_HEADER_POSITION_START,onChangeHeaderPosition:Ut.CHANGE_HEADER_POSITION,onChangeHeaderPositionFail:Ut.CHANGE_HEADER_POSITION_FAIL,onSortClick:Ut.SORT_CLICK,onAfterSort:Ut.AFTER_SORT,onFreezeClick:Ut.FREEZE_CLICK,onScroll:Ut.SCROLL,onScrollHorizontalEnd:Ut.SCROLL_HORIZONTAL_END,onScrollVerticalEnd:Ut.SCROLL_VERTICAL_END,onDropdownMenuClick:Ut.DROPDOWN_MENU_CLICK,onMouseOverChartSymbol:Ut.MOUSEOVER_CHART_SYMBOL,onDragSelectEnd:Ut.DRAG_SELECT_END,onCopyData:Ut.COPY_DATA,onDropdownIconClick:Ut.DROPDOWN_ICON_CLICK,onDropdownMenuClear:Ut.DROPDOWN_MENU_CLEAR,onTreeHierarchyStateChange:Ut.TREE_HIERARCHY_STATE_CHANGE,onShowMenu:Ut.SHOW_MENU,onHideMenu:Ut.HIDE_MENU,onIconClick:Ut.ICON_CLICK,onLegendItemClick:Ut.LEGEND_ITEM_CLICK,onLegendItemHover:Ut.LEGEND_ITEM_HOVER,onLegendItemUnHover:Ut.LEGEND_ITEM_UNHOVER,onLegendChange:Ut.LEGEND_CHANGE,onMouseEnterAxis:Ut.MOUSEENTER_AXIS,onMouseLeaveAxis:Ut.MOUSELEAVE_AXIS,onCheckboxStateChange:Ut.CHECKBOX_STATE_CHANGE,onRadioStateChange:Ut.RADIO_STATE_CHANGE,onSwitchStateChange:Ut.SWITCH_STATE_CHANGE,onAfterRender:Ut.AFTER_RENDER,onInitialized:Ut.INITIALIZED,onChangeCellValue:Ut.CHANGE_CELL_VALUE,onDragFillHandleEnd:Ut.DRAG_FILL_HANDLE_END,onMousedownFillHandle:Ut.MOUSEDOWN_FILL_HANDLE,onDblclickFillHandle:Ut.DBLCLICK_FILL_HANDLE,onPivotSortClick:Ut.PIVOT_SORT_CLICK,onDrillMenuClick:Ut.DRILLMENU_CLICK,onVChartEventType:Ut.VCHART_EVENT_TYPE,onChangCellValue:Ut.CHANGE_CELL_VALUE,onEmptyTipClick:Ut.EMPTY_TIP_CLICK,onEmptyTipDblClick:Ut.EMPTY_TIP_DBLCLICK,onButtonClick:Ut.BUTTON_CLICK,onBeforeCacheChartImage:Ut.BEFORE_CACHE_CHART_IMAGE},zt=Object.keys(Dt),Wt=(t,e=Dt)=>{const n={};return Object.keys(t).forEach((i=>{e[i]&&t[i]&&(n[i]=t[i])})),n},Ft=(t,e,n,i=Dt)=>{if(!e&&!n||!t)return!1;const r=n?Wt(n,i):null,s=e?Wt(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 jt{static GenAutoIncrementId(){return jt.auto_increment_id++}}jt.auto_increment_id=0;class Ht{constructor(t){this.id=jt.GenAutoIncrementId(),this.registry=t}}const Gt="named",$t="inject",Vt="inversify:tagged",Xt="inversify:paramtypes";class Yt{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===Gt?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Kt=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(u(s)){if(!n)return;s=new i,r.set(t,s)}let a=s.get(e);if(u(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!h(i)&&a(t,i,n)}function o(t,e,n){const i=s(e,n,!1);return!u(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(!u(i))return i.get(t)}(t,e,n);const i=g(e);return h(i)?void 0:l(t,i,n)}function u(t){return void 0===t}function h(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 u(n)||(n=f(n)),a(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return u(n)||(n=f(n)),o(t,e,n)})),t("getMetadata",(function(t,e,n){if(!c(e))throw new TypeError;return u(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 qt(t,e,n,i){!function(t,e,n,i){const r=[i];let s={};Kt.hasOwnMetadata(t,e)&&(s=Kt.getMetadata(t,e));let a=s[n];void 0===a&&(a=[]),a.push(...r),s[n]=a,Kt.defineMetadata(t,s,e)}(Vt,t,n.toString(),i)}function Qt(t){return(e,n,i)=>{qt(e,0,i,t)}}const Zt=(Jt=$t,t=>(e,n,i)=>Qt(new Yt(Jt,t))(e,n,i));var Jt;function te(){return function(t){return Kt.defineMetadata(Xt,null,t),t}}function ee(t){return Qt(new Yt(Gt,t))}const ne="Singleton",ie="Transient",re="ConstantValue",se="DynamicValue",ae="Factory",oe="Function",le="Instance",ue="Invalid";class he{constructor(t,e){this.id=jt.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=ue,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new he(this.serviceIdentifier,this.scope);return t.activated=t.scope===ne&&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 ce{getConstructorMetadata(t){return{compilerGeneratedMetadata:Kt.getMetadata(Xt,t),userGeneratedMetadata:Kt.getMetadata(Vt,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const de=(fe=Gt,t=>{const e=e=>{if(null==e)return!1;if(e.key===fe&&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===fe&&n[e].value===t)return!0;return!1};return e.metaData=new Yt(fe,t),e});var fe;class pe{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=ne,this}inTransientScope(){return this._binding.scope=ie,this}whenTargetNamed(t){return this._binding.constraint=de(t),this}}class ge{constructor(t){this._binding=t}to(t){return this._binding.type=le,this._binding.implementationType=t,new pe(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=se,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new pe(this._binding)}toConstantValue(t){return this._binding.type=re,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=ne,new pe(this._binding)}toFactory(t){return this._binding.type=ae,this._binding.factory=t,this._binding.scope=ne,new pe(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const me=Symbol("ContributionProvider");class be{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 ye(t,e){t(me).toDynamicValue((t=>{let{container:n}=t;return new be(e,n)})).inSingletonScope().whenTargetNamed(e)}class ve{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 xe extends ve{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 _e=Symbol.for("EnvContribution");var Ae;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(Ae||(Ae={}));const Se=V-1e-8;class we{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>Se)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let a,o,l,u,h=1/0,c=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),u=n*Math.sin(t),l<h&&(h=l),l>c&&(c=l),u<d&&(d=u),u>f&&(f=u)}if(p(i),p(r),r!==i)if((i%=V)<0&&(i+=V),(r%=V)<0&&(r+=V),r<i&&(s=!s,a=i,i=r,r=a),s)for(r-=V,a=i-i%$,o=0;o<4&&a>r;++o,a-=$)p(a);else for(a=i-i%$+$,o=0;o<4&&a<r;++o,a+=$)p(a);this.bounds.add(t+h,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 Te{constructor(){this.curves=[],this.bounds=new gt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Be=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Ce={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},ke=0,Me=1,Pe=2,Ee=3,Oe=4,Le=5,Re=6,Ie=7,Ne=8;let Ue,De,ze,We,Fe,je;var He,Ge,$e,Ve,Xe,Ye,Ke,qe,Qe;function Ze(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],u=l*s,h=-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,A=e+g,S=n+m,w=A+v*m,T=S-v*g;return[u*x+h*_,c*x+d*_,u*w+h*T,c*w+d*T,u*A+h*S,c*A+d*S]}function Je(t,e,n,i){const r=function(t,e,n,i,r,s,a,o,l){const u=st(a),h=Math.sin(u),c=Math.cos(u),d=c*(o-t)*.5+h*(l-e)*.5,f=c*(l-e)*.5-h*(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=h/n,b=-h/i,y=c/i,v=g*o+m*l,x=b*o+y*l,_=g*t+m*e,A=b*t+y*e;let S=1/((_-v)*(_-v)+(A-x)*(A-x))-.25;S<0&&(S=0);let w=Math.sqrt(S);s===r&&(w=-w);const T=.5*(v+_)-w*(A-x),B=.5*(x+A)+w*(_-v),C=Math.atan2(x-B,v-T);let k=Math.atan2(A-B,_-T)-C;k<0&&1===s?k+=V:k>0&&0===s&&(k-=V);const M=Math.ceil(Math.abs(k/($+.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,h,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=Ze(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"}(He||(He={})),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"}(Ge||(Ge={})),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"}($e||($e={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Ve||(Ve={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Xe||(Xe={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Ye||(Ye={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ke||(Ke={})),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"}(qe||(qe={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Qe||(Qe={}));const tn=[(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 en(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];tn[l[0]](l,e,n,i,r,s,a)}}class nn{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function rn(t,e,n,i,r){return function(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+=rt.distanceNN(s,a,o,l)}return n/2}([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function sn(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}class an extends nn{constructor(t,e,n,i){super(),this.type=qe.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 function(t,e,n,i,r){const s=sn(t.x,e.x,n.x,i.x,r),a=sn(t.y,e.y,n.y,i.y,r);return new it(s,a)}(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?rn(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Ke.ROW?Y(this.p0.x-this.p3.x):t===Ke.COLUMN?Y(this.p0.y-this.p3.y):0}getAngleAt(t){const e=Q(t-.01,0),n=Z(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return K(r.y-i.y,r.x-i.x)}}class on extends nn{constructor(t,e){super(),this.type=qe.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return rt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=K(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()?rt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ke.ROW?Y(this.p0.x-this.p1.x):t===Ke.COLUMN?Y(this.p0.y-this.p1.y):0}}class ln{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 an(new it(this._lastX,this._lastY),new it(t,e),new it(n,i),new it(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 on(new it(this._lastX,this._lastY),new it(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===Ke.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 Y(t.p0.y-i.y)}if(t===Ke.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 Y(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class un extends ln{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 hn(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 cn(t,e,n){const i=null!=e?e:Y(n[n.length-1].x-n[0].x)>Y(n[n.length-1].y-n[0].y)?Ke.ROW:Ke.COLUMN;return"monotoneY"===t?new un(t,i):new ln(t,i)}class dn{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 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;const r=cn("linear",n,t);return function(t,e){hn(t,e)}(new dn(r,i),t),r}function pn(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 gn{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&&pn(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:pn(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 mn(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 fn(t,e);const r=cn("basis",n,t);return function(t,e){hn(t,e)}(new gn(r,i),t),r}function bn(t){return t<0?-1:1}function yn(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(bn(s)+bn(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function vn(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function xn(t,e,n,i,r){const s=t._x0,a=t._y0,o=t._x1,l=t._y1,u=(o-s)/3;t.context.bezierCurveTo(s+u,a+u*e,o-u,l-u*n,o,l,i,t.lastPoint1)}class _n{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:xn(this,this._t0,vn(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,xn(this,vn(this,e=yn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:xn(this,this._t0,e=yn(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 An extends _n{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Sn(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 fn(t,e);const r=cn("monotoneX",n,t);return function(t,e){hn(t,e)}(new _n(r,i),t),r}function wn(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 fn(t,e);const r=cn("monotoneY",n,t);return function(t,e){hn(t,e)}(new An(r,i),t),r}let Tn=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;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 Bn(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 ln("step",null!=i?i:Y(t[t.length-1].x-t[0].x)>Y(t[t.length-1].y-t[0].y)?Ke.ROW:Ke.COLUMN);return function(t,e){hn(t,e)}(new Tn(s,e,r),t),s}class Cn extends dn{lineEnd(){this.context.closePath()}}function kn(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=cn("linear",n,t);return function(t,e){hn(t,e)}(new Cn(r,i),t),r}function Mn(t,e,n,i,r){let s=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>H){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>H){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 Pn(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 fn(n,r);const o=cn(t,s,n);return hn(new e(o,i,a),n),o}}const En=Pn("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:Mn(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 On=Pn("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:Mn(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 Ln extends Te{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new we(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Re,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Le,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([Ie,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([Pe,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([Me,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([Oe,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([Ne,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([ke,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([Ee]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Re]=t=>`M${t[1]} ${t[2]}`,t[Le]=t=>`L${t[1]} ${t[2]}`,t[Ie]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Pe]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ke]=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,u=(n-e)/l;for(let n=0;n<l;n++){const o=e+u*n,l=e+u*(n+1),h=4*Math.tan(Math.abs(u)/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*h*c,_=a*h*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[Ne]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Ee]=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(Ue=e[t],De=Ue.slice(1),ze=Ue[0],n=[ze],i=De.match(Be),null!==i){for(let t=0,e=i.length;t<e;t++)We=i[t],Fe=parseFloat(We),Number.isNaN(Fe)||n.push(Fe);if(je=Ce[ze],n.length-1>je){let t,e=ze;for(let i=1,s=n.length;i<s;i+=je){t=[e];for(let e=i,r=i+je;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 fn(t,n);case"basis":return mn(t,n);case"monotoneX":return Sn(t,n);case"monotoneY":return wn(t,n);case"step":return Bn(t,.5,n);case"stepBefore":return Bn(t,0,n);case"stepAfter":return Bn(t,1,n);case"catmullRom":return En(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return On(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return kn(t,n)}}(e,n);"x"===i?this.direction=Ke.ROW:"y"===i?this.direction=Ke.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[Re]=this.moveToTransform,t[Le]=this.lineToTransform,t[Ie]=this.quadraticCurveToTransform,t[Pe]=this.bezierCurveToTransform,t[Me]=this.arcToTransform,t[Oe]=this.ellipseTransform,t[Ne]=this.rectTransform,t[ke]=this.arcTransform,t[Ee]=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,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,h=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===u||(e=In(e,l,u)),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],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+o,c+e[1]+a,d+e[2]+o,n+a,i+o),f=c+e[1],p=d+e[2],c=n,d=i;break;case"S":n=e[3],i=e[4],f=2*c-f,p=2*d-p,this.bezierCurveTo(f+a,p+o,e[1]+a,e[2]+o,n+a,i+o),c=n,d=i,f=e[1],p=e[2];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===h[0].match(/[QqTt]/)?(f=c,p=d):"t"===h[0]?(f=2*c-r,p=2*d-s):"q"===h[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":Je(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":Je(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()}h=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 Le:this.lineToTransform(a,e,n,i,r);break;case Re:this.moveToTransform(a,e,n,i,r);break;case Pe:this.bezierCurveToTransform(a,e,n,i,r);break;case Ie:this.quadraticCurveToTransform(a,e,n,i,r);break;case ke:this.arcToTransform(a,e,n,i,r);break;case Oe:this.ellipseTransform(a,e,n,i,r);break;case Ne:this.rectTransform(a,e,n,i,r);break;case Me:this.arcToTransform(a,e,n,i,r);break;case Ee:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),en(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ke.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Y(t.p0.y-e.p1.y)}if(this.direction===Ke.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Y(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,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)}}}const Rn=["l",0,0,0,0,0,0,0];function In(t,e,n){const i=Rn[0]=t[0];if("a"===i||"A"===i)Rn[1]=e*t[1],Rn[2]=n*t[2],Rn[3]=t[3],Rn[4]=t[4],Rn[5]=t[5],Rn[6]=e*t[6],Rn[7]=n*t[7];else if("h"===i||"H"===i)Rn[1]=e*t[1];else if("v"===i||"V"===i)Rn[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)Rn[i]=(i%2==1?e:n)*t[i];return Rn}const Nn={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 bt},Un={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Dn=Object.assign({outerBorder:Object.assign(Object.assign({},Un),{distance:0}),innerBorder:Object.assign(Object.assign({},Un),{distance:0})},Un),zn={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:Ae.fontBounding,keepCenterInLine:!1},Wn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Dn),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Fn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},jn=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},{_debug_bounds:!1}),Wn),Nn),Hn=Object.assign(Object.assign({},jn),{startAngle:0,endAngle:X,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Gn=Object.assign(Object.assign(Object.assign({},jn),Fn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),$n=Object.assign(Object.assign({},jn),{radius:1,startAngle:0,endAngle:X}),Vn=Object.assign(Object.assign({},jn),{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}),Xn=Object.assign(Object.assign({},jn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Yn=Object.assign(Object.assign(Object.assign({},jn),Fn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Kn=Object.assign(Object.assign({},jn),{path:new Ln,fillStrokeOrder:1,customPath:()=>{F.getInstance().warn("空函数")}}),qn=Object.assign(Object.assign({},jn),{points:[],cornerRadius:0,closePath:!0}),Qn=Object.assign(Object.assign({},jn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},jn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Zn=Object.assign(Object.assign({},jn),{symbolType:"circle",size:10,keepDirIn3d:!0}),Jn=Object.assign(Object.assign(Object.assign({},jn),zn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ti=Object.assign(Object.assign(Object.assign({},jn),zn),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),ei=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},jn),{fill:!0,cornerRadius:0}),ni=Object.assign(Object.assign({},ei),{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 ii=new class{},ri=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()||u()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=p()||u()),t}();if(t)t.at=h();else{const e=u();if(e){t=e;const n=h();n&&(t.at=n)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function u(){return m("extent-keyword",t.extentKeywords,1)}function h(){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 si{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(si.IsGradientStr(t))try{const e=ri(t)[0];if(e){if("linear"===e.type)return si.ParseLinear(e);if("radial"===e.type)return si.ParseRadial(e);if("conic"===e.type)return si.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:n=[]}=t,i=G/2,r=parseFloat(e.value)/180*G-i;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+X,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=G/2;let r="angular"===e.type?parseFloat(e.value)/180*G:0;for(;r<0;)r+=X;for(;r>=X;)r-=X;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<G?(s=0,a=0,o=Math.cos(r-i),l=Math.sin(r-i)):r<G+i?(s=1,a=0,o=s-Math.sin(r-G),l=Math.cos(r-G)):(s=1,o=s-Math.cos(r-i-G),l-=Math.sin(r-i-G)),{gradient:"linear",x0:s,y0:a,x1:o,y1:l,stops:n.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function ai(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),u=Math.sign(o)*Math.sqrt(a*a+o*o);return l+u===0?0:(i=i/Math.abs(l+u)*2*n,i)}function oi(t,e,n){let i,r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e||!0===e)return"black";if(m(e))for(let t=0;t<e.length&&(r=e[t],!r);t++);else r=e;if(r=si.Parse(r),"string"==typeof r)return r;if(n.AABBBounds&&(!n.attribute||0!==n.attribute.scaleX||0!==n.attribute.scaleY)){const e=n.AABBBounds;let o=e.x2-e.x1,l=e.y2-e.y1,u=e.x1-s,h=e.y1-a;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;o/=t,l/=e,u/=t,h/=e}"linear"===r.gradient?i=function(t,e,n,i,r,s){var a,o,l,u;const h=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!==(u=e.y1)&&void 0!==u?u:0)*s);return e.stops.forEach((t=>{h.addColorStop(t.offset,t.color)})),h}(t,r,u,h,o,l):"conical"===r.gradient?i=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,r,u,h,o,l):"radial"===r.gradient&&(i=function(t,e,n,i,r,s){var a,o,l,u,h,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!==(u=e.x1)&&void 0!==u?u:.5)*r,i+(null!==(h=e.y1)&&void 0!==h?h:.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,r,u,h,o,l))}return i||"orange"}const li={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"}},ui=!0,hi=!1,ci=/\w|\(|\)|-/,di=/[.?!,;:/,。?!、;:]/,fi=/\S/,pi=(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 gi(t,e,n,i,r){if(!e||e<=0)return 0;const s=ii.graphicUtil.textMeasure;let a=i,o=t.slice(0,a),l=Math.floor(s.measureText(o,n).width),u=t.slice(0,a+1),h=Math.floor(s.measureText(u,n).width);for(;l>e||h<=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),u=t.slice(0,a+1),h=Math.floor(s.measureText(u,n).width)}return r&&(a=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e;for(;ci.test(t[i-1])&&ci.test(t[i])||di.test(t[i]);)if(i--,i<=0)return n?mi(t,e):e;return i}(t,a)),a}function mi(t,e){let n=e;for(;ci.test(t[n-1])&&ci.test(t[n])||di.test(t[n]);)if(n++,n>=t.length)return n;return n}function bi(t,e){const n=ii.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}const yi=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ie,this.options=e,this.id=jt.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new ce}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,Gt,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,n=new he(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new ge(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[$t],multiInject:i.multi_inject},a=s.inject||s.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};r.push(l)}return r}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case re:case oe:e=t.cache;break;case le: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===ne&&(t.cache=e,t.activated=!0)}},vi=Symbol.for("CanvasFactory");function xi(t){return yi.getNamed(vi,ii.global.env)(t)}const _i=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=xi(Object.assign({nativeCanvas:ii.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=xi(Object.assign({nativeCanvas:ii.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=[]}},Ai={arc:Hn,area:Gn,circle:$n,line:Yn,path:Kn,symbol:Zn,text:Jn,rect:Qn,polygon:qn,richtext:ti,richtextIcon:ni,image:ei,group:Vn,glyph:Xn},Si=Object.keys(Ai);function wi(t,e){Object.keys(e).forEach((n=>{t[n]=e[n]}))}const Ti={arc:Object.assign({},Ai.arc),area:Object.assign({},Ai.area),circle:Object.assign({},Ai.circle),line:Object.assign({},Ai.line),path:Object.assign({},Ai.path),symbol:Object.assign({},Ai.symbol),text:Object.assign({},Ai.text),rect:Object.assign({},Ai.rect),polygon:Object.assign({},Ai.polygon),richtext:Object.assign({},Ai.richtext),richtextIcon:Object.assign({},Ai.richtextIcon),image:Object.assign({},Ai.image),group:Object.assign({},Ai.group),glyph:Object.assign({},Ai.glyph)};class Bi{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Si.forEach((t=>{this._defaultTheme[t]=Object.create(Ti[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,F.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this.combinedTheme;Si.forEach((i=>{const r=Object.create(Ti[i]);t&&t[i]&&wi(r,t[i]),n[i]&&wi(r,n[i]),e[i]&&wi(r,e[i]),this.combinedTheme[i]=r})),e.common&&Si.forEach((t=>{wi(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 Ci=new Bi;function ki(t,e){return t.glyphHost?ki(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)):Ci.getTheme()}return null}(t)||t.attachedThemeGraphic&&ki(t.attachedThemeGraphic)||Ci.getTheme()}var Mi=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 Pi 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=jt.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 Mi(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&&F.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=l(n,!0)&&n||d(n)&&n.capture,r=d(n)&&n.once,s=u(e)?void 0:e;return t=i?`${t}capture`:t,e=u(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=l(n,!0)&&n||d(n)&&n.capture,r=u(e)?void 0:e;t=i?`${t}capture`:t,e=u(e)?e:e.handleEvent;const s=d(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 d(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 Ei{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=Ei.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const 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&&u(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&&u(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Oi extends Ei{constructor(t,e){super(),this.type=t,this.detail=e}}const Li={dispatchEvent(t){var e;if(!(t instanceof Ei))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 Oi(t,e))}};class Ri{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-Ri.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Ri.bounceIn(2*t):.5*Ri.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const i=e/X*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*X/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const i=e/X*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*X/e)+1}}static getElasticInOut(t,e){return function(n){const i=e/X*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*X/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*X/e)*.5+1}}}Ri.quadIn=Ri.getPowIn(2),Ri.quadOut=Ri.getPowOut(2),Ri.quadInOut=Ri.getPowInOut(2),Ri.cubicIn=Ri.getPowIn(3),Ri.cubicOut=Ri.getPowOut(3),Ri.cubicInOut=Ri.getPowInOut(3),Ri.quartIn=Ri.getPowIn(4),Ri.quartOut=Ri.getPowOut(4),Ri.quartInOut=Ri.getPowInOut(4),Ri.quintIn=Ri.getPowIn(5),Ri.quintOut=Ri.getPowOut(5),Ri.quintInOut=Ri.getPowInOut(5),Ri.backIn=Ri.getBackIn(1.7),Ri.backOut=Ri.getBackOut(1.7),Ri.backInOut=Ri.getBackInOut(1.7),Ri.elasticIn=Ri.getElasticIn(1,.3),Ri.elasticOut=Ri.getElasticOut(1,.3),Ri.elasticInOut=Ri.getElasticInOut(1,.3*1.5);const Ii=new class{constructor(){this.id=jt.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===Ve.END?this.removeAnimate(e):e.status===Ve.RUNNING||e.status===Ve.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ve.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 Ni{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 Ui extends Ni{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class Di{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jt.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ii,n=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e,this.status=Ve.INITIAL,this.tailAnimate=new zi(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=Q(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Di.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]:Di.mode;t&&e&Xe.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:$e.ANIMATE_PLAY})}runCb(t){const e=new Ui((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,n,i,r,s){const a=Di.interpolateMap.get(t)||Di.interpolateMap.get("");return!!a&&a(t,e,n,i,r,s)}pause(){this.status===Ve.RUNNING&&(this.status=Ve.PAUSED)}resume(){this.status===Ve.PAUSED&&(this.status=Ve.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 zi(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===Ve.INITIAL&&(this.status=Ve.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Ve.RUNNING&&(this.status=Ve.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=Ve.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()}}Di.mode=Xe.NORMAL,Di.interpolateMap=new Map;class zi{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 Wi(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?Ri[n]:n,r=this._addStep(e,null,i);return r.type=Ye.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?Ri[n]:n,s=this._addStep(e,null,r);return s.type=Ye.to,this._appendProps(t,s,!!i&&i.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),i&&i.noPreventAttrs||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=Ye.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=Ye.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 Wi(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 u=!this.reversed!=!(this.bounce&&s%2);return u&&(a=n-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,u),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 F.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 Wi{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 Fi=200,ji="cubicOut";var Hi;!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"}(Hi||(Hi={}));const Gi=[0,0,0,0],$i=t=>t?m(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Gi[0]=t[0],Gi[2]=t[0],Gi[1]=t[1],Gi[3]=t[1],Gi):t:t:0,Vi=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Xi=[1,2,3,0,1,2,3,0];function Yi(t,e,n,i){for(;t>=X;)t-=X;for(;t<0;)t+=X;for(;t>e;)e+=X;Vi[0].x=n,Vi[1].y=n,Vi[2].x=-n,Vi[3].y=-n;const r=Math.ceil(t/$)%4,s=Math.ceil(e/$)%4;if(i.add(q(t)*n,J(t)*n),i.add(q(e)*n,J(e)*n),r!==s||e-t>G){let t=!1;for(let e=0;e<Xi.length;e++)if(t||r!==Xi[e]){if(t&&s===Xi[e])break;if(t){const t=Vi[Xi[e]];i.add(t.x,t.y)}}else{t=!0;const e=Vi[r];i.add(e.x,e.y)}}}const Ki=(t,e)=>{const n=((t,e)=>g(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 qi;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(qi||(qi={}));class Qi{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qi.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===qi.Color1){const e=Qi.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;const i=kt.parseColorString(t);if(i){const e=[i.r/255,i.g/255,i.b/255,i.opacity];Qi.store1[t]=e,Qi.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=Qi.store255[t];if(i)return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n;const r=kt.parseColorString(t);return r&&(Qi.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],Qi.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===qi.Color1){if(Qi.store1[t])return;Qi.store1[t]=n,Qi.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Qi.store255[t])return;Qi.store255[t]=n,Qi.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function Zi(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&y(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 Ji(t,e,n,i,r){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((r,s)=>tr(m(t)?t[s]:t,m(e)?e[s]:e,n,i))):tr(t,e,n,i,r)}function tr(t,e,n,i,r){if(!t||!e)return t&&Zi(t)||e&&Zi(e)||!1;let s,a,o=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Qi.Get(t,qi.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Qi.Get(e,qi.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:Zi(a)})))});return o?Ji(s,l,n,i,r):Ji(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:ir(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:ir(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:ir(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),Zi(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)}Qi.store255={},Qi.store1={};const er=[0,0,0,0],nr=[0,0,0,0];function ir(t,e,n){return Qi.Get(t,qi.Color255,er),Qi.Get(e,qi.Color255,nr),`rgba(${Math.round(er[0]+(nr[0]-er[0])*n)},${Math.round(er[1]+(nr[1]-er[1])*n)},${Math.round(er[2]+(nr[2]-er[2])*n)},${er[3]+(nr[3]-er[3])*n})`}class rr{static GetImage(t,e){var n;const i=rr.cache.get(t);i?"fail"===i.loadState?ii.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):rr.loadImage(t,e)}static GetSvg(t,e){var n;let i=rr.cache.get(t);i?"fail"===i.loadState?ii.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"},rr.cache.set(t,i),i.dataPromise=ii.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=rr.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"},rr.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=ii.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=ii.global.loadBlob(t):"json"===e&&(n.dataPromise=ii.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!rr.isLoading&&rr.toLoadAueue.length){rr.isLoading=!0;const t=rr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:n,marks:i}=t,r={type:"image",loadState:"init"};if(rr.cache.set(n,r),r.dataPromise=ii.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((()=>{rr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),rr.loading()})).catch((t=>{rr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),rr.loading()}))}}),0)}static loadImage(t,e){const n=sr(t,rr.toLoadAueue);if(-1!==n)return rr.toLoadAueue[n].marks.push(e),void rr.loading();rr.toLoadAueue.push({url:t,marks:[e]}),rr.loading()}static improveImageLoading(t){const e=sr(t,rr.toLoadAueue);if(-1!==e){const t=rr.toLoadAueue.splice(e,1);rr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function sr(t,e){for(let n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}rr.cache=new Map,rr.isLoading=!1,rr.toLoadAueue=[],rr.onLoadSuccessCb=[];const ar=new bt,or=new gt,lr=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ur=["x","y"],hr=["scaleX","scaleY"],cr=["angle"],dr=new it,fr={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 pr extends Pi{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(pr.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new gt,this._updateTag=He.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;dr.x=r+(null!==(n=t.scrollX)&&void 0!==n?n:0),dr.y=s+(null!==(i=t.scrollY)&&void 0!==i?i:0)}else dr.x=r,dr.y=s;return dr}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;ii.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return ii.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new mt),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,i=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,s=$i(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 we(t);return en(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 bt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&He.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&ii.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&He.UPDATE_BOUNDS)&&ii.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&He.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&He.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&He.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&He.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=He.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===Ge.GLOBAL){const n=new it(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}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):h(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]:lr;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]:lr;for(let n=0;n<e.length;n++)if(t===e[n])return!0;return!1}initAttributes(t){const e={type:$e.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=He.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:$e.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ur,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?ii.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(n=a.x)&&void 0!==n?n:Nn.x)+t,a.y=(null!==(i=a.y)&&void 0!==i?i:Nn.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:$e.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ur,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:$e.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,hr,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 bt,o.postMatrix=i),ii.transformUtil.fromMatrix(i,i).scale(t,e,n)}else o.scaleX=(null!==(i=o.scaleX)&&void 0!==i?i:Nn.scaleX)*t,o.scaleY=(null!==(r=o.scaleY)&&void 0!==r?r:Nn.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:$e.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,hr,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:$e.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,cr,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new bt,s.postMatrix=n),ii.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:Nn.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:$e.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,cr,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){this.animates||(this.animates=new Map);const e=new Di(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:n,onFrame:i,onEnd:r,onRemove:s}=t;null!=n&&e.onStart(n),null!=i&&e.onFrame(i),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(ii.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!h(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(),u={};let h;n.forEach((e=>{l[e]?(h||(h={}),h[e]=t[e]):u[e]=i&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(u,null!==(s=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==s?s:Fi,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:ji),h&&this.setAttributes(h,!1,{type:$e.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:$e.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();k(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?this.currentStates.indexOf(t):-1)>=0){const n=this.currentStates.filter((e=>e!==t));this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const 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|=He.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=He.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=He.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&He.UPDATE_SHAPE_AND_BOUNDS)===He.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=He.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=He.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=He.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=He.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=He.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=He.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=He.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&He.UPDATE_LAYOUT)}getAnchor(t,e){const n=[0,0],i=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:n,angle:i}=this.attribute;return or.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(or),this.setAttributes({scaleX:t,scaleY:n,angle:i}),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=Nn.x,y:e=Nn.y,scaleX:n=Nn.scaleX,scaleY:i=Nn.scaleY,angle:r=Nn.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const u={};if(a&&(l=this.getAnchor(a,u)),!s||1===n&&1===i)!function(t,e,n,i,r,s,a,o){const l=e.a,u=e.b,h=e.c,c=e.d,d=e.e,f=e.f,p=q(a),g=J(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+h*g,_=u*p+c*g,A=h*p-l*g,S=c*p-u*g;t.a=r*x,t.b=r*_,t.c=s*A,t.d=s*S,t.e=d+l*m+h*b-x*y-A*v,t.f=f+u*m+c*b-_*y-S*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,u),ii.transformUtil.fromMatrix(a,a).scale(n,i,{x:l[0],y:l[1]})}const h=this.getOffsetXY(Nn);if(this._transMatrix.e+=h.x,this._transMatrix.f+=h.y,o){const t=ar.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),ii.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:$e.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:$e.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,u){u||(u=Object.keys(a),i.propKeys=u),s?i.propKeys.forEach((t=>{e.validAttr(t)&&(n[t]=a[t])})):u.forEach((s=>{var u;if(!e.validAttr(s))return;const h=a[s],c=null!==(u=o&&o[s])&&void 0!==u?u:t.getLastPropByName(s,i);if(null==h||null==c||h===c)return void(n[s]=h);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,c,h,n),d||(d=e.customInterpolate(s,r,c,h,this,n),d||this.defaultInterpolate(h,c,s,n,l,r)||this._interpolate(s,r,c,h,n))})),i.parsedProps=l}defaultInterpolate(t,e,n,i,r,s){if(Number.isFinite(t))return i[n]=e+(t-e)*s,!0;if("fill"===n){r||(r={});const a=r.fillColorArray,o=Ji(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=Ji(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=Ji(e,null!=a?a:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(i[n]=o),!0}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:ii.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return g(t,!0)?this.pathProxy=(new Ln).fromString(t):this.pathProxy=new Ln,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")?(rr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(x(t)||t.includes("/")||_(t))&&(rr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):d(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",ii.graphicService.onRelease(this)}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new Oi(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)}}}pr.mixin(Li);class gr{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 mr(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function br(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 u=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:u}}const yr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class vr{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,yr),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 gr("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=mr(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=br(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=mr(t,"--\x3e",s+4,"Comment is not closed.");else{const a=br(t,s,!1);let o=a.tagName,l=a.tagExp;const u=a.attrExpPresent,h=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 gr(o);o!==l&&u&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new gr(o);this.tagsNodeStack.push(n),o!==l&&u&&(t[":@"]=this.buildAttributesMap(l,r,o)),this.addChild(n,t,r),n=t}i="",s=h}else i+=t[s];return e.child}}function xr(t,e){return _r(t)}function _r(t,e){const n={};for(let e=0;e<t.length;e++){const r=t[e],s=Ar(r);if(void 0!==s&&r[s]){const t=_r(r[s]);i=t,Object.keys(i).length,r[":@"]&&Sr(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 Ar(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function Sr(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 wr{constructor(t){this.options=Object.assign({},wr.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return xr(new vr(this.options).parseXml(t),this.options)}}function Tr(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}wr.defaultOptions={};let Br=0;function Cr(){return Br++}var kr;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(kr||(kr={}));const Mr=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Mr.set(t,!0)));const Pr=new Map;function Er(t){if(Mr.has(t))return!0;if(Pr.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Pr.set(t,!0)));const Or=Cr();Cr(),Cr(),Cr(),Cr();const Lr=Cr(),Rr=Cr();Cr(),Cr(),Cr(),Cr();const Ir=Cr();Cr();const Nr=Cr(),Ur=Cr(),Dr=Cr(),zr=Symbol.for("GraphicCreator"),Wr={"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"},Fr=Object.keys(Wr);var jr;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(jr||(jr={}));let Hr=class t extends pr{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Lr,this._childUpdateTag=He.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 Bi),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Bi)}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===Ge.GLOBAL){const n=new it(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&He.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;ii.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),ii.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Nn.x,y:e=Nn.y,dx:n=Nn.dx,dy:i=Nn.dy,scaleX:r=Nn.scaleX,scaleY:s=Nn.scaleY,angle:a=Nn.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 ki(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 ii.graphicService.updateTempAABBBounds(n),ii.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&=He.CLEAR_BOUNDS,this._childUpdateTag&=He.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=He.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&He.UPDATE_BOUNDS||(this._childUpdateTag|=He.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(),ii.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),ii.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,ii.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{ii.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),ii.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&He.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=ii.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}};function Gr(t){return new Hr(t)}function $r(t,e){return!(!t&&!e)}function Vr(t,e){let n;return n=m(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function Xr(t,e,n){return n&&t*e>0}function Yr(t,e){return t*e>0}Hr.NOWORK_ANIMATE_ATTR=fr;const Kr=Symbol.for("ImageRenderContribution"),qr=Symbol.for("RectRenderContribution"),Qr=Symbol.for("SymbolRenderContribution"),Zr=Symbol.for("TextRenderContribution"),Jr=Symbol.for("InteractiveSubRenderContribution");function ts(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function es(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 ns(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 is(t,e,n){const i=n[0],r=n[1],s=n[2];let a,o,l,u,h,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],u=e[3],h=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]=u,t[4]=h,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+h*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]=u*i+f*r+b*s+e[15]),t}function rs(t,e,n){const i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],l=e[5],u=e[6],h=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],A=n[3];return t[0]=v*i+x*o+_*c+A*g,t[1]=v*r+x*l+_*d+A*m,t[2]=v*s+x*u+_*f+A*b,t[3]=v*a+x*h+_*p+A*y,v=n[4],x=n[5],_=n[6],A=n[7],t[4]=v*i+x*o+_*c+A*g,t[5]=v*r+x*l+_*d+A*m,t[6]=v*s+x*u+_*f+A*b,t[7]=v*a+x*h+_*p+A*y,v=n[8],x=n[9],_=n[10],A=n[11],t[8]=v*i+x*o+_*c+A*g,t[9]=v*r+x*l+_*d+A*m,t[10]=v*s+x*u+_*f+A*b,t[11]=v*a+x*h+_*p+A*y,v=n[12],x=n[13],_=n[14],A=n[15],t[12]=v*i+x*o+_*c+A*g,t[13]=v*r+x*l+_*d+A*m,t[14]=v*s+x*u+_*f+A*b,t[15]=v*a+x*h+_*p+A*y,t}class ss{constructor(){this.pools=[]}static identity(t){return ns(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 ss.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 as=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new bt(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 bt(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=[]}},os=new ss;var ls=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},us=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hs=function(t,e){return function(n,i){e(n,i,t)}};function cs(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:u=n.dz,scaleX:h=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(ns(t),is(t,t,[r+o,s+l,a+u]),is(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],u=e[8],h=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+u*i,t[5]=a*r+h*i,t[6]=o*r+c*i,t[7]=l*r+d*i,t[8]=u*r-s*i,t[9]=h*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],u=e[8],h=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-u*i,t[1]=a*r-h*i,t[2]=o*r-c*i,t[3]=l*r-d*i,t[8]=s*i+u*r,t[9]=a*i+h*r,t[10]=o*i+c*r,t[11]=l*i+d*r}(t,t,f),is(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,[h,c,d]),g){const n=os.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]}is(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],u=e[4],h=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+u*i,t[1]=a*r+h*i,t[2]=o*r+c*i,t[3]=l*r+d*i,t[4]=u*r-s*i,t[5]=h*r-a*i,t[6]=c*r-o*i,t[7]=d*r-l*i}(n,n,g),is(n,n,[-i[0],-i[1],0]),rs(t,t,n)}}let ds=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new xe(["graphic"]),onSetStage:new xe(["graphic","stage"]),onRemove:new xe(["graphic"]),onRelease:new xe(["graphic"]),onAddIncremental:new xe(["graphic","group","stage"]),onClearIncremental:new xe(["graphic","group","stage"]),beforeUpdateAABBBounds:new xe(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new xe(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new xe(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new gt,this.tempAABBBounds2=new gt}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 we(t);return en(n.commandList,i,0,0),!0}updateHTMLTextAABBBounds(t,e,n,i){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=y(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),i=es(s,e,e);n.set(n.x1,i,n.x2,i+e)}if(null!=t.forceBoundsWidth){const e=y(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),i=ts(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:u=n.pickStrokeBuffer,strokeBoundsBuffer:h=n.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){Tr(c,(l+u)/Math.abs(r+s),i,h),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;Tr(c,o/Math.abs(r+s)*2,!1,h+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&&ft(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),ii.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}}};ds=ls([te(),hs(0,Zt(zr)),us("design:paramtypes",[Object])],ds);const fs={x:0,y:0,z:0,lastModelMatrix:null};class ps{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Qe.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Qe.afterFillStroke)))}beforeRenderStep(t,e,n,i,r,s,a,o,l,u,h,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,u,h,c,d)}))}afterRenderStep(t,e,n,i,r,s,a,o,l,u,h,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,u,h,c,d)}))}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:u=e.lineWidth,strokeOpacity:h=e.strokeOpacity,visible:c=e.visible}=t.attribute,d=Xr(o,l,r),f=Yr(o,h),p=$r(r,s),g=Vr(a,u);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:u=e.angle,postMatrix:h}=t.attribute,c=n.modelMatrix,d=n.camera;fs.x=r,fs.y=s,fs.z=a,fs.lastModelMatrix=c;const f=d&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t)),p=f?t.transMatrix.onlyTranslate()&&!h:1===o&&1===l&&0===u&&!h;if(f){const i=os.allocate(),r=os.allocate();cs(r,t,e),rs(i,c||i,r),fs.x=0,fs.y=0,fs.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),os.free(r)}if(p&&!c){const i=t.getOffsetXY(e);fs.x+=i.x,fs.y+=i.y,fs.z=a,n.setTransformForCurrent()}else if(f)fs.x=0,fs.y=0,fs.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(d&&n.project){const i=t.getOffsetXY(e);fs.x+=i.x,fs.y+=i.y,this.transformWithoutTranslate(n,fs.x,fs.y,fs.z,o,l,u)}else n.transformFromMatrix(t.transMatrix,!0),fs.x=0,fs.y=0,fs.z=0;return fs}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),u={x:0,y:0},h={x:r,y:0},c={x:r,y:s};i.camera=null;const d=1/(u.x*(c.y-h.y)-h.x*c.y+c.x*h.y+(h.x-c.x)*u.y),f=-(u.y*(l.x-o.x)-h.y*l.x+c.y*o.x+(h.y-c.y)*a.x)*d,p=(h.y*l.y+u.y*(o.y-l.y)-c.y*o.y+(c.y-h.y)*a.y)*d,g=(u.x*(l.x-o.x)-h.x*l.x+c.x*o.x+(h.x-c.x)*a.x)*d,m=-(h.x*l.y+u.x*(o.y-l.y)-c.x*o.y+(c.x-h.x)*a.y)*d,b=(u.x*(c.y*o.x-h.y*l.x)+u.y*(h.x*l.x-c.x*o.x)+(c.x*h.y-h.x*c.y)*a.x)*d,y=(u.x*(c.y*o.y-h.y*l.y)+u.y*(h.x*l.y-c.x*o.y)+(c.x*h.y-h.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:u,z:h,lastModelMatrix:c}=o;this.z=h,function(t,e,n,i,r,s,a,o){if(!t.pathProxy)return!1;const l=ki(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:u=l.fill,stroke:h=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=Xr(c,d,u),v=Yr(c,p),x=$r(u),_=Vr(h,f);return!g||(!x&&!_||(!(y||v||a||o)||(e.beginPath(),en(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),_&&(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())),!0)))}(t,s,l,u,0,r)||(this.drawShape(t,s,l,u,i,r),this.z=0,s.modelMatrix!==c&&os.free(s.modelMatrix),s.modelMatrix=c),s.highPerformanceRestore()}}var gs=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},ms=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bs=function(t,e){return function(n,i){e(n,i,t)}};class ys{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,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}=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=ki(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.globalAlpha=g*m,this.doDrawImage(e,r.data,s,b,y),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,r){if("no-repeat"===i)t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{const s=n.width(),a=n.height();let o=s,l=a;if(r&&"repeat"!==i&&(e.width||e.height)){const n=e.width,r=e.height;"repeat-x"===i?(o=n*(a/r),l=a):"repeat-y"===i&&(l=r*(s/n),o=s);const u=t.dpr,h=_i.allocate({width:o,height:l,dpr:u}),c=h.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,o,l),c.drawImage(e,0,0,o,l),e=h.nativeCanvas),_i.free(h)}const u=t.dpr,h=t.createPattern(e,i);h.setTransform&&h.setTransform(new DOMMatrix([1/u,0,0,1/u,0,0])),t.fillStyle=h,t.translate(n.x1,n.y1),t.fillRect(0,0,s,a),t.translate(-n.x1,-n.y1)}}}const vs=new ys;let xs=class{constructor(t){this.subRenderContribitions=t,this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,a,o,l,u,h,c,d)}))}};xs=gs([te(),bs(0,Zt(me)),bs(0,ee(Jr)),ms("design:paramtypes",[Object])],xs);const _s=new class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,a=i.dpr,o=_i.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 u=i.createPattern(o.nativeCanvas,"repeat");return u.setTransform&&u.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),_i.free(o),u}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,X),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,u,h,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){let u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(o,l,a,n);break;case"diamond":u=this.createDiamondPattern(o,l,a,n);break;case"rect":u=this.createRectPattern(o,l,a,n);break;case"vertical-line":u=this.createVerticalLinePattern(o,l,a,n);break;case"horizontal-line":u=this.createHorizontalLinePattern(o,l,a,n);break;case"bias-lr":u=this.createBiasLRLinePattern(o,l,a,n);break;case"bias-rl":u=this.createBiasRLLinePattern(o,l,a,n);break;case"grid":u=this.createGridPattern(o,l,a,n)}u&&(n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,s),n.fillStyle=u,n.fill(),n.highPerformanceRestore())}},As=G/2;function Ss(t,e,n,i,r,s,a){let o;if(i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),y(s,!0))o=[s=Y(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,n;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=Y(t[0]),o=[e,e,e,e];break;case 2:case 3:e=Y(t[0]),n=Y(t[1]),o=[e,n,e,n];break;default:o=t,o[0]=Y(o[0]),o[1]=Y(o[1]),o[2]=Y(o[2]),o[3]=Y(o[3])}}else o=[0,0,0,0];if(i<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,n,i,r);const[l,u,h,c]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],d=Math.min(i/2,r/2),f=[Math.min(d,o[0]),Math.min(d,o[1]),Math.min(d,o[2]),Math.min(d,o[3])],p=[l[0]+f[0],l[1]],g=[l[0],l[1]+f[0]],m=[u[0]-f[1],u[1]],b=[u[0],u[1]+f[1]],v=[h[0]-f[2],h[1]],x=[h[0],h[1]-f[2]],_=[c[0]+f[3],c[1]],A=[c[0],c[1]-f[3]];if(t.moveTo(p[0],p[1]),a&&a[0]?a[0](p[0],p[1],m[0],m[1]):t.lineTo(m[0],m[1]),!U(m,b)){a&&a[0]&&t.moveTo(m[0],m[1]);const e=m[0],n=m[1]+f[1];t.arc(e,n,f[1],-As,0,!1)}if(a&&a[1]?a[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),!U(v,x)){const e=x[0]-f[2],n=x[1];a&&a[1]&&t.moveTo(x[0],x[1]),t.arc(e,n,f[2],0,As,!1)}if(a&&a[2]?a[2](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!U(_,A)){const e=_[0],n=_[1]-f[3];a&&a[2]&&t.moveTo(_[0],_[1]),t.arc(e,n,f[3],As,G,!1)}if(a&&a[3]?a[3](A[0],A[1],g[0],g[1]):t.lineTo(g[0],g[1]),!U(p,g)){const e=p[0],n=p[1]+f[0];a&&a[3]&&t.moveTo(g[0],g[1]),t.arc(e,n,f[0],G,G+As,!1)}return!a&&t.closePath(),t}var ws=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 Ts{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{cornerRadius:b=l.cornerRadius,opacity:y=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,x1:S,y1:w,keepStrokeScale:T=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:S-n)||0,C=(null!=C?C:w-i)||0;const k=(r,s)=>{const a=!(!r||!r.stroke),o="outerBorder"===s?-1:1,{distance:u=l[s].distance}=r,h=T?u:ai(e,u,e.dpr),d=n+o*h,f=i+o*h,p=2*h;if(0===b||m(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(d,f,B-o*p,C-o*p)):(e.beginPath(),Ss(e,d,f,B-o*p,C-o*p,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)/A,l[s]),l[s].opacity=a,e.stroke()}};p&&k(d,"outerBorder"),g&&k(f,"innerBorder")}}let Bs=class{constructor(){this.time=Qe.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};Bs=ws([te()],Bs);let Cs=class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){const{x1:d,y1:f,x:p=l.x,y:g=l.y,stroke:b=l.stroke,cornerRadius:y=l.cornerRadius}=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(b)&&b.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),!(0===y||m(y)&&y.every((t=>0===t)))){let r,s=0;return Ss(e,n,i,v,x,y,new Array(4).fill(0).map(((a,o)=>(a,u,h,c)=>{b[o]&&(s===o-1&&b[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:b[o]}),n,i,l),e.beginPath(),e.moveTo(a,u),r=b[o]),s=o,e.lineTo(h,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(n,i),b[0]?e.lineTo(n+v,i):e.moveTo(n+v,i),b[1]?e.lineTo(n+v,i+x):e.moveTo(n+v,i+x),b[2]?e.lineTo(n,i+x):e.moveTo(n,i+x),b[3]){const t=b[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};Cs=ws([te()],Cs);const ks=new Ts,Ms=_s,Ps=vs;const Es=new class extends Ts{constructor(){super(...arguments),this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){return super.drawShape(t,e,n,i,r,s,a,o,l,u,h,c)}},Os=vs;const Ls=new class{constructor(){this.time=Qe.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,a,o,l,u,h,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:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,w=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=l[s].distance}=r,u=S?o:ai(e,o,e.dpr),h="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,b,n,i,h*u)&&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)/A,l[s]),l[s].opacity=a,e.stroke()}};g&&w(f,"outerBorder"),m&&w(p,"innerBorder")}},Rs=_s,Is=vs;var Ns=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},Us=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ds=function(t,e){return function(n,i){e(n,i,t)}};let zs=class extends ps{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Ir,this.builtinContributions=[ks,Ps,Ms],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const u=null!==(l=this.tempTheme)&&void 0!==l?l:ki(t,null==s?void 0:s.theme).rect,{fill:h=u.fill,background:c,stroke:d=u.stroke,cornerRadius:f=u.cornerRadius,opacity:p=u.opacity,fillOpacity:g=u.fillOpacity,lineWidth:b=u.lineWidth,strokeOpacity:y=u.strokeOpacity,visible:v=u.visible,x1:x,y1:_,x:A=u.x,y:S=u.y,fillStrokeOrder:w=u.fillStrokeOrder}=t.attribute;let{width:T,height:B}=t.attribute;T=(null!=T?T:x-A)||0,B=(null!=B?B:_-S)||0;const C=function(t,e,n,i,r){return r&&t*e>0&&0!==n&&0!==i}(p,g,T,B,h),k=function(t,e,n,i){return t*e>0&&0!==n&&0!==i}(p,y,T,B),M=$r(h,c),P=Vr(d,b);if(!t.valid||!v)return;if(!M&&!P)return;if(!(C||k||a||o||c))return;0===f||m(f)&&f.every((t=>0===t))?(e.beginPath(),e.rect(n,i,T,B)):(e.beginPath(),Ss(e,n,i,T,B,f));const E={doFill:M,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,M,P,C,k,u,r,a,o,E);const O=()=>{E.doFill&&(a?a(e,t.attribute,u):C&&(e.setCommonStyle(t,t.attribute,A-n,S-i,u),e.fill()))},L=()=>{E.doStroke&&(o?o(e,t.attribute,u):k&&(e.setStrokeStyle(t,t.attribute,A-n,S-i,u),e.stroke()))};w?(L(),O()):(O(),L()),this.afterRenderStep(t,e,n,i,M,P,C,k,u,r,a,o)}draw(t,e,n,i){const r=ki(t,null==i?void 0:i.theme).rect;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}};zs=Ns([te(),Ds(0,Zt(me)),Ds(0,ee(qr)),Us("design:paramtypes",[Object])],zs);var Ws=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},Fs=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},js=function(t,e){return function(n,i){e(n,i,t)}};let Hs=class extends ps{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Ur,this.builtinContributions=[Ls,Is,Rs],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l;const u=ki(t,null==s?void 0:s.theme).symbol,{size:h=u.size,x:c=u.x,y:d=u.y,scaleX:f=u.scaleX,scaleY:p=u.scaleY,fillStrokeOrder:g=u.fillStrokeOrder}=t.attribute,b=this.valid(t,u,a,o);if(!b)return;const{fVisible:y,sVisible:v,doFill:x,doStroke:_}=b,A=t.getParsedPath();if(!A)return;const{keepDirIn3d:S=u.keepDirIn3d}=t.attribute,w=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();const T=(r,s)=>{var l,h,m;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!==(h=s.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(m=s.stroke)&&void 0!==m?m:t.attribute.stroke,s=e}const b=()=>{s.fill&&(a?a(e,t.attribute,u):(e.setCommonStyle(t,s,c-n,d-i,u),e.fill()))},y=()=>{s.stroke&&(o?o(e,t.attribute,u):(e.setStrokeStyle(t,s,(c-n)/f,(d-i)/p,u),e.stroke()))};g?(y(),b()):(b(),y())};if(S&&e.camera&&e.project){const t=e.project(n,i,w),r=e.camera;e.camera=null,!1===A.draw(e,m(h)?[h[0]*f,h[1]*p]:h*f,t.x,t.y,void 0,T)&&e.closePath(),e.camera=r}else!1===A.draw(e,h,n,i,w,T)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,x,_,y,v,u,r,a,o);const B=()=>{x&&!A.isSvg&&(a?a(e,t.attribute,u):y&&(e.setCommonStyle(t,t.attribute,c-n,d-i,u),e.fill()))},C=()=>{_&&!A.isSvg&&(o?o(e,t.attribute,u):v&&(e.setStrokeStyle(t,t.attribute,(c-n)/f,(d-i)/p,u),e.stroke()))};g?(C(),B()):(B(),C()),this.afterRenderStep(t,e,n,i,x,_,y,v,u,r,a,o)}draw(t,e,n,i){const r=ki(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}};Hs=Ws([te(),js(0,Zt(me)),js(0,ee(Qr)),Fs("design:paramtypes",[Object])],Hs);const Gs=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new gt)}allocate(t,e,n,i){if(!this.pools.length)return(new gt).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 gt(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 $s=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 Vs;function Xs(t){return Vs||(Vs=$s.CreateGraphic("text",{})),Vs.initAttributes(t),Vs.AABBBounds}const Ys=new class extends ys{constructor(){super(...arguments),this.time=Qe.beforeFillStroke}drawShape(t,e,n,i,r,s,a,o,l,u,h,c){var f,p,g,m,b,y,v,x,_,A;const{backgroundMode:S=l.backgroundMode,backgroundFit:w=l.backgroundFit}=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=d(B)&&B.background,P=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,n=(null!==(f=B.x)&&void 0!==f?f:e.x1)+(null!==(p=B.dx)&&void 0!==p?p:0),i=(null!==(g=B.y)&&void 0!==g?g:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),r=null!==(b=B.width)&&void 0!==b?b:e.width(),s=null!==(y=B.height)&&void 0!==y?y:e.height();if(k=Gs.allocate(n,i,n+r,i+s),B=B.background,!P){const t=k.width(),e=k.height();k.set((null!==(v=B.x)&&void 0!==v?v:0)+(null!==(x=B.dx)&&void 0!==x?x:0),(null!==(_=B.y)&&void 0!==_?_:0)+(null!==(A=B.dy)&&void 0!==A?A:0),t,e)}}else k=t.AABBBounds,P||(k=Xs(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,S,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?(Ss(e,k.x1,k.y1,k.width(),k.height(),r),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}M&&Gs.free(k),C()}};var Ks=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},qs=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qs=function(t,e){return function(n,i){e(n,i,t)}};let Zs=class extends ps{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Dr,this.builtinContributions=[Ys],this.init(t)}drawShape(t,e,n,i,r,s,a,o){var l,u,h;const c=ki(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=Ki(t.attribute.lineHeight,b))&&void 0!==l?l:b,A=this.valid(t,c,a,o);if(!A)return;const{fVisible:S,sVisible:w,doFill:T,doStroke:B}=A,C=!g,k=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,n,i,T,B,S,w,c,r,a,o),C&&this.transformUseContext2d(t,c,k,e);const M=(r,s,l,u)=>{let h=n+s;const d=i+l;if(u){e.highPerformanceSave(),h+=b;const t=as.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,h,d),e.transformFromMatrix(t,!0),as.free(t)}B&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,v-n,x-i,c),e.strokeText(r,h,d,k))),T&&(a?a(e,t.attribute,c):S&&(e.setCommonStyle(t,t.attribute,v-n,x-i,c),e.fillText(r,h,d,k))),u&&(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):S&&(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!==(u=t.getBaselineMapAlign()[i])&&void 0!==u?u:"left",i=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"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=Q(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,S,w,c,r,a,o)}draw(t,e,n,i){const r=ki(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,u,c){if(e+t<=0)return;const{textAlign:d=l.textAlign,fill:f=l.fill,opacity:p=l.opacity,underlineOffset:g=l.underlineOffset,underlineDash:m=l.underlineDash,fillOpacity:b=l.fillOpacity}=n.attribute,y=!h(c),v=y?c.width:n.clipedWidth,x=y?0:ts(d,v),_={lineWidth:0,stroke:f,opacity:p,strokeOpacity:b};if(t){_.lineWidth=t,u.setStrokeStyle(n,_,i,r,l),m&&u.setLineDash(m),u.beginPath();const e=r+s+g;u.moveTo(i+x,e,o),u.lineTo(i+x+v,e,o),u.stroke()}if(e){_.lineWidth=e,u.setStrokeStyle(n,_,i,r,l),u.beginPath();const t=r+a;u.moveTo(i+x,t,o),u.lineTo(i+x+v,t,o),u.stroke()}}};Zs=Ks([te(),Qs(0,Zt(me)),Qs(0,ee(Zr)),qs("design:paramtypes",[Object])],Zs);var Js=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},ta=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ea=function(t,e){return function(n,i){e(n,i,t)}};const na=["","repeat-x","repeat-y","repeat"];let ia=class extends ps{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Rr,this.builtinContributions=[Es,Os],this.init(t)}drawShape(t,e,n,i,r,s,a,o){const l=ki(t).image,{width:u=l.width,height:h=l.height,repeatX:c=l.repeatX,repeatY:d=l.repeatY,x:f=l.x,y:p=l.y,cornerRadius:g=l.cornerRadius,fillStrokeOrder:b=l.fillStrokeOrder,image:y}=t.attribute,v=this.valid(t,l,a);if(!v)return;const{fVisible:x,sVisible:_,doFill:A,doStroke:S}=v;if(!y||!t.resources)return;const w=t.resources.get(y);if("success"!==w.state)return;let T=!1;0===g||m(g)&&g.every((t=>0===t))||(e.beginPath(),Ss(e,n,i,u,h,g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(A)if(a)a(e,t.attribute,l);else if(x){e.setCommonStyle(t,t.attribute,n,i,l);let r=0;if("repeat"===c&&(r|=1),"repeat"===d&&(r|=2),r){const t=e.createPattern(w.data,na[r]);e.fillStyle=t,e.translate(n,i,!0),e.fillRect(0,0,u,h),e.translate(-n,-i,!0)}else e.drawImage(w.data,n,i,u,h)}},C=()=>{S&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,f-n,p-i,l),e.stroke()))};b?(C(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,A,!1,x,!1,l,r,a),B(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,n,i,A,!1,x,!1,l,r,a),B(),T&&e.restore(),C()),this.afterRenderStep(t,e,n,i,A,!1,x,!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&&g(i))return void rr.improveImageLoading(i);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=ki(t).image;this._draw(t,a,!1,n)}};ia=Js([te(),ea(0,Zt(me)),ea(0,ee(Kr)),ta("design:paramtypes",[Object])],ia);const ra=Symbol.for("GraphicRender"),sa=Symbol.for("RectRender"),aa=Symbol.for("SymbolRender"),oa=Symbol.for("TextRender"),la=Symbol.for("RichTextRender"),ua=Symbol.for("ImageRender"),ha=(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 ca{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:u=Ae.actualBounding,keepCenterInLine:h=!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,u);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:h})}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,u);e=s.width,i=Math.max(i,e),c.push({str:n,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:h})}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 da=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...lr];let fa=class t extends pr{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=Dr,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return m(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return ki(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=ut(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}=ii.graphicService.updateTempAABBBounds(n),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){Tr(r,o/Math.abs(s+a),!0,l),n.union(r)}return ii.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ii.graphicService.updateHTMLTextAABBBounds(t,e,n),ft(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:u=n.ellipsis,maxLineWidth:h,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 _=ii.graphicUtil.textMeasure,A=new ca(r,{fontSize:o,fontWeight:l,fontFamily:r,lineHeight:x},_).GetLayoutByLines(t,s,a,x,!0===u?n.ellipsis:u||void 0,!1,{lineWidth:h,suffixPosition:m,measureMode:f,keepCenterInLine:y}),{bbox:S}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(S.xOffset,S.yOffset,S.xOffset+S.width,S.yOffset+S.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:u=r.ellipsis,maxLineWidth:h,stroke:c=r.stroke,lineWidth:d=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:p=r.fontWeight,ignoreBuf:g=r.ignoreBuf,measureMode:b=r.measureMode,suffixPosition:y=r.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=r.keepCenterInLine}=this.attribute,A=g?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,r,A);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 w=ii.graphicUtil.textMeasure,T={fontSize:l,fontWeight:p,fontFamily:s,lineHeight:S},B=new ca(s,T,w),C=m(t)?t.map((t=>t.toString())):[t.toString()],k=[],M=[0,0];let P=1/0;if(v>0&&(P=Math.max(Math.floor(v/S),1)),x&&(P=Math.min(P,x)),"number"==typeof h&&h!==1/0){if(h>0)for(let t=0;t<C.length;t++){const e=C[t];let r=!0;if(t===P-1){const n=w.clipTextWithSuffix(e,T,h,u,!1,y,t!==C.length-1),i=w.measureTextPixelADscentAndWidth(n.str,T,b);k.push({str:n.str,width:n.width,ascent:i.ascent,descent:i.descent,keepCenterInLine:_});break}const s=w.clipText(e,T,h,"break-all"!==f,"keep-all"===f);if(""!==e&&""===s.str||s.wordBreaked){if(u){const t=w.clipTextWithSuffix(e,T,h,u,!1,y);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=w.measureTextPixelADscentAndWidth(s.str,T,b);k.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});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,"")),C.splice(t+1,0,n)}}let t=0;k.forEach((e=>{t=Math.max(t,e.width)})),M[0]=t}else{let t,e,n=0;for(let i=0,r=C.length;i<r;i++){if(i===P-1){const t=w.clipTextWithSuffix(C[i],T,h,u,!1,y),e=w.measureTextPixelADscentAndWidth(t.str,T,b);k.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),n=Math.max(n,t.width);break}e=C[i],t=w.measureTextWidth(e,T),n=Math.max(n,t);const r=w.measureTextPixelADscentAndWidth(e,T,b);k.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:_})}M[0]=n}M[1]=k.length*S;const E={xOffset:0,yOffset:0,width:M[0],height:M[1]};B.LayoutBBox(E,a,o,k);const O=B.layoutWithBBox(E,k,a,o,S);return this.cache.layoutData=O,this.clearUpdateShapeTag(),this._AABBBounds.set(E.xOffset,E.yOffset,E.xOffset+E.width,E.yOffset+E.height),c&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var n,i;const r=this.getGraphicTheme(),s=ii.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=r.maxLineWidth,ellipsis:u=r.ellipsis,fontFamily:h=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=Q(e,a)}));const t=ts(y,a),e=this.cache.verticalList.length*b,n=es(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++)Er(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:kr.VERTICAL}),i="",n=0),e.push({text:t[r],direction:kr.HORIZONTAL}));return i&&e.push({text:i,direction:kr.VERTICAL}),e}(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(l))if(u){const n=!0===u?r.ellipsis:u,i=s.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:d,fontFamily:h},l,n,!1,m);x[e]=i.verticalList,a=i.width}else{const n=s.clipTextVertical(t,{fontSize:c,fontWeight:d,fontFamily:h},l,!1);x[e]=n.verticalList,a=n.width}else a=0,t.forEach((t=>{const e=t.direction===kr.HORIZONTAL?c:s.measureTextWidth(t.text,{fontSize:c,fontWeight:d,fontFamily:h});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=Q(e,a)}));const _=ts(y,a),A=this.cache.verticalList.length*b,S=es(v,A,c);return this._AABBBounds.set(S,_,S+A,_+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=Ki(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]:da;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:da;return super.needUpdateTag(t,e)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return t.baselineMapAlign}getAlignMapBaseline(){return t.alignMapBaseline}};function pa(t){return new fa(t)}fa.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},fr),fa.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fa.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const ga=["heightLimit","lineClamp"];class ma extends fa{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return m(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:u=s.fontSize,ellipsis:h=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=Ki(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 A=ii.graphicUtil.textMeasure,S=new ca(a,{fontSize:u,fontWeight:g,fontFamily:a},A),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=S.textMeasure.clipTextWithSuffix(e,S.textOptions,c,h,!1,y);T.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1});break}const s=S.textMeasure.clipText(e,S.textOptions,c,"break-word"===p);if(""!==e&&""===s.str){if(h){const t=S.textMeasure.clipTextWithSuffix(e,S.textOptions,c,h,!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=S.textMeasure.clipTextWithSuffix(w[i],S.textOptions,c,h,!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=S.textMeasure.measureTextWidth(e,S.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]};S.LayoutBBox(k,o,l);const M=S.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<ga.length;e++){const n=ga[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<ga.length;e++)if(t===ga[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return ma.NOWORK_ANIMATE_ATTR}}function ba(t){return new ma(t)}class ya{bounds(t,e){if(y(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 y(t)?t:Math.min(t[0],t[1])}}function va(t,e,n,i,r){return r?t.arc(n,i,e,0,V,!1,r):t.arc(n,i,e,0,V),!1}var xa=new class extends ya{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 va(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return va(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 _a=new class extends ya{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 Aa(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 Sa=new class extends ya{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 Aa(t,this.parseSize(e)/2,n,i,r)}drawFitDir(t,e,n,i,r){return Aa(t,this.parseSize(e)/2,n,i,r)}drawOffset(t,e,n,i,r,s){return Aa(t,this.parseSize(e)/2+r,n,i,s)}};function wa(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var Ta=new class extends ya{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return wa(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return wa(t,this.parseSize(e)/2+r,n,i)}};function Ba(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 Ca extends ya{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 Ba(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ba(t,this.parseSize(e)/2,n,i,r)}}var ka=new Ca;var Ma=new class extends Ca{constructor(){super(...arguments),this.type="triangle"}};const Pa=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Ea=Math.sin(V/10)*Pa,Oa=-Math.cos(V/10)*Pa;function La(t,e,n,i){const r=Ea*e,s=Oa*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let a=1;a<5;++a){const o=V*a/5,l=Math.cos(o),u=Math.sin(o);t.lineTo(u*e+n,-l*e+i),t.lineTo(l*r-u*s+n,u*r+l*s+i)}return t.closePath(),!0}var Ra=new class extends ya{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 La(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return La(t,this.parseSize(e)/2+r,n,i)}};const Ia=tt(3);function Na(t,e,n,i){const r=e,s=r/Ia,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 Ua=new class extends ya{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 Na(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Na(t,this.parseSize(e)/2+r,n,i)}};function Da(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 za=new class extends ya{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return Da(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Da(t,this.parseSize(e)/2+r,n,i)}};function Wa(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Fa=new class extends ya{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,n,i){return Wa(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Wa(t,this.parseSize(e)/2+r,n,i)}};const ja=-.5,Ha=tt(3)/2,Ga=1/tt(12);function $a(t,e,n,i){const r=e/2,s=e*Ga,a=r,o=e*Ga+e,l=-a,u=o;return t.moveTo(r+n,s+i),t.lineTo(a+n,o+i),t.lineTo(l+n,u+i),t.lineTo(ja*r-Ha*s+n,Ha*r+ja*s+i),t.lineTo(ja*a-Ha*o+n,Ha*a+ja*o+i),t.lineTo(ja*l-Ha*u+n,Ha*l+ja*u+i),t.lineTo(ja*r+Ha*s+n,ja*s-Ha*r+i),t.lineTo(ja*a+Ha*o+n,ja*o-Ha*a+i),t.lineTo(ja*l+Ha*u+n,ja*u-Ha*l+i),t.closePath(),!1}var Va=new class extends ya{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 $a(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return $a(t,this.parseSize(e)/2+r,n,i)}};function Xa(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 Ya=new class extends ya{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 Xa(t,this.parseSize(e)/2,n,i,0)}drawOffset(t,e,n,i,r){return Xa(t,this.parseSize(e)/2,n,i,r)}};function Ka(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 qa=new class extends ya{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 Ka(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Ka(t,this.parseSize(e)/2,n,i,r)}};function Qa(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 Za=new class extends ya{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 Qa(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r){return Qa(t,this.parseSize(e)/2,n,i,r)}};const Ja=tt(3);function to(t,e,n,i){const r=e*Ja;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var eo=new class extends ya{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return to(t,this.parseSize(e)/2/Ja,n,i)}drawOffset(t,e,n,i,r){return to(t,this.parseSize(e)/2/Ja+r,n,i)}};function no(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 io=new class extends ya{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 no(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return no(t,this.parseSize(e)/4+r,n,i)}};function ro(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 so=new class extends ya{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 ro(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ro(t,this.parseSize(e)/4+r,n,i)}};function ao(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 oo=new class extends ya{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 ao(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return ao(t,this.parseSize(e)/4+r,n,i)}};function lo(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 uo=new class extends ya{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 lo(t,this.parseSize(e)/4,n,i)}drawOffset(t,e,n,i,r){return lo(t,this.parseSize(e)/4+r,n,i)}};function ho(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var co=new class extends ya{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return ho(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return ho(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 fo(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var po=new class extends ya{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return fo(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return fo(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 go(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 mo=new class extends ya{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 go(t,this.parseSize(e)/2,n,i)}drawOffset(t,e,n,i,r,s){return go(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 bo(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function yo(t,e,n,i){const r=e,s=e/2;return t.rect(n-r/2,i-s/2,r,s),!1}var vo=new class extends ya{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 y(e)?yo(t,e,n,i):bo(t,e,n,i)}drawOffset(t,e,n,i,r){return y(e)?yo(t,e+2*r,n,i):bo(t,[e[0]+2*r,e[1]+2*r],n,i)}};const xo=new gt;class _o{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,m(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(),en(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(en(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 y(t)?t:Math.min(t[0],t[1])}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((n=>{let{path:i}=n;xo.x1=i.bounds.x1*t,xo.y1=i.bounds.y1*t,xo.x2=i.bounds.x2*t,xo.y2=i.bounds.y2*t,e.union(xo)}))}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 Ao={};[xa,_a,Sa,Ta,eo,Ma,Ra,Ua,za,Fa,Va,Ya,qa,ka,Za,io,so,oo,uo,vo,co,po,mo].forEach((t=>{Ao[t.type]=t}));const So={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"},wo=new gt,To=["symbolType","size",...lr];let Bo=class t extends pr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Ur}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return m(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:n=e.symbolType}=this.attribute,i=Ao[n];if(i)return this._parsedPath=i,i;if(i=t.userSymbolMap[n],i)return this._parsedPath=i,i;if(n=So[n]||n,!0===((r=n).startsWith("<svg")||r.startsWith("<?xml"))){const e=new wr,{svg:i}=e.parse(n);if(!i)return null;const r=m(i.path)?i.path:[i.path];wo.clear();const s=[];r.forEach((t=>{const e=(new Ln).fromString(t.d),n={};Fr.forEach((e=>{t[e]&&(n[Wr[e]]=t[e])})),s.push({path:e,attribute:n}),wo.union(e.bounds)}));const a=wo.width(),o=wo.height(),l=1/Q(a,o);return s.forEach((t=>t.path.transform(0,0,l,l))),this._parsedPath=new _o(n,s,!0),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}var r;const s=(new Ln).fromString(n),a=s.bounds.width(),o=s.bounds.height(),l=1/Q(a,o);return s.transform(0,0,l,l),this._parsedPath=new _o(n,s),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}getGraphicTheme(){return ki(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}=ii.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;Tr(n,a+(r+o)/2,!0,s)}})(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return ii.graphicService.transformAABBBounds(t,n,e,"miter"===a,this),n}updateSymbolAABBBoundsImprecise(t,e,n){const{size:i=e.size}=t;if(m(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,To)}needUpdateTag(t){return super.needUpdateTag(t,To)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=m(e)?e:[e,e];return t.path?(new Ln).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Ln).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Co(t){return new Bo(t)}Bo.userSymbolMap={},Bo.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},fr);const ko=["width","x1","y1","height","cornerRadius",...lr];let Mo=class t extends pr{constructor(t){super(t),this.type="rect",this.numberType=Ir}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ki(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}=ii.graphicService.updateTempAABBBounds(n);return ha(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),ii.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,ko)}needUpdateTag(t){return super.needUpdateTag(t,ko)}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=h(t.width)?t.x1-t.x:t.width,n=h(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 Ln;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 Po(t){return new Mo(t)}Mo.NOWORK_ANIMATE_ATTR=fr;class Eo{constructor(t,e,n,i,r,s,a,o,l,u,h,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=u,this.directionKey=li[this.layoutDirection],this.isWidthMax=h,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 u=!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 u;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,u=!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 u;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,u=!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 u;{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,u=!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 u}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}}}class Oo{constructor(t,e,n){this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";const i=Ki(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof i?i>this.fontSize?i:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:a,width:o}=bi(t,n);let l=0,u=0,h=0;this.height>s&&(l=(this.height-s)/2,u=Math.ceil(l),h=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=s-l):"bottom"===this.textBaseline?(this.ascent=s-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+u,this.descent=a+h),this.length=t.length,this.width=o||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,"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}=bi(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,n,i,r){let s=this.text,a=this.left+n;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+=this.ellipsisStr,"right"!==r&&"end"!==r||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=gi(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+=this.ellipsisStr,"right"===r||"end"===r){const{width:e}=bi(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0);const{lineWidth:l=1}=this.character;this.character.stroke&&l&&t.strokeText(s,a,e),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const 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=gi(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:i}=bi(this.text.slice(t),this.character);return n+this.ellipsisWidth-i}return n}}const Lo=["width","height","image",...lr];let Ro=class t extends pr{constructor(t){super(t),this.type="image",this.numberType=Rr,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}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 ki(this).image}updateAABBBounds(t,e,n){if(!this.updatePathProxyAABBBounds(n)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const{tb1:i,tb2:r}=ii.graphicService.updateTempAABBBounds(n);return ha(t,e,i),n.union(i),i.setValue(r.x1,r.y1,r.x2,r.y2),ii.graphicService.transformAABBBounds(t,n,e,!1,this),n}getDefaultAttribute(t){return ei[t]}needUpdateTags(t){return super.needUpdateTags(t,Lo)}needUpdateTag(t){return super.needUpdateTag(t,Lo)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Io(t){return new Ro(t)}Ro.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},fr);class No 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=$i(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(m(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=$i(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=ei.width,height:e=ei.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 Uo{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=li[this.direction]}store(t){if(t instanceof No){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 No?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=li[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Oo){const e=fi.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 No?(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 No)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";n.ellipsisStr=s;const{width:a}=bi(s,n.character),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}}this.paragraphs.forEach(((e,r)=>{if(e instanceof No)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||hi;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,pi(t,e)})(t,e.character),function(t,e,n){const i=e&&e.fill||ui;if(!i)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=n?oi(t,i,{AABBBounds:n}):i,pi(t,e)}(t,e.character,a),e.draw(t,i+this.ascent,n,0===r,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let n=this.paragraphs.length-1;n>=0;n--){const i=this.paragraphs[n];if(i instanceof No)break;const{width:r}=bi(t,i.character),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 No?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 No?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const n=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(n/t[this.directionKey.width]*t.length)||0,r=gi(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 Oo(n,t.newLine,t.character),new Oo(i,!0,t.character)]}(t,r);this.store(n),e?this.send():this.deal(i)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const Do=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...lr];let zo=class t extends pr{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Nr,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:ti.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:ti.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:ti.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:ti.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:ti.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:ti.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:ti.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:ti.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return ki(this).richtext}updateAABBBounds(t,e,n){const{width:i=e.width,height:r=e.height,maxWidth:s=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:l=e.textBaseline}=t;if(i>0&&r>0)n.set(0,0,i,r);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let l=i||e||0,u=r||o||0;u="number"==typeof a&&u>a?a:u||0,l="number"==typeof s&&l>s?s:l||0,n.set(0,0,l,u)}let u=0;switch(l){case"top":u=0;break;case"middle":u=-n.height()/2;break;case"bottom":u=-n.height()}let h=0;switch(o){case"left":h=0;break;case"center":h=-n.width()/2;break;case"right":h=-n.width()}return n.translate(h,u),ii.graphicService.updateTempAABBBounds(n),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ii.graphicService.updateHTMLTextAABBBounds(t,e,n),ii.graphicService.transformAABBBounds(t,n,e,!1,this),n}needUpdateTags(t){return super.needUpdateTags(t,Do)}needUpdateTag(t){return super.needUpdateTag(t,Do)}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:u,strokeOpacity:h}=this.attribute;return Object.assign({fill:e,stroke:n,fontSize:i,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:u,strokeOpacity:h},t)}doUpdateFrameCache(t){var e;const{textConfig:n=[],maxWidth:i,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:l,verticalDirection:u,textAlign:h,textBaseline:c,layoutDirection:d,singleLine:f,disableAutoWrapLine:p}=this.attribute,g=[],m=null!=t?t:n;for(let t=0;t<m.length;t++)if("image"in m[t]){const e=this.combinedStyleToCharacter(m[t]);e.lineWidth=void 0;const n=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(n)g.push(n);else{const t=new No(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,g.push(t)}}else{const e=this.combinedStyleToCharacter(m[t]);if(y(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let n=0;n<t.length;n++)g.push(new Oo(t[n],0!==n,e))}else e.text&&g.push(new Oo(e.text,!1,e))}const b="number"==typeof i&&Number.isFinite(i)&&i>0,v="number"==typeof r&&Number.isFinite(r)&&r>0,x="number"==typeof s&&Number.isFinite(s)&&s>0&&(!b||s<=i),_="number"==typeof a&&Number.isFinite(a)&&a>0&&(!v||a<=r),A=new Eo(0,0,(x?s:b?i:0)||0,(_?a:v?r:0)||0,o,l,u,h,c,d||"horizontal",!x&&b,!_&&v,f||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),S=new Uo(A);if(p){let t=0,e=!1;for(let n=0;n<g.length;n++){const i=g[n];e?(i.overflow=!0,i.left=1/0,i.top=1/0,!i.newLine&&A.lines[A.lines.length-1].paragraphs.push(i)):S.deal(i,!0),A.lines.length!==t&&(t=A.lines.length,S.lineBuffer.length=0,i.overflow=!0,i.left=1e3,i.top=1e3,A.lines[A.lines.length-1].paragraphs.push(i),e=!0),i.newLine&&(e=!1,S.lineWidth=0),S.send()}}else for(let t=0;t<g.length;t++)S.deal(g[t]);if(S.send(),!("horizontal"===A.layoutDirection?x:_)){const t=A.getActualSizeWidthEllipsis();let e="horizontal"===A.layoutDirection?t.width:t.height;("horizontal"===A.layoutDirection?b:v)&&(e=Math.min(e,"horizontal"===A.layoutDirection?i:r)),A.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=A}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 Wo(t){return new zo(t)}zo.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},fr);const Fo=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...lr];let jo,Ho=class t extends pr{constructor(t){super(t),this.type="arc",this.numberType=Or}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(y(t,!0)?t:a*parseFloat(t)/100,a/2);if(m(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=at(e),n=e+s,i&&Y(s)<X-H){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:u=t.outerPadding,innerPadding:h=t.innerPadding}=this.attribute;o+=u,l-=h;const c=Math.abs(o-l)/2,d=c/o;if(c>H&&o>H)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=tt(a*a+o*o)}=this.attribute,u=Y(e-t);let h=t,c=e,d=t,f=e;const p=s/2;let g=u,m=u;if(p>H&&l>H){const n=e>t?1:-1;let i=nt(Number(l)/o*J(p)),r=nt(Number(l)/a*J(p));return(g-=2*i)>H?(i*=n,d+=i,f-=i):(g=0,d=f=(t+e)/2),(m-=2*r)>H?(r*=n,h+=r,c-=r):(m=0,h=c=(t+e)/2),{outerStartAngle:h,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}return{outerStartAngle:h,outerEndAngle:c,innerStartAngle:d,innerEndAngle:f,innerDeltaAngle:g,outerDeltaAngle:m}}getGraphicTheme(){return ki(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}=ii.graphicService.updateTempAABBBounds(n);ha(t,e,r),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return ii.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<=H?n.set(0,0,0,0):Math.abs(o-l)>X-H?n.set(-i,-i,i,i):(Yi(l,o,i,n),Yi(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 u=Y(a-s),h=a>s;if(l<o){const t=l;l=o,o=t}const c=new Ln;if(l<=H)c.moveTo(0,0);else if(u>=X-H)c.moveTo(0+l*q(s),0+l*J(s)),c.arc(0,0,l,s,a,!h),o>H&&(c.moveTo(0+o*q(a),0+o*J(a)),c.arc(0,0,o,a,s,h));else{const t=l*q(s),e=l*J(s),n=o*q(a),i=o*J(a);c.moveTo(0+t,0+e),c.arc(0,0,l,s,a,!h),c.lineTo(0+n,0+i),c.arc(0,0,o,a,s,h),c.closePath()}return c}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Go(){!function(){if(null==jo)try{const t=document.createElement("canvas"),e=t.getContext("2d");jo=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),jo&&(jo=!!document.createElement)}catch(t){jo=!1}}();const t=ii.global&&ii.global.env;return t?"browser"===t:jo}Ho.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},fr);var $o=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,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 Xo=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new gt}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 Vo(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}};Xo=$o([te()],Xo);let Yo=!1;const Ko=new Ht((t=>{Yo||(Yo=!0,t(zs).toSelf().inSingletonScope(),t(sa).to(zs).inSingletonScope(),t(ra).toService(sa),t(Cs).toSelf(),t(Bs).toSelf(),t(qr).toService(Cs),t(qr).toService(Bs),t(qr).toService(xs),ye(t,qr))}));let qo=!1;const Qo=new Ht((t=>{qo||(qo=!0,t(Hs).toSelf().inSingletonScope(),t(aa).to(Hs).inSingletonScope(),t(ra).toService(aa),t(Qr).toService(xs),ye(t,Qr))}));let Zo=!1;const Jo=new Ht((t=>{Zo||(Zo=!0,t(oa).to(Zs).inSingletonScope(),t(ra).toService(oa),t(Zr).toService(xs),ye(t,Zr))}));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)};let nl=class extends ps{constructor(){super(),this.numberType=Nr,this.builtinContributions=[Ys],this.init()}drawShape(t,e,n,i,r){const s=ki(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:l=s.fillOpacity,visible:u=s.visible}=t.attribute;if(!t.valid||!u)return;const h=Xr(o,l,!0),c=Xr(o,a,!0);h&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(n,i),this.beforeRenderStep(t,e,n,i,h,c,h,c,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,h,c,h,c,s,r))}drawIcon(t,e,n,i,r){var s;const a=ki(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:u=a.opacity,image:h,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(),Ss(e,n-t,i-r,b,y,g)),c&&(e.globalAlpha=d,e.fillStyle=c,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const v=h&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(h));v&&"success"===v.state&&(e.globalAlpha=u,e.drawImage(v.data,n,i,o,l))}draw(t,e,n){const i=ki(t).richtext;this._draw(t,i,!1,n)}};nl=tl([te(),el("design:paramtypes",[])],nl);let il=!1;const rl=new Ht((t=>{il||(il=!0,t(la).to(nl).inSingletonScope(),t(ra).toService(la))}));let sl=!1;const al=new Ht((t=>{sl||(sl=!0,t(ua).to(ia).inSingletonScope(),t(ra).toService(ua),t(Kr).toService(xs),ye(t,Kr))}));class ol{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=jt.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)),ii.graphicService.hooks.onRemove.unTap(this.key),ii.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,n){let i;return i=e?"string"==typeof e?ii.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:ii.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[Et(n)]=t[n])})),["fontSize","lineHeight"].forEach((i=>{const r=Et(i);h(t[i])||(e[r]=n(t[i]))})),c(t.maxLineWidth)&&(e["max-width"]=n(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&g(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:ki(t).text)}getTransformOfText(t){const e=ki(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%"},u={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:`${u[n]} ${u[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,c=0;const f=t.globalAABBBounds;let p=r.anchorType;if(h(p)&&(p="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===p&&(p="top-left"),"position"===p||f.empty()){const e=t.globalTransMatrix;l=e.e,c=e.f}else{const t=dt(f,p);l=t.x,c=t.y}const m=ii.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=e.viewBox,v=l+b.left-m.left+y.x1,x=c+b.top-m.top+y.y1;if(o.left=`${v}px`,o.top=`${x}px`,"text"===t.type&&"position"===p&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),u(r.style)){const e=r.style({top:x,left:v,width:f.width(),height:f.height()},t,n);e&&(o=Object.assign(Object.assign({},o),e))}else d(r.style)?o=Object.assign(Object.assign({},o),r.style):g(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),Pt(r.style)));ii.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"===ii.global.env&&(t.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:jn.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:jn.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&&ii.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=h(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"===ii.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 ll extends ol{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=jt.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?ii.global.getRequestAnimationFrame()((()=>{e.unmount()})):i&&i(),n&&ii.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=h(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:u}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,i,l,u,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 hl extends Hr{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,n,i){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);if(r)return this._setAttributes(r,n);p(this.attribute[t])&&p(e)&&!u(this.attribute[t])&&!u(e)?O(this.attribute[t],e):this.attribute[t]=e,ul.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=>ul.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){h(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const i=e[n];!p(this.attribute[i])||u(this.attribute[i])||u(t[i])?this.attribute[i]=t[i]:O(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 Oi(t,e);i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}}const cl=Symbol.for("MathPickerContribution"),dl=Symbol.for("MathImagePicker"),fl=Symbol.for("MathRectPicker"),pl=Symbol.for("MathSymbolPicker"),gl=Symbol.for("MathTextPicker"),ml=Symbol.for("CanvasImagePicker"),bl=Symbol.for("CanvasRectPicker"),yl=Symbol.for("CanvasSymbolPicker"),vl=Symbol.for("CanvasTextPicker"),xl=Symbol.for("CanvasRichTextPicker"),_l=Symbol.for("CanvasPickerContribution"),Al={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 Sl=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},wl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tl=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 Bl{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 Cl(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("img");if(ii.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 kl=class extends Xo{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,u;return o&&(l=a.width/o.offsetWidth,u=a.height/o.offsetHeight),{x:(t-a.left)/(v(l)?l:1),y:(n-a.top)/(v(u)?u: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 Bl(t)}return new gt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:n,height:i,style:r}=e;return r&&(g(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=g(n)?this.getElementById(n):n;t&&t.appendChild&&t.appendChild(i)}return i}loadImage(t){return Cl(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Cl(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:jt.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 Tl(this,void 0,void 0,(function*(){return new FontFace(t,g(e)?`url(${e})`:e,n).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return{loadState:"fail"}}))}))}};kl=Sl([te(),wl("design:paramtypes",[])],kl);class Ml{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();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;return this.canvasRenderer.drawShape(t,i,s,a,{},null,((t,n,i)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,n,r)=>{if(o)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,l=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=l?s+a:ai(i,s+a,i.dpr),o=t.isPointInStroke(e.x,e.y),o})),i.highPerformanceRestore(),o}}var Pl=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 El=class{constructor(){this.type="image",this.numberType=Rr}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};El=Pl([te()],El);let Ol=!1;const Ll=new Ht(((t,e,n,i)=>{Ol||(Ol=!0,t(dl).to(El).inSingletonScope(),t(El).toService(dl))})),Rl=new gt;class Il{constructor(){this.type="rect",this.numberType=Ir}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 u=!0;if(!l||t.shadowRoot||y(s,!0)&&0!==s||m(s)&&s.some((t=>0!==t)))u=!1,this.canvasRenderer.drawShape(t,i,a,o,{},null,((t,n,i)=>!!u||(u=t.isPointInPath(e.x,e.y),u)),((t,n,r)=>{if(u)return!0;const s=n.lineWidth||r.lineWidth,a=n.pickStrokeBuffer||r.pickStrokeBuffer,o=n.keepStrokeScale||r.keepStrokeScale;return i.lineWidth=o?s+a:ai(i,s+a,i.dpr),u=t.isPointInStroke(e.x,e.y),u}));else{const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)u=!0;else if(i){const n=t.AABBBounds;Rl.setValue(n.x1,n.y1,n.x2,n.y2),Rl.expand(-s/2),u=!Rl.containsPoint(e)}}return i.highPerformanceRestore(),u}}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},Ul=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dl=function(t,e){return function(n,i){e(n,i,t)}};let zl=class extends Il{constructor(t){super(),this.canvasRenderer=t}};zl=Nl([te(),Dl(0,Zt(sa)),Ul("design:paramtypes",[Object])],zl);let Wl=!1;const Fl=new Ht(((t,e,n,i)=>{Wl||(Wl=!0,t(fl).to(zl).inSingletonScope(),t(cl).toService(fl))}));let jl=!1;const Hl=new Ht(((t,e,n,i)=>{jl||(jl=!0,t(dl).to(El).inSingletonScope(),t(El).toService(dl))}));var Gl=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},$l=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vl=function(t,e){return function(n,i){e(n,i,t)}};let Xl=class extends Ml{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Ur}};Xl=Gl([te(),Vl(0,Zt(aa)),$l("design:paramtypes",[Object])],Xl);let Yl=!1;const Kl=new Ht(((t,e,n,i)=>{Yl||(Yl=!0,t(pl).to(Xl).inSingletonScope(),t(cl).toService(pl))}));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};let Ql=class{constructor(){this.type="text",this.numberType=Dr}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Ql=ql([te()],Ql);let Zl=!1;const Jl=new Ht(((t,e,n,i)=>{Zl||(Zl=!0,t(gl).to(Ql).inSingletonScope(),t(cl).toService(gl))}));var tu=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},eu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nu=function(t,e){return function(n,i){e(n,i,t)}};let iu=class extends Il{constructor(t){super(),this.canvasRenderer=t}};iu=tu([te(),nu(0,Zt(sa)),eu("design:paramtypes",[Object])],iu);let ru=!1;const su=new Ht(((t,e,n,i)=>{ru||(ru=!0,t(bl).to(iu).inSingletonScope(),t(_l).toService(bl))}));class au extends ps{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:u}=s;let h=e;if(i.camera){h=e.clone();const n=t.parent.globalTransMatrix;h.x=n.a*e.x+n.c*e.y+n.e,h.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(h.x,h.y),c))),this.canvasRenderer.z=0,i.modelMatrix!==u&&os.free(i.modelMatrix),i.modelMatrix=u,i.highPerformanceRestore(),c}}var ou=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},lu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uu=function(t,e){return function(n,i){e(n,i,t)}};let hu=class extends au{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Ur}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:u,lastModelMatrix:h}=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=u;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:ai(i,r+s,i.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==h&&os.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),d}};hu=ou([te(),uu(0,Zt(aa)),lu("design:paramtypes",[Object])],hu);let cu=!1;const du=new Ht(((t,e,n,i)=>{cu||(cu=!0,t(yl).to(hu).inSingletonScope(),t(_l).toService(yl))}));var fu=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},pu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gu=function(t,e){return function(n,i){e(n,i,t)}};let mu=class extends au{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Dr}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:u,y:h,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,u,h,{},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=es(a,d,r),b=ts(o,g);return e.rect(b+u,m+h,g,d,c),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&os.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};mu=fu([te(),gu(0,Zt(oa)),pu("design:paramtypes",[Object])],mu);let bu=!1;const yu=new Ht(((t,e,n,i)=>{bu||(bu=!0,t(vl).to(mu).inSingletonScope(),t(_l).toService(vl))}));var vu=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},xu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_u=function(t,e){return function(n,i){e(n,i,t)}};let Au=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Nr}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};Au=vu([te(),_u(0,Zt(la)),xu("design:paramtypes",[Object])],Au);let Su=!1;const wu=new Ht(((t,e,n,i)=>{Su||(Su=!0,t(xl).to(Au).inSingletonScope(),t(_l).toService(xl))}));var Tu=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 Bu=class{constructor(){this.type="image",this.numberType=Rr}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};Bu=Tu([te()],Bu);let Cu=!1;const ku=new Ht(((t,e,n,i)=>{Cu||(Cu=!0,t(ml).to(Bu).inSingletonScope(),t(_l).toService(ml))})),Mu=Go();function Pu(){Pu.__loaded||(Pu.__loaded=!0,$s.RegisterGraphicCreator("group",Gr))}Pu.__loaded=!1;const Eu=Pu;function Ou(){Ou.__loaded||(Ou.__loaded=!0,$s.RegisterGraphicCreator("image",Io),yi.load(al),yi.load(Mu?ku:Ll))}Ou.__loaded=!1;const Lu=Ou;function Ru(){Ru.__loaded||(Ru.__loaded=!0,$s.RegisterGraphicCreator("rect",Po),yi.load(Ko),yi.load(Mu?su:Fl))}Ru.__loaded=!1;const Iu=Ru;function Nu(){Nu.__loaded||(Nu.__loaded=!0,$s.RegisterGraphicCreator("richtext",Wo),yi.load(rl),yi.load(Mu?wu:Hl))}Nu.__loaded=!1;const Uu=Nu;function Du(){Du.__loaded||(Du.__loaded=!0,$s.RegisterGraphicCreator("symbol",Co),yi.load(Qo),yi.load(Mu?du:Kl))}Du.__loaded=!1;const zu=Du;function Wu(){Wu.__loaded||(Wu.__loaded=!0,$s.RegisterGraphicCreator("text",pa),yi.load(Jo),yi.load(Mu?yu:Jl))}Wu.__loaded=!1;const Fu=Wu;function ju(){ju.__loaded||(ju.__loaded=!0,$s.RegisterGraphicCreator("wrapText",ba))}ju.__loaded=!1;const Hu=ju,Gu="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 Vu(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const i=Xs({text:t,fontFamily:e.fontFamily||n.fontFamily||Gu,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 Xu(t){return"rich"===function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var n,i;return d(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 Yu=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};Eu(),Iu(),zu(),Uu(),Fu();let Ku=class t extends hl{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(e,n){super((null==n?void 0:n.skipDefault)?e:O({},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:u,maxWidth:f,padding:p=4,visible:g,state:b,type:x,textAlwaysCenter:_,containerTextAlign:A}=this.attribute,S=function(t){if(v(t))return[t,t,t,t];if(m(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(d(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]}(p),w=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let T,C=-S[3],k=-S[0],M=S[1]+S[3],P=S[0]+S[2],E=0,O=0;const{visible:L}=s,R=Yu(s,["visible"]);if(l(L)){const t=(null==R?void 0:R.size)||10,e=y(t)?t:Math.max(t[0],t[1]);T=w.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},R),{visible:L,x:e/2,y:e/2}),"symbol"),B(null==b?void 0:b.shape)||(T.states=b.shape),L&&(O=e+o)}let I;if(M+=O,E+=O,Xu({text:i})||"rich"===x){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,n;return c(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:x,text:i},r))),r),{visible:c(i)&&!1!==g,x:E,y:0});I=w.createOrUpdateChild("tag-text",t,"richtext"),M+=I.AABBBounds.width(),P+=I.AABBBounds.height(),C+=I.AABBBounds.x1,k+=I.AABBBounds.y1}else{const a=Object.assign(Object.assign({text:d(i)&&"type"in i&&"text"===i.type?i.text:i,visible:c(i)&&!1!==g,lineHeight:null==r?void 0:r.fontSize},r),{x:E,y:0});h(a.lineHeight)&&(a.lineHeight=r.fontSize),I=w.createOrUpdateChild("tag-text",a,"text"),B(null==b?void 0:b.text)||(I.states=b.text);const o=Vu(a.text,r,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text),l=o.width,p=o.height;M+=l;const m=null!==(n=s.size)&&void 0!==n?n:10,v=y(m)?m:Math.max(m[0],m[1]);P+=Math.max(p,s.visible?v:0);const{textAlign:x,textBaseline:L}=r;(c(u)||c(f))&&(c(u)&&M<u&&(M=u),c(f)&&M>f&&(M=f,I.setAttribute("maxLineWidth",f-S[1]-S[2]))),C=0,k=0;let R=0;"left"===x||"start"===x?R=1:"right"===x||"end"===x?R=-1:"center"===x&&(R=0),R?R<0?(C-=M,T&&T.setAttribute("x",(T.attribute.x||0)-l),w.setAttribute("x",-S[1]-O)):R>0&&w.setAttribute("x",S[3]):(C-=M/2,T&&T.setAttribute("x",(T.attribute.x||0)-l/2),w.setAttribute("x",-O/2));const N="right"===A||"end"===A,U="left"===A||"start"===A;if((A?"center"===A:_)&&R){const t=M-S[1]-S[3],e=l+O,n=1===R?(t-e)/2+O+l/2:S[0]+O-(M/2+e/2-O)+l/2;if(I.setAttributes({x:n,textAlign:"center"}),T){const t=n-l/2-O+v/2;T.setAttributes({x:t})}}if(U&&1!==R){const t=M-S[1]-S[3],e=0===R?-t/2+O/2:-M+S[3]+S[1]+O,n=e+O;if(I.setAttributes({x:n,textAlign:"left"}),T){const t=e+v/2;T.setAttributes({x:t})}}if(N&&-1!==R){const t=M-S[1]-S[3],e=0===R?t/2+O/2:t;if(I.setAttributes({x:e,textAlign:"right"}),T){const t=e-l-O+v/2;T.setAttributes({x:t})}}"middle"===L?(k-=P/2,T&&T.setAttribute("y",0)):"bottom"===L?(k-=P,T&&T.setAttribute("y",-p/2),w.setAttribute("y",-S[2])):"top"===L&&(w.setAttribute("y",S[0]),T&&T.setAttribute("y",p/2))}const{visible:N}=a,U=Yu(a,["visible"]);if(g&&l(N)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},U),{visible:N&&!!i,width:M,height:P,x:C,y:k}),"rect");if(B(null==b?void 0:b.panel)||(t.states=b.panel),U.customShape){const e=U.customShape;t.pathProxy=t=>e(this,t,new Ln)}this._bgRect=t}this._textShape=I,this._symbol=T,this.resetStates()}initAttributes(e,n){e=(null==n?void 0:n.skipDefault)?e:O({},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,u,h,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!==(h=null===(u=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===u?void 0:u.slice())&&void 0!==h?h:[],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))}};Ku.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};Eu(),Iu(),Fu(),Lu();class qu extends hl{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},qu.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 Mo(O({},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(O({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Ro(O({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 fa(O({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,u=Math.max(o,l),h=u/2-o/2,c=u/2-l/2,d=u+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:h,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:O({},qu.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}qu.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}},Eu(),Iu(),Hu(),Lu();let Qu=class t extends hl{constructor(e,n){super((null==n?void 0:n.skipDefault)?e:O({},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 Ho(O({},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 fa(O({},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:O({},t.defaultAttributes,e),super.initAttributes(e),this.renderGroup(),this.render()}};Qu.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 Zu extends ll{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?ii.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:ii.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 l=0,c=0;const f=t.globalAABBBounds;let p=r.anchorType;if(h(p)&&(p="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===p&&(p="top-left"),"position"===p||f.empty()){const e=t.globalTransMatrix;l=e.e,c=e.f}else{const t=dt(f,p);l=t.x,c=t.y}const m=ii.global.getElementTopLeft(i,!1),b=e.window.getTopLeft(!1),y=l+b.left-m.left,v=c+b.top-m.top;if(o.left=`${y}px`,o.top=`${v}px`,"text"===t.type&&"position"===p&&(o={...o,...this.getTransformOfText(t)}),u(r.style)){const e=r.style({top:v,left:y,width:f.width(),height:f.height()},t,n);e&&(o={...o,...e})}else d(r.style)?o={...o,...r.style}:g(r.style)&&r.style&&(o={...o,...Pt(r.style)});ii.global.updateDom(n,{width:r.width,height:r.height,style:o,graphic:t})}drawHTML(){"browser"===ii?.global?.env&&(this.pluginService.stage.children.sort(((t,e)=>(t.attribute.zIndex??jn.zIndex)-(e.attribute.zIndex??jn.zIndex))).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}}const Ju=new Ht(((t,e,n,i)=>{t(th).toSelf().inSingletonScope(),n(_e)?i(_e).toService(th):t(_e).toService(th)}));class th extends kl{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&&(g(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}}Go()&&yi.load(Ju);const eh=["children","hooks","ref",...zt,"skipFunctionDiff","onError","onReady","option","records","container","vtableConstrouctor"],nh=(t,e)=>`${t&&t.type&&(t.type.displayName||t.type.name)}-${e}`,ih=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(L(t,eh)),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 Zu),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;Ft(a.current.table,t,p.current,Dt),s(r+1),t.onReady&&t.onReady(a.current.table,0===r)}}),[r,s,t]),S=n.useCallback((()=>{a.current.table&&(a.current.table.render(),A())}),[A]);return n.useEffect((()=>{const e=o?null:(t=>{const e={};return Nt(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:nh(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),S(),void(p.current=t);if(o){if(N(p.current.option,t.option,{skipFunction:g})){if(l&&!N(p.current.records,t.records,{skipFunction:g})){if(m){const t=sh(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=sh(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=L(t,eh);if(N(n,c.current,{skipFunction:g})&&N(e,d.current,{skipFunction:g})){if(l&&!N(t.records,f.current,{skipFunction:g})){if(f.current=t.records,m){const t=sh(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=sh(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,S,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},Nt(t.children).map(((t,e)=>{if("string"==typeof t)return;const i=nh(t,e);return n.createElement(n.Fragment,{key:i},n.cloneElement(t,{updateId:r,componentId:i,componentIndex:e}))})))})),rh=(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:u,width:h,...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%",...u}},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}(ih,t,(t=>e?Object.assign(t,e):t));return r.displayName=t,r};function sh(t,e,n){if(n.isPivotTable())return e;const i=[];return t.forEach(((t,e)=>{i.push({key:e,width:t})})),i}const ah=rh("ListTable",{type:"list-table",vtableConstrouctor:e.ListTable}),oh=rh("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTable}),lh=rh("PivotChart",{type:"pivot-chart",vtableConstrouctor:e.PivotChart});const uh=rh("ListTable",{type:"list-table",vtableConstrouctor:e.ListTableSimple}),hh=rh("PivotTable",{type:"pivot-table",vtableConstrouctor:e.PivotTableSimple});var ch,dh,fh,ph,gh={exports:{}},mh={exports:{}},bh={};function yh(){return dh||(dh=1,mh.exports=(ch||(ch=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],u=o+1,h=t[u];if(0>r(l,n))u<s&&0>r(h,l)?(t[i]=h,t[u]=n,i=u):(t[i]=l,t[o]=n,i=o);else{if(!(u<s&&0>r(h,n)))break t;t[i]=h,t[u]=n,i=u}}}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=[],u=[],h=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(u);null!==r;){if(null===r.callback)i(u);else{if(!(r.startTime<=t))break;i(u),r.sortIndex=r.expirationTime,e(l,r)}r=n(u)}}function x(t){if(g=!1,v(t),!p)if(null!==n(l))p=!0,O(_);else{var e=n(u);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 h=!0;else{var m=n(u);null!==m&&L(x,m.startTime-r),h=!1}return h}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 A,S=!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?A():(S=!1,w=null)}}else S=!1}if("function"==typeof y)A=function(){y(M)};else if("undefined"!=typeof MessageChannel){var P=new MessageChannel,E=P.port2;P.port1.onmessage=M,A=function(){E.postMessage(null)}}else A=function(){m(M,0)};function O(t){w=t,S||(S=!0,A())}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:h++,callback:r,priorityLevel:i,startTime:s,expirationTime:o=s+o,sortIndex:-1},s>a?(i.sortIndex=s,e(u,i),null===n(l)&&i===n(u)&&(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}}}}(bh)),bh)),mh.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
- */gh.exports=(ph||(ph=1,fh=function(t){var e={},i=n,r=yh(),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"),u=Symbol.for("react.portal"),h=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 h:return"Fragment";case u: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,ut=t.setFocusIfFocusable,ht=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 ue(t,e){ae++,se[ae]=t.current,t.current=e}var he={},ce=oe(he),de=oe(!1),fe=he;function pe(t,e){var n=t.type.contextTypes;if(!n)return he;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!==he)throw Error(a(168));ue(ce,e),ue(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||he,fe=ce.current,ue(ce,t),ue(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),ue(ce,t)):le(de),ue(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 un(t,e){Je[tn++]=nn,Je[tn++]=en,en=t,nn=e}function hn(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&&(un(t,1),hn(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=ho(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===h?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=ho(""+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 u: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 u: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 u: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 u=null,h=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===h?u=p:h.sibling=p,h=p,c=f}if(d===o.length)return n(r,c),gn&&un(r,d),u;if(null===c){for(;d<o.length;d++)null!==(c=g(r,o[d],l))&&(a=s(c,a,d),null===h?u=c:h.sibling=c,h=c);return gn&&un(r,d),u}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===h?u=f:h.sibling=f,h=f);return t&&c.forEach((function(t){return e(r,t)})),gn&&un(r,d),u}function x(r,o,l,u){var h=S(l);if("function"!=typeof h)throw Error(a(150));if(null==(l=h.call(l)))throw Error(a(151));for(var c=h=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,u);if(null===v){null===d&&(d=p);break}t&&d&&null===v.alternate&&e(r,d),o=s(v,o,f),null===c?h=v:c.sibling=v,c=v,d=p}if(y.done)return n(r,d),gn&&un(r,f),h;if(null===d){for(;!y.done;f++,y=l.next())null!==(y=g(r,y.value,u))&&(o=s(y,o,f),null===c?h=y:c.sibling=y,c=y);return gn&&un(r,f),h}for(d=i(r,d);!y.done;f++,y=l.next())null!==(y=b(d,r,f,y.value,u))&&(t&&null!==y.alternate&&d.delete(null===y.key?f:y.key),o=s(y,o,f),null===c?h=y:c.sibling=y,c=y);return t&&d.forEach((function(t){return e(r,t)})),gn&&un(r,f),h}return function t(i,s,a,c){if("object"==typeof a&&null!==a&&a.type===h&&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)===h){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===h?((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 u: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=ho(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?(ue(Nn,e._currentValue),e._currentValue=n):(ue(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 u=l,h=u.next;u.next=null,null===o?a=h:o.next=h,o=u;var c=t.alternate;null!==c&&(l=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===l?c.firstBaseUpdate=h:l.next=h,c.lastBaseUpdate=u)}if(null!==a){var d=r.baseState;for(o=0,c=h=u=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?(h=c=p,u=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&&(u=d),r.baseState=u,r.firstBaseUpdate=h,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 ui(t){if(t===si)throw Error(a(174));return t}function hi(t,e){ue(li,e),ue(oi,t),ue(ai,si),t=R(e),le(ai),ue(ai,t)}function ci(){le(ai),le(oi),le(li)}function di(t){var e=ui(li.current),n=ui(ai.current);n!==(e=I(n,t.type,e))&&(ue(oi,t),ue(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,u=null,h=s;do{var c=h.lane;if((xi&c)===c)null!==u&&(u=u.next={lane:0,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),i=h.hasEagerState?h.eagerState:t(i,h.action);else{var d={lane:c,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null};null===u?(l=u=d,o=i):u=u.next=d,_i.lanes|=c,la|=c}h=h.next}while(null!==h&&h!==s);null===u?o=i:u.next=l,Xe(i,e.memoizedState)||(Or=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=u,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},ur(t)?hr(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(ur(t))hr(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 ur(t){var e=t.alternate;return t===_i||null!==e&&e===_i}function hr(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=he,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):he),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},ue(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,ue(sa,ra),ra|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==s?s.baseLanes:n,ue(sa,ra),ra|=i}else null!==s?(i=s.baseLanes|n,e.memoizedState=null):i=n,ue(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,u=n.contextType;u="object"==typeof u&&null!==u?$n(u):pe(e,u=ge(n)?fe:ce.current);var h=n.getDerivedStateFromProps,c="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate;c||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==u)&&_r(e,a,i,u),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 h&&(br(e,n,h,i),l=e.memoizedState),(o=qn||vr(e,n,o,i,d,l,u))?(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=u,i=o):("function"==typeof a.componentDidMount&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,Zn(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:mr(e.type,o),a.props=u,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;(h="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),(u=qn||vr(e,n,u,i,d,p,l)||!1)?(h||"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=u):("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),hi(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),ue(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=uo(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=uo({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 u={mode:"hidden",children:r.children};return 0==(1&l)&&e.child!==s?((r=e.child).childLanes=0,r.pendingProps=u,e.deletions=null):(r=ao(s,u)).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=uo({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(ue(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=ui(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=ui(ai.current),u=null;a!==i&&(u=F(o,n,a,i,r,l)),t&&null===u?e.stateNode=s:(s=Bt(s,u,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=ui(li.current),n=ui(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 us(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=ui(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=ui(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=ui(li.current),n=ui(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 ue(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,ue(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 hs(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 u=r.alternate;null!==u&&(u.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 u=o.stateNode;if("function"==typeof u.componentWillUnmount){var h=o,c=o.return;try{var d=h;u.props=d.memoizedProps,u.state=d.memoizedState,u.componentWillUnmount()}catch(t){Qa(h,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 u=ds;if(cs=a,(ds=l)&&!u)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=u}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 u=e.alternate;if(null!==u){var h=u.memoizedState;if(null!==h){var c=h.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&&lt(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,ua=0,ha=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)&&(ua|=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&=~ha,e&=~ua,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,ha=ua=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,u=e;if(e=ia,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var h=u,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,h,e),u=h;var g=(e=p).updateQueue;if(null===g){var m=new Set;m.add(u),e.updateQueue=m}else g.add(u);break t}if(0==(1&e)){kr(s,h,e),ja();break t}u=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(u,l));break t}}s=u=Ar(u,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,u,e));break t;case 1:l=u;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&ua)||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=us(n,e,ra)))return void(na=n)}else{if(null!==(n=hs(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 u=0;u<l.length;u++){var h=l[u];for(ps=h;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===h){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):ha|=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 h: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 uo(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 uo(t,e,n,i){return(t=ro(22,t,i,e)).elementType=x,t.lanes=n,t.stateNode={isHidden:!1},t}function ho(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 he;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:hi(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?(ue(pi,1&pi.current),e.flags|=128,null):0!=(n&e.child.childLanes)?qr(t,e,n):(ue(pi,1&pi.current),null!==(t=is(t,e,n))?t.sibling:null);ue(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),ue(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)&&hn(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 hi(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 u=l.firstContext;null!==u;){if(u.context===i){if(1===s.tag){(u=Jn(-1,n&-n)).tag=2;var h=s.updateQueue;if(null!==h){var c=(h=h.shared).pending;null===c?u.next=u:(u.next=c.next,c.next=u),h.pending=u}}s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),Hn(s.return,n,e),l.lanes|=n;break}u=u.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:u,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 u=t[l],h=u.x,c=h+u.width,d=u.y,f=d+u.height;if(i>=h&&s>=d&&r<=c&&o<=f){t.splice(e,1);break}if(!(i!==h||n.width!==u.width||f<s||d>o)){d>s&&(u.height+=d-s,u.y=s),f<o&&(u.height=o-d),t.splice(e,1);break}if(!(s!==d||n.height!==u.height||c<i||h>r)){h>i&&(u.width+=h-i,u.x=i),c<r&&(u.width=r-h),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&&ut(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=ht(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}),fh);var vh,xh=r(gh.exports),_h={exports:{}},Sh={};_h.exports=(vh||(vh=1,Sh.ConcurrentRoot=1,Sh.ContinuousEventPriority=4,Sh.DefaultEventPriority=16,Sh.DiscreteEventPriority=1,Sh.IdleEventPriority=536870912,Sh.LegacyRoot=0),Sh);var Ah=_h.exports;const wh=xh({supportsMutation:!0,supportsPersistence:!1,createInstance:(t,e,n)=>{const i=function(t,e){const n=function(t,e){if("tag"===t)return new Ku(e.attribute?e.attribute:e);if("radio"===t)return new Qu(e.attribute?e.attribute:e);if("checkbox"===t)return new qu(e.attribute?e.attribute:e)}(t,e);if(n)return n;if(!ii.graphicService.creator[t])return;const i=ii.graphicService.creator[t](e.attribute);return i}(t,e);if(i)return function(t,e){for(const n in e)Th(n,e)&&Sl[n]&&t.addEventListener(Sl[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:()=>Ah.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)Th(i,n)&&n[i]!==e[i]&&t.removeEventListener(Sl[i],n[i]);for(const i in e)Th(i,e)&&n[i]!==e[i]&&t.addEventListener(Sl[i],e[i]);const i=e.attribute??O({},e);t.initAttributes(i),"image"===t.type&&t.loadImage(i.image);if("flex"===i.display&&void 0===i.width&&void 0===i.height&&y(n.attribute.width)&&y(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 Th(t,e){return t.startsWith("on")&&u(e[t])}wh.injectIntoDevTools({bundleType:0,version:n.version,rendererPackageName:"react-vtable"});const Bh=(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,u=n.useRef(new Map),h=n.useCallback((t=>{const e=`${t.originCol??t.col}-${t.originRow??t.row}${t.forComputation?"-forComputation":""}`;let n;if(u.current.has(e)){const i=u.current.get(e);Ch(s,i,t),n=i.containerInfo}else{n=new Hr({});const i=wh.createContainer(n,Ah.LegacyRoot,null,null,null,"custom",null,null);u.current.set(e,i),Ch(s,i,t)}return{rootContainer:n,renderDefault:!!s.props.renderDefault}}),[s]),c=n.useCallback(((t,e)=>{const n=`${t}-${e}`;if(u.current.has(n)){const t=u.current.get(n);wh.updateContainer(null,t,null),t.containerInfo.delete(),u.current.delete(n)}}),[]),d=n.useCallback((()=>{u.current.forEach(((t,e)=>{const n=t;wh.updateContainer(null,n,null),n.containerInfo.delete()})),u.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,h,l),o.reactCustomLayout?.setReactRemoveGraphic(r,c,l),o.reactCustomLayout?.updateCustomCell(r,l)):o&&(o.reactCustomLayout?.setReactCreateGraphic(r,h,l),u.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,u={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,Ch(s,l,u),o.scenegraph.updateNextFrame()})))})),null};function Ch(t,e,i){wh.updateContainer(n.cloneElement(t,{...i}),e,null)}const kh=(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&&Ft(e.table,t,s.current,r)&&(s.current=t)}return n.useEffect((()=>()=>{r&&Ft(e.table,null,s.current,r)}),[]),Ph(t.children,t.componentId)};return l.displayName=t,l.parseOption=t=>{const i=L(t,o);if(t.children){const{children:e}=t;n.Children.map(e,((e,n)=>{Mh(e,t,i,o,t.componentId+"-"+n)}))}return{option:i,optionName:e,isSingle:s}},l};function Mh(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=L(t.props,r);i.columns.push(a),a.componentId=s,t.props.children&&n.Children.map(t.props.children,((t,n)=>{Mh(t,e,a,r,s+"-"+n)}))}}function Ph(t,e){return(i=t)&&i.$$typeof===Symbol.for("react.element")||Array.isArray(t)?n.Children.map(t,((t,i)=>t.props.children?Ph(t.props.children,e+"-"+i):"custom-layout"===t.props.role||"header-custom-layout"===t.props.role?n.createElement(Bh,{componentId:e},t):null)):null;var i}const Eh=kh("ListColumn","columns"),Oh=kh("PivotColumnDimension","columns"),Lh=kh("PivotRowDimension","rows"),Rh=kh("PivotIndicator","indicators"),Ih=kh("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),Nh=kh("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),Uh=kh("PivotCorner","corner",void 0,!0),Dh=kh("Menu","menu",void 0,!0),zh=kh("Tooltip","tooltip",void 0,!0),Wh=kh("EmptyTip","emptyTip",void 0,!0),Fh=kh("Title","title",void 0,!0);function jh(t,e){return y(t)?t:"string"==typeof t&&t.endsWith("%")?Number(t.slice(0,-1))/100*e:0}const Hh="group",Gh="text",$h="tag",Vh={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 Xh=n.forwardRef((function(t,e){const i=O({},Vh,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:u,children:h}=t,c={text:h,textStyle:e,padding:n,panel:i,minWidth:r,maxWidth:s,visible:a,cursor:o??l?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:u?.textStyle?.hover,disabled:u?.textStyle?.disabled},panel:{hover:u?.panelStyle?.hover,disabled:u?.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($h,{ref:a,attribute:l,onClick:o})}));Xh.displayName="Button";const Yh={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 Kh=n.forwardRef((function(t,e){const i=O({},Yh,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]),u=function(t){const{textStyle:e,padding:n,space:i,panelStyle:r,minWidth:s,maxWidth:a,visible:o,cursor:l,disabled:u,icon:h,state:c,children:d}=t,f={text:d,textStyle:e,padding:n,panel:r,minWidth:s,maxWidth:a,visible:o,cursor:l??u?"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:!!h,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($h,{ref:o,attribute:u,onClick:l})}));Kh.displayName="Link";const qh={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 Qh=n.forwardRef((function(t,e){const i=O({},qh,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]),u=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(g(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=Vu(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(Hh,{ref:o,attribute:u,onClick:l},n.createElement(Gh,{attribute:t}))}return"image"===s.type&&(s.props.attribute.width=r,s.props.attribute.height=r),n.createElement(Hh,{ref:o,attribute:u,onClick:l},s)}));Qh.displayName="Avatar";const Zh={defaultPopupVisible:!1,position:"top"},Jh={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"},tc=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:O({},Jh,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 nc=n.forwardRef((function(t,e){const i=O({},Zh,t),{content:r,position:s,popupVisible:a,defaultPopupVisible:o,panelStyle:l,arrowStyle:u,children:h}=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(tc,{visible:f,content:r,position:s,panelStyle:l,arrowStyle:u}),container:null,visible:!0,pointerEvents:!1,anchorType:m}},y=n.useCallback((t=>{c(a)||(p(!0),t.currentTarget.stage.renderNextFrame())}),[]),v=n.useCallback((t=>{c(a)||(p(!1),t.currentTarget.stage.renderNextFrame())}),[]);return n.createElement(Hh,{ref:d,attribute:b,onMouseEnter:y,onMouseLeave:v},h)}));nc.displayName="Popover";const ic={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=O({},ic,t),{attribute:r,panelStyle:s,children:a,...o}=i;let l=n.useRef(null);return l=e||l,n.createElement($h,{ref:l,attribute:r??{text:a,panel:s,...o},...o})}));rc.displayName="Tag";const sc={};const ac=n.forwardRef((function(t,e){const i=O({},sc,t),{textStyle:r,circleStyle:s,children:a,...o}=i;let l=n.useRef(null);l=e||l;const u=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(l.current?.addEventListener("radio_checked",u),()=>{l.current?.removeEventListener("radio_checked",u)})),[]),n.createElement("radio",{ref:l,attribute:{text:{...r,text:a},circle:s,...o},...o})}));ac.displayName="Radio";const oc={};const lc=n.forwardRef((function(t,e){const i=O({},oc,t),{textStyle:r,boxStyle:s,iconStyle:a,children:o,...l}=i;let u=n.useRef(null);u=e||u;const h=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(u.current?.addEventListener("checkbox_state_change",h),()=>{u.current?.removeEventListener("checkbox_state_change",h)})),[]),n.createElement("checkbox",{ref:u,attribute:{text:{...r,text:o},box:s,icon:a,...l},...l})}));lc.displayName="Checkbox";Object.defineProperty(t,"register",{enumerable:!0,get:function(){return e.register}}),t.Arc="arc",t.Avatar=Qh,t.Button=Xh,t.Checkbox=lc,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=O({},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:u,height:h,row:c,col:d,anchor:f,dx:p,dy:g,className:m,children:b,style:y}=s;let v,x,_,S;if("position"===a)v=o+p+"px",x=l+g+"px",_=u+"px",S=h+"px";else if("cell"===a){const t=r&&d>=0&&c>=0?r?.getCellRelativeRect(d,c):{width:0,height:0,left:-9999,top:-9999};_=jh(u,t.width)+"px",S=jh(h,t.height)+"px","top-left"===f?(v=t.left+jh(p,t.width)+"px",x=t.top+jh(g,t.height)+"px"):"top-right"===f?(v=t.left+jh(p,t.width)+t.width+"px",x=t.top+jh(g,t.height)+"px"):"bottom-left"===f?(v=t.left+jh(p,t.width)+"px",x=t.top+jh(g,t.height)+t.height+"px"):"bottom-right"===f&&(v=t.left+jh(p,t.width)+t.width+"px",x=t.top+jh(g,t.height)+t.height+"px")}const A=O({},y,{position:"absolute",zIndex:1e3,width:_,height:S,left:v,top:x});return n.createElement("div",{className:m,style:A},n.Children.map(b,(t=>t?n.cloneElement(t,{}):t)))},t.CustomLayout=Bh,t.EmptyTip=Wh,t.Group=Hh,t.Image="image",t.Line="line",t.Link=Kh,t.ListColumn=Eh,t.ListTable=ah,t.ListTableSimple=uh,t.Menu=Dh,t.Path="path",t.PivotChart=lh,t.PivotColumnDimension=Oh,t.PivotColumnHeaderTitle=Ih,t.PivotCorner=Uh,t.PivotIndicator=Rh,t.PivotRowDimension=Lh,t.PivotRowHeaderTitle=Nh,t.PivotTable=oh,t.PivotTableSimple=hh,t.Polygon="polygon",t.Popover=nc,t.Radio=ac,t.Rect="rect",t.RichText="richtext",t.Symbol="symbol",t.Tag=rc,t.Text=Gh,t.Title=Fh,t.Tooltip=zh,t.VTableReactAttributePlugin=Zu,t.registerChartModule=function(t,n){e.register.chartModule(t,n)},t.version="1.17.6"}));
10
+ */gh.exports=(ph||(ph=1,fh=function(t){var e={},i=n,r=yh(),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"),u=Symbol.for("react.portal"),h=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 A(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=_&&t[_]||t["@@iterator"])?t:null}function S(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 h:return"Fragment";case u: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:S(t.type)||"Memo";case v:e=t._payload,t=t._init;try{return S(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 S(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,ut=t.setFocusIfFocusable,ht=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,At=t.hideTextInstance,St=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 ue(t,e){ae++,se[ae]=t.current,t.current=e}var he={},ce=oe(he),de=oe(!1),fe=he;function pe(t,e){var n=t.type.contextTypes;if(!n)return he;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!==he)throw Error(a(168));ue(ce,e),ue(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||he,fe=ce.current,ue(ce,t),ue(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),ue(ce,t)):le(de),ue(de,n)}var _e=Math.clz32?Math.clz32:function(t){return 0==(t>>>=0)?32:31-(Ae(t)/Se|0)|0},Ae=Math.log,Se=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 un(t,e){Je[tn++]=nn,Je[tn++]=en,en=t,nn=e}function hn(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&&(un(t,1),hn(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 An(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;fn=t}function Sn(t){if(!q||t!==fn)return!1;if(!gn)return An(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(An(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=ho(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===h?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=ho(""+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 u:return(e=co(e,t.mode,n)).return=t,e;case v:return g(t,(0,e._init)(e._payload),n)}if(O(e)||A(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 u: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)||A(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 u: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)||A(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 u=null,h=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===h?u=p:h.sibling=p,h=p,c=f}if(d===o.length)return n(r,c),gn&&un(r,d),u;if(null===c){for(;d<o.length;d++)null!==(c=g(r,o[d],l))&&(a=s(c,a,d),null===h?u=c:h.sibling=c,h=c);return gn&&un(r,d),u}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===h?u=f:h.sibling=f,h=f);return t&&c.forEach((function(t){return e(r,t)})),gn&&un(r,d),u}function x(r,o,l,u){var h=A(l);if("function"!=typeof h)throw Error(a(150));if(null==(l=h.call(l)))throw Error(a(151));for(var c=h=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,u);if(null===v){null===d&&(d=p);break}t&&d&&null===v.alternate&&e(r,d),o=s(v,o,f),null===c?h=v:c.sibling=v,c=v,d=p}if(y.done)return n(r,d),gn&&un(r,f),h;if(null===d){for(;!y.done;f++,y=l.next())null!==(y=g(r,y.value,u))&&(o=s(y,o,f),null===c?h=y:c.sibling=y,c=y);return gn&&un(r,f),h}for(d=i(r,d);!y.done;f++,y=l.next())null!==(y=b(d,r,f,y.value,u))&&(t&&null!==y.alternate&&d.delete(null===y.key?f:y.key),o=s(y,o,f),null===c?h=y:c.sibling=y,c=y);return t&&d.forEach((function(t){return e(r,t)})),gn&&un(r,f),h}return function t(i,s,a,c){if("object"==typeof a&&null!==a&&a.type===h&&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)===h){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===h?((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 u: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(A(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=ho(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?(ue(Nn,e._currentValue),e._currentValue=n):(ue(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 u=l,h=u.next;u.next=null,null===o?a=h:o.next=h,o=u;var c=t.alternate;null!==c&&(l=(c=c.updateQueue).lastBaseUpdate)!==o&&(null===l?c.firstBaseUpdate=h:l.next=h,c.lastBaseUpdate=u)}if(null!==a){var d=r.baseState;for(o=0,c=h=u=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?(h=c=p,u=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&&(u=d),r.baseState=u,r.firstBaseUpdate=h,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 ui(t){if(t===si)throw Error(a(174));return t}function hi(t,e){ue(li,e),ue(oi,t),ue(ai,si),t=R(e),le(ai),ue(ai,t)}function ci(){le(ai),le(oi),le(li)}function di(t){var e=ui(li.current),n=ui(ai.current);n!==(e=I(n,t.type,e))&&(ue(oi,t),ue(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,Ai=null,Si=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,Si=Ai=null,e.updateQueue=null,yi.current=gr,t=n(i,r)}while(Ti)}if(yi.current=dr,e=null!==Ai&&null!==Ai.next,xi=0,Si=Ai=_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===Si?_i.memoizedState=Si=t:Si=Si.next=t,Si}function Li(){if(null===Ai){var t=_i.alternate;t=null!==t?t.memoizedState:null}else t=Ai.next;var e=null===Si?_i.memoizedState:Si.next;if(null!==e)Si=e,Ai=t;else{if(null===t)throw Error(a(310));t={memoizedState:(Ai=t).memoizedState,baseState:Ai.baseState,baseQueue:Ai.baseQueue,queue:Ai.queue,next:null},null===Si?_i.memoizedState=Si=t:Si=Si.next=t}return Si}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=Ai,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,u=null,h=s;do{var c=h.lane;if((xi&c)===c)null!==u&&(u=u.next={lane:0,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null}),i=h.hasEagerState?h.eagerState:t(i,h.action);else{var d={lane:c,action:h.action,hasEagerState:h.hasEagerState,eagerState:h.eagerState,next:null};null===u?(l=u=d,o=i):u=u.next=d,_i.lanes|=c,la|=c}h=h.next}while(null!==h&&h!==s);null===u?o=i:u.next=l,Xe(i,e.memoizedState)||(Or=!0),e.memoizedState=i,e.baseState=o,e.baseQueue=u,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!==Si&&1&Si.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!==Ai){var a=Ai.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},ur(t)?hr(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(ur(t))hr(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 ur(t){var e=t.alternate;return t===_i||null!==e&&e===_i}function hr(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(),Ai.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===Ai?e.memoizedState=t:rr(e,Ai.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=he,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):he),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 Ar(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 Sr(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},ue(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,ue(sa,ra),ra|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=null!==s?s.baseLanes:n,ue(sa,ra),ra|=i}else null!==s?(i=s.baseLanes|n,e.memoizedState=null):i=n,ue(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),Ar(e,n,i,r),i=!0;else if(null===t){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,u=n.contextType;u="object"==typeof u&&null!==u?$n(u):pe(e,u=ge(n)?fe:ce.current);var h=n.getDerivedStateFromProps,c="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate;c||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==u)&&_r(e,a,i,u),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 h&&(br(e,n,h,i),l=e.memoizedState),(o=qn||vr(e,n,o,i,d,l,u))?(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=u,i=o):("function"==typeof a.componentDidMount&&(e.flags|=4194308),i=!1)}else{a=e.stateNode,Zn(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:mr(e.type,o),a.props=u,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;(h="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),(u=qn||vr(e,n,u,i,d,p,l)||!1)?(h||"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=u):("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),hi(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),ue(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=uo(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=uo({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 u={mode:"hidden",children:r.children};return 0==(1&l)&&e.child!==s?((r=e.child).childLanes=0,r.pendingProps=u,e.deletions=null):(r=ao(s,u)).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=uo({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(ue(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=ui(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=ui(ai.current),u=null;a!==i&&(u=F(o,n,a,i,r,l)),t&&null===u?e.stateNode=s:(s=Bt(s,u,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=ui(li.current),n=ui(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 us(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||(Sn(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=ui(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=ui(ai.current),Sn(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=ui(li.current),n=ui(ai.current),Sn(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=Sn(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 ue(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,ue(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 hs(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 As(t){return 5===t.tag||3===t.tag||4===t.tag}function Ss(t){t:for(;;){for(;null===t.sibling;){if(null===t.return||As(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 u=r.alternate;null!==u&&(u.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 u=o.stateNode;if("function"==typeof u.componentWillUnmount){var h=o,c=o.return;try{var d=h;u.props=d.memoizedProps,u.state=d.memoizedState,u.componentWillUnmount()}catch(t){Qa(h,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):St(e.stateNode,e.memoizedProps)}catch(e){Qa(t,t.return,e)}}}else if(6===e.tag){if(null===i)try{s=e.stateNode,n?At(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(As(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,Ss(t),r);break;case 3:case 4:var s=i.stateNode.containerInfo;ws(t,Ss(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 u=ds;if(cs=a,(ds=l)&&!u)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=u}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 u=e.alternate;if(null!==u){var h=u.memoizedState;if(null!==h){var c=h.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&&lt(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"<"+(S(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,ua=0,ha=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,Aa=null,Sa=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)&&(ua|=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&=~ha,e&=~ua,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!==Aa&&0===Aa.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,ha=ua=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,Si=Ai=_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,u=e;if(e=ia,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var h=u,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,h,e),u=h;var g=(e=p).updateQueue;if(null===g){var m=new Set;m.add(u),e.updateQueue=m}else g.add(u);break t}if(0==(1&e)){kr(s,h,e),ja();break t}u=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(Sr(u,l));break t}}s=u=Sr(u,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,u,e));break t;case 1:l=u;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&ua)||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=us(n,e,ra)))return void(na=n)}else{if(null!==(n=hs(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!==Aa);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,Aa=t,Sa=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&Sa)&&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!==Aa){var t=Ie(Sa),e=Js.transition,n=Re;try{if(Js.transition=null,Re=16>t?16:t,null===Aa)var i=!1;else{if(t=Aa,Aa=null,Sa=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 u=0;u<l.length;u++){var h=l[u];for(ps=h;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===h){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=Sr(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=Sr(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):ha|=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 h: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 uo(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 uo(t,e,n,i){return(t=ro(22,t,i,e)).elementType=x,t.lanes=n,t.stateNode={isHidden:!1},t}function ho(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 he;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:hi(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?(ue(pi,1&pi.current),e.flags|=128,null):0!=(n&e.child.childLanes)?qr(t,e,n):(ue(pi,1&pi.current),null!==(t=is(t,e,n))?t.sibling:null);ue(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),ue(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)&&hn(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,Ar(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=Sr(Error(a(423)),e));break t}if(i!==r){e=Hr(t,e,i,n,r=Sr(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 hi(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 u=l.firstContext;null!==u;){if(u.context===i){if(1===s.tag){(u=Jn(-1,n&-n)).tag=2;var h=s.updateQueue;if(null!==h){var c=(h=h.shared).pending;null===c?u.next=u:(u.next=c.next,c.next=u),h.pending=u}}s.lanes|=n,null!==(u=s.alternate)&&(u.lanes|=n),Hn(s.return,n,e),l.lanes|=n;break}u=u.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),Ar(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:u,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 u=t[l],h=u.x,c=h+u.width,d=u.y,f=d+u.height;if(i>=h&&s>=d&&r<=c&&o<=f){t.splice(e,1);break}if(!(i!==h||n.width!==u.width||f<s||d>o)){d>s&&(u.height+=d-s,u.y=s),f<o&&(u.height=o-d),t.splice(e,1);break}if(!(s!==d||n.height!==u.height||c<i||h>r)){h>i&&(u.width+=h-i,u.x=i),c<r&&(u.width=r-h),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&&ut(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=ht(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}),fh);var vh,xh=r(gh.exports),_h={exports:{}},Ah={};_h.exports=(vh||(vh=1,Ah.ConcurrentRoot=1,Ah.ContinuousEventPriority=4,Ah.DefaultEventPriority=16,Ah.DiscreteEventPriority=1,Ah.IdleEventPriority=536870912,Ah.LegacyRoot=0),Ah);var Sh=_h.exports;const wh=xh({supportsMutation:!0,supportsPersistence:!1,createInstance:(t,e,n)=>{const i=function(t,e){const n=function(t,e){if("tag"===t)return new Ku(e.attribute?e.attribute:e);if("radio"===t)return new Qu(e.attribute?e.attribute:e);if("checkbox"===t)return new qu(e.attribute?e.attribute:e)}(t,e);if(n)return n;if(!ii.graphicService.creator[t])return;const i=ii.graphicService.creator[t](e.attribute);return i}(t,e);if(i)return function(t,e){for(const n in e)Th(n,e)&&Al[n]&&t.addEventListener(Al[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:()=>Sh.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)Th(i,n)&&n[i]!==e[i]&&t.removeEventListener(Al[i],n[i]);for(const i in e)Th(i,e)&&n[i]!==e[i]&&t.addEventListener(Al[i],e[i]);const i=e.attribute??O({},e);t.initAttributes(i),"image"===t.type&&t.loadImage(i.image);if("flex"===i.display&&void 0===i.width&&void 0===i.height&&y(n.attribute.width)&&y(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 Th(t,e){return t.startsWith("on")&&u(e[t])}wh.injectIntoDevTools({bundleType:0,version:n.version,rendererPackageName:"react-vtable"});const Bh=(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,u=n.useRef(new Map),h=n.useCallback((t=>{const e=`${t.originCol??t.col}-${t.originRow??t.row}${t.forComputation?"-forComputation":""}`;let n;if(u.current.has(e)){const i=u.current.get(e);Ch(s,i,t),n=i.containerInfo}else{n=new Hr({});const i=wh.createContainer(n,Sh.LegacyRoot,null,null,null,"custom",null,null);u.current.set(e,i),Ch(s,i,t)}return{rootContainer:n,renderDefault:!!s.props.renderDefault}}),[s]),c=n.useCallback(((t,e)=>{const n=`${t}-${e}`;if(u.current.has(n)){const t=u.current.get(n);wh.updateContainer(null,t,null),t.containerInfo.delete(),u.current.delete(n)}}),[]),d=n.useCallback((()=>{u.current.forEach(((t,e)=>{const n=t;wh.updateContainer(null,n,null),n.containerInfo.delete()})),u.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,h,l),o.reactCustomLayout?.setReactRemoveGraphic(r,c,l),o.reactCustomLayout?.updateCustomCell(r,l)):o&&(o.reactCustomLayout?.setReactCreateGraphic(r,h,l),u.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,u={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,Ch(s,l,u),o.scenegraph.updateNextFrame()})))})),null};function Ch(t,e,i){wh.updateContainer(n.cloneElement(t,{...i}),e,null)}const kh=(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&&Ft(e.table,t,s.current,r)&&(s.current=t)}return n.useEffect((()=>()=>{r&&Ft(e.table,null,s.current,r)}),[]),Ph(t.children,t.componentId)};return l.displayName=t,l.parseOption=t=>{const i=L(t,o);if(t.children){const{children:e}=t;n.Children.map(e,((e,n)=>{Mh(e,t,i,o,t.componentId+"-"+n)}))}return{option:i,optionName:e,isSingle:s}},l};function Mh(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=L(t.props,r);i.columns.push(a),a.componentId=s,t.props.children&&n.Children.map(t.props.children,((t,n)=>{Mh(t,e,a,r,s+"-"+n)}))}}function Ph(t,e){return(i=t)&&i.$$typeof===Symbol.for("react.element")||Array.isArray(t)?n.Children.map(t,((t,i)=>t.props.children?Ph(t.props.children,e+"-"+i):"custom-layout"===t.props.role||"header-custom-layout"===t.props.role?n.createElement(Bh,{componentId:e},t):null)):null;var i}const Eh=kh("ListColumn","columns"),Oh=kh("PivotColumnDimension","columns"),Lh=kh("PivotRowDimension","rows"),Rh=kh("PivotIndicator","indicators"),Ih=kh("PivotColumnHeaderTitle","columnHeaderTitle",void 0,!0),Nh=kh("PivotRowHeaderTitle","rowHeaderTitle",void 0,!0),Uh=kh("PivotCorner","corner",void 0,!0),Dh=kh("Menu","menu",void 0,!0),zh=kh("Tooltip","tooltip",void 0,!0),Wh=kh("EmptyTip","emptyTip",void 0,!0),Fh=kh("Title","title",void 0,!0);function jh(t,e){return y(t)?t:"string"==typeof t&&t.endsWith("%")?Number(t.slice(0,-1))/100*e:0}const Hh="group",Gh="text",$h="tag",Vh={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 Xh=n.forwardRef((function(t,e){const i=O({},Vh,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:u,children:h}=t,c={text:h,textStyle:e,padding:n,panel:i,minWidth:r,maxWidth:s,visible:a,cursor:o??l?"not-allowed":"pointer",childrenPickable:!1,state:{text:{hover:u?.textStyle?.hover,disabled:u?.textStyle?.disabled},panel:{hover:u?.panelStyle?.hover,disabled:u?.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($h,{ref:a,attribute:l,onClick:o})}));Xh.displayName="Button";const Yh={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 Kh=n.forwardRef((function(t,e){const i=O({},Yh,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]),u=function(t){const{textStyle:e,padding:n,space:i,panelStyle:r,minWidth:s,maxWidth:a,visible:o,cursor:l,disabled:u,icon:h,state:c,children:d}=t,f={text:d,textStyle:e,padding:n,panel:r,minWidth:s,maxWidth:a,visible:o,cursor:l??u?"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:!!h,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($h,{ref:o,attribute:u,onClick:l})}));Kh.displayName="Link";const qh={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 Qh=n.forwardRef((function(t,e){const i=O({},qh,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]),u=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(g(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=Vu(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(Hh,{ref:o,attribute:u,onClick:l},n.createElement(Gh,{attribute:t}))}return"image"===s.type&&(s.props.attribute.width=r,s.props.attribute.height=r),n.createElement(Hh,{ref:o,attribute:u,onClick:l},s)}));Qh.displayName="Avatar";const Zh={defaultPopupVisible:!1,position:"top"},Jh={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"},tc=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:O({},Jh,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 nc=n.forwardRef((function(t,e){const i=O({},Zh,t),{content:r,position:s,popupVisible:a,defaultPopupVisible:o,panelStyle:l,arrowStyle:u,children:h}=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(tc,{visible:f,content:r,position:s,panelStyle:l,arrowStyle:u}),container:null,visible:!0,pointerEvents:!1,anchorType:m}},y=n.useCallback((t=>{c(a)||(p(!0),t.currentTarget.stage.renderNextFrame())}),[]),v=n.useCallback((t=>{c(a)||(p(!1),t.currentTarget.stage.renderNextFrame())}),[]);return n.createElement(Hh,{ref:d,attribute:b,onMouseEnter:y,onMouseLeave:v},h)}));nc.displayName="Popover";const ic={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=O({},ic,t),{attribute:r,panelStyle:s,children:a,...o}=i;let l=n.useRef(null);return l=e||l,n.createElement($h,{ref:l,attribute:r??{text:a,panel:s,...o},...o})}));rc.displayName="Tag";const sc={};const ac=n.forwardRef((function(t,e){const i=O({},sc,t),{textStyle:r,circleStyle:s,children:a,...o}=i;let l=n.useRef(null);l=e||l;const u=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(l.current?.addEventListener("radio_checked",u),()=>{l.current?.removeEventListener("radio_checked",u)})),[]),n.createElement("radio",{ref:l,attribute:{text:{...r,text:a},circle:s,...o},...o})}));ac.displayName="Radio";const oc={};const lc=n.forwardRef((function(t,e){const i=O({},oc,t),{textStyle:r,boxStyle:s,iconStyle:a,children:o,...l}=i;let u=n.useRef(null);u=e||u;const h=n.useCallback((t=>{i.onChange&&i.onChange(t.target.attribute.checked)}),[]);return n.useEffect((()=>(u.current?.addEventListener("checkbox_state_change",h),()=>{u.current?.removeEventListener("checkbox_state_change",h)})),[]),n.createElement("checkbox",{ref:u,attribute:{text:{...r,text:o},box:s,icon:a,...l},...l})}));lc.displayName="Checkbox";Object.defineProperty(t,"register",{enumerable:!0,get:function(){return e.register}}),t.Arc="arc",t.Avatar=Qh,t.Button=Xh,t.Checkbox=lc,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=O({},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:u,height:h,row:c,col:d,anchor:f,dx:p,dy:g,className:m,children:b,style:y}=s;let v,x,_,A;if("position"===a)v=o+p+"px",x=l+g+"px",_=u+"px",A=h+"px";else if("cell"===a){const t=r&&d>=0&&c>=0?r?.getCellRelativeRect(d,c):{width:0,height:0,left:-9999,top:-9999};_=jh(u,t.width)+"px",A=jh(h,t.height)+"px","top-left"===f?(v=t.left+jh(p,t.width)+"px",x=t.top+jh(g,t.height)+"px"):"top-right"===f?(v=t.left+jh(p,t.width)+t.width+"px",x=t.top+jh(g,t.height)+"px"):"bottom-left"===f?(v=t.left+jh(p,t.width)+"px",x=t.top+jh(g,t.height)+t.height+"px"):"bottom-right"===f&&(v=t.left+jh(p,t.width)+t.width+"px",x=t.top+jh(g,t.height)+t.height+"px")}const S=O({},y,{position:"absolute",zIndex:1e3,width:_,height:A,left:v,top:x});return n.createElement("div",{className:m,style:S},n.Children.map(b,(t=>t?n.cloneElement(t,{}):t)))},t.CustomLayout=Bh,t.EmptyTip=Wh,t.Group=Hh,t.Image="image",t.Line="line",t.Link=Kh,t.ListColumn=Eh,t.ListTable=ah,t.ListTableSimple=uh,t.Menu=Dh,t.Path="path",t.PivotChart=lh,t.PivotColumnDimension=Oh,t.PivotColumnHeaderTitle=Ih,t.PivotCorner=Uh,t.PivotIndicator=Rh,t.PivotRowDimension=Lh,t.PivotRowHeaderTitle=Nh,t.PivotTable=oh,t.PivotTableSimple=hh,t.Polygon="polygon",t.Popover=nc,t.Radio=ac,t.Rect="rect",t.RichText="richtext",t.Symbol="symbol",t.Tag=rc,t.Text=Gh,t.Title=Fh,t.Tooltip=zh,t.VTableReactAttributePlugin=Zu,t.registerChartModule=function(t,n){e.register.chartModule(t,n)},t.version="1.17.7-alpha.0"}));