@visactor/vchart-extension 1.12.18 → 1.12.19

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.
Files changed (177) hide show
  1. package/build/index.js +10244 -0
  2. package/build/index.min.js +15 -0
  3. package/cjs/charts/conversion-funnel/arrow-data-transform.d.ts +24 -0
  4. package/cjs/charts/conversion-funnel/arrow-data-transform.js +99 -0
  5. package/cjs/charts/conversion-funnel/arrow-data-transform.js.map +1 -0
  6. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.d.ts +7 -0
  7. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +196 -0
  8. package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -0
  9. package/cjs/charts/conversion-funnel/conversion-funnel.d.ts +40 -0
  10. package/cjs/charts/conversion-funnel/conversion-funnel.js +78 -0
  11. package/cjs/charts/conversion-funnel/conversion-funnel.js.map +1 -0
  12. package/cjs/charts/conversion-funnel/index.d.ts +2 -0
  13. package/cjs/charts/conversion-funnel/index.js +21 -0
  14. package/cjs/charts/conversion-funnel/index.js.map +1 -0
  15. package/cjs/charts/conversion-funnel/interface.d.ts +35 -0
  16. package/cjs/charts/conversion-funnel/interface.js +6 -0
  17. package/cjs/charts/conversion-funnel/interface.js.map +1 -0
  18. package/cjs/charts/conversion-funnel/util.d.ts +3 -0
  19. package/cjs/charts/conversion-funnel/util.js +17 -0
  20. package/cjs/charts/conversion-funnel/util.js.map +1 -0
  21. package/cjs/charts/ranking-bar/interface.d.ts +45 -0
  22. package/cjs/charts/ranking-bar/interface.js +6 -0
  23. package/cjs/charts/ranking-bar/interface.js.map +1 -0
  24. package/cjs/charts/ranking-bar/ranking-bar-transformer.d.ts +10 -0
  25. package/cjs/charts/ranking-bar/ranking-bar-transformer.js +291 -0
  26. package/cjs/charts/ranking-bar/ranking-bar-transformer.js.map +1 -0
  27. package/cjs/charts/ranking-bar/ranking-bar.d.ts +16 -0
  28. package/cjs/charts/ranking-bar/ranking-bar.js +34 -0
  29. package/cjs/charts/ranking-bar/ranking-bar.js.map +1 -0
  30. package/cjs/components/bar-link/bar-link.d.ts +7 -0
  31. package/cjs/components/bar-link/bar-link.js +87 -0
  32. package/cjs/components/bar-link/bar-link.js.map +1 -0
  33. package/cjs/components/bar-link/constant.d.ts +1 -0
  34. package/cjs/components/bar-link/constant.js +6 -0
  35. package/cjs/components/bar-link/constant.js.map +1 -0
  36. package/cjs/components/bar-link/index.d.ts +4 -0
  37. package/cjs/components/bar-link/index.js +48 -0
  38. package/cjs/components/bar-link/index.js.map +1 -0
  39. package/cjs/components/bar-link/type.d.ts +27 -0
  40. package/cjs/components/bar-link/type.js +6 -0
  41. package/cjs/components/bar-link/type.js.map +1 -0
  42. package/cjs/components/bar-link/util.d.ts +22 -0
  43. package/cjs/components/bar-link/util.js +183 -0
  44. package/cjs/components/bar-link/util.js.map +1 -0
  45. package/cjs/components/series-break/constant.d.ts +1 -0
  46. package/cjs/components/series-break/constant.js +6 -0
  47. package/cjs/components/series-break/constant.js.map +1 -0
  48. package/cjs/components/series-break/index.d.ts +4 -0
  49. package/cjs/components/series-break/index.js +49 -0
  50. package/cjs/components/series-break/index.js.map +1 -0
  51. package/cjs/components/series-break/series-break.d.ts +7 -0
  52. package/cjs/components/series-break/series-break.js +118 -0
  53. package/cjs/components/series-break/series-break.js.map +1 -0
  54. package/cjs/components/series-break/type.d.ts +14 -0
  55. package/cjs/components/series-break/type.js +6 -0
  56. package/cjs/components/series-break/type.js.map +1 -0
  57. package/cjs/components/series-break/util.d.ts +13 -0
  58. package/cjs/components/series-break/util.js +248 -0
  59. package/cjs/components/series-break/util.js.map +1 -0
  60. package/cjs/components/series-label/constant.d.ts +1 -0
  61. package/cjs/components/series-label/constant.js +6 -0
  62. package/cjs/components/series-label/constant.js.map +1 -0
  63. package/cjs/components/series-label/index.d.ts +3 -0
  64. package/cjs/components/series-label/index.js +49 -0
  65. package/cjs/components/series-label/index.js.map +1 -0
  66. package/cjs/components/series-label/series-label.d.ts +7 -0
  67. package/cjs/components/series-label/series-label.js +114 -0
  68. package/cjs/components/series-label/series-label.js.map +1 -0
  69. package/cjs/components/series-label/type.d.ts +41 -0
  70. package/cjs/components/series-label/type.js +6 -0
  71. package/cjs/components/series-label/type.js.map +1 -0
  72. package/cjs/components/series-label/util.d.ts +33 -0
  73. package/cjs/components/series-label/util.js +152 -0
  74. package/cjs/components/series-label/util.js.map +1 -0
  75. package/cjs/index.d.ts +5 -0
  76. package/cjs/index.js +22 -0
  77. package/cjs/index.js.map +1 -0
  78. package/cjs/type/index.d.ts +1 -0
  79. package/cjs/type/index.js +21 -0
  80. package/cjs/type/index.js.map +1 -0
  81. package/cjs/type/type.d.ts +8 -0
  82. package/cjs/type/type.js +6 -0
  83. package/cjs/type/type.js.map +1 -0
  84. package/cjs/utils/element.d.ts +7 -0
  85. package/cjs/utils/element.js +21 -0
  86. package/cjs/utils/element.js.map +1 -0
  87. package/cjs/utils/math.d.ts +1 -0
  88. package/cjs/utils/math.js +10 -0
  89. package/cjs/utils/math.js.map +1 -0
  90. package/esm/charts/conversion-funnel/arrow-data-transform.d.ts +24 -0
  91. package/esm/charts/conversion-funnel/arrow-data-transform.js +94 -0
  92. package/esm/charts/conversion-funnel/arrow-data-transform.js.map +1 -0
  93. package/esm/charts/conversion-funnel/conversion-funnel-transformer.d.ts +7 -0
  94. package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +192 -0
  95. package/esm/charts/conversion-funnel/conversion-funnel-transformer.js.map +1 -0
  96. package/esm/charts/conversion-funnel/conversion-funnel.d.ts +40 -0
  97. package/esm/charts/conversion-funnel/conversion-funnel.js +81 -0
  98. package/esm/charts/conversion-funnel/conversion-funnel.js.map +1 -0
  99. package/esm/charts/conversion-funnel/index.d.ts +2 -0
  100. package/esm/charts/conversion-funnel/index.js +4 -0
  101. package/esm/charts/conversion-funnel/index.js.map +1 -0
  102. package/esm/charts/conversion-funnel/interface.d.ts +35 -0
  103. package/esm/charts/conversion-funnel/interface.js +2 -0
  104. package/esm/charts/conversion-funnel/interface.js.map +1 -0
  105. package/esm/charts/conversion-funnel/util.d.ts +3 -0
  106. package/esm/charts/conversion-funnel/util.js +10 -0
  107. package/esm/charts/conversion-funnel/util.js.map +1 -0
  108. package/esm/charts/ranking-bar/interface.d.ts +45 -0
  109. package/esm/charts/ranking-bar/interface.js +2 -0
  110. package/esm/charts/ranking-bar/interface.js.map +1 -0
  111. package/esm/charts/ranking-bar/ranking-bar-transformer.d.ts +10 -0
  112. package/esm/charts/ranking-bar/ranking-bar-transformer.js +285 -0
  113. package/esm/charts/ranking-bar/ranking-bar-transformer.js.map +1 -0
  114. package/esm/charts/ranking-bar/ranking-bar.d.ts +16 -0
  115. package/esm/charts/ranking-bar/ranking-bar.js +27 -0
  116. package/esm/charts/ranking-bar/ranking-bar.js.map +1 -0
  117. package/esm/components/bar-link/bar-link.d.ts +7 -0
  118. package/esm/components/bar-link/bar-link.js +85 -0
  119. package/esm/components/bar-link/bar-link.js.map +1 -0
  120. package/esm/components/bar-link/constant.d.ts +1 -0
  121. package/esm/components/bar-link/constant.js +2 -0
  122. package/esm/components/bar-link/constant.js.map +1 -0
  123. package/esm/components/bar-link/index.d.ts +4 -0
  124. package/esm/components/bar-link/index.js +7 -0
  125. package/esm/components/bar-link/index.js.map +1 -0
  126. package/esm/components/bar-link/type.d.ts +27 -0
  127. package/esm/components/bar-link/type.js +2 -0
  128. package/esm/components/bar-link/type.js.map +1 -0
  129. package/esm/components/bar-link/util.d.ts +22 -0
  130. package/esm/components/bar-link/util.js +178 -0
  131. package/esm/components/bar-link/util.js.map +1 -0
  132. package/esm/components/series-break/constant.d.ts +1 -0
  133. package/esm/components/series-break/constant.js +2 -0
  134. package/esm/components/series-break/constant.js.map +1 -0
  135. package/esm/components/series-break/index.d.ts +4 -0
  136. package/esm/components/series-break/index.js +8 -0
  137. package/esm/components/series-break/index.js.map +1 -0
  138. package/esm/components/series-break/series-break.d.ts +7 -0
  139. package/esm/components/series-break/series-break.js +115 -0
  140. package/esm/components/series-break/series-break.js.map +1 -0
  141. package/esm/components/series-break/type.d.ts +14 -0
  142. package/esm/components/series-break/type.js +2 -0
  143. package/esm/components/series-break/type.js.map +1 -0
  144. package/esm/components/series-break/util.d.ts +13 -0
  145. package/esm/components/series-break/util.js +244 -0
  146. package/esm/components/series-break/util.js.map +1 -0
  147. package/esm/components/series-label/constant.d.ts +1 -0
  148. package/esm/components/series-label/constant.js +2 -0
  149. package/esm/components/series-label/constant.js.map +1 -0
  150. package/esm/components/series-label/index.d.ts +3 -0
  151. package/esm/components/series-label/index.js +6 -0
  152. package/esm/components/series-label/index.js.map +1 -0
  153. package/esm/components/series-label/series-label.d.ts +7 -0
  154. package/esm/components/series-label/series-label.js +110 -0
  155. package/esm/components/series-label/series-label.js.map +1 -0
  156. package/esm/components/series-label/type.d.ts +41 -0
  157. package/esm/components/series-label/type.js +2 -0
  158. package/esm/components/series-label/type.js.map +1 -0
  159. package/esm/components/series-label/util.d.ts +33 -0
  160. package/esm/components/series-label/util.js +144 -0
  161. package/esm/components/series-label/util.js.map +1 -0
  162. package/esm/index.d.ts +5 -0
  163. package/esm/index.js +9 -0
  164. package/esm/index.js.map +1 -0
  165. package/esm/type/index.d.ts +1 -0
  166. package/esm/type/index.js +2 -0
  167. package/esm/type/index.js.map +1 -0
  168. package/esm/type/type.d.ts +8 -0
  169. package/esm/type/type.js +2 -0
  170. package/esm/type/type.js.map +1 -0
  171. package/esm/utils/element.d.ts +7 -0
  172. package/esm/utils/element.js +15 -0
  173. package/esm/utils/element.js.map +1 -0
  174. package/esm/utils/math.d.ts +1 -0
  175. package/esm/utils/math.js +4 -0
  176. package/esm/utils/math.js.map +1 -0
  177. package/package.json +8 -8
@@ -0,0 +1,15 @@
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
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
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.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 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 R(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 I(t){return(e,i,s)=>{R(e,0,s,t)}}const U=(D=O,t=>(e,i,s)=>I(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 I(new L(M,t))}const z="Singleton",F="Transient",W="ConstantValue",G="DynamicValue",$="Factory",V="Function",Y="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===z&&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=z,this}inTransientScope(){return this._binding.scope=F,this}whenTargetNamed(t){return this._binding.constraint=q(t),this}}class Q{constructor(t){this._binding=t}to(t){return this._binding.type=Y,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=z,new J(this._binding)}toFactory(t){return this._binding.type=$,this._binding.factory=t,this._binding.scope=z,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)))}}const rt=i.tau-1e-8;class at{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,s,n,r,a){if(Math.abs(r-n)>rt)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 ot{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 lt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ht={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},ct=0,dt=1,ut=2,pt=3,ft=4,gt=5,mt=6,yt=7,bt=8;let xt,vt,_t,At,Bt,Tt;var St,wt,Pt,Mt,Ot,Ct,kt,Lt,Et;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 It(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"}(St||(St={})),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"}(wt||(wt={})),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"}(Pt||(Pt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Mt||(Mt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Ot||(Ot={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Ct||(Ct={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(kt||(kt={})),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"}(Lt||(Lt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Et||(Et={}));const Ut=[(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 Dt(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];Ut[l[0]](l,e,i,s,n,r,a)}}class Nt{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function jt(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 Ft(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 Wt extends Nt{constructor(t,e,i,s){super(),this.type=Lt.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 Ft(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?jt(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===kt.ROW?i.abs(this.p0.x-this.p3.x):t===kt.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 Gt extends Nt{constructor(t,e){super(),this.type=Lt.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===kt.ROW?i.abs(this.p0.x-this.p1.x):t===kt.COLUMN?i.abs(this.p0.y-this.p1.y):0}}class $t{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 Wt(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 Gt(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===kt.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===kt.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 $t{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 Yt(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 Xt(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)?kt.ROW:kt.COLUMN;return"monotoneY"===t?new Vt(t,n):new $t(t,n)}class Ht{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 Kt(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=Xt("linear",i,t);return function(t,e){Yt(t,e)}(new Ht(n,s),t),n}function qt(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 Zt{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&&qt(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:qt(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 Jt(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 Kt(t,e);const n=Xt("basis",i,t);return function(t,e){Yt(t,e)}(new Zt(n,s),t),n}function Qt(t){return t<0?-1:1}function te(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(Qt(r)+Qt(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function ee(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function ie(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 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=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:ie(this,this._t0,ee(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,ie(this,ee(this,e=te(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:ie(this,this._t0,e=te(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 ne extends se{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function re(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 Kt(t,e);const n=Xt("monotoneX",i,t);return function(t,e){Yt(t,e)}(new se(n,s),t),n}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 Kt(t,e);const n=Xt("monotoneY",i,t);return function(t,e){Yt(t,e)}(new ne(n,s),t),n}let oe=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 le(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 $t("step",null!=n?n:i.abs(t[t.length-1].x-t[0].x)>i.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Yt(t,e)}(new oe(a,e,r),t),a}class he extends Ht{lineEnd(){this.context.closePath()}}function ce(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=Xt("linear",i,t);return function(t,e){Yt(t,e)}(new he(n,s),t),n}function de(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 ue(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 Kt(i,n);const o=Xt(t,r,i);return Yt(new e(o,s,a),i),o}}const pe=ue("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:de(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 fe=ue("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:de(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 ge(t,e,i){var s,n;switch(e){case"linear":default:return Kt(t,i);case"basis":return Jt(t,i);case"monotoneX":return re(t,i);case"monotoneY":return ae(t,i);case"step":return le(t,.5,i);case"stepBefore":return le(t,0,i);case"stepAfter":return le(t,1,i);case"catmullRom":return pe(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return fe(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return ce(t,i)}}class me extends ot{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new at(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([mt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([gt,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([yt,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([ut,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([dt,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([ft,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([bt,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([ct,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([pt]),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[mt]=t=>`M${t[1]} ${t[2]}`,t[gt]=t=>`L${t[1]} ${t[2]}`,t[yt]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[ut]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ct]=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[bt]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[pt]=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(xt=e[t],vt=xt.slice(1),_t=xt[0],i=[_t],s=vt.match(lt),null!==s){for(let t=0,e=s.length;t<e;t++)At=s[t],Bt=parseFloat(At),Number.isNaN(Bt)||i.push(Bt);if(Tt=ht[_t],i.length-1>Tt){let t,e=_t;for(let s=1,r=i.length;s<r;s+=Tt){t=[e];for(let e=s,n=s+Tt;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=ge(e,i);"x"===s?this.direction=kt.ROW:"y"===s?this.direction=kt.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[mt]=this.moveToTransform,t[gt]=this.lineToTransform,t[yt]=this.quadraticCurveToTransform,t[ut]=this.bezierCurveToTransform,t[dt]=this.arcToTransform,t[ft]=this.ellipseTransform,t[bt]=this.rectTransform,t[ct]=this.arcTransform,t[pt]=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=be(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":It(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":It(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 gt:this.lineToTransform(a,e,i,s,n);break;case mt:this.moveToTransform(a,e,i,s,n);break;case ut:this.bezierCurveToTransform(a,e,i,s,n);break;case yt:this.quadraticCurveToTransform(a,e,i,s,n);break;case ct:this.arcToTransform(a,e,i,s,n);break;case ft:this.ellipseTransform(a,e,i,s,n);break;case bt:this.rectTransform(a,e,i,s,n);break;case dt:this.arcToTransform(a,e,i,s,n);break;case pt:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Dt(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===kt.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===kt.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 ye=["l",0,0,0,0,0,0,0];function be(t,e,i){const s=ye[0]=t[0];if("a"===s||"A"===s)ye[1]=e*t[1],ye[2]=i*t[2],ye[3]=t[3],ye[4]=t[4],ye[5]=t[5],ye[6]=e*t[6],ye[7]=i*t[7];else if("h"===s||"H"===s)ye[1]=e*t[1];else if("v"===s||"V"===s)ye[1]=i*t[1];else for(let s=1,n=t.length;s<n;++s)ye[s]=(s%2==1?e:i)*t[s];return ye}const xe={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},ve={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},_e=Object.assign({outerBorder:Object.assign(Object.assign({},ve),{distance:0}),innerBorder:Object.assign(Object.assign({},ve),{distance:0})},ve),Ae={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},Be=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}),_e),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Te={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Se=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}),Be),xe),we=Object.assign(Object.assign({},Se),{startAngle:0,endAngle:i.pi2,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Pe=Object.assign(Object.assign(Object.assign({},Se),Te),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Me=Object.assign(Object.assign({},Se),{radius:1,startAngle:0,endAngle:i.pi2}),Oe=Object.assign(Object.assign({},Se),{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}),Ce=Object.assign(Object.assign({},Se),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),ke=Object.assign(Object.assign(Object.assign({},Se),Te),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Le=Object.assign(Object.assign({},Se),{path:new me,fillStrokeOrder:1,customPath:()=>{i.Logger.getInstance().warn("空函数")}}),Ee=Object.assign(Object.assign({},Se),{points:[],cornerRadius:0,closePath:!0}),Re=Object.assign(Object.assign({},Se),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},Se),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Ie=Object.assign(Object.assign({},Se),{symbolType:"circle",size:10,keepDirIn3d:!0}),Ue=Object.assign(Object.assign(Object.assign({},Se),Ae),{strokeBoundsBuffer:0,keepDirIn3d:!0}),De=Object.assign(Object.assign(Object.assign({},Se),Ae),{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}),Ne=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Se),{fill:!0,cornerRadius:0}),je=Object.assign(Object.assign({},Ne),{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 Fe(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 We=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||F,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={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};n.push(l)}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 V:e=t.cache;break;case Y: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===z&&(t.cache=e,t.activated=!0)}},Ge=Symbol.for("CanvasFactory");function $e(t){return We.getNamed(Ge,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=$e(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=$e(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=[]}},Ye={arc:we,area:Pe,circle:Me,line:ke,path:Le,symbol:Ie,text:Ue,rect:Re,polygon:Ee,richtext:De,richtextIcon:je,image:Ne,group:Oe,glyph:Ce},Xe=Object.keys(Ye);function He(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Ke={arc:Object.assign({},Ye.arc),area:Object.assign({},Ye.area),circle:Object.assign({},Ye.circle),line:Object.assign({},Ye.line),path:Object.assign({},Ye.path),symbol:Object.assign({},Ye.symbol),text:Object.assign({},Ye.text),rect:Object.assign({},Ye.rect),polygon:Object.assign({},Ye.polygon),richtext:Object.assign({},Ye.richtext),richtextIcon:Object.assign({},Ye.richtextIcon),image:Object.assign({},Ye.image),group:Object.assign({},Ye.group),glyph:Object.assign({},Ye.glyph)};class qe{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Xe.forEach((t=>{this._defaultTheme[t]=Object.create(Ke[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;Xe.forEach((s=>{const n=Object.create(Ke[s]);t&&t[s]&&He(n,t[s]),i[s]&&He(n,i[s]),e[s]&&He(n,e[s]),this.combinedTheme[s]=n})),e.common&&Xe.forEach((t=>{He(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 Ze=new qe;function Je(t,e){return t.glyphHost?Je(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)):Ze.getTheme()}return null}(t)||t.attachedThemeGraphic&&Je(t.attachedThemeGraphic)||Ze.getTheme()}var Qe=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 ti 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 Qe(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._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&i.Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const 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 ei{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=ei.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const 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 ii extends ei{constructor(t,e){super(),this.type=t,this.detail=e}}const si={dispatchEvent(t){var e;if(!(t instanceof ei))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new ii(t,e))}};class ni{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-ni.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ni.bounceIn(2*t):.5*ni.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}}}ni.quadIn=ni.getPowIn(2),ni.quadOut=ni.getPowOut(2),ni.quadInOut=ni.getPowInOut(2),ni.cubicIn=ni.getPowIn(3),ni.cubicOut=ni.getPowOut(3),ni.cubicInOut=ni.getPowInOut(3),ni.quartIn=ni.getPowIn(4),ni.quartOut=ni.getPowOut(4),ni.quartInOut=ni.getPowInOut(4),ni.quintIn=ni.getPowIn(5),ni.quintOut=ni.getPowOut(5),ni.quintInOut=ni.getPowInOut(5),ni.backIn=ni.getBackIn(1.7),ni.backOut=ni.getBackOut(1.7),ni.backInOut=ni.getBackInOut(1.7),ni.elasticIn=ni.getElasticIn(1,.3),ni.elasticOut=ni.getElasticOut(1,.3),ni.elasticInOut=ni.getElasticInOut(1,.3*1.5);const ri=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===Mt.END?this.removeAnimate(e):e.status===Mt.RUNNING||e.status===Mt.INITIAL?(this.animateCount++,e.advance(t)):e.status===Mt.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 ai{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 oi extends ai{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class li{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ri,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e,this.status=Mt.INITIAL,this.tailAnimate=new hi(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){li.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]:li.mode;t&&e&Ot.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Pt.ANIMATE_PLAY})}runCb(t){const e=new oi((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=li.interpolateMap.get(t)||li.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===Mt.RUNNING&&(this.status=Mt.PAUSED)}resume(){this.status===Mt.PAUSED&&(this.status=Mt.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 hi(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===Mt.INITIAL&&(this.status=Mt.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Mt.RUNNING&&(this.status=Mt.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=Mt.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()}}li.mode=Ot.NORMAL,li.interpolateMap=new Map;class hi{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 ci(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?ni[i]:i,n=this._addStep(e,null,s);return n.type=Ct.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?ni[i]:i,r=this._addStep(e,null,n);return r.type=Ct.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=Ct.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=Ct.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 ci(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 ci{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 di=200,ui="cubicOut";var pi;!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"}(pi||(pi={}));const fi=[0,0,0,0];function gi(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 mi(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]=gi(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]=gi(t[i],e[i],s)}return n}const yi=(t,e)=>i.isString(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;var bi;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(bi||(bi={}));class xi{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bi.Color1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===bi.Color1){const e=xi.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];xi.store1[t]=e,xi.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=xi.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&&(xi.store1[t]=[r.r/255,r.g/255,r.b/255,r.opacity],xi.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===bi.Color1){if(xi.store1[t])return;xi.store1[t]=i,xi.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(xi.store255[t])return;xi.store255[t]=i,xi.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function vi(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 _i(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)=>Ai(i.isArray(t)?t[a]:t,i.isArray(e)?e[a]:e,s,n))):Ai(t,e,s,n,r)}function Ai(t,e,i,s,n){if(!t||!e)return t&&vi(t)||e&&vi(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=xi.Get(t,bi.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=xi.Get(e,bi.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:vi(a)})))});return o?_i(r,l,i,s,n):_i(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:Si(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:Si(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:Si(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),vi(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)}xi.store255={},xi.store1={};const Bi=[0,0,0,0],Ti=[0,0,0,0];function Si(t,e,i){return xi.Get(t,bi.Color255,Bi),xi.Get(e,bi.Color255,Ti),`rgba(${Math.round(Bi[0]+(Ti[0]-Bi[0])*i)},${Math.round(Bi[1]+(Ti[1]-Bi[1])*i)},${Math.round(Bi[2]+(Ti[2]-Bi[2])*i)},${Bi[3]+(Ti[3]-Bi[3])*i})`}class wi{static GetImage(t,e){var i;const s=wi.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):wi.loadImage(t,e)}static GetSvg(t,e){var i;let s=wi.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"},wi.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=wi.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},wi.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(!wi.isLoading&&wi.toLoadAueue.length){wi.isLoading=!0;const t=wi.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(wi.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((()=>{wi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),wi.loading()})).catch((t=>{console.error(t),wi.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),wi.loading()}))}}),0)}static loadImage(t,e){const i=Pi(t,wi.toLoadAueue);if(-1!==i)return wi.toLoadAueue[i].marks.push(e),void wi.loading();wi.toLoadAueue.push({url:t,marks:[e]}),wi.loading()}static improveImageLoading(t){const e=Pi(t,wi.toLoadAueue);if(-1!==e){const t=wi.toLoadAueue.splice(e,1);wi.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Pi(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}wi.cache=new Map,wi.isLoading=!1,wi.toLoadAueue=[],wi.onLoadSuccessCb=[];const Mi=new i.Matrix,Oi=new i.AABBBounds,Ci=["lineWidth","scaleX","scaleY","angle","anchor","visible"],ki=["x","y"],Li=["scaleX","scaleY"],Ei=["angle"],Ri=new i.Point,Ii={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 Ui extends ti{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const s=e[i];Object.defineProperty(Ui.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=St.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?(fi[0]=o[0],fi[2]=o[0],fi[1]=o[1],fi[3]=o[1],fi):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 at(t);return Dt(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&St.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&ze.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&St.UPDATE_BOUNDS)&&ze.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&St.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&St.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&St.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&St.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=St.CLEAR_SHAPE}containsPoint(t,e,s,n){if(!n)return!1;if(s===wt.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]:Ci;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]:Ci;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Pt.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=St.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,s;if(0===t&&0===e)return this;const n={type:Pt.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ki,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:xe.x)+t,a.y=(null!==(s=a.y)&&void 0!==s?s:xe.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:Pt.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,ki,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:Pt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:s},this.attribute,Li,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:xe.scaleX)*t,l.scaleY=(null!==(r=l.scaleY)&&void 0!==r?r:xe.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:Pt.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Li,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:Pt.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Ei,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:xe.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:Pt.ROTATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Ei,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 li(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:di,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:ui),c&&this.setAttributes(c,!1,{type:Pt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Pt.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|=St.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=St.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=St.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&St.UPDATE_SHAPE_AND_BOUNDS)===St.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=St.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=St.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=St.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=St.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=St.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=St.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=St.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&St.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 Oi.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Oi),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=xe.x,y:e=xe.y,scaleX:s=xe.scaleX,scaleY:n=xe.scaleY,angle:r=xe.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(xe);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=Mi.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:Pt.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:Pt.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=_i(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=_i(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=_i(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 me).fromString(t):this.pathProxy=new me,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")?(wi.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(i.isValidUrl(t)||t.includes("/")||i.isBase64(t))&&(wi.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 ii(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)}}}Ui.mixin(si);class Di{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 Ni(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function ji(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 Fi{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 Di("!xml");let i=e,s="",n="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=Ni(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=ji(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=Ni(t,"--\x3e",r+4,"Comment is not closed.");else{const a=ji(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 Di(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 Di(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 Wi(t,e){return Gi(t)}function Gi(t,e){const i={};for(let e=0;e<t.length;e++){const n=t[e],r=$i(n);if(void 0!==r&&n[r]){const t=Gi(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 $i(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 Yi{constructor(t){this.options=Object.assign({},Yi.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Wi(new Fi(this.options).parseXml(t),this.options)}}function Xi(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}Yi.defaultOptions={};let Hi=0;function Ki(){return Hi++}var qi;function Zi(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:qi.VERTICAL}),s="",i=0),e.push({text:t[n],direction:qi.HORIZONTAL}));return s&&e.push({text:s,direction:qi.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(qi||(qi={}));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))),Ki(),Ki();const es=Ki();Ki(),Ki();const is=Ki();Ki();const ss=Ki(),ns=Ki(),rs=Ki();Ki(),Ki(),Ki(),Ki();const as=Ki(),os=Ki(),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 Ui{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=is,this._childUpdateTag=St.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 qe),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new qe)}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===wt.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&St.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=xe.x,y:e=xe.y,dx:i=xe.dx,dy:s=xe.dy,scaleX:n=xe.scaleX,scaleY:r=xe.scaleY,angle:a=xe.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 Je(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip,display:l}=t;return 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)})),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&=St.CLEAR_BOUNDS,this._childUpdateTag&=St.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=St.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&St.UPDATE_BOUNDS||(this._childUpdateTag|=St.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&St.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=Ii;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"])},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)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new at(t);return Dt(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){Xi(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;Xi(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)return!0;if(!s.valid)return i.clear(),!1;const{visible:n=e.visible}=t;return!!n||(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 Rs{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===Et.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Et.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=Je(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(),Dt(("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 Is=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=Et.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=Je(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=Et.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=Is([N(),Ds(0,U(tt)),Ds(0,j(vs)),Us("design:paramtypes",[Object])],js);const zs=new class{constructor(){this.time=Et.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 Fs=new class{constructor(){this.time=Et.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:Fe(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=zs,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=Ft(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 Wt(s,l,d,o),new Wt(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 Vs(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 Ys=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 Rs{constructor(){super(...arguments),this.numberType=ss}draw(t,e,i,s){const n=Je(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=Vs(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=kt.ROW:"y"===n?p=kt.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=Vs(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=Je(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=ge(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=ge(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=Ys([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 Rs{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=as,this.builtinContributions=[Fs,Gs,Ws],this.init(t)}drawShape(t,e,s,n,r,a,o,l){var h;const c=Je(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=Je(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=zs,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 Rs{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=Je(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=Je(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){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,s,n,r,a,o,l){const h=[],c=[e,i],d=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a,o,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===s||"start"===s||("center"===s?d[0]=c[0]/-2:"right"!==s&&"end"!==s||(d[0]=-c[0])),"top"===n||("middle"===n?d[1]=c[1]/-2:"bottom"===n&&(d[1]=-c[1]));const u={xOffset:d[0],yOffset:d[1],width:c[0],height:c[1]};return this.layoutWithBBox(u,h,s,n,r)}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,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((t=>t.toString()));const l=[],h=[0,0];if("number"==typeof a&&a!==1/0){let e;for(let i=0,s=t.length;i<s;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),a),l.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,n,r,o).str,width:e});h[0]=a}else{let e,i;a=0;for(let s=0,n=t.length;s<n;s++)i=t[s],e=this.textMeasure.measureTextWidth(i,this.textOptions),a=Math.max(a,e),l.push({str:i,width:e});h[0]=a}h[1]=l.length*s,h[0]=l.reduce(((t,e)=>Math.max(t,e.width)),0);const c={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(c,e,i),this.layoutWithBBox(c,l,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){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(n-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+r[1],r[1]+=n,e}}const fn=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Ci];class gn extends Ui{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();if(!this.isSimplify())return;const{maxLineWidth:s=i.maxLineWidth}=e;return Number.isFinite(s)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),s=this.attribute,{maxLineWidth:n=i.maxLineWidth,text:r,whiteSpace:a=i.whiteSpace}=s;if(!Number.isFinite(n))return!1;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===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(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=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 Je(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){Xi(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}updateWrapAABBBounds(t){var e,s,n,r;const a=this.getGraphicTheme(),{fontFamily:o=a.fontFamily,textAlign:l=a.textAlign,textBaseline:h=a.textBaseline,fontSize:c=a.fontSize,ellipsis:d=a.ellipsis,maxLineWidth:u,stroke:p=a.stroke,lineWidth:f=a.lineWidth,wordBreak:g=a.wordBreak,fontWeight:m=a.fontWeight,ignoreBuf:y=a.ignoreBuf,suffixPosition:b=a.suffixPosition,heightLimit:x=0,lineClamp:v}=this.attribute,_=null!==(e=yi(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,A=y?0:2;if(!this.shouldUpdateShape()&&(null===(s=this.cache)||void 0===s?void 0:s.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const B=ze.graphicUtil.textMeasure,T=new pn(o,{fontSize:c,fontWeight:m,fontFamily:o},B),S=i.isArray(t)?t.map((t=>t.toString())):[t.toString()],w=[],P=[0,0];let M=1/0;if(x>0&&(M=Math.max(Math.floor(x/_),1)),v&&(M=Math.min(M,v)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<S.length;t++){const e=S[t];let i=!0;if(t===M-1){const i=T.textMeasure.clipTextWithSuffix(e,T.textOptions,u,d,!1,b,t!==S.length-1);w.push({str:i.str,width:i.width});break}const s=T.textMeasure.clipText(e,T.textOptions,u,"break-all"!==g,"keep-all"===g);if(""!==e&&""===s.str||s.wordBreaked){if(d){const t=T.textMeasure.clipTextWithSuffix(e,T.textOptions,u,d,!1,b);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}w.push({str:s.str,width:s.width});let a=s.str.length;if(!s.wordBreaked||""!==e&&""===s.str||(i=!0,a=s.wordBreaked),s.str.length===e.length);else if(i){let i=e.substring(a);"keep-all"===g&&(i=i.replace(/^\s+/g,"")),S.splice(t+1,0,i)}}let t=0;w.forEach((e=>{t=Math.max(t,e.width)})),P[0]=t}else{let t,e,i=0;for(let s=0,n=S.length;s<n;s++){if(s===M-1){const t=T.textMeasure.clipTextWithSuffix(S[s],T.textOptions,u,d,!1,b);w.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=S[s],t=T.textMeasure.measureTextWidth(e,T.textOptions,"break-word"===g),i=Math.max(i,t),w.push({str:e,width:t})}P[0]=i}P[1]=w.length*(_+A);const O={xOffset:0,yOffset:0,width:P[0],height:P[1]};T.LayoutBBox(O,l,h);const C=T.layoutWithBBox(O,w,l,h,_);return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:s=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===i&&s&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+s),n}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}updateHorizontalSinglelineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),{wrap:n=s.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds([t]);const r=ze.graphicUtil.textMeasure;let a,o;const l=this.attribute,{maxLineWidth:h=s.maxLineWidth,ellipsis:c=s.ellipsis,textAlign:d=s.textAlign,textBaseline:u=s.textBaseline,fontFamily:p=s.fontFamily,fontSize:f=s.fontSize,fontWeight:g=s.fontWeight,stroke:m=s.stroke,lineWidth:y=s.lineWidth,ignoreBuf:b=s.ignoreBuf,whiteSpace:x=s.whiteSpace,suffixPosition:v=s.suffixPosition}=l;if("normal"===x)return this.updateWrapAABBBounds(t);const _=b?0:Math.max(2,.075*f),A=l.fontSize||s.fontSize,B=null!==(e=yi(l.lineHeight,A))&&void 0!==e?e:A+_;if(!this.shouldUpdateShape()&&this.cache){a=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=_s(d,a),e=As(u,B,f);return this._AABBBounds.set(t,e,t+a,e+B),m&&this._AABBBounds.expand(y/2),this._AABBBounds}if(Number.isFinite(h)){if(c){const e=!0===c?s.ellipsis:c,i=r.clipTextWithSuffix(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p},h,e,!1,v);o=i.str,a=i.width}else{const e=r.clipText(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p},h,!1);o=e.str,a=e.width}this.cache.clipedText=o,this.cache.clipedWidth=a}else a=r.measureTextWidth(t.toString(),{fontSize:f,fontWeight:g,fontFamily:p}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=a;this.clearUpdateShapeTag();const T=_s(d,a);let S=B;ze.global&&ze.global.isSafari()&&(S+=.2*f);const w=As(u,S,f,_);return this._AABBBounds.set(T,w,T+a,w+S),m&&this._AABBBounds.expand(y/2),this._AABBBounds}getBaselineMapAlign(){return gn.baselineMapAlign}getAlignMapBaseline(){return gn.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,i,s;const n=this.getGraphicTheme(),r=ze.graphicUtil.textMeasure;let a;const o=this.attribute,{ignoreBuf:l=n.ignoreBuf}=o,h=l?0:2,{maxLineWidth:c=n.maxLineWidth,ellipsis:d=n.ellipsis,fontSize:u=n.fontSize,fontWeight:p=n.fontWeight,fontFamily:f=n.fontFamily,stroke:g=n.stroke,lineWidth:m=n.lineWidth,verticalMode:y=n.verticalMode,suffixPosition:b=n.suffixPosition}=o,x=null!==(e=yi(o.lineHeight,o.fontSize||n.fontSize))&&void 0!==e?e:(o.fontSize||n.fontSize)+h;let{textAlign:v=n.textAlign,textBaseline:_=n.textBaseline}=o;if(!y){const t=v;v=null!==(i=gn.baselineMapAlign[_])&&void 0!==i?i:"left",_=null!==(s=gn.alignMapBaseline[t])&&void 0!==s?s:"top"}if(!this.shouldUpdateShape()&&this.cache){a=this.cache.clipedWidth;const t=_s(v,a),e=As(_,x,u);return this._AABBBounds.set(e,t,e+x,t+a),g&&this._AABBBounds.expand(m/2),this._AABBBounds}let A=[Zi(t.toString())];if(Number.isFinite(c)){if(d){const t=!0===d?n.ellipsis:d,e=r.clipTextWithSuffixVertical(A[0],{fontSize:u,fontWeight:p,fontFamily:f},c,t,!1,b);A=[e.verticalList],a=e.width}else{const t=r.clipTextVertical(A[0],{fontSize:u,fontWeight:p,fontFamily:f},c,!1);A=[t.verticalList],a=t.width}this.cache.verticalList=A,this.cache.clipedWidth=a}else a=0,A[0].forEach((t=>{const e=t.direction===qi.HORIZONTAL?u:r.measureTextWidth(t.text,{fontSize:u,fontWeight:p,fontFamily:f});a+=e,t.width=e})),this.cache.verticalList=A,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const B=_s(v,a),T=As(_,x,u);return this._AABBBounds.set(T,B,T+x,B+a),g&&this._AABBBounds.expand(m/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),{wrap:n=s.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);const r=this.attribute,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,fontWeight:c=s.fontWeight,ellipsis:d=s.ellipsis,maxLineWidth:u,stroke:p=s.stroke,lineWidth:f=s.lineWidth,whiteSpace:g=s.whiteSpace,suffixPosition:m=s.suffixPosition}=r,y=null!==(e=yi(r.lineHeight,r.fontSize||s.fontSize))&&void 0!==e?e:r.fontSize||s.fontSize;if("normal"===g)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const b=ze.graphicUtil.textMeasure,x=new pn(a,{fontSize:h,fontWeight:c,fontFamily:a},b).GetLayoutByLines(t,o,l,y,!0===d?s.ellipsis:d||void 0,!1,u,m),{bbox:v}=x;return this.cache.layoutData=x,this.clearUpdateShapeTag(),this._AABBBounds.set(v.xOffset,v.yOffset,v.xOffset+v.width,v.yOffset+v.height),p&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,s,n;const r=this.getGraphicTheme(),a=ze.graphicUtil.textMeasure;let o;const l=this.attribute,{ignoreBuf:h=r.ignoreBuf}=l,c=h?0:2,{maxLineWidth:d=r.maxLineWidth,ellipsis:u=r.ellipsis,fontFamily:p=r.fontFamily,fontSize:f=r.fontSize,fontWeight:g=r.fontWeight,stroke:m=r.stroke,lineWidth:y=r.lineWidth,verticalMode:b=r.verticalMode,suffixPosition:x=r.suffixPosition}=l,v=null!==(e=yi(l.lineHeight,l.fontSize||r.fontSize))&&void 0!==e?e:(l.fontSize||r.fontSize)+c;let{textAlign:_=r.textAlign,textBaseline:A=r.textBaseline}=l;if(!b){const t=_;_=null!==(s=gn.baselineMapAlign[A])&&void 0!==s?s:"left",A=null!==(n=gn.alignMapBaseline[t])&&void 0!==n?n:"top"}if(o=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);o=i.max(e,o)}));const t=_s(_,o),e=this.cache.verticalList.length*v,s=As(A,e,f);return this._AABBBounds.set(s,t,s+e,t+o),m&&this._AABBBounds.expand(y/2),this._AABBBounds}const B=t.map((t=>Zi(t.toString())));B.forEach(((t,e)=>{if(Number.isFinite(d))if(u){const i=!0===u?r.ellipsis:u,s=a.clipTextWithSuffixVertical(t,{fontSize:f,fontWeight:g,fontFamily:p},d,i,!1,x);B[e]=s.verticalList,o=s.width}else{const i=a.clipTextVertical(t,{fontSize:f,fontWeight:g,fontFamily:p},d,!1);B[e]=i.verticalList,o=i.width}else o=0,t.forEach((t=>{const e=t.direction===qi.HORIZONTAL?f:a.measureTextWidth(t.text,{fontSize:f,fontWeight:g,fontFamily:p});o+=e,t.width=e}))})),this.cache.verticalList=B,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);o=i.max(e,o)}));const T=_s(_,o),S=this.cache.verticalList.length*v,w=As(A,S,f);return this._AABBBounds.set(w,T,w+S,T+o),m&&this._AABBBounds.expand(y/2),this._AABBBounds}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}}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},Ii),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 Rn=i.sqrt(3);function In(t,e,i,s){const n=e,r=n/Rn,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 In(t,this.parseSize(e)/2,i,s)}drawOffset(t,e,i,s,n){return In(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 zn=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 Fn=-.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(Fn*n-Wn*r+i,Wn*n+Fn*r+s),t.lineTo(Fn*a-Wn*o+i,Wn*a+Fn*o+s),t.lineTo(Fn*l-Wn*h+i,Wn*l+Fn*h+s),t.lineTo(Fn*n+Wn*r+i,Fn*r-Wn*n+s),t.lineTo(Fn*a+Wn*o+i,Fn*o-Wn*a+s),t.lineTo(Fn*l+Wn*h+i,Fn*h-Wn*l+s),t.closePath(),!1}var Vn=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 Yn(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 Yn(t,this.parseSize(e)/2,i,s,0)}drawOffset(t,e,i,s,n){return Yn(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(),Dt(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(Dt(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,zn,Vn,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",...Ci];let Tr=class t extends Ui{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 Yi,{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 me).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 me).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 Je(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;Xi(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 me).fromCustomPath2D(t.path,0,0,s[0],s[1]):(new me).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},Ii);const wr=["segments","points","curveType","curveTension",...Ci];class Pr extends Ui{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=mi(i,s,e))}getGraphicTheme(){return Je(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 me,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},Ii);const Or=["path","customPath",...Ci];class Cr extends Ui{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 me?e.path:(i.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof me?this.cache:t.path)}getGraphicTheme(){return Je(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 me).fromString(t.path):t.customPath&&(this.cache=new me,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Or)}needUpdateTag(t){return super.needUpdateTag(t,Or)}toCustomPath(){return(new me).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},Ii);const Lr=["segments","points","curveType","curveTension",...Ci];class Er extends Ui{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 Je(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=mi(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Lr)}needUpdateTag(t){return super.needUpdateTag(t,Lr)}toCustomPath(){const t=new me,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},Ii);const Rr=["points","cornerRadius",...Ci];class Ir extends Ui{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 Je(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=mi(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,Rr)}needUpdateTag(t){return super.needUpdateTag(t,Rr)}toCustomPath(){const t=this.attribute.points,e=new me;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 Ir(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ir.NOWORK_ANIMATE_ATTR}}function Ur(t){return new Ir(t)}Ir.NOWORK_ANIMATE_ATTR=Ii;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=Je(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 zr=!1;const Fr=new P((t=>{zr||(zr=!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 Vr=new P((t=>{$r||($r=!0,t(dn).to(ln).inSingletonScope(),t(hn).toService(dn),t(bs).toService(js),it(t,bs))}));const Yr=["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){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,Yr.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){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>Yr.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 ii(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;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:Fe(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 Rs{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:Fe(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 Rs{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:Fe(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 Ra=new P(((t,e,i,s)=>{Ea||(Ea=!0,t(Qr).to(La).inSingletonScope(),t(ea).toService(Qr))}));var Ia=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=Ia([N(),Da(0,U(dn)),Ua("design:paramtypes",[Object])],Na);let ja=!1;const za=new P(((t,e,i,s)=>{ja||(ja=!0,t(ta).to(Na).inSingletonScope(),t(ea).toService(ta))})),Fa=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),We.load(Fr),We.load(Fa?Pa:la))}$a.__loaded=!1;const Va=$a;function Ya(){Ya.__loaded||(Ya.__loaded=!0,Js.RegisterGraphicCreator("polygon",Ur),We.load(Vr),We.load(Fa?za:fa))}Ya.__loaded=!1;const Xa=Ya;function Ha(){Ha.__loaded||(Ha.__loaded=!0,Js.RegisterGraphicCreator("symbol",Sr),We.load(Gr),We.load(Fa?Ra:va))}Ha.__loaded=!1;const Ka=Ha;Ga(),Va(),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}}};class Za{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 Ja{static registerPlotMarks(t,e){Ja._plotMarks[t]=e}static createPlotMark(t,e){return Ja._plotMarks[t]?new Ja._plotMarks[t](e):null}static registerMark(t,e){Ja._marks[t]=e}static createMark(t,e,i){return Ja._marks[t]?new Ja._marks[t](e,t,i):null}static hasMark(t){return!!Ja._marks[t]}static getMark(t){return Ja._marks[t]}static registerComponent(t,e){Ja._components[t]=e}static createComponent(t,e,i,s){const n=Ja._components[t];return n?new n(e,i,s):null}static hasComponent(t){return!!Ja._components[t]}static registerGraphicComponent(t,e){Ja._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const s=Ja._graphicComponents[t];return s?s(e,i):null}static registerTransform(t,e,i){Ja._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return Ja._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(Ja._transforms).forEach((t=>{Ja._transforms[t]&&!Ja._transforms[t].isBuiltIn&&(Ja._transforms[t]=null)}))}static registerGrammar(t,e,i){Ja._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var s;const n=null===(s=Ja._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 Ja._glyphs[t]}static createInteraction(t,e,i){const s=Ja._interactions[t];return s?new s(e,i):null}static hasInteraction(t){return!!Ja._interactions[t]}}Ja._plotMarks={},Ja._marks={},Ja._components={},Ja._graphicComponents={},Ja._transforms={},Ja._grammars={},Ja._glyphs={},Ja._animations={},Ja._interactions={},Ja._graphics={},Ja._stageEventPlugins={},Ja.registerGlyph=(t,e,i,s,n)=>(Ja._glyphs[t]=new Za(e,i,s,n),Ja._glyphs[t]),Ja.registerAnimationType=(t,e)=>{Ja._animations[t]=e},Ja.getAnimationType=t=>Ja._animations[t],Ja.registerInteraction=(t,e)=>{Ja._interactions[t]=e},Ja.registerGraphic=(t,e)=>{Ja._graphics[t]=e},Ja.getGraphicType=t=>Ja._graphics[t],Ja.createGraphic=(t,e)=>{const i=Ja._graphics[t];return i?i(e):null},Ja.registerDefaultLayout=t=>{Ja.defaultLayout=t},Ja.getDefaultLayout=()=>Ja.defaultLayout,Ja.registerStageEventPlugin=(t,e)=>{Ja._stageEventPlugins[t]=e},Ja.getStageEventPlugin=t=>Ja._stageEventPlugins[t];const Qa="seriesBreak";function to(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 eo extends Xr{constructor(){super(...arguments),this.name=Qa}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=to(p,f,a,u?75:15,u),b=to(n,r,a,u?75:15,u),x=to(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 io(t,e,i=1){return Math.abs(t-e)<i}function so(t,e){return{type:"component",componentType:Qa,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;const l=t.id,h=i.isValid(l)?a.getComponentByUserId(l):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(!h)return;const c=null!=l?l:`${h.type}-${h.id}`,d=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),s=e+t[0].getLayoutRect().width,n=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:o,y:l}=a.getLayoutStartPoint(),{width:h,height:c}=a.getLayoutRect();e=Math.min(e,o),s=Math.max(s,h+o),i=Math.min(i,l),n=Math.max(n,c+l)}return{x1:e,y1:i,x2:s,y2:n}}(h.getRegions());i.array(t.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:s=5}=t,n=h.valueToPosition(e[0]),l=h.valueToPosition(e[1]),u=(n+l)/2+(o?d.x1:d.y1);a.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getProduct().elements.forEach((t=>{const a=t.getBounds();let h,p,f,g,m=!1;o?(m=a.x1<(n+l-s)/2&&a.x2>(n+l+s)/2,h=u,p=Math.max(a.y1+d.y1-2,d.y1),f=u,g=Math.min(a.y2+d.y1+2,d.y2)):(m=a.y1<(n+l-s)/2&&a.y2>(n+l+s)/2,h=Math.max(a.x1+d.x1-2,d.x1),p=u,f=Math.min(a.x2+d.x1+2,d.x2),g=u),m&&r.push({start:{x:h,y:p},end:{x:f,y:g},gap:s,style:null==i?void 0:i.style,axisId:c,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getProduct().elements.forEach((t=>{ro(t.graphicItem,"line").forEach((t=>{no(o?{start:{x:(n+l)/2,y:0},end:{x:(n+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(n+l)/2},end:{x:d.x2-d.x1,y:(n+l)/2}},t).forEach((t=>{let n,a;o?(n={x:u,y:Math.max(t[1]+d.y1-10,d.y1)},a={x:u,y:Math.min(t[1]+d.y1+10,d.y2)}):(n={x:Math.max(t[0]+d.x1-10,d.x1),y:u},a={x:Math.min(t[0]+d.x1+10,d.x2),y:u}),r.push({start:n,end:a,gap:s,style:null==i?void 0:i.style,axisId:c,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getProduct().elements.forEach((t=>{ro(t.graphicItem,"area").forEach((t=>{const a=no(o?{start:{x:(n+l)/2,y:0},end:{x:(n+l)/2,y:d.y2-d.y1}}:{start:{x:0,y:(n+l)/2},end:{x:d.x2-d.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(ao(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+d.x1,y:Math.max(l.y+d.y1-0,d.y1)},n={x:h.x+d.x1,y:Math.min(h.y+d.y1+0,d.y2)}):(t={x:Math.max(l.x+d.x1-0,d.x1),y:l.y+d.y1},n={x:Math.min(h.x+d.x1+0,d.x2),y:h.y+d.y1}),r.push({start:t,end:n,gap:s,style:null==i?void 0:i.style,axisId:c,data:e})}}}))}))}}))}))})),r}}}}function no(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=>io(i.PointService.distancePP({x:t[0],y:t[1]},{x:r[0],y:r[1]}),0)))&&s.push(r)}return s}function ro(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 ao(t,e){const{x:i,y:s}=t;let n=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:o}=e[t],{x:l,y:h}=e[r];o>s!=h>s&&i<(l-a)*(s-o)/(h-o)+a&&(n=!n)}return n}const 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=Qa,t.SeriesBreakComponent=eo,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));if(e.length)return t.customMark=i.array(t.customMark).filter((t=>t.componentType!==Qa)),t.customMark.push(so(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=so,t.getSeriesLabelConfig=mo,t.registerBarLink=()=>{Ja.registerGraphicComponent(oo,(t=>new lo(t)))},t.registerConversionFunnelChart=t=>{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=()=>{Ja.registerGraphicComponent("seriesBreak",(t=>new eo(t)))},t.registerSeriesLabel=()=>{Ja.registerGraphicComponent("seriesLabel",(t=>new yo(t)))}}));