@visactor/vutils-extension 1.4.0-alpha.2

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 (64) hide show
  1. package/README.md +11 -0
  2. package/cjs/index.d.ts +3 -0
  3. package/cjs/index.js +21 -0
  4. package/cjs/index.js.map +1 -0
  5. package/cjs/transform/tick-data/config.d.ts +1 -0
  6. package/cjs/transform/tick-data/config.js +6 -0
  7. package/cjs/transform/tick-data/config.js.map +1 -0
  8. package/cjs/transform/tick-data/continuous.d.ts +3 -0
  9. package/cjs/transform/tick-data/continuous.js +44 -0
  10. package/cjs/transform/tick-data/continuous.js.map +1 -0
  11. package/cjs/transform/tick-data/discrete/linear.d.ts +3 -0
  12. package/cjs/transform/tick-data/discrete/linear.js +90 -0
  13. package/cjs/transform/tick-data/discrete/linear.js.map +1 -0
  14. package/cjs/transform/tick-data/discrete/polar-angle.d.ts +3 -0
  15. package/cjs/transform/tick-data/discrete/polar-angle.js +45 -0
  16. package/cjs/transform/tick-data/discrete/polar-angle.js.map +1 -0
  17. package/cjs/transform/tick-data/index.d.ts +6 -0
  18. package/cjs/transform/tick-data/index.js +41 -0
  19. package/cjs/transform/tick-data/index.js.map +1 -0
  20. package/cjs/transform/tick-data/interface.d.ts +33 -0
  21. package/cjs/transform/tick-data/interface.js +6 -0
  22. package/cjs/transform/tick-data/interface.js.map +1 -0
  23. package/cjs/transform/tick-data/util.d.ts +15 -0
  24. package/cjs/transform/tick-data/util.js +80 -0
  25. package/cjs/transform/tick-data/util.js.map +1 -0
  26. package/cjs/utils/polar.d.ts +5 -0
  27. package/cjs/utils/polar.js +23 -0
  28. package/cjs/utils/polar.js.map +1 -0
  29. package/cjs/utils/text.d.ts +4 -0
  30. package/cjs/utils/text.js +17 -0
  31. package/cjs/utils/text.js.map +1 -0
  32. package/dist/index.js +27155 -0
  33. package/dist/index.min.js +1 -0
  34. package/es/index.d.ts +3 -0
  35. package/es/index.js +5 -0
  36. package/es/index.js.map +1 -0
  37. package/es/transform/tick-data/config.d.ts +1 -0
  38. package/es/transform/tick-data/config.js +2 -0
  39. package/es/transform/tick-data/config.js.map +1 -0
  40. package/es/transform/tick-data/continuous.d.ts +3 -0
  41. package/es/transform/tick-data/continuous.js +43 -0
  42. package/es/transform/tick-data/continuous.js.map +1 -0
  43. package/es/transform/tick-data/discrete/linear.d.ts +3 -0
  44. package/es/transform/tick-data/discrete/linear.js +81 -0
  45. package/es/transform/tick-data/discrete/linear.js.map +1 -0
  46. package/es/transform/tick-data/discrete/polar-angle.d.ts +3 -0
  47. package/es/transform/tick-data/discrete/polar-angle.js +39 -0
  48. package/es/transform/tick-data/discrete/polar-angle.js.map +1 -0
  49. package/es/transform/tick-data/index.d.ts +6 -0
  50. package/es/transform/tick-data/index.js +23 -0
  51. package/es/transform/tick-data/index.js.map +1 -0
  52. package/es/transform/tick-data/interface.d.ts +33 -0
  53. package/es/transform/tick-data/interface.js +2 -0
  54. package/es/transform/tick-data/interface.js.map +1 -0
  55. package/es/transform/tick-data/util.d.ts +15 -0
  56. package/es/transform/tick-data/util.js +70 -0
  57. package/es/transform/tick-data/util.js.map +1 -0
  58. package/es/utils/polar.d.ts +5 -0
  59. package/es/utils/polar.js +16 -0
  60. package/es/utils/polar.js.map +1 -0
  61. package/es/utils/text.d.ts +4 -0
  62. package/es/utils/text.js +13 -0
  63. package/es/utils/text.js.map +1 -0
  64. package/package.json +68 -0
@@ -0,0 +1 @@
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VDatasetExtension={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function s(t,e,i,s,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,s||t,o),l=n?n+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],a]:t._events[l].push(a):(t._events[l]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},a.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,o=new Array(s);r<s;r++)o[r]=i[r].fn;return o},a.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},a.prototype.emit=function(t,e,i,r,s,o){var a=n?n+t:t;if(!this._events[a])return!1;var l,h,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,s),!0;case 6:return c.fn.call(c.context,e,i,r,s,o),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var d,f=c.length;for(h=0;h<f;h++)switch(c[h].once&&this.removeListener(t,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,e);break;case 3:c[h].fn.call(c[h].context,e,i);break;case 4:c[h].fn.call(c[h].context,e,i,r);break;default:if(!l)for(d=1,l=new Array(u-1);d<u;d++)l[d-1]=arguments[d];c[h].fn.apply(c[h].context,l)}}return!0},a.prototype.on=function(t,e,n){return s(this,t,e,n,!1)},a.prototype.once=function(t,e,n){return s(this,t,e,n,!0)},a.prototype.removeListener=function(t,e,i,r){var s=n?n+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||r&&!a.once||i&&a.context!==i||o(this,s);else{for(var l=0,h=[],c=a.length;l<c;l++)(a[l].fn!==e||r&&!a[l].once||i&&a[l].context!==i)&&h.push(a[l]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(i);var r=n(i.exports);const s=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,o=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||s(t,"Boolean")},a=t=>"function"==typeof t,l=t=>null==t,h=t=>null!=t,c=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e},u=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||s(t,"String")},d=t=>Array.isArray?Array.isArray(t):s(t,"Array"),f=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||s(t,"Number")},p=t=>f(t)&&Number.isFinite(t),g=Object.prototype.hasOwnProperty,y=(t,e)=>null!=t&&g.call(t,e);function v(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;const r=[],o=[];return void 0===e&&(e=!0),void 0===n&&(n=1/0),function t(n,a){if(null===n)return null;if(0===a)return n;let l;if("object"!=typeof n)return n;if(d(n)?l=[]:s(n,"RegExp")?(l=new RegExp(n.source,function(t){let e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}(n)),n.lastIndex&&(l.lastIndex=n.lastIndex)):l=(t=>s(t,"Date"))(n)?new Date(n.getTime()):void 0===i?Object.create(Object.getPrototypeOf(n)):Object.create(i),e){const t=r.indexOf(n);if(-1!==t)return o[t];r.push(n),o.push(l)}for(const e in n)l[e]=t(n[e],a-1);return l}(t,n)}function m(t){if(null!==(e=t)&&"function"!=typeof e&&Number.isFinite(e.length))return t[t.length-1];var e}function b(t,e){if(!d(t)||!d(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}let x=!1;try{x="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){x=!1}x=!1;const w=1e-12,S=Math.PI,A=S/2,_=2*S,B=2*Math.PI,T=Math.abs,C=Math.atan2,P=Math.cos,R=Math.max,O=Math.min,M=Math.sin,E=Math.sqrt,k=Math.pow;function I(t){return t>1?0:t<-1?S:Math.acos(t)}function j(t){return t>=1?A:t<=-1?-A:Math.asin(t)}function D(t,e,n,i,r){let s,o;return"number"==typeof t&&"number"==typeof n&&(s=(1-r)*t+r*n),"number"==typeof e&&"number"==typeof i&&(o=(1-r)*e+r*i),{x:s,y:o}}class L{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=n,this.y1=i}clone(){return new L(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return f(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return f(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class N{static distancePP(t,e){return E(k(t.x-e.x,2)+k(t.y-e.y,2))}static distanceNN(t,e,n,i){return E(k(t-n,2)+k(e-i,2))}static distancePN(t,e,n){return E(k(e-t.x,2)+k(n-t.y,2))}static pointAtPP(t,e,n){return new L((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}function W(t,e,n){const{x1:i,y1:r,x2:s,y2:o}=e;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*s+n.c*r+n.e,n.b*s+n.d*r+n.f),t.add(n.a*s+n.c*o+n.e,n.b*s+n.d*o+n.f),t.add(n.a*i+n.c*o+n.e,n.b*i+n.d*o+n.f),e)}class F{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new F(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return d(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return W(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,n){const{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(t),l=Math.sin(t),h=e-e*a+n*l,c=n-e*l-n*a;return[a*i-l*r+h,l*i+a*r+c,a*i-l*o+h,l*i+a*o+c,a*s-l*r+h,l*s+a*r+c,a*s-l*o+h,l*s+a*o+c]}scalePoints(t,e,n,i){const{x1:r,y1:s,x2:o,y2:a}=this;return[t*r+(1-t)*n,e*s+(1-e)*i,t*o+(1-t)*n,e*a+(1-e)*i]}}class U extends F{}function z(t){return t*(Math.PI/180)}const H=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-_;)t+=_;else if(t>0)for(;t>_;)t-=_;return t};class V{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,n,i,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}setValue(t,e,n,i,r,s){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,s=this.f,o=new V,a=t*i-e*n;return o.a=i/a,o.b=-e/a,o.c=-n/a,o.d=t/a,o.e=(n*s-i*r)/a,o.f=-(t*s-e*r)/a,o}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,s=this.a*-n+this.c*e,o=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=s,this.d=o,this}rotateByCenter(t,e,n){const i=Math.cos(t),r=Math.sin(t),s=(1-i)*e+r*n,o=(1-i)*n-r*e,a=i*this.a-r*this.b,l=r*this.a+i*this.b,h=i*this.c-r*this.d,c=r*this.c+i*this.d,u=i*this.e-r*this.f+s,d=r*this.e+i*this.f+o;return this.a=a,this.b=l,this.c=h,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,n,i,r,s){return this.multiply(t,e,n,i,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:n,d:i,e:r,f:s}=this;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=s,this.f=r,this}multiply(t,e,n,i,r,s){const o=this.a,a=this.b,l=this.c,h=this.d,c=o*t+l*e,u=a*t+h*e,d=o*n+l*i,f=a*n+h*i,p=o*r+l*s+this.e,g=a*r+h*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=f,this.e=p,this.f=g,this}interpolate(t,e){const n=new V;return n.a=this.a+(t.a-this.a)*e,n.b=this.b+(t.b-this.b)*e,n.c=this.c+(t.c-this.c)*e,n.d=this.d+(t.d-this.d)*e,n.e=this.e+(t.e-this.e)*e,n.f=this.f+(t.f-this.f)*e,n}transformPoint(t,e){const{a:n,b:i,c:r,d:s,e:o,f:a}=this,l=n*s-i*r,h=s/l,c=-i/l,u=-r/l,d=n/l,f=(r*a-s*o)/l,p=-(n*a-i*o)/l,{x:g,y:y}=t;e.x=g*h+y*u+f,e.y=g*c+y*d+p}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new V(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),s.scaleX=o,s.scaleY=r/o,s.skewX=(t*n+e*i)/r,s.skewY=0}else if(0!==n||0!==i){const o=Math.sqrt(n*n+i*i);s.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/o):-Math.acos(n/o)),s.scaleX=r/o,s.scaleY=o,s.skewX=0,s.skewY=(t*n+e*i)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}let G,X,Y,q,$,K,Z,J;var Q;function et(t,e,n){return!(t&&e&&(n?(G=t.x1,X=t.x2,Y=t.y1,q=t.y2,$=e.x1,K=e.x2,Z=e.y1,J=e.y2,G>X&&([G,X]=[X,G]),Y>q&&([Y,q]=[q,Y]),$>K&&([$,K]=[K,$]),Z>J&&([Z,J]=[J,Z]),G>K||X<$||Y>J||q<Z):t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1))}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Q||(Q={}));const nt=t=>{let e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e&=1023,n&=1023,i=e<<10|n,i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};class it{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),h(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=h(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(l(this._canvas)&&(h(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),l(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&h(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),l(this._context)&&h(this._canvas)){const t=this._canvas.getContext("2d");h(t)&&(t.save(),t.font=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{fontStyle:n=e.fontStyle,fontVariant:i=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(i?i+" ":"")+(r?r+" ":"")+s+"px "+(o||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!l(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,n;const{defaultFontParams:i={}}=this._option,{fontStyle:r=i.fontStyle,fontVariant:s=i.fontVariant,fontWeight:o=(null!==(t=i.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(null!==(e=i.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(n=i.fontFamily)&&void 0!==n?n:"sans-serif"),align:h,textAlign:c=(null!=h?h:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:f,limit:p,lineHeight:g=a}=this._userSpec;return{fontStyle:r,fontVariant:s,fontFamily:l,fontSize:a,fontWeight:o,textAlign:c,textBaseline:d,ellipsis:f,limit:p,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(l(t))return{width:0,height:0};if(l(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:n,fontWeight:i,textAlign:r,textBaseline:s,ellipsis:o,limit:a,lineHeight:h}=this.textSpec;let c;try{const l=this._option.getTextBounds({text:t,fontFamily:e,fontSize:n,fontWeight:i,textAlign:r,textBaseline:s,ellipsis:!!o,maxLineWidth:a||1/0,lineHeight:h});c={width:l.width(),height:l.height()}}catch(e){this._notSupportVRender=!0,c=this.measureWithNaiveCanvas(t)}return c}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const e=this._context.measureText(t),{fontSize:n,lineHeight:i}=this.textSpec;return{width:e.width,height:null!=i?i:n}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let n=0;n<t.length;n++){const i=t[n];let r=this._measureSpecialChar(i);l(r)&&it.NUMBERS_CHAR_SET.includes(i)&&(r=this._measureNumberChar()),l(r)&&["F","W"].includes(nt(i))&&(r=this._measureFullSizeChar()),l(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){const e={width:0,height:0},{fontSize:n,lineHeight:i}=this.textSpec;for(let i=0;i<t.length;i++){const r=t[i],s=["F","W"].includes(nt(r))?1:.53;e.width+=s*n}return e.height=null!=i?i:n,e}_measureReduce(t,e){const{fontSize:n,lineHeight:i}=this.textSpec,r={width:0,height:0};if(l(t))return r;if(d(t)){const s=t.filter(h).map((t=>t.toString()));return 0===s.length?r:1===s.length?e(s[0]):{width:s.reduce(((t,n)=>Math.max(t,e(n).width)),0),height:s.length*((null!=i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(l(this._numberCharSize)){const t=this._standardMethod(it.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/it.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return l(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(it.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(l(this._letterCharSize)){const t=this._standardMethod(it.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/it.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return h(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){h(this._canvas)&&(this._canvas=null),h(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}var rt,st;function ot(t){switch(t){case st.Linear:case st.Log:case st.Pow:case st.Sqrt:case st.Symlog:case st.Time:return!0;default:return!1}}it.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",it.NUMBERS_CHAR_SET="0123456789",it.FULL_SIZE_CHAR="字",function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(rt||(rt={})),function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(st||(st={}));var at=function(t){return t&&t.Math==Math&&t},lt=at("object"==typeof globalThis&&globalThis)||at("object"==typeof window&&window)||at("object"==typeof self&&self)||at("object"==typeof e&&e)||function(){return this}()||e||Function("return this")(),ht={},ct=function(t){try{return!!t()}catch(t){return!0}},ut=!ct((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),dt=!ct((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),ft=dt,pt=Function.prototype.call,gt=ft?pt.bind(pt):function(){return pt.apply(pt,arguments)},yt={},vt={}.propertyIsEnumerable,mt=Object.getOwnPropertyDescriptor,bt=mt&&!vt.call({1:2},1);yt.f=bt?function(t){var e=mt(this,t);return!!e&&e.enumerable}:vt;var xt,wt,St=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},At=dt,_t=Function.prototype,Bt=_t.call,Tt=At&&_t.bind.bind(Bt,Bt),Ct=At?Tt:function(t){return function(){return Bt.apply(t,arguments)}},Pt=Ct,Rt=Pt({}.toString),Ot=Pt("".slice),Mt=function(t){return Ot(Rt(t),8,-1)},Et=ct,kt=Mt,It=Object,jt=Ct("".split),Dt=Et((function(){return!It("z").propertyIsEnumerable(0)}))?function(t){return"String"==kt(t)?jt(t,""):It(t)}:It,Lt=function(t){return null==t},Nt=Lt,Wt=TypeError,Ft=function(t){if(Nt(t))throw Wt("Can't call method on "+t);return t},Ut=Dt,zt=Ft,Ht=function(t){return Ut(zt(t))},Vt="object"==typeof document&&document.all,Gt={all:Vt,IS_HTMLDDA:void 0===Vt&&void 0!==Vt},Xt=Gt.all,Yt=Gt.IS_HTMLDDA?function(t){return"function"==typeof t||t===Xt}:function(t){return"function"==typeof t},qt=Yt,$t=Gt.all,Kt=Gt.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:qt(t)||t===$t}:function(t){return"object"==typeof t?null!==t:qt(t)},Zt=lt,Jt=Yt,Qt=function(t,e){return arguments.length<2?(n=Zt[t],Jt(n)?n:void 0):Zt[t]&&Zt[t][e];var n},te=Ct({}.isPrototypeOf),ee=lt,ne="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ie=ee.process,re=ee.Deno,se=ie&&ie.versions||re&&re.version,oe=se&&se.v8;oe&&(wt=(xt=oe.split("."))[0]>0&&xt[0]<4?1:+(xt[0]+xt[1])),!wt&&ne&&(!(xt=ne.match(/Edge\/(\d+)/))||xt[1]>=74)&&(xt=ne.match(/Chrome\/(\d+)/))&&(wt=+xt[1]);var ae=wt,le=ct,he=lt.String,ce=!!Object.getOwnPropertySymbols&&!le((function(){var t=Symbol();return!he(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ae&&ae<41})),ue=ce&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,de=Qt,fe=Yt,pe=te,ge=Object,ye=ue?function(t){return"symbol"==typeof t}:function(t){var e=de("Symbol");return fe(e)&&pe(e.prototype,ge(t))},ve=String,me=function(t){try{return ve(t)}catch(t){return"Object"}},be=Yt,xe=me,we=TypeError,Se=function(t){if(be(t))return t;throw we(xe(t)+" is not a function")},Ae=Se,_e=Lt,Be=function(t,e){var n=t[e];return _e(n)?void 0:Ae(n)},Te=gt,Ce=Yt,Pe=Kt,Re=TypeError,Oe={exports:{}},Me=lt,Ee=Object.defineProperty,ke=function(t,e){try{Ee(Me,t,{value:e,configurable:!0,writable:!0})}catch(n){Me[t]=e}return e},Ie=ke,je="__core-js_shared__",De=lt[je]||Ie(je,{}),Le=De;(Oe.exports=function(t,e){return Le[t]||(Le[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.31.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ne=Oe.exports,We=Ft,Fe=Object,Ue=function(t){return Fe(We(t))},ze=Ue,He=Ct({}.hasOwnProperty),Ve=Object.hasOwn||function(t,e){return He(ze(t),e)},Ge=Ct,Xe=0,Ye=Math.random(),qe=Ge(1..toString),$e=function(t){return"Symbol("+(void 0===t?"":t)+")_"+qe(++Xe+Ye,36)},Ke=Ne,Ze=Ve,Je=$e,Qe=ce,tn=ue,en=lt.Symbol,nn=Ke("wks"),rn=tn?en.for||en:en&&en.withoutSetter||Je,sn=function(t){return Ze(nn,t)||(nn[t]=Qe&&Ze(en,t)?en[t]:rn("Symbol."+t)),nn[t]},on=gt,an=Kt,ln=ye,hn=Be,cn=function(t,e){var n,i;if("string"===e&&Ce(n=t.toString)&&!Pe(i=Te(n,t)))return i;if(Ce(n=t.valueOf)&&!Pe(i=Te(n,t)))return i;if("string"!==e&&Ce(n=t.toString)&&!Pe(i=Te(n,t)))return i;throw Re("Can't convert object to primitive value")},un=TypeError,dn=sn("toPrimitive"),fn=function(t,e){if(!an(t)||ln(t))return t;var n,i=hn(t,dn);if(i){if(void 0===e&&(e="default"),n=on(i,t,e),!an(n)||ln(n))return n;throw un("Can't convert object to primitive value")}return void 0===e&&(e="number"),cn(t,e)},pn=ye,gn=function(t){var e=fn(t,"string");return pn(e)?e:e+""},yn=Kt,vn=lt.document,mn=yn(vn)&&yn(vn.createElement),bn=function(t){return mn?vn.createElement(t):{}},xn=bn,wn=!ut&&!ct((function(){return 7!=Object.defineProperty(xn("div"),"a",{get:function(){return 7}}).a})),Sn=ut,An=gt,_n=yt,Bn=St,Tn=Ht,Cn=gn,Pn=Ve,Rn=wn,On=Object.getOwnPropertyDescriptor;ht.f=Sn?On:function(t,e){if(t=Tn(t),e=Cn(e),Rn)try{return On(t,e)}catch(t){}if(Pn(t,e))return Bn(!An(_n.f,t,e),t[e])};var Mn={},En=ut&&ct((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),kn=Kt,In=String,jn=TypeError,Dn=function(t){if(kn(t))return t;throw jn(In(t)+" is not an object")},Ln=ut,Nn=wn,Wn=En,Fn=Dn,Un=gn,zn=TypeError,Hn=Object.defineProperty,Vn=Object.getOwnPropertyDescriptor,Gn="enumerable",Xn="configurable",Yn="writable";Mn.f=Ln?Wn?function(t,e,n){if(Fn(t),e=Un(e),Fn(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Yn in n&&!n[Yn]){var i=Vn(t,e);i&&i[Yn]&&(t[e]=n.value,n={configurable:Xn in n?n[Xn]:i[Xn],enumerable:Gn in n?n[Gn]:i[Gn],writable:!1})}return Hn(t,e,n)}:Hn:function(t,e,n){if(Fn(t),e=Un(e),Fn(n),Nn)try{return Hn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw zn("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var qn=Mn,$n=St,Kn=ut?function(t,e,n){return qn.f(t,e,$n(1,n))}:function(t,e,n){return t[e]=n,t},Zn={exports:{}},Jn=ut,Qn=Ve,ti=Function.prototype,ei=Jn&&Object.getOwnPropertyDescriptor,ni=Qn(ti,"name"),ii={EXISTS:ni,PROPER:ni&&"something"===function(){}.name,CONFIGURABLE:ni&&(!Jn||Jn&&ei(ti,"name").configurable)},ri=Yt,si=De,oi=Ct(Function.toString);ri(si.inspectSource)||(si.inspectSource=function(t){return oi(t)});var ai,li,hi,ci=si.inspectSource,ui=Yt,di=lt.WeakMap,fi=ui(di)&&/native code/.test(String(di)),pi=$e,gi=Ne("keys"),yi=function(t){return gi[t]||(gi[t]=pi(t))},vi={},mi=fi,bi=lt,xi=Kt,wi=Kn,Si=Ve,Ai=De,_i=yi,Bi=vi,Ti="Object already initialized",Ci=bi.TypeError,Pi=bi.WeakMap;if(mi||Ai.state){var Ri=Ai.state||(Ai.state=new Pi);Ri.get=Ri.get,Ri.has=Ri.has,Ri.set=Ri.set,ai=function(t,e){if(Ri.has(t))throw Ci(Ti);return e.facade=t,Ri.set(t,e),e},li=function(t){return Ri.get(t)||{}},hi=function(t){return Ri.has(t)}}else{var Oi=_i("state");Bi[Oi]=!0,ai=function(t,e){if(Si(t,Oi))throw Ci(Ti);return e.facade=t,wi(t,Oi,e),e},li=function(t){return Si(t,Oi)?t[Oi]:{}},hi=function(t){return Si(t,Oi)}}var Mi={set:ai,get:li,has:hi,enforce:function(t){return hi(t)?li(t):ai(t,{})},getterFor:function(t){return function(e){var n;if(!xi(e)||(n=li(e)).type!==t)throw Ci("Incompatible receiver, "+t+" required");return n}}},Ei=Ct,ki=ct,Ii=Yt,ji=Ve,Di=ut,Li=ii.CONFIGURABLE,Ni=ci,Wi=Mi.enforce,Fi=Mi.get,Ui=String,zi=Object.defineProperty,Hi=Ei("".slice),Vi=Ei("".replace),Gi=Ei([].join),Xi=Di&&!ki((function(){return 8!==zi((function(){}),"length",{value:8}).length})),Yi=String(String).split("String"),qi=Zn.exports=function(t,e,n){"Symbol("===Hi(Ui(e),0,7)&&(e="["+Vi(Ui(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!ji(t,"name")||Li&&t.name!==e)&&(Di?zi(t,"name",{value:e,configurable:!0}):t.name=e),Xi&&n&&ji(n,"arity")&&t.length!==n.arity&&zi(t,"length",{value:n.arity});try{n&&ji(n,"constructor")&&n.constructor?Di&&zi(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var i=Wi(t);return ji(i,"source")||(i.source=Gi(Yi,"string"==typeof e?e:"")),t};Function.prototype.toString=qi((function(){return Ii(this)&&Fi(this).source||Ni(this)}),"toString");var $i=Zn.exports,Ki=Yt,Zi=Mn,Ji=$i,Qi=ke,tr=function(t,e,n,i){i||(i={});var r=i.enumerable,s=void 0!==i.name?i.name:e;if(Ki(n)&&Ji(n,s,i),i.global)r?t[e]=n:Qi(e,n);else{try{i.unsafe?t[e]&&(r=!0):delete t[e]}catch(t){}r?t[e]=n:Zi.f(t,e,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return t},er={},nr=Math.ceil,ir=Math.floor,rr=Math.trunc||function(t){var e=+t;return(e>0?ir:nr)(e)},sr=function(t){var e=+t;return e!=e||0===e?0:rr(e)},or=sr,ar=Math.max,lr=Math.min,hr=function(t,e){var n=or(t);return n<0?ar(n+e,0):lr(n,e)},cr=sr,ur=Math.min,dr=function(t){return t>0?ur(cr(t),9007199254740991):0},fr=function(t){return dr(t.length)},pr=Ht,gr=hr,yr=fr,vr=function(t){return function(e,n,i){var r,s=pr(e),o=yr(s),a=gr(i,o);if(t&&n!=n){for(;o>a;)if((r=s[a++])!=r)return!0}else for(;o>a;a++)if((t||a in s)&&s[a]===n)return t||a||0;return!t&&-1}},mr={includes:vr(!0),indexOf:vr(!1)},br=Ve,xr=Ht,wr=mr.indexOf,Sr=vi,Ar=Ct([].push),_r=function(t,e){var n,i=xr(t),r=0,s=[];for(n in i)!br(Sr,n)&&br(i,n)&&Ar(s,n);for(;e.length>r;)br(i,n=e[r++])&&(~wr(s,n)||Ar(s,n));return s},Br=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Tr=_r,Cr=Br.concat("length","prototype");er.f=Object.getOwnPropertyNames||function(t){return Tr(t,Cr)};var Pr={};Pr.f=Object.getOwnPropertySymbols;var Rr=Qt,Or=er,Mr=Pr,Er=Dn,kr=Ct([].concat),Ir=Rr("Reflect","ownKeys")||function(t){var e=Or.f(Er(t)),n=Mr.f;return n?kr(e,n(t)):e},jr=Ve,Dr=Ir,Lr=ht,Nr=Mn,Wr=ct,Fr=Yt,Ur=/#|\.prototype\./,zr=function(t,e){var n=Vr[Hr(t)];return n==Xr||n!=Gr&&(Fr(e)?Wr(e):!!e)},Hr=zr.normalize=function(t){return String(t).replace(Ur,".").toLowerCase()},Vr=zr.data={},Gr=zr.NATIVE="N",Xr=zr.POLYFILL="P",Yr=zr,qr=lt,$r=ht.f,Kr=Kn,Zr=tr,Jr=ke,Qr=function(t,e,n){for(var i=Dr(e),r=Nr.f,s=Lr.f,o=0;o<i.length;o++){var a=i[o];jr(t,a)||n&&jr(n,a)||r(t,a,s(e,a))}},ts=Yr,es=function(t,e){var n,i,r,s,o,a=t.target,l=t.global,h=t.stat;if(n=l?qr:h?qr[a]||Jr(a,{}):(qr[a]||{}).prototype)for(i in e){if(s=e[i],r=t.dontCallGetSet?(o=$r(n,i))&&o.value:n[i],!ts(l?i:a+(h?".":"#")+i,t.forced)&&void 0!==r){if(typeof s==typeof r)continue;Qr(s,r)}(t.sham||r&&r.sham)&&Kr(s,"sham",!0),Zr(n,i,s,t)}},ns={exports:{}},is={},rs=gn,ss=Mn,os=St,as=hr,ls=fr,hs=function(t,e,n){var i=rs(e);i in t?ss.f(t,i,os(0,n)):t[i]=n},cs=Array,us=Math.max,ds=Mt,fs=Ht,ps=er.f,gs=function(t,e,n){for(var i=ls(t),r=as(e,i),s=as(void 0===n?i:n,i),o=cs(us(s-r,0)),a=0;r<s;r++,a++)hs(o,a,t[r]);return o.length=a,o},ys="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];is.f=function(t){return ys&&"Window"==ds(t)?function(t){try{return ps(t)}catch(t){return gs(ys)}}(t):ps(fs(t))};var vs=ct((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),ms=ct,bs=Kt,xs=Mt,ws=vs,Ss=Object.isExtensible,As=ms((function(){Ss(1)}))||ws?function(t){return!!bs(t)&&((!ws||"ArrayBuffer"!=xs(t))&&(!Ss||Ss(t)))}:Ss,_s=!ct((function(){return Object.isExtensible(Object.preventExtensions({}))})),Bs=es,Ts=Ct,Cs=vi,Ps=Kt,Rs=Ve,Os=Mn.f,Ms=er,Es=is,ks=As,Is=_s,js=!1,Ds=$e("meta"),Ls=0,Ns=function(t){Os(t,Ds,{value:{objectID:"O"+Ls++,weakData:{}}})},Ws=ns.exports={enable:function(){Ws.enable=function(){},js=!0;var t=Ms.f,e=Ts([].splice),n={};n[Ds]=1,t(n).length&&(Ms.f=function(n){for(var i=t(n),r=0,s=i.length;r<s;r++)if(i[r]===Ds){e(i,r,1);break}return i},Bs({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Es.f}))},fastKey:function(t,e){if(!Ps(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!Rs(t,Ds)){if(!ks(t))return"F";if(!e)return"E";Ns(t)}return t[Ds].objectID},getWeakData:function(t,e){if(!Rs(t,Ds)){if(!ks(t))return!0;if(!e)return!1;Ns(t)}return t[Ds].weakData},onFreeze:function(t){return Is&&js&&ks(t)&&!Rs(t,Ds)&&Ns(t),t}};Cs[Ds]=!0;var Fs=ns.exports,Us=Mt,zs=Ct,Hs=function(t){if("Function"===Us(t))return zs(t)},Vs=Se,Gs=dt,Xs=Hs(Hs.bind),Ys=function(t,e){return Vs(t),void 0===e?t:Gs?Xs(t,e):function(){return t.apply(e,arguments)}},qs={},$s=qs,Ks=sn("iterator"),Zs=Array.prototype,Js={};Js[sn("toStringTag")]="z";var Qs="[object z]"===String(Js),to=Yt,eo=Mt,no=sn("toStringTag"),io=Object,ro="Arguments"==eo(function(){return arguments}()),so=Qs?eo:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=io(t),no))?n:ro?eo(e):"Object"==(i=eo(e))&&to(e.callee)?"Arguments":i},oo=so,ao=Be,lo=Lt,ho=qs,co=sn("iterator"),uo=function(t){if(!lo(t))return ao(t,co)||ao(t,"@@iterator")||ho[oo(t)]},fo=gt,po=Se,go=Dn,yo=me,vo=uo,mo=TypeError,bo=gt,xo=Dn,wo=Be,So=Ys,Ao=gt,_o=Dn,Bo=me,To=function(t){return void 0!==t&&($s.Array===t||Zs[Ks]===t)},Co=fr,Po=te,Ro=function(t,e){var n=arguments.length<2?vo(t):e;if(po(n))return go(fo(n,t));throw mo(yo(t)+" is not iterable")},Oo=uo,Mo=function(t,e,n){var i,r;xo(t);try{if(!(i=wo(t,"return"))){if("throw"===e)throw n;return n}i=bo(i,t)}catch(t){r=!0,i=t}if("throw"===e)throw n;if(r)throw i;return xo(i),n},Eo=TypeError,ko=function(t,e){this.stopped=t,this.result=e},Io=ko.prototype,jo=function(t,e,n){var i,r,s,o,a,l,h,c=n&&n.that,u=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=So(e,c),y=function(t){return i&&Mo(i,"normal",t),new ko(!0,t)},v=function(t){return u?(_o(t),p?g(t[0],t[1],y):g(t[0],t[1])):p?g(t,y):g(t)};if(d)i=t.iterator;else if(f)i=t;else{if(!(r=Oo(t)))throw Eo(Bo(t)+" is not iterable");if(To(r)){for(s=0,o=Co(t);o>s;s++)if((a=v(t[s]))&&Po(Io,a))return a;return new ko(!1)}i=Ro(t,r)}for(l=d?t.next:i.next;!(h=Ao(l,i)).done;){try{a=v(h.value)}catch(t){Mo(i,"throw",t)}if("object"==typeof a&&a&&Po(Io,a))return a}return new ko(!1)},Do=te,Lo=TypeError,No=function(t,e){if(Do(e,t))return t;throw Lo("Incorrect invocation")},Wo=sn("iterator"),Fo=!1;try{var Uo=0,zo={next:function(){return{done:!!Uo++}},return:function(){Fo=!0}};zo[Wo]=function(){return this},Array.from(zo,(function(){throw 2}))}catch(t){}var Ho=Mn.f,Vo=Ve,Go=sn("toStringTag"),Xo=function(t,e,n){t&&!n&&(t=t.prototype),t&&!Vo(t,Go)&&Ho(t,Go,{configurable:!0,value:e})},Yo=Ct,qo=Se,$o=Yt,Ko=String,Zo=TypeError,Jo=function(t,e,n){try{return Yo(qo(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},Qo=Dn,ta=function(t){if("object"==typeof t||$o(t))return t;throw Zo("Can't set "+Ko(t)+" as a prototype")},ea=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Jo(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return Qo(n),ta(i),e?t(n,i):n.__proto__=i,n}}():void 0),na=Yt,ia=Kt,ra=ea,sa=es,oa=lt,aa=Ct,la=Yr,ha=tr,ca=Fs,ua=jo,da=No,fa=Yt,pa=Lt,ga=Kt,ya=ct,va=function(t,e){if(!e&&!Fo)return!1;var n=!1;try{var i={};i[Wo]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n},ma=Xo,ba=function(t,e,n){var i,r;return ra&&na(i=e.constructor)&&i!==n&&ia(r=i.prototype)&&r!==n.prototype&&ra(t,r),t},xa=function(t,e,n){var i=-1!==t.indexOf("Map"),r=-1!==t.indexOf("Weak"),s=i?"set":"add",o=oa[t],a=o&&o.prototype,l=o,h={},c=function(t){var e=aa(a[t]);ha(a,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(r&&!ga(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return r&&!ga(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(r&&!ga(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(la(t,!fa(o)||!(r||a.forEach&&!ya((function(){(new o).entries().next()})))))l=n.getConstructor(e,t,i,s),ca.enable();else if(la(t,!0)){var u=new l,d=u[s](r?{}:-0,1)!=u,f=ya((function(){u.has(1)})),p=va((function(t){new o(t)})),g=!r&&ya((function(){for(var t=new o,e=5;e--;)t[s](e,e);return!t.has(-0)}));p||((l=e((function(t,e){da(t,a);var n=ba(new o,t,l);return pa(e)||ua(e,n[s],{that:n,AS_ENTRIES:i}),n}))).prototype=a,a.constructor=l),(f||g)&&(c("delete"),c("has"),i&&c("get")),(g||d)&&c(s),r&&a.clear&&delete a.clear}return h[t]=l,sa({global:!0,constructor:!0,forced:l!=o},h),ma(l,t),r||n.setStrong(l,t,i),l},wa={},Sa=_r,Aa=Br,_a=Object.keys||function(t){return Sa(t,Aa)},Ba=ut,Ta=En,Ca=Mn,Pa=Dn,Ra=Ht,Oa=_a;wa.f=Ba&&!Ta?Object.defineProperties:function(t,e){Pa(t);for(var n,i=Ra(e),r=Oa(e),s=r.length,o=0;s>o;)Ca.f(t,n=r[o++],i[n]);return t};var Ma,Ea=Qt("document","documentElement"),ka=Dn,Ia=wa,ja=Br,Da=vi,La=Ea,Na=bn,Wa="prototype",Fa="script",Ua=yi("IE_PROTO"),za=function(){},Ha=function(t){return"<"+Fa+">"+t+"</"+Fa+">"},Va=function(t){t.write(Ha("")),t.close();var e=t.parentWindow.Object;return t=null,e},Ga=function(){try{Ma=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;Ga="undefined"!=typeof document?document.domain&&Ma?Va(Ma):(e=Na("iframe"),n="java"+Fa+":",e.style.display="none",La.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Ha("document.F=Object")),t.close(),t.F):Va(Ma);for(var i=ja.length;i--;)delete Ga[Wa][ja[i]];return Ga()};Da[Ua]=!0;var Xa,Ya,qa,$a=Object.create||function(t,e){var n;return null!==t?(za[Wa]=ka(t),n=new za,za[Wa]=null,n[Ua]=t):n=Ga(),void 0===e?n:Ia.f(n,e)},Ka=$i,Za=Mn,Ja=function(t,e,n){return n.get&&Ka(n.get,e,{getter:!0}),n.set&&Ka(n.set,e,{setter:!0}),Za.f(t,e,n)},Qa=tr,tl=function(t,e,n){for(var i in e)Qa(t,i,e[i],n);return t},el=!ct((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),nl=Ve,il=Yt,rl=Ue,sl=el,ol=yi("IE_PROTO"),al=Object,ll=al.prototype,hl=sl?al.getPrototypeOf:function(t){var e=rl(t);if(nl(e,ol))return e[ol];var n=e.constructor;return il(n)&&e instanceof n?n.prototype:e instanceof al?ll:null},cl=ct,ul=Yt,dl=Kt,fl=hl,pl=tr,gl=sn("iterator"),yl=!1;[].keys&&("next"in(qa=[].keys())?(Ya=fl(fl(qa)))!==Object.prototype&&(Xa=Ya):yl=!0);var vl=!dl(Xa)||cl((function(){var t={};return Xa[gl].call(t)!==t}));vl&&(Xa={}),ul(Xa[gl])||pl(Xa,gl,(function(){return this}));var ml={IteratorPrototype:Xa,BUGGY_SAFARI_ITERATORS:yl},bl=ml.IteratorPrototype,xl=$a,wl=St,Sl=Xo,Al=qs,_l=function(){return this},Bl=es,Tl=gt,Cl=Yt,Pl=function(t,e,n,i){var r=e+" Iterator";return t.prototype=xl(bl,{next:wl(+!i,n)}),Sl(t,r,!1),Al[r]=_l,t},Rl=hl,Ol=ea,Ml=Xo,El=Kn,kl=tr,Il=qs,jl=ii.PROPER,Dl=ii.CONFIGURABLE,Ll=ml.IteratorPrototype,Nl=ml.BUGGY_SAFARI_ITERATORS,Wl=sn("iterator"),Fl="keys",Ul="values",zl="entries",Hl=function(){return this},Vl=Qt,Gl=Ja,Xl=ut,Yl=sn("species"),ql=$a,$l=Ja,Kl=tl,Zl=Ys,Jl=No,Ql=Lt,th=jo,eh=function(t,e,n,i,r,s,o){Pl(n,e,i);var a,l,h,c=function(t){if(t===r&&g)return g;if(!Nl&&t in f)return f[t];switch(t){case Fl:case Ul:case zl:return function(){return new n(this,t)}}return function(){return new n(this)}},u=e+" Iterator",d=!1,f=t.prototype,p=f[Wl]||f["@@iterator"]||r&&f[r],g=!Nl&&p||c(r),y="Array"==e&&f.entries||p;if(y&&(a=Rl(y.call(new t)))!==Object.prototype&&a.next&&(Rl(a)!==Ll&&(Ol?Ol(a,Ll):Cl(a[Wl])||kl(a,Wl,Hl)),Ml(a,u,!0)),jl&&r==Ul&&p&&p.name!==Ul&&(Dl?El(f,"name",Ul):(d=!0,g=function(){return Tl(p,this)})),r)if(l={values:c(Ul),keys:s?g:c(Fl),entries:c(zl)},o)for(h in l)(Nl||d||!(h in f))&&kl(f,h,l[h]);else Bl({target:e,proto:!0,forced:Nl||d},l);return f[Wl]!==g&&kl(f,Wl,g,{name:r}),Il[e]=g,l},nh=function(t,e){return{value:t,done:e}},ih=function(t){var e=Vl(t);Xl&&e&&!e[Yl]&&Gl(e,Yl,{configurable:!0,get:function(){return this}})},rh=ut,sh=Fs.fastKey,oh=Mi.set,ah=Mi.getterFor,lh={getConstructor:function(t,e,n,i){var r=t((function(t,r){Jl(t,s),oh(t,{type:e,index:ql(null),first:void 0,last:void 0,size:0}),rh||(t.size=0),Ql(r)||th(r,t[i],{that:t,AS_ENTRIES:n})})),s=r.prototype,o=ah(e),a=function(t,e,n){var i,r,s=o(t),a=l(t,e);return a?a.value=n:(s.last=a={index:r=sh(e,!0),key:e,value:n,previous:i=s.last,next:void 0,removed:!1},s.first||(s.first=a),i&&(i.next=a),rh?s.size++:t.size++,"F"!==r&&(s.index[r]=a)),t},l=function(t,e){var n,i=o(t),r=sh(e);if("F"!==r)return i.index[r];for(n=i.first;n;n=n.next)if(n.key==e)return n};return Kl(s,{clear:function(){for(var t=o(this),e=t.index,n=t.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete e[n.index],n=n.next;t.first=t.last=void 0,rh?t.size=0:this.size=0},delete:function(t){var e=this,n=o(e),i=l(e,t);if(i){var r=i.next,s=i.previous;delete n.index[i.index],i.removed=!0,s&&(s.next=r),r&&(r.previous=s),n.first==i&&(n.first=r),n.last==i&&(n.last=s),rh?n.size--:e.size--}return!!i},forEach:function(t){for(var e,n=o(this),i=Zl(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(i(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!l(this,t)}}),Kl(s,n?{get:function(t){var e=l(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),rh&&$l(s,"size",{configurable:!0,get:function(){return o(this).size}}),r},setStrong:function(t,e,n){var i=e+" Iterator",r=ah(e),s=ah(i);eh(t,e,(function(t,e){oh(this,{type:i,target:t,state:r(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?nh("keys"==e?n.key:"values"==e?n.value:[n.key,n.value],!1):(t.target=void 0,nh(void 0,!0))}),n?"entries":"values",!n,!0),ih(e)}};xa("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),lh);var hh=Mt,ch=Array.isArray||function(t){return"Array"==hh(t)},uh=Ct,dh=ct,fh=Yt,ph=so,gh=ci,yh=function(){},vh=[],mh=Qt("Reflect","construct"),bh=/^\s*(?:class|function)\b/,xh=uh(bh.exec),wh=!bh.exec(yh),Sh=function(t){if(!fh(t))return!1;try{return mh(yh,vh,t),!0}catch(t){return!1}},Ah=function(t){if(!fh(t))return!1;switch(ph(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return wh||!!xh(bh,gh(t))}catch(t){return!0}};Ah.sham=!0;var _h=!mh||dh((function(){var t;return Sh(Sh.call)||!Sh(Object)||!Sh((function(){t=!0}))||t}))?Ah:Sh,Bh=ch,Th=_h,Ch=Kt,Ph=sn("species"),Rh=Array,Oh=function(t){var e;return Bh(t)&&(e=t.constructor,(Th(e)&&(e===Rh||Bh(e.prototype))||Ch(e)&&null===(e=e[Ph]))&&(e=void 0)),void 0===e?Rh:e},Mh=Ys,Eh=Dt,kh=Ue,Ih=fr,jh=function(t,e){return new(Oh(t))(0===e?0:e)},Dh=Ct([].push),Lh=function(t){var e=1==t,n=2==t,i=3==t,r=4==t,s=6==t,o=7==t,a=5==t||s;return function(l,h,c,u){for(var d,f,p=kh(l),g=Eh(p),y=Mh(h,c),v=Ih(g),m=0,b=u||jh,x=e?b(l,v):n||o?b(l,0):void 0;v>m;m++)if((a||m in g)&&(f=y(d=g[m],m,p),t))if(e)x[m]=f;else if(f)switch(t){case 3:return!0;case 5:return d;case 6:return m;case 2:Dh(x,d)}else switch(t){case 4:return!1;case 7:Dh(x,d)}return s?-1:i||r?r:x}},Nh={forEach:Lh(0),map:Lh(1),filter:Lh(2),some:Lh(3),every:Lh(4),find:Lh(5),findIndex:Lh(6),filterReject:Lh(7)},Wh=Ct,Fh=tl,Uh=Fs.getWeakData,zh=No,Hh=Dn,Vh=Lt,Gh=Kt,Xh=jo,Yh=Ve,qh=Mi.set,$h=Mi.getterFor,Kh=Nh.find,Zh=Nh.findIndex,Jh=Wh([].splice),Qh=0,tc=function(t){return t.frozen||(t.frozen=new ec)},ec=function(){this.entries=[]},nc=function(t,e){return Kh(t.entries,(function(t){return t[0]===e}))};ec.prototype={get:function(t){var e=nc(this,t);if(e)return e[1]},has:function(t){return!!nc(this,t)},set:function(t,e){var n=nc(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=Zh(this.entries,(function(e){return e[0]===t}));return~e&&Jh(this.entries,e,1),!!~e}};var ic,rc={getConstructor:function(t,e,n,i){var r=t((function(t,r){zh(t,s),qh(t,{type:e,id:Qh++,frozen:void 0}),Vh(r)||Xh(r,t[i],{that:t,AS_ENTRIES:n})})),s=r.prototype,o=$h(e),a=function(t,e,n){var i=o(t),r=Uh(Hh(e),!0);return!0===r?tc(i).set(e,n):r[i.id]=n,t};return Fh(s,{delete:function(t){var e=o(this);if(!Gh(t))return!1;var n=Uh(t);return!0===n?tc(e).delete(t):n&&Yh(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!Gh(t))return!1;var n=Uh(t);return!0===n?tc(e).has(t):n&&Yh(n,e.id)}}),Fh(s,n?{get:function(t){var e=o(this);if(Gh(t)){var n=Uh(t);return!0===n?tc(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return a(this,t,e)}}:{add:function(t){return a(this,t,!0)}}),r}},sc=_s,oc=lt,ac=Ct,lc=tl,hc=Fs,cc=xa,uc=rc,dc=Kt,fc=Mi.enforce,pc=ct,gc=fi,yc=Object,vc=Array.isArray,mc=yc.isExtensible,bc=yc.isFrozen,xc=yc.isSealed,wc=yc.freeze,Sc=yc.seal,Ac={},_c={},Bc=!oc.ActiveXObject&&"ActiveXObject"in oc,Tc=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},Cc=cc("WeakMap",Tc,uc),Pc=Cc.prototype,Rc=ac(Pc.set);if(gc)if(Bc){ic=uc.getConstructor(Tc,"WeakMap",!0),hc.enable();var Oc=ac(Pc.delete),Mc=ac(Pc.has),Ec=ac(Pc.get);lc(Pc,{delete:function(t){if(dc(t)&&!mc(t)){var e=fc(this);return e.frozen||(e.frozen=new ic),Oc(this,t)||e.frozen.delete(t)}return Oc(this,t)},has:function(t){if(dc(t)&&!mc(t)){var e=fc(this);return e.frozen||(e.frozen=new ic),Mc(this,t)||e.frozen.has(t)}return Mc(this,t)},get:function(t){if(dc(t)&&!mc(t)){var e=fc(this);return e.frozen||(e.frozen=new ic),Mc(this,t)?Ec(this,t):e.frozen.get(t)}return Ec(this,t)},set:function(t,e){if(dc(t)&&!mc(t)){var n=fc(this);n.frozen||(n.frozen=new ic),Mc(this,t)?Rc(this,t,e):n.frozen.set(t,e)}else Rc(this,t,e);return this}})}else sc&&pc((function(){var t=wc([]);return Rc(new Cc,t,1),!bc(t)}))&&lc(Pc,{set:function(t,e){var n;return vc(t)&&(bc(t)?n=Ac:xc(t)&&(n=_c)),Rc(this,t,e),n==Ac&&wc(t),n==_c&&Sc(t),this}});var kc=Qt,Ic=Ct,jc=Ne,Dc=kc("Map"),Lc=kc("WeakMap"),Nc=Ic([].push),Wc=jc("metadata"),Fc=Wc.store||(Wc.store=new Lc),Uc=function(t,e,n){var i=Fc.get(t);if(!i){if(!n)return;Fc.set(t,i=new Dc)}var r=i.get(e);if(!r){if(!n)return;i.set(e,r=new Dc)}return r},zc={store:Fc,getMap:Uc,has:function(t,e,n){var i=Uc(e,n,!1);return void 0!==i&&i.has(t)},get:function(t,e,n){var i=Uc(e,n,!1);return void 0===i?void 0:i.get(t)},set:function(t,e,n,i){Uc(n,i,!0).set(t,e)},keys:function(t,e){var n=Uc(t,e,!1),i=[];return n&&n.forEach((function(t,e){Nc(i,e)})),i},toKey:function(t){return void 0===t||"symbol"==typeof t?t:String(t)}},Hc=Dn,Vc=zc.toKey,Gc=zc.set;es({target:"Reflect",stat:!0},{defineMetadata:function(t,e,n){var i=arguments.length<4?void 0:Vc(arguments[3]);Gc(t,e,Hc(n),i)}});var Xc=Dn,Yc=zc.toKey,qc=zc.getMap,$c=zc.store;es({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var n=arguments.length<3?void 0:Yc(arguments[2]),i=qc(Xc(e),n,!1);if(void 0===i||!i.delete(t))return!1;if(i.size)return!0;var r=$c.get(e);return r.delete(n),!!r.size||$c.delete(e)}});var Kc=Dn,Zc=hl,Jc=zc.has,Qc=zc.get,tu=zc.toKey,eu=function(t,e,n){if(Jc(t,e,n))return Qc(t,e,n);var i=Zc(e);return null!==i?eu(t,i,n):void 0};es({target:"Reflect",stat:!0},{getMetadata:function(t,e){var n=arguments.length<3?void 0:tu(arguments[2]);return eu(t,Kc(e),n)}});var nu=Ct,iu=Map.prototype,ru={Map:Map,set:nu(iu.set),get:nu(iu.get),has:nu(iu.has),remove:nu(iu.delete),proto:iu},su=gt,ou=Ct,au=function(t,e,n){for(var i,r,s=n||t.next;!(i=su(s,t)).done;)if(void 0!==(r=e(i.value)))return r},lu=ru.Map,hu=ru.proto,cu=ou(hu.forEach),uu=ou(hu.entries),du=uu(new lu).next,fu=Se,pu=Lt,gu=fr,yu=Ue,vu=function(t,e,n){return n?au(uu(t),(function(t){return e(t[1],t[0])}),du):cu(t,e)},mu=ru.Map,bu=ru.has,xu=ru.set,wu=Ct([].push),Su=es,Au=Ct,_u=zc,Bu=Dn,Tu=hl,Cu=Au((function(t){var e,n,i,r=yu(this),s=gu(r),o=[],a=new mu,l=pu(t)?function(t){return t}:fu(t);for(e=0;e<s;e++)i=l(n=r[e]),bu(a,i)||xu(a,i,n);return vu(a,(function(t){wu(o,t)})),o})),Pu=Au([].concat),Ru=_u.keys,Ou=_u.toKey,Mu=function(t,e){var n=Ru(t,e),i=Tu(t);if(null===i)return n;var r=Mu(i,e);return r.length?n.length?Cu(Pu(n,r)):r:n};Su({target:"Reflect",stat:!0},{getMetadataKeys:function(t){var e=arguments.length<2?void 0:Ou(arguments[1]);return Mu(Bu(t),e)}});var Eu=Dn,ku=zc.get,Iu=zc.toKey;es({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var n=arguments.length<3?void 0:Iu(arguments[2]);return ku(t,Eu(e),n)}});var ju=Dn,Du=zc.keys,Lu=zc.toKey;es({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:Lu(arguments[1]);return Du(ju(t),e)}});var Nu=Dn,Wu=hl,Fu=zc.has,Uu=zc.toKey,zu=function(t,e,n){if(Fu(t,e,n))return!0;var i=Wu(e);return null!==i&&zu(t,i,n)};es({target:"Reflect",stat:!0},{hasMetadata:function(t,e){var n=arguments.length<3?void 0:Uu(arguments[2]);return zu(t,Nu(e),n)}});var Hu=Dn,Vu=zc.has,Gu=zc.toKey;es({target:"Reflect",stat:!0},{hasOwnMetadata:function(t,e){var n=arguments.length<3?void 0:Gu(arguments[2]);return Vu(t,Hu(e),n)}});var Xu=Dn,Yu=zc.toKey,qu=zc.set;es({target:"Reflect",stat:!0},{metadata:function(t,e){return function(n,i){qu(t,e,Xu(n),Yu(i))}}});var $u="named",Ku="name",Zu="unmanaged",Ju="optional",Qu="inject",td="multi_inject",ed="inversify:tagged",nd="inversify:tagged_props",id="inversify:paramtypes",rd="post_construct",sd="pre_destroy";var od=[Qu,td,Ku,Zu,$u,Ju],ad={Request:"Request",Singleton:"Singleton",Transient:"Transient"},ld={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},hd={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},cd=0;function ud(){return cd++}var dd=function(){function t(t,e){this.id=ud(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=ld.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===ad.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),fd="Metadata key was used more than once in a parameter:",pd="NULL argument",gd="Key Not Found",yd="Ambiguous match found for serviceIdentifier:",vd="No matching bindings found for serviceIdentifier:",md="Missing required @injectable annotation in:",bd="Missing required @inject or @multiInject annotation in:",xd="Circular dependency found:",wd="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Sd=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},Ad=function(t,e){return"@postConstruct error in class "+t+": "+e},_d=function(t,e){return"@preDestroy error in class "+t+": "+e},Bd=function(t,e){return"onDeactivation() error in class "+t+": "+e},Td="Maximum call stack size exceeded",Cd=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(id,t),userGeneratedMetadata:Reflect.getMetadata(ed,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(nd,t)||[]},t}(),Pd={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function Rd(t){return t instanceof RangeError||t.message===Td}function Od(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function Md(t,e,n){var i="",r=n(t,e);return 0!==r.length&&(i="\nRegistered bindings:",r.forEach((function(t){var e="Object";null!==t.implementationType&&(e=Id(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i}function Ed(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||Ed(t.parentRequest,e))}function kd(t){t.childRequests.forEach((function(t){if(Ed(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,n){void 0===n&&(n=[]);var i=Od(e.serviceIdentifier);return n.push(i),null!==e.parentRequest?t(e.parentRequest,n):n}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(xd+" "+e)}kd(t)}))}function Id(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}var jd=function(){function t(t){this.id=ud(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),Dd=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===$u?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),Ld=function(t,e){this.parentContext=t,this.rootRequest=e},Nd=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),Wd=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),Fd=function(){function t(t,e,n,i){this.id=ud(),this.type=t,this.serviceIdentifier=n;var r="symbol"==typeof e?e.toString().slice(7,-1):e;this.name=new Wd(r||""),this.identifier=e,this.metadata=new Array;var s=null;"string"==typeof i?s=new Dd($u,i):i instanceof Dd&&(s=i),null!==s&&this.metadata.push(s)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(td)},t.prototype.matchesArray=function(t){return this.matchesTag(td)(t)},t.prototype.isNamed=function(){return this.hasTag($u)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return od.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(Ju)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===$u}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return od.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag($u)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var i=0,r=e.metadata;i<r.length;i++){var s=r[i];if(s.key===t&&s.value===n)return!0}return!1}},t}(),Ud=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function zd(t,e,n,i){var r=t.getConstructorMetadata(n),s=r.compilerGeneratedMetadata;if(void 0===s)throw new Error(md+" "+e+".");var o=r.userGeneratedMetadata,a=Object.keys(o),l=0===n.length&&a.length>0,h=a.length>n.length,c=function(t,e,n,i,r){for(var s=[],o=0;o<r;o++){var a=Hd(o,t,e,n,i);null!==a&&s.push(a)}return s}(i,e,s,o,l||h?a.length:n.length),u=Gd(t,n,e);return Ud(Ud([],c,!0),u,!0)}function Hd(t,e,n,i,r){var s=r[t.toString()]||[],o=Yd(s),a=!0!==o.unmanaged,l=i[t],h=o.inject||o.multiInject;if((l=h||l)instanceof Nd&&(l=l.unwrap()),a){if(!e&&(l===Object||l===Function||void 0===l))throw new Error(bd+" argument "+t+" in class "+n+".");var c=new Fd(hd.ConstructorArgument,o.targetName,l);return c.metadata=s,c}return null}function Vd(t,e,n,i){var r=t||e;if(void 0===r){var s=md+" for property "+String(n)+" in class "+i+".";throw new Error(s)}return r}function Gd(t,e,n){for(var i=t.getPropertiesMetadata(e),r=[],s=Object.getOwnPropertySymbols(i),o=0,a=Object.keys(i).concat(s);o<a.length;o++){var l=a[o],h=i[l],c=Yd(h),u=c.targetName||l,d=Vd(c.inject,c.multiInject,l,n),f=new Fd(hd.ClassProperty,u,d);f.metadata=h,r.push(f)}var p=Object.getPrototypeOf(e.prototype).constructor;if(p!==Object){var g=Gd(t,p,n);r=Ud(Ud([],r,!0),g,!0)}return r}function Xd(t,e){var n=Object.getPrototypeOf(e.prototype).constructor;if(n!==Object){var i=zd(t,Id(n),n,!0),r=i.map((function(t){return t.metadata.filter((function(t){return t.key===Zu}))})),s=[].concat.apply([],r).length,o=i.length-s;return o>0?o:Xd(t,n)}return 0}function Yd(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[Qu],multiInject:e[td],targetName:e[Ku],unmanaged:e[Zu]}}var qd=function(){function t(t,e,n,i,r){this.id=ud(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=r,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();function $d(t){return t._bindingDictionary}function Kd(t,e,n,i,r){var s=Jd(n.container,r.serviceIdentifier),o=[];return s.length===Pd.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(r.serviceIdentifier).toSelf(),s=Jd(n.container,r.serviceIdentifier)),o=e?s:s.filter((function(t){var e=new qd(t.serviceIdentifier,n,i,t,r);return t.constraint(e)})),function(t,e,n,i){switch(e.length){case Pd.NoBindingsAvailable:if(n.isOptional())return e;var r=Od(t),s=vd;throw s+=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t}(r,n),s+=Md(i,r,Jd),new Error(s);case Pd.OnlyOneBindingAvailable:return e;case Pd.MultipleBindingsAvailable:default:if(n.isArray())return e;r=Od(t),s=yd+" "+r;throw s+=Md(i,r,Jd),new Error(s)}}(r.serviceIdentifier,o,r,n.container),o}function Zd(t,e,n,i,r,s){var o,a;if(null===r){o=Kd(t,e,i,null,s),a=new qd(n,i,null,o,s);var l=new Ld(i,a);i.addPlan(l)}else o=Kd(t,e,i,r,s),a=r.addChildRequest(s.serviceIdentifier,o,s);o.forEach((function(e){var n=null;if(s.isArray())n=a.addChildRequest(e.serviceIdentifier,e,s);else{if(e.cache)return;n=a}if(e.type===ld.Instance&&null!==e.implementationType){var r=function(t,e){return zd(t,Id(e),e,!1)}(t,e.implementationType);if(!i.container.options.skipBaseClassChecks){var o=Xd(t,e.implementationType);if(r.length<o){var l=Sd(Id(e.implementationType));throw new Error(l)}}r.forEach((function(e){Zd(t,!1,e.serviceIdentifier,i,n,e)}))}}))}function Jd(t,e){var n=[],i=$d(t);return i.hasKey(e)?n=i.get(e):null!==t.parent&&(n=Jd(t.parent,e)),n}function Qd(t,e,n,i,r,s,o,a){void 0===a&&(a=!1);var l=new jd(e),h=function(t,e,n,i,r,s){var o=new Dd(t?td:Qu,n),a=new Fd(e,i,n,o);if(void 0!==r){var l=new Dd(r,s);a.metadata.push(l)}return a}(n,i,r,"",s,o);try{return Zd(t,a,r,l,null,h),l}catch(t){throw Rd(t)&&kd(l.plan.rootRequest),t}}function tf(t){return("object"==typeof t&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function ef(t){return!!tf(t)||Array.isArray(t)&&t.some(tf)}var nf,rf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},sf=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},of=function(t,e,n){t.has(e.id)||t.set(e.id,n)},af=function(t,e){t.cache=e,t.activated=!0,tf(e)&&lf(t,e)},lf=function(t,e){return rf(void 0,void 0,void 0,(function(){var n,i;return sf(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e];case 1:return n=r.sent(),t.cache=n,[3,3];case 2:throw i=r.sent(),t.cache=null,t.activated=!1,i;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(nf||(nf={}));var hf=function(){return hf=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},hf.apply(this,arguments)},cf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},uf=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},df=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))};function ff(t,e,n){var i;if(e.length>0){var r=function(t,e){return t.reduce((function(t,n){var i=e(n);return n.target.type===hd.ConstructorArgument?t.constructorInjections.push(i):(t.propertyRequests.push(n),t.propertyInjections.push(i)),t.isAsync||(t.isAsync=ef(i)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,n),s=hf(hf({},r),{constr:t});i=r.isAsync?function(t){return cf(this,void 0,void 0,(function(){var e,n;return uf(this,(function(i){switch(i.label){case 0:return[4,gf(t.constructorInjections)];case 1:return e=i.sent(),[4,gf(t.propertyInjections)];case 2:return n=i.sent(),[2,pf(hf(hf({},t),{constructorInjections:e,propertyInjections:n}))]}}))}))}(s):pf(s)}else i=new t;return i}function pf(t){var e,n=new((e=t.constr).bind.apply(e,df([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,i){var r=e.target.identifier,s=t.propertyInjections[i];n[r]=s})),n}function gf(t){return cf(this,void 0,void 0,(function(){var e,n,i,r;return uf(this,(function(s){for(e=[],n=0,i=t;n<i.length;n++)r=i[n],Array.isArray(r)?e.push(Promise.all(r)):e.push(r);return[2,Promise.all(e)]}))}))}function yf(t,e){var n=function(t,e){var n,i;if(Reflect.hasMetadata(rd,t)){var r=Reflect.getMetadata(rd,t);try{return null===(i=(n=e)[r.value])||void 0===i?void 0:i.call(n)}catch(e){throw new Error(Ad(t.name,e.message))}}}(t,e);return tf(n)?n.then((function(){return e})):e}function vf(t,e){t.scope!==ad.Singleton&&function(t,e){var n="Class cannot be instantiated in "+(t.scope===ad.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(Bd(e.name,n));if(Reflect.hasMetadata(sd,e))throw new Error(_d(e.name,n))}(t,e)}var mf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},bf=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},xf=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,i=e.childRequests,r=e.target&&e.target.isArray(),s=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(r&&s)return i.map((function(e){return xf(t)(e)}));if(!e.target.isOptional()||0!==n.length){var o=n[0];return _f(t,e,o)}}},wf=function(t,e){var n=function(t){switch(t.type){case ld.Factory:return{factory:t.factory,factoryType:nf.Factory};case ld.Provider:return{factory:t.provider,factoryType:nf.Provider};case ld.DynamicValue:return{factory:t.dynamicValue,factoryType:nf.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw Rd(t)&&(t=e()),t}}((function(){return n.factory.bind(t)(e)}),(function(){return new Error((t=n.factoryType,i=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+i+"'."));var t,i}))},Sf=function(t,e,n){var i,r=e.childRequests;switch(function(t){var e=null;switch(t.type){case ld.ConstantValue:case ld.Function:e=t.cache;break;case ld.Constructor:case ld.Instance:e=t.implementationType;break;case ld.DynamicValue:e=t.dynamicValue;break;case ld.Provider:e=t.provider;break;case ld.Factory:e=t.factory}if(null===e){var n=Od(t.serviceIdentifier);throw new Error("Invalid binding type: "+n)}}(n),n.type){case ld.ConstantValue:case ld.Function:i=n.cache;break;case ld.Constructor:i=n.implementationType;break;case ld.Instance:i=function(t,e,n,i){vf(t,e);var r=ff(e,n,i);return tf(r)?r.then((function(t){return yf(e,t)})):yf(e,r)}(n,n.implementationType,r,xf(t));break;default:i=wf(n,e.parentContext)}return i},Af=function(t,e,n){var i=function(t,e){return e.scope===ad.Singleton&&e.activated?e.cache:e.scope===ad.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==i||function(t,e,n){e.scope===ad.Singleton&&af(e,n),e.scope===ad.Request&&of(t,e,n)}(t,e,i=n()),i},_f=function(t,e,n){return Af(t,n,(function(){var i=Sf(t,e,n);return i=tf(i)?i.then((function(t){return Bf(e,n,t)})):Bf(e,n,i)}))};function Bf(t,e,n){var i,r=Tf(t.parentContext,e,n),s=Of(t.parentContext.container),o=s.next();do{i=o.value;var a=t.parentContext,l=t.serviceIdentifier,h=Rf(i,l);r=tf(r)?Pf(h,a,r):Cf(h,a,r),o=s.next()}while(!0!==o.done&&!$d(i).hasKey(t.serviceIdentifier));return r}var Tf=function(t,e,n){return"function"==typeof e.onActivation?e.onActivation(t,n):n},Cf=function(t,e,n){for(var i=t.next();!i.done;){if(tf(n=i.value(e,n)))return Pf(t,e,n);i=t.next()}return n},Pf=function(t,e,n){return mf(void 0,void 0,void 0,(function(){var i,r;return bf(this,(function(s){switch(s.label){case 0:return[4,n];case 1:i=s.sent(),r=t.next(),s.label=2;case 2:return r.done?[3,4]:[4,r.value(e,i)];case 3:return i=s.sent(),r=t.next(),[3,2];case 4:return[2,i]}}))}))},Rf=function(t,e){var n=t._activations;return n.hasKey(e)?n.get(e).values():[].values()},Of=function(t){for(var e=[t],n=t.parent;null!==n;)e.push(n),n=n.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var Mf=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||Mf(n,e))},Ef=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new Dd(t,e),n}},kf=Ef($u),If=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var i=e.bindings[0].implementationType;return t===i}return!1}},jf=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new Df(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=kf(t),new Df(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new Df(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=Ef(t)(e),new Df(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&If(t)(e.parentRequest)},new Df(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&kf(t)(e.parentRequest)},new Df(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&Ef(t)(e)(n.parentRequest)},new Df(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&Mf(e,If(t))},new Df(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!Mf(e,If(t))},new Df(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&Mf(e,kf(t))},new Df(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!Mf(e,kf(t))},new Df(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&Mf(n,Ef(t)(e))},new Df(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&!Mf(n,Ef(t)(e))},new Df(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&Mf(e,t)},new Df(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!Mf(e,t)},new Df(this._binding)},t}(),Df=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new jf(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new jf(this._binding)},t}(),Lf=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new jf(this._binding),this._bindingOnSyntax=new Df(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Nf=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=ad.Request,new Lf(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=ad.Singleton,new Lf(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=ad.Transient,new Lf(this._binding)},t}(),Wf=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new jf(this._binding),this._bindingOnSyntax=new Df(this._binding),this._bindingInSyntax=new Nf(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),Ff=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=ld.Instance,this._binding.implementationType=t,new Wf(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=ld.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=ad.Singleton,new Lf(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=ld.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Wf(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=ld.Constructor,this._binding.implementationType=t,this._binding.scope=ad.Singleton,new Lf(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=ld.Factory,this._binding.factory=t,this._binding.scope=ad.Singleton,new Lf(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=ld.Function,this._binding.scope=ad.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=ld.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=ad.Singleton,new Lf(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=ld.Factory,this._binding.factory=function(e){return function(n){return e.container.getNamed(t,n)}},new Lf(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=ld.Provider,this._binding.provider=t,this._binding.scope=ad.Singleton,new Lf(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),Uf=function(){function t(){}return t.of=function(e,n,i,r,s){var o=new t;return o.bindings=e,o.middleware=n,o.deactivations=r,o.activations=i,o.moduleActivationStore=s,o},t}();var zf=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(pd);if(null==e)throw new Error(pd);var n=this._map.get(t);void 0!==n?n.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(pd);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(gd)},t.prototype.remove=function(t){if(null==t)throw new Error(pd);if(!this._map.delete(t))throw new Error(gd)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(n,i){var r=t.hasKey(n)?t.get(n):void 0;if(void 0!==r){var s=i.filter((function(t){return!r.some((function(e){return t===e}))}));e._setValue(n,s)}}))},t.prototype.removeByCondition=function(t){var e=this,n=[];return this._map.forEach((function(i,r){for(var s=[],o=0,a=i;o<a.length;o++){var l=a[o];t(l)?n.push(l):s.push(l)}e._setValue(r,s)})),n},t.prototype.hasKey=function(t){if(null==t)throw new Error(pd);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,"object"==typeof(i=t)&&null!==i&&"clone"in i&&"function"==typeof i.clone?t.clone():t);var i}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),Hf=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,n){this._getModuleActivationHandlers(t).onDeactivations.add(e,n)},t.prototype.addActivation=function(t,e,n){this._getModuleActivationHandlers(t).onActivations.add(e,n)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){e._map.set(n,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new zf,onDeactivations:new zf}},t}(),Vf=function(){return Vf=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},Vf.apply(this,arguments)},Gf=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))},Xf=function(t,e){var n,i,r,s,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},Yf=function(t,e,n){if(n||2===arguments.length)for(var i,r=0,s=e.length;r<s;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))},qf=function(){function t(t){var e=t||{};if("object"!=typeof e)throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=ad.Transient;else if(e.defaultScope!==ad.Singleton&&e.defaultScope!==ad.Transient&&e.defaultScope!==ad.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=ud(),this._bindingDictionary=new zf,this._snapshots=[],this._middleware=null,this._activations=new zf,this._deactivations=new zf,this.parent=null,this._metadataReader=new Cd,this._moduleActivationStore=new Hf}return t.merge=function(e,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];var s=new t,o=Yf([e,n],i,!0).map((function(t){return $d(t)})),a=$d(s);return o.forEach((function(t){var e;e=a,t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),s},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),i=0,r=t;i<r.length;i++){var s=r[i],o=n(s.id);s.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,o.unbindAsyncFunction,o.onActivationFunction,o.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Gf(this,void 0,void 0,(function(){var e,n,i,r,s;return Xf(this,(function(o){switch(o.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,i=t,o.label=1;case 1:return n<i.length?(r=i[n],s=e(r.id),[4,r.registry(s.bindFunction,s.unbindFunction,s.isboundFunction,s.rebindFunction,s.unbindAsyncFunction,s.onActivationFunction,s.onDeactivationFunction)]):[3,4];case 2:o.sent(),o.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){var n=t._removeModuleBindings(e.id);t._deactivateSingletons(n),t._removeModuleHandlers(e.id)}))},t.prototype.unloadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Gf(this,void 0,void 0,(function(){var e,n,i,r;return Xf(this,(function(s){switch(s.label){case 0:e=0,n=t,s.label=1;case 1:return e<n.length?(i=n[e],r=this._removeModuleBindings(i.id),[4,this._deactivateSingletonsAsync(r)]):[3,4];case 2:s.sent(),this._removeModuleHandlers(i.id),s.label=3;case 3:return e++,[3,1];case 4:return[2]}}))}))},t.prototype.bind=function(t){var e=this.options.defaultScope||ad.Transient,n=new dd(t,e);return this._bindingDictionary.add(t,n),new Ff(n)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.rebindAsync=function(t){return Gf(this,void 0,void 0,(function(){return Xf(this,(function(e){switch(e.label){case 0:return[4,this.unbindAsync(t)];case 1:return e.sent(),[2,this.bind(t)]}}))}))},t.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var e=this._bindingDictionary.get(t);this._deactivateSingletons(e)}this._removeServiceFromDictionary(t)},t.prototype.unbindAsync=function(t){return Gf(this,void 0,void 0,(function(){var e;return Xf(this,(function(n){switch(n.label){case 0:return this._bindingDictionary.hasKey(t)?(e=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(e)]):[3,2];case 1:n.sent(),n.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}}))}))},t.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse((function(e,n){t._deactivateSingletons(n)})),this._bindingDictionary=new zf},t.prototype.unbindAllAsync=function(){return Gf(this,void 0,void 0,(function(){var t,e=this;return Xf(this,(function(n){switch(n.label){case 0:return t=[],this._bindingDictionary.traverse((function(n,i){t.push(e._deactivateSingletonsAsync(i))})),[4,Promise.all(t)];case 1:return n.sent(),this._bindingDictionary=new zf,[2]}}))}))},t.prototype.onActivation=function(t,e){this._activations.add(t,e)},t.prototype.onDeactivation=function(t,e){this._deactivations.add(t,e)},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,$u,e)},t.prototype.isBoundTagged=function(t,e,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),s=function(t,e,n,i){var r=new Fd(hd.Variable,"",e,new Dd(n,i)),s=new jd(t);return new qd(e,s,null,[],r)}(this,t,e,n);i=r.some((function(t){return t.constraint(s)}))}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,e,n)),i},t.prototype.snapshot=function(){this._snapshots.push(Uf.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error("No snapshot available to restore.");this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){var e=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(e)},t.prototype.getAsync=function(t){return Gf(this,void 0,void 0,(function(){var e;return Xf(this,(function(n){return e=this._getNotAllArgs(t,!1),[2,this._get(e)]}))}))},t.prototype.getTagged=function(t,e,n){var i=this._getNotAllArgs(t,!1,e,n);return this._getButThrowIfAsync(i)},t.prototype.getTaggedAsync=function(t,e,n){return Gf(this,void 0,void 0,(function(){var i;return Xf(this,(function(r){return i=this._getNotAllArgs(t,!1,e,n),[2,this._get(i)]}))}))},t.prototype.getNamed=function(t,e){return this.getTagged(t,$u,e)},t.prototype.getNamedAsync=function(t,e){return this.getTaggedAsync(t,$u,e)},t.prototype.getAll=function(t){var e=this._getAllArgs(t);return this._getButThrowIfAsync(e)},t.prototype.getAllAsync=function(t){var e=this._getAllArgs(t);return this._getAll(e)},t.prototype.getAllTagged=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getButThrowIfAsync(i)},t.prototype.getAllTaggedAsync=function(t,e,n){var i=this._getNotAllArgs(t,!0,e,n);return this._getAll(i)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,$u,e)},t.prototype.getAllNamedAsync=function(t,e){return this.getAllTaggedAsync(t,$u,e)},t.prototype.resolve=function(t){var e=this.isBound(t);e||this.bind(t).toSelf();var n=this.get(t);return e||this.unbind(t),n},t.prototype._preDestroy=function(t,e){if(Reflect.hasMetadata(sd,t))return e[Reflect.getMetadata(sd,t).value]()},t.prototype._removeModuleHandlers=function(t){var e=this._moduleActivationStore.remove(t);this._activations.removeIntersection(e.onActivations),this._deactivations.removeIntersection(e.onDeactivations)},t.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition((function(e){return e.moduleId===t}))},t.prototype._deactivate=function(t,e){var n=this,i=Object.getPrototypeOf(e).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var r=this._deactivateContainer(e,this._deactivations.get(t.serviceIdentifier).values());if(tf(r))return this._handleDeactivationError(r.then((function(){return n._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,e,i)})),i)}var s=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,e,i);if(tf(s))return this._handleDeactivationError(s,i)}catch(t){throw new Error(Bd(i.name,t.message))}},t.prototype._handleDeactivationError=function(t,e){return Gf(this,void 0,void 0,(function(){var n;return Xf(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,t];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),new Error(Bd(e.name,n.message));case 3:return[2]}}))}))},t.prototype._deactivateContainer=function(t,e){for(var n=this,i=e.next();i.value;){var r=i.value(t);if(tf(r))return r.then((function(){return n._deactivateContainerAsync(t,e)}));i=e.next()}},t.prototype._deactivateContainerAsync=function(t,e){return Gf(this,void 0,void 0,(function(){var n;return Xf(this,(function(i){switch(i.label){case 0:n=e.next(),i.label=1;case 1:return n.value?[4,n.value(t)]:[3,3];case 2:return i.sent(),n=e.next(),[3,1];case 3:return[2]}}))}))},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(i){var r=t.rebind(i);return e(r,n),r}},i=function(e){return function(n,i){t._moduleActivationStore.addActivation(e,n,i),t.onActivation(n,i)}},r=function(e){return function(n,i){t._moduleActivationStore.addDeactivation(e,n,i),t.onDeactivation(n,i)}};return function(s){return{bindFunction:(o=s,function(n){var i=t.bind(n);return e(i,o),i}),isboundFunction:function(e){return t.isBound(e)},onActivationFunction:i(s),onDeactivationFunction:r(s),rebindFunction:n(s),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(e){return t.unbindAsync(e)}};var o}},t.prototype._getAll=function(t){return Promise.all(this._get(t))},t.prototype._get=function(t){var e=Vf(Vf({},t),{contextInterceptor:function(t){return t},targetType:hd.Variable});if(this._middleware){var n=this._middleware(e);if(null==n)throw new Error("Invalid return type in middleware. Middleware must return!");return n}return this._planAndResolve()(e)},t.prototype._getButThrowIfAsync=function(t){var e=this._get(t);if(ef(e))throw new Error("You are attempting to construct '"+t.serviceIdentifier+"' in a synchronous way\n but it has asynchronous dependencies.");return e},t.prototype._getAllArgs=function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}},t.prototype._getNotAllArgs=function(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=Qd(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return function(t){return xf(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}(n=e.contextInterceptor(n))}},t.prototype._deactivateIfSingleton=function(t){var e=this;if(t.activated)return tf(t.cache)?t.cache.then((function(n){return e._deactivate(t,n)})):this._deactivate(t,t.cache)},t.prototype._deactivateSingletons=function(t){for(var e=0,n=t;e<n.length;e++){var i=n[e];if(tf(this._deactivateIfSingleton(i)))throw new Error("Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)")}},t.prototype._deactivateSingletonsAsync=function(t){return Gf(this,void 0,void 0,(function(){var e=this;return Xf(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){return e._deactivateIfSingleton(t)})))];case 1:return n.sent(),[2]}}))}))},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,e,n){return this.parent?this._deactivate.bind(this.parent)(t,e):this._bindingDeactivationAndPreDestroy(t,e,n)},t.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,e,n){return Gf(this,void 0,void 0,(function(){return Xf(this,(function(i){switch(i.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,e)]:[3,2];case 1:return i.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,e,n)];case 3:i.sent(),i.label=4;case 4:return[2]}}))}))},t.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error("Could not unbind serviceIdentifier: "+Od(t))}},t.prototype._bindingDeactivationAndPreDestroy=function(t,e,n){var i=this;if("function"==typeof t.onDeactivation){var r=t.onDeactivation(e);if(tf(r))return r.then((function(){return i._preDestroy(n,e)}))}return this._preDestroy(n,e)},t.prototype._bindingDeactivationAndPreDestroyAsync=function(t,e,n){return Gf(this,void 0,void 0,(function(){return Xf(this,(function(i){switch(i.label){case 0:return"function"!=typeof t.onDeactivation?[3,2]:[4,t.onDeactivation(e)];case 1:i.sent(),i.label=2;case 2:return[4,this._preDestroy(n,e)];case 3:return i.sent(),[2]}}))}))},t}(),$f=function(t){this.id=ud(),this.registry=t};function Kf(t,e,n,i){!function(t){if(void 0!==t)throw new Error(wd)}(e),Jf(ed,t,n.toString(),i)}function Zf(t){var e=[];if(Array.isArray(t)){var n=function(t){for(var e=new Set,n=0,i=t;n<i.length;n++){var r=i[n];if(e.has(r))return r;e.add(r)}}((e=t).map((function(t){return t.key})));if(void 0!==n)throw new Error(fd+" "+n.toString())}else e=[t];return e}function Jf(t,e,n,i){var r=Zf(i),s={};Reflect.hasOwnMetadata(t,e)&&(s=Reflect.getMetadata(t,e));var o=s[n];if(void 0===o)o=[];else for(var a=function(t){if(r.some((function(e){return e.key===t.key})))throw new Error(fd+" "+t.key.toString())},l=0,h=o;l<h.length;l++){a(h[l])}o.push.apply(o,r),s[n]=o,Reflect.defineMetadata(t,s,e)}function Qf(t){return function(e,n,i){"number"==typeof i?Kf(e,n,i,t):function(t,e,n){if(void 0!==t.prototype)throw new Error(wd);Jf(nd,t.constructor,e,n)}(e,n,t)}}function tp(){return function(t){if(Reflect.hasOwnMetadata(id,t))throw new Error("Cannot apply @injectable decorator multiple times.");var e=Reflect.getMetadata("design:paramtypes",t)||[];return Reflect.defineMetadata(id,e,t),t}}function ep(t){return Qf(new Dd($u,t))}function np(t){return function(e){return function(n,i,r){if(void 0===e){var s="function"==typeof n?n.name:n.constructor.name;throw new Error("@inject called with undefined this could mean that the class "+s+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation.")}return Qf(new Dd(t,e))(n,i,r)}}}var ip=np(Qu),rp=np(td);var sp,op,ap=(sp=rd,op="Cannot apply @postConstruct decorator multiple times in the same class",function(){return function(t,e){var n=new Dd(sp,e);if(Reflect.hasOwnMetadata(sp,t.constructor))throw new Error(op);Reflect.defineMetadata(sp,n,t.constructor)}});const lp=Symbol("ContributionProvider");class hp{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 cp(t,e){t(lp).toDynamicValue((t=>{let{container:n}=t;return new hp(e,n)})).inSingletonScope().whenTargetNamed(e)}class up{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((t=>t.name!==n&&(!e||t.fn===e))))}_parseOptions(t,e,n){let i;if("string"==typeof e)i={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i),i}_tap(t,e,n){this._insert(this._parseOptions(t,e,n))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let n=0;"number"==typeof t.stage&&(n=t.stage);let i=this.taps.length;for(;i>0;){i--;const t=this.taps[i];this.taps[i+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>n)){i++;break}}this.taps[i]=t}}class dp extends up{call(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const fp=Symbol.for("EnvContribution"),pp=Symbol.for("VGlobal");var gp=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},yp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vp=function(t,e){return function(n,i){e(n,i,t)}};let mp=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}constructor(t){this.contributions=t,this.hooks={onSetEnv:new dp(["lastEnv","env","global"])},this.measureTextMethod="native"}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((n=>{const i=n.configure(this,t);i&&i.then&&e.push(i)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const n=this._env;this._env=t;const i=this.bindContribution(e);if(i&&i.then)return i.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,n)}removeEventListener(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,n)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return this._env||this.setEnv("browser"),"browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1}isSafari(){return this._env||this.setEnv("browser"),"browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};mp=gp([tp(),vp(0,ip(lp)),vp(0,ep(fp)),yp("design:paramtypes",[Object])],mp);const bp=_-1e-8;class xp{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,n,i,r,s){if(Math.abs(r-i)>bp)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);let o,a,l,h,c=1/0,u=-1/0,d=1/0,f=-1/0;function p(t){l=n*Math.cos(t),h=n*Math.sin(t),l<c&&(c=l),l>u&&(u=l),h<d&&(d=h),h>f&&(f=h)}if(p(i),p(r),r!==i)if((i%=_)<0&&(i+=_),(r%=_)<0&&(r+=_),r<i&&(s=!s,o=i,i=r,r=o),s)for(r-=_,o=i-i%A,a=0;a<4&&o>r;++a,o-=A)p(o);else for(o=i-i%A+A,a=0;a<4&&o<r;++a,o+=A)p(o);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+f)}arcTo(t,e,n,i,r){throw new Error("不支持arcTo")}bezierCurveTo(t,e,n,i,r,s){this.bounds.add(t,e),this.bounds.add(n,i),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}rect(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}clear(){this.bounds.clear()}release(){}}class wp{constructor(){this.curves=[],this.bounds=new U}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Sp=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Ap={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},_p={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let Bp,Tp,Cp,Pp,Rp,Op;var Mp,Ep,kp,Ip,jp,Dp,Lp,Np,Wp;function Fp(t){const e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],o=t[5],a=t[6],l=t[7],h=l*s,c=-a*o,u=a*s,d=l*o,f=Math.cos(i),p=Math.sin(i),g=Math.cos(r),y=Math.sin(r),v=.5*(r-i),m=Math.sin(.5*v),b=8/3*m*m/Math.sin(v),x=e+f-b*p,w=n+p+b*f,S=e+g,A=n+y,_=S+b*y,B=A-b*g;return[h*x+c*w,u*x+d*w,h*_+c*B,u*_+d*B,h*S+c*A,u*S+d*A]}function Up(t,e,n,i){const r=function(t,e,n,i,r,s,o,a,l){const h=z(o),c=Math.sin(h),u=Math.cos(h),d=u*(a-t)*.5+c*(l-e)*.5,f=u*(l-e)*.5-c*(a-t)*.5;let p=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);p>1&&(p=Math.sqrt(p),n*=p,i*=p);const g=u/n,y=c/n,v=-c/i,m=u/i,b=g*a+y*l,x=v*a+m*l,w=g*t+y*e,S=v*t+m*e;let B=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;B<0&&(B=0);let T=Math.sqrt(B);s===r&&(T=-T);const C=.5*(b+w)-T*(S-x),P=.5*(x+S)+T*(w-b),R=Math.atan2(x-P,b-C);let O=Math.atan2(S-P,w-C)-R;O<0&&1===s?O+=_:O>0&&0===s&&(O-=_);const M=Math.ceil(Math.abs(O/(A+.001))),E=[];for(let t=0;t<M;++t){const e=R+t*O/M,r=R+(t+1)*O/M;E[t]=[C,P,e,r,n,i,c,u]}return E}(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n);for(let e=0;e<r.length;++e){const n=Fp(r[e]);t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Mp||(Mp={})),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"}(Ep||(Ep={})),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"}(kp||(kp={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Ip||(Ip={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(jp||(jp={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Dp||(Dp={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Lp||(Lp={})),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"}(Np||(Np={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Wp||(Wp={}));const zp=[(t,e,n,i,r,s,o)=>e.arc(t[1]*r+n,t[2]*s+i,t[3]*(r+s)/2,t[4],t[5],t[6],o),(t,e,n,i,r,s,o)=>e.arcTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*(r+s)/2,o),(t,e,n,i,r,s,o)=>e.bezierCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,t[5]*r+n,t[6]*s+i,o),(t,e,n,i)=>e.closePath(),(t,e,n,i,r,s)=>e.ellipse(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,n,i,r,s,o)=>e.lineTo(t[1]*r+n,t[2]*s+i,o),(t,e,n,i,r,s,o)=>e.moveTo(t[1]*r+n,t[2]*s+i,o),(t,e,n,i,r,s,o)=>e.quadraticCurveTo(t[1]*r+n,t[2]*s+i,t[3]*r+n,t[4]*s+i,o),(t,e,n,i,r,s,o)=>e.rect(t[1]*r+n,t[2]*s+i,t[3]*r,t[4]*s,o)];function Hp(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const l=t[a];zp[l[0]](l,e,n,i,r,s,o)}}class Vp{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Gp(t,e,n,i,r){return function(t,e){let n=0;const i=t.length;for(let r=0;r<i;r++){const s=t[r],o=e[r],a=t[(r+1)%i],l=e[(r+1)%i];n+=N.distanceNN(s,o,a,l)}return n/2}([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function Xp(t,e,n,i,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*n*r*r*s+i*r*r*r}function Yp(t,e,n,i,r){const s=Xp(t.x,e.x,n.x,i.x,r),o=Xp(t.y,e.y,n.y,i.y,r);return new L(s,o)}function qp(t,e){const{p0:n,p1:i,p2:r,p3:s}=t,o=Yp(n,i,r,s,e),a=N.pointAtPP(n,i,e),l=N.pointAtPP(i,r,e),h=N.pointAtPP(r,s,e),c=N.pointAtPP(a,l,e),u=N.pointAtPP(l,h,e);return[new $p(n,a,c,o),new $p(o,u,h,s)]}class $p extends Vp{constructor(t,e,n,i){super(),this.type=Np.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=n,this.p3=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return Yp(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Gp(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===Lp.ROW?T(this.p0.x-this.p3.x):t===Lp.COLUMN?T(this.p0.y-this.p3.y):0}getAngleAt(t){const e=R(t-.01,0),n=O(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return C(r.y-i.y,r.x-i.x)}}function Kp(t,e){const{p0:n,p1:i}=t,r=N.pointAtPP(n,i,e);return[new Zp(n,r),new Zp(r,i)]}class Zp extends Vp{constructor(t,e){super(),this.type=Np.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return N.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=C(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()?N.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Lp.ROW?T(this.p0.x-this.p1.x):t===Lp.COLUMN?T(this.p0.y-this.p1.y):0}}class Jp{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,n,i,r,s,o,a){const l=new $p(new L(this._lastX,this._lastY),new L(t,e),new L(n,i),new L(r,s));l.originP1=this._lastOriginP,l.originP2=a,l.defined=o,this.curves.push(l),this._lastX=r,this._lastY=s,this._lastOriginP=a}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,n,i){const r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}moveTo(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}quadraticCurveTo(t,e,n,i){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,n,i,r){const s=new Zp(new L(this._lastX,this._lastY),new L(t,e));return s.originP1=i,s.originP2=r,s.defined=n,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,n;if(t===Lp.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],n=this.curves[this.curves.length-1],i=null!==(e=n.p3)&&void 0!==e?e:n.p1;return T(t.p0.y-i.y)}if(t===Lp.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return T(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Qp extends Jp{bezierCurveTo(t,e,n,i,r,s,o,a){return super.bezierCurveTo(e,t,i,n,s,r,o,a)}lineTo(t,e,n,i){return super.lineTo(e,t,n,i)}moveTo(t,e,n){return super.moveTo(e,t,n)}clear(){return super.clear()}}function tg(t,e){let n=!1;for(let i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}class eg{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function ng(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=new Jp("linear",null!=n?n:T(t[t.length-1].x-t[0].x)>T(t[t.length-1].y-t[0].y)?Lp.ROW:Lp.COLUMN);return function(t,e){tg(t,e)}(new eg(r,i),t),r}function ig(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}class rg{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&&ig(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:ig(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function sg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return ng(t,e);const r=new Jp("basis",null!=n?n:T(t[t.length-1].x-t[0].x)>T(t[t.length-1].y-t[0].y)?Lp.ROW:Lp.COLUMN);return function(t,e){tg(t,e)}(new rg(r,i),t),r}function og(t){return t<0?-1:1}function ag(t,e,n){const i=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(i||Number(r<0&&-0)),o=(n-t._y1)/(r||Number(i<0&&-0)),a=(s*r+o*i)/(i+r);return(og(s)+og(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function lg(t,e){const n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function hg(t,e,n,i,r){const s=t._x0,o=t._y0,a=t._x1,l=t._y1,h=(a-s)/3;t.context.bezierCurveTo(s+h,o+h*e,a-h,l-h*n,a,l,i,t.lastPoint1)}class cg{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._lastDefined2,this.lastPoint1);break;case 3:hg(this,this._t0,lg(this,this._t0),!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const n=t.x,i=t.y;if(n!==this._x1||i!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,hg(this,lg(this,e=ag(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:hg(this,this._t0,e=ag(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}}tryUpdateLength(){return this.context.tryUpdateLength()}}class ug extends cg{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function dg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return ng(t,e);const r=new Jp("monotoneX",null!=n?n:T(t[t.length-1].x-t[0].x)>T(t[t.length-1].y-t[0].y)?Lp.ROW:Lp.COLUMN);return function(t,e){tg(t,e)}(new cg(r,i),t),r}function fg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return ng(t,e);const r=new Qp("monotoneY",null!=n?n:T(t[t.length-1].x-t[0].x)>T(t[t.length-1].y-t[0].y)?Lp.ROW:Lp.COLUMN);return function(t,e){tg(t,e)}(new ug(r,i),t),r}let pg=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{const i=this._x*(1-this._t)+e*this._t;this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function gg(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:i,startPoint:r}=n;if(t.length<2-Number(!!r))return null;const s=new Jp("step",null!=i?i:T(t[t.length-1].x-t[0].x)>T(t[t.length-1].y-t[0].y)?Lp.ROW:Lp.COLUMN);return function(t,e){tg(t,e)}(new pg(s,e,r),t),s}class yg{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.context.closePath()}point(t){const e=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function vg(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:n,startPoint:i}=e;if(t.length<2-Number(!!i))return null;const r=new Jp("linear",null!=n?n:T(t[t.length-1].x-t[0].x)>T(t[t.length-1].y-t[0].y)?Lp.ROW:Lp.COLUMN);return function(t,e){tg(t,e)}(new yg(r,i),t),r}function mg(t,e,n){switch(e){case"linear":default:return ng(t,n);case"basis":return sg(t,n);case"monotoneX":return dg(t,n);case"monotoneY":return fg(t,n);case"step":return gg(t,.5,n);case"stepBefore":return gg(t,0,n);case"stepAfter":return gg(t,1,n);case"linearClosed":return vg(t,n)}}class bg extends wp{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new xp(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([_p.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([_p.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,n,i){return this.commandList.push([_p.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,s){return this.commandList.push([_p.C,t,e,n,i,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,s),this}arcTo(t,e,n,i,r){return this.commandList.push([_p.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,s,o,a){return this.commandList.push([_p.E,t,e,n,i,r,s,o,a]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,s,o,a),this}rect(t,e,n,i){return this.commandList.push([_p.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}arc(t,e,n,i,r,s){return this.commandList.push([_p.A,t,e,n,i,r,s]),this._ctx&&this._ctx.arc(t,e,n,i,r,s),this}closePath(){return this.commandList.push([_p.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}toString(){if(!this.toStringCbList){const t=[];t[_p.M]=t=>`M${t[1]} ${t[2]}`,t[_p.L]=t=>`L${t[1]} ${t[2]}`,t[_p.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[_p.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[_p.A]=t=>{const e=[];((t,e,n,i,r,s,o)=>{const a=Math.abs(n-e),l=4*Math.tan(a/4)/3,h=n<e?-1:1,c=Math.cos(e),u=Math.sin(e),d=Math.cos(n),f=Math.sin(n),p=c*s+i,g=u*o+r,y=d*s+i,v=f*o+r,m=s*l*h,b=o*l*h;t.push(p-m*u,g+b*c,y+m*f,v-b*d,y,v)})(e,t[4],t[5],t[1],t[2],t[3],t[3]);let n="";for(let t=0;t<e.length;t+=6)n+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return n},t[_p.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((n=>{e+=t[n[0]](n)})),e}fromString(t,e,n,i,r){this.clear();const s=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let n,i;const r=[];for(let t=0,s=e.length;t<s;t++)if(Bp=e[t],Tp=Bp.slice(1),Cp=Bp[0],n=[Cp],i=Tp.match(Sp),null!==i){for(let t=0,e=i.length;t<e;t++)Pp=i[t],Rp=parseFloat(Pp),Number.isNaN(Rp)||n.push(Rp);if(Op=Ap[Cp],n.length-1>Op){let t;for(let e=1,i=n.length;e<i;e+=Op){t=[Cp];for(let i=e,r=e+Op;i<r;i++)t.push(n[i]);r.push(t)}}else r.push(n)}else r.push(n);return r}(t);return this._runCommandStrList(s,e,n,i,r),this._updateBounds(),this}fromLine(t){const{points:e,curveType:n,clipRangeByDimension:i}=t.attribute;if(!e)return;const r=mg(e,n);"x"===i?this.direction=Lp.ROW:"y"===i?this.direction=Lp.COLUMN:"auto"===i&&(this.direction=r.direction),this.curves=r.curves}fromCustomPath2D(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}transform(t,e,n,i){const r=this.commandList;if(!this.transformCbList){const t=[];t[_p.M]=this.moveToTransform,t[_p.L]=this.lineToTransform,t[_p.Q]=this.quadraticCurveToTransform,t[_p.C]=this.bezierCurveToTransform,t[_p.AT]=this.arcToTransform,t[_p.E]=this.ellipseTransform,t[_p.R]=this.rectTransform,t[_p.A]=this.arcTransform,t[_p.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,n,i)})),this._updateBounds()}moveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}lineToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}quadraticCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}bezierCurveToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}arcToTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}ellipseTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}rectTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}arcTransform(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}closePathTransform(){}_runCommandStrList(t){let e,n,i,r,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=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,u=0,d=0,f=0,p=0;for(let g=0,y=t.length;g<y;++g){switch(e=t[g],1===l&&1===h||(e=wg(e,l,h)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+o,d+a);break;case"L":u=e[1],d=e[2],this.lineTo(u+o,d+a);break;case"h":u+=e[1],this.lineTo(u+o,d+a);break;case"H":u=e[1],this.lineTo(u+o,d+a);break;case"v":d+=e[1],this.lineTo(u+o,d+a);break;case"V":d=e[1],this.lineTo(u+o,d+a);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+o,d+a);break;case"M":u=e[1],d=e[2],this.moveTo(u+o,d+a);break;case"c":n=u+e[5],i=d+e[6],f=u+e[3],p=d+e[4],this.bezierCurveTo(u+e[1]+o,d+e[2]+a,f+o,p+a,n+o,i+a),u=n,d=i;break;case"C":u=e[5],d=e[6],f=e[3],p=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,f+o,p+a,u+o,d+a);break;case"s":n=u+e[3],i=d+e[4],f=2*u-f,p=2*d-p,this.bezierCurveTo(f+o,p+a,u+e[1]+o,d+e[2]+a,n+o,i+a),f=u+e[1],p=d+e[2],u=n,d=i;break;case"S":n=e[3],i=e[4],f=2*u-f,p=2*d-p,this.bezierCurveTo(f+o,p+a,e[1]+o,e[2]+a,n+o,i+a),u=n,d=i,f=e[1],p=e[2];break;case"q":n=u+e[3],i=d+e[4],f=u+e[1],p=d+e[2],this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,n+o,i+a),u=n,d=i,f=e[1],p=e[2];break;case"t":n=u+e[1],i=d+e[2],null===c[0].match(/[QqTt]/)?(f=u,p=d):"t"===c[0]?(f=2*u-r,p=2*d-s):"q"===c[0]&&(f=2*u-f,p=2*d-p),r=f,s=p,this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i,f=u+e[1],p=d+e[2];break;case"T":n=e[1],i=e[2],f=2*u-f,p=2*d-p,this.quadraticCurveTo(f+o,p+a,n+o,i+a),u=n,d=i;break;case"a":Up(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+u+o,e[7]+d+a]),u+=e[6],d+=e[7];break;case"A":Up(this,u+o,d+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),u=e[6],d=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,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(let s=0,o=t.length;s<o;++s){const o=t[s].slice();switch(o[0]){case _p.L:this.lineToTransform(o,e,n,i,r);break;case _p.M:this.moveToTransform(o,e,n,i,r);break;case _p.C:this.bezierCurveToTransform(o,e,n,i,r);break;case _p.Q:this.quadraticCurveToTransform(o,e,n,i,r);break;case _p.A:this.arcToTransform(o,e,n,i,r);break;case _p.E:this.ellipseTransform(o,e,n,i,r);break;case _p.R:this.rectTransform(o,e,n,i,r);break;case _p.AT:this.arcToTransform(o,e,n,i,r);break;case _p.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Hp(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Lp.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return T(t.p0.y-e.p1.y)}if(this.direction===Lp.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return T(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,n=0;for(let i=0;i<this.curves.length;i++){e=this.curves[i];const r=e.getLength(this.direction);if(n+r>=t)break;n+=r}const i=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(i),angle:e.getAngleAt(i)}}}const xg=["l",0,0,0,0,0,0,0];function wg(t,e,n){const i=xg[0]=t[0];if("a"===i||"A"===i)xg[1]=e*t[1],xg[2]=n*t[2],xg[3]=t[3],xg[4]=t[4],xg[5]=t[5],xg[6]=e*t[6],xg[7]=n*t[7];else if("h"===i||"H"===i)xg[1]=e*t[1];else if("v"===i||"V"===i)xg[1]=n*t[1];else for(let i=1,r=t.length;i<r;++i)xg[i]=(i%2==1?e:n)*t[i];return xg}const Sg={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,anchor:[0,0],anchor3d:[0,0],postMatrix:new V},Ag={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},_g={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Bg=Object.assign({outerBorder:Object.assign(Object.assign({},_g),{distance:0}),innerBorder:Object.assign(Object.assign({},_g),{distance:0})},_g),Tg={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},Cg=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:0,blur:0,cursor:null,html:null},Ag),Bg),{alignSelf:"auto"}),Pg={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Rg=Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1},Cg),Sg),Og=Object.assign(Object.assign({},Rg),{startAngle:0,endAngle:B,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Mg=Object.assign(Object.assign(Object.assign({},Rg),Pg),{points:[],segments:[],curveType:"linear",clipRange:1}),Eg=Object.assign(Object.assign({},Rg),{radius:1,startAngle:0,endAngle:B}),kg=Object.assign(Object.assign({},Rg),{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"}),Ig=Object.assign(Object.assign({},Rg),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),jg=Object.assign(Object.assign(Object.assign({},Rg),Pg),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default"}),Dg=Object.assign(Object.assign({},Rg),{path:new bg,customPath:()=>{console.warn("空函数")}}),Lg=Object.assign(Object.assign({},Rg),{points:[],cornerRadius:0}),Ng=Object.assign(Object.assign({},Rg),{width:0,height:0,strokeBoundsBuffer:0,cornerRadius:0}),Wg=Object.assign(Object.assign({},Rg),{width:0,height:0,cornerRadius:0,length:0}),Fg=Object.assign(Object.assign({},Rg),{symbolType:"circle",size:10,keepDirIn3d:!0}),Ug=Object.assign(Object.assign(Object.assign({},Rg),Tg),{strokeBoundsBuffer:0,keepDirIn3d:!0}),zg=Object.assign(Object.assign({},Rg),{width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Hg=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Rg),{fill:!0,cornerRadius:0}),Vg=Object.assign(Object.assign({},Hg),{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 Gg=new class{},Xg={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Yg=!0,qg=!1,$g=/\w|\(|\)|-/,Kg=/[.?!,;:/,。?!、;:]/,Zg=/\S/;function Jg(t,e,n,i,r){if(!e||e<=0)return 0;const s=Gg.graphicUtil.textMeasure;let o=i,a=t.slice(0,o),l=Math.floor(s.measureText(a,n).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,n).width);for(;l>e||c<=e;){if(l>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}a=t.slice(0,o),l=Math.floor(s.measureText(a,n).width),h=t.slice(0,o+1),c=Math.floor(s.measureText(h,n).width)}return r&&(o=Qg(t,o)),o}function Qg(t,e){let n=e;for(;$g.test(t[n-1])&&$g.test(t[n])||Kg.test(t[n]);)if(n--,n<=0)return e;return n}function ty(t,e){const n=Gg.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var ey=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let ny=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:n=Ug.fontSize}=e,i=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?i++:r++;return{width:~~(.8*i*n+r*n),height:n}}measureTextPixelHeight(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Tg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:Tg.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,n,i){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<n;a++)o+=t[a].width,s.push(t[a]);if(t[a]&&t[a].text.length>1){const r=this._clipText(t[a].text,e,n-o,0,t[a].text.length-1);if(i&&r.str!==t[a].text){let n="",i=0;for(let e=0;e<a;e++){const r=t[e];n+=r.text,i+=r.text.length}n+=t[a].text;let s=Qg(n,i+r.str.length);s-=i,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[a]),{text:r.str,width:r.width})),o+=r.width}return{verticalList:s,width:o}}clipText(t,e,n,i){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>n)return{str:"",width:0};const s=this._clipText(t,e,n,0,t.length-1);if(i&&s.str!==t){const n=Qg(t,s.str.length);n!==s.str.length&&(s.str=t.substring(0,n),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,n,i,r){const s=Math.floor((i+r)/2),o=t.substring(0,s+1),a=this.measureTextWidth(o,e);let l;if(a>n){if(o.length<=1)return{str:"",width:0};const r=t.substring(0,s);return l=this.measureTextWidth(r,e),l<=n?{str:r,width:l}:this._clipText(t,e,n,i,s)}if(a<n){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const i=t.substring(0,s+2);return l=this.measureTextWidth(i,e),l>=n?{str:o,width:a}:this._clipText(t,e,n,s,r)}return{str:o,width:a}}clipTextWithSuffixVertical(t,e,n,i,r){if(""===i)return this.clipTextVertical(t,e,n,r);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,n,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const o=this.measureTextWidth(i,e);if(o>n)return s;n-=o;const a=this.clipTextVertical(t,e,n,r);return a.width+=o,a.verticalList.push({text:i,direction:1,width:o}),a}clipTextWithSuffix(t,e,n,i,r){if(""===i)return this.clipText(t,e,n,r);if(0===t.length)return{str:"",width:0};const s=this.measureTextWidth(t,e);if(s<=n)return{str:t,width:s};const o=this.measureTextWidth(i,e);if(o>n)return{str:"",width:0};n-=o;const a=this._clipText(t,e,n,0,t.length-1);if(r&&a.str!==t){const n=Qg(t,a.str.length);n!==a.str.length&&(a.str=t.substring(0,n),a.width=this.measureTextWidth(a.str,e))}return a.str+=i,a.width+=o,a}};ny=ey([tp()],ny);var iy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const ry=Symbol.for("TextMeasureContribution");let sy=class extends ny{};sy=iy([tp()],sy);const oy=new qf,ay=Symbol.for("CanvasFactory"),ly=Symbol.for("Context2dFactory");function hy(t){return oy.getNamed(ay,Gg.global.env)(t)}const cy=1e-4,uy=Math.sqrt(3),dy=1/3;function fy(t){return t>-Cy&&t<Cy}function py(t){return t>Cy||t<-Cy}const gy=[0,0],yy=[0,0],vy=[0,0];function my(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function by(t,e,n,i){const r=1-i;return r*(r*t+2*i*e)+i*i*n}function xy(t,e,n,i,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*i+3*s*n)}function wy(t){return(t%=B)<0&&(t+=B),t}function Sy(t,e,n,i,r,s){if(s>e&&s>i||s<e&&s<i)return 0;if(i===e)return 0;const o=(s-e)/(i-e);let a=i<e?1:-1;1!==o&&0!==o||(a=i<e?.5:-.5);const l=o*(n-t)+t;return l===r?1/0:l>r?a:0}function Ay(t,e,n,i,r,s,o,a,l){if(0===o)return!1;const h=o;return!(l>e+h&&l>i+h&&l>s+h||l<e-h&&l<i-h&&l<s-h||a>t+h&&a>n+h&&a>r+h||a<t-h&&a<n-h&&a<r-h)&&function(t,e,n,i,r,s,o,a,l){let h=0,c=.005,u=1/0;gy[0]=o,gy[1]=a;for(let o=0;o<1;o+=.05){yy[0]=by(t,n,r,o),yy[1]=by(e,i,s,o);const a=my(gy,yy);a<u&&(h=o,u=a)}u=1/0;for(let o=0;o<32&&!(c<cy);o++){const o=h-c,a=h+c;yy[0]=by(t,n,r,o),yy[1]=by(e,i,s,o);const l=my(yy,gy);if(o>=0&&l<u)h=o,u=l;else{vy[0]=by(t,n,r,a),vy[1]=by(e,i,s,a);const o=my(vy,gy);a<=1&&o<u?(h=a,u=o):c*=.5}}return l&&(l[0]=by(t,n,r,h),l[1]=by(e,i,s,h)),Math.sqrt(u)}(t,e,n,i,r,s,a,l,null)<=h/2}function _y(t,e,n,i,r,s,o,a,l,h,c){if(0===l)return!1;const u=l;return!(c>e+u&&c>i+u&&c>s+u&&c>a+u||c<e-u&&c<i-u&&c<s-u&&c<a-u||h>t+u&&h>n+u&&h>r+u&&h>o+u||h<t-u&&h<n-u&&h<r-u&&h<o-u)&&function(t,e,n,i,r,s,o,a,l,h,c){let u,d,f,p,g=0,y=.005,v=1/0;gy[0]=l,gy[1]=h;for(let l=0;l<1;l+=.05)yy[0]=xy(t,n,r,o,l),yy[1]=xy(e,i,s,a,l),f=my(gy,yy),f<v&&(g=l,v=f);v=1/0;for(let l=0;l<32&&!(y<cy);l++)u=g-y,d=g+y,yy[0]=xy(t,n,r,o,u),yy[1]=xy(e,i,s,a,u),f=my(yy,gy),u>=0&&f<v?(g=u,v=f):(vy[0]=xy(t,n,r,o,d),vy[1]=xy(e,i,s,a,d),p=my(vy,gy),d<=1&&p<v?(g=d,v=p):y*=.5);return c&&(c[0]=xy(t,n,r,o,g),c[1]=xy(e,i,s,a,g)),Math.sqrt(v)}(t,e,n,i,r,s,o,a,h,c,null)<=u/2}function By(t,e,n,i,r,s,o,a,l){if(0===o)return!1;const h=o;a-=t,l-=e;const c=Math.sqrt(a*a+l*l);if(c-h>n||c+h<n)return!1;if(Math.abs(i-r)%B<1e-4)return!0;if(s){const t=i;i=wy(r),r=wy(t)}else i=wy(i),r=wy(r);i>r&&(r+=B);let u=Math.atan2(l,a);return u<0&&(u+=B),u>=i&&u<=r||u+B>=i&&u+B<=r}function Ty(t,e,n,i,r,s,o){if(0===r)return!1;const a=r,l=r/2;let h=0,c=t;if(o>e+l&&o>i+l||o<e-l&&o<i-l||s>t+l&&s>n+l||s<t-l&&s<n-l)return!1;if(t===n)return Math.abs(s-t)<=a/2;h=(e-i)/(t-n),c=(t*i-n*e)/(t-n);const u=h*s-o+c;return u*u/(h*h+1)<=a/2*a/2}const Cy=1e-4;function Py(t,e,n,i,r){const s=6*n-12*e+6*t,o=9*e+3*i-3*t-9*n,a=3*e-3*t;let l=0;if(fy(o)){if(py(s)){const t=-a/s;t>=0&&t<=1&&(r[l++]=t)}}else{const t=s*s-4*o*a;if(fy(t))r[0]=-s/(2*o);else if(t>0){const e=Math.sqrt(t),n=(-s+e)/(2*o),i=(-s-e)/(2*o);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}const Ry=[-1,-1,-1],Oy=[-1,-1];function My(){const t=Oy[0];Oy[0]=Oy[1],Oy[1]=t}function Ey(t,e,n,i,r,s,o,a,l,h){if(h>e&&h>i&&h>s&&h>a||h<e&&h<i&&h<s&&h<a)return 0;const c=function(t,e,n,i,r,s){const o=i+3*(e-n)-t,a=3*(n-2*e+t),l=3*(e-t),h=t-r,c=a*a-3*o*l,u=a*l-9*o*h,d=l*l-3*a*h;let f=0;if(fy(c)&&fy(u))if(fy(a))s[0]=0;else{const t=-l/a;t>=0&&t<=1&&(s[f++]=t)}else{const t=u*u-4*c*d;if(fy(t)){const t=u/c,e=-a/o+t,n=-t/2;e>=0&&e<=1&&(s[f++]=e),n>=0&&n<=1&&(s[f++]=n)}else if(t>0){const e=Math.sqrt(t);let n=c*a+1.5*o*(-u+e),i=c*a+1.5*o*(-u-e);n=n<0?-Math.pow(-n,dy):Math.pow(n,dy),i=i<0?-Math.pow(-i,dy):Math.pow(i,dy);const r=(-a-(n+i))/(3*o);r>=0&&r<=1&&(s[f++]=r)}else{const t=(2*c*a-3*o*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,n=Math.sqrt(c),i=Math.cos(e),r=(-a-2*n*i)/(3*o),l=(-a+n*(i+uy*Math.sin(e)))/(3*o),h=(-a+n*(i-uy*Math.sin(e)))/(3*o);r>=0&&r<=1&&(s[f++]=r),l>=0&&l<=1&&(s[f++]=l),h>=0&&h<=1&&(s[f++]=h)}}return f}(e,i,s,a,h,Ry);if(0===c)return 0;let u=0,d=-1,f=0,p=0;for(let h=0;h<c;h++){const c=Ry[h],g=0===c||1===c?.5:1;xy(t,n,r,o,c)<l||(d<0&&(d=Py(e,i,s,a,Oy),Oy[1]<Oy[0]&&d>1&&My(),f=xy(e,i,s,a,Oy[0]),d>1&&(p=xy(e,i,s,a,Oy[1]))),2===d?c<Oy[0]?u+=f<e?g:-g:c<Oy[1]?u+=p<f?g:-g:u+=a<p?g:-g:c<Oy[0]?u+=f<e?g:-g:u+=a<f?g:-g)}return u}function ky(t,e,n,i,r,s,o,a){if(a>e&&a>i&&a>s||a<e&&a<i&&a<s)return 0;const l=function(t,e,n,i,r){const s=t-2*e+n,o=2*(e-t),a=t-i;let l=0;if(fy(s)){if(py(o)){const t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{const t=o*o-4*s*a;if(fy(t)){const t=-o/(2*s);t>=0&&t<=1&&(r[l++]=t)}else if(t>0){const e=Math.sqrt(t),n=(-o+e)/(2*s),i=(-o-e)/(2*s);n>=0&&n<=1&&(r[l++]=n),i>=0&&i<=1&&(r[l++]=i)}}return l}(e,i,s,a,Ry);if(0===l)return 0;const h=function(t,e,n){const i=t+n-2*e;return 0===i?.5:(t-e)/i}(e,i,s);if(h>=0&&h<=1){let a=0;const c=by(e,i,s,h);for(let i=0;i<l;i++){const l=0===Ry[i]||1===Ry[i]?.5:1;by(t,n,r,Ry[i])<o||(Ry[i]<h?a+=c<e?l:-l:a+=s<c?l:-l)}return a}const c=0===Ry[0]||1===Ry[0]?.5:1;return by(t,n,r,Ry[0])<o?0:s<e?c:-c}function Iy(t,e,n,i,r,s,o,a){if((a-=e)>n||a<-n)return 0;const l=Math.sqrt(n*n-a*a);Ry[0]=-l,Ry[1]=l;const h=Math.abs(i-r);if(h<1e-4)return 0;if(h>=B-1e-4){i=0,r=B;const e=s?1:-1;return o>=Ry[0]+t&&o<=Ry[1]+t?e:0}if(i>r){const t=i;i=r,r=t}i<0&&(i+=B,r+=B);let c=0;for(let e=0;e<2;e++){const n=Ry[e];if(n+t>o){let t=Math.atan2(a,n),e=s?1:-1;t<0&&(t=B+t),(t>=i&&t<=r||t+B>=i&&t+B<=r)&&(t>S/2&&t<1.5*S&&(e=-e),c+=e)}}return c}function jy(t){return Math.round(t/S*1e8)/1e8%2*S}function Dy(t,e){let n=jy(t[0]);n<0&&(n+=B);const i=n-t[0];let r=t[1];r+=i,!e&&r-n>=B?r=n+B:e&&n-r>=B?r=n-B:!e&&n>r?r=n+(B-jy(n-r)):e&&n<r&&(r=n-(B-jy(r-n))),t[0]=n,t[1]=r}const Ly=[0,0];function Ny(t,e,n,i,r){const s=t,o=t.length;let a,l,h=0,c=0,u=0,d=0,f=0;for(let t=0;t<o;t++){const o=s[t],p=0===t;o[0]===_p.M&&t>1&&(n||(h+=Sy(c,u,d,f,i,r))),p&&(c=o[1],u=o[2],d=c,f=u);const g=o[0],y=o[1],v=o[2],m=o[3],b=o[4],x=o[5],w=o[6];let S=b,A=x;Ly[0]=S,Ly[1]=A,Dy(Ly,Boolean(o[6])),S=Ly[0],A=Ly[1];const _=S,B=A-S,T=!!(1-(o[6]?0:1)),C=(i-y)*m/m+y;switch(g){case _p.M:d=y,f=v,c=d,u=f;break;case _p.L:if(n){if(Ty(c,u,y,v,e,i,r))return!0}else h+=Sy(c,u,y,v,i,r)||0;c=y,u=v;break;case _p.C:if(n){if(_y(c,u,y,v,m,b,x,w,e,i,r))return!0}else h+=Ey(c,u,y,v,m,b,x,w,i,r)||0;c=x,u=w;break;case _p.Q:if(n){if(Ay(c,u,y,v,m,b,e,i,r))return!0}else h+=ky(c,u,y,v,m,b,i,r)||0;c=m,u=b;break;case _p.A:if(a=Math.cos(_)*m+y,l=Math.sin(_)*m+v,p?(d=a,f=l):h+=Sy(c,u,a,l,i,r),n){if(By(y,v,m,_,_+B,T,e,C,r))return!0}else h+=Iy(y,v,m,_,_+B,T,C,r);c=Math.cos(_+B)*m+y,u=Math.sin(_+B)*m+v;break;case _p.R:if(d=c=y,f=u=v,a=d+m,l=f+b,n){if(Ty(d,f,a,f,e,i,r)||Ty(a,f,a,l,e,i,r)||Ty(a,l,d,l,e,i,r)||Ty(d,l,d,f,e,i,r))return!0}else h+=Sy(a,f,a,l,i,r),h+=Sy(d,l,d,f,i,r);break;case _p.Z:if(n){if(Ty(c,u,d,f,e,i,r))return!0}else h+=Sy(c,u,d,f,i,r);c=d,u=f}}return n||(p=u,g=f,Math.abs(p-g)<Cy)||(h+=Sy(c,u,d,f,i,r)||0),0!==h;var p,g}var Wy=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Fy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uy=function(t,e){return function(n,i){e(n,i,t)}};let zy=class{constructor(t,e){this.contributions=t,this.global=e,this.configured=!1,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,n)=>{this.configured=!1,this.configure(n,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){if(this.configured)return;const n=hy({nativeCanvas:t.createCanvas({width:100,height:100})});this.canvas=n,this.context=n.getContext("2d"),this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var i;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=n;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(i=e.fontSize)&&void 0!==i?i:Tg.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,n){return this.configure(this.global,this.global.env),new it(Object.assign({defaultFontParams:{fontFamily:Tg.fontFamily,fontSize:Tg.fontSize},getCanvasForMeasure:n||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+it.ALPHABET_CHAR_SET+it.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}};var Hy;zy=Wy([tp(),Uy(0,ip(lp)),Uy(0,ep(ry)),Uy(1,ip(pp)),Fy("design:paramtypes",[Object,Object])],zy),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Hy||(Hy={}));const Vy=new V;let Gy=class{constructor(){this.matrix=new V}init(t){return this.mode=Hy.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Hy.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,n){const i=this.outSourceMatrix;if(Vy.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),n){const{x:i,y:r}=n;this.outTargetMatrix.translate(i,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-i,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Vy.a,Vy.b,Vy.c,Vy.d,Vy.e,Vy.f),this}rotateMatrix(t,e){const n=this.outSourceMatrix;if(Vy.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),e){const{x:n,y:i}=e;this.outTargetMatrix.translate(n,i),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-n,-i)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Vy.a,Vy.b,Vy.c,Vy.d,Vy.e,Vy.f),this}scale(t,e,n){return this.mode===Hy.matrix?this.scaleMatrix(t,e,n):this}rotate(t,e){return this.mode===Hy.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const n=this.outSourceMatrix;return Vy.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Vy.a,Vy.b,Vy.c,Vy.d,Vy.e,Vy.f),this}translate(t,e){return this.mode===Hy.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Hy.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};Gy=Wy([tp(),Fy("design:paramtypes",[])],Gy);const Xy={arc:Og,area:Mg,circle:Eg,line:jg,path:Dg,symbol:Fg,text:Ug,rect:Ng,rect3d:Wg,polygon:Lg,richtext:zg,richtextIcon:Vg,image:Hg,group:kg,glyph:Ig},Yy=Object.keys(Xy);function qy(){return{arc:Object.assign({},Xy.arc),area:Object.assign({},Xy.area),circle:Object.assign({},Xy.circle),line:Object.assign({},Xy.line),path:Object.assign({},Xy.path),symbol:Object.assign({},Xy.symbol),text:Object.assign({},Xy.text),rect:Object.assign({},Xy.rect),rect3d:Object.assign({},Xy.rect3d),polygon:Object.assign({},Xy.polygon),richtext:Object.assign({},Xy.richtext),richtextIcon:Object.assign({},Xy.richtextIcon),image:Object.assign({},Xy.image),group:Object.assign({},Xy.group),glyph:Object.assign({},Xy.glyph)}}function $y(t,e){e&&(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]?Object.keys(e).forEach((n=>{t[n]?Object.assign(t[n],e[n]):t[n]=e[n]})):Object.keys(e).forEach((n=>{if(t[n]){const i=t[n],r=e[n];Object.keys(e[n]).forEach((t=>{void 0===i[t]&&(i[t]=r[t])}))}else t[n]=e[n]})))}const Ky=new Array(60).fill(0).map((()=>qy()));class Zy{constructor(){this._defaultTheme=Ky.pop()||qy(),this.combinedTheme=this._defaultTheme,this.dirty=!1}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const n=this.getParentWithTheme(t);return n&&(e=n.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const i=this.getParentWithTheme(t);if(i){const t=i.theme;(t.dirty||n)&&t.applyTheme(i,e,!0),this.userTheme?$y(this.userTheme,t.userTheme,!1):this.userTheme=v(t.userTheme),$y(e,t.userTheme)}this.userTheme?this.doCombine(e):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,console.warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,n=this._defaultTheme,i=this.combinedTheme,r=t.common||{},s=Object.assign(r,this.commonTheme);Yy.forEach((r=>{var o,a;e[r]||s||t[r]?i[r]=Object.assign({},n[r],null!=s?s:{},null!==(o=t[r])&&void 0!==o?o:{},null!==(a=e[r])&&void 0!==a?a:{}):i[r]=n[r]})),this.dirty=!1}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}setTheme(t,e){let n=this.userTheme;n?Object.keys(t).forEach((e=>{n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,t.common&&(this.commonTheme?Object.assign(this.commonTheme,t.common):this.commonTheme=t.common),this.userTheme=n,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Jy=new Zy;function Qy(t,e){return t.glyphHost?Qy(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)):Jy.getTheme()}return null}(t)||Jy.getTheme()}class tv{static GenAutoIncrementId(){return tv.auto_increment_id++}}tv.auto_increment_id=0;var ev=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};class nv extends r{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=tv.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,n=0;for(;e;){if(t(e,n++))return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){if(t(e,n++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ev(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._prev}}else{let e=this._firstChild,n=0;for(;e;){let i=t(e,n++);if(i.then&&(i=yield i),i)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){if(this._uid===t._uid)return null;if(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&&console.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 n=this._firstChild;for(let t=0;t<e;t++){if(!n)return null;t>0&&(n=n._next)}if(!n)return null;t._next=n._next,t._prev=n,n._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}let n;this._nodeList[e]=t;for(let t=e-1;t>=0&&(n=this._nodeList[t],!n);t--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;const i=this.insertInto(t,0);return this._ignoreWarn=!1,i}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(){if(!this._idMap)return;let t=this._firstChild;for(;t;)t.parent=null,t._prev=null,t._next=null,t=t._next;this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.forEachChildren(((e,i)=>!(e===this||!t(e,i)||(n=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren(((e,i)=>{e!==this&&t(e,i)&&n.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let n=0;n<t;n++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let n=this._firstChild;for(;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,n){const i=o(n,!0)&&n||c(n)&&n.capture,r=c(n)&&n.once,s=a(e)?void 0:e;return t=i?`${t}capture`:t,e=a(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,n){return this.addEventListener(t,e,n)}removeEventListener(t,e,n){const i=o(n,!0)&&n||c(n)&&n.capture,r=a(e)?void 0:e;t=i?`${t}capture`:t,e=a(e)?e:e.handleEvent;const s=c(n)&&n.once;return super.off(t,e,r,s),this}off(t,e,n){return this.removeEventListener(t,e,n)}once(t,e,n){return c(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return super.emit(t.type,t,...n),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class iv{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=iv.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new L,this.page=new L,this.canvas=new L,this.viewport=new L,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.path}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class rv extends iv{constructor(){super(...arguments),this.client=new L,this.movement=new L,this.offset=new L,this.global=new L,this.screen=new L}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,n,i,r,s,o,a,l,h,c,u,d,f,p){throw new Error("Method not implemented.")}}class sv extends rv{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,n;const i=new sv(this.manager);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.target=null,i.nativeEvent=this.nativeEvent,i.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,i),null===(e=this.manager)||void 0===e||e.copyMouseData(this,i),null===(n=this.manager)||void 0===n||n.copyData(this,i),i.target=this.target,i.path=this.composedPath().slice(),i.type=this.type,i}}sv.DOM_DELTA_PIXEL=0,sv.DOM_DELTA_LINE=1,sv.DOM_DELTA_PAGE=2;class ov extends iv{constructor(t,e){super(),this.type=t,this.detail=e}}const av={pickable:!0,visible:!0,dispatchEvent(t){var e;if(!(t instanceof iv))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],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 ov(t,e))}};class lv{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return lv.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class hv{static Avaliable(){return!0}avaliable(){return hv.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class cv{static Avaliable(){return!!Gg.global.getRequestAnimationFrame()}avaliable(){return cv.Avaliable()}tick(t,e){Gg.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}var uv;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(uv||(uv={}));class dv{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-dv.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*dv.bounceIn(2*t):.5*dv.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(n){if(0===n||1===n)return n;const i=e/B*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*B/e)}}static getElasticOut(t,e){return function(n){if(0===n||1===n)return n;const i=e/B*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*B/e)+1}}static getElasticInOut(t,e){return function(n){const i=e/B*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*B/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*B/e)*.5+1}}}dv.quadIn=dv.getPowIn(2),dv.quadOut=dv.getPowOut(2),dv.quadInOut=dv.getPowInOut(2),dv.cubicIn=dv.getPowIn(3),dv.cubicOut=dv.getPowOut(3),dv.cubicInOut=dv.getPowInOut(3),dv.quartIn=dv.getPowIn(4),dv.quartOut=dv.getPowOut(4),dv.quartInOut=dv.getPowInOut(4),dv.quintIn=dv.getPowIn(5),dv.quintOut=dv.getPowOut(5),dv.quintInOut=dv.getPowInOut(5),dv.backIn=dv.getBackIn(1.7),dv.backOut=dv.getBackOut(1.7),dv.backInOut=dv.getBackInOut(1.7),dv.elasticIn=dv.getElasticIn(1,.3),dv.elasticOut=dv.getElasticOut(1,.3),dv.elasticInOut=dv.getElasticInOut(1,.3*1.5);const fv=new class{constructor(){this.id=tv.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===Ip.END?this.removeAnimate(e):e.status===Ip.RUNNING||e.status===Ip.INITIAL?(this.animateCount++,e.advance(t)):e.status===Ip.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 pv{constructor(t,e,n,i,r){this.from=t,this.to=e,this.duration=n,this.easing=i,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,n){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1,Object.assign(n,this.step.getLastProps()),this.onUpdate(t,e,n),t&&this.onEnd()}}class gv extends pv{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,n){}onStart(){this.cb()}}class yv{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tv.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fv;this.id=t,this.timeline=e,this.status=Ip.INITIAL,this.tailAnimate=new vv(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}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=R(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){yv.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.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yv.mode;t&&e&jp.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:kp.ANIMATE_PLAY})}runCb(t){const e=new gv((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,n,i,r,s){const o=yv.interpolateMap.get(t)||yv.interpolateMap.get("");return!!o&&o(t,e,n,i,r,s)}pause(){this.status===Ip.RUNNING&&(this.status=Ip.PAUSED)}resume(){this.status===Ip.PAUSED&&(this.status=Ip.RUNNING)}to(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new vv(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.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===Ip.INITIAL&&(this.status=Ip.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===Ip.RUNNING&&(this.status=Ip.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,n=0;const i=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===i)return s;for(let i=0;i<this.subAnimates.length&&(e=this.subAnimates[i],!(n+e.totalDuration>=t));i++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Ip.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()}}yv.mode=jp.NORMAL,yv.interpolateMap=new Map;class vv{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 mv(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const n=t.easing,i="string"==typeof n?dv[n]:n,r=this._addStep(e,null,i);return r.type=Dp.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}to(t,e,n,i){(null==e||e<0)&&(e=0);const r="string"==typeof n?dv[n]:n,s=this._addStep(e,null,r);return s.type=Dp.to,this._appendProps(t,s,!!i&&i.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),i&&i.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(s.propKeys)})),this}from(t,e,n,i){this.to(t,0,n,i);const r={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{r[t]=this.getLastPropByName(t,this.stepTail)})),this.to(r,e,n,i),this.stepTail.type=Dp.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=Dp.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,n){const i=new mv(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}_appendProps(t,e,n){e.props=n?t:Object.assign({},t);let i=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));i.prev;)i.props&&(i.propKeys||(i.propKeys=Object.keys(i.props)),i.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=i.props[t])}))),i=i.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const n=this.duration,i=this.loop,r=this.rawPosition;let s,o,a=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(t-=l,n<=0)return a=!0,a;if(s=Math.floor(t/n),o=t-s*n,a=t>=i*n+n,a&&(o=n,s=i,t=o*s+n),t===r)return a;const h=!this.reversed!=!(this.bounce&&s%2);return h&&(o=n-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+l,this.updatePosition(a,h),a}updatePosition(t,e){if(!this.stepHead)return;let n=this.stepHead.next;const i=this.position,r=this.duration;if(this.target&&n){let s=n.next;for(;s&&s.position<=i;)n=s,s=n.next;let o=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(o=n.easing(o)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,o,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(n,o)))}}tryCallCustomAnimateLifeCycle(t,e,n){if(t!==e)if(n){let n=e.prev;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let n=e.next;for(;n&&n!==t;)n.customAnimate&&(n.customAnimate.onStart&&n.customAnimate.onStart(),n.customAnimate.onEnd&&n.customAnimate.onEnd()),n=n.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let n=e.prev;for(;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){const e=n.customAnimate.getEndProps()[t];if(void 0!==e)return e}n=n.prev}return console.warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}class mv{constructor(t,e,n,i){this.duration=e,this.position=t,this.props=n,this.easing=i}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const bv=200,xv="cubicOut";var wv;!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"}(wv||(wv={}));const Sv=[!1,!1,!1,!1],Av=[0,0,0,0],_v=t=>t?d(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Av[0]=t[0],Av[2]=t[0],Av[1]=t[1],Av[3]=t[1],Av):t:t:0,Bv=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Tv=[1,2,3,0,1,2,3,0];function Cv(t,e,n,i){for(;t>=B;)t-=B;for(;t<0;)t+=B;for(;t>e;)e+=B;Bv[0].x=n,Bv[1].y=n,Bv[2].x=-n,Bv[3].y=-n;const r=Math.ceil(t/A)%4,s=Math.ceil(e/A)%4;if(i.add(P(t)*n,M(t)*n),i.add(P(e)*n,M(e)*n),r!==s||e-t>S){let t=!1;for(let e=0;e<Tv.length;e++)if(t||r!==Tv[e]){if(t&&s===Tv[e])break;if(t){const t=Bv[Tv[e]];i.add(t.x,t.y)}}else{t=!0;const e=Bv[r];i.add(e.x,e.y)}}}function Pv(t,e,n){const{x:i,y:r}=D(t.x,t.y,e.x,e.y,n),{x:s,y:o}=D(t.x1,t.y1,e.x1,e.y1,n),a=new L(i,r,s,o);return a.defined=e.defined,a}function Rv(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let i=[];if(t.length>e.length){i=e.map((t=>{const e=new L(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)i[r]=Pv(t[r],e[r],n)}else{i=e.map((t=>{const e=new L(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)i[r]=Pv(t[r],e[r],n)}return i}function Ov(t,e){if(d(t)){let n;for(let i=0;i<t.length&&void 0===n;i++)n=t[i][e];return n}return t[e]}class Mv{constructor(){this.durations=[],this.timeout=Mv.TimeOut,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}Mv.TimeOut=1e3/60;const Ev=new Mv;var kv;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(kv||(kv={}));var Iv={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const jv={};for(const t in Iv)y(Iv,t)&&(jv[Iv[t]]=t);const Dv={to:{},get:{}};function Lv(t,e,n){return Math.min(Math.max(e,t),n)}function Nv(t){const e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}Dv.get=function(t){let e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];switch(t.substring(0,3).toLowerCase()){case"hsl":e=Dv.get.hsl(t,i),n="hsl";break;case"hwb":e=Dv.get.hwb(t,i),n="hwb";break;default:e=Dv.get.rgb(t,i),n="rgb"}return e?{model:n,value:e}:null},Dv.get.rgb=function(t){if(!t)return null;const e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];let n,i,r;if(n=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=n[2],n=n[1],i=0;i<3;i++){const t=2*i;e[i]=parseInt(n.slice(t,t+2),16)}r&&(e[3]=Math.round(parseInt(r,16)/255*100)/100)}else if(n=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=n[1],r=n[3],i=0;i<3;i++)e[i]=parseInt(n[i]+n[i],16);r&&(e[3]=Math.round(parseInt(r+r,16)/255*100)/100)}else if(n=t.match(/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/)){for(i=0;i<3;i++)e[i]=parseInt(n[i+1],10);n[4]&&(e[3]=parseFloat(n[4]))}else{if(!(n=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/))){if(n=t.match(/(\D+)/)){if("transparent"===n[1])return[0,0,0,0];const t=Iv[n[1]];return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e?(e[3]=1,e):null}return null}for(i=0;i<3;i++)e[i]=Math.round(2.55*parseFloat(n[i+1]));n[4]&&(e[3]=parseFloat(n[4]))}for(i=0;i<3;i++)e[i]=Lv(e[i],0,255);return e[3]=Lv(e[3],0,1),e},Dv.get.hsl=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;const n=t.match(/^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){const t=parseFloat(n[4]);return e[0]=(parseFloat(n[1])+360)%360,e[1]=Lv(parseFloat(n[2]),0,100),e[2]=Lv(parseFloat(n[3]),0,100),e[3]=Lv(isNaN(t)?1:t,0,1),e}return null},Dv.get.hwb=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,1];if(!t)return null;const n=t.match(/^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/);if(n){const t=parseFloat(n[4]);return e[0]=(parseFloat(n[1])%360+360)%360,e[1]=Lv(parseFloat(n[2]),0,100),e[2]=Lv(parseFloat(n[3]),0,100),e[3]=Lv(isNaN(t)?1:t,0,1),e}return null},Dv.to.hex=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return"#"+Nv(i[0])+Nv(i[1])+Nv(i[2])+(i[3]<1?Nv(Math.round(255*i[3])):"")},Dv.to.rgb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return i.length<4||1===i[3]?"rgb("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+")":"rgba("+Math.round(i[0])+", "+Math.round(i[1])+", "+Math.round(i[2])+", "+i[3]+")"},Dv.to.rgb.percent=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e,r=Math.round(i[0]/255*100),s=Math.round(i[1]/255*100),o=Math.round(i[2]/255*100);return i.length<4||1===i[3]?"rgb("+r+"%, "+s+"%, "+o+"%)":"rgba("+r+"%, "+s+"%, "+o+"%, "+i[3]+")"},Dv.to.hsl=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;return i.length<4||1===i[3]?"hsl("+i[0]+", "+i[1]+"%, "+i[2]+"%)":"hsla("+i[0]+", "+i[1]+"%, "+i[2]+"%, "+i[3]+")"},Dv.to.hwb=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];const i=e;let r="";return i.length>=4&&1!==i[3]&&(r=", "+i[3]),"hwb("+i[0]+", "+i[1]+"%, "+i[2]+"%"+r+")"},Dv.to.keyword=function(t){return jv[t.slice(0,3)]};const Wv=Dv;var Fv;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Fv||(Fv={}));class Uv{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fv.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===Fv.Color1){let e=Uv.store1[t];if(e)return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n;if(e=Dv.get(t),e&&e.value){const i=e.value,r=[i[0]/255,i[1]/255,i[2]/255,i[3]];Uv.store1[t]=r,Uv.store255[t]=i,n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3]}return n}let i=Uv.store255[t];if(i)return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n;if(i=Dv.get(t),i&&i.value){const e=i.value;Uv.store1[t]=[e[0]/255,e[1]/255,e[2]/255,e[3]],Uv.store255[t]=e,n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3]}return n}static Set(t,e,n){if(e===Fv.Color1){if(Uv.store1[t])return;Uv.store1[t]=n,Uv.store255[t]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(Uv.store255[t])return;Uv.store255[t]=n,Uv.store1[t]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function zv(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?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 Hv(t,e,n,i,r){if(!t||!e)return t&&zv(t)||e&&zv(e)||!1;let s,o,a=!1,l=!1;if(Array.isArray(t)?s=t:"string"==typeof t?s=Uv.Get(t,Fv.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Uv.Get(e,Fv.Color255):l=!0,a!==l){const s=a?t:e,o=a?e:t,l=Object.assign(Object.assign({},s),{stops:s.stops.map((t=>Object.assign(Object.assign({},t),{color:zv(o)})))});return a?Hv(s,l,n,i,r):Hv(l,s,n,i,r)}if(a){if(t.gradient===e.gradient){const i=t,r=e,s=i.stops,o=r.stops;if(s.length!==o.length)return!1;if("linear"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:Xv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("radial"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:Xv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n);if("conical"===i.gradient)return function(t,e,n){const i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map(((t,e)=>({color:Xv(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n})))}}(i,r,n)}return!1}return r&&r(s,o),zv(function(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}(s,o,n),i)}Uv.store255={},Uv.store1={};const Vv=[0,0,0,0],Gv=[0,0,0,0];function Xv(t,e,n){return Uv.Get(t,Fv.Color255,Vv),Uv.Get(e,Fv.Color255,Gv),`rgba(${Math.round(Vv[0]+(Gv[0]-Vv[0])*n)},${Math.round(Vv[1]+(Gv[1]-Vv[1])*n)},${Math.round(Vv[2]+(Gv[2]-Vv[2])*n)},${Vv[3]+(Gv[3]-Vv[3])*n})`}class Yv{static GetImage(t,e){var n;let i=Yv.cache.get(t);i?"fail"===i.loadState?Gg.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&Gg.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Yv.cache.set(t,i),i.dataPromise=Gg.global.loadImage(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetSvg(t,e){var n;let i=Yv.cache.get(t);i?"fail"===i.loadState?Gg.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===i.loadState||"loading"===i.loadState?null===(n=i.waitingMark)||void 0===n||n.push(e):e&&Gg.global.getRequestAnimationFrame()((()=>{e.imageLoadSuccess(t,i.data)})):(i={type:"image",loadState:"init"},Yv.cache.set(t,i),i.dataPromise=Gg.global.loadSvg(t),i.dataPromise?(i.waitingMark=[e],i.dataPromise.then((e=>{var n;i.loadState=(null==e?void 0:e.data)?"success":"fail",i.data=null==e?void 0:e.data,null===(n=i.waitingMark)||void 0===n||n.map(((n,r)=>{(null==e?void 0:e.data)?(i.loadState="success",i.data=e.data,n.imageLoadSuccess(t,e.data)):(i.loadState="fail",n.imageLoadFail(t))}))}))):(i.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let n=Yv.cache.get(t);return n?"init"===n.loadState||"fail"===n.loadState?Promise.reject():"loading"===n.loadState?n.dataPromise.then((t=>t.data)):Promise.resolve(n.data):(n={type:e,loadState:"init"},Yv.cache.set(t,n),"arrayBuffer"===e?n.dataPromise=Gg.global.loadArrayBuffer(t):"blob"===e?n.dataPromise=Gg.global.loadBlob(t):"json"===e&&(n.dataPromise=Gg.global.loadJson(t)),n.dataPromise.then((t=>t.data)))}}Yv.cache=new Map;const qv=new V,$v=["lineWidth","lineCap","lineJoin","miterLimit","scaleX","scaleY","angle","anchor"],Kv=["x","y"],Zv=["scaleX","scaleY"],Jv=["angle"],Qv=new L;class tm extends nv{static mixin(t){const e=Object.keys(t);for(let n=0;n<e.length;++n){const i=e[n];Object.defineProperty(tm.prototype,i,Object.getOwnPropertyDescriptor(t,i))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._AABBBounds=new U,this._updateTag=Mp.INIT,this.attribute=t,this.valid=this.isValid(),t.background&&this.loadImage(t.background,!0)}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];const{dx:n=t.dx,dy:i=t.dy}=this.attribute;if(e&&this.parent){const t=Qy(this.parent).group,{scrollX:e=t.scrollX,scrollY:r=t.scrollY}=this.parent.attribute;Qv.x=n+e,Qv.y=i+r}else Qv.x=n,Qv.y=i;return Qv}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Gg.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Gg.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this.AABBBounds.clone(),this.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 V),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Mp.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Mp.UPDATE_BOUNDS)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Mp.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Mp.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Mp.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&Mp.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Mp.CLEAR_SHAPE}containsPoint(t,e,n,i){if(!i)return!1;if(n===Ep.GLOBAL){const n=new L(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),t=n.x,e=n.y}return i.containsPoint(this,{x:t,y:e})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,n)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;const i=Object.keys(t);for(let e=0;e<i.length;e++){const n=i[e];this.attribute[n]=t[n]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}setAttribute(t,e,n,i){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,i);s?this._setAttributes(s,n,i):l(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t&&this.loadImage(e,!0)}needUpdateTags(t){for(let e=0;e<$v.length;e++){const n=$v[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<$v.length;e++)if(t===$v[e])return!0;return!1}initAttributes(t){const e={type:kp.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=Mp.INIT,this.onAttributeUpdate(e)}translate(t,e){var n,i;if(0===t&&0===e)return this;const r={type:kp.TRANSLATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Kv,r);s&&(t=s.x,e=s.y,delete s.x,delete s.y,this._setAttributes(s));const o=this.attribute,a=o.postMatrix;return a?Gg.transformUtil.fromMatrix(a,a).translate(t,e):(o.x=(null!==(n=o.x)&&void 0!==n?n:Sg.x)+t,o.y=(null!==(i=o.y)&&void 0!==i?i:Sg.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}translateTo(t,e){const n=this.attribute;if(n.x===t&&n.y===e)return this;const i={type:kp.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Kv,i);return r?(this._setAttributes(r,!1,i),this):(n.x=t,n.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}scale(t,e,n){var i,r;if(1===t&&1===e)return this;const s={type:kp.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:n},this.attribute,Zv,s);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const a=this.attribute;if(n){let{postMatrix:i}=this.attribute;i||(i=new V,a.postMatrix=i),Gg.transformUtil.fromMatrix(i,i).scale(t,e,n)}else a.scaleX=(null!==(i=a.scaleX)&&void 0!==i?i:Sg.scaleX)*t,a.scaleY=(null!==(r=a.scaleY)&&void 0!==r?r:Sg.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}scaleTo(t,e){const n=this.attribute;if(n.scaleX===t&&n.scaleY===e)return this;const i={type:kp.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Zv,i);return r?(this._setAttributes(r,!1,i),this):(n.scaleX=t,n.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}rotate(t,e){var n;if(0===t)return this;const i={type:kp.ROTATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Jv,i);r&&(delete r.angle,this._setAttributes(r,!1,i));const s=this.attribute;if(e){let{postMatrix:n}=this.attribute;n||(n=new V,s.postMatrix=n),Gg.transformUtil.fromMatrix(n,n).rotate(t,e)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:Sg.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const n={type:kp.ROTATE_TO},i=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Jv,n);return i?(this._setAttributes(i,!1,n),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new yv(null==t?void 0:t.id).bind(this);if(t){const{onStart:n,onFrame:i,onEnd:r,onRemove:s}=t;null!=n&&e.onStart(n),null!=i&&e.onFrame(i),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){Gg.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)&&(!!l(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,n,i){var r,s,o,a;if(n){const n=Object.keys(t),l=i?n.reduce(((e,n)=>(e[n]=void 0===t[n]?this.getDefaultAttribute(n):t[n],e)),{}):t,h=this.animate();h.stateNames=e,h.to(l,null!==(s=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==s?s:bv,null!==(a=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==a?a:xv)}else this.setAttributes(t,!1,{type:kp.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}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((n=>{if(n.stateNames){const i=n.getEndProps();y(i,t)&&(e=i[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs&&this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0),this.normalAttrs=null,this.currentStates=[]}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const n=this.currentStates.filter((e=>e!==t));this.useStates(n,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}addState(t,e,n){var i;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}useStates(t,e){var n;if(!t.length)return void this.clearStates(e);if((null===(n=this.currentStates)||void 0===n?void 0:n.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const i={};t.forEach((e=>{var n;const r=this.stateProxy?this.stateProxy(e,t):null===(n=this.states)||void 0===n?void 0:n[e];r&&Object.assign(i,r)})),this.updateNormalAttrs(i),this.currentStates=t,this.applyStateAttrs(i,t,e)}addUpdateBoundTag(){this._updateTag|=Mp.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Mp.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Mp.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Mp.UPDATE_SHAPE_AND_BOUNDS)===Mp.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Mp.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Mp.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Mp.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Mp.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Mp.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Mp.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Mp.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Mp.UPDATE_LAYOUT)}doUpdateLocalMatrix(){const{x:t=Sg.x,y:e=Sg.y,scaleX:n=Sg.scaleX,scaleY:i=Sg.scaleY,angle:r=Sg.angle,anchor:s,postMatrix:o}=this.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=this.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=this.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}!function(t,e,n,i,r,s,o,a){const l=e.a,h=e.b,c=e.c,u=e.d,d=e.e,f=e.f,p=P(o),g=M(o);let y,v;a?(y=a[0],v=a[1]):(y=n,v=i);const m=y-n,b=v-i,x=l*p+c*g,w=h*p+u*g,S=c*p-l*g,A=u*p-h*g;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=d+l*y+c*v-x*m-S*b,t.f=f+h*y+u*v-w*m-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,n,i,r,s&&a);const l=this.getOffsetXY(Sg);if(this._transMatrix.e+=l.x,this._transMatrix.f+=l.y,o){const t=qv.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Gg.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:kp.ANIMATE_END})}onStep(t,e,n,i,r){const s={};if(n.customAnimate)n.customAnimate.update(r,i,s);else{const o=n.props,a=n.parsedProps,l=n.propKeys;this.stepInterpolate(t,e,s,n,i,r,o,void 0,a,l)}this.setAttributes(s,!1,{type:kp.ANIMATE_UPDATE,animationState:{ratio:i,end:r,step:n,isFirstFrameOfStep:t.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,n,i,r,s,o,a,l,h){h||(h=Object.keys(o),i.propKeys=h),s?i.propKeys.forEach((t=>{e.validAttr(t)&&(n[t]=o[t])})):h.forEach((s=>{var h;if(!e.validAttr(s))return;const c=o[s],u=null!==(h=a&&a[s])&&void 0!==h?h:t.getLastPropByName(s,i);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,n),d||(d=e.customInterpolate(s,r,u,c,this,n),d||this.defaultInterpolate(c,u,s,n,l,r)||this._interpolate(s,r,u,c,n))})),i.parsedProps=l}defaultInterpolate(t,e,n,i,r,s){if(Number.isFinite(t))return i[n]=e+(t-e)*s,!0;if("fill"===n){r||(r={});const o=r.fillColorArray,a=Hv(e,null!=o?o:t,s,!1,((t,e)=>{r.fillColorArray=e}));return a&&(i[n]=a),!0}if("stroke"===n){r||(r={});const o=r.strokeColorArray,a=Hv(e,null!=o?o:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return a&&(i[n]=a),!0}if("shadowColor"===n){r||(r={});const o=r.shadowColorArray,a=Hv(e,null!=o?o:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return a&&(i[n]=a),!0}return!1}_interpolate(t,e,n,i,r){}getDefaultAttribute(t){return Qy(this)[this.type][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:Gg.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 u(t,!0)?this.pathProxy=(new bg).fromString(t):this.pathProxy=new bg,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const n=t;this.resources||(this.resources=new Map);const i={data:"init",state:null};var r;this.resources.set(n,i),"string"==typeof t?(i.state="loading",r=t,new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(r)||(t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t))(t)?(Yv.GetImage(t,this),this.backgroundImg=this.backgroundImg||e):t.startsWith("<svg")&&(Yv.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e)):(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e)}imageLoadSuccess(t,e,n){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released"}_emitCustomEvent(t,e){var n,i;if(this._events&&t in this._events){const r=new ov(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}tm.mixin(av);var em={},nm={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+e+"]["+(e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",i=new RegExp("^"+n+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,n){if(e){const i=Object.keys(e),r=i.length;for(let s=0;s<r;s++)t[i[s]]="strict"===n?[e[i[s]]]:e[i[s]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){const e=i.exec(t);return!(null==e)},t.getAllMatches=function(t,e){const n=[];let i=e.exec(t);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let t=0;t<s;t++)r.push(i[t]);n.push(r),i=e.exec(t)}return n},t.nameRegexp=n}(nm);const im=nm,rm={allowBooleanAttributes:!1,unpairedTags:[]};function sm(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function om(t,e){const n=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const i=t.substr(n,e-n);if(e>5&&"xml"===i)return pm("InvalidXml","XML declaration allowed only at the start of the document.",ym(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function am(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e<t.length;e++)if("<"===t[e])n++;else if(">"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}em.validate=function(t,e){e=Object.assign({},rm,e);const n=[];let i=!1,r=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=om(t,o),o.err)return o}else{if("<"!==t[o]){if(sm(t[o]))continue;return pm("InvalidChar","char '"+t[o]+"' is not expected.",ym(t,o))}{let a=o;if(o++,"!"===t[o]){o=am(t,o);continue}{let l=!1;"/"===t[o]&&(l=!0,o++);let h="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)h+=t[o];if(h=h.trim(),"/"===h[h.length-1]&&(h=h.substring(0,h.length-1),o--),s=h,!im.isName(s)){let e;return e=0===h.trim().length?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",pm("InvalidTag",e,ym(t,o))}const c=cm(t,o);if(!1===c)return pm("InvalidAttr","Attributes for '"+h+"' have open quote.",ym(t,o));let u=c.value;if(o=c.index,"/"===u[u.length-1]){const n=o-u.length;u=u.substring(0,u.length-1);const r=dm(u,e);if(!0!==r)return pm(r.err.code,r.err.msg,ym(t,n+r.err.line));i=!0}else if(l){if(!c.tagClosed)return pm("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",ym(t,o));if(u.trim().length>0)return pm("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",ym(t,a));{const e=n.pop();if(h!==e.tagName){let n=ym(t,e.tagStartPos);return pm("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+h+"'.",ym(t,a))}0==n.length&&(r=!0)}}else{const s=dm(u,e);if(!0!==s)return pm(s.err.code,s.err.msg,ym(t,o-u.length+s.err.line));if(!0===r)return pm("InvalidXml","Multiple possible root nodes found.",ym(t,o));-1!==e.unpairedTags.indexOf(h)||n.push({tagName:h,tagStartPos:a}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=am(t,o);continue}if("?"!==t[o+1])break;if(o=om(t,++o),o.err)return o}else if("&"===t[o]){const e=fm(t,o);if(-1==e)return pm("InvalidChar","char '&' is not expected.",ym(t,o));o=e}else if(!0===r&&!sm(t[o]))return pm("InvalidXml","Extra text at the end",ym(t,o));"<"===t[o]&&o--}}}var s;return i?1==n.length?pm("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",ym(t,n[0].tagStartPos)):!(n.length>0)||pm("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):pm("InvalidXml","Start tag expected.",1)};const lm='"',hm="'";function cm(t,e){let n="",i="",r=!1;for(;e<t.length;e++){if(t[e]===lm||t[e]===hm)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){r=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:r}}const um=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function dm(t,e){const n=im.getAllMatches(t,um),i={};for(let t=0;t<n.length;t++){if(0===n[t][1].length)return pm("InvalidAttr","Attribute '"+n[t][2]+"' has no space in starting.",vm(n[t]));if(void 0!==n[t][3]&&void 0===n[t][4])return pm("InvalidAttr","Attribute '"+n[t][2]+"' is without value.",vm(n[t]));if(void 0===n[t][3]&&!e.allowBooleanAttributes)return pm("InvalidAttr","boolean attribute '"+n[t][2]+"' is not allowed.",vm(n[t]));const r=n[t][2];if(!gm(r))return pm("InvalidAttr","Attribute '"+r+"' is an invalid name.",vm(n[t]));if(i.hasOwnProperty(r))return pm("InvalidAttr","Attribute '"+r+"' is repeated.",vm(n[t]));i[r]=1}return!0}function fm(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let n=/\d/;for("x"===t[e]&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(n))break}return-1}(t,++e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(";"===t[e])break;return-1}return e}function pm(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function gm(t){return im.isName(t)}function ym(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function vm(t){return t.startIndex+t[1].length}var mm={};const bm={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}};mm.buildOptions=function(t){return Object.assign({},bm,t)},mm.defaultOptions=bm;var xm=class{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})}};const wm=nm;function Sm(t,e){let n="";for(;e<t.length&&"'"!==t[e]&&'"'!==t[e];e++)n+=t[e];if(n=n.trim(),-1!==n.indexOf(" "))throw new Error("External entites are not supported");const i=t[e++];let r="";for(;e<t.length&&t[e]!==i;e++)r+=t[e];return[n,r,e]}function Am(t,e){return"!"===t[e+1]&&"-"===t[e+2]&&"-"===t[e+3]}function _m(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"N"===t[e+3]&&"T"===t[e+4]&&"I"===t[e+5]&&"T"===t[e+6]&&"Y"===t[e+7]}function Bm(t,e){return"!"===t[e+1]&&"E"===t[e+2]&&"L"===t[e+3]&&"E"===t[e+4]&&"M"===t[e+5]&&"E"===t[e+6]&&"N"===t[e+7]&&"T"===t[e+8]}function Tm(t,e){return"!"===t[e+1]&&"A"===t[e+2]&&"T"===t[e+3]&&"T"===t[e+4]&&"L"===t[e+5]&&"I"===t[e+6]&&"S"===t[e+7]&&"T"===t[e+8]}function Cm(t,e){return"!"===t[e+1]&&"N"===t[e+2]&&"O"===t[e+3]&&"T"===t[e+4]&&"A"===t[e+5]&&"T"===t[e+6]&&"I"===t[e+7]&&"O"===t[e+8]&&"N"===t[e+9]}function Pm(t){if(wm.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}var Rm=function(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,r=!1,s=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?r=!0:o+=t[e];else{if(r&&_m(t,e))e+=7,[entityName,val,e]=Sm(t,e+1),-1===val.indexOf("&")&&(n[Pm(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(r&&Bm(t,e))e+=8;else if(r&&Tm(t,e))e+=8;else if(r&&Cm(t,e))e+=9;else{if(!Am)throw new Error("Invalid DOCTYPE");s=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}};const Om=/^[-+]?0x[a-fA-F0-9]+$/,Mm=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const Em={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};var km=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e=Object.assign({},Em,e),!t||"string"!=typeof t)return t;let n=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(n))return t;if(e.hex&&Om.test(n))return Number.parseInt(n,16);{const i=Mm.exec(n);if(i){const r=i[1],s=i[2];let o=function(t){if(t&&-1!==t.indexOf("."))return"."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t;return t}(i[3]);const a=i[4]||i[6];if(!e.leadingZeros&&s.length>0&&r&&"."!==n[2])return t;if(!e.leadingZeros&&s.length>0&&!r&&"."!==n[1])return t;{const i=Number(n),l=""+i;return-1!==l.search(/[eE]/)||a?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===l&&""===o||l===o||r&&l==="-"+o?i:t:s?o===l||r+o===l?i:t:n===l||n===r+l?i:t}}return t}};const Im=nm,jm=xm,Dm=Rm,Lm=km;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Im.nameRegexp);function Nm(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const i=e[n];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function Wm(t,e,n,i,r,s,o){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,r,s);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return Zm(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?Zm(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function Fm(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const Um=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function zm(t,e,n){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=Im.getAllMatches(t,Um),i=n.length,r={};for(let t=0;t<i;t++){const i=this.resolveNameSpace(n[t][1]);let s=n[t][4],o=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(i,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:Zm(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const Hm=function(t){t=t.replace(/\r\n?/g,"\n");const e=new jm("!xml");let n=e,i="",r="";for(let s=0;s<t.length;s++){if("<"===t[s])if("/"===t[s+1]){const e=qm(t,">",s,"Closing Tag is not closed.");let o=t.substring(s+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,r));const a=r.substring(r.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=r.lastIndexOf("."),r=r.substring(0,l),n=this.tagsNodeStack.pop(),i="",s=e}else if("?"===t[s+1]){let e=$m(t,s,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,r),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new jm(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,r,e.tagName)),this.addChild(n,t,r)}s=e.closeIndex+1}else if("!--"===t.substr(s+1,3)){const e=qm(t,"--\x3e",s+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(s+4,e-2);i=this.saveTextToParentTag(i,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}s=e}else if("!D"===t.substr(s+1,2)){const e=Dm(t,s);this.docTypeEntities=e.entities,s=e.i}else if("!["===t.substr(s+1,2)){const e=qm(t,"]]>",s,"CDATA is not closed.")-2,o=t.substring(s+9,e);if(i=this.saveTextToParentTag(i,n,r),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let t=this.parseTextData(o,n.tagname,r,!0,!1,!0);null==t&&(t=""),n.add(this.options.textNodeName,t)}s=e+2}else{let o=$m(t,s,this.options.removeNSPrefix),a=o.tagName,l=o.tagExp,h=o.attrExpPresent,c=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,r,!1));const u=n;if(u&&-1!==this.options.unpairedTags.indexOf(u.tagname)&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),a!==e.tagname&&(r+=r?"."+a:a),this.isItStopNode(this.options.stopNodes,r,a)){let e="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)s=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))s=o.closeIndex;else{const n=this.readStopNodeData(t,a,c+1);if(!n)throw new Error(`Unexpected end of ${a}`);s=n.i,e=n.tagContent}const i=new jm(a);a!==l&&h&&(i[":@"]=this.buildAttributesMap(l,r,a)),e&&(e=this.parseTextData(e,a,r,!0,h,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,r)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),r=r.substr(0,r.length-1),l=a):l=l.substr(0,l.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const t=new jm(a);a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(n,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new jm(a);this.tagsNodeStack.push(n),a!==l&&h&&(t[":@"]=this.buildAttributesMap(l,r,a)),this.addChild(n,t,r),n=t}i="",s=c}}else i+=t[s]}return e.child};function Vm(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const Gm=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function Xm(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Ym(t,e,n){const i="*."+n;for(const n in t){const r=t[n];if(i===r||e===r)return!0}return!1}function qm(t,e,n,i){const r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function $m(t,e,n){const i=function(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:r,index:s};if(t[s+1]===i[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!i)return;let r=i.data;const s=i.index,o=r.search(/\s/);let a=r,l=!0;if(-1!==o&&(a=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1)),n){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),l=a!==i.data.substr(t+1))}return{tagName:a,tagExp:r,closeIndex:s,attrExpPresent:l}}function Km(t,e,n){const i=n;let r=1;for(;n<t.length;n++)if("<"===t[n])if("/"===t[n+1]){const s=qm(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(r--,0===r))return{tagContent:t.substring(i,n),i:s};n=s}else if("?"===t[n+1]){n=qm(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=qm(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=qm(t,"]]>",n,"StopNode is not closed.")-2}else{const i=$m(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&r++,n=i.closeIndex}}}function Zm(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&Lm(t,n)}return Im.isExist(t)?t:""}var Jm=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=Nm,this.parseXml=Hm,this.parseTextData=Wm,this.resolveNameSpace=Fm,this.buildAttributesMap=zm,this.isItStopNode=Ym,this.replaceEntitiesValue=Gm,this.readStopNodeData=Km,this.saveTextToParentTag=Xm,this.addChild=Vm}},Qm={};function tb(t,e,n){let i;const r={};for(let s=0;s<t.length;s++){const o=t[s],a=eb(o);let l="";if(l=void 0===n?a:n+"."+a,a===e.textNodeName)void 0===i?i=o[a]:i+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=tb(o[a],e,l);const n=ib(t,e);o[":@"]?nb(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==r[a]&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(t)):e.isArray(a,l,n)?r[a]=[t]:r[a]=t}}}return"string"==typeof i?i.length>0&&(r[e.textNodeName]=i):void 0!==i&&(r[e.textNodeName]=i),r}function eb(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function nb(t,e,n,i){if(e){const r=Object.keys(e),s=r.length;for(let o=0;o<s;o++){const s=r[o];i.isArray(s,n+"."+s,!0,!0)?t[s]=[e[s]]:t[s]=e[s]}}}function ib(t,e){const{textNodeName:n}=e,i=Object.keys(t).length;return 0===i||!(1!==i||!t[n]&&"boolean"!=typeof t[n]&&0!==t[n])}Qm.prettify=function(t,e){return tb(t,e)};const{buildOptions:rb}=mm,sb=Jm,{prettify:ob}=Qm,ab=em;var lb=class{constructor(t){this.externalEntities={},this.options=rb(t)}parse(t,e){if("string"==typeof t);else{if(!t.toString)throw new Error("XML data is accepted in String or Bytes[] form.");t=t.toString()}if(e){!0===e&&(e={});const n=ab.validate(t,e);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}const n=new sb(this.options);n.addExternalEntities(this.externalEntities);const i=n.parseXml(t);return this.options.preserveOrder||void 0===i?i:ob(i,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}};function hb(t,e,n,i){let r="",s=!1;for(let o=0;o<t.length;o++){const a=t[o],l=cb(a);let h="";if(h=0===n.length?l:`${n}.${l}`,l===e.textNodeName){let t=a[l];db(h,e)||(t=e.tagValueProcessor(l,t),t=fb(t,e)),s&&(r+=i),r+=t,s=!1;continue}if(l===e.cdataPropName){s&&(r+=i),r+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,s=!1;continue}if(l===e.commentPropName){r+=i+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const t=ub(a[":@"],e),n="?xml"===l?"":i;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",r+=n+`<${l}${o}${t}?>`,s=!0;continue}let c=i;""!==c&&(c+=e.indentBy);const u=i+`<${l}${ub(a[":@"],e)}`,d=hb(a[l],e,h,c);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?r+=u+">":r+=u+"/>":d&&0!==d.length||!e.suppressEmptyNode?d&&d.endsWith(">")?r+=u+`>${d}${i}</${l}>`:(r+=u+">",d&&""!==i&&(d.includes("/>")||d.includes("</"))?r+=i+e.indentBy+d+i:r+=d,r+=`</${l}>`):r+=u+"/>",s=!0}return r}function cb(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const n=e[t];if(":@"!==n)return n}}function ub(t,e){let n="";if(t&&!e.ignoreAttributes)for(let i in t){let r=e.attributeValueProcessor(i,t[i]);r=fb(r,e),!0===r&&e.suppressBooleanAttributes?n+=` ${i.substr(e.attributeNamePrefix.length)}`:n+=` ${i.substr(e.attributeNamePrefix.length)}="${r}"`}return n}function db(t,e){let n=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+n)return!0;return!1}function fb(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const i=e.entities[n];t=t.replace(i.regex,i.val)}return t}const pb=function(t,e){let n="";return e.format&&e.indentBy.length>0&&(n="\n"),hb(t,e,"",n)},gb={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function yb(t){this.options=Object.assign({},gb,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=bb),this.processTextOrObjNode=vb,this.options.format?(this.indentate=mb,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function vb(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function mb(t){return this.options.indentBy.repeat(t)}function bb(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}yb.prototype.build=function(t){return this.options.preserveOrder?pb(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},yb.prototype.j2x=function(t,e){let n="",i="";for(let r in t)if(void 0===t[r])this.isAttribute(r)&&(i+="");else if(null===t[r])this.isAttribute(r)?i+="":"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar;else if(t[r]instanceof Date)i+=this.buildTextValNode(t[r],r,"",e);else if("object"!=typeof t[r]){const s=this.isAttribute(r);if(s)n+=this.buildAttrPairStr(s,""+t[r]);else if(r===this.options.textNodeName){let e=this.options.tagValueProcessor(r,""+t[r]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[r],r,"",e)}else if(Array.isArray(t[r])){const n=t[r].length;let s="";for(let o=0;o<n;o++){const n=t[r][o];void 0===n||(null===n?"?"===r[0]?i+=this.indentate(e)+"<"+r+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+r+"/"+this.tagEndChar:"object"==typeof n?this.options.oneListGroup?s+=this.j2x(n,e+1).val:s+=this.processTextOrObjNode(n,r,e):s+=this.buildTextValNode(n,r,"",e))}this.options.oneListGroup&&(s=this.buildObjectNode(s,r,"",e)),i+=s}else if(this.options.attributesGroupName&&r===this.options.attributesGroupName){const e=Object.keys(t[r]),i=e.length;for(let s=0;s<i;s++)n+=this.buildAttrPairStr(e[s],""+t[r][e[s]])}else i+=this.processTextOrObjNode(t[r],r,e);return{attrStr:n,val:i}},yb.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},yb.prototype.buildObjectNode=function(t,e,n,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+n+"?"+this.tagEndChar:this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let r="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",r=""),!n&&""!==n||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+s+this.tagEndChar+t+this.indentate(i)+r:this.indentate(i)+"<"+e+n+s+">"+t+r}},yb.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},yb.prototype.buildTextValNode=function(t,e,n,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(e,t);return r=this.replaceEntitiesValue(r),""===r?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+r+"</"+e+this.tagEndChar}},yb.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};var xb={XMLParser:lb,XMLValidator:em,XMLBuilder:yb};function wb(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}let Sb=0;function Ab(){return Sb++}var _b;function Bb(t){const e=[];let n=0,i="";for(let r=0;r<t.length;r++)Pb(t[r])?n?i+=t[r]:(n=1,i=t[r]):(n&&(e.push({text:i,direction:_b.VERTICAL}),i="",n=0),e.push({text:t[r],direction:_b.HORIZONTAL}));return i&&e.push({text:i,direction:_b.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(_b||(_b={}));const Tb=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Tb.set(t,!0)));const Cb=new Map;function Pb(t){if(Tb.has(t))return!0;if(Cb.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Cb.set(t,!0)));const Rb=Ab(),Ob=Ab(),Mb=Ab(),Eb=Ab(),kb=Ab(),Ib=Ab(),jb=Ab(),Db=Ab(),Lb=Ab(),Nb=Ab(),Wb=Ab(),Fb=Ab(),Ub=Ab(),zb=Ab(),Hb=Ab(),Vb=Ab(),Gb=Symbol.for("GraphicService"),Xb=Symbol.for("GraphicCreator"),Yb={"@_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"},qb=Object.keys(Yb);var $b;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}($b||($b={}));class Kb extends tm{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Ib,this._childUpdateTag=Mp.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 Zy),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Zy)}hideAll(){this.setAttribute("visible",!1),this.forEachChildren((t=>{t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}showAll(){this.setAttribute("visible",!0),this.forEachChildren((t=>{t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}containsPoint(t,e,n){if(n===Ep.GLOBAL){const n=new L(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(n,n),this.AABBBounds.contains(n.x,n.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&Mp.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Gg.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Gg.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateAABBBounds(){const t=this.attribute,e=Qy(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=Gg.graphicService.updateGroupAABBBounds(t,Qy(this).group,this._AABBBounds,this),{boundsPadding:i=e.boundsPadding}=t,r=_v(i);return r&&n.expand(r),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),n}clearUpdateBoundTag(){this._updateTag&=Mp.CLEAR_BOUNDS,this._childUpdateTag&=Mp.CLEAR_BOUNDS}tryUpdateOBBBounds(){throw new Error("暂不支持")}addUpdateBoundTag(){this._updateTag|=Mp.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&Mp.UPDATE_BOUNDS||(this._childUpdateTag|=Mp.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(),Gg.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Gg.graphicService.onClearIncremental(this,this.stage)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=super.appendChild(t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertBefore(t,e){const n=super.insertBefore(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertAfter(t,e){const n=super.insertAfter(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}insertInto(t,e){const n=super.insertInto(t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}removeChild(t){const e=super.removeChild(t);return t.stage=null,Gg.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){this.forEachChildren((t=>{Gg.graphicService.onRemove(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),Gg.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&Mp.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,n){let i=this._getChildByName(t);return i?i.setAttributes(e):(i=Gg.graphicService.creator[n](e),i.name=t,this.add(i)),i}clone(){return new Kb(Object.assign({},this.attribute))}}const Zb=Symbol.for("LayerHandlerContribution");class Jb extends Kb{get offscreen(){return this.layerHandler.offscreen}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,n,i){var r;super({}),this.stage=t,this.global=e,this.window=n,this.main=i.main,this.layerHandler=oy.get(Zb),this.layerHandler.init(this,n,{main:i.main,canvasId:i.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=i.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Zy,this.background="rgba(0, 0, 0, 0)",this.virtual=!!i.virtual,this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{Gg.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}render(t,e){var n;const i=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:i.x,y:i.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(n=t.background)&&void 0!==n?n:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this)))}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}combineTo(t,e){var n,i,r;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:null!==(i=e.x)&&void 0!==i?i:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this))))}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{Gg.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var n,i,r;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,x:null!==(i=e.x)&&void 0!==i?i:this.stage.x,y:null!==(r=e.y)&&void 0!==r?r:this.stage.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}var Qb=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},tx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ex=function(t,e){return function(n,i){e(n,i,t)}};let nx=class{constructor(t){this.global=t,this.layerMap=new Map}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();const n=new Jb(t,this.global,t.window,Object.assign(Object.assign({},e),{virtual:0===this.staticLayerCountInEnv})),i=this.layerMap.get(t)||[];return i.push(n),this.layerMap.set(t,i),this.staticLayerCountInEnv--,n}releaseLayer(t,e){e.release();const n=this.layerMap.get(t)||[];this.layerMap.set(t,n.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}};nx=Qb([tp(),ex(0,ip(pp)),tx("design:paramtypes",[Object])],nx);var ix=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},rx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sx=function(t,e){return function(n,i){e(n,i,t)}};const ox=Symbol.for("VWindow"),ax=Symbol.for("WindowHandlerContribution");let lx=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(t){this.global=t,this.hooks={onChange:new dp(["x","y","width","height"])},this._uid=tv.GenAutoIncrementId()}postInit(){this.global.hooks.onSetEnv.tap("window",(()=>{this.active()})),this.active()}active(){const t=this.global;t.env&&!this.actived&&(oy.getNamed(ax,t.env).configure(this,t),this.actived=!0,this._handler)}get style(){return this._handler.getStyle()}set style(t){this._handler.setStyle(t)}create(t){this._handler.createWindow(t);const e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,n){return this._handler.addEventListener(t,e,n)}removeEventListener(t,e,n){return this._handler.removeEventListener(t,e,n)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t,e){this._handler.clearViewBox(t,e)}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};ix([ap(),rx("design:type",Function),rx("design:paramtypes",[]),rx("design:returntype",void 0)],lx.prototype,"postInit",null),lx=ix([tp(),sx(0,ip(pp)),rx("design:paramtypes",[Object])],lx);const hx=Symbol.for("TransformUtil"),cx=Symbol.for("GraphicUtil"),ux=Symbol.for("LayerService");var dx=new $f((t=>{t(mp).toSelf().inSingletonScope(),t(pp).toService(mp),t(lx).to(lx),t(ox).toService(lx),t(zy).toSelf().inSingletonScope(),t(cx).toService(zy),t(Gy).toSelf().inSingletonScope(),t(hx).toService(Gy),t(nx).toSelf().inSingletonScope(),t(ux).toService(nx)}));function fx(t,e){return!(!t&&!e)}function px(t,e){let n;return n=d(t)?t.some((t=>t||void 0===t)):!!t,n&&e>0}function gx(t,e,n){return n&&t*e>0}function yx(t,e,n,i,r){return r&&t*e>0&&n>0&&i>0}function vx(t,e){return t*e>0}function mx(t,e,n,i){return t*e>0&&n>0&&i>0}function bx(t,e,n,i,r,s,o,a){if(!t.pathProxy)return!1;const l=Qy(t,null==s?void 0:s.theme)[t.type],{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,lineWidth:f=l.lineWidth,strokeOpacity:p=l.strokeOpacity,visible:g=l.visible}=t.attribute,y=gx(u,d,h),v=vx(u,p),m=fx(h),b=px(c,f);if(!g)return!0;if(!m&&!b)return!0;if(!(y||v||o||a))return!0;e.beginPath();return Hp(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),b&&(a?a(e,t.attribute,l):v&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),m&&(o?o(e,t.attribute,l):y&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),!0}function xx(t,e,n,i,r,s,o,a){const l=n-t,h=i-e,c=o-r,u=a-s;let d=u*l-c*h;return d*d<w?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*l,e+d*h])}function Sx(t,e,n,i,r,s,o){const a=t-n,l=e-i,h=(o?s:-s)/Math.sqrt(a*a+l*l),c=h*l,u=-h*a,d=t+c,f=e+u,p=n+c,g=i+u,y=(d+p)/2,v=(f+g)/2,m=p-d,b=g-f,x=m*m+b*b,w=r-s,S=d*g-p*f,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let _=(S*b-m*A)/x,B=(-S*m-b*A)/x;const T=(S*b+m*A)/x,C=(-S*m+b*A)/x,P=_-y,R=B-v,O=T-y,M=C-v;return P*P+R*R>O*O+M*M&&(_=T,B=C),{cx:_,cy:B,x01:-c,y01:-u,x11:_*(r/w-1),y11:B*(r/w-1)}}function Ax(t,e,n,i,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=T(l-a),c=l>a;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=w)e.moveTo(n,i);else if(h>=B-w)e.moveTo(n+r*P(a),i+r*M(a)),e.arc(n,i,r,a,l,!c),s>w&&(e.moveTo(n+s*P(l),i+s*M(l)),e.arc(n,i,s,l,a,c));else{const d=t.getParsedCornerRadius(),{outerDeltaAngle:f,innerDeltaAngle:p,outerStartAngle:g,outerEndAngle:y,innerEndAngle:v,innerStartAngle:m}=t.getParsePadAngle(a,l),b=d,x=d,A=d,_=d,B=Math.max(x,b),T=Math.max(A,_);let R=B,k=T;const j=r*P(g),D=r*M(g),L=s*P(v),N=s*M(v);let W,F,U,z;if((T>w||B>w)&&(W=r*P(y),F=r*M(y),U=s*P(m),z=s*M(m),h<S)){const t=xx(j,D,U,z,W,F,L,N);if(t){const e=j-t[0],n=D-t[1],i=W-t[0],o=F-t[1],a=1/M(I((e*i+n*o)/(E(e*e+n*n)*E(i*i+o*o)))/2),l=E(t[0]*t[0]+t[1]*t[1]);k=O(T,(s-l)/(a-1)),R=O(B,(r-l)/(a+1))}}if(f<.001)o&&(o[3]||o[1])&&e.moveTo(n+j,i+D),u=!0;else if(R>w){const t=O(b,R),s=O(x,R),a=Sx(U,z,j,D,r,t,Number(c)),l=Sx(W,F,L,N,r,s,Number(c));R<B&&t===s?!o||o[0]?(e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),e.arc(n+a.cx,i+a.cy,R,C(a.y01,a.x01),C(l.y01,l.x01),!c)):e.moveTo(n+a.cx+R*P(C(l.y01,l.x01)),i+a.cy+R*M(C(l.y01,l.x01))):!o||o[0]?(e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),t>0&&e.arc(n+a.cx,i+a.cy,t,C(a.y01,a.x01),C(a.y11,a.x11),!c),e.arc(n,i,r,C(a.cy+a.y11,a.cx+a.x11),C(l.cy+l.y11,l.cx+l.x11),!c),s>0&&e.arc(n+l.cx,i+l.cy,s,C(l.y11,l.x11),C(l.y01,l.x01),!c)):s>0?e.moveTo(n+l.cx+s*P(C(l.y01,l.x01)),i+l.cy+s*M(C(l.y01,l.x01))):e.moveTo(n+W,i+r*M(y))}else o&&!o[0]||(e.moveTo(n+j,i+D),e.arc(n,i,r,g,y,!c));if(!(s>w)||p<.001)!o||o[1]?e.lineTo(n+L,i+N):e.moveTo(n+L,i+N),u=!0;else if(k>w){const t=O(_,k),r=O(A,k),a=Sx(L,N,W,F,s,-r,Number(c)),l=Sx(j,D,U,z,s,-t,Number(c));if(!o||o[1]?e.lineTo(n+a.cx+a.x01,i+a.cy+a.y01):e.moveTo(n+a.cx+a.x01,i+a.cy+a.y01),k<T&&t===r){const t=C(l.y01,l.x01);!o||o[2]?e.arc(n+a.cx,i+a.cy,k,C(a.y01,a.x01),t,!c):e.moveTo(n+a.cx+P(t),i+a.cy+M(t))}else!o||o[2]?(r>0&&e.arc(n+a.cx,i+a.cy,r,C(a.y01,a.x01),C(a.y11,a.x11),!c),e.arc(n,i,s,C(a.cy+a.y11,a.cx+a.x11),C(l.cy+l.y11,l.cx+l.x11),c),t>0&&e.arc(n+l.cx,i+l.cy,t,C(l.y11,l.x11),C(l.y01,l.x01),!c)):t>0?e.moveTo(n+l.cx+t*P(C(l.y01,l.x01)),i+l.cy+t*M(C(l.y01,l.x01))):e.moveTo(n+U,i+z)}else!o||o[1]?e.lineTo(n+L,i+N):e.moveTo(n+L,i+N),!o||o[2]?e.arc(n,i,s,v,m,c):e.moveTo(n+s*P(m),i+s*M(m))}return o?o[3]&&e.lineTo(n+r*P(l),i+r*P(l)):e.closePath(),u}class _x{static GetCanvas(){try{return _x.canvas||(_x.canvas=Gg.global.createCanvas({})),_x.canvas}catch(t){return null}}static GetCtx(){if(!_x.ctx){const t=_x.GetCanvas();_x.ctx=t.getContext("2d")}return _x.ctx}}class Bx{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;const n=_x.GetCanvas(),i=_x.GetCtx();if(n.width=e,n.height=1,!i)return;if(i.translate(0,0),!i)throw new Error("获取ctx发生错误");const r=i.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),i.fillStyle=r,i.fillRect(0,0,e,1),this.rgbaSet=i.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}static GetOrCreate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n="";t.forEach((t=>n+=t.join())),n+=e;let i=Bx.dataMap.get(n);return i||(i=new Bx(t,e),Bx.dataMap.set(n,i)),i}static SetColorInterpolateInstance(t,e){Bx.dataMap.set(t,e)}static GetColorInterpolateInstance(t){return Bx.dataMap.get(t)}}Bx.dataMap=new Map;class Tx{static GetSize(t){for(let e=0;e<Tx.ImageSize.length;e++)if(Tx.ImageSize[e]>=t)return Tx.ImageSize[e];return t}static Get(t,e,n,i,r,s,o){const a=Tx.GenKey(t,e,n,i,r),l=Tx.cache[a];if(!l||0===l.length)return null;for(let t=0;t<l.length;t++)if(l[t].width>=s&&l[t].height>=o)return l[t].pattern;return null}static Set(t,e,n,i,r,s,o,a){const l=Tx.GenKey(t,e,n,i,r);Tx.cache[l]?Tx.cache[l].push({width:o,height:a,pattern:s}):Tx.cache[l]=[{width:o,height:a,pattern:s}]}static GenKey(t,e,n,i,r){return`${e},${n},${i},${r},${t.join()}`}}Tx.cache={},Tx.ImageSize=[20,40,80,160,320,640,1280,2560];const Cx=Symbol.for("ArcRenderContribution"),Px=Symbol.for("AreaRenderContribution"),Rx=Symbol.for("CircleRenderContribution"),Ox=Symbol.for("GroupRenderContribution"),Mx=Symbol.for("ImageRenderContribution"),Ex=Symbol.for("PathRenderContribution"),kx=Symbol.for("PolygonRenderContribution"),Ix=Symbol.for("RectRenderContribution"),jx=Symbol.for("SymbolRenderContribution"),Dx=Symbol.for("TextRenderContribution"),Lx=Symbol.for("InteractiveSubRenderContribution");var Nx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Wx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fx=function(t,e){return function(n,i){e(n,i,t)}};let Ux=class{constructor(t){this.arcRenderContribitions=t,this.numberType=Rb}drawArcTailCapPath(t,e,n,i,r,s,o,a){const l=a-o,h=t.getParsedAngle(),c=h.startAngle;let u=h.endAngle;u=a;const d=T(u-c),f=u>c;let p=!1;if(r<s){const t=r;r=s,s=t}const g=t.getParsedCornerRadius(),{outerDeltaAngle:y,innerDeltaAngle:v,outerStartAngle:m,outerEndAngle:b,innerEndAngle:x,innerStartAngle:A}=t.getParsePadAngle(c,u),_=g,B=g,R=g,k=g,j=Math.max(B,_),D=Math.max(R,k);let L=j,N=D;const W=r*P(m),F=r*M(m),U=s*P(x),z=s*M(x);let H,V,G,X;if((D>w||j>w)&&(H=r*P(b),V=r*M(b),G=s*P(A),X=s*M(A),d<S)){const t=xx(W,F,G,X,H,V,U,z);if(t){const e=W-t[0],n=F-t[1],i=H-t[0],o=V-t[1],a=1/M(I((e*i+n*o)/(E(e*e+n*n)*E(i*i+o*o)))/2),l=E(t[0]*t[0]+t[1]*t[1]);N=O(D,(s-l)/(a-1)),L=O(j,(r-l)/(a+1))}}if(L>w){const t=O(_,L),s=O(B,L),o=Sx(G,X,W,F,r,t,Number(f)),a=Sx(H,V,U,z,r,s,Number(f));if(L<j&&t===s)e.moveTo(n+o.cx+o.x01,i+o.cy+o.y01),e.arc(n+o.cx,i+o.cy,L,C(o.y01,o.x01),C(a.y01,a.x01),!f);else{const t=u-l-.03,o=C(a.y11,a.x11);e.arc(n,i,r,t,o,!f),s>0&&e.arc(n+a.cx,i+a.cy,s,C(a.y11,a.x11),C(a.y01,a.x01),!f)}}else e.moveTo(n+W,i+F);if(!(s>w)||v<.001)e.lineTo(n+U,i+z),p=!0;else if(N>w){const t=O(k,N),r=O(R,N),o=Sx(U,z,H,V,s,-r,Number(f)),a=Sx(W,F,G,X,s,-t,Number(f));if(e.lineTo(n+o.cx+o.x01,i+o.cy+o.y01),N<D&&t===r){const t=C(a.y01,a.x01);e.arc(n+o.cx,i+o.cy,N,C(o.y01,o.x01),t,!f)}else{r>0&&e.arc(n+o.cx,i+o.cy,r,C(o.y01,o.x01),C(o.y11,o.x11),!f);const t=C(o.cy+o.y11,o.cx+o.x11),a=u-l-.03;e.arc(n,i,s,t,a,f)}}else e.lineTo(n+s*P(A),i+s*M(A));return p}drawShape(t,e,n,i,r,s,a,l){const h=Qy(t,null==s?void 0:s.theme).arc,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible,x:m=h.x,y:b=h.y}=t.attribute,x=gx(f,p,c),S=vx(f,y),A=fx(c,u),_=px(d,g);if(!t.valid||!v)return;if(!A&&!_)return;if(!(x||S||a||l||u))return;const{outerRadius:C=h.outerRadius,innerRadius:P=h.innerRadius,cap:R=h.cap,forceShowCap:O=h.forceShowCap}=t.attribute;let M=0;const E=(o(R)&&R||R[0])&&"conical"===c.gradient;if(E){const{sc:e,startAngle:n,endAngle:i}=t.getParsedAngle();T(i-n)<B-w&&(M=e||0,c.startAngle-=M,c.endAngle-=M)}let k=!1;const{isFullStroke:I,stroke:j}=(t=>{var e;let n=!0;if(o(t,!0)){for(let i=0;i<4;i++)Sv[i]=t,n&&(n=!(null!==(e=Sv[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Sv[e]=!!t[e],n&&(n=!!Sv[e]);else Sv[0]=!1,Sv[1]=!1,Sv[2]=!1,Sv[3]=!1;return{isFullStroke:n,stroke:Sv}})(d);if(A||I){if(e.beginPath(),Ax(t,e,n,i,C,P),!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Wp.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,_,x,S,h,r,a,l)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),A&&(a?a(e,t.attribute,h):x&&(e.setCommonStyle(t,t.attribute,m-n,b-i,h),e.fill())),_&&I&&(l?l(e,t.attribute,h):S&&(e.setStrokeStyle(t,t.attribute,m-n,b-i,h),e.stroke()))}if(!I&&_){if(e.beginPath(),Ax(t,e,n,i,C,P,j),!k){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Wp.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,_,x,S,h,r,a,l)}))}l?l(e,t.attribute,h):S&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())}if((o(R)&&R||R[1])&&O){const{startAngle:s,endAngle:o}=t.getParsedAngle();if(T(o-s)>=B-w){e.beginPath();const s=Math.abs(C-P)/2/C,{endAngle:o=h.endAngle,fill:c=h.fill}=t.attribute,u=o;if(this.drawArcTailCapPath(t,e,n,i,C,P,u,u+s),!k){if(!this._arcBeforeRenderContribitions){this._arcBeforeRenderContribitions=[],this._arcAfterRenderContribitions=[];const t=this.arcRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),t.forEach((t=>{t.time===Wp.beforeFillStroke?this._arcBeforeRenderContribitions.push(t):this._arcAfterRenderContribitions.push(t)}))}k=!0,this._arcBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,_,x,S,h,r,a,l)}))}if(A){const r=c;if("conical"===r.gradient){const s=function(t,e,n,i){const{stops:r,startAngle:s,endAngle:o}=i;for(;n<0;)n+=B;for(;n>B;)n-=B;if(n<s)return r[0].color;if(n>o)return r[0].color;let a,l,h=(n-s)/(o-s);for(let t=0;t<r.length;t++)if(r[t].offset>=h){a=r[t-1],l=r[t];break}return h=(h-a.offset)/(l.offset-a.offset),Hv(a.color,l.color,h,!1)}(0,0,o,r);a||gx&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=s,e.fill())}}_&&(l||S&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke()))}}this._arcAfterRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,A,_,x,S,h,r,a,l)})),E&&(c.startAngle+=M,c.endAngle+=M)}draw(t,e,n,i){const{context:r}=n;if(!r)return;const s=Qy(t,null==i?void 0:i.theme).arc;r.highPerformanceSave();let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);bx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};Ux=Nx([tp(),Fx(0,ip(lp)),Fx(0,ep(Cx)),Wx("design:paramtypes",[Object])],Ux);var zx=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},Hx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vx=function(t,e){return function(n,i){e(n,i,t)}};let Gx=class{constructor(t){this.circleRenderContribitions=t,this.numberType=Eb}drawShape(t,e,n,i,r,s,o,a){const l=Qy(t,null==s?void 0:s.theme).circle,{fill:h=l.fill,background:c,stroke:u=l.stroke,radius:d=l.radius,startAngle:f=l.startAngle,endAngle:p=l.endAngle,fillOpacity:g=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,opacity:v=l.opacity,lineWidth:m=l.lineWidth,visible:b=l.visible,x:x=l.x,y:w=l.y}=t.attribute,S=gx(v,g,h),A=vx(v,y),_=fx(h,c),B=px(u,m);t.valid&&b&&(_||B)&&(S||A||o||a||c)&&(e.beginPath(),e.arc(n,i,d,f,p),e.closePath(),this._circleRenderContribitions||(this._circleRenderContribitions=this.circleRenderContribitions.getContributions()||[],this._circleRenderContribitions.sort(((t,e)=>e.order-t.order))),this._circleRenderContribitions.forEach((s=>{s.time===Wp.beforeFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),_&&(o?o(e,t.attribute,l):S&&(e.setCommonStyle(t,t.attribute,x-n,w-i,l),e.fill())),B&&(a?a(e,t.attribute,l):A&&(e.setStrokeStyle(t,t.attribute,x-n,w-i,l),e.stroke())),this._circleRenderContribitions.forEach((s=>{s.time===Wp.afterFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=Qy(t,null==i?void 0:i.theme).circle;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);bx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};Gx=zx([tp(),Vx(0,ip(lp)),Vx(0,ep(Rx)),Hx("design:paramtypes",[Object])],Gx);const Xx=["radius","startAngle","endAngle",...$v];class Yx extends tm{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=Eb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)}doUpdateAABBBounds(t){const e=Qy(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Gg.graphicService.updateCircleAABBBounds(n,Qy(this).circle,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=_v(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Qy(this).circle[t]}needUpdateTags(t){for(let e=0;e<Xx.length;e++){const n=Xx[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<Xx.length;e++)if(t===Xx[e])return!0;return!1}toCustomPath(){var t,e,n;const i=this.attribute,r=null!==(t=i.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=i.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(n=i.endAngle)&&void 0!==n?n:this.getDefaultAttribute("endAngle"),a=new bg;return a.arc(0,0,r,s,o),a}clone(){return new Yx(Object.assign({},this.attribute))}}function qx(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);const{fontStyle:i=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(i?i+" ":"")+(r?r+" ":"")+(s?s+" ":"")+o*n+"px "+(a||"sans-serif")}function $x(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Kx(t,e,n){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(n||(n=e),-(e-n)/2-.79*n)}class Zx{constructor(t,e,n){this.fontFamily=t,this.textOptions=e,this.textMeasure=n}LayoutBBox(t,e,n){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"===n?0:"middle"===n?t.height/-2:"alphabetic"===n?-.79*t.height:-t.height,t}GetLayout(t,e,n,i,r,s,o,a,l){const h=[],c=[e,n],u=[0,0];for(;t.length>0;){const{str:n}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,a);h.push({str:n,width:this.textMeasure.measureTextWidth(n,this.textOptions)}),t=t.substring(n.length)}"left"===i||"start"===i||("center"===i?u[0]=c[0]/-2:"right"!==i&&"end"!==i||(u[0]=-c[0])),"top"===r||("middle"===r?u[1]=c[1]/-2:"bottom"===r&&(u[1]=-c[1]));const d={xOffset:u[0],yOffset:u[1],width:c[0],height:c[1]};return this.layoutWithBBox(d,h,i,r,s)}GetLayoutByLines(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0;t=t.map((t=>t.toString()));const a=[],l=[0,0];if("number"==typeof o&&o!==1/0){let e;for(let n=0,i=t.length;n<i;n++)e=Math.min(this.textMeasure.measureTextWidth(t[n],this.textOptions),o),a.push({str:this.textMeasure.clipTextWithSuffix(t[n],this.textOptions,e,r,s).str,width:e});l[0]=o}else{let e,n;o=0;for(let i=0,r=t.length;i<r;i++)n=t[i],e=this.textMeasure.measureTextWidth(n,this.textOptions),o=Math.max(o,e),a.push({str:n,width:e});l[0]=o}l[1]=a.length*i,l[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const h={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(h,e,n),this.layoutWithBBox(h,a,e,n,i)}layoutWithBBox(t,e,n,i,r){const s=[0,0],o=e.length*r;"top"===i||("middle"===i?s[1]=(t.height-o)/2:"bottom"===i&&(s[1]=t.height-o));for(let o=0;o<e.length;o++)this.lineOffset(t,e[o],n,i,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}lineOffset(t,e,n,i,r,s){return"left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+s[1],s[1]+=r,e}}const Jx=["text","maxLineWidth","fontSize","fontFamily","fontWeight","ellipsis","lineHeight",...$v];class Qx extends tm{get font(){const t=Qy(this).text;return this._font||(this._font=qx(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,n=Qy(this).text;if(Array.isArray(e.text))return;const{maxLineWidth:i=n.maxLineWidth}=e;return Number.isFinite(i)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}get clipedWidth(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){const t=Qy(this).text,e=this.attribute;if(Array.isArray(e.text))return;const{maxLineWidth:n=t.maxLineWidth}=e;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text.toString())}get multilineLayout(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=Vb,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return null!=t&&""!==t}doUpdateAABBBounds(){const t=Qy(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=this.attribute,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}updateSingallineAABBBounds(t){const e=Qy(this).text,{direction:n=e.direction}=this.attribute;return"horizontal"===n?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}updateMultilineAABBBounds(t){const e=Qy(this).text,{direction:n=e.direction}=this.attribute;return"horizontal"===n?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}updateHorizontalSinglelineAABBBounds(t){var e,n;const i=Qy(this).text,r=Gg.graphicUtil.textMeasure;let s,o;const a=this.attribute,{maxLineWidth:l=i.maxLineWidth,ellipsis:h=i.ellipsis,textAlign:c=i.textAlign,textBaseline:u=i.textBaseline,fontFamily:d=i.fontFamily,fontSize:f=i.fontSize,fontWeight:p=i.fontWeight,stroke:g=i.stroke,lineWidth:y=i.lineWidth,wordBreak:v=i.wordBreak,ignoreBuf:m=i.ignoreBuf}=a,b=m?0:Math.max(2,.075*f),{lineHeight:x=(null!==(e=a.lineHeight)&&void 0!==e?e:(a.fontSize||i.fontSize)+b)}=a;if(!this.shouldUpdateShape()&&this.cache){s=null!==(n=this.cache.clipedWidth)&&void 0!==n?n:0;const t=$x(c,s),e=Kx(u,x,f);return this._AABBBounds.set(t,e,t+s,e+x),g&&this._AABBBounds.expand(y/2),this._AABBBounds}if(Number.isFinite(l)){if(h){const e=!0===h?i.ellipsis:h,n=r.clipTextWithSuffix(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d},l,e,!1);o=n.str,s=n.width}else{const e=r.clipText(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d},l,!1);o=e.str,s=e.width}this.cache.clipedText=o,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:f,fontWeight:p,fontFamily:d}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const w=$x(c,s);let S=x;Gg.global&&Gg.global.isSafari()&&(S+=.2*f);const A=Kx(u,S,f,b);return this._AABBBounds.set(w,A,w+s,A+S),g&&this._AABBBounds.expand(y/2),this._AABBBounds}updateVerticalSinglelineAABBBounds(t){var e;const n=Qy(this).text,i=Gg.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=n.ignoreBuf}=s,a=o?0:2,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontSize:d=n.fontSize,fontWeight:f=n.fontWeight,fontFamily:p=n.fontFamily,stroke:g=n.stroke,lineHeight:y=(null!==(e=s.lineHeight)&&void 0!==e?e:(s.fontSize||n.fontSize)+a),lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak}=s;if(!this.shouldUpdateShape()&&this.cache){r=this.cache.clipedWidth;const t=$x(c,r),e=Kx(u,y,d);return this._AABBBounds.set(e,t,e+y,t+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}let b=[Bb(t.toString())];if(Number.isFinite(l)){if(h){const t=!0===h?n.ellipsis:h,e=i.clipTextWithSuffixVertical(b[0],{fontSize:d,fontWeight:f,fontFamily:p},l,t,!1);b=[e.verticalList],r=e.width}else{const t=i.clipTextVertical(b[0],{fontSize:d,fontWeight:f,fontFamily:p},l,!1);b=[t.verticalList],r=t.width}this.cache.verticalList=b,this.cache.clipedWidth=r}else r=0,b[0].forEach((t=>{const e=t.direction===_b.HORIZONTAL?d:i.measureTextWidth(t.text,{fontSize:d,fontWeight:f,fontFamily:p});r+=e,t.width=e})),this.cache.verticalList=b,this.cache.clipedWidth=r;this.clearUpdateShapeTag();const x=$x(c,r),w=Kx(u,y,d);return this._AABBBounds.set(w,x,w+y,x+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e;const n=Qy(this).text,i=this.attribute,{fontFamily:r=n.fontFamily,textAlign:s=n.textAlign,textBaseline:o=n.textBaseline,fontSize:a=n.fontSize,fontWeight:l=n.fontWeight,lineHeight:h=i.lineHeight||i.fontSize||n.fontSize,ellipsis:c=n.ellipsis,maxLineWidth:u,stroke:d=n.stroke,lineWidth:f=n.lineWidth,wordBreak:p=n.wordBreak}=i;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const g=Gg.graphicUtil.textMeasure,y=new Zx(r,{fontSize:a,fontWeight:l,fontFamily:r},g).GetLayoutByLines(t,s,o,h,!0===c?n.ellipsis:c||void 0,!1,u),{bbox:v}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(v.xOffset,v.yOffset,v.xOffset+v.width,v.yOffset+v.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e;const n=Qy(this).text,i=Gg.graphicUtil.textMeasure;let r;const s=this.attribute,{ignoreBuf:o=n.ignoreBuf}=s,a=o?0:2,{maxLineWidth:l=n.maxLineWidth,ellipsis:h=n.ellipsis,textAlign:c=n.textAlign,textBaseline:u=n.textBaseline,fontFamily:d=n.fontFamily,fontSize:f=n.fontSize,fontWeight:p=n.fontWeight,stroke:g=n.stroke,lineHeight:y=(null!==(e=s.lineHeight)&&void 0!==e?e:(s.fontSize||n.fontSize)+a),lineWidth:v=n.lineWidth,wordBreak:m=n.wordBreak}=s;if(r=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);r=R(e,r)}));const t=$x(c,r),e=this.cache.verticalList.length*y,n=Kx(u,e,f);return this._AABBBounds.set(n,t,n+e,t+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}const b=t.map((t=>Bb(t.toString())));b.forEach(((t,e)=>{if(Number.isFinite(l))if(h){const s=!0===h?n.ellipsis:h,o=i.clipTextWithSuffixVertical(t,{fontSize:f,fontWeight:p,fontFamily:d},l,s,!1);b[e]=o.verticalList,r=o.width}else{const n=i.clipTextVertical(t,{fontSize:f,fontWeight:p,fontFamily:d},l,!1);b[e]=n.verticalList,r=n.width}else r=0,t.forEach((t=>{const e=t.direction===_b.HORIZONTAL?f:i.measureTextWidth(t.text,{fontSize:f,fontWeight:p,fontFamily:d});r+=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);r=R(e,r)}));const x=$x(c,r),w=this.cache.verticalList.length*y,S=Kx(u,w,f);return this._AABBBounds.set(S,x,S+w,x+r),g&&this._AABBBounds.expand(v/2),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Qy(this).text[t]}needUpdateTags(t){for(let e=0;e<Jx.length;e++){const n=Jx[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<Jx.length;e++)if(t===Jx[e])return!0;return!1}clone(){return new Qx(Object.assign({},this.attribute))}}const tw=["heightLimit","lineClamp"];class ew extends Qx{_isValid(){const{text:t}=this.attribute;return d(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,n,i;const r=Qy(this).text,{fontFamily:s=r.fontFamily,textAlign:o=r.textAlign,textBaseline:a=r.textBaseline,fontSize:l=r.fontSize,lineHeight:h=this.attribute.lineHeight||this.attribute.fontSize||r.fontSize,ellipsis:c=r.ellipsis,maxLineWidth:u,stroke:d=r.stroke,lineWidth:f=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:g=r.fontWeight,ignoreBuf:y=r.ignoreBuf,heightLimit:v=0,lineClamp:m}=this.attribute,b=y?0:2;if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=Gg.graphicUtil.textMeasure,w=new Zx(s,{fontSize:l,fontWeight:g,fontFamily:s},x),S=t.map((t=>t.toString())),A=[],_=[0,0];let B=1/0;if(v>0&&(B=Math.max(Math.floor(v/h),1)),m&&(B=Math.min(B,m)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<S.length;t++){const e=S[t];let r=!0;if(t===B-1){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);A.push({str:t.str,width:t.width});break}const s=w.textMeasure.clipText(e,w.textOptions,u,"break-word"===p);if(""!==e&&""===s.str){if(c){const t=w.textMeasure.clipTextWithSuffix(e,w.textOptions,u,c,!1);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(i=t.width)&&void 0!==i?i:0}else s.str="",s.width=0;r=!1}if(A.push({str:s.str,width:s.width}),s.str.length===e.length);else if(r){const n=e.substring(s.str.length);S.splice(t+1,0,n)}}let t=0;A.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,n=0;for(let i=0,r=S.length;i<r;i++){if(i===B-1){const t=w.textMeasure.clipTextWithSuffix(S[i],w.textOptions,u,c,!1);A.push({str:t.str,width:t.width}),n=Math.max(n,t.width);break}e=S[i],t=w.textMeasure.measureTextWidth(e,w.textOptions,"break-word"===p),n=Math.max(n,t),A.push({str:e,width:t})}_[0]=n}_[1]=A.length*(h+b);const T={xOffset:0,yOffset:0,width:_[0],height:_[1]};w.LayoutBBox(T,o,a);const C=w.layoutWithBBox(T,A,o,a,h);return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(T.xOffset,T.yOffset,T.xOffset+T.width,T.yOffset+T.height),d&&this._AABBBounds.expand(f/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<tw.length;e++){const n=tw[e];if(-1!==t.indexOf(n))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<tw.length;e++)if(t===tw[e])return!0;return super.needUpdateTag(t)}}function nw(t,e,n,i,r){return r?t.arc(n,i,e,0,_,!1,r):t.arc(n,i,e,0,_),!1}var iw=new class{constructor(){this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,n,i,r){return nw(t,e/2,n,i,r)}drawOffset(t,e,n,i,r,s){return nw(t,e/2+r,n,i,s)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var rw=new class{constructor(){this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,e/6,n,i,r)}drawOffset(t,e,n,i,r,s){return function(t,e,n,i,r,s){return t.moveTo(-3*e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-e+i-r,s),t.lineTo(-e+n-r,-3*e+i-r,s),t.lineTo(e+n+r,-3*e+i-r,s),t.lineTo(e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,-e+i-r,s),t.lineTo(3*e+n+r,e+i+r,s),t.lineTo(e+n+r,e+i+r,s),t.lineTo(e+n+r,3*e+i+r,s),t.lineTo(-e+n-r,3*e+i+r,s),t.lineTo(-e+n-r,e+i+r,s),t.lineTo(-3*e+n-r,e+i+r,s),t.closePath(),!0}(t,e/6,n,i,r,s)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function sw(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var ow=new class{constructor(){this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,n,i,r){return sw(t,e/2,n,i,r)}drawFitDir(t,e,n,i,r){return sw(t,e/2,n,i,r)}drawOffset(t,e,n,i,r,s){return sw(t,e/2+r,n,i,s)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function aw(t,e,n,i){const r=2*e;return t.rect(n-e,i-e,r,r),!1}var lw=new class{constructor(){this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return aw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return aw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};class hw{constructor(){this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(n+e,e+i),t.lineTo(n-e,e+i),t.lineTo(n,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}}var cw=new hw;var uw=new class extends hw{constructor(){super(...arguments),this.type="triangle"}};const dw=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),fw=Math.sin(_/10)*dw,pw=-Math.cos(_/10)*dw;function gw(t,e,n,i){const r=fw*e,s=pw*e;t.moveTo(n,-e+i),t.lineTo(r+n,s+i);for(let o=1;o<5;++o){const a=_*o/5,l=Math.cos(a),h=Math.sin(a);t.lineTo(h*e+n,-l*e+i),t.lineTo(l*r-h*s+n,h*r+l*s+i)}return t.closePath(),!0}var yw=new class{constructor(){this.type="star",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,n,i){return gw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return gw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const vw=E(3);function mw(t,e,n,i){const r=e,s=r/vw,o=s/5,a=e;return t.moveTo(0+n,-r+i),t.lineTo(s/2+n,i),t.lineTo(o/2+n,i),t.lineTo(o/2+n,a+i),t.lineTo(-o/2+n,a+i),t.lineTo(-o/2+n,i),t.lineTo(-s/2+n,i),t.closePath(),!0}var bw=new class{constructor(){this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,n,i){return mw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return mw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function xw(t,e,n,i){const r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var ww=new class{constructor(){this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,n,i){return xw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return xw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Sw(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Aw=new class{constructor(){this.type="stroke",this.pathStr=""}draw(t,e,n,i){return Sw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return Sw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const _w=-.5,Bw=E(3)/2,Tw=1/E(12);function Cw(t,e,n,i){const r=e/2,s=e*Tw,o=r,a=e*Tw+e,l=-o,h=a;return t.moveTo(r+n,s+i),t.lineTo(o+n,a+i),t.lineTo(l+n,h+i),t.lineTo(_w*r-Bw*s+n,Bw*r+_w*s+i),t.lineTo(_w*o-Bw*a+n,Bw*o+_w*a+i),t.lineTo(_w*l-Bw*h+n,Bw*l+_w*h+i),t.lineTo(_w*r+Bw*s+n,_w*s-Bw*r+i),t.lineTo(_w*o+Bw*a+n,_w*a-Bw*o+i),t.lineTo(_w*l+Bw*h+n,_w*h-Bw*l+i),t.closePath(),!1}var Pw=new class{constructor(){this.type="wye",this.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0"}draw(t,e,n,i){return Cw(t,e/2,n,i)}drawOffset(t,e,n,i,r){return Cw(t,e/2+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var Rw=new class{constructor(){this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(e+n,e+i),t.lineTo(e+n,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var Ow=new class{constructor(){this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,e+i),t.lineTo(e+n,i),t.lineTo(n-e,i-e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};var Mw=new class{constructor(){this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,i-e),t.lineTo(n+e,i-e),t.lineTo(n,i+e),t.closePath(),!0}(t,e/2,n,i)}drawOffset(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}(t,e/2,n,i,r)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};const Ew=E(3);function kw(t,e,n,i){const r=e*Ew;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var Iw=new class extends hw{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,n,i){return kw(t,e/2/Ew,n,i)}drawOffset(t,e,n,i,r){return kw(t,e/2/Ew+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function jw(t,e,n,i){const r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var Dw=new class{constructor(){this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,n,i){return jw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return jw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Lw(t,e,n,i){const r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var Nw=new class{constructor(){this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,n,i){return Lw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Lw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Ww(t,e,n,i){const r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var Fw=new class{constructor(){this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,n,i){return Ww(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Ww(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Uw(t,e,n,i){const r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var zw=new class{constructor(){this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,n,i){return Uw(t,e/4,n,i)}drawOffset(t,e,n,i,r){return Uw(t,e/4+r,n,i)}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Hw(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var Vw=new class{constructor(){this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,n,i,r){return Hw(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return Hw(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e}, ${n-r} L ${e},${n+r}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Gw(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var Xw=new class{constructor(){this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,n,i,r){return Gw(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return Gw(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n} L ${e+r},${n}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function Yw(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var qw=new class{constructor(){this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,n,i,r){return Yw(t,e/2,n,i)}drawOffset(t,e,n,i,r,s){return Yw(t,e/2+r,n,i)}drawToSvgPath(t,e,n,i){const r=t/2;return`M ${e-r}, ${n-r} L ${e+r},${n+r} M ${e+r}, ${n-r} L ${e-r},${n+r}`}bounds(t,e){const n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}};function $w(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}var Kw=new class{constructor(){this.type="rect",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,n,i){return $w(t,f(e)?[e,e]:e,n,i)}drawOffset(t,e,n,i,r){return $w(t,f(e)?[e+2*r,e+2*r]:[e[0]+2*r,e[1]+2*r],n,i)}bounds(t,e){const n=f(t)?[t,t]:t;e.x1=-n[0]/2,e.x2=n[0]/2,e.y1=-n[1]/2,e.y2=n[1]/2}};const Zw=new U;class Jw{constructor(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,d(e)?this.svgCache=e:this.path=e,this.isSvg=n}drawOffset(t,e,n,i,r,s,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Hp(r.path.commandList,t,n,i,e,e),o&&o(r.path,r.attribute)})),!1):(Hp(this.path.commandList,t,n,i,e+r,e+r),!1)}draw(t,e,n,i,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Hp(r.path.commandList,t,n,i,e,e),s&&s(r.path,r.attribute)})),!1):(Hp(this.path.commandList,t,n,i,e,e),!1)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((n=>{let{path:i}=n;Zw.x1=i.bounds.x1*t,Zw.y1=i.bounds.y1*t,Zw.x2=i.bounds.x2*t,Zw.y2=i.bounds.y2*t,e.union(Zw)}))}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 Qw={};[iw,rw,ow,lw,Iw,uw,yw,bw,ww,Aw,Pw,Rw,Ow,cw,Mw,Dw,Nw,Fw,zw,Kw,Vw,Xw,qw].forEach((t=>{Qw[t.type]=t}));const tS=["symbolType","size",...$v];let eS=class t extends tm{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Hb}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return d(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=Qy(this).symbol,{symbolType:n=e.symbolType}=this.attribute;let i=Qw[n];if(i)return this._parsedPath=i,i;if(i=t.userSymbolMap[n],i)return this._parsedPath=i,i;if(!0===xb.XMLValidator.validate(n,{allowBooleanAttributes:!0})){const e=new xb.XMLParser({ignoreAttributes:!1}),{svg:i}=e.parse(n);if(!i)return null;const r=d(i.path)?i.path:[i.path],s=new U,o=[];r.forEach((t=>{const e=(new bg).fromString(t["@_d"]),n={fill:"black"};qb.forEach((e=>{t[e]&&(n[Yb[e]]=t[e])})),o.push({path:e,attribute:n}),s.union(e.bounds)}));const a=s.width(),l=s.height(),h=1/R(a,l);return o.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new Jw(n,o,!0),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}const r=(new bg).fromString(n),s=r.bounds.width(),o=r.bounds.height(),a=1/R(s,o);return r.transform(0,0,a,a),this._parsedPath=new Jw(n,r),t.userSymbolMap[n]=this._parsedPath,this._parsedPath}doUpdateAABBBounds(t){const e=Qy(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Gg.graphicService.updateSymbolAABBBounds(n,Qy(this).symbol,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=_v(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Qy(this).symbol[t]}needUpdateTags(t){for(let e=0;e<tS.length;e++){const n=tS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<tS.length;e++)if(t===tS[e])return!0;return!1}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,n=d(e)?e:[e,e];return t.path?(new bg).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new bg).fromString(t.pathStr,0,0,n[0],n[1])}clone(){return new t(Object.assign({},this.attribute))}};eS.userSymbolMap={};const nS=["segments","points","curveType",...$v];let iS=class t extends tm{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=Db}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,n,i,r){"points"===t&&(r.points=Rv(n,i,e))}doUpdateAABBBounds(){const t=Qy(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updateLineAABBBounds(e,Qy(this).line,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Qy(this).line[t]}needUpdateTags(t){for(let e=0;e<nS.length;e++){const n=nS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<nS.length;e++)if(t===nS[e])return!0;return!1}toCustomPath(){const t=this.attribute,e=new bg,n=t.segments,i=t=>{if(t&&t.length){let n=!0;t.forEach((t=>{!1!==t.defined&&(n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),n=!1)}))}};return n&&n.length?n.forEach((t=>{i(t.points)})):t.points&&i(t.points),e}clone(){return new t(Object.assign({},this.attribute))}};const rS=["width","height","cornerRadius",...$v];class sS extends tm{constructor(t){super(t),this.type="rect",this.numberType=Fb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{width:t,height:e}=this.attribute;return this._validNumber(t)&&this._validNumber(e)}doUpdateAABBBounds(){const t=Qy(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updateRectAABBBounds(e,Qy(this).rect,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Qy(this).rect[t]}needUpdateTags(t){for(let e=0;e<rS.length;e++){const n=rS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<rS.length;e++)if(t===rS[e])return!0;return!1}toCustomPath(){const t=this.attribute,e=t.width,n=t.height,i=new bg;return i.moveTo(0,0),i.rect(0,0,e,n),i}clone(){return new sS(Object.assign({},this.attribute))}}const oS=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class aS extends sS{constructor(t){super(t),this.type="rect3d",this.numberType=Ub}findFace(){const t={polygons:[],vertices:[],edges:[]},e=Qy(this).rect3d,{width:n=e.width,height:i=e.width,length:r=O(e.width,e.height)}=this.attribute;for(let e=0;e<oS.length;e++){const s=oS[e];t.vertices.push([s[0]*n,s[1]*i,s[2]*r])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}}class lS{constructor(t,e,n,i,r,s,o,a,l,h,c,u,d,f){this.left=t,this.top=e,this.width=n,this.height=i,this.actualHeight=0,this.bottom=e+i,this.right=t+n,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=o,this.lines=[],this.globalAlign=a,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Xg[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,f?(f.clear(),this.icons=f):this.icons=new Map}draw(t,e){const{width:n,height:i}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,n):this.width||n||0;let s=this.isHeightMax?Math.min(this.height,i):this.height||i||0;s=Math.min(s,i);let o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}let a=0;switch(this.globalAlign){case"left":a=0;break;case"center":a=-r/2;break;case"right":a=-r}let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n];if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;let s=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[n].draw(t,s,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}else{const n=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?a+=n:o+=n;for(let n=0;n<this.lines.length;n++)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:r}=this.lines[n],s=l-this.lines[n].top-this.lines[n].height;if(0===l)this.lines[n].draw(t,!1,a,s+o,e);else{if(s+r>this[this.directionKey.top]+l||s<this[this.directionKey.top])return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&s-this.lines[n+1].height<this[this.directionKey.top]&&(i=!0,h=!0),this.lines[n].draw(t,i,a,s+o,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(a+=this.lines[0].height+1);for(let n=0;n<this.lines.length;n++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(a-=this.lines[n].height+this.lines[n].top);const{top:i,height:r}=this.lines[n];if(0===l)this.lines[n].draw(t,!1,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e);else{if(i+r<this[this.directionKey.top]||i+r>this[this.directionKey.top]+l)return h;{let i=!1;this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+l&&(i=!0,h=!0),this.lines[n].draw(t,i,this.lines[n][this.directionKey.left]+a,this.lines[n][this.directionKey.top]+o,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let n=0;n<this.lines.length;n++){const i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:n,height:i}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else{Math.floor((r-this.actualHeight)/2);for(let n=0;n<this.lines.length;n++)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else if("bottom"===this.verticalDirection)for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n],o=r-this.lines[n].top-this.lines[n].height;if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(o+s>this[this.directionKey.top]+r||o<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[n+1]&&o-this.lines[n+1].height<this[this.directionKey.top]){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}else for(let n=0;n<this.lines.length;n++){const{top:i,height:s}=this.lines[n];if(0===r)this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height;else if(i+s<this[this.directionKey.top]||i+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[n+1]&&this.lines[n+1].top+this.lines[n+1].height>this[this.directionKey.top]+r){const i=this.lines[n].getWidthWithEllips();i>t&&(t=i),e+=this.lines[n].height}else this.lines[n].actualWidth>t&&(t=this.lines[n].actualWidth),e+=this.lines[n].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class hS{constructor(t,e,n){this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic","number"==typeof n.lineHeight?this.lineHeight=n.lineHeight>this.fontSize?n.lineHeight:this.fontSize:this.lineHeight=Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:i,height:r,descent:s,width:o}=ty(t,n);let a=0,l=0,h=0;this.height>r&&(a=(this.height-r)/2,l=Math.ceil(a),h=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=i+l,this.descent=s+h),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=n,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===n.direction&&(this.direction=n.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height)}updateWidth(){const{width:t}=ty(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,n,i,r){let s=this.text,o=this.left+n;e+=this.top;let a=this.direction;if(this.verticalEllipsis)s="...",a="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+="...","right"===r&&(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Jg(s,("vertical"===a?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+="...","right"===r){const{width:e}=ty(this.text.slice(t),this.character);"vertical"===a||(o-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===a&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(function(t,e){const n=e&&e.stroke||qg;if(!n)return void(t.globalAlpha=0);t.globalAlpha=1,t.lineWidth=1,t.strokeStyle=n;let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),t.strokeText(s,o,e)),function(t,e){const n=e&&e.fill||Yg;if(!n)return void(t.globalAlpha=0);t.globalAlpha=1,t.fillStyle=n;let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})}(t,this.character),this.character.fill&&t.fillText(s,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===a&&t.restore()}getWidthWithEllips(t){let e=this.text;const n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Jg(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+="...";const{width:i}=ty(this.text.slice(t),this.character);return n+this.ellipsisWidth-i}return n}}const cS=["width","height","image",...$v];class uS extends tm{constructor(t){super(t),this.type="image",this.numberType=jb,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,n){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}doUpdateAABBBounds(){const t=Qy(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updateImageAABBBounds(e,Qy(this).image,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Hg[t]}needUpdateTags(t){for(let e=0;e<cS.length;e++){const n=cS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<cS.length;e++)if(t===cS[e])return!0;return!1}clone(){return new uS(Object.assign({},this.attribute))}}class dS extends uS{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=_v(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,n)=>{if(d(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){const t=_v(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=Hg.width,height:e=Hg.height}=this.attribute,{backgroundWidth:n=t,backgroundHeight:i=e}=this.attribute,r=(n-t)/2,s=(i-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class fS{constructor(t,e,n,i,r,s,o,a){this.left=t,this.width=e,this.baseline=n,this.ascent=i,this.descent=r,this.top=n-i,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof dS?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=o,this.directionKey=Xg[this.direction];const l=this.directionKey;this.actualWidth=0;let h=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof hS){const e=Zg.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],h=Math.max(t[this.directionKey.height],h)})),this.height=h,this.blankWidth=a?0:this.width-this.actualWidth;let c=this.left,u=0;if(this.actualWidth<e&&!a)switch(this.textAlign){case"right":c=e-this.actualWidth;break;case"center":c=(e-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?c=(e-this.actualWidth)/2:u=(e-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof dS?(t["_"+l.x]=c,c+=t[l.width]+u,t["_"+l.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?h-t.height:(h-t.height)/2):(t[l.left]=c,c+=t[l.width]+u)}))}draw(t,e,n,i,r){if(e){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n instanceof dS)break;if("vertical"===this.direction&&"vertical"!==n.direction){n.verticalEllipsis=!0;break}const{width:i}=ty("...",n.character),r=i||0;if(r<=this.blankWidth+t){n.ellipsis="add";break}if(r<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}}this.paragraphs.map(((e,s)=>{if(e instanceof dS)return e.setAttributes({x:n+e._x,y:i+e._y}),void r(e,t,n+e._x,i+e._y,this.ascent);e.draw(t,i+this.ascent,n,0===s,this.textAlign)}))}getWidthWithEllips(){let t=0;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n instanceof dS)break;const{width:i}=ty("...",n.character),r=i||0;if(r<=this.blankWidth+t){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+t+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+t;break}n.ellipsis="hide",t+=n.width}let e=0;return this.paragraphs.map(((t,n)=>{e+=t instanceof dS?t.width:t.getWidthWithEllips(this.direction)})),e}}class pS{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Xg[this.direction]}store(t){if(t instanceof dS){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,n=new fS(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){t instanceof dS?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t)))}cut(t){const e=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(e/t[this.directionKey.width]*t.length)||0,i=Jg(t.text,e,t.character,n,"break-word"===this.frame.wordBreak);if(0!==i){const[e,n]=function(t,e){const n=t.text.slice(0,e),i=t.text.slice(e);return[new hS(n,t.newLine,t.character),new hS(i,!0,t.character)]}(t,i);this.store(e),this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const gS=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection",...$v];class yS extends tm{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=zb}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:zg.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:zg.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:zg.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:zg.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:zg.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:zg.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:zg.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:zg.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}doUpdateAABBBounds(){const t=Qy(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updateRichTextAABBBounds(e,Qy(this).richtext,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return zg[t]}needUpdateTags(t){for(let e=0;e<gS.length;e++){const n=gS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<gS.length;e++)if(t===gS[e])return!0;return!1}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}doUpdateFrameCache(){var t;const{textConfig:e,maxWidth:n,maxHeight:i,width:r,height:s,ellipsis:o,wordBreak:a,verticalDirection:l,textAlign:h,textBaseline:c,layoutDirection:u,singleLine:d}=this.attribute,f=[];for(let t=0;t<e.length;t++)if("image"in e[t]){const n=e[t],i=n.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(n.id);if(i)f.push(i);else{const t=new dS(n);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=n.id,f.push(t)}}else if(e[t].text.includes("\n")){const n=e[t].text.split("\n");for(let i=0;i<n.length;i++)f.push(new hS(n[i],0!==i,e[t]))}else f.push(new hS(e[t].text,!1,e[t]));const p=new lS(0,0,("number"==typeof n&&(!r||r>n)?n:r)||0,("number"==typeof i&&(!s||s>i)?i:s)||0,o,a,l,h,c,u||"horizontal","number"==typeof n&&(!r||r>n),"number"==typeof i&&(!s||s>i),d||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),g=new pS(p);for(let t=0;t<f.length;t++)g.deal(f[t]);g.send(),this._frameCache=p}clone(){return new yS(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((n=>{n.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,n,i,r,s;const o=this.pickIcon(t.global);o&&o===this._currentHoverIcon||(o?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=o,this._currentHoverIcon.setHoverState(!0),null===(n=this.stage)||void 0===n||n.setCursor(o.attribute.cursor),null===(i=this.stage)||void 0===i||i.renderNextFrame()):!o&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,n;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(n=this.stage)||void 0===n||n.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:n,f:i}=this.globalTransMatrix;let r;return e.icons.forEach((e=>{var s,o;e.AABBBounds.containsPoint({x:t.x-n,y:t.y-i})&&(r=e,r.globalX=(null!==(s=r.attribute.x)&&void 0!==s?s:0)+n,r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+i)})),r}}const vS=["path","customPath",...$v];class mS extends tm{constructor(t){super(t),this.type="path",this.numberType=Lb}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=Qy(this).path;if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof bg?e.path:(l(this.cache)&&this.doUpdatePathShape(),this.cache instanceof bg?this.cache:t.path)}doUpdateAABBBounds(){const t=Qy(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updatePathAABBBounds(e,Qy(this).path,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}doUpdatePathShape(){const t=this.attribute;u(t.path,!0)?this.cache=(new bg).fromString(t.path):t.customPath&&(this.cache=new bg,t.customPath(this.cache,this))}tryUpdateOBBBounds(){throw new Error("暂不支持")}getDefaultAttribute(t){return Qy(this).path[t]}needUpdateTags(t){for(let e=0;e<vS.length;e++){const n=vS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<vS.length;e++)if(t===vS[e])return!0;return!1}toCustomPath(){return(new bg).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new mS(Object.assign({},this.attribute))}}const bS=["segments","points","curveType",...$v];class xS extends tm{constructor(t){super(t),this.type="area",this.numberType=Mb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}doUpdateAABBBounds(){const t=Qy(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updateAreaAABBBounds(e,Qy(this).area,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),n}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,n,i,r){"points"===t&&(r.points=Rv(n,i,e))}getDefaultAttribute(t){return Qy(this).area[t]}needUpdateTags(t){for(let e=0;e<bS.length;e++){const n=bS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<bS.length;e++)if(t===bS[e])return!0;return!1}toCustomPath(){const t=new bg,e=this.attribute,n=e.segments,i=e=>{if(e&&e.length){let n=!0;const i=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(n?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),n=!1)})),i.length){for(let e=i.length-1;e>=0;e--)t.lineTo(i[e].x,i[e].y);t.closePath()}}};return e.points?i(e.points):n&&n.length&&n.forEach((t=>{i(t.points)})),t}clone(){return new xS(Object.assign({},this.attribute))}}const wS=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...$v];class SS extends tm{constructor(t){super(t),this.type="arc",this.numberType=Rb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:n,innerRadius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}getParsedCornerRadius(){const t=Qy(this).arc,{cornerRadius:e=t.cornerRadius,outerRadius:n=t.outerRadius,innerRadius:i=t.innerRadius}=this.attribute;if(0===e||"0%"===e)return 0;const r=Math.abs(n-i);return Math.min(f(e,!0)?e:r*parseFloat(e)/100,r/2)}getParsedAngle(){const t=Qy(this).arc;let{startAngle:e=t.startAngle,endAngle:n=t.endAngle}=this.attribute;const{cap:i=t.cap}=this.attribute,r=n-e>=0?1:-1,s=n-e;if(e=H(e),n=e+s,i&&T(s)<B-w){let s=1,o=1;i.length&&(s=Number(i[0]),o=Number(i[1]));const{outerRadius:a=t.outerRadius,innerRadius:l=t.innerRadius}=this.attribute,h=Math.abs(a-l)/2,c=h/a;if(h>w&&a>w)return{startAngle:e-r*c*s,endAngle:n+r*c*o,sc:r*c*s,ec:r*c*o}}return{startAngle:e,endAngle:n}}getParsePadAngle(t,e){const n=Qy(this).arc,{outerRadius:i=n.outerRadius,innerRadius:r=n.innerRadius,padAngle:s=n.padAngle}=this.attribute,{padRadius:o=E(i*i+r*r)}=this.attribute,a=T(e-t);let l=t,h=e,c=t,u=e;const d=s/2;let f=a,p=a;if(d>w&&o>w){const n=e>t?1:-1;let s=j(Number(o)/r*M(d)),a=j(Number(o)/i*M(d));return(f-=2*s)>w?(s*=n,c+=s,u-=s):(f=0,c=u=(t+e)/2),(p-=2*a)>w?(a*=n,l+=a,h-=a):(p=0,l=h=(t+e)/2),{outerStartAngle:l,outerEndAngle:h,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:f,outerDeltaAngle:p}}return{outerStartAngle:l,outerEndAngle:h,innerStartAngle:c,innerEndAngle:u,innerDeltaAngle:f,outerDeltaAngle:p}}doUpdateAABBBounds(t){const e=Qy(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const n=this.attribute,i=Gg.graphicService.updateArcAABBBounds(n,Qy(this).arc,this._AABBBounds,t,this),{boundsPadding:r=e.boundsPadding}=n,s=_v(r);return s&&i.expand(s),this.clearUpdateBoundTag(),i}tryUpdateOBBBounds(){throw new Error("暂不支持")}needUpdateTags(t){for(let e=0;e<wS.length;e++){const n=wS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<wS.length;e++)if(t===wS[e])return!0;return!1}getDefaultAttribute(t){return Qy(this).arc[t]}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:n}=this.getParsedAngle();let i=t.innerRadius,r=t.outerRadius;const s=T(n-e),o=n>e;if(r<i){const t=r;r=i,i=t}const a=new bg;if(r<=w)a.moveTo(0,0);else if(s>=B-w)a.moveTo(0+r*P(e),0+r*M(e)),a.arc(0,0,r,e,n,!o),i>w&&(a.moveTo(0+i*P(n),0+i*M(n)),a.arc(0,0,i,n,e,o));else{const t=r*P(e),s=r*M(e),l=i*P(n),h=i*M(n);a.moveTo(0+t,0+s),a.arc(0,0,r,e,n,!o),a.lineTo(0+l,0+h),a.arc(0,0,i,n,e,o),a.closePath()}return a}clone(){return new SS(Object.assign({},this.attribute))}}const AS=["points","cornerRadius",...$v];class _S extends tm{constructor(t){super(t),this.type="polygon",this.numberType=Nb}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}doUpdateAABBBounds(){const t=Qy(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);const e=this.attribute,n=Gg.graphicService.updatePolygonAABBBounds(e,Qy(this).polygon,this._AABBBounds,this),{boundsPadding:i=t.boundsPadding}=e,r=_v(i);return r&&n.expand(r),this.clearUpdateBoundTag(),this._AABBBounds}tryUpdateOBBBounds(){throw new Error("暂不支持")}_interpolate(t,e,n,i,r){"points"===t&&(r.points=Rv(n,i,e))}getDefaultAttribute(t){return Qy(this).polygon[t]}needUpdateTags(t){for(let e=0;e<AS.length;e++){const n=AS[e];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){for(let e=0;e<AS.length;e++)if(t===AS[e])return!0;return!1}toCustomPath(){const t=this.attribute.points,e=new bg;return t.forEach(((t,n)=>{0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new _S(Object.assign({},this.attribute))}}var BS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let TS=class{updateBounds(t,e,n,i){const{outerBorder:r,shadowBlur:s=e.shadowBlur}=t;if(r){const t=e.outerBorder,{distance:i=t.distance,lineWidth:o=t.lineWidth}=r;n.expand(i+s+o/2)}return n}};TS=BS([tp()],TS);var CS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const PS=Symbol.for("RectBoundsContribution");let RS=class extends TS{};RS=CS([tp()],RS);var OS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const MS=Symbol.for("SymbolBoundsContribution");let ES=class extends TS{updateBounds(t,e,n,i){const{outerBorder:r,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:o=e.strokeBoundsBuffer}=t;if(r){const t=e.outerBorder,{distance:i=t.distance,lineWidth:a=t.lineWidth}=r;wb(n,i+s+a/2,!0,o)}return n}};ES=OS([tp()],ES);var kS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const IS=Symbol.for("CircleBoundsContribution");let jS=class extends TS{};jS=kS([tp()],jS);var DS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const LS=Symbol.for("ArcBoundsContribution");let NS=class extends TS{};NS=DS([tp()],NS);var WS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const FS=Symbol.for("PathBoundsContribution");let US=class extends TS{};US=WS([tp()],US);class zS{constructor(){this.pools=[]}static identity(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}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 zS.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let n=0;n<e.length;n++)e[n]=t[n];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const HS=new class{constructor(){this.pools=[]}allocate(t,e,n,i,r,s){if(!this.pools.length)return new V(t,e,n,i,r,s);const o=this.pools.pop();return o.a=t,o.b=e,o.c=n,o.d=i,o.e=r,o.f=s,o}allocateByObj(t){if(!this.pools.length)return new V(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}},VS=new zS;var GS=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},XS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},YS=function(t,e){return function(n,i){e(n,i,t)}};function qS(t,e,n){const i=n[0],r=n[1],s=n[2];let o,a,l,h,c,u,d,f,p,g,y,v;return e===t?(t[12]=e[0]*i+e[4]*r+e[8]*s+e[12],t[13]=e[1]*i+e[5]*r+e[9]*s+e[13],t[14]=e[2]*i+e[6]*r+e[10]*s+e[14],t[15]=e[3]*i+e[7]*r+e[11]*s+e[15]):(o=e[0],a=e[1],l=e[2],h=e[3],c=e[4],u=e[5],d=e[6],f=e[7],p=e[8],g=e[9],y=e[10],v=e[11],t[0]=o,t[1]=a,t[2]=l,t[3]=h,t[4]=c,t[5]=u,t[6]=d,t[7]=f,t[8]=p,t[9]=g,t[10]=y,t[11]=v,t[12]=o*i+c*r+p*s+e[12],t[13]=a*i+u*r+g*s+e[13],t[14]=l*i+d*r+y*s+e[14],t[15]=h*i+f*r+v*s+e[15]),t}function $S(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function KS(t,e,n){const i=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5],h=e[6],c=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],y=e[13],v=e[14],m=e[15];let b=n[0],x=n[1],w=n[2],S=n[3];return t[0]=b*i+x*a+w*u+S*g,t[1]=b*r+x*l+w*d+S*y,t[2]=b*s+x*h+w*f+S*v,t[3]=b*o+x*c+w*p+S*m,b=n[4],x=n[5],w=n[6],S=n[7],t[4]=b*i+x*a+w*u+S*g,t[5]=b*r+x*l+w*d+S*y,t[6]=b*s+x*h+w*f+S*v,t[7]=b*o+x*c+w*p+S*m,b=n[8],x=n[9],w=n[10],S=n[11],t[8]=b*i+x*a+w*u+S*g,t[9]=b*r+x*l+w*d+S*y,t[10]=b*s+x*h+w*f+S*v,t[11]=b*o+x*c+w*p+S*m,b=n[12],x=n[13],w=n[14],S=n[15],t[12]=b*i+x*a+w*u+S*g,t[13]=b*r+x*l+w*d+S*y,t[14]=b*s+x*h+w*f+S*v,t[15]=b*o+x*c+w*p+S*m,t}function ZS(t,e,n){var i;const{x:r=n.x,y:s=n.y,z:o=n.z,dx:a=n.dx,dy:l=n.dy,dz:h=n.dz,scaleX:c=n.scaleX,scaleY:u=n.scaleY,scaleZ:d=n.scaleZ,alpha:f=n.alpha,beta:p=n.beta,angle:g=n.angle,anchor3d:y=e.attribute.anchor,anchor:v}=e.attribute,m=[0,0,0];if(y){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,n=e.AABBBounds;m[0]=n.x1+(n.x2-n.x1)*t}else m[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,n=e.AABBBounds;m[1]=n.x1+(n.x2-n.x1)*t}else m[1]=y[1];m[2]=null!==(i=y[2])&&void 0!==i?i:0}if(function(t){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),qS(t,t,[r+a,s+l,o+h]),qS(t,t,[m[0],m[1],m[2]]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[4],o=e[5],a=e[6],l=e[7],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*r+h*i,t[5]=o*r+c*i,t[6]=a*r+u*i,t[7]=l*r+d*i,t[8]=h*r-s*i,t[9]=c*r-o*i,t[10]=u*r-a*i,t[11]=d*r-l*i}(t,t,p),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],h=e[8],c=e[9],u=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-h*i,t[1]=o*r-c*i,t[2]=a*r-u*i,t[3]=l*r-d*i,t[8]=s*i+h*r,t[9]=o*i+c*r,t[10]=a*i+u*r,t[11]=l*i+d*r}(t,t,f),qS(t,t,[-m[0],-m[1],m[2]]),function(t,e,n){const i=n[0],r=n[1],s=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,u,d]),g){const n=VS.allocate(),i=[0,0];if(v){if("string"==typeof y[0]){const t=parseFloat(y[0])/100,n=e.AABBBounds;i[0]=n.x1+(n.x2-n.x1)*t}else i[0]=y[0];if("string"==typeof y[1]){const t=parseFloat(y[1])/100,n=e.AABBBounds;i[1]=n.x1+(n.x2-n.x1)*t}else i[1]=y[1]}qS(n,n,[i[0],i[1],0]),function(t,e,n){const i=Math.sin(n),r=Math.cos(n),s=e[0],o=e[1],a=e[2],l=e[3],h=e[4],c=e[5],u=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r+h*i,t[1]=o*r+c*i,t[2]=a*r+u*i,t[3]=l*r+d*i,t[4]=h*r-s*i,t[5]=c*r-o*i,t[6]=u*r-a*i,t[7]=d*r-l*i}(n,n,g),qS(n,n,[-i[0],-i[1],0]),KS(t,t,n)}}let JS=class{constructor(t,e,n,i,r,s){this.creator=t,this.rectBoundsContribitions=e,this.symbolBoundsContribitions=n,this.circleBoundsContribitions=i,this.arcBoundsContribitions=r,this.pathBoundsContribitions=s,this.hooks={onAttributeUpdate:new dp(["graphic"]),onSetStage:new dp(["graphic","stage"]),onRemove:new dp(["graphic"]),onAddIncremental:new dp(["graphic","group","stage"]),onClearIncremental:new dp(["graphic","group","stage"]),beforeUpdateAABBBounds:new dp(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new dp(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new U,this.tempAABBBounds2=new U}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)}onAddIncremental(t,e,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}afterUpdateAABBBounds(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}updatePathProxyAABBBounds(t,e){const n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;const i=new xp(t);return Hp(n.commandList,i,0,0),!0}updateRectAABBBounds(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this._rectBoundsContribitions||(this._rectBoundsContribitions=this.rectBoundsContribitions.getContributions()||[]),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,i),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,n,e,!1,i),n}updateGroupAABBBounds(t,e,n,i){const{width:r,height:s,path:o,clip:a=e.clip}=t;o&&o.length?o.forEach((t=>{n.union(t.AABBBounds)})):null!=r&&null!=s&&n.set(0,0,r,s),a||i.forEachChildren((t=>{n.union(t.AABBBounds)}));const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateGlyphAABBBounds(t,e,n,i){return i.getSubGraphic().forEach((t=>{n.union(t.AABBBounds)})),n}updateRichTextAABBBounds(t,e,n,i){if(!i)return n;const{width:r=e.width,height:s=e.height,maxWidth:o=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:l=e.textAlign,textBaseline:h=e.textBaseline}=t;if(r>0&&s>0)n.set(0,0,r,s);else{const t=i.getFrameCache(),{width:e,height:l}=t.getActualSize();let h=r||e||0,c=s||l||0;c="number"==typeof a&&c>a?a:c||0,h="number"==typeof o&&h>o?o:h||0,n.set(0,0,h,c)}let c=0;switch(h){case"top":c=0;break;case"middle":c=-n.height()/2;break;case"bottom":c=-n.height()}let u=0;switch(l){case"left":u=0;break;case"center":u=-n.width()/2;break;case"right":u=-n.width()}n.translate(u,c);const d=this.tempAABBBounds1,f=this.tempAABBBounds2;return d.setValue(n.x1,n.y1,n.x2,n.y2),f.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateTextAABBBounds(t,e,n,i){if(!i)return n;const{text:r=e.text}=i.attribute;Array.isArray(r)?i.updateMultilineAABBBounds(r):i.updateSingallineAABBBounds(r);const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2);const{scaleX:a=e.scaleX,scaleY:l=e.scaleY,shadowBlur:h=e.shadowBlur,strokeBoundsBuffer:c=e.strokeBoundsBuffer}=t;if(h){wb(s,h/Math.abs(a+l),!0,c),n.union(s)}return this.combindShadowAABBBounds(n,i),W(n,n,i.transMatrix),n}updatePathAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePathAABBBoundsImprecise(t,e,n,i);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this._pathBoundsContribitions||(this._pathBoundsContribitions=this.pathBoundsContribitions.getContributions()||[]),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((o=>{o.updateBounds(t,e,r,i),n.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2)}));const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updatePathAABBBoundsImprecise(t,e,n,i){if(!i)return n;const r=i.getParsedPathShape();return n.union(r.getBounds()),n}updatePyramid3dAABBBounds(t,e,n,i){if(!i)return n;const r=i.stage;if(!r||!r.camera)return n;i.findFace().vertices.forEach((t=>{const e=t[0],i=t[1];n.add(e,i)}));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updateArc3dAABBBounds(t,e,n,i){if(!i)return n;const r=i.stage;if(!r||!r.camera)return n;const{outerRadius:s=e.outerRadius,height:o=0}=t,a=s+o;n.setValue(-a,-a,a,a);const l=this.tempAABBBounds1,h=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}updatePolygonAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||this.updatePolygonAABBBoundsImprecise(t,e,n,i);const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updatePolygonAABBBoundsImprecise(t,e,n,i){const{points:r=e.points}=t;return r.forEach((t=>{n.add(t.x,t.y)})),n}updateLineAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n,i):this.updateLineAABBBoundsByPoints(t,e,n,i));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updateLineAABBBoundsByPoints(t,e,n,i){const{points:r=e.points}=t,s=n;return r.forEach((t=>{s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,n,i){const{segments:r=e.segments}=t,s=n;return r.forEach((t=>{t.points.forEach((t=>{s.add(t.x,t.y)}))})),s}updateAreaAABBBounds(t,e,n,i){this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,n,i):this.updateAreaAABBBoundsByPoints(t,e,n,i));const r=this.tempAABBBounds1,s=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:o=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===o,i),n}updateAreaAABBBoundsByPoints(t,e,n,i){const{points:r=e.points}=t,s=n;return r.forEach((t=>{var e,n;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,n,i){const{segments:r=e.segments}=t,s=n;return r.forEach((t=>{t.points.forEach((t=>{var e,n;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)}))})),s}updateCircleAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateCircleAABBBoundsImprecise(t,e,n,r):this.updateCircleAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;return s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._circleBoundsContribitions||(this._circleBoundsContribitions=this.circleBoundsContribitions.getContributions()||[]),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,n,e,!1,r),n}updateCircleAABBBoundsImprecise(t,e,n,i){const{radius:r=e.radius}=t;return n.set(-r,-r,r,r),n}updateCircleAABBBoundsAccurate(t,e,n,i){const{startAngle:r=e.startAngle,endAngle:s=e.endAngle,radius:o=e.radius}=t;return s-r>B-w?n.set(-o,-o,o,o):Cv(r,s,o,n),n}updateArcAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateArcAABBBoundsImprecise(t,e,n,r):this.updateArcAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._arcBoundsContribitions||(this._arcBoundsContribitions=this.arcBoundsContribitions.getContributions()||[]),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===a,r),n}updateArcAABBBoundsImprecise(t,e,n,i){const{outerRadius:r=e.outerRadius}=t;return n.set(-r,-r,r,r),n}updateArcAABBBoundsAccurate(t,e,n,i){let{outerRadius:r=e.outerRadius,innerRadius:s=e.innerRadius}=t;if(r<s){const t=r;r=s,s=t}let{endAngle:o=e.endAngle,startAngle:a=e.startAngle}=t;if(a>o){const t=a;a=o,o=t}return r<=w?n.set(0,0,0,0):Math.abs(o-a)>B-w?n.set(-r,-r,r,r):(Cv(a,o,r,n),Cv(a,o,s,n)),n}updateSymbolAABBBounds(t,e,n,i,r){this.updatePathProxyAABBBounds(n,r)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n,r):this.updateSymbolAABBBoundsAccurate(t,e,n,r));const s=this.tempAABBBounds1,o=this.tempAABBBounds2;s.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._symbolBoundsContribitions||(this._symbolBoundsContribitions=this.symbolBoundsContribitions.getContributions()||[]),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((i=>{i.updateBounds(t,e,s,r),n.union(s),s.setValue(o.x1,o.y1,o.x2,o.y2)}));const{lineJoin:a=e.lineJoin}=t;return this.transformAABBBounds(t,n,e,"miter"===a,r),n}updateSymbolAABBBoundsImprecise(t,e,n,i){const{size:r=e.size}=t;if(d(r))n.set(-r[0]/2,-r[1]/2,r[0]/2,r[1]/2);else{const t=r/2;n.set(-t,-t,t,t)}return n}updateSymbolAABBBoundsAccurate(t,e,n,i){if(!i)return n;const{size:r=e.size}=t;return i.getParsedPath().bounds(r,n),n}updateImageAABBBounds(t,e,n,i){if(!this.updatePathProxyAABBBounds(n,i)){const{width:i=e.width,height:r=e.height}=t;n.set(0,0,i,r)}const r=this.tempAABBBounds1,s=this.tempAABBBounds2;return r.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const n=e.shadowRoot.AABBBounds;t.union(n)}}transformAABBBounds(t,e,n,i,r){const{scaleX:s=n.scaleX,scaleY:o=n.scaleY,stroke:a=n.stroke,shadowBlur:l=n.shadowBlur,lineWidth:h=n.lineWidth,strokeBoundsBuffer:c=n.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a){wb(u,h/Math.abs(s+o),i,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(l){wb(u,l/Math.abs(s+o),i,c),e.union(u)}this.combindShadowAABBBounds(e,r),W(e,e,r.transMatrix)}};JS=GS([tp(),YS(0,ip(Xb)),YS(1,ip(lp)),YS(1,ep(PS)),YS(2,ip(lp)),YS(2,ep(MS)),YS(3,ip(lp)),YS(3,ep(IS)),YS(4,ip(lp)),YS(4,ep(LS)),YS(5,ip(lp)),YS(5,ep(FS)),XS("design:paramtypes",[Object,Object,Object,Object,Object,Object])],JS);class QS extends Kb{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function tA(t){return new sS(t)}function eA(t){return new Qx(t)}function nA(t){return new yS(t)}const iA={arc:function(t){return new SS(t)},area:function(t){return new xS(t)},circle:function(t){return new Yx(t)},group:function(t){return new Kb(t)},image:function(t){return new uS(t)},line:function(t){return new iS(t)},path:function(t){return new mS(t)},rect:tA,rect3d:function(t){return new aS(t)},symbol:function(t){return new eS(t)},text:eA,richtext:nA,polygon:function(t){return new _S(t)},shadowRoot:function(t){return new QS(t)},wrapText:function(t){return new ew(t)}},rA=eA({text:""});function sA(t){return rA.setAttributes(t),rA.AABBBounds}nA({});var oA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let aA=class{transform(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=t.transMatrix,{x:s=e.x,y:o=e.y,z:a=e.z,scaleX:l=e.scaleX,scaleY:h=e.scaleY,angle:c=e.angle,postMatrix:u}=t.attribute,d=r.onlyTranslate()&&!u,f=n.modelMatrix,p=n.camera,g={x:s,y:o,z:a,lastModelMatrix:f},y=p&&(i||function(t){const{alpha:e,beta:n}=t.attribute;return e||n}(t));if(y){const i=VS.allocate(),r=VS.allocate();ZS(r,t,e),KS(i,f||i,r),g.x=0,g.y=0,g.z=0,n.modelMatrix=i,n.setTransform(1,0,0,1,0,0,!0),VS.free(r)}if(d&&!f){const i=t.getOffsetXY(e);g.x+=i.x,g.y+=i.y,g.z=a,n.setTransformForCurrent()}else if(y)g.x=0,g.y=0,g.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(p&&n.project){const i=t.getOffsetXY(e);g.x+=i.x,g.y+=i.y,this.transformWithoutTranslate(n,g.x,g.y,g.z,l,h,c)}else n.transformFromMatrix(t.transMatrix,!0),g.x=0,g.y=0,g.z=0;return g}transformUseContext2d(t,e,n,i){const r=i.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,o=i.project(0,0,n),a=i.project(r,0,n),l=i.project(r,s,n),h={x:0,y:0},c={x:r,y:0},u={x:r,y:s};i.camera=null;const d=1/(h.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*h.y),f=-(h.y*(l.x-a.x)-c.y*l.x+u.y*a.x+(c.y-u.y)*o.x)*d,p=(c.y*l.y+h.y*(a.y-l.y)-u.y*a.y+(u.y-c.y)*o.y)*d,g=(h.x*(l.x-a.x)-c.x*l.x+u.x*a.x+(c.x-u.x)*o.x)*d,y=-(c.x*l.y+h.x*(a.y-l.y)-u.x*a.y+(u.x-c.x)*o.y)*d,v=(h.x*(u.y*a.x-c.y*l.x)+h.y*(c.x*l.x-u.x*a.x)+(u.x*c.y-c.x*u.y)*o.x)*d,m=(h.x*(u.y*a.y-c.y*l.y)+h.y*(c.x*l.y-u.x*a.y)+(u.x*c.y-c.x*u.y)*o.y)*d;i.setTransform(f,p,g,y,v,m,!0)}}restoreTransformUseContext2d(t,e,n,i){this.camera&&(i.camera=this.camera)}transformWithoutTranslate(t,e,n,i,r,s,o){const a=t.project(e,n,i);t.translate(a.x,a.y,!1),t.scale(r,s,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}};function lA(t,e,n,i,r){var s;const{offsetX:o=0,offsetY:a=0,offsetZ:l=0,mode:h="none",drawConnect:c=!1,zeroX:u=0,zeroY:d=0}=r||{};if(c&&"none"===h)return;if(!e)return;let f=!0;const{curves:p}=e;if(n>=1){if(c){let e,n=!0;p.forEach(((i,r)=>{var s;let h=i.p0;if(i.originP1!==i.originP2){if(e&&e.originP1===e.originP2&&(h=e.p0),i.defined)n||(t.lineTo(h.x+o,h.y+a,l),n=!n);else{const{originP1:e,originP2:r}=i;let c;if(e&&!1!==e.defined?c=h:e&&!1!==r.defined&&(c=null!==(s=i.p3)&&void 0!==s?s:i.p1),n){n=!n;const e=c?c.x:i.p0.x,r=c?c.y:i.p0.y;t.moveTo(e+o,r+a,l)}else c&&(n=!n,t.lineTo(c.x+o,c.y+a,l))}e=i}else e=i}))}else p.forEach((e=>{e.defined?(f&&t.moveTo(e.p0.x+o,e.p0.y+a,l),hA(t,e,1,r),f=!1):f=!0}));return}if(n<=0)return;let g;"x"===i?g=Lp.ROW:"y"===i?g=Lp.COLUMN:"auto"===i&&(g=e.direction);const y=n*e.tryUpdateLength(g);let v=0,m=!0,b=null;for(let e=0,n=p.length;e<n;e++){const n=p[e],i=n.getLength(g),h=(y-v)/i;if(v+=i,h<0)break;if(c){let e=n.p0;if(n.originP1===n.originP2){b=n;continue}if(b&&b.originP1===b.originP2&&(e=b.p0),n.defined)m||(t.lineTo(e.x+o,e.y+a,l),m=!m);else{const{originP1:i,originP2:r}=n;let h;if(i&&!1!==i.defined?h=e:i&&!1!==r.defined&&(h=null!==(s=n.p3)&&void 0!==s?s:n.p1),m){m=!m;const e=h?h.x:n.p0.x,i=h?h.y:n.p0.y;t.moveTo(e+o,i+a,l)}else h&&(m=!m,t.lineTo(h.x+o,h.y+a,l))}b=n}else{if(!n.defined){f=!0;continue}f&&t.moveTo(n.p0.x+o,n.p0.y+a,l),hA(t,n,O(h,1),r),f=!1}}}function hA(t,e,n,i){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};if(1===n)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[i]=qp(e,n);t.bezierCurveTo(r+i.p1.x,s+i.p1.y,r+i.p2.x,s+i.p2.y,r+i.p3.x,s+i.p3.y,o)}else{const i=e.getPointAt(n);t.lineTo(r+i.x,s+i.y,o)}}aA=oA([tp()],aA);var cA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let uA=class extends aA{constructor(){super(...arguments),this.numberType=Db}draw(t,e,n,i){const{context:r}=n;r.highPerformanceSave();const s=Qy(t,null==i?void 0:i.theme).line,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,bx(t,r,a,l)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&VS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,f,p,g){var y,v,m,b,x;if(!e)return;t.beginPath();const w=null!==(y=this.z)&&void 0!==y?y:0;lA(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:w}),f.cache&&!d(f.cache)&&f.attribute.curveType&&f.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowStyle&&t.setShadowStyle(f,o,a);const{x:S=0,x:A=0}=o;!1!==n&&(p?p(t,o,a):r&&(t.setCommonStyle(f,o,S-c,A-u,a),t.fill())),!1!==i&&(g?g(t,o,a):s&&(t.setStrokeStyle(f,o,S-c,A-u,a),t.stroke()));let{connectedType:_,connectedX:B,connectedY:T,connectedStyle:C}=o;if(d(a)?(_=null!==(v=null!=_?_:a[0].connectedType)&&void 0!==v?v:a[1].connectedType,B=null!==(m=null!=B?B:a[0].connectedX)&&void 0!==m?m:a[1].connectedX,T=null!==(b=null!=T?T:a[0].connectedY)&&void 0!==b?b:a[1].connectedY,C=null!==(x=null!=C?C:a[0].connectedStyle)&&void 0!==x?x:a[1].connectedStyle):(_=null!=_?_:a.connectedType,B=null!=B?B:a.connectedX,T=null!=T?T:a.connectedY,C=null!=C?C:a.connectedStyle),"connect"!==_&&"zero"!==_&&(_="none"),"none"!==_){t.beginPath(),lA(t.camera?t:t.nativeContext,e,l,h,{offsetX:c,offsetY:u,offsetZ:w,drawConnect:!0,mode:_,zeroX:B,zeroY:T});const y=[];d(a)?a.forEach((t=>y.push(t))):y.push(a),y.push(o),!1!==n&&(p?p(t,o,a):r&&(t.setCommonStyle(f,C,S-c,A-u,y),t.fill())),!1!==i&&(g?g(t,o,a):s&&(t.setStrokeStyle(f,C,S-c,A-u,y),t.stroke()))}return!1}drawShape(t,e,n,i,r,s,o,a){const l=Qy(t,null==s?void 0:s.theme).line,{fill:h=l.fill,stroke:c=l.stroke,opacity:u=l.opacity,fillOpacity:d=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:p=l.lineWidth,visible:g=l.visible}=t.attribute,y=gx(u,d,h),v=vx(u,f),m=fx(h),b=px(c,p);if(!t.valid||!g)return;if(!m&&!b)return;if(!(y||v||o||a))return;if(t.shouldUpdateShape()){const{points:e,segments:n,curveType:i=l.curveType}=t.attribute,r=e;if(n&&n.length){let e,r;t.cache=n.map(((t,n)=>(1===n?e={x:r.endX,y:r.endY,defined:r.curves[r.curves.length-1].defined}:n>1&&(e.x=r.endX,e.y=r.endY,e.defined=r.curves[r.curves.length-1].defined),r=mg(t.points,i,{startPoint:e}),r)))}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=mg(r,i)}t.clearUpdateShapeTag()}const{clipRange:x=l.clipRange,clipRangeByDimension:w=l.clipRangeByDimension}=t.attribute;if(Array.isArray(t.cache))if(1===x){let r=!1;t.cache.forEach(((s,u)=>{r||(r=this.drawSegmentItem(e,s,!!h,!!c,d,f,t.attribute.segments[u],[l,t.attribute],x,w,n,i,t,o,a))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),s=x*r;let u=0,p=!1;t.cache.forEach(((r,g)=>{if(p)return;const y=r.getLength(),v=(s-u)/y;u+=y,v>0&&(p=this.drawSegmentItem(e,r,!!h,!!c,d,f,t.attribute.segments[g],[l,t.attribute],O(v,1),w,n,i,t,o,a))}))}else this.drawSegmentItem(e,t.cache,!!h,!!c,d,f,t.attribute,l,x,w,n,i,t,o,a)}};function dA(t,e,n,i){if(e.length<2)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0,mode:a}=i||{};let l=e[0];t.moveTo(l.p0.x+r,l.p0.y+s,o),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+r,h.y+s,o),l=n[n.length-1],t.lineTo(l.p0.x+r,l.p0.y+s,o),l=n[0],h=l.p3||l.p1,t.lineTo(h.x+r,h.y+s,o),t.closePath()}function fA(t,e,n,i){const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+r,e.p0.y+s,o),pA(t,e,1,i),a=!1):a=!0})),a=!0;for(let e=n.length-1;e>=0;e--){const l=n[e];l.defined?(a&&t.lineTo(l.p0.x+r,l.p0.y+s,o),pA(t,l,1,i),a=!1):a=!0}t.closePath()}function pA(t,e,n,i){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:o=0}=i||{};if(1===n)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,o):t.lineTo(r+e.p1.x,s+e.p1.y,o);else if(e.p2&&e.p3){const[i]=qp(e,n);t.bezierCurveTo(r+i.p1.x,s+i.p1.y,r+i.p2.x,s+i.p2.y,r+i.p3.x,s+i.p3.y,o)}else{const i=e.getPointAt(n);t.lineTo(r+i.x,s+i.y,o)}}uA=cA([tp()],uA);var gA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},yA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vA=function(t,e){return function(n,i){e(n,i,t)}};function mA(t,e,n){switch(e){case"linear":default:return ng(t,n);case"basis":return sg(t,n);case"monotoneX":return dg(t,n);case"monotoneY":return fg(t,n);case"step":return gg(t,.5,n);case"stepBefore":return gg(t,0,n);case"stepAfter":return gg(t,1,n);case"linearClosed":return vg(t,n)}}let bA=class{constructor(t){this.areaRenderContribitions=t,this.numberType=Mb}drawShape(t,e,n,i,r,s,o,a){var l,h,c,u,d,f;const p=Qy(t,null==s?void 0:s.theme).area,{fill:g=p.fill,fillOpacity:y=p.fillOpacity,opacity:v=p.opacity,visible:m=p.visible,z:b=p.z,background:x,stroke:w=t.attribute.stroke,lineWidth:S=p.lineWidth,strokeOpacity:A=p.strokeOpacity}=t.attribute,_=gx(v,y,g),B=fx(g,x),T=px(w,S),C=vx(v,A);if(!t.valid||!m)return;if(!B&&!T)return;if(!(_||o||C||a))return;const{clipRange:P=p.clipRange}=t.attribute;if(t.shouldUpdateShape()){const{points:e,segments:n,curveType:i=p.curveType}=t.attribute;if(n&&n.length){let e,r;const s=n.map(((t,n)=>(1===n?e={x:r.endX,y:r.endY}:n>1&&(e.x=r.endX,e.y=r.endY),r=mA(t.points,i,{startPoint:e}),r)));let o;const a=[];for(let t=n.length-1;t>=0;t--){const e=n[t].points,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=n[t-1].points,i=e[e.length-1];i&&r.push({x:null!==(c=i.x1)&&void 0!==c?c:i.x,y:null!==(u=i.y1)&&void 0!==u?u:i.y})}o=mA(r,"stepBefore"===i?"stepAfter":"stepAfter"===i?"stepBefore":i),a.unshift(o)}t.cacheArea=a.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!e||!e.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const n=e,r=[];for(let t=e.length-1;t>=0;t--)r.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(f=e[t].y1)&&void 0!==f?f:e[t].y});const s=mA(n,i),o=mA(r,"stepBefore"===i?"stepAfter":"stepAfter"===i?"stepBefore":i);t.cacheArea={top:s,bottom:o}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea))if(1===P){let s=!1;t.cacheArea.forEach(((l,h)=>{s||(s=this.drawSegmentItem(e,l,B,y,T,A,t.attribute.segments[h],[p,t.attribute],P,n,i,b,t,r,o,a))}))}else{const s=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=P*s;let h=0,c=!1;t.cacheArea.forEach(((s,u)=>{if(c)return;const d=s.top.getLength(),f=(l-h)/d;h+=d,f>0&&(c=this.drawSegmentItem(e,s,B,y,T,A,t.attribute.segments[u],[p,t.attribute],O(f,1),n,i,b,t,r,o,a))}))}else this.drawSegmentItem(e,t.cacheArea,B,y,T,A,t.attribute,p,P,n,i,b,t,r,o,a)}draw(t,e,n,i){const{context:r}=n,s=Qy(t,null==i?void 0:i.theme).area;let{x:o=s.x,y:a=s.y}=t.attribute;if(r.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);bx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,p,g){let y=!1;return y=y||this._drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,!1,p,g),y=y||this._drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,d,f,!0,p,g),y}_drawSegmentItem(t,e,n,i,r,s,o,a,l,h,c,u,f,p,g,y,v){var m,b,x,w;let{connectedType:S,connectedX:A,connectedY:_,connectedStyle:B}=o;const C=[];if(g&&(d(a)?(S=null!==(m=null!=S?S:a[0].connectedType)&&void 0!==m?m:a[1].connectedType,A=null!==(b=null!=A?A:a[0].connectedX)&&void 0!==b?b:a[1].connectedX,_=null!==(x=null!=_?_:a[0].connectedY)&&void 0!==x?x:a[1].connectedY,B=null!==(w=null!=B?B:a[0].connectedStyle)&&void 0!==w?w:a[1].connectedStyle):(S=null!=S?S:a.connectedType,A=null!=A?A:a.connectedX,_=null!=_?_:a.connectedY,B=null!=B?B:a.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),d(a)?a.forEach((t=>C.push(t))):C.push(a),C.push(o)),g&&"none"===S)return!1;if(!e)return;t.beginPath();const{points:P,segments:R}=f.attribute;let O,M,E=Lp.ROW;if(R){const t=R[R.length-1];M=R[0].points[0],O=t.points[t.points.length-1]}else M=P[0],O=P[P.length-1];E=T(O.x-M.x)>T(O.y-M.y)?Lp.ROW:Lp.COLUMN,function(t,e,n,i){var r;const{drawConnect:s=!1,mode:o="none"}=i||{};if(s&&"none"===o)return;const{top:a,bottom:l}=e;if(n>=1){const e=[],n=[];let r=!0;if(s){let r,s,o=!0;const h=a.curves.length;a.curves.forEach(((a,c)=>{const u=l.curves[h-c-1];let d=a,f=u;if(a.originP1===a.originP2)return r=a,void(s=u);if(r&&r.originP1===r.originP2&&(d=r,f=s),a.defined)o||(e.push(d),n.push(f),dA(t,e,n,i),e.length=0,n.length=0,o=!o);else{const{originP1:r,originP2:s}=a;let l,h;r&&!1!==r.defined?(l=d,h=f):r&&!1!==s.defined&&(l=a,h=u),o?(o=!o,e.push(l||a),n.push(h||u)):l&&(o=!o,e.push(l||a),n.push(h||u),dA(t,e,n,i),e.length=0,n.length=0)}r=a})),dA(t,e,n,i)}else{for(let s=0,o=a.curves.length;s<o;s++){const h=a.curves[s];r!==h.defined?(r?(fA(t,e,n,i),e.length=0,n.length=0):(e.push(h),n.push(l.curves[o-s-1])),r=!r):r&&(e.push(h),n.push(l.curves[o-s-1]))}fA(t,e,n,i)}return}if(n<=0)return;let{direction:h}=i||{};const{curves:c}=a,u=null!==(r=c[c.length-1].p3)&&void 0!==r?r:c[c.length-1].p1,d=T(u.x-c[0].p0.x),f=T(u.y-c[0].p0.y);h=null!=h?h:d>f?Lp.ROW:Lp.COLUMN,Number.isFinite(d)||(h=Lp.COLUMN),Number.isFinite(f)||(h=Lp.ROW);const p=n*(h===Lp.ROW?d:f);let g=0,y=!0;const v=[],m=[];let b,x,w=!0;for(let e=0,n=a.curves.length;e<n;e++){const r=a.curves[e],o=r.getLength(h),c=(p-g)/o;if(c<0)break;if(g+=o,s){const s=l.curves[n-e-1];let o=r,a=s;if(r.originP1===r.originP2){b=r,x=s;continue}if(b&&b.originP1===b.originP2&&(o=b,a=x),r.defined)w||(v.push(o),m.push(a),dA(t,v,m,i),v.length=0,m.length=0,w=!w);else{const{originP1:e,originP2:n}=r;let l,h;e&&!1!==e.defined?(l=o,h=a):e&&!1!==n.defined&&(l=r,h=s),w?(w=!w,v.push(l||r),m.push(h||s)):l&&(w=!w,v.push(l||r),m.push(h||s),dA(t,v,m,i),v.length=0,m.length=0)}b=r}else{let s=null,o=null;y!==r.defined?(y?(fA(t,v,m,i),v.length=0,m.length=0):(s=r,o=l.curves[n-e-1]),y=!y):y&&(s=r,o=l.curves[n-e-1]),s&&o&&(c<1&&(s=s.p2&&s.p3?qp(s,c)[0]:Kp(s,c)[0],o=o.p2&&o.p3?qp(o,1-c)[1]:Kp(o,1-c)[1]),s.defined=y,o.defined=y,v.push(s),m.push(o)),s=null,o=null}}s?dA(t,v,m,i):fA(t,v,m,i)}(t.camera?t:t.nativeContext,e,l,{offsetX:h,offsetY:c,offsetZ:u,direction:E,drawConnect:g,mode:S,zeroX:A,zeroY:_}),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[],this._areaRenderContribitions.sort(((t,e)=>e.order-t.order))),this._areaRenderContribitions.forEach((e=>{e.time===Wp.beforeFillStroke&&e.drawShape(f,t,h,c,!!i,!1,n,!1,a,p,y,null,{attribute:o})})),t.setShadowStyle&&t.setShadowStyle(f,o,a);const{x:k=0,x:I=0}=o;if(!1!==n&&(y?y(t,o,a):i&&(t.setCommonStyle(f,g?B:o,k-h,I-c,g?C:a),t.fill())),this._areaRenderContribitions||(this._areaRenderContribitions=this.areaRenderContribitions.getContributions()||[]),this._areaRenderContribitions.forEach((e=>{e.time===Wp.afterFillStroke&&e.drawShape(f,t,h,c,!!i,!1,n,!1,a,p,y,null,{attribute:o})})),!1!==r)if(v)v(t,o,a);else{const{stroke:n=a&&a[1]&&a[1].stroke}=o;d(n)&&(n[0]||n[2])&&!1===n[1]&&(t.beginPath(),lA(t.camera?t:t.nativeContext,n[0]?e.top:e.bottom,l,E===Lp.ROW?"x":"y",{offsetX:h,offsetY:c,offsetZ:u,drawConnect:g,mode:S,zeroX:A,zeroY:_})),t.setStrokeStyle(f,g?B:o,k-h,I-c,g?C:a),t.stroke()}return!1}};bA=gA([tp(),vA(0,ip(lp)),vA(0,ep(Px)),yA("design:paramtypes",[Object])],bA);var xA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},wA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},SA=function(t,e){return function(n,i){e(n,i,t)}};let AA=class extends aA{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=Lb}drawShape(t,e,n,i,r,s,o,a){var l,h;const c=Qy(t,null==s?void 0:s.theme).path,{fill:u=c.fill,stroke:d=c.stroke,fillOpacity:f=c.fillOpacity,strokeOpacity:p=c.strokeOpacity,opacity:g=c.opacity,background:y,lineWidth:v=c.lineWidth,visible:m=c.visible,x:b=c.x,y:x=c.y}=t.attribute,w=null!==(l=this.z)&&void 0!==l?l:0,S=gx(g,f,u),A=vx(g,p),_=fx(u,y),B=px(d,v);if(t.valid&&m&&(_||B)&&(S||A||o||a||y)){if(e.beginPath(),t.pathShape)Hp(t.pathShape.commandList,e,n,i,1,1,w);else{Hp((null!==(h=t.attribute.path)&&void 0!==h?h:c.path).commandList,e,n,i,1,1,w)}this._pathRenderContribitions||(this._pathRenderContribitions=this.pathRenderContribitions.getContributions()||[],this._pathRenderContribitions.sort(((t,e)=>e.order-t.order))),this._pathRenderContribitions.forEach((s=>{s.time===Wp.beforeFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,c,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,c),B&&(a?a(e,t.attribute,c):A&&(e.setStrokeStyle(t,t.attribute,b-n,x-i,c),e.stroke())),_&&(o?o(e,t.attribute,c):S&&(e.setCommonStyle(t,t.attribute,b-n,x-i,c),e.fill())),this._pathRenderContribitions.forEach((s=>{s.time===Wp.afterFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,c,r,o,a)}))}}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=Qy(t,null==i?void 0:i.theme).path,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,bx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&VS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}};AA=xA([tp(),SA(0,ip(lp)),SA(0,ep(Ex)),wA("design:paramtypes",[Object])],AA);const _A=S/2;function BA(t,e,n,i,r,s){let o;if(f(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){const t=s;switch(t.length){case 0:o=[0,0,0,0];break;case 1:o=[t[0],t[0],t[0],t[0]];break;case 2:case 3:o=[t[0],t[1],t[0],t[1]];break;default:o=t.slice(0,5)}}else o=[0,0,0,0];if(i<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(e,n,i,r);const[a,l,h,c]=[[e,n],[e+i,n],[e+i,n+r],[e,n+r]],u=Math.min(i/2,r/2),d=[Math.min(u,o[0]),Math.min(u,o[1]),Math.min(u,o[2]),Math.min(u,o[3])],p=[a[0]+d[0],a[1]],g=[a[0],a[1]+d[0]],y=[l[0]-d[1],l[1]],v=[l[0],l[1]+d[1]],m=[h[0]-d[2],h[1]],x=[h[0],h[1]-d[2]],w=[c[0]+d[3],c[1]],A=[c[0],c[1]-d[3]];if(t.moveTo(p[0],p[1]),t.lineTo(y[0],y[1]),!b(y,v)){const e=y[0],n=y[1]+d[1];t.arc(e,n,d[1],-_A,0,!1)}if(t.lineTo(x[0],x[1]),!b(m,x)){const e=x[0]-d[2],n=x[1];t.arc(e,n,d[2],0,_A,!1)}if(t.lineTo(w[0],w[1]),!b(w,A)){const e=w[0],n=w[1]-d[3];t.arc(e,n,d[3],_A,S,!1)}if(t.lineTo(g[0],g[1]),!b(p,g)){const e=p[0],n=p[1]+d[0];t.arc(e,n,d[0],S,S+_A,!1)}return t.closePath(),t}var TA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PA=function(t,e){return function(n,i){e(n,i,t)}};let RA=class{constructor(t){this.rectRenderContribitions=t,this.type="rect",this.numberType=Fb}drawShape(t,e,n,i,r,s,o,a){const l=Qy(t,null==s?void 0:s.theme).rect,{fill:h=l.fill,background:c,stroke:u=l.stroke,width:f=l.width,height:p=l.height,cornerRadius:g=l.cornerRadius,opacity:y=l.opacity,fillOpacity:v=l.fillOpacity,lineWidth:m=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible,x:w=l.x,y:S=l.y}=t.attribute,A=yx(y,v,f,p,h),_=mx(y,b,f,p),B=fx(h,c),T=px(u,m);if(!t.valid||!x)return;if(!B&&!T)return;if(!(A||_||o||a||c))return;0===g||d(g)&&g.every((t=>0===t))?(e.beginPath(),e.rect(n,i,f,p)):(e.beginPath(),BA(e,n,i,f,p,g)),this._rectRenderContribitions||(this._rectRenderContribitions=this.rectRenderContribitions.getContributions()||[],this._rectRenderContribitions.sort(((t,e)=>e.order-t.order)));const C={doFill:B,doStroke:T};this._rectRenderContribitions.forEach((s=>{s.time===Wp.beforeFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a,C)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),C.doFill&&(o?o(e,t.attribute,l):A&&(e.setCommonStyle(t,t.attribute,w-n,S-i,l),e.fill())),C.doStroke&&(a?a(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,w-n,S-i,l),e.stroke())),this._rectRenderContribitions.forEach((s=>{s.time===Wp.afterFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=Qy(t,null==i?void 0:i.theme).rect;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);bx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};RA=TA([tp(),PA(0,ip(lp)),PA(0,ep(Ix)),CA("design:paramtypes",[Object])],RA);var OA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},MA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},EA=function(t,e){return function(n,i){e(n,i,t)}};let kA=class extends aA{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Hb}drawShape(t,e,n,i,r,s,o,a){var l;const h=Qy(t,null==s?void 0:s.theme).symbol,{size:c=h.size,fill:u=h.fill,background:d,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,opacity:g=h.opacity,lineWidth:y=h.lineWidth,stroke:v=h.stroke,visible:m=h.visible,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:S=h.scaleY}=t.attribute,A=gx(g,f,u),_=vx(g,p),B=fx(u,d),T=px(v,y);if(!t.valid||!m)return;if(!B&&!T)return;if(!(A||_||o||a||d))return;const C=t.getParsedPath();if(!C)return;const{keepDirIn3d:P=h.keepDirIn3d}=t.attribute,R=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),P&&e.camera&&e.project){const r=e.project(n,i,R),s=e.camera;e.camera=null,!1===C.draw(e,c,r.x,r.y,void 0,((r,s)=>{s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,b-n,x-i),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(b-n)/w,(x-i)/S),e.stroke()))}))&&e.closePath(),e.camera=s}else!1===C.draw(e,c,n,i,R,((r,s)=>{s.fill&&(o?o(e,t.attribute,h):(e.setCommonStyle(t,s,b-n,x-i),e.fill())),s.stroke&&(a?a(e,t.attribute,h):(e.setStrokeStyle(t,s,(b-n)/w,(x-i)/S),e.stroke()))}))&&e.closePath();this._symbolRenderContribitions||(this._symbolRenderContribitions=this.symbolRenderContribitions.getContributions()||[],this._symbolRenderContribitions.sort(((t,e)=>e.order-t.order))),this._symbolRenderContribitions.forEach((s=>{s.time===Wp.beforeFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,h,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),B&&!C.isSvg&&(o?o(e,t.attribute,h):A&&(e.setCommonStyle(t,t.attribute,b-n,x-i,h),e.fill())),T&&!C.isSvg&&(a?a(e,t.attribute,h):_&&(e.setStrokeStyle(t,t.attribute,(b-n)/w,(x-i)/S,h),e.stroke())),this._symbolRenderContribitions.forEach((s=>{s.time===Wp.afterFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,h,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=Qy(t,null==i?void 0:i.theme).symbol,o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,bx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&VS.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}};kA=OA([tp(),EA(0,ip(lp)),EA(0,ep(jx)),MA("design:paramtypes",[Object])],kA);var IA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},DA=function(t,e){return function(n,i){e(n,i,t)}};let LA=class extends aA{constructor(t){super(),this.textRenderContribitions=t,this.numberType=Vb}drawShape(t,e,n,i,r,s,o,a){var l;const h=Qy(t,null==s?void 0:s.theme).text,{text:c,fill:u=h.fill,stroke:d=h.stroke,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,opacity:g=h.opacity,lineWidth:y=h.lineWidth,visible:v=h.visible,underline:m=h.underline,lineThrough:b=h.lineThrough,keepDirIn3d:x=h.keepDirIn3d,direction:w=h.direction,fontSize:S=h.fontSize,textBaseline:A=h.textBaseline,textAlign:_=h.textAlign,x:B=h.x,y:T=h.y}=t.attribute,C=null!==(l=t.attribute.lineHeight)&&void 0!==l?l:S,P=gx(g,f,u),O=vx(g,p),M=fx(u),E=px(d,y);if(!t.valid||!v)return;if(!(M||E||P||O))return;const k=!x,I=this.z||0;if(e.beginPath(),!this._textBeforeRenderContribitions){const t=this.textRenderContribitions.getContributions()||[];t.sort(((t,e)=>e.order-t.order)),this._textBeforeRenderContribitions=[],this._textAfterRenderContribitions=[],t.forEach((t=>{t.time===Wp.beforeFillStroke?this._textBeforeRenderContribitions.push(t):this._textAfterRenderContribitions.push(t)}))}this._textBeforeRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,M,E,P,O,h,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),k&&this.transformUseContext2d(t,h,I,e);const j=(r,s,l,c)=>{let u=n+s;const d=i+l;if(c){e.highPerformanceSave(),u+=S;const t=HS.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,u,d),e.transformFromMatrix(t,!0),HS.free(t)}E&&(a?a(e,t.attribute,h):O&&(e.setStrokeStyle(t,t.attribute,B-n,T-i,h),e.strokeText(r,u,d,I))),M&&(o?o(e,t.attribute,h):P&&(e.setCommonStyle(t,t.attribute,B-n,T-i,h),e.fillText(r,u,d,I),this.drawUnderLine(m,b,t,u,d,I,h,e))),c&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(Array.isArray(c))if(e.setTextStyleWithoutAlignBaseline(t.attribute,h,I),"horizontal"===w){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:l}=r.bbox;E&&(a?a(e,t.attribute,h):O&&(e.setStrokeStyle(t,t.attribute,B-n,T-i,h),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+n,(t.topOffset||0)+l+i,I)})))),M&&(o?o(e,t.attribute,h):P&&(e.setCommonStyle(t,t.attribute,B-n,T-i,h),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+n,(r.topOffset||0)+l+i,I),this.drawMultiUnderLine(m,b,t,(r.leftOffset||0)+n,(r.topOffset||0)+l+i,I,r.width,h,e)}))))}else{const n=t.cache,{verticalList:i}=n;e.textAlign="left",e.textBaseline="top";const r=C*i.length;let s=0;i.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);s=R(e,s)}));let o=0,a=0;"bottom"===A?a=-r:"middle"===A&&(a=-r/2),"center"===_?o-=s/2:"right"===_&&(o-=s),i.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),i=s-n;let l=o;"center"===_?l+=i/2:"right"===_&&(l+=i),t.forEach((t=>{const{text:n,width:i,direction:s}=t;j(n,r-(e+1)*C+a,l,s),l+=i}))}))}else{const n=t.cache;if("horizontal"===w){e.setTextStyle(t.attribute,h,I);const n=t.clipedText;let i=0;C!==S&&("top"===A?i=(C-S)/2:"middle"===A||"bottom"===A&&(i=-(C-S)/2)),j(n,0,i,0)}else if(n){e.setTextStyleWithoutAlignBaseline(t.attribute,h,I);const{verticalList:i}=n;let r=0;const s=i[0].reduce(((t,e)=>t+(e.width||0)),0);let o=0;"bottom"===A?o=-C:"middle"===A&&(o=-C/2),"center"===_?r-=s/2:"right"===_&&(r-=s),e.textAlign="left",e.textBaseline="top",i[0].forEach((t=>{const{text:e,width:n,direction:i}=t;j(e,o,r,i),r+=n}))}}k&&this.restoreTransformUseContext2d(t,h,I,e),this._textAfterRenderContribitions.forEach((s=>{s.drawShape(t,e,n,i,M,E,P,O,h,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=Qy(t,null==i?void 0:i.theme).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,r,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.z=u,this.drawShape(t,r,h,c,n,i),this.z=0,r.modelMatrix=d,r.highPerformanceRestore()}drawUnderLine(t,e,n,i,r,s,o,a){if(e+t<=0)return;const{textAlign:l=o.textAlign,textBaseline:h=o.textBaseline,fontSize:c=o.fontSize,fill:u=o.fill,opacity:d=o.opacity,fillOpacity:f=o.fillOpacity}=n.attribute,p=n.clipedWidth,g=$x(l,p),y=Kx(h,c,c),v={lineWidth:0,stroke:u,opacity:d,strokeOpacity:f};if(t){v.lineWidth=t,a.setStrokeStyle(n,v,i,r,o),a.beginPath();const e=r+y+c;a.moveTo(i+g,e,s),a.lineTo(i+g+p,e,s),a.stroke()}if(e){v.lineWidth=e,a.setStrokeStyle(n,v,i,r,o),a.beginPath();const t=r+y+c/2;a.moveTo(i+g,t,s),a.lineTo(i+g+p,t,s),a.stroke()}}drawMultiUnderLine(t,e,n,i,r,s,o,a,l){if(e+t<=0)return;const{textAlign:h=a.textAlign,fontSize:c=a.fontSize,fill:u=a.fill,opacity:d=a.opacity,fillOpacity:f=a.fillOpacity}=n.attribute,p=$x(h,o),g=Kx("alphabetic",c,c),y={lineWidth:0,stroke:u,opacity:d,strokeOpacity:f};let v=-3;if(t){y.lineWidth=t,l.setStrokeStyle(n,y,i,r,a),l.beginPath();const e=r+g+c+v;l.moveTo(i+p,e,s),l.lineTo(i+p+o,e,s),l.stroke()}if(v=-1,e){y.lineWidth=e,l.setStrokeStyle(n,y,i,r,a),l.beginPath();const t=r+g+c/2+v;l.moveTo(i+p,t,s),l.lineTo(i+p+o,t,s),l.stroke()}}};LA=IA([tp(),DA(0,ip(lp)),DA(0,ep(Dx)),jA("design:paramtypes",[Object])],LA);var NA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let WA=class{};function FA(t,e,n,i){t.moveTo(e[0].x+n,e[0].y+i);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+n,e[r].y+i)}function UA(t,e){return Math.sqrt(t*t+e*e)}function zA(t,e,n,i,r){const s=e/n;return{x:t.x-i*s,y:t.y-r*s}}WA=NA([tp()],WA);var HA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},VA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},GA=function(t,e){return function(n,i){e(n,i,t)}};let XA=class{constructor(t){this.polygonRenderContribitions=t,this.numberType=Nb}drawShape(t,e,n,i,r,s,o,a){const l=Qy(t,null==s?void 0:s.theme).polygon,{points:h=l.points,fill:c=l.fill,stroke:u=l.stroke,cornerRadius:f=l.cornerRadius,fillOpacity:p=l.fillOpacity,background:g,strokeOpacity:y=l.strokeOpacity,lineWidth:v=l.lineWidth,opacity:m=l.opacity,visible:b=l.visible,x:x=l.x,y:w=l.y}=t.attribute,S=gx(m,p,c),A=vx(m,y),_=fx(c,g),B=px(u,v);t.valid&&b&&(_||B)&&(S||A||o||a||g)&&(e.beginPath(),f<=0||d(f)&&f.every((t=>0===t))?FA(e.camera?e:e.nativeContext,h,n,i):function(t,e,n,i,r){var s;if(e.length<3)FA(t,e,n,i);else for(let o=0;o<e.length;o++){const a=e[o],l=e[(o+1)%e.length],h=e[(o+2)%e.length],c=l.x-a.x,u=l.y-a.y,d=l.x-h.x,f=l.y-h.y,p=(Math.atan2(u,c)-Math.atan2(f,d))/2,g=Math.abs(Math.tan(p));let y=Array.isArray(r)?null!==(s=r[(o+1)%e.length])&&void 0!==s?s:0:r,v=y/g;const m=UA(c,u),b=UA(d,f),x=Math.min(m,b);v>x&&(v=x,y=x*g);const w=zA(l,v,m,c,u),S=zA(l,v,b,d,f),A=2*l.x-w.x-S.x,_=2*l.y-w.y-S.y,B=UA(A,_),T=zA(l,UA(v,y),B,A,_);let C=Math.atan2(w.y-T.y,w.x-T.x);const P=Math.atan2(S.y-T.y,S.x-T.x);let R=P-C;R<0&&(C=P,R=-R),R>Math.PI&&(R-=Math.PI),0===o?t.moveTo(w.x+n,w.y+i):t.lineTo(w.x+n,w.y+i),R&&t.arcTo(l.x+n,l.y+i,S.x+n,S.y+i,y),t.lineTo(S.x+n,S.y+i)}}(e.camera?e:e.nativeContext,h,n,i,f),e.closePath(),this._polygonRenderContribitions||(this._polygonRenderContribitions=this.polygonRenderContribitions.getContributions()||[],this._polygonRenderContribitions.sort(((t,e)=>e.order-t.order))),this._polygonRenderContribitions.forEach((s=>{s.time===Wp.beforeFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),_&&(o?o(e,t.attribute,l):p&&(e.setCommonStyle(t,t.attribute,x-n,w-i,l),e.fill())),B&&(a?a(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,x-n,w-i,l),e.stroke())),this._polygonRenderContribitions.forEach((s=>{s.time===Wp.afterFillStroke&&s.drawShape(t,e,n,i,_,B,S,A,l,r,o,a)})))}draw(t,e,n,i){const{context:r}=n;if(!r)return;r.highPerformanceSave();const s=Qy(t,null==i?void 0:i.theme).polygon;let{x:o=s.x,y:a=s.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(s);o+=e.x,a+=e.y,r.setTransformForCurrent()}else o=0,a=0,r.transformFromMatrix(t.transMatrix,!0);bx(t,r,o,a,0,i)||this.drawShape(t,r,o,a,n,i),r.highPerformanceRestore()}};XA=HA([tp(),GA(0,ip(lp)),GA(0,ep(kx)),VA("design:paramtypes",[Object])],XA);var YA=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},qA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$A=function(t,e){return function(n,i){e(n,i,t)}};const KA=["","repeat-x","repeat-y","repeat"];let ZA=class{constructor(t){this.imageRenderContribitions=t,this.numberType=jb}drawShape(t,e,n,i,r,s,o){const a=Qy(t).image,{fill:l=a.fill,width:h=a.width,height:c=a.height,opacity:u=a.opacity,fillOpacity:f=a.fillOpacity,visible:p=a.visible,repeatX:g=a.repeatX,repeatY:y=a.repeatY,cornerRadius:v=a.cornerRadius,image:m}=t.attribute,b=gx(u,f,l),x=fx(l);if(t.valid&&p&&x&&(b||o)){if(this._imageRenderContribitions||(this._imageRenderContribitions=this.imageRenderContribitions.getContributions()||[]),this._imageRenderContribitions.forEach((s=>{s.time===Wp.beforeFillStroke&&s.drawShape(t,e,n,i,x,!1,b,!1,a,r,o)})),e.setShadowStyle&&e.setShadowStyle(t,a),x)if(o)o(e,t.attribute,a);else if(b){if(!m||!t.resources)return;const r=t.resources.get(m);if("success"!==r.state)return;let s=!1;0===v||d(v)&&v.every((t=>0===t))||(e.beginPath(),BA(e,n,i,h,c,v),e.save(),e.clip(),s=!0),e.setCommonStyle(t,t.attribute,n,i,a);let o=0;if("repeat"===g&&(o|=1),"repeat"===y&&(o|=2),o){const t=e.createPattern(r.data,KA[o]);e.fillStyle=t,e.fillRect(n,i,h,c)}else e.drawImage(r.data,n,i,h,c);s&&e.restore()}this._imageRenderContribitions.forEach((s=>{s.time===Wp.afterFillStroke&&s.drawShape(t,e,n,i,x,!1,b,!1,a,r,o)}))}}draw(t,e,n){const{context:i}=e.drawParams;if(!i)return;const r=Qy(t).image;let{x:s=r.x,y:o=r.y}=t.attribute;const{image:a}=t.attribute;if(a&&t.resources&&"success"===t.resources.get(a).state){if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,o,n),i.highPerformanceRestore()}}};ZA=YA([tp(),$A(0,ip(lp)),$A(0,ep(Mx)),qA("design:paramtypes",[Object])],ZA);const JA=Symbol.for("IncrementalDrawContribution"),QA=Symbol.for("ArcRender"),t_=Symbol.for("Arc3dRender"),e_=Symbol.for("AreaRender"),n_=Symbol.for("CircleRender"),i_=Symbol.for("GraphicRender"),r_=Symbol.for("GroupRender"),s_=Symbol.for("LineRender"),o_=Symbol.for("PathRender"),a_=Symbol.for("PolygonRender"),l_=Symbol.for("RectRender"),h_=Symbol.for("Rect3DRender"),c_=Symbol.for("SymbolRender"),u_=Symbol.for("TextRender"),d_=Symbol.for("RichTextRender"),f_=Symbol.for("Pyramid3dRender"),p_=Symbol.for("GlyphRender"),g_=Symbol.for("ImageRender"),y_=Symbol.for("RenderSelector"),v_=Symbol.for("DrawContribution");function m_(t,e,n){let i=e;const{a:r,b:s,c:o,d:a}=t.currentMatrix,l=Math.sign(r)*Math.sqrt(r*r+s*s),h=Math.sign(a)*Math.sqrt(o*o+a*a);return l+h===0?0:(i=i/Math.abs(l+h)*2*n,i)}function b_(t,e,n,i,r){if(!e||!0===e)return"black";let s,o;if(d(e))for(let t=0;t<e.length&&(o=e[t],!o);t++);else o=e;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l;const h=n.AABBBounds;if(!h)return;let c=h.x2-h.x1,u=h.y2-h.y1,d=h.x1-i,f=h.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;c/=t,u/=e,d/=t,f/=e}const p=t.createLinearGradient(d+(null!==(s=e.x0)&&void 0!==s?s:0)*c,f+(null!==(o=e.y0)&&void 0!==o?o:0)*u,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,f+(null!==(l=e.y1)&&void 0!==l?l:0)*u);return e.stops.forEach((t=>{p.addColorStop(t.offset,t.color)})),p}(t,o,n,i,r):"conical"===o.gradient?s=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o;const a=n.AABBBounds;if(!a)return;let l=a.x2-a.x1,h=a.y2-a.y1,c=a.x1-i,u=a.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;l/=t,h/=e,c/=t,u/=e}const d=t.createConicGradient(c+(null!==(s=e.x)&&void 0!==s?s:0)*l,u+(null!==(o=e.y)&&void 0!==o?o:0)*h,e.startAngle,e.endAngle);return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d.GetPattern(l+c,h+u,void 0)}(t,o,n,i,r):"radial"===o.gradient&&(s=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var s,o,a,l,h,c;const u=n.AABBBounds;if(!u)return;let d=u.x2-u.x1,f=u.y2-u.y1,p=u.x1-i,g=u.y1-r;if(n.attribute){const{scaleX:t=1,scaleY:e=1}=n.attribute;if(t*e==0)return;p/=t,g/=e,d/=t,f/=e}const y=t.createRadialGradient(p+(null!==(s=e.x0)&&void 0!==s?s:.5)*d,g+(null!==(o=e.y0)&&void 0!==o?o:.5)*f,Math.max(d,f)*(null!==(a=e.r0)&&void 0!==a?a:0),p+(null!==(l=e.x1)&&void 0!==l?l:.5)*d,g+(null!==(h=e.y1)&&void 0!==h?h:.5)*f,Math.max(d,f)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{y.addColorStop(t.offset,t.color)})),y}(t,o,n,i,r)),s||"orange")}const x_=new class{constructor(){this.pools=[]}allocate(t){if(!this.pools.length)return hy(Object.assign({nativeCanvas:Gg.global.createCanvas(t)},t));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};return hy(Object.assign({nativeCanvas:Gg.global.createCanvas(e)},e))}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=[]}};var w_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},S_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},A_=function(t,e){return function(n,i){e(n,i,t)}};let __=class{constructor(){this.time=Wp.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){const{background:f}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const r=t.resources.get(f);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=Qy(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,l),e.drawImage(r.data,s.x1,s.y1,s.width(),s.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}};__=w_([tp()],__);let B_=class{constructor(t){this.subRenderContribitions=t,this.time=Wp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((f=>{f.render(t,e,n,i,r,s,o,a,l,h,c,u,d)}))}};B_=w_([tp(),A_(0,ip(lp)),A_(0,ep(Lx)),S_("design:paramtypes",[Object])],B_);let T_=class{constructor(){this.time=Wp.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,n,i,r){const s=(t-2*e)/2,o=x_.allocate({width:t,height:t,dpr:1}),a=o.getContext("2d");if(!a)return null;a.clearRect(0,0,t,t),r(s,a);const l=i.createPattern(o.nativeCanvas,"repeat");return x_.free(o),l}createCirclePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,e)=>{e.fillStyle=n,e.arc(t,t,t,0,B),e.fill()}))}createDiamondPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{const r=t/2,s=r;i.fillStyle=n,i.moveTo(r,s-e),i.lineTo(e+r,s),i.lineTo(r,s+e),i.lineTo(r-e,s),i.closePath(),i.fill()}))}createRectPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(s,0,2*i,t)}))}createHorizontalLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((i,r)=>{const s=e;r.fillStyle=n,r.fillRect(0,s,t,2*i)}))}createBiasLRLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);const r=t/2,s=-r;i.moveTo(r,s),i.lineTo(r+t,s+t),i.moveTo(-r,-s),i.lineTo(-r+t,-s+t),i.stroke()}))}createBiasRLLinePattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((e,i)=>{i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);const r=t/2,s=r;i.moveTo(t+r,s),i.lineTo(r,s+t),i.moveTo(t-r,-s),i.lineTo(-r,-s+t),i.stroke()}))}createGridPattern(t,e,n,i){return this.createCommonPattern(t,e,n,i,((t,i)=>{const r=e,s=r;i.fillStyle=n,i.fillRect(r,s,t,t),i.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:f=l.texture,textureColor:p=l.textureColor,textureSize:g=l.textureSize,texturePadding:y=l.texturePadding}=t.attribute;if(!f)return;let v=this.textureMap.get(f);if(!v)switch(f){case"circle":v=this.createCirclePattern(g,y,p,e);break;case"diamond":v=this.createDiamondPattern(g,y,p,e);break;case"rect":v=this.createRectPattern(g,y,p,e);break;case"vertical-line":v=this.createVerticalLinePattern(g,y,p,e);break;case"horizontal-line":v=this.createHorizontalLinePattern(g,y,p,e);break;case"bias-lr":v=this.createBiasLRLinePattern(g,y,p,e);break;case"bias-rl":v=this.createBiasRLLinePattern(g,y,p,e);break;case"grid":v=this.createGridPattern(g,y,p,e)}v&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=v,e.fill(),e.highPerformanceRestore())}};T_=w_([tp()],T_);var C_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let P_=class{constructor(){this.time=Wp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{innerRadius:y=l.innerRadius,outerRadius:v=l.outerRadius,startAngle:m=l.startAngle,endAngle:b=l.endAngle,opacity:x=l.opacity,x:w=l.x,y:S=l.y,scaleX:A=l.scaleX,scaleY:_=l.scaleY}=t.attribute,B=!(!d||!d.stroke),T=!(!f||!f.stroke);if(p){const{distance:r=l.outerBorder.distance}=d,s=m_(e,r,e.dpr),o=r/v;if(t.setAttributes({outerRadius:v+s,innerRadius:y-s,startAngle:m-o,endAngle:b+o}),e.beginPath(),Ax(t,e,n,i,v+s,y-s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(B){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,d,(w-n)/A,(S-i)/_,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=f,s=m_(e,r,e.dpr),o=r/v;if(t.setAttributes({outerRadius:v-s,innerRadius:y+s,startAngle:m+o,endAngle:b-o}),e.beginPath(),Ax(t,e,n,i,v-s,y+s),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(T){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,f,(w-n)/A,(S-i)/_,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}t.setAttributes({outerRadius:v,innerRadius:y,startAngle:m,endAngle:b})}};P_=C_([tp()],P_);let R_=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}};R_=C_([tp()],R_);let O_=class extends T_{constructor(){super(...arguments),this.time=Wp.afterFillStroke}};O_=C_([tp()],O_);var M_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let E_=class{constructor(){this.time=Wp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:d,innerBorder:f}=t.attribute,p=d&&!1!==d.visible,g=f&&!1!==f.visible;if(!p&&!g)return;const{radius:y=l.radius,startAngle:v=l.startAngle,endAngle:m=l.endAngle,opacity:b=l.opacity,x:x=l.x,y:w=l.y,scaleX:S=l.scaleX,scaleY:A=l.scaleY}=t.attribute,_=!(!d||!d.stroke),B=!(!f||!f.stroke);if(p){const{distance:r=l.outerBorder.distance}=d,s=m_(e,r,e.dpr);if(e.beginPath(),e.arc(n,i,y+s,v,m),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,d,l.outerBorder);else if(_){const r=l.outerBorder.opacity;l.outerBorder.opacity=b,e.setStrokeStyle(t,d,(x-n)/S,(w-i)/A,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(g){const{distance:r=l.innerBorder.distance}=f,s=m_(e,r,e.dpr);if(e.beginPath(),e.arc(n,i,y-s,v,m),e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.innerBorder);else if(B){const r=l.innerBorder.opacity;l.innerBorder.opacity=b,e.setStrokeStyle(t,f,(x-n)/S,(w-i)/A,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};E_=M_([tp()],E_);let k_=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}};k_=M_([tp()],k_);let I_=class extends T_{constructor(){super(...arguments),this.time=Wp.afterFillStroke}};I_=M_([tp()],I_);var j_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let D_=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{background:d}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const n=t.resources.get(d);if("success"!==n.state||!n.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const i=t.AABBBounds;e.drawImage(n.data,i.x1,i.y1,i.width(),i.height()),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}};D_=j_([tp()],D_);var L_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let N_=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,u,d){const{background:p,width:g,height:y}=t.attribute;if(p)if(t.backgroundImg){const n=t.resources.get(p);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const n=Qy(t.parent).group,{scrollX:i=n.scrollX,scrollY:r=n.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(i,r)}const i=t.AABBBounds;e.drawImage(n.data,i.x1,i.y1,i.width(),i.height()),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(c(p)){const{stroke:n,fill:i,lineWidth:r=1,cornerRadius:s=0,expandX:o=0,expandY:a=0}=p;if(!n&&!i)return;e.beginPath();const{x:l,y:h,width:c,height:u}=function(t){const e=_v(t.attribute.boundsPadding),n=t.AABBBounds;let i=n.x1,r=n.y1,s=n.width(),o=n.height();return f(e)?(i+=e,r+=e,s-=2*e,o-=2*e):(i+=e[3],r+=e[0],s-=e[1]+e[3],o-=e[0]+e[2]),{x:i,y:r,width:s,height:o}}(t);s?BA(e,l-o,h-a,c+2*o,u+2*a,s):e.rect(l-o,h-a,c+2*o,u+2*a),e.globalAlpha=1,i&&(e.fillStyle=i,e.fill()),n&&r>0&&(e.lineWidth=r,e.strokeStyle=n,e.stroke())}else{e.beginPath();const r=t.AABBBounds;e.rect(n,i,r.width(),r.height()),e.fillStyle=p,e.globalAlpha=1,e.fill()}}};N_=L_([tp()],N_);var W_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let F_=class{constructor(){this.time=Wp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,y=p&&!1!==p.visible;if(!g&&!y)return;const{width:v=l.width,height:m=l.height,cornerRadius:b=l.cornerRadius,opacity:x=l.opacity,x:w=l.x,y:S=l.y,scaleX:A=l.scaleX,scaleY:_=l.scaleY}=t.attribute,B=!(!f||!f.stroke),T=!(!p||!p.stroke);if(g){const{distance:r=l.outerBorder.distance}=f,s=m_(e,r,e.dpr),o=n-s,a=i-s,h=2*s;if(0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v+h,m+h)):(e.beginPath(),BA(e,o,a,v+h,m+h,b)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.outerBorder);else if(B){const r=l.outerBorder.opacity;l.outerBorder.opacity=x,e.setStrokeStyle(t,f,(w-n)/A,(S-i)/_,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=l.innerBorder.distance}=p,s=m_(e,r,e.dpr),o=n+s,a=i+s,h=2*s;if(0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(o,a,v-h,m-h)):(e.beginPath(),BA(e,o,a,v-h,m-h,b)),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(T){const r=l.innerBorder.opacity;l.innerBorder.opacity=x,e.setStrokeStyle(t,p,(w-n)/A,(S-i)/_,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};F_=W_([tp()],F_);let U_=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}};U_=W_([tp()],U_);let z_=class extends T_{constructor(){super(...arguments),this.time=Wp.afterFillStroke}};z_=W_([tp()],z_);let H_=class{constructor(){this.time=Wp.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){const{stroke:f=l.stroke}=t.attribute;Array.isArray(f)&&f.some((t=>!1===t))&&(d.doStroke=!1)}};H_=W_([tp()],H_);let V_=class{constructor(){this.time=Wp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const{width:d=l.width,height:f=l.height,stroke:p=l.stroke}=t.attribute;if(Array.isArray(p)&&p.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,n,i,l),e.beginPath(),e.moveTo(n,i),p[0]?e.lineTo(n+d,i):e.moveTo(n+d,i),p[1]?e.lineTo(n+d,i+f):e.moveTo(n+d,i+f),p[2]?e.lineTo(n,i+f):e.moveTo(n,i+f),p[3]){const t=p[0]?i-e.lineWidth/2:i;e.lineTo(n,t)}else e.moveTo(n,i);e.stroke()}}};V_=W_([tp()],V_);var G_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let X_=class{constructor(){this.time=Wp.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,n,i,r,s,o,a,l,h,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:f,innerBorder:p}=t.attribute,g=f&&!1!==f.visible,y=p&&!1!==p.visible;if(!g&&!y)return;const{size:v=l.size,opacity:m=l.opacity,x:b=l.x,y:x=l.y,scaleX:w=l.scaleX,scaleY:S=l.scaleY}=t.attribute,A=!(!f||!f.stroke),_=!(!p||!p.stroke);if(g){const{distance:r=l.outerBorder.distance}=f,s=m_(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,v,n,i,s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,f,l.outerBorder);else if(A){const r=l.outerBorder.opacity;l.outerBorder.opacity=m,e.setStrokeStyle(t,f,(b-n)/w,(x-i)/S,l.outerBorder),l.outerBorder.opacity=r,e.stroke()}}if(y){const{distance:r=l.innerBorder.distance}=p,s=m_(e,r,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,v,n,i,-s)&&e.closePath(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),u)u(e,p,l.innerBorder);else if(_){const r=l.innerBorder.opacity;l.innerBorder.opacity=m,e.setStrokeStyle(t,p,(b-n)/w,(x-i)/S,l.innerBorder),l.innerBorder.opacity=r,e.stroke()}}}};X_=G_([tp()],X_);class Y_ extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}}class q_ extends T_{constructor(){super(...arguments),this.time=Wp.afterFillStroke}}var $_=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},K_=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Z_=function(t,e){return function(n,i){e(n,i,t)}};const J_=Symbol.for("RenderService");let Q_=class{constructor(t){this.drawContribution=t}prepare(t){this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const n=e.updateBounds;this.prepare(n),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}};Q_=$_([tp(),Z_(0,ip(v_)),K_("design:paramtypes",[Object])],Q_);var tB=new $f((t=>{t(Q_).toSelf(),t(J_).toService(Q_)})),eB=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};function nB(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s={},o=[];let a=!1;if(r)a=!0;else{let n;t.forEachChildren(((t,i)=>{const{zIndex:r=e}=t.attribute;if(0===i)n=r;else if(n!==r)return a=!0,!0;return!1}),i)}if(a){t.forEachChildren((t=>{const{zIndex:n=e}=t.attribute;s[n]?s[n].push(t):(s[n]=[t],o.push(n))}),i),o.sort(((t,e)=>i?e-t:t-e));let a=!1;for(let t=0;t<o.length&&!a;t++){const e=o[t],l=s[e];r&&l.sort(((t,e)=>{var n,r;return(i?-1:1)*((null!==(n=e.attribute.z)&&void 0!==n?n:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<l.length;t++)if(n(l[t],t)){a=!0;break}}}else t.forEachChildren(n,i)}function iB(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return eB(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(n,i)}))}function rB(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r={},s=[];let o=!1;t.forEachChildren(((t,e)=>{const{zIndex:i=n}=t.attribute;if(0===e);else if(void 0!==i)return o=!0,!0;return!1}),i);let a=null,l=!1;if(o){t.forEachChildren((t=>{const{zIndex:e=n}=t.attribute;r[e]?r[e].push(t):(r[e]=[t],s.push(e))}),i),s.sort(((t,e)=>i?e-t:t-e));let o=!1;for(let t=0;t<s.length&&!o;t++){const n=s[t],i=r[n];for(let t=0;t<i.length;t++){if(l){o=!0,a=i[t];break}i[t]._uid!==e||(l=!0)}}}else t.forEachChildren((t=>l?(a=t,!0):(t._uid===e&&(l=!0),!1)),i);return a}var sB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const oB=Symbol.for("PickItemInterceptor");let aB=class{constructor(){this.order=1}afterPickItem(t,e,n,i,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this._pickItem(t,e,n,i,r)}beforePickItem(t,e,n,i,r){return t.attribute.shadowRootIdx<0&&this._pickItem(t,e,n,i,r)}_pickItem(t,e,n,i,r){if(!t.shadowRoot)return!1;const{parentMatrix:s}=r||{};if(!s)return!1;const o=e.pickContext;o.highPerformanceSave();const a=t.shadowRoot,l=HS.allocateByObj(s),h=new L(n.x,n.y);s.transformPoint(h,h);const c=t.transMatrix;l.multiply(c.a,c.b,c.c,c.d,c.e,c.f);const u=e.pickGroup(a,h.clone(),l,i);return o.highPerformanceRestore(),u}};aB=sB([tp()],aB);let lB=class{constructor(){this.order=1}beforePickItem(t,e,n,i,r){if(!t.in3dMode||i.in3dInterceptor)return null;const s=e.pickContext,o=t.stage;if(!s||!o)return null;if(i.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){let o,a=!1,l=!1;if(t.forEachChildren((t=>(a=t.numberType===Ob,!a))),t.forEachChildren((t=>(l=!!t.findFace,!l))),a){const s=t.getChildren(),a=[...s];a.sort(((t,e)=>{var n,i,r,s;let o=(null!==(i=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==i?i:0)/2,a=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;o<0;)o+=B;for(;a<0;)a+=B;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),a.forEach((e=>{t.appendChild(e)})),i.hack_pieFace="outside",o=e.pickGroup(t,n,r.parentMatrix,i),o.graphic||(i.hack_pieFace="inside",o=e.pickGroup(t,n,r.parentMatrix,i)),o.graphic||(i.hack_pieFace="top",o=e.pickGroup(t,n,r.parentMatrix,i)),t.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),s.forEach((e=>{t.appendChild(e)}))}else if(l){const a=t.getChildren(),l=a.map((t=>({ave_z:t.findFace().vertices.map((e=>{var n;return s.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));l.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),l.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),l.forEach((e=>{t.add(e.g)})),o=e.pickGroup(t,n,r.parentMatrix,i),t.removeAllChild(),a.forEach((t=>{t._next=null,t._prev=null})),t.update(),a.forEach((e=>{t.add(e)}))}else o=e.pickGroup(t,n,r.parentMatrix,i);return s.camera=null,i.in3dInterceptor=!1,o}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};lB=sB([tp()],lB);var hB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uB=function(t,e){return function(n,i){e(n,i,t)}};const dB=Symbol.for("PickerService");let fB=class{constructor(t,e){this.global=t,this.pickItemInterceptorContributions=e,this.type="default"}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,n){let i={graphic:null,group:null};n.pickerService=this;let r=0,s=0;if(n&&n.bounds){if(!n.bounds.contains(e.x,e.y))return i;r=n.bounds.x1,s=n.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const o=new V(1,0,0,1,r,s);let a;for(let r=t.length-1;r>=0&&(t[r].isContainer?i=this.pickGroup(t[r],e,o,n):i.graphic=this.pickItem(t[r],e,o,n),!i.graphic);r--)a||(a=i.group);if(i.graphic||(i.group=a),this.pickContext&&(this.pickContext.inuse=!1),i.graphic){let t=i.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=t.shadowHost)}return i}containsPoint(t,e,n){return!!this.pickItem(t,e,null,n)}pickGroup(t,e,n,i){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=i.pickContext,o=s.modelMatrix;if(s.camera){const e=t.transMatrix,n=VS.allocate();if($S(n,e),o){if(n){const t=VS.allocate();s.modelMatrix=KS(t,o,n),VS.free(n)}}else $S(n,t.globalTransMatrix),s.modelMatrix=n}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const a=this.InterceptorContributions[r];if(a.beforePickItem){const r=a.beforePickItem(t,this,e,i,{parentMatrix:n});if(r)return s.modelMatrix!==o&&VS.free(s.modelMatrix),s.modelMatrix=o,r}}const a=t.transMatrix,l=HS.allocateByObj(n),h=new L(e.x,e.y);l.transformPoint(h,h);const c=t.AABBBounds.containsPoint(h);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,h.clone(),n,i);u&&(r.graphic=u);const d=!1!==t.attribute.pickable&&c;return l.multiply(a.a,a.b,a.c,a.d,a.e,a.f),!1===t.attribute.childrenPickable||u||nB(t,Rg.zIndex,(s=>{if(s.isContainer){const n=new L(e.x,e.y),o=Qy(t).group,{scrollX:a=o.scrollX,scrollY:h=o.scrollY}=t.attribute;n.x-=a,n.y-=h,r=this.pickGroup(s,n,l,i)}else{const o=new L(e.x,e.y);l.transformPoint(o,o);const a=Qy(t).group,{scrollX:h=a.scrollX,scrollY:c=a.scrollY}=t.attribute;o.x-=h,o.y-=c;const u=this.pickItem(s,o,n,i);r.graphic=u}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==o&&VS.free(s.modelMatrix),s.modelMatrix=o,r.graphic||r.group||!d||t.stage.camera||(r.group=t),HS.free(l),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};fB=hB([tp(),uB(0,ip(pp)),uB(1,ip(lp)),uB(1,ep(oB)),cB("design:paramtypes",[Object,Object])],fB);var pB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},gB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yB=function(t,e){return function(n,i){e(n,i,t)}};const vB=Symbol.for("GlobalPickerService");let mB=class{constructor(t){this.global=t,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,n)=>{this.configure(n,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,n){let i={graphic:null,group:null};const r=new V(1,0,0,1,0,0);let s;for(let o=0;o<t.length&&(t[o].isContainer?i=this.pickGroup(t[o],e,r,n):i.graphic=this.pickItem(t[o],e,r,n),!i.graphic);o++)s||(s=i.group);if(i.graphic||(i.group=s),i.graphic){let t=i.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=t.shadowHost)}return i}containsPoint(t,e,n){return!!this.pickItem(t,e,null,n)}pickGroup(t,e,n,i){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,o=new L(e.x,e.y);n.transformPoint(o,o);const a=t.AABBBounds.containsPoint(o);if(!a)return r;const l=!1!==t.attribute.pickable&&a;return n.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,n,i);else{const s=new L(e.x,e.y);n.transformPoint(s,s),r.graphic=this.pickItem(t,s,n,i)}return!!r.graphic||!!r.group})),r.graphic||r.group||!l||(r.group=t),r}pickItem(t,e,n,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?t:null}};function bB(t,e,n){const i=e[0],r=e[1],s=e[2];let o=n[3]*i+n[7]*r+n[11]*s+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*s+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*s+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*s+n[14])/o,t}mB=pB([tp(),yB(0,ip(pp)),gB("design:paramtypes",[Object])],mB);var xB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},wB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const SB=[0,0,0],AB=new V(1,0,0,1,0,0);let _B=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Ag),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Bg),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Tg),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1;const n=t.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=t,this.matrix=new V(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new V(1,0,0,1,0,0)}reset(){this.stack.length&&console.warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new V(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return HS.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(HS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(HS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*n,a*i,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,n,i,r,s,o){if(o=o||0,this.camera){const a=[];((t,e,n,i,r,s,o,a)=>{if(a)for(;n>e;)n-=B;else for(;n<e;)n+=B;const l=S/3*(n>e?1:-1);let h=e,c=h;for(;c!==n;){c=l>0?Math.min(c+l,n):Math.max(c+l,n);const e=Math.abs(c-h),a=4*Math.tan(e/4)/3,u=c<h?-1:1,d=Math.cos(h),f=Math.sin(h),p=Math.cos(c),g=Math.sin(c),y=d*s+i,v=f*o+r,m=p*s+i,b=g*o+r,x=s*a*u,w=o*a*u;t.push([y-x*f,v+w*d,m+x*g,b-w*p,m,b]),h=c}})(a,i,r,t,e,n,n,s);for(let t=0;t<a.length;++t){const e=a[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],o)}}else this.nativeContext.arc(t,e,n,i,r,s)}arcTo(t,e,n,i,r){this.nativeContext.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s,o){if(o=o||0,this.camera){let a=o,l=o;this.modelMatrix&&(bB(SB,[t,e,o],this.modelMatrix),t=SB[0],e=SB[1],a=SB[2],bB(SB,[n,i,o],this.modelMatrix),n=SB[0],i=SB[1],l=SB[2],bB(SB,[r,s,o],this.modelMatrix),r=SB[0],s=SB[1],o=SB[2]);let h=this.camera.vp(r,s,o);r=h.x,s=h.y,h=this.camera.vp(t,e,a),t=h.x,e=h.y,h=this.camera.vp(n,i,l),n=h.x,i=h.y}this.nativeContext.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,n,i,r,s,o,a){null==a?this.nativeContext.ellipse(t,e,n,i,r,s,o):this.nativeContext.ellipse(t,e,n,i,r,s,o,a)}lineTo(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(bB(SB,[t,e,n],this.modelMatrix),t=SB[0],e=SB[1],n=SB[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(bB(SB,[t,e,n],this.modelMatrix),t=SB[0],e=SB[1],n=SB[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,n,i,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(bB(SB,[t,e,r],this.modelMatrix),t=SB[0],e=SB[1],s=SB[2],bB(SB,[n,i,r],this.modelMatrix),n=SB[0],i=SB[1],r=SB[2]);let o=this.camera.vp(n,i,r);n=o.x,i=o.y,o=this.camera.vp(t,e,s),t=o.x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+n,e,r),this.lineTo(t+n,e+i,r),this.lineTo(t,e+i,r),this.closePath()):this.nativeContext.rect(t,e,n,i)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,n,i){return this.nativeContext.createLinearGradient(t,e,n,i)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,n,i,r,s){return this.nativeContext.createRadialGradient(t,e,n,i,r,s)}createConicGradient(t,e,n,i){let r,s=!1;const o=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(a,l,h){return s&&(h||(h=i-n),r=function(t,e,n,i,r,s,o,a,l){const h=Math.floor(180*r/Math.PI),c=_x.GetCanvas(),u=_x.GetCtx();if(!u)return null;const d=Tx.GetSize(a),f=Tx.GetSize(l);let p=Tx.Get(e,n,i,s,o,d,f);if(p)return p;const g=Math.sqrt(Math.max(Math.max(Math.pow(n,2)+Math.pow(i,2),Math.pow(d-n,2)+Math.pow(i,2)),Math.max(Math.pow(d-n,2)+Math.pow(f-i,2),Math.pow(n,2)+Math.pow(f-i,2)))),y=h+1,v=r/Math.max(1,y-1),m=Bx.GetOrCreate(e,y),b=2*Math.PI*g/360;c.width=d,c.height=f,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,f),u.translate(n,i),u.rotate(s);for(let t=0,e=y-1;t<e&&!(s+t*v>o);t++){const e=m.getColor(t);u.beginPath(),u.rotate(v),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,f);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),p=t.createPattern(c,"no-repeat"),p&&Tx.Set(e,n,i,s,o,p,d,f),p}(o,this.stops,t,e,h,n,i,a,l),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,n,i){this.nativeContext.fillRect(t,e,n,i)}clearRect(t,e,n,i){this.nativeContext.clearRect(t,e,n,i)}project(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(bB(SB,[t,e,n],this.modelMatrix),t=SB[0],e=SB[1],n=SB[2]);const i=this.camera.vp(t,e,n);t=i.x,e=i.y}return{x:t,y:e}}view(t,e,n){return n=n||0,this.camera?(this.modelMatrix&&(bB(SB,[t,e,n],this.modelMatrix),t=SB[0],e=SB[1],n=SB[2]),this.camera.view(t,e,n)):[t,e,n]}fillText(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(bB(SB,[e,n,i],this.modelMatrix),e=SB[0],n=SB[1],i=SB[2]);const t=this.camera.vp(e,n,i);e=t.x,n=t.y}this.nativeContext.fillText(t,e,n)}getImageData(t,e,n,i){return this.nativeContext.getImageData(t,e,n,i)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gg.global.measureTextMethod;var n,i;return e&&"native"!==e?(this.mathTextMeasure||(this.mathTextMeasure=Gg.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas))),this.mathTextMeasure.textSpec.fontFamily=null!==(n=this.fontFamily)&&void 0!==n?n:Tg.fontFamily,this.mathTextMeasure.textSpec.fontSize=null!==(i=this.fontSize)&&void 0!==i?i:Tg.fontSize,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={},this.mathTextMeasure.measure(t,e)):this.nativeContext.measureText(t)}putImageData(t,e,n){this.nativeContext.putImageData(t,e,n)}setLineDash(t){const e=arguments,n=this.nativeContext;this.nativeContext.setLineDash?n.setLineDash(e[0]):"mozDash"in n?n.mozDash=e[0]:"webkitLineDash"in n&&(n.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,n,i){this.nativeContext.strokeRect(t,e,n,i)}strokeText(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(bB(SB,[e,n,i],this.modelMatrix),e=SB[0],n=SB[1],i=SB[2]);const t=this.camera.vp(e,n,i);e=t.x,n=t.y}this.nativeContext.strokeText(t,e,n)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,n,i,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setCommonStyle(t,e,n,i,s)}return this._setCommonStyle(t,e,n,i,r)}_setCommonStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12?(s.globalAlpha=o*a,s.fillStyle=b_(this,l,t,n,i)):s.globalAlpha=o*a}setShadowStyle(t,e,n){if(Array.isArray(n)){if(n.length<=1)return this._setShadowStyle(t,n[0]);const i={};return n.forEach((t=>{Object.assign(i,t)})),this._setShadowStyle(t,e,i)}return this._setShadowStyle(t,e,n)}_setShadowStyle(t,e,n){const i=this.nativeContext;n||(n=this.fillAttributes);const{opacity:r=n.opacity,shadowBlur:s=n.shadowBlur,shadowColor:o=n.shadowColor,shadowOffsetX:a=n.shadowOffsetX,shadowOffsetY:l=n.shadowOffsetY,blur:h=n.blur}=e;r<=1e-12||(s||a||l?(i.shadowBlur=s,i.shadowColor=o,i.shadowOffsetX=a,i.shadowOffsetY=l,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),h?(i.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1))}setStrokeStyle(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,n,i,r[0]);const s={};return r.forEach((t=>{Object.assign(s,t)})),this._setStrokeStyle(t,e,n,i,s)}return this._setStrokeStyle(t,e,n,i,r)}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=m_(this,l,this.dpr),s.strokeStyle=b_(this,h,t,n,i),s.lineJoin=c,s.setLineDash(u),s.lineCap=d,s.miterLimit=f}}setTextStyleWithoutAlignBaseline(t,e,n){const i=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?i.font=t.font:i.font=qx(t,e,r&&this.camera&&this.camera.getProjectionScale(n));const{fontFamily:s=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=s,this.fontSize=o,i.textAlign="left",i.textBaseline="alphabetic"}setTextStyle(t,e,n){var i,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=qx(t,e,this.camera&&this.camera.getProjectionScale(n));const{fontFamily:o=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=o,this.fontSize=a,s.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(AB,t,e)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>HS.free(t))),this.stack.length=0}};_B.env="browser",_B=xB([tp(),wB("design:paramtypes",[Object,Number])],_B);var BB=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},TB=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const CB={WIDTH:500,HEIGHT:500,DPR:1};let PB=class{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){const{nativeCanvas:e,width:n=CB.WIDTH,height:i=CB.HEIGHT,dpr:r=CB.DPR,container:s,x:o,y:a,canvasControled:l=!0}=t;if(this._x=null!=o?o:0,this._y=null!=a?a:0,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this.controled=l,"string"==typeof s){const t=Gg.global.getElementById(s);t&&(this._container=t)}else this._container=s;this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new _B(this,this._dpr),this._id=e.id,this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),null!=this.id&&(t.id=this.id.toString()),this._container&&this._container.appendChild(t),this.visiable||this.hide()}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:n=this._displayHeight,dpr:i=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:o}=this;o.width=e*i,o.height=n*i,!o.style||this.setCanvasStyle(o,r,s,e,n),t.id&&(o.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,n,i,r){this.controled&&(t.style.padding="0",t.style.margin="0",t.style.border="0",t.style.background="transparent",t.style.width=`${i}px`,t.style.height=`${r}px`)}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}readPixels(t,e,n,i){return this._context.getImageData(t,e,n,i)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}};PB.env="browser",PB=BB([tp(),TB("design:paramtypes",[Object])],PB);const RB=Symbol.for("CanvasArcPicker"),OB=Symbol.for("CanvasArc3dPicker"),MB=Symbol.for("CanvasAreaPicker"),EB=Symbol.for("CanvasCirclePicker"),kB=Symbol.for("CanvasImagePicker"),IB=Symbol.for("CanvasLinePicker"),jB=Symbol.for("CanvasPathPicker"),DB=Symbol.for("CanvasRectPicker"),LB=Symbol.for("CanvasRect3dPicker"),NB=Symbol.for("CanvasSymbolPicker"),WB=Symbol.for("CanvasTextPicker"),FB=Symbol.for("CanvasPolygonPicker"),UB=Symbol.for("CanvasPyramid3dPicker"),zB=Symbol.for("CanvasRichTextPicker"),HB=Symbol.for("CanvasGlyphPicker"),VB=Symbol.for("CanvasGroupPicker"),GB=Symbol.for("CanvasPickerContribution"),XB=Symbol.for("MathArcPicker"),YB=Symbol.for("MathAreaPicker"),qB=Symbol.for("MathCirclePicker"),$B=Symbol.for("MathLinePicker"),KB=Symbol.for("MathPathPicker"),ZB=Symbol.for("MathRectPicker"),JB=Symbol.for("MathSymbolPicker"),QB=Symbol.for("MathTextPicker"),tT=Symbol.for("MathPolygonPicker"),eT=Symbol.for("MathGlyphPicker"),nT=Symbol.for("MathPickerContribution");var iT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},rT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sT=function(t,e){return function(n,i){e(n,i,t)}};let oT=class extends fB{constructor(t,e,n,i,r,s,o,a,l,h,c,u,d,f,p){super(f,p),this.contributions=t,this.circlePicker=e,this.rectPicker=n,this.arcPicker=i,this.areaPicker=r,this.imagePicker=s,this.linePicker=o,this.pathPicker=a,this.symbolPicker=l,this.textPicker=h,this.polygonPicker=c,this.richtextPicker=u,this.drawContribution=d,this.global=f,this.pickItemInterceptorContributions=p,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,n)=>{this.configure(n,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){const n={width:100,height:100,nativeCanvas:t.createCanvas({width:100,height:100}),id:"for-pick"};this.pickCanvas=new PB(n),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,n,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,i,{parentMatrix:n});if(r)return!0===r?t:r.graphic}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,i)?t:null;if(s)return s;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,i,{parentMatrix:n});if(r)return!0===r?t:r.graphic}}return s}};iT([ap(),rT("design:type",Function),rT("design:paramtypes",[]),rT("design:returntype",void 0)],oT.prototype,"init",null),oT=iT([tp(),sT(0,ip(lp)),sT(0,ep(GB)),sT(1,ip(EB)),sT(2,ip(DB)),sT(3,ip(RB)),sT(4,ip(MB)),sT(5,ip(kB)),sT(6,ip(IB)),sT(7,ip(jB)),sT(8,ip(NB)),sT(9,ip(WB)),sT(10,ip(FB)),sT(11,ip(zB)),sT(12,ip(v_)),sT(13,ip(pp)),sT(14,ip(lp)),sT(14,ep(oB)),rT("design:paramtypes",[Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object,Object])],oT);var aT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const hT=new V(1,0,0,1,0,0),cT={x:0,y:0};let uT=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new V(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new V(1,0,0,1,0,0),this.path=new bg}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return HS.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(HS.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(HS.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}setScale(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}scalePoint(t,e,n,i){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}setTransform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(a*t,a*e,a*n,a*i,a*r,a*s),o&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,n,i,r,s){let o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,s),o&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=t*Math.PI/180;this.rotate(n,e)}rotateAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,n,i,r,s){this.path.arc(t,e,n,i,r,s)}arcTo(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}bezierCurveTo(t,e,n,i,r,s){this.path.bezierCurveTo(t,e,n,i,r,s)}closePath(){this.path.closePath()}ellipse(t,e,n,i,r,s,o,a){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}rect(t,e,n,i){this.path.rect(t,e,n,i)}createImageData(t,e){return null}createLinearGradient(t,e,n,i){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,n,i,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,n,i){return null}fill(t,e){}fillRect(t,e,n,i){this.path.rect(t,e,n,i)}clearRect(t,e,n,i){}fillText(t,e,n){}getImageData(t,e,n,i){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},cT),function(t,e,n){return Ny(t,0,!1,e,n)}(this.path.commandList,cT.x,cT.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},cT);const n=m_(this,this.lineWidth,this.dpr);return function(t,e,n,i){return Ny(t,e,!0,n,i)}(this.path.commandList,n,cT.x,cT.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,n){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,n,i){this.path.rect(t,e,n,i)}strokeText(t,e,n){}drawImage(){}setCommonStyle(t,e,n,i,r){}_setCommonStyle(t,e,n,i){}setStrokeStyle(t,e,n,i,r){}_setStrokeStyle(t,e,n,i){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(hT,t,e)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>HS.free(t))),this.stack.length=0}};uT=aT([tp(),lT("design:paramtypes",[Object,Number])],uT);var dT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},fT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pT=function(t,e){return function(n,i){e(n,i,t)}};let gT=class extends fB{constructor(t,e,n){super(e,n),this.contributions=t,this.global=e,this.pickItemInterceptorContributions=n,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,n)=>{this.configure(n,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickContext=new uT(null,1)}pickItem(t,e,n,i){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);return r&&r.contains(t,e,i)?t:null}};dT([ap(),fT("design:type",Function),fT("design:paramtypes",[]),fT("design:returntype",void 0)],gT.prototype,"init",null),gT=dT([tp(),pT(0,ip(lp)),pT(0,ep(nT)),pT(1,ip(pp)),pT(2,ip(lp)),pT(2,ep(oB)),fT("design:paramtypes",[Object,Object,Object])],gT);var yT=new $f((t=>{t(oT).toSelf().inSingletonScope(),t(gT).toSelf().inSingletonScope(),t(dB).toService(oT),t(mB).toSelf().inSingletonScope(),t(vB).toService(mB),t(lB).toSelf().inSingletonScope(),t(oB).toService(lB),t(aB).toSelf().inSingletonScope(),t(oB).toService(aB),cp(t,oB)})),vT=new $f((t=>{t(JS).toSelf().inSingletonScope(),t(Gb).toService(JS),t(RS).toSelf().inSingletonScope(),t(PS).toService(RS),cp(t,PS),t(ES).toSelf().inSingletonScope(),t(MS).toService(ES),cp(t,MS),t(jS).toSelf().inSingletonScope(),t(IS).toService(jS),cp(t,IS),t(NS).toSelf().inSingletonScope(),t(LS).toService(NS),cp(t,LS),t(US).toSelf().inSingletonScope(),t(FS).toService(US),cp(t,FS),t(Xb).toConstantValue(iA)}));const mT=Symbol.for("AutoEnablePlugins"),bT=Symbol.for("PluginService");var xT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},wT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ST=function(t,e){return function(n,i){e(n,i,t)}};let AT=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:n}=e;n&&oy.isBound(mT)&&this.autoEnablePlugins.getContributions().forEach((t=>{n.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((n=>{n.name===t&&e.push(n)})),this.onRegisterPlugin.forEach((n=>{n.name===t&&e.push(n)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};AT=xT([tp(),ST(0,ip(lp)),ST(0,ep(mT)),wT("design:paramtypes",[Object])],AT);var _T=new $f((t=>{t(AT).toSelf(),t(bT).toService(AT),function(t,e){t(lp).toDynamicValue((t=>{let{container:n}=t;return new hp(e,n)})).whenTargetNamed(e)}(t,mT)})),BT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let TT=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new U}removeDom(t){return!1}createDom(t){return null}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};TT=BT([tp()],TT);var CT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},PT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class RT{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function OT(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=document.createElement("img");if(n.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return n.src=t,n.complete?Promise.resolve(n):new Promise(((t,e)=>{n.onload=()=>{t(n)},n.onerror=()=>{e(new Error("加载失败"))}}))}let MT=class extends TT{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var n;if(e){const{clientX:i,clientY:r}=t,s=e.getBoundingClientRect(),o=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;let a,l;return o&&(a=s.width/o.offsetWidth,l=s.height/o.offsetHeight),{x:(i-s.left)/(p(a)?a:1),y:(r-s.top)/(p(l)?a:1)}}return{x:t.offsetX,y:t.offsetY}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/xml").firstChild),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new RT(t)}return new U}removeDom(t){return t.parentElement.removeChild(t),!0}createDom(t){const{tagName:e="div",width:n,height:i,style:r,parent:s}=t,o=document.createElement(e);if(r&&(u(r)?o.setAttribute("style",r):Object.keys(r).forEach((t=>{o.setAttribute(t,r[t])}))),null!=n&&(o.style.width=`${n}px`),null!=i&&(o.style.height=`${i}px`),s){const t=u(s)?this.getElementById(s):s;t&&t.appendChild&&t.appendChild(o)}return o}loadImage(t){return OT(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return OT(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,n;const i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:tv.GenAutoIncrementId().toString());const r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width=`${t.width}px`,i.style.height=`${t.height}px`,i.width=t.width*r,i.height=t.height*r),i}createOffscreenCanvas(t){var e;const n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,n){return document.addEventListener(t,e,n)}removeEventListener(t,e,n){return document.removeEventListener(t,e,n)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let n=t.offsetTop,i=t.offsetParent;for(;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}getElementLeft(t,e){let n=t.offsetLeft,i=t.offsetParent;for(;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}getElementTopLeft(t,e){let n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;for(;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}};function ET(){oy.rebind(dB).toService(gT)}MT=CT([tp(),PT("design:paramtypes",[])],MT);var kT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},IT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jT=class extends TT{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,n,i,r){const s=tt.getSystemInfoSync().pixelRatio;e.forEach(((e,o)=>{const a=tt.createCanvasContext(e);a.canvas={width:t.width*s,height:t.height*s};const l={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>a,getBoundingClientRect:()=>({height:t.height,width:t.width})};n.set(e,l),o>=i&&r.push(l)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),ET())}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ev.call(t)}}getCancelAnimationFrame(){return t=>{Ev.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};jT=kT([tp(),IT("design:paramtypes",[])],jT);var DT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let NT=class extends TT{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}configure(t,e){var n,i,r,s,o,a,l;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,o=this.freeCanvasList,a=e.taro,l=e.pixelRatio,i.forEach(((t,e)=>{const i=a.createCanvasContext(t);i.canvas={width:n.width*l,height:n.height*l},i.createRadialGradient||(i.createRadialGradient=function(){return i.createCircularGradient(...arguments)}),!i.getImageData&&a.canvasGetImageData&&(i.getImageData=(e,n,i,r)=>new Promise(((s,o)=>{try{a.canvasGetImageData({canvasId:t,x:e,y:n,width:i,height:r,success(t){s(t)}})}catch(t){o(t)}})));const h={id:t,width:n.width*l,height:n.height*l,offsetWidth:n.width,offsetHeight:n.height,getContext:()=>i,getBoundingClientRect:()=>({height:n.height,width:n.width})};return r.set(t,h),e>=s&&o.push(h),h})),this.taro=e.taro,this.pixelRatio=e.pixelRatio,oy.rebind(dB).toService(gT))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const n=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],i=(new XMLSerializer).serializeToString(n),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const n=new e.Blob([t],{type:"image/svg+xml"}),i=e.URL.createObjectURL(n);return Promise.resolve({data:i,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};NT=DT([tp(),LT("design:paramtypes",[])],NT);var WT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},FT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let UT=!1;try{UT=!!lynx.createCanvasNG}catch(t){}let zT=class extends TT{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,n,i,r){const s=SystemInfo.pixelRatio;e.forEach(((e,o)=>{const a=UT?lynx.createCanvasNG(e):lynx.createCanvas(e);a.width=t.width*s,a.height=t.height*s,UT&&a.attachToCanvasView(e);const l=a.getContext("2d");l.draw=(t,e)=>{e()};const h={width:t.width*s,height:t.height*s,offsetWidth:t.width,offsetHeight:t.height,id:null!=e?e:"",getContext:()=>l,getBoundingClientRect:()=>({height:t.height,width:t.width})};n.set(e,h),o>=i&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList),ET())}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return this.freeCanvasList.length}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,n)=>{e.onload=()=>{t(e)},e.onerror=()=>{n(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return Ev.call(t)}}getCancelAnimationFrame(){return t=>{Ev.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};zT=WT([tp(),FT("design:paramtypes",[])],zT);var HT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let VT=class extends TT{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 1}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const n=new e(t).render().asPng();return this.loadImage(n)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return Ev.call(t)}}getCancelAnimationFrame(){return t=>{Ev.clear(t)}}addEventListener(t,e,n){}removeEventListener(t,e,n){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};VT=HT([tp()],VT);var GT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},XT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},YT=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};let qT=class extends TT{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,n,i,r,s){return YT(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let o=0;o<e.length;o++){const a=e[o];yield new Promise((e=>{let l=wx.createSelectorQuery();s&&(l=l.in(s)),l.select(`#${a}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const l=s[0].node,h=s[0].width,c=s[0].height;l.width=h*t,l.height=c*t,n.set(a,l),o>=i&&r.push(l),e(null)}))}))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.compoient).then((()=>{ET()}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ev.call(t)}}getCancelAnimationFrame(){return t=>{Ev.clear(t)}}addEventListener(t,e,n){return null}removeEventListener(t,e,n){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return(null===(e=null==t?void 0:t.type)||void 0===e?void 0:e.startsWith("mouse"))?t:null}};qT=GT([tp(),XT("design:paramtypes",[])],qT);var $T=new $f((t=>{t(MT).toSelf().inSingletonScope(),t(fp).toService(MT),t(jT).toSelf().inSingletonScope(),t(fp).toService(jT),t(NT).toSelf().inSingletonScope(),t(fp).toService(NT),t(zT).toSelf().inSingletonScope(),t(fp).toService(zT),t(qT).toSelf().inSingletonScope(),t(fp).toService(qT),t(VT).toSelf().inSingletonScope(),t(fp).toService(VT),cp(t,fp)})),KT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ZT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let JT=class{constructor(){this._uid=tv.GenAutoIncrementId()}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}};JT=KT([tp(),ZT("design:paramtypes",[])],JT);var QT=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},tC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},eC=function(t,e){return function(n,i){e(n,i,t)}};let nC=class extends JT{get container(){return this.canvas.nativeCanvas.parentElement}constructor(t){super(),this.global=t,this.type="browser",this._canvasIsIntersecting=!0}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>n||e.top>i)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let n;if(n="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!n)throw new Error("发生错误,containerId可能传入有误");t.offscreen?n=null:n.appendChild(e);const i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:n,id:tv.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new PB(i)}createWindowByCanvas(t){var e;let n;if("string"==typeof t.canvas){if(n=this.global.getElementById(t.canvas),!n)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=t.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");let i=t.width,r=t.height;if(null==i||null==r||!t.canvasControled){const t=n.getBoundingClientRect();i=t.width,r=t.height}let s=t.dpr;!1===t.canvasControled&&(s&&console.warn("canvasControled为false后,dpr参数将无效"),s=null),null==s&&(s=null!==(e=n.getContext("2d").pixelRatio)&&void 0!==e?e:n.width/i),this.canvas=new PB({width:i,height:r,dpr:s,nativeCanvas:n,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,n){return this.canvas.nativeCanvas.addEventListener(t,e,n)}removeEventListener(t,e,n){return this.canvas.nativeCanvas.removeEventListener(t,e,n)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){return this.canvas.nativeCanvas.style}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};nC.env="browser",nC=QT([tp(),eC(0,ip(pp)),tC("design:paramtypes",[Object])],nC);var iC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let rC=class extends _B{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}getImageData(t,e,n,i){return new Promise(((r,s)=>{var o;try{tt.canvasGetImageData({canvasId:null!==(o=this.canvas.nativeCanvas.id)&&void 0!==o?o:this.canvas.id,x:t,y:e,width:n,height:i,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}createPattern(t,e){return null}};rC.env="feishu",rC=iC([tp()],rC);var sC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},oC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const aC={WIDTH:500,HEIGHT:500,DPR:1};let lC=class{get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:n=aC.WIDTH,height:i=aC.HEIGHT,dpr:r=aC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new rC(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};lC.env="feishu",lC=sC([tp(),oC("design:paramtypes",[Object])],lC);var hC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},cC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uC=function(t,e){return function(n,i){e(n,i,t)}};let dC=class extends JT{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:tv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new lC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new lC({width:n,height:i,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};dC.env="feishu",dC=hC([tp(),uC(0,ip(pp)),cC("design:paramtypes",[Object])],dC);var fC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let pC=class extends _B{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,n){}_setCommonStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:o=r.fillOpacity,opacity:a=r.opacity,fill:l=r.fill}=e;o>1e-12&&a>1e-12&&(s.setGlobalAlpha(o*a),s.setFillStyle(b_(this,l,t,n,i)))}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.setGlobalAlpha(o*a),s.setLineWidth(m_(this,l,this.dpr)),s.setStrokeStyle(b_(this,h,t,n,i)),s.setLineJoin(c),s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(f)}}setTextStyleWithoutAlignBaseline(t,e){var n;const i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=qx(t,e),i.setFontSize(null!==(n=t.fontSize)&&void 0!==n?n:e.fontSize)}setTextStyle(t,e){var n,i;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=qx(t,e),r.setTextAlign(null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign),r.setTextBaseline(null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)}createConicGradient(t,e,n,i){return null}createPattern(t,e){return null}};pC.env="taro",pC=fC([tp()],pC);var gC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},yC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const vC={WIDTH:500,HEIGHT:500,DPR:1};let mC=class{get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:n=vC.WIDTH,height:i=vC.HEIGHT,dpr:r=vC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new pC(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};mC.env="taro",mC=gC([tp(),yC("design:paramtypes",[Object])],mC);var bC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},xC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wC=function(t,e){return function(n,i){e(n,i,t)}};let SC=class extends JT{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:tv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new mC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new mC({width:n,height:i,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,n)=>{t.changedTouches[n]=Object.assign(Object.assign({},t.changedTouches[n]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,n)=>{t.touches[n]=Object.assign(Object.assign({},t.touches[n]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};SC.env="taro",SC=bC([tp(),wC(0,ip(pp)),xC("design:paramtypes",[Object])],SC);var AC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let _C=class extends _B{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t,this._globalAlpha=t}setLineDash(t){const e=arguments,n=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;n.setLineDash(t)}}_setStrokeStyle(t,e,n,i,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:o=r.strokeOpacity,opacity:a=r.opacity}=e;if(o>1e-12&&a>1e-12){const{lineWidth:l=r.lineWidth,stroke:h=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:f=r.miterLimit}=e;s.globalAlpha=o*a,s.lineWidth=m_(this,l,this.dpr),s.strokeStyle=b_(this,h,t,n,i),s.lineJoin=c,0===u[0]&&0===u[1]||s.setLineDash(u),s.lineCap=d,s.miterLimit=f}}createPattern(t,e){return null}draw(){const t=this.nativeContext;this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))}))}};_C.env="lynx",_C=AC([tp()],_C);var BC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},TC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const CC={WIDTH:500,HEIGHT:500,DPR:1};let PC=class{get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:n=CC.WIDTH,height:i=CC.HEIGHT,dpr:r=CC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new _C(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};PC.env="lynx",PC=BC([tp(),TC("design:paramtypes",[Object])],PC);var RC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},OC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},MC=function(t,e){return function(n,i){e(n,i,t)}};let EC=class extends JT{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:tv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new PC(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new PC({width:n,height:i,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};EC.env="lynx",EC=RC([tp(),MC(0,ip(pp)),OC("design:paramtypes",[Object])],EC);var kC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},IC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jC=class extends _B{constructor(t,e){super(t,e);const n=t.nativeCanvas.getContext("2d");if(!n)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=n,this.canvas=t,this.matrix=new V(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};jC.env="node",jC=kC([tp(),IC("design:paramtypes",[Object,Number])],jC);var DC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const NC={WIDTH:500,HEIGHT:500,DPR:1};let WC=class{get id(){return this._id}get x(){return 0}set x(t){}get y(){return 0}set y(t){}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this.width,this.height)}constructor(t){const{nativeCanvas:e,width:n=NC.WIDTH,height:i=NC.HEIGHT,canvasControled:r=!0,dpr:s=NC.DPR}=t;this._visiable=!1!==t.visiable,this.controled=r,this._pixelWidth=n*s,this._pixelHeight=i*s,this._displayWidth=n,this._displayHeight=i,this._nativeCanvas=e,this._context=new jC(this,t.dpr),this._id=e.id,this._dpr=s}applyPosition(){}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}hide(){}show(){}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas&&(this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight)}toDataURL(t,e){return""}readPixels(t,e,n,i){return this._context.getImageData(t,e,n,i)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this._nativeCanvas.release&&a(this._nativeCanvas.release)&&this._nativeCanvas.release()}};WC.env="node",WC=DC([tp(),LC("design:paramtypes",[Object])],WC);var FC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},UC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zC=function(t,e){return function(n,i){e(n,i,t)}};let HC=class extends JT{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:tv.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new WC(n)}createWindowByCanvas(t){const e=t.canvas;let n=t.width,i=t.height;null!=n&&null!=i&&t.canvasControled||(n=e.width,i=e.height),this.canvas=new WC({width:n,height:i,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,n){}dispatchEvent(t){return!0}removeEventListener(t,e,n){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t,e){}};HC.env="node",HC=FC([tp(),zC(0,ip(pp)),UC("design:paramtypes",[Object])],HC);var VC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let GC=class extends _B{draw(){}createPattern(t,e){return null}};GC.env="wx",GC=VC([tp()],GC);var XC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},YC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const qC={WIDTH:500,HEIGHT:500,DPR:1};let $C=class{get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}get displayWidth(){return this._displayWidth}get displayHeight(){return this._displayHeight}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t}constructor(t){const{nativeCanvas:e,width:n=qC.WIDTH,height:i=qC.HEIGHT,dpr:r=qC.DPR}=t,{x:s,y:o}=e.getBoundingClientRect?e.getBoundingClientRect():{x:0,y:0};this._x=s,this._y=o,this._pixelWidth=n*r,this._pixelHeight=i*r,this._visiable=!1!==t.visiable,this._displayWidth=n,this._displayHeight=i,this._dpr=r,this._nativeCanvas=e,this._context=new GC(this,this._dpr),this._id=e.id}getNativeCanvas(){return this._nativeCanvas}resetStyle(t){}applyPosition(){}hide(){}show(){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,n,i){throw new Error("暂未实现")}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){}};$C.env="wx",$C=XC([tp(),YC("design:paramtypes",[Object])],$C);var KC=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},ZC=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},JC=function(t,e){return function(n,i){e(n,i,t)}};class QC{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const n=this.cache[t].listener.findIndex((t=>t===e));n>=0&&this.cache[t].listener.splice(n,1)}cleanEvent(){this.cache={}}}let tP=class extends JT{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new QC}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:tv.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new $C(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){const t=e.getBoundingClientRect();n=t.width,i=t.height}let r=t.dpr;null==r&&(r=e.width/n),this.canvas=new $C({width:n,height:i,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){var e,n,i,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(n=t.changedTouches[0].x)&&void 0!==n?n:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(i=t.changedTouches[0].y)&&void 0!==i?i:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t,e){const n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1),e&&(n.fillStyle=e,n.fillRect(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1)),n.nativeContext.restore()}};tP.env="wx",tP=KC([tp(),JC(0,ip(pp)),ZC("design:paramtypes",[Object])],tP);var eP=new $f((t=>{t(nC).toSelf(),t(ax).toDynamicValue((t=>t.container.get(nC))).whenTargetNamed(nC.env),t(dC).toSelf(),t(ax).toDynamicValue((t=>t.container.get(dC))).whenTargetNamed(dC.env),t(SC).toSelf(),t(ax).toDynamicValue((t=>t.container.get(SC))).whenTargetNamed(SC.env),t(EC).toSelf(),t(ax).toDynamicValue((t=>t.container.get(EC))).whenTargetNamed(EC.env),t(tP).toSelf(),t(ax).toDynamicValue((t=>t.container.get(tP))).whenTargetNamed(tP.env),t(HC).toSelf(),t(ax).toDynamicValue((t=>t.container.get(HC))).whenTargetNamed(HC.env)})),nP=new $f((t=>{t(sy).toSelf().inSingletonScope(),t(ry).toService(sy),cp(t,ry)})),iP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},rP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sP=function(t,e){return function(n,i){e(n,i,t)}};let oP=class{constructor(t){this.global=t,this.offscreen=!1}setDpr(t){this.canvas.dpr=t}init(t,e,n){if(this.layer=t,this.window=e,n.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,t=n.canvasId?this.global.getElementById(n.canvasId):this.global.createCanvas({width:e.width,height:e.height}),t.style&&(t.style["pointer-events"]="none");const i=e.getContext().getCanvas().nativeCanvas,r=hy({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:i.offsetLeft,y:i.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,n){var i;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"},e),n))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,n){var i;const r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};oP=iP([tp(),sP(0,ip(pp)),rP("design:paramtypes",[Object])],oP);var aP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hP=function(t,e){return function(n,i){e(n,i,t)}};let cP=class{constructor(t){this.global=t,this.offscreen=!0}setDpr(t){this.canvas.dpr=t}init(t,e,n){this.layer=t;const i=hy({nativeCanvas:this.global.createOffscreenCanvas({width:n.width,height:n.height,dpr:e.dpr}),width:n.width,height:n.height,dpr:e.dpr,canvasControled:!0});this.canvas=i,this.context=i.getContext()}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){this.canvas.resize(t,e)}render(t,e){var n;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"}))}prepare(t,e){}release(){this.canvas.release()}getContext(){return this.context}drawTo(t,e,n){const i=t.getContext(),r=t.dpr,{x:s=0,y:o=0,width:a=this.layer.viewWidth,height:l=this.layer.viewHeight}=n;i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),n.clear&&i.clearRect(s,o,a,l),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,o,a,l),i.nativeContext.restore()}merge(t){}};cP=aP([tp(),hP(0,ip(pp)),lP("design:paramtypes",[Object])],cP);var uP=new $f((t=>{t(oP).toSelf(),t(cP).toSelf(),t(Zb).toService(oP)}));var dP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};const fP=Symbol.for("DrawItemInterceptor"),pP=new U;let gP=class{constructor(){this.order=1}afterDrawItem(t,e,n,i,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,n,i,r),!1}beforeDrawItem(t,e,n,i,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,n,i,r),!1}drawItem(t,e,n,i,r){if(!t.shadowRoot)return!1;const{context:s}=n;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),i.dirtyBounds&&i.backupDirtyBounds){pP.copy(i.dirtyBounds);const e=t.globalTransMatrix.getInverse();i.dirtyBounds.copy(i.backupDirtyBounds).transformWithMatrix(e)}return i.renderGroup(t.shadowRoot,n),s.highPerformanceRestore(),i.dirtyBounds&&i.backupDirtyBounds&&i.dirtyBounds.copy(pP),!0}};gP=dP([tp()],gP);let yP=class{constructor(){this.order=1}beforeDrawItem(t,e,n,i,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;const{context:s,stage:o}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=o.camera;const a=s.currentMatrix;a.a/=s.dpr,a.b/=s.dpr,a.c/=s.dpr,a.d/=s.dpr,a.e/=s.dpr,a.f/=s.dpr;const l=VS.allocate();$S(l,a);const h=s.modelMatrix;if(h){if(l){const t=VS.allocate();s.modelMatrix=KS(t,h,l)}}else s.modelMatrix=l;if(s.setTransform(1,0,0,1,0,0,!0),t.isContainer){let e=!1,r=!1;if(t.forEachChildren((t=>(e=t.numberType===Ob,!e))),t.forEachChildren((t=>(r=!!t.findFace,!r))),e){const e=t.getChildren(),r=[...e];r.sort(((t,e)=>{var n,i,r,s;let o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(i=t.attribute.endAngle)&&void 0!==i?i:0))/2,a=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(s=e.attribute.endAngle)&&void 0!==s?s:0))/2;for(;o<0;)o+=B;for(;a<0;)a+=B;return a-o})),r.forEach((t=>{t._next=null,t._prev=null})),t.removeAllChild(),t.update(),r.forEach((e=>{t.appendChild(e)})),n.hack_pieFace="outside",i.renderGroup(t,n),n.hack_pieFace="inside",i.renderGroup(t,n),n.hack_pieFace="top",i.renderGroup(t,n),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),e.forEach((e=>{t.appendChild(e)}))}else if(r){const e=t.getChildren(),r=e.map((t=>({ave_z:t.findFace().vertices.map((e=>{var n;return s.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce(((t,e)=>t+e),0),g:t})));r.sort(((t,e)=>e.ave_z-t.ave_z)),t.removeAllChild(),r.forEach((t=>{t.g._next=null,t.g._prev=null})),t.update(),r.forEach((e=>{t.add(e.g)})),i.renderGroup(t,n,!0),t.removeAllChild(),e.forEach((t=>{t._next=null,t._prev=null})),t.update(),e.forEach((e=>{t.add(e)}))}else i.renderGroup(t,n)}else i.renderItem(t,n);return s.camera=null,s.restore(),s.modelMatrix!==h&&VS.free(s.modelMatrix),s.modelMatrix=h,n.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}};yP=dP([tp()],yP);var vP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bP=function(t,e){return function(n,i){e(n,i,t)}};let xP=class{constructor(t,e,n,i){this.contributions=t,this.renderSelector=e,this.layerService=n,this.drawItemInterceptorContributions=i,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new F,this.backupDirtyBounds=new F}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}draw(t,e){e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:n,stage:i,x:r=0,y:s=0,width:o,height:a}=e;if(!n)return;const l=this.dirtyBounds.setValue(0,0,o,a);if(i.dirtyBounds&&!i.dirtyBounds.empty()){const t=(h=l,c=i.dirtyBounds,u=!1,null===h?c:null===c?h:(G=h.x1,X=h.x2,Y=h.y1,q=h.y2,$=c.x1,K=c.x2,Z=c.y1,J=c.y2,u&&(G>X&&([G,X]=[X,G]),Y>q&&([Y,q]=[q,Y]),$>K&&([$,K]=[K,$]),Z>J&&([Z,J]=[J,Z])),G>=K||X<=$||Y>=J||q<=Z?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(G,$),y1:Math.max(Y,Z),x2:Math.min(X,K),y2:Math.min(q,J)}));l.x1=Math.floor(t.x1),l.y1=Math.floor(t.y1),l.x2=Math.ceil(t.x2),l.y2=Math.ceil(t.y2)}var h,c,u;this.backupDirtyBounds.copy(l),n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0);const d=l.width()*n.dpr!==n.canvas.width||l.height()*n.dpr!==n.canvas.height;n.save(),n.translate(r,s,!0),d&&(n.beginPath(),n.rect(l.x1,l.y1,l.width(),l.height()),n.clip()),i.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,n,e),n.save(),t.renderTreeRoots.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Rg.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Rg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),n.restore(),n.restore(),n.draw(),n.inuse=!1}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,n=t._uid;for(;e;){const t=rB(e,n,Rg.zIndex);if(t)return t;n=e._uid,e=e.parent}return null}renderGroup(t,e,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!et(t.AABBBounds,this.dirtyBounds,!1))return;const i=this.dirtyBounds.clone(),r=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r),this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))})):nB(t,Rg.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.dirtyBounds.copy(i)}_increaseRender(t,e){const{layer:n,stage:i}=e,{subLayers:r}=n;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(i),zIndex:r.size,group:t},r.set(t._uid,s));const o=s.layer.getNativeHandler().getContext(),a=s.drawContribution||oy.get(JA);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:s.layer,context:o,startAtId:t._uid,break:!1})),s.drawContribution=a;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=r.get(l._uid);t||(t={layer:this.layerService.createLayer(i),zIndex:r.size},r.set(l._uid,t));const n=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:t.layer,context:n,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e=this.renderSelector.selector(t);return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,n){if(this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const r=this.InterceptorContributions[i];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,n))return}const i=this.getRenderContribution(t);if(!i)return;if(!t.isContainer&&!et(t.AABBBounds,this.dirtyBounds,!1))return;const r=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),n&&(n.skipDraw=r),r?t.isContainer&&i.draw(t,this.currentRenderService,e,n):i.draw(t,this.currentRenderService,e,n),this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const i=this.InterceptorContributions[n];if(i.afterDrawItem&&i.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return console.warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,n){const{clear:i}=n;if(i){const t=e.getCanvas(),{width:r=t.width,height:s=t.height}=n,o=0,a=0;e.clearRect(o,a,r,s),e.fillStyle=b_(e,i,{AABBBounds:{x1:o,y1:a,x2:o+r,y2:a+s}},0,0),e.fillRect(o,a,r,s)}}afterDraw(t,e){}};vP([ip(pp),mP("design:type",Object)],xP.prototype,"global",void 0),vP([ap(),mP("design:type",Function),mP("design:paramtypes",[]),mP("design:returntype",void 0)],xP.prototype,"init",null),xP=vP([tp(),bP(0,rp(i_)),bP(1,ip(y_)),bP(2,ip(ux)),bP(3,ip(lp)),bP(3,ep(fP)),mP("design:paramtypes",[Array,Object,Object,Object])],xP);var wP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let SP=class{selector(t){return null}};SP=wP([tp()],SP);var AP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},_P=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},BP=function(t,e){return function(n,i){e(n,i,t)}};let TP=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Ib}drawShape(t,e,n,i,r,s,o,a){const l=Qy(t,null==s?void 0:s.theme).group,{fill:h=l.fill,background:c,stroke:u=l.stroke,opacity:f=l.opacity,width:p=l.width,height:g=l.height,clip:y=l.clip,fillOpacity:v=l.fillOpacity,strokeOpacity:m=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:S=l.visible}=t.attribute,A=yx(f,v,p,g,h),_=mx(f,m,p,g),B=fx(h,c),T=px(u,w);if(!t.valid||!S)return;if(!y){if(!B&&!T)return;if(!(A||_||o||a||c))return}if(x&&x.length&&r.drawContribution){const t=e.disableFill,n=e.disableStroke,i=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,x.forEach((t=>{r.drawContribution.getRenderContribution(t).draw(t,r.renderService,r,s)})),e.disableFill=t,e.disableStroke=n,e.disableBeginPath=i}else 0===b||d(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(n,i,p,g)):(e.beginPath(),BA(e,n,i,p,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[]);const C={doFill:B,doStroke:T};this._groupRenderContribitions.forEach((s=>{s.time===Wp.beforeFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a,C)})),y&&e.clip(),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,l),C.doFill&&(o?o(e,t.attribute,l):A&&(e.setCommonStyle(t,t.attribute,n,i,l),e.fill())),C.doStroke&&(a?a(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,n,i,l),e.stroke())),this._groupRenderContribitions.forEach((s=>{s.time===Wp.afterFillStroke&&s.drawShape(t,e,n,i,B,T,A,_,l,r,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;const{clip:s}=t.attribute;s?r.save():r.highPerformanceSave();const o=Qy(t,null==i?void 0:i.theme).group,a=r.modelMatrix;if(r.camera){const e=VS.allocate(),n=VS.allocate();ZS(n,t,o),KS(e,a||e,n),r.modelMatrix=e,VS.free(n),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,n);const{scrollX:l=o.scrollX,scrollY:h=o.scrollY}=t.attribute;let c;(l||h)&&r.translate(l,h),i&&i.drawingCb&&(c=i.drawingCb()),r.modelMatrix!==a&&VS.free(r.modelMatrix),r.modelMatrix=a,c&&c.then?c.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}};TP=AP([tp(),BP(0,ip(lp)),BP(0,ep(Ox)),_P("design:paramtypes",[Object])],TP);var CP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let PP=class extends uA{constructor(){super(...arguments),this.numberType=Db}drawShape(t,e,n,i,r,s,o,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Qy(t).line,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:f=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:g=h.lineWidth,visible:y=h.visible}=t.attribute,v=gx(d,f,c),m=vx(d,p),b=fx(c),x=px(u,g);if(!t.valid||!y)return;if(!b&&!x)return;if(!(v||m||o||a))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],n,i)}else super.drawShape(t,e,n,i,r,s,o,a)}drawIncreaseSegment(t,e,n,i,r,s,o,a){i&&(e.beginPath(),function(t,e,n,i){const{offsetX:r=0,offsetY:s=0}=i||{},o=e?e.points[e.points.length-1]:n.points[0];t.moveTo(o.x+r,o.y+s),n.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}(e.nativeContext,n,i,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setStrokeStyle(t,r,o,a,s),e.stroke())}};PP=CP([tp()],PP);var RP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let OP=class extends bA{constructor(){super(...arguments),this.numberType=Mb}drawShape(t,e,n,i,r,s,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:a}=r.multiGraphicOptions,{segments:l=[]}=t.attribute;if(s>l.length)return;const h=Qy(t).area,{fill:c=h.fill,fillOpacity:u=h.fillOpacity,opacity:d=h.opacity,visible:f=h.visible}=t.attribute,p=gx(d,u,c),g=fx(c);if(!t.valid||!f)return;if(!g)return;if(!p&&!o)return;for(let r=s;r<s+a;r++)this.drawIncreaseSegment(t,e,l[r-1],l[r],t.attribute.segments[r],[h,t.attribute],n,i)}else super.drawShape(t,e,n,i,r,s,o)}drawIncreaseSegment(t,e,n,i,r,s,o,a){i&&(e.beginPath(),function(t,e,n,i){const{offsetX:r=0,offsetY:s=0}=i||{},{points:o}=n,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((n,i)=>{var o,a,l,h;const c=e&&0===i?e.points[e.points.length-1]:n[0];t.moveTo(c.x+r,c.y+s),n.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=n.length-1;e>=0;e--){const i=n[e];t.lineTo(null!==(o=i.x1)&&void 0!==o?o:i.x,null!==(a=i.y1)&&void 0!==a?a:i.y)}t.lineTo(null!==(l=c.x1)&&void 0!==l?l:c.x,null!==(h=c.y1)&&void 0!==h?h:c.y),t.closePath()}))}(e.camera?e:e.nativeContext,n,i,{offsetX:o,offsetY:a}),e.setShadowStyle&&e.setShadowStyle(t,r,s),e.setCommonStyle(t,r,o,a,s),e.fill())}};OP=RP([tp()],OP);var MP,EP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kP=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IP=function(t,e){return function(n,i){e(n,i,t)}},jP=function(t,e,n,i){return new(n||(n=Promise))((function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}l((i=i.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(MP||(MP={}));let DP=class extends xP{constructor(t,e,n,i,r,s){super(t,e,r,s),this.contributions=t,this.renderSelector=e,this.lineRender=n,this.areaRender=i,this.layerService=r,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=MP.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new dp([])}}init(){super.init(),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return jP(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const n=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,n)return;this.currentRenderService=t;const{context:i,x:r=0,y:s=0}=e;i&&(i.inuse=!0,i.clearMatrix(),i.setTransformForCurrent(!0),i.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,i,e),i.translate(r,s,!0),i.save(),t.renderTreeRoots.sort(((t,e)=>{var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:Rg.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:Rg.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{i.restore(),i.restore(),i.draw(),i.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return jP(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return jP(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((n=>{this.renderItem(t,e,{drawingCb:()=>jP(this,void 0,void 0,(function*(){if(2!==t.count)yield iB(t,Rg.zIndex,((n,i)=>{if(this.status===MP.STOP)return!0;if(n.isContainer)return!1;if(i<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return i<r&&(this.currentIdx=i+1,this.renderItem(n,e)),i===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),n(!1);else{const i=t.getChildAt(0);if(i.incremental&&i.attribute.segments)for(i.incrementalAt||(i.incrementalAt=0);i.incrementalAt<i.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:i.incrementalAt,length:i.incremental},this.renderItem(i,e),i.incrementalAt+=i.incremental,yield this.waitToNextFrame();else this.renderItem(i,e);n(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return jP(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return jP(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return jP(this,void 0,void 0,(function*(){this.rendering&&(this.status=MP.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=MP.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return jP(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((n=>{this.renderItem(t,e,{drawingCb:()=>jP(this,void 0,void 0,(function*(){yield iB(t,Rg.zIndex,(t=>jP(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),n(!1)}))})})))}))}};EP([ip(pp),kP("design:type",Object)],DP.prototype,"global",void 0),DP=EP([tp(),IP(0,rp(i_)),IP(1,ip(y_)),IP(2,ip(PP)),IP(3,ip(OP)),IP(4,ip(ux)),IP(5,ip(lp)),IP(5,ep(fP)),kP("design:paramtypes",[Array,Object,Object,Object,Object,Object])],DP);var LP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let NP=class extends aA{constructor(){super(...arguments),this.type="rect3d",this.numberType=Ub}drawShape(t,e,n,i,r,s,o,a){var l;const h=Qy(t,null==s?void 0:s.theme).rect3d,{fill:c=h.fill,stroke:u=h.stroke,width:d=h.width,height:f=h.height,opacity:p=h.opacity,fillOpacity:g=h.fillOpacity,lineWidth:y=h.lineWidth,strokeOpacity:v=h.strokeOpacity,visible:m=h.visible}=t.attribute,b=null!==(l=this.z)&&void 0!==l?l:0,x=yx(p,g,d,f,c),w=mx(p,v,d,f),S=fx(c),A=px(u,y);if(!t.valid||!m)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:_,camera:B}=r.stage||{},T=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,n,i,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(n,i,b,T,r,e,_,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,b,T,e))}stroke(t,e,n,i,r){const s=i.vertices;i.edges.forEach((i=>{const o=s[i[0]],a={x:t+o[0],y:e+o[1],z:n+o[2]},l=s[i[1]],h={x:t+l[0],y:e+l[1],z:n+l[2]};r.beginPath(),r.moveTo(a.x,a.y,a.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(t,e,n,i,r,s,o,a){const l=Wv.get(r).value,h=i.vertices,c=h.map((t=>s.view(t[0],t[1],t[2])[2])),u=[];i.polygons.forEach(((t,e)=>{u.push({faceIdx:e,polygon:t});const{polygon:n,normal:i}=t,r=c[n[0]],s=c[n[1]],o=c[n[2]],a=c[n[3]];t.ave_z=r+s+o+a})),u.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),u.forEach((i=>{const{polygon:c,normal:u}=i.polygon,d=h[c[0]],f=h[c[1]],p=h[c[2]],g=h[c[3]],y={x:t+d[0],y:e+d[1],z:n+d[2]},v={x:t+f[0],y:e+f[1],z:n+f[2]},m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+g[0],y:e+g[1],z:n+g[2]};s.beginPath(),s.moveTo(y.x,y.y,y.z),s.lineTo(v.x,v.y,v.z),s.lineTo(m.x,m.y,m.z),s.lineTo(b.x,b.y,b.z),s.closePath(),a?a(s,null,null):(s.fillStyle=o?o.computeColor(u,l):r,s.fill())}))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=Qy(t).rect,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;this.z=l,this.drawShape(t,i,o,a,n),this.z=0,i.modelMatrix!==h&&VS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}};NP=LP([tp()],NP);var WP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let FP=class{constructor(){this.numberType=zb}drawShape(t,e,n,i,r){const s=Qy(t).richtext,{width:o=s.width,height:a=s.height,opacity:l=s.opacity,fillOpacity:h=s.fillOpacity,visible:c=s.visible}=t.attribute;t.valid&&c&&gx(l,h,!0)&&(e.translate(n,i),t.getFrameCache().draw(e,this.drawIcon))}drawIcon(t,e,n,i,r){var s;const o=Qy(t).richtextIcon,{width:a=o.width,height:l=o.height,opacity:h=o.opacity,image:c,backgroundFill:u=o.backgroundFill,backgroundFillOpacity:d=o.backgroundFillOpacity,backgroundStroke:f=o.backgroundStroke,backgroundStrokeOpacity:p=o.backgroundStrokeOpacity,backgroundRadius:g=o.backgroundRadius,margin:y}=t.attribute,{backgroundWidth:v=a,backgroundHeight:m=l}=t.attribute;if(y&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){const t=(v-a)/2,r=(m-l)/2;0===g?(e.beginPath(),e.rect(n-t,i-r,v,m)):(e.beginPath(),BA(e,n-t,i-r,v,m,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),f&&(e.globalAlpha=p,e.strokeStyle=f,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=h,e.drawImage(b.data,n,i,a,l))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=Qy(t).richtext;let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);this.drawShape(t,i,s,o,n),i.highPerformanceRestore()}};FP=WP([tp()],FP);var UP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let zP=class{constructor(){this.numberType=kb}drawShape(t,e,n,i,r,s,o,a){r.drawContribution&&t.getSubGraphic().forEach((t=>{const l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,n,i,r,s,o,a)}))}draw(t,e,n,i){const{context:r}=n;if(!r)return;if(r.highPerformanceSave(),!n.drawContribution)return;const s=Qy(t),o=t.getSubGraphic();o.length&&o.forEach((t=>{n.drawContribution.renderItem(t,n,{theme:s})})),r.highPerformanceRestore()}};zP=UP([tp()],zP);var HP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let VP=class extends aA{constructor(){super(...arguments),this.numberType=Ob}drawShape(t,e,n,i,r,s,o,a){var l;const h=Qy(t,null==s?void 0:s.theme).arc,{fill:c=h.fill,background:u,stroke:d=h.stroke,opacity:f=h.opacity,fillOpacity:p=h.fillOpacity,lineWidth:g=h.lineWidth,strokeOpacity:y=h.strokeOpacity,visible:v=h.visible}=t.attribute,m=gx(f,p,c),b=vx(f,y),x=fx(c,u),S=px(d,g),A=null!==(l=this.z)&&void 0!==l?l:0;if(!t.valid||!v)return;if(!x&&!S)return;if(!(m||b||o||a||u))return;const{outerRadius:_=h.outerRadius,innerRadius:C=h.innerRadius,height:R=10}=t.attribute,O=Wv.get(c).value,{light:E}=r.stage||{},k=r.hack_pieFace,I={top:A,bottom:A+R},j={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===k||"top"===k?(e.beginPath(),function(t,e,n,i,r,s,o){const{startAngle:a,endAngle:l}=t.getParsedAngle(),h=T(l-a),c=l>a;let u=!1;if(s<o){const t=s;s=o,o=t}if(s<=w)e.moveTo(n,i,r);else if(h>=B-w)e.moveTo(n+s*P(a),i+s*M(a),r),e.arc(n,i,s,a,l,!c,r),o>w&&(e.moveTo(n+o*P(l),i+o*M(l),r),e.arc(n,i,o,l,a,c,r));else{const{outerDeltaAngle:h,innerDeltaAngle:d,outerStartAngle:f,outerEndAngle:p,innerEndAngle:g,innerStartAngle:y}=t.getParsePadAngle(a,l),v=s*P(f),m=s*M(f),b=o*P(g),x=o*M(g);h<.001?u=!0:(e.moveTo(n+v,i+m,r),e.arc(n,i,s,f,p,!c,r)),!(o>w)||d<.001?(e.lineTo(n+b,i+x,r),u=!0):(e.lineTo(n+b,i+x,r),e.arc(n,i,o,g,y,c,r))}e.closePath()}(t,e,n,i,I[k],_,C),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),x&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=E?E.computeColor(j[k],O):c,e.fill())),S&&(a?a(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke()))):"outside"!==k&&"inside"!==k||("inside"===k&&(e.save(),e.beginPath(),e.arc(n,i,C,0,B,!0,I.top),e.clip()),e.beginPath(),function(t,e,n,i,r,s,o,a){const{startAngle:l,endAngle:h}=t.getParsedAngle(),c=T(h-l),u=h>l;let d=!1;if(o<=w)e.moveTo(n,i,r);else if(c>=B-w)e.moveTo(n+o*P(l),i+o*M(l),r),e.arc(n,i,o,l,h,!u,r),e.lineTo(n+o*P(h),i+o*M(h),s),e.arc(n,i,o,h,l,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:f}=a(l,h),p=o*P(c),g=o*M(c),y=o*P(f),v=o*M(f);t<.001?d=!0:(e.moveTo(n+p,i+g,r),e.arc(n,i,o,c,f,!u,r),e.lineTo(n+y,i+v,s),e.arc(n,i,o,f,c,u,s))}e.closePath()}(t,e,n,i,I.top,I.bottom,"outside"===k?_:C,((e,n)=>{const{outerDeltaAngle:i,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:o,innerEndAngle:a,innerStartAngle:l}=t.getParsePadAngle(e,n);return"outside"===k?{innerouterDeltaAngle:i,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:a,innerouterStartAngle:l}})),e.setShadowStyle&&e.setShadowStyle(t,t.attribute,h),x&&(o?o(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,n,i,h),e.fillStyle=E?E.computeColor(j[k],O):c,e.fill())),S&&(a?a(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,n,i,h),e.stroke())),"inside"===k&&e.restore())}draw(t,e,n,i){const{context:r}=n;if(!r)return;const s=Qy(t,null==i?void 0:i.theme).arc;r.save();const o=this.transform(t,s,r),{x:a,y:l,z:h,lastModelMatrix:c}=o;this.z=h,bx(t,r,a,l,0,i)||(this.drawShape(t,r,a,l,n,i),this.z=0,r.modelMatrix!==c&&VS.free(r.modelMatrix),r.modelMatrix=c),r.restore()}};VP=HP([tp()],VP);var GP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let XP=class extends aA{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Wb}drawShape(t,e,n,i,r,s,o,a){var l;const h=Qy(t,null==s?void 0:s.theme).polygon,{fill:c=h.fill,stroke:u=h.stroke,opacity:d=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:y=h.visible,points:v,face:m=[!0,!0,!0,!0,!0,!0]}=t.attribute,b=null!==(l=this.z)&&void 0!==l?l:0,x=gx(d,f,c),w=vx(d,g),S=fx(c),A=px(u,p);if(!t.valid||!y||4!==v.length)return;if(!S&&!A)return;if(!(x||w||o||a))return;const{light:_,camera:B}=r.stage||{},T=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,n,i,h);let r=c;"string"!=typeof r&&(r="black"),this.fill(n,i,b,T,m,r,e,_,B,t,h,o)}!1!==u&&(e.setStrokeStyle(t,t.attribute,n,i,h),this.stroke(n,i,b,T,e))}stroke(t,e,n,i,r){const s=i.vertices;i.edges.forEach((i=>{const o=s[i[0]],a=s[i[1]],l={x:t+o[0],y:e+o[1],z:n+o[2]},h={x:t+a[0],y:e+a[1],z:n+a[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(h.x,h.y,h.z),r.stroke()}))}fill(t,e,n,i,r,s,o,a,l,h,c,u){const d=Wv.get(s).value,f=i.vertices,p=f.map((t=>o.view(t[0],t[1],t[2])[2])),g=[];i.polygons.forEach(((t,e)=>{if(!r[e])return;g.push({faceIdx:e,polygon:t});const{polygon:n,normal:i}=t,s=p[n[0]],o=p[n[1]],a=p[n[2]],l=p[n[3]];t.ave_z=s+o+a+l})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((i=>{const{polygon:r,normal:l}=i.polygon,p=f[r[0]],g=f[r[1]],y=f[r[2]],v=f[r[3]],m={x:t+p[0],y:e+p[1],z:n+p[2]},b={x:t+g[0],y:e+g[1],z:n+g[2]},x={x:t+y[0],y:e+y[1],z:n+y[2]},w={x:t+v[0],y:e+v[1],z:n+v[2]};o.beginPath(),o.moveTo(m.x,m.y,m.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.lineTo(w.x,w.y,w.z),o.closePath(),u?u(o,h.attribute,c):(o.fillStyle=a?a.computeColor(l,d):s,o.fill())}))}draw(t,e,n){const{context:i}=n;if(!i)return;i.highPerformanceSave();const r=Qy(t).polygon,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;this.z=l,this.drawShape(t,i,o,a,n),this.z=0,i.modelMatrix!==h&&VS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore()}};XP=GP([tp()],XP);var YP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let qP=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}};qP=YP([tp()],qP);let $P=class extends T_{constructor(){super(...arguments),this.time=Wp.afterFillStroke}};$P=YP([tp()],$P);var KP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let ZP=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}};ZP=KP([tp()],ZP);let JP=class extends T_{constructor(){super(...arguments),this.time=Wp.afterFillStroke}};JP=KP([tp()],JP);var QP=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let tR=class extends __{constructor(){super(...arguments),this.time=Wp.beforeFillStroke}};tR=QP([tp()],tR);let eR=class extends T_{constructor(){super(...arguments),this.time=Wp.afterFillStroke}drawShape(t,e,n,i,r,s,o,a,l,h,c,u,d){var f,p,g,y;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:v=t.attribute}=d||{},{texture:m=(null!==(f=t.attribute.texture)&&void 0!==f?f:Ov(l,"texture")),textureColor:b=(null!==(p=t.attribute.textureColor)&&void 0!==p?p:Ov(l,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:Ov(l,"textureSize")),texturePadding:w=(null!==(y=t.attribute.texturePadding)&&void 0!==y?y:Ov(l,"texturePadding"))}=v;if(!m)return;let S=this.textureMap.get(m);if(!S)switch(m){case"circle":S=this.createCirclePattern(x,w,b,e);break;case"diamond":S=this.createDiamondPattern(x,w,b,e);break;case"rect":S=this.createRectPattern(x,w,b,e);break;case"vertical-line":S=this.createVerticalLinePattern(x,w,b,e);break;case"horizontal-line":S=this.createHorizontalLinePattern(x,w,b,e);break;case"bias-lr":S=this.createBiasLRLinePattern(x,w,b,e);break;case"bias-rl":S=this.createBiasRLLinePattern(x,w,b,e);break;case"grid":S=this.createGridPattern(x,w,b,e)}S&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,l),e.fillStyle=S,e.fill(),e.highPerformanceRestore())}};eR=QP([tp()],eR);var nR=new $f((t=>{t(xP).toSelf(),t(v_).toService(xP),t(DP).toSelf(),t(JA).toService(DP),t(SP).toSelf(),t(y_).toService(SP),t(Gx).toSelf().inSingletonScope(),t(n_).to(Gx),t(i_).to(Gx),t(E_).toSelf().inSingletonScope(),t(k_).toSelf().inSingletonScope(),t(I_).toSelf().inSingletonScope(),t(Rx).toService(E_),t(Rx).toService(k_),t(Rx).toService(I_),cp(t,Rx),t(RA).toSelf().inSingletonScope(),t(l_).to(RA),t(i_).to(RA),t(NP).toSelf().inSingletonScope(),t(h_).toService(NP),t(i_).toService(h_),t(F_).toSelf().inSingletonScope(),t(U_).toSelf().inSingletonScope(),t(z_).toSelf().inSingletonScope(),t(H_).toSelf().inSingletonScope(),t(V_).toSelf().inSingletonScope(),t(Ix).toService(F_),t(Ix).toService(U_),t(Ix).toService(z_),t(Ix).toService(H_),t(Ix).toService(V_),cp(t,Ix),t(LA).toSelf().inSingletonScope(),t(u_).to(LA),t(i_).to(LA),cp(t,Dx),t(AA).toSelf().inSingletonScope(),t(o_).to(AA),t(i_).to(AA),t(ZP).toSelf().inSingletonScope(),t(JP).toSelf().inSingletonScope(),t(Ex).toService(ZP),t(Ex).toService(JP),cp(t,Ex),t(kA).toSelf().inSingletonScope(),t(c_).to(kA),t(i_).to(kA),t(X_).toSelf().inSingletonScope(),t(Y_).toSelf().inSingletonScope(),t(q_).toSelf().inSingletonScope(),t(jx).toService(X_),t(jx).toService(Y_),t(jx).toService(q_),cp(t,jx),t(Ux).toSelf().inSingletonScope(),t(QA).to(Ux),t(i_).to(Ux),t(VP).toSelf().inSingletonScope(),t(t_).toService(VP),t(i_).toService(t_),t(P_).toSelf().inSingletonScope(),t(R_).toSelf().inSingletonScope(),t(O_).toSelf().inSingletonScope(),t(Cx).toService(P_),t(Cx).toService(R_),t(Cx).toService(O_),cp(t,Cx),t(uA).toSelf().inSingletonScope(),t(s_).to(uA),t(i_).to(uA),t(PP).toSelf().inSingletonScope(),t(OP).toSelf().inSingletonScope(),t(bA).toSelf().inSingletonScope(),t(e_).to(bA),t(i_).to(bA),t(tR).toSelf().inSingletonScope(),t(eR).toSelf().inSingletonScope(),t(Px).toService(tR),t(Px).toService(eR),cp(t,Px),t(TP).toSelf().inSingletonScope(),t(r_).to(TP),t(i_).to(TP),t(D_).toSelf().inSingletonScope(),t(Ox).toService(D_),cp(t,Ox),t(XA).toSelf().inSingletonScope(),t(a_).to(XA),t(i_).to(XA),t(qP).toSelf().inSingletonScope(),t($P).toSelf().inSingletonScope(),t(kx).toService(qP),t(kx).toService($P),cp(t,kx),t(zP).toSelf().inSingletonScope(),t(p_).toService(zP),t(i_).toService(p_),t(ZA).toSelf().inSingletonScope(),t(g_).toService(ZA),t(i_).toService(g_),t(N_).toSelf().inSingletonScope(),t(Mx).toService(N_),cp(t,Mx),t(FP).toSelf().inSingletonScope(),t(d_).toService(FP),t(i_).toService(d_),t(XP).toSelf().inSingletonScope(),t(f_).toService(XP),t(i_).toService(f_),t(B_).toSelf().inSingletonScope(),t(Dx).toService(B_),t(Cx).toService(B_),t(Ex).toService(B_),t(jx).toService(B_),t(Ix).toService(B_),t(Mx).toService(B_),t(Rx).toService(B_),t(Px).toService(B_),t(kx).toService(B_),cp(t,Lx),cp(t,i_),t(gP).toSelf().inSingletonScope(),t(fP).toService(gP),t(yP).toSelf().inSingletonScope(),t(fP).toService(yP),cp(t,fP)}));var iR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},rR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sR=function(t,e){return function(n,i){e(n,i,t)}};let oR=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Eb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=m_(i,s,i.dpr),a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};oR=iR([tp(),sR(0,ip(n_)),rR("design:paramtypes",[Object])],oR);var aR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},lR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hR=function(t,e){return function(n,i){e(n,i,t)}};const cR=new U;let uR=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Fb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,i.setTransformForCurrent()}else o=0,a=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||f(s,!0)&&0!==s||d(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=m_(i,s,i.dpr),h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;cR.setValue(n.x1,n.y1,n.x2,n.y2),cR.expand(-s/2),h=!cR.containsPoint(e)}}return i.highPerformanceRestore(),h}};uR=aR([tp(),hR(0,ip(l_)),lR("design:paramtypes",[Object])],uR);var dR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},fR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pR=function(t,e){return function(n,i){e(n,i,t)}};let gR=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Rb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).arc;i.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=m_(i,s,i.dpr),a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};gR=dR([tp(),pR(0,ip(QA)),fR("design:paramtypes",[Object])],gR);var yR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},vR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mR=function(t,e){return function(n,i){e(n,i,t)}};let bR=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Mb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),i.highPerformanceRestore(),a}};bR=yR([tp(),mR(0,ip(e_)),vR("design:paramtypes",[Object])],bR);var xR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let wR=class{constructor(){this.type="image",this.numberType=jb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};return!!i&&!!t.AABBBounds.containsPoint(e)}};wR=xR([tp()],wR);var SR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let AR=class extends aA{};AR=SR([tp()],AR);var _R=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},BR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},TR=function(t,e){return function(n,i){e(n,i,t)}};let CR=class extends AR{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Db}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;i.highPerformanceSave();const r=Qy(t).line,s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>{if(u)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=m_(i,r,i.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,i.modelMatrix!==h&&VS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};CR=_R([tp(),TR(0,ip(s_)),BR("design:paramtypes",[Object])],CR);var PR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},RR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},OR=function(t,e){return function(n,i){e(n,i,t)}};let MR=class extends AR{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Lb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).path;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>{if(u)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=m_(i,r,i.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,i.modelMatrix!==h&&VS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};MR=PR([tp(),OR(0,ip(o_)),RR("design:paramtypes",[Object])],MR);var ER=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},kR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IR=function(t,e){return function(n,i){e(n,i,t)}};tA({});let jR=class extends AR{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Hb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();const s=Qy(t).symbol,o=this.transform(t,s,i),{x:a,y:l,z:h,lastModelMatrix:c}=o;let u=e;if(i.camera){u=e.clone();const n=t.parent.globalTransMatrix;u.x=n.a*e.x+n.c*e.y+n.e,u.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=h;let d=!1;return this.canvasRenderer.drawShape(t,i,a,l,{},null,((t,e,n)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,n)=>{if(d)return!0;const r=e.lineWidth||n.lineWidth;return i.lineWidth=m_(i,r,i.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,i.modelMatrix!==c&&VS.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),d}};jR=ER([tp(),IR(0,ip(c_)),kR("design:paramtypes",[Object])],jR);var DR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},LR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},NR=function(t,e){return function(n,i){e(n,i,t)}};let WR=class extends AR{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=Vb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();const s=Qy(t).text,{keepDirIn3d:o=s.keepDirIn3d}=t.attribute,a=!o,l=this.transform(t,s,i,a),{x:h,y:c,z:u,lastModelMatrix:d}=l;this.canvasRenderer.z=u;let f=e;if(i.camera){f=e.clone();const n=t.parent.globalTransMatrix;f.x=n.a*e.x+n.c*e.y+n.e,f.y=n.b*e.x+n.d*e.y+n.f}let p=!1;return this.canvasRenderer.drawShape(t,i,h,c,{},null,((e,n,i)=>{if(p)return!0;const{fontSize:r=s.fontSize,textBaseline:o=s.textBaseline,textAlign:a=s.textAlign}=t.attribute,l=t.AABBBounds,d=l.height(),g=l.width(),y=Kx(o,d,r),v=$x(a,g);return e.rect(v+h,y+c,g,d,u),p=e.isPointInPath(f.x,f.y),p}),((t,e,n)=>p)),this.canvasRenderer.z=0,i.modelMatrix!==d&&VS.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}};WR=DR([tp(),NR(0,ip(u_)),LR("design:paramtypes",[Object])],WR);var FR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},UR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zR=function(t,e){return function(n,i){e(n,i,t)}};let HR=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Nb}contains(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};HR=FR([tp(),zR(0,ip(a_)),UR("design:paramtypes",[Object])],HR);var VR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},GR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XR=function(t,e){return function(n,i){e(n,i,t)}};new U;let YR=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=zb}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};YR=VR([tp(),XR(0,ip(d_)),GR("design:paramtypes",[Object])],YR);var qR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$R=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},KR=function(t,e){return function(n,i){e(n,i,t)}};let ZR=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=kb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=null==n?void 0:n.pickerService;if(r){let i=!1;return t.getSubGraphic().forEach((t=>{i||(i=!!r.pickItem(t,e,null,n))})),i}return!1}};ZR=qR([tp(),KR(0,ip(p_)),$R("design:paramtypes",[Object])],ZR);var JR=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},QR=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tO=function(t,e){return function(n,i){e(n,i,t)}};new U;let eO=class extends AR{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Ub}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).rect;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,n,null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,i.modelMatrix!==h&&VS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};eO=JR([tp(),tO(0,ip(h_)),QR("design:paramtypes",[Object])],eO);var nO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},iO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rO=function(t,e){return function(n,i){e(n,i,t)}};new U;let sO=class extends AR{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Wb}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).polygon;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,n)=>!1)),this.canvasRenderer.z=0,i.modelMatrix!==h&&VS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};sO=nO([tp(),rO(0,ip(f_)),iO("design:paramtypes",[Object])],sO);var oO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},aO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lO=function(t,e){return function(n,i){e(n,i,t)}};new U;let hO=class extends AR{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=Ob}contains(t,e,n){const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).arc;i.highPerformanceSave();const s=this.transform(t,r,i),{x:o,y:a,z:l,lastModelMatrix:h}=s;let c=e;if(i.camera){c=e.clone();const n=t.parent.globalTransMatrix;c.x=n.a*e.x+n.c*e.y+n.e,c.y=n.b*e.x+n.d*e.y+n.f}this.canvasRenderer.z=l;let u=!1;return this.canvasRenderer.drawShape(t,i,o,a,n,null,((t,e,n)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,i.modelMatrix!==h&&VS.free(i.modelMatrix),i.modelMatrix=h,i.highPerformanceRestore(),u}};hO=oO([tp(),lO(0,ip(t_)),aO("design:paramtypes",[Object])],hO);var cO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let uO=class{constructor(){this.type="group",this.numberType=Ib}contains(t,e,n){return!1}};uO=cO([tp()],uO);var dO=new $f(((t,e,n,i)=>{t(oR).toSelf().inSingletonScope(),t(EB).toService(oR),t(GB).toService(EB),t(uR).toSelf().inSingletonScope(),t(DB).toService(uR),t(GB).toService(DB),t(eO).toSelf().inSingletonScope(),t(LB).toService(eO),t(GB).toService(LB),t(gR).toSelf().inSingletonScope(),t(RB).toService(gR),t(GB).toService(RB),t(bR).toSelf().inSingletonScope(),t(MB).toService(bR),t(GB).toService(MB),t(wR).toSelf().inSingletonScope(),t(kB).toService(wR),t(GB).toService(kB),t(CR).toSelf().inSingletonScope(),t(IB).toService(CR),t(GB).toService(IB),t(MR).toSelf().inSingletonScope(),t(jB).toService(MR),t(GB).toService(jB),t(jR).toSelf().inSingletonScope(),t(NB).toService(jR),t(GB).toService(NB),t(WR).toSelf().inSingletonScope(),t(WB).toService(WR),t(GB).toService(WB),t(HR).toSelf().inSingletonScope(),t(FB).toService(HR),t(GB).toService(FB),t(sO).toSelf().inSingletonScope(),t(UB).toService(sO),t(GB).toService(UB),t(hO).toSelf().inSingletonScope(),t(OB).toService(hO),t(GB).toService(OB),t(YR).toSelf().inSingletonScope(),t(zB).toService(YR),t(GB).toService(zB),t(ZR).toSelf().inSingletonScope(),t(HB).toService(ZR),t(GB).toService(HB),t(uO).toSelf().inSingletonScope(),t(VB).toService(uO),t(GB).toService(VB),cp(t,GB)})),fO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},pO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gO=function(t,e){return function(n,i){e(n,i,t)}};let yO=class{constructor(t){this.canvasRenderer=t,this.type="path",this.numberType=Lb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).path;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};yO=fO([tp(),gO(0,ip(o_)),pO("design:paramtypes",[Object])],yO);var vO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},mO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bO=function(t,e){return function(n,i){e(n,i,t)}};let xO=class{constructor(t){this.canvasRenderer=t,this.type="circle",this.numberType=Eb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).circle;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};xO=vO([tp(),bO(0,ip(n_)),mO("design:paramtypes",[Object])],xO);var wO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},SO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},AO=function(t,e){return function(n,i){e(n,i,t)}};const _O=new U;let BO=class{constructor(t){this.canvasRenderer=t,this.type="rect",this.numberType=Fb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).rect,{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:o=r.x,y:a=r.y}=t.attribute;i.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);o+=e.x,a+=e.y,i.setTransformForCurrent()}else o=0,a=0,l=!1,i.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!l||f(s,!0)&&0!==s||d(s)&&s.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,i,o,a,{},null,((t,n,i)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,n,r)=>{if(h)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,h=t.isPointInStroke(e.x,e.y),h}));else if(h){const{fill:n=r.fill,stroke:i=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(n)h=!0;else if(i){const n=t.AABBBounds;_O.setValue(n.x1,n.y1,n.x2,n.y2),_O.expand(-s/2),h=!_O.containsPoint(e)}}return i.highPerformanceRestore(),h}};BO=wO([tp(),AO(0,ip(l_)),SO("design:paramtypes",[Object])],BO);var TO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},CO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},PO=function(t,e){return function(n,i){e(n,i,t)}};let RO=class{constructor(t){this.canvasRenderer=t,this.type="arc",this.numberType=Rb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).arc;i.highPerformanceSave();let{x:s=r.x,y:o=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};RO=TO([tp(),PO(0,ip(QA)),CO("design:paramtypes",[Object])],RO);var OO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},MO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},EO=function(t,e){return function(n,i){e(n,i,t)}};let kO=class{constructor(t){this.canvasRenderer=t,this.type="area",this.numberType=Mb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).area;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a))),i.highPerformanceRestore(),a}};kO=OO([tp(),EO(0,ip(e_)),MO("design:paramtypes",[Object])],kO);var IO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},jO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},DO=function(t,e){return function(n,i){e(n,i,t)}};let LO=class{constructor(t){this.canvasRenderer=t,this.type="line",this.numberType=Db}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).line;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,(t=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};LO=IO([tp(),DO(0,ip(s_)),jO("design:paramtypes",[Object])],LO);var NO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},WO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},FO=function(t,e){return function(n,i){e(n,i,t)}};let UO=class{constructor(t){this.canvasRenderer=t,this.type="symbol",this.numberType=Hb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).symbol;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};UO=NO([tp(),FO(0,ip(c_)),WO("design:paramtypes",[Object])],UO);var zO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o};let HO=class{constructor(){this.type="text",this.numberType=Vb}contains(t,e,n){return!!t.AABBBounds.containsPoint(e)}};HO=zO([tp()],HO);var VO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},GO=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XO=function(t,e){return function(n,i){e(n,i,t)}};let YO=class{constructor(t){this.canvasRenderer=t,this.type="polygon",this.numberType=Nb}contains(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=Qy(t).polygon;let{x:s=r.x,y:o=r.y}=t.attribute;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,o+=e.y,i.setTransformForCurrent()}else s=0,o=0,i.transformFromMatrix(t.transMatrix,!0);let a=!1;return this.canvasRenderer.drawShape(t,i,s,o,{},null,((t,n,i)=>!!a||(a=t.isPointInPath(e.x,e.y),a)),((t,n,r)=>{if(a)return!0;const s=n.lineWidth||r.lineWidth;return i.lineWidth=s,a=t.isPointInStroke(e.x,e.y),a})),i.highPerformanceRestore(),a}};YO=VO([tp(),XO(0,ip(a_)),GO("design:paramtypes",[Object])],YO);var qO=function(t,e,n,i){var r,s=arguments.length,o=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(s<3?r(o):s>3?r(e,n,o):r(e,n))||o);return s>3&&o&&Object.defineProperty(e,n,o),o},$O=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},KO=function(t,e){return function(n,i){e(n,i,t)}};let ZO=class{constructor(t){this.canvasRenderer=t,this.type="glyph",this.numberType=kb}contains(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:i}=null!=n?n:{};if(!i)return!1;const r=null==n?void 0:n.pickerService;if(r){let i=!1;return t.getSubGraphic().forEach((t=>{i||(i=!!r.pickItem(t,e,null,n))})),i}return!1}};ZO=qO([tp(),KO(0,ip(p_)),$O("design:paramtypes",[Object])],ZO);var JO=new $f((t=>{t(xO).toSelf().inSingletonScope(),t(qB).toService(xO),t(nT).toService(qB),t(BO).toSelf().inSingletonScope(),t(ZB).toService(BO),t(nT).toService(ZB),t(RO).toSelf().inSingletonScope(),t(XB).toService(RO),t(nT).toService(XB),t(kO).toSelf().inSingletonScope(),t(YB).toService(kO),t(nT).toService(YB),t(LO).toSelf().inSingletonScope(),t($B).toService(LO),t(nT).toService($B),t(yO).toSelf().inSingletonScope(),t(KB).toService(yO),t(nT).toService(KB),t(UO).toSelf().inSingletonScope(),t(JB).toService(UO),t(nT).toService(JB),t(HO).toSelf().inSingletonScope(),t(QB).toService(HO),t(nT).toService(QB),t(YO).toSelf().inSingletonScope(),t(tT).toService(YO),t(nT).toService(tT),t(ZO).toSelf().inSingletonScope(),t(eT).toService(ZO),t(ZO).toService(eT),cp(t,nT)}));var QO=new $f((t=>{t(ay).toDynamicValue((()=>t=>new PB(t))).whenTargetNamed(PB.env),t(ly).toDynamicValue((()=>(t,e)=>new _B(t,e))).whenTargetNamed(_B.env)})),tM=new $f((t=>{t(ay).toDynamicValue((()=>t=>new mC(t))).whenTargetNamed(mC.env),t(ly).toDynamicValue((()=>(t,e)=>new pC(t,e))).whenTargetNamed(pC.env)})),eM=new $f((t=>{t(ay).toDynamicValue((()=>t=>new lC(t))).whenTargetNamed(lC.env),t(ly).toDynamicValue((()=>(t,e)=>new rC(t,e))).whenTargetNamed(rC.env)})),nM=new $f((t=>{t(ay).toDynamicValue((()=>t=>new PC(t))).whenTargetNamed(PC.env),t(ly).toDynamicValue((()=>(t,e)=>new _C(t,e))).whenTargetNamed(_C.env)})),iM=new $f((t=>{t(ay).toDynamicValue((()=>t=>new $C(t))).whenTargetNamed($C.env),t(ly).toDynamicValue((()=>(t,e)=>new GC(t,e))).whenTargetNamed(GC.env)})),rM=new $f((t=>{t(ay).toDynamicValue((()=>t=>new WC(t))).whenTargetNamed(WC.env),t(ly).toDynamicValue((()=>(t,e)=>new jC(t,e))).whenTargetNamed(jC.env)}));oy.load(dx),oy.load(vT),oy.load(tB),oy.load(yT),oy.load(_T),function(t){t.load($T),t.load(eP),t.load(nP),t.load(uP)}(oy),function(t){t.load(nR)}(oy),function(t){t.load(dO),t.load(JO)}(oy),function(t){t.load(QO),t.load(eM),t.load(tM),t.load(nM),t.load(iM),t.load(rM)}(oy);const sM=oy.get(pp);Gg.global=sM;const oM=oy.get(cx);Gg.graphicUtil=oM;const aM=oy.get(hx);Gg.transformUtil=aM;const lM=oy.get(Gb);Gg.graphicService=lM,oy.get(vB);const hM=oy.get(ux);Gg.layerService=hM,new U;const cM=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.handleTick=(t,e)=>{const{once:n=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),n||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let n=0;this.lastFrameTime>=0&&(n=e-this.lastFrameTime),this.lastFrameTime=e,this.status===uv.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(n)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=uv.INITIAL,Gg.global.hooks.onSetEnv.tap("window",(()=>{this.initHandler()})),Gg.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:cv},{mode:"timeout",cons:hv},{mode:"manual",cons:lv}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new cv;break;case"timeout":t=new hv;break;case"manual":t=new lv;break;default:console.warn("非法的计时器模式"),t=new cv}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==uv.INITIAL&&(this.status=uv.PAUSE,!0)}resume(){return this.status!==uv.INITIAL&&(this.status=uv.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===uv.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===uv.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=uv.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=uv.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};var uM;cM.addTimeline(fv),cM.setFPS(60),function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(uM||(uM={}));const dM=(t,e,n,i)=>new it(Object.assign({defaultFontParams:Object.assign({fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14},i),getTextBounds:n?void 0:sA,specialCharSet:"-/: .,@%'\"~"+it.ALPHABET_CHAR_SET+it.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function fM(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function pM(t){let e="center",n="middle";return e=(t=fM(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",n=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:n}}const gM=t=>t.map(((t,e)=>({index:e,value:t}))),yM=(t,e,n=0)=>{const i=new U(t).expand(n/2),r=new U(e).expand(n/2);return i.intersects(r)},vM=(t,e)=>{let n=0;t.x2<e.x1?n=e.x1-t.x2:e.x2<t.x1&&(n=t.x1-e.x2);let i=0;return t.y2<e.y1?i=e.y1-t.y2:e.y2<t.y1&&(i=t.y1-e.y2),[n,i]};function mM(t,e,n){return n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function bM(t,e){for(let n,i=1,r=t.length,s=t[0];i<r;s=n,++i)if(n=t[i],mM(s.AABBBounds,n.AABBBounds,e))return!0;return!1}const xM=(t,e,n)=>{var i;const{labelStyle:r,axisOrientType:s,labelFlush:o,labelFormatter:a,startAngle:l=0}=n,h=null!==(i=r.angle)&&void 0!==i?i:0,c=["bottom","top"].includes(s),u=["left","right"].includes(s);let d=l;c?d=0:u&&(d=z(-90));const f=dM(r),p=e.map(((n,i)=>{var s,l;const p=a?a(n):`${n}`,{width:g,height:y}=f.quickMeasure(p),v=Math.max(g,12),m=Math.max(y,12),b=t.scale(n);let x,w,S=Math.cos(d)*b,A=-Math.sin(d)*b;x=o&&c&&0===i?"left":o&&c&&i===e.length-1?"right":null!==(s=r.textAlign)&&void 0!==s?s:"center","right"===x?S-=v:"center"===x&&(S-=v/2),w=o&&u&&0===i?"top":o&&u&&i===e.length-1?"bottom":null!==(l=r.textBaseline)&&void 0!==l?l:"middle","bottom"===w?A-=m:"middle"===w&&(A-=m/2);return(new U).set(S,A,S+v,A+m).rotate(h,S+v/2,A+m/2)}));return p},wM=(t,e,n)=>{var i;const{labelStyle:r,getRadius:s,labelOffset:o,labelFormatter:a}=n,l=null==s?void 0:s(),h=null!==(i=r.angle)&&void 0!==i?i:0,c=dM(r),u=e.map((e=>{const n=a?a(e):`${e}`,{width:i,height:r}=c.quickMeasure(n),s=Math.max(i,12),u=Math.max(r,12),d=t.scale(e);let f=0,p=0;const g=pM(d),{x:y,y:v}=function(t,e,n){return{x:t.x+e*Math.cos(n),y:t.y+e*Math.sin(n)}}({x:0,y:0},l+o,d);f=y+("right"===g.align?-s:"center"===g.align?-s/2:0),p=v+("bottom"===g.baseline?-u:"middle"===g.baseline?-u/2:0);return(new U).set(f,p,f+s,p+u).rotate(h,f+s/2,p+u/2)}));return u},SM={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let n;return t.filter(((t,i)=>(!i||!mM(n.AABBBounds,t.AABBBounds,e))&&(n=t,!0)))}},AM=(t,e,n,i,r,s)=>{let o=s,a=0,l=0,h=0,c=-1,u=Number.MAX_VALUE;do{let s=!0;o++;let d=0;do{d+o<t.length&&yM(e[d],e[d+o],n)&&(s=!1),d+=o}while(s&&d<t.length);if(s){if(!i){h=o;break}{const i=t.length-1;a=0;do{if(d-=o,d!==i&&!yM(e[d],e[i],n))break;a++}while(d>0);if(d===i){h=o,l=a;break}{const n=Math.floor(t.length/o)-a+1;if(n<c)break;{c=n;const t=r?0:1,s=vM(e[d],e[i])[t],f=d-o>=0?vM(e[d-o],e[d])[t]:s,p=Math.abs(s-f);p<u&&(u=p,h=o,l=a)}}}}}while(o<=t.length);return{step:h,delCount:l}},_M=(t,e,n,i)=>{let r=i;do{let i=!0;r++;let s=0;do{s+r<t.length&&yM(e[s],e[s+r],n)&&(i=!1),s+=r}while(i&&s<t.length);if(i)break}while(r<=t.length);let s=0;if(t.length>2){let n=t.length-t.length%r;for(n>=t.length&&(n-=r);n>0&&yM(e[0],e[n]);)s++,n-=r}return{step:r,delCount:s}};t.angleLabelOrientAttribute=pM,t.convertDomainToTickData=gM,t.initTextMeasure=dM,t.normalizeAngle=fM,t.ticks=(t,e)=>{if(ot(t.type))return((t,e)=>{if(!ot(t.type))return gM(t.domain());const n=t.range();if(Math.abs(n[n.length-1]-n[0])<2)return gM([t.domain()[0]]);const{tickCount:i,forceTickCount:r,tickStep:s,noDecimals:o=!1}=e;let a;if(a=h(s)?t.stepTicks(s):h(r)?t.forceTicks(r):"d3"===e.tickMode?t.d3Ticks(null!=i?i:5,{noDecimals:o}):t.ticks(null!=i?i:5,{noDecimals:o}),e.sampling&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:n=4,labelFlush:i}=e;let r=xM(t,a,e).map(((t,e)=>({AABBBounds:t,value:a[e]})));for(;r.length>=3&&bM(r,n);)r=SM.parity(r);const s=r.map((t=>t.value));s.length<3&&i&&(s.length>1&&s.pop(),m(s)!==m(a)&&s.push(m(a))),a=s}return gM(a)})(t,e);if(function(t){switch(t){case st.Ordinal:case st.Point:case st.Band:return!0;default:return!1}}(t.type)){if("cartesian"===e.coordinateType)return((t,e)=>{var n;const i=t.domain();if(!i.length)return[];const{tickCount:r,forceTickCount:s,tickStep:o,labelGap:a=4,axisOrientType:l}=e,c=["bottom","top"].includes(l),u=t.range(),d=Math.abs(u[u.length-1]-u[0]);if(d<2)return e.labelLastVisible?gM([i[i.length-1]]):gM([i[0]]);let f;if(h(o))f=t.stepTicks(o);else if(h(s))f=t.forceTicks(s);else if(h(r))f=t.ticks(r);else if(e.sampling){let r;const s=(null!==(n=e.labelStyle.fontSize)&&void 0!==n?n:12)+2;if(i.length<=d/s)r=xM(t,i,e);else{const n=[i[0],i[Math.floor(i.length/2)],i[i.length-1]],s=xM(t,n,e);let o=null,a=0;s.forEach(((t,e)=>{if(!o)return o=t,void(a=e);c?o.width()<t.width()&&(o=t,a=e):o.height()<t.height()&&(o=t,a=e)}));const l=0===a?0:2===a?i.length-1:Math.floor(i.length/2),h=t.scale(i[l]);r=new Array(i.length);for(let e=0;e<r.length;e++){r[e]=o.clone();const n=t.scale(i[e]);c?r[e].translate(n-h,0):r[e].translate(0,n-h)}}const o=r.map((t=>c?t.width():t.height())),l=Math.min(...u),h=(Math.max(...u)-l)/i.length,p=AM(i,r,a,e.labelLastVisible,c,Math.floor(Math.min(...o)/h));f=t.stepTicks(p.step),e.labelLastVisible&&(f=f.slice(0,f.length-p.delCount),f.push(i[i.length-1]))}else f=t.domain();return gM(f)})(t,e);if("polar"===e.coordinateType&&"angle"===e.axisOrientType)return((t,e)=>{const{tickCount:n,forceTickCount:i,tickStep:r,getRadius:s,labelOffset:o,labelGap:a=0}=e,l=null==s?void 0:s();if(!l)return gM(t.domain());let c;if(h(r))c=t.stepTicks(r);else if(h(i))c=t.forceTicks(i);else if(h(n))c=t.ticks(n);else if(e.sampling){const n=t.domain(),i=t.range(),r=wM(t,n,e),s=Math.min(...i),h=Math.max(...i),u=Math.abs(h-s)*(l+o)/n.length,{step:d,delCount:f}=_M(n,r,a,Math.floor(r.reduce(((t,e)=>Math.min(t,e.width(),e.height())),Number.MAX_VALUE)/u));c=t.stepTicks(d),c=c.slice(0,c.length-f)}else c=t.domain();return gM(c)})(t,e)}return gM(t.domain())}}));