@visactor/vchart-extension 2.0.4-alpha.5 → 2.0.4-alpha.7

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.
@@ -12,4 +12,4 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function Ve(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i}const He={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},Xe={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},$e={fill:"#606773",fontSize:12},Ye={fill:"#eff1f9"};class qe extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:s}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=Ve(t,["arrows"]),s=e.filter((t=>"left"===t.position)),n=e.filter((t=>"right"===t.position)),r=Ke(n,i),a=Ke(s,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(s&&s.visible){const t=function(t){const{style:e={}}=t,i=Ve(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},Ye),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:s}=i.getLayoutRect();return s},height:(t,e)=>{const i=e.getPoints(t),s=i[0];return i[3].y-s.y}})})}(s);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function Ke(t,i){if(0===(null==t?void 0:t.length))return null;const{line:s,symbol:n,text:r,margin:a}=i,l=[],h={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},c=function(t={},e){const{style:i={}}=t,s=Ve(t,["style"]),n=(t,e)=>{var i,s;const{from:n,to:r}=t,{vchart:a}=e,o=null===(s=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData;return!(r>o.length-1||n>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},s),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},He),i),{renderable:n,points:(t,i)=>{if(!n(t,i))return[];let s=t.layout.points;return s=Ze(t,i,e),s}})})}(s,a);c&&l.push(c);const u=function(t={},e){const{style:i={}}=t,s=Ve(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},s),{style:Object.assign(Object.assign(Object.assign({},Xe),i),{x:(t,i)=>{var s,n;let r=t.layout.points;return r=Ze(t,i,e),null!==(n=null===(s=r[(null==r?void 0:r.length)-1])||void 0===s?void 0:s.x)&&void 0!==n?n:NaN},y:(t,i)=>{var s,n;let r=t.layout.points;return r=Ze(t,i,e),null!==(n=null===(s=r[(null==r?void 0:r.length)-1])||void 0===s?void 0:s.y)&&void 0!==n?n:NaN},angle:t=>"left"===t.position?90:-90})})}(n,a);u&&l.push(u);const d=function(t={},e){const{style:i={},formatMethod:s,textMargin:n=4}=t,r=Ve(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},r),{style:Object.assign(Object.assign(Object.assign({},$e),{text:(t,e)=>{var i,n,r,a,l,h,c;const{text:u}=t;let d=u;if(o(s)){const{vchart:o}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(r=null===(n=null===(i=null==o?void 0:o.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData)&&void 0!==r?r:[],y=null!==(c=null===(h=null===(l=null===(a=null==o?void 0:o.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));d=s(u,{arrow:t,from:b,to:v})}return d},x:(t,i)=>{var s,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=(null===(s=a[1])||void 0===s?void 0:s.x)+("left"===t.position?-n:n))&&void 0!==r?r:NaN},y:(t,i)=>{var s,n,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=((null===(s=a[1])||void 0===s?void 0:s.y)+(null===(n=a[2])||void 0===n?void 0:n.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),i)})}(r,a);return d&&l.push(d),h.children=l,h}function Ze(t,e,i){var s,n,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:u}=t.context,d=null===(n=null===(s=null==l?void 0:l.getChart())||void 0===s?void 0:s.getSeriesData())||void 0===n?void 0:n.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(d&&d.length){const s=p.find((t=>t[u]===d[h][u])),n=p.find((t=>t[u]===d[c][u])),r=p[0];if(s&&n&&r){g=function(t,e,i,s,n=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:u,toTotal:d}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],m=Math.abs(g.y-f.y),y=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(y.y-b.y),x=p?s[1]:s[0],_=m/(u+1),A=v/(d+1),S=g.y+_*(h+1),T=y.y+A*(c+1),w=p?-1:1,M=[{x:g.x-n*w,y:S},{x:x.x-(n+(l+1)*a)*w,y:S},{x:x.x-(n+(l+1)*a)*w,y:T},{x:y.x-n*w,y:T}];return M}(t,e.getPoints(s),e.getPoints(n),e.getPoints(r),i),t.layout.points=g}}return g}function Je(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return s>n&&r>i}function Qe(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return i===n&&s===r}const ti=(t,e)=>{var i,s,n;if(!t||!(null===(i=t.arrows)||void 0===i?void 0:i.length))return[];const{arrows:r}=t,a=function(t,e){return t.filter((t=>b(t.from*t.to))).map(((t,i)=>{const{from:s,to:n,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(s,n),to:Math.max(s,n),span:Math.abs(s-n),isLayout:!1,context:{field:e},layout:{level:0},id:`${s}-${n}-${r}-${i}`})}))}(r,e.categoryField),o=a.filter((t=>"left"===t.position)),l=a.filter((t=>"right"===t.position));return[...null!==(s=ei(o))&&void 0!==s?s:[],...null!==(n=ei(l))&&void 0!==n?n:[]]};function ei(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const i=e.get(t.from);if(h(i)){const e=i.fromArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:i.degree+=1,i.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const s=e.get(t.to);if(h(s)){const e=s.toArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:s.degree+=1,s.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((i=>{var s;const n=t.filter((t=>t.layout.isLayout)),r=((t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,s))&&void 0!==i?i:r-s)>0&&(s=r)}return s})(n,((t,e)=>t.layout.level-e.layout.level));let a=null!==(s=null==r?void 0:r.layout.level)&&void 0!==s?s:0;for(;a>=0;){if(n.some((t=>t.layout.level===a&&Je(t,i)))){a+=1;break}--a}i.layout.level=Math.max(0,a),i.layout.fromTotal=e.get(i.from).degree,i.layout.toTotal=e.get(i.to).degree;const o=i.layout.duplicateNode;o?(i.layout.fromIndex=o.layout.fromIndex,i.layout.toIndex=o.layout.toIndex):(i.layout.fromIndex=ii(i,e.get(i.from).totalArrows),i.layout.toIndex=ii(i,e.get(i.to).totalArrows)),i.layout.isLayout=!0})),t}function ii(t,e){let i=0,s=0;for(let n=0;n<e.length;n++){const r=e[n];if(r===t){i=n-s;break}r.layout.duplicateNode&&s++}return i}class si extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=qe}}si.type="conversionFunnel",si.transformerConstructor=qe;class ni extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new Ge(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",ti),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const ri="dataKey";class ai extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,n,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const s=t.data[i].nodes;e.push({data:[{id:"nodes",values:s.map(((t,e)=>Object.assign(Object.assign({},t),{[ri]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),o="neighborhood"!==t.taskType;t.type="common",t.dataKey=ri,t.data=a[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"==t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(n=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class oi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=ai}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,data:a}=this._spec;return n&&r?!!a||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}oi.type="sequenceScatterLink",oi.view="singleDefault",oi.transformerConstructor=ai;const li=.2;function hi(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const ci="dataKey";class ui extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,n,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const s=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[ci]:e}))),n=function(t,e=100,i){const s=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),n=[];return Object.entries(s).forEach((([t,s])=>{const r=i||function(t){return t.length**(-1/6)}(s),a=s.map((t=>t.x)),o=s.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),u=Math.max(...o),d=l-(h-l)*li,p=c-(u-c)*li;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=d+.1*i,o=p+.1*a;let l=0;for(const t of s)l+=hi(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=s.length*r*r,n.push({x:e,y:o,kde:l,label:t})}})),n}(s,150);e.push({data:[{id:"nodes",values:s},{id:"iter",values:[{iter:i}]},{id:"kde",values:n}]})})),e}(t);t.type="common",t.dataKey=ci,t.data=o[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:o}),t.animationAppear={duration:null!==(n=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class di extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=ui}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,data:a}=this._spec;return n&&r?!!a||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}di.type="sequenceScatterKDE",di.view="singleDefault",di.transformerConstructor=ui;const pi="dataKey";function gi(t){const e=[];return Object.keys(t.data).forEach((i=>{let s=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const s=document.createElement("canvas");s.width=e.width,s.height=e.height;const n=s.getContext("2d");if(!n)throw new Error("Failed to get 2D rendering context from canvas");const r=n.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let s=0;s<300;s++){const n=(null===(i=t[e])||void 0===i?void 0:i[s])||[0,0,0],a=4*(300*e+s);r.data[a]=Math.round(255*n[0]),r.data[a+1]=Math.round(255*n[1]),r.data[a+2]=Math.round(255*n[2]),r.data[a+3]=255}return n.putImageData(r,0,0),s.toDataURL("image/png")}(t.backgroundColors[i],t);s={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[pi]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:s?[s]:[]}]})})),e}class fi extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,n,r;super.transformSpec(t);const a=gi(t);t.type="common",t.dataKey=pi,t.data=a[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(n=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class mi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=fi}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,data:a}=this._spec;return n&&r?!!a||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}mi.type="sequenceScatterPixel",mi.view="singleDefault",mi.transformerConstructor=fi;class yi extends e.BarChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var bi,vi,xi,_i,Ai;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(bi||(bi={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(vi||(vi={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(xi||(xi={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(_i||(_i={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(Ai||(Ai={}));class Si{static GenAutoIncrementId(){return Si.auto_increment_id++}}Si.auto_increment_id=0;class Ti{constructor(t){this.id=Si.GenAutoIncrementId(),this.registry=t}}const wi="named",Mi="inject",Bi="inversify:tagged",Ci="inversify:paramtypes";class ki{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===wi?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Pi=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),s=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),n=new WeakMap;function r(t,e,i){let r=n.get(t);if(h(r)){if(!i)return;r=new s,n.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new s,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const s=f(e);return!c(s)&&a(t,s,i)}function o(t,e,i){const s=r(e,i,!1);return!h(s)&&!!s.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const s=r(e,i,!1);if(!h(s))return s.get(t)}(t,e,i);const s=f(e);return c(s)?void 0:l(t,s,i)}function h(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const s=3===i?"string":5===i?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==n){const e=n.call(t,s);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}function p(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const s=t.prototype,n=s&&Object.getPrototypeOf(s);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,s){if(!u(i))throw new TypeError;return n=t,a=e,void r(i,s,!0).set(n,a);var n,a})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function Oi(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};Pi.hasOwnMetadata(t,e)&&(r=Pi.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,Pi.defineMetadata(t,r,e)}(Bi,t,i.toString(),s)}function Ri(t){return(e,i,s)=>{Oi(e,0,s,t)}}const Li=(Ei=Mi,t=>(e,i,s)=>Ri(new ki(Ei,t))(e,i,s));var Ei;function Ii(){return function(t){return Pi.defineMetadata(Ci,null,t),t}}function Di(t){return Ri(new ki(wi,t))}const Fi="Singleton",ji="Transient",Ui="ConstantValue",Ni="DynamicValue",Wi="Factory",zi="Function",Gi="Instance",Vi="Invalid";class Hi{constructor(t,e){this.id=Si.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Vi,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Hi(this.serviceIdentifier,this.scope);return t.activated=t.scope===Fi&&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 Xi{getConstructorMetadata(t){return{compilerGeneratedMetadata:Pi.getMetadata(Ci,t),userGeneratedMetadata:Pi.getMetadata(Bi,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const $i=(Yi=wi,t=>{const e=e=>{if(null==e)return!1;if(e.key===Yi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===Yi&&i[e].value===t)return!0;return!1};return e.metaData=new ki(Yi,t),e});var Yi;class qi{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Fi,this}inTransientScope(){return this._binding.scope=ji,this}whenTargetNamed(t){return this._binding.constraint=$i(t),this}}class Ki{constructor(t){this._binding=t}to(t){return this._binding.type=Gi,this._binding.implementationType=t,new qi(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Ni,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new qi(this._binding)}toConstantValue(t){return this._binding.type=Ui,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Fi,new qi(this._binding)}toFactory(t){return this._binding.type=Wi,this._binding.factory=t,this._binding.scope=Fi,new qi(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const Zi=Symbol("ContributionProvider");class Ji{constructor(t,e){this.serviceIdentifier=t,this.container=e,ts.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function Qi(t,e){t(Zi).toDynamicValue((({container:t})=>new Ji(e,t))).inSingletonScope().whenTargetNamed(e)}class ts{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}ts.store=new Map;class es{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let s;if("string"==typeof e)s={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof s.name||""===s.name)throw new Error("Missing name for tap");return s=Object.assign({type:t,fn:i},s),s}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let s=this.taps.length;for(;s>0;){s--;const t=this.taps[s];this.taps[s+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){s++;break}}this.taps[s]=t}}class is extends es{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const ss=new class{};let ns=0;var rs,as,os,ls;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(rs||(rs={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(as||(as={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(os||(os={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(ls||(ls={}));const hs=rt-1e-8;class cs{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>hs)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(g(s),g(n),n!==s)if((s%=rt)<0&&(s+=rt),(n%=rt)<0&&(n+=rt),n<s&&(r=!r,a=s,s=n,n=a),r)for(n-=rt,a=s-s%nt,o=0;o<4&&a>n;++o,a-=nt)g(a);else for(a=s-s%nt+nt,o=0;o<4&&a<n;++o,a+=nt)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,s,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,n,r){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(n,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,s){this.bounds.add(t,e),this.bounds.add(i,s)}rect(t,e,i,s){this.bounds.add(t,e),this.bounds.add(t+i,e+s)}clear(){this.bounds.clear()}release(...t){}}class us{constructor(){this._curves=[],this.bounds=new Xt}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ds=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ps={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},gs={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let fs,ms,ys,bs,vs,xs;var _s,As,Ss,Ts,ws,Ms;function Bs(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,u=o*r,d=l*a,p=Math.cos(s),g=Math.sin(s),f=Math.cos(n),m=Math.sin(n),y=.5*(n-s),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,_=i+g+v*p,A=e+f,S=i+m,T=A+v*m,w=S-v*f;return[h*x+c*_,u*x+d*_,h*T+c*w,u*T+d*w,h*A+c*S,u*A+d*S]}function Cs(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,l){const h=xt(a),c=Math.sin(h),u=Math.cos(h),d=u*(o-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(o-t)*.5;let g=d*d/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const f=u/i,m=c/i,y=-c/s,b=u/s,v=f*o+m*l,x=y*o+b*l,_=f*t+m*e,A=y*t+b*e;let S=1/((_-v)*(_-v)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);r===n&&(T=-T);const w=.5*(v+_)-T*(A-x),M=.5*(x+A)+T*(_-v),B=Math.atan2(x-M,v-w);let C=Math.atan2(A-M,_-w)-B;C<0&&1===r?C+=rt:C>0&&0===r&&(C-=rt);const k=Math.ceil(Math.abs(C/(nt+.001))),P=[];for(let t=0;t<k;++t){const e=B+t*C/k,n=B+(t+1)*C/k;P[t]=[w,M,e,n,i,s,c,u]}return P}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,i);for(let e=0;e<n.length;++e){const i=Bs(n[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(_s||(_s={})),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"}(As||(As={})),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"}(Ss||(Ss={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ts||(Ts={})),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"}(ws||(ws={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ms||(Ms={}));const ks=[(t,e,i,s,n,r,a)=>e.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function Ps(t,e,i=0,s=0,n=1,r=1,a){for(let o=0;o<t.length;o++){const l=t[o];ks[l[0]](l,e,i,s,n,r,a)}}class Os{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Rs(t,e){let i=0;const s=t.length;for(let n=0;n<s;n++){const r=t[n],a=e[n],o=t[(n+1)%s],l=e[(n+1)%s];i+=vt.distanceNN(r,a,o,l)}return i/2}function Ls(t,e,i,s,n){const r=1-n;return r*r*r*t+3*e*n*r*r+3*i*n*n*r+s*n*n*n}function Es(t,e,i,s,n){const r=Ls(t.x,e.x,i.x,s.x,n),a=Ls(t.y,e.y,i.y,s.y,n);return new bt(r,a)}function Is(t,e,i,s){const n=1-s;return n*n*t+2*n*s*e+s*s*i}function Ds(t,e,i,s){const n=Is(t.x,e.x,i.x,s),r=Is(t.y,e.y,i.y,s);return new bt(n,r)}function Fs(t,e){const{p0:i,p1:s,p2:n,p3:r}=t,a=Es(i,s,n,r,e),o=vt.pointAtPP(i,s,e),l=vt.pointAtPP(s,n,e),h=vt.pointAtPP(n,r,e),c=vt.pointAtPP(o,l,e),u=vt.pointAtPP(l,h,e);return[new js(i,o,c,a),new js(a,u,h,r)]}class js extends Os{constructor(t,e,i,s){super(),this.type=ws.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=s}_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 Es(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,s=this.p3,Rs([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])):60;var t,e,i,s}calcProjLength(t){return t===Ts.ROW?ot(this.p0.x-this.p3.x):t===Ts.COLUMN?ot(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return lt(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.bezierCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i,this.p3.x*s+e,this.p3.y*n+i);else if(r>0){const[a]=Fs(this,r);t.bezierCurveTo(a.p1.x*s+e,a.p1.y*n+i,a.p2.x*s+e,a.p2.y*n+i,a.p3.x*s+e,a.p3.y*n+i)}}includeX(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Us extends Os{constructor(t,e){super(),this.type=ws.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return vt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=lt(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()?vt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ts.ROW?ot(this.p0.x-this.p1.x):t===Ts.COLUMN?ot(this.p0.y-this.p1.y):0}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.lineTo(this.p1.x*s+e,this.p1.y*n+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*s+e,a.y*n+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const s=(t-e.x)/(i.x-e.x);return e.y+s*(i.y-e.y)}return 1/0}}class Ns{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,s,n,r,a,o){const l=new js(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,s),new bt(n,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=n,this._lastY=r,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,s){const n=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=s}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,s){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,s,n){const r=new Us(new bt(this._lastX,this._lastY),new bt(t,e));return r.originP1=s,r.originP2=n,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Ts.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],s=null!==(e=i.p3)&&void 0!==e?e:i.p1;return ot(t.p0.y-s.y)}if(t===Ts.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(i=e.p3)&&void 0!==i?i:e.p1;return ot(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ws extends Ns{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function zs(t,e,i=1){let s=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function Gs(t,e,i){const s=null!=e?e:ot(i[i.length-1].x-i[0].x)>ot(i[i.length-1].y-i[0].y)?Ts.ROW:Ts.COLUMN;return"monotoneY"===t?new Ws(t,s):new Ns(t,s)}class Vs{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Hs(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Gs("linear",i,t);return function(t,e){zs(t,e,1)}(new Vs(n,s),t),n}function Xs(t,e,i,s,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,s,t.lastPoint1)}class $s{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&&Xs(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:Xs(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Ys(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Hs(t,e);const n=Gs("basis",i,t);return function(t,e){zs(t,e,2)}(new $s(n,s),t),n}function qs(t){return t<0?-1:1}function Ks(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(qs(r)+qs(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Zs(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Js(t,e,i,s,n){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,s,t.lastPoint1)}class Qs{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:Js(this,this._t0,Zs(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,Js(this,Zs(this,e=Ks(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Js(this,this._t0,e=Ks(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,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 tn extends Qs{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function en(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Hs(t,e);const n=Gs("monotoneX",i,t);return function(t,e){zs(t,e,2)}(new Qs(n,s),t),n}function sn(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Hs(t,e);const n=Gs("monotoneY",i,t);return function(t,e){zs(t,e,2)}(new tn(n,s),t),n}let nn=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class rn extends nn{lineEnd(){this.context.closePath()}}function an(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Ns("step",null!=s?s:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?Ts.ROW:Ts.COLUMN);return on(new nn(r,e,n),t),r}function on(t,e){return zs(t,e,1)}class ln extends Vs{lineEnd(){this.context.closePath()}}function hn(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Gs("linear",i,t);return function(t,e){zs(t,e,1)}(new ln(n,s),t),n}function cn(t,e,i,s,n){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>it){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>it){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/n,l=(l*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,s,t.lastPoint1)}function un(t,e){return function(i,s,n={}){const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Hs(i,n);const o=Gs(t,r,i);return zs(new e(o,s,a),i,2),o}}const dn=un("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:cn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const pn=un("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:cn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class gn extends Os{constructor(t,e,i){super(),this.type=ws.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Ds(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,Rs([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Ts.ROW?ot(this.p0.x-this.p2.x):t===Ts.COLUMN?ot(this.p0.y-this.p2.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return lt(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:s,p2:n}=t,r=Ds(i,s,n,e),a=vt.pointAtPP(i,s,e),o=vt.pointAtPP(s,n,e);return[new gn(i,a,r),new gn(r,o,n)]}(this,r);t.quadraticCurveTo(a.p1.x*s+e,a.p1.y*n+i,a.p2.x*s+e,a.p2.y*n+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class fn{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Us(new bt(this._lastX,this._lastY),new bt(t,e))}quadraticCurveTo(t,e,i,s){const n=new gn(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,s));this.path.addCurve(n),this._lastX=i,this._lastY=s}bezierCurveTo(t,e,i,s,n,r){const a=new js(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,s),new bt(n,r));this.path.addCurve(a),this._lastX=n,this._lastY=r}arcTo(t,e,i,s,n){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,s,n,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,s){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,s,n,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function mn(t,e,i){var s,n;switch(e){case"linear":default:return Hs(t,i);case"basis":return Ys(t,i);case"monotoneX":return en(t,i);case"monotoneY":return sn(t,i);case"step":return an(t,.5,i);case"stepClosed":return function(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Ns("step",null!=s?s:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?Ts.ROW:Ts.COLUMN);return on(new rn(r,e,n),t),r}(t,.5,i);case"stepBefore":return an(t,0,i);case"stepAfter":return an(t,1,i);case"catmullRom":return dn(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return pn(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return hn(t,i)}}class yn extends us{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new cs(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([gs.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([gs.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([gs.Q,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([gs.C,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([gs.AT,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([gs.E,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([gs.R,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([gs.A,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([gs.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new fn(this);Ps(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[gs.M]=t=>`M${t[1]} ${t[2]}`,t[gs.L]=t=>`L${t[1]} ${t[2]}`,t[gs.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[gs.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[gs.A]=t=>{const e=[],i=t[1],s=t[2],n=t[3];((t,e,i,s,n,r,a,o=!1)=>{const l=2*Math.PI,h=(e%l+l)%l;let c,u=(i%l+l)%l;o?(u>=h&&(u-=l),c=u-h):(u<=h&&(u+=l),c=u-h);const d=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/d;for(let e=0;e<d;e++){const i=h+p*e,l=h+p*(e+1),c=4/3*Math.tan(Math.abs(p)/4),u=Math.cos(i),d=Math.sin(i),g=Math.cos(l),f=Math.sin(l),m=u*r+s,y=d*a+n,b=g*r+s,v=f*a+n,x=o?-1:1,_=r*c*x,A=a*c*x;t.push(m-_*d,y+A*u,b+_*f,v-A*g,b,v)}})(e,t[4],t[5],i,s,n,n,t[6]);let r="";for(let t=0;t<e.length;t+=6)r+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return r},t[gs.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[gs.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,r=e.length;t<r;t++)if(fs=e[t],ms=fs.slice(1),ys=fs[0],i=[ys],s=ms.match(ds),null!==s){for(let t=0,e=s.length;t<e;t++)bs=s[t],vs=parseFloat(bs),Number.isNaN(vs)||i.push(vs);if(xs=ps[ys],i.length-1>xs){let t,e=ys;for(let s=1,r=i.length;s<r;s+=xs){t=[e];for(let e=s,n=s+xs;e<n;e++)t.push(i[e]);n.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else n.push(i)}else n.push(i);return n}(t);return this._runCommandStrList(r,e,i,s,n),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:s}=t.attribute;if(!e)return;const n=mn(e,i);"x"===s?this.direction=Ts.ROW:"y"===s?this.direction=Ts.COLUMN:"auto"===s&&(this.direction=n.direction),this._curves=n.curves}fromCustomPath2D(t,e,i,s,n){return this.clear(),this._runCommandList(t.commandList,e,i,s,n),this._updateBounds(),this}transform(t,e,i,s){const n=this.commandList;if(!this.transformCbList){const t=[];t[gs.M]=this.moveToTransform,t[gs.L]=this.lineToTransform,t[gs.Q]=this.quadraticCurveToTransform,t[gs.C]=this.bezierCurveToTransform,t[gs.AT]=this.arcToTransform,t[gs.E]=this.ellipseTransform,t[gs.R]=this.rectTransform,t[gs.A]=this.arcTransform,t[gs.Z]=this.closePathTransform,this.transformCbList=t}n.forEach((n=>{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,s=1,n=1){let r,a,o,l,h,c=null,u=0,d=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(r=t[f],1===s&&1===n||(r=vn(r,s,n)),r[0]){case"l":u+=r[1],d+=r[2],this.lineTo(u+e,d+i);break;case"L":u=r[1],d=r[2],this.lineTo(u+e,d+i);break;case"h":u+=r[1],this.lineTo(u+e,d+i);break;case"H":u=r[1],this.lineTo(u+e,d+i);break;case"v":d+=r[1],this.lineTo(u+e,d+i);break;case"V":d=r[1],this.lineTo(u+e,d+i);break;case"m":u+=r[1],d+=r[2],this.moveTo(u+e,d+i);break;case"M":u=r[1],d=r[2],this.moveTo(u+e,d+i);break;case"c":a=u+r[5],o=d+r[6],p=u+r[3],g=d+r[4],this.bezierCurveTo(u+r[1]+e,d+r[2]+i,p+e,g+i,a+e,o+i),u=a,d=o;break;case"C":u=r[5],d=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,u+e,d+i);break;case"s":a=u+r[3],o=d+r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=u+r[1],h=d+r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"S":a=r[3],o=r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=r[1],h=r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"q":a=u+r[3],o=d+r[4],p=u+r[1],g=d+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),u=a,d=o,p=r[1],g=r[2];break;case"t":a=u+r[1],o=d+r[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-l,g=2*d-h):"q"===c[0]&&(p=2*u-p,g=2*d-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o,p=u+r[1],g=d+r[2];break;case"T":a=r[1],o=r[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"a":Cs(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+u+e,r[7]+d+i]),u+=r[6],d+=r[7];break;case"A":Cs(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),u=r[6],d=r[7];break;case"z":case"Z":this.closePath()}c=r}}_runCommandList(t,e=0,i=0,s=1,n=1){if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case gs.L:this.lineToTransform(a,e,i,s,n);break;case gs.M:this.moveToTransform(a,e,i,s,n);break;case gs.C:this.bezierCurveToTransform(a,e,i,s,n);break;case gs.Q:this.quadraticCurveToTransform(a,e,i,s,n);break;case gs.A:this.arcToTransform(a,e,i,s,n);break;case gs.E:this.ellipseTransform(a,e,i,s,n);break;case gs.R:this.rectTransform(a,e,i,s,n);break;case gs.AT:this.arcToTransform(a,e,i,s,n);break;case gs.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ps(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ts.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.y-e.p1.y)}if(this.direction===Ts.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s<this._curves.length;s++){e=this._curves[s];const n=e.getLength(this.direction);if(i+n>=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}drawWithClipRange(t,e,i,s,n){this.tryBuildCurves();const r=this.getLength()*n;let a=0;for(let n=0;n<this._curves.length;n++){const o=this._curves[n],l=o.getLength(this.direction);if(!(a+l<=r)){const n=1-(a+l-r)/l;o.draw(t,i,s,e,e,n);break}o.draw(t,i,s,e,e,1),a+=l}}}const bn=["l",0,0,0,0,0,0,0];function vn(t,e,i){const s=bn[0]=t[0];if("a"===s||"A"===s)bn[1]=e*t[1],bn[2]=i*t[2],bn[3]=t[3],bn[4]=t[4],bn[5]=t[5],bn[6]=e*t[6],bn[7]=i*t[7];else if("h"===s||"H"===s)bn[1]=e*t[1];else if("v"===s||"V"===s)bn[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)bn[s]=(s%2==1?e:i)*t[s];return bn}const xn={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 Yt},_n={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},An=Object.assign({outerBorder:Object.assign(Object.assign({},_n),{distance:0}),innerBorder:Object.assign(Object.assign({},_n),{distance:0})},_n),Sn={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:rs.fontBounding,keepCenterInLine:!1},Tn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),An),{alignSelf:"auto"}),{pickStrokeBuffer:0}),wn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Mn=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),Tn),xn),Bn=Object.assign(Object.assign({},Mn),{startAngle:0,endAngle:at,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Cn=Object.assign(Object.assign(Object.assign({},Mn),wn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),kn=Object.assign(Object.assign({},Mn),{radius:1,startAngle:0,endAngle:at}),Pn=Object.assign(Object.assign({},Mn),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),On=Object.assign(Object.assign({},Mn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Rn=Object.assign(Object.assign(Object.assign({},Mn),wn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Ln=Object.assign(Object.assign({},Mn),{path:new yn,fillStrokeOrder:1,clipRange:1,customPath:()=>{$.getInstance().warn("空函数")}}),En=Object.assign(Object.assign({},Mn),{points:[],cornerRadius:0,closePath:!0}),In=Object.assign(Object.assign({},Mn),{width:100,height:100,spikes:5,thickness:.5}),Dn=Object.assign(Object.assign({},Mn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Mn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Fn=Object.assign(Object.assign({},Mn),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),jn=Object.assign(Object.assign(Object.assign({},Mn),Sn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Un=Object.assign(Object.assign(Object.assign({},Mn),Sn),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Nn=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Mn),{fill:!0,cornerRadius:0,cornerType:"round"}),Wn=Object.assign(Object.assign({},Nn),{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}),zn=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function s(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,s,n){return function(s,r){const a=y(s);if(a){y(t.startCall)||i("Missing (");const s=function(s){const r=n();return r&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:d(p)}}();return y(t.endCall)||i("Missing )"),s}}(s)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,s,n=l();return n&&(i=[],i.push(n),s=e,y(t.comma)&&(n=l(),n?i.push(n):e=s)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let s=e();const n=[];if(s)for(n.push(s);y(t.comma);)s=e(),s?n.push(s):i("One extra comma");return n}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const s=y(e);if(s)return{type:t,value:s[i]}}function y(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const s=t.exec(e);return s&&b(s[0].length),s}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(s);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Gn{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Gn.IsGradientStr(t))try{const e=zn(t)[0];if(e){if("linear"===e.type)return Gn.ParseLinear(e);if("radial"===e.type)return Gn.ParseRadial(e);if("conic"===e.type)return Gn.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,s=st/2,n=parseFloat(e.value)/180*st-s;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+at,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,s=st/2;let n="angular"===e.type?parseFloat(e.value)/180*st:0;for(;n<0;)n+=at;for(;n>=at;)n-=at;let r=0,a=0,o=0,l=0;return n<s?(r=0,a=1,o=Math.sin(n),l=a-Math.cos(n)):n<st?(r=0,a=0,o=Math.cos(n-s),l=Math.sin(n-s)):n<st+s?(r=1,a=0,o=r-Math.sin(n-st),l=Math.cos(n-st)):(r=1,o=r-Math.cos(n-s-st),l-=Math.sin(n-s-st)),{gradient:"linear",x0:r,y0:a,x1:o,y1:l,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Vn(t,e,i){let s=e;const{a:n,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(s=s/Math.abs(l+h)*2*i,s)}function Hn(t,e,i,s=0,n=0){var r,a,o,l;if(!e||!0===e)return"black";let h,c;if(g(e))for(let t=0;t<e.length&&(c=e[t],!c);t++);else c=e;if(c=Gn.Parse(c),"string"==typeof c)return c;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let u=e.x2-e.x1,d=e.y2-e.y1,p=e.x1-s,g=e.y1-n;if(i.attribute){const{scaleX:t=1,scaleY:e=1,angle:s=0}=i.attribute;u/=t,d/=e,p/=t,g/=e,(s||1!==t||1!==e)&&(p=null!==(r=i.x1WithoutTransform)&&void 0!==r?r:0,g=null!==(a=i.y1WithoutTransform)&&void 0!==a?a:0,u=null!==(o=i.widthWithoutTransform)&&void 0!==o?o:u,d=null!==(l=i.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===c.gradient?h=function(t,e,i,s,n,r){var a,o,l,h;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*n,s+(null!==(o=e.y0)&&void 0!==o?o:0)*r,i+(null!==(l=e.x1)&&void 0!==l?l:1)*n,s+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,u,d):"conical"===c.gradient?h=function(t,e,i,s,n,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*n,s+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(n+i,r+s,void 0):l}(t,c,p,g,u,d):"radial"===c.gradient&&(h=function(t,e,i,s,n,r){var a,o,l,h,c,u;const d=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*n,s+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(n,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,s+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(n,r)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,c,p,g,u,d))}return h||"orange"}const Xn={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"}},$n=!0,Yn=!1,qn=/\w|\(|\)|-/,Kn=/[.?!,;:/,。?!、;:]/,Zn=/\S/,Jn=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function Qn(t,e,i,s,n){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=ss.graphicUtil.textMeasure;let a=s,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=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(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return n&&(a=function(t,e,i=!1){let s=e;for(;qn.test(t[s-1])&&qn.test(t[s])||Kn.test(t[s]);)if(s--,s<=0)return i?tr(t,e):e;return s}(t,a)),a}function tr(t,e){let i=e;for(;qn.test(t[i+1])&&qn.test(t[i])||Kn.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function er(t,e,i="actual"){var s;if(""===t)return{ascent:0,height:0,descent:0,width:0};const n=ss.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?n.actualBoundingBoxAscent:n.fontBoundingBoxAscent,o="actual"===i?n.actualBoundingBoxDescent:n.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(n.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(n.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(s=e.space)&&void 0!==s?s:0;return r.width+=l,r}const ir=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ji,this.options=e,this.id=Si.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Xi}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const s=this._getNotAllArgs(t,!1,e,i);return this._get(s)}getNamed(t,e){return this.getTagged(t,wi,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Hi(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new Ki(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const s=this.bind(i);return t(s,e),s},i=()=>t=>this.unbind(t),s=()=>t=>this.isBound(t),n=e=>i=>{const s=this.rebind(i);return t(s,e),s};return t=>({bindFunction:e(t),isboundFunction:s(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,s){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:s}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),s=Object.keys(i),n=[];for(let t=0;t<s.length;t++){const e=i[t],s={};e.forEach((t=>{s[t.key]=t.value}));const r={inject:s[Mi],multiInject:s.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};n.push(t)}}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Ui:case zi:e=t.cache;break;case Gi:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Fi&&(t.cache=e,t.activated=!0)}},sr=Symbol.for("CanvasFactory");function nr(t){return ir.getNamed(sr,ss.global.env)(t)}const rr=1e-4,ar=Math.sqrt(3),or=1/3;function lr(t){return t>-_r&&t<_r}function hr(t){return t>_r||t<-_r}const cr=[0,0],ur=[0,0],dr=[0,0];function pr(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function gr(t,e,i,s){const n=1-s;return n*(n*t+2*s*e)+s*s*i}function fr(t,e,i,s,n){const r=1-n;return r*r*(r*t+3*n*e)+n*n*(n*s+3*r*i)}function mr(t){return(t%=at)<0&&(t+=at),t}function yr(t,e,i,s,n,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>s+h&&l>r+h||l<e-h&&l<s-h&&l<r-h||o>t+h&&o>i+h&&o>n+h||o<t-h&&o<i-h&&o<n-h)&&function(t,e,i,s,n,r,a,o,l){let h=0,c=.005,u=1/0;cr[0]=a,cr[1]=o;for(let a=0;a<1;a+=.05){ur[0]=gr(t,i,n,a),ur[1]=gr(e,s,r,a);const o=pr(cr,ur);o<u&&(h=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<rr);a++){const a=h-c,o=h+c;ur[0]=gr(t,i,n,a),ur[1]=gr(e,s,r,a);const l=pr(ur,cr);if(a>=0&&l<u)h=a,u=l;else{dr[0]=gr(t,i,n,o),dr[1]=gr(e,s,r,o);const a=pr(dr,cr);o<=1&&a<u?(h=o,u=a):c*=.5}}return l&&(l[0]=gr(t,i,n,h),l[1]=gr(e,s,r,h)),Math.sqrt(u)}(t,e,i,s,n,r,o,l,null)<=h/2}function br(t,e,i,s,n,r,a,o,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>s+u&&c>r+u&&c>o+u||c<e-u&&c<s-u&&c<r-u&&c<o-u||h>t+u&&h>i+u&&h>n+u&&h>a+u||h<t-u&&h<i-u&&h<n-u&&h<a-u)&&function(t,e,i,s,n,r,a,o,l,h,c){let u,d,p,g,f=0,m=.005,y=1/0;cr[0]=l,cr[1]=h;for(let l=0;l<1;l+=.05)ur[0]=fr(t,i,n,a,l),ur[1]=fr(e,s,r,o,l),p=pr(cr,ur),p<y&&(f=l,y=p);y=1/0;for(let l=0;l<32&&!(m<rr);l++)u=f-m,d=f+m,ur[0]=fr(t,i,n,a,u),ur[1]=fr(e,s,r,o,u),p=pr(ur,cr),u>=0&&p<y?(f=u,y=p):(dr[0]=fr(t,i,n,a,d),dr[1]=fr(e,s,r,o,d),g=pr(dr,cr),d<=1&&g<y?(f=d,y=g):m*=.5);return c&&(c[0]=fr(t,i,n,a,f),c[1]=fr(e,s,r,o,f)),Math.sqrt(y)}(t,e,i,s,n,r,a,o,h,c,null)<=u/2}function vr(t,e,i,s,n,r,a,o,l){if(0===a)return!1;const h=a;o-=t,l-=e;const c=Math.sqrt(o*o+l*l);if(c-h>i||c+h<i)return!1;if(Math.abs(s-n)%at<1e-4)return!0;if(r){const t=s;s=mr(n),n=mr(t)}else s=mr(s),n=mr(n);s>n&&(n+=at);let u=Math.atan2(l,o);return u<0&&(u+=at),u>=s&&u<=n||u+at>=s&&u+at<=n}function xr(t,e,i,s,n,r,a){if(0===n)return!1;const o=n,l=n/2;let h=0,c=t;if(a>e+l&&a>s+l||a<e-l&&a<s-l||r>t+l&&r>i+l||r<t-l&&r<i-l)return!1;if(t===i)return Math.abs(r-t)<=o/2;h=(e-s)/(t-i),c=(t*s-i*e)/(t-i);const u=h*r-a+c;return u*u/(h*h+1)<=o/2*o/2}const _r=1e-4;function Ar(t,e,i,s,n){const r=6*i-12*e+6*t,a=9*e+3*s-3*t-9*i,o=3*e-3*t;let l=0;if(lr(a)){if(hr(r)){const t=-o/r;t>=0&&t<=1&&(n[l++]=t)}}else{const t=r*r-4*a*o;if(lr(t))n[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),s=(-r-e)/(2*a);i>=0&&i<=1&&(n[l++]=i),s>=0&&s<=1&&(n[l++]=s)}}return l}const Sr=[-1,-1,-1],Tr=[-1,-1];function wr(){const t=Tr[0];Tr[0]=Tr[1],Tr[1]=t}function Mr(t,e,i,s,n,r,a,o,l,h){if(h>e&&h>s&&h>r&&h>o||h<e&&h<s&&h<r&&h<o)return 0;const c=function(t,e,i,s,n,r){const a=s+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-n,c=o*o-3*a*l,u=o*l-9*a*h,d=l*l-3*o*h;let p=0;if(lr(c)&&lr(u))if(lr(o))r[0]=0;else{const t=-l/o;t>=0&&t<=1&&(r[p++]=t)}else{const t=u*u-4*c*d;if(lr(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),s=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,or):Math.pow(i,or),s=s<0?-Math.pow(-s,or):Math.pow(s,or);const n=(-o-(i+s))/(3*a);n>=0&&n<=1&&(r[p++]=n)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),s=Math.cos(e),n=(-o-2*i*s)/(3*a),l=(-o+i*(s+ar*Math.sin(e)))/(3*a),h=(-o+i*(s-ar*Math.sin(e)))/(3*a);n>=0&&n<=1&&(r[p++]=n),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,s,r,o,h,Sr);if(0===c)return 0;let u=0,d=-1,p=0,g=0;for(let h=0;h<c;h++){const c=Sr[h],f=0===c||1===c?.5:1;fr(t,i,n,a,c)<l||(d<0&&(d=Ar(e,s,r,o,Tr),Tr[1]<Tr[0]&&d>1&&wr(),p=fr(e,s,r,o,Tr[0]),d>1&&(g=fr(e,s,r,o,Tr[1]))),2===d?c<Tr[0]?u+=p<e?f:-f:c<Tr[1]?u+=g<p?f:-f:u+=o<g?f:-f:c<Tr[0]?u+=p<e?f:-f:u+=o<p?f:-f)}return u}function Br(t,e,i,s,n,r,a,o){if(o>e&&o>s&&o>r||o<e&&o<s&&o<r)return 0;const l=function(t,e,i,s,n){const r=t-2*e+i,a=2*(e-t),o=t-s;let l=0;if(lr(r)){if(hr(a)){const t=-o/a;t>=0&&t<=1&&(n[l++]=t)}}else{const t=a*a-4*r*o;if(lr(t)){const t=-a/(2*r);t>=0&&t<=1&&(n[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),s=(-a-e)/(2*r);i>=0&&i<=1&&(n[l++]=i),s>=0&&s<=1&&(n[l++]=s)}}return l}(e,s,r,o,Sr);if(0===l)return 0;const h=function(t,e,i){const s=t+i-2*e;return 0===s?.5:(t-e)/s}(e,s,r);if(h>=0&&h<=1){let o=0;const c=gr(e,s,r,h);for(let s=0;s<l;s++){const l=0===Sr[s]||1===Sr[s]?.5:1;gr(t,i,n,Sr[s])<a||(Sr[s]<h?o+=c<e?l:-l:o+=r<c?l:-l)}return o}const c=0===Sr[0]||1===Sr[0]?.5:1;return gr(t,i,n,Sr[0])<a?0:r<e?c:-c}function Cr(t,e,i,s,n,r,a,o){if((o-=e)>i||o<-i)return 0;const l=Math.sqrt(i*i-o*o);Sr[0]=-l,Sr[1]=l;const h=Math.abs(s-n);if(h<1e-4)return 0;if(h>=at-1e-4){s=0,n=at;const e=r?1:-1;return a>=Sr[0]+t&&a<=Sr[1]+t?e:0}if(s>n){const t=s;s=n,n=t}s<0&&(s+=at,n+=at);let c=0;for(let e=0;e<2;e++){const i=Sr[e];if(i+t>a){let t=Math.atan2(o,i),e=r?1:-1;t<0&&(t=at+t),(t>=s&&t<=n||t+at>=s&&t+at<=n)&&(t>st/2&&t<1.5*st&&(e=-e),c+=e)}}return c}function kr(t){return Math.round(t/st*1e8)/1e8%2*st}function Pr(t,e){let i=kr(t[0]);i<0&&(i+=at);const s=i-t[0];let n=t[1];n+=s,!e&&n-i>=at?n=i+at:e&&i-n>=at?n=i-at:!e&&i>n?n=i+(at-kr(i-n)):e&&i<n&&(n=i-(at-kr(n-i))),t[0]=i,t[1]=n}const Or=[0,0];function Rr(t,e,i,s,n){const r=t,a=t.length;let o,l,h=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=r[t],g=0===t;a[0]===gs.M&&t>1&&(i||(h+=Ut(c,u,d,p,s,n))),g&&(c=a[1],u=a[2],d=c,p=u);const f=a[0],m=a[1],y=a[2],b=a[3],v=a[4],x=a[5],_=a[6];let A=v,S=x;Or[0]=A,Or[1]=S,Pr(Or,Boolean(a[6])),A=Or[0],S=Or[1];const T=A,w=S-A,M=!!(1-(a[6]?0:1)),B=(s-m)*b/b+m;switch(f){case gs.M:d=m,p=y,c=d,u=p;break;case gs.L:if(i){if(xr(c,u,m,y,e,s,n))return!0}else h+=Ut(c,u,m,y,s,n)||0;c=m,u=y;break;case gs.C:if(i){if(br(c,u,m,y,b,v,x,_,e,s,n))return!0}else h+=Mr(c,u,m,y,b,v,x,_,s,n)||0;c=x,u=_;break;case gs.Q:if(i){if(yr(c,u,m,y,b,v,e,s,n))return!0}else h+=Br(c,u,m,y,b,v,s,n)||0;c=b,u=v;break;case gs.A:if(o=Math.cos(T)*b+m,l=Math.sin(T)*b+y,g?(d=o,p=l):h+=Ut(c,u,o,l,s,n),i){if(vr(m,y,b,T,T+w,M,e,B,n))return!0}else h+=Cr(m,y,b,T,T+w,M,B,n);c=Math.cos(T+w)*b+m,u=Math.sin(T+w)*b+y;break;case gs.R:if(d=c=m,p=u=y,o=d+b,l=p+v,i){if(xr(d,p,o,p,e,s,n)||xr(o,p,o,l,e,s,n)||xr(o,l,d,l,e,s,n)||xr(d,l,d,p,e,s,n))return!0}else h+=Ut(o,p,o,l,s,n),h+=Ut(d,l,d,p,s,n);break;case gs.Z:if(i){if(xr(c,u,d,p,e,s,n))return!0}else h+=Ut(c,u,d,p,s,n);c=d,u=p}}return i||(g=u,f=p,Math.abs(g-f)<_r)||(h+=Ut(c,u,d,p,s,n)||0),0!==h;var g,f}const Lr=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=nr(Object.assign({nativeCanvas:ss.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=nr(Object.assign({nativeCanvas:ss.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Er={arc:Bn,area:Cn,circle:kn,line:Rn,path:Ln,symbol:Fn,text:jn,rect:Dn,polygon:En,star:In,richtext:Un,richtextIcon:Wn,image:Nn,group:Pn,glyph:On},Ir=Object.keys(Er);function Dr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Fr={arc:Object.assign({},Er.arc),area:Object.assign({},Er.area),circle:Object.assign({},Er.circle),line:Object.assign({},Er.line),path:Object.assign({},Er.path),symbol:Object.assign({},Er.symbol),text:Object.assign({},Er.text),rect:Object.assign({},Er.rect),polygon:Object.assign({},Er.polygon),star:Object.assign({},Er.star),richtext:Object.assign({},Er.richtext),richtextIcon:Object.assign({},Er.richtextIcon),image:Object.assign({},Er.image),group:Object.assign({},Er.group),glyph:Object.assign({},Er.glyph)};class jr{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Ir.forEach((t=>{this._defaultTheme[t]=Object.create(Fr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,$.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Ir.forEach((s=>{const n=Object.create(Fr[s]);t&&t[s]&&Dr(n,t[s]),i[s]&&Dr(n,i[s]),e[s]&&Dr(n,e[s]),this.combinedTheme[s]=n})),e.common&&Ir.forEach((t=>{Dr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Ur=new jr;function Nr(t,e){return t.glyphHost?Nr(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)):Ur.getTheme()}return null}(t)||t.attachedThemeGraphic&&Nr(t.attachedThemeGraphic)||Ur.getTheme()}var Wr=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};class zr extends n{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=Si.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return Wr(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){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,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&$.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}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,e=!1){let i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const s=a(i,!0)&&i||c(i)&&i.capture,n=c(i)&&i.once,r=o(e)?void 0:e;return t=s?`${t}capture`:t,e=o(e)?e:e.handleEvent,n?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const s=a(i,!0)&&i||c(i)&&i.capture,n=o(e)?void 0:e;t=s?`${t}capture`:t,e=o(e)?e:e.handleEvent;const r=c(i)&&i.once;return super.off(t,e,n,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return c(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Gr{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=Gr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&o(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&&o(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Vr extends Gr{constructor(t,e){super(),this.type=t,this.detail=e}}const Hr={dispatchEvent(t){var e;if(!(t instanceof Gr))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 Vr(t,e))}};class Xr{static GetImage(t,e){var i;const s=Xr.cache.get(t);s?"fail"===s.loadState?ss.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Xr.loadImage(t,e)}static GetSvg(t,e){var i;let s=Xr.cache.get(t);s?"fail"===s.loadState?ss.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Xr.cache.set(t,s),s.dataPromise=ss.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Xr.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Xr.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ss.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ss.global.loadBlob(t):"json"===e&&(i.dataPromise=ss.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Xr.isLoading&&Xr.toLoadAueue.length){Xr.isLoading=!0;const t=Xr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Xr.cache.set(i,n),n.dataPromise=ss.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()})).catch((t=>{console.error(t),Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()}))}}),0)}static loadImage(t,e){const i=$r(t,Xr.toLoadAueue);if(-1!==i)return Xr.toLoadAueue[i].marks.push(e),void Xr.loading();Xr.toLoadAueue.push({url:t,marks:[e]}),Xr.loading()}static improveImageLoading(t){const e=$r(t,Xr.toLoadAueue);if(-1!==e){const t=Xr.toLoadAueue.splice(e,1);Xr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function $r(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}var Yr;Xr.cache=new Map,Xr.isLoading=!1,Xr.toLoadAueue=[],Xr.onLoadSuccessCb=[],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"}(Yr||(Yr={}));const qr=[!1,!1,!1,!1],Kr=[0,0,0,0],Zr=t=>t?g(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Kr[0]=t[0],Kr[2]=t[0],Kr[1]=t[1],Kr[3]=t[1],Kr):t:t:0,Jr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Qr=[1,2,3,0,1,2,3,0];function ta(t,e,i,s){for(;t>=at;)t-=at;for(;t<0;)t+=at;for(;t>e;)e+=at;Jr[0].x=i,Jr[1].y=i,Jr[2].x=-i,Jr[3].y=-i;const n=Math.ceil(t/nt)%4,r=Math.ceil(e/nt)%4;if(s.add(ht(t)*i,dt(t)*i),s.add(ht(e)*i,dt(e)*i),n!==r||e-t>st){let t=!1;for(let e=0;e<Qr.length;e++)if(t||n!==Qr[e]){if(t&&r===Qr[e])break;if(t){const t=Jr[Qr[e]];s.add(t.x,t.y)}}else{t=!0;const e=Jr[n];s.add(e.x,e.y)}}}function ea(t,e,i){const{x:s,y:n}=mt(t.x,t.y,e.x,e.y,i),{x:r,y:a}=mt(t.x1,t.y1,e.x1,e.y1,i),o=new bt(s,n,r,a);return o.defined=e.defined,o}function ia(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let s=[];if(t.length>e.length){s=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<e.length;n++)s[n]=ea(t[n],e[n],i)}else{s=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<t.length;n++)s[n]=ea(t[n],e[n],i)}return s}const sa=(t,e)=>{const i=((t,e)=>p(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};class na{bounds(t,e){if(y(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}}function ra(t,e,i,s,n){return n?t.arc(i,s,e,0,rt,!1,n):t.arc(i,s,e,0,rt),!1}var aa=new class extends na{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,s,n){return ra(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return ra(t,this.parseSize(e)/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var oa=new class extends na{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n)}drawOffset(t,e,i,s,n,r){return function(t,e,i,s,n,r){return t.moveTo(-3*e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-3*e+s-n,r),t.lineTo(e+i+n,-3*e+s-n,r),t.lineTo(e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,e+s+n,r),t.lineTo(e+i+n,e+s+n,r),t.lineTo(e+i+n,3*e+s+n,r),t.lineTo(-e+i-n,3*e+s+n,r),t.lineTo(-e+i-n,e+s+n,r),t.lineTo(-3*e+i-n,e+s+n,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n,r)}};function la(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}var ha=new class extends na{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return la(t,this.parseSize(e)/2,i,s,n)}drawFitDir(t,e,i,s,n){return la(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return la(t,this.parseSize(e)/2+n,i,s,r)}};function ca(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}var ua=new class extends na{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return ca(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return ca(t,this.parseSize(e)/2+n,i,s)}};function da(t,e,i,s,n=0){return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class pa extends na{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return da(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return da(t,this.parseSize(e)/2,i,s,n)}}var ga=new pa;var fa=new class extends pa{constructor(){super(...arguments),this.type="triangle"}};const ma=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ya=Math.sin(rt/10)*ma,ba=-Math.cos(rt/10)*ma;function va(t,e,i,s){const n=ya*e,r=ba*e;t.moveTo(i,-e+s),t.lineTo(n+i,r+s);for(let a=1;a<5;++a){const o=rt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+s),t.lineTo(l*n-h*r+i,h*n+l*r+s)}return t.closePath(),!0}var xa=new class extends na{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,s){return va(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return va(t,this.parseSize(e)/2+n,i,s)}};const _a=pt(3);function Aa(t,e,i,s){const n=e,r=n/_a,a=r/5,o=e;return t.moveTo(0+i,-n+s),t.lineTo(r/2+i,s),t.lineTo(a/2+i,s),t.lineTo(a/2+i,o+s),t.lineTo(-a/2+i,o+s),t.lineTo(-a/2+i,s),t.lineTo(-r/2+i,s),t.closePath(),!0}var Sa=new class extends na{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,s){return Aa(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Aa(t,this.parseSize(e)/2+n,i,s)}};function Ta(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}var wa=new class extends na{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Ta(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ta(t,this.parseSize(e)/2+n,i,s)}};function Ma(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var Ba=new class extends na{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Ma(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ma(t,this.parseSize(e)/2+n,i,s)}};const Ca=-.5,ka=pt(3)/2,Pa=1/pt(12);function Oa(t,e,i,s){const n=e/2,r=e*Pa,a=n,o=e*Pa+e,l=-a,h=o;return t.moveTo(n+i,r+s),t.lineTo(a+i,o+s),t.lineTo(l+i,h+s),t.lineTo(Ca*n-ka*r+i,ka*n+Ca*r+s),t.lineTo(Ca*a-ka*o+i,ka*a+Ca*o+s),t.lineTo(Ca*l-ka*h+i,ka*l+Ca*h+s),t.lineTo(Ca*n+ka*r+i,Ca*r-ka*n+s),t.lineTo(Ca*a+ka*o+i,Ca*o-ka*a+s),t.lineTo(Ca*l+ka*h+i,Ca*h-ka*l+s),t.closePath(),!1}var Ra=new class extends na{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,s){return Oa(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Oa(t,this.parseSize(e)/2+n,i,s)}};function La(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}var Ea=new class extends na{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return La(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return La(t,this.parseSize(e)/2,i,s,n)}};function Ia(t,e,i,s,n=0){return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}var Da=new class extends na{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,s){return Ia(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ia(t,this.parseSize(e)/2,i,s,n)}};function Fa(t,e,i,s,n=0){return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}var ja=new class extends na{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return Fa(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Fa(t,this.parseSize(e)/2,i,s,n)}};const Ua=pt(3);function Na(t,e,i,s){const n=e*Ua;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}var Wa=new class extends na{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Na(t,this.parseSize(e)/2/Ua,i,s)}drawOffset(t,e,i,s,n){return Na(t,this.parseSize(e)/2/Ua+n,i,s)}};function za(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}var Ga=new class extends na{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,s){return za(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return za(t,this.parseSize(e)/4+n,i,s)}};function Va(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}var Ha=new class extends na{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,s){return Va(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Va(t,this.parseSize(e)/4+n,i,s)}};function Xa(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}var $a=new class extends na{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,s){return Xa(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Xa(t,this.parseSize(e)/4+n,i,s)}};function Ya(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}var qa=new class extends na{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,s){return Ya(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Ya(t,this.parseSize(e)/4+n,i,s)}};function Ka(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var Za=new class extends na{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return Ka(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return Ka(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function Ja(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var Qa=new class extends na{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return Ja(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return Ja(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function to(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}var eo=new class extends na{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,s,n){return to(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return to(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function io(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function so(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}var no=new class extends na{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return y(e)?so(t,e,i,s):io(t,e,i,s)}drawWithClipRange(t,e,i,s,n,r,a){y(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*n,l=[{x:i+e[0]/2,y:s-e[1]/2},{x:i+e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;e<l.length;e++){const i=l[e],s=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(h+s>o){const e=(i.x-c.x)*(o-h)/s,n=(i.y-c.y)*(o-h)/s;t.lineTo(c.x+e,c.y+n);break}t.lineTo(i.x,i.y),c=i,h+=s}return!1}drawOffset(t,e,i,s,n){return y(e)?so(t,e+2*n,i,s):io(t,[e[0]+2*n,e[1]+2*n],i,s)}};const ro=new Xt;class ao{constructor(t,e,i=!1){this.pathStr="",this.type=t,g(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),Ps(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(Ps(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,n,r)}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,s,n),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,s,n),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{ro.x1=i.bounds.x1*t,ro.y1=i.bounds.y1*t,ro.x2=i.bounds.x2*t,ro.y2=i.bounds.y2*t,e.union(ro)}))}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 oo={};[aa,oa,ha,ua,Wa,fa,xa,Sa,wa,Ba,Ra,Ea,Da,ga,ja,Ga,Ha,$a,qa,no,Za,Qa,eo].forEach((t=>{oo[t.type]=t}));const lo={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class ho{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 co(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function uo(t,e,i,s=">"){const n=function(t,e,i=">"){let s,n="";for(let r=e;r<t.length;r++){let e=t[r];if(s)e===s&&(s="");else if('"'===e||"'"===e)s=e;else if(e===i[0]){if(!i[1])return{data:n,index:r};if(t[r+1]===i[1])return{data:n,index:r}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,s);if(!n)return;let r=n.data;const a=n.index,o=r.search(/\s/);let l=r,h=!0;-1!==o&&(l=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const c=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),h=l!==n.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:a,attrExpPresent:h,rawTagName:c}}const po=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class go{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const s=e.tagname;"string"==typeof s?(e.tagname=s,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const s={};if(!t)return;const n=function(t,e){const i=[];let s=e.exec(t);for(;s;){const n=[];n.startIndex=e.lastIndex-s[0].length;const r=s.length;for(let t=0;t<r;t++)n.push(s[t]);i.push(n),s=e.exec(t)}return i}(t,po),r=n.length;for(let t=0;t<r;t++){const e=n[t][1],i=n[t][4];e&&(s[e]=void 0===i||(isNaN(i)?i:Number(i)))}return s}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new ho("!xml");let i=e,s="",n="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=co(t,">",r,"Closing Tag is not closed."),a=n.lastIndexOf(".");n=n.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",r=e}else if("?"===t[r+1])r=uo(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=co(t,"--\x3e",r+4,"Comment is not closed.");else{const a=uo(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(n+=n?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),n=n.substr(0,n.length-1),l=o):l=l.substr(0,l.length-1);const t=new ho(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new ho(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=c}else s+=t[r];return e.child}}function fo(t,e){return mo(t)}function mo(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=yo(n);if(void 0!==r&&n[r]){const t=mo(n[r]);s=t,Object.keys(s).length,n[":@"]&&bo(t,n[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var s;return i}function yo(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function bo(t,e,i){if(e){const i=Object.keys(e),s=i.length;for(let n=0;n<s;n++){const s=i[n];t[s]=e[s]}}}class vo{constructor(t){this.options=Object.assign({},vo.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return fo(new go(this.options).parseXml(t),this.options)}}function xo(t,e,i,s=0){return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}vo.defaultOptions={};let _o=0;function Ao(){return _o++}var So;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(So||(So={}));const To=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>To.set(t,!0)));const wo=new Map;function Mo(t){if(To.has(t))return!0;if(wo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>wo.set(t,!0)));const Bo=Ao(),Co=Ao(),ko=Ao();Ao(),Ao();const Po=Ao(),Oo=Ao(),Ro=Ao(),Lo=Ao(),Eo=Ao(),Io=Ao(),Do=Ao(),Fo=Ao(),jo=Ao();Ao();const Uo=Ao(),No=Ao(),Wo=Symbol.for("GraphicCreator"),zo={"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"},Go=Object.keys(zo),Vo={duration:200,easing:"cubicOut"};function Ho(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 Xo(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,c,u,d,p,g,f,m,y;return e===t?(t[12]=e[0]*s+e[4]*n+e[8]*r+e[12],t[13]=e[1]*s+e[5]*n+e[9]*r+e[13],t[14]=e[2]*s+e[6]*n+e[10]*r+e[14],t[15]=e[3]*s+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],g=e[8],f=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*s+c*n+g*r+e[12],t[13]=o*s+u*n+f*r+e[13],t[14]=l*s+d*n+m*r+e[14],t[15]=h*s+p*n+y*r+e[15]),t}function $o(t,e,i){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*s+x*o+_*u+A*f,t[1]=v*n+x*l+_*d+A*m,t[2]=v*r+x*h+_*p+A*y,t[3]=v*a+x*c+_*g+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*s+x*o+_*u+A*f,t[5]=v*n+x*l+_*d+A*m,t[6]=v*r+x*h+_*p+A*y,t[7]=v*a+x*c+_*g+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*s+x*o+_*u+A*f,t[9]=v*n+x*l+_*d+A*m,t[10]=v*r+x*h+_*p+A*y,t[11]=v*a+x*c+_*g+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*s+x*o+_*u+A*f,t[13]=v*n+x*l+_*d+A*m,t[14]=v*r+x*h+_*p+A*y,t[15]=v*a+x*c+_*g+A*b,t}function Yo(t,e,i){const s=e[0],n=e[1],r=e[2];let a=i[3]*s+i[7]*n+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*s+i[4]*n+i[8]*r+i[12])/a,t[1]=(i[1]*s+i[5]*n+i[9]*r+i[13])/a,t[2]=(i[2]*s+i[6]*n+i[10]*r+i[14])/a,t}class qo{constructor(){this.pools=[]}static identity(t){return Ho(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 qo.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Ko=new class{constructor(){this.pools=[]}allocate(t,e,i,s,n,r){if(!this.pools.length)return new Yt(t,e,i,s,n,r);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=s,a.e=n,a.f=r,a}allocateByObj(t){if(!this.pools.length)return new Yt(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(...t){this.pools=[]}},Zo=new qo;var Jo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const tl=new Yt(1,0,0,1,0,0),el={x:0,y:0};let il=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Yt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Yt(1,0,0,1,0,0),this.path=new yn,this._clearMatrix=new Yt(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ko.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Yt(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,n=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,s,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,n,r,a=!0){this.matrix.multiply(t,e,i,s,n,r),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,s,n,r){this.path.arc(t,e,i,s,n,r)}arcTo(t,e,i,s,n){this.path.arcTo(t,e,i,s,n)}bezierCurveTo(t,e,i,s,n,r){this.path.bezierCurveTo(t,e,i,s,n,r)}closePath(){this.path.closePath()}ellipse(t,e,i,s,n,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this.path.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s){this.path.rect(t,e,i,s)}createImageData(t,e){return null}createLinearGradient(t,e,i,s){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,s,n,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,s){return null}fill(t,e){}fillRect(t,e,i,s){this.path.rect(t,e,i,s)}clearRect(t,e,i,s){}fillText(t,e,i){}getImageData(t,e,i,s){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},el),function(t,e,i){return Rr(t,0,!1,e,i)}(this.path.commandList,el.x,el.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},el);const i=Vn(this,this.lineWidth,this.dpr);return function(t,e,i,s){return Rr(t,e,!0,i,s)}(this.path.commandList,i,el.x,el.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,s){this.path.rect(t,e,i,s)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,s,n){}_setCommonStyle(t,e,i,s){}setStrokeStyle(t,e,i,s,n){}_setStrokeStyle(t,e,i,s){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(tl,t,e)}setClearMatrix(t,e,i,s,n,r){this._clearMatrix.setValue(t,e,i,s,n,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Ko.free(t))),this.stack.length=0}};var sl;il=Jo([Ii(),Qo("design:paramtypes",[Object,Number])],il),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(sl||(sl={}));class nl{static Get(t,e=sl.Color1,i=[0,0,0,1]){if(e===sl.Color1){const e=nl.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=re.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];nl.store1[t]=e,nl.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=nl.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=re.parseColorString(t);return n&&(nl.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],nl.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===sl.Color1){if(nl.store1[t])return;nl.store1[t]=i,nl.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(nl.store255[t])return;nl.store255[t]=i,nl.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function rl(t,e=!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 al(t,e,i,s,n){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((n,r)=>{var a,o;return ol(g(t)?null!==(a=t[r])&&void 0!==a?a:t[0]:t,g(e)?null!==(o=e[r])&&void 0!==o?o:e[0]:e,i,s)})):ol(t,e,i,s,n)}function ol(t,e,i,s,n){if(!t||!e)return t&&rl(t)||e&&rl(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=nl.Get(t,sl.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=nl.Get(e,sl.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:rl(a)})))});return o?al(r,l,i,s,n):al(l,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:ul(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:ul(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:ul(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(r,a),rl(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),s)}function ll(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}nl.store255={},nl.store1={};const hl=[0,0,0,0],cl=[0,0,0,0];function ul(t,e,i){return nl.Get(t,sl.Color255,hl),nl.Get(e,sl.Color255,cl),`rgba(${Math.round(hl[0]+(cl[0]-hl[0])*i)},${Math.round(hl[1]+(cl[1]-hl[1])*i)},${Math.round(hl[2]+(cl[2]-hl[2])*i)},${hl[3]+(cl[3]-hl[3])*i})`}const dl=new Xt,pl=new Yt;new Xt;const gl=["lineWidth","scaleX","scaleY","angle","anchor","visible"],fl=["x","y"],ml=["scaleX","scaleY"],yl=["angle"],bl=new bt,vl={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 xl extends zr{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(xl.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Xt,this._updateTag=_s.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)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:ss.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,s;const{dx:n=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;bl.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),bl.y=r+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else bl.x=n,bl.y=r;return bl}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new $t),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=oo[t];if(e)return e;if(e=xl.userSymbolMap[t],e)return e;if(!0===((i=t=lo[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new vo,{svg:i}=e.parse(t);if(!i)return null;const s=g(i.path)?i.path:[i.path];dl.clear();const n=[];s.forEach((t=>{const e=(new yn).fromString(t.d),i={};Go.forEach((e=>{t[e]&&(i[zo[e]]=t[e])})),n.push({path:e,attribute:i}),dl.union(e.bounds)}));const r=dl.width(),a=dl.height(),o=1/ct(r,a);n.forEach((t=>t.path.transform(0,0,o,o)));const l=new ao(t,n,!0);return xl.userSymbolMap[t]=l,l}var i;const s=(new yn).fromString(t),n=s.bounds.width(),r=s.bounds.height(),a=1/ct(n,r);s.transform(0,0,a,a);const o=new ao(t,s);return xl.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,s=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:n=e.boundsPadding}=i,r=Zr(n);return r&&s.expand(r),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new cs(t);return Ps(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){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(t=!0){return this._transMatrix||(this._transMatrix=new Yt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&_s.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&_s.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&_s.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&_s.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&_s.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&_s.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=_s.CLEAR_SHAPE}containsPoint(t,e,i,s){if(!s)return!1;if(i===As.GLOBAL){const i=new bt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,i,s){this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{(e.priority!==1/0||s)&&Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t,e=!1,i){(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t,e=!1,i){const s=Object.keys(t);for(let e=0;e<s.length;e++){const i=s[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(s)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,s){var n;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);r?this._setAttributes(r,i,s):l(null===(n=this.normalAttrs)||void 0===n?void 0:n[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=gl){for(let i=0;i<e.length;i++){const s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t,e=gl){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Ss.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=_s.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const n={type:Ss.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,n);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?ss.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:xn.x)+t,a.y=(null!==(s=a.y)&&void 0!==s?s:xn.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const s={type:Ss.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,s);return n?(this._setAttributes(n,!1,s),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}scale(t,e,i){var s,n;if(1===t&&1===e)return this;const r={type:Ss.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,ml,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:s}=this.attribute;s||(s=new Yt,o.postMatrix=s),ss.transformUtil.fromMatrix(s,s).scale(t,e,i)}else o.scaleX=(null!==(s=o.scaleX)&&void 0!==s?s:xn.scaleX)*t,o.scaleY=(null!==(n=o.scaleY)&&void 0!==n?n:xn.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Ss.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ml,s);return n?(this._setAttributes(n,!1,s),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}rotate(t,e){var i;if(0===t)return this;const s={type:Ss.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,yl,s);n&&(delete n.angle,this._setAttributes(n,!1,s));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Yt,r.postMatrix=i),ss.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:xn.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Ss.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,yl,i);return s?(this._setAttributes(s,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,s){var n,r;if(i){const e=Object.keys(t),i=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{i[e]?(o||(o={}),o[e]=t[e]):a[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(n=this.context&&this.context.stateAnimateConfig)&&void 0!==n?n:this.stateAnimateConfig)&&void 0!==r?r:Vo;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:Ss.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:Ss.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:Ss.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(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,i;const s=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=s?s:null===(i=this.finalAttribute)||void 0===i?void 0:i[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=g(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(i);s.length!==this.currentStates.length&&this.useStates(s,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=_s.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=_s.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=_s.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&_s.UPDATE_SHAPE_AND_BOUNDS)===_s.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=_s.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_s.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_s.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=_s.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=_s.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=_s.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=_s.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&_s.UPDATE_LAYOUT)}getAnchor(t,e,i){const s=[0,0],n=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=n();s[0]=i.x1+(i.x2-i.x1)*e}else s[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=n();s[1]=i.y1+(i.y2-i.y1)*e}else s[1]=t[1];return s}doUpdateLocalMatrix(){const{x:t=xn.x,y:e=xn.y,scaleX:i=xn.scaleX,scaleY:s=xn.scaleY,angle:n=xn.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&n&&(l=this.getAnchor(a,h)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=ht(a),f=dt(a);let m,y;o?(m=o[0],y=o[1]):(m=i,y=s);const b=m-i,v=y-s,x=l*g+c*f,_=h*g+u*f,A=c*g-l*f,S=u*g-h*f;t.a=n*x,t.b=n*_,t.c=r*A,t.d=r*S,t.e=d+l*m+c*y-x*b-A*v,t.f=p+h*m+u*y-_*b-S*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),ss.transformUtil.fromMatrix(a,a).scale(i,s,{x:l[0],y:l[1]})}const c=this.getOffsetXY(xn);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=pl.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Ss.ANIMATE_END})}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,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:ss.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return p(t,!0)?this.pathProxy=(new yn).fromString(t):this.pathProxy=new yn,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("<svg")?(Xr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(v(t)||t.includes("/")||x(t))&&(Xr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):c(t)?(s.state="success",s.data=t,this.backgroundImg=this.backgroundImg||e):s.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const s=this.resources.get(t);s&&(s.state="success",s.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),ss.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new Vr(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}toCustomPath(){var t,e,i;const s=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||ss.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(s){const t=new il(null,1);return s.drawShape(this,t,0,0,{},{}),t.path}return null}}var _l;xl.userSymbolMap={},xl.mixin(Hr),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(_l||(_l={}));class Al extends xl{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Po,this._childUpdateTag=_s.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 jr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new jr)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===As.GLOBAL){const i=new bt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&_s.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=xn.x,y:e=xn.y,dx:i=xn.dx,dy:s=xn.dy,scaleX:n=xn.scaleX,scaleY:r=xn.scaleY,angle:a=xn.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==s||1!==n||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Nr(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=n&&null!=r&&i.set(0,0,Math.max(0,n),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:s=0}=t;i.translate(e,s)}return ss.graphicService.updateTempAABBBounds(i),ss.graphicService.transformAABBBounds(t,i,e,!1,this),s.copy(i),s}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=_s.CLEAR_BOUNDS,this._childUpdateTag&=_s.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=_s.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&_s.UPDATE_BOUNDS||(this._childUpdateTag|=_s.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(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return this.getGraphicService().onRemove(t),t.stage=null,this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{this.getGraphicService().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),this.getGraphicService().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(t=!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&_s.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let s=this._getChildByName(t);return s?s.setAttributes(e):(s=ss.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new Al(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Al.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function Sl(t){return new Al(t)}function Tl(t,e){return!(!t&&!e)}function wl(t,e){let i;return i=g(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Ml(t,e,i){return i&&t*e>0}function Bl(t,e,i,s,n){return n&&t*e>0&&0!==i&&0!==s}function Cl(t,e){return t*e>0}function kl(t,e,i,s){return t*e>0&&0!==i&&0!==s}function Pl(t,e,i,s,n,r,a){const o=t-i,l=e-s,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,u=-h*o,d=t+c,p=e+u,g=i+c,f=s+u,m=(d+g)/2,y=(p+f)/2,b=g-d,v=f-p,x=b*b+v*v,_=n-r,A=d*f-g*p,S=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A));let T=(A*v-b*S)/x,w=(-A*b-v*S)/x;const M=(A*v+b*S)/x,B=(-A*b+v*S)/x,C=T-m,k=w-y,P=M-m,O=B-y;return C*C+k*k>P*P+O*O&&(T=M,w=B),{cx:T,cy:w,x01:-c,y01:-u,x11:T*(n/_-1),y11:w*(n/_-1)}}function Ol(t,e,i,s,n){const r=ot(i-e),a=t.getParsedCornerRadius(),o=g(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:c,outerEndAngle:u,innerEndAngle:d,innerStartAngle:p}=t.getParsePadAngle(e,i),f=o?a[0]:a,m=o?a[1]:a,y=o?a[2]:a,b=o?a[3]:a,v=Math.max(m,f),x=Math.max(y,b);let _=v,A=x;const S=n*ht(c),T=n*dt(c),w=s*ht(d),M=s*dt(d);let B,C,k,P;if((x>it||v>it)&&(B=n*ht(u),C=n*dt(u),k=s*ht(p),P=s*dt(p),r<st)){const t=function(t,e,i,s,n,r,a,o){const l=i-t,h=s-e,c=a-n,u=o-r;let d=u*l-c*h;return d*d<it?[]:(d=(c*(e-r)-u*(t-n))/d,[t+d*l,e+d*h])}(S,T,k,P,B,C,w,M);if(t){const e=S-t[0],i=T-t[1],r=B-t[0],a=C-t[1],o=1/dt(((O=(e*r+i*a)/(pt(e*e+i*i)*pt(r*r+a*a)))>1?0:O<-1?st:Math.acos(O))/2),l=pt(t[0]*t[0]+t[1]*t[1]);A=ut(x,(s-l)/(o-1)),_=ut(v,(n-l)/(o+1))}}var O;return{outerDeltaAngle:l,xors:S,yors:T,xirs:k,yirs:P,xore:B,yore:C,xire:w,yire:M,limitedOcr:_,limitedIcr:A,outerCornerRadiusStart:f,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:x,outerStartAngle:c,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:d,innerStartAngle:p,innerCornerRadiusStart:b,innerCornerRadiusEnd:y}}function Rl(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(n<r){const t=n;n=r,r=t}if(n<=it)e.moveTo(i,s);else if(h>=at-it)e.moveTo(i+n*ht(o),s+n*dt(o)),e.arc(i,s,n,o,l,!c),r>it&&(e.moveTo(i+r*ht(l),s+r*dt(l)),e.arc(i,s,r,l,o,c));else{const{outerDeltaAngle:h,xors:d,yors:p,xirs:g,yirs:f,limitedOcr:m,outerCornerRadiusStart:y,outerCornerRadiusEnd:b,maxOuterCornerRadius:v,xore:x,yore:_,xire:A,yire:S,outerStartAngle:T,outerEndAngle:w,limitedIcr:M,innerDeltaAngle:B,innerEndAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,o,l,r,n);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+d,s+p),u=!0;else if(m>it){const t=ut(y,m),r=ut(b,m),o=Pl(g,f,d,p,n,t,Number(c)),l=Pl(x,_,A,S,n,r,Number(c));m<v&&t===r?!a||a[0]?(e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),e.arc(i+o.cx,s+o.cy,m,lt(o.y01,o.x01),lt(l.y01,l.x01),!c)):e.moveTo(i+o.cx+m*ht(lt(l.y01,l.x01)),s+o.cy+m*dt(lt(l.y01,l.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),t>0&&e.arc(i+o.cx,s+o.cy,t,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,s,n,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),!c),r>0&&e.arc(i+l.cx,s+l.cy,r,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):r>0?e.moveTo(i+l.cx+r*ht(lt(l.y01,l.x01)),s+l.cy+r*dt(lt(l.y01,l.x01))):e.moveTo(i+x,s+n*dt(w))}else!a||a[0]?(e.moveTo(i+d,s+p),e.arc(i,s,n,T,w,!c)):e.moveTo(i+n*ht(w),s+n*dt(w));if(!(r>it)||B<.001)!a||a[1]?e.lineTo(i+A,s+S):e.moveTo(i+A,s+S),u=!0;else if(M>it){const t=ut(P,M),n=ut(O,M),o=Pl(A,S,x,_,r,-n,Number(c)),l=Pl(d,p,g,f,r,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,s+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),M<R&&t===n){const t=lt(l.y01,l.x01);!a||a[2]?e.arc(i+o.cx,s+o.cy,M,lt(o.y01,o.x01),t,!c):e.moveTo(i+o.cx+ht(t),s+o.cy+dt(t))}else!a||a[2]?(n>0&&e.arc(i+o.cx,s+o.cy,n,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,s,r,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,s+l.cy,t,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*ht(lt(l.y01,l.x01)),s+l.cy+t*dt(lt(l.y01,l.x01))):e.moveTo(i+g,s+f)}else!a||a[1]?e.lineTo(i+A,s+S):e.moveTo(i+A,s+S),!a||a[2]?e.arc(i,s,r,C,k,c):e.moveTo(i+r*ht(k),s+r*dt(k))}return a?a[3]&&e.lineTo(i+n*ht(o),s+n*dt(o)):e.closePath(),u}Al.NOWORK_ANIMATE_ATTR=vl;const Ll=Symbol.for("ArcRenderContribution"),El=Symbol.for("ImageRenderContribution"),Il=Symbol.for("PolygonRenderContribution"),Dl=Symbol.for("RectRenderContribution"),Fl=Symbol.for("SymbolRenderContribution"),jl=Symbol.for("TextRenderContribution"),Ul=Symbol.for("InteractiveSubRenderContribution");function Nl(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Wl(t,e,i,s=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?s-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var zl=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Gl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vl=function(t,e){return function(i,s){e(i,s,t)}};function Hl(t,e,i){var s;const{x:n=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(s=m[2])&&void 0!==s?s:0}if(Ho(t),Xo(t,t,[n+o,r+l,a+h]),Xo(t,t,[b[0],b[1],b[2]]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],u=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]=r*n+h*s,t[5]=a*n+c*s,t[6]=o*n+u*s,t[7]=l*n+d*s,t[8]=h*n-r*s,t[9]=c*n-a*s,t[10]=u*n-o*s,t[11]=d*n-l*s}(t,t,g),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],c=e[9],u=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]=r*n-h*s,t[1]=a*n-c*s,t[2]=o*n-u*s,t[3]=l*n-d*s,t[8]=r*s+h*n,t[9]=a*s+c*n,t[10]=o*s+u*n,t[11]=l*s+d*n}(t,t,p),Xo(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const s=i[0],n=i[1],r=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),f){const i=Zo.allocate(),s=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=m[1]}Xo(i,i,[s[0],s[1],0]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=e[5],u=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]=r*n+h*s,t[1]=a*n+c*s,t[2]=o*n+u*s,t[3]=l*n+d*s,t[4]=h*n-r*s,t[5]=c*n-a*s,t[6]=u*n-o*s,t[7]=d*n-l*s}(i,i,f),Xo(i,i,[-s[0],-s[1],0]),$o(t,t,i)}}let Xl=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new is(["graphic"]),onSetStage:new is(["graphic","stage"]),onRemove:new is(["graphic"]),onRelease:new is(["graphic"]),onAddIncremental:new is(["graphic","group","stage"]),onClearIncremental:new is(["graphic","group","stage"]),beforeUpdateAABBBounds:new is(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new is(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new is(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Xt,this.tempAABBBounds2=new Xt}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,s){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,s)}afterUpdateAABBBounds(t,e,i,s,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,s,n)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new cs(t);return Ps(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=y(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=Wl(r,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){const e=y(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=Nl(n,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){xo(u,(l+h)/Math.abs(n+r),s,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;xo(u,o/Math.abs(n+r)*2,!1,c+1),u.translate(s,a),e.union(u)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const a=n.transMatrix;n&&n.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Vt(e,e,a)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(s.shadowRoot||s.isContainer)return!0;const{visible:n=e.visible}=t;return!(!s.valid||!n)||(i.empty()||(s.parent&&i.transformWithMatrix(s.parent.globalTransMatrix),this.clearAABBBounds(s,s.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};Xl=zl([Ii(),Vl(0,Li(Wo)),Gl("design:paramtypes",[Object])],Xl);const $l=(t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}return i};class Yl{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,s){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===s.length){const t=s[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,s,n="",r,a){const{lineWidth:o,suffixPosition:l="end",measureMode:h=rs.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const u=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,s=t.length;i<s;i++){const s=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(s.width>o){const s=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,n,r,l);a=s.str,e=s.width}else e=s.width;u.push({str:a,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:c})}d[0]=o}else{let e,i,s=0;for(let n=0,r=t.length;n<r;n++){i=t[n];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[n],this.textOptions,h);e=r.width,s=Math.max(s,e),u.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}d[0]=s}d[1]=u.length*s,d[0]=u.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(p,e,i,u),this.layoutWithBBox(p,u,e,i,s)}layoutWithBBox(t,e,i,s,n){const r=[0,0],a=e.length*n;"top"===s||("middle"===s?r[1]=(t.height-a)/2:"bottom"===s&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,s,n,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:n,textAlign:i,textBaseline:s}}lineOffset(t,e,i,s,n,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=n/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<n-t&&("bottom"===s?e.topOffset+=(n-i)/2:"top"===s&&(e.topOffset-=(n-i)/2)),"alphabetic"===s){const t=n/(e.ascent+e.descent);e.topOffset=n/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=n,e}}const ql=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...gl];class Kl extends xl{get font(){const t=this.getGraphicTheme();return this._font||(this._font=zt(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),s=this.getMaxWidth(i);return Number.isFinite(s)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),s=this.attribute,n=this.getMaxWidth(i);if(!Number.isFinite(n))return!1;const{text:r}=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(r)?r.join(""):r)!==t}return"vertical"===s.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==s.text.toString():null!=this.clipedText&&this.clipedText!==s.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=No,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return g(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Nr(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new Kl({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:n,y:r}=e,a={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},o=kt(a,i,{x:n,y:r});return this._OBBBounds.copy(s),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:n}=ss.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){xo(n,o/Math.abs(r+a),!0,l),i.union(n)}return ss.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ss.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Vt(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:s=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&s&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+s),n}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),s=this.attribute,{fontFamily:n=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=s,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(s,i,v);if("normal"===f||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=ss.graphicUtil.textMeasure,A=new Yl(n,{fontSize:o,fontWeight:l,fontFamily:n,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{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),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,s;const n=this.getGraphicTheme(),{fontFamily:r=n.fontFamily,textAlign:a=n.textAlign,textBaseline:o=n.textBaseline,fontSize:l=n.fontSize,ellipsis:h=n.ellipsis,maxLineWidth:c,stroke:u=n.stroke,lineWidth:d=n.lineWidth,wordBreak:p=n.wordBreak,fontWeight:f=n.fontWeight,ignoreBuf:m=n.ignoreBuf,measureMode:y=n.measureMode,suffixPosition:b=n.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=n.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,n,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),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const T=ss.graphicUtil.textMeasure,w={fontSize:l,fontWeight:f,fontFamily:r,lineHeight:S},M=new Yl(r,w,T),B=g(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[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 c&&c!==1/0){if(c>0)for(let t=0;t<B.length;t++){const e=B[t];let n=!0;if(t===P-1){const i=T.clipTextWithSuffix(e,w,c,h,!1,b,t!==B.length-1),s=T.measureTextPixelADscentAndWidth(i.str,w,y);C.push({str:i.str,width:i.width,ascent:s.ascent,descent:s.descent,keepCenterInLine:_});break}const r=T.clipText(e,w,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(h){const t=T.clipTextWithSuffix(e,w,c,h,!1,b);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(s=t.width)&&void 0!==s?s:0}else r.str="",r.width=0;n=!1}const a=T.measureTextPixelADscentAndWidth(r.str,w,y);C.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(n=!0,o=r.wordBreaked),r.str.length===e.length);else if(n){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),B.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let s=0,n=B.length;s<n;s++){if(s===P-1){const t=T.clipTextWithSuffix(B[s],w,c,h,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,w,y);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=B[s],t=T.measureTextWidth(e,w),i=Math.max(i,t);const n=T.measureTextPixelADscentAndWidth(e,w,y);C.push({str:e,width:t,ascent:n.ascent,descent:n.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const O={xOffset:0,yOffset:0,width:k[0],height:k[1]};M.LayoutBBox(O,a,o,C);const R=M.layoutWithBBox(O,C,a,o,S);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),n=ss.graphicUtil.textMeasure;let r;const a=this.attribute,{maxLineWidth:o=s.maxLineWidth,ellipsis:l=s.ellipsis,fontFamily:h=s.fontFamily,fontSize:c=s.fontSize,fontWeight:u=s.fontWeight,stroke:d=s.stroke,lineWidth:p=s.lineWidth,verticalMode:g=s.verticalMode,suffixPosition:f=s.suffixPosition}=a,m=this.getLineHeight(a,s,0);let{textAlign:y=s.textAlign,textBaseline:b=s.textBaseline}=a;if(!g){const t=y;y=null!==(e=Kl.baselineMapAlign[b])&&void 0!==e?e:"left",b=null!==(i=Kl.alignMapBaseline[t])&&void 0!==i?i:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const t=Nl(y,r),e=this.cache.verticalList.length*m,i=Wl(b,e,c);return this._AABBBounds.set(i,t,i+e,t+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,s="";for(let n=0;n<t.length;n++)Mo(t[n])?i?s+=t[n]:(i=1,s=t[n]):(i&&(e.push({text:s,direction:So.VERTICAL}),s="",i=0),e.push({text:t[n],direction:So.HORIZONTAL}));return s&&e.push({text:s,direction:So.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(o))if(l){const i=!0===l?s.ellipsis:l,a=n.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,i,!1,f);v[e]=a.verticalList,r=a.width}else{const i=n.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,!1);v[e]=i.verticalList,r=i.width}else r=0,t.forEach((t=>{const e=t.direction===So.HORIZONTAL?c:n.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:h});r+=e,t.width=e}))})),this.cache.verticalList=v,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const x=Nl(y,r),_=this.cache.verticalList.length*m,A=Wl(b,_,c);return this._AABBBounds.set(A,x,A+_,x+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,i;const s=this.attribute;return null!==(i=null!==(e=s.maxLineWidth)&&void 0!==e?e:s.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var s;return null!==(s=sa(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==s?s:(t.fontSize||e.fontSize)+i}needUpdateTags(t,e=ql){return super.needUpdateTags(t,e)}needUpdateTag(t,e=ql){return super.needUpdateTag(t,e)}_interpolate(t,e,i,s,n){"text"===t&&(n.text=s)}clone(){return new Kl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Kl.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return Kl.baselineMapAlign}getAlignMapBaseline(){return Kl.alignMapBaseline}}function Zl(t){return new Kl(t)}Kl.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},vl),Kl.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Kl.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Jl=["symbolType","size",...gl];let Ql=class t extends xl{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Uo}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,i=1){let s=null;try{s=new Path2D}catch(t){return null}const n=this.getParsedPath();if(!n)return null;n.draw(s,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return g(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Nr(this).symbol}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=ss.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(s){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=s;xo(i,a+(n+o)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:s=e.size}=t;if(g(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Jl)}needUpdateTag(t){return super.needUpdateTag(t,Jl)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=g(e)?e:[e,e];return t.path?(new yn).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new yn).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function th(t){return new Ql(t)}Ql.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},vl);const eh=["segments","points","curveType","curveTension",...gl];let ih=class t extends xl{constructor(t={}){super(t),this.type="line",this.numberType=Ro}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,s,n){"points"===t&&(n.points=ia(i,s,e))}getGraphicTheme(){return Nr(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),ss.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:s=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateLineAABBBoundsByPoints(t,e,i,s){const{points:n=e.points,connectedType:r}=t,a=i;return n.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments,connectedType:r}=t,a=i;return n.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,eh)}needUpdateTag(t){return super.needUpdateTag(t,eh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new yn;const i=e.segments,s=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{s(t.points)})):e.points&&s(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function sh(t){return new ih(t)}ih.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const nh=["width","x1","y1","height","cornerRadius",...gl];class rh extends xl{constructor(t){super(t),this.type="rect",this.numberType=Do}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Nr(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=ss.graphicService.updateTempAABBBounds(i);return $l(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ss.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,nh)}needUpdateTag(t){return super.needUpdateTag(t,nh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:i,y:s,width:n,height:r}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=l(t.width)?t.x1-t.x:t.width,i=l(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(e);return t=new yn,t.moveTo(i,s),t.rect(i,s,n,r),t}clone(){return new rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return rh.NOWORK_ANIMATE_ATTR}}function ah(t){return new rh(t)}rh.NOWORK_ANIMATE_ATTR=vl;const oh=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class lh extends rh{constructor(t){super(t),this.type="rect3d",this.numberType=Fo}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:s,x:n,y:r,length:a=ut(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-n,l=null!=l?l:s-r;for(let e=0;e<oh.length;e++){const i=oh[e];t.vertices.push([i[0]*o,i[1]*l,i[2]*a])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return lh.NOWORK_ANIMATE_ATTR}}function hh(t){return new lh(t)}lh.NOWORK_ANIMATE_ATTR=vl;class ch{constructor(t,e,i,s,n,r,a,o,l,h,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=s,this.actualHeight=0,this.bottom=e+s,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Xn[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:s}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,s):this.height||s||0;r=Math.min(r,s);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-n:"center"===this.globalAlign&&(o=-n/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){const{top:s,height:n}=this.lines[i];if(s+n<this[this.directionKey.top]||s+n>this[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:s,height:n}=this.lines[i],r=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,r+a,this.ellipsis,e);else{if(r+n>this[this.directionKey.top]+l||r<this[this.directionKey.top])return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(s=!0,h=!0),this.lines[i].draw(t,s,o,r+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:s,height:n}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(s+n<this[this.directionKey.top]||s+n>this[this.directionKey.top]+l)return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const s=this.lines[i];s.actualWidth>t&&(t=s.actualWidth),e+=s.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:s}=this.getRawActualSize();this.width,this.height;let n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(let i=0;i<this.lines.length;i++){const{top:s,height:r}=this.lines[i];if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((n-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:s,height:r}=this.lines[i],a=n-this.lines[i].top-this.lines[i].height;if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+n||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:s,height:r}=this.lines[i];if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function uh(t,e,i,s){const n=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(s);return{left:t>n?n:n-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>s?o:o+.5}}class dh{constructor(t,e,i,s){var n,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=s;const a=sa(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:c}=er(t,i,this.ascentDescentMode);let u=0,d=0,p=0;this.height>l&&(u=(this.height-l)/2,d=Math.ceil(u),p=Math.floor(u)),"top"===this.textBaseline?(this.ascent=u,this.descent=l-u):"bottom"===this.textBaseline?(this.ascent=l-u,this.descent=u):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(n=i.dx)&&void 0!==n?n:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=er(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,i,s,n,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+s;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qn(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const u=uh(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},u),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,s,n,r,a){var o;let l=e+i,h=this.text,c=this.left+s+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let u=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,u="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qn(h,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===u);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===u&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===u&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Qn(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:s}=er(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-s}return i}}const ph=["width","height","image",...gl];class gh extends xl{constructor(t){super(t),this.type="image",this.numberType=Oo,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return Nr(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:s=e.maxWidth,maxHeight:n=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>s/n?(r=s,a=s/t):(a=n,r=n*t)}}else r=s,a=n}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:s,tb2:n}=ss.graphicService.updateTempAABBBounds(i);return $l(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ss.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Nn[t]}needUpdateTags(t){return super.needUpdateTags(t,ph)}needUpdateTag(t){return super.needUpdateTag(t,ph)}clone(){return new gh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gh.NOWORK_ANIMATE_ATTR}}function fh(t){return new gh(t)}gh.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},vl);class mh extends gh{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=Zr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(g(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Zr(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=Nn.width,height:e=Nn.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:s=e}=this.attribute,n=(i-t)/2,r=(s-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class yh{constructor(t,e,i,s,n,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=n,this.top=i-s,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof mh?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Xn[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof dh){const e=Zn.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 i=this.directionKey,s=this.height;let n=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?n=t-this.actualWidth:"center"===this.textAlign?n=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?n=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof mh?(t["_"+i.x]=n,n+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?s-t.height:(s-t.height)/2):(t[i.left]=n,n+=t[i.width]+r)}))}draw(t,e,i,s,n,r){if(n&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const s=this.paragraphs[e];if(s.overflow)t=t&&""===s.text;else if(t){i=!0;break}}let s=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof mh)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";i.ellipsisStr=r;const{width:a}=er(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+s){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+s+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+s;break}i.ellipsis="hide",s+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,n)=>{if(e instanceof mh)return;const r=e.drawBackground(t,s,this.ascent,i,0===n,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],s=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,s.right-i.left,s.bottom-i.top)})),this.paragraphs.forEach(((e,n)=>{if(e instanceof mh)return e.setAttributes({x:i+e._x,y:s+e._y}),void r(e,t,i+e._x,s+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Yn;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Jn(t,e)})(t,e.character),function(t,e,i){const s=e&&e.fill||$n;if(!s)return void(t.globalAlpha=0);const{fillOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.fillStyle=i?Hn(t,s,{AABBBounds:i}):s,Jn(t,e)}(t,e.character,a),e.draw(t,s,this.ascent,i,0===n,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s instanceof mh)break;const{width:n}=er(t,s.character,s.ascentDescentMode),r=n||0;if(r<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=r;break}if(r<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=r,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof mh?t.width:t.getWidthWithEllips(this.direction)})),i}}class bh{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=Xn[this.direction]}store(t){if(t instanceof mh){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new yh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof mh?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=Qn(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==n){const[i,s]=function(t,e){const i=t.text.slice(0,e),s=t.text.slice(e);return[new dh(i,t.newLine,t.character,t.ascentDescentMode),new dh(s,!0,t.character,t.ascentDescentMode)]}(t,n);this.store(i),e?this.send():this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let vh=!1;try{vh=Intl&&"function"==typeof Intl.Segmenter}catch(t){vh=!1}const xh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...gl];class _h extends xl{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=jo,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const s=this._frameCache.icons.get(t[i]);this.updateHoverIconState(s)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Un.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:Un.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:Un.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:Un.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:Un.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:Un.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:Un.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:Un.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Nr(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&p(t.text)&&_h.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&p(t.text)&&_h.splitText(t.text).length>1)))}static splitText(t){if(vh){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:s}of e.segment(t))i.push(s);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const i=_h.splitText(t.text.toString());if(p(t.text)&&i.length>1)for(let s=0;s<i.length;s++){const n=i[s];e.push(Object.assign(Object.assign({},t),{text:n}))}else e.push(t)})),e}updateAABBBounds(t,e,i){var s,n,r,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:c=e.maxHeight,textAlign:u=e.textAlign,textBaseline:d=(null!==(n=null!==(s=t.textBaseline)&&void 0!==s?s:e.textBaseline)&&void 0!==n?n:"top"),editOptions:p}=t;if(o>0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:s}=t.getActualSize();let n=o||e||0,r=l||s||0;r="number"==typeof c&&r>c?c:r||0,n="number"==typeof h&&n>h?h:n||0,i.set(0,0,n,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(d){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(u){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return i.translate(f,g),ss.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ss.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ss.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,xh)}needUpdateTag(t){return super.needUpdateTag(t,xh)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:s,fontFamily:n,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:c,strokeOpacity:u,upgradeAttrs:d}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:s,fontFamily:n,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:u},t);return(null==d?void 0:d.lineHeight)&&(p.lineHeight=c),p}doUpdateFrameCache(t){var e;const{maxWidth:i,maxHeight:s,width:n,height:r,ellipsis:a,wordBreak:o,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d,disableAutoWrapLine:p,editable:g,ascentDescentMode:f,upgradeAttrs:m}=this.attribute,b=m&&m.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!_h.AllSingleCharacter(v)&&(v=_h.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=t?t:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)x.push(i);else{const t=new mh(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(y(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let s=0;s<i.length;s++)if(0===s)x.push(new dh(i[s],!1,e,f));else if(i[s]||t===_.length-1)x.push(new dh(i[s],!0,e,f));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new dh(i[s],!0,e,f))}}else e.text&&x.push(new dh(e.text,!1,e,f))}const A="number"==typeof i&&Number.isFinite(i)&&i>0,S="number"==typeof s&&Number.isFinite(s)&&s>0,T="number"==typeof n&&Number.isFinite(n)&&n>0&&(!A||n<=i),w="number"==typeof r&&Number.isFinite(r)&&r>0&&(!S||r<=s),M=new ch(0,0,(T?n:A?i:0)||0,(w?r:S?s:0)||0,a,o,l,h,c,u||"horizontal",!T&&A,!w&&S,d||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),B=new bh(M);if(B.newLine=b,p){let t=0,e=!1;for(let i=0;i<x.length;i++){const s=x[i];e?(s.overflow=!0,s.left=1/0,s.top=1/0,!s.newLine&&M.lines[M.lines.length-1].paragraphs.push(s)):B.deal(s,!0),M.lines.length!==t&&(t=M.lines.length,B.lineBuffer.length=0,s.overflow=!0,s.left=1e3,s.top=1e3,M.lines[M.lines.length-1].paragraphs.push(s),e=!0),s.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===M.layoutDirection?T:w)){const t=M.getActualSizeWidthEllipsis();let e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?A:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?i:s)),M.lines.forEach((function(t){t.calcOffset(e,!1)}))}b&&M.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=M}clone(){return new _h(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,s,n,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(s=this.stage)||void 0===s||s.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:s}=this.globalTransMatrix;let n;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-s})&&(n=e,n.globalX=(null!==(a=n.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],n.globalY=(null!==(o=n.attribute.y)&&void 0!==o?o:0)+s+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return _h.NOWORK_ANIMATE_ATTR}}function Ah(t){return new _h(t)}_h.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},vl);const Sh=["path","customPath",...gl];class Th extends xl{constructor(t){super(t),this.type="path",this.numberType=Lo}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof yn?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof yn?this.cache:t.path)}getGraphicTheme(){return Nr(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=ss.graphicService.updateTempAABBBounds(i);$l(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;p(t.path,!0)?this.cache=(new yn).fromString(t.path):t.customPath&&(this.cache=new yn,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Sh)}needUpdateTag(t){return super.needUpdateTag(t,Sh)}toCustomPath(){return(new yn).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Th(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Th.NOWORK_ANIMATE_ATTR}}function wh(t){return new Th(t)}Th.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},vl);const Mh=["segments","points","curveType","curveTension",...gl];class Bh extends xl{constructor(t){super(t),this.type="area",this.numberType=ko}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Nr(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),ss.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:s=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateAreaAABBBoundsByPoints(t,e,i,s){const{points:n=e.points}=t,r=i;return n.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments}=t,r=i;return n.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,s,n){"points"===t&&(n.points=ia(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Mh)}needUpdateTag(t){return super.needUpdateTag(t,Mh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new yn;const e=this.attribute,i=e.segments,s=e=>{if(e&&e.length){let i=!0;const s=[];if(e.forEach((e=>{var n,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),s.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),s.length){for(let e=s.length-1;e>=0;e--)t.lineTo(s[e].x,s[e].y);t.closePath()}}};return e.points?s(e.points):i&&i.length&&i.forEach((t=>{s(t.points)})),t}clone(){return new Bh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Bh.NOWORK_ANIMATE_ATTR}}Bh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const Ch=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...gl];class kh extends xl{constructor(t){super(t),this.type="arc",this.numberType=Bo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=s,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(n-r),o=t=>Math.min(y(t,!0)?t:a*parseFloat(t)/100,a/2);if(g(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=At(e),i=e+r,s&&ot(r)<at-it){let r=1,a=1;s.length&&(r=Number(s[0]),a=Number(s[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;o+=h,l-=c;const u=Math.abs(o-l)/2,d=u/o;if(u>it&&o>it)return{startAngle:e-n*d*r,endAngle:i+n*d*a,sc:n*d*r,ec:n*d*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=s;const{padRadius:l=pt(a*a+o*o)}=this.attribute,h=ot(e-t);let c=t,u=e,d=t,p=e;const g=r/2;let f=h,m=h;if(g>it&&l>it){const i=e>t?1:-1;let s=ft(Number(l)/o*dt(g)),n=ft(Number(l)/a*dt(g));return(f-=2*s)>it?(s*=i,d+=s,p-=s):(f=0,d=p=(t+e)/2),(m-=2*n)>it?(n*=i,c+=n,u-=n):(m=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}getGraphicTheme(){return Nr(this).arc}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=ss.graphicService.updateTempAABBBounds(i);$l(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return s+=r,n-=a,s<n&&(s=n),i.set(-s,-s,s,s),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(s+=r,n-=a,s<n){const t=s;s=n,n=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return s<=it?i.set(0,0,0,0):Math.abs(o-l)>at-it?i.set(-s,-s,s,s):(ta(l,o,s,i),ta(l,o,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,Ch)}needUpdateTag(t){return super.needUpdateTag(t,Ch)}toCustomPath(){var t,e,i,s;let n=super.toCustomPath();if(n)return n;const r=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(s=r.outerPadding)&&void 0!==s?s:0);const c=ot(o-a),u=o>a;if(h<l){const t=h;h=l,l=t}if(n=new yn,h<=it)n.moveTo(0,0);else if(c>=at-it)n.moveTo(0+h*ht(a),0+h*dt(a)),n.arc(0,0,h,a,o,!u),l>it&&(n.moveTo(0+l*ht(o),0+l*dt(o)),n.arc(0,0,l,o,a,u));else{const t=h*ht(a),e=h*dt(a),i=l*ht(o),s=l*dt(o);n.moveTo(0+t,0+e),n.arc(0,0,h,a,o,!u),n.lineTo(0+i,0+s),n.arc(0,0,l,o,a,u),n.closePath()}return n}clone(){return new kh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return kh.NOWORK_ANIMATE_ATTR}}function Ph(t){return new kh(t)}kh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);class Oh extends kh{constructor(t){super(t),this.type="arc3d",this.numberType=Co}updateAABBBounds(t,e,i){const s=this.stage;if(!s||!s.camera)return i;const{outerRadius:n=e.outerRadius,height:r=0}=t,a=n+r;return i.setValue(-a,-a,a,a),ss.graphicService.updateTempAABBBounds(i),ss.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Oh.NOWORK_ANIMATE_ATTR}}function Rh(t){return new Oh(t)}Oh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);const Lh=["points","cornerRadius",...gl];class Eh extends xl{constructor(t){super(t),this.type="polygon",this.numberType=Eo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Nr(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),ss.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:s=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:s=e.points}=t;return s.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,s,n){"points"===t&&(n.points=ia(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Lh)}needUpdateTag(t){return super.needUpdateTag(t,Lh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute.points;return t=new yn,e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t}clone(){return new Eh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Eh.NOWORK_ANIMATE_ATTR}}function Ih(t){return new Eh(t)}Eh.NOWORK_ANIMATE_ATTR=vl;class Dh extends Eh{constructor(t){super(t),this.type="pyramid3d",this.numberType=Io}updateAABBBounds(t,e,i){const s=this.stage;return s&&s.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],s=t[1];i.add(e,s)})),ss.graphicService.updateTempAABBBounds(i),ss.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const s=3===i?t[0]:t[i+1],n=e.x-s.x;return 0===n?0:(e.y-s.y)/n})),i=t.map((t=>({p:t,d:0})));let s=!1,n=0;for(let t=0;t<e.length-1;t++){for(let r=t+1;r<e.length;r++){if(e[t]===e[r]){s=!0;const e=vt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,n=ct(n,e);const a=vt.distancePP(i[r].p,i[r+1].p);i[r].d=a,i[r+1].d=a,n=ct(n,a)}if(s)break}if(s)break}for(let e=t.length-1;e>=0;e--){const s=t[e];i.unshift({p:s,d:0})}for(let e=0;e<t.length;e++){const s=(n-i[e+t.length].d)/2;i[e].d+=s,i[e+t.length].d+=s}const r={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return Dh.NOWORK_ANIMATE_ATTR}}function Fh(t){return new Dh(t)}Dh.NOWORK_ANIMATE_ATTR=vl;class jh extends Al{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function Uh(t){return new jh(t)}const Nh=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Wh;function zh(t){return Wh||(Wh=Nh.CreateGraphic("text",{})),Wh.initAttributes(t),Wh.AABBBounds}var Gh=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Vh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hh=function(t,e){return function(i,s){e(i,s,t)}};class Xh{constructor(){this.time=Ms.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const n=t.resources.get(g);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Nr(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=f*m,this.doDrawImage(e,n.data,r,{backgroundMode:y,backgroundFit:b,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s){const{backgroundMode:n,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=s,c=i.width(),u=i.height();let d=c,p=u;if("no-repeat"===n)if(r)if(a){const s=Math.max(c/e.width,u/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*s*o,e.height*s*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=e.width*o,n=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,s,n)}else{if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,s=e.height;"repeat-x"===n?(d=i*(u/s),p=u):"repeat-y"===n&&(p=s*(c/i),d=c);const r=t.dpr,a=Lr.allocate({width:d,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,p),o.drawImage(e,0,0,d,p),e=a.nativeCanvas),Lr.free(a)}const s=t.dpr,a=t.createPattern(e,n);a.setTransform&&a.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,u),t.translate(-i.x1,-i.y1)}}}const $h=new Xh;let Yh=class{constructor(t){this.subRenderContribitions=t,this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,c,u,d)}))}};Yh=Gh([Ii(),Hh(0,Li(Zi)),Hh(0,Di(Ul)),Vh("design:paramtypes",[Object])],Yh);const qh=new class{constructor(){this.time=Ms.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const y=!(c||u),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:b.height();y&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,s+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const Kh=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||u||e.restore())}};const Zh=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=Lr.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),n(r,l);const h=s.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Lr.free(o),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,at),e.fill()}))}createDiamondPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{const n=t/2,r=n;s.fillStyle=i,s.moveTo(n,r-e),s.lineTo(e+n,r),s.lineTo(n,r+e),s.lineTo(n-e,r),s.closePath(),s.fill()}))}createRectPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*s,t)}))}createHorizontalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*s)}))}createBiasLRLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(0,0),s.lineTo(t,t);const n=t/2,r=-n;s.moveTo(n,r),s.lineTo(n+t,r+t),s.moveTo(-n,-r),s.lineTo(-n+t,-r+t),s.stroke()}))}createBiasRLLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(t,0),s.lineTo(0,t);const n=t/2,r=n;s.moveTo(t+n,r),s.lineTo(n,r+t),s.moveTo(t-n,-r),s.lineTo(-n,-r+t),s.stroke()}))}createGridPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,t,t),s.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,g,f,m)}drawTexture(t,e,i,s,n,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:u=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,i);break;case"diamond":d=this.createDiamondPattern(o,l,a,i);break;case"rect":d=this.createRectPattern(o,l,a,i);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":d=this.createGridPattern(o,l,a,i)}if(u&&u.dynamicTexture){const{gridConfig:d={},useNewCanvas:p}=u,g=e.AABBBounds;s=g.x1,n=g.y1;const f=i;let m;if(p){m=Lr.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),s=0,n=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,s,n,r),f.clip();const y=g.width(),b=g.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(y/x),A=d.rows?d.rows:Math.ceil(b/x),S=d.gutterColumn?d.gutterColumn:2*v,T=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=th({}));const w=d.columns?y/d.columns:x,M=d.rows?b/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[w-S,M-T],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=s+x/2+r*x,l=n+x/2+t*x;null===(h=u.beforeDynamicTexture)||void 0===h||h.call(u,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(w-S,M-T),o,l,0)&&i.closePath(),i.fillStyle=a,u.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(d)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,s,n,r),i.fillStyle=d,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,s,n,r),i.clip();const t=e.AABBBounds;(function(t,e,i,s,n,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:u=0}=n;let{amplitude:d=10}=n;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=s*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,s+a),t.lineTo(0+r,p+a);const m=g/h*e,y=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=d*Math.sin((e+m+u)/y+u);t.lineTo(e+r,p+i+a)}t.lineTo(g+r,s+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},u||{}),{fill:a}),s+t.x1-s,n+t.y1-n),i.restore()}}};const Jh=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,g=d&&!1!==d.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerPadding:m=l.innerPadding,outerPadding:y=l.outerPadding,startAngle:b=l.startAngle,endAngle:v=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY,keepStrokeScale:w=l.keepStrokeScale}=t.attribute;let{innerRadius:M=l.innerRadius,outerRadius:B=l.outerRadius}=t.attribute;B+=y,M-=m;const C=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=w?o:Vn(e,o,e.dpr),c=o/B,d="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:B+d*h,innerRadius:M-d*h,startAngle:b-d*c,endAngle:v+d*c}),e.beginPath(),Rl(t,e,i,s,B+d*h,M-d*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=x,e.setStrokeStyle(t,n,(_-i)/S,(A-s)/T,l[r]),l[r].opacity=a,e.stroke()}};g&&C(d,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:M,startAngle:b,endAngle:v})}},Qh=Zh,tc=$h,ec=st/2;function ic(t,e,i,s,n,r,a=!0,o){let l;if(Array.isArray(a)&&(o=a,a=!0),s<0&&(e+=s,s=-s),n<0&&(i+=n,n=-n),y(r,!0))l=[r=ot(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=ot(t[0]),l=[e,e,e,e];break;case 2:case 3:e=ot(t[0]),i=ot(t[1]),l=[e,i,e,i];break;default:l=t,l[0]=ot(l[0]),l[1]=ot(l[1]),l[2]=ot(l[2]),l[3]=ot(l[3])}}else l=[0,0,0,0];if(s<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,i,s,n);const[h,c,u,d]=[[e,i],[e+s,i],[e+s,i+n],[e,i+n]],p=Math.min(s/2,n/2),g=[Math.min(p,l[0]),Math.min(p,l[1]),Math.min(p,l[2]),Math.min(p,l[3])],f=[h[0]+g[0],h[1]],m=[h[0],h[1]+g[0]],b=[c[0]-g[1],c[1]],v=[c[0],c[1]+g[1]],x=[u[0]-g[2],u[1]],_=[u[0],u[1]-g[2]],A=[d[0]+g[3],d[1]],S=[d[0],d[1]-g[3]];if(t.moveTo(f[0],f[1]),a){if(o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),!N(b,v)){o&&o[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+g[1];t.arc(e,i,g[1],-ec,0,!1)}if(o&&o[1]?o[1](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!N(x,_)){const e=_[0]-g[2],i=_[1];o&&o[1]&&t.moveTo(_[0],_[1]),t.arc(e,i,g[2],0,ec,!1)}if(o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),!N(A,S)){const e=A[0],i=A[1]-g[3];o&&o[2]&&t.moveTo(A[0],A[1]),t.arc(e,i,g[3],ec,st,!1)}if(o&&o[3]?o[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!N(f,m)){const e=f[0],i=f[1]+g[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],st,st+ec,!1)}}else o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),o&&o[1]?o[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),o&&o[2]?o[2](A[0],A[1],f[0],f[1]):t.lineTo(f[0],f[1]);return!o&&t.closePath(),t}var sc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class nc{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,m=p&&!1!==p.visible;if(!f&&!m)return;const{cornerRadius:y=l.cornerRadius,cornerType:b=l.cornerType,opacity:v=l.opacity,x:x=l.x,y:_=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY,x1:T,y1:w,keepStrokeScale:M=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:T-i)||0,C=(null!=C?C:w-s)||0;const k=(n,r)=>{const a=!(!n||!n.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=n,c=M?h:Vn(e,h,e.dpr),d=i+o*c,p=s+o*c,f=2*c;if(0===y||g(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(d,p,B-o*f,C-o*f)):(e.beginPath(),ic(e,d,p,B-o*f,C-o*f,y,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,n,(x-i)/A,(_-s)/S,l[r]),l[r].opacity=a,e.stroke()}};f&&k(d,"outerBorder"),m&&k(p,"innerBorder")}}let rc=class{constructor(){this.time=Ms.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}};rc=sc([Ii()],rc);let ac=class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const{x1:d,y1:p,x:f=l.x,y:m=l.y,stroke:y=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:v=l.cornerType}=t.attribute;let{width:x,height:_}=t.attribute;if(x=(null!=x?x:d-f)||0,_=(null!=_?_:p-m)||0,Array.isArray(y)&&y.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,s,l),!(0===b||g(b)&&b.every((t=>0===t)))){let n,r=0;return ic(e,i,s,x,_,b,"bevel"!==v,new Array(4).fill(0).map(((a,o)=>(a,h,c,u)=>{y[o]&&(r===o-1&&y[o]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:y[o]}),i,s,l),e.beginPath(),e.moveTo(a,h),n=y[o]),r=o,e.lineTo(c,u),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),y[0]?e.lineTo(i+x,s):e.moveTo(i+x,s),y[1]?e.lineTo(i+x,s+_):e.moveTo(i+x,s+_),y[2]?e.lineTo(i,s+_):e.moveTo(i,s+_),y[3]){const t=y[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};ac=sc([Ii()],ac);const oc=new nc,lc=Zh,hc=$h;const cc=new class extends nc{constructor(){super(...arguments),this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){return super.drawShape(t,e,i,s,n,r,a,o,l,h,c,u)}},uc=$h;const dc=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=S?o:Vn(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===d.drawOffset(e,y,i,s,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(v-i)/_,(x-s)/A,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},pc=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:y=l.size,scaleX:b=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,y,i,s,p,m,((n,r)=>{var a,h,c,d;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(d=r.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,r=e}r.stroke&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/b,(f-s)/v,l),e.stroke()))})),r&&!x.isSvg&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/b,(f-s)/v,l),e.stroke())))}},gc=Zh,fc=$h,mc={x:0,y:0,z:0,lastModelMatrix:null};class yc{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(qh),this.builtinContributions.push(Kh),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===Ms.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ms.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d)}))}drawPathProxy(t,e,i,s,n,r,a,o){if(!t.pathProxy)return!1;const l=Nr(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=Ml(u,d,h),v=Cl(u,g),x=Tl(h),_=wl(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return Ps(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,x,_,b,v,l,n,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-m,s-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,s-y,l),e.fill())),this.afterRenderStep(t,e,i,s,x,_,b,v,l,n,a,o),!0}valid(t,e,i,s){const{fill:n=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Ml(o,l,n),p=Cl(o,c),g=Tl(n,r),f=wl(a,h);return!(!t.valid||!u)&&!(!g&&!f)&&!!(d||p||i||s||r)&&{fVisible:d,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i,s=!1){const{x:n=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;mc.x=n,mc.y=r,mc.z=a,mc.lastModelMatrix=u;const p=d&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const s=Zo.allocate(),n=Zo.allocate();Hl(n,t,e),$o(s,u||s,n),mc.x=0,mc.y=0,mc.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Zo.free(n)}if(g&&!u){const s=t.getOffsetXY(e);mc.x+=s.x,mc.y+=s.y,mc.z=a,i.setTransformForCurrent()}else if(p)mc.x=0,mc.y=0,mc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const s=t.getOffsetXY(e);mc.x+=s.x,mc.y+=s.y,this.transformWithoutTranslate(i,mc.x,mc.y,mc.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),mc.x=0,mc.y=0,mc.z=0;return mc}transformUseContext2d(t,e,i,s){const n=s.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,a=s.project(0,0,i),o=s.project(n,0,i),l=s.project(n,r,i),h={x:0,y:0},c={x:n,y:0},u={x:n,y:r};s.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+u.y*o.x+(c.y-u.y)*a.x)*d,g=(c.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-c.y)*a.y)*d,f=(h.x*(l.x-o.x)-c.x*l.x+u.x*o.x+(c.x-u.x)*a.x)*d,m=-(c.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-c.x)*a.y)*d,y=(h.x*(u.y*o.x-c.y*l.x)+h.y*(c.x*l.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,b=(h.x*(u.y*o.y-c.y*l.y)+h.y*(c.x*l.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;s.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,n,r,a){const o=t.project(e,i,s);t.translate(o.x,o.y,!1),t.scale(n,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,n,r){const{context:a}=s;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawPathProxy(t,a,h,c,s,n)||(this.drawShape(t,a,h,c,s,n,null,null,r),this.z=0,a.modelMatrix!==d&&Zo.free(a.modelMatrix),a.modelMatrix=d),a.highPerformanceRestore()}}var bc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},vc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xc=function(t,e){return function(i,s){e(i,s,t)}};let _c=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Bo,this.builtinContributions=[Jh,tc,Qh],this.init(t)}drawArcTailCapPath(t,e,i,s,n,r,a,o){const l=o-a,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=o;const d=u>c;let p=!1;if(n<r){const t=n;n=r,r=t}const{outerDeltaAngle:g,xors:f,yors:m,xirs:y,yirs:b,limitedOcr:v,outerCornerRadiusStart:x,outerCornerRadiusEnd:_,maxOuterCornerRadius:A,xore:S,yore:T,xire:w,yire:M,limitedIcr:B,innerDeltaAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,c,u,r,n);if(v>it){const t=ut(x,v),r=ut(_,v),a=Pl(y,b,f,m,n,t,Number(d)),o=Pl(S,T,w,M,n,r,Number(d));if(v<A&&t===r)e.moveTo(i+a.cx+a.x01,s+a.cy+a.y01),e.arc(i+a.cx,s+a.cy,v,lt(a.y01,a.x01),lt(o.y01,o.x01),!d);else{const t=u-l-.03,a=lt(o.y11,o.x11);e.arc(i,s,n,t,a,!d),r>0&&e.arc(i+o.cx,s+o.cy,r,lt(o.y11,o.x11),lt(o.y01,o.x01),!d)}}else e.moveTo(i+f,s+m);if(!(r>it)||C<.001)e.lineTo(i+w,s+M),p=!0;else if(B>it){const t=ut(P,B),n=ut(O,B),a=Pl(w,M,S,T,r,-n,Number(d)),o=Pl(f,m,y,b,r,-t,Number(d));if(e.lineTo(i+a.cx+a.x01,s+a.cy+a.y01),B<R&&t===n){const t=lt(o.y01,o.x01);e.arc(i+a.cx,s+a.cy,B,lt(a.y01,a.x01),t,!d)}else{n>0&&e.arc(i+a.cx,s+a.cy,n,lt(a.y01,a.x01),lt(a.y11,a.x11),!d);const t=lt(a.cy+a.y11,a.cx+a.x11),o=u-l-.03;e.arc(i,s,r,t,o,d)}}else e.lineTo(i+r*ht(k),s+r*dt(k));return p}drawShape(t,e,i,s,n,r,o,l,h){h=null!=h?h:Nr(t,null==r?void 0:r.theme).arc;const{fill:c=h.fill,stroke:u=h.stroke,x:d=h.x,y:p=h.y,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,o,l);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f,{outerPadding:x=h.outerPadding,innerPadding:_=h.innerPadding,cap:A=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:T=h.outerRadius,innerRadius:w=h.innerRadius}=t.attribute;T+=x,w-=_;let M=0;const B=(a(A)&&A||A[0])&&"conical"===c.gradient;if(B){const{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();ot(s-i)<at-it&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let C=!1;const{isFullStroke:k,stroke:P}=(t=>{var e;let i=!0;if(a(t,!0)){for(let s=0;s<4;s++)qr[s]=t,i&&(i=!(null!==(e=qr[s])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)qr[e]=!!t[e],i&&(i=!!qr[e]);else qr[0]=!1,qr[1]=!1,qr[2]=!1,qr[3]=!1;return{isFullStroke:i,stroke:qr}})(u);if((b||k)&&(e.beginPath(),Rl(t,e,i,s,T,w),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,b,v,m,y,h,n,o,l),g?(this._runStroke(t,e,i,s,h,v,k,y,l),this._runFill(t,e,i,s,h,b,m,d,p,o)):(this._runFill(t,e,i,s,h,b,m,d,p,o),this._runStroke(t,e,i,s,h,v,k,y,l))),!k&&v&&(e.beginPath(),Rl(t,e,i,s,T,w,P),C||this.beforeRenderStep(t,e,i,s,b,v,m,y,h,n,o,l),l?l(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),(a(A)&&A||A[1])&&S){const{startAngle:r,endAngle:a}=t.getParsedAngle();if(ot(a-r)>=at-it){e.beginPath();const r=Math.abs(T-w)/2/T,{endAngle:a=h.endAngle,fill:c=h.fill}=t.attribute,u=a;this.drawArcTailCapPath(t,e,i,s,T,w,u,u+r),C||this.beforeRenderStep(t,e,i,s,b,v,m,y,h,n,o,l);const d=()=>{if(b){const n=c;if("conical"===n.gradient){const r=function(t,e,i,s){const{stops:n,startAngle:r,endAngle:a}=s;for(;i<0;)i+=at;for(;i>at;)i-=at;if(i<r)return n[0].color;if(i>a)return n[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t<n.length;t++)if(n[t].offset>=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),al(o.color,l.color,h,!1)}(0,0,a,n);o||Ml&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=r,e.fill())}}},p=()=>{v&&(l||y&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))};d(),p()}}this.afterRenderStep(t,e,i,s,b,v,m,y,h,n,o,l),B&&(c.startAngle+=M,c.endAngle+=M)}_runFill(t,e,i,s,n,r,a,o,l,h){r&&(h?h(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l){r&&a&&(l||o&&(e.setStrokeStyle(t,t.attribute,i,s,n),e.stroke()))}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s,n)}};function Ac(t,e,i,s){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,a):t.lineTo(n+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[s]=Fs(e,i);t.bezierCurveTo(n+s.p1.x,r+s.p1.y,n+s.p2.x,r+s.p2.y,n+s.p3.x,r+s.p3.y,a)}else{const s=e.getPointAt(i);t.lineTo(n+s.x,r+s.y,a)}}function Sc(t,e,i,s,n,r,a){var o;let l=e.p0,h=s;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)s||(t.lineTo(l.x+n,l.y+r,a),h=!s);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=l:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+n,o+r,a)}else d&&(h=!s,t.lineTo(d.x+n,d.y+r,a))}return h}_c=bc([Ii(),xc(0,Li(Zi)),xc(0,Di(Ll)),vc("design:paramtypes",[Object])],_c);var Tc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let wc=class extends yc{constructor(){super(...arguments),this.numberType=Ro}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).line;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,c,u,d,p,f){var m;if(!e)return;t.beginPath();(function(t,e,i,s,n){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=n||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:u}=e;if(i>=1){if(h){let e,i=!0;u.forEach(((s,n)=>{s.originP1!==s.originP2?(i=Sc(t,s,e,i,r,a,o),e=s):e=s}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),Ac(t,e,1,n),c=!1):c=!0}));return}if(i<=0)return;let d;"x"===s?d=Ts.ROW:"y"===s?d=Ts.COLUMN:"auto"===s&&(d=e.direction);const p=i*e.tryUpdateLength(d);let g=0,f=!0,m=null;for(let e=0,i=u.length;e<i;e++){const i=u[e],s=i.getLength(d),l=(p-g)/s;if(g+=s,l<0)break;if(h){if(i.originP1===i.originP2){m=i;continue}f=Sc(t,i,m,f,r,a,o),m=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+a,o),Ac(t,i,ut(l,1),n),c=!1}}})(t,e,l,h,{offsetX:c,offsetY:u,offsetZ:null!==(m=this.z)&&void 0!==m?m:0}),d.cache&&!g(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:y=0,x:b=0}=a;return!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(d,a,y-c,b-u,o),t.fill())),!1!==s&&(f?f(t,a,o):r&&(t.setStrokeStyle(d,a,y-c,b-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,c,u,d){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==s&&(d?d(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,i,s,n,r,a,o){const l=Nr(t,null==r?void 0:r.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=l.curveTension,connectedType:y=l.connectedType}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:b=l.curveType}=t.attribute;f&&"linear"===b&&(b="linearClosed");const{clipRange:v=l.clipRange,clipRangeByDimension:x=l.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some((t=>!1===t.defined))&&"linear"===b)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,s,l,n,r,a,o);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,s=e;if(i&&i.length){let e,s;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(s={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:s.endX,y:s.endY,defined:s.curves[s.curves.length-1].defined}:i>1&&(e.x=s.endX,e.y=s.endY,e.defined=s.curves[s.curves.length-1].defined);const n=mn(_(t.points,y),b,{startPoint:e,curveTension:m});return s=n,n})).filter((t=>!!t)),"linearClosed"===b){let e;for(let i=0;i<t.cache.length;i++){const s=t.cache[i];for(let t=0;t<s.curves.length;t++)if(s.curves[t].defined){e=s.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=mn(_(s,y),b,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const n=t.attribute.segments.filter((t=>t.points.length));if(1===n[0].points.length&&n.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,u,d,n[g],[l,t.attribute],v,x,i,s,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const y=r.getLength(),b=(p-g)/y;g+=y,b>0&&(f=this.drawSegmentItem(e,r,!!h,!!c,u,d,n[m],[l,t.attribute],ut(b,1),x,i,s,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,v,x,i,s,t,a,o)}};wc=Tc([Ii()],wc);var Mc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cc=function(t,e){return function(i,s){e(i,s,t)}};let kc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=Do,this.builtinContributions=[oc,hc,lc],this.init(t)}drawShape(t,e,i,s,n,r,a,o,l){l=null!=l?l:Nr(t,null==r?void 0:r.theme).rect;const{fill:h=l.fill,background:c,stroke:u=l.stroke,cornerRadius:d=l.cornerRadius,cornerType:p=l.cornerType,opacity:f=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:v=l.visible,x1:x,y1:_,x:A=l.x,y:S=l.y,fillStrokeOrder:T=l.fillStrokeOrder}=t.attribute;let{width:w,height:M}=t.attribute;w=(null!=w?w:x-A)||0,M=(null!=M?M:_-S)||0;const B=Bl(f,m,w,M,h),C=kl(f,b,w,M),k=Tl(h,c),P=wl(u,y);if(!t.valid||!v)return;if(!k&&!P)return;if(!(B||C||a||o||c))return;0===d||g(d)&&d.every((t=>0===t))?(e.beginPath(),e.rect(i,s,w,M)):(e.beginPath(),ic(e,i,s,w,M,d,"bevel"!==p));const O={doFill:k,doStroke:P};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,k,P,B,C,l,n,a,o,O),T?(this._runStroke(t,e,i,s,l,O,C,A,S,o),this._runFill(t,e,i,s,l,O,B,A,S,a)):(this._runFill(t,e,i,s,l,O,B,A,S,a),this._runStroke(t,e,i,s,l,O,C,A,S,o)),this.afterRenderStep(t,e,i,s,k,P,B,C,l,n,a,o)}_runFill(t,e,i,s,n,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,n):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-s,n),e.stroke()))}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).rect;this._draw(t,n,!1,i,s,n)}};kc=Mc([Ii(),Cc(0,Li(Zi)),Cc(0,Di(Dl)),Bc("design:paramtypes",[Object])],kc);var Pc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Oc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rc=function(t,e){return function(i,s){e(i,s,t)}};let Lc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Uo,this.builtinContributions=[dc,fc,gc,pc],this.init(t)}drawShape(t,e,i,s,n,r,a,o,l){var h;l=null!=l?l:Nr(t,null==r?void 0:r.theme).symbol;const{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY,fillStrokeOrder:m=l.fillStrokeOrder,clipRange:y=l.clipRange}=t.attribute,b=this.valid(t,l,a,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=l.keepDirIn3d}=t.attribute,w=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();let M=i,B=s,C=w;const k=e.camera;if(T&&k&&e.project){const t=e.project(i,s,w);e.camera=null,g(c)&&(c[0],c[1]),M=t.x,B=t.y,C=void 0}!1===S.draw(e,c,M,B,C,((n,r)=>{var h,c,g,b;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(h=r.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=r.stroke)&&void 0!==g?g:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,r,u-i,d-s,l),e.fill()))},_=()=>{r.stroke&&(o?o(e,t.attribute,l):x&&y>=1&&(e.setStrokeStyle(t,r,(u-i)/p,(d-s)/f,l),e.stroke()))};m?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,A,v,x,l,n,a,o),m?(this._runStroke(t,e,i,s,l,A,x,u,d,S,y,p,f,o),this._runFill(t,e,i,s,l,_,v,u,d,S,a)):(this._runFill(t,e,i,s,l,_,v,u,d,S,a),this._runStroke(t,e,i,s,l,A,x,u,d,S,y,p,f,o)),this.afterRenderStep(t,e,i,s,_,A,v,x,l,n,a,o)}_runFill(t,e,i,s,n,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l,h,c,u,d,p){r&&!h.isSvg&&(p?p(e,t.attribute,n):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/u,(l-s)/d,n),e.stroke()))}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Lc=Pc([Ii(),Rc(0,Li(Zi)),Rc(0,Di(Fl)),Oc("design:paramtypes",[Object])],Lc);const Ec=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Xt)}allocate(t,e,i,s){if(!this.pools.length)return(new Xt).setValue(t,e,i,s);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}allocateByObj(t){if(!this.pools.length)return new Xt(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(...t){this.pools=[]}};const Ic=new class extends Xh{constructor(){super(...arguments),this.time=Ms.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,u,d){var p,g,f,m,y,b,v,x,_,A;const{backgroundMode:S=l.backgroundMode,backgroundFit:T=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let M,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),M&&e.setTransformFromMatrix(M,!0,1))};let k;"richtext"===t.type&&(M=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=c(B)&&B.background,O=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(p=B.x)&&void 0!==p?p:e.x1)+(null!==(g=B.dx)&&void 0!==g?g:0),s=(null!==(f=B.y)&&void 0!==f?f:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),n=null!==(y=B.width)&&void 0!==y?y:e.width(),r=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Ec.allocate(i,s,i+n,s+r),B=B.background,!O){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,O||(k=zh(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const n=t.resources.get(B);if("success"!==n.state||!n.data)return void C();e.highPerformanceSave(),O&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,s,l),this.doDrawImage(e,n.data,k,{backgroundMode:S,backgroundFit:T,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=B,n?(ic(e,k.x1,k.y1,k.width(),k.height(),n,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}P&&Ec.free(k),C()}};var Dc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jc=function(t,e){return function(i,s){e(i,s,t)}};let Uc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=No,this.builtinContributions=[Ic],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,c;const u=Nr(t,null==r?void 0:r.theme).text,{text:d,underline:p=u.underline,lineThrough:g=u.lineThrough,keepDirIn3d:f=u.keepDirIn3d,direction:m=u.direction,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:v=u.x,y:x=u.y}=t.attribute,_=null!==(l=sa(t.attribute.lineHeight,y))&&void 0!==l?l:y,A=this.valid(t,u,a,o);if(!A)return;const{fVisible:S,sVisible:T,doFill:w,doStroke:M}=A,B=!f,C=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,s,w,M,S,T,u,n,a,o),B&&this.transformUseContext2d(t,u,C,e);const k=(n,r,l,h)=>{let c=i+r;const d=s+l;if(h){e.highPerformanceSave(),c+=y;const t=Ko.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Ko.free(t)}M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-s,u),e.strokeText(n,c,d,C))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-s,u),e.fillText(n,c,d,C))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,C),"horizontal"===m){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=n.bbox;M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-s,u),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+s,C)})))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-s,u),n.lines.forEach((n=>{e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,C),this.drawUnderLine(p,g,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,n.descent,(n.descent-n.ascent)/2,C,u,e,{width:n.width})}))))}else{let{textAlign:i=u.textAlign,textBaseline:s=u.textBaseline}=t.attribute;if(!b){const e=i;i=null!==(h=t.getBaselineMapAlign()[s])&&void 0!==h?h:"left",s=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const n=t.cache,{verticalList:r}=n;e.textAlign="left",e.textBaseline="top";const a=_*r.length;let o=0;r.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=ct(e,o)}));let l=0,d=0;"bottom"===s?d=-a:"middle"===s&&(d=-a/2),"center"===i?l-=o/2:"right"===i&&(l-=o),r.forEach(((t,e)=>{const s=t.reduce(((t,e)=>t+(e.width||0)),0),n=o-s;let r=l;"center"===i?r+=n/2:"right"===i&&(r+=n),t.forEach((t=>{const{text:i,width:s,direction:n}=t;k(i,a-(e+1)*_+d,r,n),r+=s}))}))}B&&this.restoreTransformUseContext2d(t,u,C,e),this.afterRenderStep(t,e,i,s,w,M,S,T,u,n,a,o)}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,a=!r;this._draw(t,n,a,i,s)}drawUnderLine(t,e,i,s,n,r,a,o,h,c,u){if(e+t<=0)return;const{textAlign:d=h.textAlign,fill:p=h.fill,opacity:g=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:m=h.underlineDash,fillOpacity:y=h.fillOpacity}=i.attribute,b=!l(u),v=b?u.width:i.clipedWidth,x=b?0:Nl(d,v),_={lineWidth:0,stroke:p,opacity:g,strokeOpacity:y};if(t){_.lineWidth=t,c.setStrokeStyle(i,_,s,n,h),m&&c.setLineDash(m),c.beginPath();const e=n+r+f;c.moveTo(s+x,e,o),c.lineTo(s+x+v,e,o),c.stroke()}if(e){_.lineWidth=e,c.setStrokeStyle(i,_,s,n,h),c.beginPath();const t=n+a;c.moveTo(s+x,t,o),c.lineTo(s+x+v,t,o),c.stroke()}}};function Nc(t,e,i,s){if(e&&e.length){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n<e.length;n++)t.lineTo(e[n].x+i,e[n].y+s)}}function Wc(t,e){return Math.sqrt(t*t+e*e)}function zc(t,e,i,s,n){const r=e/i;return{x:t.x-s*r,y:t.y-n*r}}Uc=Dc([Ii(),jc(0,Li(Zi)),jc(0,Di(jl)),Fc("design:paramtypes",[Object])],Uc);const Gc=Zh,Vc=$h;var Hc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$c=function(t,e){return function(i,s){e(i,s,t)}};let Yc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Eo,this.builtinContributions=[Vc,Gc],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Nr(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath,fillStrokeOrder:f=l.fillStrokeOrder}=t.attribute,m=this.valid(t,l,a,o);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),c<=0||g(c)&&c.every((t=>0===t))?Nc(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,n,r=!0){var a;if(e.length<3)return void Nc(t,e,i,s);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+s));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],u=h.x-o.x,d=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(d,u)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,b=y/m;const v=Wc(u,d),x=Wc(p,g),_=Math.min(v,x);b>_&&(b=_,y=_*m);const A=zc(h,b,v,u,d),S=zc(h,b,x,p,g),T=2*h.x-A.x-S.x,w=2*h.y-A.y-S.y,M=Wc(T,w),B=zc(h,Wc(b,y),M,T,w);let C=Math.atan2(A.y-B.y,A.x-B.x);const k=Math.atan2(S.y-B.y,S.x-B.x);let P=k-C;P<0&&(C=k,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(A.x+i,A.y+s):t.lineTo(A.x+i,A.y+s),P&&t.arcTo(h.x+i,h.y+s,S.x+i,S.y+s,y),t.lineTo(S.x+i,S.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,v,x,y,b,l,n,a,o);const _=()=>{v&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,u-i,d-s,l),e.fill()))},A=()=>{x&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,u-i,d-s,l),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,i,s,v,x,y,b,l,n,a,o)}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};Yc=Hc([Ii(),$c(0,Li(Zi)),$c(0,Di(Il)),Xc("design:paramtypes",[Object])],Yc);var qc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zc=function(t,e){return function(i,s){e(i,s,t)}};const Jc=["","repeat-x","repeat-y","repeat"];let Qc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Oo,this.builtinContributions=[cc,uc],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Nr(t).image,{repeatX:h=l.repeatX,repeatY:c=l.repeatY,x:u=l.x,y:d=l.y,cornerRadius:p=l.cornerRadius,fillStrokeOrder:f=l.fillStrokeOrder,cornerType:m=l.cornerType,image:y}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b;if(!y||!t.resources)return;const S=t.resources.get(y);if("success"!==S.state)return;const T=t.width,w=t.height;e.beginPath();let M=!1;0===p||g(p)&&p.every((t=>0===t))?e.rect(i,s,T,w):(ic(e,i,s,T,w,p,"bevel"!==m),M=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(_)if(a)a(e,t.attribute,l);else if(v){e.setCommonStyle(t,t.attribute,i,s,l);let n=0;if("repeat"===h&&(n|=1),"repeat"===c&&(n|=2),n){const t=e.createPattern(S.data,Jc[n]);e.fillStyle=t,e.translate(i,s,!0),e.fillRect(0,0,T,w),e.translate(-i,-s,!0)}else e.drawImage(S.data,i,s,T,w)}},C=()=>{A&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,u-i,d-s,l),e.stroke()))};f?(C(),M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,_,!1,v,!1,l,n,a),B(),M&&e.restore()):(M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,_,!1,v,!1,l,n,a),B(),M&&e.restore(),C()),this.afterRenderStep(t,e,i,s,_,!1,v,!1,l,n,a)}draw(t,e,i){const{image:s}=t.attribute;if(!s||!t.resources)return;const n=t.resources.get(s);if("loading"===n.state&&p(s))return void Xr.improveImageLoading(s);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const a=Nr(t).image;this._draw(t,a,!1,i)}};Qc=qc([Ii(),Zc(0,Li(Zi)),Zc(0,Di(El)),Kc("design:paramtypes",[Object])],Qc);const tu=Symbol.for("ArcRender"),eu=Symbol.for("Arc3dRender"),iu=Symbol.for("GraphicRender"),su=Symbol.for("LineRender"),nu=Symbol.for("PolygonRender"),ru=Symbol.for("RectRender"),au=Symbol.for("Rect3DRender"),ou=Symbol.for("SymbolRender"),lu=Symbol.for("TextRender"),hu=Symbol.for("RichTextRender"),cu=Symbol.for("Pyramid3dRender"),uu=Symbol.for("ImageRender");var du=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let pu,gu=class extends wc{constructor(){super(...arguments),this.numberType=Ro}drawShape(t,e,i,s,n,r,a,o){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Nr(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=Ml(d,p,c),b=Cl(d,g),v=Tl(c),x=wl(u,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:_}=n;for(let n=e;n<e+r;n++)this.drawIncreaseSegment(t,_,l[n-1],l[n],t.attribute.segments[n],[h,t.attribute],i,s)}else super.drawShape(t,e,i,s,n,r,a,o)}drawIncreaseSegment(t,e,i,s,n,r,a,o){s&&(e.beginPath(),function(t,e,i,s){const{offsetX:n=0,offsetY:r=0}=s||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+n,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,a,o,r),e.stroke())}};gu=du([Ii()],gu);class fu{static registerPlugin(t,e){fu._pluginClasses[t]=e}static getPlugin(t){return fu._pluginClasses[t]}}fu._pluginClasses={};class mu{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=nl.Get(e,sl.Color1),this.ambient=i;const s=pt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/s,t[1]/s,t[2]/s]}computeColor(t,e){const i=this.formatedDir,s=ut(ct((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let n;n=p(e)?nl.Get(e,sl.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*n[0]*s}, ${r[1]*n[1]*s}, ${r[2]*n[2]*s})`}}const yu=()=>{fu.registerPlugin("DirectionalLight",mu)};class bu{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,s){let n,r,a,o,l,h,c,u,d,p;const g=e[0],f=e[1],m=e[2],y=s[0],b=s[1],v=s[2],x=i[0],_=i[1],A=i[2];Math.abs(g-x)<it&&Math.abs(f-_)<it&&Math.abs(m-A)<it?Ho(t):(c=g-x,u=f-_,d=m-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,n=b*d-v*u,r=v*c-y*d,a=y*u-b*c,p=Math.hypot(n,r,a),p?(p=1/p,n*=p,r*=p,a*=p):(n=0,r=0,a=0),o=u*a-d*r,l=d*n-c*a,h=c*r-u*n,p=Math.hypot(o,l,h),p?(p=1/p,o*=p,l*=p,h*=p):(o=0,l=0,h=0),t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=r,t[5]=l,t[6]=u,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(n*g+r*f+a*m),t[13]=-(o*g+l*f+h*m),t[14]=-(c*g+u*f+d*m),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate());const{left:t,top:e,right:i,bottom:s}=this._params;return function(t,e,i,s,n,r,a){const o=1/(e-i),l=1/(s-n),h=1/(r-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*o,t[13]=(n+s)*l,t[14]=(a+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,s,e,0,-2e6),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:s}=this._params;return(null!=e?e:s-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const s=[0,0,0];return Yo(s,[t,e,i],this._viewMatrixCached),s}vp(t,e,i){const s=[0,0,0],{pos:n}=this._params.viewParams;Yo(s,[t,e,i],this._viewMatrixCached),t=s[0],e=s[1],i=s[2];const r=this.getProjectionScale(i);return{x:t*r+n[0],y:e*r+n[1]}}}const vu=()=>{fu.registerPlugin("OrthoCamera",bu)};let xu=!1;const _u=new Ti((t=>{xu||(xu=!0,t(_c).toSelf().inSingletonScope(),t(tu).to(_c).inSingletonScope(),t(iu).toService(tu),t(Ll).toService(Yh),Qi(t,Ll))}));let Au=!1;const Su=new Ti((t=>{Au||(Au=!0,t(kc).toSelf().inSingletonScope(),t(ru).to(kc).inSingletonScope(),t(iu).toService(ru),t(ac).toSelf(),t(rc).toSelf(),t(Dl).toService(ac),t(Dl).toService(rc),t(Dl).toService(Yh),Qi(t,Dl))}));let Tu=!1;const wu=new Ti((t=>{Tu||(Tu=!0,t(wc).toSelf().inSingletonScope(),t(gu).toSelf().inSingletonScope(),t(su).to(wc).inSingletonScope(),t(iu).toService(su))}));let Mu=!1;const Bu=new Ti((t=>{Mu||(Mu=!0,t(Lc).toSelf().inSingletonScope(),t(ou).to(Lc).inSingletonScope(),t(iu).toService(ou),t(Fl).toService(Yh),Qi(t,Fl))}));let Cu=!1;const ku=new Ti((t=>{Cu||(Cu=!0,t(lu).to(Uc).inSingletonScope(),t(iu).toService(lu),t(jl).toService(Yh),Qi(t,jl))}));let Pu=!1;const Ou=new Ti((t=>{Pu||(Pu=!0,t(nu).to(Yc).inSingletonScope(),t(iu).toService(nu),t(Il).toService(Yh),Qi(t,Il))}));var Ru=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Lu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Eu=class extends yc{constructor(){super(),this.numberType=jo,this.builtinContributions=[Ic],this.init()}drawShape(t,e,i,s,n){const r=Nr(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const c=Ml(o,l,!0),u=Ml(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,r),e.translate(i,s),this.beforeRenderStep(t,e,i,s,c,u,c,u,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,s,c,u,c,u,r,n))}drawIcon(t,e,i,s,n){var r;const a=Nr(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=l}=t.attribute;if(m&&(i+=t._marginArray[3],s+=t._marginArray[0]),t._hovered){const t=(y-o)/2,n=(b-l)/2;0===f?(e.beginPath(),e.rect(i-t,s-n,y,b)):(e.beginPath(),ic(e,i-t,s-n,y,b,f,!0)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(c));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,s,o,l))}draw(t,e,i){const s=Nr(t).richtext;this._draw(t,s,!1,i)}};Eu=Ru([Ii(),Lu("design:paramtypes",[])],Eu);let Iu=!1;const Du=new Ti((t=>{Iu||(Iu=!0,t(hu).to(Eu).inSingletonScope(),t(iu).toService(hu))}));let Fu=!1;const ju=new Ti((t=>{Fu||(Fu=!0,t(uu).to(Qc).inSingletonScope(),t(iu).toService(uu),t(El).toService(Yh),Qi(t,El))}));class Uu extends yc{stroke(t,e,i,s,n){const r=s.vertices;s.edges.forEach((s=>{const a=r[s[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[s[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};n.beginPath(),n.moveTo(o.x,o.y,o.z),n.lineTo(h.x,h.y,h.z),n.stroke()}))}fill(t,e,i,s,n,r,a,o,l,h,c){const u=nl.Get(r,sl.Color255),d=s.vertices,p=d.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];s.polygons.forEach(((t,e)=>{if(n&&!n[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,s=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=s+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((s=>{const{polygon:n,normal:p}=s.polygon,g=d[n[0]],f=d[n[1]],m=d[n[2]],y=d[n[3]],b={x:t+g[0],y:e+g[1],z:i+g[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),c?c(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,u):r,a.fill())}))}}var Nu=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Wu=class extends Uu{constructor(){super(...arguments),this.type="rect3d",this.numberType=Fo}drawShape(t,e,i,s,n,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).rect,{fill:c=h.fill,stroke:u=h.stroke,x1:d,y1:p,x:g,y:f,opacity:m=h.opacity,fillOpacity:y=h.fillOpacity,lineWidth:b=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:x=h.visible}=t.attribute;let{width:_,height:A}=t.attribute;_=(null!=_?_:d-g)||0,A=(null!=A?A:p-f)||0;const S=null!==(l=this.z)&&void 0!==l?l:0,T=Bl(m,y,_,A,c),w=kl(m,v,_,A),M=Tl(c),B=wl(u,b);if(!t.valid||!x)return;if(!M&&!B)return;if(!(T||w||a||o))return;const{light:C}=n.stage||{},k=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,s,h);let n=c;"string"!=typeof n&&(n="black"),this.fill(i,s,S,k,null,n,e,C,null,null,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,s,h),this.stroke(i,s,S,k,e))}draw(t,e,i){const s=Nr(t).rect;this._draw(t,s,!1,i)}};Wu=Nu([Ii()],Wu);let zu=!1;const Gu=new Ti((t=>{zu||(zu=!0,t(au).to(Wu).inSingletonScope(),t(iu).toService(au))}));var Vu=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Hu=class extends yc{constructor(){super(...arguments),this.numberType=Co}drawShape(t,e,i,s,n,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).arc,{fill:c=h.fill}=t.attribute,u=this.valid(t,h,a,o);if(!u)return;const{fVisible:d,sVisible:p,doFill:g,doStroke:f}=u,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:y=h.outerPadding,innerPadding:b=h.innerPadding,height:v=10}=t.attribute;let{outerRadius:x=h.outerRadius,innerRadius:_=h.innerRadius}=t.attribute;x+=y,_-=b;const A=nl.Get(c,sl.Color255),{light:S}=n.stage||{},T=n.hack_pieFace,w={top:m,bottom:m+v},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===T||"top"===T?(e.beginPath(),function(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(r<a){const t=r;r=a,a=t}if(r<=it)e.moveTo(i,s,n);else if(h>=at-it)e.moveTo(i+r*ht(o),s+r*dt(o),n),e.arc(i,s,r,o,l,!c,n),a>it&&(e.moveTo(i+a*ht(l),s+a*dt(l),n),e.arc(i,s,a,l,o,c,n));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:g,innerEndAngle:f,innerStartAngle:m}=t.getParsePadAngle(o,l),y=r*ht(p),b=r*dt(p),v=a*ht(f),x=a*dt(f);h<.001?u=!0:(e.moveTo(i+y,s+b,n),e.arc(i,s,r,p,g,!c,n)),!(a>it)||d<.001?(e.lineTo(i+v,s+x,n),u=!0):(e.lineTo(i+v,s+x,n),e.arc(i,s,a,f,m,c,n))}e.closePath()}(t,e,i,s,w[T],x,_),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))):"outside"!==T&&"inside"!==T||("inside"===T&&(e.save(),e.beginPath(),e.arc(i,s,_,0,at,!0,w.top),e.clip()),e.beginPath(),function(t,e,i,s,n,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=ot(h-l),u=h>l;let d=!1;if(a<=it)e.moveTo(i,s,n);else if(c>=at-it)e.moveTo(i+a*ht(l),s+a*dt(l),n),e.arc(i,s,a,l,h,!u,n),e.lineTo(i+a*ht(h),s+a*dt(h),r),e.arc(i,s,a,h,l,u,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=o(l,h),g=a*ht(c),f=a*dt(c),m=a*ht(p),y=a*dt(p);t<.001?d=!0:(e.moveTo(i+g,s+f,n),e.arc(i,s,a,c,p,!u,n),e.lineTo(i+m,s+y,r),e.arc(i,s,a,p,c,u,r))}e.closePath()}(t,e,i,s,w.top,w.bottom,"outside"===T?x:_,((e,i)=>{const{outerDeltaAngle:s,innerDeltaAngle:n,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===T?{innerouterDeltaAngle:s,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),"inside"===T&&e.restore())}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Hu=Vu([Ii()],Hu);let Xu=!1;const $u=new Ti((t=>{Xu||(Xu=!0,t(eu).to(Hu).inSingletonScope(),t(iu).toService(eu))}));var Yu=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let qu=class extends Uu{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Io}drawShape(t,e,i,s,n,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=n.stage||{},f=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,s,h);let n=c;"string"!=typeof n&&(n="black"),this.fill(i,s,p,f,d,n,e,g,t,h,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,s,h),this.stroke(i,s,p,f,e))}draw(t,e,i){const s=Nr(t).polygon;this._draw(t,s,!1,i)}};qu=Yu([Ii()],qu);let Ku=!1;const Zu=new Ti((t=>{Ku||(Ku=!0,t(cu).to(qu).inSingletonScope(),t(iu).toService(cu))}));class Ju{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Si.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const s=this.pluginService.stage;if(this.option3d||(this.option3d=s.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const n=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=n/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,s.set3dOptions(this.option3d),s.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const Qu=t=>t.zField||t.series&&t.series.some((t=>t.zField));class td extends e.BasePlugin{constructor(){super(td.type),this.type="VChart3dPlugin"}onInit(t,e){var i,s;if(this._is3d=!!(s=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(s.type)||Qu(s),!0),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&Qu(e)&&(e.layout={type:"layout3d"})}}td.pluginType="chart",td.type="VChart3dPlugin";const ed=()=>{e.registerChartPlugin(td),yu(),vu(),fu.registerPlugin("ViewTransform3dPlugin",Ju)},id={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class sd extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}const nd=Symbol.for("MathPickerContribution"),rd=Symbol.for("MathArcPicker"),ad=Symbol.for("MathImagePicker"),od=Symbol.for("MathLinePicker"),ld=Symbol.for("MathRectPicker"),hd=Symbol.for("MathSymbolPicker"),cd=Symbol.for("MathTextPicker"),ud=Symbol.for("MathPolygonPicker"),dd=Symbol.for("CanvasArcPicker"),pd=Symbol.for("CanvasArc3dPicker"),gd=Symbol.for("CanvasImagePicker"),fd=Symbol.for("CanvasLinePicker"),md=Symbol.for("CanvasRectPicker"),yd=Symbol.for("CanvasRect3dPicker"),bd=Symbol.for("CanvasSymbolPicker"),vd=Symbol.for("CanvasTextPicker"),xd=Symbol.for("CanvasPolygonPicker"),_d=Symbol.for("CanvasPyramid3dPicker"),Ad=Symbol.for("CanvasRichTextPicker"),Sd=Symbol.for("CanvasPickerContribution");class Td{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();let{x:r=n.x,y:a=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,a+=e.y,s.setTransformForCurrent()}else r=0,a=0,s.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,s,r,a,{},null,((t,i,s,n)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=n||l,o)),((t,i,n,r)=>{if(o||l)return!0;const a=i.lineWidth||n.lineWidth,h=i.pickStrokeBuffer||n.pickStrokeBuffer,c=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=c?a+h:Vn(s,a+h,s.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),s.highPerformanceRestore(),o}}var wd=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Md=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bd=function(t,e){return function(i,s){e(i,s,t)}};let Cd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};Cd=wd([Ii(),Bd(0,Li(tu)),Md("design:paramtypes",[Object])],Cd);let kd=!1;const Pd=new Ti(((t,e,i,s)=>{kd||(kd=!0,t(rd).to(Cd).inSingletonScope(),t(nd).toService(rd))}));var Od=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Rd=class{constructor(){this.type="image",this.numberType=Oo}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};Rd=Od([Ii()],Rd);let Ld=!1;const Ed=new Ti(((t,e,i,s)=>{Ld||(Ld=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var Id=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Dd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fd=function(t,e){return function(i,s){e(i,s,t)}};let jd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};jd=Id([Ii(),Fd(0,Li(su)),Dd("design:paramtypes",[Object])],jd);let Ud=!1;const Nd=new Ti(((t,e,i,s)=>{Ud||(Ud=!0,t(od).to(jd).inSingletonScope(),t(nd).toService(od))}));var Wd=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},zd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gd=function(t,e){return function(i,s){e(i,s,t)}};let Vd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Eo}};Vd=Wd([Ii(),Gd(0,Li(nu)),zd("design:paramtypes",[Object])],Vd);let Hd=!1;const Xd=new Ti(((t,e,i,s)=>{Hd||(Hd=!0,t(ud).to(Vd).inSingletonScope(),t(nd).toService(ud))})),$d=new Xt;class Yd{constructor(){this.type="rect",this.numberType=Do}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme(),{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:a=n.x,y:o=n.y}=t.attribute;s.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);a+=e.x,o+=e.y,s.setTransformForCurrent()}else a=0,o=0,l=!1,s.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||y(r,!0)&&0!==r||g(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,s,a,o,{},null,((t,i,s)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,n)=>{if(h)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer,o=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=o?r+a:Vn(s,r+a,s.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=n.fill,stroke:s=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)h=!0;else if(s){const i=t.AABBBounds;$d.setValue(i.x1,i.y1,i.x2,i.y2),$d.expand(-r/2),h=!$d.containsPoint(e)}}return s.highPerformanceRestore(),h}}var qd=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zd=function(t,e){return function(i,s){e(i,s,t)}};let Jd=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Jd=qd([Ii(),Zd(0,Li(ru)),Kd("design:paramtypes",[Object])],Jd);let Qd=!1;const tp=new Ti(((t,e,i,s)=>{Qd||(Qd=!0,t(ld).to(Jd).inSingletonScope(),t(nd).toService(ld))}));let ep=!1;const ip=new Ti(((t,e,i,s)=>{ep||(ep=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var sp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rp=function(t,e){return function(i,s){e(i,s,t)}};let ap=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}};ap=sp([Ii(),rp(0,Li(ou)),np("design:paramtypes",[Object])],ap);let op=!1;const lp=new Ti(((t,e,i,s)=>{op||(op=!0,t(hd).to(ap).inSingletonScope(),t(nd).toService(hd))}));var hp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let cp=class{constructor(){this.type="text",this.numberType=No}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};cp=hp([Ii()],cp);let up=!1;const dp=new Ti(((t,e,i,s)=>{up||(up=!0,t(cd).to(cp).inSingletonScope(),t(nd).toService(cd))}));var pp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},gp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fp=function(t,e){return function(i,s){e(i,s,t)}};let mp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};mp=pp([Ii(),fp(0,Li(tu)),gp("design:paramtypes",[Object])],mp);let yp=!1;const bp=new Ti(((t,e,i,s)=>{yp||(yp=!0,t(dd).to(mp).inSingletonScope(),t(Sd).toService(dd))}));var vp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_p=function(t,e){return function(i,s){e(i,s,t)}};let Ap=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Ap=vp([Ii(),_p(0,Li(ru)),xp("design:paramtypes",[Object])],Ap);let Sp=!1;const Tp=new Ti(((t,e,i,s)=>{Sp||(Sp=!0,t(md).to(Ap).inSingletonScope(),t(Sd).toService(md))}));class wp extends yc{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;s.highPerformanceSave();const n=t.getGraphicTheme(),r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(s.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return s.lineWidth=a?n+r:Vn(s,n+r,s.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Zo.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),u}}var Mp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cp=function(t,e){return function(i,s){e(i,s,t)}};let kp=class extends wp{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};kp=Mp([Ii(),Cp(0,Li(su)),Bp("design:paramtypes",[Object])],kp);let Pp=!1;const Op=new Ti(((t,e,i,s)=>{Pp||(Pp=!0,t(fd).to(kp).inSingletonScope(),t(Sd).toService(fd))}));class Rp extends yc{contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();const r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(s.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Zo.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),u}}var Lp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ep=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ip=function(t,e){return function(i,s){e(i,s,t)}};let Dp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getParsedPath();if(!s.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}s.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,s),{x:o,y:l,z:h,lastModelMatrix:c}=a;let u=e;if(s.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return s.lineWidth=a?n+r:Vn(s,n+r,s.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,s.modelMatrix!==c&&Zo.free(s.modelMatrix),s.modelMatrix=c,s.highPerformanceRestore(),d}};Dp=Lp([Ii(),Ip(0,Li(ou)),Ep("design:paramtypes",[Object])],Dp);let Fp=!1;const jp=new Ti(((t,e,i,s)=>{Fp||(Fp=!0,t(bd).to(Dp).inSingletonScope(),t(Sd).toService(bd))}));var Up=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wp=function(t,e){return function(i,s){e(i,s,t)}};let zp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=No}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.AABBBounds;if(!s.camera)return!!n.containsPoint(e);s.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,s,o),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let p=e;if(s.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,s,h,c,{},null,((e,i,s)=>{if(g)return!0;const{fontSize:n=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),f=l.width(),m=Wl(a,d,n),y=Nl(o,f);return e.rect(y+h,m+c,f,d,u),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,s.modelMatrix!==d&&Zo.free(s.modelMatrix),s.modelMatrix=d,s.highPerformanceRestore(),g}};zp=Up([Ii(),Wp(0,Li(lu)),Np("design:paramtypes",[Object])],zp);let Gp=!1;const Vp=new Ti(((t,e,i,s)=>{Gp||(Gp=!0,t(vd).to(zp).inSingletonScope(),t(Sd).toService(vd))}));var Hp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$p=function(t,e){return function(i,s){e(i,s,t)}};let Yp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Eo}};Yp=Hp([Ii(),$p(0,Li(nu)),Xp("design:paramtypes",[Object])],Yp);let qp=!1;const Kp=new Ti(((t,e,i,s)=>{qp||(qp=!0,t(xd).to(Yp).inSingletonScope(),t(Sd).toService(xd))}));var Zp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Jp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qp=function(t,e){return function(i,s){e(i,s,t)}};let tg=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=jo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};tg=Zp([Ii(),Qp(0,Li(hu)),Jp("design:paramtypes",[Object])],tg);let eg=!1;const ig=new Ti(((t,e,i,s)=>{eg||(eg=!0,t(Ad).to(tg).inSingletonScope(),t(Sd).toService(Ad))}));var sg=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ng=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rg=function(t,e){return function(i,s){e(i,s,t)}};let ag=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Oo}};ag=sg([Ii(),rg(0,Li(uu)),ng("design:paramtypes",[Object])],ag);let og=!1;const lg=new Ti(((t,e,i,s)=>{og||(og=!0,t(gd).to(ag).inSingletonScope(),t(Sd).toService(gd))}));var hg=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},cg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ug=function(t,e){return function(i,s){e(i,s,t)}};let dg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Fo,this.themeType="rect"}};dg=hg([Ii(),ug(0,Li(au)),cg("design:paramtypes",[Object])],dg);let pg=!1;const gg=new Ti(((t,e,i,s)=>{pg||(pg=!0,t(yd).to(dg).inSingletonScope(),t(Sd).toService(yd))}));var fg=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},mg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yg=function(t,e){return function(i,s){e(i,s,t)}};let bg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Co,this.themeType="arc"}};bg=fg([Ii(),yg(0,Li(eu)),mg("design:paramtypes",[Object])],bg);let vg=!1;const xg=new Ti(((t,e,i,s)=>{vg||(vg=!0,t(pd).to(bg).inSingletonScope(),t(Sd).toService(pd))}));var _g=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ag=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sg=function(t,e){return function(i,s){e(i,s,t)}};let Tg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Io,this.themeType="polygon"}};Tg=_g([Ii(),Sg(0,Li(cu)),Ag("design:paramtypes",[Object])],Tg);let wg=!1;const Mg=new Ti(((t,e,i,s)=>{wg||(wg=!0,t(_d).to(Tg).inSingletonScope(),t(Sd).toService(_d))})),Bg=function(){!function(){if(null==pu)try{const t=document.createElement("canvas"),e=t.getContext("2d");pu=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),pu&&(pu=!!document.createElement)}catch(t){pu=!1}}();const t=ss.global&&ss.global.env;return t?"browser"===t:pu}();function Cg(){Cg.__loaded||(Cg.__loaded=!0,Nh.RegisterGraphicCreator("arc",Ph),ir.load(_u),ir.load(Bg?bp:Pd))}Cg.__loaded=!1;const kg=Cg;function Pg(){Pg.__loaded||(Pg.__loaded=!0,Nh.RegisterGraphicCreator("arc3d",Rh),yu(),vu(),ir.load($u),ir.load(xg))}Pg.__loaded=!1;const Og=Pg;function Rg(){Rg.__loaded||(Rg.__loaded=!0,Nh.RegisterGraphicCreator("group",Sl))}Rg.__loaded=!1;const Lg=Rg;function Eg(){Eg.__loaded||(Eg.__loaded=!0,Nh.RegisterGraphicCreator("image",fh),ir.load(ju),ir.load(Bg?lg:Ed))}Eg.__loaded=!1;const Ig=Eg;function Dg(){Dg.__loaded||(Dg.__loaded=!0,Nh.RegisterGraphicCreator("line",sh),ir.load(wu),ir.load(Bg?Op:Nd))}Dg.__loaded=!1;const Fg=Dg;function jg(){jg.__loaded||(jg.__loaded=!0,Nh.RegisterGraphicCreator("polygon",Ih),ir.load(Ou),ir.load(Bg?Kp:Xd))}jg.__loaded=!1;const Ug=jg;function Ng(){Ng.__loaded||(Ng.__loaded=!0,Nh.RegisterGraphicCreator("pyramid3d",Fh),yu(),vu(),ir.load(Zu),ir.load(Mg))}Ng.__loaded=!1;const Wg=Ng;function zg(){zg.__loaded||(zg.__loaded=!0,Nh.RegisterGraphicCreator("rect",ah),ir.load(Su),ir.load(Bg?Tp:tp))}zg.__loaded=!1;const Gg=zg;function Vg(){Vg.__loaded||(Vg.__loaded=!0,Nh.RegisterGraphicCreator("rect3d",hh),ir.load(Gu),ir.load(gg))}Vg.__loaded=!1;const Hg=Vg;function Xg(){Xg.__loaded||(Xg.__loaded=!0,Nh.RegisterGraphicCreator("richtext",Ah),ir.load(Du),ir.load(Bg?ig:ip))}Xg.__loaded=!1;const $g=Xg;function Yg(){Yg.__loaded||(Yg.__loaded=!0,Nh.RegisterGraphicCreator("shadowRoot",Uh))}Yg.__loaded=!1;const qg=Yg;function Kg(){Kg.__loaded||(Kg.__loaded=!0,Nh.RegisterGraphicCreator("symbol",th),ir.load(Bu),ir.load(Bg?jp:lp))}Kg.__loaded=!1;const Zg=Kg;function Jg(){Jg.__loaded||(Jg.__loaded=!0,Nh.RegisterGraphicCreator("text",Zl),ir.load(ku),ir.load(Bg?Vp:dp))}Jg.__loaded=!1;const Qg=Jg;class tf extends e.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=tf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}tf.type="rect3d";const ef=()=>{e.Factory.registerMark(tf.type,tf),qg(),Hg(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",hh)};class sf extends e.BarSeries{constructor(){super(...arguments),this.type=xi.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=sd}}sf.type=xi.bar3d,sf.mark=id,sf.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},sf.transformerConstructor=sd;const nf=()=>{e.Factory.registerAnimation("bar3d",((t,i)=>({appear:e.barPresetAnimation(t,i),enter:e.barGrowIn(t,!1),exit:e.barGrowOut(t,!1),disappear:e.barGrowOut(t)}))),ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(sf.type,sf)};class rf extends e.Layout{layoutItems(t,i,s,n){this._layoutInit(t,i,s,n);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((t=>"absolute"===t.layoutType)),l=o.filter((t=>"z"===t.layoutOrient));let h={width:0,height:0};if(l.length){h=l[0].getLayoutRect()}this.leftCurrent+=h.width/8,this.rightCurrent-=h.width/8,this.topCurrent+=h.height/8,this.bottomCurrent-=h.height/8;const{regionItems:c,relativeItems:u,relativeOverlapItems:d,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,u,d,g,r),this._processAutoIndent(c,u,d,g,p,a,r);const f=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(f);const m=u.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],y=u.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(m&&l.length){const t=m.getLayoutStartPoint(),e=m.getLayoutRect(),i={x:"left"===y.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===y.layoutOrient?"r2l":"l2r";const s=m.getLayoutRect(),n=y.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:s.width,height:n.height};m.model.setLayout3dBox&&m.model.setLayout3dBox(r),y.model.setLayout3dBox&&y.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),this.layoutZAxisItems(l,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}rf.type="layout3d";const af=()=>{e.Factory.registerLayout(rf.type,rf)};class of extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=yi,this.type="bar3d",this.seriesType=xi.bar3d}}of.type="bar3d",of.seriesType=xi.bar3d,of.transformerConstructor=yi;const lf=Object.assign(Object.assign({},e.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class hf extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class cf extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=cf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}cf.type="pyramid3d";const uf=e.getFunnelTheme(!0);class df extends e.FunnelSeries{constructor(){super(...arguments),this.type=xi.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=hf}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},df.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},df.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(df.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(df.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t){var i,s;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series),this._labelMark=t,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(s=this._funnelOuterLabelMark)||void 0===s||s.line}}df.type=xi.funnel3d,df.mark=lf,df.builtInTheme={funnel3d:uf},df.transformerConstructor=hf;const pf=()=>{e.Factory.registerMark(cf.type,cf),qg(),Wg(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",Fh),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(df.type,df)};class gf extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=xi.funnel3d}}gf.type="funnel3d",gf.seriesType=xi.funnel3d,gf.transformerConstructor=e.FunnelChartSpecTransformer;class ff extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=xi.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ff.type="histogram3d",ff.seriesType=xi.bar3d,ff.transformerConstructor=e.HistogramChartSpecTransformer;class mf extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class yf extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=yf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}yf.type="arc3d";const bf=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class vf extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class xf extends e.BasePieSeries{constructor(){super(...arguments),this.type=xi.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=vf}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t,i={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,e.AttributeLevel.Mark))}}xf.type=xi.pie3d,xf.mark=bf,xf.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},xf.transformerConstructor=vf;const _f=()=>{e.Factory.registerAnimation("pie3d",((t,i)=>({appear:e.piePresetAnimation(t,i),enter:e.pieEnter(t),exit:e.pieExit(t),disappear:e.pieDisappear(t)}))),e.registerArcAnimation(),qg(),Og(),e.Factory.registerGraphicComponent("arc3d",Rh),e.Factory.registerMark("arc3d",yf),e.Factory.registerSeries(xf.type,xf)};class Af extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=mf,this.type="pie3d",this.seriesType=xi.pie3d}}Af.type="pie3d",Af.seriesType=xi.pie3d,Af.transformerConstructor=mf;class Sf{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-Sf.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Sf.bounceIn(2*t):.5*Sf.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/at*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*at/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/at*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*at/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/at*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*at/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*at/e)*.5+1}}static registerFunc(t,e){Sf[t]=e}}function Tf(t,e){const i=1/e;let s=1;for(;t>i;)t-=i,s*=-1;const n=s*t/i;return n>0?n:1+n}Sf.quadIn=Sf.getPowIn(2),Sf.quadOut=Sf.getPowOut(2),Sf.quadInOut=Sf.getPowInOut(2),Sf.cubicIn=Sf.getPowIn(3),Sf.cubicOut=Sf.getPowOut(3),Sf.cubicInOut=Sf.getPowInOut(3),Sf.quartIn=Sf.getPowIn(4),Sf.quartOut=Sf.getPowOut(4),Sf.quartInOut=Sf.getPowInOut(4),Sf.quintIn=Sf.getPowIn(5),Sf.quintOut=Sf.getPowOut(5),Sf.quintInOut=Sf.getPowInOut(5),Sf.backIn=Sf.getBackIn(1.7),Sf.backOut=Sf.getBackOut(1.7),Sf.backInOut=Sf.getBackInOut(1.7),Sf.elasticIn=Sf.getElasticIn(1,.3),Sf.elasticOut=Sf.getElasticOut(1,.3),Sf.elasticInOut=Sf.getElasticInOut(1,.3*1.5),Sf.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Sf.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Sf.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Sf[`flicker${t}`]=e=>Tf(e,t);for(let t=2;t<10;t++)Sf[`aIn${t}`]=e=>t*e*e+(1-t)*e;function wf(t,e,i){return t+(e-t)*i}const Mf=new class{constructor(){this.opacity=(t,e,i,s,n,r)=>{r.attribute.opacity=wf(e,i,s)},this.baseOpacity=(t,e,i,s,n,r)=>{r.attribute.baseOpacity=wf(e,i,s)},this.fillOpacity=(t,e,i,s,n,r)=>{r.attribute.fillOpacity=wf(e,i,s)},this.strokeOpacity=(t,e,i,s,n,r)=>{r.attribute.strokeOpacity=wf(e,i,s)},this.zIndex=(t,e,i,s,n,r)=>{r.attribute.zIndex=wf(e,i,s)},this.backgroundOpacity=(t,e,i,s,n,r)=>{r.attribute.backgroundOpacity=wf(e,i,s)},this.shadowOffsetX=(t,e,i,s,n,r)=>{r.attribute.shadowOffsetX=wf(e,i,s)},this.shadowOffsetY=(t,e,i,s,n,r)=>{r.attribute.shadowOffsetY=wf(e,i,s)},this.shadowBlur=(t,e,i,s,n,r)=>{r.attribute.shadowBlur=wf(e,i,s)},this.fill=(t,e,i,s,n,r)=>{r.attribute.fill=al(e,i,s,!1)},this.fillPure=(t,e,i,s,n,r)=>{r.attribute.fill=n.fromParsedProps.fill?ll(n.fromParsedProps.fill,n.toParsedProps.fill,s):n.toParsedProps.fill},this.stroke=(t,e,i,s,n,r)=>{r.attribute.stroke=al(e,i,s,!1)},this.strokePure=(t,e,i,s,n,r)=>{r.attribute.stroke=n.fromParsedProps.stroke?ll(n.fromParsedProps.stroke,n.toParsedProps.stroke,s):n.toParsedProps.stroke},this.width=(t,e,i,s,n,r)=>{r.attribute.width=wf(e,i,s),r.addUpdateBoundTag()},this.height=(t,e,i,s,n,r)=>{r.attribute.height=wf(e,i,s),r.addUpdateBoundTag()},this.x=(t,e,i,s,n,r)=>{r.attribute.x=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.y=(t,e,i,s,n,r)=>{r.attribute.y=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dx=(t,e,i,s,n,r)=>{r.attribute.dx=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dy=(t,e,i,s,n,r)=>{r.attribute.dy=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.angle=(t,e,i,s,n,r)=>{r.attribute.angle=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleX=(t,e,i,s,n,r)=>{r.attribute.scaleX=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleY=(t,e,i,s,n,r)=>{r.attribute.scaleY=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.lineWidth=(t,e,i,s,n,r)=>{r.attribute.lineWidth=wf(e,i,s),r.addUpdateBoundTag()},this.startAngle=(t,e,i,s,n,r)=>{r.attribute.startAngle=wf(e,i,s),r.addUpdateBoundTag()},this.endAngle=(t,e,i,s,n,r)=>{r.attribute.endAngle=wf(e,i,s),r.addUpdateBoundTag()},this.radius=(t,e,i,s,n,r)=>{r.attribute.radius=wf(e,i,s),r.addUpdateBoundTag()},this.outerRadius=(t,e,i,s,n,r)=>{r.attribute.outerRadius=wf(e,i,s),r.addUpdateBoundTag()},this.innerRadius=(t,e,i,s,n,r)=>{r.attribute.innerRadius=wf(e,i,s),r.addUpdateBoundTag()},this.size=(t,e,i,s,n,r)=>{r.attribute.size=wf(e,i,s),r.addUpdateBoundTag()},this.points=(t,e,i,s,n,r)=>{r.attribute.points=ia(e,i,s),r.addUpdateBoundTag()}}};function Bf(t,e,i,s,n,r){if(Number.isFinite(i)&&Number.isFinite(e))return r.attribute[t]=e+(i-e)*s,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){const n=[];let a=!0;for(let t=0;t<i.length;t++){const r=e[t],o=r+(i[t]-r)*s;if(!Number.isFinite(o)){a=!1;break}n.push(o)}return a&&(r.attribute[t]=n),!0}return!1}function Cf(){}class kf{constructor(t,e,i,s){var n;this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=s?"function"==typeof s?s:null!==(n=Sf[s])&&void 0!==n?n:Sf.linear:Sf.linear,"wait"===t&&(this.onUpdate=Cf),this.id=Si.GenAutoIncrementId(),this.syncAttributeUpdate=Cf}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t,e=!0){this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;const t=[];this.propKeys.forEach((e=>{if("fill"===e||"stroke"===e){const i=this.fromProps[e],s=this.props[e];if(p(i)&&p(s)){const n=nl.Get(i,sl.Color255),r=nl.Get(s,sl.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=n,this.toParsedProps[e]=r,t.push(Mf["fill"===e?"fillPure":"strokePure"])}else Mf[e]?t.push(Mf[e]):t.push(Bf)}else Mf[e]?t.push(Mf[e]):t.push(Bf)})),this.interpolateUpdateFunctions=t}setStartTime(t,e=!0){this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();const t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach((e=>{var i;this.fromProps[e]=null!==(i=this.fromProps[e])&&void 0!==i?i:t[e]})),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){const t=this.animate;this.target.animates.forEach((e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;const i=e.getStartProps();this.propKeys.forEach((t=>{null!=i[t]&&e.preventAttr(t)}))}))}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];const i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null===(e=this.interpolateUpdateFunctions)||void 0===e||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach((t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)}))}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const s=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,s,this,this.target):this.interpolateUpdateFunctions.forEach(((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;const i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],s,this,this.target)})),this.onUpdate(t,s,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}}class Pf extends kf{constructor(t,e,i,s){super(t,e,i,s)}onStart(){super.onStart()}onFirstRun(){const t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class Of extends n{get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this._animationEndFlag=!0,this.id=Si.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){const s=e.next;t(e.animate,i),i++,e=s}}addAnimate(t){const e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;this._animationEndFlag&&(this._animationEndFlag=!1,this.emit("animationStart"));const e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate(((t,i)=>{t.status===ls.END?this.removeAnimate(t,!0):t.status!==ls.RUNNING&&t.status!==ls.INITIAL||t.advance(e)})),0===this._animateCount&&(this._animationEndFlag=!0,this.emit("animationEnd"))}clear(){this.forEachAccessAnimate((t=>{t.release()})),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t,e=!0){const i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach((t=>t())),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate((t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}))}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}const Rf=new Of;Rf.isGlobal=!0;class Lf{constructor(t=Si.GenAutoIncrementId(),e=Rf,i){this.id=t,this.status=ls.INITIAL,this._timeline=e,e.addAnimate(this),this.slience=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.animates||(this.target.animates=new Map),this.target.animates.set(this.id,this),this.onRemove((()=>{this.stop(),this.target.animates.delete(this.id)})),this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t,e=300,i="linear"){const s=new kf(os.to,t,e,i);return s.bind(this.target,this),this.updateStepAfterAppend(s),this}wait(t){const e=new Pf(os.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?(this._lastStep.append(t),this._lastStep=t):(this._firstStep=t,this._lastStep=t),this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})),t=t.next}from(t,e=300,i="linear"){const s=new kf(os.from,t,e,i);return this._firstStep?(this._lastStep.append(s),this._lastStep=s):(this._firstStep=s,this._lastStep=s),this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===ls.RUNNING&&(this.status=ls.PAUSED)}resume(){this.status===ls.PAUSED&&(this.status=ls.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null===(e=this._onStart)||void 0===e||e.forEach((t=>t())),Object.keys(this._endProps).forEach((t=>{this._startProps[t]=this.target.getComputedAttribute(t)})))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null===(e=this._onEnd)||void 0===e||e.forEach((t=>t()))}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null===(e=this._onRemove)||void 0===e||e.forEach((t=>t()))}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach((t=>this._preventAttrs.add(t)))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null===(e=this._lastStep)||void 0===e||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,s,n,r){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==ls.END&&this.onEnd(),this.status=ls.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=ls.END,this._onRemove&&this._onRemove.forEach((t=>t())),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[]}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach((t=>{const i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)})),this.startAt(e)}after(t){if(!t)return this;const e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t?(this.startAt(t.getStartTime()),this):this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,s;if(this.status===ls.END)return void console.warn("aaa 动画已经结束,不能推进");const n=this.currentTime+t;if(n<this._startTime)return void(this.currentTime=n);if(n>=this._startTime+this._totalDuration)return null===(e=this._lastStep)||void 0===e||e.onUpdate(!0,1,{}),null===(i=this._lastStep)||void 0===i||i.onEnd(),this.onEnd(),void(this.status=ls.END);this.status=ls.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=n;let r=n-this._startTime,a=!1,o=!1;if(this._loopCount>0){r=(n-this._startTime)%this._duration;const t=Math.floor((n-this._startTime)/this._duration);a=t>this._currentLoop,this._currentLoop=t,o=this._bounce&&t%2==1,o&&(r=this._duration-r)}a&&!o&&this.target.setAttributes(this._startProps);let l=null;if(this._lastStep===this._firstStep)l=this._firstStep;else{let t=this._firstStep;for(;t;){const e=t.getStartTime(),i=t.getDuration();if(r>=e&&r<=e+i){l=t;break}t=t.next}}if(!l)return;l!==this.lastRunStep&&(null===(s=this.lastRunStep)||void 0===s||s.onEnd()),this.lastRunStep=l;const h=(r-l.getStartTime())/l.getDuration(),c=h>=1;l.update(c,h,{}),c&&(l.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.getStartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}}const Ef=new class{constructor(){this.nextAnimationFrameCbs=new Map,this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=new Map,e.forEach((e=>e(t)))},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.size&&(this._rafHandle=ss.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.set(++ns,t),this.tryRunAnimationFrameNextFrame(),ns}removeAnimationFrameCb(t){return!!this.nextAnimationFrameCbs.has(t)&&(this.nextAnimationFrameCbs.delete(t),!0)}};class If{constructor(){this.released=!1}tick(t,e){Ef.addAnimationFrameCb((()=>{if(!this.released)return e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Df extends n{constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;const s=t.getTime();this._lastTickTime=s,this.lastFrameTime<0&&(this.lastFrameTime=s-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));const n=s-this.lastFrameTime,r=this.checkSkip(n);return r||(this._handlerTick(n),this.lastFrameTime=s,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!r},this._handlerTick=t=>{this.status===as.RUNNING&&(this.tickCounts++,this.timelines.forEach((e=>{e.tick(t)})),this.emit("tick",t))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=as.INITIAL,ss.global.hooks.onSetEnv.tap("graph-ticker",(()=>{this.initHandler(!1)})),ss.global.env&&this.initHandler(!1)}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}getTimelines(){return this.timelines}initHandler(t=!1){this.setupTickHandler(t)}setupTickHandler(t=!1){if(!t&&this.tickerHandler)return!0;const e=new If;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=e,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(1e3/t))}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>this.handleTick(t,{once:!0})))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==as.INITIAL&&(this.status=as.PAUSE,!0)}resume(){return this.status!==as.INITIAL&&(this.status=as.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(this.timelines.every((t=>!t.isRunning())))return!0}return!1}start(t=!1){if(this.status===as.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===as.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=as.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=as.INITIAL,this.setupTickHandler(!0),this.lastFrameTime=-1}trySyncTickStatus(){this.status===as.INITIAL&&this.timelines.some((t=>t.isRunning()))?this.start():this.status===as.RUNNING&&this.timelines.every((t=>!t.isRunning()))&&this.stop()}release(){var t;this.stop(),this.timelines=[],null===(t=this.tickerHandler)||void 0===t||t.release(),this.tickerHandler=null,this.lastFrameTime=-1}checkSkip(t){var e,i,s;return"performance"!==(null===(s=null===(i=null===(e=this.stage)||void 0===e?void 0:e.params)||void 0===i?void 0:i.optimize)||void 0===s?void 0:s.tickRenderMode)&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class Ff{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return Ff.instance||(Ff.instance=new Ff),Ff.instance}registerDefaultTransitions(){this.registerTransition("appear","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("appear","appear",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("appear","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("appear","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("normal","normal",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("normal","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("exit","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","enter",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","exit",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("enter","enter",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("enter","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("disappear","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("disappear","appear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))}isTransitionAllowed(t,e,i){var s,n,r,a;let o=null===(s=this.transitions.get(t))||void 0===s?void 0:s.get(e);return o?o(i,t):(o=null===(n=this.transitions.get(t))||void 0===n?void 0:n.get("*"),o?o(i,t):(o=null===(r=this.transitions.get("*"))||void 0===r?void 0:r.get(e),o?o(i,t):(o=null===(a=this.transitions.get("*"))||void 0===a?void 0:a.get("*"),o?o(i,t):{allowTransition:!0,stopOriginalTransition:!0})))}registerTransition(t,e,i){let s=this.transitions.get(t);s||(s=new Map,this.transitions.set(t,s)),s.set(e,i)}}Ff.getInstance();class jf{static registerBuiltInAnimate(t,e){jf.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach((t=>{t()}))}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach((t=>{t()}))}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd((()=>{this._activeCount--;const e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())}))}parseParams(t,e,i){var s,n;const r=this.resolveValue(t.totalTime,void 0,void 0),a=this.resolveValue(t.startTime,void 0,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=a,l.totalTime=r;const h=this.resolveValue(t.oneByOne,i,!1);if(e){const t=l.timeSlices;g(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map((t=>{const s=this.resolveValue(t.delay,i,0),n=this.resolveValue(t.delayAfter,i,0),r=this.resolveValue(t.duration,i,300);return e+=s+r+n,Object.assign(Object.assign({},t),{delay:s,delayAfter:n,duration:r})}));let s=0;h&&(s="number"==typeof h?h:h?e:0),l.oneByOneDelay=s;let n=1;if(r){const t=e+s*(this._target.count-2);n=r?r/t:1}l.timeSlices=l.timeSlices.map((t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*n,delayAfter:t.delayAfter*n,duration:t.duration*n,effects:e.map((t=>{var e,i;const s=null!==(e=t.custom)&&void 0!==e?e:jf.builtInAnimateMap[null!==(i=t.type)&&void 0!==i?i:"fromTo"],n=s&&o(s)?/^class\s/.test(Function.prototype.toString.call(s))?1:2:0;return Object.assign(Object.assign({},t),{custom:s,customType:n})}))})})),l.oneByOneDelay=s*n,l.startTime=a*n}else{const e=this.resolveValue(t.delay,i,0),c=this.resolveValue(t.delayAfter,i,0),u=this.resolveValue(t.duration,i,300);let d=0;h&&(d="number"==typeof h?h:h?e+c+u:0),l.oneByOneDelay=d,l.custom=null!==(s=t.custom)&&void 0!==s?s:jf.builtInAnimateMap[null!==(n=t.type)&&void 0!==n?n:"fromTo"];const p=l.custom&&o(l.custom)?/^class\s/.test(Function.prototype.toString.call(l.custom))?1:2:0;if(l.customType=p,r){const t=e+c+u+d*(this._target.count-2),i=r?r/t:1;l.delay=e*i,l.delayAfter=c*i,l.duration=u*i,l.oneByOneDelay=d*i,l.startTime=a}}return l}execute(t){Array.isArray(t)?t.forEach((t=>this._execute(t))):this._execute(t)}_execute(t){if(t.selfOnly)return this._executeItem(t,this._target,0,1);const e="timeSlices"in t;let i;e&&t.partitioner&&(i=(null!=i?i:this._target.getChildren()).filter((e=>{var i,s;return t.partitioner(null===(s=null===(i=e.context)||void 0===i?void 0:i.data)||void 0===s?void 0:s[0],e,{})}))),e&&t.sort&&(i=null!=i?i:this._target.getChildren(),i.sort(((e,i)=>{var s,n,r,a;return t.sort(null===(n=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===n?void 0:n[0],null===(a=null===(r=i.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,i,{})})));const s=e?(i,s,n)=>{const r=this.parseParams(t,e,i),a=this.executeTimelineItem(r,i,s,n);a&&this._trackAnimation(a)}:(i,s,n)=>{const r=this.parseParams(t,e,i),a=this.executeTypeConfigItem(r,i,s,n);a&&this._trackAnimation(a)};i?i.forEach(((t,e)=>s(t,e,i.length))):this._target.count<=1?s(this._target,0,1):this._target.forEachChildren(((t,e)=>s(t,e,this._target.count-1)))}executeTypeConfigItem(t,e,i,s){var n,r,a,l,h,c,u,d;const{type:p="fromTo",channel:g,customParameters:f,easing:m="linear",delay:y=0,delayAfter:b=0,duration:v=300,startTime:x=0,oneByOneDelay:_=0,loop:A,bounce:S,priority:T=0,options:w,custom:M,customType:B,controlOptions:C}=t,k=e.animate();k.priority=T;const P=o(y)?y(null===(r=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===r?void 0:r[0],e,{}):y,O=null===(l=null===(a=e.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],R=null===(h=e.context)||void 0===h?void 0:h.indexKey;O&&R&&(i=null!==(c=O[R])&&void 0!==c?c:i),k.startAt(x);const L=i*_+P;L>0&&k.wait(L);let E=null,I=t.to,D=t.from;I||(E||(E=this.createPropsFromChannel(g,e)),I=E.props),D||(E||(E=this.createPropsFromChannel(g,e)),D=E.from),this._handleRunAnimate(k,M,B,D,I,v,m,f,C,w,p,e);let F=0;_&&(F=_*(s-i-1));const j=o(b)?b(null===(d=null===(u=e.context)||void 0===u?void 0:u.data)||void 0===d?void 0:d[0],e,{}):b;return j>0&&(F+=j),F>0&&k.wait(F),A&&A>0&&k.loop(A),S&&k.bounce(!0),k}_handleRunAnimate(t,e,i,s,n,r,a,l,h,c,u,d){var p,g,f,m;if(e&&i){const u=Object.assign({width:d.stage.width,height:d.stage.height,group:this._target.parent},this.resolveValue(l,d)),y=o(c)?c.call(null,null!==(g=u&&(null===(p=u.data)||void 0===p?void 0:p[0]))&&void 0!==g?g:null===(m=null===(f=d.context)||void 0===f?void 0:f.data)||void 0===m?void 0:m[0],d,u):c;u.options=y,u.controlOptions=h,1===i?this.createCustomAnimation(t,e,s,n,r,a,u):2===i&&this.createCustomInterpolatorAnimation(t,e,n,r,a,u)}else"to"===u?t.to(n,r,a):"from"===u&&t.from(n,r,a)}executeTimelineItem(t,e,i,s){var n,r,a,o;const{timeSlices:l,startTime:h=0,loop:c,bounce:u,oneByOneDelay:d,priority:p,controlOptions:g}=t,f=null===(r=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===r?void 0:r[0],m=null===(a=e.context)||void 0===a?void 0:a.indexKey;f&&m&&(i=null!==(o=f[m])&&void 0!==o?o:i);const y=e.animate();return y.priority=p,y.startAt(h),y.wait(i*d),c&&c>0&&y.loop(c),u&&y.bounce(!0),(Array.isArray(l)?l:[l]).forEach((t=>{this.applyTimeSliceToAnimate(t,y,e,g)})),d&&y.wait(d*(s-i-1)),y}applyTimeSliceToAnimate(t,e,i,s){var n,r,a,l;const{effects:h,duration:c=300,delay:u=0,delayAfter:d=0}=t,p=o(u)?u(null===(r=null===(n=i.context)||void 0===n?void 0:n.data)||void 0===r?void 0:r[0],i,{}):u,g=o(d)?d(null===(l=null===(a=i.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],i,{}):d;p>0&&e.wait(p),(Array.isArray(h)?h:[h]).forEach((t=>{var n;const{type:r="fromTo",channel:a,customParameters:o,easing:l="linear",options:h}=t;let u=null,d=t.to,p=t.from;d||(u||(u=this.createPropsFromChannel(a,i)),d=u.props),p||(u||(u=this.createPropsFromChannel(a,i)),p=u.from);const g=null!==(n=t.custom)&&void 0!==n?n:jf.builtInAnimateMap[r],f=t.customType;this._handleRunAnimate(e,g,f,p,d,c,l,o,s,h,r,i)})),g>0&&e.wait(g)}createCustomInterpolatorAnimation(t,e,i,s,n,r){const a=i;Object.keys(a).forEach((e=>{t.target.getComputedAttribute(e)})),t.interpolateUpdateFunction=(i,s,n,a,o)=>{e(n,i,s,a,o,t.target,r)},t.to(i,s,n)}createCustomAnimation(t,e,i,s,n,r,a){const o=new e(i,s,n,r,a);t.play(o)}createPropsFromChannel(t,e){const i={};let s=null;return t?(Array.isArray(t)?t.forEach((t=>{var s,n;const r=null===(n=null===(s=e.context)||void 0===s?void 0:s.diffAttrs)||void 0===n?void 0:n[t];void 0!==r&&(i[t]=r)})):Object.keys(t).forEach((n=>{var r,a,o,l;const h=t[n];void 0!==h.to&&("function"==typeof h.to?i[n]=h.to(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):i[n]=h.to),void 0!==h.from&&(s||(s={}),"function"==typeof h.from?s[n]=h.from(null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],e,{}):s[n]=h.from)})),{from:s,props:i}):{from:s,props:i}}resolveValue(t,e,i){var s,n;return void 0===t?i:"function"==typeof t&&e?t(null===(n=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===n?void 0:n[0],e,{}):t}executeItem(t,e,i=0,s=1){return Array.isArray(t)?t.map((t=>this._executeItem(t,e,i,s))).filter(Boolean):[this._executeItem(t,e,i,s)].filter(Boolean)}_executeItem(t,e,i=0,s=1){if(!e)return null;const n="timeSlices"in t;let r=null;const a=this.parseParams(t,n);return r=n?this.executeTimelineItem(a,e,i,s):this.executeTypeConfigItem(a,e,i,s),r&&this._trackAnimation(r),r}stop(t){for(;this._animates.length>0;){const e=this._animates.pop();null==e||e.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,this.onEnd())}}jf.builtInAnimateMap={};const Uf="appear",Nf="disappear",Wf="update",zf="highlight",Gf="unhighlight";class Vf{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null===(t=this.states)||void 0===t||t.clear()}}class Hf{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,i){const s=Ff.getInstance(),n=[],r=[];if(this.stateList&&this.stateList.length?t.forEach(((t,i)=>{const a={allowTransition:!0,stopOriginalTransition:!0};this.stateList.forEach((e=>{const i=s.isTransitionAllowed(e.state,t,this.graphic);a.allowTransition=a.allowTransition&&i.allowTransition})),a.allowTransition&&(r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)}),this.stateList.forEach((e=>{s.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&n.push(e)})))})):t.forEach(((t,i)=>{r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)})})),n.forEach((t=>{t.executor.stop()})),r.length){r[0].executor.execute(r[0].animationConfig);for(let t=0;t<r.length;t++){const e=r[t+1],s=r[t];s.executor.onEnd((()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter((t=>t!==s)),t===r.length-1&&i&&i(!1)}))}}else i&&i(!0);this.stateList?this.stateList=this.stateList.filter((t=>!n.includes(t))):this.stateList=[],this.stateList.push(...r)}applyAppearState(t,e){this.applyState([Uf],[{name:Uf,animation:t}],e)}applyDisappearState(t,e){this.applyState([Nf],[{name:Nf,animation:t}],e)}applyUpdateState(t,e){this.applyState([Wf],[{name:Wf,animation:t}],e)}applyHighlightState(t,e){this.applyState([zf],[{name:zf,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([Gf],[{name:Gf,animation:t}],e)}stopState(t,e){var i;const s=null===(i=this.stateList)||void 0===i?void 0:i.find((e=>e.state===t));s&&s.executor.stop(e)}clearState(){var t;null===(t=this.stateList)||void 0===t||t.forEach((t=>{t.executor.stop()})),this.stateList=null}reApplyState(t){var e;const i=null===(e=this.stateList)||void 0===e?void 0:e.find((e=>e.state===t));if(i){const t=this.stateList.slice();i.executor.stop(),this.stateList=t,i.executor.execute(i.animationConfig)}}}class Xf{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new Hf(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new Vf(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e,i=!1){return this._getAnimationStateManager(this).stopState(t,e),i&&this.isContainer&&this.forEachChildren((s=>{s.stopAnimationState(t,e,i)})),this}clearAnimationStates(){const t=this._animationStateManager;return t&&t.clearState(),this}reApplyAnimationState(t,e=!1){const i=this._animationStateManager;return i&&i.reApplyState(t),e&&this.isContainer&&this.forEachChildren((i=>{i.reApplyAnimationState(t,e)})),this}static extend(t){return(new Xf)._getAnimationStateManager(t),t}}class $f{getAttributes(t=!1){return t&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,s;const n=new Lf(null==t?void 0:t.id,null!==(i=null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline())&&void 0!==i?i:Rf,null==t?void 0:t.slience);if(n.bind(this),t){const{onStart:e,onEnd:i,onRemove:s}=t;null!=e&&n.onStart(e),null!=i&&n.onEnd(i),null!=s&&n.onRemove(s)}return null===(s=this.stage)||void 0===s||s.ticker.start(),n}createTimeline(){return new Of}createTicker(t){return new Df(t)}setFinalAttributes(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttributes(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new jf(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach((t=>{this._animateExecutor.execute(t)})),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t,e=!1){return!e&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}pauseAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.pause())),t&&this.isContainer&&this.forEachChildren((e=>{e.pauseAnimation(t)}))}resumeAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.resume())),t&&this.isContainer&&this.forEachChildren((e=>{e.resumeAnimation(t)}))}stopAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.stop())),t&&this.isContainer&&this.forEachChildren((e=>{e.stopAnimation(t)}))}}function Yf(){F(xl,Xf),F(xl,$f)}class qf extends kf{constructor(t,e,i,s,n){super("customAnimate",e,i,s),this.type="customAnimate",this.customFrom=t,this.params=n,this.from=t,this.to=e}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const s=this.easing(e);this.onUpdate(t,s,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class Kf extends qf{onBind(){super.onBind(),this.propKeys=["x","y","z","alpha","zIndex"]}onFirstRun(){super.onFirstRun();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t)}onStart(){super.onStart();const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.finalAttribute.x,s=this.target.finalAttribute.y,n=this.target.finalAttribute.z,r=Math.acos((s-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));n-t.z<0&&(a=at-a),this.theta=a,this.phi=r}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const s=this.target,{center:n,r:r,cb:a}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,l=this.theta+o,h=this.phi,c=r*Math.sin(h)*Math.cos(l)+n.x,u=r*Math.cos(h)+n.y,d=r*Math.sin(h)*Math.sin(l)+n.z;for(s.attribute.x=c,s.attribute.y=u,s.attribute.z=d,s.attribute.alpha=l+st/2;s.attribute.alpha>at;)s.attribute.alpha-=at;s.attribute.alpha=at-s.attribute.alpha,s.attribute.zIndex=-1e4*s.attribute.z,a&&a(i)}}const Zf=t=>({custom:Kf,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class Jf extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=xi.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(e.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",e.AttributeLevel.Series)}initAnimation(){var t,i;const s=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(e.animationConfig(null===(i=e.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var t;const e=this.getCompiler().getStage(),i=e.width-s.left||0-s.right||0,n=e.height-s.top||0-s.bottom||0,r=Math.max(i,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Jf.type=xi.wordCloud3d,Jf.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Qf=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({appear:Zf(t)}))),e.Factory.registerSeries(Jf.type,Jf)},tm=()=>{Qf()};class em extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class im extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=em,this.type="wordCloud3d",this.seriesType=xi.wordCloud3d}}im.type="wordCloud3d",im.seriesType=xi.wordCloud3d,im.transformerConstructor=em;const sm=()=>{ed(),Qf(),e.Factory.registerChart(im.type,im)},nm={label:{space:0}};class rm{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,i){const s=e.isZAxis(this._orient),n=e.isXAxis(this._orient),r=e.isYAxis(this._orient);let a=0,o=0;if(!i){const t=this.getRegions();let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}a=Math.abs(n-i),o=Math.abs(s-e)}let l=0,h=0;const{width:c,height:u}=this.getLayoutRect();let d={x:0,y:0};n?(d={x:c,y:0},l=a,h=c):r&&(d={x:0,y:u},l=o,h=u);const p=this.layout3dBox?this.layout3dBox.length:0;if(!s){const e=this.getLabelItems(h);return t.grid={length:l},t.start={x:0,y:0},t.text=this._spec.title.text||this._dataFieldText,t.maxWidth=this._getTitleLimit(n),t.items=e,t.grid={type:"line",start:{x:0,y:0},end:d,items:e[0],depth:p,length:l},t}return((t,i)=>{var s;const n=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(a),u={start:{x:0,y:0},end:h,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:c,scale:t._scale.clone()},d=null!==(s=t.directionStr)&&void 0!==s?s:"r2l";let p=[0,0],g=-Math.PI/2,f=0;return"l2r"===d&&(f=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),u.z=f,u.alpha=g,u.anchor3d=p,i||(u.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:n.height,alpha:g,z:f,anchor3d:p}),u})(this,i)}}const am=Object.assign(Object.assign({},id),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class om extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=xi.rangeColumn3d,this._barMarkType="rect3d",this._barName=xi.bar3d}}om.type=xi.rangeColumn3d,om.mark=am;const lm=()=>{ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(om.type,om)};class hm extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class cm extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}class um extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=cm,this.type="rangeColumn3d",this.seriesType=xi.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}um.type="rangeColumn3d",um.seriesType=xi.rangeColumn3d,um.transformerConstructor=cm;const dm="pictogram",pm="pictogram";var gm;!function(t){t.pictogram="pictogram"}(gm||(gm={}));const fm=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class mm extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===pm}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const ym=new Map;let bm;function vm(t,i){ym.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),bm||(bm=new ze,e.registerDataSetInstanceParser(bm,"svg",Le));const s=new Ge(bm);s.parse(i,{type:"svg"}),ym.set(t,s)}function xm(t){ym.has(t)?ym.delete(t):e.warn(`map type of '${t}' does not exists.`)}function _m(t){return ym.get(t)}class Am extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var e,i,s;const n=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},r=t.svg,a=null===(s=null===(i=ym.get(r))||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.elements;if(a&&a.length){a.map((t=>t.name)).filter((t=>h(t))).forEach((e=>{t[e]&&(n[e]=t[e])}))}return n}}class Sm extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const Tm="element-highlight-by-graphic-name";class wm extends e.ElementHighlight{constructor(){super(...arguments),this.type=Tm,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)){if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(l(t))return;const{interaction:e,highlightState:i,blurState:s}=this.options,n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&r.push(e)}))})),e.updateStates(this,r,n,i,s),e.setStatedGraphics(this,r)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}wm.type=Tm;const Mm="element-select-by-graphic-name";class Bm extends e.ElementSelect{constructor(){super(...arguments),this.type=Mm}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}Bm.type=Mm;function Cm(t){var e;return h(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const km=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&Cm(i)?1:0},Pm=(t,e)=>{var i;const s=null!==(i=t.fill)&&void 0!==i?i:e;return s&&Cm(s)?s:void 0},Om=(t,e)=>{var i;const s=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!s||!Cm(s))&&s},Rm=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Pm(t),lineWidth:km(t),stroke:Om(t)}),Lm={group:t=>{const e=Rm(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Rm(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},Rm(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},Rm(t)),{path:t.d,fillStrokeOrder:!1,fill:Pm(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Rm(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:Pm(t,"#000")})},text:(t,e)=>{var i,s;return Object.assign(Object.assign({},Rm(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(s=t.textAnchor)&&void 0!==s?s:"middle",anchor:[0,0],fill:Pm(t,"#000")})}},Em=t=>{var i,s;if(!t||!t[0])return{};const{elements:n}=t[0].latestData;if(n&&n.length){n.forEach(((t,i)=>{var s;t[e.DEFAULT_DATA_INDEX]=i,t._uniqueId=`${t.id}-${i}`,t.data=void 0;const{graphicType:n,transform:r}=t,a={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?O(a,t._inheritStyle,null===(s=t.parent)||void 0===s?void 0:s._textGroupStyle,t.attributes):"group"!==t.graphicType&&O(a,t._inheritStyle,t.attributes),Lm[n]?t._finalAttributes=Lm[n](a,t.value):t._finalAttributes=a,r&&(t._finalAttributes.postMatrix=Object.assign({},r))}));const t=n.filter((t=>"text"===t.tagName));for(let r=0;r<t.length;r++){const a=t[r]._uniqueId,o=n.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(o&&o.length){const n=null!==(s=null===(i=t[r]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==s?s:0;let a=n;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)a=n;else if(i.value&&void 0===i.parent._textGroupStyle.x){const s=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(s){a+=e.measureText(s.value,s._finalAttributes).width}i._finalAttributes.x=a}}}}}return n};class Im extends e.GeoSeries{constructor(){super(...arguments),this.type=pm,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=_m(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:e.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:e.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(t){const i="multiple"===t.mode,s=h(t.triggerOff)?t.triggerOff:i?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:s,reverseState:e.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:e.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var t;if(this._pictogramMark=this._createMark(Im.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,Im.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Im.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:s,name:n,parent:r,id:a,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:s,name:null!=n?n:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,Im.mark.pictogram.name)});h&&(h.setData(this._mapViewData),h.setUserId(l),this._idToMark.set(l,h),"group"!==h.type&&h.setMarkConfig({graphicName:h.name}),h.setTransform([{type:"filter",callback:t=>t._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(Im.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}initMarkStyle(){const{root:t,viewBoxRect:i}=this._parsedSvgResult,s=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,Lm.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[ah(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const t of s){const{_uniqueId:i,_finalAttributes:s}=t,n=this._idToMark.get(i),r=this._validElement(t);n&&(this.setMarkStyle(n,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),r?(this.initMarkStyleWithSpec(n,O({},this._spec.pictogram,this._spec[n.name])),this.setMarkStyle(n,s,"normal",e.AttributeLevel.Series),n.setPostProcess("fill",((t,e)=>h(t)?t:this._spec.defaultFillColor))):(n.setMarkConfig({interactive:!1}),this.setMarkStyle(n,s,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new Sm(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const i=t[this.nameField];if(!i)return null;const s=this.getMarksWithoutRoot().filter((t=>t.name===i));if(!s||0===s.length)return null;let n=new Ht;e?s.forEach((t=>{n=n.union(t.getGraphics()[0].globalAABBBounds)})):s.forEach((t=>{n=n.union(t.getProduct().AABBBounds)}));const r={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();r.x-=t,r.y-=e}return r}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,s=this.getRootMatrix();if(!s)return null;const n={};return s.getInverse().transformPoint({x:e,y:i},n),n}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const s=ym.get(this.svg);s||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const n=new Ge(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",Em),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),n.parse([s],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",n.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,n)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,s=e/2,n=this.getPictogramRootGraphic();if(n){const r=n.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=n.AABBBounds,c=(a+o)/2,u=(l+h)/2,d=t/r.width(),p=e/r.height(),g=Math.min(d,p);n.scale(g,g,{x:c,y:u}),n.translate(i-c,s-u)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;const s=this.getPictogramRootGraphic();s&&(s.attribute.postMatrix||s.setAttributes({postMatrix:new Yt}),s.scale(e,e,i))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const i=this.getPictogramRootGraphic();i&&(i.attribute.postMatrix||i.setAttributes({postMatrix:new Yt}),i.translate(e[0],e[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}Im.type=pm,Im.mark=fm,Im.transformerConstructor=Am;const Dm=()=>{e.Factory.registerSeries(Im.type,Im),e.Factory.registerImplement("registerSVG",vm),e.Factory.registerImplement("unregisterSVG",xm),e.Factory.registerInteractionTrigger(wm.type,wm),e.Factory.registerInteractionTrigger(Bm.type,Bm)};class Fm extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=mm,this.type=dm,this.seriesType=pm}}Fm.type=pm,Fm.seriesType=dm,Fm.transformerConstructor=mm;class jm extends e.BaseChartSpecTransformer{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const Um="imageCloud",Nm="imageCloud";var Wm;!function(t){t.image="image",t.imageMask="imageMask"}(Wm||(Wm={}));const zm=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}}),Gm={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:Vm,triangle:Vm,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function Vm(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}const Hm={archimedean:function(t){const e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,s=0;return t=>{const n=t<0?-1:1;switch(Math.sqrt(1+4*n*t)-n&3){case 0:i+=e;break;case 1:s+=4;break;case 2:i-=e;break;default:s-=4}return[i,s]}}};const Xm=(t,e,i)=>{const{threshold:s,invert:n=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,i)=>{const r=t.width;if(0===t.data[e*r*4+4*i+3])return!n;const a=t.data[e*r*4+4*i+0],o=t.data[e*r*4+4*i+1],l=t.data[e*r*4+4*i+2];if(255===a&&255===o&&255===l)return!n;if(b(s)){const t=.3*a+.59*o+.11*l;return n?t<=s:t>=s}return!1};const r=i({width:1,height:1}).getContext("2d",{willReadFrequently:!0});r.fillStyle=t,r.fillRect(0,0,1,1);const a=r.getImageData(0,0,1,1).data;return(t,e,i)=>{const s=t.width;return[0,1,2,3].every((r=>n?t.data[4*(e*s+i)+r]!==a[r]:t.data[4*(e*s+i)+r]===a[r]))}},$m=(t,e,i,s,n)=>{const{fontFamily:r="sans-serif",fontWeight:a="normal",fontStyle:o="normal",fontVariant:l="normal",text:c,hollow:u}=t;let d=12;n.font=`${o} ${l} ${a} ${d}px ${r}`,n.textAlign="center",n.textBaseline="middle",n.fillStyle=e;const p=n.measureText(c),g="normal"!==o?1.1:1,f=h(p.actualBoundingBoxRight)&&h(p.actualBoundingBoxLeft)?Math.ceil(g*(Math.abs(p.actualBoundingBoxRight)+Math.abs(p.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(p.width),f,d);if(u&&(n.globalCompositeOperation="xor"),m>i){const t=Math.min(i/m,s/d);n.fillText(c,i/2,s/2),n.scale(t,t)}else d=Math.floor(d*i/m),d=Math.min(d,s),n.font=`${o} ${l} ${a} ${d}px ${r}`,n.fillText(c,Math.floor(i/2),Math.floor(s/2))},Ym=(t,e,i=0,s)=>{const n=2*Math.PI/s;return new Array(s).fill(0).map(((s,r)=>St(t,e,i+r*n)))},qm=(t,e,i=0,s)=>{const n=2*Math.PI/s,r=(t=>Gm[t]?Gm[t]():Gm.circle())("cardioid");return new Array(s).fill(0).map(((s,a)=>{const o=i+a*n,l=e*r(o);return St(t,l,o)}))},Km=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},Zm=(t,e,i,s,n)=>{const{hollow:r}=t,{center:a,maxRadius:o}=function(t,e){const i=e[0],s=e[1];let n=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(s/2.7*.4),n=Math.floor(Math.min(i/2.3,s/2.6));break;case"triangleForward":n=s/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(s/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(s/1.5),n=Math.floor(Math.min(s/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":n=Math.floor(Math.min(i/2,s/2));break;default:n=Math.floor(Math.max(i/2,s/2))}return{maxRadius:n,center:r}}(t.shape,[i,s]);n.fillStyle=e,r&&(n.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,s)=>{0===s?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(n,qm({x:l,y:h},o,0,100));else if("circle"===t.shape)n.beginPath(),n.arc(l,h,o,0,2*Math.PI,!0),n.fill();else if("diamond"===t.shape)Km(n,Ym({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)Km(n,Ym({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)Km(n,Ym({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)Km(n,Ym({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)Km(n,Ym({x:l,y:h},o,0,3));else if("star"===t.shape){const t=Ym({x:l,y:h},o,-Math.PI/2,5),e=Ym({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let s=0;s<5;s++)i.push(t[s]),i.push(e[s]);Km(n,i)}else n.fillRect(0,0,i,s)};function Jm(t){const{size:e,maskCanvas:i}=t,s=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),n=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i<e[1];i++)for(let l=0;l<e[0];l++)if(0===n[i*e[0]+l]&&!t.isEmptyPixel(s,i,l)){n[i*e[0]+l]=r,o.push([i,l]);for(let i=0;i<o.length;i++)for(let l=0;l<4;l++){let h=o[i][0]+a[l][0],c=o[i][1]+a[l][1];h=h<0?0:h>=e[1]?e[1]-1:h,c=c<0?0:c>=e[0]?e[0]-1:c,0!==n[h*e[0]+c]||t.isEmptyPixel(s,h,c)||(n[h*e[0]+c]=r,o.push([h,c]))}r++,o=[]}const l={},h={},c={},u={},d={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){const s=n[t*e[0]+i];0!==s&&(T(t,i)&&(f.push([t,i]),l[s]=l[s]||[],l[s].push([i,t]),u[s]||(u[s]=[1/0,-1/0,1/0,-1/0]),t<u[s][0]&&(u[s][0]=t),t>u[s][1]&&(u[s][1]=t),i<u[s][2]&&(u[s][2]=i),i>u[s][3]&&(u[s][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[s]=(h[s]||0)+1)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),s=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);c[t]=[i,s],m.push(...e);const[n,r,a,o]=u[t];d[t]=~~Math.max(Math.sqrt((i-a)**2+(s-n)**2),Math.sqrt((i-o)**2+(s-r)**2),Math.sqrt((i-a)**2+(s-r)**2),Math.sqrt((i-o)**2+(s-n)**2)),p[t]=(o-a)/(r-n)}const y=Object.keys(c).map((t=>({label:t-1,boundary:l[t],area:h[t],center:c[t],maxPoint:u[t],maxR:d[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const b=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),x=~~Math.max(Math.sqrt((b-g.x1)**2+(v-g.y1)**2),Math.sqrt((b-g.x2)**2+(v-g.y2)**2),Math.sqrt((b-g.x1)**2+(v-g.y2)**2),Math.sqrt((b-g.x2)**2+(v-g.y1)**2)),_=g.width/g.height,A=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:y,labels:n,labelNumber:r-1};if(t.blur){const i=t.blur,s=function(t,e,i,s){const n=s/3,r=Math.ceil(s/2),a=function(t,e){const i=new Array(2*t+1).fill(0),s=t;let n=0;for(let r=-t;r<=t;r++){const t=Math.exp(-r*r/(2*e*e));i[r+s]=t,n+=t}for(let t=0;t<i.length;t++)i[t]/=n;return i}(r,n),o=new Array(t.length).fill(0),l=new Array(t.length).fill(0);for(let s=0;s<i;s++)for(let i=0;i<e;i++){let n=0;for(let o=-r;o<=r;o++)n+=t[s*e+Math.min(Math.max(i+o,0),e-1)]*a[o+r];o[s*e+i]=n}for(let t=0;t<e;t++)for(let s=0;s<i;s++){let n=0;for(let l=-r;l<=r;l++)n+=o[Math.min(Math.max(s+l,0),i-1)*e+t]*a[l+r];l[s*e+t]=Math.max(0,Math.min(1,n))}return l}(n,e[0],e[1],i);(function(t,e,i,s,n=1){const r=new Array(t.length).fill(0);for(const[t,a]of e)if(r[t*i+a]=1,n>1)for(let e=1-n;e<=n-1;e++)for(let o=1-n;o<=n-1;o++)if(Math.sqrt(e*e+o*o)<n){const n=t+e,l=a+o;n>=0&&n<s&&l>=0&&l<i&&(r[n*i+l]=1)}return r})(n,f,e[0],e[1],Math.ceil(i/2)).forEach(((t,e)=>{1===t&&(n[e]=s[e])}))}return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:x,shapeRatio:_,shapeCenter:[b,v],shapeArea:A});function T(t,i){const s=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+s[r][0],o=i+s[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===n[a*e[0]+o])return!0}return!1}}function Qm(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let s=0;s<t;++s)if(!i(r,e,s))return!1;return!0},u=(t,e,s)=>{for(let n=e;n<s;++n)if(!i(r,n,t))return!1;return!0};for(;a<o&&c(n,a);)++a;for(;o-1>a&&c(n,o-1);)--o;for(;l<h&&u(l,a,o);)++l;for(;h-1>l&&u(h-1,a,o);)--h;const d=s.getImageData(l,a,h-l,o-a);return e.width=d.width,e.height=d.height,s.clearRect(0,0,e.width,e.height),s.putImageData(d,0,0),e}function ty(t,e){return t&&(v(t)||x(t)||t.startsWith("<svg"))?new Promise(((i,s)=>{var n;const r=e({image:t}),a=null===(n=r.resources)||void 0===n?void 0:n.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const n=null===(e=r.resources)||void 0===e?void 0:e.get(t);n&&"success"===n.state&&n.data?i(n.data):s(new Error("image load failed: "+t))}else s(new Error("image load failed: "+t))},r.failCallback=()=>{s(new Error("image load failed: "+t))})})):null}var ey;function iy(t){return t}!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(ey||(ey={})),Object.values(ey).forEach((t=>{}));const sy=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),ny=t=>t<0?-t*t:t*t;function ry(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function ay(t,e,i){const s=t[0],n=t[1],r=e[0],a=e[1];let o,l;return n<s?(o=ry(n,s),l=i(a,r)):(o=ry(s,n),l=i(r,a)),t=>l(o(t))}function oy(t,e,i){const s=Math.min(t.length,e.length)-1,n=new Array(s),r=new Array(s);let a=-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<s;)n[a]=ry(t[a],t[a+1]),r[a]=i(e[a],e[a+1]);return function(e){const i=function(t,e,i=0,s){for(l(s)&&(s=t.length);i<s;){const n=i+s>>>1;z(t[n],e)>0?s=n:i=n+1}return i}(t,e,1,s)-1;return r[i](n[i](e))}}class ly{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),s=t[0]-i*e[0];return[s,i+s]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):h(this._rangeFactorStart)&&h(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return l(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return l(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:s}=this._fishEyeOptions,n=this.range(),r=n[0],a=n[n.length-1],o=Math.min(r,a),h=Math.max(r,a),c=q(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,h),u=l(s)?(h-o)*i:s;let d=Math.exp(e);d=d/(d-1)*u;const p=e/u;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=u)return t;if(e<=1e-6)return c;const i=d*(1-Math.exp(-e*p))/e*.75+.25;return c+(t-c)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const{interpolateRgb:hy}=oe;function cy(t,e){const i=typeof e;let s;if(l(e)||"boolean"===i)return()=>e;if("number"===i)return K(t,e);if("string"===i){if(s=re.parseColorString(e)){const e=hy(re.parseColorString(t),s);return t=>e(t).formatRgb()}return K(Number(t),Number(e))}return e instanceof ae?hy(t,e):e instanceof re?hy(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),s=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+s*t),n)}(t,e):K(Number(t),Number(e))}class uy extends ly{constructor(t=iy,e=iy){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=iy,this._piecewise=ay,this._interpolate=cy}calculateVisibleDomain(t){var e;return h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),K)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,G);return this._domain=s,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Z,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=i.length,n=this._range.length;let r=Math.min(s,n);if(s&&s<n&&this._forceAlign){const t=n-s+1,e=i[s-1],a=s>=2?(e-i[s-2])/t:0;for(let n=1;n<=t;n++)i[s-2+n]=e-a*(t-n);r=n}return this._autoClamp&&(this._clamp=function(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}(i[0],i[r-1])),this._piecewise=r>2?oy:ay,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:iy),this.rescale(i)):this._clamp!==iy}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return l(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return l(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const dy=Math.sqrt(50),py=Math.sqrt(10),gy=Math.sqrt(2),fy=[1,2,5,10],my=(t,e,i)=>{let s=1,n=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?s=xy(a).step:(i||a>1)&&(n=Math.floor(t)-r*s),s>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*s)),function(t,e,i){h(e)||(e=t,t=0),h(i)||(i=1);let s=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(0,e).map((t=>n+t*s))):t>0?by(0,-(e-1)/s,s):by((e-1)/s,0,s)},yy=Y(((t,e,i,s)=>{let n,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e<t)&&(r=t,t=e,e=r),o=_y(t,e,i).step,!isFinite(o))return[];if(o>0){let i=Math.round(t/o),s=Math.round(e/o);for(i*o<t&&++i,s*o>e&&--s,a=new Array(r=s-i+1);++l<r;)a[l]=(i+l)*o}else if(o<0&&(null==s?void 0:s.noDecimals)){o=1;const i=Math.ceil(t),s=Math.floor(e);if(!(i<=s))return[];for(a=new Array(r=s-i+1);++l<r;)a[l]=i+l}else{o=-o;let i=Math.round(t*o),s=Math.round(e*o);for(i/o<t&&++i,s/o>e&&--s,a=new Array(r=s-i+1);++l<r;)a[l]=(i+l)/o}return n&&a.reverse(),a})),by=(t,e,i)=>{let s,n,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,n=new Array(s=o-a+1);++r<s;)n[r]=(a+r)*i}else{i=-i;let a=Math.floor(t*i),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,n=new Array(s=o-a+1);++r<s;)n[r]=(a+r)/i}return n},vy=Y(((t,e,i,s)=>{let n,r,a;if(i=+i,(t=+t)==(e=+e))return my(t,i,null==s?void 0:s.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return my(t,i,null==s?void 0:s.noDecimals);(n=e<t)&&(a=t,t=e,e=a);const o=_y(t,e,i);let l=o.step;if(!isFinite(l))return[];if(l>0){let s=1;const{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;s<=5&&(r=by(t,e,l),r.length>i+1)&&i>2;)l+=h,s+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let s;const n=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(s=a;s>=1;s--)e.push(n-s*i);return e.concat(t)}if(n>=0){for(s=1;s<=a;s++)t.push(r+s*i);return t}let o=[];const l=[];for(s=1;s<=a;s++)s%2==0?o=[n-Math.floor(s/2)*i].concat(o):l.push(r+Math.ceil(s/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==s?void 0:s.noDecimals)&&l<0&&(l=1),r=by(t,e,l);return n&&r.reverse(),r})),xy=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let s=fy[0];return i>=dy?s=fy[3]:i>=py?s=fy[2]:i>=gy&&(s=fy[1]),e>=0?{step:s*10**e,gap:s,power:e}:{step:-(10**-e)/s,gap:s,power:e}};function _y(t,e,i){const s=(e-t)/Math.max(0,i);return xy(s)}function Ay(t,e,i){let s;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(s=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(s))return[];const n=new Array(i);for(let e=0;e<i;e++)n[e]=t+e*s;return n}function Sy(t,e=10){let i,s,n=0,r=t.length-1,a=t[n],o=t[r],l=10;for(o<a&&(s=a,a=o,o=s,s=n,n=r,r=s);l-- >0;){if(s=_y(a,o,e).step,s===i)return t[n]=a,t[r]=o,t;if(s>0)a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s;else{if(!(s<0))break;a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s}i=s}}class Ty extends uy{constructor(){super(...arguments),this.type=ey.Linear}clone(){var t;const e=new Ty;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null===(t=this._niceDomain)||void 0===t?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return yy(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(o(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=s[0],a=s[s.length-1];let l=vy(n[0],n[n.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==r||l[l.length-1]!==a)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==r?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==a&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ay(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let s,n,r=-1;if(i=+i,(n=(e=+e)<(t=+t))&&(s=t,t=e,e=s),!isFinite(i)||e-t<=i)return[t];const a=Math.floor((e-t)/i+1),o=new Array(a);for(;++r<a;)o[r]=t+r*i;return n&&o.reverse(),o}(e[0],e[e.length-1],t)}nice(t=10,e){var i,s;const n=this._domain;let r=[];if(e){const t=function(t,e){const i=y(e.forceMin),s=y(e.forceMax);let n=null;const r=[];let a=null;const o=i&&s?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:y(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),s?r[1]=e.forceMax:y(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),y(r[0])&&y(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):n=y(r[0])||y(r[1])?y(r[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:r,domainValidator:o}}(n,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=Sy(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=r[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Sy(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Sy(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class wy extends Ty{constructor(){super(sy,ny),this.type=ey.Sqrt}clone(){return(new wy).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}var My;function By(t,e){t.aspectRatio>1?(t.width=e,t.height=~~(e/t.aspectRatio)):(t.height=e,t.width=~~(e*t.aspectRatio))}!function(t){t.BEFORE_IMAGECLOUD_LAYOUT="beforeImagecloudLayout",t.AFTER_IMAGECLOUD_LAYOUT="afterImagecloudLayout",t.AFTER_IMAGECLOUD_DRAW="afterImagecloudDraw"}(My||(My={}));class Cy{constructor(t){this.progressiveResult=[],this.imageCollageList=[],this.options=t}preProcess(){const{imageConfig:t={},weight:e}=this.options,{padding:i=0}=t;let s=this.imageCollageList;return s.forEach(((t,s)=>{!1===t.valid?(t.x=-10,t.y=-10,t.width=0,t.height=0,t.opacity=0):(t.padding=i,t.weight=tt(e)(this.data[s]),t.datum=this.data[s])})),s=s.filter((t=>!1!==t.valid)).sort(((t,e)=>e.weight-t.weight)),s}onImageCollageInputReady(t){t.forEach(((t,e)=>{if("fulfilled"===t.status){const i=t.value,{width:s,height:n}=i;this.imageCollageList.push(Object.assign({},this.data[e],{aspectRatio:s/n}))}else this.imageCollageList.push(Object.assign({},this.data[e],{valid:!1}))}))}layout(t){this.data=t,this.loadSegmentationInput(),this.loadImageCollageInput()}loadSegmentationInput(){var t,e,i,s,n,r;const a=this.options,o=a.size,l={shapeUrl:null!==(t=a.mask)&&void 0!==t?t:{type:"geometric",shape:"rect"},size:o,ratio:a.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0,blur:null===(e=a.maskConfig)||void 0===e?void 0:e.edgeBlur},h=this.options.createCanvas({width:o[0],height:o[1]}),c=h.getContext("2d",{willReadFrequently:!0});c.textAlign="center",c.textBaseline="middle",l.tempCanvas=h;const u=o[0]+31>>5<<5;if(l.boardSize=[u,o[1]],l.random?l.randomGenerator=Math.random:l.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=l,p(l.shapeUrl)){l.isEmptyPixel=Xm(void 0,{threshold:null!==(s=null===(i=a.maskConfig)||void 0===i?void 0:i.threshold)&&void 0!==s?s:200,invert:null===(n=a.maskConfig)||void 0===n?void 0:n.invert},this.options.createCanvas);const t=ty(l.shapeUrl,this.options.createImage);t?(this.isMaskImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{var e,i;this.isMaskImageFinished=!0;const s=a.size,n=this.options.createCanvas({width:s[0],height:s[1],dpr:1});l.maskCanvas=n;const r=n.getContext("2d");(null===(e=a.maskConfig)||void 0===e?void 0:e.removeWhiteBorder)&&Qm(t,n,l.isEmptyPixel);const o=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,s);let h;r.clearRect(0,0,s[0],s[1]),r.drawImage(t,o.x,o.y,o.width,o.height),this.segmentationOutput=Jm(this.segmentationInput),"masked"===(null===(i=this.options.layoutConfig)||void 0===i?void 0:i.placement)&&(h=this.generateTransparentMaskCanvas(t,s)),this.segmentationOutput.transparentMaskCanvas=h,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(n,h)})).catch((t=>{this.isMaskImageFinished=!0}))):(this.isMaskImageFinished=!0,this.isLayoutFinished=!0)}else if(l.shapeUrl&&("text"===l.shapeUrl.type||"geometric"===l.shapeUrl.type)){l.isEmptyPixel=Xm(l.shapeUrl.backgroundColor,void 0,this.options.createCanvas),"text"!==l.shapeUrl.type&&"geometric"!==l.shapeUrl.type||l.shapeUrl.backgroundColor||(l.shapeUrl.backgroundColor="rgba(255,255,255,255)");const t=((t,e,i,s,n=!1,r)=>{let{backgroundColor:a="#fff"}=t,{fill:o="#000"}=t;n&&([a,o]=[o,a]);const l=s||r({width:e,height:i,dpr:1}),h=l.getContext("2d",{willReadFrequently:!0});if(s){const t=s.width,n=s.height;h.clearRect(0,0,t,n),s.style.width=`${e}px`,s.style.height=`${i}px`,s.width=e,s.height=i}return h.fillStyle=a,h.fillRect(0,0,l.width,l.height),"text"===t.type?$m(t,o,l.width,l.height,h):"geometric"===t.type&&Zm(t,o,l.width,l.height,h),l})(l.shapeUrl,o[0],o[1],void 0,null===(r=a.maskConfig)||void 0===r?void 0:r.invert,this.options.createCanvas);l.maskCanvas=t,this.segmentationOutput=Jm(this.segmentationInput),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t,t),this.isMaskImageFinished=!0}}loadImageCollageInput(){const t=function(t,e){return Promise.allSettled(t.map((t=>ty(t,e))))}(this.data.map((t=>tt(this.options.image)(t))),this.options.createImage);t?t.then((t=>{this.onImageCollageInputReady(t),this.isImagesFinished=!0})).catch((t=>{this.isImagesFinished=!0,this.isLayoutFinished=!0,$.getInstance().error("image load failed",t)})):(this.isImagesFinished=!0,this.isLayoutFinished=!0)}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){if(this.isImagesFinished&&this.isMaskImageFinished&&!this.isLayoutFinished){const t=this.preProcess(),e=this.doLayout(t);this.options&&this.options.onLayoutEnd&&this.options.onLayoutEnd(e),this.progressiveResult=this.processOutput(e),this.isLayoutFinished=!0}}progressiveOutput(){return this.progressiveResult}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}calculateImageSize(t,e={},i=.45){const{imageSizeRange:s,padding:n=0}=e,r=y(e.imageSize)?e.imageSize:((t,e={})=>{if(g(t)){const i=t.map((t=>Q(t,e)));return t=>i.map((e=>e(t)))}return Q(t,e)})(e.imageSize),a=this.options.size;if(r||s)if(r&&!o(r))t.forEach((t=>By(t,r)));else if(s){const e=(new wy).domain(et(t,(t=>t.weight))).range(s);t.forEach((t=>By(t,~~e.scale(t.weight))))}else if(r&&o(r)&&!s){const e=.5,[s,r]=et(t,(t=>t.weight)),o=t.reduce(((t,i)=>{const n=i.aspectRatio,a=(i.weight-s)/(r-s);return t+(n>1?1/n:n)*(e+(1-e)*a)**2}),0),l=~~Math.sqrt(i*a[0]*a[1]/o),h=[~~(e*l)-2*n<0?1:~~(e*l)-2*n,~~l-2*n<0?1:~~l-2*n],c=(new wy).domain(et(t,(t=>t.weight))).range(h);t.forEach((t=>By(t,~~c.scale(t.weight))))}else console.warn("image cloud imageSize error");else{const e=t.reduce(((t,e)=>{const i=e.aspectRatio;return t+(i>1?1/i:i)}),0);let s=~~Math.sqrt(i*a[0]*a[1]/e);s=s-2*n<0?1:s-2*n,t.forEach((t=>By(t,s)))}return t}generateTransparentMaskCanvas(t,e){var i;const s=this.options.createCanvas({width:e[0],height:e[1],dpr:1}),n=s.getContext("2d");this.segmentationOutput.transparentMaskCanvas=s,(null===(i=this.options.maskConfig)||void 0===i?void 0:i.removeWhiteBorder)&&Qm(t,s,this.segmentationInput.isEmptyPixel);const r=n.createImageData(e[0],e[1]),a=this.segmentationOutput.segmentation.labels;for(let t=0;t<a.length;t++){const e=0===a[t]?255:0,i=255*a[t],s=4*t;r.data[s]=e,r.data[s+1]=e,r.data[s+2]=e,r.data[s+3]=i}return n.clearRect(0,0,e[0],e[1]),n.fillStyle="rgba(255,255,255,0)",n.fillRect(0,0,e[0],e[1]),n.putImageData(r,0,0),s}processOutput(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.as;return i&&Object.keys(i).forEach((e=>{t.forEach((t=>{t[i[e]]=t[e],delete t[e]}))})),t}}class ky extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.45}=this.options;return this.calculateImageSize(t,e,i)}tryPlaceImage(t,e,i,s,n,r=1){const[a,o]=e,l=a/2,h=o/2,c=Math.sqrt(l**2+h**2),u=Hm[i](e);let d,p,g=-r;const{segmentation:f}=s,{labels:m}=f;for(;([d,p]=u(g+=r))&&!(Math.min(Math.abs(d),Math.abs(p))>=c);)if(d-=t.width/2,p-=t.height/2,t.visible=!0,t.x=~~(l+d),t.y=~~(h+p),t._left=t.x+t.padding,t._top=t.y+t.padding,t._leftWithoutPadding=t.x,t._topWithoutPadding=t.y,Py(t,n)){const{x:e,y:i,width:s,height:n}=t;let r=!1;for(let t=0;t<s;t++){for(let s=0;s<n&&i+t<=o;s++)if(!(e+s>a||m[(i+t)*a+(e+s)])){r=!0;break}if(r)break}if(!r){const e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}];let i=!0;for(const t of e)if(!m[t.y*a+t.x]){i=!1;break}if(!i)continue;return!0}}return!1}doLayout(t){var e;const{segmentationOutput:i}=this,{layoutConfig:s={}}=this.options,n=this.options.size,{spiralType:r="archimedean",fillingTimes:a=4,minFillingImageSize:o=10}=s,l=[],h=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));for(const e of t)e._widthWithPadding=e.width+2*e.padding,e._heightWithPadding=e.height+2*e.padding,e.frequency=1,this.tryPlaceImage(e,n,r,i,l)&&l.push(e);const c=U(l,((t,e)=>t.width-e.width)).width,u=U(l,((t,e)=>t.height-e.height)).height,d=[];for(let s=0;s<a;s++){const a=.5*c-1*s,p=.5*u-1*s;for(const s of t){const t=Object.assign({},s,{visible:!0});By(t,Math.max(o,t.aspectRatio>1?a:p)),t._widthWithPadding=t.width+2*t.padding,t._heightWithPadding=t.height+2*t.padding,this.tryPlaceImage(t,n,r,i,[...d,...l],.5)&&(s._tempFrequency=(null!==(e=s._tempFrequency)&&void 0!==e?e:s.frequency)+1,t.frequency=s._tempFrequency,t.distance=Math.sqrt(Math.pow(t.x-n[0]/2,2)+Math.pow(t.y-n[1]/2,2)),t[h]=`${t[h]}_${t.frequency}`,d.push(t))}}return[...l,...d].filter((t=>t.visible))}}function Py(t,e){for(let n=0;n<e.length;n++)if(i=t,s=e[n],!(i._leftWithoutPadding+i._widthWithPadding<s._leftWithoutPadding||i._topWithoutPadding+i._heightWithPadding<s._topWithoutPadding||i._leftWithoutPadding>s._leftWithoutPadding+s._widthWithPadding||i._topWithoutPadding>s._topWithoutPadding+s._heightWithPadding))return!1;var i,s;return!0}function Oy(t){const{imageConfig:e={},size:i,ratio:s=.1,layoutConfig:n={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i;let h;h=a||Math.min(o,l)*s-2*r,h<0&&(h=1);const{rectAspectRatio:c=1}=n;let u,d;c>1?(u=h,d=h/c):(d=h,u=h*c);const p=Math.ceil(l/(d+r)),g=Math.ceil(o/(u+r)),f=o/2,m=l/2,y=new Array(g*p);for(let t=0;t<p;t++)for(let e=0;e<g;e++){const i=e*(u+r)+u/2,s=t*(d+r)+d/2;y[t*g+e]={centerX:i,centerY:s,x:i-u/2,y:s-d/2,row:t,col:e,distance:Math.sqrt(Math.pow(i-f,2)+Math.pow(s-m,2))}}return{context:Object.assign({},n,{cellWidth:u,cellHeight:d,cellInfo:y,cellCount:y.length,cellType:"rect",cellPixelCount:u*d,eachPixel:(t,e)=>{const{x:i,y:s}=t;for(let t=0;t<u;t++)for(let n=0;n<d&&s+t<=l;n++)i+n>o||e((~~s+t)*o+(~~i+n))},clipPath:`M${-u/2} ${-d/2} L${u/2} ${-d/2} L${u/2} ${d/2} L${-u/2} ${d/2} Z`}),imageLength:h}}const Ry={rect:Oy,circle:function(t){const{imageConfig:e={},size:i,ratio:s=.1,layoutConfig:n={}}=t,{padding:r=0,imageSize:a=0}=e,[o,l]=i,h=o/2,c=l/2;let u=0;u=a?a/2:Math.min(o,l)*s/2,u-r<=0&&(u=r+1);const d=2*u,p=Math.sqrt(3)/2*d+r,g=[];let f=0;for(let t=0;t*p-u<l;t++){const e=t*p,i=t%2==0?0:u;for(let s=-1;s*(d+r)+i-u<o;s++){const n=s*(d+r)+i+u;g[f++]={centerX:n,centerY:e,x:n-u,y:e-u,row:t,col:s,distance:Math.sqrt(Math.pow(n-h,2)+Math.pow(e-c,2))}}}let m=0;const y=u*u;for(let t=0;t<d;t++)for(let e=0;e<d;e++){const i=t-u,s=e-u;i*i+s*s<=y&&m++}return{context:Object.assign({},n,{cellWidth:d,cellHeight:d,cellInfo:g,cellCount:g.length,cellType:"circle",cellPixelCount:m,eachPixel:(t,e)=>{const{x:i,y:s}=t;for(let t=0;t<d;t++)for(let n=0;n<d;n++){if(t+i<0||t+i>o||n+s>l||n+s<0)continue;const r=t-u,a=n-u;r*r+a*a<=y&&e((~~s+t)*o+(~~i+n))}},clipPath:"M 1 0 A 1 1 0 1 0 -1 0 A 1 1 0 1 0 1 0 Z"}),imageLength:d}},hexagonal:function(t){const{imageConfig:e={},size:i,ratio:s=.1,layoutConfig:n={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i,h=o/2,c=l/2;let u;u=a?a/2:Math.min(o,l)*s/2,u-r<=0&&(u=r+1);const d=[],p=2*Math.PI/6;for(let t=0;t<6;t++){const e=p*t;d.push({x:(u-r/2)*Math.cos(e),y:(u-r/2)*Math.sin(e)})}const g=2*u,f=Math.sin(Math.PI/6)*g,m=Math.sqrt(3)*f,y=g-f/2,b=Math.cos(Math.PI/6)*g,v=b/2,x=Math.floor(l/m),_=Math.floor(o/f),A=[];for(let t=-1;t<=x+1;t++)for(let e=-1;e<=_;e++){const i=e*y,s=t*b+(e%2?v:0);A.push({centerX:i,centerY:s,x:i-f,y:s-f,row:t,col:e,distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(s-c,2))})}let S=0;const T=[];for(let t=0;t<=m;t++)for(let e=0;e<=2*f;e++){const i=e-f,s=t-m/2,n=Math.abs(i),r=Math.abs(s);n<=f&&r<=m/2&&2*r+n*Math.sqrt(3)<=m?(S++,T.push(!0)):T.push(!1)}return{context:Object.assign({},n,{cellHexSideLength:f,cellHexPoints:d,cellHeight:m,cellWidth:2*f,cellInfo:A,cellCount:A.length,cellType:"hexagonal",cellPixelCount:S,eachPixel:(t,e)=>{const{x:i,y:s}=t;let n=0;for(let t=0;t<=m;t++)for(let r=0;r<=2*f;r++)T[n++]&&e((~~s+t)*o+(~~i+r))},clipPath:"M 1 0 L 0.5 0.866 L -0.5 0.866 L -1 0 L -0.5 -0.866 L 0.5 -0.866 Z"}),imageLength:g-r}}};class Ly extends Cy{preProcess(){var t;const e=super.preProcess(),{layoutConfig:i={}}=this.options,{cellType:s="rect"}=i,n=(null!==(t=Ry[s])&&void 0!==t?t:Ry.rect)(this.options),{context:r,imageLength:a}=n;return e.forEach((t=>function(t,e){t.aspectRatio>1?(t.height=e,t.width=~~(e*t.aspectRatio)):(t.width=e,t.height=~~(e/t.aspectRatio))}(t,a))),r.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.layoutContext=r,e}doLayout(t){const{cellWidth:e,cellHeight:i,cellInfo:s,cellCount:n,clipPath:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===n||0===e||0===i||0===s.length)return void(this.isLayoutFinished=!0);const{segmentationOutput:l}=this,{layoutConfig:h={}}=this.options,{placement:c="default"}=h;if("edge"===c||"default"===c){const{segmentation:t}=l,{labels:e}=t;s.forEach((t=>{let i=0;a(t,(t=>{e[t]&&i++})),t.intersectPixels=i}))}const u=t.length,d=t=>{const{intersectPixels:e}=t;return"default"===c?e>=.45*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<u;e++){const i=t[e],n=s[e];n&&(i.x=n.centerX-i.width/2,i.y=n.centerY-i.height/2,i.clipConfig={shape:r},i.frequency=1,i.visible=d(n),i.cell=R(n,["image"]),i.distance=n.distance,n.image=i)}const p=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<n)for(let e=u;e<n;e++){const i=t[e-u],n=s[e];if(n){const e=Object.assign({},i);e.x=n.centerX-e.width/2,e.y=n.centerY-e.height/2,e.frequency+=1,e[p]=`${e[p]}_${e.frequency}`,e.visible=d(n),e.distance=n.distance,e.cell=R(n,["image"]),n.image=e,t.push(e)}}return t.filter((t=>t.visible))}}class Ey extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.1}=this.options,s=Oy;return this.layoutContext=s(Object.assign({},this.options,{imageConfig:{imageSize:null}})).context,this.layoutContext.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.calculateImageSize(t,e,i)}doLayout(t){const{segmentationOutput:e}=this,{cellWidth:i,cellHeight:s,cellInfo:n,cellCount:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===r||0===i||0===s||0===n.length)return void(this.isLayoutFinished=!0);const{layoutConfig:l={}}=this.options,h=this.options.size,{placement:c="default",maxAngle:u=Math.PI/180*45}=l;if("edge"===c||"default"===c){const{segmentation:t}=e,{labels:i}=t;n.forEach((t=>{let e=0;a(t,(t=>{i[t]&&e++})),t.intersectPixels=e}))}const d=t.length,p=Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2)),g=t=>{const{intersectPixels:e}=t;return"default"===c?e>.5*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<d;e++){const i=t[e],s=n[e];s&&(i.x=s.centerX-i.width/2,i.y=s.centerY-i.height/2,i.visible=g(s),i.cell=`${s.row}_${s.col}`,i.angle=Math.random()*(2*u)-u,i.anchor=[i.x+i.width/2,i.y+i.height/2],i.zIndex=p-s.distance,i.distance=s.distance,i.frequency=1,s.image=i)}const f=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(d<r)for(let e=d;e<r;e++){const i=t[e-d],s=n[e];if(s){const e=Object.assign({},i);e.x=s.centerX-e.width/2,e.y=s.centerY-e.height/2,e.anchor=[e.x+e.width/2,e.y+e.height/2],e.angle=Math.random()*(2*u)-u,e.frequency+=1,e[f]=`${e[f]}_${e.frequency}`,e.visible=g(s),e.cell=`${s.row}_${s.col}`,e.distance=s.distance,e.zIndex=p-s.distance,s.image=e,t.push(e)}}return t.filter((t=>t.visible))}}const Iy=(t,e,i)=>{var s,n;const r=o(t.size)?t.size():t.size;if(t.size=r,!r||l(r[0])||l(r[1])||r[0]<=0||r[1]<=0)return $.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(r[0]),Math.ceil(r[1])],t.image||$.getInstance().error("Imagecloud: image source must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let a;switch(null!==(n=null===(s=t.layoutConfig)||void 0===s?void 0:s.layoutMode)&&void 0!==n?n:"spiral"){case"grid":a=Ly;break;case"stack":a=Ey;break;default:a=ky}const h=new a(t);return h.layout(e),h.unfinished()?{progressive:h}:h.output()};class Dy extends qf{constructor(t,e,i,s,n){var r;super(t,e,i,s,n),this._rotations=null!==(r=null==n?void 0:n.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,b(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var s;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const n=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(n))*(null!==(s=this._scaleX)&&void 0!==s?s:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Fy(t,i){switch(i){case"axialRotate":return[{custom:Dy,customParameters:{rotation:1},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(e,i)=>t.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>t.center().x},y:{from:()=>t.center().y}},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class jy extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}class Uy extends e.BaseSeries{constructor(){super(...arguments),this.type=Nm}setValueField(t){h(t)&&(this._valueField=t)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var t;(null===(t=this._spec.imageMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(zm.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(zm.image,{key:t=>`${t[e.DEFAULT_DATA_KEY]}-${t.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var t,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:t=>t.x,y:t=>t.y,width:t=>t.width,height:t=>t.height,visible:t=>t.visible,angle:t=>t.angle,clipConfig:t=>t.clipConfig,image:t=>t[this._urlField],scaleCenter:["50%","50%"]},"normal",e.AttributeLevel.Series);"masked"===(null===(t=this._spec.layoutConfig)||void 0===t?void 0:t.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",e.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",e.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",e.AttributeLevel.Series)}isFillingImage(t){return t._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",e.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new jy(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var t;return{size:()=>{const{width:t,height:e}=this._region.getLayoutRect();return[t,e]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(t=this._spec.image)||void 0===t?void 0:t.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:e.vglobal.createCanvas.bind(e.vglobal),createImage:fh,onUpdateMaskCanvas:((t,e)=>{var i;t&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((e=>{e.setAttribute("background",t)})),e&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",e)}).bind(this)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,s;if(t){const n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===s?void 0:s.preset,r={center:()=>{const{width:t,height:e}=this._region.getLayoutRect();return{x:t/2,y:e/2}},height:()=>{const{height:t}=this._region.getLayoutRect();return t}};t.setAnimationConfig(e.animationConfig(e.Factory.getAnimationInKey("imageCloud")(r,n),e.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var t;return[null!==(t=this._nameField)&&void 0!==t?t:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getActiveMarks(){return[this._imageMark]}getMarkData(t){var e;return null!==(e=null==t?void 0:t.datum)&&void 0!==e?e:t}getGroupFields(){return[]}dataToPosition(t){return null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}valueToPosition(t,e){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Uy.type=Nm,Uy.mark=zm;const Ny=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Fy(t,e),enter:Fy(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Uy.type,Uy),e.Factory.registerGrammarTransform("imagecloud",{transform:Iy})};class Wy extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Wy.transformerConstructor,this.type=Um,this.seriesType=Nm}}Wy.type=Um,Wy.seriesType=Nm,Wy.transformerConstructor=jm;class zy extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){const e=[t.openField,t.highField,t.lowField,t.closeField],i=super._getDefaultSeriesSpec(t,["candlestick","openField","highField","lowField","closeField","rising","falling","doji"]);return i.yField=e,i}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),e.setDefaultCrosshairForCartesianChart(t)}}class Gy extends e.GlyphMark{constructor(){super(...arguments),this.type=Gy.type}setGlyphConfig(t){super.setGlyphConfig(t),this._subMarks={line:{type:"line",defaultAttributes:{x:0,y:0}},box:{type:"rect"}},this._positionChannels=["x","boxWidth","open","close","high","low"],this._channelEncoder=null,this._positionEncoder=(t,e,i)=>{const{x:s=i.attribute.x,boxWidth:n=i.attribute.boxWidth,open:r=i.attribute.open,close:a=i.attribute.close,low:o=i.attribute.low,high:l=i.attribute.high}=t,h={};return h.line={points:[{x:s,y:o},{x:s,y:l}]},h.box={x:s-n/2,x1:s+n/2,y:Math.min(r,a),y1:Math.max(r,a),drawStrokeWhenZeroWH:!0},h}}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}}Gy.type="candlestick";class Vy extends qf{constructor(t,e,i,s,n){super(t,e,i,s,n)}onBind(){super.onBind();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){const t=(t=>{const e=t.getFinalAttribute(),{x:i,y:s,open:n,high:r,low:a,close:o}=e,l={from:{x:i,y:s},to:{x:i,y:s}};return b(n)&&b(o)&&(n>o?(l.from.open=a,l.to.open=n,l.from.close=a,l.to.close=o,b(r)&&(l.from.high=a,l.to.high=r)):(l.from.open=r,l.to.open=n,l.from.close=r,l.to.close=o,b(a)&&(l.from.low=r,l.to.low=a))),l})(this.target,this.params,this.params.options);return t}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}class Hy extends qf{constructor(t,e,i,s,n){super(t,e,i,s,n)}onBind(){var t;(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){const t=(t=>{const e=t.getFinalAttribute(),{x:i,y:s,open:n,high:r,low:a,close:o}=e,l={from:{x:i,y:s},to:{x:i,y:s}};return b(n)&&b(o)&&(n>o?(l.from.open=n,l.to.open=a,l.from.close=o,l.to.close=a,b(r)&&(l.from.high=r,l.to.high=a)):(l.from.open=n,l.to.open=r,l.from.close=o,l.to.close=r,b(a)&&(l.from.low=a,l.to.low=r))),l})(this.target,this.params,this.params.options);return t}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}const Xy="candlestick";var $y,Yy;!function(t){t.OPEN="open",t.HIGH="high",t.LOW="low",t.CLOSE="close",t.SERIES_FIELD="seriesField"}($y||($y={})),function(t){t.candlestick="candlestick"}(Yy||(Yy={}));const qy=Object.assign(Object.assign({},e.baseSeriesMark),{candlestick:{name:"candlestick",type:"candlestick"}});class Ky extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.getContentKey=t=>e=>{switch(t){case $y.OPEN:return this.series.getOpenField();case $y.HIGH:return this.series.getHighField();case $y.LOW:return this.series.getLowField();case $y.CLOSE:return this.series.getCloseField();case $y.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{switch(t){case $y.OPEN:return e[this.series.getOpenField()];case $y.HIGH:return e[this.series.getHighField()];case $y.LOW:return e[this.series.getLowField()];case $y.CLOSE:return e[this.series.getCloseField()];case $y.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>this.series.getMarkInName("candlestick").getAttribute("stroke",t)}getDefaultContentList(t){return[{key:this.getContentKey($y.OPEN),value:this.getContentValue($y.OPEN)},{key:this.getContentKey($y.HIGH),value:this.getContentValue($y.HIGH)},{key:this.getContentKey($y.LOW),value:this.getContentValue($y.LOW)},{key:this.getContentKey($y.CLOSE),value:this.getContentValue($y.CLOSE)},{key:this.getContentKey($y.SERIES_FIELD),value:this.getContentValue($y.SERIES_FIELD)}]}}const Zy={rising:{style:{boxFill:"#FF0000",stroke:"#FF0000"}},falling:{style:{boxFill:"#00AA00",stroke:"#00AA00"}},doji:{style:{boxFill:"#000000",stroke:"#000000"}},candlestick:{style:{lineWidth:1}}};class Jy extends e.CartesianSeries{constructor(){super(...arguments),this.type=Xy,this._mergedStyles={rising:{},falling:{},doji:{}}}getOpenField(){return this._openField}getHighField(){return this._highField}getLowField(){return this._lowField}getCloseField(){return this._closeField}getBoxFill(){return this._boxFill}getStrokeColor(){return this._strokeColor}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec();const l=this._spec,h=null!==(e=null===(t=l.candlestick)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._openField=l.openField,this._highField=l.highField,this._lowField=l.lowField,this._closeField=l.closeField,this._boxWidth=h.boxWidth,this._boxFill=h.boxFill,this._strokeColor=h.strokeColor,this._buildMergedStyles(h,null!==(s=null===(i=l.rising)||void 0===i?void 0:i.style)&&void 0!==s?s:{},null!==(r=null===(n=l.falling)||void 0===n?void 0:n.style)&&void 0!==r?r:{},null!==(o=null===(a=l.doji)||void 0===a?void 0:a.style)&&void 0!==o?o:{})}initMark(){this._candlestickMark=this._createMark(Jy.mark.candlestick,{groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){var t;const i=this._candlestickMark;if(i){const s={fill:t=>this.mergeStyle(t).boxFill,stroke:t=>this.mergeStyle(t).stroke,lineWidth:t=>this.mergeStyle(t).lineWidth,boxWidth:null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth.bind(this),x:this.dataToPositionX.bind(this)};i.setGlyphConfig({}),this.setMarkStyle(i,s,e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}initCandlestickMarkStyle(){var t;const i=this._candlestickMark,s=this._yAxisHelper;if(i&&s){const{dataToPosition:n}=s,r=null===(t=null==s?void 0:s.getScale)||void 0===t?void 0:t.call(s,0);this.setMarkStyle(i,{open:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._openField),{bandPosition:this._bandPosition}),r),high:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._highField),{bandPosition:this._bandPosition}),r),low:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._lowField),{bandPosition:this._bandPosition}),r),close:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._closeField),{bandPosition:this._bandPosition}),r)},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}init(t){super.init(t),this.initCandlestickMarkStyle()}_initAnimationSpec(t={}){const e=O({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{e[t]&&"scaleIn"===e[t].type?e[t].type="candlestickScaleIn":e[t]&&"scaleOut"===e[t].type&&(e[t].type="candlestickScaleOut")})),e}initAnimation(){var t;const i=e.getGroupAnimationParams(this);if(this._candlestickMark){const s=this._initAnimationSpec(null===(t=e.Factory.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),n=this._initAnimationSpec(e.userAnimationConfig(Xy,this._spec,this._markAttributeContext));this._candlestickMark.setAnimationConfig(e.animationConfig(s,n,i))}}initTooltip(){this._tooltipHelper=new Ky(this),this._candlestickMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._candlestickMark)}_buildMergedStyles(t,e,i,s){this._mergedStyles.rising=O({},t,e),this._mergedStyles.falling=O({},t,i),this._mergedStyles.doji=O({},t,s)}mergeStyle(t){const e=this.getDatumPositionValues(t,this._openField)[0],i=this.getDatumPositionValues(t,this._closeField)[0];return e<i?this._mergedStyles.rising:e>i?this._mergedStyles.falling:this._mergedStyles.doji}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t=this._xAxisHelper,e=this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(){super.onLayoutEnd(),this._autoBoxWidth=null}getActiveMarks(){return[this._candlestickMark]}}Jy.type=Xy,Jy.builtInTheme={candlestick:Zy},Jy.mark=qy;const Qy=()=>{e.registerGlyphMark(),Fg(),Gg(),e.Factory.registerGraphicComponent("line",(t=>sh(t))),e.Factory.registerGraphicComponent("rect",(t=>ah(t))),e.Factory.registerMark(Gy.type,Gy),e.registerSymbolMark(),e.registerScaleInOutAnimation(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),jf.registerBuiltInAnimate("candlestickScaleIn",Vy),jf.registerBuiltInAnimate("candlestickScaleOut",Hy),e.Factory.registerSeries(Jy.type,Jy)};class tb extends e.BaseChart{_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}tb.type="candlestick",tb.seriesType=Xy,tb.transformerConstructor=zy;const eb=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class ib extends Al{constructor(t,e){super(t),this._skipRenderAttributes=eb,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i,s){const n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);if(n)return this._setAttributes(n,i);d(this.attribute[t])&&d(e)&&!o(this.attribute[t])&&!o(e)?O(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){l(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const s=e[i];!d(this.attribute[s])||o(this.attribute[s])||o(t[s])?this.attribute[s]=t[s]:O(this.attribute[s],t[s])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const s=new Vr(t,e);s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(s)}eventPosToStagePos(t){var e,i;const s={x:0,y:0},n=null!==(i=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==i?i:{x:0,y:0};return this.globalTransMatrix.transformPoint(n,s),s}}var sb;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(sb||(sb={}));const nb={[sb.selectedReverse]:{},[sb.selected]:{},[sb.hover]:{},[sb.hoverReverse]:{}};function rb(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&rb(t,e)}))}function ab(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function ob(t,e,i){return Math.abs(t-e)<i}function lb(t,e="type"){return"rich"===function(t,e="type"){var i,s;return c(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}(t,e)}const hb=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function cb(){Lg(),Gg(),Zg(),$g(),Qg()}var ub=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};cb();class db extends ib{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},db.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;this.cacheStates();const{text:s="",textStyle:n={},shape:r={},panel:o={},space:u=4,minWidth:d,maxWidth:p,padding:f=4,visible:m,state:v,type:x,textAlwaysCenter:_,containerTextAlign:A}=this.attribute,S=function(t){if(b(t))return[t,t,t,t];if(g(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,s]=t;return[e,i,s,i]}if(4===e)return t}if(c(t)){const{top:e=0,right:i=0,bottom:s=0,left:n=0}=t;return[e,i,s,n]}return[0,0,0,0]}(f),T=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let M,B=-S[3],C=-S[0],k=S[1]+S[3],P=S[0]+S[2],O=0,R=0;const{visible:L}=r,E=ub(r,["visible"]);if(a(L)){const t=(null==E?void 0:E.size)||10,e=y(t)?t:Math.max(t[0],t[1]);M=T.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},E),{visible:L,x:e/2,y:e/2}),"symbol"),w(null==v?void 0:v.shape)||(M.states=v.shape),L&&(R=e+u)}let I,D,F;if(k+=R,O+=R,lb({text:s})||"rich"===x){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,i;return h(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:x,text:s},n))),n),{visible:h(s)&&!1!==m,x:O,y:0});l(t.lineHeight)&&(t.lineHeight=n.fontSize),I=T.createOrUpdateChild("tag-text",t,"richtext"),D=I.AABBBounds.width(),F=I.AABBBounds.height()}else{const i=Object.assign(Object.assign({text:c(s)&&"type"in s&&"text"===s.type?s.text:s,visible:h(s)&&!1!==m,lineHeight:null==n?void 0:n.fontSize},n),{x:O,y:0});l(i.lineHeight)&&(i.lineHeight=n.fontSize),I=T.createOrUpdateChild("tag-text",i,"text");const r=function(t,e,i={}){if(!t)return{width:0,height:0};const s=zh({text:t,fontFamily:e.fontFamily||i.fontFamily||"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",fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:s.width(),height:s.height()}}(i.text,n,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);D=r.width,F=r.height}k+=D;const U=null!==(i=r.size)&&void 0!==i?i:10,N=y(U)?U:Math.max(U[0],U[1]);P+=Math.max(F,r.visible?N:0);const{textAlign:W,textBaseline:z}=n;(h(d)||h(p))&&(h(d)&&k<d&&(k=d),h(p)&&k>p&&(k=p,I.setAttribute("maxLineWidth",p-S[1]-S[2]))),B=0,C=0;let G=0;"left"===W||"start"===W?G=1:"right"===W||"end"===W?G=-1:"center"===W&&(G=0),G?G<0?(B-=k,M&&M.setAttribute("x",(M.attribute.x||0)-D),T.setAttribute("x",-S[1]-R)):G>0&&T.setAttribute("x",S[3]):(B-=k/2,M&&M.setAttribute("x",(M.attribute.x||0)-D/2),T.setAttribute("x",-R/2));const V="right"===A||"end"===A,H="left"===A||"start"===A,X=(t,e)=>{"richtext"===I.type?I.setAttributes({x:t,textAlign:e,textConfig:j(I.attribute.textConfig).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):I.setAttributes({x:t,textAlign:e})};if((A?"center"===A:_)&&G){const t=k-S[1]-S[3],e=D+R,i=1===G?(t-e)/2+R+D/2:S[0]+R-(k/2+e/2-R)+D/2;if(X(i,"center"),M){const t=i-D/2-R+N/2;M.setAttributes({x:t})}}if(H&&1!==G){const t=k-S[1]-S[3],e=0===G?-t/2+R/2:-k+S[3]+S[1]+R;if(X(e+R,"left"),M){const t=e+N/2;M.setAttributes({x:t})}}if(V&&-1!==G){const t=k-S[1]-S[3],e=0===G?t/2+R/2:t;if(X(e,"right"),M){const t=e-D-R+N/2;M.setAttributes({x:t})}}"middle"===z?(C-=P/2,M&&M.setAttribute("y",0)):"bottom"===z?(C-=P,M&&M.setAttribute("y",-F/2),T.setAttribute("y",-S[2])):"top"===z&&(T.setAttribute("y",S[0]),M&&M.setAttribute("y",F/2)),w(null==v?void 0:v.text)||(I.states=v.text);const{visible:$}=o,Y=ub(o,["visible"]);if(m&&a($)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},Y),{visible:$&&!!s,width:k,height:P,x:B,y:C}),"rect");if(w(null==v?void 0:v.panel)||(t.states=v.panel),Y.customShape){const e=Y.customShape;t.pathProxy=t=>e(this,t,new yn)}this._bgRect=t}this._textShape=I,this._symbol=M,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:O({},db.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,s,n,r,a,o,l,h,c,u,d,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(n=null===(s=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===s?void 0:s.slice())&&void 0!==n?n:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(c=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==c?c:[],this.clearStates(),null===(u=this._bgRect)||void 0===u||u.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function pb(){Lg(),Fg(),Ug(),Zg()}function gb(){Lg(),Fg(),kg(),Zg()}db.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}},pb();class fb extends ib{getStartAngle(){return Tt(this._startAngle)}getEndAngle(){return Tt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},fb.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!n)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(b(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(W(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var n,r;const a=Nh.line(Object.assign(Object.assign({points:t},g(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),w(null==s?void 0:s.line)||(a.states=g(s.line)?null!==(r=s.line[e])&&void 0!==r?r:s.line[s.line.length-1]:s.line),this.add(a),this.lines.push(a)}))}else{let t=Nh.line;j(i)[0].cornerRadius&&(t=Nh.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},j(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),w(null==s?void 0:s.line)||(e.states=[].concat(s.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:s=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:c=0,refY:u=0,refAngle:d=0,style:p,symbolType:g,size:f=12}=t;let m,y;"start"===i?(m={x:l.x+(b(r)?c*Math.cos(r)+u*Math.cos(r-Math.PI/2):0),y:l.y+(b(r)?c*Math.sin(r)+u*Math.sin(r-Math.PI/2):0)},y=this._computeStartRotate(this._startAngle)):(m={x:h.x+(b(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(b(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},y=this._computeEndRotate(this._endAngle)),n=Nh.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:g,size:f,angle:s?y+d:0,strokeBoundsBuffer:0}),p)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),w(null==o?void 0:o.symbol)||(n.states=o.symbol),"start"===i?w(null==o?void 0:o.startSymbol)||(n.states=o.startSymbol):w(null==o?void 0:o.endSymbol)||(n.states=o.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let s;return s=e?b(i)?t[i]:W(t):t,this._mainSegmentPoints=s,s}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let s=t;if(e.visible){const i=e.clip?e.size||10:0;s=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...s.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,n={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};s=[...s.slice(0,s.length-1),n]}return s}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],s=t[t.length-2],n=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[n.x-s.x,n.y-s.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}fb.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},gb();class mb extends fb{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},fb.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!n)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},c={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,c];const u=this._renderSymbol(t,this._mainSegmentPoints,"start"),d=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=u,this.endSymbol=d;const p=Nh.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),w(null==s?void 0:s.line)||(p.states=[].concat(s.line)[0]),this.add(p),this.line=p}}var yb,bb,vb,xb;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(yb||(yb={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.topLeft="topLeft",t.topRight="topRight",t.bottomLeft="bottomLeft",t.bottomRight="bottomRight",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideTopLeft="insideTopLeft",t.insideTopRight="insideTopRight",t.insideBottomLeft="insideBottomLeft",t.insideBottomRight="insideBottomRight"}(bb||(bb={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(vb||(vb={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(xb||(xb={}));class _b extends ib{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=((t,e,i)=>{const s=t.target;return s!==i&&s.name&&!w(s.states)?(s.addState(sb.hover,!0),rb(e,(t=>{t!==s&&t.name&&!w(t.states)&&t.addState(sb.hoverReverse,!0)})),s):i})(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,i)=>i?(rb(e,(t=>{t.name&&!w(t.states)&&(t.removeState(sb.hoverReverse),t.removeState(sb.hover))})),null):i)(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,i)=>{const s=t.target;return i===s&&s.hasState(sb.selected)?(rb(e,(t=>{t.name&&!w(t.states)&&(t.removeState(sb.selectedReverse),t.removeState(sb.selected))})),null):s.name&&!w(s.states)?(s.addState(sb.selected,!0),rb(e,(t=>{t!==s&&t.name&&!w(t.states)&&t.addState(sb.selectedReverse,!0)})),s):i})(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const s=c(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:O({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:O({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:O({},this.defaultUpdateAnimation,s,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:s,select:n}=this.attribute;s&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),n&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;let n;if(s){const s=Nh.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));n=Nh.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),s.add(n),this._containerClip=s,this.add(s)}else n=Nh.group({x:0,y:0,pickable:!1}),this.add(n);n.name="marker-container",this._container=n}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:s?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:s?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}const Ab={type:"callIn",duration:500,easing:"linear",delay:0},Sb={type:"fadeOut",duration:500,easing:"linear",delay:0},Tb=.001;yb.end,vb.arcOuterMiddle,bb.right,vb.arcOuterMiddle;const wb={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};Lg(),cb(),Yf(),pb(),gb(),Zg(),Ig(),Fg(),Yf();class Mb extends _b{markerAnimate(t){Mb._animate&&this._animationConfig&&Mb._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},Mb.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=Ab,this.defaultExitAnimation=Sb,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,s,n){return ob(Math.abs(s),Math.PI/2,Tb)||ob(Math.abs(s),3*Math.PI/2,Tb)?function(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}(t,s,n):ab(s)?wb.postiveXAxis[n]:wb.negativeXAxis[n]}setItemAttributes(t,e,i,s,n){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:c=0,style:u,position:d=xb.middle}=e,{state:p}=this.attribute,g=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(g)+h*Math.cos(g-Math.PI/2),m=l*Math.sin(g)+h*Math.sin(g-Math.PI/2);if("text"===n){const n=s.x-i.x,r=s.y-i.y;t.setAttributes(Object.assign(Object.assign({},u),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,n,r,g,null!==(a=e.position)&&void 0!==a?a:"end")),u.textStyle),state:{panel:O({},nb,null==p?void 0:p.textBackground),text:O({},nb,null==p?void 0:p.itemContent)}}))}else("richText"===n||"image"===n)&&(t.setAttributes({dx:this.getItemDx(t,d,u)+(u.dx||0),dy:this.getItemDy(t,d,u)+(u.dy||0)}),t.states=O({},nb,null==p?void 0:p.itemContent));const y=ab(g)?g:g-Math.PI;t.setAttributes({x:s.x+(f||0),y:s.y+(m||0),angle:o&&y+c})}getItemDx(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==n?n:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==n?n:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,i){const{state:s}=this.attribute,{type:n="text",style:r,renderCustomCallback:a}=t;let o;return"symbol"===n?(o=Nh.symbol(Object.assign(Object.assign({},i),r)),o.states=O({},nb,null==s?void 0:s.itemContent)):"text"===n?o=new db(Object.assign(Object.assign({},i),{state:{panel:O({},nb,null==s?void 0:s.textBackground),text:O({},nb,null==s?void 0:s.itemContent)}})):"richText"===n?(o=Nh.richtext(Object.assign(Object.assign({},i),r)),o.states=O({},nb,null==s?void 0:s.itemContent)):"image"===n?(o=Nh.image(Object.assign(Object.assign({},i),r)),o.states=O({},nb,null==s?void 0:s.itemContent)):"custom"===n&&a&&(o=a(),o.states=O({},nb,null==s?void 0:s.itemContent)),o.name=`mark-point-${n}`,this.setItemAttributes(o,t,e,i,n),o}getItemLineAttr(t,e,i){let s=[],n={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,c=i.x-e.x,u=i.y-e.y;if(this._isStraightLine=ob(c,0,Tb)||ob(u,0,Tb),this._isArcLine){const{x:t,y:e}=this.attribute.position,{x:s,y:l}=i,c=(t+s)/2,u=c+h*(l>e?-1:1)*c,d=(e===l?0:-(t-s)/(e-l))*(u-c)+(e+l)/2;a=hb(e-d,t-u),o=hb(l-d,s-u),n={x:u,y:d};const p=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e)),g=this.attribute.targetSymbol.style.size/2;a+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?o<a&&(o+=2*Math.PI):a<o&&(a+=2*Math.PI),r=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e))}else s="type-do"!==l||this._isStraightLine?"type-po"!==l||this._isStraightLine?"type-op"!==l||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return s=function(t){const e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(s),{points:s,center:n,radius:r,startAngle:a,endAngle:o}}reDrawLine(t,e){this._line.release();const{startSymbol:i,endSymbol:s,lineStyle:n,type:r="type-s"}=t,{state:a}=this.attribute,o=this._isArcLine?mb:fb;this._container.removeChild(this._line),this._line=new o(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:i,endSymbol:s,lineStyle:n,visible:t.visible,state:{line:O({},nb,null==a?void 0:a.line),startSymbol:O({},nb,null==a?void 0:a.lineStartSymbol),endSymbol:O({},nb,null==a?void 0:a.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,i){if(this._line){const{startSymbol:s,endSymbol:n,lineStyle:r,type:a="type-s"}=t,{state:o}=this.attribute,l=this.getItemLineAttr(t,e,i);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},l),{startSymbol:s,endSymbol:n,lineStyle:r,visible:t.visible,state:{line:O({},nb,null==o?void 0:o.line),startSymbol:O({},nb,null==o?void 0:o.lineStartSymbol),endSymbol:O({},nb,null==o?void 0:o.lineEndSymbol)}})):this.reDrawLine(t,l)}}getDecorativeLineAttr(t){var e;const i=(null===(e=null==t?void 0:t.decorativeLine)||void 0===e?void 0:e.length)||10,s=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(s-Math.PI/2),startPointOffsetY:i/2*Math.sin(s-Math.PI/2),endPointOffsetX:-i/2*Math.cos(s-Math.PI/2),endPointOffsetY:-i/2*Math.sin(s-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var s;if(this._decorativeLine){const{lineStyle:n}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+o,y:e.y+l}]},n),{visible:i})),this._decorativeLine.states=O({},nb,null===(s=this.attribute.state)||void 0===s?void 0:s.line)}}setTargetItemAttributes(t,e){var i,s;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!==(i=t.visible)&&void 0!==i&&i,size:t.size},t.style)),this._targetItem.states=O({},nb,null===(s=this.attribute.state)||void 0===s?void 0:s.targetItem))}setAllOfItemsAttr(t,e){var i;const{position:s,itemLine:n={},itemContent:r={},limitRect:a,targetSymbol:o}=this.attribute,{type:l="text",confine:h}=r;if(a&&h){const{x:t,y:i,width:s,height:n}=a,{dx:r,dy:o}=function(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds;let c=0,u=0;return a<i&&(c=i-a),o<s&&(u=s-o),l>n&&(c=n-l),h>r&&(u=r-h),{dx:c,dy:u}}(this._item,{x1:t,y1:i,x2:t+s,y2:i+n});e.x=e.x+r,e.y=e.y+o}this.setTargetItemAttributes(o,s),this.setItemLineAttr(n,t,e),this.setItemAttributes(this._item,r,t,e,l),this.setDecorativeLineAttr(n,e,null===(i=n.decorativeLine)||void 0===i?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;const{itemContent:s={},targetSymbol:n,itemLine:r}=this.attribute,{offsetX:a=0,offsetY:o=0}=s,{offset:l=0,style:h,visible:c=!1,size:u}=n,d=c?null!==(i=null!==(e=h.size)&&void 0!==e?e:u)&&void 0!==i?i:20:0;let p;return p="type-do"===r.type?hb(o,a/2):"type-po"===r.type?hb(0,a):"type-op"===r.type?hb(o,0):hb(o,a),{newPosition:{x:t.x+(d/2+l)*Math.cos(p),y:t.y+(d/2+l)*Math.sin(p)},newItemPosition:{x:t.x+(d/2+l)*Math.cos(p)+a,y:t.y+(d/2+l)*Math.sin(p)+o}}}initMarker(t){const{position:e,itemContent:i={},itemLine:s}=this.attribute,{type:n="type-s",arcRatio:r=.8}=s,{offsetX:a=0,offsetY:o=0}=i;this._isStraightLine=ob(a,0,Tb)||ob(o,0,Tb),this._isArcLine="type-arc"===n&&0!==r&&!this._isStraightLine;const{newPosition:l,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),c=new(this._isArcLine?mb:fb)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});c.name="mark-point-line",this._line=c,t.add(c);const u=Nh.line({points:[]});u.name="mark-point-decorativeLine",this._decorativeLine=u,t.add(u);const d=Nh.symbol({});d.name="mark-point-targetItem",this._targetItem=d,t.add(this._targetItem);const p=this.initItem(i,l,h);this._item=p,t.add(p),this.setAllOfItemsAttr(l,h)}updateMarker(){const{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:s="text"}=e,{type:n="type-s",arcRatio:r=.8}=i,{offsetX:a=0,offsetY:o=0}=e;this._isStraightLine=ob(a,0,Tb)||ob(o,0,Tb);const l="type-arc"===n&&0!==r&&!this._isStraightLine,{newPosition:h,newItemPosition:c}=this.computeNewPositionAfterTargetItem(t);l!==this._isArcLine?(this._isArcLine=l,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=l,this.setItemAttributes(this._item,e,h,c,s),this.setAllOfItemsAttr(h,c)}isValidPoints(){const{position:t}=this.attribute;return!(!b(t.x)||!b(t.y))}}Mb.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};const Bb="seriesBreak";function Cb(t,e,i,s,n=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=n?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),u=Math.PI/180*s,d=i*Math.cos(u),p=i*Math.sin(u);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=n?a+(t%2==0?d:-d):a+t*i*2,s=n?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${s}`)}return r.push(`L ${n?a:l} ${n?h:o}`),r.join(" ")}const kb=(t,e)=>{const{start:i,end:s}=e,n=i.x===s.x,r=n?"x":"y",a=n?"y":"x";let o=!0;const l=1e-6;t.length&&t.forEach((t=>{if(function(t,e,i=1e-10,s=1e-10){const n=s,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}(t.start[r],i[r])){const e=Math.min(i[a],s[a]),n=Math.max(i[a],s[a]),r=Math.min(t.start[a],t.end[a]),h=Math.max(t.start[a],t.end[a]);if(!(n<r-l||e>h+l))return t.start[a]=Math.min(r,e),t.end[a]=Math.max(h,n),void(o=!1)}})),o&&t.push(e)};class Pb extends ib{constructor(){super(...arguments),this.name=Bb}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(w(t))return;const e=[],i=[];t.forEach((t=>{const{start:s,end:n}=t,r=s.x===n.x;kb(r?e:i,t)})),[...e,...i].forEach(((t,e)=>{var i;const{start:s,end:n,size:r=4,gap:a=5,style:o={}}=t,l=Ve(t,["start","end","size","gap","style"]),c=Sl({}),u=s.x===n.x;let d,p,g,f;u?(d={x:s.x-a/2,y:s.y},p={x:n.x-a/2,y:n.y},g={x:s.x+a/2,y:s.y},f={x:n.x+a/2,y:n.y}):(d={x:s.x,y:s.y-a/2},p={x:n.x,y:n.y-a/2},g={x:s.x,y:s.y+a/2},f={x:n.x,y:n.y+a/2});const m=Cb(d,p,r,u?75:15,u),y=Cb(s,n,r,u?75:15,u),b=Cb(g,f,r,u?75:15,u);c.add(wh(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh({path:y,stroke:"#fff",lineWidth:a,pickable:!1,zIndex:0})),c.name="series-break",c.data=l,h(l.axisId)&&(c.id=`${null!==(i=l.axisId)&&void 0!==i?i:""}_${e}`),this.add(c)}))}}function Ob(t,e,i=1){return Math.abs(t-e)<i}function Rb(t,e){return{type:"component",componentType:Bb,interactive:!0,zIndex:500,style:{data:(i,s)=>{const n=[],r=s.vchart.getChart(),a="horizontal"===r.getAllSeries()[0].direction;return t.forEach(((t,i)=>{var s,o;const l=t.id,c=h(l)?r.getComponentByUserId(l):e&&h(e[i])?r.getComponentByIndex("axes",e[i]):null===(s=r.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===s?void 0:s[0];if(!c)return;const u=null!=l?l:`${c.type}-${c.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}return{x1:e,y1:i,x2:s,y2:n}}(c.getRegions());j(null===(o=c._break)||void 0===o?void 0:o.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:s=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(o+l)/2+(a?d.x1:d.y1);r.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const r=t.AABBBounds;let c,p,g,f,m=!1;a?(m=r.x1<(o+l-s)/2&&r.x2>(o+l+s)/2,c=h,p=Math.max(r.y1+d.y1-2,d.y1),g=h,f=Math.min(r.y2+d.y1+2,d.y2)):(m=r.y1<(o+l-s)/2&&r.y2>(o+l+s)/2,c=Math.max(r.x1+d.x1-2,d.x1),p=h,g=Math.min(r.x2+d.x1+2,d.x2),f=h),m&&n.push({start:{x:c,y:p},end:{x:g,y:f},gap:s,style:null==i?void 0:i.style,axisId:u,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{Eb(t,"line").forEach((t=>{Lb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t).forEach((t=>{let r,o;a?(r={x:h,y:Math.max(t[1]+d.y1-10,d.y1)},o={x:h,y:Math.min(t[1]+d.y1+10,d.y2)}):(r={x:Math.max(t[0]+d.x1-10,d.x1),y:h},o={x:Math.min(t[0]+d.x1+10,d.x2),y:h}),n.push({start:r,end:o,gap:s,style:null==i?void 0:i.style,axisId:u,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{Eb(t,"area").forEach((t=>{const r=Lb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t);r.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<r.length-1;o++){const l={x:r[o][0],y:r[o][1]},h={x:r[o+1][0],y:r[o+1][1]};if(Ib(a?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;a?(t={x:l.x+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},r={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},r={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),n.push({start:t,end:r,gap:s,style:null==i?void 0:i.style,axisId:u,data:e})}}}))}))}}))}))})),n}}}}function Lb(t,e){const i=[];for(let s=1;s<e.length;s++){const n=Mt([t.start.x,t.start.y],[t.end.x,t.end.y],[e[s].x,e[s].y],[e[s-1].x,e[s-1].y]);n&&!i.find((t=>Ob(vt.distancePP({x:t[0],y:t[1]},{x:n[0],y:n[1]}),0)))&&i.push(n)}return i}function Eb(t,e){const{points:i,segments:s}=t.attribute,n=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var s,a;if(!1===t.defined){if(n.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(s=t.x1)&&void 0!==s?s:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}n.push(r)}};return i&&i.length?a(i):s&&s.length&&s.forEach((t=>{a(t.points)})),n}function Ib(t,e){const{x:i,y:s}=t;let n=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>s!=h>s&&i<(l-a)*(s-o)/(h-o)+a&&(n=!n)}return n}const Db="barLink";class Fb extends ib{constructor(){super(...arguments),this.name=Db}render(){const{data:t,linkStyle:i,areaStyle:s,styleMap:n,label:r,linkType:a="total"}=this.attribute;w(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,u,d;const{linePoints:p,areaPoints:g,id:f=o,color:m,data:y}=t;if(g&&!1!==(null===(l=null==n?void 0:n[`area-${f}`])||void 0===l?void 0:l.visible)){const t=(b=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:m,zIndex:0},s),null==n?void 0:n[`area-${f}`]),new Bh(b));t.name="bar-link-area",t.id=`area-${f}`,this.add(t)}var b;if(p&&!1!==(null===(h=null==n?void 0:n[`line-${f}`])||void 0===h?void 0:h.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==n?void 0:n[`line-${f}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:s}=i||{},r=B(t),a=B(e);(null==n?void 0:n[`line-${f}`])&&n[`line-${f}`].stroke&&(r.style=Object.assign(Object.assign({},r.style),{color:n[`line-${f}`].stroke}),a.style=Object.assign(Object.assign({},a.style),{color:n[`line-${f}`].stroke})),r.symbolType||r.originSymbolType||(r.originSymbolType="solidArrow"),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow");const o=new fb({points:p,startSymbol:Object.assign({size:8},r),endSymbol:Object.assign({size:8},a),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},s),null==n?void 0:n[`line-${f}`]),pickable:!0,childrenPickable:!1,zIndex:1});o.name="bar-link-line",o.id=`line-${f}`,this.add(o)}if((null==r?void 0:r.visible)&&!1!==(null===(d=null==n?void 0:n[`label-${f}`])||void 0===d?void 0:d.visible)){const{style:t,formatMethod:i}=r,[s,o]=y;let l=s[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===a&&(l=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,u=(h-l)/l*100,d=Zl(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,y):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==n?void 0:n[`label-${f}`]));d.name="bar-link-label",d.id=`label-${f}`,this.add(d)}})))}}function jb(t,i,s){const{isHorizontal:n,isXAxisInverse:r,isYAxisInverse:a,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=s,u=t.AABBBounds,d=i.AABBBounds;let p,g;return n?(p=[{x:(u.x1+u.x2)/2+h,y:u.y1+c},{x:(d.x1+d.x2)/2+h,y:d.y2+c}],r?("total"===o&&(p=[{x:u.x1+h,y:u.y1+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x1+h,x1:u.x2+h,y:u.y1+c},{x:d.x1+h,x1:d.x2+h,y:d.y2+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x2+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,x1:u.x1+h,y:u.y1+c},{x:d.x2+h,x1:d.x1+h,y:d.y2+c}]))):(p=[{x:u.x2+h,y:(u.y1+u.y2)/2+c},{x:d.x1+h,y:(d.y1+d.y2)/2+c}],a?("total"===o&&(p=[{x:u.x2+h,y:u.y2+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,y:u.y2+c,y1:u.y1+c},{x:d.x1+h,y:d.y2+c,y1:d.y1+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x1+h,y:d.y1+c}]),l&&(g=[{x:u.x2+h,y:u.y1+c,y1:u.y2+c},{x:d.x1+h,y:d.y1+c,y1:d.y2+c}]))),{areaPoints:g,linePoints:p,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function Ub(t={},i){const{linkType:s="total",doFill:n}=t,r=Ve(t,["linkType","doFill"]);return{type:"component",componentType:Db,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e;(null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getGraphics()).forEach((t=>{l.push(t)}))}));const h=function(t,i){const s={};for(let n=0;n<t.length;n++){const r=t[n],a=e.getDatumOfGraphic(r),o=i.map((t=>a[t])).join("-");s[o]||(s[o]=[]),s[o].push(r)}return s}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>e.getDatumOfGraphic(t)[e.STACK_FIELD_END]-e.getDatumOfGraphic(i)[e.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,d=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(u){g[0][0].AABBBounds.y1<g[g.length-1][0].AABBBounds.y1&&g.reverse()}else{g[0][0].AABBBounds.x1>g[g.length-1][0].AABBBounds.x1&&g.reverse()}for(let t=0;t<g.length-1;t++){const e=g[t],i=g[t+1];if(e.forEach(((t,e)=>{var l;const h=jb(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:n,linkType:s,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=jb(t,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:n,linkType:s,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:s},r),i)}}const Nb="seriesLabel";function Wb(t,e=10,i=10,s=.1){const n=t.length;if(!t.every(isFinite))return t;if(!(n>1))return t;const r=function(t,e,i){t=+t,e=+e;let s=arguments.length;i=s<2?(e=t,t=0,1):s<3?1:+i;let n=-1;s=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(s);for(;++n<s;)r[n]=t+n*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return s=t[e],n=t[i],null==s||null==n?NaN:s<n?-1:s>n?1:s>=n?0:NaN;var s,n}));let i=0;for(let s=1;s<n;++s){let n=t[r[s]]-t[r[s-1]];n<e&&(n=(e-n)/2,i=Math.max(i,n),t[r[s-1]]-=n,t[r[s]]+=n)}if(i<s)break}return t}function zb(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Gb(t,e=10,i=10){const s=t.length;let n,r=0;do{n=!1;for(let i=0;i<s;++i)for(let r=i+1;r<s;++r){const s=t[i].AABBBounds,a=t[r].AABBBounds;if(zb(s,a)){const i=e-(a.x1-s.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,n=!0)}}r++}while(n&&r<i)}function Vb(t,e){const{label:i,line:s}=e;return{type:"component",componentType:Nb,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(e,i)=>{var s;const n=i.vchart.getChart(),r=n.getAllSeries()[0],a="horizontal"===r.direction,o=a?r.getYAxisHelper():r.getXAxisHelper(),l=null===(s=o.getScale)||void 0===s?void 0:s.call(o,0),h=o.isInverse(),c=r.getDimensionField()[0],u=r.getSeriesField(),d=n.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===d.length&&["bar","area","line","waterfall"].includes(d[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?function(t){if(f(t))return t[t.length-1]}(l.domain()):l.domain()[0],i=r.getRegion(),{x:s,y:o}=i.getLayoutStartPoint();let g=0;n.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===d[0]?"bar":d[0]).getGraphics().forEach((n=>{var r;const l=n.context.data.find((t=>t[c]===e));if(l){const e=n.AABBBounds;let f,m,y,b;"bar"===d[0]||"waterfall"===d[0]?(f="end"===t?{x:a?(e.x1+e.x2)/2:h?e.x1:e.x2,y:a?h?e.y2:e.y1:(e.y1+e.y2)/2}:{x:a?(e.x1+e.x2)/2:h?e.x2:e.x1,y:a?h?e.y1:e.y2:(e.y1+e.y2)/2},m=n.attribute.fill):(f=i.dataToPosition(l),m=n.attribute.stroke||n.attribute.fill),"end"===t?(y=a?"center":h?"end":"start",b=a?h?"top":"bottom":"middle"):(y=a?"center":h?"start":"end",b=a?h?"bottom":"top":"middle");const v=null!==(r=l[u])&&void 0!==r?r:l[c];p.push({point:{x:f.x+s,y:f.y+o},label:v,color:m,textAlign:y,textBaseline:b,series:i,datum:l,id:`${t}-${g}`,position:t}),g++}}))}))}))}return p},line:s,label:Object.assign({space:12},i)}}}class Hb extends ib{constructor(){super(...arguments),this.name=Nb}render(){var t,e,i,s;this.removeAllChild();const{data:n,layout:r,label:a,line:o={}}=this.attribute;if(w(n))return;const l=null!==(t=null==a?void 0:a.styleMap)&&void 0!==t?t:{},h={},c=n.filter((t=>{var e;return!1!==(null===(e=l[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===r){const t=1.5*(null!==(i=null===(e=null==a?void 0:a.style)||void 0===e?void 0:e.fontSize)&&void 0!==i?i:12),s=(t,e,i)=>{var s,n,r,a,o,l,h,c;const{label:u,color:d,textAlign:p,textBaseline:g,id:f}=t,m=null!==(n=null===(s=i[f])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(u,t.datum,{series:t.series}):u},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:d}),null===(c=i[f])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const i=c.filter((t=>t.position===e)),n=Wb(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==a?void 0:a.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:n[e]};s(t,r,l),h[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var s,n,r,o,h;const{point:c,label:u,color:d,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:c.x,y:c.y},b=null!==(n=null===(s=l[f])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null==a?void 0:a.formatMethod,v=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(u,i.datum,{series:i.series}):u},null==a?void 0:a.style),y),{textAlign:p,textBaseline:g,fill:null!==(o=null===(r=null==a?void 0:a.style)||void 0===r?void 0:r.fill)&&void 0!==o?o:d}),null===(h=l[f])||void 0===h?void 0:h.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&Gb(t,4,10),e.length&&Gb(e,4,10);const i=null!==(s=null==a?void 0:a.space)&&void 0!==s?s:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),h[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==o.visible&&c.forEach((t=>{var e,i,s,n,a,c;const{point:u,color:d,id:p}=t,g={x:h[p].x+(null!==(s=null===(i=null===(e=l[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==s?s:0),y:h[p].y+(null!==(c=null===(a=null===(n=l[p])||void 0===n?void 0:n.style)||void 0===a?void 0:a.dy)&&void 0!==c?c:0)};if(!1!==o.autoVisible){if("vertical"===r&&u.y!==g.y||"horizontal"===r&&u.x!==g.x){const t=sh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}else{const t=sh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}))}}function Xb(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function $b(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function Yb(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:$b(t.rect),anchorCandidates:tv(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>Xb(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<n.anchorCandidates.length;t++){const e=n.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!s.some((t=>Xb(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function qb(t,e,i){const s=t.map((t=>t.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=Dt(s),l=i([(n+r)/2,(a+o)/2]);if(!l)return[];const h=t.map((t=>{const s=t.rect,n=Jb(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=de(r,s,i);if(!Jb(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],Kb(Zb(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=Kb(Zb(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=Qb(t.rect,a,0),t}));return Yb(h)}function Kb(t){return t>180?t-360:t}function Zb(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Jb(t,e){for(let i=0;i<t.length;i++){if(ue(e,t[i]))return!0}return!1}function Qb(t,e,i=0){const s=Object.assign({},t);return"top"===e?(s.x-=t.width/2,s.y-=i+t.height/2):"bottom"===e?(s.x-=t.width/2,s.y+=i-t.height/2):"left"===e?(s.x-=i+t.width,s.y-=t.height/2):"right"===e&&(s.x+=i,s.y-=t.height/2),s}function tv(t,e,i,s=0){const n=[];return t.forEach((t=>{const{x:r,y:a}=Qb(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}const ev={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class iv extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return ev}}class sv extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=iv,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&h(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new Ge(this._option.dataSet,{name:`${this.name}_data`});t.parse([i],{type:"dataview"}),t.transform({type:"copyDataView",level:e.TransformLevel.copyDataView},!1),this._data=new e.CompilableData(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const s=new Mb({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s})));this._markerComponents.forEach(((t,s)=>{const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,i){var s,n,r,a,o,l,c,u,d,p,g,f,m,y;let b=0,v=0,x=0,_=0,A=0;const S=this._spec.position||"top",T=this._spec.offset,w=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),M=this._spec.space||0;v+=((null==w?void 0:w.left)||0)+((null==w?void 0:w.right)||0),x+=((null==w?void 0:w.top)||0)+((null==w?void 0:w.bottom)||0);const B={},C=this.dataToPosition(t),k=Nh.group({});if(k.name=`${this.name}_marker_itemContainer_${i}`,B.container=k,null===(n=this._spec.background)||void 0===n?void 0:n.visible){const t=Nh.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),B.labelBackground=t,k.appendChild(t)}if(null===(r=this._spec.icon)||void 0===r?void 0:r.visible){const t=Nh.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(o=null===(a=this._spec.icon.style)||void 0===a?void 0:a.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=t.AABBBounds,s=null!==(c=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==c?c:0,n=null!==(u=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==u?u:0;B.icon=t,k.appendChild(t),A=s,_+=n,b++}if(null===(d=this._spec.nameLabel)||void 0===d?void 0:d.visible){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const s=i.AABBBounds,n=null!==(p=(null==s?void 0:s.y2)-(null==s?void 0:s.y1))&&void 0!==p?p:0,r=null!==(g=(null==s?void 0:s.x2)-(null==s?void 0:s.x1))&&void 0!==g?g:0;B.nameLabel=i,k.appendChild(i),A=Math.max(A,n),_+=r,b++}if((null===(f=this._spec.valueLabel)||void 0===f?void 0:f.visible)&&h(t[this.valueField])){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const s=i.AABBBounds,n=null!==(m=(null==s?void 0:s.y2)-(null==s?void 0:s.y1))&&void 0!==m?m:0,r=null!==(y=(null==s?void 0:s.x2)-(null==s?void 0:s.x1))&&void 0!==y?y:0;B.valueLabel=i,k.appendChild(i),A=Math.max(A,n),_+=r,b++}const P=Object.values(B).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},R={x:O.x,y:O.y,width:0,height:0};R.width=v+_+(b-1)*M,R.height=x+A;const L={rect:R,point:O,index:i};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=Qb(R,S,T),L.anchors=t,L.offset=T}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:B}}_layoutMarkers(t,i){var s,n,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:u}=i[a],d=t[a],p=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),g=this._spec.space||0,f=d.height/2;let m=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:f}),m+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(m+=g)}})),null==c||c.setAttributes({x:0,y:0,width:d.width,height:d.height}),null==u||u.setAttributes({dx:-d.width/2,dy:-d.height/2});const y=this._data.getLatestData()[a],b=this.dataToPosition(y),v=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(n=this._spec.leader)||void 0===n?void 0:n.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:v.x,y:v.y,position:b,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:d.x+d.width/2-b.x,offsetY:d.y+d.height/2-b.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?qb(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):Yb(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}sv.type="mapLabel",sv.specKey="mapLabel",sv.transformerConstructor=iv;t.BAR_LINK=Db,t.Bar3dChart=of,t.Bar3dChartSpecTransformer=yi,t.Bar3dSeries=sf,t.Bar3dSeriesSpecTransformer=sd,t.BarLinkComponent=Fb,t.CandlestickChart=tb,t.CandlestickChartSpecTransformer=zy,t.ConversionFunnelChart=si,t.ConversionFunnelSeries=ni,t.DefaultBandWidth=6,t.Funnel3dChart=gf,t.Funnel3dSeries=df,t.Funnel3dSeriesSpecTransformer=hf,t.Histogram3dChart=ff,t.ImageCloudChart=Wy,t.MapLabelComponent=sv,t.PictogramChart=Fm,t.PictogramChartSpecTransformer=mm,t.PictogramSeries=Im,t.Pie3dChart=Af,t.Pie3dChartSpecTransformer=mf,t.Pie3dSeries=xf,t.Pie3dSeriesSpecTransformer=vf,t.RangeColumn3dChart=um,t.RangeColumn3dChartSpecTransformer=cm,t.RangeColumn3dSeries=om,t.RangeColumn3dSeriesSpecTransformer=hm,t.RankingBar=me,t.RankingList=Te,t.SERIES_BREAK=Bb,t.SequenceScatterKDE=di,t.SequenceScatterLink=oi,t.SequenceScatterPixel=mi,t.SeriesBreakComponent=Pb,t.SeriesLabelComponent=Hb,t.WordCloud3dChart=im,t.WordCloud3dChartSpecTransformer=em,t.WordCloud3dSeries=Jf,t.appendBarLinkConfig=function(t,e){t.customMark=j(t.customMark).filter((t=>t.componentType!==Db)),t.customMark.push(Ub(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=j(t.customMark).filter((t=>t.componentType!==Bb)),t.customMark.push(Rb(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var i,s,n;if(t.customMark=j(t.customMark).filter((t=>t.componentType!==Nb)),e||(e=null!==(n=null!==(i=M(t,Nb))&&void 0!==i?i:M(null===(s=t.series)||void 0===s?void 0:s[0],Nb))&&void 0!==n?n:{}),e.visible){const{position:i="end"}=e,s=Ve(e,["position"]);t.customMark.push(Vb(i,s))}},t.clearSVGSource=function(){ym.clear(),bm=null},t.getBarLinkConfig=Ub,t.getSVGSource=_m,t.getSeriesBreakConfig=Rb,t.getSeriesLabelConfig=Vb,t.register3DPlugin=ed,t.registerAxis3dPlugin=()=>{ed(),af(),(()=>{e.registerCartesianBandAxis();const t=e.Factory.getComponentInKey(e.CartesianBandAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianLinearAxis();const t=e.Factory.getComponentInKey(e.CartesianLinearAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianTimeAxis();const t=e.Factory.getComponentInKey(e.CartesianTimeAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianSymlogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianLogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),nm)}),F(t,rm)})()},t.registerBar3dChart=()=>{ed(),af(),nf(),e.Factory.registerChart(of.type,of)},t.registerBar3dSeries=nf,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(Db,(t=>new Fb(t)))},t.registerCandlestickChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Qy(),e.Factory.registerChart(tb.type,tb)},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([si]),i.useSeries([ni]))},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),pf(),e.Factory.registerChart(gf.type,gf)},t.registerFunnel3dSeries=pf,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),nf(),e.Factory.registerChart(ff.type,ff)},t.registerImageCloudChart=()=>{Ny(),e.Factory.registerChart(Wy.type,Wy)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([sv])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Dm(),e.Factory.registerChart(Fm.type,Fm)},t.registerPictogramSeries=Dm,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),_f(),e.Factory.registerChart(Af.type,Af)},t.registerPie3dSeries=_f,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),lm(),e.Factory.registerChart(um.type,um)},t.registerRangeColumn3dSeries=lm,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([me])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Te,e.BarChart])},t.registerSVGSource=vm,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([di,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([oi,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([mi,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new Pb(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new Hb(t)))},t.registerWordCloud3dChart=sm,t.registerWordCloud3dSeries=Qf,t.registerWordCloudShape3dChart=()=>{ed(),tm(),sm()},t.registerWordCloudShape3dSeries=tm,t.svgSourceMap=ym,t.unregisterSVGSource=xm}));
15
+ ***************************************************************************** */function Ve(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i}const He={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},Xe={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},$e={fill:"#606773",fontSize:12},Ye={fill:"#eff1f9"};class qe extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:s}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=Ve(t,["arrows"]),s=e.filter((t=>"left"===t.position)),n=e.filter((t=>"right"===t.position)),r=Ke(n,i),a=Ke(s,i),o=[];r&&(r.name="arrowRight",o.push(r));a&&(a.name="arrowLeft",o.push(a));return o}(e);t&&t.length&&i.push(...t)}if(s&&s.visible){const t=function(t){const{style:e={}}=t,i=Ve(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},Ye),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:s}=i.getLayoutRect();return s},height:(t,e)=>{const i=e.getPoints(t),s=i[0];return i[3].y-s.y}})})}(s);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function Ke(t,i){if(0===(null==t?void 0:t.length))return null;const{line:s,symbol:n,text:r,margin:a}=i,l=[],h={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},c=function(t={},e){const{style:i={}}=t,s=Ve(t,["style"]),n=(t,e)=>{var i,s;const{from:n,to:r}=t,{vchart:a}=e,o=null===(s=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===s?void 0:s.latestData;return!(r>o.length-1||n>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},s),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},He),i),{renderable:n,points:(t,i)=>{if(!n(t,i))return[];let s=t.layout.points;return s=Ze(t,i,e),s}})})}(s,a);c&&l.push(c);const u=function(t={},e){const{style:i={}}=t,s=Ve(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},s),{style:Object.assign(Object.assign(Object.assign({},Xe),i),{x:(t,i)=>{var s,n;let r=t.layout.points;return r=Ze(t,i,e),null!==(n=null===(s=r[(null==r?void 0:r.length)-1])||void 0===s?void 0:s.x)&&void 0!==n?n:NaN},y:(t,i)=>{var s,n;let r=t.layout.points;return r=Ze(t,i,e),null!==(n=null===(s=r[(null==r?void 0:r.length)-1])||void 0===s?void 0:s.y)&&void 0!==n?n:NaN},angle:t=>"left"===t.position?90:-90})})}(n,a);u&&l.push(u);const d=function(t={},e){const{style:i={},formatMethod:s,textMargin:n=4}=t,r=Ve(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},r),{style:Object.assign(Object.assign(Object.assign({},$e),{text:(t,e)=>{var i,n,r,a,l,h,c;const{text:u}=t;let d=u;if(o(s)){const{vchart:o}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(r=null===(n=null===(i=null==o?void 0:o.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData)&&void 0!==r?r:[],y=null!==(c=null===(h=null===(l=null===(a=null==o?void 0:o.getChart())||void 0===a?void 0:a.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==c?c:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));d=s(u,{arrow:t,from:b,to:v})}return d},x:(t,i)=>{var s,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=(null===(s=a[1])||void 0===s?void 0:s.x)+("left"===t.position?-n:n))&&void 0!==r?r:NaN},y:(t,i)=>{var s,n,r;let a=t.layout.points;return a=Ze(t,i,e),null!==(r=((null===(s=a[1])||void 0===s?void 0:s.y)+(null===(n=a[2])||void 0===n?void 0:n.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),i)})}(r,a);return d&&l.push(d),h.children=l,h}function Ze(t,e,i){var s,n,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:u}=t.context,d=null===(n=null===(s=null==l?void 0:l.getChart())||void 0===s?void 0:s.getSeriesData())||void 0===n?void 0:n.latestData,p=null===(o=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(d&&d.length){const s=p.find((t=>t[u]===d[h][u])),n=p.find((t=>t[u]===d[c][u])),r=p[0];if(s&&n&&r){g=function(t,e,i,s,n=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:u,toTotal:d}=r,p="right"===o,g=p?e[1]:e[0],f=p?e[2]:e[3],m=Math.abs(g.y-f.y),y=p?i[1]:i[0],b=p?i[2]:i[3],v=Math.abs(y.y-b.y),x=p?s[1]:s[0],_=m/(u+1),A=v/(d+1),S=g.y+_*(h+1),T=y.y+A*(c+1),w=p?-1:1,M=[{x:g.x-n*w,y:S},{x:x.x-(n+(l+1)*a)*w,y:S},{x:x.x-(n+(l+1)*a)*w,y:T},{x:y.x-n*w,y:T}];return M}(t,e.getPoints(s),e.getPoints(n),e.getPoints(r),i),t.layout.points=g}}return g}function Je(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return s>n&&r>i}function Qe(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return i===n&&s===r}const ti=(t,e)=>{var i,s,n;if(!t||!(null===(i=t.arrows)||void 0===i?void 0:i.length))return[];const{arrows:r}=t,a=function(t,e){return t.filter((t=>b(t.from*t.to))).map(((t,i)=>{const{from:s,to:n,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(s,n),to:Math.max(s,n),span:Math.abs(s-n),isLayout:!1,context:{field:e},layout:{level:0},id:`${s}-${n}-${r}-${i}`})}))}(r,e.categoryField),o=a.filter((t=>"left"===t.position)),l=a.filter((t=>"right"===t.position));return[...null!==(s=ei(o))&&void 0!==s?s:[],...null!==(n=ei(l))&&void 0!==n?n:[]]};function ei(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const i=e.get(t.from);if(h(i)){const e=i.fromArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:i.degree+=1,i.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const s=e.get(t.to);if(h(s)){const e=s.toArrows.find((e=>Qe(e,t)));e?t.layout.duplicateNode=e:s.degree+=1,s.toArrows.push(t)}else e.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),e.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((i=>{var s;const n=t.filter((t=>t.layout.isLayout)),r=((t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,s))&&void 0!==i?i:r-s)>0&&(s=r)}return s})(n,((t,e)=>t.layout.level-e.layout.level));let a=null!==(s=null==r?void 0:r.layout.level)&&void 0!==s?s:0;for(;a>=0;){if(n.some((t=>t.layout.level===a&&Je(t,i)))){a+=1;break}--a}i.layout.level=Math.max(0,a),i.layout.fromTotal=e.get(i.from).degree,i.layout.toTotal=e.get(i.to).degree;const o=i.layout.duplicateNode;o?(i.layout.fromIndex=o.layout.fromIndex,i.layout.toIndex=o.layout.toIndex):(i.layout.fromIndex=ii(i,e.get(i.from).totalArrows),i.layout.toIndex=ii(i,e.get(i.to).totalArrows)),i.layout.isLayout=!0})),t}function ii(t,e){let i=0,s=0;for(let n=0;n<e.length;n++){const r=e[n];if(r===t){i=n-s;break}r.layout.duplicateNode&&s++}return i}class si extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=qe}}si.type="conversionFunnel",si.transformerConstructor=qe;class ni extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new Ge(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",ti),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const ri="dataKey";class ai extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,n,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const s=t.data[i].nodes;e.push({data:[{id:"nodes",values:s.map(((t,e)=>Object.assign(Object.assign({},t),{[ri]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),o="neighborhood"!==t.taskType;t.type="common",t.dataKey=ri,t.data=a[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"==t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(n=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class oi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=ai}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,data:a}=this._spec;return n&&r?!!a||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}oi.type="sequenceScatterLink",oi.view="singleDefault",oi.transformerConstructor=ai;const li=.2;function hi(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const ci="dataKey";class ui extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,n,r,a;super.transformSpec(t);const o=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const s=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[ci]:e}))),n=function(t,e=100,i){const s=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),n=[];return Object.entries(s).forEach((([t,s])=>{const r=i||function(t){return t.length**(-1/6)}(s),a=s.map((t=>t.x)),o=s.map((t=>t.y)),l=Math.min(...a),h=Math.max(...a),c=Math.min(...o),u=Math.max(...o),d=l-(h-l)*li,p=c-(u-c)*li;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=d+.1*i,o=p+.1*a;let l=0;for(const t of s)l+=hi(Math.sqrt((e-t.x)**2+(o-t.y)**2)/r);l/=s.length*r*r,n.push({x:e,y:o,kde:l,label:t})}})),n}(s,150);e.push({data:[{id:"nodes",values:s},{id:"iter",values:[{iter:i}]},{id:"kde",values:n}]})})),e}(t);t.type="common",t.dataKey=ci,t.data=o[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:o}),t.animationAppear={duration:null!==(n=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class di extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=ui}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,data:a}=this._spec;return n&&r?!!a||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}di.type="sequenceScatterKDE",di.view="singleDefault",di.transformerConstructor=ui;const pi="dataKey";function gi(t){const e=[];return Object.keys(t.data).forEach((i=>{let s=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const s=document.createElement("canvas");s.width=e.width,s.height=e.height;const n=s.getContext("2d");if(!n)throw new Error("Failed to get 2D rendering context from canvas");const r=n.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let s=0;s<300;s++){const n=(null===(i=t[e])||void 0===i?void 0:i[s])||[0,0,0],a=4*(300*e+s);r.data[a]=Math.round(255*n[0]),r.data[a+1]=Math.round(255*n[1]),r.data[a+2]=Math.round(255*n[2]),r.data[a+3]=255}return n.putImageData(r,0,0),s.toDataURL("image/png")}(t.backgroundColors[i],t);s={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[pi]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:s?[s]:[]}]})})),e}class fi extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,s,n,r;super.transformSpec(t);const a=gi(t);t.type="common",t.dataKey=pi,t.data=a[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(n=null===(s=t.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class mi extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=fi}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,data:a}=this._spec;return n&&r?!!a||(null===(s=(i=this._option).onError)||void 0===s||s.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}mi.type="sequenceScatterPixel",mi.view="singleDefault",mi.transformerConstructor=fi;class yi extends e.BarChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var bi,vi,xi,_i,Ai;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(bi||(bi={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(vi||(vi={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(xi||(xi={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(_i||(_i={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(Ai||(Ai={}));class Si{static GenAutoIncrementId(){return Si.auto_increment_id++}}Si.auto_increment_id=0;class Ti{constructor(t){this.id=Si.GenAutoIncrementId(),this.registry=t}}const wi="named",Mi="inject",Bi="inversify:tagged",Ci="inversify:paramtypes";class ki{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===wi?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var Pi=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),s=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),n=new WeakMap;function r(t,e,i){let r=n.get(t);if(h(r)){if(!i)return;r=new s,n.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new s,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const s=f(e);return!c(s)&&a(t,s,i)}function o(t,e,i){const s=r(e,i,!1);return!h(s)&&!!s.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const s=r(e,i,!1);if(!h(s))return s.get(t)}(t,e,i);const s=f(e);return c(s)?void 0:l(t,s,i)}function h(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const s=3===i?"string":5===i?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==n){const e=n.call(t,s);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}function p(t){const e=d(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const s=t.prototype,n=s&&Object.getPrototypeOf(s);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,s){if(!u(i))throw new TypeError;return n=t,a=e,void r(i,s,!0).set(n,a);var n,a})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return h(i)||(i=p(i)),l(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function Oi(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};Pi.hasOwnMetadata(t,e)&&(r=Pi.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,Pi.defineMetadata(t,r,e)}(Bi,t,i.toString(),s)}function Ri(t){return(e,i,s)=>{Oi(e,0,s,t)}}const Li=(Ei=Mi,t=>(e,i,s)=>Ri(new ki(Ei,t))(e,i,s));var Ei;function Ii(){return function(t){return Pi.defineMetadata(Ci,null,t),t}}function Di(t){return Ri(new ki(wi,t))}const Fi="Singleton",ji="Transient",Ui="ConstantValue",Ni="DynamicValue",Wi="Factory",zi="Function",Gi="Instance",Vi="Invalid";class Hi{constructor(t,e){this.id=Si.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Vi,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Hi(this.serviceIdentifier,this.scope);return t.activated=t.scope===Fi&&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 Xi{getConstructorMetadata(t){return{compilerGeneratedMetadata:Pi.getMetadata(Ci,t),userGeneratedMetadata:Pi.getMetadata(Bi,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const $i=(Yi=wi,t=>{const e=e=>{if(null==e)return!1;if(e.key===Yi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===Yi&&i[e].value===t)return!0;return!1};return e.metaData=new ki(Yi,t),e});var Yi;class qi{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=Fi,this}inTransientScope(){return this._binding.scope=ji,this}whenTargetNamed(t){return this._binding.constraint=$i(t),this}}class Ki{constructor(t){this._binding=t}to(t){return this._binding.type=Gi,this._binding.implementationType=t,new qi(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=Ni,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new qi(this._binding)}toConstantValue(t){return this._binding.type=Ui,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Fi,new qi(this._binding)}toFactory(t){return this._binding.type=Wi,this._binding.factory=t,this._binding.scope=Fi,new qi(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const Zi=Symbol("ContributionProvider");class Ji{constructor(t,e){this.serviceIdentifier=t,this.container=e,ts.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function Qi(t,e){t(Zi).toDynamicValue((({container:t})=>new Ji(e,t))).inSingletonScope().whenTargetNamed(e)}class ts{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}ts.store=new Map;class es{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let s;if("string"==typeof e)s={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof s.name||""===s.name)throw new Error("Missing name for tap");return s=Object.assign({type:t,fn:i},s),s}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let s=this.taps.length;for(;s>0;){s--;const t=this.taps[s];this.taps[s+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){s++;break}}this.taps[s]=t}}class is extends es{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const ss=new class{};let ns=0;var rs,as,os,ls;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(rs||(rs={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(as||(as={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(os||(os={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(ls||(ls={}));const hs=rt-1e-8;class cs{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>hs)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,c=1/0,u=-1/0,d=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>p&&(p=h)}if(g(s),g(n),n!==s)if((s%=rt)<0&&(s+=rt),(n%=rt)<0&&(n+=rt),n<s&&(r=!r,a=s,s=n,n=a),r)for(n-=rt,a=s-s%nt,o=0;o<4&&a>n;++o,a-=nt)g(a);else for(a=s-s%nt+nt,o=0;o<4&&a<n;++o,a+=nt)g(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,s,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,s,n,r){this.bounds.add(t,e),this.bounds.add(i,s),this.bounds.add(n,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,s){this.bounds.add(t,e),this.bounds.add(i,s)}rect(t,e,i,s){this.bounds.add(t,e),this.bounds.add(t+i,e+s)}clear(){this.bounds.clear()}release(...t){}}class us{constructor(){this._curves=[],this.bounds=new Xt}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ds=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ps={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},gs={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let fs,ms,ys,bs,vs,xs;var _s,As,Ss,Ts,ws,Ms;function Bs(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,c=-o*a,u=o*r,d=l*a,p=Math.cos(s),g=Math.sin(s),f=Math.cos(n),m=Math.sin(n),y=.5*(n-s),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,_=i+g+v*p,A=e+f,S=i+m,T=A+v*m,w=S-v*f;return[h*x+c*_,u*x+d*_,h*T+c*w,u*T+d*w,h*A+c*S,u*A+d*S]}function Cs(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,l){const h=xt(a),c=Math.sin(h),u=Math.cos(h),d=u*(o-t)*.5+c*(l-e)*.5,p=u*(l-e)*.5-c*(o-t)*.5;let g=d*d/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const f=u/i,m=c/i,y=-c/s,b=u/s,v=f*o+m*l,x=y*o+b*l,_=f*t+m*e,A=y*t+b*e;let S=1/((_-v)*(_-v)+(A-x)*(A-x))-.25;S<0&&(S=0);let T=Math.sqrt(S);r===n&&(T=-T);const w=.5*(v+_)-T*(A-x),M=.5*(x+A)+T*(_-v),B=Math.atan2(x-M,v-w);let C=Math.atan2(A-M,_-w)-B;C<0&&1===r?C+=rt:C>0&&0===r&&(C-=rt);const k=Math.ceil(Math.abs(C/(nt+.001))),P=[];for(let t=0;t<k;++t){const e=B+t*C/k,n=B+(t+1)*C/k;P[t]=[w,M,e,n,i,s,c,u]}return P}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,i);for(let e=0;e<n.length;++e){const i=Bs(n[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(_s||(_s={})),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"}(As||(As={})),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"}(Ss||(Ss={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Ts||(Ts={})),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"}(ws||(ws={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ms||(Ms={}));const ks=[(t,e,i,s,n,r,a)=>e.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function Ps(t,e,i=0,s=0,n=1,r=1,a){for(let o=0;o<t.length;o++){const l=t[o];ks[l[0]](l,e,i,s,n,r,a)}}class Os{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Rs(t,e){let i=0;const s=t.length;for(let n=0;n<s;n++){const r=t[n],a=e[n],o=t[(n+1)%s],l=e[(n+1)%s];i+=vt.distanceNN(r,a,o,l)}return i/2}function Ls(t,e,i,s,n){const r=1-n;return r*r*r*t+3*e*n*r*r+3*i*n*n*r+s*n*n*n}function Es(t,e,i,s,n){const r=Ls(t.x,e.x,i.x,s.x,n),a=Ls(t.y,e.y,i.y,s.y,n);return new bt(r,a)}function Is(t,e,i,s){const n=1-s;return n*n*t+2*n*s*e+s*s*i}function Ds(t,e,i,s){const n=Is(t.x,e.x,i.x,s),r=Is(t.y,e.y,i.y,s);return new bt(n,r)}function Fs(t,e){const{p0:i,p1:s,p2:n,p3:r}=t,a=Es(i,s,n,r,e),o=vt.pointAtPP(i,s,e),l=vt.pointAtPP(s,n,e),h=vt.pointAtPP(n,r,e),c=vt.pointAtPP(o,l,e),u=vt.pointAtPP(l,h,e);return[new js(i,o,c,a),new js(a,u,h,r)]}class js extends Os{constructor(t,e,i,s){super(),this.type=ws.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=s}_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 Es(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,s=this.p3,Rs([t.x,e.x,i.x,s.x],[t.y,e.y,i.y,s.y])):60;var t,e,i,s}calcProjLength(t){return t===Ts.ROW?ot(this.p0.x-this.p3.x):t===Ts.COLUMN?ot(this.p0.y-this.p3.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return lt(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.bezierCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i,this.p3.x*s+e,this.p3.y*n+i);else if(r>0){const[a]=Fs(this,r);t.bezierCurveTo(a.p1.x*s+e,a.p1.y*n+i,a.p2.x*s+e,a.p2.y*n+i,a.p3.x*s+e,a.p3.y*n+i)}}includeX(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=ut(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(ct(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}class Us extends Os{constructor(t,e){super(),this.type=ws.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return vt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=lt(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()?vt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Ts.ROW?ot(this.p0.x-this.p1.x):t===Ts.COLUMN?ot(this.p0.y-this.p1.y):0}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.lineTo(this.p1.x*s+e,this.p1.y*n+i);else if(r>0){const a=this.getPointAt(r);t.lineTo(a.x*s+e,a.y*n+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const s=(t-e.x)/(i.x-e.x);return e.y+s*(i.y-e.y)}return 1/0}}class Ns{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,s,n,r,a,o){const l=new js(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,s),new bt(n,r));l.originP1=this._lastOriginP,l.originP2=o,l.defined=a,this.curves.push(l),this._lastX=n,this._lastY=r,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,s){const n=this.addLinearCurve(t,e,i,this._lastOriginP,s);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=s}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,s){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,s,n){const r=new Us(new bt(this._lastX,this._lastY),new bt(t,e));return r.originP1=s,r.originP2=n,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Ts.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],s=null!==(e=i.p3)&&void 0!==e?e:i.p1;return ot(t.p0.y-s.y)}if(t===Ts.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(i=e.p3)&&void 0!==i?i:e.p1;return ot(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ws extends Ns{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function zs(t,e,i=1){let s=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function Gs(t,e,i){const s=null!=e?e:ot(i[i.length-1].x-i[0].x)>ot(i[i.length-1].y-i[0].y)?Ts.ROW:Ts.COLUMN;return"monotoneY"===t?new Ws(t,s):new Ns(t,s)}class Vs{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Hs(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Gs("linear",i,t);return function(t,e){zs(t,e,1)}(new Vs(n,s),t),n}function Xs(t,e,i,s,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,s,t.lastPoint1)}class $s{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&&Xs(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:Xs(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Ys(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Hs(t,e);const n=Gs("basis",i,t);return function(t,e){zs(t,e,2)}(new $s(n,s),t),n}function qs(t){return t<0?-1:1}function Ks(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(qs(r)+qs(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Zs(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Js(t,e,i,s,n){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,s,t.lastPoint1)}class Qs{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:Js(this,this._t0,Zs(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,Js(this,Zs(this,e=Ks(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Js(this,this._t0,e=Ks(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,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 tn extends Qs{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function en(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Hs(t,e);const n=Gs("monotoneX",i,t);return function(t,e){zs(t,e,2)}(new Qs(n,s),t),n}function sn(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Hs(t,e);const n=Gs("monotoneY",i,t);return function(t,e){zs(t,e,2)}(new tn(n,s),t),n}let nn=class{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(s,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};class rn extends nn{lineEnd(){this.context.closePath()}}function an(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Ns("step",null!=s?s:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?Ts.ROW:Ts.COLUMN);return on(new nn(r,e,n),t),r}function on(t,e){return zs(t,e,1)}class ln extends Vs{lineEnd(){this.context.closePath()}}function hn(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Gs("linear",i,t);return function(t,e){zs(t,e,1)}(new ln(n,s),t),n}function cn(t,e,i,s,n){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>it){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>it){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/n,l=(l*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,s,t.lastPoint1)}function un(t,e){return function(i,s,n={}){const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Hs(i,n);const o=Gs(t,r,i);return zs(new e(o,s,a),i,2),o}}const dn=un("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:cn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const pn=un("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:cn(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});class gn extends Os{constructor(t,e,i){super(),this.type=ws.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return Ds(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,Rs([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Ts.ROW?ot(this.p0.x-this.p2.x):t===Ts.COLUMN?ot(this.p0.y-this.p2.y):0}getAngleAt(t){const e=ct(t-.01,0),i=ut(t+.01,1),s=this.getPointAt(e),n=this.getPointAt(i);return lt(n.y-s.y,n.x-s.x)}draw(t,e,i,s,n,r){if(t.moveTo(this.p0.x*s+e,this.p0.y*n+i),r>=1)t.quadraticCurveTo(this.p1.x*s+e,this.p1.y*n+i,this.p2.x*s+e,this.p2.y*n+i);else if(r>0){const[a]=function(t,e){const{p0:i,p1:s,p2:n}=t,r=Ds(i,s,n,e),a=vt.pointAtPP(i,s,e),o=vt.pointAtPP(s,n,e);return[new gn(i,a,r),new gn(r,o,n)]}(this,r);t.quadraticCurveTo(a.p1.x*s+e,a.p1.y*n+i,a.p2.x*s+e,a.p2.y*n+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}class fn{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new Us(new bt(this._lastX,this._lastY),new bt(t,e))}quadraticCurveTo(t,e,i,s){const n=new gn(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,s));this.path.addCurve(n),this._lastX=i,this._lastY=s}bezierCurveTo(t,e,i,s,n,r){const a=new js(new bt(this._lastX,this._lastY),new bt(t,e),new bt(i,s),new bt(n,r));this.path.addCurve(a),this._lastX=n,this._lastY=r}arcTo(t,e,i,s,n){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,s,n,r,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,s){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,s,n,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function mn(t,e,i){var s,n;switch(e){case"linear":default:return Hs(t,i);case"basis":return Ys(t,i);case"monotoneX":return en(t,i);case"monotoneY":return sn(t,i);case"step":return an(t,.5,i);case"stepClosed":return function(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Ns("step",null!=s?s:ot(t[t.length-1].x-t[0].x)>ot(t[t.length-1].y-t[0].y)?Ts.ROW:Ts.COLUMN);return on(new rn(r,e,n),t),r}(t,.5,i);case"stepBefore":return an(t,0,i);case"stepAfter":return an(t,1,i);case"catmullRom":return dn(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return pn(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return hn(t,i)}}class yn extends us{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new cs(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([gs.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([gs.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([gs.Q,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([gs.C,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([gs.AT,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([gs.E,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([gs.R,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([gs.A,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([gs.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this._curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this._curves.length=0}beginPath(){this.clear()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new fn(this);Ps(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[gs.M]=t=>`M${t[1]} ${t[2]}`,t[gs.L]=t=>`L${t[1]} ${t[2]}`,t[gs.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[gs.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[gs.A]=t=>{const e=[],i=t[1],s=t[2],n=t[3];((t,e,i,s,n,r,a,o=!1)=>{const l=2*Math.PI,h=(e%l+l)%l;let c,u=(i%l+l)%l;o?(u>=h&&(u-=l),c=u-h):(u<=h&&(u+=l),c=u-h);const d=Math.ceil(Math.abs(c)/(.5*Math.PI)),p=c/d;for(let e=0;e<d;e++){const i=h+p*e,l=h+p*(e+1),c=4/3*Math.tan(Math.abs(p)/4),u=Math.cos(i),d=Math.sin(i),g=Math.cos(l),f=Math.sin(l),m=u*r+s,y=d*a+n,b=g*r+s,v=f*a+n,x=o?-1:1,_=r*c*x,A=a*c*x;t.push(m-_*d,y+A*u,b+_*f,v-A*g,b,v)}})(e,t[4],t[5],i,s,n,n,t[6]);let r="";for(let t=0;t<e.length;t+=6)r+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return r},t[gs.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[gs.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,r=e.length;t<r;t++)if(fs=e[t],ms=fs.slice(1),ys=fs[0],i=[ys],s=ms.match(ds),null!==s){for(let t=0,e=s.length;t<e;t++)bs=s[t],vs=parseFloat(bs),Number.isNaN(vs)||i.push(vs);if(xs=ps[ys],i.length-1>xs){let t,e=ys;for(let s=1,r=i.length;s<r;s+=xs){t=[e];for(let e=s,n=s+xs;e<n;e++)t.push(i[e]);n.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else n.push(i)}else n.push(i);return n}(t);return this._runCommandStrList(r,e,i,s,n),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:s}=t.attribute;if(!e)return;const n=mn(e,i);"x"===s?this.direction=Ts.ROW:"y"===s?this.direction=Ts.COLUMN:"auto"===s&&(this.direction=n.direction),this._curves=n.curves}fromCustomPath2D(t,e,i,s,n){return this.clear(),this._runCommandList(t.commandList,e,i,s,n),this._updateBounds(),this}transform(t,e,i,s){const n=this.commandList;if(!this.transformCbList){const t=[];t[gs.M]=this.moveToTransform,t[gs.L]=this.lineToTransform,t[gs.Q]=this.quadraticCurveToTransform,t[gs.C]=this.bezierCurveToTransform,t[gs.AT]=this.arcToTransform,t[gs.E]=this.ellipseTransform,t[gs.R]=this.rectTransform,t[gs.A]=this.arcTransform,t[gs.Z]=this.closePathTransform,this.transformCbList=t}n.forEach((n=>{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,s=1,n=1){let r,a,o,l,h,c=null,u=0,d=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(r=t[f],1===s&&1===n||(r=vn(r,s,n)),r[0]){case"l":u+=r[1],d+=r[2],this.lineTo(u+e,d+i);break;case"L":u=r[1],d=r[2],this.lineTo(u+e,d+i);break;case"h":u+=r[1],this.lineTo(u+e,d+i);break;case"H":u=r[1],this.lineTo(u+e,d+i);break;case"v":d+=r[1],this.lineTo(u+e,d+i);break;case"V":d=r[1],this.lineTo(u+e,d+i);break;case"m":u+=r[1],d+=r[2],this.moveTo(u+e,d+i);break;case"M":u=r[1],d=r[2],this.moveTo(u+e,d+i);break;case"c":a=u+r[5],o=d+r[6],p=u+r[3],g=d+r[4],this.bezierCurveTo(u+r[1]+e,d+r[2]+i,p+e,g+i,a+e,o+i),u=a,d=o;break;case"C":u=r[5],d=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,u+e,d+i);break;case"s":a=u+r[3],o=d+r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=u+r[1],h=d+r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"S":a=r[3],o=r[4],null===c[0].match(/[CcSs]/)?(p=u,g=d):(p=2*u-p,g=2*d-g),l=r[1],h=r[2],this.bezierCurveTo(p+e,g+i,l+e,h+i,a+e,o+i),p=l,g=h,u=a,d=o;break;case"q":a=u+r[3],o=d+r[4],p=u+r[1],g=d+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),u=a,d=o,p=r[1],g=r[2];break;case"t":a=u+r[1],o=d+r[2],null===c[0].match(/[QqTt]/)?(p=u,g=d):"t"===c[0]?(p=2*u-l,g=2*d-h):"q"===c[0]&&(p=2*u-p,g=2*d-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o,p=u+r[1],g=d+r[2];break;case"T":a=r[1],o=r[2],p=2*u-p,g=2*d-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),u=a,d=o;break;case"a":Cs(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+u+e,r[7]+d+i]),u+=r[6],d+=r[7];break;case"A":Cs(this,u+e,d+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),u=r[6],d=r[7];break;case"z":case"Z":this.closePath()}c=r}}_runCommandList(t,e=0,i=0,s=1,n=1){if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case gs.L:this.lineToTransform(a,e,i,s,n);break;case gs.M:this.moveToTransform(a,e,i,s,n);break;case gs.C:this.bezierCurveToTransform(a,e,i,s,n);break;case gs.Q:this.quadraticCurveToTransform(a,e,i,s,n);break;case gs.A:this.arcToTransform(a,e,i,s,n);break;case gs.E:this.ellipseTransform(a,e,i,s,n);break;case gs.R:this.rectTransform(a,e,i,s,n);break;case gs.AT:this.arcToTransform(a,e,i,s,n);break;case gs.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ps(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Ts.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.y-e.p1.y)}if(this.direction===Ts.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return ot(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/0}getAttrAt(t){if(!this._curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s<this._curves.length;s++){e=this._curves[s];const n=e.getLength(this.direction);if(i+n>=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}drawWithClipRange(t,e,i,s,n){this.tryBuildCurves();const r=this.getLength()*n;let a=0;for(let n=0;n<this._curves.length;n++){const o=this._curves[n],l=o.getLength(this.direction);if(!(a+l<=r)){const n=1-(a+l-r)/l;o.draw(t,i,s,e,e,n);break}o.draw(t,i,s,e,e,1),a+=l}}}const bn=["l",0,0,0,0,0,0,0];function vn(t,e,i){const s=bn[0]=t[0];if("a"===s||"A"===s)bn[1]=e*t[1],bn[2]=i*t[2],bn[3]=t[3],bn[4]=t[4],bn[5]=t[5],bn[6]=e*t[6],bn[7]=i*t[7];else if("h"===s||"H"===s)bn[1]=e*t[1];else if("v"===s||"V"===s)bn[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)bn[s]=(s%2==1?e:i)*t[s];return bn}const xn={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 Yt},_n={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},An=Object.assign({outerBorder:Object.assign(Object.assign({},_n),{distance:0}),innerBorder:Object.assign(Object.assign({},_n),{distance:0})},_n),Sn={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:rs.fontBounding,keepCenterInLine:!1},Tn=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),An),{alignSelf:"auto"}),{pickStrokeBuffer:0}),wn={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Mn=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1,clipConfig:null,roughStyle:null},{_debug_bounds:!1}),Tn),xn),Bn=Object.assign(Object.assign({},Mn),{startAngle:0,endAngle:at,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Cn=Object.assign(Object.assign(Object.assign({},Mn),wn),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),kn=Object.assign(Object.assign({},Mn),{radius:1,startAngle:0,endAngle:at}),Pn=Object.assign(Object.assign({},Mn),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1,cornerType:"round"}),On=Object.assign(Object.assign({},Mn),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Rn=Object.assign(Object.assign(Object.assign({},Mn),wn),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Ln=Object.assign(Object.assign({},Mn),{path:new yn,fillStrokeOrder:1,clipRange:1,customPath:()=>{$.getInstance().warn("空函数")}}),En=Object.assign(Object.assign({},Mn),{points:[],cornerRadius:0,closePath:!0}),In=Object.assign(Object.assign({},Mn),{width:100,height:100,spikes:5,thickness:.5}),Dn=Object.assign(Object.assign({},Mn),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round",drawStrokeWhenZeroWH:!1});Object.assign(Object.assign({},Mn),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round",drawStrokeWhenZeroWH:!1});const Fn=Object.assign(Object.assign({},Mn),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),jn=Object.assign(Object.assign(Object.assign({},Mn),Sn),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Un=Object.assign(Object.assign(Object.assign({},Mn),Sn),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Nn=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Mn),{fill:!0,cornerRadius:0,cornerType:"round"}),Wn=Object.assign(Object.assign({},Nn),{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}),zn=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function s(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,s,n){return function(s,r){const a=y(s);if(a){y(t.startCall)||i("Missing (");const s=function(s){const r=n();return r&&(y(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:d(p)}}();return y(t.endCall)||i("Missing )"),s}}(s)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function a(){return m("angular",t.fromAngleValue,1)}function o(){let i,s,n=l();return n&&(i=[],i.push(n),s=e,y(t.comma)&&(n=l(),n?i.push(n):e=s)),i}function l(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=c();else{const e=h();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function h(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let s=e();const n=[];if(s)for(n.push(s);y(t.comma);)s=e(),s?n.push(s):i("One extra comma");return n}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const s=y(e);if(s)return{type:t,value:s[i]}}function y(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const s=t.exec(e);return s&&b(s[0].length),s}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(s);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Gn{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Gn.IsGradientStr(t))try{const e=zn(t)[0];if(e){if("linear"===e.type)return Gn.ParseLinear(e);if("radial"===e.type)return Gn.ParseRadial(e);if("conic"===e.type)return Gn.ParseConic(e)}}catch(e){return t}return t}static processColorStops(t){if(!t||0===t.length)return[];if(t.some((t=>t.length))){const e=t.map((t=>({color:t.value,offset:t.length?parseFloat(t.length.value)/100:-1})));e[0].offset<0&&(e[0].offset=0),e[e.length-1].offset<0&&(e[e.length-1].offset=1);for(let t=1;t<e.length-1;t++)if(e[t].offset<0){const i=t-1;let s=t+1;for(;s<e.length&&e[s].offset<0;)s++;const n=e[i].offset,r=e[s].offset,a=s-i;for(let t=1;t<a;t++)e[i+t].offset=n+(r-n)*t/a;t=s-1}return e}return t.map(((e,i)=>{const s=t.length>1?i/(t.length-1):0;return{color:e.value,offset:s}}))}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,s=st/2,n=parseFloat(e.value)/180*st-s;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+at,stops:Gn.processColorStops(i)}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:Gn.processColorStops(e)}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,s=st/2;let n="angular"===e.type?parseFloat(e.value)/180*st:0;for(;n<0;)n+=at;for(;n>=at;)n-=at;let r=0,a=0,o=0,l=0;return n<s?(r=0,a=1,o=Math.sin(n),l=a-Math.cos(n)):n<st?(r=0,a=0,o=Math.cos(n-s),l=Math.sin(n-s)):n<st+s?(r=1,a=0,o=r-Math.sin(n-st),l=Math.cos(n-st)):(r=1,o=r-Math.cos(n-s-st),l-=Math.sin(n-s-st)),{gradient:"linear",x0:r,y0:a,x1:o,y1:l,stops:Gn.processColorStops(i)}}}function Vn(t,e,i){let s=e;const{a:n,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(s=s/Math.abs(l+h)*2*i,s)}function Hn(t,e,i,s=0,n=0){var r,a,o,l;if(!e||!0===e)return"black";let h,c;if(g(e))for(let t=0;t<e.length&&(c=e[t],!c);t++);else c=e;if(c=Gn.Parse(c),"string"==typeof c)return c;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let u=e.x2-e.x1,d=e.y2-e.y1,p=e.x1-s,g=e.y1-n;if(i.attribute){const{scaleX:t=1,scaleY:e=1,angle:s=0}=i.attribute;u/=t,d/=e,p/=t,g/=e,(s||1!==t||1!==e)&&(p=null!==(r=i.x1WithoutTransform)&&void 0!==r?r:0,g=null!==(a=i.y1WithoutTransform)&&void 0!==a?a:0,u=null!==(o=i.widthWithoutTransform)&&void 0!==o?o:u,d=null!==(l=i.heightWithoutTransform)&&void 0!==l?l:d)}"linear"===c.gradient?h=function(t,e,i,s,n,r){var a,o,l,h;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*n,s+(null!==(o=e.y0)&&void 0!==o?o:0)*r,i+(null!==(l=e.x1)&&void 0!==l?l:1)*n,s+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,u,d):"conical"===c.gradient?h=function(t,e,i,s,n,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*n,s+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern?l.GetPattern(n+i,r+s,void 0):l}(t,c,p,g,u,d):"radial"===c.gradient&&(h=function(t,e,i,s,n,r){var a,o,l,h,c,u;const d=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*n,s+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(n,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,s+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(n,r)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,c,p,g,u,d))}return h||"orange"}const Xn={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"}},$n=!0,Yn=!1,qn=/\w|\(|\)|-/,Kn=/[.?!,;:/,。?!、;:]/,Zn=/\S/,Jn=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function Qn(t,e,i,s,n){if(t.length<=1)return 0;if(!e||e<=0)return 0;const r=ss.graphicUtil.textMeasure;let a=s,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width);for(;l>e||c<=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(r.measureText(o,i).width),h=t.slice(0,a+1),c=Math.floor(r.measureText(h,i).width)}return n&&(a=function(t,e,i=!1){let s=e;for(;qn.test(t[s-1])&&qn.test(t[s])||Kn.test(t[s]);)if(s--,s<=0)return i?tr(t,e):e;return s}(t,a)),a}function tr(t,e){let i=e;for(;qn.test(t[i+1])&&qn.test(t[i])||Kn.test(t[i]);)if(i++,i>=t.length)return i;return i+1}function er(t,e,i="actual"){var s;if(""===t)return{ascent:0,height:0,descent:0,width:0};const n=ss.graphicUtil.textMeasure.measureText(t,e),r={ascent:0,height:0,descent:0,width:0},a="actual"===i?n.actualBoundingBoxAscent:n.fontBoundingBoxAscent,o="actual"===i?n.actualBoundingBoxDescent:n.fontBoundingBoxDescent;"number"!=typeof a||"number"!=typeof o?(r.width=Math.floor(n.width),r.height=e.fontSize||0,r.ascent=r.height,r.descent=0):(r.width=Math.floor(n.width),r.height=Math.floor(a+o),r.ascent=Math.floor(a),r.descent=r.height-r.ascent);const l=null!==(s=e.space)&&void 0!==s?s:0;return r.width+=l,r}const ir=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||ji,this.options=e,this.id=Si.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Xi}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const s=this._getNotAllArgs(t,!1,e,i);return this._get(s)}getNamed(t,e){return this.getTagged(t,wi,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Hi(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new Ki(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const s=this.bind(i);return t(s,e),s},i=()=>t=>this.unbind(t),s=()=>t=>this.isBound(t),n=e=>i=>{const s=this.rebind(i);return t(s,e),s};return t=>({bindFunction:e(t),isboundFunction:s(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,s){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:s}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),s=Object.keys(i),n=[];for(let t=0;t<s.length;t++){const e=i[t],s={};e.forEach((t=>{s[t.key]=t.value}));const r={inject:s[Mi],multiInject:s.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l=(this._bindingDictionary.get(a)||[]).filter((t=>t.constraint(o)));if(l.length){const t={injectIdentifier:a,metadata:e,bindings:l};n.push(t)}}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Ui:case zi:e=t.cache;break;case Gi:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Fi&&(t.cache=e,t.activated=!0)}},sr=Symbol.for("CanvasFactory");function nr(t){return ir.getNamed(sr,ss.global.env)(t)}const rr=1e-4,ar=Math.sqrt(3),or=1/3;function lr(t){return t>-_r&&t<_r}function hr(t){return t>_r||t<-_r}const cr=[0,0],ur=[0,0],dr=[0,0];function pr(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function gr(t,e,i,s){const n=1-s;return n*(n*t+2*s*e)+s*s*i}function fr(t,e,i,s,n){const r=1-n;return r*r*(r*t+3*n*e)+n*n*(n*s+3*r*i)}function mr(t){return(t%=at)<0&&(t+=at),t}function yr(t,e,i,s,n,r,a,o,l){if(0===a)return!1;const h=a;return!(l>e+h&&l>s+h&&l>r+h||l<e-h&&l<s-h&&l<r-h||o>t+h&&o>i+h&&o>n+h||o<t-h&&o<i-h&&o<n-h)&&function(t,e,i,s,n,r,a,o,l){let h=0,c=.005,u=1/0;cr[0]=a,cr[1]=o;for(let a=0;a<1;a+=.05){ur[0]=gr(t,i,n,a),ur[1]=gr(e,s,r,a);const o=pr(cr,ur);o<u&&(h=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<rr);a++){const a=h-c,o=h+c;ur[0]=gr(t,i,n,a),ur[1]=gr(e,s,r,a);const l=pr(ur,cr);if(a>=0&&l<u)h=a,u=l;else{dr[0]=gr(t,i,n,o),dr[1]=gr(e,s,r,o);const a=pr(dr,cr);o<=1&&a<u?(h=o,u=a):c*=.5}}return l&&(l[0]=gr(t,i,n,h),l[1]=gr(e,s,r,h)),Math.sqrt(u)}(t,e,i,s,n,r,o,l,null)<=h/2}function br(t,e,i,s,n,r,a,o,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>s+u&&c>r+u&&c>o+u||c<e-u&&c<s-u&&c<r-u&&c<o-u||h>t+u&&h>i+u&&h>n+u&&h>a+u||h<t-u&&h<i-u&&h<n-u&&h<a-u)&&function(t,e,i,s,n,r,a,o,l,h,c){let u,d,p,g,f=0,m=.005,y=1/0;cr[0]=l,cr[1]=h;for(let l=0;l<1;l+=.05)ur[0]=fr(t,i,n,a,l),ur[1]=fr(e,s,r,o,l),p=pr(cr,ur),p<y&&(f=l,y=p);y=1/0;for(let l=0;l<32&&!(m<rr);l++)u=f-m,d=f+m,ur[0]=fr(t,i,n,a,u),ur[1]=fr(e,s,r,o,u),p=pr(ur,cr),u>=0&&p<y?(f=u,y=p):(dr[0]=fr(t,i,n,a,d),dr[1]=fr(e,s,r,o,d),g=pr(dr,cr),d<=1&&g<y?(f=d,y=g):m*=.5);return c&&(c[0]=fr(t,i,n,a,f),c[1]=fr(e,s,r,o,f)),Math.sqrt(y)}(t,e,i,s,n,r,a,o,h,c,null)<=u/2}function vr(t,e,i,s,n,r,a,o,l){if(0===a)return!1;const h=a;o-=t,l-=e;const c=Math.sqrt(o*o+l*l);if(c-h>i||c+h<i)return!1;if(Math.abs(s-n)%at<1e-4)return!0;if(r){const t=s;s=mr(n),n=mr(t)}else s=mr(s),n=mr(n);s>n&&(n+=at);let u=Math.atan2(l,o);return u<0&&(u+=at),u>=s&&u<=n||u+at>=s&&u+at<=n}function xr(t,e,i,s,n,r,a){if(0===n)return!1;const o=n,l=n/2;let h=0,c=t;if(a>e+l&&a>s+l||a<e-l&&a<s-l||r>t+l&&r>i+l||r<t-l&&r<i-l)return!1;if(t===i)return Math.abs(r-t)<=o/2;h=(e-s)/(t-i),c=(t*s-i*e)/(t-i);const u=h*r-a+c;return u*u/(h*h+1)<=o/2*o/2}const _r=1e-4;function Ar(t,e,i,s,n){const r=6*i-12*e+6*t,a=9*e+3*s-3*t-9*i,o=3*e-3*t;let l=0;if(lr(a)){if(hr(r)){const t=-o/r;t>=0&&t<=1&&(n[l++]=t)}}else{const t=r*r-4*a*o;if(lr(t))n[0]=-r/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-r+e)/(2*a),s=(-r-e)/(2*a);i>=0&&i<=1&&(n[l++]=i),s>=0&&s<=1&&(n[l++]=s)}}return l}const Sr=[-1,-1,-1],Tr=[-1,-1];function wr(){const t=Tr[0];Tr[0]=Tr[1],Tr[1]=t}function Mr(t,e,i,s,n,r,a,o,l,h){if(h>e&&h>s&&h>r&&h>o||h<e&&h<s&&h<r&&h<o)return 0;const c=function(t,e,i,s,n,r){const a=s+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),h=t-n,c=o*o-3*a*l,u=o*l-9*a*h,d=l*l-3*o*h;let p=0;if(lr(c)&&lr(u))if(lr(o))r[0]=0;else{const t=-l/o;t>=0&&t<=1&&(r[p++]=t)}else{const t=u*u-4*c*d;if(lr(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(r[p++]=e),i>=0&&i<=1&&(r[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),s=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,or):Math.pow(i,or),s=s<0?-Math.pow(-s,or):Math.pow(s,or);const n=(-o-(i+s))/(3*a);n>=0&&n<=1&&(r[p++]=n)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),s=Math.cos(e),n=(-o-2*i*s)/(3*a),l=(-o+i*(s+ar*Math.sin(e)))/(3*a),h=(-o+i*(s-ar*Math.sin(e)))/(3*a);n>=0&&n<=1&&(r[p++]=n),l>=0&&l<=1&&(r[p++]=l),h>=0&&h<=1&&(r[p++]=h)}}return p}(e,s,r,o,h,Sr);if(0===c)return 0;let u=0,d=-1,p=0,g=0;for(let h=0;h<c;h++){const c=Sr[h],f=0===c||1===c?.5:1;fr(t,i,n,a,c)<l||(d<0&&(d=Ar(e,s,r,o,Tr),Tr[1]<Tr[0]&&d>1&&wr(),p=fr(e,s,r,o,Tr[0]),d>1&&(g=fr(e,s,r,o,Tr[1]))),2===d?c<Tr[0]?u+=p<e?f:-f:c<Tr[1]?u+=g<p?f:-f:u+=o<g?f:-f:c<Tr[0]?u+=p<e?f:-f:u+=o<p?f:-f)}return u}function Br(t,e,i,s,n,r,a,o){if(o>e&&o>s&&o>r||o<e&&o<s&&o<r)return 0;const l=function(t,e,i,s,n){const r=t-2*e+i,a=2*(e-t),o=t-s;let l=0;if(lr(r)){if(hr(a)){const t=-o/a;t>=0&&t<=1&&(n[l++]=t)}}else{const t=a*a-4*r*o;if(lr(t)){const t=-a/(2*r);t>=0&&t<=1&&(n[l++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*r),s=(-a-e)/(2*r);i>=0&&i<=1&&(n[l++]=i),s>=0&&s<=1&&(n[l++]=s)}}return l}(e,s,r,o,Sr);if(0===l)return 0;const h=function(t,e,i){const s=t+i-2*e;return 0===s?.5:(t-e)/s}(e,s,r);if(h>=0&&h<=1){let o=0;const c=gr(e,s,r,h);for(let s=0;s<l;s++){const l=0===Sr[s]||1===Sr[s]?.5:1;gr(t,i,n,Sr[s])<a||(Sr[s]<h?o+=c<e?l:-l:o+=r<c?l:-l)}return o}const c=0===Sr[0]||1===Sr[0]?.5:1;return gr(t,i,n,Sr[0])<a?0:r<e?c:-c}function Cr(t,e,i,s,n,r,a,o){if((o-=e)>i||o<-i)return 0;const l=Math.sqrt(i*i-o*o);Sr[0]=-l,Sr[1]=l;const h=Math.abs(s-n);if(h<1e-4)return 0;if(h>=at-1e-4){s=0,n=at;const e=r?1:-1;return a>=Sr[0]+t&&a<=Sr[1]+t?e:0}if(s>n){const t=s;s=n,n=t}s<0&&(s+=at,n+=at);let c=0;for(let e=0;e<2;e++){const i=Sr[e];if(i+t>a){let t=Math.atan2(o,i),e=r?1:-1;t<0&&(t=at+t),(t>=s&&t<=n||t+at>=s&&t+at<=n)&&(t>st/2&&t<1.5*st&&(e=-e),c+=e)}}return c}function kr(t){return Math.round(t/st*1e8)/1e8%2*st}function Pr(t,e){let i=kr(t[0]);i<0&&(i+=at);const s=i-t[0];let n=t[1];n+=s,!e&&n-i>=at?n=i+at:e&&i-n>=at?n=i-at:!e&&i>n?n=i+(at-kr(i-n)):e&&i<n&&(n=i-(at-kr(n-i))),t[0]=i,t[1]=n}const Or=[0,0];function Rr(t,e,i,s,n){const r=t,a=t.length;let o,l,h=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=r[t],g=0===t;a[0]===gs.M&&t>1&&(i||(h+=Ut(c,u,d,p,s,n))),g&&(c=a[1],u=a[2],d=c,p=u);const f=a[0],m=a[1],y=a[2],b=a[3],v=a[4],x=a[5],_=a[6];let A=v,S=x;Or[0]=A,Or[1]=S,Pr(Or,Boolean(a[6])),A=Or[0],S=Or[1];const T=A,w=S-A,M=!!(1-(a[6]?0:1)),B=(s-m)*b/b+m;switch(f){case gs.M:d=m,p=y,c=d,u=p;break;case gs.L:if(i){if(xr(c,u,m,y,e,s,n))return!0}else h+=Ut(c,u,m,y,s,n)||0;c=m,u=y;break;case gs.C:if(i){if(br(c,u,m,y,b,v,x,_,e,s,n))return!0}else h+=Mr(c,u,m,y,b,v,x,_,s,n)||0;c=x,u=_;break;case gs.Q:if(i){if(yr(c,u,m,y,b,v,e,s,n))return!0}else h+=Br(c,u,m,y,b,v,s,n)||0;c=b,u=v;break;case gs.A:if(o=Math.cos(T)*b+m,l=Math.sin(T)*b+y,g?(d=o,p=l):h+=Ut(c,u,o,l,s,n),i){if(vr(m,y,b,T,T+w,M,e,B,n))return!0}else h+=Cr(m,y,b,T,T+w,M,B,n);c=Math.cos(T+w)*b+m,u=Math.sin(T+w)*b+y;break;case gs.R:if(d=c=m,p=u=y,o=d+b,l=p+v,i){if(xr(d,p,o,p,e,s,n)||xr(o,p,o,l,e,s,n)||xr(o,l,d,l,e,s,n)||xr(d,l,d,p,e,s,n))return!0}else h+=Ut(o,p,o,l,s,n),h+=Ut(d,l,d,p,s,n);break;case gs.Z:if(i){if(xr(c,u,d,p,e,s,n))return!0}else h+=Ut(c,u,d,p,s,n);c=d,u=p}}return i||(g=u,f=p,Math.abs(g-f)<_r)||(h+=Ut(c,u,d,p,s,n)||0),0!==h;var g,f}const Lr=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=nr(Object.assign({nativeCanvas:ss.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=nr(Object.assign({nativeCanvas:ss.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}},Er={arc:Bn,area:Cn,circle:kn,line:Rn,path:Ln,symbol:Fn,text:jn,rect:Dn,polygon:En,star:In,richtext:Un,richtextIcon:Wn,image:Nn,group:Pn,glyph:On},Ir=Object.keys(Er);function Dr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Fr={arc:Object.assign({},Er.arc),area:Object.assign({},Er.area),circle:Object.assign({},Er.circle),line:Object.assign({},Er.line),path:Object.assign({},Er.path),symbol:Object.assign({},Er.symbol),text:Object.assign({},Er.text),rect:Object.assign({},Er.rect),polygon:Object.assign({},Er.polygon),star:Object.assign({},Er.star),richtext:Object.assign({},Er.richtext),richtextIcon:Object.assign({},Er.richtextIcon),image:Object.assign({},Er.image),group:Object.assign({},Er.group),glyph:Object.assign({},Er.glyph)};class jr{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Ir.forEach((t=>{this._defaultTheme[t]=Object.create(Fr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,$.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Ir.forEach((s=>{const n=Object.create(Fr[s]);t&&t[s]&&Dr(n,t[s]),i[s]&&Dr(n,i[s]),e[s]&&Dr(n,e[s]),this.combinedTheme[s]=n})),e.common&&Ir.forEach((t=>{Dr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Ur=new jr;function Nr(t,e){return t.glyphHost?Nr(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)):Ur.getTheme()}return null}(t)||t.attachedThemeGraphic&&Nr(t.attachedThemeGraphic)||Ur.getTheme()}var Wr=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};class zr extends n{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=Si.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return Wr(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){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,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&$.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}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,e=!1){let i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const s=a(i,!0)&&i||c(i)&&i.capture,n=c(i)&&i.once,r=o(e)?void 0:e;return t=s?`${t}capture`:t,e=o(e)?e:e.handleEvent,n?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const s=a(i,!0)&&i||c(i)&&i.capture,n=o(e)?void 0:e;t=s?`${t}capture`:t,e=o(e)?e:e.handleEvent;const r=c(i)&&i.once;return super.off(t,e,n,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return c(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t,...e){return super.emit(t.type,t,...e),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Gr{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=Gr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=t.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&o(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&&o(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Vr extends Gr{constructor(t,e){super(),this.type=t,this.detail=e}}const Hr={dispatchEvent(t){var e;if(!(t instanceof Gr))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 Vr(t,e))}};class Xr{static GetImage(t,e){var i;const s=Xr.cache.get(t);s?"fail"===s.loadState?ss.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Xr.loadImage(t,e)}static GetSvg(t,e){var i;let s=Xr.cache.get(t);s?"fail"===s.loadState?ss.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Xr.cache.set(t,s),s.dataPromise=ss.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Xr.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Xr.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ss.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ss.global.loadBlob(t):"json"===e&&(i.dataPromise=ss.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Xr.isLoading&&Xr.toLoadAueue.length){Xr.isLoading=!0;const t=Xr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Xr.cache.set(i,n),n.dataPromise=ss.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()})).catch((t=>{console.error(t),Xr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Xr.loading()}))}}),0)}static loadImage(t,e){const i=$r(t,Xr.toLoadAueue);if(-1!==i)return Xr.toLoadAueue[i].marks.push(e),void Xr.loading();Xr.toLoadAueue.push({url:t,marks:[e]}),Xr.loading()}static improveImageLoading(t){const e=$r(t,Xr.toLoadAueue);if(-1!==e){const t=Xr.toLoadAueue.splice(e,1);Xr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function $r(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}var Yr;Xr.cache=new Map,Xr.isLoading=!1,Xr.toLoadAueue=[],Xr.onLoadSuccessCb=[],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"}(Yr||(Yr={}));const qr=[!1,!1,!1,!1],Kr=[0,0,0,0],Zr=t=>t?g(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Kr[0]=t[0],Kr[2]=t[0],Kr[1]=t[1],Kr[3]=t[1],Kr):t:t:0,Jr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Qr=[1,2,3,0,1,2,3,0];function ta(t,e,i,s){for(;t>=at;)t-=at;for(;t<0;)t+=at;for(;t>e;)e+=at;Jr[0].x=i,Jr[1].y=i,Jr[2].x=-i,Jr[3].y=-i;const n=Math.ceil(t/nt)%4,r=Math.ceil(e/nt)%4;if(s.add(ht(t)*i,dt(t)*i),s.add(ht(e)*i,dt(e)*i),n!==r||e-t>st){let t=!1;for(let e=0;e<Qr.length;e++)if(t||n!==Qr[e]){if(t&&r===Qr[e])break;if(t){const t=Jr[Qr[e]];s.add(t.x,t.y)}}else{t=!0;const e=Jr[n];s.add(e.x,e.y)}}}function ea(t,e,i){const{x:s,y:n}=mt(t.x,t.y,e.x,e.y,i),{x:r,y:a}=mt(t.x1,t.y1,e.x1,e.y1,i),o=new bt(s,n,r,a);return o.defined=e.defined,o}function ia(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let s=[];if(t.length>e.length){s=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<e.length;n++)s[n]=ea(t[n],e[n],i)}else{s=e.map((t=>{const e=new bt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<t.length;n++)s[n]=ea(t[n],e[n],i)}return s}const sa=(t,e)=>{const i=((t,e)=>p(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(i)?i:Math.max(e,i)};class na{bounds(t,e){if(y(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}}function ra(t,e,i,s,n){return n?t.arc(i,s,e,0,rt,!1,n):t.arc(i,s,e,0,rt),!1}var aa=new class extends na{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,s,n){return ra(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return ra(t,this.parseSize(e)/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var oa=new class extends na{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n)}drawOffset(t,e,i,s,n,r){return function(t,e,i,s,n,r){return t.moveTo(-3*e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-3*e+s-n,r),t.lineTo(e+i+n,-3*e+s-n,r),t.lineTo(e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,e+s+n,r),t.lineTo(e+i+n,e+s+n,r),t.lineTo(e+i+n,3*e+s+n,r),t.lineTo(-e+i-n,3*e+s+n,r),t.lineTo(-e+i-n,e+s+n,r),t.lineTo(-3*e+i-n,e+s+n,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,s,n,r)}};function la(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}var ha=new class extends na{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return la(t,this.parseSize(e)/2,i,s,n)}drawFitDir(t,e,i,s,n){return la(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return la(t,this.parseSize(e)/2+n,i,s,r)}};function ca(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}var ua=new class extends na{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return ca(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return ca(t,this.parseSize(e)/2+n,i,s)}};function da(t,e,i,s,n=0){return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class pa extends na{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return da(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return da(t,this.parseSize(e)/2,i,s,n)}}var ga=new pa;var fa=new class extends pa{constructor(){super(...arguments),this.type="triangle"}};const ma=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ya=Math.sin(rt/10)*ma,ba=-Math.cos(rt/10)*ma;function va(t,e,i,s){const n=ya*e,r=ba*e;t.moveTo(i,-e+s),t.lineTo(n+i,r+s);for(let a=1;a<5;++a){const o=rt*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+s),t.lineTo(l*n-h*r+i,h*n+l*r+s)}return t.closePath(),!0}var xa=new class extends na{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,s){return va(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return va(t,this.parseSize(e)/2+n,i,s)}};const _a=pt(3);function Aa(t,e,i,s){const n=e,r=n/_a,a=r/5,o=e;return t.moveTo(0+i,-n+s),t.lineTo(r/2+i,s),t.lineTo(a/2+i,s),t.lineTo(a/2+i,o+s),t.lineTo(-a/2+i,o+s),t.lineTo(-a/2+i,s),t.lineTo(-r/2+i,s),t.closePath(),!0}var Sa=new class extends na{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,s){return Aa(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Aa(t,this.parseSize(e)/2+n,i,s)}};function Ta(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}var wa=new class extends na{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Ta(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ta(t,this.parseSize(e)/2+n,i,s)}};function Ma(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var Ba=new class extends na{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Ma(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ma(t,this.parseSize(e)/2+n,i,s)}};const Ca=-.5,ka=pt(3)/2,Pa=1/pt(12);function Oa(t,e,i,s){const n=e/2,r=e*Pa,a=n,o=e*Pa+e,l=-a,h=o;return t.moveTo(n+i,r+s),t.lineTo(a+i,o+s),t.lineTo(l+i,h+s),t.lineTo(Ca*n-ka*r+i,ka*n+Ca*r+s),t.lineTo(Ca*a-ka*o+i,ka*a+Ca*o+s),t.lineTo(Ca*l-ka*h+i,ka*l+Ca*h+s),t.lineTo(Ca*n+ka*r+i,Ca*r-ka*n+s),t.lineTo(Ca*a+ka*o+i,Ca*o-ka*a+s),t.lineTo(Ca*l+ka*h+i,Ca*h-ka*l+s),t.closePath(),!1}var Ra=new class extends na{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,s){return Oa(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Oa(t,this.parseSize(e)/2+n,i,s)}};function La(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}var Ea=new class extends na{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return La(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return La(t,this.parseSize(e)/2,i,s,n)}};function Ia(t,e,i,s,n=0){return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}var Da=new class extends na{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,s){return Ia(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ia(t,this.parseSize(e)/2,i,s,n)}};function Fa(t,e,i,s,n=0){return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}var ja=new class extends na{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return Fa(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Fa(t,this.parseSize(e)/2,i,s,n)}};const Ua=pt(3);function Na(t,e,i,s){const n=e*Ua;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}var Wa=new class extends na{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Na(t,this.parseSize(e)/2/Ua,i,s)}drawOffset(t,e,i,s,n){return Na(t,this.parseSize(e)/2/Ua+n,i,s)}};function za(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}var Ga=new class extends na{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,s){return za(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return za(t,this.parseSize(e)/4+n,i,s)}};function Va(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}var Ha=new class extends na{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,s){return Va(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Va(t,this.parseSize(e)/4+n,i,s)}};function Xa(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}var $a=new class extends na{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,s){return Xa(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Xa(t,this.parseSize(e)/4+n,i,s)}};function Ya(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}var qa=new class extends na{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,s){return Ya(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return Ya(t,this.parseSize(e)/4+n,i,s)}};function Ka(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var Za=new class extends na{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return Ka(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return Ka(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function Ja(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var Qa=new class extends na{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return Ja(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return Ja(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function to(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}var eo=new class extends na{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,s,n){return to(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return to(t,this.parseSize(e)/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=this.parseSize(t)/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function io(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function so(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}var no=new class extends na{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return y(e)?so(t,e,i,s):io(t,e,i,s)}drawWithClipRange(t,e,i,s,n,r,a){y(e)&&(e=[e,e/2]);const o=2*(e[0]+e[1])*n,l=[{x:i+e[0]/2,y:s-e[1]/2},{x:i+e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s+e[1]/2},{x:i-e[0]/2,y:s-e[1]/2}];let h=0,c=l[3];t.moveTo(c.x,c.y);for(let e=0;e<l.length;e++){const i=l[e],s=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(h+s>o){const e=(i.x-c.x)*(o-h)/s,n=(i.y-c.y)*(o-h)/s;t.lineTo(c.x+e,c.y+n);break}t.lineTo(i.x,i.y),c=i,h+=s}return!1}drawOffset(t,e,i,s,n){return y(e)?so(t,e+2*n,i,s):io(t,[e[0]+2*n,e[1]+2*n],i,s)}};const ro=new Xt;class ao{constructor(t,e,i=!1){this.pathStr="",this.type=t,g(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),Ps(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(Ps(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return e=this.parseSize(e),this.drawOffset(t,e,i,s,0,n,r)}parseSize(t){return y(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,s,n),a&&a(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,s,n),!1)}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{ro.x1=i.bounds.x1*t,ro.y1=i.bounds.y1*t,ro.x2=i.bounds.x2*t,ro.y2=i.bounds.y2*t,e.union(ro)}))}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 oo={};[aa,oa,ha,ua,Wa,fa,xa,Sa,wa,Ba,Ra,Ea,Da,ga,ja,Ga,Ha,$a,qa,no,Za,Qa,eo].forEach((t=>{oo[t.type]=t}));const lo={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"};class ho{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 co(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function uo(t,e,i,s=">"){const n=function(t,e,i=">"){let s,n="";for(let r=e;r<t.length;r++){let e=t[r];if(s)e===s&&(s="");else if('"'===e||"'"===e)s=e;else if(e===i[0]){if(!i[1])return{data:n,index:r};if(t[r+1]===i[1])return{data:n,index:r}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,s);if(!n)return;let r=n.data;const a=n.index,o=r.search(/\s/);let l=r,h=!0;-1!==o&&(l=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));const c=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),h=l!==n.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:a,attrExpPresent:h,rawTagName:c}}const po=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class go{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const s=e.tagname;"string"==typeof s?(e.tagname=s,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const s={};if(!t)return;const n=function(t,e){const i=[];let s=e.exec(t);for(;s;){const n=[];n.startIndex=e.lastIndex-s[0].length;const r=s.length;for(let t=0;t<r;t++)n.push(s[t]);i.push(n),s=e.exec(t)}return i}(t,po),r=n.length;for(let t=0;t<r;t++){const e=n[t][1],i=n[t][4];e&&(s[e]=void 0===i||(isNaN(i)?i:Number(i)))}return s}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new ho("!xml");let i=e,s="",n="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=co(t,">",r,"Closing Tag is not closed."),a=n.lastIndexOf(".");n=n.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",r=e}else if("?"===t[r+1])r=uo(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=co(t,"--\x3e",r+4,"Comment is not closed.");else{const a=uo(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(n+=n?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),n=n.substr(0,n.length-1),l=o):l=l.substr(0,l.length-1);const t=new ho(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new ho(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=c}else s+=t[r];return e.child}}function fo(t,e){return mo(t)}function mo(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=yo(n);if(void 0!==r&&n[r]){const t=mo(n[r]);s=t,Object.keys(s).length,n[":@"]&&bo(t,n[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var s;return i}function yo(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function bo(t,e,i){if(e){const i=Object.keys(e),s=i.length;for(let n=0;n<s;n++){const s=i[n];t[s]=e[s]}}}class vo{constructor(t){this.options=Object.assign({},vo.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return fo(new go(this.options).parseXml(t),this.options)}}function xo(t,e,i,s=0){return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}vo.defaultOptions={};let _o=0;function Ao(){return _o++}var So;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(So||(So={}));const To=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>To.set(t,!0)));const wo=new Map;function Mo(t){if(To.has(t))return!0;if(wo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>wo.set(t,!0)));const Bo=Ao(),Co=Ao(),ko=Ao();Ao(),Ao();const Po=Ao(),Oo=Ao(),Ro=Ao(),Lo=Ao(),Eo=Ao(),Io=Ao(),Do=Ao(),Fo=Ao(),jo=Ao();Ao();const Uo=Ao(),No=Ao(),Wo=Symbol.for("GraphicCreator"),zo={"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"},Go=Object.keys(zo),Vo={duration:200,easing:"cubicOut"};function Ho(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 Xo(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,c,u,d,p,g,f,m,y;return e===t?(t[12]=e[0]*s+e[4]*n+e[8]*r+e[12],t[13]=e[1]*s+e[5]*n+e[9]*r+e[13],t[14]=e[2]*s+e[6]*n+e[10]*r+e[14],t[15]=e[3]*s+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],p=e[7],g=e[8],f=e[9],m=e[10],y=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*s+c*n+g*r+e[12],t[13]=o*s+u*n+f*r+e[13],t[14]=l*s+d*n+m*r+e[14],t[15]=h*s+p*n+y*r+e[15]),t}function $o(t,e,i){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],p=e[10],g=e[11],f=e[12],m=e[13],y=e[14],b=e[15];let v=i[0],x=i[1],_=i[2],A=i[3];return t[0]=v*s+x*o+_*u+A*f,t[1]=v*n+x*l+_*d+A*m,t[2]=v*r+x*h+_*p+A*y,t[3]=v*a+x*c+_*g+A*b,v=i[4],x=i[5],_=i[6],A=i[7],t[4]=v*s+x*o+_*u+A*f,t[5]=v*n+x*l+_*d+A*m,t[6]=v*r+x*h+_*p+A*y,t[7]=v*a+x*c+_*g+A*b,v=i[8],x=i[9],_=i[10],A=i[11],t[8]=v*s+x*o+_*u+A*f,t[9]=v*n+x*l+_*d+A*m,t[10]=v*r+x*h+_*p+A*y,t[11]=v*a+x*c+_*g+A*b,v=i[12],x=i[13],_=i[14],A=i[15],t[12]=v*s+x*o+_*u+A*f,t[13]=v*n+x*l+_*d+A*m,t[14]=v*r+x*h+_*p+A*y,t[15]=v*a+x*c+_*g+A*b,t}function Yo(t,e,i){const s=e[0],n=e[1],r=e[2];let a=i[3]*s+i[7]*n+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*s+i[4]*n+i[8]*r+i[12])/a,t[1]=(i[1]*s+i[5]*n+i[9]*r+i[13])/a,t[2]=(i[2]*s+i[6]*n+i[10]*r+i[14])/a,t}class qo{constructor(){this.pools=[]}static identity(t){return Ho(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 qo.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}}const Ko=new class{constructor(){this.pools=[]}allocate(t,e,i,s,n,r){if(!this.pools.length)return new Yt(t,e,i,s,n,r);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=s,a.e=n,a.f=r,a}allocateByObj(t){if(!this.pools.length)return new Yt(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(...t){this.pools=[]}},Zo=new qo;var Jo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Qo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const tl=new Yt(1,0,0,1,0,0),el={x:0,y:0};let il=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new Yt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Yt(1,0,0,1,0,0),this.path=new yn,this._clearMatrix=new Yt(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ko.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}reset(){this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Yt(1,0,0,1,0,0),this.stack.length=0}restore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Ko.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,n=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,s,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,n,r,a=!0){this.matrix.multiply(t,e,i,s,n,r),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,s,n,r){this.path.arc(t,e,i,s,n,r)}arcTo(t,e,i,s,n){this.path.arcTo(t,e,i,s,n)}bezierCurveTo(t,e,i,s,n,r){this.path.bezierCurveTo(t,e,i,s,n,r)}closePath(){this.path.closePath()}ellipse(t,e,i,s,n,r,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,s){this.path.quadraticCurveTo(t,e,i,s)}rect(t,e,i,s){this.path.rect(t,e,i,s)}createImageData(t,e){return null}createLinearGradient(t,e,i,s){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,s,n,r){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,s){return null}fill(t,e){}fillRect(t,e,i,s){this.path.rect(t,e,i,s)}clearRect(t,e,i,s){}fillText(t,e,i){}getImageData(t,e,i,s){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},el),function(t,e,i){return Rr(t,0,!1,e,i)}(this.path.commandList,el.x,el.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},el);const i=Vn(this,this.lineWidth,this.dpr);return function(t,e,i,s){return Rr(t,e,!0,i,s)}(this.path.commandList,i,el.x,el.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,s){this.path.rect(t,e,i,s)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,s,n){}_setCommonStyle(t,e,i,s){}setStrokeStyle(t,e,i,s,n){}_setStrokeStyle(t,e,i,s){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(tl,t,e)}setClearMatrix(t,e,i,s,n,r){this._clearMatrix.setValue(t,e,i,s,n,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Ko.free(t))),this.stack.length=0}};var sl;il=Jo([Ii(),Qo("design:paramtypes",[Object,Number])],il),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(sl||(sl={}));class nl{static Get(t,e=sl.Color1,i=[0,0,0,1]){if(e===sl.Color1){const e=nl.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=re.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];nl.store1[t]=e,nl.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=nl.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=re.parseColorString(t);return n&&(nl.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],nl.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===sl.Color1){if(nl.store1[t])return;nl.store1[t]=i,nl.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(nl.store255[t])return;nl.store255[t]=i,nl.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function rl(t,e=!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 al(t,e,i,s,n){return Array.isArray(t)&&!y(t[0])||Array.isArray(e)&&!y(e[0])?new Array(4).fill(0).map(((n,r)=>{var a,o;return ol(g(t)?null!==(a=t[r])&&void 0!==a?a:t[0]:t,g(e)?null!==(o=e[r])&&void 0!==o?o:e[0]:e,i,s)})):ol(t,e,i,s,n)}function ol(t,e,i,s,n){if(!t||!e)return t&&rl(t)||e&&rl(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=nl.Get(t,sl.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=nl.Get(e,sl.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:rl(a)})))});return o?al(r,l,i,s,n):al(l,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:ul(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:ul(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:ul(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(r,a),rl(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),s)}function ll(t,e,i){return`rgba(${t[0]+(e[0]-t[0])*i},${t[1]+(e[1]-t[1])*i},${t[2]+(e[2]-t[2])*i},${t[3]+(e[3]-t[3])*i})`}nl.store255={},nl.store1={};const hl=[0,0,0,0],cl=[0,0,0,0];function ul(t,e,i){return nl.Get(t,sl.Color255,hl),nl.Get(e,sl.Color255,cl),`rgba(${Math.round(hl[0]+(cl[0]-hl[0])*i)},${Math.round(hl[1]+(cl[1]-hl[1])*i)},${Math.round(hl[2]+(cl[2]-hl[2])*i)},${hl[3]+(cl[3]-hl[3])*i})`}const dl=new Xt,pl=new Yt;new Xt;const gl=["lineWidth","scaleX","scaleY","angle","anchor","visible"],fl=["x","y"],ml=["scaleX","scaleY"],yl=["angle"],bl=new bt,vl={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 xl extends zr{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(xl.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(t={}){var e;super(),this._AABBBounds=new Xt,this._updateTag=_s.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)}getGraphicService(){var t,e;return null!==(e=null===(t=this.stage)||void 0===t?void 0:t.graphicService)&&void 0!==e?e:ss.graphicService}getAttributes(){return this.attribute}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t,e=!1){var i,s;const{dx:n=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;bl.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),bl.y=r+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else bl.x=n,bl.y=r;return bl}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new $t),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=oo[t];if(e)return e;if(e=xl.userSymbolMap[t],e)return e;if(!0===((i=t=lo[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new vo,{svg:i}=e.parse(t);if(!i)return null;const s=g(i.path)?i.path:[i.path];dl.clear();const n=[];s.forEach((t=>{const e=(new yn).fromString(t.d),i={};Go.forEach((e=>{t[e]&&(i[zo[e]]=t[e])})),n.push({path:e,attribute:i}),dl.union(e.bounds)}));const r=dl.width(),a=dl.height(),o=1/ct(r,a);n.forEach((t=>t.path.transform(0,0,o,o)));const l=new ao(t,n,!0);return xl.userSymbolMap[t]=l,l}var i;const s=(new yn).fromString(t),n=s.bounds.width(),r=s.bounds.height(),a=1/ct(n,r);s.transform(0,0,a,a);const o=new ao(t,s);return xl.userSymbolMap[t]=o,o}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,s=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:n=e.boundsPadding}=i,r=Zr(n);return r&&s.expand(r),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new cs(t);return Ps(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(t=!0){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(t=!0){return this._transMatrix||(this._transMatrix=new Yt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&_s.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&_s.UPDATE_BOUNDS)&&this.getGraphicService().validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&_s.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&_s.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&_s.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&_s.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=_s.CLEAR_SHAPE}containsPoint(t,e,i,s){if(!s)return!1;if(i===As.GLOBAL){const i=new bt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return s.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}setAttributesAndPreventAnimate(t,e=!1,i,s){this.setAttributes(t,e,i),this.animates&&this.animates.forEach((e=>{(e.priority!==1/0||s)&&Object.keys(t).forEach((t=>{e.preventAttr(t)}))}))}setAttributes(t,e=!1,i){t&&((t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i))}_setAttributes(t,e=!1,i){const s=Object.keys(t);for(let e=0;e<s.length;e++){const i=s[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(s)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,s){var n;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);r?this._setAttributes(r,i,s):l(null===(n=this.normalAttrs)||void 0===n?void 0:n[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t,e=gl){for(let i=0;i<e.length;i++){const s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t,e=gl){for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Ss.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=_s.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const n={type:Ss.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,n);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const a=this.attribute,o=a.postMatrix;return o?ss.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:xn.x)+t,a.y=(null!==(s=a.y)&&void 0!==s?s:xn.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const s={type:Ss.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,fl,s);return n?(this._setAttributes(n,!1,s),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}scale(t,e,i){var s,n;if(1===t&&1===e)return this;const r={type:Ss.SCALE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,ml,r);a&&(t=a.scaleX,e=a.scaleY,delete a.scaleX,delete a.scaleY,this._setAttributes(a));const o=this.attribute;if(i){let{postMatrix:s}=this.attribute;s||(s=new Yt,o.postMatrix=s),ss.transformUtil.fromMatrix(s,s).scale(t,e,i)}else o.scaleX=(null!==(s=o.scaleX)&&void 0!==s?s:xn.scaleX)*t,o.scaleY=(null!==(n=o.scaleY)&&void 0!==n?n:xn.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Ss.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ml,s);return n?(this._setAttributes(n,!1,s),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this)}rotate(t,e){var i;if(0===t)return this;const s={type:Ss.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,yl,s);n&&(delete n.angle,this._setAttributes(n,!1,s));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Yt,r.postMatrix=i),ss.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:xn.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Ss.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,yl,i);return s?(this._setAttributes(s,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}onAttributeUpdate(t){t&&t.skipUpdateCallback||(this.getGraphicService().onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,s){var n,r;if(i){const e=Object.keys(t),i=this.getNoWorkAnimateAttr(),a={};let o;e.forEach((e=>{i[e]?(o||(o={}),o[e]=t[e]):a[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const l=null!==(r=null!==(n=this.context&&this.context.stateAnimateConfig)&&void 0!==n?n:this.stateAnimateConfig)&&void 0!==r?r:Vo;this.applyAnimationState(["state"],[{name:"state",animation:{type:"state",to:a,duration:l.duration,easing:l.easing}}]),o&&this.setAttributesAndPreventAnimate(o,!1,{type:Ss.STATE})}else this.stopStateAnimates(),this.setAttributesAndPreventAnimate(t,!1,{type:Ss.STATE}),this.finalAttribute&&Object.assign(this.finalAttribute,t);this._emitCustomEvent("afterStateUpdate",{type:Ss.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(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){var e,i;const s=this.attribute[t];return this.animates?null===(e=this.finalAttribute)||void 0===e?void 0:e[t]:null!=s?s:null===(i=this.finalAttribute)||void 0===i?void 0:i[t]}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if(this.currentStates){const i=g(t)?e=>!t.includes(e):e=>e!==t,s=this.currentStates.filter(i);s.length!==this.currentStates.length&&this.useStates(s,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=_s.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=_s.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=_s.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&_s.UPDATE_SHAPE_AND_BOUNDS)===_s.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=_s.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_s.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=_s.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=_s.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=_s.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=_s.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=_s.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&_s.UPDATE_LAYOUT)}getAnchor(t,e,i){const s=[0,0],n=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=n();s[0]=i.x1+(i.x2-i.x1)*e}else s[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=n();s[1]=i.y1+(i.y2-i.y1)*e}else s[1]=t[1];return s}doUpdateLocalMatrix(){const{x:t=xn.x,y:e=xn.y,scaleX:i=xn.scaleX,scaleY:s=xn.scaleY,angle:n=xn.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&n&&(l=this.getAnchor(a,h)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,p=e.f,g=ht(a),f=dt(a);let m,y;o?(m=o[0],y=o[1]):(m=i,y=s);const b=m-i,v=y-s,x=l*g+c*f,_=h*g+u*f,A=c*g-l*f,S=u*g-h*f;t.a=n*x,t.b=n*_,t.c=r*A,t.d=r*S,t.e=d+l*m+c*y-x*b-A*v,t.f=p+h*m+u*y-_*b-S*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h,!0),ss.transformUtil.fromMatrix(a,a).scale(i,s,{x:l[0],y:l[1]})}const c=this.getOffsetXY(xn);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=pl.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.timeline.isGlobal&&(t.setTimeline(e),e.addAnimate(t))}))}this._onSetStage&&this._onSetStage(this,t,e),this.getGraphicService().onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Ss.ANIMATE_END})}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,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:ss.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return p(t,!0)?this.pathProxy=(new yn).fromString(t):this.pathProxy=new yn,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("<svg")?(Xr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(v(t)||t.includes("/")||x(t))&&(Xr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):c(t)?(s.state="success",s.data=t,this.backgroundImg=this.backgroundImg||e):s.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const s=this.resources.get(t);s&&(s.state="success",s.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",this.stopAnimates(),ss.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new Vr(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}toCustomPath(){var t,e,i;const s=null===(i=null===(e=(null===(t=this.stage)||void 0===t?void 0:t.renderService)||ss.renderService)||void 0===e?void 0:e.drawContribution)||void 0===i?void 0:i.getRenderContribution(this);if(s){const t=new il(null,1);return s.drawShape(this,t,0,0,{},{}),t.path}return null}}var _l;xl.userSymbolMap={},xl.mixin(Hr),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(_l||(_l={}));class Al extends xl{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Po,this._childUpdateTag=_s.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 jr),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new jr)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===As.GLOBAL){const i=new bt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&_s.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.getGraphicService().beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),this.getGraphicService().afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=xn.x,y:e=xn.y,dx:i=xn.dx,dy:s=xn.dy,scaleX:n=xn.scaleX,scaleY:r=xn.scaleY,angle:a=xn.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==s||1!==n||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Nr(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=n&&null!=r&&i.set(0,0,Math.max(0,n),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:s=0}=t;i.translate(e,s)}return ss.graphicService.updateTempAABBBounds(i),ss.graphicService.transformAABBBounds(t,i,e,!1,this),s.copy(i),s}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=_s.CLEAR_BOUNDS,this._childUpdateTag&=_s.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=_s.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&_s.UPDATE_BOUNDS||(this._childUpdateTag|=_s.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(),this.getGraphicService().onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),this.getGraphicService().onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return this.getGraphicService().onRemove(t),t.stage=null,this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{this.getGraphicService().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),this.getGraphicService().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(t=!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&_s.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let s=this._getChildByName(t);return s?s.setAttributes(e):(s=ss.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new Al(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Al.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}function Sl(t){return new Al(t)}function Tl(t,e){return!(!t&&!e)}function wl(t,e){let i;return i=g(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Ml(t,e,i){return i&&t*e>0}function Bl(t,e,i,s,n){return n&&t*e>0&&0!==i&&0!==s}function Cl(t,e){return t*e>0}function kl(t,e,i,s,n){return n?t*e>0:t*e>0&&0!==i&&0!==s}function Pl(t,e,i,s,n,r,a){const o=t-i,l=e-s,h=(a?r:-r)/Math.sqrt(o*o+l*l),c=h*l,u=-h*o,d=t+c,p=e+u,g=i+c,f=s+u,m=(d+g)/2,y=(p+f)/2,b=g-d,v=f-p,x=b*b+v*v,_=n-r,A=d*f-g*p,S=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A));let T=(A*v-b*S)/x,w=(-A*b-v*S)/x;const M=(A*v+b*S)/x,B=(-A*b+v*S)/x,C=T-m,k=w-y,P=M-m,O=B-y;return C*C+k*k>P*P+O*O&&(T=M,w=B),{cx:T,cy:w,x01:-c,y01:-u,x11:T*(n/_-1),y11:w*(n/_-1)}}function Ol(t,e,i,s,n){const r=ot(i-e),a=t.getParsedCornerRadius(),o=g(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:c,outerEndAngle:u,innerEndAngle:d,innerStartAngle:p}=t.getParsePadAngle(e,i),f=o?a[0]:a,m=o?a[1]:a,y=o?a[2]:a,b=o?a[3]:a,v=Math.max(m,f),x=Math.max(y,b);let _=v,A=x;const S=n*ht(c),T=n*dt(c),w=s*ht(d),M=s*dt(d);let B,C,k,P;if((x>it||v>it)&&(B=n*ht(u),C=n*dt(u),k=s*ht(p),P=s*dt(p),r<st)){const t=function(t,e,i,s,n,r,a,o){const l=i-t,h=s-e,c=a-n,u=o-r;let d=u*l-c*h;return d*d<it?[]:(d=(c*(e-r)-u*(t-n))/d,[t+d*l,e+d*h])}(S,T,k,P,B,C,w,M);if(t){const e=S-t[0],i=T-t[1],r=B-t[0],a=C-t[1],o=1/dt(((O=(e*r+i*a)/(pt(e*e+i*i)*pt(r*r+a*a)))>1?0:O<-1?st:Math.acos(O))/2),l=pt(t[0]*t[0]+t[1]*t[1]);A=ut(x,(s-l)/(o-1)),_=ut(v,(n-l)/(o+1))}}var O;return{outerDeltaAngle:l,xors:S,yors:T,xirs:k,yirs:P,xore:B,yore:C,xire:w,yire:M,limitedOcr:_,limitedIcr:A,outerCornerRadiusStart:f,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:x,outerStartAngle:c,outerEndAngle:u,innerDeltaAngle:h,innerEndAngle:d,innerStartAngle:p,innerCornerRadiusStart:b,innerCornerRadiusEnd:y}}function Rl(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(n<r){const t=n;n=r,r=t}if(n<=it)e.moveTo(i,s);else if(h>=at-it)e.moveTo(i+n*ht(o),s+n*dt(o)),e.arc(i,s,n,o,l,!c),r>it&&(e.moveTo(i+r*ht(l),s+r*dt(l)),e.arc(i,s,r,l,o,c));else{const{outerDeltaAngle:h,xors:d,yors:p,xirs:g,yirs:f,limitedOcr:m,outerCornerRadiusStart:y,outerCornerRadiusEnd:b,maxOuterCornerRadius:v,xore:x,yore:_,xire:A,yire:S,outerStartAngle:T,outerEndAngle:w,limitedIcr:M,innerDeltaAngle:B,innerEndAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,o,l,r,n);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+d,s+p),u=!0;else if(m>it){const t=ut(y,m),r=ut(b,m),o=Pl(g,f,d,p,n,t,Number(c)),l=Pl(x,_,A,S,n,r,Number(c));m<v&&t===r?!a||a[0]?(e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),e.arc(i+o.cx,s+o.cy,m,lt(o.y01,o.x01),lt(l.y01,l.x01),!c)):e.moveTo(i+o.cx+m*ht(lt(l.y01,l.x01)),s+o.cy+m*dt(lt(l.y01,l.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),t>0&&e.arc(i+o.cx,s+o.cy,t,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,s,n,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),!c),r>0&&e.arc(i+l.cx,s+l.cy,r,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):r>0?e.moveTo(i+l.cx+r*ht(lt(l.y01,l.x01)),s+l.cy+r*dt(lt(l.y01,l.x01))):e.moveTo(i+x,s+n*dt(w))}else!a||a[0]?(e.moveTo(i+d,s+p),e.arc(i,s,n,T,w,!c)):e.moveTo(i+n*ht(w),s+n*dt(w));if(!(r>it)||B<.001)!a||a[1]?e.lineTo(i+A,s+S):e.moveTo(i+A,s+S),u=!0;else if(M>it){const t=ut(P,M),n=ut(O,M),o=Pl(A,S,x,_,r,-n,Number(c)),l=Pl(d,p,g,f,r,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,s+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),M<R&&t===n){const t=lt(l.y01,l.x01);!a||a[2]?e.arc(i+o.cx,s+o.cy,M,lt(o.y01,o.x01),t,!c):e.moveTo(i+o.cx+ht(t),s+o.cy+dt(t))}else!a||a[2]?(n>0&&e.arc(i+o.cx,s+o.cy,n,lt(o.y01,o.x01),lt(o.y11,o.x11),!c),e.arc(i,s,r,lt(o.cy+o.y11,o.cx+o.x11),lt(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(i+l.cx,s+l.cy,t,lt(l.y11,l.x11),lt(l.y01,l.x01),!c)):t>0?e.moveTo(i+l.cx+t*ht(lt(l.y01,l.x01)),s+l.cy+t*dt(lt(l.y01,l.x01))):e.moveTo(i+g,s+f)}else!a||a[1]?e.lineTo(i+A,s+S):e.moveTo(i+A,s+S),!a||a[2]?e.arc(i,s,r,C,k,c):e.moveTo(i+r*ht(k),s+r*dt(k))}return a?a[3]&&e.lineTo(i+n*ht(o),s+n*dt(o)):e.closePath(),u}Al.NOWORK_ANIMATE_ATTR=vl;const Ll=Symbol.for("ArcRenderContribution"),El=Symbol.for("ImageRenderContribution"),Il=Symbol.for("PolygonRenderContribution"),Dl=Symbol.for("RectRenderContribution"),Fl=Symbol.for("SymbolRenderContribution"),jl=Symbol.for("TextRenderContribution"),Ul=Symbol.for("InteractiveSubRenderContribution");function Nl(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Wl(t,e,i,s=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?s-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var zl=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Gl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vl=function(t,e){return function(i,s){e(i,s,t)}};function Hl(t,e,i){var s;const{x:n=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:y}=e.attribute,b=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=m[1];b[2]=null!==(s=m[2])&&void 0!==s?s:0}if(Ho(t),Xo(t,t,[n+o,r+l,a+h]),Xo(t,t,[b[0],b[1],b[2]]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],c=e[9],u=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]=r*n+h*s,t[5]=a*n+c*s,t[6]=o*n+u*s,t[7]=l*n+d*s,t[8]=h*n-r*s,t[9]=c*n-a*s,t[10]=u*n-o*s,t[11]=d*n-l*s}(t,t,g),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],c=e[9],u=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]=r*n-h*s,t[1]=a*n-c*s,t[2]=o*n-u*s,t[3]=l*n-d*s,t[8]=r*s+h*n,t[9]=a*s+c*n,t[10]=o*s+u*n,t[11]=l*s+d*n}(t,t,p),Xo(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const s=i[0],n=i[1],r=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),f){const i=Zo.allocate(),s=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=m[1]}Xo(i,i,[s[0],s[1],0]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],c=e[5],u=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]=r*n+h*s,t[1]=a*n+c*s,t[2]=o*n+u*s,t[3]=l*n+d*s,t[4]=h*n-r*s,t[5]=c*n-a*s,t[6]=u*n-o*s,t[7]=d*n-l*s}(i,i,f),Xo(i,i,[-s[0],-s[1],0]),$o(t,t,i)}}let Xl=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new is(["graphic"]),onSetStage:new is(["graphic","stage"]),onRemove:new is(["graphic"]),onRelease:new is(["graphic"]),onAddIncremental:new is(["graphic","group","stage"]),onClearIncremental:new is(["graphic","group","stage"]),beforeUpdateAABBBounds:new is(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new is(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new is(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Xt,this.tempAABBBounds2=new Xt}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,s){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,s)}afterUpdateAABBBounds(t,e,i,s,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,s,n)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new cs(t);return Ps(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=y(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=Wl(r,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){const e=y(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=Nl(n,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&l){xo(u,(l+h)/Math.abs(n+r),s,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;xo(u,o/Math.abs(n+r)*2,!1,c+1),u.translate(s,a),e.union(u)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const a=n.transMatrix;n&&n.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Vt(e,e,a)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(s.shadowRoot||s.isContainer)return!0;const{visible:n=e.visible}=t;return!(!s.valid||!n)||(i.empty()||(s.parent&&i.transformWithMatrix(s.parent.globalTransMatrix),this.clearAABBBounds(s,s.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};Xl=zl([Ii(),Vl(0,Li(Wo)),Gl("design:paramtypes",[Object])],Xl);const $l=(t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}return i};class Yl{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,s){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===s.length){const t=s[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,s,n="",r,a){const{lineWidth:o,suffixPosition:l="end",measureMode:h=rs.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const u=[],d=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,s=t.length;i<s;i++){const s=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(s.width>o){const s=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,n,r,l);a=s.str,e=s.width}else e=s.width;u.push({str:a,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:c})}d[0]=o}else{let e,i,s=0;for(let n=0,r=t.length;n<r;n++){i=t[n];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[n],this.textOptions,h);e=r.width,s=Math.max(s,e),u.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}d[0]=s}d[1]=u.length*s,d[0]=u.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:d[0],height:d[1]};return this.LayoutBBox(p,e,i,u),this.layoutWithBBox(p,u,e,i,s)}layoutWithBBox(t,e,i,s,n){const r=[0,0],a=e.length*n;"top"===s||("middle"===s?r[1]=(t.height-a)/2:"bottom"===s&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,s,n,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:n,textAlign:i,textBaseline:s}}lineOffset(t,e,i,s,n,r){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=n/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<n-t&&("bottom"===s?e.topOffset+=(n-i)/2:"top"===s&&(e.topOffset-=(n-i)/2)),"alphabetic"===s){const t=n/(e.ascent+e.descent);e.topOffset=n/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=n,e}}const ql=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...gl];class Kl extends xl{get font(){const t=this.getGraphicTheme();return this._font||(this._font=zt(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),s=this.getMaxWidth(i);return Number.isFinite(s)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),s=this.attribute,n=this.getMaxWidth(i);if(!Number.isFinite(n))return!1;const{text:r}=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(r)?r.join(""):r)!==t}return"vertical"===s.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==s.text.toString():null!=this.clipedText&&this.clipedText!==s.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=No,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return g(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Nr(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new Kl({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:n,y:r}=e,a={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},o=kt(a,i,{x:n,y:r});return this._OBBBounds.copy(s),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:n}=ss.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;if(o){xo(n,o/Math.abs(r+a),!0,l),i.union(n)}return ss.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ss.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Vt(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:s=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&s&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+s),n}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),s=this.attribute,{fontFamily:n=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:g=i.lineWidth,whiteSpace:f=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=s,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(s,i,v);if("normal"===f||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const _=ss.graphicUtil.textMeasure,A=new Yl(n,{fontSize:o,fontWeight:l,fontFamily:n,lineHeight:x},_).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{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),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,s;const n=this.getGraphicTheme(),{fontFamily:r=n.fontFamily,textAlign:a=n.textAlign,textBaseline:o=n.textBaseline,fontSize:l=n.fontSize,ellipsis:h=n.ellipsis,maxLineWidth:c,stroke:u=n.stroke,lineWidth:d=n.lineWidth,wordBreak:p=n.wordBreak,fontWeight:f=n.fontWeight,ignoreBuf:m=n.ignoreBuf,measureMode:y=n.measureMode,suffixPosition:b=n.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:_=n.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(l),S=this.getLineHeight(this.attribute,n,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),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const T=ss.graphicUtil.textMeasure,w={fontSize:l,fontWeight:f,fontFamily:r,lineHeight:S},M=new Yl(r,w,T),B=g(t)?t.map((t=>t.toString())):[t.toString()],C=[],k=[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 c&&c!==1/0){if(c>0)for(let t=0;t<B.length;t++){const e=B[t];let n=!0;if(t===P-1){const i=T.clipTextWithSuffix(e,w,c,h,!1,b,t!==B.length-1),s=T.measureTextPixelADscentAndWidth(i.str,w,y);C.push({str:i.str,width:i.width,ascent:s.ascent,descent:s.descent,keepCenterInLine:_});break}const r=T.clipText(e,w,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(h){const t=T.clipTextWithSuffix(e,w,c,h,!1,b);r.str=null!==(i=t.str)&&void 0!==i?i:"",r.width=null!==(s=t.width)&&void 0!==s?s:0}else r.str="",r.width=0;n=!1}const a=T.measureTextPixelADscentAndWidth(r.str,w,y);C.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:_});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(n=!0,o=r.wordBreaked),r.str.length===e.length);else if(n){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),B.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),k[0]=t}else{let t,e,i=0;for(let s=0,n=B.length;s<n;s++){if(s===P-1){const t=T.clipTextWithSuffix(B[s],w,c,h,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,w,y);C.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=B[s],t=T.measureTextWidth(e,w),i=Math.max(i,t);const n=T.measureTextPixelADscentAndWidth(e,w,y);C.push({str:e,width:t,ascent:n.ascent,descent:n.descent,keepCenterInLine:_})}k[0]=i}k[1]=C.length*S;const O={xOffset:0,yOffset:0,width:k[0],height:k[1]};M.LayoutBBox(O,a,o,C);const R=M.layoutWithBBox(O,C,a,o,S);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),n=ss.graphicUtil.textMeasure;let r;const a=this.attribute,{maxLineWidth:o=s.maxLineWidth,ellipsis:l=s.ellipsis,fontFamily:h=s.fontFamily,fontSize:c=s.fontSize,fontWeight:u=s.fontWeight,stroke:d=s.stroke,lineWidth:p=s.lineWidth,verticalMode:g=s.verticalMode,suffixPosition:f=s.suffixPosition}=a,m=this.getLineHeight(a,s,0);let{textAlign:y=s.textAlign,textBaseline:b=s.textBaseline}=a;if(!g){const t=y;y=null!==(e=Kl.baselineMapAlign[b])&&void 0!==e?e:"left",b=null!==(i=Kl.alignMapBaseline[t])&&void 0!==i?i:"top"}if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const t=Nl(y,r),e=this.cache.verticalList.length*m,i=Wl(b,e,c);return this._AABBBounds.set(i,t,i+e,t+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,s="";for(let n=0;n<t.length;n++)Mo(t[n])?i?s+=t[n]:(i=1,s=t[n]):(i&&(e.push({text:s,direction:So.VERTICAL}),s="",i=0),e.push({text:t[n],direction:So.HORIZONTAL}));return s&&e.push({text:s,direction:So.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(o))if(l){const i=!0===l?s.ellipsis:l,a=n.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,i,!1,f);v[e]=a.verticalList,r=a.width}else{const i=n.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:h},o,!1);v[e]=i.verticalList,r=i.width}else r=0,t.forEach((t=>{const e=t.direction===So.HORIZONTAL?c:n.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:h});r+=e,t.width=e}))})),this.cache.verticalList=v,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=ct(e,r)}));const x=Nl(y,r),_=this.cache.verticalList.length*m,A=Wl(b,_,c);return this._AABBBounds.set(A,x,A+_,x+r),d&&this._AABBBounds.expand(p/2),this._AABBBounds}getMaxWidth(t){var e,i;const s=this.attribute;return null!==(i=null!==(e=s.maxLineWidth)&&void 0!==e?e:s.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var s;return null!==(s=sa(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==s?s:(t.fontSize||e.fontSize)+i}needUpdateTags(t,e=ql){return super.needUpdateTags(t,e)}needUpdateTag(t,e=ql){return super.needUpdateTag(t,e)}_interpolate(t,e,i,s,n){"text"===t&&(n.text=s)}clone(){return new Kl(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Kl.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return Kl.baselineMapAlign}getAlignMapBaseline(){return Kl.alignMapBaseline}}function Zl(t){return new Kl(t)}Kl.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},vl),Kl.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Kl.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Jl=["symbolType","size",...gl];let Ql=class t extends xl{constructor(t={symbolType:"circle"}){super(t),this.type="symbol",this.numberType=Uo}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(t=0,e=0,i=1){let s=null;try{s=new Path2D}catch(t){return null}const n=this.getParsedPath();if(!n)return null;n.draw(s,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return g(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return Nr(this).symbol}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=ss.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(s){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=s;xo(i,a+(n+o)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:a=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:s=e.size}=t;if(g(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Jl)}needUpdateTag(t){return super.needUpdateTag(t,Jl)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=g(e)?e:[e,e];return t.path?(new yn).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new yn).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function th(t){return new Ql(t)}Ql.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},vl);const eh=["segments","points","curveType","curveTension",...gl];let ih=class t extends xl{constructor(t={}){super(t),this.type="line",this.numberType=Ro}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,s,n){"points"===t&&(n.points=ia(i,s,e))}getGraphicTheme(){return Nr(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),ss.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:s=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateLineAABBBoundsByPoints(t,e,i,s){const{points:n=e.points,connectedType:r}=t,a=i;return n.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments,connectedType:r}=t,a=i;return n.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,eh)}needUpdateTag(t){return super.needUpdateTag(t,eh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute;t=new yn;const i=e.segments,s=e=>{if(e&&e.length){let i=!0;e.forEach((e=>{!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{s(t.points)})):e.points&&s(e.points),t}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function sh(t){return new ih(t)}ih.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const nh=["width","x1","y1","height","cornerRadius",...gl];class rh extends xl{constructor(t){super(t),this.type="rect",this.numberType=Do}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Nr(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=ss.graphicService.updateTempAABBBounds(i);return $l(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ss.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,nh)}needUpdateTag(t){return super.needUpdateTag(t,nh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute,{x:i,y:s,width:n,height:r}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=l(t.width)?t.x1-t.x:t.width,i=l(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(e);return t=new yn,t.moveTo(i,s),t.rect(i,s,n,r),t}clone(){return new rh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return rh.NOWORK_ANIMATE_ATTR}}function ah(t){return new rh(t)}rh.NOWORK_ANIMATE_ATTR=vl;const oh=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class lh extends rh{constructor(t){super(t),this.type="rect3d",this.numberType=Fo}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:s,x:n,y:r,length:a=ut(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-n,l=null!=l?l:s-r;for(let e=0;e<oh.length;e++){const i=oh[e];t.vertices.push([i[0]*o,i[1]*l,i[2]*a])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return lh.NOWORK_ANIMATE_ATTR}}function hh(t){return new lh(t)}lh.NOWORK_ANIMATE_ATTR=vl;class ch{constructor(t,e,i,s,n,r,a,o,l,h,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=s,this.actualHeight=0,this.bottom=e+s,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Xn[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:s}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,s):this.height||s||0;r=Math.min(r,s);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-n:"center"===this.globalAlign&&(o=-n/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;i<this.lines.length;i++){const{top:s,height:n}=this.lines[i];if(s+n<this[this.directionKey.top]||s+n>this[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:s,height:n}=this.lines[i],r=l-this.lines[i].top-this.lines[i].height;if(0===l)this.lines[i].draw(t,!1,o,r+a,this.ellipsis,e);else{if(r+n>this[this.directionKey.top]+l||r<this[this.directionKey.top])return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(s=!0,h=!0),this.lines[i].draw(t,s,o,r+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:s,height:n}=this.lines[i];if(0===l)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(s+n<this[this.directionKey.top]||s+n>this[this.directionKey.top]+l)return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const s=this.lines[i];s.actualWidth>t&&(t=s.actualWidth),e+=s.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:s}=this.getRawActualSize();this.width,this.height;let n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(let i=0;i<this.lines.length;i++){const{top:s,height:r}=this.lines[i];if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((n-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:s,height:r}=this.lines[i],a=n-this.lines[i].top-this.lines[i].height;if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+r>this[this.directionKey.top]+n||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:s,height:r}=this.lines[i];if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+r<this[this.directionKey.top]||s+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}function uh(t,e,i,s){const n=Math.round(t),r=Math.round(i),a=Math.round(e),o=Math.round(s);return{left:t>n?n:n-.5,top:i>r?r:r-.5,right:a>e?a:a+.5,bottom:o>s?o:o+.5}}class dh{constructor(t,e,i,s){var n,r;this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic",this.ascentDescentMode=s;const a=sa(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof a?a>this.fontSize?a:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:o,height:l,descent:h,width:c}=er(t,i,this.ascentDescentMode);let u=0,d=0,p=0;this.height>l&&(u=(this.height-l)/2,d=Math.ceil(u),p=Math.floor(u)),"top"===this.textBaseline?(this.ascent=u,this.descent=l-u):"bottom"===this.textBaseline?(this.ascent=l-u,this.descent=u):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,this.descent=h+p),this.length=t.length,this.width=c||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,this.space=i.space,this.dx=null!==(n=i.dx)&&void 0!==n?n:0,this.dy=null!==(r=i.dy)&&void 0!==r?r:0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=er(this.text,this.character,this.ascentDescentMode);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}drawBackground(t,e,i,s,n,r,a){if(""===this.text||"\n"===this.text||!this.character.background||this.character.backgroundOpacity&&!(this.character.backgroundOpacity>0))return;let o=e+i,l=this.text,h=this.left+s;o+=this.top;let c=this.direction;if(this.verticalEllipsis)l=this.ellipsisStr,c="vertical",o-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)l+=this.ellipsisStr,"right"!==r&&"end"!==r||(h-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qn(l,("vertical"===c?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,l.length-1);if(l=l.slice(0,t),l+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===c);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);h-=this.ellipsisWidth-e}}}const u=uh(h,h+(this.widthOrigin||this.width),e,e+a);return Object.assign(Object.assign({},u),{fillStyle:this.character.background,globalAlpha:this.character.backgroundOpacity})}draw(t,e,i,s,n,r,a){var o;let l=e+i,h=this.text,c=this.left+s+(null!==(o=this.space)&&void 0!==o?o:0)/2;l+=this.top;let u=this.direction;if(this.verticalEllipsis)h=this.ellipsisStr,u="vertical",l-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)h+=this.ellipsisStr,"right"!==r&&"end"!==r||(c-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Qn(h,("vertical"===u?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,h.length-1);if(h=h.slice(0,t),h+=this.ellipsisStr,"right"===r||"end"===r)if("vertical"===u);else{const{width:e}=er(this.text.slice(t),this.character,this.ascentDescentMode);c-=this.ellipsisWidth-e}}}switch(this.character.script){case"super":l-=this.ascent*(1/3);break;case"sub":l+=this.descent/2}"vertical"===u&&(t.save(),t.rotateAbout(Math.PI/2,c,l),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(c,l),c=0,l=0);const{lineWidth:d=1}=this.character;if(this.character.stroke&&d&&t.strokeText(h,c+this.dx,l+this.dy),this.character.fill&&t.fillText(h,c+this.dx,l+this.dy),this.character.fill)if(this.character.lineThrough||this.character.underline){if(this.character.underline){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}if(this.character.lineThrough){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}}else if("underline"===this.character.textDecoration){const e=1+l,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}else if("line-through"===this.character.textDecoration){const e=1+l-this.ascent/2,i=uh(c,c+(this.widthOrigin||this.width),e,e+(this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1));t.fillRect(i.left,1+l-this.ascent/2,i.right-i.left,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)}"vertical"===u&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Qn(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:s}=er(this.text.slice(t),this.character,this.ascentDescentMode);return i+this.ellipsisWidth-s}return i}}const ph=["width","height","image",...gl];class gh extends xl{constructor(t){super(t),this.type="image",this.numberType=Oo,this.loadImage(this.attribute.image)}getImageElement(){const{image:t}=this.attribute;if(!t||!this.resources)return null;const e=this.resources.get(t);return"success"!==e.state?null:e.data}get width(){return this.tryUpdateAABBBounds(),this._actualWidth}get height(){return this.tryUpdateAABBBounds(),this._actualHeight}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()})),this.addUpdateBoundTag()}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return Nr(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{maxWidth:s=e.maxWidth,maxHeight:n=e.maxHeight}=t;let{width:r,height:a}=t;if(null==r||null==a){const t=this.getImageElement();if(t){const e=t.width,i=t.height;if(null!=r)a=r*(i/e);else if(null!=a)r=a*(e/i);else{const t=e/i;t>s/n?(r=s,a=s/t):(a=n,r=n*t)}}else r=s,a=n}this._actualWidth=r,this._actualHeight=a,i.set(0,0,r,a)}const{tb1:s,tb2:n}=ss.graphicService.updateTempAABBBounds(i);return $l(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ss.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Nn[t]}needUpdateTags(t){return super.needUpdateTags(t,ph)}needUpdateTag(t){return super.needUpdateTag(t,ph)}clone(){return new gh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gh.NOWORK_ANIMATE_ATTR}}function fh(t){return new gh(t)}gh.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},vl);class mh extends gh{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=Zr(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(g(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Zr(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=Nn.width,height:e=Nn.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:s=e}=this.attribute,n=(i-t)/2,r=(s-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class yh{constructor(t,e,i,s,n,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=n,this.top=i-s,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof mh?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Xn[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof dh){const e=Zn.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 i=this.directionKey,s=this.height;let n=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?n=t-this.actualWidth:"center"===this.textAlign?n=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?n=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof mh?(t["_"+i.x]=n,n+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?s-t.height:(s-t.height)/2):(t[i.left]=n,n+=t[i.width]+r)}))}draw(t,e,i,s,n,r){if(n&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const s=this.paragraphs[e];if(s.overflow)t=t&&""===s.text;else if(t){i=!0;break}}let s=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof mh)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";i.ellipsisStr=r;const{width:a}=er(r,i.character,i.ascentDescentMode),o=a||0;if(o<=this.blankWidth+s){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+s+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+s;break}i.ellipsis="hide",s+=i.width}}let a="",o=-1,l=[];const h=[l];this.paragraphs.forEach(((e,n)=>{if(e instanceof mh)return;const r=e.drawBackground(t,s,this.ascent,i,0===n,this.textAlign,this.height);r&&(a===r.fillStyle&&o===r.globalAlpha||(l=[],h.push(l),a=r.fillStyle,o=r.globalAlpha),l.push(r))})),h.forEach((e=>{if(0===e.length)return;const i=e[0],s=e[e.length-1];t.fillStyle=i.fillStyle,t.globalAlpha=i.globalAlpha,t.fillRect(i.left,i.top,s.right-i.left,s.bottom-i.top)})),this.paragraphs.forEach(((e,n)=>{if(e instanceof mh)return e.setAttributes({x:i+e._x,y:s+e._y}),void r(e,t,i+e._x,s+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Yn;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Jn(t,e)})(t,e.character),function(t,e,i){const s=e&&e.fill||$n;if(!s)return void(t.globalAlpha=0);const{fillOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.fillStyle=i?Hn(t,s,{AABBBounds:i}):s,Jn(t,e)}(t,e.character,a),e.draw(t,s,this.ascent,i,0===n,this.textAlign,this.height)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s instanceof mh)break;const{width:n}=er(t,s.character,s.ascentDescentMode),r=n||0;if(r<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=r;break}if(r<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=r,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof mh?t.width:t.getWidthWithEllips(this.direction)})),i}}class bh{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=Xn[this.direction]}store(t){if(t instanceof mh){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new yh(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof mh?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),(0!==t.text.length||this.newLine)&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=Qn(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==n){const[i,s]=function(t,e){const i=t.text.slice(0,e),s=t.text.slice(e);return[new dh(i,t.newLine,t.character,t.ascentDescentMode),new dh(s,!0,t.character,t.ascentDescentMode)]}(t,n);this.store(i),e?this.send():this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}let vh=!1;try{vh=Intl&&"function"==typeof Intl.Segmenter}catch(t){vh=!1}const xh=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...gl];class _h extends xl{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=jo,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const s=this._frameCache.icons.get(t[i]);this.updateHoverIconState(s)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Un.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:Un.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:Un.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:Un.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:Un.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:Un.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:Un.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:Un.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Nr(this).richtext}static AllSingleCharacter(t){return t.lines?t.lines.every((t=>t.paragraphs.every((t=>!(t.text&&p(t.text)&&_h.splitText(t.text).length>1))))):t.every((t=>t.isComposing||!(t.text&&p(t.text)&&_h.splitText(t.text).length>1)))}static splitText(t){if(vh){const e=new Intl.Segmenter(void 0,{granularity:"grapheme"}),i=[];for(const{segment:s}of e.segment(t))i.push(s);return i}return Array.from(t)}static TransformTextConfig2SingleCharacter(t){const e=[];return t.forEach((t=>{const i=_h.splitText(t.text.toString());if(p(t.text)&&i.length>1)for(let s=0;s<i.length;s++){const n=i[s];e.push(Object.assign(Object.assign({},t),{text:n}))}else e.push(t)})),e}updateAABBBounds(t,e,i){var s,n,r,a;const{width:o=e.width,height:l=e.height,maxWidth:h=e.maxWidth,maxHeight:c=e.maxHeight,textAlign:u=e.textAlign,textBaseline:d=(null!==(n=null!==(s=t.textBaseline)&&void 0!==s?s:e.textBaseline)&&void 0!==n?n:"top"),editOptions:p}=t;if(o>0&&l>0)i.set(0,0,o,l);else{const t=this.getFrameCache(),{width:e,height:s}=t.getActualSize();let n=o||e||0,r=l||s||0;r="number"==typeof c&&r>c?c:r||0,n="number"==typeof h&&n>h?h:n||0,i.set(0,0,n,r)}p&&p.keepHeightWhileEmpty&&!i.height()&&!(null===(r=t.textConfig)||void 0===r?void 0:r.length)&&(i.y2=i.y1+(null!==(a=t.fontSize)&&void 0!==a?a:12),i.x2=i.x1+2);let g=0;switch(d){case"top":g=0;break;case"middle":g=-i.height()/2;break;case"bottom":g=-i.height()}let f=0;switch(u){case"left":f=0;break;case"center":f=-i.width()/2;break;case"right":f=-i.width()}return l||("middle"===this.verticalDirection?g-=i.height()/2:"bottom"===this.verticalDirection&&(g-=i.height())),i.translate(f,g),ss.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ss.graphicService.updateHTMLTextAABBBounds(t,e,i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,ss.graphicService.transformAABBBounds(t,i,e,!1,this),0===i.width()&&0===i.height()&&i.clear(),i}needUpdateTags(t){return super.needUpdateTags(t,xh)}needUpdateTag(t){return super.needUpdateTag(t,xh)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:s,fontFamily:n,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,lineHeight:c,strokeOpacity:u,upgradeAttrs:d}=this.attribute,p=Object.assign({fill:e,stroke:i,fontSize:s,fontFamily:n,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:u},t);return(null==d?void 0:d.lineHeight)&&(p.lineHeight=c),p}doUpdateFrameCache(t){var e;const{maxWidth:i,maxHeight:s,width:n,height:r,ellipsis:a,wordBreak:o,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d,disableAutoWrapLine:p,editable:g,ascentDescentMode:f,upgradeAttrs:m}=this.attribute,b=m&&m.multiBreakLine;let{textConfig:v=[]}=this.attribute;g&&v.length>0&&!_h.AllSingleCharacter(v)&&(v=_h.TransformTextConfig2SingleCharacter(v),this.attribute.textConfig=v);const x=[],_=null!=t?t:v;for(let t=0;t<_.length;t++)if("image"in _[t]){const e=this.combinedStyleToCharacter(_[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)x.push(i);else{const t=new mh(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,x.push(t)}}else{const e=this.combinedStyleToCharacter(_[t]);if(y(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const i=e.text.split("\n");for(let s=0;s<i.length;s++)if(0===s)x.push(new dh(i[s],!1,e,f));else if(i[s]||t===_.length-1)x.push(new dh(i[s],!0,e,f));else{const e=this.combinedStyleToCharacter(_[t+1]);x.push(new dh(i[s],!0,e,f))}}else e.text&&x.push(new dh(e.text,!1,e,f))}const A="number"==typeof i&&Number.isFinite(i)&&i>0,S="number"==typeof s&&Number.isFinite(s)&&s>0,T="number"==typeof n&&Number.isFinite(n)&&n>0&&(!A||n<=i),w="number"==typeof r&&Number.isFinite(r)&&r>0&&(!S||r<=s),M=new ch(0,0,(T?n:A?i:0)||0,(w?r:S?s:0)||0,a,o,l,h,c,u||"horizontal",!T&&A,!w&&S,d||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),B=new bh(M);if(B.newLine=b,p){let t=0,e=!1;for(let i=0;i<x.length;i++){const s=x[i];e?(s.overflow=!0,s.left=1/0,s.top=1/0,!s.newLine&&M.lines[M.lines.length-1].paragraphs.push(s)):B.deal(s,!0),M.lines.length!==t&&(t=M.lines.length,B.lineBuffer.length=0,s.overflow=!0,s.left=1e3,s.top=1e3,M.lines[M.lines.length-1].paragraphs.push(s),e=!0),s.newLine&&(e=!1,B.lineWidth=0),B.send()}}else for(let t=0;t<x.length;t++)B.deal(x[t]);if(B.send(),!("horizontal"===M.layoutDirection?T:w)){const t=M.getActualSizeWidthEllipsis();let e="horizontal"===M.layoutDirection?t.width:t.height;("horizontal"===M.layoutDirection?A:S)&&(e=Math.min(e,"horizontal"===M.layoutDirection?i:s)),M.lines.forEach((function(t){t.calcOffset(e,!1)}))}b&&M.lines.forEach((t=>{const e=t.paragraphs;t.paragraphs=t.paragraphs.filter((t=>""!==t.text)),0===t.paragraphs.length&&e.length&&(e[0].text="\n",t.paragraphs.push(e[0]))})),this._frameCache=M}clone(){return new _h(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,s,n,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(s=this.stage)||void 0===s||s.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:s}=this.globalTransMatrix;let n;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-s})&&(n=e,n.globalX=(null!==(a=n.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],n.globalY=(null!==(o=n.attribute.y)&&void 0!==o?o:0)+s+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return _h.NOWORK_ANIMATE_ATTR}}function Ah(t){return new _h(t)}_h.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},vl);const Sh=["path","customPath",...gl];class Th extends xl{constructor(t){super(t),this.type="path",this.numberType=Lo}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof yn?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof yn?this.cache:t.path)}getGraphicTheme(){return Nr(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=ss.graphicService.updateTempAABBBounds(i);$l(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:r=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;p(t.path,!0)?this.cache=(new yn).fromString(t.path):t.customPath&&(this.cache=new yn,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Sh)}needUpdateTag(t){return super.needUpdateTag(t,Sh)}toCustomPath(){return(new yn).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Th(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Th.NOWORK_ANIMATE_ATTR}}function wh(t){return new Th(t)}Th.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},vl);const Mh=["segments","points","curveType","curveTension",...gl];class Bh extends xl{constructor(t){super(t),this.type="area",this.numberType=ko}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Nr(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),ss.graphicService.updateTempAABBBounds(i),this.setWidthHeightWithoutTransform(i);const{lineJoin:s=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateAreaAABBBoundsByPoints(t,e,i,s){const{points:n=e.points}=t,r=i;return n.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments}=t,r=i;return n.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,s,n){"points"===t&&(n.points=ia(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Mh)}needUpdateTag(t){return super.needUpdateTag(t,Mh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;t=new yn;const e=this.attribute,i=e.segments,s=e=>{if(e&&e.length){let i=!0;const s=[];if(e.forEach((e=>{var n,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),s.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),s.length){for(let e=s.length-1;e>=0;e--)t.lineTo(s[e].x,s[e].y);t.closePath()}}};return e.points?s(e.points):i&&i.length&&i.forEach((t=>{s(t.points)})),t}clone(){return new Bh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Bh.NOWORK_ANIMATE_ATTR}}Bh.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},vl);const Ch=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...gl];class kh extends xl{constructor(t){super(t),this.type="arc",this.numberType=Bo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=s,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(n-r),o=t=>Math.min(y(t,!0)?t:a*parseFloat(t)/100,a/2);if(g(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=At(e),i=e+r,s&&ot(r)<at-it){let r=1,a=1;s.length&&(r=Number(s[0]),a=Number(s[1]));let{outerRadius:o=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;o+=h,l-=c;const u=Math.abs(o-l)/2,d=u/o;if(u>it&&o>it)return{startAngle:e-n*d*r,endAngle:i+n*d*a,sc:n*d*r,ec:n*d*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=s;const{padRadius:l=pt(a*a+o*o)}=this.attribute,h=ot(e-t);let c=t,u=e,d=t,p=e;const g=r/2;let f=h,m=h;if(g>it&&l>it){const i=e>t?1:-1;let s=ft(Number(l)/o*dt(g)),n=ft(Number(l)/a*dt(g));return(f-=2*s)>it?(s*=i,d+=s,p-=s):(f=0,d=p=(t+e)/2),(m-=2*n)>it?(n*=i,c+=n,u-=n):(m=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:f,outerDeltaAngle:m}}getGraphicTheme(){return Nr(this).arc}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=ss.graphicService.updateTempAABBBounds(i);$l(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),this.setWidthHeightWithoutTransform(i);const{lineJoin:a=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return s+=r,n-=a,s<n&&(s=n),i.set(-s,-s,s,s),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(s+=r,n-=a,s<n){const t=s;s=n,n=t}let{endAngle:o=e.endAngle,startAngle:l=e.startAngle}=t;if(l>o){const t=l;l=o,o=t}return s<=it?i.set(0,0,0,0):Math.abs(o-l)>at-it?i.set(-s,-s,s,s):(ta(l,o,s,i),ta(l,o,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,Ch)}needUpdateTag(t){return super.needUpdateTag(t,Ch)}toCustomPath(){var t,e,i,s;let n=super.toCustomPath();if(n)return n;const r=this.attribute,{startAngle:a,endAngle:o}=this.getParsedAngle();let l=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(s=r.outerPadding)&&void 0!==s?s:0);const c=ot(o-a),u=o>a;if(h<l){const t=h;h=l,l=t}if(n=new yn,h<=it)n.moveTo(0,0);else if(c>=at-it)n.moveTo(0+h*ht(a),0+h*dt(a)),n.arc(0,0,h,a,o,!u),l>it&&(n.moveTo(0+l*ht(o),0+l*dt(o)),n.arc(0,0,l,o,a,u));else{const t=h*ht(a),e=h*dt(a),i=l*ht(o),s=l*dt(o);n.moveTo(0+t,0+e),n.arc(0,0,h,a,o,!u),n.lineTo(0+i,0+s),n.arc(0,0,l,o,a,u),n.closePath()}return n}clone(){return new kh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return kh.NOWORK_ANIMATE_ATTR}}function Ph(t){return new kh(t)}kh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);class Oh extends kh{constructor(t){super(t),this.type="arc3d",this.numberType=Co}updateAABBBounds(t,e,i){const s=this.stage;if(!s||!s.camera)return i;const{outerRadius:n=e.outerRadius,height:r=0}=t,a=n+r;return i.setValue(-a,-a,a,a),ss.graphicService.updateTempAABBBounds(i),ss.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Oh.NOWORK_ANIMATE_ATTR}}function Rh(t){return new Oh(t)}Oh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},vl);const Lh=["points","cornerRadius",...gl];class Eh extends xl{constructor(t){super(t),this.type="polygon",this.numberType=Eo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Nr(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),ss.graphicService.updateTempAABBBounds(i),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1;const{lineJoin:s=e.lineJoin}=t;return ss.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:s=e.points}=t;return s.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,s,n){"points"===t&&(n.points=ia(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Lh)}needUpdateTag(t){return super.needUpdateTag(t,Lh)}toCustomPath(){let t=super.toCustomPath();if(t)return t;const e=this.attribute.points;return t=new yn,e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t}clone(){return new Eh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Eh.NOWORK_ANIMATE_ATTR}}function Ih(t){return new Eh(t)}Eh.NOWORK_ANIMATE_ATTR=vl;class Dh extends Eh{constructor(t){super(t),this.type="pyramid3d",this.numberType=Io}updateAABBBounds(t,e,i){const s=this.stage;return s&&s.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],s=t[1];i.add(e,s)})),ss.graphicService.updateTempAABBBounds(i),ss.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const s=3===i?t[0]:t[i+1],n=e.x-s.x;return 0===n?0:(e.y-s.y)/n})),i=t.map((t=>({p:t,d:0})));let s=!1,n=0;for(let t=0;t<e.length-1;t++){for(let r=t+1;r<e.length;r++){if(e[t]===e[r]){s=!0;const e=vt.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,n=ct(n,e);const a=vt.distancePP(i[r].p,i[r+1].p);i[r].d=a,i[r+1].d=a,n=ct(n,a)}if(s)break}if(s)break}for(let e=t.length-1;e>=0;e--){const s=t[e];i.unshift({p:s,d:0})}for(let e=0;e<t.length;e++){const s=(n-i[e+t.length].d)/2;i[e].d+=s,i[e+t.length].d+=s}const r={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return Dh.NOWORK_ANIMATE_ATTR}}function Fh(t){return new Dh(t)}Dh.NOWORK_ANIMATE_ATTR=vl;class jh extends Al{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function Uh(t){return new jh(t)}const Nh=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Wh;function zh(t){return Wh||(Wh=Nh.CreateGraphic("text",{})),Wh.initAttributes(t),Wh.AABBBounds}var Gh=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Vh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hh=function(t,e){return function(i,s){e(i,s,t)}};class Xh{constructor(){this.time=Ms.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit,backgroundKeepAspectRatio:v=l.backgroundKeepAspectRatio,backgroundScale:x=l.backgroundScale,backgroundOffsetX:_=l.backgroundOffsetX,backgroundOffsetY:A=l.backgroundOffsetY,backgroundClip:S=l.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const n=t.resources.get(g);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Nr(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}S&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=f*m,this.doDrawImage(e,n.data,r,{backgroundMode:y,backgroundFit:b,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:_,backgroundOffsetY:A}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s){const{backgroundMode:n,backgroundFit:r,backgroundKeepAspectRatio:a,backgroundScale:o=1,backgroundOffsetX:l=0,backgroundOffsetY:h=0}=s,c=i.width(),u=i.height();let d=c,p=u;if("no-repeat"===n)if(r)if(a){const s=Math.max(c/e.width,u/e.height);t.drawImage(e,i.x1+l,i.y1+h,e.width*s*o,e.height*s*o)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=e.width*o,n=e.height*o;t.drawImage(e,i.x1+l,i.y1+h,s,n)}else{if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,s=e.height;"repeat-x"===n?(d=i*(u/s),p=u):"repeat-y"===n&&(p=s*(c/i),d=c);const r=t.dpr,a=Lr.allocate({width:d,height:p,dpr:r}),o=a.getContext("2d");o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.clearRect(0,0,d,p),o.drawImage(e,0,0,d,p),e=a.nativeCanvas),Lr.free(a)}const s=t.dpr,a=t.createPattern(e,n);a.setTransform&&a.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),t.fillStyle=a,t.translate(i.x1,i.y1),t.fillRect(0,0,c,u),t.translate(-i.x1,-i.y1)}}}const $h=new Xh;let Yh=class{constructor(t){this.subRenderContribitions=t,this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,c,u,d)}))}};Yh=Gh([Ii(),Hh(0,Li(Zi)),Hh(0,Di(Ul)),Vh("design:paramtypes",[Object])],Yh);const qh=new class{constructor(){this.time=Ms.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const y=!(c||u),b=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:b.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:b.height();y&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,s+x/2,0)&&e.closePath(),c&&c(e,t.attribute,l,!0),y&&e.clip()}};const Kh=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||u||e.restore())}};const Zh=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=Lr.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),n(r,l);const h=s.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Lr.free(o),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,at),e.fill()}))}createDiamondPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{const n=t/2,r=n;s.fillStyle=i,s.moveTo(n,r-e),s.lineTo(e+n,r),s.lineTo(n,r+e),s.lineTo(n-e,r),s.closePath(),s.fill()}))}createRectPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*s,t)}))}createHorizontalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*s)}))}createBiasLRLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(0,0),s.lineTo(t,t);const n=t/2,r=-n;s.moveTo(n,r),s.lineTo(n+t,r+t),s.moveTo(-n,-r),s.lineTo(-n+t,-r+t),s.stroke()}))}createBiasRLLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(t,0),s.lineTo(0,t);const n=t/2,r=n;s.moveTo(t+n,r),s.lineTo(n,r+t),s.moveTo(t-n,-r),s.lineTo(-n,-r+t),s.stroke()}))}createGridPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,t,t),s.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:f=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,g,f,m)}drawTexture(t,e,i,s,n,r,a,o,l){var h;const{textureRatio:c=r.textureRatio,textureOptions:u=null}=e.attribute;let d=this.textureMap.get(t);if(!d)switch(t){case"circle":d=this.createCirclePattern(o,l,a,i);break;case"diamond":d=this.createDiamondPattern(o,l,a,i);break;case"rect":d=this.createRectPattern(o,l,a,i);break;case"vertical-line":d=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":d=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":d=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":d=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":d=this.createGridPattern(o,l,a,i)}if(u&&u.dynamicTexture){const{gridConfig:d={},useNewCanvas:p}=u,g=e.AABBBounds;s=g.x1,n=g.y1;const f=i;let m;if(p){m=Lr.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),s=0,n=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,s,n,r),f.clip();const y=g.width(),b=g.height(),v=l,x=o,_=d.columns?d.columns:Math.ceil(y/x),A=d.rows?d.rows:Math.ceil(b/x),S=d.gutterColumn?d.gutterColumn:2*v,T=d.gutterRow?d.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=th({}));const w=d.columns?y/d.columns:x,M=d.rows?b/d.rows:x;this._tempSymbolGraphic.setAttributes({size:[w-S,M-T],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<A;t++)for(let r=0;r<_;r++){const o=s+x/2+r*x,l=n+x/2+t*x;null===(h=u.beforeDynamicTexture)||void 0===h||h.call(u,i,t,r,A,_,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(w-S,M-T),o,l,0)&&i.closePath(),i.fillStyle=a,u.dynamicTexture(i,t,r,A,_,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(d)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,s,n,r),i.fillStyle=d,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,s,n,r),i.clip();const t=e.AABBBounds;(function(t,e,i,s,n,r,a){const{fill:o="orange",percent:l=.6,frequency:h=4,opacity:c,phi:u=0}=n;let{amplitude:d=10}=n;d*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=s*(1-l),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,s+a),t.lineTo(0+r,p+a);const m=g/h*e,y=g/Math.PI/(2*h);for(let e=0;e<g;e+=f){const i=d*Math.sin((e+m+u)/y+u);t.lineTo(e+r,p+i+a)}t.lineTo(g+r,s+a),t.closePath(),t.fillStyle=o,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},u||{}),{fill:a}),s+t.x1-s,n+t.y1-n),i.restore()}}};const Jh=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,g=d&&!1!==d.visible,f=p&&!1!==p.visible;if(!g&&!f)return;const{innerPadding:m=l.innerPadding,outerPadding:y=l.outerPadding,startAngle:b=l.startAngle,endAngle:v=l.endAngle,opacity:x=l.opacity,x:_=l.x,y:A=l.y,scaleX:S=l.scaleX,scaleY:T=l.scaleY,keepStrokeScale:w=l.keepStrokeScale}=t.attribute;let{innerRadius:M=l.innerRadius,outerRadius:B=l.outerRadius}=t.attribute;B+=y,M-=m;const C=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=w?o:Vn(e,o,e.dpr),c=o/B,d="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:B+d*h,innerRadius:M-d*h,startAngle:b-d*c,endAngle:v+d*c}),e.beginPath(),Rl(t,e,i,s,B+d*h,M-d*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=x,e.setStrokeStyle(t,n,(_-i)/S,(A-s)/T,l[r]),l[r].opacity=a,e.stroke()}};g&&C(d,"outerBorder"),f&&C(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:M,startAngle:b,endAngle:v})}},Qh=Zh,tc=$h,ec=st/2;function ic(t,e,i,s,n,r,a=!0,o){let l;if(Array.isArray(a)&&(o=a,a=!0),s<0&&(e+=s,s=-s),n<0&&(i+=n,n=-n),y(r,!0))l=[r=ot(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=ot(t[0]),l=[e,e,e,e];break;case 2:case 3:e=ot(t[0]),i=ot(t[1]),l=[e,i,e,i];break;default:l=t,l[0]=ot(l[0]),l[1]=ot(l[1]),l[2]=ot(l[2]),l[3]=ot(l[3])}}else l=[0,0,0,0];if(s<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,i,s,n);const[h,c,u,d]=[[e,i],[e+s,i],[e+s,i+n],[e,i+n]],p=Math.min(s/2,n/2),g=[Math.min(p,l[0]),Math.min(p,l[1]),Math.min(p,l[2]),Math.min(p,l[3])],f=[h[0]+g[0],h[1]],m=[h[0],h[1]+g[0]],b=[c[0]-g[1],c[1]],v=[c[0],c[1]+g[1]],x=[u[0]-g[2],u[1]],_=[u[0],u[1]-g[2]],A=[d[0]+g[3],d[1]],S=[d[0],d[1]-g[3]];if(t.moveTo(f[0],f[1]),a){if(o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),!N(b,v)){o&&o[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+g[1];t.arc(e,i,g[1],-ec,0,!1)}if(o&&o[1]?o[1](v[0],v[1],_[0],_[1]):t.lineTo(_[0],_[1]),!N(x,_)){const e=_[0]-g[2],i=_[1];o&&o[1]&&t.moveTo(_[0],_[1]),t.arc(e,i,g[2],0,ec,!1)}if(o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),!N(A,S)){const e=A[0],i=A[1]-g[3];o&&o[2]&&t.moveTo(A[0],A[1]),t.arc(e,i,g[3],ec,st,!1)}if(o&&o[3]?o[3](S[0],S[1],m[0],m[1]):t.lineTo(m[0],m[1]),!N(f,m)){const e=f[0],i=f[1]+g[0];o&&o[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],st,st+ec,!1)}}else o&&o[0]?o[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),o&&o[1]?o[1](b[0],b[1],x[0],x[1]):t.lineTo(x[0],x[1]),o&&o[2]?o[2](x[0],x[1],A[0],A[1]):t.lineTo(A[0],A[1]),o&&o[2]?o[2](A[0],A[1],f[0],f[1]):t.lineTo(f[0],f[1]);return!o&&t.closePath(),t}var sc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class nc{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,m=p&&!1!==p.visible;if(!f&&!m)return;const{cornerRadius:y=l.cornerRadius,cornerType:b=l.cornerType,opacity:v=l.opacity,x:x=l.x,y:_=l.y,scaleX:A=l.scaleX,scaleY:S=l.scaleY,x1:T,y1:w,keepStrokeScale:M=l.keepStrokeScale}=t.attribute;let{width:B,height:C}=t.attribute;B=(null!=B?B:T-i)||0,C=(null!=C?C:w-s)||0;const k=(n,r)=>{const a=!(!n||!n.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=n,c=M?h:Vn(e,h,e.dpr),d=i+o*c,p=s+o*c,f=2*c;if(0===y||g(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(d,p,B-o*f,C-o*f)):(e.beginPath(),ic(e,d,p,B-o*f,C-o*f,y,"bevel"!==b)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,n,(x-i)/A,(_-s)/S,l[r]),l[r].opacity=a,e.stroke()}};f&&k(d,"outerBorder"),m&&k(p,"innerBorder")}}let rc=class{constructor(){this.time=Ms.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}};rc=sc([Ii()],rc);let ac=class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const{x1:d,y1:p,x:f=l.x,y:m=l.y,stroke:y=l.stroke,cornerRadius:b=l.cornerRadius,cornerType:v=l.cornerType}=t.attribute;let{width:x,height:_}=t.attribute;if(x=(null!=x?x:d-f)||0,_=(null!=_?_:p-m)||0,Array.isArray(y)&&y.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,s,l),!(0===b||g(b)&&b.every((t=>0===t)))){let n,r=0;return ic(e,i,s,x,_,b,"bevel"!==v,new Array(4).fill(0).map(((a,o)=>(a,h,c,u)=>{y[o]&&(r===o-1&&y[o]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:y[o]}),i,s,l),e.beginPath(),e.moveTo(a,h),n=y[o]),r=o,e.lineTo(c,u),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),y[0]?e.lineTo(i+x,s):e.moveTo(i+x,s),y[1]?e.lineTo(i+x,s+_):e.moveTo(i+x,s+_),y[2]?e.lineTo(i,s+_):e.moveTo(i,s+_),y[3]){const t=y[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};ac=sc([Ii()],ac);const oc=new nc,lc=Zh,hc=$h;const cc=new class extends nc{constructor(){super(...arguments),this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){return super.drawShape(t,e,i,s,n,r,a,o,l,h,c,u)}},uc=$h;const dc=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:g}=t.attribute,f=p&&!1!==p.visible,m=g&&!1!==g.visible;if(!f&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:v=l.x,y:x=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:S=l.keepStrokeScale}=t.attribute,T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=S?o:Vn(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===d.drawOffset(e,y,i,s,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),u)u(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(v-i)/_,(x-s)/A,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},pc=new class{constructor(){this.time=Ms.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d){const{clipRange:p=l.clipRange,x:g=l.x,y:f=l.y,z:m=l.z,size:y=l.size,scaleX:b=l.scaleX,scaleY:v=l.scaleY}=t.attribute,x=t.getParsedPath();x&&p<1&&p>0&&(e.beginPath(),x.drawWithClipRange&&x.drawWithClipRange(e,y,i,s,p,m,((n,r)=>{var a,h,c,d;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(h=r.opacity)&&void 0!==h?h:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(c=r.stroke)&&void 0!==c?c:t.attribute.stroke,e.lineWidth=null!==(d=r.lineWidth)&&void 0!==d?d:t.attribute.lineWidth,r=e}r.stroke&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,r,(g-i)/b,(f-s)/v,l),e.stroke()))})),r&&!x.isSvg&&(u?u(e,t.attribute,l):o&&(e.setStrokeStyle(t,t.attribute,(g-i)/b,(f-s)/v,l),e.stroke())))}},gc=Zh,fc=$h,mc={x:0,y:0,z:0,lastModelMatrix:null};class yc{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(qh),this.builtinContributions.push(Kh),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===Ms.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ms.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,u,d)}))}drawPathProxy(t,e,i,s,n,r,a,o){if(!t.pathProxy)return!1;const l=Nr(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:g=l.strokeOpacity,visible:f=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=Ml(u,d,h),v=Cl(u,g),x=Tl(h),_=wl(c,p);if(!f)return!0;if(!x&&!_)return!0;if(!(b||v||a||o))return!0;e.beginPath();return Ps(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,x,_,b,v,l,n,a,o),_&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-m,s-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,s-y,l),e.fill())),this.afterRenderStep(t,e,i,s,x,_,b,v,l,n,a,o),!0}valid(t,e,i,s){const{fill:n=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=Ml(o,l,n),p=Cl(o,c),g=Tl(n,r),f=wl(a,h);return!(!t.valid||!u)&&!(!g&&!f)&&!!(d||p||i||s||r)&&{fVisible:d,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i,s=!1){const{x:n=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;mc.x=n,mc.y=r,mc.z=a,mc.lastModelMatrix=u;const p=d&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const s=Zo.allocate(),n=Zo.allocate();Hl(n,t,e),$o(s,u||s,n),mc.x=0,mc.y=0,mc.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Zo.free(n)}if(g&&!u){const s=t.getOffsetXY(e);mc.x+=s.x,mc.y+=s.y,mc.z=a,i.setTransformForCurrent()}else if(p)mc.x=0,mc.y=0,mc.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const s=t.getOffsetXY(e);mc.x+=s.x,mc.y+=s.y,this.transformWithoutTranslate(i,mc.x,mc.y,mc.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),mc.x=0,mc.y=0,mc.z=0;return mc}transformUseContext2d(t,e,i,s){const n=s.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,a=s.project(0,0,i),o=s.project(n,0,i),l=s.project(n,r,i),h={x:0,y:0},c={x:n,y:0},u={x:n,y:r};s.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+u.y*o.x+(c.y-u.y)*a.x)*d,g=(c.y*l.y+h.y*(o.y-l.y)-u.y*o.y+(u.y-c.y)*a.y)*d,f=(h.x*(l.x-o.x)-c.x*l.x+u.x*o.x+(c.x-u.x)*a.x)*d,m=-(c.x*l.y+h.x*(o.y-l.y)-u.x*o.y+(u.x-c.x)*a.y)*d,y=(h.x*(u.y*o.x-c.y*l.x)+h.y*(c.x*l.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,b=(h.x*(u.y*o.y-c.y*l.y)+h.y*(c.x*l.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;s.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,n,r,a){const o=t.project(e,i,s);t.translate(o.x,o.y,!1),t.scale(n,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,n,r){const{context:a}=s;if(!a)return;const{renderable:o}=t.attribute;if(!1===o)return;a.highPerformanceSave();const l=this.transform(t,e,a,i),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawPathProxy(t,a,h,c,s,n)||(this.drawShape(t,a,h,c,s,n,null,null,r),this.z=0,a.modelMatrix!==d&&Zo.free(a.modelMatrix),a.modelMatrix=d),a.highPerformanceRestore()}}var bc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},vc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xc=function(t,e){return function(i,s){e(i,s,t)}};let _c=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Bo,this.builtinContributions=[Jh,tc,Qh],this.init(t)}drawArcTailCapPath(t,e,i,s,n,r,a,o){const l=o-a,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=o;const d=u>c;let p=!1;if(n<r){const t=n;n=r,r=t}const{outerDeltaAngle:g,xors:f,yors:m,xirs:y,yirs:b,limitedOcr:v,outerCornerRadiusStart:x,outerCornerRadiusEnd:_,maxOuterCornerRadius:A,xore:S,yore:T,xire:w,yire:M,limitedIcr:B,innerDeltaAngle:C,innerStartAngle:k,innerCornerRadiusStart:P,innerCornerRadiusEnd:O,maxInnerCornerRadius:R}=Ol(t,c,u,r,n);if(v>it){const t=ut(x,v),r=ut(_,v),a=Pl(y,b,f,m,n,t,Number(d)),o=Pl(S,T,w,M,n,r,Number(d));if(v<A&&t===r)e.moveTo(i+a.cx+a.x01,s+a.cy+a.y01),e.arc(i+a.cx,s+a.cy,v,lt(a.y01,a.x01),lt(o.y01,o.x01),!d);else{const t=u-l-.03,a=lt(o.y11,o.x11);e.arc(i,s,n,t,a,!d),r>0&&e.arc(i+o.cx,s+o.cy,r,lt(o.y11,o.x11),lt(o.y01,o.x01),!d)}}else e.moveTo(i+f,s+m);if(!(r>it)||C<.001)e.lineTo(i+w,s+M),p=!0;else if(B>it){const t=ut(P,B),n=ut(O,B),a=Pl(w,M,S,T,r,-n,Number(d)),o=Pl(f,m,y,b,r,-t,Number(d));if(e.lineTo(i+a.cx+a.x01,s+a.cy+a.y01),B<R&&t===n){const t=lt(o.y01,o.x01);e.arc(i+a.cx,s+a.cy,B,lt(a.y01,a.x01),t,!d)}else{n>0&&e.arc(i+a.cx,s+a.cy,n,lt(a.y01,a.x01),lt(a.y11,a.x11),!d);const t=lt(a.cy+a.y11,a.cx+a.x11),o=u-l-.03;e.arc(i,s,r,t,o,d)}}else e.lineTo(i+r*ht(k),s+r*dt(k));return p}drawShape(t,e,i,s,n,r,o,l,h){h=null!=h?h:Nr(t,null==r?void 0:r.theme).arc;const{fill:c=h.fill,stroke:u=h.stroke,x:d=h.x,y:p=h.y,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,o,l);if(!f)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:v}=f,{outerPadding:x=h.outerPadding,innerPadding:_=h.innerPadding,cap:A=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:T=h.outerRadius,innerRadius:w=h.innerRadius}=t.attribute;T+=x,w-=_;let M=0;const B=(a(A)&&A||A[0])&&"conical"===c.gradient;if(B){const{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();ot(s-i)<at-it&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let C=!1;const{isFullStroke:k,stroke:P}=(t=>{var e;let i=!0;if(a(t,!0)){for(let s=0;s<4;s++)qr[s]=t,i&&(i=!(null!==(e=qr[s])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)qr[e]=!!t[e],i&&(i=!!qr[e]);else qr[0]=!1,qr[1]=!1,qr[2]=!1,qr[3]=!1;return{isFullStroke:i,stroke:qr}})(u);if((b||k)&&(e.beginPath(),Rl(t,e,i,s,T,w),C=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,b,v,m,y,h,n,o,l),g?(this._runStroke(t,e,i,s,h,v,k,y,l),this._runFill(t,e,i,s,h,b,m,d,p,o)):(this._runFill(t,e,i,s,h,b,m,d,p,o),this._runStroke(t,e,i,s,h,v,k,y,l))),!k&&v&&(e.beginPath(),Rl(t,e,i,s,T,w,P),C||this.beforeRenderStep(t,e,i,s,b,v,m,y,h,n,o,l),l?l(e,t.attribute,h):y&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),(a(A)&&A||A[1])&&S){const{startAngle:r,endAngle:a}=t.getParsedAngle();if(ot(a-r)>=at-it){e.beginPath();const r=Math.abs(T-w)/2/T,{endAngle:a=h.endAngle,fill:c=h.fill}=t.attribute,u=a;this.drawArcTailCapPath(t,e,i,s,T,w,u,u+r),C||this.beforeRenderStep(t,e,i,s,b,v,m,y,h,n,o,l);const d=()=>{if(b){const n=c;if("conical"===n.gradient){const r=function(t,e,i,s){const{stops:n,startAngle:r,endAngle:a}=s;for(;i<0;)i+=at;for(;i>at;)i-=at;if(i<r)return n[0].color;if(i>a)return n[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t<n.length;t++)if(n[t].offset>=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),al(o.color,l.color,h,!1)}(0,0,a,n);o||Ml&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=r,e.fill())}}},p=()=>{v&&(l||y&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))};d(),p()}}this.afterRenderStep(t,e,i,s,b,v,m,y,h,n,o,l),B&&(c.startAngle+=M,c.endAngle+=M)}_runFill(t,e,i,s,n,r,a,o,l,h){r&&(h?h(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l){r&&a&&(l||o&&(e.setStrokeStyle(t,t.attribute,i,s,n),e.stroke()))}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s,n)}};function Ac(t,e,i,s){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,a):t.lineTo(n+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[s]=Fs(e,i);t.bezierCurveTo(n+s.p1.x,r+s.p1.y,n+s.p2.x,r+s.p2.y,n+s.p3.x,r+s.p3.y,a)}else{const s=e.getPointAt(i);t.lineTo(n+s.x,r+s.y,a)}}function Sc(t,e,i,s,n,r,a){var o;let l=e.p0,h=s;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)s||(t.lineTo(l.x+n,l.y+r,a),h=!s);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=l:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+n,o+r,a)}else d&&(h=!s,t.lineTo(d.x+n,d.y+r,a))}return h}_c=bc([Ii(),xc(0,Li(Zi)),xc(0,Di(Ll)),vc("design:paramtypes",[Object])],_c);var Tc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let wc=class extends yc{constructor(){super(...arguments),this.numberType=Ro}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).line;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,c,u,d,p,f){var m;if(!e)return;t.beginPath();(function(t,e,i,s,n){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=n||{};if(h&&"none"===l)return;if(!e)return;let c=!0;const{curves:u}=e;if(i>=1){if(h){let e,i=!0;u.forEach(((s,n)=>{s.originP1!==s.originP2?(i=Sc(t,s,e,i,r,a,o),e=s):e=s}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+a,o),Ac(t,e,1,n),c=!1):c=!0}));return}if(i<=0)return;let d;"x"===s?d=Ts.ROW:"y"===s?d=Ts.COLUMN:"auto"===s&&(d=e.direction);const p=i*e.tryUpdateLength(d);let g=0,f=!0,m=null;for(let e=0,i=u.length;e<i;e++){const i=u[e],s=i.getLength(d),l=(p-g)/s;if(g+=s,l<0)break;if(h){if(i.originP1===i.originP2){m=i;continue}f=Sc(t,i,m,f,r,a,o),m=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+a,o),Ac(t,i,ut(l,1),n),c=!1}}})(t,e,l,h,{offsetX:c,offsetY:u,offsetZ:null!==(m=this.z)&&void 0!==m?m:0}),d.cache&&!g(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:y=0,x:b=0}=a;return!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(d,a,y-c,b-u,o),t.fill())),!1!==s&&(f?f(t,a,o):r&&(t.setStrokeStyle(d,a,y-c,b-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,c,u,d){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+a,m.y+o,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+a,i.y+o,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==s&&(d?d(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,i,s,n,r,a,o){const l=Nr(t,null==r?void 0:r.theme).line,{fill:h=l.fill,stroke:c=l.stroke,fillOpacity:u=l.fillOpacity,strokeOpacity:d=l.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=l.curveTension,connectedType:y=l.connectedType}=t.attribute;if(!this.valid(t,l,a,o))return;let{curveType:b=l.curveType}=t.attribute;f&&"linear"===b&&(b="linearClosed");const{clipRange:v=l.clipRange,clipRangeByDimension:x=l.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some((t=>!1===t.defined))&&"linear"===b)return this.drawLinearLineHighPerformance(t,e,!!h,!!c,u,d,i,s,l,n,r,a,o);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,s=e;if(i&&i.length){let e,s;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(s={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:s.endX,y:s.endY,defined:s.curves[s.curves.length-1].defined}:i>1&&(e.x=s.endX,e.y=s.endY,e.defined=s.curves[s.curves.length-1].defined);const n=mn(_(t.points,y),b,{startPoint:e,curveTension:m});return s=n,n})).filter((t=>!!t)),"linearClosed"===b){let e;for(let i=0;i<t.cache.length;i++){const s=t.cache[i];for(let t=0;t<s.curves.length;t++)if(s.curves[t].defined){e=s.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=mn(_(s,y),b,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const n=t.attribute.segments.filter((t=>t.points.length));if(1===n[0].points.length&&n.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!c,u,d,n[g],[l,t.attribute],v,x,i,s,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const y=r.getLength(),b=(p-g)/y;g+=y,b>0&&(f=this.drawSegmentItem(e,r,!!h,!!c,u,d,n[m],[l,t.attribute],ut(b,1),x,i,s,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!c,u,d,t.attribute,l,v,x,i,s,t,a,o)}};wc=Tc([Ii()],wc);var Mc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cc=function(t,e){return function(i,s){e(i,s,t)}};let kc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.type="rect",this.numberType=Do,this.builtinContributions=[oc,hc,lc],this.init(t)}drawShape(t,e,i,s,n,r,a,o,l){l=null!=l?l:Nr(t,null==r?void 0:r.theme).rect;const{fill:h=l.fill,background:c,stroke:u=l.stroke,cornerRadius:d=l.cornerRadius,cornerType:p=l.cornerType,opacity:f=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:v=l.visible,x1:x,y1:_,x:A=l.x,y:S=l.y,fillStrokeOrder:T=l.fillStrokeOrder,drawStrokeWhenZeroWH:w=l.drawStrokeWhenZeroWH}=t.attribute;let{width:M,height:B}=t.attribute;M=(null!=M?M:x-A)||0,B=(null!=B?B:_-S)||0;const C=Bl(f,m,M,B,h),k=kl(f,b,M,B,w),P=Tl(h,c),O=wl(u,y);if(!t.valid||!v)return;if(!P&&!O)return;if(!(C||k||a||o||c))return;0===d||g(d)&&d.every((t=>0===t))?(e.beginPath(),e.rect(i,s,M,B)):(e.beginPath(),ic(e,i,s,M,B,d,"bevel"!==p));const R={doFill:P,doStroke:O};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,P,O,C,k,l,n,a,o,R),T?(this._runStroke(t,e,i,s,l,R,k,A,S,o),this._runFill(t,e,i,s,l,R,C,A,S,a)):(this._runFill(t,e,i,s,l,R,C,A,S,a),this._runStroke(t,e,i,s,l,R,k,A,S,o)),this.afterRenderStep(t,e,i,s,P,O,C,k,l,n,a,o)}_runFill(t,e,i,s,n,r,a,o,l,h){r.doFill&&(h?h(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l,h){r.doStroke&&(h?h(e,t.attribute,n):a&&(e.setStrokeStyle(t,t.attribute,o-i,l-s,n),e.stroke()))}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).rect;this._draw(t,n,!1,i,s,n)}};kc=Mc([Ii(),Cc(0,Li(Zi)),Cc(0,Di(Dl)),Bc("design:paramtypes",[Object])],kc);var Pc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Oc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rc=function(t,e){return function(i,s){e(i,s,t)}};let Lc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Uo,this.builtinContributions=[dc,fc,gc,pc],this.init(t)}drawShape(t,e,i,s,n,r,a,o,l){var h;l=null!=l?l:Nr(t,null==r?void 0:r.theme).symbol;const{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY,fillStrokeOrder:m=l.fillStrokeOrder,clipRange:y=l.clipRange}=t.attribute,b=this.valid(t,l,a,o);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b,S=t.getParsedPath();if(!S)return;const{keepDirIn3d:T=l.keepDirIn3d}=t.attribute,w=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();let M=i,B=s,C=w;const k=e.camera;if(T&&k&&e.project){const t=e.project(i,s,w);e.camera=null,g(c)&&(c[0],c[1]),M=t.x,B=t.y,C=void 0}!1===S.draw(e,c,M,B,C,((n,r)=>{var h,c,g,b;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(h=r.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=r.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(g=r.stroke)&&void 0!==g?g:t.attribute.stroke,e.lineWidth=null!==(b=r.lineWidth)&&void 0!==b?b:t.attribute.lineWidth,r=e}const v=()=>{r.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,r,u-i,d-s,l),e.fill()))},_=()=>{r.stroke&&(o?o(e,t.attribute,l):x&&y>=1&&(e.setStrokeStyle(t,r,(u-i)/p,(d-s)/f,l),e.stroke()))};m?(_(),v()):(v(),_())}))&&e.closePath(),e.camera=k,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,A,v,x,l,n,a,o),m?(this._runStroke(t,e,i,s,l,A,x,u,d,S,y,p,f,o),this._runFill(t,e,i,s,l,_,v,u,d,S,a)):(this._runFill(t,e,i,s,l,_,v,u,d,S,a),this._runStroke(t,e,i,s,l,A,x,u,d,S,y,p,f,o)),this.afterRenderStep(t,e,i,s,_,A,v,x,l,n,a,o)}_runFill(t,e,i,s,n,r,a,o,l,h,c){r&&!h.isSvg&&(c?c(e,t.attribute,n):a&&(e.setCommonStyle(t,t.attribute,o-i,l-s,n),e.fill()))}_runStroke(t,e,i,s,n,r,a,o,l,h,c,u,d,p){r&&!h.isSvg&&(p?p(e,t.attribute,n):a&&c>=1&&(e.setStrokeStyle(t,t.attribute,(o-i)/u,(l-s)/d,n),e.stroke()))}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Lc=Pc([Ii(),Rc(0,Li(Zi)),Rc(0,Di(Fl)),Oc("design:paramtypes",[Object])],Lc);const Ec=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Xt)}allocate(t,e,i,s){if(!this.pools.length)return(new Xt).setValue(t,e,i,s);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}allocateByObj(t){if(!this.pools.length)return new Xt(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(...t){this.pools=[]}};const Ic=new class extends Xh{constructor(){super(...arguments),this.time=Ms.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,u,d){var p,g,f,m,y,b,v,x,_,A;const{backgroundMode:S=l.backgroundMode,backgroundFit:T=l.backgroundFit,backgroundKeepAspectRatio:w=l.backgroundKeepAspectRatio}=t.attribute;let M,{background:B}=t.attribute;if(!B)return;const C=()=>{"richtext"===t.type&&(e.restore(),e.save(),M&&e.setTransformFromMatrix(M,!0,1))};let k;"richtext"===t.type&&(M=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=c(B)&&B.background,O=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(p=B.x)&&void 0!==p?p:e.x1)+(null!==(g=B.dx)&&void 0!==g?g:0),s=(null!==(f=B.y)&&void 0!==f?f:e.y1)+(null!==(m=B.dy)&&void 0!==m?m:0),n=null!==(y=B.width)&&void 0!==y?y:e.width(),r=null!==(b=B.height)&&void 0!==b?b:e.height();if(k=Ec.allocate(i,s,i+n,s+r),B=B.background,!O){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,O||(k=zh(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const n=t.resources.get(B);if("success"!==n.state||!n.data)return void C();e.highPerformanceSave(),O&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,s,l),this.doDrawImage(e,n.data,k,{backgroundMode:S,backgroundFit:T,backgroundKeepAspectRatio:w}),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=B,n?(ic(e,k.x1,k.y1,k.width(),k.height(),n,!0),e.fill()):e.fillRect(k.x1,k.y1,k.width(),k.height()),e.highPerformanceRestore()}P&&Ec.free(k),C()}};var Dc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jc=function(t,e){return function(i,s){e(i,s,t)}};let Uc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=No,this.builtinContributions=[Ic],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,c;const u=Nr(t,null==r?void 0:r.theme).text,{text:d,underline:p=u.underline,lineThrough:g=u.lineThrough,keepDirIn3d:f=u.keepDirIn3d,direction:m=u.direction,fontSize:y=u.fontSize,verticalMode:b=u.verticalMode,x:v=u.x,y:x=u.y}=t.attribute,_=null!==(l=sa(t.attribute.lineHeight,y))&&void 0!==l?l:y,A=this.valid(t,u,a,o);if(!A)return;const{fVisible:S,sVisible:T,doFill:w,doStroke:M}=A,B=!f,C=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,s,w,M,S,T,u,n,a,o),B&&this.transformUseContext2d(t,u,C,e);const k=(n,r,l,h)=>{let c=i+r;const d=s+l;if(h){e.highPerformanceSave(),c+=y;const t=Ko.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Ko.free(t)}M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-s,u),e.strokeText(n,c,d,C))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-s,u),e.fillText(n,c,d,C))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,C),"horizontal"===m){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=n.bbox;M&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,v-i,x-s,u),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+s,C)})))),w&&(a?a(e,t.attribute,u):S&&(e.setCommonStyle(t,t.attribute,v-i,x-s,u),n.lines.forEach((n=>{e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,C),this.drawUnderLine(p,g,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,n.descent,(n.descent-n.ascent)/2,C,u,e,{width:n.width})}))))}else{let{textAlign:i=u.textAlign,textBaseline:s=u.textBaseline}=t.attribute;if(!b){const e=i;i=null!==(h=t.getBaselineMapAlign()[s])&&void 0!==h?h:"left",s=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const n=t.cache,{verticalList:r}=n;e.textAlign="left",e.textBaseline="top";const a=_*r.length;let o=0;r.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=ct(e,o)}));let l=0,d=0;"bottom"===s?d=-a:"middle"===s&&(d=-a/2),"center"===i?l-=o/2:"right"===i&&(l-=o),r.forEach(((t,e)=>{const s=t.reduce(((t,e)=>t+(e.width||0)),0),n=o-s;let r=l;"center"===i?r+=n/2:"right"===i&&(r+=n),t.forEach((t=>{const{text:i,width:s,direction:n}=t;k(i,a-(e+1)*_+d,r,n),r+=s}))}))}B&&this.restoreTransformUseContext2d(t,u,C,e),this.afterRenderStep(t,e,i,s,w,M,S,T,u,n,a,o)}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,a=!r;this._draw(t,n,a,i,s)}drawUnderLine(t,e,i,s,n,r,a,o,h,c,u){if(e+t<=0)return;const{textAlign:d=h.textAlign,fill:p=h.fill,opacity:g=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:m=h.underlineDash,fillOpacity:y=h.fillOpacity}=i.attribute,b=!l(u),v=b?u.width:i.clipedWidth,x=b?0:Nl(d,v),_={lineWidth:0,stroke:p,opacity:g,strokeOpacity:y};if(t){_.lineWidth=t,c.setStrokeStyle(i,_,s,n,h),m&&c.setLineDash(m),c.beginPath();const e=n+r+f;c.moveTo(s+x,e,o),c.lineTo(s+x+v,e,o),c.stroke()}if(e){_.lineWidth=e,c.setStrokeStyle(i,_,s,n,h),c.beginPath();const t=n+a;c.moveTo(s+x,t,o),c.lineTo(s+x+v,t,o),c.stroke()}}};function Nc(t,e,i,s){if(e&&e.length){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n<e.length;n++)t.lineTo(e[n].x+i,e[n].y+s)}}function Wc(t,e){return Math.sqrt(t*t+e*e)}function zc(t,e,i,s,n){const r=e/i;return{x:t.x-s*r,y:t.y-n*r}}Uc=Dc([Ii(),jc(0,Li(Zi)),jc(0,Di(jl)),Fc("design:paramtypes",[Object])],Uc);const Gc=Zh,Vc=$h;var Hc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$c=function(t,e){return function(i,s){e(i,s,t)}};let Yc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Eo,this.builtinContributions=[Vc,Gc],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Nr(t,null==r?void 0:r.theme).polygon,{points:h=l.points,cornerRadius:c=l.cornerRadius,x:u=l.x,y:d=l.y,closePath:p=l.closePath,fillStrokeOrder:f=l.fillStrokeOrder}=t.attribute,m=this.valid(t,l,a,o);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),c<=0||g(c)&&c.every((t=>0===t))?Nc(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,n,r=!0){var a;if(e.length<3)return void Nc(t,e,i,s);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+s));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],c=e[(r+1)%e.length],u=h.x-o.x,d=h.y-o.y,p=h.x-c.x,g=h.y-c.y,f=(Math.atan2(d,u)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,b=y/m;const v=Wc(u,d),x=Wc(p,g),_=Math.min(v,x);b>_&&(b=_,y=_*m);const A=zc(h,b,v,u,d),S=zc(h,b,x,p,g),T=2*h.x-A.x-S.x,w=2*h.y-A.y-S.y,M=Wc(T,w),B=zc(h,Wc(b,y),M,T,w);let C=Math.atan2(A.y-B.y,A.x-B.x);const k=Math.atan2(S.y-B.y,S.x-B.x);let P=k-C;P<0&&(C=k,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(A.x+i,A.y+s):t.lineTo(A.x+i,A.y+s),P&&t.arcTo(h.x+i,h.y+s,S.x+i,S.y+s,y),t.lineTo(S.x+i,S.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,v,x,y,b,l,n,a,o);const _=()=>{v&&(a?a(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,u-i,d-s,l),e.fill()))},A=()=>{x&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,u-i,d-s,l),e.stroke()))};f?(A(),_()):(_(),A()),this.afterRenderStep(t,e,i,s,v,x,y,b,l,n,a,o)}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};Yc=Hc([Ii(),$c(0,Li(Zi)),$c(0,Di(Il)),Xc("design:paramtypes",[Object])],Yc);var qc=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zc=function(t,e){return function(i,s){e(i,s,t)}};const Jc=["","repeat-x","repeat-y","repeat"];let Qc=class extends yc{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Oo,this.builtinContributions=[cc,uc],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Nr(t).image,{repeatX:h=l.repeatX,repeatY:c=l.repeatY,x:u=l.x,y:d=l.y,cornerRadius:p=l.cornerRadius,fillStrokeOrder:f=l.fillStrokeOrder,cornerType:m=l.cornerType,image:y}=t.attribute,b=this.valid(t,l,a);if(!b)return;const{fVisible:v,sVisible:x,doFill:_,doStroke:A}=b;if(!y||!t.resources)return;const S=t.resources.get(y);if("success"!==S.state)return;const T=t.width,w=t.height;e.beginPath();let M=!1;0===p||g(p)&&p.every((t=>0===t))?e.rect(i,s,T,w):(ic(e,i,s,T,w,p,"bevel"!==m),M=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const B=()=>{if(_)if(a)a(e,t.attribute,l);else if(v){e.setCommonStyle(t,t.attribute,i,s,l);let n=0;if("repeat"===h&&(n|=1),"repeat"===c&&(n|=2),n){const t=e.createPattern(S.data,Jc[n]);e.fillStyle=t,e.translate(i,s,!0),e.fillRect(0,0,T,w),e.translate(-i,-s,!0)}else e.drawImage(S.data,i,s,T,w)}},C=()=>{A&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,u-i,d-s,l),e.stroke()))};f?(C(),M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,_,!1,v,!1,l,n,a),B(),M&&e.restore()):(M&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,s,_,!1,v,!1,l,n,a),B(),M&&e.restore(),C()),this.afterRenderStep(t,e,i,s,_,!1,v,!1,l,n,a)}draw(t,e,i){const{image:s}=t.attribute;if(!s||!t.resources)return;const n=t.resources.get(s);if("loading"===n.state&&p(s))return void Xr.improveImageLoading(s);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const a=Nr(t).image;this._draw(t,a,!1,i)}};Qc=qc([Ii(),Zc(0,Li(Zi)),Zc(0,Di(El)),Kc("design:paramtypes",[Object])],Qc);const tu=Symbol.for("ArcRender"),eu=Symbol.for("Arc3dRender"),iu=Symbol.for("GraphicRender"),su=Symbol.for("LineRender"),nu=Symbol.for("PolygonRender"),ru=Symbol.for("RectRender"),au=Symbol.for("Rect3DRender"),ou=Symbol.for("SymbolRender"),lu=Symbol.for("TextRender"),hu=Symbol.for("RichTextRender"),cu=Symbol.for("Pyramid3dRender"),uu=Symbol.for("ImageRender");var du=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let pu,gu=class extends wc{constructor(){super(...arguments),this.numberType=Ro}drawShape(t,e,i,s,n,r,a,o){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Nr(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=Ml(d,p,c),b=Cl(d,g),v=Tl(c),x=wl(u,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:_}=n;for(let n=e;n<e+r;n++)this.drawIncreaseSegment(t,_,l[n-1],l[n],t.attribute.segments[n],[h,t.attribute],i,s)}else super.drawShape(t,e,i,s,n,r,a,o)}drawIncreaseSegment(t,e,i,s,n,r,a,o){s&&(e.beginPath(),function(t,e,i,s){const{offsetX:n=0,offsetY:r=0}=s||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+n,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,a,o,r),e.stroke())}};gu=du([Ii()],gu);class fu{static registerPlugin(t,e){fu._pluginClasses[t]=e}static getPlugin(t){return fu._pluginClasses[t]}}fu._pluginClasses={};class mu{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=nl.Get(e,sl.Color1),this.ambient=i;const s=pt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/s,t[1]/s,t[2]/s]}computeColor(t,e){const i=this.formatedDir,s=ut(ct((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let n;n=p(e)?nl.Get(e,sl.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*n[0]*s}, ${r[1]*n[1]*s}, ${r[2]*n[2]*s})`}}const yu=()=>{fu.registerPlugin("DirectionalLight",mu)};class bu{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Zo.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,s){let n,r,a,o,l,h,c,u,d,p;const g=e[0],f=e[1],m=e[2],y=s[0],b=s[1],v=s[2],x=i[0],_=i[1],A=i[2];Math.abs(g-x)<it&&Math.abs(f-_)<it&&Math.abs(m-A)<it?Ho(t):(c=g-x,u=f-_,d=m-A,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,n=b*d-v*u,r=v*c-y*d,a=y*u-b*c,p=Math.hypot(n,r,a),p?(p=1/p,n*=p,r*=p,a*=p):(n=0,r=0,a=0),o=u*a-d*r,l=d*n-c*a,h=c*r-u*n,p=Math.hypot(o,l,h),p?(p=1/p,o*=p,l*=p,h*=p):(o=0,l=0,h=0),t[0]=n,t[1]=o,t[2]=c,t[3]=0,t[4]=r,t[5]=l,t[6]=u,t[7]=0,t[8]=a,t[9]=h,t[10]=d,t[11]=0,t[12]=-(n*g+r*f+a*m),t[13]=-(o*g+l*f+h*m),t[14]=-(c*g+u*f+d*m),t[15]=1)}(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Zo.allocate());const{left:t,top:e,right:i,bottom:s}=this._params;return function(t,e,i,s,n,r,a){const o=1/(e-i),l=1/(s-n),h=1/(r-a);t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+i)*o,t[13]=(n+s)*l,t[14]=(a+r)*h,t[15]=1}(this._projectionMatrixCached,t,i,s,e,0,-2e6),this._vp||(this._vp=Zo.allocate()),this._vp=$o(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:s}=this._params;return(null!=e?e:s-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const s=[0,0,0];return Yo(s,[t,e,i],this._viewMatrixCached),s}vp(t,e,i){const s=[0,0,0],{pos:n}=this._params.viewParams;Yo(s,[t,e,i],this._viewMatrixCached),t=s[0],e=s[1],i=s[2];const r=this.getProjectionScale(i);return{x:t*r+n[0],y:e*r+n[1]}}}const vu=()=>{fu.registerPlugin("OrthoCamera",bu)};let xu=!1;const _u=new Ti((t=>{xu||(xu=!0,t(_c).toSelf().inSingletonScope(),t(tu).to(_c).inSingletonScope(),t(iu).toService(tu),t(Ll).toService(Yh),Qi(t,Ll))}));let Au=!1;const Su=new Ti((t=>{Au||(Au=!0,t(kc).toSelf().inSingletonScope(),t(ru).to(kc).inSingletonScope(),t(iu).toService(ru),t(ac).toSelf(),t(rc).toSelf(),t(Dl).toService(ac),t(Dl).toService(rc),t(Dl).toService(Yh),Qi(t,Dl))}));let Tu=!1;const wu=new Ti((t=>{Tu||(Tu=!0,t(wc).toSelf().inSingletonScope(),t(gu).toSelf().inSingletonScope(),t(su).to(wc).inSingletonScope(),t(iu).toService(su))}));let Mu=!1;const Bu=new Ti((t=>{Mu||(Mu=!0,t(Lc).toSelf().inSingletonScope(),t(ou).to(Lc).inSingletonScope(),t(iu).toService(ou),t(Fl).toService(Yh),Qi(t,Fl))}));let Cu=!1;const ku=new Ti((t=>{Cu||(Cu=!0,t(lu).to(Uc).inSingletonScope(),t(iu).toService(lu),t(jl).toService(Yh),Qi(t,jl))}));let Pu=!1;const Ou=new Ti((t=>{Pu||(Pu=!0,t(nu).to(Yc).inSingletonScope(),t(iu).toService(nu),t(Il).toService(Yh),Qi(t,Il))}));var Ru=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Lu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Eu=class extends yc{constructor(){super(),this.numberType=jo,this.builtinContributions=[Ic],this.init()}drawShape(t,e,i,s,n){const r=Nr(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const c=Ml(o,l,!0),u=Ml(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,r),e.translate(i,s),this.beforeRenderStep(t,e,i,s,c,u,c,u,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,s,c,u,c,u,r,n))}drawIcon(t,e,i,s,n){var r;const a=Nr(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:f=a.backgroundRadius,margin:m}=t.attribute,{backgroundWidth:y=o,backgroundHeight:b=l}=t.attribute;if(m&&(i+=t._marginArray[3],s+=t._marginArray[0]),t._hovered){const t=(y-o)/2,n=(b-l)/2;0===f?(e.beginPath(),e.rect(i-t,s-n,y,b)):(e.beginPath(),ic(e,i-t,s-n,y,b,f,!0)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const v=c&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(c));v&&"success"===v.state&&(e.globalAlpha=h,e.drawImage(v.data,i,s,o,l))}draw(t,e,i){const s=Nr(t).richtext;this._draw(t,s,!1,i)}};Eu=Ru([Ii(),Lu("design:paramtypes",[])],Eu);let Iu=!1;const Du=new Ti((t=>{Iu||(Iu=!0,t(hu).to(Eu).inSingletonScope(),t(iu).toService(hu))}));let Fu=!1;const ju=new Ti((t=>{Fu||(Fu=!0,t(uu).to(Qc).inSingletonScope(),t(iu).toService(uu),t(El).toService(Yh),Qi(t,El))}));class Uu extends yc{stroke(t,e,i,s,n){const r=s.vertices;s.edges.forEach((s=>{const a=r[s[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[s[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};n.beginPath(),n.moveTo(o.x,o.y,o.z),n.lineTo(h.x,h.y,h.z),n.stroke()}))}fill(t,e,i,s,n,r,a,o,l,h,c){const u=nl.Get(r,sl.Color255),d=s.vertices,p=d.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];s.polygons.forEach(((t,e)=>{if(n&&!n[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,s=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=s+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((s=>{const{polygon:n,normal:p}=s.polygon,g=d[n[0]],f=d[n[1]],m=d[n[2]],y=d[n[3]],b={x:t+g[0],y:e+g[1],z:i+g[2]},v={x:t+f[0],y:e+f[1],z:i+f[2]},x={x:t+m[0],y:e+m[1],z:i+m[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]};a.beginPath(),a.moveTo(b.x,b.y,b.z),a.lineTo(v.x,v.y,v.z),a.lineTo(x.x,x.y,x.z),a.lineTo(_.x,_.y,_.z),a.closePath(),c?c(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,u):r,a.fill())}))}}var Nu=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Wu=class extends Uu{constructor(){super(...arguments),this.type="rect3d",this.numberType=Fo}drawShape(t,e,i,s,n,r,a,o){var l,h;const c=Nr(t,null==r?void 0:r.theme).rect,{fill:u=c.fill,stroke:d=c.stroke,x1:p,y1:g,x:f,y:m,opacity:y=c.opacity,fillOpacity:b=c.fillOpacity,lineWidth:v=c.lineWidth,strokeOpacity:x=c.strokeOpacity,visible:_=c.visible,drawStrokeWhenZeroWH:A=null!==(l=c.drawStrokeWhenZeroWH)&&void 0!==l&&l}=t.attribute;let{width:S,height:T}=t.attribute;S=(null!=S?S:p-f)||0,T=(null!=T?T:g-m)||0;const w=null!==(h=this.z)&&void 0!==h?h:0,M=Bl(y,b,S,T,u),B=kl(y,x,S,T,A),C=Tl(u),k=wl(d,v);if(!t.valid||!_)return;if(!C&&!k)return;if(!(M||B||a||o))return;const{light:P}=n.stage||{},O=t.findFace();if(!1!==u){e.setCommonStyle(t,t.attribute,i,s,c);let n=u;"string"!=typeof n&&(n="black"),this.fill(i,s,w,O,null,n,e,P,null,null,a)}!1!==d&&(e.setStrokeStyle(t,t.attribute,i,s,c),this.stroke(i,s,w,O,e))}draw(t,e,i){const s=Nr(t).rect;this._draw(t,s,!1,i)}};Wu=Nu([Ii()],Wu);let zu=!1;const Gu=new Ti((t=>{zu||(zu=!0,t(au).to(Wu).inSingletonScope(),t(iu).toService(au))}));var Vu=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Hu=class extends yc{constructor(){super(...arguments),this.numberType=Co}drawShape(t,e,i,s,n,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).arc,{fill:c=h.fill}=t.attribute,u=this.valid(t,h,a,o);if(!u)return;const{fVisible:d,sVisible:p,doFill:g,doStroke:f}=u,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:y=h.outerPadding,innerPadding:b=h.innerPadding,height:v=10}=t.attribute;let{outerRadius:x=h.outerRadius,innerRadius:_=h.innerRadius}=t.attribute;x+=y,_-=b;const A=nl.Get(c,sl.Color255),{light:S}=n.stage||{},T=n.hack_pieFace,w={top:m,bottom:m+v},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===T||"top"===T?(e.beginPath(),function(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ot(l-o),c=l>o;let u=!1;if(r<a){const t=r;r=a,a=t}if(r<=it)e.moveTo(i,s,n);else if(h>=at-it)e.moveTo(i+r*ht(o),s+r*dt(o),n),e.arc(i,s,r,o,l,!c,n),a>it&&(e.moveTo(i+a*ht(l),s+a*dt(l),n),e.arc(i,s,a,l,o,c,n));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:g,innerEndAngle:f,innerStartAngle:m}=t.getParsePadAngle(o,l),y=r*ht(p),b=r*dt(p),v=a*ht(f),x=a*dt(f);h<.001?u=!0:(e.moveTo(i+y,s+b,n),e.arc(i,s,r,p,g,!c,n)),!(a>it)||d<.001?(e.lineTo(i+v,s+x,n),u=!0):(e.lineTo(i+v,s+x,n),e.arc(i,s,a,f,m,c,n))}e.closePath()}(t,e,i,s,w[T],x,_),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))):"outside"!==T&&"inside"!==T||("inside"===T&&(e.save(),e.beginPath(),e.arc(i,s,_,0,at,!0,w.top),e.clip()),e.beginPath(),function(t,e,i,s,n,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=ot(h-l),u=h>l;let d=!1;if(a<=it)e.moveTo(i,s,n);else if(c>=at-it)e.moveTo(i+a*ht(l),s+a*dt(l),n),e.arc(i,s,a,l,h,!u,n),e.lineTo(i+a*ht(h),s+a*dt(h),r),e.arc(i,s,a,h,l,u,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=o(l,h),g=a*ht(c),f=a*dt(c),m=a*ht(p),y=a*dt(p);t<.001?d=!0:(e.moveTo(i+g,s+f,n),e.arc(i,s,a,c,p,!u,n),e.lineTo(i+m,s+y,r),e.arc(i,s,a,p,c,u,r))}e.closePath()}(t,e,i,s,w.top,w.bottom,"outside"===T?x:_,((e,i)=>{const{outerDeltaAngle:s,innerDeltaAngle:n,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===T?{innerouterDeltaAngle:s,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):d&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=S?S.computeColor(M[T],A):c,e.fill())),f&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),"inside"===T&&e.restore())}draw(t,e,i,s){const n=Nr(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Hu=Vu([Ii()],Hu);let Xu=!1;const $u=new Ti((t=>{Xu||(Xu=!0,t(eu).to(Hu).inSingletonScope(),t(iu).toService(eu))}));var Yu=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let qu=class extends Uu{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Io}drawShape(t,e,i,s,n,r,a,o){var l;const h=Nr(t,null==r?void 0:r.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=n.stage||{},f=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,s,h);let n=c;"string"!=typeof n&&(n="black"),this.fill(i,s,p,f,d,n,e,g,t,h,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,s,h),this.stroke(i,s,p,f,e))}draw(t,e,i){const s=Nr(t).polygon;this._draw(t,s,!1,i)}};qu=Yu([Ii()],qu);let Ku=!1;const Zu=new Ti((t=>{Ku||(Ku=!0,t(cu).to(qu).inSingletonScope(),t(iu).toService(cu))}));class Ju{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=Si.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const s=this.pluginService.stage;if(this.option3d||(this.option3d=s.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const n=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=n/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,s.set3dOptions(this.option3d),s.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const Qu=t=>t.zField||t.series&&t.series.some((t=>t.zField));class td extends e.BasePlugin{constructor(){super(td.type),this.type="VChart3dPlugin"}onInit(t,e){var i,s;if(this._is3d=!!(s=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(s.type)||Qu(s),!0),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&Qu(e)&&(e.layout={type:"layout3d"})}}td.pluginType="chart",td.type="VChart3dPlugin";const ed=()=>{e.registerChartPlugin(td),yu(),vu(),fu.registerPlugin("ViewTransform3dPlugin",Ju)},id={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class sd extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}const nd=Symbol.for("MathPickerContribution"),rd=Symbol.for("MathArcPicker"),ad=Symbol.for("MathImagePicker"),od=Symbol.for("MathLinePicker"),ld=Symbol.for("MathRectPicker"),hd=Symbol.for("MathSymbolPicker"),cd=Symbol.for("MathTextPicker"),ud=Symbol.for("MathPolygonPicker"),dd=Symbol.for("CanvasArcPicker"),pd=Symbol.for("CanvasArc3dPicker"),gd=Symbol.for("CanvasImagePicker"),fd=Symbol.for("CanvasLinePicker"),md=Symbol.for("CanvasRectPicker"),yd=Symbol.for("CanvasRect3dPicker"),bd=Symbol.for("CanvasSymbolPicker"),vd=Symbol.for("CanvasTextPicker"),xd=Symbol.for("CanvasPolygonPicker"),_d=Symbol.for("CanvasPyramid3dPicker"),Ad=Symbol.for("CanvasRichTextPicker"),Sd=Symbol.for("CanvasPickerContribution");class Td{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();let{x:r=n.x,y:a=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,a+=e.y,s.setTransformForCurrent()}else r=0,a=0,s.transformFromMatrix(t.transMatrix,!0);let o=!1,l=!1;return this.canvasRenderer.drawShape(t,s,r,a,{},null,((t,i,s,n)=>!(!o&&!l)||(o=t.isPointInPath(e.x,e.y),l=n||l,o)),((t,i,n,r)=>{if(o||l)return!0;const a=i.lineWidth||n.lineWidth,h=i.pickStrokeBuffer||n.pickStrokeBuffer,c=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=c?a+h:Vn(s,a+h,s.dpr),o=t.isPointInStroke(e.x,e.y),l=r||l,o})),s.highPerformanceRestore(),o}}var wd=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Md=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bd=function(t,e){return function(i,s){e(i,s,t)}};let Cd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};Cd=wd([Ii(),Bd(0,Li(tu)),Md("design:paramtypes",[Object])],Cd);let kd=!1;const Pd=new Ti(((t,e,i,s)=>{kd||(kd=!0,t(rd).to(Cd).inSingletonScope(),t(nd).toService(rd))}));var Od=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Rd=class{constructor(){this.type="image",this.numberType=Oo}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};Rd=Od([Ii()],Rd);let Ld=!1;const Ed=new Ti(((t,e,i,s)=>{Ld||(Ld=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var Id=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Dd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fd=function(t,e){return function(i,s){e(i,s,t)}};let jd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};jd=Id([Ii(),Fd(0,Li(su)),Dd("design:paramtypes",[Object])],jd);let Ud=!1;const Nd=new Ti(((t,e,i,s)=>{Ud||(Ud=!0,t(od).to(jd).inSingletonScope(),t(nd).toService(od))}));var Wd=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},zd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gd=function(t,e){return function(i,s){e(i,s,t)}};let Vd=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Eo}};Vd=Wd([Ii(),Gd(0,Li(nu)),zd("design:paramtypes",[Object])],Vd);let Hd=!1;const Xd=new Ti(((t,e,i,s)=>{Hd||(Hd=!0,t(ud).to(Vd).inSingletonScope(),t(nd).toService(ud))})),$d=new Xt;class Yd{constructor(){this.type="rect",this.numberType=Do}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme(),{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:a=n.x,y:o=n.y}=t.attribute;s.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);a+=e.x,o+=e.y,s.setTransformForCurrent()}else a=0,o=0,l=!1,s.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||t.shadowRoot||y(r,!0)&&0!==r||g(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,s,a,o,{},null,((t,i,s)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,n)=>{if(h)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer,o=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=o?r+a:Vn(s,r+a,s.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=n.fill,stroke:s=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)h=!0;else if(s){const i=t.AABBBounds;$d.setValue(i.x1,i.y1,i.x2,i.y2),$d.expand(-r/2),h=!$d.containsPoint(e)}}return s.highPerformanceRestore(),h}}var qd=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Kd=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zd=function(t,e){return function(i,s){e(i,s,t)}};let Jd=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Jd=qd([Ii(),Zd(0,Li(ru)),Kd("design:paramtypes",[Object])],Jd);let Qd=!1;const tp=new Ti(((t,e,i,s)=>{Qd||(Qd=!0,t(ld).to(Jd).inSingletonScope(),t(nd).toService(ld))}));let ep=!1;const ip=new Ti(((t,e,i,s)=>{ep||(ep=!0,t(ad).to(Rd).inSingletonScope(),t(Rd).toService(ad))}));var sp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rp=function(t,e){return function(i,s){e(i,s,t)}};let ap=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}};ap=sp([Ii(),rp(0,Li(ou)),np("design:paramtypes",[Object])],ap);let op=!1;const lp=new Ti(((t,e,i,s)=>{op||(op=!0,t(hd).to(ap).inSingletonScope(),t(nd).toService(hd))}));var hp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let cp=class{constructor(){this.type="text",this.numberType=No}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};cp=hp([Ii()],cp);let up=!1;const dp=new Ti(((t,e,i,s)=>{up||(up=!0,t(cd).to(cp).inSingletonScope(),t(nd).toService(cd))}));var pp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},gp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fp=function(t,e){return function(i,s){e(i,s,t)}};let mp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Bo}};mp=pp([Ii(),fp(0,Li(tu)),gp("design:paramtypes",[Object])],mp);let yp=!1;const bp=new Ti(((t,e,i,s)=>{yp||(yp=!0,t(dd).to(mp).inSingletonScope(),t(Sd).toService(dd))}));var vp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_p=function(t,e){return function(i,s){e(i,s,t)}};let Ap=class extends Yd{constructor(t){super(),this.canvasRenderer=t}};Ap=vp([Ii(),_p(0,Li(ru)),xp("design:paramtypes",[Object])],Ap);let Sp=!1;const Tp=new Ti(((t,e,i,s)=>{Sp||(Sp=!0,t(md).to(Ap).inSingletonScope(),t(Sd).toService(md))}));class wp extends yc{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;s.highPerformanceSave();const n=t.getGraphicTheme(),r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(s.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return s.lineWidth=a?n+r:Vn(s,n+r,s.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Zo.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),u}}var Mp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cp=function(t,e){return function(i,s){e(i,s,t)}};let kp=class extends wp{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Ro}};kp=Mp([Ii(),Cp(0,Li(su)),Bp("design:paramtypes",[Object])],kp);let Pp=!1;const Op=new Ti(((t,e,i,s)=>{Pp||(Pp=!0,t(fd).to(kp).inSingletonScope(),t(Sd).toService(fd))}));class Rp extends yc{contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();const r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let c=e;if(s.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Zo.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),u}}var Lp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ep=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ip=function(t,e){return function(i,s){e(i,s,t)}};let Dp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Uo}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getParsedPath();if(!s.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}s.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,s),{x:o,y:l,z:h,lastModelMatrix:c}=a;let u=e;if(s.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return s.lineWidth=a?n+r:Vn(s,n+r,s.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,s.modelMatrix!==c&&Zo.free(s.modelMatrix),s.modelMatrix=c,s.highPerformanceRestore(),d}};Dp=Lp([Ii(),Ip(0,Li(ou)),Ep("design:paramtypes",[Object])],Dp);let Fp=!1;const jp=new Ti(((t,e,i,s)=>{Fp||(Fp=!0,t(bd).to(Dp).inSingletonScope(),t(Sd).toService(bd))}));var Up=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Np=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wp=function(t,e){return function(i,s){e(i,s,t)}};let zp=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=No}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.AABBBounds;if(!s.camera)return!!n.containsPoint(e);s.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,s,o),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let p=e;if(s.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,s,h,c,{},null,((e,i,s)=>{if(g)return!0;const{fontSize:n=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),f=l.width(),m=Wl(a,d,n),y=Nl(o,f);return e.rect(y+h,m+c,f,d,u),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,s.modelMatrix!==d&&Zo.free(s.modelMatrix),s.modelMatrix=d,s.highPerformanceRestore(),g}};zp=Up([Ii(),Wp(0,Li(lu)),Np("design:paramtypes",[Object])],zp);let Gp=!1;const Vp=new Ti(((t,e,i,s)=>{Gp||(Gp=!0,t(vd).to(zp).inSingletonScope(),t(Sd).toService(vd))}));var Hp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$p=function(t,e){return function(i,s){e(i,s,t)}};let Yp=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Eo}};Yp=Hp([Ii(),$p(0,Li(nu)),Xp("design:paramtypes",[Object])],Yp);let qp=!1;const Kp=new Ti(((t,e,i,s)=>{qp||(qp=!0,t(xd).to(Yp).inSingletonScope(),t(Sd).toService(xd))}));var Zp=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Jp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qp=function(t,e){return function(i,s){e(i,s,t)}};let tg=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=jo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};tg=Zp([Ii(),Qp(0,Li(hu)),Jp("design:paramtypes",[Object])],tg);let eg=!1;const ig=new Ti(((t,e,i,s)=>{eg||(eg=!0,t(Ad).to(tg).inSingletonScope(),t(Sd).toService(Ad))}));var sg=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ng=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rg=function(t,e){return function(i,s){e(i,s,t)}};let ag=class extends Td{constructor(t){super(),this.canvasRenderer=t,this.type="image",this.numberType=Oo}};ag=sg([Ii(),rg(0,Li(uu)),ng("design:paramtypes",[Object])],ag);let og=!1;const lg=new Ti(((t,e,i,s)=>{og||(og=!0,t(gd).to(ag).inSingletonScope(),t(Sd).toService(gd))}));var hg=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},cg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ug=function(t,e){return function(i,s){e(i,s,t)}};let dg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Fo,this.themeType="rect"}};dg=hg([Ii(),ug(0,Li(au)),cg("design:paramtypes",[Object])],dg);let pg=!1;const gg=new Ti(((t,e,i,s)=>{pg||(pg=!0,t(yd).to(dg).inSingletonScope(),t(Sd).toService(yd))}));var fg=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},mg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yg=function(t,e){return function(i,s){e(i,s,t)}};let bg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Co,this.themeType="arc"}};bg=fg([Ii(),yg(0,Li(eu)),mg("design:paramtypes",[Object])],bg);let vg=!1;const xg=new Ti(((t,e,i,s)=>{vg||(vg=!0,t(pd).to(bg).inSingletonScope(),t(Sd).toService(pd))}));var _g=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ag=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sg=function(t,e){return function(i,s){e(i,s,t)}};let Tg=class extends Rp{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Io,this.themeType="polygon"}};Tg=_g([Ii(),Sg(0,Li(cu)),Ag("design:paramtypes",[Object])],Tg);let wg=!1;const Mg=new Ti(((t,e,i,s)=>{wg||(wg=!0,t(_d).to(Tg).inSingletonScope(),t(Sd).toService(_d))})),Bg=function(){!function(){if(null==pu)try{const t=document.createElement("canvas"),e=t.getContext("2d");pu=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),pu&&(pu=!!document.createElement)}catch(t){pu=!1}}();const t=ss.global&&ss.global.env;return t?"browser"===t:pu}();function Cg(){Cg.__loaded||(Cg.__loaded=!0,Nh.RegisterGraphicCreator("arc",Ph),ir.load(_u),ir.load(Bg?bp:Pd))}Cg.__loaded=!1;const kg=Cg;function Pg(){Pg.__loaded||(Pg.__loaded=!0,Nh.RegisterGraphicCreator("arc3d",Rh),yu(),vu(),ir.load($u),ir.load(xg))}Pg.__loaded=!1;const Og=Pg;function Rg(){Rg.__loaded||(Rg.__loaded=!0,Nh.RegisterGraphicCreator("group",Sl))}Rg.__loaded=!1;const Lg=Rg;function Eg(){Eg.__loaded||(Eg.__loaded=!0,Nh.RegisterGraphicCreator("image",fh),ir.load(ju),ir.load(Bg?lg:Ed))}Eg.__loaded=!1;const Ig=Eg;function Dg(){Dg.__loaded||(Dg.__loaded=!0,Nh.RegisterGraphicCreator("line",sh),ir.load(wu),ir.load(Bg?Op:Nd))}Dg.__loaded=!1;const Fg=Dg;function jg(){jg.__loaded||(jg.__loaded=!0,Nh.RegisterGraphicCreator("polygon",Ih),ir.load(Ou),ir.load(Bg?Kp:Xd))}jg.__loaded=!1;const Ug=jg;function Ng(){Ng.__loaded||(Ng.__loaded=!0,Nh.RegisterGraphicCreator("pyramid3d",Fh),yu(),vu(),ir.load(Zu),ir.load(Mg))}Ng.__loaded=!1;const Wg=Ng;function zg(){zg.__loaded||(zg.__loaded=!0,Nh.RegisterGraphicCreator("rect",ah),ir.load(Su),ir.load(Bg?Tp:tp))}zg.__loaded=!1;const Gg=zg;function Vg(){Vg.__loaded||(Vg.__loaded=!0,Nh.RegisterGraphicCreator("rect3d",hh),ir.load(Gu),ir.load(gg))}Vg.__loaded=!1;const Hg=Vg;function Xg(){Xg.__loaded||(Xg.__loaded=!0,Nh.RegisterGraphicCreator("richtext",Ah),ir.load(Du),ir.load(Bg?ig:ip))}Xg.__loaded=!1;const $g=Xg;function Yg(){Yg.__loaded||(Yg.__loaded=!0,Nh.RegisterGraphicCreator("shadowRoot",Uh))}Yg.__loaded=!1;const qg=Yg;function Kg(){Kg.__loaded||(Kg.__loaded=!0,Nh.RegisterGraphicCreator("symbol",th),ir.load(Bu),ir.load(Bg?jp:lp))}Kg.__loaded=!1;const Zg=Kg;function Jg(){Jg.__loaded||(Jg.__loaded=!0,Nh.RegisterGraphicCreator("text",Zl),ir.load(ku),ir.load(Bg?Vp:dp))}Jg.__loaded=!1;const Qg=Jg;class tf extends e.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=tf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}tf.type="rect3d";const ef=()=>{e.Factory.registerMark(tf.type,tf),qg(),Hg(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",hh)};class sf extends e.BarSeries{constructor(){super(...arguments),this.type=xi.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=sd}}sf.type=xi.bar3d,sf.mark=id,sf.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},sf.transformerConstructor=sd;const nf=()=>{e.Factory.registerAnimation("bar3d",((t,i)=>({appear:e.barPresetAnimation(t,i),enter:e.barGrowIn(t,!1),exit:e.barGrowOut(t,!1),disappear:e.barGrowOut(t)}))),ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(sf.type,sf)};class rf extends e.Layout{layoutItems(t,i,s,n){this._layoutInit(t,i,s,n);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((t=>"absolute"===t.layoutType)),l=o.filter((t=>"z"===t.layoutOrient));let h={width:0,height:0};if(l.length){h=l[0].getLayoutRect()}this.leftCurrent+=h.width/8,this.rightCurrent-=h.width/8,this.topCurrent+=h.height/8,this.bottomCurrent-=h.height/8;const{regionItems:c,relativeItems:u,relativeOverlapItems:d,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,u,d,g,r),this._processAutoIndent(c,u,d,g,p,a,r);const f=o.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(f);const m=u.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],y=u.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(m&&l.length){const t=m.getLayoutStartPoint(),e=m.getLayoutRect(),i={x:"left"===y.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===y.layoutOrient?"r2l":"l2r";const s=m.getLayoutRect(),n=y.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:s.width,height:n.height};m.model.setLayout3dBox&&m.model.setLayout3dBox(r),y.model.setLayout3dBox&&y.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),this.layoutZAxisItems(l,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}rf.type="layout3d";const af=()=>{e.Factory.registerLayout(rf.type,rf)};class of extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=yi,this.type="bar3d",this.seriesType=xi.bar3d}}of.type="bar3d",of.seriesType=xi.bar3d,of.transformerConstructor=yi;const lf=Object.assign(Object.assign({},e.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class hf extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class cf extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=cf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}cf.type="pyramid3d";const uf=e.getFunnelTheme(!0);class df extends e.FunnelSeries{constructor(){super(...arguments),this.type=xi.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=hf}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},df.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},df.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(df.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(df.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t){var i,s;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series),this._labelMark=t,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(s=this._funnelOuterLabelMark)||void 0===s||s.line}}df.type=xi.funnel3d,df.mark=lf,df.builtInTheme={funnel3d:uf},df.transformerConstructor=hf;const pf=()=>{e.Factory.registerMark(cf.type,cf),qg(),Wg(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",Fh),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(df.type,df)};class gf extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=xi.funnel3d}}gf.type="funnel3d",gf.seriesType=xi.funnel3d,gf.transformerConstructor=e.FunnelChartSpecTransformer;class ff extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=xi.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}ff.type="histogram3d",ff.seriesType=xi.bar3d,ff.transformerConstructor=e.HistogramChartSpecTransformer;class mf extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class yf extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=yf.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}yf.type="arc3d";const bf=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class vf extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class xf extends e.BasePieSeries{constructor(){super(...arguments),this.type=xi.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=vf}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t,i={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,e.AttributeLevel.Mark))}}xf.type=xi.pie3d,xf.mark=bf,xf.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},xf.transformerConstructor=vf;const _f=()=>{e.Factory.registerAnimation("pie3d",((t,i)=>({appear:e.piePresetAnimation(t,i),enter:e.pieEnter(t),exit:e.pieExit(t),disappear:e.pieDisappear(t)}))),e.registerArcAnimation(),qg(),Og(),e.Factory.registerGraphicComponent("arc3d",Rh),e.Factory.registerMark("arc3d",yf),e.Factory.registerSeries(xf.type,xf)};class Af extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=mf,this.type="pie3d",this.seriesType=xi.pie3d}}Af.type="pie3d",Af.seriesType=xi.pie3d,Af.transformerConstructor=mf;class Sf{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-Sf.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Sf.bounceIn(2*t):.5*Sf.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/at*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*at/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/at*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*at/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/at*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*at/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*at/e)*.5+1}}static registerFunc(t,e){Sf[t]=e}}function Tf(t,e){const i=1/e;let s=1;for(;t>i;)t-=i,s*=-1;const n=s*t/i;return n>0?n:1+n}Sf.quadIn=Sf.getPowIn(2),Sf.quadOut=Sf.getPowOut(2),Sf.quadInOut=Sf.getPowInOut(2),Sf.cubicIn=Sf.getPowIn(3),Sf.cubicOut=Sf.getPowOut(3),Sf.cubicInOut=Sf.getPowInOut(3),Sf.quartIn=Sf.getPowIn(4),Sf.quartOut=Sf.getPowOut(4),Sf.quartInOut=Sf.getPowInOut(4),Sf.quintIn=Sf.getPowIn(5),Sf.quintOut=Sf.getPowOut(5),Sf.quintInOut=Sf.getPowInOut(5),Sf.backIn=Sf.getBackIn(1.7),Sf.backOut=Sf.getBackOut(1.7),Sf.backInOut=Sf.getBackInOut(1.7),Sf.elasticIn=Sf.getElasticIn(1,.3),Sf.elasticOut=Sf.getElasticOut(1,.3),Sf.elasticInOut=Sf.getElasticInOut(1,.3*1.5),Sf.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Sf.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Sf.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Sf[`flicker${t}`]=e=>Tf(e,t);for(let t=2;t<10;t++)Sf[`aIn${t}`]=e=>t*e*e+(1-t)*e;function wf(t,e,i){return t+(e-t)*i}const Mf=new class{constructor(){this.opacity=(t,e,i,s,n,r)=>{r.attribute.opacity=wf(e,i,s)},this.baseOpacity=(t,e,i,s,n,r)=>{r.attribute.baseOpacity=wf(e,i,s)},this.fillOpacity=(t,e,i,s,n,r)=>{r.attribute.fillOpacity=wf(e,i,s)},this.strokeOpacity=(t,e,i,s,n,r)=>{r.attribute.strokeOpacity=wf(e,i,s)},this.zIndex=(t,e,i,s,n,r)=>{r.attribute.zIndex=wf(e,i,s)},this.backgroundOpacity=(t,e,i,s,n,r)=>{r.attribute.backgroundOpacity=wf(e,i,s)},this.shadowOffsetX=(t,e,i,s,n,r)=>{r.attribute.shadowOffsetX=wf(e,i,s)},this.shadowOffsetY=(t,e,i,s,n,r)=>{r.attribute.shadowOffsetY=wf(e,i,s)},this.shadowBlur=(t,e,i,s,n,r)=>{r.attribute.shadowBlur=wf(e,i,s)},this.fill=(t,e,i,s,n,r)=>{r.attribute.fill=al(e,i,s,!1)},this.fillPure=(t,e,i,s,n,r)=>{r.attribute.fill=n.fromParsedProps.fill?ll(n.fromParsedProps.fill,n.toParsedProps.fill,s):n.toParsedProps.fill},this.stroke=(t,e,i,s,n,r)=>{r.attribute.stroke=al(e,i,s,!1)},this.strokePure=(t,e,i,s,n,r)=>{r.attribute.stroke=n.fromParsedProps.stroke?ll(n.fromParsedProps.stroke,n.toParsedProps.stroke,s):n.toParsedProps.stroke},this.width=(t,e,i,s,n,r)=>{r.attribute.width=wf(e,i,s),r.addUpdateBoundTag()},this.height=(t,e,i,s,n,r)=>{r.attribute.height=wf(e,i,s),r.addUpdateBoundTag()},this.x=(t,e,i,s,n,r)=>{r.attribute.x=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.y=(t,e,i,s,n,r)=>{r.attribute.y=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dx=(t,e,i,s,n,r)=>{r.attribute.dx=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.dy=(t,e,i,s,n,r)=>{r.attribute.dy=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.angle=(t,e,i,s,n,r)=>{r.attribute.angle=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleX=(t,e,i,s,n,r)=>{r.attribute.scaleX=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.scaleY=(t,e,i,s,n,r)=>{r.attribute.scaleY=wf(e,i,s),r.addUpdateBoundTag(),r.addUpdatePositionTag()},this.lineWidth=(t,e,i,s,n,r)=>{r.attribute.lineWidth=wf(e,i,s),r.addUpdateBoundTag()},this.startAngle=(t,e,i,s,n,r)=>{r.attribute.startAngle=wf(e,i,s),r.addUpdateBoundTag()},this.endAngle=(t,e,i,s,n,r)=>{r.attribute.endAngle=wf(e,i,s),r.addUpdateBoundTag()},this.radius=(t,e,i,s,n,r)=>{r.attribute.radius=wf(e,i,s),r.addUpdateBoundTag()},this.outerRadius=(t,e,i,s,n,r)=>{r.attribute.outerRadius=wf(e,i,s),r.addUpdateBoundTag()},this.innerRadius=(t,e,i,s,n,r)=>{r.attribute.innerRadius=wf(e,i,s),r.addUpdateBoundTag()},this.size=(t,e,i,s,n,r)=>{r.attribute.size=wf(e,i,s),r.addUpdateBoundTag()},this.points=(t,e,i,s,n,r)=>{r.attribute.points=ia(e,i,s),r.addUpdateBoundTag()}}};function Bf(t,e,i,s,n,r){if(Number.isFinite(i)&&Number.isFinite(e))return r.attribute[t]=e+(i-e)*s,!0;if(Array.isArray(i)&&Array.isArray(e)&&i.length===e.length){const n=[];let a=!0;for(let t=0;t<i.length;t++){const r=e[t],o=r+(i[t]-r)*s;if(!Number.isFinite(o)){a=!1;break}n.push(o)}return a&&(r.attribute[t]=n),!0}return!1}function Cf(){}class kf{constructor(t,e,i,s){var n;this._startTime=0,this._hasFirstRun=!1,this._syncAttributeUpdate=()=>{this.target.setAttributes(this.target.attribute)},this.type=t,this.props=e,this.duration=i,this.easing=s?"function"==typeof s?s:null!==(n=Sf[s])&&void 0!==n?n:Sf.linear:Sf.linear,"wait"===t&&(this.onUpdate=Cf),this.id=Si.GenAutoIncrementId(),this.syncAttributeUpdate=Cf}bind(t,e){this.target=t,this.animate=e,this.onBind(),this.syncAttributeUpdate()}append(t){this.next=t,t.prev=this,t.setStartTime(this.getStartTime()+this.duration,!1)}updateDownstreamStartTimes(){let t=this.next,e=this._startTime+this.duration;for(;t;)t.setStartTime(e,!1),e+=t.duration,t=t.next;this.animate.updateDuration()}getLastProps(){return this.prev?this.prev.props||{}:this.animate.getStartProps()}setDuration(t,e=!0){this.duration=t,e&&this.updateDownstreamStartTimes()}getDuration(){return this.duration}determineInterpolateUpdateFunction(){if(!this.props)return;const t=[];this.propKeys.forEach((e=>{if("fill"===e||"stroke"===e){const i=this.fromProps[e],s=this.props[e];if(p(i)&&p(s)){const n=nl.Get(i,sl.Color255),r=nl.Get(s,sl.Color255);this.fromParsedProps||(this.fromParsedProps={}),this.toParsedProps||(this.toParsedProps={}),this.fromParsedProps[e]=n,this.toParsedProps[e]=r,t.push(Mf["fill"===e?"fillPure":"strokePure"])}else Mf[e]?t.push(Mf[e]):t.push(Bf)}else Mf[e]?t.push(Mf[e]):t.push(Bf)})),this.interpolateUpdateFunctions=t}setStartTime(t,e=!0){this._startTime=t,e&&this.updateDownstreamStartTimes()}getStartTime(){return this._startTime}onBind(){"glyph"===this.target.type&&(this.syncAttributeUpdate=this._syncAttributeUpdate)}onFirstRun(){}onStart(){if(!this._hasFirstRun){this._hasFirstRun=!0,this.fromProps=this.getLastProps();const t=this.animate.getStartProps();this.propKeys&&this.propKeys.forEach((e=>{var i;this.fromProps[e]=null!==(i=this.fromProps[e])&&void 0!==i?i:t[e]})),this.determineInterpolateUpdateFunction(),this.tryPreventConflict(),this.trySyncStartProps(),this.onFirstRun()}}tryPreventConflict(){const t=this.animate;this.target.animates.forEach((e=>{if(e===t||e.priority>t.priority||e.priority===1/0)return;const i=e.getStartProps();this.propKeys.forEach((t=>{null!=i[t]&&e.preventAttr(t)}))}))}deleteSelfAttr(t){var e;delete this.props[t],this.fromProps&&delete this.fromProps[t];const i=this.propKeys.indexOf(t);-1!==i&&(this.propKeys.splice(i,1),null===(e=this.interpolateUpdateFunctions)||void 0===e||e.splice(i,1))}trySyncStartProps(){this.propKeys.forEach((t=>{this.fromProps[t]=this.animate.target.getComputedAttribute(t)}))}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const s=this.easing(e);this.animate.interpolateUpdateFunction?this.animate.interpolateUpdateFunction(this.fromProps,this.props,s,this,this.target):this.interpolateUpdateFunctions.forEach(((t,e)=>{if(!this.animate.validAttr(this.propKeys[e]))return;const i=this.propKeys[e];t(i,this.fromProps[i],this.props[i],s,this,this.target)})),this.onUpdate(t,s,i),this.syncAttributeUpdate()}onUpdate(t,e,i){}onEnd(t){this.target.setAttributes(this.props),t?this._endCb=t:this._endCb&&this._endCb(this.animate,this)}getEndProps(){return this.props}getFromProps(){return this.fromProps}getMergedEndProps(){return this.getEndProps()}stop(){}release(){}}class Pf extends kf{constructor(t,e,i,s){super(t,e,i,s)}onStart(){super.onStart();const t=this.getFromProps();this.target.setAttributes(t)}update(t,e,i){this.onStart()}determineInterpolateUpdateFunction(){}}class Of extends n{get animateCount(){return this._animateCount}constructor(){super(),this.head=null,this.tail=null,this.animateMap=new Map,this._animateCount=0,this._playSpeed=1,this._totalDuration=0,this._startTime=0,this._currentTime=0,this._animationEndFlag=!0,this.id=Si.GenAutoIncrementId(),this.paused=!1}isRunning(){return!this.paused&&this._animateCount>0}forEachAccessAnimate(t){let e=this.head,i=0;for(;e;){const s=e.next;t(e.animate,i),i++,e=s}}addAnimate(t){const e={animate:t,next:null,prev:null};this.head?this.tail&&(this.tail.next=e,e.prev=this.tail,this.tail=e):(this.head=e,this.tail=e),this.animateMap.set(t,e),this._animateCount++,this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;this._animationEndFlag&&(this._animationEndFlag=!1,this.emit("animationStart"));const e=t*this._playSpeed;this._currentTime+=e,this.forEachAccessAnimate(((t,i)=>{t.status===ls.END?this.removeAnimate(t,!0):t.status!==ls.RUNNING&&t.status!==ls.INITIAL||t.advance(e)})),0===this._animateCount&&(this._animationEndFlag=!0,this.emit("animationEnd"))}clear(){this.forEachAccessAnimate((t=>{t.release()})),this.head=null,this.tail=null,this.animateMap.clear(),this._animateCount=0,this._totalDuration=0}removeAnimate(t,e=!0){const i=this.animateMap.get(t);i&&(e&&(t._onRemove&&t._onRemove.forEach((t=>t())),t.release()),i.prev?i.prev.next=i.next:this.head=i.next,i.next?i.next.prev=i.prev:this.tail=i.prev,this.animateMap.delete(t),this._animateCount--,t.getStartTime()+t.getDuration()>=this._totalDuration&&this.recalculateTotalDuration())}recalculateTotalDuration(){this._totalDuration=0,this.forEachAccessAnimate((t=>{this._totalDuration=Math.max(this._totalDuration,t.getStartTime()+t.getDuration())}))}getTotalDuration(){return this._totalDuration}getPlaySpeed(){return this._playSpeed}setPlaySpeed(t){this._playSpeed=t}getPlayState(){return this.paused?"paused":0===this.animateCount?"stopped":"playing"}setStartTime(t){this._startTime=t}getStartTime(){return this._startTime}getCurrentTime(){return this._currentTime}setCurrentTime(t){this._currentTime=t}}const Rf=new Of;Rf.isGlobal=!0;class Lf{constructor(t=Si.GenAutoIncrementId(),e=Rf,i){this.id=t,this.status=ls.INITIAL,this._timeline=e,e.addAnimate(this),this.slience=i,this._startTime=0,this._duration=0,this._totalDuration=0,this._loopCount=0,this._currentLoop=0,this._bounce=!1,this._firstStep=null,this._lastStep=null,this._startProps={},this._endProps={},this._preventAttrs=new Set,this.currentTime=0,this.interpolateUpdateFunction=null,this.priority=0}getStartProps(){return this._startProps}getEndProps(){return this._endProps}setTimeline(t){this._timeline=t}getTimeline(){return this._timeline}get timeline(){return this._timeline}bind(t){return this.target=t,this.target.animates||(this.target.animates=new Map),this.target.animates.set(this.id,this),this.onRemove((()=>{this.stop(),this.target.animates.delete(this.id)})),this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.target.animationAttribute||(this.target.animationAttribute={}),this}to(t,e=300,i="linear"){const s=new kf(os.to,t,e,i);return s.bind(this.target,this),this.updateStepAfterAppend(s),this}wait(t){const e=new Pf(os.wait,{},t,"linear");return e.bind(this.target,this),this.updateStepAfterAppend(e),this}updateStepAfterAppend(t){this._firstStep?(this._lastStep.append(t),this._lastStep=t):(this._firstStep=t,this._lastStep=t),this.parseStepProps(t),this.updateDuration()}parseStepProps(t){this._lastStep&&(t.propKeys=t.propKeys||Object.keys(t.props),Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})))}reSyncProps(){if(!this._lastStep)return;this._endProps={};let t=this._firstStep;for(;t;)Object.keys(this._endProps).forEach((e=>{var i;t.props[e]=null!==(i=t.props[e])&&void 0!==i?i:this._endProps[e]})),t.propKeys.forEach((e=>{this._endProps[e]=t.props[e]})),t=t.next}from(t,e=300,i="linear"){const s=new kf(os.from,t,e,i);return this._firstStep?(this._lastStep.append(s),this._lastStep=s):(this._firstStep=s,this._lastStep=s),this.updateDuration(),this}play(t){return t.bind(this.target,this),this.updateStepAfterAppend(t),this}pause(){this.status===ls.RUNNING&&(this.status=ls.PAUSED)}resume(){this.status===ls.PAUSED&&(this.status=ls.RUNNING)}onStart(t){var e;t?(this._onStart||(this._onStart=[]),this._onStart.push(t)):(null===(e=this._onStart)||void 0===e||e.forEach((t=>t())),Object.keys(this._endProps).forEach((t=>{this._startProps[t]=this.target.getComputedAttribute(t)})))}onEnd(t){var e;t?(this._onEnd||(this._onEnd=[]),this._onEnd.push(t)):null===(e=this._onEnd)||void 0===e||e.forEach((t=>t()))}onFrame(t){t&&(this._onFrame||(this._onFrame=[]),this._onFrame.push(t))}onRemove(t){var e;t?(this._onRemove||(this._onRemove=[]),this._onRemove.push(t)):null===(e=this._onRemove)||void 0===e||e.forEach((t=>t()))}preventAttr(t){this._preventAttrs.add(t),delete this._startProps[t],delete this._endProps[t];let e=this._firstStep;for(;e;)e.deleteSelfAttr(t),e=e.next}preventAttrs(t){t.forEach((t=>this._preventAttrs.add(t)))}validAttr(t){return!this._preventAttrs.has(t)}runCb(t){var e;return null===(e=this._lastStep)||void 0===e||e.onEnd(t),this}startAt(t){return this._startTime=t,this}customInterpolate(t,e,i,s,n,r){return!1}getFromValue(){return this._startProps}getToValue(){return this._endProps}stop(t){let e=this._firstStep;for(;e;)e.stop(),e=e.next;this.status!==ls.END&&this.onEnd(),this.status=ls.END,this.target&&("start"===t?this.target.setAttributes(this._startProps):"end"===t?this.target.setAttributes(this._endProps):t&&this.target.setAttributes(t))}release(){this.status=ls.END,this._onRemove&&this._onRemove.forEach((t=>t())),this._onStart=[],this._onFrame=[],this._onEnd=[],this._onRemove=[],this.forEachStep((t=>{t.release()}))}getDuration(){return this._duration}getStartTime(){return this._startTime}afterAll(t){if(!t||0===t.length)return this;let e=0;return t.forEach((t=>{const i=t.getStartTime()+t.getTotalDuration();e=Math.max(e,i)})),this.startAt(e)}after(t){if(!t)return this;const e=t.getStartTime()+t.getTotalDuration();return this.startAt(e)}parallel(t){return t?(this.startAt(t.getStartTime()),this):this}loop(t){return!0===t?t=1/0:!1===t&&(t=0),this._loopCount=t,this.updateDuration(),this}bounce(t){return this._bounce=t,this}advance(t){var e,i,s;if(this.status===ls.END)return void console.warn("aaa 动画已经结束,不能推进");const n=this.currentTime+t;if(n<this._startTime)return void(this.currentTime=n);if(n>=this._startTime+this._totalDuration)return null===(e=this._lastStep)||void 0===e||e.onUpdate(!0,1,{}),null===(i=this._lastStep)||void 0===i||i.onEnd(),this.onEnd(),void(this.status=ls.END);this.status=ls.RUNNING,this.currentTime<=this._startTime&&this.onStart(),this.currentTime=n;let r=n-this._startTime,a=!1,o=!1;if(this._loopCount>0){r=(n-this._startTime)%this._duration;const t=Math.floor((n-this._startTime)/this._duration);a=t>this._currentLoop,this._currentLoop=t,o=this._bounce&&t%2==1,o&&(r=this._duration-r)}a&&!o&&this.target.setAttributes(this._startProps);let l=null;if(this._lastStep===this._firstStep)l=this._firstStep;else{let t=this._firstStep;for(;t;){const e=t.getStartTime(),i=t.getDuration();if(r>=e&&r<=e+i){l=t;break}t=t.next}}if(!l)return;l!==this.lastRunStep&&(null===(s=this.lastRunStep)||void 0===s||s.onEnd()),this.lastRunStep=l;const h=(r-l.getStartTime())/l.getDuration(),c=h>=1;l.update(c,h,{}),c&&(l.onEnd(),this.lastRunStep=null)}updateDuration(){this._lastStep?(this._duration=this._lastStep.getStartTime()+this._lastStep.getDuration(),this._totalDuration=this._duration*(this._loopCount+1)):this._duration=0}getTotalDuration(){return this._totalDuration}getLoop(){return this._loopCount}forEachStep(t){let e=this._firstStep;for(;e;)t(e),e=e.next}}const Ef=new class{constructor(){this.nextAnimationFrameCbs=new Map,this._rafHandle=null,this.runAnimationFrame=t=>{this._rafHandle=null;const e=this.nextAnimationFrameCbs;this.nextAnimationFrameCbs=new Map,e.forEach((e=>e(t)))},this.tryRunAnimationFrameNextFrame=()=>{null===this._rafHandle&&0!==this.nextAnimationFrameCbs.size&&(this._rafHandle=ss.global.getRequestAnimationFrame()(this.runAnimationFrame))}}addAnimationFrameCb(t){return this.nextAnimationFrameCbs.set(++ns,t),this.tryRunAnimationFrameNextFrame(),ns}removeAnimationFrameCb(t){return!!this.nextAnimationFrameCbs.has(t)&&(this.nextAnimationFrameCbs.delete(t),!0)}};class If{constructor(){this.released=!1}tick(t,e){Ef.addAnimationFrameCb((()=>{if(!this.released)return e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Df extends n{constructor(t){super(),this.timelines=[],this.frameTimeHistory=[],this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};if(this.ifCanStop())return this.stop(),!1;const s=t.getTime();this._lastTickTime=s,this.lastFrameTime<0&&(this.lastFrameTime=s-this.interval+this.timeOffset,this.frameTimeHistory.push(this.lastFrameTime));const n=s-this.lastFrameTime,r=this.checkSkip(n);return r||(this._handlerTick(n),this.lastFrameTime=s,this.frameTimeHistory.push(this.lastFrameTime)),i||t.tick(this.interval,this.handleTick),!r},this._handlerTick=t=>{this.status===as.RUNNING&&(this.tickCounts++,this.timelines.forEach((e=>{e.tick(t)})),this.emit("tick",t))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.stage=t,this.autoStop=!0,this.interval=16,this.computeTimeOffsetAndJitter()}bindStage(t){this.stage=t}computeTimeOffsetAndJitter(){this.timeOffset=Math.floor(Math.random()*this.interval),this._jitter=Math.min(Math.max(.2*this.interval,6),.7*this.interval)}init(){this.interval=16,this.status=as.INITIAL,ss.global.hooks.onSetEnv.tap("graph-ticker",(()=>{this.initHandler(!1)})),ss.global.env&&this.initHandler(!1)}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}getTimelines(){return this.timelines}initHandler(t=!1){this.setupTickHandler(t)}setupTickHandler(t=!1){if(!t&&this.tickerHandler)return!0;const e=new If;return this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=e,!0}setInterval(t){this.interval=t,this.computeTimeOffsetAndJitter()}getInterval(){return this.interval}setFPS(t){this.setInterval(Math.floor(1e3/t))}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>this.handleTick(t,{once:!0})))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==as.INITIAL&&(this.status=as.PAUSE,!0)}resume(){return this.status!==as.INITIAL&&(this.status=as.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(this.timelines.every((t=>!t.isRunning())))return!0}return!1}start(t=!1){if(this.status===as.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===as.PAUSE)return!1;if(this.ifCanStop())return!1}return this.status=as.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=as.INITIAL,this.setupTickHandler(!0),this.lastFrameTime=-1}trySyncTickStatus(){this.status===as.INITIAL&&this.timelines.some((t=>t.isRunning()))?this.start():this.status===as.RUNNING&&this.timelines.every((t=>!t.isRunning()))&&this.stop()}release(){var t;this.stop(),this.timelines=[],null===(t=this.tickerHandler)||void 0===t||t.release(),this.tickerHandler=null,this.lastFrameTime=-1}checkSkip(t){var e,i,s;return"performance"!==(null===(s=null===(i=null===(e=this.stage)||void 0===e?void 0:e.params)||void 0===i?void 0:i.optimize)||void 0===s?void 0:s.tickRenderMode)&&t<this.interval+2*(Math.random()-.5)*this._jitter}}class Ff{constructor(){this.transitions=new Map,this.registerDefaultTransitions()}static getInstance(){return Ff.instance||(Ff.instance=new Ff),Ff.instance}registerDefaultTransitions(){this.registerTransition("appear","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("appear","appear",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("appear","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("appear","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("normal","normal",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("normal","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("normal","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("exit","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","enter",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("exit","exit",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("enter","enter",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("enter","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("enter","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("disappear","*",(()=>({allowTransition:!1,stopOriginalTransition:!1}))),this.registerTransition("disappear","appear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("update","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("update","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","*",(()=>({allowTransition:!0,stopOriginalTransition:!1}))),this.registerTransition("state","disappear",(()=>({allowTransition:!0,stopOriginalTransition:!0}))),this.registerTransition("state","exit",(()=>({allowTransition:!0,stopOriginalTransition:!0})))}isTransitionAllowed(t,e,i){var s,n,r,a;let o=null===(s=this.transitions.get(t))||void 0===s?void 0:s.get(e);return o?o(i,t):(o=null===(n=this.transitions.get(t))||void 0===n?void 0:n.get("*"),o?o(i,t):(o=null===(r=this.transitions.get("*"))||void 0===r?void 0:r.get(e),o?o(i,t):(o=null===(a=this.transitions.get("*"))||void 0===a?void 0:a.get("*"),o?o(i,t):{allowTransition:!0,stopOriginalTransition:!0})))}registerTransition(t,e,i){let s=this.transitions.get(t);s||(s=new Map,this.transitions.set(t,s)),s.set(e,i)}}Ff.getInstance();class jf{static registerBuiltInAnimate(t,e){jf.builtInAnimateMap[t]=e}constructor(t){this._animates=[],this._startCallbacks=[],this._endCallbacks=[],this._started=!1,this._activeCount=0,this._target=t}get started(){return this._started}onStart(t){t?(this._startCallbacks.push(t),this._started&&this._activeCount>0&&t()):this._startCallbacks.forEach((t=>{t()}))}onEnd(t){t?this._endCallbacks.push(t):this._endCallbacks.forEach((t=>{t()}))}_trackAnimation(t){this._animates.push(t),this._activeCount++,1!==this._activeCount||this._started||(this._started=!0,this.onStart()),t.onEnd((()=>{this._activeCount--;const e=this._animates.indexOf(t);e>=0&&this._animates.splice(e,1),0===this._activeCount&&this._started&&(this._started=!1,this.onEnd())}))}parseParams(t,e,i){var s,n;const r=this.resolveValue(t.totalTime,void 0,void 0),a=this.resolveValue(t.startTime,void 0,0),l=Object.assign({},t);l.oneByOneDelay=0,l.startTime=a,l.totalTime=r;const h=this.resolveValue(t.oneByOne,i,!1);if(e){const t=l.timeSlices;g(t)||(l.timeSlices=[t]);let e=0;l.timeSlices=l.timeSlices.map((t=>{const s=this.resolveValue(t.delay,i,0),n=this.resolveValue(t.delayAfter,i,0),r=this.resolveValue(t.duration,i,300);return e+=s+r+n,Object.assign(Object.assign({},t),{delay:s,delayAfter:n,duration:r})}));let s=0;h&&(s="number"==typeof h?h:h?e:0),l.oneByOneDelay=s;let n=1;if(r){const t=e+s*(this._target.count-2);n=r?r/t:1}l.timeSlices=l.timeSlices.map((t=>{let e=t.effects;return Array.isArray(e)||(e=[e]),Object.assign(Object.assign({},t),{delay:t.delay*n,delayAfter:t.delayAfter*n,duration:t.duration*n,effects:e.map((t=>{var e,i;const s=null!==(e=t.custom)&&void 0!==e?e:jf.builtInAnimateMap[null!==(i=t.type)&&void 0!==i?i:"fromTo"],n=s&&o(s)?/^class\s/.test(Function.prototype.toString.call(s))?1:2:0;return Object.assign(Object.assign({},t),{custom:s,customType:n})}))})})),l.oneByOneDelay=s*n,l.startTime=a*n}else{const e=this.resolveValue(t.delay,i,0),c=this.resolveValue(t.delayAfter,i,0),u=this.resolveValue(t.duration,i,300);let d=0;h&&(d="number"==typeof h?h:h?e+c+u:0),l.oneByOneDelay=d,l.custom=null!==(s=t.custom)&&void 0!==s?s:jf.builtInAnimateMap[null!==(n=t.type)&&void 0!==n?n:"fromTo"];const p=l.custom&&o(l.custom)?/^class\s/.test(Function.prototype.toString.call(l.custom))?1:2:0;if(l.customType=p,r){const t=e+c+u+d*(this._target.count-2),i=r?r/t:1;l.delay=e*i,l.delayAfter=c*i,l.duration=u*i,l.oneByOneDelay=d*i,l.startTime=a}}return l}execute(t){Array.isArray(t)?t.forEach((t=>this._execute(t))):this._execute(t)}_execute(t){if(t.selfOnly)return this._executeItem(t,this._target,0,1);const e="timeSlices"in t;let i;e&&t.partitioner&&(i=(null!=i?i:this._target.getChildren()).filter((e=>{var i,s;return t.partitioner(null===(s=null===(i=e.context)||void 0===i?void 0:i.data)||void 0===s?void 0:s[0],e,{})}))),e&&t.sort&&(i=null!=i?i:this._target.getChildren(),i.sort(((e,i)=>{var s,n,r,a;return t.sort(null===(n=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===n?void 0:n[0],null===(a=null===(r=i.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,i,{})})));const s=e?(i,s,n)=>{const r=this.parseParams(t,e,i),a=this.executeTimelineItem(r,i,s,n);a&&this._trackAnimation(a)}:(i,s,n)=>{const r=this.parseParams(t,e,i),a=this.executeTypeConfigItem(r,i,s,n);a&&this._trackAnimation(a)};i?i.forEach(((t,e)=>s(t,e,i.length))):this._target.count<=1?s(this._target,0,1):this._target.forEachChildren(((t,e)=>s(t,e,this._target.count-1)))}executeTypeConfigItem(t,e,i,s){var n,r,a,l,h,c,u,d;const{type:p="fromTo",channel:g,customParameters:f,easing:m="linear",delay:y=0,delayAfter:b=0,duration:v=300,startTime:x=0,oneByOneDelay:_=0,loop:A,bounce:S,priority:T=0,options:w,custom:M,customType:B,controlOptions:C}=t,k=e.animate();k.priority=T;const P=o(y)?y(null===(r=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===r?void 0:r[0],e,{}):y,O=null===(l=null===(a=e.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],R=null===(h=e.context)||void 0===h?void 0:h.indexKey;O&&R&&(i=null!==(c=O[R])&&void 0!==c?c:i),k.startAt(x);const L=i*_+P;L>0&&k.wait(L);let E=null,I=t.to,D=t.from;I||(E||(E=this.createPropsFromChannel(g,e)),I=E.props),D||(E||(E=this.createPropsFromChannel(g,e)),D=E.from),this._handleRunAnimate(k,M,B,D,I,v,m,f,C,w,p,e);let F=0;_&&(F=_*(s-i-1));const j=o(b)?b(null===(d=null===(u=e.context)||void 0===u?void 0:u.data)||void 0===d?void 0:d[0],e,{}):b;return j>0&&(F+=j),F>0&&k.wait(F),A&&A>0&&k.loop(A),S&&k.bounce(!0),k}_handleRunAnimate(t,e,i,s,n,r,a,l,h,c,u,d){var p,g,f,m,y,b;if(e&&i){const u=Object.assign({width:(null===(p=d.stage)||void 0===p?void 0:p.width)||0,height:(null===(g=d.stage)||void 0===g?void 0:g.height)||0,group:this._target.parent},this.resolveValue(l,d)),v=o(c)?c.call(null,null!==(m=u&&(null===(f=u.data)||void 0===f?void 0:f[0]))&&void 0!==m?m:null===(b=null===(y=d.context)||void 0===y?void 0:y.data)||void 0===b?void 0:b[0],d,u):c;u.options=v,u.controlOptions=h,1===i?this.createCustomAnimation(t,e,s,n,r,a,u):2===i&&this.createCustomInterpolatorAnimation(t,e,n,r,a,u)}else"to"===u?t.to(n,r,a):"from"===u&&t.from(n,r,a)}executeTimelineItem(t,e,i,s){var n,r,a,o;const{timeSlices:l,startTime:h=0,loop:c,bounce:u,oneByOneDelay:d,priority:p,controlOptions:g}=t,f=null===(r=null===(n=e.context)||void 0===n?void 0:n.data)||void 0===r?void 0:r[0],m=null===(a=e.context)||void 0===a?void 0:a.indexKey;f&&m&&(i=null!==(o=f[m])&&void 0!==o?o:i);const y=e.animate();return y.priority=p,y.startAt(h),y.wait(i*d),c&&c>0&&y.loop(c),u&&y.bounce(!0),(Array.isArray(l)?l:[l]).forEach((t=>{this.applyTimeSliceToAnimate(t,y,e,g)})),d&&y.wait(d*(s-i-1)),y}applyTimeSliceToAnimate(t,e,i,s){var n,r,a,l;const{effects:h,duration:c=300,delay:u=0,delayAfter:d=0}=t,p=o(u)?u(null===(r=null===(n=i.context)||void 0===n?void 0:n.data)||void 0===r?void 0:r[0],i,{}):u,g=o(d)?d(null===(l=null===(a=i.context)||void 0===a?void 0:a.data)||void 0===l?void 0:l[0],i,{}):d;p>0&&e.wait(p),(Array.isArray(h)?h:[h]).forEach((t=>{var n;const{type:r="fromTo",channel:a,customParameters:o,easing:l="linear",options:h}=t;let u=null,d=t.to,p=t.from;d||(u||(u=this.createPropsFromChannel(a,i)),d=u.props),p||(u||(u=this.createPropsFromChannel(a,i)),p=u.from);const g=null!==(n=t.custom)&&void 0!==n?n:jf.builtInAnimateMap[r],f=t.customType;this._handleRunAnimate(e,g,f,p,d,c,l,o,s,h,r,i)})),g>0&&e.wait(g)}createCustomInterpolatorAnimation(t,e,i,s,n,r){const a=i;Object.keys(a).forEach((e=>{t.target.getComputedAttribute(e)})),t.interpolateUpdateFunction=(i,s,n,a,o)=>{e(n,i,s,a,o,t.target,r)},t.to(i,s,n)}createCustomAnimation(t,e,i,s,n,r,a){const o=new e(i,s,n,r,a);t.play(o)}createPropsFromChannel(t,e){const i={};let s=null;return t?(Array.isArray(t)?t.forEach((t=>{var s,n;const r=null===(n=null===(s=e.context)||void 0===s?void 0:s.diffAttrs)||void 0===n?void 0:n[t];void 0!==r&&(i[t]=r)})):Object.keys(t).forEach((n=>{var r,a,o,l;const h=t[n];void 0!==h.to&&("function"==typeof h.to?i[n]=h.to(null===(a=null===(r=e.context)||void 0===r?void 0:r.data)||void 0===a?void 0:a[0],e,{}):i[n]=h.to),void 0!==h.from&&(s||(s={}),"function"==typeof h.from?s[n]=h.from(null===(l=null===(o=e.context)||void 0===o?void 0:o.data)||void 0===l?void 0:l[0],e,{}):s[n]=h.from)})),{from:s,props:i}):{from:s,props:i}}resolveValue(t,e,i){var s,n;return void 0===t?i:"function"==typeof t&&e?t(null===(n=null===(s=e.context)||void 0===s?void 0:s.data)||void 0===n?void 0:n[0],e,{}):t}executeItem(t,e,i=0,s=1){return Array.isArray(t)?t.map((t=>this._executeItem(t,e,i,s))).filter(Boolean):[this._executeItem(t,e,i,s)].filter(Boolean)}_executeItem(t,e,i=0,s=1){if(!e)return null;const n="timeSlices"in t;let r=null;const a=this.parseParams(t,n);return r=n?this.executeTimelineItem(a,e,i,s):this.executeTypeConfigItem(a,e,i,s),r&&this._trackAnimation(r),r}stop(t){for(;this._animates.length>0;){const e=this._animates.pop();null==e||e.stop(t)}this._animates=[],this._activeCount=0,this._started&&(this._started=!1,this.onEnd())}}jf.builtInAnimateMap={};const Uf="appear",Nf="disappear",Wf="update",zf="highlight",Gf="unhighlight";class Vf{constructor(t){this.graphic=t}registerState(t){this.states||(this.states=new Map),this.states.set(t.name,t)}clearStates(){var t;null===(t=this.states)||void 0===t||t.clear()}}class Hf{constructor(t){this.stateList=null,this.graphic=t}applyState(t,e,i){const s=Ff.getInstance(),n=[],r=[];if(this.stateList&&this.stateList.length?t.forEach(((t,i)=>{const a={allowTransition:!0,stopOriginalTransition:!0};this.stateList.forEach((e=>{const i=s.isTransitionAllowed(e.state,t,this.graphic);a.allowTransition=a.allowTransition&&i.allowTransition})),a.allowTransition&&(r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)}),this.stateList.forEach((e=>{s.isTransitionAllowed(e.state,t,this.graphic).stopOriginalTransition&&n.push(e)})))})):t.forEach(((t,i)=>{r.push({state:t,animationConfig:g(e[i])?e[i].map((t=>t.animation)):e[i].animation,executor:new jf(this.graphic)})})),n.forEach((t=>{t.executor.stop()})),r.length){r[0].executor.execute(r[0].animationConfig);for(let t=0;t<r.length;t++){const e=r[t+1],s=r[t];s.executor.onEnd((()=>{e&&e.executor.execute(e.animationConfig),this.stateList=this.stateList.filter((t=>t!==s)),t===r.length-1&&i&&i(!1)}))}}else i&&i(!0);this.stateList?this.stateList=this.stateList.filter((t=>!n.includes(t))):this.stateList=[],this.stateList.push(...r)}applyAppearState(t,e){this.applyState([Uf],[{name:Uf,animation:t}],e)}applyDisappearState(t,e){this.applyState([Nf],[{name:Nf,animation:t}],e)}applyUpdateState(t,e){this.applyState([Wf],[{name:Wf,animation:t}],e)}applyHighlightState(t,e){this.applyState([zf],[{name:zf,animation:t}],e)}applyUnhighlightState(t,e){this.applyState([Gf],[{name:Gf,animation:t}],e)}stopState(t,e){var i;const s=null===(i=this.stateList)||void 0===i?void 0:i.find((e=>e.state===t));s&&s.executor.stop(e)}clearState(){var t;null===(t=this.stateList)||void 0===t||t.forEach((t=>{t.executor.stop()})),this.stateList=null}reApplyState(t){var e;const i=null===(e=this.stateList)||void 0===e?void 0:e.find((e=>e.state===t));if(i&&i.executor.started){const t=this.stateList.slice();i.executor.stop(),this.stateList=t,i.executor.execute(i.animationConfig)}}}class Xf{_getAnimationStateManager(t){return t._animationStateManager||(t._animationStateManager=new Hf(t)),t._animationStateManager}_getAnimationStateStore(t){return t._animationStateStore||(t._animationStateStore=new Vf(t)),t._animationStateStore}registerAnimationState(t){return this._getAnimationStateStore(this).registerState(t),this}applyAnimationState(t,e,i){return this._getAnimationStateManager(this).applyState(t,e,i),this}applyAppearState(t,e){return this._getAnimationStateManager(this).applyAppearState(t,e),this}applyDisappearState(t,e){return this._getAnimationStateManager(this).applyDisappearState(t,e),this}applyUpdateState(t,e){return this._getAnimationStateManager(this).applyUpdateState(t,e),this}applyHighlightState(t,e){return this._getAnimationStateManager(this).applyHighlightState(t,e),this}applyUnhighlightState(t,e){return this._getAnimationStateManager(this).applyUnhighlightState(t,e),this}stopAnimationState(t,e,i=!1){return this._getAnimationStateManager(this).stopState(t,e),i&&this.isContainer&&this.forEachChildren((s=>{s.stopAnimationState(t,e,i)})),this}clearAnimationStates(){const t=this._animationStateManager;return t&&t.clearState(),this}reApplyAnimationState(t,e=!1){const i=this._animationStateManager;return i&&i.reApplyState(t),e&&this.isContainer&&this.forEachChildren((i=>{i.reApplyAnimationState(t,e)})),this}static extend(t){return(new Xf)._getAnimationStateManager(t),t}}class $f{getAttributes(t=!1){return t&&this.finalAttribute?this.finalAttribute:this.attribute}animate(t){var e,i,s;const n=new Lf(null==t?void 0:t.id,null!==(i=null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline())&&void 0!==i?i:Rf,null==t?void 0:t.slience);if(n.bind(this),t){const{onStart:e,onEnd:i,onRemove:s}=t;null!=e&&n.onStart(e),null!=i&&n.onEnd(i),null!=s&&n.onRemove(s)}return null===(s=this.stage)||void 0===s||s.ticker.start(),n}createTimeline(){return new Of}createTicker(t){return new Df(t)}setFinalAttributes(t){this.finalAttribute||(this.finalAttribute={}),Object.assign(this.finalAttribute,t)}initFinalAttributes(t){this.finalAttribute=t}initAnimateExecutor(){this._animateExecutor||(this._animateExecutor=new jf(this))}executeAnimation(t){return this.initAnimateExecutor(),this._animateExecutor.execute(t),this}executeAnimations(t){return this.initAnimateExecutor(),t.forEach((t=>{this._animateExecutor.execute(t)})),this}getFinalAttribute(){return this.finalAttribute}getGraphicAttribute(t,e=!1){return!e&&this.finalAttribute?this.finalAttribute[t]:this.attribute[t]}pauseAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.pause())),t&&this.isContainer&&this.forEachChildren((e=>{e.pauseAnimation(t)}))}resumeAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.resume())),t&&this.isContainer&&this.forEachChildren((e=>{e.resumeAnimation(t)}))}stopAnimation(t=!1){this.animates&&this.animates.forEach((t=>t.stop())),t&&this.isContainer&&this.forEachChildren((e=>{e.stopAnimation(t)}))}}function Yf(){F(xl,Xf),F(xl,$f)}class qf extends kf{constructor(t,e,i,s,n){super("customAnimate",e,i,s),this.type="customAnimate",this.customFrom=t,this.params=n,this.from=t,this.to=e}update(t,e,i){if(this.onStart(),!this.props||!this.propKeys)return;const s=this.easing(e);this.onUpdate(t,s,i),this.syncAttributeUpdate()}setProps(t){this.props=t,this.propKeys=Object.keys(t),this.animate.reSyncProps()}}class Kf extends qf{onBind(){super.onBind(),this.propKeys=["x","y","z","alpha","zIndex"]}onFirstRun(){super.onFirstRun();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t)}onStart(){super.onStart();const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.finalAttribute.x,s=this.target.finalAttribute.y,n=this.target.finalAttribute.z,r=Math.acos((s-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));n-t.z<0&&(a=at-a),this.theta=a,this.phi=r}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const s=this.target,{center:n,r:r,cb:a}="function"==typeof this.params?this.params():this.params,o=2*Math.PI*e,l=this.theta+o,h=this.phi,c=r*Math.sin(h)*Math.cos(l)+n.x,u=r*Math.cos(h)+n.y,d=r*Math.sin(h)*Math.sin(l)+n.z;for(s.attribute.x=c,s.attribute.y=u,s.attribute.z=d,s.attribute.alpha=l+st/2;s.attribute.alpha>at;)s.attribute.alpha-=at;s.attribute.alpha=at-s.attribute.alpha,s.attribute.zIndex=-1e4*s.attribute.z,a&&a(i)}}const Zf=t=>({custom:Kf,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class Jf extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=xi.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(e.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",e.AttributeLevel.Series)}initAnimation(){var t,i;const s=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(e.animationConfig(null===(i=e.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var t;const e=this.getCompiler().getStage(),i=e.width-s.left||0-s.right||0,n=e.height-s.top||0-s.bottom||0,r=Math.max(i,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Jf.type=xi.wordCloud3d,Jf.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Qf=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({appear:Zf(t)}))),e.Factory.registerSeries(Jf.type,Jf)},tm=()=>{Qf()};class em extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class im extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=em,this.type="wordCloud3d",this.seriesType=xi.wordCloud3d}}im.type="wordCloud3d",im.seriesType=xi.wordCloud3d,im.transformerConstructor=em;const sm=()=>{ed(),Qf(),e.Factory.registerChart(im.type,im)},nm={label:{space:0}};class rm{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,i){const s=e.isZAxis(this._orient),n=e.isXAxis(this._orient),r=e.isYAxis(this._orient);let a=0,o=0;if(!i){const t=this.getRegions();let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}a=Math.abs(n-i),o=Math.abs(s-e)}let l=0,h=0;const{width:c,height:u}=this.getLayoutRect();let d={x:0,y:0};n?(d={x:c,y:0},l=a,h=c):r&&(d={x:0,y:u},l=o,h=u);const p=this.layout3dBox?this.layout3dBox.length:0;if(!s){const e=this.getLabelItems(h);return t.grid={length:l},t.start={x:0,y:0},t.text=this._spec.title.text||this._dataFieldText,t.maxWidth=this._getTitleLimit(n),t.items=e,t.grid={type:"line",start:{x:0,y:0},end:d,items:e[0],depth:p,length:l},t}return((t,i)=>{var s;const n=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,o=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,h={x:o,y:0},c=t.getLabelItems(a),u={start:{x:0,y:0},end:h,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:c,scale:t._scale.clone()},d=null!==(s=t.directionStr)&&void 0!==s?s:"r2l";let p=[0,0],g=-Math.PI/2,f=0;return"l2r"===d&&(f=t.layout3dBox.length,p=[0,0,0],g=Math.PI/2),u.z=f,u.alpha=g,u.anchor3d=p,i||(u.grid={type:"line",start:{x:0,y:0},end:h,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:n.height,alpha:g,z:f,anchor3d:p}),u})(this,i)}}const am=Object.assign(Object.assign({},id),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class om extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=xi.rangeColumn3d,this._barMarkType="rect3d",this._barName=xi.bar3d}}om.type=xi.rangeColumn3d,om.mark=am;const lm=()=>{ef(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(om.type,om)};class hm extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class cm extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}class um extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=cm,this.type="rangeColumn3d",this.seriesType=xi.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}um.type="rangeColumn3d",um.seriesType=xi.rangeColumn3d,um.transformerConstructor=cm;const dm="pictogram",pm="pictogram";var gm;!function(t){t.pictogram="pictogram"}(gm||(gm={}));const fm=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class mm extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===pm}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const ym=new Map;let bm;function vm(t,i){ym.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),bm||(bm=new ze,e.registerDataSetInstanceParser(bm,"svg",Le));const s=new Ge(bm);s.parse(i,{type:"svg"}),ym.set(t,s)}function xm(t){ym.has(t)?ym.delete(t):e.warn(`map type of '${t}' does not exists.`)}function _m(t){return ym.get(t)}class Am extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var e,i,s;const n=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},r=t.svg,a=null===(s=null===(i=ym.get(r))||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.elements;if(a&&a.length){a.map((t=>t.name)).filter((t=>h(t))).forEach((e=>{t[e]&&(n[e]=t[e])}))}return n}}class Sm extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const Tm="element-highlight-by-graphic-name";class wm extends e.ElementHighlight{constructor(){super(...arguments),this.type=Tm,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)){if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(l(t))return;const{interaction:e,highlightState:i,blurState:s}=this.options,n=e.getStatedGraphics(this),r=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&r.push(e)}))})),e.updateStates(this,r,n,i,s),e.setStatedGraphics(this,r)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}wm.type=Tm;const Mm="element-select-by-graphic-name";class Bm extends e.ElementSelect{constructor(){super(...arguments),this.type=Mm}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}Bm.type=Mm;function Cm(t){var e;return h(t)&&"none"!==t&&!(null===(e=t.includes)||void 0===e?void 0:e.call(t,"url"))}const km=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&Cm(i)?1:0},Pm=(t,e)=>{var i;const s=null!==(i=t.fill)&&void 0!==i?i:e;return s&&Cm(s)?s:void 0},Om=(t,e)=>{var i;const s=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!s||!Cm(s))&&s},Rm=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:Pm(t),lineWidth:km(t),stroke:Om(t)}),Lm={group:t=>{const e=Rm(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},Rm(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},Rm(t)),{fill:Pm(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},Rm(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},Rm(t)),{path:t.d,fillStrokeOrder:!1,fill:Pm(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},Rm(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:Pm(t,"#000")})},text:(t,e)=>{var i,s;return Object.assign(Object.assign({},Rm(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(s=t.textAnchor)&&void 0!==s?s:"middle",anchor:[0,0],fill:Pm(t,"#000")})}},Em=t=>{var i,s;if(!t||!t[0])return{};const{elements:n}=t[0].latestData;if(n&&n.length){n.forEach(((t,i)=>{var s;t[e.DEFAULT_DATA_INDEX]=i,t._uniqueId=`${t.id}-${i}`,t.data=void 0;const{graphicType:n,transform:r}=t,a={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?O(a,t._inheritStyle,null===(s=t.parent)||void 0===s?void 0:s._textGroupStyle,t.attributes):"group"!==t.graphicType&&O(a,t._inheritStyle,t.attributes),Lm[n]?t._finalAttributes=Lm[n](a,t.value):t._finalAttributes=a,r&&(t._finalAttributes.postMatrix=Object.assign({},r))}));const t=n.filter((t=>"text"===t.tagName));for(let r=0;r<t.length;r++){const a=t[r]._uniqueId,o=n.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(o&&o.length){const n=null!==(s=null===(i=t[r]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==s?s:0;let a=n;for(let t=0;t<o.length;t++){const i=o[t];if("group"===i.graphicType)a=n;else if(i.value&&void 0===i.parent._textGroupStyle.x){const s=o.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(s){a+=e.measureText(s.value,s._finalAttributes).width}i._finalAttributes.x=a}}}}}return n};class Im extends e.GeoSeries{constructor(){super(...arguments),this.type=pm,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=_m(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:e.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:e.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(t){const i="multiple"===t.mode,s=h(t.triggerOff)?t.triggerOff:i?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:s,reverseState:e.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:e.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var t;if(this._pictogramMark=this._createMark(Im.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,Im.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(Im.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:s,name:n,parent:r,id:a,_nameFromParent:o,_uniqueId:l}=i,h=this._createMark({type:s,name:null!=n?n:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,Im.mark.pictogram.name)});h&&(h.setData(this._mapViewData),h.setUserId(l),this._idToMark.set(l,h),"group"!==h.type&&h.setMarkConfig({graphicName:h.name}),h.setTransform([{type:"filter",callback:t=>t._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(Im.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}initMarkStyle(){const{root:t,viewBoxRect:i}=this._parsedSvgResult,s=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,Lm.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[ah(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const t of s){const{_uniqueId:i,_finalAttributes:s}=t,n=this._idToMark.get(i),r=this._validElement(t);n&&(this.setMarkStyle(n,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),r?(this.initMarkStyleWithSpec(n,O({},this._spec.pictogram,this._spec[n.name])),this.setMarkStyle(n,s,"normal",e.AttributeLevel.Series),n.setPostProcess("fill",((t,e)=>h(t)?t:this._spec.defaultFillColor))):(n.setMarkConfig({interactive:!1}),this.setMarkStyle(n,s,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new Sm(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,e=!1){if(!t)return null;const i=t[this.nameField];if(!i)return null;const s=this.getMarksWithoutRoot().filter((t=>t.name===i));if(!s||0===s.length)return null;let n=new Ht;e?s.forEach((t=>{n=n.union(t.getGraphics()[0].globalAABBBounds)})):s.forEach((t=>{n=n.union(t.getProduct().AABBBounds)}));const r={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2};if(e){const{x:t,y:e}=this.getLayoutStartPoint();r.x-=t,r.y-=e}return r}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,s=this.getRootMatrix();if(!s)return null;const n={};return s.getInverse().transformPoint({x:e,y:i},n),n}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const s=ym.get(this.svg);s||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const n=new Ge(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",Em),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),n.parse([s],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",n.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,n)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,s=e/2,n=this.getPictogramRootGraphic();if(n){const r=n.AABBBounds,{x1:a,x2:o,y1:l,y2:h}=n.AABBBounds,c=(a+o)/2,u=(l+h)/2,d=t/r.width(),p=e/r.height(),g=Math.min(d,p);n.scale(g,g,{x:c,y:u}),n.translate(i-c,s-u)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;const s=this.getPictogramRootGraphic();s&&(s.attribute.postMatrix||s.setAttributes({postMatrix:new Yt}),s.scale(e,e,i))}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;const i=this.getPictogramRootGraphic();i&&(i.attribute.postMatrix||i.setAttributes({postMatrix:new Yt}),i.translate(e[0],e[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}Im.type=pm,Im.mark=fm,Im.transformerConstructor=Am;const Dm=()=>{e.Factory.registerSeries(Im.type,Im),e.Factory.registerImplement("registerSVG",vm),e.Factory.registerImplement("unregisterSVG",xm),e.Factory.registerInteractionTrigger(wm.type,wm),e.Factory.registerInteractionTrigger(Bm.type,Bm)};class Fm extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=mm,this.type=dm,this.seriesType=pm}}Fm.type=pm,Fm.seriesType=dm,Fm.transformerConstructor=mm;class jm extends e.BaseChartSpecTransformer{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const Um="imageCloud",Nm="imageCloud";var Wm;!function(t){t.image="image",t.imageMask="imageMask"}(Wm||(Wm={}));const zm=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}}),Gm={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:Vm,triangle:Vm,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function Vm(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}const Hm={archimedean:function(t){const e=t[0]/t[1];return t=>[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,s=0;return t=>{const n=t<0?-1:1;switch(Math.sqrt(1+4*n*t)-n&3){case 0:i+=e;break;case 1:s+=4;break;case 2:i-=e;break;default:s-=4}return[i,s]}}};const Xm=(t,e,i)=>{const{threshold:s,invert:n=!1}=null!=e?e:{};if(!t||"#fff"===t)return(t,e,i)=>{const r=t.width;if(0===t.data[e*r*4+4*i+3])return!n;const a=t.data[e*r*4+4*i+0],o=t.data[e*r*4+4*i+1],l=t.data[e*r*4+4*i+2];if(255===a&&255===o&&255===l)return!n;if(b(s)){const t=.3*a+.59*o+.11*l;return n?t<=s:t>=s}return!1};const r=i({width:1,height:1}).getContext("2d",{willReadFrequently:!0});r.fillStyle=t,r.fillRect(0,0,1,1);const a=r.getImageData(0,0,1,1).data;return(t,e,i)=>{const s=t.width;return[0,1,2,3].every((r=>n?t.data[4*(e*s+i)+r]!==a[r]:t.data[4*(e*s+i)+r]===a[r]))}},$m=(t,e,i,s,n)=>{const{fontFamily:r="sans-serif",fontWeight:a="normal",fontStyle:o="normal",fontVariant:l="normal",text:c,hollow:u}=t;let d=12;n.font=`${o} ${l} ${a} ${d}px ${r}`,n.textAlign="center",n.textBaseline="middle",n.fillStyle=e;const p=n.measureText(c),g="normal"!==o?1.1:1,f=h(p.actualBoundingBoxRight)&&h(p.actualBoundingBoxLeft)?Math.ceil(g*(Math.abs(p.actualBoundingBoxRight)+Math.abs(p.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(p.width),f,d);if(u&&(n.globalCompositeOperation="xor"),m>i){const t=Math.min(i/m,s/d);n.fillText(c,i/2,s/2),n.scale(t,t)}else d=Math.floor(d*i/m),d=Math.min(d,s),n.font=`${o} ${l} ${a} ${d}px ${r}`,n.fillText(c,Math.floor(i/2),Math.floor(s/2))},Ym=(t,e,i=0,s)=>{const n=2*Math.PI/s;return new Array(s).fill(0).map(((s,r)=>St(t,e,i+r*n)))},qm=(t,e,i=0,s)=>{const n=2*Math.PI/s,r=(t=>Gm[t]?Gm[t]():Gm.circle())("cardioid");return new Array(s).fill(0).map(((s,a)=>{const o=i+a*n,l=e*r(o);return St(t,l,o)}))},Km=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},Zm=(t,e,i,s,n)=>{const{hollow:r}=t,{center:a,maxRadius:o}=function(t,e){const i=e[0],s=e[1];let n=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(s/2.7*.4),n=Math.floor(Math.min(i/2.3,s/2.6));break;case"triangleForward":n=s/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(s/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(s/1.5),n=Math.floor(Math.min(s/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":n=Math.floor(Math.min(i/2,s/2));break;default:n=Math.floor(Math.max(i/2,s/2))}return{maxRadius:n,center:r}}(t.shape,[i,s]);n.fillStyle=e,r&&(n.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,s)=>{0===s?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(n,qm({x:l,y:h},o,0,100));else if("circle"===t.shape)n.beginPath(),n.arc(l,h,o,0,2*Math.PI,!0),n.fill();else if("diamond"===t.shape)Km(n,Ym({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)Km(n,Ym({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)Km(n,Ym({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)Km(n,Ym({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)Km(n,Ym({x:l,y:h},o,0,3));else if("star"===t.shape){const t=Ym({x:l,y:h},o,-Math.PI/2,5),e=Ym({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let s=0;s<5;s++)i.push(t[s]),i.push(e[s]);Km(n,i)}else n.fillRect(0,0,i,s)};function Jm(t){const{size:e,maskCanvas:i}=t,s=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),n=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i<e[1];i++)for(let l=0;l<e[0];l++)if(0===n[i*e[0]+l]&&!t.isEmptyPixel(s,i,l)){n[i*e[0]+l]=r,o.push([i,l]);for(let i=0;i<o.length;i++)for(let l=0;l<4;l++){let h=o[i][0]+a[l][0],c=o[i][1]+a[l][1];h=h<0?0:h>=e[1]?e[1]-1:h,c=c<0?0:c>=e[0]?e[0]-1:c,0!==n[h*e[0]+c]||t.isEmptyPixel(s,h,c)||(n[h*e[0]+c]=r,o.push([h,c]))}r++,o=[]}const l={},h={},c={},u={},d={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0},f=[];for(let t=0;t<e[1];t++)for(let i=0;i<e[0];i++){const s=n[t*e[0]+i];0!==s&&(T(t,i)&&(f.push([t,i]),l[s]=l[s]||[],l[s].push([i,t]),u[s]||(u[s]=[1/0,-1/0,1/0,-1/0]),t<u[s][0]&&(u[s][0]=t),t>u[s][1]&&(u[s][1]=t),i<u[s][2]&&(u[s][2]=i),i>u[s][3]&&(u[s][3]=i),i<g.x1&&(g.x1=i),i>g.x2&&(g.x2=i),t<g.y1&&(g.y1=t),t>g.y2&&(g.y2=t)),h[s]=(h[s]||0)+1)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),s=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);c[t]=[i,s],m.push(...e);const[n,r,a,o]=u[t];d[t]=~~Math.max(Math.sqrt((i-a)**2+(s-n)**2),Math.sqrt((i-o)**2+(s-r)**2),Math.sqrt((i-a)**2+(s-r)**2),Math.sqrt((i-o)**2+(s-n)**2)),p[t]=(o-a)/(r-n)}const y=Object.keys(c).map((t=>({label:t-1,boundary:l[t],area:h[t],center:c[t],maxPoint:u[t],maxR:d[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const b=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),x=~~Math.max(Math.sqrt((b-g.x1)**2+(v-g.y1)**2),Math.sqrt((b-g.x2)**2+(v-g.y2)**2),Math.sqrt((b-g.x1)**2+(v-g.y2)**2),Math.sqrt((b-g.x2)**2+(v-g.y1)**2)),_=g.width/g.height,A=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:y,labels:n,labelNumber:r-1};if(t.blur){const i=t.blur,s=function(t,e,i,s){const n=s/3,r=Math.ceil(s/2),a=function(t,e){const i=new Array(2*t+1).fill(0),s=t;let n=0;for(let r=-t;r<=t;r++){const t=Math.exp(-r*r/(2*e*e));i[r+s]=t,n+=t}for(let t=0;t<i.length;t++)i[t]/=n;return i}(r,n),o=new Array(t.length).fill(0),l=new Array(t.length).fill(0);for(let s=0;s<i;s++)for(let i=0;i<e;i++){let n=0;for(let o=-r;o<=r;o++)n+=t[s*e+Math.min(Math.max(i+o,0),e-1)]*a[o+r];o[s*e+i]=n}for(let t=0;t<e;t++)for(let s=0;s<i;s++){let n=0;for(let l=-r;l<=r;l++)n+=o[Math.min(Math.max(s+l,0),i-1)*e+t]*a[l+r];l[s*e+t]=Math.max(0,Math.min(1,n))}return l}(n,e[0],e[1],i);(function(t,e,i,s,n=1){const r=new Array(t.length).fill(0);for(const[t,a]of e)if(r[t*i+a]=1,n>1)for(let e=1-n;e<=n-1;e++)for(let o=1-n;o<=n-1;o++)if(Math.sqrt(e*e+o*o)<n){const n=t+e,l=a+o;n>=0&&n<s&&l>=0&&l<i&&(r[n*i+l]=1)}return r})(n,f,e[0],e[1],Math.ceil(i/2)).forEach(((t,e)=>{1===t&&(n[e]=s[e])}))}return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:x,shapeRatio:_,shapeCenter:[b,v],shapeArea:A});function T(t,i){const s=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+s[r][0],o=i+s[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===n[a*e[0]+o])return!0}return!1}}function Qm(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const c=(t,e)=>{for(let s=0;s<t;++s)if(!i(r,e,s))return!1;return!0},u=(t,e,s)=>{for(let n=e;n<s;++n)if(!i(r,n,t))return!1;return!0};for(;a<o&&c(n,a);)++a;for(;o-1>a&&c(n,o-1);)--o;for(;l<h&&u(l,a,o);)++l;for(;h-1>l&&u(h-1,a,o);)--h;const d=s.getImageData(l,a,h-l,o-a);return e.width=d.width,e.height=d.height,s.clearRect(0,0,e.width,e.height),s.putImageData(d,0,0),e}function ty(t,e){return t&&(v(t)||x(t)||t.startsWith("<svg"))?new Promise(((i,s)=>{var n;const r=e({image:t}),a=null===(n=r.resources)||void 0===n?void 0:n.get(t);a&&"success"===a.state&&a.data?i(a.data):(r.successCallback=()=>{var e;if(r){const n=null===(e=r.resources)||void 0===e?void 0:e.get(t);n&&"success"===n.state&&n.data?i(n.data):s(new Error("image load failed: "+t))}else s(new Error("image load failed: "+t))},r.failCallback=()=>{s(new Error("image load failed: "+t))})})):null}var ey;function iy(t){return t}!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(ey||(ey={})),Object.values(ey).forEach((t=>{}));const sy=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),ny=t=>t<0?-t*t:t*t;function ry(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function ay(t,e,i){const s=t[0],n=t[1],r=e[0],a=e[1];let o,l;return n<s?(o=ry(n,s),l=i(a,r)):(o=ry(s,n),l=i(r,a)),t=>l(o(t))}function oy(t,e,i){const s=Math.min(t.length,e.length)-1,n=new Array(s),r=new Array(s);let a=-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<s;)n[a]=ry(t[a],t[a+1]),r[a]=i(e[a],e[a+1]);return function(e){const i=function(t,e,i=0,s){for(l(s)&&(s=t.length);i<s;){const n=i+s>>>1;z(t[n],e)>0?s=n:i=n+1}return i}(t,e,1,s)-1;return r[i](n[i](e))}}class ly{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=function(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),s=t[0]-i*e[0];return[s,i+s]}(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):h(this._rangeFactorStart)&&h(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return l(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return l(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!l(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:s}=this._fishEyeOptions,n=this.range(),r=n[0],a=n[n.length-1],o=Math.min(r,a),h=Math.max(r,a),c=q(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,h),u=l(s)?(h-o)*i:s;let d=Math.exp(e);d=d/(d-1)*u;const p=e/u;this._fishEyeTransform=t=>{const e=Math.abs(t-c);if(e>=u)return t;if(e<=1e-6)return c;const i=d*(1-Math.exp(-e*p))/e*.75+.25;return c+(t-c)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const{interpolateRgb:hy}=oe;function cy(t,e){const i=typeof e;let s;if(l(e)||"boolean"===i)return()=>e;if("number"===i)return K(t,e);if("string"===i){if(s=re.parseColorString(e)){const e=hy(re.parseColorString(t),s);return t=>e(t).formatRgb()}return K(Number(t),Number(e))}return e instanceof ae?hy(t,e):e instanceof re?hy(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),s=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+s*t),n)}(t,e):K(Number(t),Number(e))}class uy extends ly{constructor(t=iy,e=iy){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=iy,this._piecewise=ay,this._interpolate=cy}calculateVisibleDomain(t){var e;return h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),K)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,G);return this._domain=s,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Z,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=i.length,n=this._range.length;let r=Math.min(s,n);if(s&&s<n&&this._forceAlign){const t=n-s+1,e=i[s-1],a=s>=2?(e-i[s-2])/t:0;for(let n=1;n<=t;n++)i[s-2+n]=e-a*(t-n);r=n}return this._autoClamp&&(this._clamp=function(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}(i[0],i[r-1])),this._piecewise=r>2?oy:ay,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:iy),this.rescale(i)):this._clamp!==iy}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return l(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return l(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const dy=Math.sqrt(50),py=Math.sqrt(10),gy=Math.sqrt(2),fy=[1,2,5,10],my=(t,e,i)=>{let s=1,n=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?s=xy(a).step:(i||a>1)&&(n=Math.floor(t)-r*s),s>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*s)),function(t,e,i){h(e)||(e=t,t=0),h(i)||(i=1);let s=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(0,e).map((t=>n+t*s))):t>0?by(0,-(e-1)/s,s):by((e-1)/s,0,s)},yy=Y(((t,e,i,s)=>{let n,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e<t)&&(r=t,t=e,e=r),o=_y(t,e,i).step,!isFinite(o))return[];if(o>0){let i=Math.round(t/o),s=Math.round(e/o);for(i*o<t&&++i,s*o>e&&--s,a=new Array(r=s-i+1);++l<r;)a[l]=(i+l)*o}else if(o<0&&(null==s?void 0:s.noDecimals)){o=1;const i=Math.ceil(t),s=Math.floor(e);if(!(i<=s))return[];for(a=new Array(r=s-i+1);++l<r;)a[l]=i+l}else{o=-o;let i=Math.round(t*o),s=Math.round(e*o);for(i/o<t&&++i,s/o>e&&--s,a=new Array(r=s-i+1);++l<r;)a[l]=(i+l)/o}return n&&a.reverse(),a})),by=(t,e,i)=>{let s,n,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*i<t&&++a,(o-1)*i>e&&--o,n=new Array(s=o-a+1);++r<s;)n[r]=(a+r)*i}else{i=-i;let a=Math.floor(t*i),o=Math.ceil(e*i);for((a+1)/i<t&&++a,(o-1)/i>e&&--o,n=new Array(s=o-a+1);++r<s;)n[r]=(a+r)/i}return n},vy=Y(((t,e,i,s)=>{let n,r,a;if(i=+i,(t=+t)==(e=+e))return my(t,i,null==s?void 0:s.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return my(t,i,null==s?void 0:s.noDecimals);(n=e<t)&&(a=t,t=e,e=a);const o=_y(t,e,i);let l=o.step;if(!isFinite(l))return[];if(l>0){let s=1;const{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;s<=5&&(r=by(t,e,l),r.length>i+1)&&i>2;)l+=h,s+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let s;const n=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(s=a;s>=1;s--)e.push(n-s*i);return e.concat(t)}if(n>=0){for(s=1;s<=a;s++)t.push(r+s*i);return t}let o=[];const l=[];for(s=1;s<=a;s++)s%2==0?o=[n-Math.floor(s/2)*i].concat(o):l.push(r+Math.ceil(s/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==s?void 0:s.noDecimals)&&l<0&&(l=1),r=by(t,e,l);return n&&r.reverse(),r})),xy=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let s=fy[0];return i>=dy?s=fy[3]:i>=py?s=fy[2]:i>=gy&&(s=fy[1]),e>=0?{step:s*10**e,gap:s,power:e}:{step:-(10**-e)/s,gap:s,power:e}};function _y(t,e,i){const s=(e-t)/Math.max(0,i);return xy(s)}function Ay(t,e,i){let s;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(s=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(s))return[];const n=new Array(i);for(let e=0;e<i;e++)n[e]=t+e*s;return n}function Sy(t,e=10){let i,s,n=0,r=t.length-1,a=t[n],o=t[r],l=10;for(o<a&&(s=a,a=o,o=s,s=n,n=r,r=s);l-- >0;){if(s=_y(a,o,e).step,s===i)return t[n]=a,t[r]=o,t;if(s>0)a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s;else{if(!(s<0))break;a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s}i=s}}class Ty extends uy{constructor(){super(...arguments),this.type=ey.Linear}clone(){var t;const e=new Ty;return e.domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate),this._niceType&&(e._niceType=this._niceType,e._domainValidator=this._domainValidator,e._niceDomain=null===(t=this._niceDomain)||void 0===t?void 0:t.slice()),e}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return yy(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(o(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(h(this._rangeFactorStart)&&h(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=s[0],a=s[s.length-1];let l=vy(n[0],n[n.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==r||l[l.length-1]!==a)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==r?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==a&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Ay(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let s,n,r=-1;if(i=+i,(n=(e=+e)<(t=+t))&&(s=t,t=e,e=s),!isFinite(i)||e-t<=i)return[t];const a=Math.floor((e-t)/i+1),o=new Array(a);for(;++r<a;)o[r]=t+r*i;return n&&o.reverse(),o}(e[0],e[e.length-1],t)}nice(t=10,e){var i,s;const n=this._domain;let r=[];if(e){const t=function(t,e){const i=y(e.forceMin),s=y(e.forceMax);let n=null;const r=[];let a=null;const o=i&&s?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:y(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),s?r[1]=e.forceMax:y(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),y(r[0])&&y(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):n=y(r[0])||y(r[1])?y(r[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:r,domainValidator:o}}(n,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=Sy(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=r[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Sy(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Sy(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class wy extends Ty{constructor(){super(sy,ny),this.type=ey.Sqrt}clone(){return(new wy).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}var My;function By(t,e){t.aspectRatio>1?(t.width=e,t.height=~~(e/t.aspectRatio)):(t.height=e,t.width=~~(e*t.aspectRatio))}!function(t){t.BEFORE_IMAGECLOUD_LAYOUT="beforeImagecloudLayout",t.AFTER_IMAGECLOUD_LAYOUT="afterImagecloudLayout",t.AFTER_IMAGECLOUD_DRAW="afterImagecloudDraw"}(My||(My={}));class Cy{constructor(t){this.progressiveResult=[],this.imageCollageList=[],this.options=t}preProcess(){const{imageConfig:t={},weight:e}=this.options,{padding:i=0}=t;let s=this.imageCollageList;return s.forEach(((t,s)=>{!1===t.valid?(t.x=-10,t.y=-10,t.width=0,t.height=0,t.opacity=0):(t.padding=i,t.weight=tt(e)(this.data[s]),t.datum=this.data[s])})),s=s.filter((t=>!1!==t.valid)).sort(((t,e)=>e.weight-t.weight)),s}onImageCollageInputReady(t){t.forEach(((t,e)=>{if("fulfilled"===t.status){const i=t.value,{width:s,height:n}=i;this.imageCollageList.push(Object.assign({},this.data[e],{aspectRatio:s/n}))}else this.imageCollageList.push(Object.assign({},this.data[e],{valid:!1}))}))}layout(t){this.data=t,this.loadSegmentationInput(),this.loadImageCollageInput()}loadSegmentationInput(){var t,e,i,s,n,r;const a=this.options,o=a.size,l={shapeUrl:null!==(t=a.mask)&&void 0!==t?t:{type:"geometric",shape:"rect"},size:o,ratio:a.ratio||.8,tempCanvas:void 0,boardSize:[0,0],random:!1,randomGenerator:void 0,blur:null===(e=a.maskConfig)||void 0===e?void 0:e.edgeBlur},h=this.options.createCanvas({width:o[0],height:o[1]}),c=h.getContext("2d",{willReadFrequently:!0});c.textAlign="center",c.textBaseline="middle",l.tempCanvas=h;const u=o[0]+31>>5<<5;if(l.boardSize=[u,o[1]],l.random?l.randomGenerator=Math.random:l.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=l,p(l.shapeUrl)){l.isEmptyPixel=Xm(void 0,{threshold:null!==(s=null===(i=a.maskConfig)||void 0===i?void 0:i.threshold)&&void 0!==s?s:200,invert:null===(n=a.maskConfig)||void 0===n?void 0:n.invert},this.options.createCanvas);const t=ty(l.shapeUrl,this.options.createImage);t?(this.isMaskImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{var e,i;this.isMaskImageFinished=!0;const s=a.size,n=this.options.createCanvas({width:s[0],height:s[1],dpr:1});l.maskCanvas=n;const r=n.getContext("2d");(null===(e=a.maskConfig)||void 0===e?void 0:e.removeWhiteBorder)&&Qm(t,n,l.isEmptyPixel);const o=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,s);let h;r.clearRect(0,0,s[0],s[1]),r.drawImage(t,o.x,o.y,o.width,o.height),this.segmentationOutput=Jm(this.segmentationInput),"masked"===(null===(i=this.options.layoutConfig)||void 0===i?void 0:i.placement)&&(h=this.generateTransparentMaskCanvas(t,s)),this.segmentationOutput.transparentMaskCanvas=h,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(n,h)})).catch((t=>{this.isMaskImageFinished=!0}))):(this.isMaskImageFinished=!0,this.isLayoutFinished=!0)}else if(l.shapeUrl&&("text"===l.shapeUrl.type||"geometric"===l.shapeUrl.type)){l.isEmptyPixel=Xm(l.shapeUrl.backgroundColor,void 0,this.options.createCanvas),"text"!==l.shapeUrl.type&&"geometric"!==l.shapeUrl.type||l.shapeUrl.backgroundColor||(l.shapeUrl.backgroundColor="rgba(255,255,255,255)");const t=((t,e,i,s,n=!1,r)=>{let{backgroundColor:a="#fff"}=t,{fill:o="#000"}=t;n&&([a,o]=[o,a]);const l=s||r({width:e,height:i,dpr:1}),h=l.getContext("2d",{willReadFrequently:!0});if(s){const t=s.width,n=s.height;h.clearRect(0,0,t,n),s.style.width=`${e}px`,s.style.height=`${i}px`,s.width=e,s.height=i}return h.fillStyle=a,h.fillRect(0,0,l.width,l.height),"text"===t.type?$m(t,o,l.width,l.height,h):"geometric"===t.type&&Zm(t,o,l.width,l.height,h),l})(l.shapeUrl,o[0],o[1],void 0,null===(r=a.maskConfig)||void 0===r?void 0:r.invert,this.options.createCanvas);l.maskCanvas=t,this.segmentationOutput=Jm(this.segmentationInput),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t,t),this.isMaskImageFinished=!0}}loadImageCollageInput(){const t=function(t,e){return Promise.allSettled(t.map((t=>ty(t,e))))}(this.data.map((t=>tt(this.options.image)(t))),this.options.createImage);t?t.then((t=>{this.onImageCollageInputReady(t),this.isImagesFinished=!0})).catch((t=>{this.isImagesFinished=!0,this.isLayoutFinished=!0,$.getInstance().error("image load failed",t)})):(this.isImagesFinished=!0,this.isLayoutFinished=!0)}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){if(this.isImagesFinished&&this.isMaskImageFinished&&!this.isLayoutFinished){const t=this.preProcess(),e=this.doLayout(t);this.options&&this.options.onLayoutEnd&&this.options.onLayoutEnd(e),this.progressiveResult=this.processOutput(e),this.isLayoutFinished=!0}}progressiveOutput(){return this.progressiveResult}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}calculateImageSize(t,e={},i=.45){const{imageSizeRange:s,padding:n=0}=e,r=y(e.imageSize)?e.imageSize:((t,e={})=>{if(g(t)){const i=t.map((t=>Q(t,e)));return t=>i.map((e=>e(t)))}return Q(t,e)})(e.imageSize),a=this.options.size;if(r||s)if(r&&!o(r))t.forEach((t=>By(t,r)));else if(s){const e=(new wy).domain(et(t,(t=>t.weight))).range(s);t.forEach((t=>By(t,~~e.scale(t.weight))))}else if(r&&o(r)&&!s){const e=.5,[s,r]=et(t,(t=>t.weight)),o=t.reduce(((t,i)=>{const n=i.aspectRatio,a=(i.weight-s)/(r-s);return t+(n>1?1/n:n)*(e+(1-e)*a)**2}),0),l=~~Math.sqrt(i*a[0]*a[1]/o),h=[~~(e*l)-2*n<0?1:~~(e*l)-2*n,~~l-2*n<0?1:~~l-2*n],c=(new wy).domain(et(t,(t=>t.weight))).range(h);t.forEach((t=>By(t,~~c.scale(t.weight))))}else console.warn("image cloud imageSize error");else{const e=t.reduce(((t,e)=>{const i=e.aspectRatio;return t+(i>1?1/i:i)}),0);let s=~~Math.sqrt(i*a[0]*a[1]/e);s=s-2*n<0?1:s-2*n,t.forEach((t=>By(t,s)))}return t}generateTransparentMaskCanvas(t,e){var i;const s=this.options.createCanvas({width:e[0],height:e[1],dpr:1}),n=s.getContext("2d");this.segmentationOutput.transparentMaskCanvas=s,(null===(i=this.options.maskConfig)||void 0===i?void 0:i.removeWhiteBorder)&&Qm(t,s,this.segmentationInput.isEmptyPixel);const r=n.createImageData(e[0],e[1]),a=this.segmentationOutput.segmentation.labels;for(let t=0;t<a.length;t++){const e=0===a[t]?255:0,i=255*a[t],s=4*t;r.data[s]=e,r.data[s+1]=e,r.data[s+2]=e,r.data[s+3]=i}return n.clearRect(0,0,e[0],e[1]),n.fillStyle="rgba(255,255,255,0)",n.fillRect(0,0,e[0],e[1]),n.putImageData(r,0,0),s}processOutput(t){var e;const i=null===(e=this.options)||void 0===e?void 0:e.as;return i&&Object.keys(i).forEach((e=>{t.forEach((t=>{t[i[e]]=t[e],delete t[e]}))})),t}}class ky extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.45}=this.options;return this.calculateImageSize(t,e,i)}tryPlaceImage(t,e,i,s,n,r=1){const[a,o]=e,l=a/2,h=o/2,c=Math.sqrt(l**2+h**2),u=Hm[i](e);let d,p,g=-r;const{segmentation:f}=s,{labels:m}=f;for(;([d,p]=u(g+=r))&&!(Math.min(Math.abs(d),Math.abs(p))>=c);)if(d-=t.width/2,p-=t.height/2,t.visible=!0,t.x=~~(l+d),t.y=~~(h+p),t._left=t.x+t.padding,t._top=t.y+t.padding,t._leftWithoutPadding=t.x,t._topWithoutPadding=t.y,Py(t,n)){const{x:e,y:i,width:s,height:n}=t;let r=!1;for(let t=0;t<s;t++){for(let s=0;s<n&&i+t<=o;s++)if(!(e+s>a||m[(i+t)*a+(e+s)])){r=!0;break}if(r)break}if(!r){const e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x,y:t.y+t.height},{x:t.x+t.width,y:t.y+t.height}];let i=!0;for(const t of e)if(!m[t.y*a+t.x]){i=!1;break}if(!i)continue;return!0}}return!1}doLayout(t){var e;const{segmentationOutput:i}=this,{layoutConfig:s={}}=this.options,n=this.options.size,{spiralType:r="archimedean",fillingTimes:a=4,minFillingImageSize:o=10}=s,l=[],h=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));for(const e of t)e._widthWithPadding=e.width+2*e.padding,e._heightWithPadding=e.height+2*e.padding,e.frequency=1,this.tryPlaceImage(e,n,r,i,l)&&l.push(e);const c=U(l,((t,e)=>t.width-e.width)).width,u=U(l,((t,e)=>t.height-e.height)).height,d=[];for(let s=0;s<a;s++){const a=.5*c-1*s,p=.5*u-1*s;for(const s of t){const t=Object.assign({},s,{visible:!0});By(t,Math.max(o,t.aspectRatio>1?a:p)),t._widthWithPadding=t.width+2*t.padding,t._heightWithPadding=t.height+2*t.padding,this.tryPlaceImage(t,n,r,i,[...d,...l],.5)&&(s._tempFrequency=(null!==(e=s._tempFrequency)&&void 0!==e?e:s.frequency)+1,t.frequency=s._tempFrequency,t.distance=Math.sqrt(Math.pow(t.x-n[0]/2,2)+Math.pow(t.y-n[1]/2,2)),t[h]=`${t[h]}_${t.frequency}`,d.push(t))}}return[...l,...d].filter((t=>t.visible))}}function Py(t,e){for(let n=0;n<e.length;n++)if(i=t,s=e[n],!(i._leftWithoutPadding+i._widthWithPadding<s._leftWithoutPadding||i._topWithoutPadding+i._heightWithPadding<s._topWithoutPadding||i._leftWithoutPadding>s._leftWithoutPadding+s._widthWithPadding||i._topWithoutPadding>s._topWithoutPadding+s._heightWithPadding))return!1;var i,s;return!0}function Oy(t){const{imageConfig:e={},size:i,ratio:s=.1,layoutConfig:n={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i;let h;h=a||Math.min(o,l)*s-2*r,h<0&&(h=1);const{rectAspectRatio:c=1}=n;let u,d;c>1?(u=h,d=h/c):(d=h,u=h*c);const p=Math.ceil(l/(d+r)),g=Math.ceil(o/(u+r)),f=o/2,m=l/2,y=new Array(g*p);for(let t=0;t<p;t++)for(let e=0;e<g;e++){const i=e*(u+r)+u/2,s=t*(d+r)+d/2;y[t*g+e]={centerX:i,centerY:s,x:i-u/2,y:s-d/2,row:t,col:e,distance:Math.sqrt(Math.pow(i-f,2)+Math.pow(s-m,2))}}return{context:Object.assign({},n,{cellWidth:u,cellHeight:d,cellInfo:y,cellCount:y.length,cellType:"rect",cellPixelCount:u*d,eachPixel:(t,e)=>{const{x:i,y:s}=t;for(let t=0;t<u;t++)for(let n=0;n<d&&s+t<=l;n++)i+n>o||e((~~s+t)*o+(~~i+n))},clipPath:`M${-u/2} ${-d/2} L${u/2} ${-d/2} L${u/2} ${d/2} L${-u/2} ${d/2} Z`}),imageLength:h}}const Ry={rect:Oy,circle:function(t){const{imageConfig:e={},size:i,ratio:s=.1,layoutConfig:n={}}=t,{padding:r=0,imageSize:a=0}=e,[o,l]=i,h=o/2,c=l/2;let u=0;u=a?a/2:Math.min(o,l)*s/2,u-r<=0&&(u=r+1);const d=2*u,p=Math.sqrt(3)/2*d+r,g=[];let f=0;for(let t=0;t*p-u<l;t++){const e=t*p,i=t%2==0?0:u;for(let s=-1;s*(d+r)+i-u<o;s++){const n=s*(d+r)+i+u;g[f++]={centerX:n,centerY:e,x:n-u,y:e-u,row:t,col:s,distance:Math.sqrt(Math.pow(n-h,2)+Math.pow(e-c,2))}}}let m=0;const y=u*u;for(let t=0;t<d;t++)for(let e=0;e<d;e++){const i=t-u,s=e-u;i*i+s*s<=y&&m++}return{context:Object.assign({},n,{cellWidth:d,cellHeight:d,cellInfo:g,cellCount:g.length,cellType:"circle",cellPixelCount:m,eachPixel:(t,e)=>{const{x:i,y:s}=t;for(let t=0;t<d;t++)for(let n=0;n<d;n++){if(t+i<0||t+i>o||n+s>l||n+s<0)continue;const r=t-u,a=n-u;r*r+a*a<=y&&e((~~s+t)*o+(~~i+n))}},clipPath:"M 1 0 A 1 1 0 1 0 -1 0 A 1 1 0 1 0 1 0 Z"}),imageLength:d}},hexagonal:function(t){const{imageConfig:e={},size:i,ratio:s=.1,layoutConfig:n={}}=t,{padding:r=0,imageSize:a}=e,[o,l]=i,h=o/2,c=l/2;let u;u=a?a/2:Math.min(o,l)*s/2,u-r<=0&&(u=r+1);const d=[],p=2*Math.PI/6;for(let t=0;t<6;t++){const e=p*t;d.push({x:(u-r/2)*Math.cos(e),y:(u-r/2)*Math.sin(e)})}const g=2*u,f=Math.sin(Math.PI/6)*g,m=Math.sqrt(3)*f,y=g-f/2,b=Math.cos(Math.PI/6)*g,v=b/2,x=Math.floor(l/m),_=Math.floor(o/f),A=[];for(let t=-1;t<=x+1;t++)for(let e=-1;e<=_;e++){const i=e*y,s=t*b+(e%2?v:0);A.push({centerX:i,centerY:s,x:i-f,y:s-f,row:t,col:e,distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(s-c,2))})}let S=0;const T=[];for(let t=0;t<=m;t++)for(let e=0;e<=2*f;e++){const i=e-f,s=t-m/2,n=Math.abs(i),r=Math.abs(s);n<=f&&r<=m/2&&2*r+n*Math.sqrt(3)<=m?(S++,T.push(!0)):T.push(!1)}return{context:Object.assign({},n,{cellHexSideLength:f,cellHexPoints:d,cellHeight:m,cellWidth:2*f,cellInfo:A,cellCount:A.length,cellType:"hexagonal",cellPixelCount:S,eachPixel:(t,e)=>{const{x:i,y:s}=t;let n=0;for(let t=0;t<=m;t++)for(let r=0;r<=2*f;r++)T[n++]&&e((~~s+t)*o+(~~i+r))},clipPath:"M 1 0 L 0.5 0.866 L -0.5 0.866 L -1 0 L -0.5 -0.866 L 0.5 -0.866 Z"}),imageLength:g-r}}};class Ly extends Cy{preProcess(){var t;const e=super.preProcess(),{layoutConfig:i={}}=this.options,{cellType:s="rect"}=i,n=(null!==(t=Ry[s])&&void 0!==t?t:Ry.rect)(this.options),{context:r,imageLength:a}=n;return e.forEach((t=>function(t,e){t.aspectRatio>1?(t.height=e,t.width=~~(e*t.aspectRatio)):(t.width=e,t.height=~~(e/t.aspectRatio))}(t,a))),r.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.layoutContext=r,e}doLayout(t){const{cellWidth:e,cellHeight:i,cellInfo:s,cellCount:n,clipPath:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===n||0===e||0===i||0===s.length)return void(this.isLayoutFinished=!0);const{segmentationOutput:l}=this,{layoutConfig:h={}}=this.options,{placement:c="default"}=h;if("edge"===c||"default"===c){const{segmentation:t}=l,{labels:e}=t;s.forEach((t=>{let i=0;a(t,(t=>{e[t]&&i++})),t.intersectPixels=i}))}const u=t.length,d=t=>{const{intersectPixels:e}=t;return"default"===c?e>=.45*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<u;e++){const i=t[e],n=s[e];n&&(i.x=n.centerX-i.width/2,i.y=n.centerY-i.height/2,i.clipConfig={shape:r},i.frequency=1,i.visible=d(n),i.cell=R(n,["image"]),i.distance=n.distance,n.image=i)}const p=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(u<n)for(let e=u;e<n;e++){const i=t[e-u],n=s[e];if(n){const e=Object.assign({},i);e.x=n.centerX-e.width/2,e.y=n.centerY-e.height/2,e.frequency+=1,e[p]=`${e[p]}_${e.frequency}`,e.visible=d(n),e.distance=n.distance,e.cell=R(n,["image"]),n.image=e,t.push(e)}}return t.filter((t=>t.visible))}}class Ey extends Cy{preProcess(){const t=super.preProcess(),{imageConfig:e={},ratio:i=.1}=this.options,s=Oy;return this.layoutContext=s(Object.assign({},this.options,{imageConfig:{imageSize:null}})).context,this.layoutContext.cellInfo.sort(((t,e)=>t.distance-e.distance)),this.calculateImageSize(t,e,i)}doLayout(t){const{segmentationOutput:e}=this,{cellWidth:i,cellHeight:s,cellInfo:n,cellCount:r,eachPixel:a,cellPixelCount:o}=this.layoutContext;if(0===t.length||0===r||0===i||0===s||0===n.length)return void(this.isLayoutFinished=!0);const{layoutConfig:l={}}=this.options,h=this.options.size,{placement:c="default",maxAngle:u=Math.PI/180*45}=l;if("edge"===c||"default"===c){const{segmentation:t}=e,{labels:i}=t;n.forEach((t=>{let e=0;a(t,(t=>{i[t]&&e++})),t.intersectPixels=e}))}const d=t.length,p=Math.sqrt(Math.pow(h[0],2)+Math.pow(h[1],2)),g=t=>{const{intersectPixels:e}=t;return"default"===c?e>.5*o:"edge"!==c||e>.1*o&&e<o};for(let e=0;e<d;e++){const i=t[e],s=n[e];s&&(i.x=s.centerX-i.width/2,i.y=s.centerY-i.height/2,i.visible=g(s),i.cell=`${s.row}_${s.col}`,i.angle=Math.random()*(2*u)-u,i.anchor=[i.x+i.width/2,i.y+i.height/2],i.zIndex=p-s.distance,i.distance=s.distance,i.frequency=1,s.image=i)}const f=Object.keys(t[0]).find((t=>t.includes("VGRAMMAR")));if(d<r)for(let e=d;e<r;e++){const i=t[e-d],s=n[e];if(s){const e=Object.assign({},i);e.x=s.centerX-e.width/2,e.y=s.centerY-e.height/2,e.anchor=[e.x+e.width/2,e.y+e.height/2],e.angle=Math.random()*(2*u)-u,e.frequency+=1,e[f]=`${e[f]}_${e.frequency}`,e.visible=g(s),e.cell=`${s.row}_${s.col}`,e.distance=s.distance,e.zIndex=p-s.distance,s.image=e,t.push(e)}}return t.filter((t=>t.visible))}}const Iy=(t,e,i)=>{var s,n;const r=o(t.size)?t.size():t.size;if(t.size=r,!r||l(r[0])||l(r[1])||r[0]<=0||r[1]<=0)return $.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(r[0]),Math.ceil(r[1])],t.image||$.getInstance().error("Imagecloud: image source must be specified."),t.onBeforeLayout&&t.onBeforeLayout(),!e||0===e.length)return[];let a;switch(null!==(n=null===(s=t.layoutConfig)||void 0===s?void 0:s.layoutMode)&&void 0!==n?n:"spiral"){case"grid":a=Ly;break;case"stack":a=Ey;break;default:a=ky}const h=new a(t);return h.layout(e),h.unfinished()?{progressive:h}:h.output()};class Dy extends qf{constructor(t,e,i,s,n){var r;super(t,e,i,s,n),this._rotations=null!==(r=null==n?void 0:n.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,b(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var s;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const n=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(n))*(null!==(s=this._scaleX)&&void 0!==s?s:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Fy(t,i){switch(i){case"axialRotate":return[{custom:Dy,customParameters:{rotation:1},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(e,i)=>t.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>t.center().x},y:{from:()=>t.center().y}},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class jy extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}class Uy extends e.BaseSeries{constructor(){super(...arguments),this.type=Nm}setValueField(t){h(t)&&(this._valueField=t)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var t;(null===(t=this._spec.imageMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(zm.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(zm.image,{key:t=>`${t[e.DEFAULT_DATA_KEY]}-${t.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var t,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:t=>t.x,y:t=>t.y,width:t=>t.width,height:t=>t.height,visible:t=>t.visible,angle:t=>t.angle,clipConfig:t=>t.clipConfig,image:t=>t[this._urlField],scaleCenter:["50%","50%"]},"normal",e.AttributeLevel.Series);"masked"===(null===(t=this._spec.layoutConfig)||void 0===t?void 0:t.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",e.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",e.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",e.AttributeLevel.Series)}isFillingImage(t){return t._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",e.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new jy(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var t;return{size:()=>{const{width:t,height:e}=this._region.getLayoutRect();return[t,e]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(t=this._spec.image)||void 0===t?void 0:t.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:e.vglobal.createCanvas.bind(e.vglobal),createImage:fh,onUpdateMaskCanvas:((t,e)=>{var i;t&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((e=>{e.setAttribute("background",t)})),e&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",e)}).bind(this),onLayoutFinished:()=>{var t,e;return null===(e=null===(t=this._option.globalInstance.getChart().getOption().performanceHook)||void 0===t?void 0:t.afterWordcloudShapeDraw)||void 0===e?void 0:e.call(t,this._option.globalInstance)}}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,s;if(t){const n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===s?void 0:s.preset,r={center:()=>{const{width:t,height:e}=this._region.getLayoutRect();return{x:t/2,y:e/2}},height:()=>{const{height:t}=this._region.getLayoutRect();return t}};t.setAnimationConfig(e.animationConfig(e.Factory.getAnimationInKey("imageCloud")(r,n),e.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var t;return[null!==(t=this._nameField)&&void 0!==t?t:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getActiveMarks(){return[this._imageMark]}getMarkData(t){var e;return null!==(e=null==t?void 0:t.datum)&&void 0!==e?e:t}getGroupFields(){return[]}dataToPosition(t){return null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}valueToPosition(t,e){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Uy.type=Nm,Uy.mark=zm;const Ny=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Fy(t,e),enter:Fy(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Uy.type,Uy),e.Factory.registerGrammarTransform("imagecloud",{transform:Iy})};class Wy extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Wy.transformerConstructor,this.type=Um,this.seriesType=Nm}}Wy.type=Um,Wy.seriesType=Nm,Wy.transformerConstructor=jm;class zy extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){const e=[t.openField,t.highField,t.lowField,t.closeField],i=super._getDefaultSeriesSpec(t,["candlestick","openField","highField","lowField","closeField","rising","falling","doji"]);return i.yField=e,i}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),e.setDefaultCrosshairForCartesianChart(t)}}class Gy extends e.GlyphMark{constructor(){super(...arguments),this.type=Gy.type}setGlyphConfig(t){super.setGlyphConfig(t),this._subMarks={line:{type:"line",defaultAttributes:{x:0,y:0}},box:{type:"rect"}},this._positionChannels=["x","boxWidth","open","close","high","low"],this._channelEncoder=null,this._positionEncoder=(t,e,i)=>{const{x:s=i.attribute.x,boxWidth:n=i.attribute.boxWidth,open:r=i.attribute.open,close:a=i.attribute.close,low:o=i.attribute.low,high:l=i.attribute.high}=t,h={};return h.line={points:[{x:s,y:o},{x:s,y:l}]},h.box={x:s-n/2,x1:s+n/2,y:Math.min(r,a),y1:Math.max(r,a),drawStrokeWhenZeroWH:!0},h}}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}}Gy.type="candlestick";class Vy extends qf{constructor(t,e,i,s,n){super(t,e,i,s,n)}onBind(){super.onBind();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){const t=(t=>{const e=t.getFinalAttribute(),{x:i,y:s,open:n,high:r,low:a,close:o}=e,l={from:{x:i,y:s},to:{x:i,y:s}};return b(n)&&b(o)&&(n>o?(l.from.open=a,l.to.open=n,l.from.close=a,l.to.close=o,b(r)&&(l.from.high=a,l.to.high=r)):(l.from.open=r,l.to.open=n,l.from.close=r,l.to.close=o,b(a)&&(l.from.low=r,l.to.low=a))),l})(this.target,this.params,this.params.options);return t}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}class Hy extends qf{constructor(t,e,i,s,n){super(t,e,i,s,n)}onBind(){var t;(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){const t=(t=>{const e=t.getFinalAttribute(),{x:i,y:s,open:n,high:r,low:a,close:o}=e,l={from:{x:i,y:s},to:{x:i,y:s}};return b(n)&&b(o)&&(n>o?(l.from.open=n,l.to.open=a,l.from.close=o,l.to.close=a,b(r)&&(l.from.high=r,l.to.high=a)):(l.from.open=n,l.to.open=r,l.from.close=o,l.to.close=r,b(a)&&(l.from.low=a,l.to.low=r))),l})(this.target,this.params,this.params.options);return t}onUpdate(t,e,i){const s=this.target.attribute;this.propKeys.forEach((t=>{s[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(s)}}const Xy="candlestick";var $y,Yy;!function(t){t.OPEN="open",t.HIGH="high",t.LOW="low",t.CLOSE="close",t.SERIES_FIELD="seriesField"}($y||($y={})),function(t){t.candlestick="candlestick"}(Yy||(Yy={}));const qy=Object.assign(Object.assign({},e.baseSeriesMark),{candlestick:{name:"candlestick",type:"candlestick"}});class Ky extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.getContentKey=t=>e=>{switch(t){case $y.OPEN:return this.series.getOpenField();case $y.HIGH:return this.series.getHighField();case $y.LOW:return this.series.getLowField();case $y.CLOSE:return this.series.getCloseField();case $y.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{switch(t){case $y.OPEN:return e[this.series.getOpenField()];case $y.HIGH:return e[this.series.getHighField()];case $y.LOW:return e[this.series.getLowField()];case $y.CLOSE:return e[this.series.getCloseField()];case $y.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>this.series.getMarkInName("candlestick").getAttribute("stroke",t)}getDefaultContentList(t){return[{key:this.getContentKey($y.OPEN),value:this.getContentValue($y.OPEN)},{key:this.getContentKey($y.HIGH),value:this.getContentValue($y.HIGH)},{key:this.getContentKey($y.LOW),value:this.getContentValue($y.LOW)},{key:this.getContentKey($y.CLOSE),value:this.getContentValue($y.CLOSE)},{key:this.getContentKey($y.SERIES_FIELD),value:this.getContentValue($y.SERIES_FIELD)}]}}const Zy={rising:{style:{boxFill:"#FF0000",stroke:"#FF0000"}},falling:{style:{boxFill:"#00AA00",stroke:"#00AA00"}},doji:{style:{boxFill:"#000000",stroke:"#000000"}},candlestick:{style:{lineWidth:1}}};class Jy extends e.CartesianSeries{constructor(){super(...arguments),this.type=Xy,this._mergedStyles={rising:{},falling:{},doji:{}}}getOpenField(){return this._openField}getHighField(){return this._highField}getLowField(){return this._lowField}getCloseField(){return this._closeField}getBoxFill(){return this._boxFill}getStrokeColor(){return this._strokeColor}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec();const l=this._spec,h=null!==(e=null===(t=l.candlestick)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._openField=l.openField,this._highField=l.highField,this._lowField=l.lowField,this._closeField=l.closeField,this._boxWidth=h.boxWidth,this._boxFill=h.boxFill,this._strokeColor=h.strokeColor,this._buildMergedStyles(h,null!==(s=null===(i=l.rising)||void 0===i?void 0:i.style)&&void 0!==s?s:{},null!==(r=null===(n=l.falling)||void 0===n?void 0:n.style)&&void 0!==r?r:{},null!==(o=null===(a=l.doji)||void 0===a?void 0:a.style)&&void 0!==o?o:{})}initMark(){this._candlestickMark=this._createMark(Jy.mark.candlestick,{groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){var t;const i=this._candlestickMark;if(i){const s={fill:t=>this.mergeStyle(t).boxFill,stroke:t=>this.mergeStyle(t).stroke,lineWidth:t=>this.mergeStyle(t).lineWidth,boxWidth:null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth.bind(this),x:this.dataToPositionX.bind(this)};i.setGlyphConfig({}),this.setMarkStyle(i,s,e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}initCandlestickMarkStyle(){var t;const i=this._candlestickMark,s=this._yAxisHelper;if(i&&s){const{dataToPosition:n}=s,r=null===(t=null==s?void 0:s.getScale)||void 0===t?void 0:t.call(s,0);this.setMarkStyle(i,{open:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._openField),{bandPosition:this._bandPosition}),r),high:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._highField),{bandPosition:this._bandPosition}),r),low:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._lowField),{bandPosition:this._bandPosition}),r),close:t=>e.valueInScaleRange(n(this.getDatumPositionValues(t,this._closeField),{bandPosition:this._bandPosition}),r)},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}init(t){super.init(t),this.initCandlestickMarkStyle()}_initAnimationSpec(t={}){const e=O({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{e[t]&&"scaleIn"===e[t].type?e[t].type="candlestickScaleIn":e[t]&&"scaleOut"===e[t].type&&(e[t].type="candlestickScaleOut")})),e}initAnimation(){var t;const i=e.getGroupAnimationParams(this);if(this._candlestickMark){const s=this._initAnimationSpec(null===(t=e.Factory.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),n=this._initAnimationSpec(e.userAnimationConfig(Xy,this._spec,this._markAttributeContext));this._candlestickMark.setAnimationConfig(e.animationConfig(s,n,i))}}initTooltip(){this._tooltipHelper=new Ky(this),this._candlestickMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._candlestickMark)}_buildMergedStyles(t,e,i,s){this._mergedStyles.rising=O({},t,e),this._mergedStyles.falling=O({},t,i),this._mergedStyles.doji=O({},t,s)}mergeStyle(t){const e=this.getDatumPositionValues(t,this._openField)[0],i=this.getDatumPositionValues(t,this._closeField)[0];return e<i?this._mergedStyles.rising:e>i?this._mergedStyles.falling:this._mergedStyles.doji}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t=this._xAxisHelper,e=this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(){super.onLayoutEnd(),this._autoBoxWidth=null}getActiveMarks(){return[this._candlestickMark]}}Jy.type=Xy,Jy.builtInTheme={candlestick:Zy},Jy.mark=qy;const Qy=()=>{e.registerGlyphMark(),Fg(),Gg(),e.Factory.registerGraphicComponent("line",(t=>sh(t))),e.Factory.registerGraphicComponent("rect",(t=>ah(t))),e.Factory.registerMark(Gy.type,Gy),e.registerSymbolMark(),e.registerScaleInOutAnimation(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),jf.registerBuiltInAnimate("candlestickScaleIn",Vy),jf.registerBuiltInAnimate("candlestickScaleOut",Hy),e.Factory.registerSeries(Jy.type,Jy)};class tb extends e.BaseChart{_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}tb.type="candlestick",tb.seriesType=Xy,tb.transformerConstructor=zy;const eb=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class ib extends Al{constructor(t,e){super(t),this._skipRenderAttributes=eb,(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i,s){const n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);if(n)return this._setAttributes(n,i);d(this.attribute[t])&&d(e)&&!o(this.attribute[t])&&!o(e)?O(this.attribute[t],e):this.attribute[t]=e,this._skipRenderAttributes.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,i){return t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t,this._setAttributes(t,e)}_setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>this._skipRenderAttributes.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){l(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const s=e[i];!d(this.attribute[s])||o(this.attribute[s])||o(t[s])?this.attribute[s]=t[s]:O(this.attribute[s],t[s])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const s=new Vr(t,e);s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(s)}eventPosToStagePos(t){var e,i;const s={x:0,y:0},n=null!==(i=null===(e=this.stage)||void 0===e?void 0:e.eventPointTransform(t))&&void 0!==i?i:{x:0,y:0};return this.globalTransMatrix.transformPoint(n,s),s}}var sb;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(sb||(sb={}));const nb={[sb.selectedReverse]:{},[sb.selected]:{},[sb.hover]:{},[sb.hoverReverse]:{}};function rb(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&rb(t,e)}))}function ab(t){return t>=0&&t<Math.PI/2||t>3*Math.PI/2&&t<=2*Math.PI}function ob(t,e,i){return Math.abs(t-e)<i}function lb(t,e="type"){return"rich"===function(t,e="type"){var i,s;return c(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}(t,e)}const hb=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function cb(){Lg(),Gg(),Zg(),$g(),Qg()}var ub=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(i[s[n]]=t[s[n]])}return i};cb();class db extends ib{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},db.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;this.cacheStates();const{text:s="",textStyle:n={},shape:r={},panel:o={},space:u=4,minWidth:d,maxWidth:p,padding:f=4,visible:m,state:v,type:x,textAlwaysCenter:_,containerTextAlign:A}=this.attribute,S=function(t){if(b(t))return[t,t,t,t];if(g(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,s]=t;return[e,i,s,i]}if(4===e)return t}if(c(t)){const{top:e=0,right:i=0,bottom:s=0,left:n=0}=t;return[e,i,s,n]}return[0,0,0,0]}(f),T=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let M,B=-S[3],C=-S[0],k=S[1]+S[3],P=S[0]+S[2],O=0,R=0;const{visible:L}=r,E=ub(r,["visible"]);if(a(L)){const t=(null==E?void 0:E.size)||10,e=y(t)?t:Math.max(t[0],t[1]);M=T.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},E),{visible:L,x:e/2,y:e/2}),"symbol"),w(null==v?void 0:v.shape)||(M.states=v.shape),L&&(R=e+u)}let I,D,F;if(k+=R,O+=R,lb({text:s})||"rich"===x){const t=Object.assign(Object.assign(Object.assign({},function(t){var e,i;return h(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}(Object.assign({type:x,text:s},n))),n),{visible:h(s)&&!1!==m,x:O,y:0});l(t.lineHeight)&&(t.lineHeight=n.fontSize),I=T.createOrUpdateChild("tag-text",t,"richtext"),D=I.AABBBounds.width(),F=I.AABBBounds.height()}else{const i=Object.assign(Object.assign({text:c(s)&&"type"in s&&"text"===s.type?s.text:s,visible:h(s)&&!1!==m,lineHeight:null==n?void 0:n.fontSize},n),{x:O,y:0});l(i.lineHeight)&&(i.lineHeight=n.fontSize),I=T.createOrUpdateChild("tag-text",i,"text");const r=function(t,e,i={}){if(!t)return{width:0,height:0};const s=zh({text:t,fontFamily:e.fontFamily||i.fontFamily||"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",fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:s.width(),height:s.height()}}(i.text,n,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text);D=r.width,F=r.height}k+=D;const U=null!==(i=r.size)&&void 0!==i?i:10,N=y(U)?U:Math.max(U[0],U[1]);P+=Math.max(F,r.visible?N:0);const{textAlign:W,textBaseline:z}=n;(h(d)||h(p))&&(h(d)&&k<d&&(k=d),h(p)&&k>p&&(k=p,I.setAttribute("maxLineWidth",p-S[1]-S[2]))),B=0,C=0;let G=0;"left"===W||"start"===W?G=1:"right"===W||"end"===W?G=-1:"center"===W&&(G=0),G?G<0?(B-=k,M&&M.setAttribute("x",(M.attribute.x||0)-D),T.setAttribute("x",-S[1]-R)):G>0&&T.setAttribute("x",S[3]):(B-=k/2,M&&M.setAttribute("x",(M.attribute.x||0)-D/2),T.setAttribute("x",-R/2));const V="right"===A||"end"===A,H="left"===A||"start"===A,X=(t,e)=>{"richtext"===I.type?I.setAttributes({x:t,textAlign:e,textConfig:j(I.attribute.textConfig).map((t=>Object.assign(Object.assign({},t),{textAlign:e})))}):I.setAttributes({x:t,textAlign:e})};if((A?"center"===A:_)&&G){const t=k-S[1]-S[3],e=D+R,i=1===G?(t-e)/2+R+D/2:S[0]+R-(k/2+e/2-R)+D/2;if(X(i,"center"),M){const t=i-D/2-R+N/2;M.setAttributes({x:t})}}if(H&&1!==G){const t=k-S[1]-S[3],e=0===G?-t/2+R/2:-k+S[3]+S[1]+R;if(X(e+R,"left"),M){const t=e+N/2;M.setAttributes({x:t})}}if(V&&-1!==G){const t=k-S[1]-S[3],e=0===G?t/2+R/2:t;if(X(e,"right"),M){const t=e-D-R+N/2;M.setAttributes({x:t})}}"middle"===z?(C-=P/2,M&&M.setAttribute("y",0)):"bottom"===z?(C-=P,M&&M.setAttribute("y",-F/2),T.setAttribute("y",-S[2])):"top"===z&&(T.setAttribute("y",S[0]),M&&M.setAttribute("y",F/2)),w(null==v?void 0:v.text)||(I.states=v.text);const{visible:$}=o,Y=ub(o,["visible"]);if(m&&a($)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},Y),{visible:$&&!!s,width:k,height:P,x:B,y:C}),"rect");if(w(null==v?void 0:v.panel)||(t.states=v.panel),Y.customShape){const e=Y.customShape;t.pathProxy=t=>e(this,t,new yn)}this._bgRect=t}this._textShape=I,this._symbol=M,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:O({},db.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,s,n,r,a,o,l,h,c,u,d,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(n=null===(s=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===s?void 0:s.slice())&&void 0!==n?n:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(c=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==c?c:[],this.clearStates(),null===(u=this._bgRect)||void 0===u||u.clearStates(),null===(d=this._symbol)||void 0===d||d.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function pb(){Lg(),Fg(),Ug(),Zg()}function gb(){Lg(),Fg(),kg(),Zg()}db.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}},pb();class fb extends ib{getStartAngle(){return Tt(this._startAngle)}getEndAngle(){return Tt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},fb.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!n)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(b(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(W(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var n,r;const a=Nh.line(Object.assign(Object.assign({points:t},g(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),w(null==s?void 0:s.line)||(a.states=g(s.line)?null!==(r=s.line[e])&&void 0!==r?r:s.line[s.line.length-1]:s.line),this.add(a),this.lines.push(a)}))}else{let t=Nh.line;j(i)[0].cornerRadius&&(t=Nh.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},j(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),w(null==s?void 0:s.line)||(e.states=[].concat(s.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:s=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:c=0,refY:u=0,refAngle:d=0,style:p,symbolType:g,size:f=12}=t;let m,y;"start"===i?(m={x:l.x+(b(r)?c*Math.cos(r)+u*Math.cos(r-Math.PI/2):0),y:l.y+(b(r)?c*Math.sin(r)+u*Math.sin(r-Math.PI/2):0)},y=this._computeStartRotate(this._startAngle)):(m={x:h.x+(b(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(b(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},y=this._computeEndRotate(this._endAngle)),n=Nh.symbol(Object.assign(Object.assign(Object.assign({},m),{symbolType:g,size:f,angle:s?y+d:0,strokeBoundsBuffer:0}),p)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),w(null==o?void 0:o.symbol)||(n.states=o.symbol),"start"===i?w(null==o?void 0:o.startSymbol)||(n.states=o.startSymbol):w(null==o?void 0:o.endSymbol)||(n.states=o.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let s;return s=e?b(i)?t[i]:W(t):t,this._mainSegmentPoints=s,s}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let s=t;if(e.visible){const i=e.clip?e.size||10:0;s=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...s.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,n={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};s=[...s.slice(0,s.length-1),n]}return s}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],s=t[t.length-2],n=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[n.x-s.x,n.y-s.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}fb.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},gb();class mb extends fb{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},fb.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!n)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},c={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,c];const u=this._renderSymbol(t,this._mainSegmentPoints,"start"),d=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=u,this.endSymbol=d;const p=Nh.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),w(null==s?void 0:s.line)||(p.states=[].concat(s.line)[0]),this.add(p),this.line=p}}var yb,bb,vb,xb;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(yb||(yb={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.topLeft="topLeft",t.topRight="topRight",t.bottomLeft="bottomLeft",t.bottomRight="bottomRight",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideTopLeft="insideTopLeft",t.insideTopRight="insideTopRight",t.insideBottomLeft="insideBottomLeft",t.insideBottomRight="insideBottomRight"}(bb||(bb={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(vb||(vb={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(xb||(xb={}));class _b extends ib{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=((t,e,i)=>{const s=t.target;return s!==i&&s.name&&!w(s.states)?(s.addState(sb.hover,!0),rb(e,(t=>{t!==s&&t.name&&!w(t.states)&&t.addState(sb.hoverReverse,!0)})),s):i})(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,i)=>i?(rb(e,(t=>{t.name&&!w(t.states)&&(t.removeState(sb.hoverReverse),t.removeState(sb.hover))})),null):i)(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,i)=>{const s=t.target;return i===s&&s.hasState(sb.selected)?(rb(e,(t=>{t.name&&!w(t.states)&&(t.removeState(sb.selectedReverse),t.removeState(sb.selected))})),null):s.name&&!w(s.states)?(s.addState(sb.selected,!0),rb(e,(t=>{t!==s&&t.name&&!w(t.states)&&t.addState(sb.selectedReverse,!0)})),s):i})(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const s=c(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:O({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:O({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:O({},this.defaultUpdateAnimation,s,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:s,select:n}=this.attribute;s&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),n&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;let n;if(s){const s=Nh.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));n=Nh.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),s.add(n),this._containerClip=s,this.add(s)}else n=Nh.group({x:0,y:0,pickable:!1}),this.add(n);n.name="marker-container",this._container=n}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:s?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:s?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}const Ab={type:"callIn",duration:500,easing:"linear",delay:0},Sb={type:"fadeOut",duration:500,easing:"linear",delay:0},Tb=.001;yb.end,vb.arcOuterMiddle,bb.right,vb.arcOuterMiddle;const wb={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};Lg(),cb(),Yf(),pb(),gb(),Zg(),Ig(),Fg(),Yf();class Mb extends _b{markerAnimate(t){Mb._animate&&this._animationConfig&&Mb._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:O({},Mb.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=Ab,this.defaultExitAnimation=Sb,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,s,n){return ob(Math.abs(s),Math.PI/2,Tb)||ob(Math.abs(s),3*Math.PI/2,Tb)?function(t,e,i){return t?{textAlign:"right",textBaseline:"middle"}:{textAlign:e<Math.PI&&i.toLocaleLowerCase().includes("top")||e>Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":e<Math.PI&&i.toLocaleLowerCase().includes("bottom")||e>Math.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:e<Math.PI&&i.includes("inside")||e>Math.PI&&!i.includes("inside")?"bottom":"top"}}(t,s,n):ab(s)?wb.postiveXAxis[n]:wb.negativeXAxis[n]}setItemAttributes(t,e,i,s,n){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:c=0,style:u,position:d=xb.middle}=e,{state:p}=this.attribute,g=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(g)+h*Math.cos(g-Math.PI/2),m=l*Math.sin(g)+h*Math.sin(g-Math.PI/2);if("text"===n){const n=s.x-i.x,r=s.y-i.y;t.setAttributes(Object.assign(Object.assign({},u),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,n,r,g,null!==(a=e.position)&&void 0!==a?a:"end")),u.textStyle),state:{panel:O({},nb,null==p?void 0:p.textBackground),text:O({},nb,null==p?void 0:p.itemContent)}}))}else("richText"===n||"image"===n)&&(t.setAttributes({dx:this.getItemDx(t,d,u)+(u.dx||0),dy:this.getItemDy(t,d,u)+(u.dy||0)}),t.states=O({},nb,null==p?void 0:p.itemContent));const y=ab(g)?g:g-Math.PI;t.setAttributes({x:s.x+(f||0),y:s.y+(m||0),angle:o&&y+c})}getItemDx(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==n?n:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==n?n:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,i){const{state:s}=this.attribute,{type:n="text",style:r,renderCustomCallback:a}=t;let o;return"symbol"===n?(o=Nh.symbol(Object.assign(Object.assign({},i),r)),o.states=O({},nb,null==s?void 0:s.itemContent)):"text"===n?o=new db(Object.assign(Object.assign({},i),{state:{panel:O({},nb,null==s?void 0:s.textBackground),text:O({},nb,null==s?void 0:s.itemContent)}})):"richText"===n?(o=Nh.richtext(Object.assign(Object.assign({},i),r)),o.states=O({},nb,null==s?void 0:s.itemContent)):"image"===n?(o=Nh.image(Object.assign(Object.assign({},i),r)),o.states=O({},nb,null==s?void 0:s.itemContent)):"custom"===n&&a&&(o=a(),o.states=O({},nb,null==s?void 0:s.itemContent)),o.name=`mark-point-${n}`,this.setItemAttributes(o,t,e,i,n),o}getItemLineAttr(t,e,i){let s=[],n={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,c=i.x-e.x,u=i.y-e.y;if(this._isStraightLine=ob(c,0,Tb)||ob(u,0,Tb),this._isArcLine){const{x:t,y:e}=this.attribute.position,{x:s,y:l}=i,c=(t+s)/2,u=c+h*(l>e?-1:1)*c,d=(e===l?0:-(t-s)/(e-l))*(u-c)+(e+l)/2;a=hb(e-d,t-u),o=hb(l-d,s-u),n={x:u,y:d};const p=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e)),g=this.attribute.targetSymbol.style.size/2;a+=2*Math.acos(Math.sqrt(1-g*g/(4*p*p))),h>0?o<a&&(o+=2*Math.PI):a<o&&(a+=2*Math.PI),r=Math.sqrt((u-t)*(u-t)+(d-e)*(d-e))}else s="type-do"!==l||this._isStraightLine?"type-po"!==l||this._isStraightLine?"type-op"!==l||this._isStraightLine?[e,i]:[e,{x:e.x,y:i.y},i]:[e,{x:i.x,y:e.y},i]:[e,{x:(e.x+i.x)/2,y:i.y},i];return s=function(t){const e=[t[0]];for(let i=1;i<t.length;i++)t[i].x===t[i-1].x&&t[i].y===t[i-1].y||e.push(t[i]);return e}(s),{points:s,center:n,radius:r,startAngle:a,endAngle:o}}reDrawLine(t,e){this._line.release();const{startSymbol:i,endSymbol:s,lineStyle:n,type:r="type-s"}=t,{state:a}=this.attribute,o=this._isArcLine?mb:fb;this._container.removeChild(this._line),this._line=new o(Object.assign(Object.assign({},e),{pickable:!1,startSymbol:i,endSymbol:s,lineStyle:n,visible:t.visible,state:{line:O({},nb,null==a?void 0:a.line),startSymbol:O({},nb,null==a?void 0:a.lineStartSymbol),endSymbol:O({},nb,null==a?void 0:a.lineEndSymbol)}})),this._container.add(this._line)}setItemLineAttr(t,e,i){if(this._line){const{startSymbol:s,endSymbol:n,lineStyle:r,type:a="type-s"}=t,{state:o}=this.attribute,l=this.getItemLineAttr(t,e,i);this._isArcLine&&"arc-segment"===this._line.key||!this._isArcLine&&"segment"===this._line.key?this._line.setAttributes(Object.assign(Object.assign({},l),{startSymbol:s,endSymbol:n,lineStyle:r,visible:t.visible,state:{line:O({},nb,null==o?void 0:o.line),startSymbol:O({},nb,null==o?void 0:o.lineStartSymbol),endSymbol:O({},nb,null==o?void 0:o.lineEndSymbol)}})):this.reDrawLine(t,l)}}getDecorativeLineAttr(t){var e;const i=(null===(e=null==t?void 0:t.decorativeLine)||void 0===e?void 0:e.length)||10,s=this._line.getEndAngle()||0;return{startPointOffsetX:i/2*Math.cos(s-Math.PI/2),startPointOffsetY:i/2*Math.sin(s-Math.PI/2),endPointOffsetX:-i/2*Math.cos(s-Math.PI/2),endPointOffsetY:-i/2*Math.sin(s-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var s;if(this._decorativeLine){const{lineStyle:n}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+o,y:e.y+l}]},n),{visible:i})),this._decorativeLine.states=O({},nb,null===(s=this.attribute.state)||void 0===s?void 0:s.line)}}setTargetItemAttributes(t,e){var i,s;this._targetItem&&(this._targetItem.setAttributes(Object.assign({x:e.x,y:e.y,visible:null!==(i=t.visible)&&void 0!==i&&i,size:t.size},t.style)),this._targetItem.states=O({},nb,null===(s=this.attribute.state)||void 0===s?void 0:s.targetItem))}setAllOfItemsAttr(t,e){var i;const{position:s,itemLine:n={},itemContent:r={},limitRect:a,targetSymbol:o}=this.attribute,{type:l="text",confine:h}=r;if(a&&h){const{x:t,y:i,width:s,height:n}=a,{dx:r,dy:o}=function(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds;let c=0,u=0;return a<i&&(c=i-a),o<s&&(u=s-o),l>n&&(c=n-l),h>r&&(u=r-h),{dx:c,dy:u}}(this._item,{x1:t,y1:i,x2:t+s,y2:i+n});e.x=e.x+r,e.y=e.y+o}this.setTargetItemAttributes(o,s),this.setItemLineAttr(n,t,e),this.setItemAttributes(this._item,r,t,e,l),this.setDecorativeLineAttr(n,e,null===(i=n.decorativeLine)||void 0===i?void 0:i.visible)}computeNewPositionAfterTargetItem(t){var e,i;const{itemContent:s={},targetSymbol:n,itemLine:r}=this.attribute,{offsetX:a=0,offsetY:o=0}=s,{offset:l=0,style:h,visible:c=!1,size:u}=n,d=c?null!==(i=null!==(e=h.size)&&void 0!==e?e:u)&&void 0!==i?i:20:0;let p;return p="type-do"===r.type?hb(o,a/2):"type-po"===r.type?hb(0,a):"type-op"===r.type?hb(o,0):hb(o,a),{newPosition:{x:t.x+(d/2+l)*Math.cos(p),y:t.y+(d/2+l)*Math.sin(p)},newItemPosition:{x:t.x+(d/2+l)*Math.cos(p)+a,y:t.y+(d/2+l)*Math.sin(p)+o}}}initMarker(t){const{position:e,itemContent:i={},itemLine:s}=this.attribute,{type:n="type-s",arcRatio:r=.8}=s,{offsetX:a=0,offsetY:o=0}=i;this._isStraightLine=ob(a,0,Tb)||ob(o,0,Tb),this._isArcLine="type-arc"===n&&0!==r&&!this._isStraightLine;const{newPosition:l,newItemPosition:h}=this.computeNewPositionAfterTargetItem(e),c=new(this._isArcLine?mb:fb)({points:[],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0});c.name="mark-point-line",this._line=c,t.add(c);const u=Nh.line({points:[]});u.name="mark-point-decorativeLine",this._decorativeLine=u,t.add(u);const d=Nh.symbol({});d.name="mark-point-targetItem",this._targetItem=d,t.add(this._targetItem);const p=this.initItem(i,l,h);this._item=p,t.add(p),this.setAllOfItemsAttr(l,h)}updateMarker(){const{position:t,itemContent:e={},itemLine:i}=this.attribute,{type:s="text"}=e,{type:n="type-s",arcRatio:r=.8}=i,{offsetX:a=0,offsetY:o=0}=e;this._isStraightLine=ob(a,0,Tb)||ob(o,0,Tb);const l="type-arc"===n&&0!==r&&!this._isStraightLine,{newPosition:h,newItemPosition:c}=this.computeNewPositionAfterTargetItem(t);l!==this._isArcLine?(this._isArcLine=l,this.reDrawLine(i,{points:[{x:0,y:0}],pickable:!1,center:{x:0,y:0},radius:0,startAngle:0,endAngle:0})):this._isArcLine=l,this.setItemAttributes(this._item,e,h,c,s),this.setAllOfItemsAttr(h,c)}isValidPoints(){const{position:t}=this.attribute;return!(!b(t.x)||!b(t.y))}}Mb.defaultAttributes={interactive:!0,targetSymbol:{visible:!1,offset:0,style:{symbolType:"circle",size:20,fill:!1,stroke:"rgba(46, 47, 50)"}},itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10}};const Bb="seriesBreak";function Cb(t,e,i,s,n=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,c=n?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),u=Math.PI/180*s,d=i*Math.cos(u),p=i*Math.sin(u);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=n?a+(t%2==0?d:-d):a+t*i*2,s=n?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${s}`)}return r.push(`L ${n?a:l} ${n?h:o}`),r.join(" ")}const kb=(t,e)=>{const{start:i,end:s}=e,n=i.x===s.x,r=n?"x":"y",a=n?"y":"x";let o=!0;const l=1e-6;t.length&&t.forEach((t=>{if(function(t,e,i=1e-10,s=1e-10){const n=s,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}(t.start[r],i[r])){const e=Math.min(i[a],s[a]),n=Math.max(i[a],s[a]),r=Math.min(t.start[a],t.end[a]),h=Math.max(t.start[a],t.end[a]);if(!(n<r-l||e>h+l))return t.start[a]=Math.min(r,e),t.end[a]=Math.max(h,n),void(o=!1)}})),o&&t.push(e)};class Pb extends ib{constructor(){super(...arguments),this.name=Bb}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(w(t))return;const e=[],i=[];t.forEach((t=>{const{start:s,end:n}=t,r=s.x===n.x;kb(r?e:i,t)})),[...e,...i].forEach(((t,e)=>{var i;const{start:s,end:n,size:r=4,gap:a=5,style:o={}}=t,l=Ve(t,["start","end","size","gap","style"]),c=Sl({}),u=s.x===n.x;let d,p,g,f;u?(d={x:s.x-a/2,y:s.y},p={x:n.x-a/2,y:n.y},g={x:s.x+a/2,y:s.y},f={x:n.x+a/2,y:n.y}):(d={x:s.x,y:s.y-a/2},p={x:n.x,y:n.y-a/2},g={x:s.x,y:s.y+a/2},f={x:n.x,y:n.y+a/2});const m=Cb(d,p,r,u?75:15,u),y=Cb(s,n,r,u?75:15,u),b=Cb(g,f,r,u?75:15,u);c.add(wh(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},o),{pickable:!1,zIndex:1}))),c.add(wh({path:y,stroke:"#fff",lineWidth:a,pickable:!1,zIndex:0})),c.name="series-break",c.data=l,h(l.axisId)&&(c.id=`${null!==(i=l.axisId)&&void 0!==i?i:""}_${e}`),this.add(c)}))}}function Ob(t,e,i=1){return Math.abs(t-e)<i}function Rb(t,e){return{type:"component",componentType:Bb,interactive:!0,zIndex:500,style:{data:(i,s)=>{const n=[],r=s.vchart.getChart(),a="horizontal"===r.getAllSeries()[0].direction;return t.forEach(((t,i)=>{var s,o;const l=t.id,c=h(l)?r.getComponentByUserId(l):e&&h(e[i])?r.getComponentByIndex("axes",e[i]):null===(s=r.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===s?void 0:s[0];if(!c)return;const u=null!=l?l:`${c.type}-${c.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}return{x1:e,y1:i,x2:s,y2:n}}(c.getRegions());j(null===(o=c._break)||void 0===o?void 0:o.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:s=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(o+l)/2+(a?d.x1:d.y1);r.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const r=t.AABBBounds;let c,p,g,f,m=!1;a?(m=r.x1<(o+l-s)/2&&r.x2>(o+l+s)/2,c=h,p=Math.max(r.y1+d.y1-2,d.y1),g=h,f=Math.min(r.y2+d.y1+2,d.y2)):(m=r.y1<(o+l-s)/2&&r.y2>(o+l+s)/2,c=Math.max(r.x1+d.x1-2,d.x1),p=h,g=Math.min(r.x2+d.x1+2,d.x2),f=h),m&&n.push({start:{x:c,y:p},end:{x:g,y:f},gap:s,style:null==i?void 0:i.style,axisId:u,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{Eb(t,"line").forEach((t=>{Lb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t).forEach((t=>{let r,o;a?(r={x:h,y:Math.max(t[1]+d.y1-10,d.y1)},o={x:h,y:Math.min(t[1]+d.y1+10,d.y2)}):(r={x:Math.max(t[0]+d.x1-10,d.x1),y:h},o={x:Math.min(t[0]+d.x1+10,d.x2),y:h}),n.push({start:r,end:o,gap:s,style:null==i?void 0:i.style,axisId:u,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{Eb(t,"area").forEach((t=>{const r=Lb(a?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(o+l)/2},end:{x:d.x2-d.x1,y:(o+l)/2}},t);r.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<r.length-1;o++){const l={x:r[o][0],y:r[o][1]},h={x:r[o+1][0],y:r[o+1][1]};if(Ib(a?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,r;a?(t={x:l.x+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},r={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},r={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),n.push({start:t,end:r,gap:s,style:null==i?void 0:i.style,axisId:u,data:e})}}}))}))}}))}))})),n}}}}function Lb(t,e){const i=[];for(let s=1;s<e.length;s++){const n=Mt([t.start.x,t.start.y],[t.end.x,t.end.y],[e[s].x,e[s].y],[e[s-1].x,e[s-1].y]);n&&!i.find((t=>Ob(vt.distancePP({x:t[0],y:t[1]},{x:n[0],y:n[1]}),0)))&&i.push(n)}return i}function Eb(t,e){const{points:i,segments:s}=t.attribute,n=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var s,a;if(!1===t.defined){if(n.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(s=t.x1)&&void 0!==s?s:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}n.push(r)}};return i&&i.length?a(i):s&&s.length&&s.forEach((t=>{a(t.points)})),n}function Ib(t,e){const{x:i,y:s}=t;let n=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>s!=h>s&&i<(l-a)*(s-o)/(h-o)+a&&(n=!n)}return n}const Db="barLink";class Fb extends ib{constructor(){super(...arguments),this.name=Db}render(){const{data:t,linkStyle:i,areaStyle:s,styleMap:n,label:r,linkType:a="total"}=this.attribute;w(t)||(this.removeAllChild(),t.forEach(((t,o)=>{var l,h,c,u,d;const{linePoints:p,areaPoints:g,id:f=o,color:m,data:y}=t;if(g&&!1!==(null===(l=null==n?void 0:n[`area-${f}`])||void 0===l?void 0:l.visible)){const t=(b=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:m,zIndex:0},s),null==n?void 0:n[`area-${f}`]),new Bh(b));t.name="bar-link-area",t.id=`area-${f}`,this.add(t)}var b;if(p&&!1!==(null===(h=null==n?void 0:n[`line-${f}`])||void 0===h?void 0:h.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==n?void 0:n[`line-${f}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:s}=i||{},r=B(t),a=B(e);(null==n?void 0:n[`line-${f}`])&&n[`line-${f}`].stroke&&(r.style=Object.assign(Object.assign({},r.style),{color:n[`line-${f}`].stroke}),a.style=Object.assign(Object.assign({},a.style),{color:n[`line-${f}`].stroke})),r.symbolType||r.originSymbolType||(r.originSymbolType="solidArrow"),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow");const o=new fb({points:p,startSymbol:Object.assign({size:8},r),endSymbol:Object.assign({size:8},a),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},s),null==n?void 0:n[`line-${f}`]),pickable:!0,childrenPickable:!1,zIndex:1});o.name="bar-link-line",o.id=`line-${f}`,this.add(o)}if((null==r?void 0:r.visible)&&!1!==(null===(d=null==n?void 0:n[`label-${f}`])||void 0===d?void 0:d.visible)){const{style:t,formatMethod:i}=r,[s,o]=y;let l=s[e.STACK_FIELD_END],h=o[e.STACK_FIELD_END];"value"===a&&(l=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START],h=o[e.STACK_FIELD_END]-o[e.STACK_FIELD_START]);const c=h-l,u=(h-l)/l*100,d=Zl(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,y):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==n?void 0:n[`label-${f}`]));d.name="bar-link-label",d.id=`label-${f}`,this.add(d)}})))}}function jb(t,i,s){const{isHorizontal:n,isXAxisInverse:r,isYAxisInverse:a,linkType:o,doFill:l,regionStartX:h,regionStartY:c}=s,u=t.AABBBounds,d=i.AABBBounds;let p,g;return n?(p=[{x:(u.x1+u.x2)/2+h,y:u.y1+c},{x:(d.x1+d.x2)/2+h,y:d.y2+c}],r?("total"===o&&(p=[{x:u.x1+h,y:u.y1+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x1+h,x1:u.x2+h,y:u.y1+c},{x:d.x1+h,x1:d.x2+h,y:d.y2+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x2+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,x1:u.x1+h,y:u.y1+c},{x:d.x2+h,x1:d.x1+h,y:d.y2+c}]))):(p=[{x:u.x2+h,y:(u.y1+u.y2)/2+c},{x:d.x1+h,y:(d.y1+d.y2)/2+c}],a?("total"===o&&(p=[{x:u.x2+h,y:u.y2+c},{x:d.x1+h,y:d.y2+c}]),l&&(g=[{x:u.x2+h,y:u.y2+c,y1:u.y1+c},{x:d.x1+h,y:d.y2+c,y1:d.y1+c}])):("total"===o&&(p=[{x:u.x2+h,y:u.y1+c},{x:d.x1+h,y:d.y1+c}]),l&&(g=[{x:u.x2+h,y:u.y1+c,y1:u.y2+c},{x:d.x1+h,y:d.y1+c,y1:d.y2+c}]))),{areaPoints:g,linePoints:p,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function Ub(t={},i){const{linkType:s="total",doFill:n}=t,r=Ve(t,["linkType","doFill"]);return{type:"component",componentType:Db,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),o=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e;(null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getGraphics()).forEach((t=>{l.push(t)}))}));const h=function(t,i){const s={};for(let n=0;n<t.length;n++){const r=t[n],a=e.getDatumOfGraphic(r),o=i.map((t=>a[t])).join("-");s[o]||(s[o]=[]),s[o].push(r)}return s}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>e.getDatumOfGraphic(t)[e.STACK_FIELD_END]-e.getDatumOfGraphic(i)[e.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,d=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(u){g[0][0].AABBBounds.y1<g[g.length-1][0].AABBBounds.y1&&g.reverse()}else{g[0][0].AABBBounds.x1>g[g.length-1][0].AABBBounds.x1&&g.reverse()}for(let t=0;t<g.length-1;t++){const e=g[t],i=g[t+1];if(e.forEach(((t,e)=>{var l;const h=jb(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:n,linkType:s,regionStartX:r,regionStartY:a});o.push(h)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=jb(t,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:d,doFill:n,linkType:s,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:s},r),i)}}const Nb="seriesLabel";function Wb(t,e=10,i=10,s=.1){const n=t.length;if(!t.every(isFinite))return t;if(!(n>1))return t;const r=function(t,e,i){t=+t,e=+e;let s=arguments.length;i=s<2?(e=t,t=0,1):s<3?1:+i;let n=-1;s=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(s);for(;++n<s;)r[n]=t+n*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return s=t[e],n=t[i],null==s||null==n?NaN:s<n?-1:s>n?1:s>=n?0:NaN;var s,n}));let i=0;for(let s=1;s<n;++s){let n=t[r[s]]-t[r[s-1]];n<e&&(n=(e-n)/2,i=Math.max(i,n),t[r[s-1]]-=n,t[r[s]]+=n)}if(i<s)break}return t}function zb(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Gb(t,e=10,i=10){const s=t.length;let n,r=0;do{n=!1;for(let i=0;i<s;++i)for(let r=i+1;r<s;++r){const s=t[i].AABBBounds,a=t[r].AABBBounds;if(zb(s,a)){const i=e-(a.x1-s.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,n=!0)}}r++}while(n&&r<i)}function Vb(t,e){const{label:i,line:s}=e;return{type:"component",componentType:Nb,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(e,i)=>{var s;const n=i.vchart.getChart(),r=n.getAllSeries()[0],a="horizontal"===r.direction,o=a?r.getYAxisHelper():r.getXAxisHelper(),l=null===(s=o.getScale)||void 0===s?void 0:s.call(o,0),h=o.isInverse(),c=r.getDimensionField()[0],u=r.getSeriesField(),d=n.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===d.length&&["bar","area","line","waterfall"].includes(d[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?function(t){if(f(t))return t[t.length-1]}(l.domain()):l.domain()[0],i=r.getRegion(),{x:s,y:o}=i.getLayoutStartPoint();let g=0;n.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===d[0]?"bar":d[0]).getGraphics().forEach((n=>{var r;const l=n.context.data.find((t=>t[c]===e));if(l){const e=n.AABBBounds;let f,m,y,b;"bar"===d[0]||"waterfall"===d[0]?(f="end"===t?{x:a?(e.x1+e.x2)/2:h?e.x1:e.x2,y:a?h?e.y2:e.y1:(e.y1+e.y2)/2}:{x:a?(e.x1+e.x2)/2:h?e.x2:e.x1,y:a?h?e.y1:e.y2:(e.y1+e.y2)/2},m=n.attribute.fill):(f=i.dataToPosition(l),m=n.attribute.stroke||n.attribute.fill),"end"===t?(y=a?"center":h?"end":"start",b=a?h?"top":"bottom":"middle"):(y=a?"center":h?"start":"end",b=a?h?"bottom":"top":"middle");const v=null!==(r=l[u])&&void 0!==r?r:l[c];p.push({point:{x:f.x+s,y:f.y+o},label:v,color:m,textAlign:y,textBaseline:b,series:i,datum:l,id:`${t}-${g}`,position:t}),g++}}))}))}))}return p},line:s,label:Object.assign({space:12},i)}}}class Hb extends ib{constructor(){super(...arguments),this.name=Nb}render(){var t,e,i,s;this.removeAllChild();const{data:n,layout:r,label:a,line:o={}}=this.attribute;if(w(n))return;const l=null!==(t=null==a?void 0:a.styleMap)&&void 0!==t?t:{},h={},c=n.filter((t=>{var e;return!1!==(null===(e=l[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===r){const t=1.5*(null!==(i=null===(e=null==a?void 0:a.style)||void 0===e?void 0:e.fontSize)&&void 0!==i?i:12),s=(t,e,i)=>{var s,n,r,a,o,l,h,c;const{label:u,color:d,textAlign:p,textBaseline:g,id:f}=t,m=null!==(n=null===(s=i[f])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(u,t.datum,{series:t.series}):u},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:g,fill:null!==(h=null===(l=null===(o=this.attribute.label)||void 0===o?void 0:o.style)||void 0===l?void 0:l.fill)&&void 0!==h?h:d}),null===(c=i[f])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const i=c.filter((t=>t.position===e)),n=Wb(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==a?void 0:a.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:n[e]};s(t,r,l),h[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var s,n,r,o,h;const{point:c,label:u,color:d,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:c.x,y:c.y},b=null!==(n=null===(s=l[f])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null==a?void 0:a.formatMethod,v=Zl(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(u,i.datum,{series:i.series}):u},null==a?void 0:a.style),y),{textAlign:p,textBaseline:g,fill:null!==(o=null===(r=null==a?void 0:a.style)||void 0===r?void 0:r.fill)&&void 0!==o?o:d}),null===(h=l[f])||void 0===h?void 0:h.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&Gb(t,4,10),e.length&&Gb(e,4,10);const i=null!==(s=null==a?void 0:a.space)&&void 0!==s?s:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),h[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==o.visible&&c.forEach((t=>{var e,i,s,n,a,c;const{point:u,color:d,id:p}=t,g={x:h[p].x+(null!==(s=null===(i=null===(e=l[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==s?s:0),y:h[p].y+(null!==(c=null===(a=null===(n=l[p])||void 0===n?void 0:n.style)||void 0===a?void 0:a.dy)&&void 0!==c?c:0)};if(!1!==o.autoVisible){if("vertical"===r&&u.y!==g.y||"horizontal"===r&&u.x!==g.x){const t=sh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}else{const t=sh(Object.assign({points:[u,g],lineWidth:1,stroke:d},o.style));t.name="series-label-line",this.add(t)}}))}}function Xb(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function $b(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function Yb(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:$b(t.rect),anchorCandidates:tv(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>Xb(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<n.anchorCandidates.length;t++){const e=n.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!s.some((t=>Xb(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function qb(t,e,i){const s=t.map((t=>t.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=Dt(s),l=i([(n+r)/2,(a+o)/2]);if(!l)return[];const h=t.map((t=>{const s=t.rect,n=Jb(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=de(r,s,i);if(!Jb(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],Kb(Zb(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=Kb(Zb(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=Qb(t.rect,a,0),t}));return Yb(h)}function Kb(t){return t>180?t-360:t}function Zb(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function Jb(t,e){for(let i=0;i<t.length;i++){if(ue(e,t[i]))return!0}return!1}function Qb(t,e,i=0){const s=Object.assign({},t);return"top"===e?(s.x-=t.width/2,s.y-=i+t.height/2):"bottom"===e?(s.x-=t.width/2,s.y+=i-t.height/2):"left"===e?(s.x-=i+t.width,s.y-=t.height/2):"right"===e&&(s.x+=i,s.y-=t.height/2),s}function tv(t,e,i,s=0){const n=[];return t.forEach((t=>{const{x:r,y:a}=Qb(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}const ev={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class iv extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return ev}}class sv extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=iv,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&h(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new Ge(this._option.dataSet,{name:`${this.name}_data`});t.parse([i],{type:"dataview"}),t.transform({type:"copyDataView",level:e.TransformLevel.copyDataView},!1),this._data=new e.CompilableData(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const s=new Mb({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s})));this._markerComponents.forEach(((t,s)=>{const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,i){var s,n,r,a,o,l,c,u,d,p,g,f,m,y;let b=0,v=0,x=0,_=0,A=0;const S=this._spec.position||"top",T=this._spec.offset,w=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),M=this._spec.space||0;v+=((null==w?void 0:w.left)||0)+((null==w?void 0:w.right)||0),x+=((null==w?void 0:w.top)||0)+((null==w?void 0:w.bottom)||0);const B={},C=this.dataToPosition(t),k=Nh.group({});if(k.name=`${this.name}_marker_itemContainer_${i}`,B.container=k,null===(n=this._spec.background)||void 0===n?void 0:n.visible){const t=Nh.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),B.labelBackground=t,k.appendChild(t)}if(null===(r=this._spec.icon)||void 0===r?void 0:r.visible){const t=Nh.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(o=null===(a=this._spec.icon.style)||void 0===a?void 0:a.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=t.AABBBounds,s=null!==(c=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==c?c:0,n=null!==(u=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==u?u:0;B.icon=t,k.appendChild(t),A=s,_+=n,b++}if(null===(d=this._spec.nameLabel)||void 0===d?void 0:d.visible){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const s=i.AABBBounds,n=null!==(p=(null==s?void 0:s.y2)-(null==s?void 0:s.y1))&&void 0!==p?p:0,r=null!==(g=(null==s?void 0:s.x2)-(null==s?void 0:s.x1))&&void 0!==g?g:0;B.nameLabel=i,k.appendChild(i),A=Math.max(A,n),_+=r,b++}if((null===(f=this._spec.valueLabel)||void 0===f?void 0:f.visible)&&h(t[this.valueField])){const i=Nh.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const s=i.AABBBounds,n=null!==(m=(null==s?void 0:s.y2)-(null==s?void 0:s.y1))&&void 0!==m?m:0,r=null!==(y=(null==s?void 0:s.x2)-(null==s?void 0:s.x1))&&void 0!==y?y:0;B.valueLabel=i,k.appendChild(i),A=Math.max(A,n),_+=r,b++}const P=Object.values(B).find((t=>!!t&&"group"!==t.type)),O={x:null==P?void 0:P.getComputedAttribute("x"),y:null==P?void 0:P.getComputedAttribute("y")},R={x:O.x,y:O.y,width:0,height:0};R.width=v+_+(b-1)*M,R.height=x+A;const L={rect:R,point:O,index:i};if("outer"!==S){const t=["top","right","left","bottom"].filter((t=>t!==S));L.rect=Qb(R,S,T),L.anchors=t,L.offset=T}else L.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:L,contentMarks:B}}_layoutMarkers(t,i){var s,n,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:o,nameLabel:l,valueLabel:h,labelBackground:c,container:u}=i[a],d=t[a],p=e.normalizeLayoutPaddingSpec(null===(s=this._spec.background)||void 0===s?void 0:s.padding),g=this._spec.space||0,f=d.height/2;let m=(null==p?void 0:p.left)||0;[o,l,h].forEach(((t,e)=>{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:f}),m+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(m+=g)}})),null==c||c.setAttributes({x:0,y:0,width:d.width,height:d.height}),null==u||u.setAttributes({dx:-d.width/2,dy:-d.height/2});const y=this._data.getLatestData()[a],b=this.dataToPosition(y),v=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(n=this._spec.leader)||void 0===n?void 0:n.visible)||!(o||l||h));this._markerComponents[a].setAttributes({x:v.x,y:v.y,position:b,visible:this._activeDatum.includes(y),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:d.x+d.width/2-b.x,offsetY:d.y+d.height/2-b.y},itemLine:{visible:x,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?qb(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):Yb(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}sv.type="mapLabel",sv.specKey="mapLabel",sv.transformerConstructor=iv;t.BAR_LINK=Db,t.Bar3dChart=of,t.Bar3dChartSpecTransformer=yi,t.Bar3dSeries=sf,t.Bar3dSeriesSpecTransformer=sd,t.BarLinkComponent=Fb,t.CandlestickChart=tb,t.CandlestickChartSpecTransformer=zy,t.ConversionFunnelChart=si,t.ConversionFunnelSeries=ni,t.DefaultBandWidth=6,t.Funnel3dChart=gf,t.Funnel3dSeries=df,t.Funnel3dSeriesSpecTransformer=hf,t.Histogram3dChart=ff,t.ImageCloudChart=Wy,t.MapLabelComponent=sv,t.PictogramChart=Fm,t.PictogramChartSpecTransformer=mm,t.PictogramSeries=Im,t.Pie3dChart=Af,t.Pie3dChartSpecTransformer=mf,t.Pie3dSeries=xf,t.Pie3dSeriesSpecTransformer=vf,t.RangeColumn3dChart=um,t.RangeColumn3dChartSpecTransformer=cm,t.RangeColumn3dSeries=om,t.RangeColumn3dSeriesSpecTransformer=hm,t.RankingBar=me,t.RankingList=Te,t.SERIES_BREAK=Bb,t.SequenceScatterKDE=di,t.SequenceScatterLink=oi,t.SequenceScatterPixel=mi,t.SeriesBreakComponent=Pb,t.SeriesLabelComponent=Hb,t.WordCloud3dChart=im,t.WordCloud3dChartSpecTransformer=em,t.WordCloud3dSeries=Jf,t.appendBarLinkConfig=function(t,e){t.customMark=j(t.customMark).filter((t=>t.componentType!==Db)),t.customMark.push(Ub(e))},t.appendSeriesBreakConfig=t=>{var e;if(null===(e=t.axes)||void 0===e?void 0:e.length){const e=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(e.length)return t.customMark=j(t.customMark).filter((t=>t.componentType!==Bb)),t.customMark.push(Rb(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var i,s,n;if(t.customMark=j(t.customMark).filter((t=>t.componentType!==Nb)),e||(e=null!==(n=null!==(i=M(t,Nb))&&void 0!==i?i:M(null===(s=t.series)||void 0===s?void 0:s[0],Nb))&&void 0!==n?n:{}),e.visible){const{position:i="end"}=e,s=Ve(e,["position"]);t.customMark.push(Vb(i,s))}},t.clearSVGSource=function(){ym.clear(),bm=null},t.getBarLinkConfig=Ub,t.getSVGSource=_m,t.getSeriesBreakConfig=Rb,t.getSeriesLabelConfig=Vb,t.register3DPlugin=ed,t.registerAxis3dPlugin=()=>{ed(),af(),(()=>{e.registerCartesianBandAxis();const t=e.Factory.getComponentInKey(e.CartesianBandAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianLinearAxis();const t=e.Factory.getComponentInKey(e.CartesianLinearAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianTimeAxis();const t=e.Factory.getComponentInKey(e.CartesianTimeAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianSymlogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),nm)}),F(t,rm)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianLogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),nm)}),F(t,rm)})()},t.registerBar3dChart=()=>{ed(),af(),nf(),e.Factory.registerChart(of.type,of)},t.registerBar3dSeries=nf,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(Db,(t=>new Fb(t)))},t.registerCandlestickChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Qy(),e.Factory.registerChart(tb.type,tb)},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([si]),i.useSeries([ni]))},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),pf(),e.Factory.registerChart(gf.type,gf)},t.registerFunnel3dSeries=pf,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),nf(),e.Factory.registerChart(ff.type,ff)},t.registerImageCloudChart=()=>{Ny(),e.Factory.registerChart(Wy.type,Wy)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([sv])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Dm(),e.Factory.registerChart(Fm.type,Fm)},t.registerPictogramSeries=Dm,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),ed(),af(),_f(),e.Factory.registerChart(Af.type,Af)},t.registerPie3dSeries=_f,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),ed(),af(),lm(),e.Factory.registerChart(um.type,um)},t.registerRangeColumn3dSeries=lm,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([me])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([Te,e.BarChart])},t.registerSVGSource=vm,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([di,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([oi,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([mi,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new Pb(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new Hb(t)))},t.registerWordCloud3dChart=sm,t.registerWordCloud3dSeries=Qf,t.registerWordCloudShape3dChart=()=>{ed(),tm(),sm()},t.registerWordCloudShape3dSeries=tm,t.svgSourceMap=ym,t.unregisterSVGSource=xm}));