@visactor/vchart-extension 1.15.5-alpha.8 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +143 -814
- package/build/index.min.js +2 -2
- package/cjs/charts/conversion-funnel/conversion-funnel.js +3 -2
- package/cjs/charts/conversion-funnel/conversion-funnel.js.map +1 -1
- package/cjs/components/bar-link/index.js +1 -2
- package/cjs/components/series-break/series-break.js +2 -2
- package/cjs/components/series-break/series-break.js.map +1 -1
- package/cjs/components/series-break/util.js +6 -6
- package/cjs/components/series-break/util.js.map +1 -1
- package/cjs/components/series-label/type.js +2 -1
- package/cjs/index.d.ts +0 -1
- package/cjs/index.js +3 -3
- package/cjs/index.js.map +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel.js +4 -3
- package/esm/charts/conversion-funnel/conversion-funnel.js.map +1 -1
- package/esm/components/bar-link/index.js +1 -2
- package/esm/components/series-break/series-break.js +2 -2
- package/esm/components/series-break/series-break.js.map +1 -1
- package/esm/components/series-break/util.js +6 -6
- package/esm/components/series-break/util.js.map +1 -1
- package/esm/components/series-label/type.js +2 -1
- package/esm/index.d.ts +0 -1
- package/esm/index.js +0 -2
- package/esm/index.js.map +1 -1
- package/package.json +10 -11
- package/cjs/charts/ranking-list/constant.d.ts +0 -2
- package/cjs/charts/ranking-list/constant.js +0 -74
- package/cjs/charts/ranking-list/constant.js.map +0 -1
- package/cjs/charts/ranking-list/interface.d.ts +0 -73
- package/cjs/charts/ranking-list/interface.js +0 -6
- package/cjs/charts/ranking-list/interface.js.map +0 -1
- package/cjs/charts/ranking-list/ranking-list-transformer.d.ts +0 -458
- package/cjs/charts/ranking-list/ranking-list-transformer.js +0 -376
- package/cjs/charts/ranking-list/ranking-list-transformer.js.map +0 -1
- package/cjs/charts/ranking-list/ranking-list.d.ts +0 -16
- package/cjs/charts/ranking-list/ranking-list.js +0 -34
- package/cjs/charts/ranking-list/ranking-list.js.map +0 -1
- package/cjs/charts/ranking-list/utils.d.ts +0 -7
- package/cjs/charts/ranking-list/utils.js +0 -51
- package/cjs/charts/ranking-list/utils.js.map +0 -1
- package/esm/charts/ranking-list/constant.d.ts +0 -2
- package/esm/charts/ranking-list/constant.js +0 -70
- package/esm/charts/ranking-list/constant.js.map +0 -1
- package/esm/charts/ranking-list/interface.d.ts +0 -73
- package/esm/charts/ranking-list/interface.js +0 -2
- package/esm/charts/ranking-list/interface.js.map +0 -1
- package/esm/charts/ranking-list/ranking-list-transformer.d.ts +0 -458
- package/esm/charts/ranking-list/ranking-list-transformer.js +0 -376
- package/esm/charts/ranking-list/ranking-list-transformer.js.map +0 -1
- package/esm/charts/ranking-list/ranking-list.d.ts +0 -16
- package/esm/charts/ranking-list/ranking-list.js +0 -27
- package/esm/charts/ranking-list/ranking-list.js.map +0 -1
- package/esm/charts/ranking-list/utils.d.ts +0 -7
- package/esm/charts/ranking-list/utils.js +0 -41
- package/esm/charts/ranking-list/utils.js.map +0 -1
package/build/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart,t.VUtils)}(this,(function(t,e,i){"use strict";class n extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:n}=function(t){const{xField:e,yField:n,timeField:s,data:r,topN:a=10,icon:o}=t,l=new Set,h=new Map;return r.sort(((t,i)=>Number(i[e])-Number(t[e]))),r.forEach((t=>{const e=t[s];i.isValid(e)&&l.add(e),h.has(e)||h.set(e,[]);const r=h.get(e);if(r.length<a){const e=Object.assign({},t);o&&o[e[n]]&&(e.icon=o[e[n]]),r.push(e)}})),{timeData:h,timeNodes:Array.from(l).sort()}}(t),{interval:a,xField:o,yField:l,color:h,icon:d,iconPosition:c,iconShape:u,timeLabel:p,label:g,nameLabel:f,xAxis:m,yAxis:y}=t,b=a||1e3,v=Math.min(b,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(n[0])},{id:"time",values:[{time:n[0]}]}],t.color={specified:Object.assign({},h)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:o,seriesField:l,extensionMark:[],label:s(g,Object.assign(Object.assign({},f),{yField:l}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},n={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(n.label=t.label);return[i,n]}(m,y),t.player={type:"continuous",auto:!0,loop:!1,interval:b,specs:n.map((t=>({data:[{id:"timeData",values:e.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:b,exchangeDuration:v}),p&&!1===p.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(p.style)),d){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,s;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(s=a.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const s=e.vchart,r=null===(i=s.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(s&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:r(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(c,u,{interval:b,exchangeDuration:v});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function s(t={},e){var i,n,s,r;const a=[];return!1!==t.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(s=e.style)||void 0===s?void 0:s.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function r(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class a extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=n}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,timeField:a,data:o}=this._spec;return s&&r&&a?!!o||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}a.type="rankingBar",a.view="singleDefault",a.transformerConstructor=n;const o={width:400,height:225,labelLayout:"top",bar:{height:100,style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(255,255,255,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:"rgba(253,253,253,0.5)",size:12}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:"rgba(255,255,255,0.7)",textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:"rgba(255,255,255,0.7)",textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:14,fontWeight:"normal",fill:"rgba(255,255,255,1)",textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:1e3,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:1e3,easing:"linear"},animationNormal:{interval:1e3}},l="dataKey",h="VCHART_ORDER",d="SUPPLY_DATA_KEY";class c extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,s={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,s[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[d]:!0}))));break}return{orderCount:r,result:s}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[h]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const s=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:s},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[d]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[l]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}transformSpec(t){super.transformSpec(t),this.normalizeSpec(t),this.upgradeTextMeasure(t),this.upgradeFormatMap(t),this.processData(t),this.transformBaseSpec(t),this.transformAnimationSpec(t),this.transformAxesSpec(t),t.extensionMark=[this.generateBarBackground(t),...this.generateDecorateHaloIcons(t),this.generateRankingIcon(t),this.generateNameLabel(t),this.generateOrderLabel(t),this.generateValueLabel(t)],this.transformPaddingSpec(t),super.transformSpec(t)}normalizeSpec(t){(function t(e,i){for(const n in i)"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,o),((t,e)=>{e.forEach((e=>{var n,s,r,a,o,l;i.isArray(t[e])?t[e].forEach(((i,n)=>{var s,r,a;t[e][n]=Object.assign(Object.assign({},i),{style:Object.assign(Object.assign({},null==i?void 0:i.style),{visible:null===(a=null!==(r=null===(s=null==i?void 0:i.style)||void 0===s?void 0:s.visible)&&void 0!==r?r:null==i?void 0:i.visible)||void 0===a||a})})})):t[e]=Object.assign(Object.assign({},t[e]),{style:Object.assign(Object.assign({},null===(n=t[e])||void 0===n?void 0:n.style),{visible:null===(l=null!==(a=null===(r=null===(s=t[e])||void 0===s?void 0:s.style)||void 0===r?void 0:r.visible)&&void 0!==a?a:null===(o=t[e])||void 0===o?void 0:o.visible)||void 0===l||l})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var e,n,s,r,a,o,l,h,d;null===(e=this.nameLabelTextMeasure)||void 0===e||e.release(),null===(n=this.valueLabelTextMeasure)||void 0===n||n.release(),null===(s=this.orderLabelTextMeasure)||void 0===s||s.release(),this.nameLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(a=null===(r=t.nameLabel)||void 0===r?void 0:r.style)&&void 0!==a?a:{}}),this.valueLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(l=null===(o=t.valueLabel)||void 0===o?void 0:o.style)&&void 0!==l?l:{}}),this.orderLabelTextMeasure=new i.TextMeasure({defaultFontParams:null!==(d=null===(h=t.orderLabel)||void 0===h?void 0:h.style)&&void 0!==d?d:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[h]=t.orderLabel.formatMethod}processData(t){var e;(null===(e=t.data[0])||void 0===e?void 0:e.values)||(this.originalData=t.data,this.originalSpec=i.cloneDeep(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=l,t.series=[{type:"bar",direction:"horizontal",xField:t.xField,yField:t.yField,barWidth:null!==(i=null===(e=t.bar)||void 0===e?void 0:e.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},t.bar),{style:Object.assign(Object.assign({},null===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[d]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;t.animationUpdate.enable&&this.orderCount>1&&(t.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(e=t.animationNormal)||void 0===e?void 0:e.interval)&&void 0!==i?i:1e3)+(null!==(n=t.animationUpdate.duration)&&void 0!==n?n:1e3)/2,loop:!0},t.player),t.animationExit=this.getAnimationExit(this.originalSpec),t.animationEnter=this.getAnimationEnter(this.originalSpec),t.animationUpdate=this.getAnimationUpdate(this.originalSpec)),t.animationNormal=this.originalSpec.animationNormal,t.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(t){const{min:e,max:i}=((t,e)=>{let i,n;const s=t.map((t=>t[e])).filter((t=>null!=t));if(0===s.length)i=0,n=1;else{i=Math.min(...s)-(Math.max(...s)-Math.min(...s))/3,n=(Math.max(...s)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(this.originalData,t.xField);t.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:e,max:i}]}generateBarBackground(t){var e;return{type:t.barBackground.type,dataId:"data",visible:!0,dataKey:l,zIndex:-99,state:null===(e=t.barBackground)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>"symbol"===t.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2-("symbol"===t.barBackground.type?0:t.bar.height/2),size:(e,i)=>[i.getRegion().getLayoutRect().width,t.bar.height],width:(t,e)=>e.getRegion().getLayoutRect().width,height:t.bar.height},t.barBackground.style),{visible:e=>!e[d]&&t.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(t){var e;return null===(e=t.decorateHaloIcons)||void 0===e?void 0:e.map((e=>({type:"symbol",dataId:"data",visible:!0,dataKey:l,state:null==e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>{if(void 0!==e[t.xField]&&null!==e[t.xField])return i.valueToX([e[t.xField]])},y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2},e.style),{visible:t=>!t[d]&&e.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(t){return{type:"symbol",dataId:"data",visible:!0,dataKey:l,state:t.rankingIcon.state,style:Object.assign(Object.assign({x:e=>"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+(t.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(h,e)).width:0)+8):5,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(h,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[d]&&t.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(t){var e;return{type:"text",dataId:"data",dataKey:l,state:null===(e=t.nameLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.yField,e),x:()=>{var e;return"bothEnd"===t.labelLayout?-10:(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,h,this.orderLabelTextMeasure):0)},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.nameLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[d]&&t.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(t){var e;return{type:"text",dataId:"data",dataKey:l,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(h,t),x:e=>{var i;return"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+5):t.rankingIcon.style.visible?8+(null!==(i=t.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.orderLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[d]&&t.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(t){var e;return{type:"text",dataId:"data",visible:!0,dataKey:l,state:null===(e=t.valueLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.xField,e),x:(e,i)=>"bothEnd"===t.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.valueLabel.style),{textAlign:"bothEnd"===t.labelLayout?"left":"right",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[d]&&t.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(t){var e;const i=t.decorateHaloIcons.length>0?Math.max(...t.decorateHaloIcons.map((t=>{var e,i;return null!==(i=null===(e=t.style)||void 0===e?void 0:e.size)&&void 0!==i?i:18}))):0;t.padding=Object.assign({left:"bothEnd"===t.labelLayout?10+this.getMaxDataLabelLens(t,t.yField,this.nameLabelTextMeasure)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,h,this.orderLabelTextMeasure):0)+(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+5:5+i/2,right:"bothEnd"===t.labelLayout?5+this.getMaxDataLabelLens(t,t.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},t.padding)}getMaxDataLabelLens(t,e,i){const n=this.originalData.map((t=>t[d]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}formatDatum(t,e){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[t])?this.formatMap[t](e[t],e):e[t]}getLabelWidth(t,e){return e+t}getAnimationExit(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,s,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["y"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(s=t.animationUpdate)||void 0===s?void 0:s.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,s,r,a,o,l,h,d,c,u,p,g;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(s=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==s?s:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear",options:{}}:"symbol"===e?{channel:{x:{from:0,to:(t,e)=>e.getGraphicItem().attribute.x}},duration:null!==(l=null===(o=t.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(d=null===(h=t.animationAppear)||void 0===h?void 0:h.easing)&&void 0!==d?d:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(u=null===(c=t.animationAppear)||void 0===c?void 0:c.duration)&&void 0!==u?u:1e3,easing:null!==(g=null===(p=t.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==g?g:"linear"})}getAnimationUpdate(t){var e,i,n,s;return!1!==t.animationUpdate.enable&&{duration:null!==(i=null===(e=t.animationUpdate)||void 0===e?void 0:e.duration)&&void 0!==i?i:1e3,easing:null!==(s=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==s?s:"linear"}}}class u extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=c}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:s,yField:r,data:a}=this._spec;return s&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}u.type="rankingList",u.view="singleDefault",u.transformerConstructor=c;const p=(t,e)=>{var i,n;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const s=e.fields,r=t[0],a={},o=[];for(const e in s)if(Object.prototype.hasOwnProperty.call(s,e)){const l=s[e];if(!l.type){let n=r;e in r||(n=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof n[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(h)),(null===(n=l.domain)||void 0===n?void 0:n.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),o.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let n=0;n<i.length;n++){const s=i[n];let r=0;if("ordinal"===s.type?(void 0===s.sortIndex[e[s.key]]&&(s.sortIndex[e[s.key]]=s.sortIndexCount++),void 0===s.sortIndex[t[s.key]]&&(s.sortIndex[t[s.key]]=s.sortIndexCount++),r=s.sortIndex[t[s.key]]-s.sortIndex[e[s.key]]):"linear"===s.type&&(r=t[s.key]-e[s.key]),s.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};let g=0;const f="_data-view-diff-rank";class m{constructor(t,e){var n=this;let s;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new i.EventEmitter,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return n.isRunning=!0,n.resetTransformData(),n.transformsArr.forEach((e=>{n.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),n.isLastTransform(e)&&n.diffLastData()})),n.isRunning=!1,!1!==t.emitMessage&&n.target.emit("change",[]),n},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},s=(null==e?void 0:e.name)?e.name:function(){return g>1e8&&(g=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+g++}("dataview"),this.name=s,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(s,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var n;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const s=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(s,e.options,this);this.rawData=s,this.parserData=t,this.history&&this.historyData.push(s,t),this.latestData=t}else this.parserData=s,this.rawData=s,this.history&&this.historyData.push(s),this.latestData=s;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,n;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(n=e.level)&&void 0!==n?n:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:n}=e,s=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(s),this.latestData=s,!1!==n&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[f]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[f]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[f]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let n=!1;return t instanceof m||!0!==(null==e?void 0:e.clone)||(n=!0),n?i.cloneDeep(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?i.merge({},this._fields,t):t;const n=this.transformsArr.find((t=>"fields"===t.type));!i.isNil(this._fields)&&i.isNil(n)?(this.dataSet.registerTransform("fields",p),this.transform({type:"fields",options:{fields:this._fields}},!1)):n&&(n.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart,t.VUtils)}(this,(function(t,e,i){"use strict";class s extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:e,timeNodes:s}=function(t){const{xField:e,yField:s,timeField:n,data:r,topN:a=10,icon:o}=t,l=new Set,h=new Map;return r.sort(((t,i)=>Number(i[e])-Number(t[e]))),r.forEach((t=>{const e=t[n];i.isValid(e)&&l.add(e),h.has(e)||h.set(e,[]);const r=h.get(e);if(r.length<a){const e=Object.assign({},t);o&&o[e[s]]&&(e.icon=o[e[s]]),r.push(e)}})),{timeData:h,timeNodes:Array.from(l).sort()}}(t),{interval:a,xField:o,yField:l,color:h,icon:c,iconPosition:d,iconShape:u,timeLabel:p,label:f,nameLabel:g,xAxis:m,yAxis:y}=t,b=a||1e3,x=Math.min(b,500);if(t.type="common",t.data=[{id:"timeData",values:e.get(s[0])},{id:"time",values:[{time:s[0]}]}],t.color={specified:Object.assign({},h)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:o,seriesField:l,extensionMark:[],label:n(f,Object.assign(Object.assign({},g),{yField:l}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},s={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(s.label=t.label);return[i,s]}(m,y),t.player={type:"continuous",auto:!0,loop:!1,interval:b,specs:s.map((t=>({data:[{id:"timeData",values:e.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:b,exchangeDuration:x}),p&&!1===p.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(p.style)),c){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:s}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,s;const n=e.vchart,r=null===(i=n.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(n&&r){const t=null!==(s=r.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var s,n;const r=i.vchart,a=null===(s=r.getChart())||void 0===s?void 0:s.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(n=a.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,s;const n=e.vchart,r=null===(i=n.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(n&&r){const e=null!==(s=r.getYAxisHelper().getBandwidth(0))&&void 0!==s?s:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:r(i,s),animationEnter:[{type:"moveIn",duration:s,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:s,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(d,u,{interval:b,exchangeDuration:x});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function n(t={},e){var i,s,n,r;const a=[];return!1!==t.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(s=t.style)||void 0===s?void 0:s.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(n=e.style)||void 0===n?void 0:n.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function r(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class a extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=s}init(){this.isValid()&&super.init()}isValid(){var t,e,i,s;const{xField:n,yField:r,timeField:a,data:o}=this._spec;return n&&r&&a?!!o||(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`, `timeField` "),!1)}}a.type="rankingBar",a.view="singleDefault",a.transformerConstructor=s;const o=(t,e)=>{var i,s;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],a={},o=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const l=n[e];if(!l.type){let s=r;e in r||(s=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof s[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(h)),(null===(s=l.domain)||void 0===s?void 0:s.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),o.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let s=0;s<i.length;s++){const n=i[s];let r=0;if("ordinal"===n.type?(void 0===n.sortIndex[e[n.key]]&&(n.sortIndex[e[n.key]]=n.sortIndexCount++),void 0===n.sortIndex[t[n.key]]&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),r=n.sortIndex[t[n.key]]-n.sortIndex[e[n.key]]):"linear"===n.type&&(r=t[n.key]-e[n.key]),n.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,o))),t};let l=0;const h="_data-view-diff-rank";class c{constructor(t,e){var s=this;let n;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new i.EventEmitter,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return s.isRunning=!0,s.resetTransformData(),s.transformsArr.forEach((e=>{s.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),s.isLastTransform(e)&&s.diffLastData()})),s.isRunning=!1,!1!==t.emitMessage&&s.target.emit("change",[]),s},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},n=(null==e?void 0:e.name)?e.name:function(){return l>1e8&&(l=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+l++}("dataview"),this.name=n,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(n,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var s;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(s=this.dataSet.getParser(e.type))&&void 0!==s?s:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,s;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(s=e.level)&&void 0!==s?s:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:s}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==s&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[h]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[h]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[h]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let s=!1;return t instanceof c||!0!==(null==e?void 0:e.clone)||(s=!0),s?i.cloneDeep(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?i.merge({},this._fields,t):t;const s=this.transformsArr.find((t=>"fields"===t.type));!i.isNil(this._fields)&&i.isNil(s)?(this.dataSet.registerTransform("fields",o),this.transform({type:"fields",options:{fields:this._fields}},!1)):s&&(s.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -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 y(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(i[n[s]]=t[n[s]])}return i}class b extends e.FunnelChart.transformerConstructor{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=y(t,["arrows"]),n=e.filter((t=>"left"===t.position)),s=e.filter((t=>"right"===t.position)),r=v(s,i),a=v(n,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(n&&n.visible){const t=function(t){const{style:e={}}=t,i=y(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},L),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);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 v(t,e){if(0===(null==t?void 0:t.length))return null;const{line:n,symbol:s,text:r,margin:a}=e,o=[],l={type:"group",children:[]},h=function(t={},e){const{style:i={}}=t,n=y(t,["style"]),s=(t,e)=>{var i,n;const{from:s,to:r}=t,{vchart:a}=e,o=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>o.length-1||s>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},M),i),{renderable:s,points:(t,i)=>{if(!s(t,i))return[];let n=t.layout.points;return n=x(t,i,e),n}})})}(n,a);h&&o.push(h);const d=function(t={},e){const{style:i={}}=t,n=y(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},O),i),{x:(t,i)=>{var n,s;let r=t.layout.points;return r=x(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==s?s:NaN},y:(t,i)=>{var n,s;let r=t.layout.points;return r=x(t,i,e),null!==(s=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==s?s:NaN},angle:t=>"left"===t.position?90:-90})})}(s,a);d&&o.push(d);const c=function(t={},e){const{style:n={},formatMethod:s,textMargin:r=4}=t,a=y(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},a),{style:Object.assign(Object.assign(Object.assign({},C),{text:(t,e)=>{var n,r,a,o,l,h,d;const{text:c}=t;let u=c;if(i.isFunction(s)){const{vchart:i}=e,{from:p,to:g}=t,{field:f}=t.context,m=null!==(a=null===(r=null===(n=null==i?void 0:i.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===r?void 0:r.latestData)&&void 0!==a?a:[],y=null!==(d=null===(h=null===(l=null===(o=null==i?void 0:i.getChart())||void 0===o?void 0:o.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===h?void 0:h.latestData)&&void 0!==d?d:[],b=y.find((t=>t[f]===m[p][f])),v=y.find((t=>t[f]===m[g][f]));u=s(c,{arrow:t,from:b,to:v})}return u},x:(t,i)=>{var n,s;let a=t.layout.points;return a=x(t,i,e),null!==(s=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-r:r))&&void 0!==s?s:NaN},y:(t,i)=>{var n,s,r;let a=t.layout.points;return a=x(t,i,e),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(s=a[2])||void 0===s?void 0:s.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),n)})}(r,a);return c&&o.push(c),l.children=o,l}function x(t,e,i){var n,s,r,a,o;const{vchart:l}=e,{from:h,to:d}=t,{field:c}=t.context,u=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===s?void 0:s.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(u&&u.length){const n=p.find((t=>t[c]===u[h][c])),s=p.find((t=>t[c]===u[d][c])),r=p[0];if(n&&s&&r){g=function(t,e,i,n,s=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:d,fromTotal:c,toTotal:u}=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?n[1]:n[0],A=m/(c+1),_=v/(u+1),B=g.y+A*(h+1),T=y.y+_*(d+1),S=p?-1:1,w=[{x:g.x-s*S,y:B},{x:x.x-(s+(l+1)*a)*S,y:B},{x:x.x-(s+(l+1)*a)*S,y:T},{x:y.x-s*S,y:T}];return w}(t,e.getPoints(n),e.getPoints(s),e.getPoints(r),i),t.layout.points=g}}return g}function A(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return n>s&&r>i}function _(t,e){const{from:i,to:n}=t,{from:s,to:r}=e;return i===s&&n===r}const B=(t,e)=>{var n,s,r;if(!t||!(null===(n=t.arrows)||void 0===n?void 0:n.length))return[];const{arrows:a}=t,o=function(t,e){return t.filter((t=>i.isValidNumber(t.from*t.to))).map(((t,i)=>{const{from:n,to:s,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,s),to:Math.max(n,s),span:Math.abs(n-s),isLayout:!1,context:{field:e},layout:{level:0},id:`${n}-${s}-${r}-${i}`})}))}(a,e.categoryField),l=o.filter((t=>"left"===t.position)),h=o.filter((t=>"right"===t.position));return[...null!==(s=T(l))&&void 0!==s?s:[],...null!==(r=T(h))&&void 0!==r?r:[]]};function T(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const n=e.get(t.from);if(i.isValid(n)){const e=n.fromArrows.find((e=>_(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const s=e.get(t.to);if(i.isValid(s)){const e=s.toArrows.find((e=>_(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((n=>{var s;const r=t.filter((t=>t.layout.isLayout)),a=i.maxInArray(r,((t,e)=>t.layout.level-e.layout.level));let o=null!==(s=null==a?void 0:a.layout.level)&&void 0!==s?s:0;for(;o>=0;){if(r.some((t=>t.layout.level===o&&A(t,n)))){o+=1;break}--o}n.layout.level=Math.max(0,o),n.layout.fromTotal=e.get(n.from).degree,n.layout.toTotal=e.get(n.to).degree;const l=n.layout.duplicateNode;l?(n.layout.fromIndex=l.layout.fromIndex,n.layout.toIndex=l.layout.toIndex):(n.layout.fromIndex=S(n,e.get(n.from).totalArrows),n.layout.toIndex=S(n,e.get(n.to).totalArrows)),n.layout.isLayout=!0})),t}function S(t,e){let i=0,n=0;for(let s=0;s<e.length;s++){const r=e[s];if(r===t){i=s-n;break}r.layout.duplicateNode&&n++}return i}class w extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=b}}w.type="conversionFunnel",w.transformerConstructor=b;class P 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 m(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",B),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.getProduct().transform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.getProduct().transform([{type:"filter",callback:t=>"left"===t.position}])}))}}const M={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},O={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},C={fill:"#606773",fontSize:12},L={fill:"#eff1f9"};class k{static GenAutoIncrementId(){return k.auto_increment_id++}}k.auto_increment_id=0;class E{constructor(t){this.id=k.GenAutoIncrementId(),this.registry=t}}const I="named",R="inject",U="inversify:tagged",D="inversify:paramtypes";class N{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===I?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var j=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(h(r)){if(!i)return;r=new n,s.set(t,r)}let a=r.get(e);if(h(a)){if(!i)return;a=new n,r.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=f(e);return!d(n)&&a(t,n,i)}function o(t,e,i){const n=r(e,i,!1);return!h(n)&&!!n.has(t)}function l(t,e,i){if(o(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!h(n))return n.get(t)}(t,e,i);const n=f(e);return d(n)?void 0:l(t,n,i)}function h(t){return void 0===t}function d(t){return null===t}function c(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(c(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(!c(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!c(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!c(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!c(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!c(i))throw new TypeError;return s=t,a=e,void r(i,n,!0).set(s,a);var s,a})),t("hasMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!c(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 F(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};j.hasOwnMetadata(t,e)&&(r=j.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...s),r[i]=a,j.defineMetadata(t,r,e)}(U,t,i.toString(),n)}function z(t){return(e,i,n)=>{F(e,0,n,t)}}const W=(G=R,t=>(e,i,n)=>z(new N(G,t))(e,i,n));var G;function Y(){return function(t){return j.defineMetadata(D,null,t),t}}function $(t){return z(new N(I,t))}const V="Singleton",X="Transient",H="ConstantValue",K="DynamicValue",q="Factory",Z="Function",J="Instance",Q="Invalid";class tt{constructor(t,e){this.id=k.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=Q,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new tt(this.serviceIdentifier,this.scope);return t.activated=t.scope===V&&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 et{getConstructorMetadata(t){return{compilerGeneratedMetadata:j.getMetadata(D,t),userGeneratedMetadata:j.getMetadata(U,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const it=(nt=I,t=>{const e=e=>{if(null==e)return!1;if(e.key===nt&&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===nt&&i[e].value===t)return!0;return!1};return e.metaData=new N(nt,t),e});var nt;class st{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=V,this}inTransientScope(){return this._binding.scope=X,this}whenTargetNamed(t){return this._binding.constraint=it(t),this}}class rt{constructor(t){this._binding=t}to(t){return this._binding.type=J,this._binding.implementationType=t,new st(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=K,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new st(this._binding)}toConstantValue(t){return this._binding.type=H,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=V,new st(this._binding)}toFactory(t){return this._binding.type=q,this._binding.factory=t,this._binding.scope=V,new st(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const at=Symbol("ContributionProvider");class ot{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function lt(t,e){t(at).toDynamicValue((t=>{let{container:i}=t;return new ot(e,i)})).inSingletonScope().whenTargetNamed(e)}class ht{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class dt extends ht{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}var ct;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(ct||(ct={}));const ut=i.tau-1e-8;class pt{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,s,r,a){if(Math.abs(r-s)>ut)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let o,l,h,d,c=1/0,u=-1/0,p=1/0,g=-1/0;function f(t){h=n*Math.cos(t),d=n*Math.sin(t),h<c&&(c=h),h>u&&(u=h),d<p&&(p=d),d>g&&(g=d)}if(f(s),f(r),r!==s)if((s%=i.tau)<0&&(s+=i.tau),(r%=i.tau)<0&&(r+=i.tau),r<s&&(a=!a,o=s,s=r,r=o),a)for(r-=i.tau,o=s-s%i.halfPi,l=0;l<4&&o>r;++l,o-=i.halfPi)f(o);else for(o=s-s%i.halfPi+i.halfPi,l=0;l<4&&o<r;++l,o+=i.halfPi)f(o);this.bounds.add(t+c,e+p),this.bounds.add(t+u,e+g)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class gt{constructor(){this.curves=[],this.bounds=new i.AABBBounds}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ft=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,mt={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},yt=0,bt=1,vt=2,xt=3,At=4,_t=5,Bt=6,Tt=7,St=8;let wt,Pt,Mt,Ot,Ct,Lt;var kt,Et,It,Rt,Ut,Dt,Nt,jt,Ft;function zt(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,d=-o*a,c=o*r,u=l*a,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),y=.5*(s-n),b=Math.sin(.5*y),v=8/3*b*b/Math.sin(y),x=e+p-v*g,A=i+g+v*p,_=e+f,B=i+m,T=_+v*m,S=B-v*f;return[h*x+d*A,c*x+u*A,h*T+d*S,c*T+u*S,h*_+d*B,c*_+u*B]}function Wt(t,e,n,s){const r=function(t,e,n,s,r,a,o,l,h){const d=i.degreeToRadian(o),c=Math.sin(d),u=Math.cos(d),p=u*(l-t)*.5+c*(h-e)*.5,g=u*(h-e)*.5-c*(l-t)*.5;let f=p*p/((n=Math.abs(n))*n)+g*g/((s=Math.abs(s))*s);f>1&&(f=Math.sqrt(f),n*=f,s*=f);const m=u/n,y=c/n,b=-c/s,v=u/s,x=m*l+y*h,A=b*l+v*h,_=m*t+y*e,B=b*t+v*e;let T=1/((_-x)*(_-x)+(B-A)*(B-A))-.25;T<0&&(T=0);let S=Math.sqrt(T);a===r&&(S=-S);const w=.5*(x+_)-S*(B-A),P=.5*(A+B)+S*(_-x),M=Math.atan2(A-P,x-w);let O=Math.atan2(B-P,_-w)-M;O<0&&1===a?O+=i.tau:O>0&&0===a&&(O-=i.tau);const C=Math.ceil(Math.abs(O/(i.halfPi+.001))),L=[];for(let t=0;t<C;++t){const e=M+t*O/C,i=M+(t+1)*O/C;L[t]=[w,P,e,i,n,s,c,u]}return L}(s[5],s[6],s[0],s[1],s[3],s[4],s[2],e,n);for(let e=0;e<r.length;++e){const i=zt(r[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"}(kt||(kt={})),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"}(Et||(Et={})),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"}(It||(It={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Rt||(Rt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Ut||(Ut={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Dt||(Dt={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Nt||(Nt={})),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"}(jt||(jt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ft||(Ft={}));const Gt=[(t,e,i,n,s,r,a)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],a),(t,e,i,n,s,r,a)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,a),(t,e,i,n,s,r,a)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,a)=>e.lineTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.moveTo(t[1]*s+i,t[2]*r+n,a),(t,e,i,n,s,r,a)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,a),(t,e,i,n,s,r,a)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,a)];function Yt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];Gt[l[0]](l,e,i,n,s,r,a)}}class $t{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Vt(t,e,n,s,r){return function(t,e){let n=0;const s=t.length;for(let r=0;r<s;r++){const a=t[r],o=e[r],l=t[(r+1)%s],h=e[(r+1)%s];n+=i.PointService.distanceNN(a,o,l,h)}return n/2}([t.x,e.x,n.x,s.x],[t.y,e.y,n.y,s.y])}function Xt(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function Ht(t,e,n,s,r){const a=Xt(t.x,e.x,n.x,s.x,r),o=Xt(t.y,e.y,n.y,s.y,r);return new i.Point(a,o)}class Kt extends $t{constructor(t,e,i,n){super(),this.type=jt.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Ht(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Vt(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Nt.ROW?i.abs(this.p0.x-this.p3.x):t===Nt.COLUMN?i.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const e=i.max(t-.01,0),n=i.min(t+.01,1),s=this.getPointAt(e),r=this.getPointAt(n);return i.atan2(r.y-s.y,r.x-s.x)}}class qt extends $t{constructor(t,e){super(),this.type=jt.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return i.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=i.atan2(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()?i.PointService.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Nt.ROW?i.abs(this.p0.x-this.p1.x):t===Nt.COLUMN?i.abs(this.p0.y-this.p1.y):0}}class Zt{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,n,s,r,a,o,l){const h=new Kt(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(n,s),new i.Point(r,a));h.originP1=this._lastOriginP,h.originP2=l,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=a,this._lastOriginP=l}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,s,r){const a=new qt(new i.Point(this._lastX,this._lastY),new i.Point(t,e));return a.originP1=s,a.originP2=r,a.defined=n,a}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===Nt.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],s=null!==(e=n.p3)&&void 0!==e?e:n.p1;return i.abs(t.p0.y-s.y)}if(t===Nt.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],s=null!==(n=e.p3)&&void 0!==n?n:e.p1;return i.abs(t.p0.x-s.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Jt extends Zt{bezierCurveTo(t,e,i,n,s,r,a,o){return super.bezierCurveTo(e,t,n,i,r,s,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Qt(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function te(t,e,n){const s=null!=e?e:i.abs(n[n.length-1].x-n[0].x)>i.abs(n[n.length-1].y-n[0].y)?Nt.ROW:Nt.COLUMN;return"monotoneY"===t?new Jt(t,s):new Zt(t,s)}class ee{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 ie(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=te("linear",i,t);return function(t,e){Qt(t,e)}(new ee(s,n),t),s}function ne(t,e,i,n,s){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class se{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&&ne(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:ne(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 re(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return ie(t,e);const s=te("basis",i,t);return function(t,e){Qt(t,e)}(new se(s,n),t),s}function ae(t){return t<0?-1:1}function oe(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),a=(i-t._y1)/(s||Number(n<0&&-0)),o=(r*s+a*n)/(n+s);return(ae(r)+ae(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function le(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function he(t,e,i,n,s){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,n,t.lastPoint1)}class de{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:he(this,this._t0,le(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,he(this,le(this,e=oe(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:he(this,this._t0,e=oe(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class ce extends de{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function ue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return ie(t,e);const s=te("monotoneX",i,t);return function(t,e){Qt(t,e)}(new de(s,n),t),s}function pe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return ie(t,e);const s=te("monotoneY",i,t);return function(t,e){Qt(t,e)}(new ce(s,n),t),s}let ge=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function fe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const a=new Zt("step",null!=s?s:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?Nt.ROW:Nt.COLUMN);return function(t,e){Qt(t,e)}(new ge(a,e,r),t),a}class me extends ee{lineEnd(){this.context.closePath()}}function ye(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const s=te("linear",i,t);return function(t,e){Qt(t,e)}(new me(s,n),t),s}function be(t,e,n,s,r){let a=t._x1,o=t._y1,l=t._x2,h=t._y2;if(t._l01_a>i.epsilon){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);a=(a*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>i.epsilon){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*i+t._x1*t._l23_2a-e*t._l12_2a)/s,h=(h*i+t._y1*t._l23_2a-n*t._l12_2a)/s}t.context.bezierCurveTo(a,o,l,h,t._x2,t._y2,s,t.lastPoint1)}function ve(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=s;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return ie(i,s);const o=te(t,r,i);return Qt(new e(o,n,a),i),o}}const xe=ve("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:be(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 Ae=ve("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:be(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function _e(t,e,i){var n,s;switch(e){case"linear":default:return ie(t,i);case"basis":return re(t,i);case"monotoneX":return ue(t,i);case"monotoneY":return pe(t,i);case"step":return fe(t,.5,i);case"stepBefore":return fe(t,0,i);case"stepAfter":return fe(t,1,i);case"catmullRom":return xe(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Ae(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return ye(t,i)}}class Be extends gt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new pt(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Bt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([_t,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Tt,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([vt,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([bt,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,a,o){return this.commandList.push([At,t,e,i,n,s,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,a,o),this}rect(t,e,i,n){return this.commandList.push([St,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([yt,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([xt]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Bt]=t=>`M${t[1]} ${t[2]}`,t[_t]=t=>`L${t[1]} ${t[2]}`,t[Tt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[vt]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[yt]=t=>{const e=[];((t,e,i,n,s,r,a)=>{const o=Math.abs(i-e),l=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,h=(i-e)/l;for(let i=0;i<l;i++){const o=e+h*i,l=e+h*(i+1),d=4*Math.tan(Math.abs(h)/4)/3,c=l<o?-1:1,u=Math.cos(o),p=Math.sin(o),g=Math.cos(l),f=Math.sin(l),m=u*r+n,y=p*a+s,b=g*r+n,v=f*a+s,x=r*d*c,A=a*d*c;t.push(m-x*p,y+A*u,b+x*f,v-A*g,b,v)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[St]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[xt]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(wt=e[t],Pt=wt.slice(1),Mt=wt[0],i=[Mt],n=Pt.match(ft),null!==n){for(let t=0,e=n.length;t<e;t++)Ot=n[t],Ct=parseFloat(Ot),Number.isNaN(Ct)||i.push(Ct);if(Lt=mt[Mt],i.length-1>Lt){let t,e=Mt;for(let n=1,r=i.length;n<r;n+=Lt){t=[e];for(let e=n,s=n+Lt;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=_e(e,i);"x"===n?this.direction=Nt.ROW:"y"===n?this.direction=Nt.COLUMN:"auto"===n&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[Bt]=this.moveToTransform,t[_t]=this.lineToTransform,t[Tt]=this.quadraticCurveToTransform,t[vt]=this.bezierCurveToTransform,t[bt]=this.arcToTransform,t[At]=this.ellipseTransform,t[St]=this.rectTransform,t[yt]=this.arcTransform,t[xt]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,s,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,d=null,c=0,u=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===l&&1===h||(e=Se(e,l,h)),e[0]){case"l":c+=e[1],u+=e[2],this.lineTo(c+a,u+o);break;case"L":c=e[1],u=e[2],this.lineTo(c+a,u+o);break;case"h":c+=e[1],this.lineTo(c+a,u+o);break;case"H":c=e[1],this.lineTo(c+a,u+o);break;case"v":u+=e[1],this.lineTo(c+a,u+o);break;case"V":u=e[1],this.lineTo(c+a,u+o);break;case"m":c+=e[1],u+=e[2],this.moveTo(c+a,u+o);break;case"M":c=e[1],u=e[2],this.moveTo(c+a,u+o);break;case"c":i=c+e[5],n=u+e[6],p=c+e[3],g=u+e[4],this.bezierCurveTo(c+e[1]+a,u+e[2]+o,p+a,g+o,i+a,n+o),c=i,u=n;break;case"C":c=e[5],u=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,g+o,c+a,u+o);break;case"s":i=c+e[3],n=u+e[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+a,g+o,c+e[1]+a,u+e[2]+o,i+a,n+o),p=c+e[1],g=u+e[2],c=i,u=n;break;case"S":i=e[3],n=e[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+a,g+o,e[1]+a,e[2]+o,i+a,n+o),c=i,u=n,p=e[1],g=e[2];break;case"q":i=c+e[3],n=u+e[4],p=c+e[1],g=u+e[2],this.quadraticCurveTo(p+a,g+o,i+a,n+o),c=i,u=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,n+o),c=i,u=n,p=e[1],g=e[2];break;case"t":i=c+e[1],n=u+e[2],null===d[0].match(/[QqTt]/)?(p=c,g=u):"t"===d[0]?(p=2*c-s,g=2*u-r):"q"===d[0]&&(p=2*c-p,g=2*u-g),s=p,r=g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),c=i,u=n,p=c+e[1],g=u+e[2];break;case"T":i=e[1],n=e[2],p=2*c-p,g=2*u-g,this.quadraticCurveTo(p+a,g+o,i+a,n+o),c=i,u=n;break;case"a":Wt(this,c+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+c+a,e[7]+u+o]),c+=e[6],u+=e[7];break;case"A":Wt(this,c+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),c=e[6],u=e[7];break;case"z":case"Z":this.closePath()}d=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==s)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case _t:this.lineToTransform(a,e,i,n,s);break;case Bt:this.moveToTransform(a,e,i,n,s);break;case vt:this.bezierCurveToTransform(a,e,i,n,s);break;case Tt:this.quadraticCurveToTransform(a,e,i,n,s);break;case yt:this.arcToTransform(a,e,i,n,s);break;case At:this.ellipseTransform(a,e,i,n,s);break;case St:this.rectTransform(a,e,i,n,s);break;case bt:this.arcToTransform(a,e,i,n,s);break;case xt:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Yt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Nt.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return i.abs(t.p0.y-e.p1.y)}if(this.direction===Nt.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return i.abs(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const Te=["l",0,0,0,0,0,0,0];function Se(t,e,i){const n=Te[0]=t[0];if("a"===n||"A"===n)Te[1]=e*t[1],Te[2]=i*t[2],Te[3]=t[3],Te[4]=t[4],Te[5]=t[5],Te[6]=e*t[6],Te[7]=i*t[7];else if("h"===n||"H"===n)Te[1]=e*t[1];else if("v"===n||"V"===n)Te[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)Te[n]=(n%2==1?e:i)*t[n];return Te}const we={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 i.Matrix},Pe={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Me=Object.assign({outerBorder:Object.assign(Object.assign({},Pe),{distance:0}),innerBorder:Object.assign(Object.assign({},Pe),{distance:0})},Pe),Oe={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:ct.fontBounding,keepCenterInLine:!1},Ce=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Me),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Le={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},ke=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1},{_debug_bounds:!1}),Ce),we),Ee=Object.assign(Object.assign({},ke),{startAngle:0,endAngle:i.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Ie=Object.assign(Object.assign(Object.assign({},ke),Le),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Re=Object.assign(Object.assign({},ke),{radius:1,startAngle:0,endAngle:i.pi2}),Ue=Object.assign(Object.assign({},ke),{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}),De=Object.assign(Object.assign({},ke),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Ne=Object.assign(Object.assign(Object.assign({},ke),Le),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),je=Object.assign(Object.assign({},ke),{path:new Be,fillStrokeOrder:1,customPath:()=>{i.Logger.getInstance().warn("空函数")}}),Fe=Object.assign(Object.assign({},ke),{points:[],cornerRadius:0,closePath:!0}),ze=Object.assign(Object.assign({},ke),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},ke),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const We=Object.assign(Object.assign({},ke),{symbolType:"circle",size:10,keepDirIn3d:!0}),Ge=Object.assign(Object.assign(Object.assign({},ke),Oe),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Ye=Object.assign(Object.assign(Object.assign({},ke),Oe),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),$e=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},ke),{fill:!0,cornerRadius:0}),Ve=Object.assign(Object.assign({},$e),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const Xe=new class{};function He(t,e,i){let n=e;const{a:s,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(s)*Math.sqrt(s*s+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(n=n/Math.abs(l+h)*2*i,n)}const Ke=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||X,this.options=e,this.id=k.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new et}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,I,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new tt(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new rt(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[R],multiInject:n.multi_inject},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};s.push(l)}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case H:case Z:e=t.cache;break;case J: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===V&&(t.cache=e,t.activated=!0)}},qe=Symbol.for("CanvasFactory");function Ze(t){return Ke.getNamed(qe,Xe.global.env)(t)}const Je=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=Ze(Object.assign({nativeCanvas:Xe.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=Ze(Object.assign({nativeCanvas:Xe.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},Qe={arc:Ee,area:Ie,circle:Re,line:Ne,path:je,symbol:We,text:Ge,rect:ze,polygon:Fe,richtext:Ye,richtextIcon:Ve,image:$e,group:Ue,glyph:De},ti=Object.keys(Qe);function ei(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const ii={arc:Object.assign({},Qe.arc),area:Object.assign({},Qe.area),circle:Object.assign({},Qe.circle),line:Object.assign({},Qe.line),path:Object.assign({},Qe.path),symbol:Object.assign({},Qe.symbol),text:Object.assign({},Qe.text),rect:Object.assign({},Qe.rect),polygon:Object.assign({},Qe.polygon),richtext:Object.assign({},Qe.richtext),richtextIcon:Object.assign({},Qe.richtextIcon),image:Object.assign({},Qe.image),group:Object.assign({},Qe.group),glyph:Object.assign({},Qe.glyph)};class ni{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},ti.forEach((t=>{this._defaultTheme[t]=Object.create(ii[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||n)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,i.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;ti.forEach((n=>{const s=Object.create(ii[n]);t&&t[n]&&ei(s,t[n]),i[n]&&ei(s,i[n]),e[n]&&ei(s,e[n]),this.combinedTheme[n]=s})),e.common&&ti.forEach((t=>{ei(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 si=new ni;function ri(t,e){return t.glyphHost?ri(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)):si.getTheme()}return null}(t)||t.attachedThemeGraphic&&ri(t.attachedThemeGraphic)||si.getTheme()}var ai=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((n=n.apply(t,e||[])).next())}))};class oi extends i.EventEmitter{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=k.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ai(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return 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&&i.Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,n){const s=i.isBoolean(n,!0)&&n||i.isObject(n)&&n.capture,r=i.isObject(n)&&n.once,a=i.isFunction(e)?void 0:e;return t=s?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent,r?super.once(t,e,a):super.on(t,e,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,n){const s=i.isBoolean(n,!0)&&n||i.isObject(n)&&n.capture,r=i.isFunction(e)?void 0:e;t=s?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent;const a=i.isObject(n)&&n.once;return super.off(t,e,r,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,n){return i.isObject(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class li{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=li.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&i.isFunction(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&&i.isFunction(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class hi extends li{constructor(t,e){super(),this.type=t,this.detail=e}}const di={dispatchEvent(t){var e;if(!(t instanceof li))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 hi(t,e))}};class ci{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-ci.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ci.bounceIn(2*t):.5*ci.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const s=e/i.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-s)*i.pi2/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const s=e/i.pi2*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-s)*i.pi2/e)+1}}static getElasticInOut(t,e){return function(n){const s=e/i.pi2*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-s)*i.pi2/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-s)*i.pi2/e)*.5+1}}}ci.quadIn=ci.getPowIn(2),ci.quadOut=ci.getPowOut(2),ci.quadInOut=ci.getPowInOut(2),ci.cubicIn=ci.getPowIn(3),ci.cubicOut=ci.getPowOut(3),ci.cubicInOut=ci.getPowInOut(3),ci.quartIn=ci.getPowIn(4),ci.quartOut=ci.getPowOut(4),ci.quartInOut=ci.getPowInOut(4),ci.quintIn=ci.getPowIn(5),ci.quintOut=ci.getPowOut(5),ci.quintInOut=ci.getPowInOut(5),ci.backIn=ci.getBackIn(1.7),ci.backOut=ci.getBackOut(1.7),ci.backInOut=ci.getBackInOut(1.7),ci.elasticIn=ci.getElasticIn(1,.3),ci.elasticOut=ci.getElasticOut(1,.3),ci.elasticInOut=ci.getElasticInOut(1,.3*1.5);const ui=new class{constructor(){this.id=k.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Rt.END?this.removeAnimate(e):e.status===Rt.RUNNING||e.status===Rt.INITIAL?(this.animateCount++,e.advance(t)):e.status===Rt.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class pi{constructor(t,e,i,n,s){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=s,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class gi extends pi{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class fi{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ui,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||ui,this.status=Rt.INITIAL,this.tailAnimate=new mi(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=i.max(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){fi.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fi.mode;t&&e&Ut.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:It.ANIMATE_PLAY})}runCb(t){const e=new gi((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,s,r){const a=fi.interpolateMap.get(t)||fi.interpolateMap.get("");return!!a&&a(t,e,i,n,s,r)}pause(){this.status===Rt.RUNNING&&(this.status=Rt.PAUSED)}resume(){this.status===Rt.PAUSED&&(this.status=Rt.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new mi(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Rt.INITIAL&&(this.status=Rt.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Rt.RUNNING&&(this.status=Rt.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,s=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=s;if(r&&(t=s),t===n)return r;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),r}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Rt.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}fi.mode=Ut.NORMAL,fi.interpolateMap=new Map;class mi{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new yi(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,n="string"==typeof i?ci[i]:i,s=this._addStep(e,null,n);return s.type=Dt.customAnimate,this._appendProps(t.getEndProps(),s,!1),this._appendCustomAnimate(t,s),this}to(t,e,i,n){(null==e||e<0)&&(e=0);const s="string"==typeof i?ci[i]:i,r=this._addStep(e,null,s);return r.type=Dt.to,this._appendProps(t,r,!!n&&n.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),n&&n.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,n){this.to(t,0,i,n);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,e,i,n),this.stepTail.type=Dt.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=Dt.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const n=new yi(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const s=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===s[t]&&(s[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(s)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,s=this.rawPosition;let r,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,i<=0&&(o=!0,i<0))return o;if(r=Math.floor(t/i),a=t-r*i,o=t>=n*i+i,o&&(a=i,r=n,t=a*r+i),t===s)return o;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,s=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=n;)i=r,r=i.next;let a=t?0===s?1:n/s:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let n=e.prev;for(;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){const e=n.customAnimate.getEndProps()[t];if(void 0!==e)return e}n=n.prev}return i.Logger.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class yi{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const bi=200,vi="cubicOut";var xi;!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"}(xi||(xi={}));const Ai=[0,0,0,0];function _i(t,e,n){const{x:s,y:r}=i.pointAt(t.x,t.y,e.x,e.y,n),{x:a,y:o}=i.pointAt(t.x1,t.y1,e.x1,e.y1,n),l=new i.Point(s,r,a,o);return l.defined=e.defined,l}function Bi(t,e,n){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 i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<e.length;i++)s[i]=_i(t[i],e[i],n)}else{s=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<t.length;i++)s[i]=_i(t[i],e[i],n)}return s}const Ti=(t,e)=>{const n=((t,e)=>i.isString(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(n)?n:Math.max(e,n)};var Si;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Si||(Si={}));class wi{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Si.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===Si.Color1){const e=wi.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;const s=i.Color.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];wi.store1[t]=e,wi.store255[t]=[s.r,s.g,s.b,s.opacity],n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}const s=wi.store255[t];if(s)return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n;const r=i.Color.parseColorString(t);return r&&(wi.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],wi.store255[t]=[r.r,r.g,r.b,r.opacity],n[0]=r.r,n[1]=r.g,n[2]=r.b,n[3]=r.opacity),n}static Set(t,e,i){if(e===Si.Color1){if(wi.store1[t])return;wi.store1[t]=i,wi.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(wi.store255[t])return;wi.store255[t]=i,wi.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Pi(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&i.isNumber(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 Mi(t,e,n,s,r){return Array.isArray(t)&&!i.isNumber(t[0])||Array.isArray(e)&&!i.isNumber(e[0])?new Array(4).fill(0).map(((r,a)=>Oi(i.isArray(t)?t[a]:t,i.isArray(e)?e[a]:e,n,s))):Oi(t,e,n,s,r)}function Oi(t,e,i,n,s){if(!t||!e)return t&&Pi(t)||e&&Pi(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=wi.Get(t,Si.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=wi.Get(e,Si.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:Pi(a)})))});return o?Mi(r,l,i,n,s):Mi(l,r,i,n,s)}if(o){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,a=s.stops;if(r.length!==a.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ki(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ki(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:ki(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,a),Pi(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),n)}wi.store255={},wi.store1={};const Ci=[0,0,0,0],Li=[0,0,0,0];function ki(t,e,i){return wi.Get(t,Si.Color255,Ci),wi.Get(e,Si.Color255,Li),`rgba(${Math.round(Ci[0]+(Li[0]-Ci[0])*i)},${Math.round(Ci[1]+(Li[1]-Ci[1])*i)},${Math.round(Ci[2]+(Li[2]-Ci[2])*i)},${Ci[3]+(Li[3]-Ci[3])*i})`}class Ei{static GetImage(t,e){var i;const n=Ei.cache.get(t);n?"fail"===n.loadState?Xe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Ei.loadImage(t,e)}static GetSvg(t,e){var i;let n=Ei.cache.get(t);n?"fail"===n.loadState?Xe.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Ei.cache.set(t,n),n.dataPromise=Xe.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,s)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Ei.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"},Ei.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Xe.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Xe.global.loadBlob(t):"json"===e&&(i.dataPromise=Xe.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Ei.isLoading&&Ei.toLoadAueue.length){Ei.isLoading=!0;const t=Ei.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(Ei.cache.set(i,s),s.dataPromise=Xe.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Ei.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ei.loading()})).catch((t=>{console.error(t),Ei.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ei.loading()}))}}),0)}static loadImage(t,e){const i=Ii(t,Ei.toLoadAueue);if(-1!==i)return Ei.toLoadAueue[i].marks.push(e),void Ei.loading();Ei.toLoadAueue.push({url:t,marks:[e]}),Ei.loading()}static improveImageLoading(t){const e=Ii(t,Ei.toLoadAueue);if(-1!==e){const t=Ei.toLoadAueue.splice(e,1);Ei.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Ii(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Ei.cache=new Map,Ei.isLoading=!1,Ei.toLoadAueue=[],Ei.onLoadSuccessCb=[];const Ri=new i.Matrix,Ui=new i.AABBBounds,Di=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Ni=["x","y"],ji=["scaleX","scaleY"],Fi=["angle"],zi=new i.Point,Wi={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 Gi extends oi{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(Gi.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new i.AABBBounds,this._updateTag=kt.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;zi.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),zi.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else zi.x=s,zi.y=r;return zi}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Xe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return Xe.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new i.OBBBounds),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const n=this.attribute,s=this.updateAABBBounds(n,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=n,a=(o=r)?i.isArray(o)?0===o.length?0:1===o.length?o[0]:2===o.length?(Ai[0]=o[0],Ai[2]=o[0],Ai[1]=o[1],Ai[3]=o[1],Ai):o:o:0;var o;return a&&s.expand(a),this.clearUpdateBoundTag(),s}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new pt(t);return Yt(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new i.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&kt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&Xe.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&kt.UPDATE_BOUNDS)&&Xe.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&kt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&kt.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&kt.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&kt.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=kt.CLEAR_SHAPE}containsPoint(t,e,n,s){if(!s)return!1;if(n===Et.GLOBAL){const n=new i.Point(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return s.containsPoint(this,{x:t,y:e})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,n,s){var r;const a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);a?this._setAttributes(a,n,s):i.isNil(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Di;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Di;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:It.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=kt.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:It.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ni,s);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?Xe.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:we.x)+t,a.y=(null!==(n=a.y)&&void 0!==n?n:we.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:It.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Ni,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,n){var s,r;if(1===t&&1===e)return this;const a={type:It.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,ji,a);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const l=this.attribute;if(n){let{postMatrix:s}=this.attribute;s||(s=new i.Matrix,l.postMatrix=s),Xe.transformUtil.fromMatrix(s,s).scale(t,e,n)}else l.scaleX=(null!==(s=l.scaleX)&&void 0!==s?s:we.scaleX)*t,l.scaleY=(null!==(r=l.scaleY)&&void 0!==r?r:we.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:It.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,ji,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var n;if(0===t)return this;const s={type:It.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Fi,s);r&&(delete r.angle,this._setAttributes(r,!1,s));const a=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new i.Matrix,a.postMatrix=n),Xe.transformUtil.fromMatrix(n,n).rotate(t,e)}else a.angle=(null!==(n=a.angle)&&void 0!==n?n:we.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:It.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Fi,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new fi(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:n,onEnd:s,onRemove:r}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=s&&e.onEnd(s),null!=r&&e.onRemove(r),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Xe.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!i.isNil(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,n){var s,r,a,o;if(i){const i=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let d;i.forEach((e=>{l[e]?(d||(d={}),d[e]=t[e]):h[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(h,null!==(r=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==r?r:bi,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:vi),d&&this.setAttributes(d,!1,{type:It.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:It.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((n=>{if(n.stateNames){const s=n.getEndProps();i.has(s,t)&&(e=s[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=kt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=kt.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=kt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&kt.UPDATE_SHAPE_AND_BOUNDS)===kt.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=kt.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=kt.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=kt.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=kt.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=kt.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=kt.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=kt.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&kt.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return Ui.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Ui),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,s=n();i[0]=s.x1+(s.x2-s.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,s=n();i[1]=s.y1+(s.y2-s.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=we.x,y:e=we.y,scaleX:n=we.scaleX,scaleY:s=we.scaleY,angle:r=we.angle,scaleCenter:a,anchor:o,postMatrix:l}=this.attribute;let h=[0,0];const d={};if(o&&(h=this.getAnchor(o,d)),!a||1===n&&1===s)i.normalTransform(this._transMatrix,this._transMatrix.reset(),t,e,n,s,r,o&&h);else{const i=this._transMatrix;i.reset(),i.translate(h[0],h[1]),i.rotate(r),i.translate(-h[0],-h[1]),i.translate(t,e),h=this.getAnchor(a,d),Xe.transformUtil.fromMatrix(i,i).scale(n,s,{x:h[0],y:h[1]})}const c=this.getOffsetXY(we);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,l){const t=Ri.setValue(l.a,l.b,l.c,l.d,l.e,l.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Xe.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:It.ANIMATE_END})}onStep(t,e,i,n,s){const r={};if(i.customAnimate)i.customAnimate.update(s,n,r);else{const a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,r,i,n,s,a,void 0,o,l)}this.setAttributes(r,!1,{type:It.ANIMATE_UPDATE,animationState:{ratio:n,end:s,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,s,r,a,o,l,h){h||(h=Object.keys(a),n.propKeys=h),r?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const d=a[r],c=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,n);if(null==d||null==c||d===c)return void(i[r]=d);let u;u=e.interpolateFunc&&e.interpolateFunc(r,s,c,d,i),u||(u=e.customInterpolate(r,s,c,d,this,i),u||this.defaultInterpolate(d,c,r,i,l,s)||this._interpolate(r,s,c,d,i))})),n.parsedProps=l}defaultInterpolate(t,e,i,n,s,r){if(Number.isFinite(t))return n[i]=e+(t-e)*r,!0;if("fill"===i){s||(s={});const a=s.fillColorArray,o=Mi(e,null!=a?a:t,r,!1,((t,e)=>{s.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){s||(s={});const a=s.strokeColorArray,o=Mi(e,null!=a?a:t,r,!1,((t,e)=>{s.strokeColorArray=e}));return o&&(n[i]=o),!0}if("shadowColor"===i){s||(s={});const a=s.shadowColorArray,o=Mi(e,null!=a?a:t,r,!0,((t,e)=>{s.shadowColorArray=e}));return o&&(n[i]=o),!0}return!1}_interpolate(t,e,i,n,s){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Xe.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return i.isString(t,!0)?this.pathProxy=(new Be).fromString(t):this.pathProxy=new Be,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(n,s),"string"==typeof t?(s.state="loading",t.startsWith("<svg")?(Ei.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(i.isValidUrl(t)||t.includes("/")||i.isBase64(t))&&(Ei.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):i.isObject(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 n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",Xe.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new hi(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}}Gi.mixin(di);class Yi{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 $i(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function Vi(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let s=n.data;const r=n.index,a=s.search(/\s/);let o=s,l=!0;-1!==a&&(o=s.substr(0,a).replace(/\s\s*$/,""),s=s.substr(a+1));const h=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==n.data.substr(t+1))}return{tagName:o,tagExp:s,closeIndex:r,attrExpPresent:l,rawTagName:h}}const Xi=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Hi{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,Xi),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Yi("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=$i(t,">",r,"Closing Tag is not closed."),a=s.lastIndexOf(".");s=s.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=Vi(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=$i(t,"--\x3e",r+4,"Comment is not closed.");else{const a=Vi(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,d=a.closeIndex;if(o!==e.tagname&&(s+=s?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),s=s.substr(0,s.length-1),l=o):l=l.substr(0,l.length-1);const t=new Yi(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new Yi(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,s,o)),this.addChild(i,t,s),i=t}n="",r=d}else n+=t[r];return e.child}}function Ki(t,e){return qi(t)}function qi(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=Zi(s);if(void 0!==r&&s[r]){const t=qi(s[r]);n=t,Object.keys(n).length,s[":@"]&&Ji(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function Zi(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Ji(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class Qi{constructor(t){this.options=Object.assign({},Qi.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Ki(new Hi(this.options).parseXml(t),this.options)}}function tn(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Qi.defaultOptions={};let en=0;function nn(){return en++}var sn;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(sn||(sn={}));const rn=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>rn.set(t,!0)));const an=new Map;function on(t){if(rn.has(t))return!0;if(an.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>an.set(t,!0))),nn(),nn();const ln=nn();nn(),nn();const hn=nn();nn();const dn=nn(),cn=nn(),un=nn();nn(),nn(),nn(),nn();const pn=nn(),gn=nn(),fn=Symbol.for("GraphicCreator"),mn={"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"},yn=Object.keys(mn);var bn;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(bn||(bn={}));class vn extends Gi{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=hn,this._childUpdateTag=kt.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 ni),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new ni)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,n){if(n===Et.GLOBAL){const n=new i.Point(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&kt.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Xe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Xe.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=we.x,y:e=we.y,dx:i=we.dx,dy:n=we.dy,scaleX:s=we.scaleX,scaleY:r=we.scaleY,angle:a=we.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return ri(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return Xe.graphicService.updateTempAABBBounds(i),Xe.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=kt.CLEAR_BOUNDS,this._childUpdateTag&=kt.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=kt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&kt.UPDATE_BOUNDS||(this._childUpdateTag|=kt.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(),Xe.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Xe.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,Xe.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{Xe.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),Xe.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&kt.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=Xe.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new vn(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return vn.NOWORK_ANIMATE_ATTR}}function xn(t){return new vn(t)}function An(t,e){return!(!t&&!e)}function _n(t,e){let n;return n=i.isArray(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function Bn(t,e,i){return i&&t*e>0}function Tn(t,e){return t*e>0}vn.NOWORK_ANIMATE_ATTR=Wi;const Sn=Symbol.for("PolygonRenderContribution"),wn=Symbol.for("SymbolRenderContribution"),Pn=Symbol.for("InteractiveSubRenderContribution");function Mn(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function On(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function Cn(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 Ln(t,e,i){const n=i[0],s=i[1],r=i[2];let a,o,l,h,d,c,u,p,g,f,m,y;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],d=e[4],c=e[5],u=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]=d,t[5]=c,t[6]=u,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=y,t[12]=a*n+d*s+g*r+e[12],t[13]=o*n+c*s+f*r+e[13],t[14]=l*n+u*s+m*r+e[14],t[15]=h*n+p*s+y*r+e[15]),t}function kn(t,e,i){const n=e[0],s=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],d=e[7],c=e[8],u=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],A=i[2],_=i[3];return t[0]=v*n+x*o+A*c+_*f,t[1]=v*s+x*l+A*u+_*m,t[2]=v*r+x*h+A*p+_*y,t[3]=v*a+x*d+A*g+_*b,v=i[4],x=i[5],A=i[6],_=i[7],t[4]=v*n+x*o+A*c+_*f,t[5]=v*s+x*l+A*u+_*m,t[6]=v*r+x*h+A*p+_*y,t[7]=v*a+x*d+A*g+_*b,v=i[8],x=i[9],A=i[10],_=i[11],t[8]=v*n+x*o+A*c+_*f,t[9]=v*s+x*l+A*u+_*m,t[10]=v*r+x*h+A*p+_*y,t[11]=v*a+x*d+A*g+_*b,v=i[12],x=i[13],A=i[14],_=i[15],t[12]=v*n+x*o+A*c+_*f,t[13]=v*s+x*l+A*u+_*m,t[14]=v*r+x*h+A*p+_*y,t[15]=v*a+x*d+A*g+_*b,t}class En{constructor(){this.pools=[]}static identity(t){return Cn(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 En.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const In=new En;var Rn=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Un=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dn=function(t,e){return function(i,n){e(i,n,t)}};function Nn(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:d=i.scaleX,scaleY:c=i.scaleY,scaleZ:u=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!==(n=m[2])&&void 0!==n?n:0}if(Cn(t),Ln(t,t,[s+o,r+l,a+h]),Ln(t,t,[b[0],b[1],b[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*s+h*n,t[5]=a*s+d*n,t[6]=o*s+c*n,t[7]=l*s+u*n,t[8]=h*s-r*n,t[9]=d*s-a*n,t[10]=c*s-o*n,t[11]=u*s-l*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*s-h*n,t[1]=a*s-d*n,t[2]=o*s-c*n,t[3]=l*s-u*n,t[8]=r*n+h*s,t[9]=a*n+d*s,t[10]=o*n+c*s,t[11]=l*n+u*s}(t,t,p),Ln(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[d,c,u]),f){const i=In.allocate(),n=[0,0];if(y){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}Ln(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],d=e[5],c=e[6],u=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*s+h*n,t[1]=a*s+d*n,t[2]=o*s+c*n,t[3]=l*s+u*n,t[4]=h*s-r*n,t[5]=d*s-a*n,t[6]=c*s-o*n,t[7]=u*s-l*n}(i,i,f),Ln(i,i,[-n[0],-n[1],0]),kn(t,t,i)}}let jn=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new dt(["graphic"]),onSetStage:new dt(["graphic","stage"]),onRemove:new dt(["graphic"]),onRelease:new dt(["graphic"]),onAddIncremental:new dt(["graphic","group","stage"]),onClearIncremental:new dt(["graphic","group","stage"]),beforeUpdateAABBBounds:new dt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new dt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new dt(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new i.AABBBounds,this.tempAABBBounds2=new i.AABBBounds}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new pt(t);return Yt(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,n,s){const{textAlign:r,textBaseline:a}=t;if(null!=t.forceBoundsHeight){const e=i.isNumber(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=On(a,e,e);n.set(n.x1,s,n.x2,s+e)}if(null!=t.forceBoundsWidth){const e=i.isNumber(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=Mn(r,e);n.set(s,n.y1,s+e,n.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,n,s,r){if(!e.empty()){const{scaleX:i=n.scaleX,scaleY:r=n.scaleY,stroke:a=n.stroke,shadowBlur:o=n.shadowBlur,lineWidth:l=n.lineWidth,pickStrokeBuffer:h=n.pickStrokeBuffer,strokeBoundsBuffer:d=n.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l){tn(c,(l+h)/Math.abs(i+r),s,d),e.union(c),c.setValue(u.x1,u.y1,u.x2,u.y2)}if(o){const{shadowOffsetX:s=n.shadowOffsetX,shadowOffsetY:a=n.shadowOffsetY}=t;tn(c,o/Math.abs(i+r)*2,!1,d+1),c.translate(s,a),e.union(c)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let a=!0;const o=r.transMatrix;r&&r.isContainer&&(a=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),a&&i.transformBoundsWithMatrix(e,e,o)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),Xe.graphicService.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};jn=Rn([Y(),Dn(0,W(fn)),Un("design:paramtypes",[Object])],jn);const Fn={x:0,y:0,z:0,lastModelMatrix:null};class zn{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Ft.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ft.afterFillStroke)))}beforeRenderStep(t,e,i,n,s,r,a,o,l,h,d,c,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,d,c,u)}))}afterRenderStep(t,e,i,n,s,r,a,o,l,h,d,c,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,s,r,a,o,l,h,d,c,u)}))}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:d=e.strokeOpacity,visible:c=e.visible}=t.attribute,u=Bn(o,l,s),p=Tn(o,d),g=An(s,r),f=_n(a,h);return!(!t.valid||!c)&&!(!g&&!f)&&!!(u||p||i||n||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:s=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:d}=t.attribute,c=i.modelMatrix,u=i.camera;Fn.x=s,Fn.y=r,Fn.z=a,Fn.lastModelMatrix=c;const p=u&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!d:1===o&&1===l&&0===h&&!d;if(p){const n=In.allocate(),s=In.allocate();Nn(s,t,e),kn(n,c||n,s),Fn.x=0,Fn.y=0,Fn.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),In.free(s)}if(g&&!c){const n=t.getOffsetXY(e);Fn.x+=n.x,Fn.y+=n.y,Fn.z=a,i.setTransformForCurrent()}else if(p)Fn.x=0,Fn.y=0,Fn.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const n=t.getOffsetXY(e);Fn.x+=n.x,Fn.y+=n.y,this.transformWithoutTranslate(i,Fn.x,Fn.y,Fn.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Fn.x=0,Fn.y=0,Fn.z=0;return Fn}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,a=n.project(0,0,i),o=n.project(s,0,i),l=n.project(s,r,i),h={x:0,y:0},d={x:s,y:0},c={x:s,y:r};n.camera=null;const u=1/(h.x*(c.y-d.y)-d.x*c.y+c.x*d.y+(d.x-c.x)*h.y),p=-(h.y*(l.x-o.x)-d.y*l.x+c.y*o.x+(d.y-c.y)*a.x)*u,g=(d.y*l.y+h.y*(o.y-l.y)-c.y*o.y+(c.y-d.y)*a.y)*u,f=(h.x*(l.x-o.x)-d.x*l.x+c.x*o.x+(d.x-c.x)*a.x)*u,m=-(d.x*l.y+h.x*(o.y-l.y)-c.x*o.y+(c.x-d.x)*a.y)*u,y=(h.x*(c.y*o.x-d.y*l.x)+h.y*(d.x*l.x-c.x*o.x)+(c.x*d.y-d.x*c.y)*a.x)*u,b=(h.x*(c.y*o.y-d.y*l.y)+h.y*(d.x*l.y-c.x*o.y)+(c.x*d.y-d.x*c.y)*a.y)*u;n.setTransform(p,g,f,m,y,b,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(s,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s){const{context:r}=n;if(!r)return;const{renderable:a}=t.attribute;if(!1===a)return;r.highPerformanceSave();const o=this.transform(t,e,r,i),{x:l,y:h,z:d,lastModelMatrix:c}=o;this.z=d,function(t,e,i,n,s,r,a,o){if(!t.pathProxy)return!1;const l=ri(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:d=l.stroke,opacity:c=l.opacity,fillOpacity:u=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=Bn(c,u,h),v=Tn(c,g),x=An(h),A=_n(d,p);return!f||(!x&&!A||(!(b||v||a||o)||(e.beginPath(),Yt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),A&&(o?o(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,i-m,n-y,l),e.stroke())),x&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,n-y,l),e.fill())),!0)))}(t,r,l,h,0,s)||(this.drawShape(t,r,l,h,n,s),this.z=0,r.modelMatrix!==c&&In.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}}var Wn=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Gn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yn=function(t,e){return function(i,n){e(i,n,t)}};const $n=new class{constructor(){this.time=Ft.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,d,c,u){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}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=ri(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,this.doDrawImage(e,s.data,r,y,b),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n,s){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=i.width(),a=i.height();let o=r,l=a;if(s&&"repeat"!==n&&(e.width||e.height)){const i=e.width,s=e.height;"repeat-x"===n?(o=i*(a/s),l=a):"repeat-y"===n&&(l=s*(r/i),o=r);const h=t.dpr,d=Je.allocate({width:o,height:l,dpr:h}),c=d.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,o,l),c.drawImage(e,0,0,o,l),e=d.nativeCanvas),Je.free(d)}const h=t.dpr,d=t.createPattern(e,n);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,r,a),t.translate(-i.x1,-i.y1)}}};let Vn=class{constructor(t){this.subRenderContribitions=t,this.time=Ft.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,d,c,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,a,o,l,h,d,c,u)}))}};Vn=Wn([Y(),Yn(0,W(at)),Yn(0,$(Pn)),Gn("design:paramtypes",[Object])],Vn);const Xn=new class{constructor(){this.time=Ft.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,a=n.dpr,o=Je.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),s(r,l);const h=n.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Je.free(o),h}createCirclePattern(t,e,n,s){return this.createCommonPattern(t,e,n,s,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,i.pi2),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,a,o,l,h,d,c,u){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,n,l,g,f,m)}drawTexture(t,e,i,n,s,r,a,o,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(o,l,a,i);break;case"diamond":h=this.createDiamondPattern(o,l,a,i);break;case"rect":h=this.createRectPattern(o,l,a,i);break;case"vertical-line":h=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":h=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":h=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":h=this.createGridPattern(o,l,a,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}};const Hn=new class{constructor(){this.time=Ft.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,a,o,l,h,d,c){const u=t.getParsedPath();if(!u)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:A=l.scaleX,scaleY:_=l.scaleY,keepStrokeScale:B=l.keepStrokeScale}=t.attribute,T=(s,r)=>{const a=!(!s||!s.stroke),{distance:o=l[r].distance}=s,h=B?o:He(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,y,i,n,d*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,s,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,s,(v-i)/A,(x-n)/_,l[r]),l[r].opacity=a,e.stroke()}};f&&T(p,"outerBorder"),m&&T(g,"innerBorder")}},Kn=Xn,qn=$n;function Zn(t,e,n,s){if(!e.p1)return;const{offsetX:r=0,offsetY:a=0,offsetZ:o=0}=s||{};if(1===n)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,a+e.p1.y,r+e.p2.x,a+e.p2.y,r+e.p3.x,a+e.p3.y,o):t.lineTo(r+e.p1.x,a+e.p1.y,o);else if(e.p2&&e.p3){const[s]=function(t,e){const{p0:n,p1:s,p2:r,p3:a}=t,o=Ht(n,s,r,a,e),l=i.PointService.pointAtPP(n,s,e),h=i.PointService.pointAtPP(s,r,e),d=i.PointService.pointAtPP(r,a,e),c=i.PointService.pointAtPP(l,h,e),u=i.PointService.pointAtPP(h,d,e);return[new Kt(n,l,c,o),new Kt(o,u,d,a)]}(e,n);t.bezierCurveTo(r+s.p1.x,a+s.p1.y,r+s.p2.x,a+s.p2.y,r+s.p3.x,a+s.p3.y,o)}else{const i=e.getPointAt(n);t.lineTo(r+i.x,a+i.y,o)}}function Jn(t,e,i,n,s,r,a){var o;let l=e.p0,h=n;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)n||(t.lineTo(l.x+s,l.y+r,a),h=!n);else{const{originP1:d,originP2:c}=e;let u;if(d&&!1!==d.defined&&!i?u=l:d&&!1!==c.defined&&(u=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){h=!n;const i=u?u.x:e.p0.x,o=u?u.y:e.p0.y;t.moveTo(i+s,o+r,a)}else u&&(h=!n,t.lineTo(u.x+s,u.y+r,a))}return h}var Qn=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let ts=class extends zn{constructor(){super(...arguments),this.numberType=dn}draw(t,e,i,n){const s=ri(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,n,s,r,a,o,l,h,d,c,u,p,g,f){var m;if(!e)return;t.beginPath();const y=null!==(m=this.z)&&void 0!==m?m:0;(function(t,e,n,s,r){const{offsetX:a=0,offsetY:o=0,offsetZ:l=0,mode:h="none",drawConnect:d=!1}=r||{};if(d&&"none"===h)return;if(!e)return;let c=!0;const{curves:u}=e;if(n>=1){if(d){let e,i=!0;u.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Jn(t,n,e,i,a,o,l),e=n):e=n}))}else u.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+a,e.p0.y+o,l),Zn(t,e,1,r),c=!1):c=!0}));return}if(n<=0)return;let p;"x"===s?p=Nt.ROW:"y"===s?p=Nt.COLUMN:"auto"===s&&(p=e.direction);const g=n*e.tryUpdateLength(p);let f=0,m=!0,y=null;for(let e=0,n=u.length;e<n;e++){const n=u[e],s=n.getLength(p),h=(g-f)/s;if(f+=s,h<0)break;if(d){if(n.originP1===n.originP2){y=n;continue}m=Jn(t,n,y,m,a,o,l),y=n}else{if(!n.defined){c=!0;continue}c&&t.moveTo(n.p0.x+a,n.p0.y+o,l),Zn(t,n,i.min(h,1),r),c=!1}}})(t.camera?t:t.nativeContext,e,h,d,{offsetX:c,offsetY:u,offsetZ:y}),p.cache&&!i.isArray(p.cache)&&p.cache.curves.every((t=>t.defined))&&p.attribute.curveType&&p.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(p,o,l);const{x:b=0,x:v=0}=o;return!1!==n&&(g?g(t,o,l):r&&(t.setCommonStyle(p,o,b-c,v-u,l),t.fill())),!1!==s&&(f?f(t,o,l):a&&(t.setStrokeStyle(p,o,b-c,v-u,l),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,a,o,l,h,d,c,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+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&&(c?c(e,t.attribute,l):s&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==n&&(u?u(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,n,s,r,a,o,l){const h=ri(t,null==a?void 0:a.theme).line,{fill:d=h.fill,stroke:c=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,segments:g,points:f,closePath:m,curveTension:y=h.curveTension,connectedType:b=h.connectedType}=t.attribute;if(!this.valid(t,h,o,l))return;let{curveType:v=h.curveType}=t.attribute;m&&"linear"===v&&(v="linearClosed");const{clipRange:x=h.clipRange,clipRangeByDimension:A=h.clipRangeByDimension}=t.attribute;if(1===x&&!g&&!f.some((t=>!1===t.defined))&&"linear"===v)return this.drawLinearLineHighPerformance(t,e,!!d,!!c,u,p,n,s,h,r,a,o,l);function _(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const s=_e(_(t.points,b),v,{startPoint:e,curveTension:y});return n=s,s})).filter((t=>!!t)),"linearClosed"===v){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=_e(_(n,b),v,{curveTension:y})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===x){let i=!1;t.cache.forEach(((a,g)=>{i||(i=this.drawSegmentItem(e,a,!!d,!!c,u,p,r[g],[h,t.attribute],x,A,n,s,t,o,l))}))}else{const a=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=x*a;let f=0,m=!1;t.cache.forEach(((a,y)=>{if(m)return;const b=a.getLength(),v=(g-f)/b;f+=b,v>0&&(m=this.drawSegmentItem(e,a,!!d,!!c,u,p,r[y],[h,t.attribute],i.min(v,1),A,n,s,t,o,l))}))}}else this.drawSegmentItem(e,t.cache,!!d,!!c,u,p,t.attribute,h,x,A,n,s,t,o,l)}};ts=Qn([Y()],ts);var es=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},is=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ns=function(t,e){return function(i,n){e(i,n,t)}};let ss=class extends zn{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=pn,this.builtinContributions=[Hn,qn,Kn],this.init(t)}drawShape(t,e,n,s,r,a,o,l){var h;const d=ri(t,null==a?void 0:a.theme).symbol,{size:c=d.size,x:u=d.x,y:p=d.y,scaleX:g=d.scaleX,scaleY:f=d.scaleY,fillStrokeOrder:m=d.fillStrokeOrder}=t.attribute,y=this.valid(t,d,o,l);if(!y)return;const{fVisible:b,sVisible:v,doFill:x,doStroke:A}=y,_=t.getParsedPath();if(!_)return;const{keepDirIn3d:B=d.keepDirIn3d}=t.attribute,T=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();const S=(i,r)=>{var a,h,c;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,r=e}const y=()=>{r.fill&&(o?o(e,t.attribute,d):(e.setCommonStyle(t,r,u-n,p-s,d),e.fill()))},b=()=>{r.stroke&&(l?l(e,t.attribute,d):(e.setStrokeStyle(t,r,(u-n)/g,(p-s)/f,d),e.stroke()))};m?(b(),y()):(y(),b())};if(B&&e.camera&&e.project){const t=e.project(n,s,T),r=e.camera;e.camera=null,!1===_.draw(e,i.isArray(c)?[c[0]*g,c[1]*f]:c*g,t.x,t.y,void 0,S)&&e.closePath(),e.camera=r}else!1===_.draw(e,c,n,s,T,S)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,n,s,x,A,b,v,d,r,o,l);const w=()=>{x&&!_.isSvg&&(o?o(e,t.attribute,d):b&&(e.setCommonStyle(t,t.attribute,u-n,p-s,d),e.fill()))},P=()=>{A&&!_.isSvg&&(l?l(e,t.attribute,d):v&&(e.setStrokeStyle(t,t.attribute,(u-n)/g,(p-s)/f,d),e.stroke()))};m?(P(),w()):(w(),P()),this.afterRenderStep(t,e,n,s,x,A,b,v,d,r,o,l)}draw(t,e,i,n){const s=ri(t,null==n?void 0:n.theme).symbol;this._draw(t,s,!1,i,n)}};ss=es([Y(),ns(0,W(at)),ns(0,$(wn)),is("design:paramtypes",[Object])],ss);const rs=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}};function as(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let s=1;s<e.length;s++)t.lineTo(e[s].x+i,e[s].y+n)}function os(t,e){return Math.sqrt(t*t+e*e)}function ls(t,e,i,n,s){const r=e/i;return{x:t.x-n*r,y:t.y-s*r}}const hs=Xn,ds=$n;var cs=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},us=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ps=function(t,e){return function(i,n){e(i,n,t)}};let gs=class extends zn{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=un,this.builtinContributions=[ds,hs],this.init(t)}drawShape(t,e,n,s,r,a,o,l){const h=ri(t,null==a?void 0:a.theme).polygon,{points:d=h.points,cornerRadius:c=h.cornerRadius,x:u=h.x,y:p=h.y,closePath:g=h.closePath,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,m=this.valid(t,h,o,l);if(!m)return;const{fVisible:y,sVisible:b,doFill:v,doStroke:x}=m;e.beginPath(),c<=0||i.isArray(c)&&c.every((t=>0===t))?as(e.camera?e:e.nativeContext,d,n,s):function(t,e,i,n,s){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void as(t,e,i,n);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],d=e[(r+1)%e.length],c=h.x-o.x,u=h.y-o.y,p=h.x-d.x,g=h.y-d.y,f=(Math.atan2(u,c)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(f));let y=Array.isArray(s)?null!==(a=s[r%e.length])&&void 0!==a?a:0:s,b=y/m;const v=os(c,u),x=os(p,g),A=Math.min(v,x);b>A&&(b=A,y=A*m);const _=ls(h,b,v,c,u),B=ls(h,b,x,p,g),T=2*h.x-_.x-B.x,S=2*h.y-_.y-B.y,w=os(T,S),P=ls(h,os(b,y),w,T,S);let M=Math.atan2(_.y-P.y,_.x-P.x);const O=Math.atan2(B.y-P.y,B.x-P.x);let C=O-M;C<0&&(M=O,C=-C),C>Math.PI&&(C-=Math.PI),0===r?t.moveTo(_.x+i,_.y+n):t.lineTo(_.x+i,_.y+n),C&&t.arcTo(h.x+i,h.y+n,B.x+i,B.y+n,y),t.lineTo(B.x+i,B.y+n)}r||t.lineTo(e[l+1].x+i,e[l+1].y+n)}(e.camera?e:e.nativeContext,d,n,s,c,g),g&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,s,v,x,y,b,h,r,o,l);const A=()=>{v&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,u-n,p-s,h),e.fill()))},_=()=>{x&&(l?l(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,u-n,p-s,h),e.stroke()))};f?(_(),A()):(A(),_()),this.afterRenderStep(t,e,n,s,v,x,y,b,h,r,o,l)}draw(t,e,i,n){const s=ri(t,null==n?void 0:n.theme).polygon;this._draw(t,s,!1,i,n)}};gs=cs([Y(),ps(0,W(at)),ps(0,$(Sn)),us("design:paramtypes",[Object])],gs);const fs=Symbol.for("GraphicRender"),ms=Symbol.for("LineRender"),ys=Symbol.for("PolygonRender"),bs=Symbol.for("SymbolRender");class vs{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){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===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=ct.actualBounding,keepCenterInLine:d=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const c=[],u=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let i=0,n=t.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(t[i],this.textOptions,h);let a=t[i].toString();if(n.width>o){const n=this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,o,s,r,l);a=n.str,e=n.width}else e=n.width;c.push({str:a,width:e,ascent:n.ascent,descent:n.descent,keepCenterInLine:d})}u[0]=o}else{let e,i,n=0;for(let s=0,r=t.length;s<r;s++){i=t[s];const r=this.textMeasure.measureTextPixelADscentAndWidth(t[s],this.textOptions,h);e=r.width,n=Math.max(n,e),c.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:d})}u[0]=n}u[1]=c.length*n,u[0]=c.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(p,e,i,c),this.layoutWithBBox(p,c,e,i,n)}layoutWithBBox(t,e,i,n,s){const r=[0,0],a=e.length*s;"top"===n||("middle"===n?r[1]=(t.height-a)/2:"bottom"===n&&(r[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,s,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:s,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,s,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=s/2+(e.ascent-e.descent)/2+r[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<s-t&&("bottom"===n?e.topOffset+=(s-i)/2:"top"===n&&(e.topOffset-=(s-i)/2)),"alphabetic"===n){const t=s/(e.ascent+e.descent);e.topOffset=s/2+(e.ascent-e.descent)/2*t+r[1]}}return r[1]+=s,e}}const xs=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Di];class As extends Gi{get font(){const t=this.getGraphicTheme();return this._font||(this._font=i.getContextFont(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(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(),n=this.attribute,s=this.getMaxWidth(i);if(!Number.isFinite(s))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"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=gn,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return i.isArray(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return ri(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:n=t.angle}=e;if(!n){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new As({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const s=this.obbText.AABBBounds,{x:r,y:a}=e,o={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2},l=i.rotatePoint(o,n,{x:r,y:a});return this._OBBBounds.copy(s),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=n,this._OBBBounds}updateAABBBounds(t,e,n){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:r}=Xe.graphicService.updateTempAABBBounds(n),{scaleX:a=e.scaleX,scaleY:o=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(l){tn(r,l/Math.abs(a+o),!0,h),n.union(r)}return Xe.graphicService.combindShadowAABBBounds(n,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||Xe.graphicService.updateHTMLTextAABBBounds(t,e,n),i.transformBoundsWithMatrix(n,n,this.transMatrix),n}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,s="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),s}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:s=i.fontFamily,textAlign:r=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:l=i.fontWeight,ellipsis:h=i.ellipsis,maxLineWidth:d,stroke:c=i.stroke,wrap:u=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}=n,v=y?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,v);if("normal"===f||u)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),c&&this._AABBBounds.expand(g/2),this._AABBBounds}const A=Xe.graphicUtil.textMeasure,_=new vs(s,{fontSize:o,fontWeight:l,fontFamily:s,lineHeight:x},A).GetLayoutByLines(t,r,a,x,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:d,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{bbox:B}=_;return this.cache.layoutData=_,this.clearUpdateShapeTag(),this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),c&&this._AABBBounds.expand(g/2),this._AABBBounds}updateWrapAABBBounds(t){var e,n,s;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:m=r.ignoreBuf,measureMode:y=r.measureMode,suffixPosition:b=r.suffixPosition,heightLimit:v=0,lineClamp:x,keepCenterInLine:A=r.keepCenterInLine}=this.attribute,_=m?0:this.guessLineHeightBuf(h),B=this.getLineHeight(this.attribute,r,_);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}const T=Xe.graphicUtil.textMeasure,S={fontSize:h,fontWeight:f,fontFamily:a,lineHeight:B},w=new vs(a,S,T),P=i.isArray(t)?t.map((t=>t.toString())):[t.toString()],M=[],O=[0,0];let C=1/0;if(v>0&&(C=Math.max(Math.floor(v/B),1)),x&&(C=Math.min(C,x)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<P.length;t++){const e=P[t];let i=!0;if(t===C-1){const i=T.clipTextWithSuffix(e,S,c,d,!1,b,t!==P.length-1),n=T.measureTextPixelADscentAndWidth(i.str,S,y);M.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:A});break}const r=T.clipText(e,S,c,"break-all"!==g,"keep-all"===g);if(""!==e&&""===r.str||r.wordBreaked){if(d){const t=T.clipTextWithSuffix(e,S,c,d,!1,b);r.str=null!==(n=t.str)&&void 0!==n?n:"",r.width=null!==(s=t.width)&&void 0!==s?s:0}else r.str="",r.width=0;i=!1}const a=T.measureTextPixelADscentAndWidth(r.str,S,y);M.push({str:r.str,width:r.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:A});let o=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(i=!0,o=r.wordBreaked),r.str.length===e.length);else if(i){let i=e.substring(o);"keep-all"===g&&(i=i.replace(/^\s+/g,"")),P.splice(t+1,0,i)}}let t=0;M.forEach((e=>{t=Math.max(t,e.width)})),O[0]=t}else{let t,e,i=0;for(let n=0,s=P.length;n<s;n++){if(n===C-1){const t=T.clipTextWithSuffix(P[n],S,c,d,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,S,y);M.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:A}),i=Math.max(i,t.width);break}e=P[n],t=T.measureTextWidth(e,S),i=Math.max(i,t);const s=T.measureTextPixelADscentAndWidth(e,S,y);M.push({str:e,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:A})}O[0]=i}O[1]=M.length*B;const L={xOffset:0,yOffset:0,width:O[0],height:O[1]};w.LayoutBBox(L,o,l,M);const k=w.layoutWithBBox(L,M,o,l,B);return this.cache.layoutData=k,this.clearUpdateShapeTag(),this._AABBBounds.set(L.xOffset,L.yOffset,L.xOffset+L.width,L.yOffset+L.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,n;const s=this.getGraphicTheme(),r=Xe.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=s.maxLineWidth,ellipsis:h=s.ellipsis,fontFamily:d=s.fontFamily,fontSize:c=s.fontSize,fontWeight:u=s.fontWeight,stroke:p=s.stroke,lineWidth:g=s.lineWidth,verticalMode:f=s.verticalMode,suffixPosition:m=s.suffixPosition}=o,y=this.getLineHeight(o,s,0);let{textAlign:b=s.textAlign,textBaseline:v=s.textBaseline}=o;if(!f){const t=b;b=null!==(e=As.baselineMapAlign[v])&&void 0!==e?e:"left",v=null!==(n=As.alignMapBaseline[t])&&void 0!==n?n:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const t=Mn(b,a),e=this.cache.verticalList.length*y,n=On(v,e,c);return this._AABBBounds.set(n,t,n+e,t+a),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const x=t.map((t=>function(t){const e=[];let i=0,n="";for(let s=0;s<t.length;s++)on(t[s])?i?n+=t[s]:(i=1,n=t[s]):(i&&(e.push({text:n,direction:sn.VERTICAL}),n="",i=0),e.push({text:t[s],direction:sn.HORIZONTAL}));return n&&e.push({text:n,direction:sn.VERTICAL}),e}(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const i=!0===h?s.ellipsis:h,n=r.clipTextWithSuffixVertical(t,{fontSize:c,fontWeight:u,fontFamily:d},l,i,!1,m);x[e]=n.verticalList,a=n.width}else{const i=r.clipTextVertical(t,{fontSize:c,fontWeight:u,fontFamily:d},l,!1);x[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===sn.HORIZONTAL?c:r.measureTextWidth(t.text,{fontSize:c,fontWeight:u,fontFamily:d});a+=e,t.width=e}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const A=Mn(b,a),_=this.cache.verticalList.length*y,B=On(v,_,c);return this._AABBBounds.set(B,A,B+_,A+a),p&&this._AABBBounds.expand(g/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=Ti(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xs;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xs;return super.needUpdateTag(t,e)}clone(){return new As(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return As.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return As.baselineMapAlign}getAlignMapBaseline(){return As.alignMapBaseline}}function _s(t){return new As(t)}As.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Wi),As.baselineMapAlign={top:"left",bottom:"right",middle:"center"},As.alignMapBaseline={left:"top",right:"bottom",center:"middle"};class Bs{bounds(t,e){if(i.isNumber(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 i.isNumber(t)?t:Math.min(t[0],t[1])}}function Ts(t,e,n,s,r){return r?t.arc(n,s,e,0,i.tau,!1,r):t.arc(n,s,e,0,i.tau),!1}var Ss=new class extends Bs{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,s){return Ts(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Ts(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var ws=new class extends Bs{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function Ps(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var Ms=new class extends Bs{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return Ps(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return Ps(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return Ps(t,this.parseSize(e)/2+s,i,n,r)}};function Os(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var Cs=new class extends Bs{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Os(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Os(t,this.parseSize(e)/2+s,i,n)}};function Ls(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class ks extends Bs{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return Ls(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ls(t,this.parseSize(e)/2,i,n,s)}}var Es=new ks;var Is=new class extends ks{constructor(){super(...arguments),this.type="triangle"}};const Rs=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Us=Math.sin(i.tau/10)*Rs,Ds=-Math.cos(i.tau/10)*Rs;function Ns(t,e,n,s){const r=Us*e,a=Ds*e;t.moveTo(n,-e+s),t.lineTo(r+n,a+s);for(let o=1;o<5;++o){const l=i.tau*o/5,h=Math.cos(l),d=Math.sin(l);t.lineTo(d*e+n,-h*e+s),t.lineTo(h*r-d*a+n,d*r+h*a+s)}return t.closePath(),!0}var js=new class extends Bs{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return Ns(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ns(t,this.parseSize(e)/2+s,i,n)}};const Fs=i.sqrt(3);function zs(t,e,i,n){const s=e,r=s/Fs,a=r/5,o=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var Ws=new class extends Bs{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return zs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return zs(t,this.parseSize(e)/2+s,i,n)}};function Gs(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var Ys=new class extends Bs{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Gs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Gs(t,this.parseSize(e)/2+s,i,n)}};function $s(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Vs=new class extends Bs{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return $s(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return $s(t,this.parseSize(e)/2+s,i,n)}};const Xs=-.5,Hs=i.sqrt(3)/2,Ks=1/i.sqrt(12);function qs(t,e,i,n){const s=e/2,r=e*Ks,a=s,o=e*Ks+e,l=-a,h=o;return t.moveTo(s+i,r+n),t.lineTo(a+i,o+n),t.lineTo(l+i,h+n),t.lineTo(Xs*s-Hs*r+i,Hs*s+Xs*r+n),t.lineTo(Xs*a-Hs*o+i,Hs*a+Xs*o+n),t.lineTo(Xs*l-Hs*h+i,Hs*l+Xs*h+n),t.lineTo(Xs*s+Hs*r+i,Xs*r-Hs*s+n),t.lineTo(Xs*a+Hs*o+i,Xs*o-Hs*a+n),t.lineTo(Xs*l+Hs*h+i,Xs*h-Hs*l+n),t.closePath(),!1}var Zs=new class extends Bs{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return qs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return qs(t,this.parseSize(e)/2+s,i,n)}};function Js(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var Qs=new class extends Bs{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return Js(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return Js(t,this.parseSize(e)/2,i,n,s)}};function tr(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var er=new class extends Bs{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return tr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return tr(t,this.parseSize(e)/2,i,n,s)}};function ir(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var nr=new class extends Bs{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return ir(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ir(t,this.parseSize(e)/2,i,n,s)}};const sr=i.sqrt(3);function rr(t,e,i,n){const s=e*sr;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var ar=new class extends Bs{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return rr(t,this.parseSize(e)/2/sr,i,n)}drawOffset(t,e,i,n,s){return rr(t,this.parseSize(e)/2/sr+s,i,n)}};function or(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var lr=new class extends Bs{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return or(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return or(t,this.parseSize(e)/4+s,i,n)}};function hr(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var dr=new class extends Bs{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return hr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return hr(t,this.parseSize(e)/4+s,i,n)}};function cr(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var ur=new class extends Bs{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return cr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return cr(t,this.parseSize(e)/4+s,i,n)}};function pr(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var gr=new class extends Bs{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return pr(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return pr(t,this.parseSize(e)/4+s,i,n)}};function fr(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var mr=new class extends Bs{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return fr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return fr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function yr(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var br=new class extends Bs{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return yr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return yr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function vr(t,e,i,n,s){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var xr=new class extends Bs{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,s){return vr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return vr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function Ar(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function _r(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var Br=new class extends Bs{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,n,s){return i.isNumber(e)?_r(t,e,n,s):Ar(t,e,n,s)}drawOffset(t,e,n,s,r){return i.isNumber(e)?_r(t,e+2*r,n,s):Ar(t,[e[0]+2*r,e[1]+2*r],n,s)}};const Tr=new i.AABBBounds;class Sr{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,i.isArray(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,i,n,s,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),Yt(s.path.commandList,t,i,n,e,e),a&&a(s.path,s.attribute)})),!1):(Yt(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return i.isNumber(t)?t:Math.min(t[0],t[1])}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;Tr.x1=n.bounds.x1*t,Tr.y1=n.bounds.y1*t,Tr.x2=n.bounds.x2*t,Tr.y2=n.bounds.y2*t,e.union(Tr)}))}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 wr={};[Ss,ws,Ms,Cs,ar,Is,js,Ws,Ys,Vs,Zs,Qs,er,Es,nr,lr,dr,ur,gr,Br,mr,br,xr].forEach((t=>{wr[t.type]=t}));const Pr={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"},Mr=new i.AABBBounds,Or=["symbolType","size",...Di];let Cr=class t extends Gi{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=pn}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return i.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:n=e.symbolType}=this.attribute,s=wr[n];if(s)return this._parsedPath=s,s;if(s=t.userSymbolMap[n],s)return this._parsedPath=s,s;if(n=Pr[n]||n,!0===((r=n).startsWith("<svg")||r.startsWith("<?xml"))){const e=new Qi,{svg:s}=e.parse(n);if(!s)return null;const r=i.isArray(s.path)?s.path:[s.path];Mr.clear();const a=[];r.forEach((t=>{const e=(new Be).fromString(t.d),i={};yn.forEach((e=>{t[e]&&(i[mn[e]]=t[e])})),a.push({path:e,attribute:i}),Mr.union(e.bounds)}));const o=Mr.width(),l=Mr.height(),h=1/i.max(o,l);return a.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new Sr(n,a,!0),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}var r;const a=(new Be).fromString(n),o=a.bounds.width(),l=a.bounds.height(),h=1/i.max(o,l);return a.transform(0,0,h,h),this._parsedPath=new Sr(n,a),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}getGraphicTheme(){return ri(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=Xe.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;tn(i,a+(s+o)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return Xe.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,n){const{size:s=e.size}=t;if(i.isArray(s))n.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,Or)}needUpdateTag(t){return super.needUpdateTag(t,Or)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=i.isArray(e)?e:[e,e];return t.path?(new Be).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new Be).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Lr(t){return new Cr(t)}Cr.userSymbolMap={},Cr.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Wi);const kr=["segments","points","curveType","curveTension",...Di];class Er extends Gi{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=dn}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,n,s){"points"===t&&(s.points=Bi(i,n,e))}getGraphicTheme(){return ri(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),Xe.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return Xe.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:s=e.points,connectedType:r}=t,a=i;return s.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:s=e.segments,connectedType:r}=t,a=i;return s.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,kr)}needUpdateTag(t){return super.needUpdateTag(t,kr)}toCustomPath(){const t=this.attribute,e=new Be,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new Er(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Er.NOWORK_ANIMATE_ATTR}}function Ir(t){return new Er(t)}Er.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Wi);const Rr=["path","customPath",...Di];class Ur extends Gi{constructor(t){super(t),this.type="path",this.numberType=cn}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 Be?e.path:(i.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Be?this.cache:t.path)}getGraphicTheme(){return ri(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:s}=Xe.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(r+(s+a)/2)}})(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:r=e.lineJoin}=t;return Xe.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;i.isString(t.path,!0)?this.cache=(new Be).fromString(t.path):t.customPath&&(this.cache=new Be,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Rr)}needUpdateTag(t){return super.needUpdateTag(t,Rr)}toCustomPath(){return(new Be).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Ur(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ur.NOWORK_ANIMATE_ATTR}}function Dr(t){return new Ur(t)}Ur.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Wi);const Nr=["segments","points","curveType","curveTension",...Di];class jr extends Gi{constructor(t){super(t),this.type="area",this.numberType=ln}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 ri(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),Xe.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return Xe.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:s=e.points}=t,r=i;return s.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,n){const{segments:s=e.segments}=t,r=i;return s.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,n,s){"points"===t&&(s.points=Bi(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,Nr)}needUpdateTag(t){return super.needUpdateTag(t,Nr)}toCustomPath(){const t=new Be,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var s,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(s=e.x1)&&void 0!==s?s:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new jr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return jr.NOWORK_ANIMATE_ATTR}}jr.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Wi);const Fr=["points","cornerRadius",...Di];class zr extends Gi{constructor(t){super(t),this.type="polygon",this.numberType=un}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return ri(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),Xe.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return Xe.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,s){"points"===t&&(s.points=Bi(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,Fr)}needUpdateTag(t){return super.needUpdateTag(t,Fr)}toCustomPath(){const t=this.attribute.points,e=new Be;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new zr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return zr.NOWORK_ANIMATE_ATTR}}function Wr(t){return new zr(t)}zr.NOWORK_ANIMATE_ATTR=Wi;var Gr=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};let Yr,$r=class extends ts{constructor(){super(...arguments),this.numberType=dn}drawShape(t,e,i,n,s,r,a,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=ri(t).line,{fill:d=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:m=h.visible}=t.attribute,y=Bn(u,p,d),b=Tn(u,g),v=An(d),x=_n(c,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(y||b||a||o))return;const{context:A}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,A,l[s-1],l[s],t.attribute.segments[s],[h,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,a,o)}drawIncreaseSegment(t,e,i,n,s,r,a,o){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+s,a.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,a,o,r),e.stroke())}};$r=Gr([Y()],$r);let Vr=!1;const Xr=new E((t=>{Vr||(Vr=!0,t(ts).toSelf().inSingletonScope(),t($r).toSelf().inSingletonScope(),t(ms).to(ts).inSingletonScope(),t(fs).toService(ms))}));let Hr=!1;const Kr=new E((t=>{Hr||(Hr=!0,t(ss).toSelf().inSingletonScope(),t(bs).to(ss).inSingletonScope(),t(fs).toService(bs),t(wn).toService(Vn),lt(t,wn))}));let qr=!1;const Zr=new E((t=>{qr||(qr=!0,t(ys).to(gs).inSingletonScope(),t(fs).toService(ys),t(Sn).toService(Vn),lt(t,Sn))}));const Jr=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Qr extends vn{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,n,s){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,s);if(r)return this._setAttributes(r,n);i.isPlainObject(this.attribute[t])&&i.isPlainObject(e)&&!i.isFunction(this.attribute[t])&&!i.isFunction(e)?i.merge(this.attribute[t],e):this.attribute[t]=e,Jr.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e,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=>Jr.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){i.isNil(e)&&(e=Object.keys(t));for(let n=0;n<e.length;n++){const s=e[n];!i.isPlainObject(this.attribute[s])||i.isFunction(this.attribute[s])||i.isFunction(t[s])?this.attribute[s]=t[s]:i.merge(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 n=new hi(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}const ta=Symbol.for("MathPickerContribution"),ea=Symbol.for("MathLinePicker"),ia=Symbol.for("MathSymbolPicker"),na=Symbol.for("MathPolygonPicker"),sa=Symbol.for("CanvasLinePicker"),ra=Symbol.for("CanvasSymbolPicker"),aa=Symbol.for("CanvasPolygonPicker"),oa=Symbol.for("CanvasPickerContribution");class la{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();let{x:r=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);r+=e.x,a+=e.y,n.setTransformForCurrent()}else r=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,r,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,s)=>{if(o)return!0;const r=i.lineWidth||s.lineWidth,a=i.pickStrokeBuffer||s.pickStrokeBuffer,l=i.keepStrokeScale||s.keepStrokeScale;return n.lineWidth=l?r+a:He(n,r+a,n.dpr),o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}}var ha=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},da=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ca=function(t,e){return function(i,n){e(i,n,t)}};let ua=class extends la{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=dn}};ua=ha([Y(),ca(0,W(ms)),da("design:paramtypes",[Object])],ua);let pa=!1;const ga=new E(((t,e,i,n)=>{pa||(pa=!0,t(ea).to(ua).inSingletonScope(),t(ta).toService(ea))}));var fa=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},ma=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ya=function(t,e){return function(i,n){e(i,n,t)}};let ba=class extends la{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=un}};ba=fa([Y(),ya(0,W(ys)),ma("design:paramtypes",[Object])],ba);let va=!1;const xa=new E(((t,e,i,n)=>{va||(va=!0,t(na).to(ba).inSingletonScope(),t(ta).toService(na))}));var Aa=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},_a=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ba=function(t,e){return function(i,n){e(i,n,t)}};let Ta=class extends la{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=pn}};Ta=Aa([Y(),Ba(0,W(bs)),_a("design:paramtypes",[Object])],Ta);let Sa=!1;const wa=new E(((t,e,i,n)=>{Sa||(Sa=!0,t(ia).to(Ta).inSingletonScope(),t(ta).toService(ia))}));class Pa extends zn{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const s=t.getGraphicTheme(),r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=e;if(n.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:He(n,s+r,n.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,n.modelMatrix!==h&&In.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),c}}var Ma=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Oa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ca=function(t,e){return function(i,n){e(i,n,t)}};let La=class extends Pa{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=dn}};La=Ma([Y(),Ca(0,W(ms)),Oa("design:paramtypes",[Object])],La);let ka=!1;const Ea=new E(((t,e,i,n)=>{ka||(ka=!0,t(sa).to(La).inSingletonScope(),t(oa).toService(sa))}));class Ia extends zn{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getGraphicTheme();n.highPerformanceSave();const r=this.transform(t,s,n),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=e;if(n.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!c||(c=t.isPointInPath(d.x,d.y),c))),this.canvasRenderer.z=0,n.modelMatrix!==h&&In.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),c}}var Ra=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Ua=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Da=function(t,e){return function(i,n){e(i,n,t)}};let Na=class extends Ia{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=pn}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const s=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(s.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,n),{x:o,y:l,z:h,lastModelMatrix:d}=a;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const s=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?s+r:He(n,s+r,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==d&&In.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),u}};Na=Ra([Y(),Da(0,W(bs)),Ua("design:paramtypes",[Object])],Na);let ja=!1;const Fa=new E(((t,e,i,n)=>{ja||(ja=!0,t(ra).to(Na).inSingletonScope(),t(oa).toService(ra))}));var za=function(t,e,i,n){var s,r=arguments.length,a=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(s=t[o])&&(a=(r<3?s(a):r>3?s(e,i,a):s(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},Wa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ga=function(t,e){return function(i,n){e(i,n,t)}};let Ya=class extends la{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=un}};Ya=za([Y(),Ga(0,W(ys)),Wa("design:paramtypes",[Object])],Ya);let $a=!1;const Va=new E(((t,e,i,n)=>{$a||($a=!0,t(aa).to(Ya).inSingletonScope(),t(oa).toService(aa))})),Xa=function(){!function(){if(null==Yr)try{const t=document.createElement("canvas"),e=t.getContext("2d");Yr=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),Yr&&(Yr=!!document.createElement)}catch(t){Yr=!1}}();const t=Xe.global&&Xe.global.env;return t?"browser"===t:Yr}();function Ha(){Ha.__loaded||(Ha.__loaded=!0,rs.RegisterGraphicCreator("group",xn))}Ha.__loaded=!1;const Ka=Ha;function qa(){qa.__loaded||(qa.__loaded=!0,rs.RegisterGraphicCreator("line",Ir),Ke.load(Xr),Ke.load(Xa?Ea:ga))}qa.__loaded=!1;const Za=qa;function Ja(){Ja.__loaded||(Ja.__loaded=!0,rs.RegisterGraphicCreator("polygon",Wr),Ke.load(Zr),Ke.load(Xa?Va:xa))}Ja.__loaded=!1;const Qa=Ja;function to(){to.__loaded||(to.__loaded=!0,rs.RegisterGraphicCreator("symbol",Lr),Ke.load(Kr),Ke.load(Xa?Fa:wa))}to.__loaded=!1;const eo=to;Ka(),Za(),Qa(),eo();class io extends Qr{getStartAngle(){return i.normalizeAngle(this._startAngle)}getEndAngle(){return i.normalizeAngle(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},io.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:n,state:s,visible:r=!0,multiSegment:a,mainSegmentIndex:o}=this.attribute;if(!r)return;this._computeLineAngle();const l=this._getMainSegmentPoints(),h=this._renderSymbol(t,l,"start"),d=this._renderSymbol(e,l,"end");if(this.startSymbol=h,this.endSymbol=d,a){const t=[...this.attribute.points];if(i.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const e=this._clipPoints(i.flattenArray(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 r,a;const o=rs.line(Object.assign(Object.assign({points:t},i.isArray(n)?null!==(r=n[e])&&void 0!==r?r:n[n.length-1]:n),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+e),i.isEmpty(null==s?void 0:s.line)||(o.states=i.isArray(s.line)?null!==(a=s.line[e])&&void 0!==a?a:s.line[s.line.length-1]:s.line),this.add(o),this.lines.push(o)}))}else{let t=rs.line;i.array(n)[0].cornerRadius&&(t=rs.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},i.array(n)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),i.isEmpty(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,n){if(!e.length)return;const{autoRotate:s=!0}=t;let r;if(t&&t.visible){const a=this.getStartAngle(),o=this.getEndAngle(),{state:l}=this.attribute,h=e[0],d=e[e.length-1],{refX:c=0,refY:u=0,refAngle:p=0,style:g,symbolType:f,size:m=12}=t;let y,b;"start"===n?(y={x:h.x+(i.isValidNumber(a)?c*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(i.isValidNumber(a)?c*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},b=this._computeStartRotate(this._startAngle)):(y={x:d.x+(i.isValidNumber(o)?c*Math.cos(o)+u*Math.cos(o-Math.PI/2):0),y:d.y+(i.isValidNumber(o)?c*Math.sin(o)+u*Math.sin(o-Math.PI/2):0)},b=this._computeEndRotate(this._endAngle)),r=rs.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:f,size:m,angle:s?b+p:0,strokeBoundsBuffer:0}),g)),r.name=`${this.name}-${n}-symbol`,r.id=this._getNodeId(`${n}-symbol`),i.isEmpty(null==l?void 0:l.symbol)||(r.states=l.symbol),"start"===n?i.isEmpty(null==l?void 0:l.startSymbol)||(r.states=l.startSymbol):i.isEmpty(null==l?void 0:l.endSymbol)||(r.states=l.endSymbol),this.add(r)}return r}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:n}=this.attribute;let s;return s=e?i.isValidNumber(n)?t[n]:i.flattenArray(t):t,this._mainSegmentPoints=s,s}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let n=t;if(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,s={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)};n=[...n.slice(0,n.length-1),s]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],s=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[s.x-n.x,s.y-n.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}}io.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}}};class no{constructor(t,e,i,n){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(n)}getMarks(){return this.marks}registerChannelEncoder(t,e){return i.isString(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}registerFunctionEncoder(t){return this.functionEncoder=t,this}registerDefaultEncoder(t){return this.defaultEncoder=t,this}registerProgressiveChannels(t){return this.progressiveChannels=i.array(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class so{static registerPlotMarks(t,e){so._plotMarks[t]=e}static createPlotMark(t,e){return so._plotMarks[t]?new so._plotMarks[t](e):null}static registerMark(t,e){so._marks[t]=e}static createMark(t,e,i){return so._marks[t]?new so._marks[t](e,t,i):null}static hasMark(t){return!!so._marks[t]}static getMark(t){return so._marks[t]}static registerComponent(t,e){so._components[t]=e}static createComponent(t,e,i,n){const s=so._components[t];return s?new s(e,i,n):null}static hasComponent(t){return!!so._components[t]}static registerGraphicComponent(t,e){so._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const n=so._graphicComponents[t];return n?n(e,i):null}static registerTransform(t,e,i){so._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return so._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(so._transforms).forEach((t=>{so._transforms[t]&&!so._transforms[t].isBuiltIn&&(so._transforms[t]=null)}))}static registerGrammar(t,e,i){so._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var n;const s=null===(n=so._grammars[t])||void 0===n?void 0:n.grammarClass;return s?new s(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return so._glyphs[t]}static createInteraction(t,e,i){const n=so._interactions[t];return n?new n(e,i):null}static hasInteraction(t){return!!so._interactions[t]}}so._plotMarks={},so._marks={},so._components={},so._graphicComponents={},so._transforms={},so._grammars={},so._glyphs={},so._animations={},so._interactions={},so._graphics={},so._stageEventPlugins={},so.registerGlyph=(t,e,i,n,s)=>(so._glyphs[t]=new no(e,i,n,s),so._glyphs[t]),so.registerAnimationType=(t,e)=>{so._animations[t]=e},so.getAnimationType=t=>so._animations[t],so.registerInteraction=(t,e)=>{so._interactions[t]=e},so.registerGraphic=(t,e)=>{so._graphics[t]=e},so.getGraphicType=t=>so._graphics[t],so.createGraphic=(t,e)=>{const i=so._graphics[t];return i?i(e):null},so.registerDefaultLayout=t=>{so.defaultLayout=t},so.getDefaultLayout=()=>so.defaultLayout,so.registerStageEventPlugin=(t,e)=>{so._stageEventPlugins[t]=e},so.getStageEventPlugin=t=>so._stageEventPlugins[t];const ro="seriesBreak";function ao(t,e,i,n,s=!1){const r=[],{x:a,y:o}=t,{x:l,y:h}=e,d=s?Math.floor((h-o)/(2*i)):Math.floor((l-a)/(2*i)),c=Math.PI/180*n,u=i*Math.cos(c),p=i*Math.sin(c);r.push(`M ${a} ${o}`);for(let t=0;t<=d;t++){const e=s?a+(t%2==0?u:-u):a+t*i*2,n=s?o+t*i*2:t%2==0?o-p:o+p;r.push(`L ${e} ${n}`)}return r.push(`L ${s?a:l} ${s?h:o}`),r.join(" ")}class oo extends Qr{constructor(){super(...arguments),this.name=ro}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(i.isEmpty(t))return;const e=[],n=[];t.forEach((t=>{const{start:s,end:r}=t;((t,e)=>{const{start:n,end:s}=e,r=n.x===s.x,a=r?"x":"y",o=r?"y":"x";let l=!0;const h=1e-6;t.length&&t.forEach((t=>{if(i.isNumberClose(t.start[a],n[a])){const e=Math.min(n[o],s[o]),i=Math.max(n[o],s[o]),r=Math.min(t.start[o],t.end[o]),a=Math.max(t.start[o],t.end[o]);if(!(i<r-h||e>a+h))return t.start[o]=Math.min(r,e),t.end[o]=Math.max(a,i),void(l=!1)}})),l&&t.push(e)})(s.x===r.x?e:n,t)})),[...e,...n].forEach(((t,e)=>{var n;const{start:s,end:r,size:a=4,gap:o=5,style:l={}}=t,h=y(t,["start","end","size","gap","style"]),d=xn({}),c=s.x===r.x;let u,p,g,f;c?(u={x:s.x-o/2,y:s.y},p={x:r.x-o/2,y:r.y},g={x:s.x+o/2,y:s.y},f={x:r.x+o/2,y:r.y}):(u={x:s.x,y:s.y-o/2},p={x:r.x,y:r.y-o/2},g={x:s.x,y:s.y+o/2},f={x:r.x,y:r.y+o/2});const m=ao(u,p,a,c?75:15,c),b=ao(s,r,a,c?75:15,c),v=ao(g,f,a,c?75:15,c);d.add(Dr(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),d.add(Dr(Object.assign(Object.assign({path:v,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),d.add(Dr({path:b,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),d.name="series-break",d.data=h,i.isValid(h.axisId)&&(d.id=`${null!==(n=h.axisId)&&void 0!==n?n:""}_${e}`),this.add(d)}))}}function lo(t,e,i=1){return Math.abs(t-e)<i}function ho(t,e){return{type:"component",componentType:ro,interactive:!0,zIndex:500,style:{data:(n,s)=>{const r=[],a=s.vchart.getChart(),o="horizontal"===a.getAllSeries()[0].direction;return t.forEach(((t,n)=>{var s,l;const h=t.id,d=i.isValid(h)?a.getComponentByUserId(h):e&&i.isValid(e[n])?a.getComponentByIndex("axes",e[n]):null===(s=a.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===s?void 0:s[0];if(!d)return;const c=null!=h?h:`${d.type}-${d.id}`,u=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,s=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:d}=a.getLayoutRect();e=Math.min(e,o),n=Math.max(n,h+o),i=Math.min(i,l),s=Math.max(s,d+l)}return{x1:e,y1:i,x2:n,y2:s}}(d.getRegions());i.array(null===(l=d._break)||void 0===l?void 0:l.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,s=d.valueToPosition(e[0]),l=d.valueToPosition(e[1]),h=(s+l)/2+(o?u.x1:u.y1);a.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getProduct().elements.forEach((t=>{const a=t.getBounds();let d,p,g,f,m=!1;o?(m=a.x1<(s+l-n)/2&&a.x2>(s+l+n)/2,d=h,p=Math.max(a.y1+u.y1-2,u.y1),g=h,f=Math.min(a.y2+u.y1+2,u.y2)):(m=a.y1<(s+l-n)/2&&a.y2>(s+l+n)/2,d=Math.max(a.x1+u.x1-2,u.x1),p=h,g=Math.min(a.x2+u.x1+2,u.x2),f=h),m&&r.push({start:{x:d,y:p},end:{x:g,y:f},gap:n,style:null==i?void 0:i.style,axisId:c,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getProduct().elements.forEach((t=>{uo(t.graphicItem,"line").forEach((t=>{co(o?{start:{x:(s+l)/2,y:0},end:{x:(s+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(s+l)/2},end:{x:u.x2-u.x1,y:(s+l)/2}},t).forEach((t=>{let s,a;o?(s={x:h,y:Math.max(t[1]+u.y1-10,u.y1)},a={x:h,y:Math.min(t[1]+u.y1+10,u.y2)}):(s={x:Math.max(t[0]+u.x1-10,u.x1),y:h},a={x:Math.min(t[0]+u.x1+10,u.x2),y:h}),r.push({start:s,end:a,gap:n,style:null==i?void 0:i.style,axisId:c,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getProduct().elements.forEach((t=>{uo(t.graphicItem,"area").forEach((t=>{const a=co(o?{start:{x:(s+l)/2,y:0},end:{x:(s+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(s+l)/2},end:{x:u.x2-u.x1,y:(s+l)/2}},t);a.sort(((t,e)=>t[0]-e[0]));for(let s=0;s<a.length-1;s++){const l={x:a[s][0],y:a[s][1]},h={x:a[s+1][0],y:a[s+1][1]};if(po(o?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,s;o?(t={x:l.x+u.x1,y:Math.max(l.y+u.y1-0,u.y1)},s={x:h.x+u.x1,y:Math.min(h.y+u.y1+0,u.y2)}):(t={x:Math.max(l.x+u.x1-0,u.x1),y:l.y+u.y1},s={x:Math.min(h.x+u.x1+0,u.x2),y:h.y+u.y1}),r.push({start:t,end:s,gap:n,style:null==i?void 0:i.style,axisId:c,data:e})}}}))}))}}))}))})),r}}}}function co(t,e){const n=[];for(let s=1;s<e.length;s++){const r=i.getIntersectPoint([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]);r&&!n.find((t=>lo(i.PointService.distancePP({x:t[0],y:t[1]},{x:r[0],y:r[1]}),0)))&&n.push(r)}return n}function uo(t,e){const{points:i,segments:n}=t.attribute,s=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(s.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!==(n=t.x1)&&void 0!==n?n: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])}s.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),s}function po(t,e){const{x:i,y:n}=t;let s=!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>n!=h>n&&i<(l-a)*(n-o)/(h-o)+a&&(s=!s)}return s}const go="barLink";class fo extends Qr{constructor(){super(...arguments),this.name=go}render(){const{data:t,linkStyle:n,areaStyle:s,styleMap:r,label:a,linkType:o="total"}=this.attribute;i.isEmpty(t)||(this.removeAllChild(),t.forEach(((t,l)=>{var h,d,c,u,p;const{linePoints:g,areaPoints:f,id:m=l,color:y,data:b}=t;if(f&&!1!==(null===(h=null==r?void 0:r[`area-${m}`])||void 0===h?void 0:h.visible)){const t=(v=Object.assign(Object.assign({points:f,fillOpacity:.3,fill:y,zIndex:0},s),null==r?void 0:r[`area-${m}`]),new jr(v));t.name="bar-link-area",t.id=`area-${m}`,this.add(t)}var v;if(g&&!1!==(null===(d=null==r?void 0:r[`line-${m}`])||void 0===d?void 0:d.visible)&&0!==(null===(c=null==n?void 0:n.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==r?void 0:r[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:s}=n||{},a=i.cloneDeep(t),o=i.cloneDeep(e);(null==r?void 0:r[`line-${m}`])&&r[`line-${m}`].stroke&&(a.style=Object.assign(Object.assign({},a.style),{color:r[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:r[`line-${m}`].stroke})),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new io({points:g,startSymbol:Object.assign({size:8},a),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},s),null==r?void 0:r[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==a?void 0:a.visible)&&!1!==(null===(p=null==r?void 0:r[`label-${m}`])||void 0===p?void 0:p.visible)){const{style:t,formatMethod:i}=a,[n,s]=b;let l=n[e.STACK_FIELD_END],h=s[e.STACK_FIELD_END];"value"===o&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],h=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START]);const d=h-l,c=(h-l)/l*100,u=_s(Object.assign(Object.assign({x:.5*(g[0].x+g[1].x),y:.5*(g[0].y+g[1].y),text:i?i(d,c,b):`${d} ${c}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==r?void 0:r[`label-${m}`]));u.name="bar-link-label",u.id=`label-${m}`,this.add(u)}})))}}function mo(t,e,i){const{isHorizontal:n,isXAxisInverse:s,isYAxisInverse:r,linkType:a,doFill:o,regionStartX:l,regionStartY:h}=i,d=t.getGraphicItem(),c=e.getGraphicItem(),u=d.AABBBounds,p=c.AABBBounds;let g,f;return n?(g=[{x:(u.x1+u.x2)/2+l,y:u.y1+h},{x:(p.x1+p.x2)/2+l,y:p.y2+h}],s?("total"===a&&(g=[{x:u.x1+l,y:u.y1+h},{x:p.x1+l,y:p.y2+h}]),o&&(f=[{x:u.x1+l,x1:u.x2+l,y:u.y1+h},{x:p.x1+l,x1:p.x2+l,y:p.y2+h}])):("total"===a&&(g=[{x:u.x2+l,y:u.y1+h},{x:p.x2+l,y:p.y2+h}]),o&&(f=[{x:u.x2+l,x1:u.x1+l,y:u.y1+h},{x:p.x2+l,x1:p.x1+l,y:p.y2+h}]))):(g=[{x:u.x2+l,y:(u.y1+u.y2)/2+h},{x:p.x1+l,y:(p.y1+p.y2)/2+h}],r?("total"===a&&(g=[{x:u.x2+l,y:u.y2+h},{x:p.x1+l,y:p.y2+h}]),o&&(f=[{x:u.x2+l,y:u.y2+h,y1:u.y1+h},{x:p.x1+l,y:p.y2+h,y1:p.y1+h}])):("total"===a&&(g=[{x:u.x2+l,y:u.y1+h},{x:p.x1+l,y:p.y1+h}]),o&&(f=[{x:u.x2+l,y:u.y1+h,y1:u.y2+h},{x:p.x1+l,y:p.y1+h,y1:p.y2+h}]))),{areaPoints:f,linePoints:g,data:[t.data[0],e.data[0]],color:d.attribute.fill}}function yo(t={},i){const{linkType:n="total",doFill:s}=t,r=y(t,["linkType","doFill"]);return{type:"component",componentType:go,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,i;(null===(i=null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getProduct())||void 0===i?void 0:i.elements).forEach((t=>{l.push(t)}))}));const h=function(t,e){var i;const n={};for(let s=0;s<t.length;s++){const r=t[s],a=null===(i=r.data)||void 0===i?void 0:i[0],o=e.map((t=>a[t])).join("-");n[o]||(n[o]=[]),n[o].push(r)}return n}(l,t);Object.values(h).forEach((t=>{t.sort(((t,i)=>t.data[0][e.STACK_FIELD_END]-i.data[0][e.STACK_FIELD_END]))}));const d=i[0],c="horizontal"===d.direction,u=d.getYAxisHelper().isInverse(),p=d.getXAxisHelper().isInverse(),g=Object.values(h);if(g.length)if(c){g[0][0].getGraphicItem().AABBBounds.y1<g[g.length-1][0].getGraphicItem().AABBBounds.y1&&g.reverse()}else{g[0][0].getGraphicItem().AABBBounds.x1>g[g.length-1][0].getGraphicItem().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=mo(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:c,isXAxisInverse:p,isYAxisInverse:u,doFill:s,linkType:n,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=mo(t,i[l],{isHorizontal:c,isXAxisInverse:p,isYAxisInverse:u,doFill:s,linkType:n,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:n},r),i)}}const bo="seriesLabel";function vo(t,e=10,i=10,n=.1){const s=t.length;if(!t.every(isFinite))return t;if(!(s>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let s=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++s<n;)r[s]=t+s*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],s=t[i],null==n||null==s?NaN:n<s?-1:n>s?1:n>=s?0:NaN;var n,s}));let i=0;for(let n=1;n<s;++n){let s=t[r[n]]-t[r[n-1]];s<e&&(s=(e-s)/2,i=Math.max(i,s),t[r[n-1]]-=s,t[r[n]]+=s)}if(i<n)break}return t}function xo(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function Ao(t,e=10,i=10){const n=t.length;let s,r=0;do{s=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(xo(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,s=!0)}}r++}while(s&&r<i)}function _o(t,e){const{label:n,line:s}=e;return{type:"component",componentType:bo,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,n)=>{var s;const r=n.vchart.getChart(),a=r.getAllSeries()[0],o="horizontal"===a.direction,l=o?a.getYAxisHelper():a.getXAxisHelper(),h=null===(s=l.getScale)||void 0===s?void 0:s.call(l,0),d=l.isInverse(),c=a.getDimensionField()[0],u=a.getSeriesField(),p=r.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),g=[];if(1===p.length&&["bar","area","line","waterfall"].includes(p[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?i.last(h.domain()):h.domain()[0],n=a.getRegion(),{x:s,y:l}=n.getLayoutStartPoint();let f=0;r.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===p[0]?"bar":p[0]).getProduct().elements.forEach((n=>{var r;const a=n.data.find((t=>t[c]===e));if(a){const e=n.getGraphicItem(),h=e.AABBBounds;let m,y,b,v;"bar"===p[0]||"waterfall"===p[0]?(m="end"===t?{x:o?(h.x1+h.x2)/2:d?h.x1:h.x2,y:o?d?h.y2:h.y1:(h.y1+h.y2)/2}:{x:o?(h.x1+h.x2)/2:d?h.x2:h.x1,y:o?d?h.y1:h.y2:(h.y1+h.y2)/2},y=e.attribute.fill):(m=i.dataToPosition(a),y=e.attribute.stroke||e.attribute.fill),"end"===t?(b=o?"center":d?"end":"start",v=o?d?"top":"bottom":"middle"):(b=o?"center":d?"start":"end",v=o?d?"bottom":"top":"middle");const x=null!==(r=a[u])&&void 0!==r?r:a[c];g.push({point:{x:m.x+s,y:m.y+l},label:x,color:y,textAlign:b,textBaseline:v,series:i,datum:a,id:`${t}-${f}`,position:t}),f++}}))}))}))}return g},line:s,label:Object.assign({space:12},n)}}}class Bo extends Qr{constructor(){super(...arguments),this.name=bo}render(){var t,e,n,s;this.removeAllChild();const{data:r,layout:a,label:o,line:l={}}=this.attribute;if(i.isEmpty(r))return;const h=null!==(t=null==o?void 0:o.styleMap)&&void 0!==t?t:{},d={},c=r.filter((t=>{var e;return!1!==(null===(e=h[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===a){const t=1.5*(null!==(n=null===(e=null==o?void 0:o.style)||void 0===e?void 0:e.fontSize)&&void 0!==n?n:12),i=(t,e,i)=>{var n,s,r,a,o,l,h,d;const{label:c,color:u,textAlign:p,textBaseline:g,id:f}=t,m=null!==(s=null===(n=i[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=_s(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(c,t.datum,{series:t.series}):c},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:u}),null===(d=i[f])||void 0===d?void 0:d.style));return y.name="series-label-text",y.id=f,this.add(y),y};["start","end"].forEach((e=>{const n=c.filter((t=>t.position===e)),s=vo(n.map((t=>t.point.y)),t);n.forEach(((t,e)=>{var n;const r={x:t.point.x+(null!==(n=null==o?void 0:o.space)&&void 0!==n?n:8)*("start"===t.textAlign?1:-1),y:s[e]};i(t,r,h),d[t.id]=r}))}))}else{const t=[],e=[];c.forEach((i=>{var n,s,r,a,l;const{point:d,label:c,color:u,textAlign:p,textBaseline:g,id:f,position:m}=i,y={x:d.x,y:d.y},b=null!==(s=null===(n=h[f])||void 0===n?void 0:n.formatMethod)&&void 0!==s?s:null==o?void 0:o.formatMethod,v=_s(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(c,i.datum,{series:i.series}):c},null==o?void 0:o.style),y),{textAlign:p,textBaseline:g,fill:null!==(a=null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:u}),null===(l=h[f])||void 0===l?void 0:l.style));v.id=f,v.name="series-label-text",this.add(v),"start"===m?t.push(v):"end"===m&&e.push(v)})),t.length&&Ao(t,4,10),e.length&&Ao(e,4,10);const i=null!==(s=null==o?void 0:o.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),d[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==l.visible&&c.forEach((t=>{var e,i,n,s,r,o;const{point:c,color:u,id:p}=t,g={x:d[p].x+(null!==(n=null===(i=null===(e=h[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==n?n:0),y:d[p].y+(null!==(o=null===(r=null===(s=h[p])||void 0===s?void 0:s.style)||void 0===r?void 0:r.dy)&&void 0!==o?o:0)};if(!1!==l.autoVisible){if("vertical"===a&&c.y!==g.y||"horizontal"===a&&c.x!==g.x){const t=Ir(Object.assign({points:[c,g],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}else{const t=Ir(Object.assign({points:[c,g],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}))}}t.BAR_LINK=go,t.BarLinkComponent=fo,t.ConversionFunnelChart=w,t.ConversionFunnelSeries=P,t.DEFAULT_ARROW_MARK_STYLE=M,t.DEFAULT_ARROW_SYMBOL_MARK_STYLE=O,t.DEFAULT_ARROW_TEXT_MARK_STYLE=C,t.DEFAULT_FUNNEL_BACKGROUND_MARK_STYLE=L,t.RankingBar=a,t.RankingList=u,t.SERIES_BREAK=ro,t.SeriesBreakComponent=oo,t.SeriesLabelComponent=Bo,t.appendBarLinkConfig=function(t,e){t.customMark=i.array(t.customMark).filter((t=>t.componentType!==go)),t.customMark.push(yo(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=i.array(t.customMark).filter((t=>t.componentType!==ro)),t.customMark.push(ho(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var n,s,r;if(t.customMark=i.array(t.customMark).filter((t=>t.componentType!==bo)),e||(e=null!==(r=null!==(n=i.get(t,bo))&&void 0!==n?n:i.get(null===(s=t.series)||void 0===s?void 0:s[0],bo))&&void 0!==r?r:{}),e.visible){const{position:i="end"}=e,n=y(e,["position"]);t.customMark.push(_o(i,n))}},t.getBarLinkConfig=yo,t.getSeriesBreakConfig=ho,t.getSeriesLabelConfig=_o,t.registerBarLink=()=>{so.registerGraphicComponent(go,(t=>new fo(t)))},t.registerConversionFunnelChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([w]),i.useSeries([P]))},t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([a])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([u,e.BarChart])},t.registerSeriesBreak=()=>{so.registerGraphicComponent("seriesBreak",(t=>new oo(t)))},t.registerSeriesLabel=()=>{so.registerGraphicComponent("seriesLabel",(t=>new Bo(t)))}}));
|
|
15
|
+
***************************************************************************** */function d(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}class u extends e.FunnelChart.transformerConstructor{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=d(t,["arrows"]),s=e.filter((t=>"left"===t.position)),n=e.filter((t=>"right"===t.position)),r=p(n,i),a=p(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=d(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},S),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 p(t,e){if(0===(null==t?void 0:t.length))return null;const{line:s,symbol:n,text:r,margin:a}=e,o=[],l={type:"group",children:[]},h=function(t={},e){const{style:i={}}=t,s=d(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({},A),i),{renderable:n,points:(t,i)=>{if(!n(t,i))return[];let s=t.layout.points;return s=f(t,i,e),s}})})}(s,a);h&&o.push(h);const c=function(t={},e){const{style:i={}}=t,s=d(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},s),{style:Object.assign(Object.assign(Object.assign({},B),i),{x:(t,i)=>{var s,n;let r=t.layout.points;return r=f(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=f(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);c&&o.push(c);const u=function(t={},e){const{style:s={},formatMethod:n,textMargin:r=4}=t,a=d(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},a),{style:Object.assign(Object.assign(Object.assign({},T),{text:(t,e)=>{var s,r,a,o,l,h,c;const{text:d}=t;let u=d;if(i.isFunction(n)){const{vchart:i}=e,{from:p,to:f}=t,{field:g}=t.context,m=null!==(a=null===(r=null===(s=null==i?void 0:i.getChart())||void 0===s?void 0:s.getSeriesData())||void 0===r?void 0:r.latestData)&&void 0!==a?a:[],y=null!==(c=null===(h=null===(l=null===(o=null==i?void 0:i.getChart())||void 0===o?void 0:o.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[g]===m[p][g])),x=y.find((t=>t[g]===m[f][g]));u=n(d,{arrow:t,from:b,to:x})}return u},x:(t,i)=>{var s,n;let a=t.layout.points;return a=f(t,i,e),null!==(n=(null===(s=a[1])||void 0===s?void 0:s.x)+("left"===t.position?-r:r))&&void 0!==n?n:NaN},y:(t,i)=>{var s,n,r;let a=t.layout.points;return a=f(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"}),s)})}(r,a);return u&&o.push(u),l.children=o,l}function f(t,e,i){var s,n,r,a,o;const{vchart:l}=e,{from:h,to:c}=t,{field:d}=t.context,u=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 f=[];if(u&&u.length){const s=p.find((t=>t[d]===u[h][d])),n=p.find((t=>t[d]===u[c][d])),r=p[0];if(s&&n&&r){f=function(t,e,i,s,n=12){const{layout:r,distance:a,position:o}=t,{level:l,fromIndex:h,toIndex:c,fromTotal:d,toTotal:u}=r,p="right"===o,f=p?e[1]:e[0],g=p?e[2]:e[3],m=Math.abs(f.y-g.y),y=p?i[1]:i[0],b=p?i[2]:i[3],x=Math.abs(y.y-b.y),v=p?s[1]:s[0],_=m/(d+1),A=x/(u+1),B=f.y+_*(h+1),T=y.y+A*(c+1),S=p?-1:1,w=[{x:f.x-n*S,y:B},{x:v.x-(n+(l+1)*a)*S,y:B},{x:v.x-(n+(l+1)*a)*S,y:T},{x:y.x-n*S,y:T}];return w}(t,e.getPoints(s),e.getPoints(n),e.getPoints(r),i),t.layout.points=f}}return f}function g(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return s>n&&r>i}function m(t,e){const{from:i,to:s}=t,{from:n,to:r}=e;return i===n&&s===r}const y=(t,e)=>{var s,n,r;if(!t||!(null===(s=t.arrows)||void 0===s?void 0:s.length))return[];const{arrows:a}=t,o=function(t,e){return t.filter((t=>i.isValidNumber(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}`})}))}(a,e.categoryField),l=o.filter((t=>"left"===t.position)),h=o.filter((t=>"right"===t.position));return[...null!==(n=b(l))&&void 0!==n?n:[],...null!==(r=b(h))&&void 0!==r?r:[]]};function b(t){if(0===(null==t?void 0:t.length))return null;const e=new Map;return t.forEach((t=>{const s=e.get(t.from);if(i.isValid(s)){const e=s.fromArrows.find((e=>m(e,t)));e?t.layout.duplicateNode=e:s.degree+=1,s.fromArrows.push(t)}else e.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const n=e.get(t.to);if(i.isValid(n)){const e=n.toArrows.find((e=>m(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.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((s=>{var n;const r=t.filter((t=>t.layout.isLayout)),a=i.maxInArray(r,((t,e)=>t.layout.level-e.layout.level));let o=null!==(n=null==a?void 0:a.layout.level)&&void 0!==n?n:0;for(;o>=0;){if(r.some((t=>t.layout.level===o&&g(t,s)))){o+=1;break}--o}s.layout.level=Math.max(0,o),s.layout.fromTotal=e.get(s.from).degree,s.layout.toTotal=e.get(s.to).degree;const l=s.layout.duplicateNode;l?(s.layout.fromIndex=l.layout.fromIndex,s.layout.toIndex=l.layout.toIndex):(s.layout.fromIndex=x(s,e.get(s.from).totalArrows),s.layout.toIndex=x(s,e.get(s.to).totalArrows)),s.layout.isLayout=!0})),t}function x(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 v extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=u}}v.type="conversionFunnel",v.transformerConstructor=u;class _ 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 c(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",y),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 A={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},B={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},T={fill:"#606773",fontSize:12},S={fill:"#eff1f9"};class w{static GenAutoIncrementId(){return w.auto_increment_id++}}w.auto_increment_id=0;class P{constructor(t){this.id=w.GenAutoIncrementId(),this.registry=t}}const M="named",O="inject",C="inversify:tagged",k="inversify:paramtypes";class L{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===M?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var E=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=g(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=g(e);return c(s)?void 0:l(t,s,i)}function h(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(t,i){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const s=3===i?"string":5===i?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!f(i))throw new TypeError;return i}}(t,e);if(void 0!==n){const e=n.call(t,s);if(d(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(f(e)){const i=e.call(t);if(!d(i))return i}const i=t.valueOf;if(f(i)){const e=i.call(t);if(!d(e))return e}}else{const e=t.valueOf;if(f(e)){const i=e.call(t);if(!d(i))return i}const i=t.toString;if(f(i)){const e=i.call(t);if(!d(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}function p(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function f(t){return"function"==typeof t}function g(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(!d(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(!d(e))throw new TypeError;return h(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return h(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(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 I(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};E.hasOwnMetadata(t,e)&&(r=E.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,E.defineMetadata(t,r,e)}(C,t,i.toString(),s)}function R(t){return(e,i,s)=>{I(e,0,s,t)}}const U=(D=O,t=>(e,i,s)=>R(new L(D,t))(e,i,s));var D;function N(){return function(t){return E.defineMetadata(k,null,t),t}}function j(t){return R(new L(M,t))}const F="Singleton",z="Transient",W="ConstantValue",G="DynamicValue",$="Factory",Y="Function",V="Instance",X="Invalid";class H{constructor(t,e){this.id=w.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=X,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new H(this.serviceIdentifier,this.scope);return t.activated=t.scope===F&&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 K{getConstructorMetadata(t){return{compilerGeneratedMetadata:E.getMetadata(k,t),userGeneratedMetadata:E.getMetadata(C,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const q=(Z=M,t=>{const e=e=>{if(null==e)return!1;if(e.key===Z&&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===Z&&i[e].value===t)return!0;return!1};return e.metaData=new L(Z,t),e});var Z;class J{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=F,this}inTransientScope(){return this._binding.scope=z,this}whenTargetNamed(t){return this._binding.constraint=q(t),this}}class Q{constructor(t){this._binding=t}to(t){return this._binding.type=V,this._binding.implementationType=t,new J(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=G,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new J(this._binding)}toConstantValue(t){return this._binding.type=W,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=F,new J(this._binding)}toFactory(t){return this._binding.type=$,this._binding.factory=t,this._binding.scope=F,new J(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const tt=Symbol("ContributionProvider");class et{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function it(t,e){t(tt).toDynamicValue((t=>{let{container:i}=t;return new et(e,i)})).inSingletonScope().whenTargetNamed(e)}class st{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 nt extends st{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}var rt;!function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(rt||(rt={}));const at=i.tau-1e-8;class ot{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,s,n,r,a){if(Math.abs(r-n)>at)return this.bounds.add(t-s,e-s),void this.bounds.add(t+s,e+s);let o,l,h,c,d=1/0,u=-1/0,p=1/0,f=-1/0;function g(t){h=s*Math.cos(t),c=s*Math.sin(t),h<d&&(d=h),h>u&&(u=h),c<p&&(p=c),c>f&&(f=c)}if(g(n),g(r),r!==n)if((n%=i.tau)<0&&(n+=i.tau),(r%=i.tau)<0&&(r+=i.tau),r<n&&(a=!a,o=n,n=r,r=o),a)for(r-=i.tau,o=n-n%i.halfPi,l=0;l<4&&o>r;++l,o-=i.halfPi)g(o);else for(o=n-n%i.halfPi+i.halfPi,l=0;l<4&&o<r;++l,o+=i.halfPi)g(o);this.bounds.add(t+d,e+p),this.bounds.add(t+u,e+f)}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(){}}class lt{constructor(){this.curves=[],this.bounds=new i.AABBBounds}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ht=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ct={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},dt=0,ut=1,pt=2,ft=3,gt=4,mt=5,yt=6,bt=7,xt=8;let vt,_t,At,Bt,Tt,St;var wt,Pt,Mt,Ot,Ct,kt,Lt,Et,It;function Rt(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,d=o*r,u=l*a,p=Math.cos(s),f=Math.sin(s),g=Math.cos(n),m=Math.sin(n),y=.5*(n-s),b=Math.sin(.5*y),x=8/3*b*b/Math.sin(y),v=e+p-x*f,_=i+f+x*p,A=e+g,B=i+m,T=A+x*m,S=B-x*g;return[h*v+c*_,d*v+u*_,h*T+c*S,d*T+u*S,h*A+c*B,d*A+u*B]}function Ut(t,e,s,n){const r=function(t,e,s,n,r,a,o,l,h){const c=i.degreeToRadian(o),d=Math.sin(c),u=Math.cos(c),p=u*(l-t)*.5+d*(h-e)*.5,f=u*(h-e)*.5-d*(l-t)*.5;let g=p*p/((s=Math.abs(s))*s)+f*f/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),s*=g,n*=g);const m=u/s,y=d/s,b=-d/n,x=u/n,v=m*l+y*h,_=b*l+x*h,A=m*t+y*e,B=b*t+x*e;let T=1/((A-v)*(A-v)+(B-_)*(B-_))-.25;T<0&&(T=0);let S=Math.sqrt(T);a===r&&(S=-S);const w=.5*(v+A)-S*(B-_),P=.5*(_+B)+S*(A-v),M=Math.atan2(_-P,v-w);let O=Math.atan2(B-P,A-w)-M;O<0&&1===a?O+=i.tau:O>0&&0===a&&(O-=i.tau);const C=Math.ceil(Math.abs(O/(i.halfPi+.001))),k=[];for(let t=0;t<C;++t){const e=M+t*O/C,i=M+(t+1)*O/C;k[t]=[w,P,e,i,s,n,d,u]}return k}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,s);for(let e=0;e<r.length;++e){const i=Rt(r[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"}(wt||(wt={})),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"}(Pt||(Pt={})),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"}(Mt||(Mt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Ot||(Ot={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Ct||(Ct={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(kt||(kt={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Lt||(Lt={})),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"}(Et||(Et={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(It||(It={}));const Dt=[(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 Nt(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const l=t[o];Dt[l[0]](l,e,i,s,n,r,a)}}class jt{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ft(t,e,s,n,r){return function(t,e){let s=0;const n=t.length;for(let r=0;r<n;r++){const a=t[r],o=e[r],l=t[(r+1)%n],h=e[(r+1)%n];s+=i.PointService.distanceNN(a,o,l,h)}return s/2}([t.x,e.x,s.x,n.x],[t.y,e.y,s.y,n.y])}function zt(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 Wt(t,e,s,n,r){const a=zt(t.x,e.x,s.x,n.x,r),o=zt(t.y,e.y,s.y,n.y,r);return new i.Point(a,o)}class Gt extends jt{constructor(t,e,i,s){super(),this.type=Et.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 Wt(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Ft(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Lt.ROW?i.abs(this.p0.x-this.p3.x):t===Lt.COLUMN?i.abs(this.p0.y-this.p3.y):0}getAngleAt(t){const e=i.max(t-.01,0),s=i.min(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(s);return i.atan2(r.y-n.y,r.x-n.x)}}class $t extends jt{constructor(t,e){super(),this.type=Et.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return i.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=i.atan2(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()?i.PointService.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Lt.ROW?i.abs(this.p0.x-this.p1.x):t===Lt.COLUMN?i.abs(this.p0.y-this.p1.y):0}}class Yt{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,s,n,r,a,o,l){const h=new Gt(new i.Point(this._lastX,this._lastY),new i.Point(t,e),new i.Point(s,n),new i.Point(r,a));h.originP1=this._lastOriginP,h.originP2=l,h.defined=o,this.curves.push(h),this._lastX=r,this._lastY=a,this._lastOriginP=l}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,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,s,n,r){const a=new $t(new i.Point(this._lastX,this._lastY),new i.Point(t,e));return a.originP1=n,a.originP2=r,a.defined=s,a}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,s;if(t===Lt.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],s=this.curves[this.curves.length-1],n=null!==(e=s.p3)&&void 0!==e?e:s.p1;return i.abs(t.p0.y-n.y)}if(t===Lt.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(s=e.p3)&&void 0!==s?s:e.p1;return i.abs(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Vt extends Yt{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 Xt(t,e){let i=!1;for(let s=0,n=e.length;s<=n;s++)s>=n===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[s])}function Ht(t,e,s){const n=null!=e?e:i.abs(s[s.length-1].x-s[0].x)>i.abs(s[s.length-1].y-s[0].y)?Lt.ROW:Lt.COLUMN;return"monotoneY"===t?new Vt(t,n):new Yt(t,n)}class Kt{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 qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Ht("linear",i,t);return function(t,e){Xt(t,e)}(new Kt(n,s),t),n}function Zt(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 Jt{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&&Zt(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:Zt(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 Qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return qt(t,e);const n=Ht("basis",i,t);return function(t,e){Xt(t,e)}(new Jt(n,s),t),n}function te(t){return t<0?-1:1}function ee(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(te(r)+te(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function ie(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function se(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 ne{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:se(this,this._t0,ie(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,se(this,ie(this,e=ee(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:se(this,this._t0,e=ee(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 re extends ne{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function ae(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return qt(t,e);const n=Ht("monotoneX",i,t);return function(t,e){Xt(t,e)}(new ne(n,s),t),n}function oe(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return qt(t,e);const n=Ht("monotoneY",i,t);return function(t,e){Xt(t,e)}(new re(n,s),t),n}let le=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const 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()}};function he(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:r}=s;if(t.length<2-Number(!!r))return null;const a=new Yt("step",null!=n?n:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?Lt.ROW:Lt.COLUMN);return function(t,e){Xt(t,e)}(new le(a,e,r),t),a}class ce extends Kt{lineEnd(){this.context.closePath()}}function de(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=Ht("linear",i,t);return function(t,e){Xt(t,e)}(new ce(n,s),t),n}function ue(t,e,s,n,r){let a=t._x1,o=t._y1,l=t._x2,h=t._y2;if(t._l01_a>i.epsilon){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);a=(a*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>i.epsilon){const i=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*i+t._x1*t._l23_2a-e*t._l12_2a)/n,h=(h*i+t._y1*t._l23_2a-s*t._l12_2a)/n}t.context.bezierCurveTo(a,o,l,h,t._x2,t._y2,n,t.lastPoint1)}function pe(t,e){return function(i,s){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return qt(i,n);const o=Ht(t,r,i);return Xt(new e(o,s,a),i),o}}const fe=pe("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,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:ue(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 ge=pe("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,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:ue(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function me(t,e,i){var s,n;switch(e){case"linear":default:return qt(t,i);case"basis":return Qt(t,i);case"monotoneX":return ae(t,i);case"monotoneY":return oe(t,i);case"step":return he(t,.5,i);case"stepBefore":return he(t,0,i);case"stepAfter":return he(t,1,i);case"catmullRom":return fe(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return ge(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return de(t,i)}}class ye extends lt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ot(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([yt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([mt,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([bt,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([pt,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([ut,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([gt,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([xt,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([dt,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([ft]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[yt]=t=>`M${t[1]} ${t[2]}`,t[mt]=t=>`L${t[1]} ${t[2]}`,t[bt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[pt]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[dt]=t=>{const e=[];((t,e,i,s,n,r,a)=>{const o=Math.abs(i-e),l=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,h=(i-e)/l;for(let i=0;i<l;i++){const o=e+h*i,l=e+h*(i+1),c=4*Math.tan(Math.abs(h)/4)/3,d=l<o?-1:1,u=Math.cos(o),p=Math.sin(o),f=Math.cos(l),g=Math.sin(l),m=u*r+s,y=p*a+n,b=f*r+s,x=g*a+n,v=r*c*d,_=a*c*d;t.push(m-v*p,y+_*u,b+v*g,x-_*f,b,x)}})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[xt]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ft]=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(vt=e[t],_t=vt.slice(1),At=vt[0],i=[At],s=_t.match(ht),null!==s){for(let t=0,e=s.length;t<e;t++)Bt=s[t],Tt=parseFloat(Bt),Number.isNaN(Tt)||i.push(Tt);if(St=ct[At],i.length-1>St){let t,e=At;for(let s=1,r=i.length;s<r;s+=St){t=[e];for(let e=s,n=s+St;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=me(e,i);"x"===s?this.direction=Lt.ROW:"y"===s?this.direction=Lt.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[yt]=this.moveToTransform,t[mt]=this.lineToTransform,t[bt]=this.quadraticCurveToTransform,t[pt]=this.bezierCurveToTransform,t[ut]=this.arcToTransform,t[gt]=this.ellipseTransform,t[xt]=this.rectTransform,t[dt]=this.arcTransform,t[ft]=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){let e,i,s,n,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,d=0,u=0,p=0,f=0;for(let g=0,m=t.length;g<m;++g){switch(e=t[g],1===l&&1===h||(e=xe(e,l,h)),e[0]){case"l":d+=e[1],u+=e[2],this.lineTo(d+a,u+o);break;case"L":d=e[1],u=e[2],this.lineTo(d+a,u+o);break;case"h":d+=e[1],this.lineTo(d+a,u+o);break;case"H":d=e[1],this.lineTo(d+a,u+o);break;case"v":u+=e[1],this.lineTo(d+a,u+o);break;case"V":u=e[1],this.lineTo(d+a,u+o);break;case"m":d+=e[1],u+=e[2],this.moveTo(d+a,u+o);break;case"M":d=e[1],u=e[2],this.moveTo(d+a,u+o);break;case"c":i=d+e[5],s=u+e[6],p=d+e[3],f=u+e[4],this.bezierCurveTo(d+e[1]+a,u+e[2]+o,p+a,f+o,i+a,s+o),d=i,u=s;break;case"C":d=e[5],u=e[6],p=e[3],f=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,f+o,d+a,u+o);break;case"s":i=d+e[3],s=u+e[4],p=2*d-p,f=2*u-f,this.bezierCurveTo(p+a,f+o,d+e[1]+a,u+e[2]+o,i+a,s+o),p=d+e[1],f=u+e[2],d=i,u=s;break;case"S":i=e[3],s=e[4],p=2*d-p,f=2*u-f,this.bezierCurveTo(p+a,f+o,e[1]+a,e[2]+o,i+a,s+o),d=i,u=s,p=e[1],f=e[2];break;case"q":i=d+e[3],s=u+e[4],p=d+e[1],f=u+e[2],this.quadraticCurveTo(p+a,f+o,i+a,s+o),d=i,u=s;break;case"Q":i=e[3],s=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,s+o),d=i,u=s,p=e[1],f=e[2];break;case"t":i=d+e[1],s=u+e[2],null===c[0].match(/[QqTt]/)?(p=d,f=u):"t"===c[0]?(p=2*d-n,f=2*u-r):"q"===c[0]&&(p=2*d-p,f=2*u-f),n=p,r=f,this.quadraticCurveTo(p+a,f+o,i+a,s+o),d=i,u=s,p=d+e[1],f=u+e[2];break;case"T":i=e[1],s=e[2],p=2*d-p,f=2*u-f,this.quadraticCurveTo(p+a,f+o,i+a,s+o),d=i,u=s;break;case"a":Ut(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+d+a,e[7]+u+o]),d+=e[6],u+=e[7];break;case"A":Ut(this,d+a,u+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),d=e[6],u=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;r<a;++r){const a=t[r].slice();switch(a[0]){case mt:this.lineToTransform(a,e,i,s,n);break;case yt:this.moveToTransform(a,e,i,s,n);break;case pt:this.bezierCurveToTransform(a,e,i,s,n);break;case bt:this.quadraticCurveToTransform(a,e,i,s,n);break;case dt:this.arcToTransform(a,e,i,s,n);break;case gt:this.ellipseTransform(a,e,i,s,n);break;case xt:this.rectTransform(a,e,i,s,n);break;case ut:this.arcToTransform(a,e,i,s,n);break;case ft:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Nt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Lt.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return i.abs(t.p0.y-e.p1.y)}if(this.direction===Lt.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return i.abs(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let 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)}}}const be=["l",0,0,0,0,0,0,0];function xe(t,e,i){const s=be[0]=t[0];if("a"===s||"A"===s)be[1]=e*t[1],be[2]=i*t[2],be[3]=t[3],be[4]=t[4],be[5]=t[5],be[6]=e*t[6],be[7]=i*t[7];else if("h"===s||"H"===s)be[1]=e*t[1];else if("v"===s||"V"===s)be[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)be[s]=(s%2==1?e:i)*t[s];return be}const ve={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 i.Matrix},_e={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Ae=Object.assign({outerBorder:Object.assign(Object.assign({},_e),{distance:0}),innerBorder:Object.assign(Object.assign({},_e),{distance:0})},_e),Be={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:rt.fontBounding,keepCenterInLine:!1},Te=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Ae),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Se={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},we=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1},{_debug_bounds:!1}),Te),ve),Pe=Object.assign(Object.assign({},we),{startAngle:0,endAngle:i.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Me=Object.assign(Object.assign(Object.assign({},we),Se),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Oe=Object.assign(Object.assign({},we),{radius:1,startAngle:0,endAngle:i.pi2}),Ce=Object.assign(Object.assign({},we),{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}),ke=Object.assign(Object.assign({},we),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Le=Object.assign(Object.assign(Object.assign({},we),Se),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Ee=Object.assign(Object.assign({},we),{path:new ye,fillStrokeOrder:1,customPath:()=>{i.Logger.getInstance().warn("空函数")}}),Ie=Object.assign(Object.assign({},we),{points:[],cornerRadius:0,closePath:!0}),Re=Object.assign(Object.assign({},we),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},we),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Ue=Object.assign(Object.assign({},we),{symbolType:"circle",size:10,keepDirIn3d:!0}),De=Object.assign(Object.assign(Object.assign({},we),Be),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Ne=Object.assign(Object.assign(Object.assign({},we),Be),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),je=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},we),{fill:!0,cornerRadius:0}),Fe=Object.assign(Object.assign({},je),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});const ze=new class{};function We(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)}const Ge=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||z,this.options=e,this.id=w.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new K}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,M,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new H(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new Q(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[O],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 W:case Y:e=t.cache;break;case V: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===F&&(t.cache=e,t.activated=!0)}},$e=Symbol.for("CanvasFactory");function Ye(t){return Ge.getNamed($e,ze.global.env)(t)}const Ve=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=Ye(Object.assign({nativeCanvas:ze.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=Ye(Object.assign({nativeCanvas:ze.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},Xe={arc:Pe,area:Me,circle:Oe,line:Le,path:Ee,symbol:Ue,text:De,rect:Re,polygon:Ie,richtext:Ne,richtextIcon:Fe,image:je,group:Ce,glyph:ke},He=Object.keys(Xe);function Ke(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const qe={arc:Object.assign({},Xe.arc),area:Object.assign({},Xe.area),circle:Object.assign({},Xe.circle),line:Object.assign({},Xe.line),path:Object.assign({},Xe.path),symbol:Object.assign({},Xe.symbol),text:Object.assign({},Xe.text),rect:Object.assign({},Xe.rect),polygon:Object.assign({},Xe.polygon),richtext:Object.assign({},Xe.richtext),richtextIcon:Object.assign({},Xe.richtextIcon),image:Object.assign({},Xe.image),group:Object.assign({},Xe.group),glyph:Object.assign({},Xe.glyph)};class Ze{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},He.forEach((t=>{this._defaultTheme[t]=Object.create(qe[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||s)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,i.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;He.forEach((s=>{const n=Object.create(qe[s]);t&&t[s]&&Ke(n,t[s]),i[s]&&Ke(n,i[s]),e[s]&&Ke(n,e[s]),this.combinedTheme[s]=n})),e.common&&He.forEach((t=>{Ke(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 Je=new Ze;function Qe(t,e){return t.glyphHost?Qe(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)):Je.getTheme()}return null}(t)||t.attachedThemeGraphic&&Qe(t.attachedThemeGraphic)||Je.getTheme()}var ti=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 ei extends i.EventEmitter{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=w.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ti(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){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return 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&&i.Logger.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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],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){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,s){const n=i.isBoolean(s,!0)&&s||i.isObject(s)&&s.capture,r=i.isObject(s)&&s.once,a=i.isFunction(e)?void 0:e;return t=n?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent,r?super.once(t,e,a):super.on(t,e,a),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,s){const n=i.isBoolean(s,!0)&&s||i.isObject(s)&&s.capture,r=i.isFunction(e)?void 0:e;t=n?`${t}capture`:t,e=i.isFunction(e)?e:e.handleEvent;const a=i.isObject(s)&&s.once;return super.off(t,e,r,a),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,s){return i.isObject(s)?(s.once=!0,this.addEventListener(t,e,s)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),s=1;s<e;s++)i[s-1]=arguments[s];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class ii{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=ii.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&i.isFunction(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&&i.isFunction(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class si extends ii{constructor(t,e){super(),this.type=t,this.detail=e}}const ni={dispatchEvent(t){var e;if(!(t instanceof ii))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 si(t,e))}};class ri{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-ri.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ri.bounceIn(2*t):.5*ri.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(s){if(0===s||1===s)return s;const n=e/i.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(s-=1))*Math.sin((s-n)*i.pi2/e)}}static getElasticOut(t,e){return function(s){if(0===s||1===s)return s;const n=e/i.pi2*Math.asin(1/t);return t*Math.pow(2,-10*s)*Math.sin((s-n)*i.pi2/e)+1}}static getElasticInOut(t,e){return function(s){const n=e/i.pi2*Math.asin(1/t);return(s*=2)<1?t*Math.pow(2,10*(s-=1))*Math.sin((s-n)*i.pi2/e)*-.5:t*Math.pow(2,-10*(s-=1))*Math.sin((s-n)*i.pi2/e)*.5+1}}}ri.quadIn=ri.getPowIn(2),ri.quadOut=ri.getPowOut(2),ri.quadInOut=ri.getPowInOut(2),ri.cubicIn=ri.getPowIn(3),ri.cubicOut=ri.getPowOut(3),ri.cubicInOut=ri.getPowInOut(3),ri.quartIn=ri.getPowIn(4),ri.quartOut=ri.getPowOut(4),ri.quartInOut=ri.getPowInOut(4),ri.quintIn=ri.getPowIn(5),ri.quintOut=ri.getPowOut(5),ri.quintInOut=ri.getPowInOut(5),ri.backIn=ri.getBackIn(1.7),ri.backOut=ri.getBackOut(1.7),ri.backInOut=ri.getBackInOut(1.7),ri.elasticIn=ri.getElasticIn(1,.3),ri.elasticOut=ri.getElasticOut(1,.3),ri.elasticInOut=ri.getElasticInOut(1,.3*1.5);const ai=new class{constructor(){this.id=w.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Ot.END?this.removeAnimate(e):e.status===Ot.RUNNING||e.status===Ot.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ot.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}};class oi{constructor(t,e,i,s,n){this.from=t,this.to=e,this.duration=i,this.easing=s,this.params=n,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class li extends oi{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class hi{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ai,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||ai,this.status=Ot.INITIAL,this.tailAnimate=new ci(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=i.max(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){hi.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hi.mode;t&&e&Ct.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Mt.ANIMATE_PLAY})}runCb(t){const e=new li((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=hi.interpolateMap.get(t)||hi.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===Ot.RUNNING&&(this.status=Ot.PAUSED)}resume(){this.status===Ot.PAUSED&&(this.status=Ot.RUNNING)}to(t,e,i,s){if(this.tailAnimate.to(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,s){if(this.tailAnimate.from(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new ci(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Ot.INITIAL&&(this.status=Ot.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Ot.RUNNING&&(this.status=Ot.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const s=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=n;if(r&&(t=n),t===s)return r;for(let s=0;s<this.subAnimates.length&&(e=this.subAnimates[s],!(i+e.totalDuration>=t));s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),r}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Ot.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}hi.mode=Ct.NORMAL,hi.interpolateMap=new Map;class ci{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new di(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,s="string"==typeof i?ri[i]:i,n=this._addStep(e,null,s);return n.type=kt.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,s){(null==e||e<0)&&(e=0);const n="string"==typeof i?ri[i]:i,r=this._addStep(e,null,n);return r.type=kt.to,this._appendProps(t,r,!!s&&s.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),s&&s.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,s){this.to(t,0,i,s);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,s),this.stepTail.type=kt.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=kt.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const s=new di(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(s),this.stepTail=s,s}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let s=e.prev;const n=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));s.prev;)s.props&&(s.propKeys||(s.propKeys=Object.keys(s.props)),s.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=s.props[t])}))),e.propKeys=Object.keys(e.props),s=s.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,s=this.loop,n=this.rawPosition;let r,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,i<=0&&(o=!0,i<0))return o;if(r=Math.floor(t/i),a=t-r*i,o=t>=s*i+i,o&&(a=i,r=s,t=a*r+i),t===n)return o;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const s=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=s;)i=r,r=i.next;let a=t?0===n?1:s/n:(s-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let s=e.prev;for(;s;){if(s.props&&void 0!==s.props[t])return s.props[t];if(s.customAnimate){const e=s.customAnimate.getEndProps()[t];if(void 0!==e)return e}s=s.prev}return i.Logger.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class di{constructor(t,e,i,s){this.duration=e,this.position=t,this.props=i,this.easing=s}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const ui=200,pi="cubicOut";var fi;!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"}(fi||(fi={}));const gi=[0,0,0,0];function mi(t,e,s){const{x:n,y:r}=i.pointAt(t.x,t.y,e.x,e.y,s),{x:a,y:o}=i.pointAt(t.x1,t.y1,e.x1,e.y1,s),l=new i.Point(n,r,a,o);return l.defined=e.defined,l}function yi(t,e,s){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<e.length;i++)n[i]=mi(t[i],e[i],s)}else{n=e.map((t=>{const e=new i.Point(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let i=0;i<t.length;i++)n[i]=mi(t[i],e[i],s)}return n}const bi=(t,e)=>{const s=((t,e)=>i.isString(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t)(t,e);return isNaN(s)?s:Math.max(e,s)};var xi;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(xi||(xi={}));class vi{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xi.Color1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===xi.Color1){const e=vi.store1[t];if(e)return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s;const n=i.Color.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];vi.store1[t]=e,vi.store255[t]=[n.r,n.g,n.b,n.opacity],s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3]}return s}const n=vi.store255[t];if(n)return s[0]=n[0],s[1]=n[1],s[2]=n[2],s[3]=n[3],s;const r=i.Color.parseColorString(t);return r&&(vi.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],vi.store255[t]=[r.r,r.g,r.b,r.opacity],s[0]=r.r,s[1]=r.g,s[2]=r.b,s[3]=r.opacity),s}static Set(t,e,i){if(e===xi.Color1){if(vi.store1[t])return;vi.store1[t]=i,vi.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(vi.store255[t])return;vi.store255[t]=i,vi.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function _i(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&i.isNumber(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 Ai(t,e,s,n,r){return Array.isArray(t)&&!i.isNumber(t[0])||Array.isArray(e)&&!i.isNumber(e[0])?new Array(4).fill(0).map(((r,a)=>Bi(i.isArray(t)?t[a]:t,i.isArray(e)?e[a]:e,s,n))):Bi(t,e,s,n,r)}function Bi(t,e,i,s,n){if(!t||!e)return t&&_i(t)||e&&_i(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=vi.Get(t,xi.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=vi.Get(e,xi.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:_i(a)})))});return o?Ai(r,l,i,s,n):Ai(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:wi(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:wi(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:wi(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),_i(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)}vi.store255={},vi.store1={};const Ti=[0,0,0,0],Si=[0,0,0,0];function wi(t,e,i){return vi.Get(t,xi.Color255,Ti),vi.Get(e,xi.Color255,Si),`rgba(${Math.round(Ti[0]+(Si[0]-Ti[0])*i)},${Math.round(Ti[1]+(Si[1]-Ti[1])*i)},${Math.round(Ti[2]+(Si[2]-Ti[2])*i)},${Ti[3]+(Si[3]-Ti[3])*i})`}class Pi{static GetImage(t,e){var i;const s=Pi.cache.get(t);s?"fail"===s.loadState?ze.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):Pi.loadImage(t,e)}static GetSvg(t,e){var i;let s=Pi.cache.get(t);s?"fail"===s.loadState?ze.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"},Pi.cache.set(t,s),s.dataPromise=ze.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=Pi.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"},Pi.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=ze.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=ze.global.loadBlob(t):"json"===e&&(i.dataPromise=ze.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Pi.isLoading&&Pi.toLoadAueue.length){Pi.isLoading=!0;const t=Pi.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Pi.cache.set(i,n),n.dataPromise=ze.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((()=>{Pi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Pi.loading()})).catch((t=>{console.error(t),Pi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Pi.loading()}))}}),0)}static loadImage(t,e){const i=Mi(t,Pi.toLoadAueue);if(-1!==i)return Pi.toLoadAueue[i].marks.push(e),void Pi.loading();Pi.toLoadAueue.push({url:t,marks:[e]}),Pi.loading()}static improveImageLoading(t){const e=Mi(t,Pi.toLoadAueue);if(-1!==e){const t=Pi.toLoadAueue.splice(e,1);Pi.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Mi(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Pi.cache=new Map,Pi.isLoading=!1,Pi.toLoadAueue=[],Pi.onLoadSuccessCb=[];const Oi=new i.Matrix,Ci=new i.AABBBounds,ki=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Li=["x","y"],Ei=["scaleX","scaleY"],Ii=["angle"],Ri=new i.Point,Ui={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 Di extends ei{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(Di.prototype,s,Object.getOwnPropertyDescriptor(t,s))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new i.AABBBounds,this._updateTag=wt.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,s;const{dx:n=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Ri.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),Ri.y=r+(null!==(s=t.scrollY)&&void 0!==s?s:0)}else Ri.x=n,Ri.y=r;return Ri}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;ze.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return ze.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new i.OBBBounds),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const s=this.attribute,n=this.updateAABBBounds(s,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=s,a=(o=r)?i.isArray(o)?0===o.length?0:1===o.length?o[0]:2===o.length?(gi[0]=o[0],gi[2]=o[0],gi[1]=o[1],gi[3]=o[1],gi):o:o:0;var o;return a&&n.expand(a),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ot(t);return Nt(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new i.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&wt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&ze.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&wt.UPDATE_BOUNDS)&&ze.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&wt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&wt.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&wt.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&wt.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=wt.CLEAR_SHAPE}containsPoint(t,e,s,n){if(!n)return!1;if(s===Pt.GLOBAL){const s=new i.Point(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(s,s),t=s.x,e=s.y}return n.containsPoint(this,{x:t,y:e})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const 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,s,n){var r;const a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);a?this._setAttributes(a,s,n):i.isNil(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!s&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ki;for(let i=0;i<e.length;i++){const s=e[i];if(-1!==t.indexOf(s))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ki;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Mt.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=wt.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const n={type:Mt.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Li,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?ze.transformUtil.fromMatrix(o,o).translate(t,e):(a.x=(null!==(i=a.x)&&void 0!==i?i:ve.x)+t,a.y=(null!==(s=a.y)&&void 0!==s?s:ve.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:Mt.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Li,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,s){var n,r;if(1===t&&1===e)return this;const a={type:Mt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:s},this.attribute,Ei,a);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const l=this.attribute;if(s){let{postMatrix:n}=this.attribute;n||(n=new i.Matrix,l.postMatrix=n),ze.transformUtil.fromMatrix(n,n).scale(t,e,s)}else l.scaleX=(null!==(n=l.scaleX)&&void 0!==n?n:ve.scaleX)*t,l.scaleY=(null!==(r=l.scaleY)&&void 0!==r?r:ve.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const s={type:Mt.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Ei,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 s;if(0===t)return this;const n={type:Mt.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Ii,n);r&&(delete r.angle,this._setAttributes(r,!1,n));const a=this.attribute;if(e){let{postMatrix:s}=this.attribute;s||(s=new i.Matrix,a.postMatrix=s),ze.transformUtil.fromMatrix(s,s).rotate(t,e)}else a.angle=(null!==(s=a.angle)&&void 0!==s?s:ve.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Mt.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Ii,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}animate(t){this.animates||(this.animates=new Map);const e=new hi(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:s,onEnd:n,onRemove:r}=t;null!=i&&e.onStart(i),null!=s&&e.onFrame(s),null!=n&&e.onEnd(n),null!=r&&e.onRemove(r),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(ze.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!i.isNil(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,a,o;if(i){const i=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let c;i.forEach((e=>{l[e]?(c||(c={}),c[e]=t[e]):h[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const d=this.animate({slience:!0});d.stateNames=e,d.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:ui,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:pi),c&&this.setAttributes(c,!1,{type:Mt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Mt.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((s=>{if(s.stateNames){const n=s.getEndProps();i.has(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var 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|=wt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=wt.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=wt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&wt.UPDATE_SHAPE_AND_BOUNDS)===wt.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=wt.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=wt.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=wt.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=wt.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=wt.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=wt.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=wt.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&wt.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],s=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:s}=this.attribute;return Ci.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Ci),this.setAttributes({scaleX:t,scaleY:i,angle:s}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=s();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=s();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=ve.x,y:e=ve.y,scaleX:s=ve.scaleX,scaleY:n=ve.scaleY,angle:r=ve.angle,scaleCenter:a,anchor:o,postMatrix:l}=this.attribute;let h=[0,0];const c={};if(o&&(h=this.getAnchor(o,c)),!a||1===s&&1===n)i.normalTransform(this._transMatrix,this._transMatrix.reset(),t,e,s,n,r,o&&h);else{const i=this._transMatrix;i.reset(),i.translate(h[0],h[1]),i.rotate(r),i.translate(-h[0],-h[1]),i.translate(t,e),h=this.getAnchor(a,c),ze.transformUtil.fromMatrix(i,i).scale(s,n,{x:h[0],y:h[1]})}const d=this.getOffsetXY(ve);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=Oi.setValue(l.a,l.b,l.c,l.d,l.e,l.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),ze.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Mt.ANIMATE_END})}onStep(t,e,i,s,n){const r={};if(i.customAnimate)i.customAnimate.update(n,s,r);else{const a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,r,i,s,n,a,void 0,o,l)}this.setAttributes(r,!1,{type:Mt.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,r,a,o,l,h){h||(h=Object.keys(a),s.propKeys=h),r?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const c=a[r],d=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,s);if(null==c||null==d||c===d)return void(i[r]=c);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,d,c,i),u||(u=e.customInterpolate(r,n,d,c,this,i),u||this.defaultInterpolate(c,d,r,i,l,n)||this._interpolate(r,n,d,c,i))})),s.parsedProps=l}defaultInterpolate(t,e,i,s,n,r){if(Number.isFinite(t))return s[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const a=n.fillColorArray,o=Ai(e,null!=a?a:t,r,!1,((t,e)=>{n.fillColorArray=e}));return o&&(s[i]=o),!0}if("stroke"===i){n||(n={});const a=n.strokeColorArray,o=Ai(e,null!=a?a:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return o&&(s[i]=o),!0}if("shadowColor"===i){n||(n={});const a=n.shadowColorArray,o=Ai(e,null!=a?a:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return o&&(s[i]=o),!0}return!1}_interpolate(t,e,i,s,n){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:ze.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return i.isString(t,!0)?this.pathProxy=(new ye).fromString(t):this.pathProxy=new ye,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const s=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(s,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Pi.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(i.isValidUrl(t)||t.includes("/")||i.isBase64(t))&&(Pi.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):i.isObject(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const 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(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",ze.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new si(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)}}}Di.mixin(ni);class Ni{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 ji(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function Fi(t,e,i){const s=function(t,e){let i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",n="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===s[0]){if(!s[1])return{data:n,index:r};if(t[r+1]===s[1])return{data:n,index:r}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!s)return;let n=s.data;const r=s.index,a=n.search(/\s/);let o=n,l=!0;-1!==a&&(o=n.substr(0,a).replace(/\s\s*$/,""),n=n.substr(a+1));const h=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),l=o!==s.data.substr(t+1))}return{tagName:o,tagExp:n,closeIndex:r,attrExpPresent:l,rawTagName:h}}const zi=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Wi{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,zi),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 Ni("!xml");let i=e,s="",n="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=ji(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=Fi(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=ji(t,"--\x3e",r+4,"Comment is not closed.");else{const a=Fi(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 Ni(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 Ni(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 Gi(t,e){return $i(t)}function $i(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=Yi(n);if(void 0!==r&&n[r]){const t=$i(n[r]);s=t,Object.keys(s).length,n[":@"]&&Vi(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 Yi(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Vi(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 Xi{constructor(t){this.options=Object.assign({},Xi.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Gi(new Wi(this.options).parseXml(t),this.options)}}function Hi(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Xi.defaultOptions={};let Ki=0;function qi(){return Ki++}var Zi;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Zi||(Zi={}));const Ji=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ji.set(t,!0)));const Qi=new Map;function ts(t){if(Ji.has(t))return!0;if(Qi.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Qi.set(t,!0))),qi(),qi();const es=qi();qi(),qi();const is=qi();qi();const ss=qi(),ns=qi(),rs=qi();qi(),qi(),qi(),qi();const as=qi(),os=qi(),ls=Symbol.for("GraphicCreator"),hs={"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"},cs=Object.keys(hs);var ds;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ds||(ds={}));class us extends Di{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=is,this._childUpdateTag=wt.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 Ze),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Ze)}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,s){if(s===Pt.GLOBAL){const s=new i.Point(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(s,s),this.AABBBounds.contains(s.x,s.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&wt.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;ze.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),ze.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=ve.x,y:e=ve.y,dx:i=ve.dx,dy:s=ve.dy,scaleX:n=ve.scaleX,scaleY:r=ve.scaleY,angle:a=ve.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 Qe(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 ze.graphicService.updateTempAABBBounds(i),ze.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&=wt.CLEAR_BOUNDS,this._childUpdateTag&=wt.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=wt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&wt.UPDATE_BOUNDS||(this._childUpdateTag|=wt.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(),ze.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),ze.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,ze.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{ze.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),ze.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&wt.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=ze.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new us(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return us.NOWORK_ANIMATE_ATTR}}function ps(t){return new us(t)}function fs(t,e){return!(!t&&!e)}function gs(t,e){let s;return s=i.isArray(t)?t.some((t=>t||void 0===t)):!!t,s&&e>0}function ms(t,e,i){return i&&t*e>0}function ys(t,e){return t*e>0}us.NOWORK_ANIMATE_ATTR=Ui;const bs=Symbol.for("PolygonRenderContribution"),xs=Symbol.for("SymbolRenderContribution"),vs=Symbol.for("InteractiveSubRenderContribution");function _s(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function As(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function Bs(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 Ts(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,c,d,u,p,f,g,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],d=e[5],u=e[6],p=e[7],f=e[8],g=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]=d,t[6]=u,t[7]=p,t[8]=f,t[9]=g,t[10]=m,t[11]=y,t[12]=a*s+c*n+f*r+e[12],t[13]=o*s+d*n+g*r+e[13],t[14]=l*s+u*n+m*r+e[14],t[15]=h*s+p*n+y*r+e[15]),t}function Ss(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],d=e[8],u=e[9],p=e[10],f=e[11],g=e[12],m=e[13],y=e[14],b=e[15];let x=i[0],v=i[1],_=i[2],A=i[3];return t[0]=x*s+v*o+_*d+A*g,t[1]=x*n+v*l+_*u+A*m,t[2]=x*r+v*h+_*p+A*y,t[3]=x*a+v*c+_*f+A*b,x=i[4],v=i[5],_=i[6],A=i[7],t[4]=x*s+v*o+_*d+A*g,t[5]=x*n+v*l+_*u+A*m,t[6]=x*r+v*h+_*p+A*y,t[7]=x*a+v*c+_*f+A*b,x=i[8],v=i[9],_=i[10],A=i[11],t[8]=x*s+v*o+_*d+A*g,t[9]=x*n+v*l+_*u+A*m,t[10]=x*r+v*h+_*p+A*y,t[11]=x*a+v*c+_*f+A*b,x=i[12],v=i[13],_=i[14],A=i[15],t[12]=x*s+v*o+_*d+A*g,t[13]=x*n+v*l+_*u+A*m,t[14]=x*r+v*h+_*p+A*y,t[15]=x*a+v*c+_*f+A*b,t}class ws{constructor(){this.pools=[]}static identity(t){return Bs(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 ws.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const Ps=new ws;var Ms=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},Os=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cs=function(t,e){return function(i,s){e(i,s,t)}};function ks(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:d=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=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(Bs(t),Ts(t,t,[n+o,r+l,a+h]),Ts(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],d=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*n+h*s,t[5]=a*n+c*s,t[6]=o*n+d*s,t[7]=l*n+u*s,t[8]=h*n-r*s,t[9]=c*n-a*s,t[10]=d*n-o*s,t[11]=u*n-l*s}(t,t,f),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],d=e[10],u=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*n-h*s,t[1]=a*n-c*s,t[2]=o*n-d*s,t[3]=l*n-u*s,t[8]=r*s+h*n,t[9]=a*s+c*n,t[10]=o*s+d*n,t[11]=l*s+u*n}(t,t,p),Ts(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,d,u]),g){const i=Ps.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]}Ts(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],d=e[6],u=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*n+h*s,t[1]=a*n+c*s,t[2]=o*n+d*s,t[3]=l*n+u*s,t[4]=h*n-r*s,t[5]=c*n-a*s,t[6]=d*n-o*s,t[7]=u*n-l*s}(i,i,g),Ts(i,i,[-s[0],-s[1],0]),Ss(t,t,i)}}let Ls=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new nt(["graphic"]),onSetStage:new nt(["graphic","stage"]),onRemove:new nt(["graphic"]),onRelease:new nt(["graphic"]),onAddIncremental:new nt(["graphic","group","stage"]),onClearIncremental:new nt(["graphic","group","stage"]),beforeUpdateAABBBounds:new nt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new nt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new nt(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new i.AABBBounds,this.tempAABBBounds2=new i.AABBBounds}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 ot(t);return Nt(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,s,n){const{textAlign:r,textBaseline:a}=t;if(null!=t.forceBoundsHeight){const e=i.isNumber(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=As(a,e,e);s.set(s.x1,n,s.x2,n+e)}if(null!=t.forceBoundsWidth){const e=i.isNumber(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=_s(r,e);s.set(n,s.y1,n+e,s.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,s,n,r){if(!e.empty()){const{scaleX:i=s.scaleX,scaleY:r=s.scaleY,stroke:a=s.stroke,shadowBlur:o=s.shadowBlur,lineWidth:l=s.lineWidth,pickStrokeBuffer:h=s.pickStrokeBuffer,strokeBoundsBuffer:c=s.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l){Hi(d,(l+h)/Math.abs(i+r),n,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(o){const{shadowOffsetX:n=s.shadowOffsetX,shadowOffsetY:a=s.shadowOffsetY}=t;Hi(d,o/Math.abs(i+r)*2,!1,c+1),d.translate(n,a),e.union(d)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let a=!0;const o=r.transMatrix;r&&r.isContainer&&(a=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),a&&i.transformBoundsWithMatrix(e,e,o)}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),ze.graphicService.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}}};Ls=Ms([N(),Cs(0,U(ls)),Os("design:paramtypes",[Object])],Ls);const Es={x:0,y:0,z:0,lastModelMatrix:null};class Is{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===It.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===It.afterFillStroke)))}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,c,d,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,c,d,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u)}))}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:d=e.visible}=t.attribute,u=ms(o,l,n),p=ys(o,c),f=fs(n,r),g=gs(a,h);return!(!t.valid||!d)&&!(!f&&!g)&&!!(u||p||i||s||r)&&{fVisible:u,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];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,d=i.modelMatrix,u=i.camera;Es.x=n,Es.y=r,Es.z=a,Es.lastModelMatrix=d;const p=u&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),f=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===l&&0===h&&!c;if(p){const s=Ps.allocate(),n=Ps.allocate();ks(n,t,e),Ss(s,d||s,n),Es.x=0,Es.y=0,Es.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Ps.free(n)}if(f&&!d){const s=t.getOffsetXY(e);Es.x+=s.x,Es.y+=s.y,Es.z=a,i.setTransformForCurrent()}else if(p)Es.x=0,Es.y=0,Es.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);Es.x+=s.x,Es.y+=s.y,this.transformWithoutTranslate(i,Es.x,Es.y,Es.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),Es.x=0,Es.y=0,Es.z=0;return Es}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},d={x:n,y:r};s.camera=null;const u=1/(h.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*h.y),p=-(h.y*(l.x-o.x)-c.y*l.x+d.y*o.x+(c.y-d.y)*a.x)*u,f=(c.y*l.y+h.y*(o.y-l.y)-d.y*o.y+(d.y-c.y)*a.y)*u,g=(h.x*(l.x-o.x)-c.x*l.x+d.x*o.x+(c.x-d.x)*a.x)*u,m=-(c.x*l.y+h.x*(o.y-l.y)-d.x*o.y+(d.x-c.x)*a.y)*u,y=(h.x*(d.y*o.x-c.y*l.x)+h.y*(c.x*l.x-d.x*o.x)+(d.x*c.y-c.x*d.y)*a.x)*u,b=(h.x*(d.y*o.y-c.y*l.y)+h.y*(c.x*l.y-d.x*o.y)+(d.x*c.y-c.x*d.y)*a.y)*u;s.setTransform(p,f,g,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){const{context:r}=s;if(!r)return;const{renderable:a}=t.attribute;if(!1===a)return;r.highPerformanceSave();const o=this.transform(t,e,r,i),{x:l,y:h,z:c,lastModelMatrix:d}=o;this.z=c,function(t,e,i,s,n,r,a,o){if(!t.pathProxy)return!1;const l=Qe(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=l.fill,stroke:c=l.stroke,opacity:d=l.opacity,fillOpacity:u=l.fillOpacity,lineWidth:p=l.lineWidth,strokeOpacity:f=l.strokeOpacity,visible:g=l.visible,x:m=l.x,y:y=l.y}=t.attribute,b=ms(d,u,h),x=ys(d,f),v=fs(h),_=gs(c,p);return!g||(!v&&!_||(!(b||x||a||o)||(e.beginPath(),Nt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),_&&(o?o(e,t.attribute,l):x&&(e.setStrokeStyle(t,t.attribute,i-m,s-y,l),e.stroke())),v&&(a?a(e,t.attribute,l):b&&(e.setCommonStyle(t,t.attribute,i-m,s-y,l),e.fill())),!0)))}(t,r,l,h,0,n)||(this.drawShape(t,r,l,h,s,n),this.z=0,r.modelMatrix!==d&&Ps.free(r.modelMatrix),r.modelMatrix=d),r.highPerformanceRestore()}}var Rs=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},Us=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ds=function(t,e){return function(i,s){e(i,s,t)}};const Ns=new class{constructor(){this.time=It.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){var p;const{background:f,backgroundOpacity:g=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:m=l.opacity,backgroundMode:y=l.backgroundMode,backgroundFit:b=l.backgroundFit}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const n=t.resources.get(f);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Qe(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=g*m,this.doDrawImage(e,n.data,r,y,b),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=g*m,e.fillStyle=f,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s,n){if("no-repeat"===s)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=i.width(),a=i.height();let o=r,l=a;if(n&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(o=i*(a/n),l=a):"repeat-y"===s&&(l=n*(r/i),o=r);const h=t.dpr,c=Ve.allocate({width:o,height:l,dpr:h}),d=c.getContext("2d");d&&(d.inuse=!0,d.clearMatrix(),d.setTransformForCurrent(!0),d.clearRect(0,0,o,l),d.drawImage(e,0,0,o,l),e=c.nativeCanvas),Ve.free(c)}const h=t.dpr,c=t.createPattern(e,s);c.setTransform&&c.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=c,t.translate(i.x1,i.y1),t.fillRect(0,0,r,a),t.translate(-i.x1,-i.y1)}}};let js=class{constructor(t){this.subRenderContribitions=t,this.time=It.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,c,d,u)}))}};js=Rs([N(),Ds(0,U(tt)),Ds(0,j(vs)),Us("design:paramtypes",[Object])],js);const Fs=new class{constructor(){this.time=It.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=Ve.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])),Ve.free(o),h}createCirclePattern(t,e,s,n){return this.createCommonPattern(t,e,s,n,((t,e)=>{e.fillStyle=s,e.arc(t,t,t,0,i.pi2),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,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:f=l.textureColor,textureSize:g=l.textureSize,texturePadding:m=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,f,g,m)}drawTexture(t,e,i,s,n,r,a,o,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(o,l,a,i);break;case"diamond":h=this.createDiamondPattern(o,l,a,i);break;case"rect":h=this.createRectPattern(o,l,a,i);break;case"vertical-line":h=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":h=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":h=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":h=this.createGridPattern(o,l,a,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,s,n,r),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}};const zs=new class{constructor(){this.time=It.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,c,d){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,m=f&&!1!==f.visible;if(!g&&!m)return;const{size:y=l.size,opacity:b=l.opacity,x:x=l.x,y:v=l.y,scaleX:_=l.scaleX,scaleY:A=l.scaleY,keepStrokeScale:B=l.keepStrokeScale}=t.attribute,T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=B?o:We(e,o,e.dpr),c="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,y,i,s,c*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(x-i)/_,(v-s)/A,l[r]),l[r].opacity=a,e.stroke()}};g&&T(p,"outerBorder"),m&&T(f,"innerBorder")}},Ws=Fs,Gs=Ns;function $s(t,e,s,n){if(!e.p1)return;const{offsetX:r=0,offsetY:a=0,offsetZ:o=0}=n||{};if(1===s)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,a+e.p1.y,r+e.p2.x,a+e.p2.y,r+e.p3.x,a+e.p3.y,o):t.lineTo(r+e.p1.x,a+e.p1.y,o);else if(e.p2&&e.p3){const[n]=function(t,e){const{p0:s,p1:n,p2:r,p3:a}=t,o=Wt(s,n,r,a,e),l=i.PointService.pointAtPP(s,n,e),h=i.PointService.pointAtPP(n,r,e),c=i.PointService.pointAtPP(r,a,e),d=i.PointService.pointAtPP(l,h,e),u=i.PointService.pointAtPP(h,c,e);return[new Gt(s,l,d,o),new Gt(o,u,c,a)]}(e,s);t.bezierCurveTo(r+n.p1.x,a+n.p1.y,r+n.p2.x,a+n.p2.y,r+n.p3.x,a+n.p3.y,o)}else{const i=e.getPointAt(s);t.lineTo(r+i.x,a+i.y,o)}}function Ys(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:d}=e;let u;if(c&&!1!==c.defined&&!i?u=l:c&&!1!==d.defined&&(u=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=u?u.x:e.p0.x,o=u?u.y:e.p0.y;t.moveTo(i+n,o+r,a)}else u&&(h=!s,t.lineTo(u.x+n,u.y+r,a))}return h}var Vs=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 Xs=class extends Is{constructor(){super(...arguments),this.numberType=ss}draw(t,e,i,s){const n=Qe(t,null==s?void 0:s.theme).line;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,s,n,r,a,o,l,h,c,d,u,p,f,g){var m;if(!e)return;t.beginPath();const y=null!==(m=this.z)&&void 0!==m?m:0;(function(t,e,s,n,r){const{offsetX:a=0,offsetY:o=0,offsetZ:l=0,mode:h="none",drawConnect:c=!1}=r||{};if(c&&"none"===h)return;if(!e)return;let d=!0;const{curves:u}=e;if(s>=1){if(c){let e,i=!0;u.forEach(((s,n)=>{s.originP1!==s.originP2?(i=Ys(t,s,e,i,a,o,l),e=s):e=s}))}else u.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+a,e.p0.y+o,l),$s(t,e,1,r),d=!1):d=!0}));return}if(s<=0)return;let p;"x"===n?p=Lt.ROW:"y"===n?p=Lt.COLUMN:"auto"===n&&(p=e.direction);const f=s*e.tryUpdateLength(p);let g=0,m=!0,y=null;for(let e=0,s=u.length;e<s;e++){const s=u[e],n=s.getLength(p),h=(f-g)/n;if(g+=n,h<0)break;if(c){if(s.originP1===s.originP2){y=s;continue}m=Ys(t,s,y,m,a,o,l),y=s}else{if(!s.defined){d=!0;continue}d&&t.moveTo(s.p0.x+a,s.p0.y+o,l),$s(t,s,i.min(h,1),r),d=!1}}})(t.camera?t:t.nativeContext,e,h,c,{offsetX:d,offsetY:u,offsetZ:y}),p.cache&&!i.isArray(p.cache)&&p.cache.curves.every((t=>t.defined))&&p.attribute.curveType&&p.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(p,o,l);const{x:b=0,x:x=0}=o;return!1!==s&&(f?f(t,o,l):r&&(t.setCommonStyle(p,o,b-d,x-u,l),t.fill())),!1!==n&&(g?g(t,o,l):a&&(t.setStrokeStyle(p,o,b-d,x-u,l),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,c,d,u){var p;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,{points:g}=t.attribute,m=g[0];e.moveTo(m.x+a,m.y+o,f);for(let t=1;t<g.length;t++){const i=g[t];e.lineTo(i.x+a,i.y+o,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);const{x:y=0,x:b=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,y-a,b-o,l),e.fill())),!1!==s&&(u?u(e,t.attribute,l):r&&(e.setStrokeStyle(t,t.attribute,y-a,b-o,l),e.stroke()))}drawShape(t,e,s,n,r,a,o,l){const h=Qe(t,null==a?void 0:a.theme).line,{fill:c=h.fill,stroke:d=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,segments:f,points:g,closePath:m,curveTension:y=h.curveTension,connectedType:b=h.connectedType}=t.attribute;if(!this.valid(t,h,o,l))return;let{curveType:x=h.curveType}=t.attribute;m&&"linear"===x&&(x="linearClosed");const{clipRange:v=h.clipRange,clipRangeByDimension:_=h.clipRangeByDimension}=t.attribute;if(1===v&&!f&&!g.some((t=>!1===t.defined))&&"linear"===x)return this.drawLinearLineHighPerformance(t,e,!!c,!!d,u,p,s,n,h,r,a,o,l);function A(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=me(A(t.points,b),x,{startPoint:e,curveTension:y});return s=n,n})).filter((t=>!!t)),"linearClosed"===x){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=me(A(s,b),x,{curveTension:y})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===v){let i=!1;t.cache.forEach(((a,f)=>{i||(i=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[f],[h,t.attribute],v,_,s,n,t,o,l))}))}else{const a=t.cache.reduce(((t,e)=>t+e.getLength()),0),f=v*a;let g=0,m=!1;t.cache.forEach(((a,y)=>{if(m)return;const b=a.getLength(),x=(f-g)/b;g+=b,x>0&&(m=this.drawSegmentItem(e,a,!!c,!!d,u,p,r[y],[h,t.attribute],i.min(x,1),_,s,n,t,o,l))}))}}else this.drawSegmentItem(e,t.cache,!!c,!!d,u,p,t.attribute,h,v,_,s,n,t,o,l)}};Xs=Vs([N()],Xs);var Hs=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},Ks=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qs=function(t,e){return function(i,s){e(i,s,t)}};let Zs=class extends Is{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=as,this.builtinContributions=[zs,Gs,Ws],this.init(t)}drawShape(t,e,s,n,r,a,o,l){var h;const c=Qe(t,null==a?void 0:a.theme).symbol,{size:d=c.size,x:u=c.x,y:p=c.y,scaleX:f=c.scaleX,scaleY:g=c.scaleY,fillStrokeOrder:m=c.fillStrokeOrder}=t.attribute,y=this.valid(t,c,o,l);if(!y)return;const{fVisible:b,sVisible:x,doFill:v,doStroke:_}=y,A=t.getParsedPath();if(!A)return;const{keepDirIn3d:B=c.keepDirIn3d}=t.attribute,T=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();const S=(i,r)=>{var a,h,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!==(d=r.stroke)&&void 0!==d?d:t.attribute.stroke,r=e}const y=()=>{r.fill&&(o?o(e,t.attribute,c):(e.setCommonStyle(t,r,u-s,p-n,c),e.fill()))},b=()=>{r.stroke&&(l?l(e,t.attribute,c):(e.setStrokeStyle(t,r,(u-s)/f,(p-n)/g,c),e.stroke()))};m?(b(),y()):(y(),b())};if(B&&e.camera&&e.project){const t=e.project(s,n,T),r=e.camera;e.camera=null,!1===A.draw(e,i.isArray(d)?[d[0]*f,d[1]*g]:d*f,t.x,t.y,void 0,S)&&e.closePath(),e.camera=r}else!1===A.draw(e,d,s,n,T,S)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,s,n,v,_,b,x,c,r,o,l);const w=()=>{v&&!A.isSvg&&(o?o(e,t.attribute,c):b&&(e.setCommonStyle(t,t.attribute,u-s,p-n,c),e.fill()))},P=()=>{_&&!A.isSvg&&(l?l(e,t.attribute,c):x&&(e.setStrokeStyle(t,t.attribute,(u-s)/f,(p-n)/g,c),e.stroke()))};m?(P(),w()):(w(),P()),this.afterRenderStep(t,e,s,n,v,_,b,x,c,r,o,l)}draw(t,e,i,s){const n=Qe(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Zs=Hs([N(),qs(0,U(tt)),qs(0,j(xs)),Ks("design:paramtypes",[Object])],Zs);const Js=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}};function Qs(t,e,i,s){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 tn(t,e){return Math.sqrt(t*t+e*e)}function en(t,e,i,s,n){const r=e/i;return{x:t.x-s*r,y:t.y-n*r}}const sn=Fs,nn=Ns;var rn=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},an=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},on=function(t,e){return function(i,s){e(i,s,t)}};let ln=class extends Is{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=rs,this.builtinContributions=[nn,sn],this.init(t)}drawShape(t,e,s,n,r,a,o,l){const h=Qe(t,null==a?void 0:a.theme).polygon,{points:c=h.points,cornerRadius:d=h.cornerRadius,x:u=h.x,y:p=h.y,closePath:f=h.closePath,fillStrokeOrder:g=h.fillStrokeOrder}=t.attribute,m=this.valid(t,h,o,l);if(!m)return;const{fVisible:y,sVisible:b,doFill:x,doStroke:v}=m;e.beginPath(),d<=0||i.isArray(d)&&d.every((t=>0===t))?Qs(e.camera?e:e.nativeContext,c,s,n):function(t,e,i,s,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void Qs(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],d=h.x-o.x,u=h.y-o.y,p=h.x-c.x,f=h.y-c.y,g=(Math.atan2(u,d)-Math.atan2(f,p))/2,m=Math.abs(Math.tan(g));let y=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,b=y/m;const x=tn(d,u),v=tn(p,f),_=Math.min(x,v);b>_&&(b=_,y=_*m);const A=en(h,b,x,d,u),B=en(h,b,v,p,f),T=2*h.x-A.x-B.x,S=2*h.y-A.y-B.y,w=tn(T,S),P=en(h,tn(b,y),w,T,S);let M=Math.atan2(A.y-P.y,A.x-P.x);const O=Math.atan2(B.y-P.y,B.x-P.x);let C=O-M;C<0&&(M=O,C=-C),C>Math.PI&&(C-=Math.PI),0===r?t.moveTo(A.x+i,A.y+s):t.lineTo(A.x+i,A.y+s),C&&t.arcTo(h.x+i,h.y+s,B.x+i,B.y+s,y),t.lineTo(B.x+i,B.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,c,s,n,d,f),f&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,s,n,x,v,y,b,h,r,o,l);const _=()=>{x&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,u-s,p-n,h),e.fill()))},A=()=>{v&&(l?l(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,u-s,p-n,h),e.stroke()))};g?(A(),_()):(_(),A()),this.afterRenderStep(t,e,s,n,x,v,y,b,h,r,o,l)}draw(t,e,i,s){const n=Qe(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};ln=rn([N(),on(0,U(tt)),on(0,j(bs)),an("design:paramtypes",[Object])],ln);const hn=Symbol.for("GraphicRender"),cn=Symbol.for("LineRender"),dn=Symbol.for("PolygonRender"),un=Symbol.for("SymbolRender");class pn{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){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;const{lineWidth:o,suffixPosition:l="end",measureMode:h=rt.actualBounding,keepCenterInLine:c=!1}=null!=a?a:{};t=t.map((t=>t.toString()));const d=[],u=[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;d.push({str:a,width:e,ascent:s.ascent,descent:s.descent,keepCenterInLine:c})}u[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),d.push({str:i,width:e,ascent:r.ascent,descent:r.descent,keepCenterInLine:c})}u[0]=s}u[1]=d.length*s,u[0]=d.reduce(((t,e)=>Math.max(t,e.width)),0);const p={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(p,e,i,d),this.layoutWithBBox(p,d,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 fn=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...ki];class gn extends Di{get font(){const t=this.getGraphicTheme();return this._font||(this._font=i.getContextFont(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(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=os,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return i.isArray(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Qe(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:s=t.angle}=e;if(!s){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new gn({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:r,y:a}=e,o={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},l=i.rotatePoint(o,s,{x:r,y:a});return this._OBBBounds.copy(n),this._OBBBounds.translate(l.x-o.x,l.y-o.y),this._OBBBounds.angle=s,this._OBBBounds}updateAABBBounds(t,e,s){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:r}=ze.graphicService.updateTempAABBBounds(s),{scaleX:a=e.scaleX,scaleY:o=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(l){Hi(r,l/Math.abs(a+o),!0,h),s.union(r)}return ze.graphicService.combindShadowAABBBounds(s,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||ze.graphicService.updateHTMLTextAABBBounds(t,e,s),i.transformBoundsWithMatrix(s,s,this.transMatrix),s}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:d=i.stroke,wrap:u=i.wrap,measureMode:p=i.measureMode,lineWidth:f=i.lineWidth,whiteSpace:g=i.whiteSpace,suffixPosition:m=i.suffixPosition,ignoreBuf:y=i.ignoreBuf,keepCenterInLine:b=i.keepCenterInLine}=s,x=y?0:this.guessLineHeightBuf(o),v=this.getLineHeight(s,i,x);if("normal"===g||u)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),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const _=ze.graphicUtil.textMeasure,A=new pn(n,{fontSize:o,fontWeight:l,fontFamily:n,lineHeight:v},_).GetLayoutByLines(t,r,a,v,!0===h?i.ellipsis:h||void 0,!1,{lineWidth:c,suffixPosition:m,measureMode:p,keepCenterInLine:b}),{bbox:B}=A;return this.cache.layoutData=A,this.clearUpdateShapeTag(),this._AABBBounds.set(B.xOffset,B.yOffset,B.xOffset+B.width,B.yOffset+B.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}updateWrapAABBBounds(t){var e,s,n;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:d,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:f=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:m=r.ignoreBuf,measureMode:y=r.measureMode,suffixPosition:b=r.suffixPosition,heightLimit:x=0,lineClamp:v,keepCenterInLine:_=r.keepCenterInLine}=this.attribute,A=m?0:this.guessLineHeightBuf(h),B=this.getLineHeight(this.attribute,r,A);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}const T=ze.graphicUtil.textMeasure,S={fontSize:h,fontWeight:g,fontFamily:a,lineHeight:B},w=new pn(a,S,T),P=i.isArray(t)?t.map((t=>t.toString())):[t.toString()],M=[],O=[0,0];let C=1/0;if(x>0&&(C=Math.max(Math.floor(x/B),1)),v&&(C=Math.min(C,v)),"number"==typeof d&&d!==1/0){if(d>0)for(let t=0;t<P.length;t++){const e=P[t];let i=!0;if(t===C-1){const i=T.clipTextWithSuffix(e,S,d,c,!1,b,t!==P.length-1),s=T.measureTextPixelADscentAndWidth(i.str,S,y);M.push({str:i.str,width:i.width,ascent:s.ascent,descent:s.descent,keepCenterInLine:_});break}const r=T.clipText(e,S,d,"break-all"!==f,"keep-all"===f);if(""!==e&&""===r.str||r.wordBreaked){if(c){const t=T.clipTextWithSuffix(e,S,d,c,!1,b);r.str=null!==(s=t.str)&&void 0!==s?s:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;i=!1}const a=T.measureTextPixelADscentAndWidth(r.str,S,y);M.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||(i=!0,o=r.wordBreaked),r.str.length===e.length);else if(i){let i=e.substring(o);"keep-all"===f&&(i=i.replace(/^\s+/g,"")),P.splice(t+1,0,i)}}let t=0;M.forEach((e=>{t=Math.max(t,e.width)})),O[0]=t}else{let t,e,i=0;for(let s=0,n=P.length;s<n;s++){if(s===C-1){const t=T.clipTextWithSuffix(P[s],S,d,c,!1,b),e=T.measureTextPixelADscentAndWidth(t.str,S,y);M.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:_}),i=Math.max(i,t.width);break}e=P[s],t=T.measureTextWidth(e,S),i=Math.max(i,t);const n=T.measureTextPixelADscentAndWidth(e,S,y);M.push({str:e,width:t,ascent:n.ascent,descent:n.descent,keepCenterInLine:_})}O[0]=i}O[1]=M.length*B;const k={xOffset:0,yOffset:0,width:O[0],height:O[1]};w.LayoutBBox(k,o,l,M);const L=w.layoutWithBBox(k,M,o,l,B);return this.cache.layoutData=L,this.clearUpdateShapeTag(),this._AABBBounds.set(k.xOffset,k.yOffset,k.xOffset+k.width,k.yOffset+k.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,s;const n=this.getGraphicTheme(),r=ze.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,fontFamily:c=n.fontFamily,fontSize:d=n.fontSize,fontWeight:u=n.fontWeight,stroke:p=n.stroke,lineWidth:f=n.lineWidth,verticalMode:g=n.verticalMode,suffixPosition:m=n.suffixPosition}=o,y=this.getLineHeight(o,n,0);let{textAlign:b=n.textAlign,textBaseline:x=n.textBaseline}=o;if(!g){const t=b;b=null!==(e=gn.baselineMapAlign[x])&&void 0!==e?e:"left",x=null!==(s=gn.alignMapBaseline[t])&&void 0!==s?s:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=i.max(e,a)}));const t=_s(b,a),e=this.cache.verticalList.length*y,s=As(x,e,d);return this._AABBBounds.set(s,t,s+e,t+a),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const v=t.map((t=>function(t){const e=[];let i=0,s="";for(let n=0;n<t.length;n++)ts(t[n])?i?s+=t[n]:(i=1,s=t[n]):(i&&(e.push({text:s,direction:Zi.VERTICAL}),s="",i=0),e.push({text:t[n],direction:Zi.HORIZONTAL}));return s&&e.push({text:s,direction:Zi.VERTICAL}),e}(t.toString())));v.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const i=!0===h?n.ellipsis:h,s=r.clipTextWithSuffixVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,i,!1,m);v[e]=s.verticalList,a=s.width}else{const i=r.clipTextVertical(t,{fontSize:d,fontWeight:u,fontFamily:c},l,!1);v[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===Zi.HORIZONTAL?d:r.measureTextWidth(t.text,{fontSize:d,fontWeight:u,fontFamily:c});a+=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);a=i.max(e,a)}));const _=_s(b,a),A=this.cache.verticalList.length*y,B=As(x,A,d);return this._AABBBounds.set(B,_,B+A,_+a),p&&this._AABBBounds.expand(f/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=bi(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==s?s:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fn;return super.needUpdateTag(t,e)}clone(){return new gn(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return gn.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return gn.baselineMapAlign}getAlignMapBaseline(){return gn.alignMapBaseline}}function mn(t){return new gn(t)}gn.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Ui),gn.baselineMapAlign={top:"left",bottom:"right",middle:"center"},gn.alignMapBaseline={left:"top",right:"bottom",center:"middle"};class yn{bounds(t,e){if(i.isNumber(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 i.isNumber(t)?t:Math.min(t[0],t[1])}}function bn(t,e,s,n,r){return r?t.arc(s,n,e,0,i.tau,!1,r):t.arc(s,n,e,0,i.tau),!1}var xn=new class extends yn{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 bn(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return bn(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 vn=new class extends yn{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 _n(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 An=new class extends yn{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 _n(t,this.parseSize(e)/2,i,s,n)}drawFitDir(t,e,i,s,n){return _n(t,this.parseSize(e)/2,i,s,n)}drawOffset(t,e,i,s,n,r){return _n(t,this.parseSize(e)/2+n,i,s,r)}};function Bn(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}var Tn=new class extends yn{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return Bn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Bn(t,this.parseSize(e)/2+n,i,s)}};function Sn(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]: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 wn extends yn{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 Sn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Sn(t,this.parseSize(e)/2,i,s,n)}}var Pn=new wn;var Mn=new class extends wn{constructor(){super(...arguments),this.type="triangle"}};const On=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Cn=Math.sin(i.tau/10)*On,kn=-Math.cos(i.tau/10)*On;function Ln(t,e,s,n){const r=Cn*e,a=kn*e;t.moveTo(s,-e+n),t.lineTo(r+s,a+n);for(let o=1;o<5;++o){const l=i.tau*o/5,h=Math.cos(l),c=Math.sin(l);t.lineTo(c*e+s,-h*e+n),t.lineTo(h*r-c*a+s,c*r+h*a+n)}return t.closePath(),!0}var En=new class extends yn{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 Ln(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Ln(t,this.parseSize(e)/2+n,i,s)}};const In=i.sqrt(3);function Rn(t,e,i,s){const n=e,r=n/In,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 Un=new class extends yn{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 Rn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Rn(t,this.parseSize(e)/2+n,i,s)}};function Dn(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 Nn=new class extends yn{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Dn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Dn(t,this.parseSize(e)/2+n,i,s)}};function jn(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}var Fn=new class extends yn{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return jn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return jn(t,this.parseSize(e)/2+n,i,s)}};const zn=-.5,Wn=i.sqrt(3)/2,Gn=1/i.sqrt(12);function $n(t,e,i,s){const n=e/2,r=e*Gn,a=n,o=e*Gn+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(zn*n-Wn*r+i,Wn*n+zn*r+s),t.lineTo(zn*a-Wn*o+i,Wn*a+zn*o+s),t.lineTo(zn*l-Wn*h+i,Wn*l+zn*h+s),t.lineTo(zn*n+Wn*r+i,zn*r-Wn*n+s),t.lineTo(zn*a+Wn*o+i,zn*o-Wn*a+s),t.lineTo(zn*l+Wn*h+i,zn*h-Wn*l+s),t.closePath(),!1}var Yn=new class extends yn{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 $n(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return $n(t,this.parseSize(e)/2+n,i,s)}};function Vn(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 Xn=new class extends yn{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 Vn(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return Vn(t,this.parseSize(e)/2,i,s,n)}};function Hn(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]: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 Kn=new class extends yn{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 Hn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return Hn(t,this.parseSize(e)/2,i,s,n)}};function qn(t,e,i,s){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]: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 Zn=new class extends yn{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 qn(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return qn(t,this.parseSize(e)/2,i,s,n)}};const Jn=i.sqrt(3);function Qn(t,e,i,s){const n=e*Jn;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}var tr=new class extends yn{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Qn(t,this.parseSize(e)/2/Jn,i,s)}drawOffset(t,e,i,s,n){return Qn(t,this.parseSize(e)/2/Jn+n,i,s)}};function er(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 ir=new class extends yn{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 er(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return er(t,this.parseSize(e)/4+n,i,s)}};function sr(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 nr=new class extends yn{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 sr(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return sr(t,this.parseSize(e)/4+n,i,s)}};function rr(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 ar=new class extends yn{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 rr(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return rr(t,this.parseSize(e)/4+n,i,s)}};function or(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 lr=new class extends yn{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 or(t,this.parseSize(e)/4,i,s)}drawOffset(t,e,i,s,n){return or(t,this.parseSize(e)/4+n,i,s)}};function hr(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}var cr=new class extends yn{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return hr(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return hr(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 dr(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}var ur=new class extends yn{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return dr(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return dr(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 pr(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 fr=new class extends yn{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 pr(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n,r){return pr(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 gr(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function mr(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}var yr=new class extends yn{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,s,n){return i.isNumber(e)?mr(t,e,s,n):gr(t,e,s,n)}drawOffset(t,e,s,n,r){return i.isNumber(e)?mr(t,e+2*r,s,n):gr(t,[e[0]+2*r,e[1]+2*r],s,n)}};const br=new i.AABBBounds;class xr{constructor(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,i.isArray(e)?this.svgCache=e:this.path=e,this.isSvg=s}drawOffset(t,e,i,s,n,r,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),Nt(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(Nt(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 i.isNumber(t)?t:Math.min(t[0],t[1])}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:s}=i;br.x1=s.bounds.x1*t,br.y1=s.bounds.y1*t,br.x2=s.bounds.x2*t,br.y2=s.bounds.y2*t,e.union(br)}))}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 vr={};[xn,vn,An,Tn,tr,Mn,En,Un,Nn,Fn,Yn,Xn,Kn,Pn,Zn,ir,nr,ar,lr,yr,cr,ur,fr].forEach((t=>{vr[t.type]=t}));const _r={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"},Ar=new i.AABBBounds,Br=["symbolType","size",...ki];let Tr=class t extends Di{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=as}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return i.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:s=e.symbolType}=this.attribute,n=vr[s];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[s],n)return this._parsedPath=n,n;if(s=_r[s]||s,!0===((r=s).startsWith("<svg")||r.startsWith("<?xml"))){const e=new Xi,{svg:n}=e.parse(s);if(!n)return null;const r=i.isArray(n.path)?n.path:[n.path];Ar.clear();const a=[];r.forEach((t=>{const e=(new ye).fromString(t.d),i={};cs.forEach((e=>{t[e]&&(i[hs[e]]=t[e])})),a.push({path:e,attribute:i}),Ar.union(e.bounds)}));const o=Ar.width(),l=Ar.height(),h=1/i.max(o,l);return a.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new xr(s,a,!0),t.userSymbolMap[s]=this._parsedPath,this._parsedPath}var r;const a=(new ye).fromString(s),o=a.bounds.width(),l=a.bounds.height(),h=1/i.max(o,l);return a.transform(0,0,h,h),this._parsedPath=new xr(s,a),t.userSymbolMap[s]=this._parsedPath,this._parsedPath}getGraphicTheme(){return Qe(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}=ze.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;Hi(i,a+(n+o)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return ze.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,s){const{size:n=e.size}=t;if(i.isArray(n))s.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;s.set(-t,-t,t,t)}return s}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Br)}needUpdateTag(t){return super.needUpdateTag(t,Br)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,s=i.isArray(e)?e:[e,e];return t.path?(new ye).fromCustomPath2D(t.path,0,0,s[0],s[1]):(new ye).fromString(t.pathStr,0,0,s[0],s[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Sr(t){return new Tr(t)}Tr.userSymbolMap={},Tr.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Ui);const wr=["segments","points","curveType","curveTension",...ki];class Pr extends Di{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=ss}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=yi(i,s,e))}getGraphicTheme(){return Qe(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),ze.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return ze.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,wr)}needUpdateTag(t){return super.needUpdateTag(t,wr)}toCustomPath(){const t=this.attribute,e=new ye,i=t.segments,s=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{s(t.points)})):t.points&&s(t.points),e}clone(){return new Pr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Pr.NOWORK_ANIMATE_ATTR}}function Mr(t){return new Pr(t)}Pr.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ui);const Or=["path","customPath",...ki];class Cr extends Di{constructor(t){super(t),this.type="path",this.numberType=ns}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 ye?e.path:(i.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ye?this.cache:t.path)}getGraphicTheme(){return Qe(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=ze.graphicService.updateTempAABBBounds(i);((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)}})(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:r=e.lineJoin}=t;return ze.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;i.isString(t.path,!0)?this.cache=(new ye).fromString(t.path):t.customPath&&(this.cache=new ye,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Or)}needUpdateTag(t){return super.needUpdateTag(t,Or)}toCustomPath(){return(new ye).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Cr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Cr.NOWORK_ANIMATE_ATTR}}function kr(t){return new Cr(t)}Cr.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Ui);const Lr=["segments","points","curveType","curveTension",...ki];class Er extends Di{constructor(t){super(t),this.type="area",this.numberType=es}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 Qe(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),ze.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return ze.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=yi(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Lr)}needUpdateTag(t){return super.needUpdateTag(t,Lr)}toCustomPath(){const t=new ye,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 Er(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Er.NOWORK_ANIMATE_ATTR}}Er.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ui);const Ir=["points","cornerRadius",...ki];class Rr extends Di{constructor(t){super(t),this.type="polygon",this.numberType=rs}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Qe(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),ze.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return ze.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=yi(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Ir)}needUpdateTag(t){return super.needUpdateTag(t,Ir)}toCustomPath(){const t=this.attribute.points,e=new ye;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new Rr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Rr.NOWORK_ANIMATE_ATTR}}function Ur(t){return new Rr(t)}Rr.NOWORK_ANIMATE_ATTR=Ui;var Dr=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 Nr,jr=class extends Xs{constructor(){super(...arguments),this.numberType=ss}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=Qe(t).line,{fill:c=h.fill,stroke:d=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:f=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:m=h.visible}=t.attribute,y=ms(u,p,c),b=ys(u,f),x=fs(c),v=gs(d,g);if(!t.valid||!m)return;if(!x&&!v)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())}};jr=Dr([N()],jr);let Fr=!1;const zr=new P((t=>{Fr||(Fr=!0,t(Xs).toSelf().inSingletonScope(),t(jr).toSelf().inSingletonScope(),t(cn).to(Xs).inSingletonScope(),t(hn).toService(cn))}));let Wr=!1;const Gr=new P((t=>{Wr||(Wr=!0,t(Zs).toSelf().inSingletonScope(),t(un).to(Zs).inSingletonScope(),t(hn).toService(un),t(xs).toService(js),it(t,xs))}));let $r=!1;const Yr=new P((t=>{$r||($r=!0,t(dn).to(ln).inSingletonScope(),t(hn).toService(dn),t(bs).toService(js),it(t,bs))}));const Vr=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Xr extends us{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,s,n){const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);if(r)return this._setAttributes(r,s);i.isPlainObject(this.attribute[t])&&i.isPlainObject(e)&&!i.isFunction(this.attribute[t])&&!i.isFunction(e)?i.merge(this.attribute[t],e):this.attribute[t]=e,Vr.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!s&&!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=>Vr.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){i.isNil(e)&&(e=Object.keys(t));for(let s=0;s<e.length;s++){const n=e[s];!i.isPlainObject(this.attribute[n])||i.isFunction(this.attribute[n])||i.isFunction(t[n])?this.attribute[n]=t[n]:i.merge(this.attribute[n],t[n])}}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 si(t,e);s.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(s)}}const Hr=Symbol.for("MathPickerContribution"),Kr=Symbol.for("MathLinePicker"),qr=Symbol.for("MathSymbolPicker"),Zr=Symbol.for("MathPolygonPicker"),Jr=Symbol.for("CanvasLinePicker"),Qr=Symbol.for("CanvasSymbolPicker"),ta=Symbol.for("CanvasPolygonPicker"),ea=Symbol.for("CanvasPickerContribution");class ia{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;return this.canvasRenderer.drawShape(t,s,r,a,{},null,((t,i,s)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,n)=>{if(o)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer,l=i.keepStrokeScale||n.keepStrokeScale;return s.lineWidth=l?r+a:We(s,r+a,s.dpr),o=t.isPointInStroke(e.x,e.y),o})),s.highPerformanceRestore(),o}}var sa=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},na=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ra=function(t,e){return function(i,s){e(i,s,t)}};let aa=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ss}};aa=sa([N(),ra(0,U(cn)),na("design:paramtypes",[Object])],aa);let oa=!1;const la=new P(((t,e,i,s)=>{oa||(oa=!0,t(Kr).to(aa).inSingletonScope(),t(Hr).toService(Kr))}));var ha=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},ca=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},da=function(t,e){return function(i,s){e(i,s,t)}};let ua=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=rs}};ua=ha([N(),da(0,U(dn)),ca("design:paramtypes",[Object])],ua);let pa=!1;const fa=new P(((t,e,i,s)=>{pa||(pa=!0,t(Zr).to(ua).inSingletonScope(),t(Hr).toService(Zr))}));var ga=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},ma=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ya=function(t,e){return function(i,s){e(i,s,t)}};let ba=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=as}};ba=ga([N(),ya(0,U(un)),ma("design:paramtypes",[Object])],ba);let xa=!1;const va=new P(((t,e,i,s)=>{xa||(xa=!0,t(qr).to(ba).inSingletonScope(),t(Hr).toService(qr))}));class _a extends Is{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 d=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!d||(d=t.isPointInPath(c.x,c.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:We(s,n+r,s.dpr),d=t.isPointInStroke(c.x,c.y),d})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Ps.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),d}}var Aa=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},Ba=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ta=function(t,e){return function(i,s){e(i,s,t)}};let Sa=class extends _a{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=ss}};Sa=Aa([N(),Ta(0,U(cn)),Ba("design:paramtypes",[Object])],Sa);let wa=!1;const Pa=new P(((t,e,i,s)=>{wa||(wa=!0,t(Jr).to(Sa).inSingletonScope(),t(ea).toService(Jr))}));class Ma extends Is{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 d=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!d||(d=t.isPointInPath(c.x,c.y),d))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Ps.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),d}}var Oa=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},Ca=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ka=function(t,e){return function(i,s){e(i,s,t)}};let La=class extends Ma{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=as}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 d=e;if(s.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(d.x,d.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:We(s,n+r,s.dpr),u=t.isPointInStroke(d.x,d.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==c&&Ps.free(s.modelMatrix),s.modelMatrix=c,s.highPerformanceRestore(),u}};La=Oa([N(),ka(0,U(un)),Ca("design:paramtypes",[Object])],La);let Ea=!1;const Ia=new P(((t,e,i,s)=>{Ea||(Ea=!0,t(Qr).to(La).inSingletonScope(),t(ea).toService(Qr))}));var Ra=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},Ua=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Da=function(t,e){return function(i,s){e(i,s,t)}};let Na=class extends ia{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=rs}};Na=Ra([N(),Da(0,U(dn)),Ua("design:paramtypes",[Object])],Na);let ja=!1;const Fa=new P(((t,e,i,s)=>{ja||(ja=!0,t(ta).to(Na).inSingletonScope(),t(ea).toService(ta))})),za=function(){!function(){if(null==Nr)try{const t=document.createElement("canvas"),e=t.getContext("2d");Nr=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),Nr&&(Nr=!!document.createElement)}catch(t){Nr=!1}}();const t=ze.global&&ze.global.env;return t?"browser"===t:Nr}();function Wa(){Wa.__loaded||(Wa.__loaded=!0,Js.RegisterGraphicCreator("group",ps))}Wa.__loaded=!1;const Ga=Wa;function $a(){$a.__loaded||($a.__loaded=!0,Js.RegisterGraphicCreator("line",Mr),Ge.load(zr),Ge.load(za?Pa:la))}$a.__loaded=!1;const Ya=$a;function Va(){Va.__loaded||(Va.__loaded=!0,Js.RegisterGraphicCreator("polygon",Ur),Ge.load(Yr),Ge.load(za?Fa:fa))}Va.__loaded=!1;const Xa=Va;function Ha(){Ha.__loaded||(Ha.__loaded=!0,Js.RegisterGraphicCreator("symbol",Sr),Ge.load(Gr),Ge.load(za?Ia:va))}Ha.__loaded=!1;const Ka=Ha;Ga(),Ya(),Xa(),Ka();class qa extends Xr{getStartAngle(){return i.normalizeAngle(this._startAngle)}getEndAngle(){return i.normalizeAngle(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:i.merge({},qa.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:s,state:n,visible:r=!0,multiSegment:a,mainSegmentIndex:o}=this.attribute;if(!r)return;this._computeLineAngle();const l=this._getMainSegmentPoints(),h=this._renderSymbol(t,l,"start"),c=this._renderSymbol(e,l,"end");if(this.startSymbol=h,this.endSymbol=c,a){const t=[...this.attribute.points];if(i.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const e=this._clipPoints(i.flattenArray(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 r,a;const o=Js.line(Object.assign(Object.assign({points:t},i.isArray(s)?null!==(r=s[e])&&void 0!==r?r:s[s.length-1]:s),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+e),i.isEmpty(null==n?void 0:n.line)||(o.states=i.isArray(n.line)?null!==(a=n.line[e])&&void 0!==a?a:n.line[n.line.length-1]:n.line),this.add(o),this.lines.push(o)}))}else{let t=Js.line;i.array(s)[0].cornerRadius&&(t=Js.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},i.array(s)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),i.isEmpty(null==n?void 0:n.line)||(e.states=[].concat(n.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,s){if(!e.length)return;const{autoRotate:n=!0}=t;let r;if(t&&t.visible){const a=this.getStartAngle(),o=this.getEndAngle(),{state:l}=this.attribute,h=e[0],c=e[e.length-1],{refX:d=0,refY:u=0,refAngle:p=0,style:f,symbolType:g,size:m=12}=t;let y,b;"start"===s?(y={x:h.x+(i.isValidNumber(a)?d*Math.cos(a)+u*Math.cos(a-Math.PI/2):0),y:h.y+(i.isValidNumber(a)?d*Math.sin(a)+u*Math.sin(a-Math.PI/2):0)},b=this._computeStartRotate(this._startAngle)):(y={x:c.x+(i.isValidNumber(o)?d*Math.cos(o)+u*Math.cos(o-Math.PI/2):0),y:c.y+(i.isValidNumber(o)?d*Math.sin(o)+u*Math.sin(o-Math.PI/2):0)},b=this._computeEndRotate(this._endAngle)),r=Js.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:g,size:m,angle:n?b+p:0,strokeBoundsBuffer:0}),f)),r.name=`${this.name}-${s}-symbol`,r.id=this._getNodeId(`${s}-symbol`),i.isEmpty(null==l?void 0:l.symbol)||(r.states=l.symbol),"start"===s?i.isEmpty(null==l?void 0:l.startSymbol)||(r.states=l.startSymbol):i.isEmpty(null==l?void 0:l.endSymbol)||(r.states=l.endSymbol),this.add(r)}return r}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:s}=this.attribute;let n;return n=e?i.isValidNumber(s)?t[s]:i.flattenArray(t):t,this._mainSegmentPoints=n,n}_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}}qa.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}}};const Za="seriesBreak";function Ja(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)),d=Math.PI/180*s,u=i*Math.cos(d),p=i*Math.sin(d);r.push(`M ${a} ${o}`);for(let t=0;t<=c;t++){const e=n?a+(t%2==0?u:-u):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(" ")}class Qa extends Xr{constructor(){super(...arguments),this.name=Za}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(i.isEmpty(t))return;const e=[],s=[];t.forEach((t=>{const{start:n,end:r}=t;((t,e)=>{const{start:s,end:n}=e,r=s.x===n.x,a=r?"x":"y",o=r?"y":"x";let l=!0;const h=1e-6;t.length&&t.forEach((t=>{if(i.isNumberClose(t.start[a],s[a])){const e=Math.min(s[o],n[o]),i=Math.max(s[o],n[o]),r=Math.min(t.start[o],t.end[o]),a=Math.max(t.start[o],t.end[o]);if(!(i<r-h||e>a+h))return t.start[o]=Math.min(r,e),t.end[o]=Math.max(a,i),void(l=!1)}})),l&&t.push(e)})(n.x===r.x?e:s,t)})),[...e,...s].forEach(((t,e)=>{var s;const{start:n,end:r,size:a=4,gap:o=5,style:l={}}=t,h=d(t,["start","end","size","gap","style"]),c=ps({}),u=n.x===r.x;let p,f,g,m;u?(p={x:n.x-o/2,y:n.y},f={x:r.x-o/2,y:r.y},g={x:n.x+o/2,y:n.y},m={x:r.x+o/2,y:r.y}):(p={x:n.x,y:n.y-o/2},f={x:r.x,y:r.y-o/2},g={x:n.x,y:n.y+o/2},m={x:r.x,y:r.y+o/2});const y=Ja(p,f,a,u?75:15,u),b=Ja(n,r,a,u?75:15,u),x=Ja(g,m,a,u?75:15,u);c.add(kr(Object.assign(Object.assign({path:y,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(kr(Object.assign(Object.assign({path:x,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(kr({path:b,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),c.name="series-break",c.data=h,i.isValid(h.axisId)&&(c.id=`${null!==(s=h.axisId)&&void 0!==s?s:""}_${e}`),this.add(c)}))}}function to(t,e,i=1){return Math.abs(t-e)<i}function eo(t,e){return{type:"component",componentType:Za,interactive:!0,zIndex:500,style:{data:(s,n)=>{const r=[],a=n.vchart.getChart(),o="horizontal"===a.getAllSeries()[0].direction;return t.forEach(((t,s)=>{var n,l;const h=t.id,c=i.isValid(h)?a.getComponentByUserId(h):e&&i.isValid(e[s])?a.getComponentByIndex("axes",e[s]):null===(n=a.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===n?void 0:n[0];if(!c)return;const d=null!=h?h:`${c.type}-${c.id}`,u=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());i.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:s=5}=t,n=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),h=(n+l)/2+(o?u.x1:u.y1);a.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const a=t.AABBBounds;let c,p,f,g,m=!1;o?(m=a.x1<(n+l-s)/2&&a.x2>(n+l+s)/2,c=h,p=Math.max(a.y1+u.y1-2,u.y1),f=h,g=Math.min(a.y2+u.y1+2,u.y2)):(m=a.y1<(n+l-s)/2&&a.y2>(n+l+s)/2,c=Math.max(a.x1+u.x1-2,u.x1),p=h,f=Math.min(a.x2+u.x1+2,u.x2),g=h),m&&r.push({start:{x:c,y:p},end:{x:f,y:g},gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{so(t,"line").forEach((t=>{io(o?{start:{x:(n+l)/2,y:0},end:{x:(n+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(n+l)/2},end:{x:u.x2-u.x1,y:(n+l)/2}},t).forEach((t=>{let n,a;o?(n={x:h,y:Math.max(t[1]+u.y1-10,u.y1)},a={x:h,y:Math.min(t[1]+u.y1+10,u.y2)}):(n={x:Math.max(t[0]+u.x1-10,u.x1),y:h},a={x:Math.min(t[0]+u.x1+10,u.x2),y:h}),r.push({start:n,end:a,gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{so(t,"area").forEach((t=>{const a=io(o?{start:{x:(n+l)/2,y:0},end:{x:(n+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(n+l)/2},end:{x:u.x2-u.x1,y:(n+l)/2}},t);a.sort(((t,e)=>t[0]-e[0]));for(let n=0;n<a.length-1;n++){const l={x:a[n][0],y:a[n][1]},h={x:a[n+1][0],y:a[n+1][1]};if(no(o?{x:l.x,y:(l.y+h.y)/2}:{x:(l.x+h.x)/2,y:l.y},t)){let t,n;o?(t={x:l.x+u.x1,y:Math.max(l.y+u.y1-0,u.y1)},n={x:h.x+u.x1,y:Math.min(h.y+u.y1+0,u.y2)}):(t={x:Math.max(l.x+u.x1-0,u.x1),y:l.y+u.y1},n={x:Math.min(h.x+u.x1+0,u.x2),y:h.y+u.y1}),r.push({start:t,end:n,gap:s,style:null==i?void 0:i.style,axisId:d,data:e})}}}))}))}}))}))})),r}}}}function io(t,e){const s=[];for(let n=1;n<e.length;n++){const r=i.getIntersectPoint([t.start.x,t.start.y],[t.end.x,t.end.y],[e[n].x,e[n].y],[e[n-1].x,e[n-1].y]);r&&!s.find((t=>to(i.PointService.distancePP({x:t[0],y:t[1]},{x:r[0],y:r[1]}),0)))&&s.push(r)}return s}function so(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 no(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}class ro{constructor(t,e,i,s){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(s)}getMarks(){return this.marks}registerChannelEncoder(t,e){return i.isString(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}registerFunctionEncoder(t){return this.functionEncoder=t,this}registerDefaultEncoder(t){return this.defaultEncoder=t,this}registerProgressiveChannels(t){return this.progressiveChannels=i.array(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class ao{static registerPlotMarks(t,e){ao._plotMarks[t]=e}static createPlotMark(t,e){return ao._plotMarks[t]?new ao._plotMarks[t](e):null}static registerMark(t,e){ao._marks[t]=e}static createMark(t,e,i){return ao._marks[t]?new ao._marks[t](e,t,i):null}static hasMark(t){return!!ao._marks[t]}static getMark(t){return ao._marks[t]}static registerComponent(t,e){ao._components[t]=e}static createComponent(t,e,i,s){const n=ao._components[t];return n?new n(e,i,s):null}static hasComponent(t){return!!ao._components[t]}static registerGraphicComponent(t,e){ao._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const s=ao._graphicComponents[t];return s?s(e,i):null}static registerTransform(t,e,i){ao._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return ao._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(ao._transforms).forEach((t=>{ao._transforms[t]&&!ao._transforms[t].isBuiltIn&&(ao._transforms[t]=null)}))}static registerGrammar(t,e,i){ao._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var s;const n=null===(s=ao._grammars[t])||void 0===s?void 0:s.grammarClass;return n?new n(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return ao._glyphs[t]}static createInteraction(t,e,i){const s=ao._interactions[t];return s?new s(e,i):null}static hasInteraction(t){return!!ao._interactions[t]}}ao._plotMarks={},ao._marks={},ao._components={},ao._graphicComponents={},ao._transforms={},ao._grammars={},ao._glyphs={},ao._animations={},ao._interactions={},ao._graphics={},ao._stageEventPlugins={},ao.registerGlyph=(t,e,i,s,n)=>(ao._glyphs[t]=new ro(e,i,s,n),ao._glyphs[t]),ao.registerAnimationType=(t,e)=>{ao._animations[t]=e},ao.getAnimationType=t=>ao._animations[t],ao.registerInteraction=(t,e)=>{ao._interactions[t]=e},ao.registerGraphic=(t,e)=>{ao._graphics[t]=e},ao.getGraphicType=t=>ao._graphics[t],ao.createGraphic=(t,e)=>{const i=ao._graphics[t];return i?i(e):null},ao.registerDefaultLayout=t=>{ao.defaultLayout=t},ao.getDefaultLayout=()=>ao.defaultLayout,ao.registerStageEventPlugin=(t,e)=>{ao._stageEventPlugins[t]=e},ao.getStageEventPlugin=t=>ao._stageEventPlugins[t];const oo="barLink";class lo extends Xr{constructor(){super(...arguments),this.name=oo}render(){const{data:t,linkStyle:s,areaStyle:n,styleMap:r,label:a,linkType:o="total"}=this.attribute;i.isEmpty(t)||(this.removeAllChild(),t.forEach(((t,l)=>{var h,c,d,u,p;const{linePoints:f,areaPoints:g,id:m=l,color:y,data:b}=t;if(g&&!1!==(null===(h=null==r?void 0:r[`area-${m}`])||void 0===h?void 0:h.visible)){const t=(x=Object.assign(Object.assign({points:g,fillOpacity:.3,fill:y,zIndex:0},n),null==r?void 0:r[`area-${m}`]),new Er(x));t.name="bar-link-area",t.id=`area-${m}`,this.add(t)}var x;if(f&&!1!==(null===(c=null==r?void 0:r[`line-${m}`])||void 0===c?void 0:c.visible)&&0!==(null===(d=null==s?void 0:s.lineStyle)||void 0===d?void 0:d.lineWidth)&&0!==(null===(u=null==r?void 0:r[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:t={},endSymbol:e={},lineStyle:n}=s||{},a=i.cloneDeep(t),o=i.cloneDeep(e);(null==r?void 0:r[`line-${m}`])&&r[`line-${m}`].stroke&&(a.style=Object.assign(Object.assign({},a.style),{color:r[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:r[`line-${m}`].stroke})),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new qa({points:f,startSymbol:Object.assign({size:8},a),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==r?void 0:r[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==a?void 0:a.visible)&&!1!==(null===(p=null==r?void 0:r[`label-${m}`])||void 0===p?void 0:p.visible)){const{style:t,formatMethod:i}=a,[s,n]=b;let l=s[e.STACK_FIELD_END],h=n[e.STACK_FIELD_END];"value"===o&&(l=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START],h=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START]);const c=h-l,d=(h-l)/l*100,u=mn(Object.assign(Object.assign({x:.5*(f[0].x+f[1].x),y:.5*(f[0].y+f[1].y),text:i?i(c,d,b):`${c} ${d}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==r?void 0:r[`label-${m}`]));u.name="bar-link-label",u.id=`label-${m}`,this.add(u)}})))}}function ho(t,e,i){const{isHorizontal:s,isXAxisInverse:n,isYAxisInverse:r,linkType:a,doFill:o,regionStartX:l,regionStartY:h}=i,c=t.getGraphicItem(),d=e.getGraphicItem(),u=c.AABBBounds,p=d.AABBBounds;let f,g;return s?(f=[{x:(u.x1+u.x2)/2+l,y:u.y1+h},{x:(p.x1+p.x2)/2+l,y:p.y2+h}],n?("total"===a&&(f=[{x:u.x1+l,y:u.y1+h},{x:p.x1+l,y:p.y2+h}]),o&&(g=[{x:u.x1+l,x1:u.x2+l,y:u.y1+h},{x:p.x1+l,x1:p.x2+l,y:p.y2+h}])):("total"===a&&(f=[{x:u.x2+l,y:u.y1+h},{x:p.x2+l,y:p.y2+h}]),o&&(g=[{x:u.x2+l,x1:u.x1+l,y:u.y1+h},{x:p.x2+l,x1:p.x1+l,y:p.y2+h}]))):(f=[{x:u.x2+l,y:(u.y1+u.y2)/2+h},{x:p.x1+l,y:(p.y1+p.y2)/2+h}],r?("total"===a&&(f=[{x:u.x2+l,y:u.y2+h},{x:p.x1+l,y:p.y2+h}]),o&&(g=[{x:u.x2+l,y:u.y2+h,y1:u.y1+h},{x:p.x1+l,y:p.y2+h,y1:p.y1+h}])):("total"===a&&(f=[{x:u.x2+l,y:u.y1+h},{x:p.x1+l,y:p.y1+h}]),o&&(g=[{x:u.x2+l,y:u.y1+h,y1:u.y2+h},{x:p.x1+l,y:p.y1+h,y1:p.y2+h}]))),{areaPoints:g,linePoints:f,data:[t.data[0],e.data[0]],color:c.attribute.fill}}function co(t={},i){const{linkType:s="total",doFill:n}=t,r=d(t,["linkType","doFill"]);return{type:"component",componentType:oo,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,i;(null===(i=null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getProduct())||void 0===i?void 0:i.elements).forEach((t=>{l.push(t)}))}));const h=function(t,e){var i;const s={};for(let n=0;n<t.length;n++){const r=t[n],a=null===(i=r.data)||void 0===i?void 0:i[0],o=e.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)=>t.data[0][e.STACK_FIELD_END]-i.data[0][e.STACK_FIELD_END]))}));const c=i[0],d="horizontal"===c.direction,u=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),f=Object.values(h);if(f.length)if(d){f[0][0].getGraphicItem().AABBBounds.y1<f[f.length-1][0].getGraphicItem().AABBBounds.y1&&f.reverse()}else{f[0][0].getGraphicItem().AABBBounds.x1>f[f.length-1][0].getGraphicItem().AABBBounds.x1&&f.reverse()}for(let t=0;t<f.length-1;t++){const e=f[t],i=f[t+1];if(e.forEach(((t,e)=>{var l;const h=ho(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,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=ho(t,i[l],{isHorizontal:d,isXAxisInverse:p,isYAxisInverse:u,doFill:n,linkType:s,regionStartX:r,regionStartY:a});o.push(e)}}}}})),o},linkType:s},r),i)}}const uo="seriesLabel";function po(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 fo(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function go(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(fo(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 mo(t,e){const{label:s,line:n}=e;return{type:"component",componentType:uo,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,s)=>{var n;const r=s.vchart.getChart(),a=r.getAllSeries()[0],o="horizontal"===a.direction,l=o?a.getYAxisHelper():a.getXAxisHelper(),h=null===(n=l.getScale)||void 0===n?void 0:n.call(l,0),c=l.isInverse(),d=a.getDimensionField()[0],u=a.getSeriesField(),p=r.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),f=[];if(1===p.length&&["bar","area","line","waterfall"].includes(p[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const e="end"===t?i.last(h.domain()):h.domain()[0],s=a.getRegion(),{x:n,y:l}=s.getLayoutStartPoint();let g=0;r.getAllSeries().forEach((i=>{i.getMarkInName("waterfall"===p[0]?"bar":p[0]).getProduct().elements.forEach((s=>{var r;const a=s.data.find((t=>t[d]===e));if(a){const e=s.getGraphicItem(),h=e.AABBBounds;let m,y,b,x;"bar"===p[0]||"waterfall"===p[0]?(m="end"===t?{x:o?(h.x1+h.x2)/2:c?h.x1:h.x2,y:o?c?h.y2:h.y1:(h.y1+h.y2)/2}:{x:o?(h.x1+h.x2)/2:c?h.x2:h.x1,y:o?c?h.y1:h.y2:(h.y1+h.y2)/2},y=e.attribute.fill):(m=i.dataToPosition(a),y=e.attribute.stroke||e.attribute.fill),"end"===t?(b=o?"center":c?"end":"start",x=o?c?"top":"bottom":"middle"):(b=o?"center":c?"start":"end",x=o?c?"bottom":"top":"middle");const v=null!==(r=a[u])&&void 0!==r?r:a[d];f.push({point:{x:m.x+n,y:m.y+l},label:v,color:y,textAlign:b,textBaseline:x,series:i,datum:a,id:`${t}-${g}`,position:t}),g++}}))}))}))}return f},line:n,label:Object.assign({space:12},s)}}}class yo extends Xr{constructor(){super(...arguments),this.name=uo}render(){var t,e,s,n;this.removeAllChild();const{data:r,layout:a,label:o,line:l={}}=this.attribute;if(i.isEmpty(r))return;const h=null!==(t=null==o?void 0:o.styleMap)&&void 0!==t?t:{},c={},d=r.filter((t=>{var e;return!1!==(null===(e=h[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===a){const t=1.5*(null!==(s=null===(e=null==o?void 0:o.style)||void 0===e?void 0:e.fontSize)&&void 0!==s?s:12),i=(t,e,i)=>{var s,n,r,a,o,l,h,c;const{label:d,color:u,textAlign:p,textBaseline:f,id:g}=t,m=null!==(n=null===(s=i[g])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null===(r=this.attribute.label)||void 0===r?void 0:r.formatMethod,y=mn(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(d,t.datum,{series:t.series}):d},null===(a=this.attribute.label)||void 0===a?void 0:a.style),e),{textAlign:p,textBaseline:f,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:u}),null===(c=i[g])||void 0===c?void 0:c.style));return y.name="series-label-text",y.id=g,this.add(y),y};["start","end"].forEach((e=>{const s=d.filter((t=>t.position===e)),n=po(s.map((t=>t.point.y)),t);s.forEach(((t,e)=>{var s;const r={x:t.point.x+(null!==(s=null==o?void 0:o.space)&&void 0!==s?s:8)*("start"===t.textAlign?1:-1),y:n[e]};i(t,r,h),c[t.id]=r}))}))}else{const t=[],e=[];d.forEach((i=>{var s,n,r,a,l;const{point:c,label:d,color:u,textAlign:p,textBaseline:f,id:g,position:m}=i,y={x:c.x,y:c.y},b=null!==(n=null===(s=h[g])||void 0===s?void 0:s.formatMethod)&&void 0!==n?n:null==o?void 0:o.formatMethod,x=mn(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(d,i.datum,{series:i.series}):d},null==o?void 0:o.style),y),{textAlign:p,textBaseline:f,fill:null!==(a=null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:u}),null===(l=h[g])||void 0===l?void 0:l.style));x.id=g,x.name="series-label-text",this.add(x),"start"===m?t.push(x):"end"===m&&e.push(x)})),t.length&&go(t,4,10),e.length&&go(e,4,10);const i=null!==(n=null==o?void 0:o.space)&&void 0!==n?n:8;[...t,...e].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+i*e),c[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==l.visible&&d.forEach((t=>{var e,i,s,n,r,o;const{point:d,color:u,id:p}=t,f={x:c[p].x+(null!==(s=null===(i=null===(e=h[p])||void 0===e?void 0:e.style)||void 0===i?void 0:i.dx)&&void 0!==s?s:0),y:c[p].y+(null!==(o=null===(r=null===(n=h[p])||void 0===n?void 0:n.style)||void 0===r?void 0:r.dy)&&void 0!==o?o:0)};if(!1!==l.autoVisible){if("vertical"===a&&d.y!==f.y||"horizontal"===a&&d.x!==f.x){const t=Mr(Object.assign({points:[d,f],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}else{const t=Mr(Object.assign({points:[d,f],lineWidth:1,stroke:u},l.style));t.name="series-label-line",this.add(t)}}))}}t.BAR_LINK=oo,t.BarLinkComponent=lo,t.ConversionFunnelChart=v,t.ConversionFunnelSeries=_,t.DEFAULT_ARROW_MARK_STYLE=A,t.DEFAULT_ARROW_SYMBOL_MARK_STYLE=B,t.DEFAULT_ARROW_TEXT_MARK_STYLE=T,t.DEFAULT_FUNNEL_BACKGROUND_MARK_STYLE=S,t.RankingBar=a,t.SERIES_BREAK=Za,t.SeriesBreakComponent=Qa,t.SeriesLabelComponent=yo,t.appendBarLinkConfig=function(t,e){t.customMark=i.array(t.customMark).filter((t=>t.componentType!==oo)),t.customMark.push(co(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=i.array(t.customMark).filter((t=>t.componentType!==Za)),t.customMark.push(eo(e,e.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,e){var s,n,r;if(t.customMark=i.array(t.customMark).filter((t=>t.componentType!==uo)),e||(e=null!==(r=null!==(s=i.get(t,uo))&&void 0!==s?s:i.get(null===(n=t.series)||void 0===n?void 0:n[0],uo))&&void 0!==r?r:{}),e.visible){const{position:i="end"}=e,s=d(e,["position"]);t.customMark.push(mo(i,s))}},t.getBarLinkConfig=co,t.getSeriesBreakConfig=eo,t.getSeriesLabelConfig=mo,t.registerBarLink=()=>{ao.registerGraphicComponent(oo,(t=>new lo(t)))},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([v]),i.useSeries([_]))},t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([a])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new Qa(t)))},t.registerSeriesLabel=()=>{ao.registerGraphicComponent("seriesLabel",(t=>new yo(t)))}}));
|