@visactor/vrender-components 0.17.0 → 0.17.1-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.
- package/cjs/axis/base.js +12 -14
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/circle.js +1 -1
- package/cjs/axis/circle.js.map +1 -1
- package/cjs/axis/grid/base.js +4 -6
- package/cjs/axis/grid/base.js.map +1 -1
- package/cjs/axis/line.d.ts +1 -2
- package/cjs/axis/line.js +2 -3
- package/cjs/axis/line.js.map +1 -1
- package/cjs/brush/brush.js +1 -2
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.d.ts +1 -2
- package/cjs/label/arc.js +1 -2
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/base.js +3 -3
- package/cjs/label/base.js.map +1 -1
- package/cjs/legend/base.js +1 -1
- package/cjs/legend/base.js.map +1 -1
- package/cjs/legend/discrete/discrete.js +9 -11
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/legend/size/size.js +2 -3
- package/cjs/legend/size/size.js.map +1 -1
- package/cjs/marker/area.js +1 -2
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/base.js +3 -3
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/point.js +2 -4
- package/cjs/marker/point.js.map +1 -1
- package/cjs/pager/pager.js +4 -5
- package/cjs/pager/pager.js.map +1 -1
- package/cjs/segment/segment.js +3 -3
- package/cjs/segment/segment.js.map +1 -1
- package/cjs/slider/slider.js +10 -11
- package/cjs/slider/slider.js.map +1 -1
- package/cjs/util/text.d.ts +2 -2
- package/dist/index.js +3681 -9155
- package/dist/index.min.js +1 -1
- package/es/axis/base.js +11 -11
- package/es/axis/base.js.map +1 -1
- package/es/axis/circle.js +2 -2
- package/es/axis/circle.js.map +1 -1
- package/es/axis/grid/base.js +5 -5
- package/es/axis/grid/base.js.map +1 -1
- package/es/axis/line.d.ts +1 -2
- package/es/axis/line.js +3 -3
- package/es/axis/line.js.map +1 -1
- package/es/brush/brush.js +2 -2
- package/es/brush/brush.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/label/arc.d.ts +1 -2
- package/es/label/arc.js +2 -2
- package/es/label/arc.js.map +1 -1
- package/es/label/base.js +4 -4
- package/es/label/base.js.map +1 -1
- package/es/legend/base.js +2 -2
- package/es/legend/base.js.map +1 -1
- package/es/legend/discrete/discrete.js +10 -10
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/legend/size/size.js +3 -3
- package/es/legend/size/size.js.map +1 -1
- package/es/marker/area.js +2 -2
- package/es/marker/area.js.map +1 -1
- package/es/marker/base.js +4 -4
- package/es/marker/base.js.map +1 -1
- package/es/marker/point.js +3 -3
- package/es/marker/point.js.map +1 -1
- package/es/pager/pager.js +5 -5
- package/es/pager/pager.js.map +1 -1
- package/es/segment/segment.js +4 -4
- package/es/segment/segment.js.map +1 -1
- package/es/slider/slider.js +11 -11
- package/es/slider/slider.js.map +1 -1
- package/es/util/text.d.ts +2 -2
- package/package.json +5 -5
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vutils"),require("@visactor/vscale")):"function"==typeof define&&define.amd?define(["exports","@visactor/vutils","@visactor/vscale"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VRender=t.VRender||{},t.VRender.Components={}),t.VUtils,t.VScale)}(this,(function(t,e,i){"use strict";function n(){n=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,a=Object.defineProperty||function(t,e,i){t[e]=i.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var r=e&&e.prototype instanceof b?e:b,s=Object.create(r.prototype),o=new E(n||[]);return a(s,"_invoke",{value:T(t,i,o)}),s}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",v="suspendedYield",p="executing",g="completed",y={};function b(){}function m(){}function x(){}var _={};h(_,o,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(O([])));k&&k!==i&&r.call(k,o)&&(_=k);var B=x.prototype=b.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function i(n,a,s,o){var l=c(t[n],t,a);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,o)}),(function(t){i("throw",t,s,o)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return i("throw",t,s,o)}))}o(l.arg)}var n;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,n){i(t,r,e,n)}))}return n=n?n.then(a,a):a()}})}function T(e,i,n){var r=f;return function(a,s){if(r===p)throw new Error("Generator is already running");if(r===g){if("throw"===a)throw s;return{value:t,done:!0}}for(n.method=a,n.arg=s;;){var o=n.delegate;if(o){var l=C(o,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,i,n);if("normal"===u.type){if(r=n.done?g:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=g,n.method="throw",n.arg=u.arg)}}}function C(e,i){var n=i.method,r=e.iterator[n];if(r===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=c(r,e.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,y;var s=a.arg;return s?s.done?(i[e.resultName]=s.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function O(e){if(e||""===e){var i=e[o];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=x,a(B,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:m,configurable:!0}),m.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(B),t},e.awrap=function(t){return{__await:t}},S(w.prototype),h(w.prototype,l,(function(){return this})),e.AsyncIterator=w,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var s=new w(d(t,i,n,r),a);return e.isGeneratorFunction(i)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},S(B),h(B,u,"Generator"),h(B,o,(function(){return this})),h(B,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(n,r){return o.type="throw",o.arg=e,i.next=n,r&&(i.method="next",i.arg=t),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(l&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),M(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;M(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:O(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,A(n.key),n)}}function o(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,i){return(e=A(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function f(t,e,i){return f=c()?Reflect.construct.bind():function(t,e,i){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(t,n));return i&&d(r,i.prototype),r},f.apply(null,arguments)}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}function g(t){var e=c();return function(){var i,n=h(t);if(e){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return p(this,i)}}function y(){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},y.apply(this,arguments)}function b(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,s,o=[],l=!0,u=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(u)throw r}}return o}}(t,e)||x(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t){return function(t){if(Array.isArray(t))return _(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||x(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t,e){if(t){if("string"==typeof t)return _(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function A(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var k=function(){function t(){a(this,t)}return o(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}]),t}();k.auto_increment_id=0;var B=o((function t(e){a(this,t),this.id=k.GenAutoIncrementId(),this.registry=e})),S="named",w="inject",T="multi_inject",C="inversify:tagged",P="inversify:paramtypes",M=function(){function t(e,i){a(this,t),this.key=e,this.value=i}return o(t,[{key:"toString",value:function(){return this.key===S?"named: ".concat(String(this.value).toString()," "):"tagged: { key:".concat(this.key.toString(),", value: ").concat(String(this.value)," }")}}]),t}(),E=function(t){var e;return function(t){var e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,n=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,l=!s&&!o,u={create:s?function(){return S(Object.create(null))}:o?function(){return S({__proto__:null})}:function(){return S({})},has:l?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:l?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),d="object"==("undefined"==typeof process?"undefined":r(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=d||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],i=function(){function t(t,e,i){this._index=0,this._keys=t,this._values=e,this._selector=i}return t.prototype["@@iterator"]=function(){return this},t.prototype[a]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var i=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){var i=this._find(e,!1);if(i>=0){for(var n=this._keys.length,r=i+1;r<n;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new i(this._keys,this._values,n)},e.prototype.values=function(){return new i(this._keys,this._values,r)},e.prototype.entries=function(){return new i(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[a]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function r(t,e){return e}function s(t,e){return[t,e]}}():Map,f=(d||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new c}Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[a]=function(){return this.keys()}}():Set,new(d||"function"!=typeof WeakMap?function(){var t=16,i=u.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=a(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=a(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return a(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=a(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var t;do{t="@@WeakMap@@"+o()}while(u.has(i,t));return i[t]=!0,t}function a(t,i){if(!e.call(t,n)){if(!i)return;Object.defineProperty(t,n,{value:u.create()})}return t[n]}function s(t,e){for(var i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function o(){var e,i=(e=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):s(new Uint8Array(e),e):s(new Array(e),e));i[6]=79&i[6]|64,i[8]=191&i[8]|128;for(var n="",r=0;r<t;++r){var a=i[r];4!==r&&6!==r&&8!==r||(n+="-"),a<16&&(n+="0"),n+=a.toString(16).toLowerCase()}return n}}():WeakMap));function v(t,e,i){var n=f.get(t);if(b(n)){if(!i)return;n=new c,f.set(t,n)}var r=n.get(e);if(b(r)){if(!i)return;r=new c,n.set(e,r)}return r}function p(t,e,i){if(g(t,e,i))return!0;var n=B(e);return!m(n)&&p(t,n,i)}function g(t,e,i){var n=v(e,i,!1);return!b(n)&&!!n.has(t)}function y(t,e,i){if(g(t,e,i))return function(t,e,i){var n=v(e,i,!1);if(!b(n))return n.get(t)}(t,e,i);var n=B(e);return m(n)?void 0:y(t,n,i)}function b(t){return void 0===t}function m(t){return null===t}function x(t){return"object"==r(t)?null!==t:"function"==typeof t}function _(t,e){switch(function(t){if(null===t)return 1;switch(r(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var i=3===e?"string":5===e?"number":"default",a=function(t,e){var i=t[e];if(null!=i){if(!k(i))throw new TypeError;return i}}(t,n);if(void 0!==a){var s=a.call(t,i);if(x(s))throw new TypeError;return s}return function(t,e){if("string"===e){var i=t.toString;if(k(i)){var n=i.call(t);if(!x(n))return n}var r=t.valueOf;if(k(r)){var a=r.call(t);if(!x(a))return a}}else{var s=t.valueOf;if(k(s)){var o=s.call(t);if(!x(o))return o}var l=t.toString;if(k(l)){var u=l.call(t);if(!x(u))return u}}throw new TypeError}(t,"default"===i?"number":i)}function A(t){var e=_(t,3);return"symbol"==r(e)?e:function(t){return""+t}(e)}function k(t){return"function"==typeof t}function B(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;var i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;var r=n.constructor;return"function"!=typeof r||r===t?e:r}function S(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,i,n){if(!x(i))throw new TypeError;return r=t,a=e,void v(i,n,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),p(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),g(t,e,i)})),t("getMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),y(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function O(t,e,i,n){!function(t,e,i,n){var r,a=[n],s={};E.hasOwnMetadata(t,e)&&(s=E.getMetadata(t,e));var o=s[i];void 0===o&&(o=[]),(r=o).push.apply(r,a),s[i]=o,E.defineMetadata(t,s,e)}(C,t,i.toString(),n)}function L(t){return function(e,i,n){O(e,0,n,t)}}function R(t){return function(e){return function(i,n,r){return L(new M(t,e))(i,n,r)}}}var I=R(w),j=R(T);function D(){return function(t){return E.defineMetadata(P,null,t),t}}function N(t){return L(new M(S,t))}var U,z="Singleton",H="Transient",V="ConstantValue",W="DynamicValue",F="Factory",G="Function",Y="Instance",X="Invalid",$=function(){function t(e,i){a(this,t),this.id=k.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=e,this.scope=i,this.type=X,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}return o(t,[{key:"clone",value:function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===z&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.provider=this.provider,e.constraint=this.constraint,e.cache=this.cache,e}}]),t}(),q=function(){function t(){a(this,t)}return o(t,[{key:"getConstructorMetadata",value:function(t){return{compilerGeneratedMetadata:E.getMetadata(P,t),userGeneratedMetadata:E.getMetadata(C,t)||{}}}},{key:"getPropertiesMetadata",value:function(t){throw new Error("暂未实现")}}]),t}(),K=(U=S,function(t){var e=function(e){if(null==e)return!1;if(e.key===U&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;for(var i=e.constructorArgsMetadata,n=0;n<i.length;n++)if(i[n].key===U&&i[n].value===t)return!0;return!1};return e.metaData=new M(U,t),e}),Z=function(){function t(e){a(this,t),this._binding=e}return o(t,[{key:"inRequestScope",value:function(){throw new Error("暂未实现")}},{key:"inSingletonScope",value:function(){return this._binding.scope=z,this}},{key:"inTransientScope",value:function(){return this._binding.scope=H,this}},{key:"whenTargetNamed",value:function(t){return this._binding.constraint=K(t),this}}]),t}(),J=function(){function t(e){a(this,t),this._binding=e}return o(t,[{key:"to",value:function(t){return this._binding.type=Y,this._binding.implementationType=t,new Z(this._binding)}},{key:"toSelf",value:function(){var t=this._binding.serviceIdentifier;return this.to(t)}},{key:"toDynamicValue",value:function(t){return this._binding.type=W,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Z(this._binding)}},{key:"toConstantValue",value:function(t){return this._binding.type=V,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=z,new Z(this._binding)}},{key:"toFactory",value:function(t){return this._binding.type=F,this._binding.factory=t,this._binding.scope=z,new Z(this._binding)}},{key:"toService",value:function(t){this.toDynamicValue((function(e){return e.container.get(t)}))}}]),t}(),Q=function(){function t(e){a(this,t);var i=e||{};i.defaultScope=i.defaultScope||H,this.options=i,this.id=k.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new q}return o(t,[{key:"load",value:function(t){var e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}},{key:"get",value:function(t){var e=this._getNotAllArgs(t,!1);return this._get(e)}},{key:"getAll",value:function(t){var e=this._getAllArgs(t);return this._get(e)}},{key:"getTagged",value:function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}},{key:"getNamed",value:function(t,e){return this.getTagged(t,S,e)}},{key:"isBound",value:function(t){return this._bindingDictionary.has(t)}},{key:"bind",value:function(t){var e=this.options.defaultScope,i=new $(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new J(i)}},{key:"unbind",value:function(t){this._bindingDictionary.delete(t)}},{key:"rebind",value:function(t){return this.unbind(t),this.bind(t)}},{key:"_getContainerModuleHelpersFactory",value:function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}};return function(n){return{bindFunction:(r=n,function(i){var n=t.bind(i);return e(n,r),n}),isboundFunction:function(e){return t.isBound(e)},rebindFunction:i(n),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(t){return null}};var r}}},{key:"_getNotAllArgs",value:function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}},{key:"_getAllArgs",value:function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}},{key:"_get",value:function(t){var e=this,i=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((function(e){return e.constraint(t)})).forEach((function(t){i.push(e._resolveFromBinding(t))})),t.isMultiInject||1!==i.length?i:i[0]}},{key:"_getChildRequest",value:function(t){for(var e=this,i=t.implementationType,n=this._metadataReader.getConstructorMetadata(i).userGeneratedMetadata,r=Object.keys(n),a=[],s=function(){var t=n[o],i={};t.forEach((function(t){i[t.key]=t.value}));var r={inject:i[w],multiInject:i[T]},s=r.inject||r.multiInject,l={serviceIdentifier:s,constructorArgsMetadata:t},u={injectIdentifier:s,metadata:t,bindings:e._bindingDictionary.get(s).filter((function(t){return t.constraint(l)}))};a.push(u)},o=0;o<r.length;o++)s();return a}},{key:"_resolveFromBinding",value:function(t){var e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}},{key:"_getResolvedFromBinding",value:function(t){var e;switch(t.type){case V:case G:e=t.cache;break;case Y:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}},{key:"_resolveInstance",value:function(t,e){if(t.activated)return t.cache;var i=this._getChildRequest(t);return this._createInstance(e,i)}},{key:"_createInstance",value:function(t,e){return e.length?f(t,m(this._resolveRequests(e))):new t}},{key:"_resolveRequests",value:function(t){var e=this;return t.map((function(t){return t.bindings.length>1?t.bindings.map((function(t){return e._resolveFromBinding(t)})):e._resolveFromBinding(t.bindings[0])}))}},{key:"_saveToScope",value:function(t,e){t.scope===z&&(t.cache=e,t.activated=!0)}}]),t}(),tt=Symbol("ContributionProvider"),et=function(){function t(e,i){a(this,t),this.serviceIdentifier=e,this.container=i}return o(t,[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&(t=this.caches).push.apply(t,m(this.container.getAll(this.serviceIdentifier)))),this.caches}}]),t}();function it(t,e){t(tt).toDynamicValue((function(t){var i=t.container;return new et(e,i)})).inSingletonScope().whenTargetNamed(e)}var nt=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}]),i}(function(){function t(e,i){a(this,t),this._args=e,this.name=i,this.taps=[]}return o(t,[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((function(t){return t.name!==i&&(!e||t.fn===e)})))}},{key:"_parseOptions",value:function(t,e,i){var n;if("string"==typeof e)n={name:e.trim()};else if("object"!=r(e)||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n)}},{key:"_tap",value:function(t,e,i){this._insert(this._parseOptions(t,e,i))}},{key:"_insert",value:function(t){var e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var i=0;"number"==typeof t.stage&&(i=t.stage);for(var n=this.taps.length;n>0;){n--;var r=this.taps[n];this.taps[n+1]=r;var a=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(a>i)){n++;break}}this.taps[n]=t}}]),t}()),rt=Symbol.for("EnvContribution"),at=Symbol.for("VGlobal"),st=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ot=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lt=function(t,e){return function(i,n){e(i,n,t)}},ut=function(){function t(e){a(this,t),this.contributions=e,this.id=k.GenAutoIncrementId(),this.hooks={onSetEnv:new nt(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}return o(t,[{key:"env",get:function(){return this._env}},{key:"devicePixelRatio",get:function(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}},{key:"supportEvent",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}},{key:"supportsTouchEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}},{key:"supportsPointerEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}},{key:"supportsMouseEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}},{key:"applyStyles",get:function(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles},set:function(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}},{key:"bindContribution",value:function(t){var e=this,i=[];if(this.contributions.getContributions().forEach((function(n){var r=n.configure(e,t);r&&r.then&&i.push(r)})),i.length)return Promise.all(i)}},{key:"getDynamicCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}},{key:"getStaticCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}},{key:"setEnv",value:function(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}},{key:"deactiveCurrentEnv",value:function(){this.envContribution&&this.envContribution.release()}},{key:"activeEnv",value:function(t,e){var i=this,n=this._env;this._env=t;var r=this.bindContribution(e);if(r&&r.then)return r.then((function(){i.envParams=e,i.hooks.onSetEnv.call(n,t,i)}));this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}},{key:"setActiveEnvContribution",value:function(t){this.envContribution=t}},{key:"createCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}},{key:"createOffscreenCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}},{key:"releaseCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}},{key:"addEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}},{key:"getRequestAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}},{key:"getCancelAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}},{key:"getElementById",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}},{key:"getRootElement",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}},{key:"getDocument",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}},{key:"mapToCanvasPoint",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}},{key:"loadImage",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}},{key:"loadSvg",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}},{key:"loadJson",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}},{key:"loadArrayBuffer",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}},{key:"loadBlob",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}},{key:"isChrome",value:function(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}},{key:"isSafari",value:function(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}},{key:"getNativeAABBBounds",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}},{key:"removeDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}},{key:"createDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}},{key:"getElementTop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}},{key:"getElementLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}},{key:"getElementTopLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}}]),t}();ut=st([D(),lt(0,I(tt)),lt(0,N(rt)),ot("design:paramtypes",[Object])],ut);var ht,dt,ct,ft,vt,pt,gt,yt,bt,mt,xt,_t,At,kt,Bt,St=e.tau-1e-8,wt=function(){function t(e){a(this,t),this.init(e)}return o(t,[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,i,n,r,a,s){if(Math.abs(a-r)>St)return this.bounds.add(t-n,i-n),void this.bounds.add(t+n,i+n);var o,l,u,h,d=1/0,c=-1/0,f=1/0,v=-1/0;function p(t){u=n*Math.cos(t),h=n*Math.sin(t),u<d&&(d=u),u>c&&(c=u),h<f&&(f=h),h>v&&(v=h)}if(p(r),p(a),a!==r)if((r%=e.tau)<0&&(r+=e.tau),(a%=e.tau)<0&&(a+=e.tau),a<r&&(s=!s,o=r,r=a,a=o),s)for(a-=e.tau,o=r-r%e.halfPi,l=0;l<4&&o>a;++l,o-=e.halfPi)p(o);else for(o=r-r%e.halfPi+e.halfPi,l=0;l<4&&o<a;++l,o+=e.halfPi)p(o);this.bounds.add(t+d,i+f),this.bounds.add(t+c,i+v)}},{key:"arcTo",value:function(t,e,i,n,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,a)}},{key:"closePath",value:function(){}},{key:"ellipse",value:function(){throw new Error("不支持ellipse")}},{key:"lineTo",value:function(t,e){this.bounds.add(t,e)}},{key:"moveTo",value:function(t,e){this.bounds.add(t,e)}},{key:"quadraticCurveTo",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}},{key:"rect",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}]),t}(),Tt=function(){function t(){a(this,t),this.curves=[],this.bounds=new e.AABBBounds}return o(t,[{key:"getCurveLengths",value:function(){return this.curves.map((function(t){return t.getLength()}))}},{key:"getPointAt",value:function(t){return{x:0,y:0}}},{key:"getLength",value:function(){return 0}},{key:"getBounds",value:function(){return this.bounds}}]),t}(),Ct=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Pt={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},Mt={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};function Et(t){var e=t[0],i=t[1],n=t[2],r=t[3],a=t[4],s=t[5],o=t[6],l=t[7],u=l*a,h=-o*s,d=o*a,c=l*s,f=Math.cos(n),v=Math.sin(n),p=Math.cos(r),g=Math.sin(r),y=.5*(r-n),b=Math.sin(.5*y),m=8/3*b*b/Math.sin(y),x=e+f-m*v,_=i+v+m*f,A=e+p,k=i+g,B=A+m*g,S=k-m*p;return[u*x+h*_,d*x+c*_,u*B+h*S,d*B+c*S,u*A+h*k,d*A+c*k]}function Ot(t,i,n,r){for(var a=function(t,i,n,r,a,s,o,l,u){var h=e.degreeToRadian(o),d=Math.sin(h),c=Math.cos(h),f=c*(l-t)*.5+d*(u-i)*.5,v=c*(u-i)*.5-d*(l-t)*.5,p=f*f/((n=Math.abs(n))*n)+v*v/((r=Math.abs(r))*r);p>1&&(n*=p=Math.sqrt(p),r*=p);var g=c/n,y=d/n,b=-d/r,m=c/r,x=g*l+y*u,_=b*l+m*u,A=g*t+y*i,k=b*t+m*i,B=1/((A-x)*(A-x)+(k-_)*(k-_))-.25;B<0&&(B=0);var S=Math.sqrt(B);s===a&&(S=-S);var w=.5*(x+A)-S*(k-_),T=.5*(_+k)+S*(A-x),C=Math.atan2(_-T,x-w),P=Math.atan2(k-T,A-w)-C;P<0&&1===s?P+=e.tau:P>0&&0===s&&(P-=e.tau);for(var M=Math.ceil(Math.abs(P/(e.halfPi+.001))),E=[],O=0;O<M;++O){var L=C+O*P/M,R=C+(O+1)*P/M;E[O]=[w,T,L,R,n,r,d,c]}return E}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],i,n),s=0;s<a.length;++s){var o=Et(a[s]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[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"}(gt||(gt={})),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"}(yt||(yt={})),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"}(bt||(bt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(mt||(mt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(xt||(xt={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(_t||(_t={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(At||(At={})),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"}(kt||(kt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Bt||(Bt={}));var Lt=[function(t,e,i,n,r,a,s){return e.arc(t[1]*r+i,t[2]*a+n,t[3]*(r+a)/2,t[4],t[5],t[6],s)},function(t,e,i,n,r,a,s){return e.arcTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*(r+a)/2,s)},function(t,e,i,n,r,a,s){return e.bezierCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*r+i,t[6]*a+n,s)},function(t,e,i,n){return e.closePath()},function(t,e,i,n,r,a){return e.ellipse(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8])},function(t,e,i,n,r,a,s){return e.lineTo(t[1]*r+i,t[2]*a+n,s)},function(t,e,i,n,r,a,s){return e.moveTo(t[1]*r+i,t[2]*a+n,s)},function(t,e,i,n,r,a,s){return e.quadraticCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,s)},function(t,e,i,n,r,a,s){return e.rect(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,s)}];function Rt(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,o=0;o<t.length;o++){var l=t[o];Lt[l[0]](l,e,i,n,r,a,s)}}var It=function(){function t(){a(this,t)}return o(t,[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}]),t}();function jt(t,i,n,r,a){return function(t,i){for(var n=0,r=t.length,a=0;a<r;a++){var s=t[a],o=i[a],l=t[(a+1)%r],u=i[(a+1)%r];n+=e.PointService.distanceNN(s,o,l,u)}return n/2}([t.x,i.x,n.x,r.x],[t.y,i.y,n.y,r.y])}function Dt(t,e,i,n,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*i*r*r*a+n*r*r*r}function Nt(t,i,n,r,a){var s=Dt(t.x,i.x,n.x,r.x,a),o=Dt(t.y,i.y,n.y,r.y,a);return new e.Point(s,o)}function Ut(t,i){var n=t.p0,r=t.p1,a=t.p2,s=t.p3,o=Nt(n,r,a,s,i),l=e.PointService.pointAtPP(n,r,i),u=e.PointService.pointAtPP(r,a,i),h=e.PointService.pointAtPP(a,s,i),d=e.PointService.pointAtPP(l,u,i),c=e.PointService.pointAtPP(u,h,i);return[new zt(n,l,d,o),new zt(o,c,h,s)]}var zt=function(t){u(n,t);var i=g(n);function n(t,e,r,s){var o;return a(this,n),(o=i.call(this)).type=kt.CubicBezierCurve,o.p0=t,o.p1=e,o.p2=r,o.p3=s,o}return o(n,[{key:"_validPoint",value:function(){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)}},{key:"getPointAt",value:function(t){if(!1!==this.defined)return Nt(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?jt(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(t){return t===At.ROW?e.abs(this.p0.x-this.p3.x):t===At.COLUMN?e.abs(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var i=e.max(t-.01,0),n=e.min(t+.01,1),r=this.getPointAt(i),a=this.getPointAt(n);return e.atan2(a.y-r.y,a.x-r.x)}}]),n}(It);function Ht(t,i){var n=t.p0,r=t.p1,a=e.PointService.pointAtPP(n,r,i);return[new Vt(n,a),new Vt(a,r)]}var Vt=function(t){u(n,t);var i=g(n);function n(t,e){var r;return a(this,n),(r=i.call(this)).type=kt.LineCurve,r.p0=t,r.p1=e,r}return o(n,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return e.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=e.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}},{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}},{key:"calcLength",value:function(){return this._validPoint()?e.PointService.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(t){return t===At.ROW?e.abs(this.p0.x-this.p1.x):t===At.COLUMN?e.abs(this.p0.y-this.p1.y):0}}]),n}(It),Wt=function(){function t(e,i){a(this,t),this.init(e,i)}return o(t,[{key:"endX",get:function(){return this._lastX}},{key:"endY",get:function(){return this._lastY}},{key:"init",value:function(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}},{key:"bezierCurveTo",value:function(t,i,n,r,a,s,o,l){var u=new zt(new e.Point(this._lastX,this._lastY),new e.Point(t,i),new e.Point(n,r),new e.Point(a,s));u.originP1=this._lastOriginP,u.originP2=l,u.defined=o,this.curves.push(u),this._lastX=a,this._lastY=s,this._lastOriginP=l}},{key:"closePath",value:function(){if(!(this.curves.length<2)){var t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}}},{key:"ellipse",value:function(){throw new Error("SegContext不支持调用ellipse")}},{key:"lineTo",value:function(t,e,i,n){var r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}},{key:"moveTo",value:function(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}},{key:"quadraticCurveTo",value:function(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}},{key:"clear",value:function(){this.curves=[],this.length=NaN}},{key:"tryUpdateLength",value:function(t){return this.getLength(t)}},{key:"addLinearCurve",value:function(t,i,n,r,a){var s=new Vt(new e.Point(this._lastX,this._lastY),new e.Point(t,i));return s.originP1=r,s.originP2=a,s.defined=n,s}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(t){var i,n;if(t===At.COLUMN){if(!this.curves.length)return 0;var r=this.curves[0],a=this.curves[this.curves.length-1],s=null!==(i=a.p3)&&void 0!==i?i:a.p1;return e.abs(r.p0.y-s.y)}if(t===At.ROW){if(!this.curves.length)return 0;var o=this.curves[0],l=this.curves[this.curves.length-1],u=null!==(n=l.p3)&&void 0!==n?n:l.p1;return e.abs(o.p0.x-u.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}]),t}(),Ft=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"bezierCurveTo",value:function(t,e,n,r,a,s,o,l){return y(h(i.prototype),"bezierCurveTo",this).call(this,e,t,r,n,s,a,o,l)}},{key:"lineTo",value:function(t,e,n,r){return y(h(i.prototype),"lineTo",this).call(this,e,t,n,r)}},{key:"moveTo",value:function(t,e,n){return y(h(i.prototype),"moveTo",this).call(this,e,t,n)}},{key:"clear",value:function(){return y(h(i.prototype),"clear",this).call(this)}}]),i}(Wt);function Gt(t,e){for(var i=!1,n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}var Yt=function(){function t(e,i){a(this,t),this.context=e,i&&(this.startPoint=i)}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function Xt(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;var a=new Wt("linear",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?At.ROW:At.COLUMN);return function(t,e){Gt(t,e)}(new Yt(a,r),t),a}function $t(t,e,i,n,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+i)/6,n,t.lastPoint1)}var qt=function(){function t(e,i){a(this,t),this.context=e,this.startPoint=i}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){2===this._point&&$t(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}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:$t(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function Kt(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return Xt(t,i);var a=new Wt("basis",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?At.ROW:At.COLUMN);return function(t,e){Gt(t,e)}(new qt(a,r),t),a}function Zt(t){return t<0?-1:1}function Jt(t,e,i){var n=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(n||Number(r<0&&-0)),s=(i-t._y1)/(r||Number(n<0&&-0)),o=(a*r+s*n)/(n+r);return(Zt(a)+Zt(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function Qt(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function te(t,e,i,n,r){var a=t._x0,s=t._y0,o=t._x1,l=t._y1,u=(o-a)/3;t.context.bezierCurveTo(a+u,s+u*e,o-u,l-u*i,o,l,n,t.lastPoint1)}var ee=function(){function t(e,i){a(this,t),this.context=e,this.startPoint=i}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:te(this,this._t0,Qt(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=NaN,i=t.x,n=t.y;if(i!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,te(this,Qt(this,e=Jt(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:te(this,this._t0,e=Jt(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}(),ie=function(t){u(i,t);var e=g(i);function i(t,n){return a(this,i),e.call(this,t,n)}return o(i,[{key:"point",value:function(t){return y(h(i.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}]),i}(ee);function ne(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return Xt(t,i);var a=new Wt("monotoneX",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?At.ROW:At.COLUMN);return function(t,e){Gt(t,e)}(new ee(a,r),t),a}function re(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return Xt(t,i);var a=new Ft("monotoneY",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?At.ROW:At.COLUMN);return function(t,e){Gt(t,e)}(new ie(a,r),t),a}var ae=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;a(this,t),this.context=e,this._t=i,this.startPoint=n}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){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)}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{var n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function se(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.direction,a=n.startPoint;if(t.length<2-Number(!!a))return null;var s=new Wt("step",null!=r?r:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?At.ROW:At.COLUMN);return function(t,e){Gt(t,e)}(new ae(s,i,a),t),s}var oe=function(){function t(e,i){a(this,t),this.context=e,i&&(this.startPoint=i)}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){this.context.closePath()}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function le(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;var a=new Wt("linear",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?At.ROW:At.COLUMN);return function(t,e){Gt(t,e)}(new oe(a,r),t),a}function ue(t,e,i){switch(e){case"linear":default:return Xt(t,i);case"basis":return Kt(t,i);case"monotoneX":return ne(t,i);case"monotoneY":return re(t,i);case"step":return se(t,.5,i);case"stepBefore":return se(t,0,i);case"stepAfter":return se(t,1,i);case"linearClosed":return le(t,i)}}var he=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).commandList=[],t&&(e._ctx=t),e._boundsContext=new wt(e.bounds),e}return o(n,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([Mt.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([Mt.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,i,n){return this.commandList.push([Mt.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){return this.commandList.push([Mt.C,t,e,i,n,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,a),this}},{key:"arcTo",value:function(t,e,i,n,r){return this.commandList.push([Mt.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}},{key:"ellipse",value:function(t,e,i,n,r,a,s,o){return this.commandList.push([Mt.E,t,e,i,n,r,a,s,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,a,s,o),this}},{key:"rect",value:function(t,e,i,n){return this.commandList.push([Mt.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}},{key:"arc",value:function(t,e,i,n,r,a){return this.commandList.push([Mt.A,t,e,i,n,r,a]),this._ctx&&this._ctx.arc(t,e,i,n,r,a),this}},{key:"closePath",value:function(){return this.commandList.push([Mt.Z]),this._ctx&&this._ctx.closePath(),this}},{key:"addCurve",value:function(t){this.curves.push(t)}},{key:"clear",value:function(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[Mt.M]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[Mt.L]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[Mt.Q]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[Mt.C]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[Mt.A]=function(t){var e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_=[];e=_,i=t[4],n=t[5],r=t[1],a=t[2],s=t[3],o=t[3],l=Math.abs(n-i),u=4*Math.tan(l/4)/3,h=n<i?-1:1,d=Math.cos(i),c=Math.sin(i),f=Math.cos(n),v=Math.sin(n),p=d*s+r,g=c*o+a,y=f*s+r,b=v*o+a,m=s*u*h,x=o*u*h,e.push(p-m*c,g+x*d,y+m*v,b-x*f,y,b);for(var A="",k=0;k<_.length;k+=6)A+="C".concat(_[k]," ").concat(_[k+1]," ").concat(_[k+2]," ").concat(_[k+3]," ").concat(_[k+4]," ").concat(_[k+5]);return A},t[Mt.Z]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,i="";return this.commandList.forEach((function(t){i+=e[t[0]](t)})),i}},{key:"fromString",value:function(t,e,i,n,r){this.clear();var a=function(t){if(!t)return[];var e,i,n=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===n)return[];for(var r=[],a=0,s=n.length;a<s;a++)if(ht=n[a],dt=ht.slice(1),e=[ct=ht[0]],null!==(i=dt.match(Ct))){for(var o=0,l=i.length;o<l;o++)ft=i[o],vt=parseFloat(ft),Number.isNaN(vt)||e.push(vt);if(pt=Pt[ct],e.length-1>pt)for(var u=void 0,h=1,d=e.length;h<d;h+=pt){u=[ct];for(var c=h,f=h+pt;c<f;c++)u.push(e[c]);r.push(u)}else r.push(e)}else r.push(e);return r}(t);return this._runCommandStrList(a,e,i,n,r),this._updateBounds(),this}},{key:"fromLine",value:function(t){var e=t.attribute,i=e.points,n=e.curveType,r=e.clipRangeByDimension;if(i){var a=ue(i,n);"x"===r?this.direction=At.ROW:"y"===r?this.direction=At.COLUMN:"auto"===r&&(this.direction=a.direction),this.curves=a.curves}}},{key:"fromCustomPath2D",value:function(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,i,n){var r=this,a=this.commandList;if(!this.transformCbList){var s=[];s[Mt.M]=this.moveToTransform,s[Mt.L]=this.lineToTransform,s[Mt.Q]=this.quadraticCurveToTransform,s[Mt.C]=this.bezierCurveToTransform,s[Mt.AT]=this.arcToTransform,s[Mt.E]=this.ellipseTransform,s[Mt.R]=this.rectTransform,s[Mt.A]=this.arcTransform,s[Mt.Z]=this.closePathTransform,this.transformCbList=s}a.forEach((function(a){r.transformCbList[a[0]](a,t,e,i,n)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"lineToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"quadraticCurveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}},{key:"bezierCurveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}},{key:"arcToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}},{key:"ellipseTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}},{key:"rectTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}},{key:"arcTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,i,n,r,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,h=null,d=0,c=0,f=0,v=0,p=0,g=t.length;p<g;++p){switch(e=t[p],1===l&&1===u||(e=ce(e,l,u)),e[0]){case"l":d+=e[1],c+=e[2],this.lineTo(d+s,c+o);break;case"L":d=e[1],c=e[2],this.lineTo(d+s,c+o);break;case"h":d+=e[1],this.lineTo(d+s,c+o);break;case"H":d=e[1],this.lineTo(d+s,c+o);break;case"v":c+=e[1],this.lineTo(d+s,c+o);break;case"V":c=e[1],this.lineTo(d+s,c+o);break;case"m":d+=e[1],c+=e[2],this.moveTo(d+s,c+o);break;case"M":d=e[1],c=e[2],this.moveTo(d+s,c+o);break;case"c":i=d+e[5],n=c+e[6],f=d+e[3],v=c+e[4],this.bezierCurveTo(d+e[1]+s,c+e[2]+o,f+s,v+o,i+s,n+o),d=i,c=n;break;case"C":d=e[5],c=e[6],f=e[3],v=e[4],this.bezierCurveTo(e[1]+s,e[2]+o,f+s,v+o,d+s,c+o);break;case"s":i=d+e[3],n=c+e[4],f=2*d-f,v=2*c-v,this.bezierCurveTo(f+s,v+o,d+e[1]+s,c+e[2]+o,i+s,n+o),f=d+e[1],v=c+e[2],d=i,c=n;break;case"S":i=e[3],n=e[4],f=2*d-f,v=2*c-v,this.bezierCurveTo(f+s,v+o,e[1]+s,e[2]+o,i+s,n+o),d=i,c=n,f=e[1],v=e[2];break;case"q":i=d+e[3],n=c+e[4],f=d+e[1],v=c+e[2],this.quadraticCurveTo(f+s,v+o,i+s,n+o),d=i,c=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+s,e[2]+o,i+s,n+o),d=i,c=n,f=e[1],v=e[2];break;case"t":i=d+e[1],n=c+e[2],null===h[0].match(/[QqTt]/)?(f=d,v=c):"t"===h[0]?(f=2*d-r,v=2*c-a):"q"===h[0]&&(f=2*d-f,v=2*c-v),r=f,a=v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),c=n,f=(d=i)+e[1],v=c+e[2];break;case"T":i=e[1],n=e[2],f=2*d-f,v=2*c-v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),d=i,c=n;break;case"a":Ot(this,d+s,c+o,[e[1],e[2],e[3],e[4],e[5],e[6]+d+s,e[7]+c+o]),d+=e[6],c+=e[7];break;case"A":Ot(this,d+s,c+o,[e[1],e[2],e[3],e[4],e[5],e[6]+s,e[7]+o]),d=e[6],c=e[7];break;case"z":case"Z":this.closePath()}h=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(var a=0,s=t.length;a<s;++a){var o=t[a].slice();switch(o[0]){case Mt.L:this.lineToTransform(o,e,i,n,r);break;case Mt.M:this.moveToTransform(o,e,i,n,r);break;case Mt.C:this.bezierCurveToTransform(o,e,i,n,r);break;case Mt.Q:this.quadraticCurveToTransform(o,e,i,n,r);break;case Mt.A:this.arcToTransform(o,e,i,n,r);break;case Mt.E:this.ellipseTransform(o,e,i,n,r);break;case Mt.R:this.rectTransform(o,e,i,n,r);break;case Mt.AT:this.arcToTransform(o,e,i,n,r);break;case Mt.Z:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),Rt(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===At.COLUMN){if(!this.curves.length)return 0;var t=this.curves[0],i=this.curves[this.curves.length-1];return e.abs(t.p0.y-i.p1.y)}if(this.direction===At.ROW){if(!this.curves.length)return 0;var n=this.curves[0],r=this.curves[this.curves.length-1];return e.abs(n.p0.x-r.p1.x)}return this.curves.reduce((function(t,e){return t+e.getLength()}),0)}},{key:"getAttrAt",value:function(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};for(var e,i=0,n=0;n<this.curves.length;n++){var r=(e=this.curves[n]).getLength(this.direction);if(i+r>=t)break;i+=r}var a=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(a),angle:e.getAngleAt(a)}}}]),n}(Tt),de=["l",0,0,0,0,0,0,0];function ce(t,e,i){var n=de[0]=t[0];if("a"===n||"A"===n)de[1]=e*t[1],de[2]=i*t[2],de[3]=t[3],de[4]=t[4],de[5]=t[5],de[6]=e*t[6],de[7]=i*t[7];else if("h"===n||"H"===n)de[1]=e*t[1];else if("v"===n||"V"===n)de[1]=i*t[1];else for(var r=1,a=t.length;r<a;++r)de[r]=(r%2==1?e:i)*t[r];return de}var fe={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new e.Matrix},ve={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},pe=Object.assign({outerBorder:Object.assign(Object.assign({},ve),{distance:0}),innerBorder:Object.assign(Object.assign({},ve),{distance:0})},ve),ge={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end"},ye=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",blur:0,cursor:null,html:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),pe),{alignSelf:"auto"}),be={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},me=Object.assign(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,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},{_debug_bounds:!1}),ye),fe),xe=Object.assign(Object.assign({},me),{startAngle:0,endAngle:e.pi2,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),_e=Object.assign(Object.assign(Object.assign({},me),be),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),Ae=Object.assign(Object.assign({},me),{radius:1,startAngle:0,endAngle:e.pi2}),ke=Object.assign(Object.assign({},me),{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"}),Be=Object.assign(Object.assign({},me),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Se=Object.assign(Object.assign(Object.assign({},me),be),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),we=Object.assign(Object.assign({},me),{path:new he,customPath:function(){e.Logger.getInstance().warn("空函数")}}),Te=Object.assign(Object.assign({},me),{points:[],cornerRadius:0,closePath:!0}),Ce=Object.assign(Object.assign({},me),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),Pe=Object.assign(Object.assign({},me),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Me=Object.assign(Object.assign({},me),{symbolType:"circle",size:10,keepDirIn3d:!0}),Ee=Object.assign(Object.assign(Object.assign({},me),ge),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Oe=Object.assign(Object.assign({},me),{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}),Le=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},me),{fill:!0,cornerRadius:0}),Re=Object.assign(Object.assign({},Le),{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}),Ie=new(o((function t(){a(this,t)}))),je={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"}},De=!0,Ne=!1,Ue=/\w|\(|\)|-/,ze=/[.?!,;:/,。?!、;:]/,He=/\S/;function Ve(t,e,i,n,r){if(!e||e<=0)return 0;for(var a=Ie.graphicUtil.textMeasure,s=n,o=t.slice(0,s),l=Math.floor(a.measureText(o,i).width),u=t.slice(0,s+1),h=Math.floor(a.measureText(u,i).width);l>e||h<=e;){if(l>e?s--:s++,s>t.length){s=t.length;break}if(s<0){s=0;break}o=t.slice(0,s),l=Math.floor(a.measureText(o,i).width),u=t.slice(0,s+1),h=Math.floor(a.measureText(u,i).width)}return r&&(s=We(t,s)),s}function We(t,e){for(var i=e;Ue.test(t[i-1])&&Ue.test(t[i])||ze.test(t[i]);)if(--i<=0)return e;return i}function Fe(t,e){var i=Ie.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var Ge=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ye=function(){function t(){a(this,t)}return o(t,[{key:"configure",value:function(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}},{key:"measureTextWidth",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}},{key:"estimate",value:function(t,e){for(var i=e.fontSize,n=void 0===i?Ee.fontSize:i,r=0,a=0,s=0;s<t.length;s++)t.charCodeAt(s)<128?r++:a++;return{width:~~(.8*r*n+a*n),height:n}}},{key:"measureTextPixelHeight",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:ge.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:ge.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}},{key:"measureText",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}},{key:"clipTextVertical",value:function(t,e,i,n){var r=this;if(0===t.length)return{verticalList:t,width:0};var a=e.fontSize,s=void 0===a?12:a;t.forEach((function(t){t.width=0===t.direction?s:r.measureTextWidth(t.text,e)}));for(var o=[],l=0,u=0;u<t.length&&l+t[u].width<i;u++)l+=t[u].width,o.push(t[u]);if(t[u]&&t[u].text.length>1){var h=this._clipText(t[u].text,e,i-l,0,t[u].text.length-1,"end",!1);if(n&&h.str!==t[u].text){for(var d="",c=0,f=0;f<u;f++){var v=t[f];d+=v.text,c+=v.text.length}var p=We(d+=t[u].text,c+h.str.length);(p-=c)!==h.str.length-1&&(h.str=h.str.substring(0,p),h.width=this.measureTextWidth(h.str,e))}o.push(Object.assign(Object.assign({},t[u]),{text:h.str,width:h.width})),l+=h.width}return{verticalList:o,width:l}}},{key:"clipText",value:function(t,e,i,n){if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if((r=this.measureTextWidth(t[0],e))>i)return{str:"",width:0};var a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&a.str!==t){var s=We(t,a.str.length);s!==a.str.length&&(a.str=t.substring(0,s),a.width=this.measureTextWidth(a.str,e))}return a}},{key:"_clipText",value:function(t,e,i,n,r,a,s){var o;if("end"===a)o=this._clipTextEnd(t,e,i,n,r),s&&(o.result=o.str+s);else if("start"===a)o=this._clipTextStart(t,e,i,n,r),s&&(o.result=s+o.str);else if("middle"===a){var l=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:l.width,result:l.left+s+l.right}}return o}},{key:"_clipTextEnd",value:function(t,e,i,n,r){var a,s=Math.floor((n+r)/2),o=t.substring(0,s+1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};var u=t.substring(0,s);return(a=this.measureTextWidth(u,e))<=i?{str:u,width:a}:this._clipTextEnd(t,e,i,n,s)}if(l<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(0,s+2);return(a=this.measureTextWidth(h,e))>=i?{str:o,width:l}:this._clipTextEnd(t,e,i,s,r)}return{str:o,width:l}}},{key:"_clipTextStart",value:function(t,e,i,n,r){var a,s=Math.ceil((n+r)/2),o=t.substring(s-1,t.length-1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};var u=t.substring(s,t.length-1);return(a=this.measureTextWidth(u,e))<=i?{str:u,width:a}:this._clipTextStart(t,e,i,s,t.length-1)}if(l<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(s-2,t.length-1);return(a=this.measureTextWidth(h,e))>=i?{str:o,width:l}:this._clipTextStart(t,e,i,n,s)}return{str:o,width:l}}},{key:"_clipTextMiddle",value:function(t,e,i,n,r,a,s,o){var l=t.substring(0,o),u=this.measureTextWidth(l,e);if(u+s>i)return{left:n,right:r,width:a+s};var h=t.substring(t.length-o,t.length),d=this.measureTextWidth(h,e);return u+d>i?{left:l,right:r,width:u+s}:this._clipTextMiddle(t,e,i,l,h,u,d,o+1)}},{key:"clipTextWithSuffixVertical",value:function(t,e,i,n,r,a){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};var s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;var o,l=this.measureTextWidth(n,e);if(l>i)return s;if(i-=l,"start"===a){var u=this.revertVerticalList(t);o=this.clipTextVertical(u,e,i,r);var h=this.revertVerticalList(o.verticalList);h.unshift({text:n,direction:1,width:l}),o.verticalList=h}else if("middle"===a){var d=this.clipTextVertical(t,e,i/2,r),c=this.revertVerticalList(t),f=this.clipTextVertical(c,e,i/2,r);d.verticalList.push({text:n,direction:1,width:l}),this.revertVerticalList(f.verticalList).forEach((function(t){return d.verticalList.push(t)})),o={verticalList:d.verticalList,width:d.width+f.width}}else(o=this.clipTextVertical(t,e,i,r)).verticalList.push({text:n,direction:1,width:l});return o.width+=l,o}},{key:"revertVerticalList",value:function(t){return t.reverse().map((function(t){var e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}},{key:"clipTextWithSuffix",value:function(t,e,i,n,r,a){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};var s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};var o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;var l=this._clipText(t,e,i,0,t.length-1,a,n);if(r&&l.str!==t){var u=We(t,l.str.length);u!==l.str.length&&(l.str=t.substring(0,u),l.width=this.measureTextWidth(l.str,e))}return l.str=l.result,l.width+=o,l}}]),t}();Ye=Ge([D()],Ye);var Xe=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$e=Symbol.for("TextMeasureContribution"),qe=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i)}(Ye);qe=Xe([D()],qe);var Ke=new Q,Ze=Symbol.for("CanvasFactory");function Je(t){return Ke.getNamed(Ze,Ie.global.env)(t)}var Qe=1e-4,ti=Math.sqrt(3),ei=1/3;function ii(t){return t>-gi&&t<gi}function ni(t){return t>gi||t<-gi}var ri=[0,0],ai=[0,0],si=[0,0];function oi(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function li(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}function ui(t,e,i,n,r){var a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*n+3*a*i)}function hi(t){return(t%=e.pi2)<0&&(t+=e.pi2),t}function di(t,e,i,n,r,a){if(a>e&&a>n||a<e&&a<n)return 0;if(n===e)return 0;var s=(a-e)/(n-e),o=n<e?1:-1;1!==s&&0!==s||(o=n<e?.5:-.5);var l=s*(i-t)+t;return l===r?1/0:l>r?o:0}function ci(t,e,i,n,r,a,s,o,l){if(0===s)return!1;var u=s;return!(l>e+u&&l>n+u&&l>a+u||l<e-u&&l<n-u&&l<a-u||o>t+u&&o>i+u&&o>r+u||o<t-u&&o<i-u&&o<r-u)&&function(t,e,i,n,r,a,s,o,l){var u=0,h=.005,d=1/0;ri[0]=s,ri[1]=o;for(var c=0;c<1;c+=.05){ai[0]=li(t,i,r,c),ai[1]=li(e,n,a,c);var f=oi(ri,ai);f<d&&(u=c,d=f)}d=1/0;for(var v=0;v<32&&!(h<Qe);v++){var p=u-h,g=u+h;ai[0]=li(t,i,r,p),ai[1]=li(e,n,a,p);var y=oi(ai,ri);if(p>=0&&y<d)u=p,d=y;else{si[0]=li(t,i,r,g),si[1]=li(e,n,a,g);var b=oi(si,ri);g<=1&&b<d?(u=g,d=b):h*=.5}}return l&&(l[0]=li(t,i,r,u),l[1]=li(e,n,a,u)),Math.sqrt(d)}(t,e,i,n,r,a,o,l,null)<=u/2}function fi(t,e,i,n,r,a,s,o,l,u,h){if(0===l)return!1;var d=l;return!(h>e+d&&h>n+d&&h>a+d&&h>o+d||h<e-d&&h<n-d&&h<a-d&&h<o-d||u>t+d&&u>i+d&&u>r+d&&u>s+d||u<t-d&&u<i-d&&u<r-d&&u<s-d)&&function(t,e,i,n,r,a,s,o,l,u,h){var d,c,f,v,p=0,g=.005,y=1/0;ri[0]=l,ri[1]=u;for(var b=0;b<1;b+=.05)ai[0]=ui(t,i,r,s,b),ai[1]=ui(e,n,a,o,b),(f=oi(ri,ai))<y&&(p=b,y=f);y=1/0;for(var m=0;m<32&&!(g<Qe);m++)d=p-g,c=p+g,ai[0]=ui(t,i,r,s,d),ai[1]=ui(e,n,a,o,d),f=oi(ai,ri),d>=0&&f<y?(p=d,y=f):(si[0]=ui(t,i,r,s,c),si[1]=ui(e,n,a,o,c),v=oi(si,ri),c<=1&&v<y?(p=c,y=v):g*=.5);return h&&(h[0]=ui(t,i,r,s,p),h[1]=ui(e,n,a,o,p)),Math.sqrt(y)}(t,e,i,n,r,a,s,o,u,h,null)<=d/2}function vi(t,i,n,r,a,s,o,l,u){if(0===o)return!1;var h=o;l-=t,u-=i;var d=Math.sqrt(l*l+u*u);if(d-h>n||d+h<n)return!1;if(Math.abs(r-a)%e.pi2<1e-4)return!0;if(s){var c=r;r=hi(a),a=hi(c)}else r=hi(r),a=hi(a);r>a&&(a+=e.pi2);var f=Math.atan2(u,l);return f<0&&(f+=e.pi2),f>=r&&f<=a||f+e.pi2>=r&&f+e.pi2<=a}function pi(t,e,i,n,r,a,s){if(0===r)return!1;var o,l=r,u=r/2;if(s>e+u&&s>n+u||s<e-u&&s<n-u||a>t+u&&a>i+u||a<t-u&&a<i-u)return!1;if(t===i)return Math.abs(a-t)<=l/2;var h=(o=(e-n)/(t-i))*a-s+(t*n-i*e)/(t-i);return h*h/(o*o+1)<=l/2*l/2}var gi=1e-4;function yi(t,e,i,n,r){var a=6*i-12*e+6*t,s=9*e+3*n-3*t-9*i,o=3*e-3*t,l=0;if(ii(s)){if(ni(a)){var u=-o/a;u>=0&&u<=1&&(r[l++]=u)}}else{var h=a*a-4*s*o;if(ii(h))r[0]=-a/(2*s);else if(h>0){var d=Math.sqrt(h),c=(-a+d)/(2*s),f=(-a-d)/(2*s);c>=0&&c<=1&&(r[l++]=c),f>=0&&f<=1&&(r[l++]=f)}}return l}var bi=[-1,-1,-1],mi=[-1,-1];function xi(t,e,i,n,r,a,s,o,l,u){if(u>e&&u>n&&u>a&&u>o||u<e&&u<n&&u<a&&u<o)return 0;var h=function(t,e,i,n,r,a){var s=n+3*(e-i)-t,o=3*(i-2*e+t),l=3*(e-t),u=t-r,h=o*o-3*s*l,d=o*l-9*s*u,c=l*l-3*o*u,f=0;if(ii(h)&&ii(d))if(ii(o))a[0]=0;else{var v=-l/o;v>=0&&v<=1&&(a[f++]=v)}else{var p=d*d-4*h*c;if(ii(p)){var g=d/h,y=-o/s+g,b=-g/2;y>=0&&y<=1&&(a[f++]=y),b>=0&&b<=1&&(a[f++]=b)}else if(p>0){var m=Math.sqrt(p),x=h*o+1.5*s*(-d+m),_=h*o+1.5*s*(-d-m),A=(-o-((x=x<0?-Math.pow(-x,ei):Math.pow(x,ei))+(_=_<0?-Math.pow(-_,ei):Math.pow(_,ei))))/(3*s);A>=0&&A<=1&&(a[f++]=A)}else{var k=(2*h*o-3*s*d)/(2*Math.sqrt(h*h*h)),B=Math.acos(k)/3,S=Math.sqrt(h),w=Math.cos(B),T=(-o-2*S*w)/(3*s),C=(-o+S*(w+ti*Math.sin(B)))/(3*s),P=(-o+S*(w-ti*Math.sin(B)))/(3*s);T>=0&&T<=1&&(a[f++]=T),C>=0&&C<=1&&(a[f++]=C),P>=0&&P<=1&&(a[f++]=P)}}return f}(e,n,a,o,u,bi);if(0===h)return 0;for(var d,c=0,f=-1,v=0,p=0,g=0;g<h;g++){var y=bi[g],b=0===y||1===y?.5:1;ui(t,i,r,s,y)<l||(f<0&&(f=yi(e,n,a,o,mi),mi[1]<mi[0]&&f>1&&(d=void 0,d=mi[0],mi[0]=mi[1],mi[1]=d),v=ui(e,n,a,o,mi[0]),f>1&&(p=ui(e,n,a,o,mi[1]))),2===f?y<mi[0]?c+=v<e?b:-b:y<mi[1]?c+=p<v?b:-b:c+=o<p?b:-b:y<mi[0]?c+=v<e?b:-b:c+=o<v?b:-b)}return c}function _i(t,e,i,n,r,a,s,o){if(o>e&&o>n&&o>a||o<e&&o<n&&o<a)return 0;var l=function(t,e,i,n,r){var a=t-2*e+i,s=2*(e-t),o=t-n,l=0;if(ii(a)){if(ni(s)){var u=-o/s;u>=0&&u<=1&&(r[l++]=u)}}else{var h=s*s-4*a*o;if(ii(h)){var d=-s/(2*a);d>=0&&d<=1&&(r[l++]=d)}else if(h>0){var c=Math.sqrt(h),f=(-s+c)/(2*a),v=(-s-c)/(2*a);f>=0&&f<=1&&(r[l++]=f),v>=0&&v<=1&&(r[l++]=v)}}return l}(e,n,a,o,bi);if(0===l)return 0;var u,h,d,c=0===(d=(u=e)+a-2*(h=n))?.5:(u-h)/d;if(c>=0&&c<=1){for(var f=0,v=li(e,n,a,c),p=0;p<l;p++){var g=0===bi[p]||1===bi[p]?.5:1;li(t,i,r,bi[p])<s||(bi[p]<c?f+=v<e?g:-g:f+=a<v?g:-g)}return f}var y=0===bi[0]||1===bi[0]?.5:1;return li(t,i,r,bi[0])<s?0:a<e?y:-y}function Ai(t,i,n,r,a,s,o,l){if((l-=i)>n||l<-n)return 0;var u=Math.sqrt(n*n-l*l);bi[0]=-u,bi[1]=u;var h=Math.abs(r-a);if(h<1e-4)return 0;if(h>=e.pi2-1e-4){r=0,a=e.pi2;var d=s?1:-1;return o>=bi[0]+t&&o<=bi[1]+t?d:0}if(r>a){var c=r;r=a,a=c}r<0&&(r+=e.pi2,a+=e.pi2);for(var f=0,v=0;v<2;v++){var p=bi[v];if(p+t>o){var g=Math.atan2(l,p),y=s?1:-1;g<0&&(g=e.pi2+g),(g>=r&&g<=a||g+e.pi2>=r&&g+e.pi2<=a)&&(g>e.pi/2&&g<1.5*e.pi&&(y=-y),f+=y)}}return f}function ki(t){return Math.round(t/e.pi*1e8)/1e8%2*e.pi}function Bi(t,i){var n=ki(t[0]);n<0&&(n+=e.pi2);var r=n-t[0],a=t[1];a+=r,!i&&a-n>=e.pi2?a=n+e.pi2:i&&n-a>=e.pi2?a=n-e.pi2:!i&&n>a?a=n+(e.pi2-ki(n-a)):i&&n<a&&(a=n-(e.pi2-ki(a-n))),t[0]=n,t[1]=a}var Si=[0,0];function wi(t,e,i,n,r){for(var a,s,o,l,u=t,h=t.length,d=0,c=0,f=0,v=0,p=0,g=0;g<h;g++){var y=u[g],b=0===g;y[0]===Mt.M&&g>1&&(i||(d+=di(c,f,v,p,n,r))),b&&(v=c=y[1],p=f=y[2]);var m=y[0],x=y[1],_=y[2],A=y[3],k=y[4],B=y[5],S=y[6],w=k,T=B;Si[0]=w,Si[1]=T,Bi(Si,Boolean(y[6]));var C=w=Si[0],P=(T=Si[1])-w,M=!!(1-(y[6]?0:1)),E=(n-x)*A/A+x;switch(m){case Mt.M:c=v=x,f=p=_;break;case Mt.L:if(i){if(pi(c,f,x,_,e,n,r))return!0}else d+=di(c,f,x,_,n,r)||0;c=x,f=_;break;case Mt.C:if(i){if(fi(c,f,x,_,A,k,B,S,e,n,r))return!0}else d+=xi(c,f,x,_,A,k,B,S,n,r)||0;c=B,f=S;break;case Mt.Q:if(i){if(ci(c,f,x,_,A,k,e,n,r))return!0}else d+=_i(c,f,x,_,A,k,n,r)||0;c=A,f=k;break;case Mt.A:if(a=Math.cos(C)*A+x,s=Math.sin(C)*A+_,b?(v=a,p=s):d+=di(c,f,a,s,n,r),i){if(vi(x,_,A,C,C+P,M,e,E,r))return!0}else d+=Ai(x,_,A,C,C+P,M,E,r);c=Math.cos(C+P)*A+x,f=Math.sin(C+P)*A+_;break;case Mt.R:if(a=(v=c=x)+A,s=(p=f=_)+k,i){if(pi(v,p,a,p,e,n,r)||pi(a,p,a,s,e,n,r)||pi(a,s,v,s,e,n,r)||pi(v,s,v,p,e,n,r))return!0}else d+=di(a,p,a,s,n,r),d+=di(v,s,v,p,n,r);break;case Mt.Z:if(i){if(pi(c,f,v,p,e,n,r))return!0}else d+=di(c,f,v,p,n,r);c=v,f=p}}return i||(o=f,l=p,Math.abs(o-l)<gi)||(d+=di(c,f,v,p,n,r)||0),0!==d}var Ti,Ci=function(){function t(){a(this,t),this.pools=[],this.allocatedCanvas=[]}return o(t,[{key:"shareCanvas",value:function(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}},{key:"getCommonCanvas",value:function(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}},{key:"allocate",value:function(t){if(!this.pools.length){var e=Je(Object.assign({nativeCanvas:Ie.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}var i=this.pools.pop();return i.resize(t.width,t.height),i.dpr=t.dpr,i}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Je(Object.assign({nativeCanvas:Ie.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}var n=this.pools.pop();return n.width=t.width,n.height=t.height,n}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),Pi=new Ci,Mi=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ei=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Oi=function(t,e){return function(i,n){e(i,n,t)}},Li=function(){function t(e){var i=this;a(this,t),this.contributions=e,this.configured=!1,this.global=Ie.global,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,n){i.configured=!1,i.configure(n,e)}))}return o(t,[{key:"canvas",get:function(){return this.tryInitCanvas(),this._canvas}},{key:"context",get:function(){return this.tryInitCanvas(),this._context}},{key:"textMeasure",get:function(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}},{key:"configure",value:function(t,e){var i=this;this.configured||(this.contributions.getContributions().forEach((function(t){t.configure(i,e)})),this.configured=!0)}},{key:"tryInitCanvas",value:function(){if(!this._canvas){var t=Pi.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";this.configure(this.global,this.global.env);var r=this.global.measureTextMethod;this.global.measureTextMethod=n;var a={width:this._textMeasure.measureTextWidth(t,e),height:null!==(i=e.fontSize)&&void 0!==i?i:ge.fontSize};return this.global.measureTextMethod=r,a}},{key:"createTextMeasureInstance",value:function(t,i,n){var r=this;return this.configure(this.global,this.global.env),new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:ge.fontFamily,fontSize:ge.fontSize},getCanvasForMeasure:n||function(){return r.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t)}}]),t}();Li=Mi([D(),Oi(0,I(tt)),Oi(0,N($e)),Ei("design:paramtypes",[Object])],Li),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Ti||(Ti={}));var Ri=new e.Matrix,Ii=function(){function t(){a(this,t),this.matrix=new e.Matrix}return o(t,[{key:"init",value:function(t){return this.mode=Ti.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=Ti.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,i){var n=this.outSourceMatrix;if(Ri.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){var r=i.x,a=i.y;this.outTargetMatrix.translate(r,a),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-r,-a)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Ri.a,Ri.b,Ri.c,Ri.d,Ri.e,Ri.f),this}},{key:"rotateMatrix",value:function(t,e){var i=this.outSourceMatrix;if(Ri.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){var n=e.x,r=e.y;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Ri.a,Ri.b,Ri.c,Ri.d,Ri.e,Ri.f),this}},{key:"scale",value:function(t,e,i){return this.mode===Ti.matrix?this.scaleMatrix(t,e,i):this}},{key:"rotate",value:function(t,e){return this.mode===Ti.matrix?this.rotateMatrix(t,e):this}},{key:"translateMatrix",value:function(t,e){var i=this.outSourceMatrix;return Ri.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Ri.a,Ri.b,Ri.c,Ri.d,Ri.e,Ri.f),this}},{key:"translate",value:function(t,e){return this.mode===Ti.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===Ti.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}]),t}();Ii=Mi([D(),Ei("design:paramtypes",[])],Ii);var ji={arc:xe,area:_e,circle:Ae,line:Se,path:we,symbol:Me,text:Ee,rect:Ce,rect3d:Pe,polygon:Te,richtext:Oe,richtextIcon:Re,image:Le,group:ke,glyph:Be},Di=Object.keys(ji);function Ni(t,e){Object.keys(e).forEach((function(i){t[i]=e[i]}))}var Ui={arc:Object.assign({},ji.arc),area:Object.assign({},ji.area),circle:Object.assign({},ji.circle),line:Object.assign({},ji.line),path:Object.assign({},ji.path),symbol:Object.assign({},ji.symbol),text:Object.assign({},ji.text),rect:Object.assign({},ji.rect),rect3d:Object.assign({},ji.rect3d),polygon:Object.assign({},ji.polygon),richtext:Object.assign({},ji.richtext),richtextIcon:Object.assign({},ji.richtextIcon),image:Object.assign({},ji.image),group:Object.assign({},ji.group),glyph:Object.assign({},ji.glyph)},zi=function(){function t(){a(this,t),this.initTheme(),this.dirty=!1}return o(t,[{key:"initTheme",value:function(){var t=this;this._defaultTheme={},Di.forEach((function(e){t._defaultTheme[e]=Object.create(Ui[e])})),this.combinedTheme=this._defaultTheme}},{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}},{key:"getParentWithTheme",value:function(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}},{key:"applyTheme",value:function(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){var r=this.getParentWithTheme(t);if(r){var a=r.theme;(a.dirty||n)&&a.applyTheme(r,i,!0)}this.userTheme?this.doCombine(r&&r.theme.combinedTheme):(r?this.combinedTheme=r.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,e.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this,i=this.userTheme,n=this.combinedTheme;Di.forEach((function(r){var a=Object.create(Ui[r]);t&&t[r]&&Ni(a,t[r]),n[r]&&Ni(a,n[r]),i[r]&&Ni(a,i[r]),e.combinedTheme[r]=a})),i.common&&Di.forEach((function(t){Ni(e.combinedTheme[t],i.common)})),this.dirty=!1}},{key:"setTheme",value:function(t,e){var i=this.userTheme;i?Object.keys(t).forEach((function(e){i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}},{key:"resetTheme",value:function(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}},{key:"dirtyChildren",value:function(t){var e=this;t.forEachChildren((function(t){t.isContainer&&(t.theme&&(t.theme.dirty=!0),e.dirtyChildren(t))}))}}]),t}(),Hi=new zi;function Vi(t,e){return t.glyphHost?Vi(t.glyphHost):e?(t.isContainer,e):function(t){var 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)):Hi.getTheme()}return null}(t)||Hi.getTheme()}var Wi=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))},Fi=function(t){u(r,t);var i=g(r);function r(){var t;return a(this,r),(t=i.call(this))._uid=k.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return o(r,[{key:"previousSibling",get:function(){return this._prev}},{key:"nextSibling",get:function(){return this._next}},{key:"children",get:function(){return this.getChildren()}},{key:"firstChild",get:function(){return this._firstChild}},{key:"lastChild",get:function(){return this._lastChild}},{key:"count",get:function(){return this._count}},{key:"childrenCount",get:function(){return this._idMap?this._idMap.size:0}},{key:"forEachChildren",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])for(var e=this._lastChild,i=0;e;){if(t(e,i++))return;e=e._prev}else for(var n=this._firstChild,r=0;n;){if(t(n,r++))return;n=n._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Wi(this,void 0,void 0,n().mark((function i(){var r,a,s,o,l,u;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!e){i.next=16;break}r=this._lastChild,a=0;case 2:if(!r){i.next=14;break}if(s=t(r,a++),i.t0=s.then,!i.t0){i.next=9;break}return i.next=8,s;case 8:s=i.sent;case 9:if(!s){i.next=11;break}return i.abrupt("return");case 11:r=r._prev;case 12:i.next=2;break;case 14:i.next=29;break;case 16:o=this._firstChild,l=0;case 17:if(!o){i.next=29;break}if(u=t(o,l++),i.t1=u.then,!i.t1){i.next=24;break}return i.next=23,u;case 23:u=i.sent;case 24:if(!u){i.next=26;break}return i.abrupt("return");case 26:o=o._next;case 27:i.next=17;break;case 29:case"end":return i.stop()}}),i,this)})))}},{key:"forEach",value:function(t){return this.forEachChildren(t)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}},{key:"appendChildArrHighPerformance",value:function(t){return console.error("暂不支持该函数"),t}},{key:"insertBefore",value:function(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)}},{key:"insertAfter",value:function(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)}},{key:"insertInto",value:function(t,i){if(!this._ignoreWarn&&this._nodeList&&e.Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),i>=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===i)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var n=this._firstChild,r=0;r<i;r++){if(!n)return null;r>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}},{key:"insertIntoKeepIdx",value:function(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){var i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}var n;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(n=this._nodeList[r]);r--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;var a=this.insertInto(t,0);return this._ignoreWarn=!1,a}},{key:"removeChild",value:function(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){var e=this._nodeList.findIndex((function(e){return 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}},{key:"delete",value:function(){this.parent&&this.parent.removeChild(this)}},{key:"removeAllChild",value:function(){if(this._idMap){for(var t=this._firstChild;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)}}},{key:"replaceChild",value:function(t,e){throw new Error("暂不支持")}},{key:"find",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.forEachChildren((function(i,r){return!(i===e||!t(i,r)||(n=i,0))})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}},{key:"findAll",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren((function(i,r){i!==e&&t(i,r)&&n.push(i)})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}},{key:"getElementById",value:function(t){return this.find((function(e){return e.id===t}),!0)}},{key:"findChildById",value:function(t){return this.getElementById(t)}},{key:"findChildByUid",value:function(t){return this._idMap&&this._idMap.get(t)||null}},{key:"getElementsByName",value:function(t){return this.findAll((function(e){return e.name===t}),!0)}},{key:"findChildrenByName",value:function(t){return this.getElementsByName(t)}},{key:"getElementsByType",value:function(t){return this.findAll((function(e){return e.type===t}),!0)}},{key:"getChildByName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((function(e){return e.name===t}),e)}},{key:"getChildAt",value:function(t){var e=this._firstChild;if(!e)return null;for(var i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}},{key:"at",value:function(t){return this.getChildAt(t)}},{key:"containNode",value:function(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;for(var e=this._firstChild;e;){if(e.containNode(t))return!0;e=e._next}return!1}},{key:"getRootNode",value:function(){for(var t=this.parent;null==t?void 0:t.parent;)t=t.parent;return t||this}},{key:"hasChildNodes",value:function(){return null!==this._firstChild}},{key:"addChild",value:function(t){return this.appendChild(t)}},{key:"add",value:function(t){return this.appendChild(t)}},{key:"getChildren",value:function(){for(var t=[],e=this._firstChild;e;)t.push(e),e=e._next;return t}},{key:"isChildOf",value:function(t){return!!this.parent&&this.parent._uid===t._uid}},{key:"isParentOf",value:function(t){return t.isChildOf(this)}},{key:"isDescendantsOf",value:function(t){var e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}},{key:"isAncestorsOf",value:function(t){return t.isDescendantsOf(this)}},{key:"getAncestor",value:function(t){throw new Error("暂不支持")}},{key:"setAllDescendantsProps",value:function(t,e){for(var i=this._firstChild;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}},{key:"setCount",value:function(t){this._count+=t;var e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}},{key:"clone",value:function(){throw new Error("暂不支持")}},{key:"cloneTo",value:function(t){throw new Error("暂不支持")}},{key:"getParent",value:function(){return this.parent}},{key:"del",value:function(t){return this.removeChild(t)}},{key:"addEventListener",value:function(t,i,n){var a=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isObject(n)&&n.once,o=e.isFunction(i)?void 0:i;return t=a?"".concat(t,"capture"):t,i=e.isFunction(i)?i:i.handleEvent,s?y(h(r.prototype),"once",this).call(this,t,i,o):y(h(r.prototype),"on",this).call(this,t,i,o),this}},{key:"on",value:function(t,e,i){return this.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,i,n){var a=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isFunction(i)?void 0:i;t=a?"".concat(t,"capture"):t,i=e.isFunction(i)?i:i.handleEvent;var o=e.isObject(n)&&n.once;return y(h(r.prototype),"off",this).call(this,t,i,s,o),this}},{key:"off",value:function(t,e,i){return this.removeEventListener(t,e,i)}},{key:"once",value:function(t,i,n){return e.isObject(n)?(n.once=!0,this.addEventListener(t,i,n)):this.addEventListener(t,i,{once:!0})}},{key:"removeAllEventListeners",value:function(){return y(h(r.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];return(e=y(h(r.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(n)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}]),r}(e.EventEmitter),Gi=function(){function t(e){a(this,t),this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=t.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return o(t,[{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewX",get:function(){return this.viewport.x}},{key:"viewY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error("Method not implemented.")}}]),t}(),Yi=function(t){u(i,t);var e=g(i);function i(t,n){var r;return a(this,i),(r=e.call(this)).type=t,r.detail=n,r}return o(i)}(Gi);"object"==("undefined"==typeof performance?"undefined":r(performance))&&performance.now?performance:Date;var Xi,$i={pickable:!0,visible:!0,dispatchEvent:function(t){var e;if(!(t instanceof Gi))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:function(t,e){return this.dispatchEvent(new Yi(t,e))}},qi=function(){function t(){a(this,t),this.time=0}return o(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}},{key:"tickTo",value:function(t,e){this.time=Math.max(0,t),e(this,{once:!0})}},{key:"release",value:function(){this.timerId>0&&(this.timerId=-1)}},{key:"getTime",value:function(){return this.time}}],[{key:"Avaliable",value:function(){return!0}}]),t}(),Ki=function(){function t(){a(this,t)}return o(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var i=this;this.timerId=setTimeout((function(){e(i)}),t)}},{key:"release",value:function(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!0}}]),t}(),Zi=function(){function t(){a(this,t)}return o(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var i=this;Ie.global.getRequestAnimationFrame()((function(){i.released||e(i)}))}},{key:"release",value:function(){this.released=!0}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!!Ie.global.getRequestAnimationFrame()}}]),t}();!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Xi||(Xi={}));var Ji=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];a(this,t),this.handleTick=function(t,i){var n=(null!=i?i:{}).once,r=void 0!==n&&n;e.ifCanStop()?e.stop():(e._handlerTick(t),r||t.tick(e.interval,e.handleTick))},this._handlerTick=function(t){var i=e.tickerHandler.getTime(),n=0;e.lastFrameTime>=0&&(n=i-e.lastFrameTime),e.lastFrameTime=i,e.status===Xi.RUNNING&&(e.tickCounts++,e.timelines.forEach((function(t){t.tick(n)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=i,this.autoStop=!0}return o(t,[{key:"mode",get:function(){return this._mode},set:function(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}},{key:"init",value:function(){var t=this;this.interval=NaN,this.status=Xi.INITIAL,Ie.global.hooks.onSetEnv.tap("default-ticker",(function(){t.initHandler()})),Ie.global.env&&this.initHandler()}},{key:"addTimeline",value:function(t){this.timelines.push(t)}},{key:"remTimeline",value:function(t){this.timelines=this.timelines.filter((function(e){return e!==t}))}},{key:"initHandler",value:function(){if(this._mode)return null;for(var t=[{mode:"raf",cons:Zi},{mode:"timeout",cons:Ki},{mode:"manual",cons:qi}],e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}},{key:"setupTickHandler",value:function(){var t;switch(this._mode){case"raf":t=new Zi;break;case"timeout":t=new Ki;break;case"manual":t=new qi;break;default:e.Logger.getInstance().warn("非法的计时器模式"),t=new Zi}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}},{key:"setInterval",value:function(t){this.interval=t}},{key:"getInterval",value:function(){return this.interval}},{key:"setFPS",value:function(t){this.setInterval(1e3/t)}},{key:"getFPS",value:function(){return 1e3/this.interval}},{key:"tick",value:function(t){var e=this;this.tickerHandler.tick(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"tickTo",value:function(t){var e=this;this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"pause",value:function(){return this.status!==Xi.INITIAL&&(this.status=Xi.PAUSE,!0)}},{key:"resume",value:function(){return this.status!==Xi.INITIAL&&(this.status=Xi.RUNNING,!0)}},{key:"ifCanStop",value:function(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!0}return!1}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===Xi.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Xi.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!1}return this.status=Xi.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}},{key:"stop",value:function(){this.status=Xi.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}]),t}(),Qi=function(){function t(){a(this,t)}return o(t,null,[{key:"linear",value:function(t){return t}},{key:"none",value:function(){return this.linear}},{key:"get",value:function(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))}}},{key:"getPowIn",value:function(t){return function(e){return Math.pow(e,t)}}},{key:"getPowOut",value:function(t){return function(e){return 1-Math.pow(1-e,t)}}},{key:"getPowInOut",value:function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}},{key:"getBackIn",value:function(t){return function(e){return e*e*((t+1)*e-t)}}},{key:"getBackOut",value:function(t){return function(e){return--e*e*((t+1)*e+t)+1}}},{key:"getBackInOut",value:function(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)}}},{key:"sineIn",value:function(t){return 1-Math.cos(t*Math.PI/2)}},{key:"sineOut",value:function(t){return Math.sin(t*Math.PI/2)}},{key:"sineInOut",value:function(t){return-(Math.cos(Math.PI*t)-1)/2}},{key:"expoIn",value:function(t){return 0===t?0:Math.pow(2,10*t-10)}},{key:"expoOut",value:function(t){return 1===t?1:1-Math.pow(2,-10*t)}},{key:"expoInOut",value:function(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}},{key:"circIn",value:function(t){return-(Math.sqrt(1-t*t)-1)}},{key:"circOut",value:function(t){return Math.sqrt(1- --t*t)}},{key:"circInOut",value:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{key:"bounceOut",value:function(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}},{key:"bounceIn",value:function(e){return 1-t.bounceOut(1-e)}},{key:"bounceInOut",value:function(e){return e<.5?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5}},{key:"getElasticIn",value:function(t,i){return function(n){if(0===n||1===n)return n;var r=i/e.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)}}},{key:"getElasticOut",value:function(t,i){return function(n){if(0===n||1===n)return n;var r=i/e.pi2*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-r)*e.pi2/i)+1}}},{key:"getElasticInOut",value:function(t,i){return function(n){var r=i/e.pi2*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-r)*e.pi2/i)*.5+1}}}]),t}();Qi.quadIn=Qi.getPowIn(2),Qi.quadOut=Qi.getPowOut(2),Qi.quadInOut=Qi.getPowInOut(2),Qi.cubicIn=Qi.getPowIn(3),Qi.cubicOut=Qi.getPowOut(3),Qi.cubicInOut=Qi.getPowInOut(3),Qi.quartIn=Qi.getPowIn(4),Qi.quartOut=Qi.getPowOut(4),Qi.quartInOut=Qi.getPowInOut(4),Qi.quintIn=Qi.getPowIn(5),Qi.quintOut=Qi.getPowOut(5),Qi.quintInOut=Qi.getPowInOut(5),Qi.backIn=Qi.getBackIn(1.7),Qi.backOut=Qi.getBackOut(1.7),Qi.backInOut=Qi.getBackInOut(1.7),Qi.elasticIn=Qi.getElasticIn(1,.3),Qi.elasticOut=Qi.getElasticOut(1,.3),Qi.elasticInOut=Qi.getElasticInOut(1,.3*1.5);var tn=function(){function t(){a(this,t),this.id=k.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}return o(t,[{key:"addAnimate",value:function(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++}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}},{key:"tick",value:function(t){if(!this.paused){var e=this.animateHead;for(this.animateCount=0;e;)e.status===mt.END?this.removeAnimate(e):e.status===mt.RUNNING||e.status===mt.INITIAL?(this.animateCount++,e.advance(t)):e.status===mt.PAUSED&&this.animateCount++,e=e.nextAnimate}}},{key:"clear",value:function(){for(var t=this.animateHead;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}},{key:"removeAnimate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((function(t){return 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()}}]),t}(),en=new tn,nn=function(){function t(e,i,n,r,s){a(this,t),this.from=e,this.to=i,this.duration=n,this.easing=r,this.params=s,this.updateCount=0}return o(t,[{key:"bind",value:function(t,e){this.target=t,this.subAnimate=e,this.onBind()}},{key:"onBind",value:function(){}},{key:"onFirstRun",value:function(){}},{key:"onStart",value:function(){}},{key:"onEnd",value:function(){}},{key:"getEndProps",value:function(){}},{key:"getFromProps",value:function(){return this.from}},{key:"getMergedEndProps",value:function(){var t,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}},{key:"update",value:function(t,e,i){var n=this;if(0===this.updateCount){this.onFirstRun();var r=this.step.getLastProps();Object.keys(r).forEach((function(t){n.subAnimate.animate.validAttr(t)&&(i[t]=r[t])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}]),t}(),rn=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,null,null,0,"linear")).cb=t,n}return o(i,[{key:"onUpdate",value:function(t,e,i){}},{key:"onStart",value:function(){this.cb()}}]),i}(nn),an=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:en;a(this,t),this.id=e,this.timeline=i,this.status=mt.INITIAL,this.tailAnimate=new on(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return o(t,[{key:"setTimeline",value:function(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}},{key:"getStartTime",value:function(){return this._startTime}},{key:"getDuration",value:function(){return this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0)}},{key:"after",value:function(t){var e=t.getDuration();return this._startTime=e,this}},{key:"afterAll",value:function(t){var i=-1/0;return t.forEach((function(t){i=e.max(t.getDuration(),i)})),this._startTime=i,this}},{key:"parallel",value:function(t){return this._startTime=t.getStartTime(),this}},{key:"play",value:function(t){if(this.tailAnimate.play(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}},{key:"trySetAttribute",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.mode;e&&i&xt.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:bt.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,i=new rn((function(){t(e,i.step.prev)}));return this.tailAnimate.play(i),this}},{key:"customInterpolate",value:function(e,i,n,r,a,s){var o=t.interpolateMap.get(e)||t.interpolateMap.get("");return!!o&&o(e,i,n,r,a,s)}},{key:"pause",value:function(){this.status===mt.RUNNING&&(this.status=mt.PAUSED)}},{key:"resume",value:function(){this.status===mt.PAUSED&&(this.status=mt.RUNNING)}},{key:"to",value:function(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"wait",value:function(t){if(this.tailAnimate.wait(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"startAt",value:function(t){if(this.tailAnimate.startAt(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"loop",value:function(t){if(this.tailAnimate.loop=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"reversed",value:function(t){if(this.tailAnimate.reversed=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"bounce",value:function(t){if(this.tailAnimate.bounce=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"subAnimate",value:function(){var t=new on(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}},{key:"getStartProps",value:function(){return this.subAnimates[0].getStartProps()}},{key:"getEndProps",value:function(){return this.tailAnimate.getEndProps()}},{key:"depreventAttr",value:function(t){this._preventAttrs&&this._preventAttrs.delete(t)}},{key:"preventAttr",value:function(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}},{key:"preventAttrs",value:function(t){var e=this;t.forEach((function(t){return e.preventAttr(t)}))}},{key:"validAttr",value:function(t){return!this._preventAttrs||!this._preventAttrs.has(t)}},{key:"bind",value:function(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((function(e){e.bind(t)})),this}},{key:"advance",value:function(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===mt.INITIAL&&(this.status=mt.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===mt.RUNNING&&(this.status=mt.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,i=0,n=this.rawPosition,r=this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0);t<0&&(t=0);var a=t>=r;if(a&&(t=r),t===n)return a;for(var s=0;s<this.subAnimates.length&&!(i+(e=this.subAnimates[s]).totalDuration>=t);s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),a}},{key:"onStart",value:function(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}},{key:"onEnd",value:function(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}},{key:"onRemove",value:function(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}},{key:"onFrame",value:function(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}},{key:"release",value:function(){this.status=mt.END}},{key:"stop",value:function(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()}}],[{key:"AddInterpolate",value:function(e,i){t.interpolateMap.set(e,i)}}]),t}();an.mode=xt.NORMAL,an.interpolateMap=new Map;var sn,on=function(){function t(e,i){a(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new ln(0,0,i?Object.assign({},i.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}return o(t,[{key:"totalDuration",get:function(){return this.calcAttr(),this._totalDuration+this._startAt}},{key:"calcAttr",value:function(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}},{key:"bind",value:function(t){return this.target=t,this}},{key:"play",value:function(t){var e=t.duration;(null==e||e<0)&&(e=0);var i=t.easing,n="string"==typeof i?Qi[i]:i,r=this._addStep(e,null,n);return r.type=_t.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}},{key:"to",value:function(t,e,i,n){var r=this;(null==e||e<0)&&(e=0);var a="string"==typeof i?Qi[i]:i,s=this._addStep(e,null,a);return s.type=_t.to,this._appendProps(t,s,!!n&&n.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),n&&n.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==r.animate.id&&t.preventAttrs(s.propKeys)})),this}},{key:"from",value:function(t,e,i,n){var r=this;this.to(t,0,i,n);var a={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){a[t]=r.getLastPropByName(t,r.stepTail)})),this.to(a,e,i,n),this.stepTail.type=_t.from}},{key:"startAt",value:function(t){return t<0&&(t=0),this._startAt=t,this}},{key:"getStartProps",value:function(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}},{key:"getEndProps",value:function(){return this.stepTail.props}},{key:"getLastStep",value:function(){return this._lastStep}},{key:"wait",value:function(t){if(t>0){var e=this._addStep(+t,null);e.type=_t.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}},{key:"_addStep",value:function(t,e,i){var n=new ln(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}},{key:"_appendProps",value:function(t,e,i){var n=this;e.props=i?t:Object.assign({},t);var r=e.prev,a=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((function(t){void 0===e.props[t]&&(e.props[t]=n.target.getDefaultAttribute(t))}));r.prev;)r.props&&(r.propKeys||(r.propKeys=Object.keys(r.props)),r.propKeys.forEach((function(t){void 0===a[t]&&(a[t]=r.props[t])}))),e.propKeys=Object.keys(e.props),r=r.prev;var s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(a)),e.propKeys.forEach((function(t){if(void 0===s[t]){var e=n.animate.getStartProps();s[t]=e[t]=n.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}},{key:"_appendCustomAnimate",value:function(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}},{key:"setPosition",value:function(t){var e,i,n,r=this.duration,a=this.loop,s=this.rawPosition,o=!1,l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(r<=0)return o=!0;if(n=(t-=l)-(i=Math.floor(t/r))*r,(o=t>=a*r+r)&&(t=(n=r)*(i=a)+r),t===s)return o;var u=!this.reversed!=!(this.bounce&&i%2);return u&&(n=r-n),this._deltaPosition=n-this.position,this.position=n,this.rawPosition=t+l,this.updatePosition(o,u),o}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var i=this.stepHead.next,n=this.position,r=this.duration;if(this.target&&i){for(var a=i.next;a&&a.position<=n;)a=(i=a).next;var s=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(s=i.easing(s)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,s,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(i,s)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,i){if(t!==e)if(i){for(var n=e.prev;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{for(var r=e.next;r&&r!==t;)r.customAnimate&&(r.customAnimate.onStart&&r.customAnimate.onStart(),r.customAnimate.onEnd&&r.customAnimate.onEnd()),r=r.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}},{key:"getLastPropByName",value:function(t,i){for(var n=i.prev;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){var r=n.customAnimate.getEndProps()[t];if(void 0!==r)return r}n=n.prev}return e.Logger.getInstance().warn("未知错误,step中找不到属性"),i.props[t]}},{key:"updateTarget",value:function(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}]),t}(),ln=function(){function t(e,i,n,r){a(this,t),this.duration=i,this.position=e,this.props=n,this.easing=r}return o(t,[{key:"append",value:function(t){t.prev=this,t.next=this.next,this.next=t}},{key:"getLastProps",value:function(){for(var t=this.prev;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}]),t}(),un=200,hn="cubicOut";!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"}(sn||(sn={}));var dn=[!1,!1,!1,!1],cn=[0,0,0,0],fn=function(t){return t?e.isArray(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(cn[0]=t[0],cn[2]=t[0],cn[1]=t[1],cn[3]=t[1],cn):t:t:0},vn=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],pn=[1,2,3,0,1,2,3,0];function gn(t,i,n,r){for(;t>=e.pi2;)t-=e.pi2;for(;t<0;)t+=e.pi2;for(;t>i;)i+=e.pi2;vn[0].x=n,vn[1].y=n,vn[2].x=-n,vn[3].y=-n;var a=Math.ceil(t/e.halfPi)%4,s=Math.ceil(i/e.halfPi)%4;if(r.add(e.cos(t)*n,e.sin(t)*n),r.add(e.cos(i)*n,e.sin(i)*n),a!==s||i-t>e.pi)for(var o=!1,l=0;l<pn.length;l++)if(o||a!==pn[l]){if(o&&s===pn[l])break;if(o){var u=vn[pn[l]];r.add(u.x,u.y)}}else{o=!0;var h=vn[a];r.add(h.x,h.y)}}function yn(t,i,n){var r=e.pointAt(t.x,t.y,i.x,i.y,n),a=r.x,s=r.y,o=e.pointAt(t.x1,t.y1,i.x1,i.y1,n),l=o.x,u=o.y,h=new e.Point(a,s,l,u);return h.defined=i.defined,h}function bn(t,i,n){if(!t||!i)return[];Array.isArray(t)||(t=[t]),Array.isArray(i)||(i=[i]);var r=[];if(t.length>i.length){r=i.map((function(t){var i=new e.Point(t.x,t.y,t.x1,t.y1);return i.defined=t.defined,i}));for(var a=0;a<i.length;a++)r[a]=yn(t[a],i[a],n)}else{r=i.map((function(t){var i=new e.Point(t.x,t.y,t.x1,t.y1);return i.defined=t.defined,i}));for(var s=0;s<t.length;s++)r[s]=yn(t[s],i[s],n)}return r}function mn(t,i){if(e.isArray(t)){for(var n,r=0;r<t.length&&void 0===n;r++)n=t[r][i];return n}return t[i]}var xn=function(){function t(){a(this,t),this.durations=[],this.timeout=t.TimeOut,this.lastDate=0,this.durationsListThreshold=30}return o(t,[{key:"call",value:function(t){var e=this;return this.lastDate=Date.now(),setTimeout((function(){e.appendDuration(Date.now()-e.lastDate),t(0)}),this.timeout,!0)}},{key:"clear",value:function(t){clearTimeout(t)}},{key:"appendDuration",value:function(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((function(t,e){return t+e}),0)/this.durations.length,1e3/60),1e3/30)}}]),t}();xn.TimeOut=1e3/60,new xn;var _n,An=function(t,i){return e.isString(t)&&"%"===t[t.length-1]?i*(Number.parseFloat(t.substring(0,t.length-1))/100):t},kn=function(t){u(n,t);var i=g(n);function n(t,e,r,s,o){return a(this,n),i.call(this,t,e,r,s,o)}return o(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,i,n,r,a,s,o,l;this.fromNumber=e.isNumber(null===(t=this.from)||void 0===t?void 0:t.text)?null===(i=this.from)||void 0===i?void 0:i.text:Number.parseFloat(null===(n=this.from)||void 0===n?void 0:n.text),this.toNumber=e.isNumber(null===(r=this.to)||void 0===r?void 0:r.text)?null===(a=this.to)||void 0===a?void 0:a.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(l=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==l?l:Math.max(e.getDecimalPlaces(this.fromNumber),e.getDecimalPlaces(this.toNumber)))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}]),n}(nn);!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"}(_n||(_n={}));var Bn,Sn=e.ColorUtil.Color;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Bn||(Bn={}));var wn=function(){function t(){a(this,t)}return o(t,null,[{key:"Get",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bn.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===Bn.Color1){var r=t.store1[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;var a=Sn.parseColorString(e);if(a){var s=[a.r/255,a.g/255,a.b/255,a.opacity];t.store1[e]=s,t.store255[e]=[a.r,a.g,a.b,a.opacity],n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3]}return n}var o=t.store255[e];if(o)return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n;var l=Sn.parseColorString(e);return l&&(t.store1[e]=[l.r/255,l.g/255,l.b/255,l.opacity],t.store255[e]=[l.r,l.g,l.b,l.opacity],n[0]=l.r,n[1]=l.g,n[2]=l.b,n[3]=l.opacity),n}},{key:"Set",value:function(e,i,n){if(i===Bn.Color1){if(t.store1[e])return;t.store1[e]=n,t.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(t.store255[e])return;t.store255[e]=n,t.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}]),t}();function Tn(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?e?"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),",").concat(t[3].toFixed(2),")"):"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),")"):t}function Cn(t,e,i,n,r){if(!t||!e)return t&&Tn(t)||e&&Tn(e)||!1;var a,s,o=!1,l=!1;if(Array.isArray(t)?a=t:"string"==typeof t?a=wn.Get(t,Bn.Color255):o=!0,Array.isArray(e)?s=e:"string"==typeof e?s=wn.Get(e,Bn.Color255):l=!0,o!==l){var u=o?t:e,h=o?e:t,d=Object.assign(Object.assign({},u),{stops:u.stops.map((function(t){return Object.assign(Object.assign({},t),{color:Tn(h)})}))});return o?Cn(u,d,i,n,r):Cn(d,u,i,n,r)}if(o){if(t.gradient===e.gradient){var c=t,f=e,v=c.stops,p=f.stops;if(v.length!==p.length)return!1;if("linear"===c.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:En(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i);if("radial"===c.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:En(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i);if("conical"===c.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:En(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i)}return!1}return r&&r(a,s),Tn(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(a,s,i),n)}wn.store255={},wn.store1={};var Pn=[0,0,0,0],Mn=[0,0,0,0];function En(t,e,i){return wn.Get(t,Bn.Color255,Pn),wn.Get(e,Bn.Color255,Mn),"rgba(".concat(Math.round(Pn[0]+(Mn[0]-Pn[0])*i),",").concat(Math.round(Pn[1]+(Mn[1]-Pn[1])*i),",").concat(Math.round(Pn[2]+(Mn[2]-Pn[2])*i),",").concat(Pn[3]+(Mn[3]-Pn[3])*i,")")}Object.keys(e.DEFAULT_COLORS).forEach((function(t){e.DEFAULT_COLORS[t]}));var On=function(){function t(){a(this,t)}return o(t,null,[{key:"GetImage",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?Ie.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&i.imageLoadSuccess(e,r.data):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Ie.global.loadImage(e),r.dataPromise?(r.waitingMark=[i],r.dataPromise.then((function(t){var i;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(i=r.waitingMark)||void 0===i||i.map((function(i,n){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,i.imageLoadSuccess(e,t.data)):(r.loadState="fail",i.imageLoadFail(e))}))}))):(r.loadState="fail",i.imageLoadFail(e)))}},{key:"GetSvg",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?Ie.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&Ie.global.getRequestAnimationFrame()((function(){i.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Ie.global.loadSvg(e),r.dataPromise?(r.waitingMark=[i],r.dataPromise.then((function(t){var i;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(i=r.waitingMark)||void 0===i||i.map((function(i,n){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,i.imageLoadSuccess(e,t.data)):(r.loadState="fail",i.imageLoadFail(e))}))}))):(r.loadState="fail",i.imageLoadFail(e)))}},{key:"GetFile",value:function(e,i){var n=t.cache.get(e);return n?"init"===n.loadState||"fail"===n.loadState?Promise.reject():"loading"===n.loadState?n.dataPromise.then((function(t){return t.data})):Promise.resolve(n.data):(n={type:i,loadState:"init"},t.cache.set(e,n),"arrayBuffer"===i?n.dataPromise=Ie.global.loadArrayBuffer(e):"blob"===i?n.dataPromise=Ie.global.loadBlob(e):"json"===i&&(n.dataPromise=Ie.global.loadJson(e)),n.dataPromise.then((function(t){return t.data})))}}]),t}();On.cache=new Map;var Ln=new e.Matrix,Rn=new e.AABBBounds,In=["lineWidth","scaleX","scaleY","angle","anchor","visible"],jn=["x","y"],Dn=["scaleX","scaleY"],Nn=["angle"],Un=new e.Point,zn={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1},Hn=function(t){u(n,t);var i=g(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,n),(t=i.call(this))._AABBBounds=new e.AABBBounds,t._updateTag=gt.INIT,t.attribute=r,t.valid=t.isValid(),r.background&&t.loadImage(r.background,!0),t}return o(n,[{key:"AABBBounds",get:function(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}},{key:"OBBBounds",get:function(){return this.tryUpdateOBBBounds()}},{key:"globalAABBBounds",get:function(){return this.tryUpdateGlobalAABBBounds()}},{key:"transMatrix",get:function(){return this.tryUpdateLocalTransMatrix(!0)}},{key:"globalTransMatrix",get:function(){return this.tryUpdateGlobalTransMatrix(!0)}},{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"getOffsetXY",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attribute,a=r.dx,s=void 0===a?t.dx:a,o=r.dy,l=void 0===o?t.dy:o;if(n&&this.parent){var u=this.parent.attribute;Un.x=s+(null!==(e=u.scrollX)&&void 0!==e?e:0),Un.y=l+(null!==(i=u.scrollY)&&void 0!==i?i:0)}else Un.x=s,Un.y=l;return Un}},{key:"onAnimateBind",value:function(t){this._emitCustomEvent("animate-bind",t)}},{key:"tryUpdateAABBBounds",value:function(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Ie.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Ie.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}},{key:"combindShadowAABBBounds",value:function(t){if(this.shadowRoot){var e=this.shadowRoot.AABBBounds.clone();t.union(e)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){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}},{key:"tryUpdateGlobalTransMatrix",value:function(){if(this._globalTransMatrix){if(this.parent){var 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}},{key:"shouldUpdateGlobalMatrix",value:function(){return!0}},{key:"tryUpdateLocalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new e.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag>.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag>.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag>.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag>.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag>.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag>.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=gt.CLEAR_SHAPE}},{key:"containsPoint",value:function(t,i,n,r){if(!r)return!1;if(n===yt.GLOBAL){var a=new e.Point(t,i);this.parent&&this.parent.globalTransMatrix.transformPoint(a,a),t=a.x,i=a.y}return r.containsPoint(this,{x:t,y:i})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,n=Object.keys(t),r=0;r<n.length;r++){var a=n[r];this.attribute[a]=t[a]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}},{key:"setAttribute",value:function(t,i,n,r){var a,s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(l({},t,i),this.attribute,t,r);s?this._setAttributes(s,n,r):e.isNil(null===(a=this.normalAttrs)||void 0===a?void 0:a[t])?(this.attribute[t]=i,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r)):this.normalAttrs[t]=i,"background"===t&&this.loadImage(i,!0)}},{key:"needUpdateTags",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:In,i=0;i<e.length;i++){var n=e[i];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:In,i=0;i<e.length;i++)if(t===e[i])return!0;return!1}},{key:"initAttributes",value:function(t){var e={type:bt.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=gt.INIT,this.onAttributeUpdate(e)}},{key:"translate",value:function(t,e){var i,n;if(0===t&&0===e)return this;var r={type:bt.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,jn,r);a&&(t=a.x,e=a.y,delete a.x,delete a.y,this._setAttributes(a));var s=this.attribute,o=s.postMatrix;return o?Ie.transformUtil.fromMatrix(o,o).translate(t,e):(s.x=(null!==(i=s.x)&&void 0!==i?i:fe.x)+t,s.y=(null!==(n=s.y)&&void 0!==n?n:fe.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"translateTo",value:function(t,e){var i=this.attribute;if(i.x===t&&i.y===e)return this;var n={type:bt.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,jn,n);return r?(this._setAttributes(r,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"scale",value:function(t,i,n){var r,a;if(1===t&&1===i)return this;var s={type:bt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:i,scaleCenter:n},this.attribute,Dn,s);o&&(t=o.scaleX,i=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));var l=this.attribute;if(n){var u=this.attribute.postMatrix;u||(u=new e.Matrix,l.postMatrix=u),Ie.transformUtil.fromMatrix(u,u).scale(t,i,n)}else l.scaleX=(null!==(r=l.scaleX)&&void 0!==r?r:fe.scaleX)*t,l.scaleY=(null!==(a=l.scaleY)&&void 0!==a?a:fe.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}},{key:"scaleTo",value:function(t,e){var i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;var n={type:bt.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Dn,n);return r?(this._setAttributes(r,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"rotate",value:function(t,i){var n;if(0===t)return this;var r={type:bt.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:i},this.attribute,Nn,r);a&&(delete a.angle,this._setAttributes(a,!1,r));var s=this.attribute;if(i){var o=this.attribute.postMatrix;o||(o=new e.Matrix,s.postMatrix=o),Ie.transformUtil.fromMatrix(o,o).rotate(t,i)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:fe.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"rotateTo",value:function(t){var e=this.attribute;if(e.angle===t)return this;var i={type:bt.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Nn,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}},{key:"skewTo",value:function(t,e){return this}},{key:"animate",value:function(t){var e=this;this.animates||(this.animates=new Map);var i=new an(null==t?void 0:t.id).bind(this);if(t){var n=t.onStart,r=t.onFrame,a=t.onEnd,s=t.onRemove;null!=n&&i.onStart(n),null!=r&&i.onFrame(r),null!=a&&i.onEnd(a),null!=s&&i.onRemove(s),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((function(){e.animates.delete(i.id)})),i}},{key:"onAttributeUpdate",value:function(t){t&&t.skipUpdateCallback||(Ie.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}},{key:"update",value:function(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}},{key:"hasState",value:function(t){return!(!this.currentStates||!this.currentStates.length)&&(!!e.isNil(t)||this.currentStates.includes(t))}},{key:"getState",value:function(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}},{key:"applyStateAttrs",value:function(t,e,i,n){var r,a,s,o,l=this;if(i){var u,h=Object.keys(t),d=this.getNoWorkAnimateAttr(),c={};n?h.forEach((function(e){d[e]?(u||(u={}),u[e]=t[e]):c[e]=void 0===t[e]?l.getDefaultAttribute(e):t[e]})):h.forEach((function(e){d[e]?(u||(u={}),u[e]=t[e]):c[e]=t[e]}));var f=this.animate();f.stateNames=e,f.to(c,null!==(a=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==a?a:un,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==o?o:hn),u&&this.setAttributes(u,!1,{type:bt.STATE})}else this.setAttributes(t,!1,{type:bt.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,i={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(i[t]=e.normalAttrs[t],delete e.normalAttrs[t]):i[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(i){t[i]=e.normalAttrs[i]}))):Object.keys(t).forEach((function(t){i[t]=e.getNormalAttribute(t)})),this.normalAttrs=i}},{key:"getNormalAttribute",value:function(t){var i=this.attribute[t];return this.animates&&this.animates.forEach((function(n){if(n.stateNames){var r=n.getEndProps();e.has(r,t)&&(i=r[t])}})),i}},{key:"clearStates",value:function(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}},{key:"removeState",value:function(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){var i=this.currentStates.filter((function(e){return e!==t}));this.useStates(i,e)}}},{key:"toggleState",value:function(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){var i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}},{key:"addState",value:function(t,e,i){var n;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}}},{key:"useStates",value:function(t,e){var i,n=this;if(t.length){if((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some((function(t,e){return n.currentStates[e]!==t}))){var r={};t.forEach((function(e){var i,a=n.stateProxy?n.stateProxy(e,t):null===(i=n.states)||void 0===i?void 0:i[e];a&&Object.assign(r,a)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=gt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=gt.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=gt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag>.UPDATE_SHAPE_AND_BOUNDS)===gt.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=gt.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=gt.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=gt.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=gt.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=gt.CLEAR_GLOBAL_MATRIX}},{key:"addUpdateLayoutTag",value:function(){this._updateTag|=gt.UPDATE_LAYOUT}},{key:"clearUpdateLayoutTag",value:function(){this._updateTag&=gt.CLEAR_LAYOUT}},{key:"needUpdateLayout",value:function(){return!!(this._updateTag>.UPDATE_LAYOUT)}},{key:"getAnchor",value:function(t,e){var i=this,n=[0,0],r=function(){if(e.b)return e.b;var t=i.attribute,n=t.scaleX,r=t.scaleY,a=t.angle;return Rn.copy(i._AABBBounds),i.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=i.AABBBounds.clone(),i._AABBBounds.copy(Rn),i.setAttributes({scaleX:n,scaleY:r,angle:a}),e.b};if("string"==typeof t[0]){var a=parseFloat(t[0])/100,s=r();n[0]=s.x1+(s.x2-s.x1)*a}else n[0]=t[0];if("string"==typeof t[1]){var o=parseFloat(t[1])/100,l=r();n[1]=l.y1+(l.y2-l.y1)*o}else n[1]=t[1];return n}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,i=t.x,n=void 0===i?fe.x:i,r=t.y,a=void 0===r?fe.y:r,s=t.scaleX,o=void 0===s?fe.scaleX:s,l=t.scaleY,u=void 0===l?fe.scaleY:l,h=t.angle,d=void 0===h?fe.angle:h,c=t.scaleCenter,f=t.anchor,v=t.postMatrix,p=[0,0],g={};if(f&&(p=this.getAnchor(f,g)),!c||1===o&&1===u)e.normalTransform(this._transMatrix,this._transMatrix.reset(),n,a,o,u,d,f&&p);else{var y=this._transMatrix;y.reset(),y.translate(p[0],p[1]),y.rotate(d),y.translate(-p[0],-p[1]),y.translate(n,a),p=this.getAnchor(c,g),Ie.transformUtil.fromMatrix(y,y).scale(o,u,{x:p[0],y:p[1]})}var b=this.getOffsetXY(fe);if(this._transMatrix.e+=b.x,this._transMatrix.f+=b.y,v){var m=Ln.setValue(v.a,v.b,v.c,v.d,v.e,v.f),x=this._transMatrix;m.multiply(x.a,x.b,x.c,x.d,x.e,x.f),x.setValue(m.a,m.b,m.c,m.d,m.e,m.f)}}},{key:"doUpdateGlobalMatrix",value:function(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);var t=this.parent.attribute,e=t.scrollX,i=void 0===e?0:e,n=t.scrollY,r=void 0===n?0:n;this._globalTransMatrix.translate(i,r)}}},{key:"setStage",value:function(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){var i=t.getTimeline();this.animates.forEach((function(t){t.setTimeline(i)}))}this._onSetStage&&this._onSetStage(this,t,e),Ie.graphicService.onSetStage(this,t)}}},{key:"setStageToShadowRoot",value:function(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}},{key:"onAddStep",value:function(t){}},{key:"onStop",value:function(t){t&&this.setAttributes(t,!1,{type:bt.ANIMATE_END})}},{key:"onStep",value:function(t,e,i,n,r){var a={};if(i.customAnimate)i.customAnimate.update(r,n,a);else{var s=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,a,i,n,r,s,void 0,o,l)}this.setAttributes(a,!1,{type:bt.ANIMATE_UPDATE,animationState:{ratio:n,end:r,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,i,n,r,a,s,o,l,u){var h=this;u||(u=Object.keys(s),n.propKeys=u),a?n.propKeys.forEach((function(t){e.validAttr(t)&&(i[t]=s[t])})):u.forEach((function(a){var u;if(e.validAttr(a)){var d=s[a],c=null!==(u=o&&o[a])&&void 0!==u?u:t.getLastPropByName(a,n);if(null!=d&&null!=c)e.interpolateFunc&&e.interpolateFunc(a,r,c,d,i)||(e.customInterpolate(a,r,c,d,h,i)||h.defaultInterpolate(d,c,a,i,l,r)||h._interpolate(a,r,c,d,i));else i[a]=d}})),n.parsedProps=l}},{key:"defaultInterpolate",value:function(t,e,i,n,r,a){if(Number.isFinite(t))return n[i]=e+(t-e)*a,!0;if("fill"===i){r||(r={});var s=r.fillColorArray,o=Cn(e,null!=s?s:t,a,!1,(function(t,e){r.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){r||(r={});var l=r.strokeColorArray,u=Cn(e,null!=l?l:t,a,!1,(function(t,e){r.strokeColorArray=e}));return u&&(n[i]=u),!0}if("shadowColor"===i){r||(r={});var h=r.shadowColorArray,d=Cn(e,null!=h?h:t,a,!0,(function(t,e){r.shadowColorArray=e}));return d&&(n[i]=d),!0}return!1}},{key:"_interpolate",value:function(t,e,i,n,r){}},{key:"getDefaultAttribute",value:function(t){return Vi(this)[this.type][t]}},{key:"getComputedAttribute",value:function(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}},{key:"onSetStage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}},{key:"attachShadow",value:function(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:Ie.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}},{key:"detachShadow",value:function(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}},{key:"toJson",value:function(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((function(t){return t.toJson()}))}}},{key:"createPathProxy",value:function(t){return e.isString(t,!0)?this.pathProxy=(new he).fromString(t):this.pathProxy=new he,this.pathProxy}},{key:"loadImage",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!t||i&&function(t){return!(!t.fill&&!t.stroke)}(t))){var n=t;this.resources||(this.resources=new Map);var r={data:"init",state:null};this.resources.set(n,r),"string"==typeof t?(r.state="loading",t.startsWith("<svg")?(On.GetSvg(t,this),this.backgroundImg=this.backgroundImg||i):(e.isValidUrl(t)||t.includes("/")||e.isBase64(t))&&(On.GetImage(t,this),this.backgroundImg=this.backgroundImg||i)):(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||i)}}},{key:"imageLoadSuccess",value:function(t,e,i){if(this.resources){var n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var i=this.resources.get(t);i&&(i.state="fail",e&&e())}}},{key:"_stopAnimates",value:function(t){t&&t.forEach((function(t){t.stop()}))}},{key:"stopAnimates",value:function(){var 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((function(e){e.stopAnimates(t)}))}},{key:"release",value:function(){this.releaseStatus="released",Ie.graphicService.onRelease(this)}},{key:"_emitCustomEvent",value:function(t,e){var i,n;if(this._events&&t in this._events){var r=new Yi(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),i=0;i<e.length;++i){var r=e[i];Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}]),n}(Fi);Hn.mixin($i);var Vn=function(){function t(e){a(this,t),this.tagname=e,this.child=[],this[":@"]={}}return o(t,[{key:"add",value:function(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push(l({},t,e))}},{key:"addChild",value:function(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(l(l({},t.tagname,t.child),":@",t[":@"])):this.child.push(l({},t.tagname,t.child))}}]),t}();function Wn(t,e,i,n){var r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Fn(t,e,i){var n=function(t,e){for(var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",a=e;a<t.length;a++){var s=t[a];if(i)s===i&&(i="");else if('"'===s||"'"===s)i=s;else if(s===n[0]){if(!n[1])return{data:r,index:a};if(t[a+1]===n[1])return{data:r,index:a}}else"\t"===s&&(s=" ");r+=s}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(n){var r=n.data,a=n.index,s=r.search(/\s/),o=r,l=!0;-1!==s&&(o=r.substr(0,s).replace(/\s\s*$/,""),r=r.substr(s+1));var u=o;if(i){var h=o.indexOf(":");-1!==h&&(l=(o=o.substr(h+1))!==n.data.substr(h+1))}return{tagName:o,tagExp:r,closeIndex:a,attrExpPresent:l,rawTagName:u}}}var Gn=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm"),Yn=function(){function t(e){a(this,t),this.currentNode=null,this.options=e,this.tagsNodeStack=[],this.docTypeEntities={}}return o(t,[{key:"addChild",value:function(t,e,i){var n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}},{key:"buildAttributesMap",value:function(t,e,i){var n={};if(t){for(var r=function(t,e){for(var i=[],n=e.exec(t);n;){var r=[];r.startIndex=e.lastIndex-n[0].length;for(var a=n.length,s=0;s<a;s++)r.push(n[s]);i.push(r),n=e.exec(t)}return i}(t,Gn),a=r.length,s=0;s<a;s++){var o=r[s][1],l=r[s][4];o&&(n[o]=void 0===l||(isNaN(l)?l:Number(l)))}return n}}},{key:"parseXml",value:function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new Vn("!xml"),i=e,n="",r="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var s=Wn(t,">",a,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),(i=this.tagsNodeStack.pop())&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",a=s}else if("?"===t[a+1])a=Fn(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=Wn(t,"--\x3e",a+4,"Comment is not closed.");else{var l=Fn(t,a,!1),u=l.tagName,h=l.tagExp,d=l.attrExpPresent,c=l.closeIndex;if(u!==e.tagname&&(r+=r?"."+u:u),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===u[u.length-1]?(u=u.substr(0,u.length-1),r=r.substr(0,r.length-1),h=u):h=h.substr(0,h.length-1);var f=new Vn(u);u!==h&&d&&(f[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,f,r),r=r.substr(0,r.lastIndexOf("."))}else{var v=new Vn(u);this.tagsNodeStack.push(i),u!==h&&d&&(v[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,v,r),i=v}n="",a=c}else n+=t[a];return e.child}}]),t}();function Xn(t,e){return $n(t)}function $n(t,e){for(var i,n={},r=0;r<t.length;r++){var a=t[r],s=qn(a);if(void 0!==s&&a[s]){var o=$n(a[s]);i=o,Object.keys(i).length,a[":@"]&&Kn(o,a[":@"]),void 0!==n[s]&&n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[n[s]]),n[s].push(o)):n[s]=o}}return n}function qn(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Kn(t,e,i){if(e)for(var n=Object.keys(e),r=n.length,a=0;a<r;a++){var s=n[a];t[s]=e[s]}}var Zn=function(){function t(e){a(this,t),this.options=Object.assign({},t.defaultOptions,e)}return o(t,[{key:"valid",value:function(t){return t.startsWith("<")}},{key:"parse",value:function(t){return!!this.valid&&Xn(new Yn(this.options).parseXml(t),this.options)}}]),t}();function Jn(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Zn.defaultOptions={};var Qn,tr=0;function er(){return tr++}function ir(t){for(var e=[],i=0,n="",r=0;r<t.length;r++)ar(t[r])?i?n+=t[r]:(i=1,n=t[r]):(i&&(e.push({text:n,direction:Qn.VERTICAL}),n="",i=0),e.push({text:t[r],direction:Qn.HORIZONTAL}));return n&&e.push({text:n,direction:Qn.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Qn||(Qn={}));var nr=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((function(t){return nr.set(t,!0)}));var rr=new Map;function ar(t){if(nr.has(t))return!0;if(rr.has(t))return!1;var e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((function(t){return rr.set(t,!0)}));var sr,or=er(),lr=er(),ur=er(),hr=er(),dr=er(),cr=er(),fr=er(),vr=er(),pr=er(),gr=er(),yr=er(),br=er(),mr=er(),xr=er(),_r=er(),Ar=er(),kr=Symbol.for("GraphicService"),Br=Symbol.for("GraphicCreator"),Sr={"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"},wr=Object.keys(Sr);!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(sr||(sr={}));var Tr=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="group",e.parent=null,e.isContainer=!0,e.numberType=cr,e._childUpdateTag=gt.UPDATE_BOUNDS,e}return o(n,[{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"setTheme",value:function(t){return this.theme||(this.theme=new zi),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new zi)}},{key:"hideAll",value:function(){this.setAttribute("visible",!1),this.forEachChildren((function(t){t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}},{key:"showAll",value:function(){this.setAttribute("visible",!0),this.forEachChildren((function(t){t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}},{key:"containsPoint",value:function(t,i,n){if(n===yt.GLOBAL){var r=new e.Point(t,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),this.AABBBounds.contains(r.x,r.y)}return this.AABBBounds.contains(t,i)}},{key:"shouldUpdateAABBBounds",value:function(){return!!y(h(n.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag>.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Ie.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Ie.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,i=void 0===e?fe.x:e,r=t.y,a=void 0===r?fe.y:r,s=t.dx,o=void 0===s?fe.dx:s,l=t.dy,u=void 0===l?fe.dy:l,d=t.scaleX,c=void 0===d?fe.scaleX:d,f=t.scaleY,v=void 0===f?fe.scaleY:f,p=t.angle,g=void 0===p?fe.angle:p,b=t.postMatrix;if(0!==i||0!==a||0!==o||0!==u||1!==c||1!==v||0!==g||b)return y(h(n.prototype),"doUpdateLocalMatrix",this).call(this);this._transMatrix.reset()}},{key:"doUpdateAABBBounds",value:function(){var t=this.attribute,e=Vi(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=Ie.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),n=t.boundsPadding,r=void 0===n?e.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=gt.CLEAR_BOUNDS,this._childUpdateTag&=gt.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=gt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag>.UPDATE_BOUNDS||(this._childUpdateTag|=gt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=y(h(n.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),Ie.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){y(h(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),Ie.graphicService.onClearIncremental(this,this.stage)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=y(h(n.prototype),"appendChild",this).call(this,t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertBefore",value:function(t,e){var i=y(h(n.prototype),"insertBefore",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertAfter",value:function(t,e){var i=y(h(n.prototype),"insertAfter",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertInto",value:function(t,e){var i=y(h(n.prototype),"insertInto",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"removeChild",value:function(t){var e=y(h(n.prototype),"removeChild",this).call(this,t);return t.stage=null,Ie.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){this.forEachChildren((function(t){Ie.graphicService.onRemove(t)})),y(h(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var i=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),Ie.graphicService.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,i.layer)})))}},{key:"addUpdatePositionTag",value:function(){y(h(n.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){y(h(n.prototype),"addUpdateGlobalPositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){var e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!!(this._updateTag>.UPDATE_GLOBAL_MATRIX)}},{key:"_getChildByName",value:function(t,e){return this.find((function(e){return e.name===t}),e)}},{key:"createOrUpdateChild",value:function(t,e,i){var n=this._getChildByName(t);return n?n.setAttributes(e):((n=Ie.graphicService.creator[i](e)).name=t,this.add(n)),n}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(Hn);Tr.NOWORK_ANIMATE_ATTR=zn;var Cr,Pr=function(t){u(i,t);var e=g(i);function i(t,n,r,s){var o,l;return a(this,i),(o=e.call(this,{})).stage=t,o.global=n,o.window=r,o.main=s.main,o.layerHandler=s.layerHandler,o.layerHandler.init(v(o),r,{main:s.main,canvasId:s.canvasId,width:o.viewWidth,height:o.viewHeight,zIndex:null!==(l=s.zIndex)&&void 0!==l?l:0}),o.layer=v(o),o.subLayers=new Map,o.theme=new zi,o.background="rgba(0, 0, 0, 0)",o.afterDrawCbs=[],o}return o(i,[{key:"offscreen",get:function(){return this.layerHandler.offscreen}},{key:"layerMode",get:function(){return this.layerHandler.type}},{key:"width",get:function(){return this.stage?this.stage.width:0}},{key:"height",get:function(){return this.stage?this.stage.height:0}},{key:"viewWidth",get:function(){return this.stage?this.stage.viewWidth:0}},{key:"viewHeight",get:function(){return this.stage?this.stage.viewHeight:0}},{key:"dirtyBound",get:function(){throw new Error("暂不支持")}},{key:"dpr",get:function(){return this._dpr}},{key:"combineSubLayer",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(i.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&i.forEach((function(t){t.group&&(t.group.incremental=0)})),i.forEach((function(e){Ie.layerService.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){y(h(i.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"tryRenderSecondaryLayer",value:function(t,e){var i=this;this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((function(n){n.layer.renderCount=i.renderCount,n.layer.render(t,e)}))}},{key:"render",value:function(t,e){var i,n=this,r=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:r.x,y:r.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((function(t){return t(n)})),this.tryRenderSecondaryLayer(t,e)}},{key:"resize",value:function(t,e){this.layerHandler.resize(t,e)}},{key:"resizeView",value:function(t,e){this.layerHandler.resizeView(t,e)}},{key:"setDpr",value:function(t){this.layerHandler.setDpr(t)}},{key:"afterDraw",value:function(t){this.afterDrawCbs.push(t)}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"prepare",value:function(t,e){}},{key:"combineTo",value:function(t,e){var i,n,r,a=this;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n: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((function(t){return t(a)})))}},{key:"release",value:function(){var t=this;y(h(i.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){Ie.layerService.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var i,n,r,a=this;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n: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((function(t){return t(a)}))}}]),i}(Tr),Mr=Symbol.for("TransformUtil"),Er=Symbol.for("GraphicUtil"),Or=Symbol.for("LayerService"),Lr=Symbol.for("StaticLayerHandlerContribution"),Rr=Symbol.for("DynamicLayerHandlerContribution"),Ir=Symbol.for("VirtualLayerHandlerContribution"),jr=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Dr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Nr=Cr=function(){function t(){a(this,t),this.layerMap=new Map,this.global=Ie.global}return o(t,[{key:"tryInit",value:function(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}},{key:"getStageLayer",value:function(t){return this.layerMap.get(t)}},{key:"getRecommendedLayerType",value:function(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}},{key:"getLayerHandler",value:function(t){return"static"===t?Ke.get(Lr):"dynamic"===t?Ke.get(Rr):Ke.get(Ir)}},{key:"createLayer",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();var n=this.getRecommendedLayerType(i.layerMode);n=i.canvasId?"static":n;var r=this.getLayerHandler(n),a=new Pr(t,this.global,t.window,Object.assign(Object.assign({main:!1},i),{layerMode:n,canvasId:null!==(e=i.canvasId)&&void 0!==e?e:Cr.GenerateLayerId(),layerHandler:r})),s=this.layerMap.get(t)||[];return s.push(a),this.layerMap.set(t,s),this.staticLayerCountInEnv--,a}},{key:"prepareStageLayer",value:function(t){var e;t.forEachChildren((function(t){var i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i).secondaryHandlers=[]}))}},{key:"releaseLayer",value:function(t,e){e.release();var i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((function(t){return t!==e})))}},{key:"layerCount",value:function(t){return(this.layerMap.get(t)||[]).length}},{key:"restLayerCount",value:function(t){return"browser"===this.global.env?10:0}}],[{key:"GenerateLayerId",value:function(){return"".concat(Cr.idprefix,"_").concat(Cr.prefix_count++)}}]),t}();Nr.idprefix="visactor_layer",Nr.prefix_count=0,Nr=Cr=jr([D(),Dr("design:paramtypes",[])],Nr);var Ur=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},zr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hr=Symbol.for("VWindow"),Vr=Symbol.for("WindowHandlerContribution"),Wr=function(){function t(){a(this,t),this.hooks={onChange:new nt(["x","y","width","height"])},this._uid=k.GenAutoIncrementId(),this.global=Ie.global,this.postInit()}return o(t,[{key:"width",get:function(){if(this._handler){var t=this._handler.getWH();return this._width=t.width}return this._width}},{key:"height",get:function(){if(this._handler){var t=this._handler.getWH();return this._height=t.height}return this._height}},{key:"dpr",get:function(){return this._handler.getDpr()}},{key:"postInit",value:function(){var t=this;this.global.hooks.onSetEnv.tap("window",(function(){t.active()})),this.active()}},{key:"active",value:function(){var t=this.global;t.env&&!this.actived&&(Ke.getNamed(Vr,t.env).configure(this,t),this.actived=!0)}},{key:"style",get:function(){return this._handler.getStyle()},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){this._handler.createWindow(t);var e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}},{key:"setWindowHandler",value:function(t){this._handler=t}},{key:"setDpr",value:function(t){return this._handler.setDpr(t)}},{key:"resize",value:function(t,e){return this._handler.resizeWindow(t,e)}},{key:"configure",value:function(){throw new Error("暂不支持")}},{key:"release",value:function(){return this._handler.releaseWindow()}},{key:"getContext",value:function(){return this._handler.getContext()}},{key:"getNativeHandler",value:function(){return this._handler.getNativeHandler()}},{key:"getImageBuffer",value:function(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}},{key:"addEventListener",value:function(t,e,i){return this._handler.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._handler.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._handler.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this._handler.getBoundingClientRect()}},{key:"getContainer",value:function(){return this._handler.container}},{key:"clearViewBox",value:function(t,e){this._handler.clearViewBox(t,e)}},{key:"isVisible",value:function(t){return this._handler.isVisible(t)}},{key:"onVisibleChange",value:function(t){return this._handler.onVisibleChange(t)}},{key:"getTopLeft",value:function(t){return this._handler.getTopLeft(t)}}]),t}();Wr=Ur([D(),zr("design:paramtypes",[])],Wr);var Fr=new B((function(t){t(at).to(ut).inSingletonScope(),t(Hr).to(Wr),t(Er).to(Li).inSingletonScope(),t(Mr).to(Ii).inSingletonScope(),t(Or).to(Nr).inSingletonScope()}));function Gr(t,e){return!(!t&&!e)}function Yr(t,i){return(e.isArray(t)?t.some((function(t){return t||void 0===t})):!!t)&&i>0}function Xr(t,e,i){return i&&t*e>0}function $r(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function qr(t,e){return t*e>0}function Kr(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Zr(t,i,n,r,a,s,o,l){var u=n-t,h=r-i,d=o-a,c=l-s,f=c*u-d*h;return f*f<e.epsilon?[]:[t+(f=(d*(i-s)-c*(t-a))/f)*u,i+f*h]}function Jr(t,e,i,n,r,a,s){var o=t-i,l=e-n,u=(s?a:-a)/Math.sqrt(o*o+l*l),h=u*l,d=-u*o,c=t+h,f=e+d,v=i+h,p=n+d,g=(c+v)/2,y=(f+p)/2,b=v-c,m=p-f,x=b*b+m*m,_=r-a,A=c*p-v*f,k=(m<0?-1:1)*Math.sqrt(Math.max(0,_*_*x-A*A)),B=(A*m-b*k)/x,S=(-A*b-m*k)/x,w=(A*m+b*k)/x,T=(-A*b+m*k)/x,C=B-g,P=S-y,M=w-g,E=T-y;return C*C+P*P>M*M+E*E&&(B=w,S=T),{cx:B,cy:S,x01:-h,y01:-d,x11:B*(r/_-1),y11:S*(r/_-1)}}function Qr(t,i,n,r,a,s,o){var l=t.getParsedAngle(),u=l.startAngle,h=l.endAngle,d=e.abs(h-u),c=h>u,f=!1;if(a<s){var v=a;a=s,s=v}if(a<=e.epsilon)i.moveTo(n,r);else if(d>=e.pi2-e.epsilon)i.moveTo(n+a*e.cos(u),r+a*e.sin(u)),i.arc(n,r,a,u,h,!c),s>e.epsilon&&(i.moveTo(n+s*e.cos(h),r+s*e.sin(h)),i.arc(n,r,s,h,u,c));else{var p,g,y,b,m=t.getParsedCornerRadius(),x=t.getParsePadAngle(u,h),_=x.outerDeltaAngle,A=x.innerDeltaAngle,k=x.outerStartAngle,B=x.outerEndAngle,S=x.innerEndAngle,w=x.innerStartAngle,T=m,C=m,P=m,M=m,E=Math.max(C,T),O=Math.max(P,M),L=E,R=O,I=a*e.cos(k),j=a*e.sin(k),D=s*e.cos(S),N=s*e.sin(S);if((O>e.epsilon||E>e.epsilon)&&(p=a*e.cos(B),g=a*e.sin(B),y=s*e.cos(w),b=s*e.sin(w),d<e.pi)){var U=Zr(I,j,y,b,p,g,D,N);if(U){var z=I-U[0],H=j-U[1],V=p-U[0],W=g-U[1],F=1/e.sin(e.acos((z*V+H*W)/(e.sqrt(z*z+H*H)*e.sqrt(V*V+W*W)))/2),G=e.sqrt(U[0]*U[0]+U[1]*U[1]);R=e.min(O,(s-G)/(F-1)),L=e.min(E,(a-G)/(F+1))}}if(_<.001)o&&(o[3]||o[1])&&i.moveTo(n+I,r+j),f=!0;else if(L>e.epsilon){var Y=e.min(T,L),X=e.min(C,L),$=Jr(y,b,I,j,a,Y,Number(c)),q=Jr(p,g,D,N,a,X,Number(c));L<E&&Y===X?!o||o[0]?(i.moveTo(n+$.cx+$.x01,r+$.cy+$.y01),i.arc(n+$.cx,r+$.cy,L,e.atan2($.y01,$.x01),e.atan2(q.y01,q.x01),!c)):i.moveTo(n+$.cx+L*e.cos(e.atan2(q.y01,q.x01)),r+$.cy+L*e.sin(e.atan2(q.y01,q.x01))):!o||o[0]?(i.moveTo(n+$.cx+$.x01,r+$.cy+$.y01),Y>0&&i.arc(n+$.cx,r+$.cy,Y,e.atan2($.y01,$.x01),e.atan2($.y11,$.x11),!c),i.arc(n,r,a,e.atan2($.cy+$.y11,$.cx+$.x11),e.atan2(q.cy+q.y11,q.cx+q.x11),!c),X>0&&i.arc(n+q.cx,r+q.cy,X,e.atan2(q.y11,q.x11),e.atan2(q.y01,q.x01),!c)):X>0?i.moveTo(n+q.cx+X*e.cos(e.atan2(q.y01,q.x01)),r+q.cy+X*e.sin(e.atan2(q.y01,q.x01))):i.moveTo(n+p,r+a*e.sin(B))}else!o||o[0]?(i.moveTo(n+I,r+j),i.arc(n,r,a,k,B,!c)):i.moveTo(n+a*e.cos(B),r+a*e.sin(B));if(!(s>e.epsilon)||A<.001)!o||o[1]?i.lineTo(n+D,r+N):i.moveTo(n+D,r+N),f=!0;else if(R>e.epsilon){var K=e.min(M,R),Z=e.min(P,R),J=Jr(D,N,p,g,s,-Z,Number(c)),Q=Jr(I,j,y,b,s,-K,Number(c));if(!o||o[1]?i.lineTo(n+J.cx+J.x01,r+J.cy+J.y01):i.moveTo(n+J.cx+J.x01,r+J.cy+J.y01),R<O&&K===Z){var tt=e.atan2(Q.y01,Q.x01);!o||o[2]?i.arc(n+J.cx,r+J.cy,R,e.atan2(J.y01,J.x01),tt,!c):i.moveTo(n+J.cx+e.cos(tt),r+J.cy+e.sin(tt))}else!o||o[2]?(Z>0&&i.arc(n+J.cx,r+J.cy,Z,e.atan2(J.y01,J.x01),e.atan2(J.y11,J.x11),!c),i.arc(n,r,s,e.atan2(J.cy+J.y11,J.cx+J.x11),e.atan2(Q.cy+Q.y11,Q.cx+Q.x11),c),K>0&&i.arc(n+Q.cx,r+Q.cy,K,e.atan2(Q.y11,Q.x11),e.atan2(Q.y01,Q.x01),!c)):K>0?i.moveTo(n+Q.cx+K*e.cos(e.atan2(Q.y01,Q.x01)),r+Q.cy+K*e.sin(e.atan2(Q.y01,Q.x01))):i.moveTo(n+y,r+b)}else!o||o[1]?i.lineTo(n+D,r+N):i.moveTo(n+D,r+N),!o||o[2]?i.arc(n,r,s,S,w,c):i.moveTo(n+s*e.cos(w),r+s*e.sin(w))}return o?o[3]&&i.lineTo(n+a*e.cos(u),r+a*e.sin(u)):i.closePath(),f}var ta=Symbol.for("ArcRenderContribution"),ea=Symbol.for("AreaRenderContribution"),ia=Symbol.for("CircleRenderContribution"),na=Symbol.for("GroupRenderContribution"),ra=Symbol.for("ImageRenderContribution"),aa=Symbol.for("PathRenderContribution"),sa=Symbol.for("PolygonRenderContribution"),oa=Symbol.for("RectRenderContribution"),la=Symbol.for("SymbolRenderContribution"),ua=Symbol.for("TextRenderContribution"),ha=Symbol.for("InteractiveSubRenderContribution"),da=["radius","startAngle","endAngle"].concat(m(In)),ca=function(t){u(i,t);var e=g(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1};return a(this,i),(t=e.call(this,n)).type="circle",t.numberType=hr,t}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,i=t.endAngle,n=t.radius;return this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}},{key:"doUpdateAABBBounds",value:function(t){var e=Vi(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Ie.graphicService.updateCircleAABBBounds(i,Vi(this).circle,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=fn(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Vi(this).circle[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,da)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,da)}},{key:"toCustomPath",value:function(){var t,e,i,n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),a=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),s=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new he;return o.arc(0,0,r,a,s),o}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(Hn);function fa(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function va(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}ca.NOWORK_ANIMATE_ATTR=zn;var pa=function(){function t(e,i,n){a(this,t),this.fontFamily=e,this.textOptions=i,this.textMeasure=n}return o(t,[{key:"LayoutBBox",value:function(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}},{key:"GetLayout",value:function(t,e,i,n,r,a,s,o,l){for(var u=[],h=[e,i],d=[0,0];t.length>0;){var c=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,s,o,l).str;u.push({str:c,width:this.textMeasure.measureTextWidth(c,this.textOptions)}),t=t.substring(c.length)}"left"===n||"start"===n||("center"===n?d[0]=h[0]/-2:"right"!==n&&"end"!==n||(d[0]=-h[0])),"top"===r||("middle"===r?d[1]=h[1]/-2:"bottom"===r&&(d[1]=-h[1]));var f={xOffset:d[0],yOffset:d[1],width:h[0],height:h[1]};return this.layoutWithBBox(f,u,n,r,a)}},{key:"GetLayoutByLines",value:function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((function(t){return t.toString()}));var l=[],u=[0,0];if("number"==typeof s&&s!==1/0){for(var h,d=0,c=t.length;d<c;d++)h=Math.min(this.textMeasure.measureTextWidth(t[d],this.textOptions),s),l.push({str:this.textMeasure.clipTextWithSuffix(t[d],this.textOptions,h,r,a,o).str,width:h});u[0]=s}else{var f,v;s=0;for(var p=0,g=t.length;p<g;p++)v=t[p],f=this.textMeasure.measureTextWidth(v,this.textOptions),s=Math.max(s,f),l.push({str:v,width:f});u[0]=s}u[1]=l.length*n,u[0]=l.reduce((function(t,e){return Math.max(t,e.width)}),0);var y={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(y,e,i),this.layoutWithBBox(y,l,e,i,n)}},{key:"layoutWithBBox",value:function(t,e,i,n,r){var a=[0,0],s=e.length*r;"top"===n||("middle"===n?a[1]=(t.height-s)/2:"bottom"===n&&(a[1]=t.height-s));for(var o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}},{key:"lineOffset",value:function(t,e,i,n,r,a){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+a[1],a[1]+=r,e}}]),t}(),ga=["text","maxLineWidth","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak"].concat(m(In)),ya=function(t){u(n,t);var i=g(n);function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return a(this,n),(t=i.call(this,e)).type="text",t.numberType=Ar,t.cache={},t}return o(n,[{key:"font",get:function(){var t=Vi(this).text;return this._font||(this._font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);var n=t.fontStyle,r=void 0===n?e.fontStyle:n,a=t.fontVariant,s=void 0===a?e.fontVariant:a,o=t.fontWeight,l=void 0===o?e.fontWeight:o,u=t.fontSize,h=void 0===u?e.fontSize:u,d=t.fontFamily;return(r?r+" ":"")+(s?s+" ":"")+(l?l+" ":"")+h*i+"px "+((void 0===d?e.fontFamily:d)||"sans-serif")}(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,i=Vi(this).text;if(!Array.isArray(e.text)){var n=e.maxLineWidth,r=void 0===n?i.maxLineWidth:n;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}}},{key:"clipedWidth",get:function(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=Vi(this).text,e=this.attribute;if(!Array.isArray(e.text)){var i=e.maxLineWidth,n=void 0===i?t.maxLineWidth:i;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text.toString())}}},{key:"multilineLayout",get:function(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}},{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),n=this.attribute.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"updateWrapAABBBounds",value:function(t){var i,n,r,a,s=Vi(this).text,o=this.attribute,l=o.fontFamily,u=void 0===l?s.fontFamily:l,h=o.textAlign,d=void 0===h?s.textAlign:h,c=o.textBaseline,f=void 0===c?s.textBaseline:c,v=o.fontSize,p=void 0===v?s.fontSize:v,g=o.ellipsis,y=void 0===g?s.ellipsis:g,b=o.maxLineWidth,m=o.stroke,x=void 0===m?s.stroke:m,_=o.lineWidth,A=void 0===_?s.lineWidth:_,k=o.wordBreak,B=void 0===k?s.wordBreak:k,S=o.fontWeight,w=void 0===S?s.fontWeight:S,T=o.ignoreBuf,C=void 0===T?s.ignoreBuf:T,P=o.heightLimit,M=void 0===P?0:P,E=o.lineClamp,O=null!==(i=An(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==i?i:this.attribute.fontSize||s.fontSize,L=C?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var R=this.cache.layoutData.bbox;return this._AABBBounds.set(R.xOffset,R.yOffset,R.xOffset+R.width,R.yOffset+R.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}var I=Ie.graphicUtil.textMeasure,j=new pa(u,{fontSize:p,fontWeight:w,fontFamily:u},I),D=e.isArray(t)?t.map((function(t){return t.toString()})):[t.toString()],N=[],U=[0,0],z=1/0;if(M>0&&(z=Math.max(Math.floor(M/O),1)),E&&(z=Math.min(z,E)),"number"==typeof b&&b!==1/0){if(b>0)for(var H=0;H<D.length;H++){var V=D[H],W=!0;if(H===z-1){var F=j.textMeasure.clipTextWithSuffix(V,j.textOptions,b,y,!1);N.push({str:F.str,width:F.width});break}var G=j.textMeasure.clipText(V,j.textOptions,b,"break-word"===B);if(""!==V&&""===G.str){if(y){var Y=j.textMeasure.clipTextWithSuffix(V,j.textOptions,b,y,!1);G.str=null!==(r=Y.str)&&void 0!==r?r:"",G.width=null!==(a=Y.width)&&void 0!==a?a:0}else G.str="",G.width=0;W=!1}if(N.push({str:G.str,width:G.width}),G.str.length===V.length);else if(W){var X=V.substring(G.str.length);D.splice(H+1,0,X)}}var $=0;N.forEach((function(t){$=Math.max($,t.width)})),U[0]=$}else{for(var q,K,Z=0,J=0,Q=D.length;J<Q;J++){if(J===z-1){var tt=j.textMeasure.clipTextWithSuffix(D[J],j.textOptions,b,y,!1);N.push({str:tt.str,width:tt.width}),Z=Math.max(Z,tt.width);break}K=D[J],q=j.textMeasure.measureTextWidth(K,j.textOptions,"break-word"===B),Z=Math.max(Z,q),N.push({str:K,width:q})}U[0]=Z}U[1]=N.length*(O+L);var et={xOffset:0,yOffset:0,width:U[0],height:U[1]};j.LayoutBBox(et,d,f);var it=j.layoutWithBBox(et,N,d,f,O);return this.cache.layoutData=it,this.clearUpdateShapeTag(),this._AABBBounds.set(et.xOffset,et.yOffset,et.xOffset+et.width,et.yOffset+et.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"updateSingallineAABBBounds",value:function(t){var e=Vi(this).text,i=this.attribute.direction;return"horizontal"===(void 0===i?e.direction:i)?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}},{key:"updateMultilineAABBBounds",value:function(t){var e=Vi(this).text,i=this.attribute.direction;return"horizontal"===(void 0===i?e.direction:i)?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}},{key:"updateHorizontalSinglelineAABBBounds",value:function(t){var e,i,n,r,a=Vi(this).text,s=Ie.graphicUtil.textMeasure,o=this.attribute,l=o.maxLineWidth,u=void 0===l?a.maxLineWidth:l,h=o.ellipsis,d=void 0===h?a.ellipsis:h,c=o.textAlign,f=void 0===c?a.textAlign:c,v=o.textBaseline,p=void 0===v?a.textBaseline:v,g=o.fontFamily,y=void 0===g?a.fontFamily:g,b=o.fontSize,m=void 0===b?a.fontSize:b,x=o.fontWeight,_=void 0===x?a.fontWeight:x,A=o.stroke,k=void 0===A?a.stroke:A,B=o.lineWidth,S=void 0===B?a.lineWidth:B,w=o.ignoreBuf,T=void 0===w?a.ignoreBuf:w,C=o.whiteSpace,P=void 0===C?a.whiteSpace:C,M=o.suffixPosition,E=void 0===M?a.suffixPosition:M;if("normal"===P)return this.updateWrapAABBBounds(t);var O=T?0:Math.max(2,.075*m),L=o.fontSize||a.fontSize,R=null!==(e=An(o.lineHeight,L))&&void 0!==e?e:L+O;if(!this.shouldUpdateShape()&&this.cache){var I=fa(f,n=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0),j=va(p,R,m);return this._AABBBounds.set(I,j,I+n,j+R),k&&this._AABBBounds.expand(S/2),this._AABBBounds}if(Number.isFinite(u)){if(d){var D=!0===d?a.ellipsis:d,N=s.clipTextWithSuffix(t.toString(),{fontSize:m,fontWeight:_,fontFamily:y},u,D,!1,E);r=N.str,n=N.width}else{var U=s.clipText(t.toString(),{fontSize:m,fontWeight:_,fontFamily:y},u,!1);r=U.str,n=U.width}this.cache.clipedText=r,this.cache.clipedWidth=n}else n=s.measureTextWidth(t.toString(),{fontSize:m,fontWeight:_,fontFamily:y}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();var z=fa(f,n),H=R;Ie.global&&Ie.global.isSafari()&&(H+=.2*m);var V=va(p,H,m,O);return this._AABBBounds.set(z,V,z+n,V+H),k&&this._AABBBounds.expand(S/2),this._AABBBounds}},{key:"getBaselineMapAlign",value:function(){return n.baselineMapAlign}},{key:"getAlignMapBaseline",value:function(){return n.alignMapBaseline}},{key:"updateVerticalSinglelineAABBBounds",value:function(t){var e,i,r,a,s=Vi(this).text,o=Ie.graphicUtil.textMeasure,l=this.attribute,u=l.ignoreBuf,h=(void 0===u?s.ignoreBuf:u)?0:2,d=l.maxLineWidth,c=void 0===d?s.maxLineWidth:d,f=l.ellipsis,v=void 0===f?s.ellipsis:f,p=l.fontSize,g=void 0===p?s.fontSize:p,y=l.fontWeight,b=void 0===y?s.fontWeight:y,m=l.fontFamily,x=void 0===m?s.fontFamily:m,_=l.stroke,A=void 0===_?s.stroke:_,k=l.lineWidth,B=void 0===k?s.lineWidth:k,S=l.verticalMode,w=void 0===S?s.verticalMode:S,T=l.suffixPosition,C=void 0===T?s.suffixPosition:T,P=null!==(e=An(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==e?e:(l.fontSize||s.fontSize)+h,M=l.textAlign,E=void 0===M?s.textAlign:M,O=l.textBaseline,L=void 0===O?s.textBaseline:O;if(!w){var R=E;E=null!==(i=n.baselineMapAlign[L])&&void 0!==i?i:"left",L=null!==(r=n.alignMapBaseline[R])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){var I=fa(E,a=this.cache.clipedWidth),j=va(L,P,g);return this._AABBBounds.set(j,I,j+P,I+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}var D=[ir(t.toString())];if(Number.isFinite(c)){if(v){var N=!0===v?s.ellipsis:v,U=o.clipTextWithSuffixVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},c,N,!1,C);D=[U.verticalList],a=U.width}else{var z=o.clipTextVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},c,!1);D=[z.verticalList],a=z.width}this.cache.verticalList=D,this.cache.clipedWidth=a}else a=0,D[0].forEach((function(t){var e=t.direction===Qn.HORIZONTAL?g:o.measureTextWidth(t.text,{fontSize:g,fontWeight:b,fontFamily:x});a+=e,t.width=e})),this.cache.verticalList=D,this.cache.clipedWidth=a;this.clearUpdateShapeTag();var H=fa(E,a),V=va(L,P,g);return this._AABBBounds.set(V,H,V+P,H+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}},{key:"updateHorizontalMultilineAABBBounds",value:function(t){var e,i,n=Vi(this).text,r=this.attribute,a=r.fontFamily,s=void 0===a?n.fontFamily:a,o=r.textAlign,l=void 0===o?n.textAlign:o,u=r.textBaseline,h=void 0===u?n.textBaseline:u,d=r.fontSize,c=void 0===d?n.fontSize:d,f=r.fontWeight,v=void 0===f?n.fontWeight:f,p=r.ellipsis,g=void 0===p?n.ellipsis:p,y=r.maxLineWidth,b=r.stroke,m=void 0===b?n.stroke:b,x=r.lineWidth,_=void 0===x?n.lineWidth:x,A=r.whiteSpace,k=void 0===A?n.whiteSpace:A,B=r.suffixPosition,S=void 0===B?n.suffixPosition:B,w=null!==(e=An(r.lineHeight,r.fontSize||n.fontSize))&&void 0!==e?e:r.fontSize||n.fontSize;if("normal"===k)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var T=this.cache.layoutData.bbox;return this._AABBBounds.set(T.xOffset,T.yOffset,T.xOffset+T.width,T.yOffset+T.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}var C=Ie.graphicUtil.textMeasure,P=new pa(s,{fontSize:c,fontWeight:v,fontFamily:s},C).GetLayoutByLines(t,l,h,w,!0===g?n.ellipsis:g||void 0,!1,y,S),M=P.bbox;return this.cache.layoutData=P,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"updateVerticalMultilineAABBBounds",value:function(t){var i,r,a,s,o=Vi(this).text,l=Ie.graphicUtil.textMeasure,u=this.attribute,h=u.ignoreBuf,d=(void 0===h?o.ignoreBuf:h)?0:2,c=u.maxLineWidth,f=void 0===c?o.maxLineWidth:c,v=u.ellipsis,p=void 0===v?o.ellipsis:v,g=u.fontFamily,y=void 0===g?o.fontFamily:g,b=u.fontSize,m=void 0===b?o.fontSize:b,x=u.fontWeight,_=void 0===x?o.fontWeight:x,A=u.stroke,k=void 0===A?o.stroke:A,B=u.lineWidth,S=void 0===B?o.lineWidth:B,w=u.verticalMode,T=void 0===w?o.verticalMode:w,C=u.suffixPosition,P=void 0===C?o.suffixPosition:C,M=null!==(i=An(u.lineHeight,u.fontSize||o.fontSize))&&void 0!==i?i:(u.fontSize||o.fontSize)+d,E=u.textAlign,O=void 0===E?o.textAlign:E,L=u.textBaseline,R=void 0===L?o.textBaseline:L;if(!T){var I=O;O=null!==(r=n.baselineMapAlign[R])&&void 0!==r?r:"left",R=null!==(a=n.alignMapBaseline[I])&&void 0!==a?a:"top"}if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((function(t){var i=t.reduce((function(t,e){return t+e.width}),0);s=e.max(i,s)}));var j=fa(O,s),D=this.cache.verticalList.length*M,N=va(R,D,m);return this._AABBBounds.set(N,j,N+D,j+s),k&&this._AABBBounds.expand(S/2),this._AABBBounds}var U=t.map((function(t){return ir(t.toString())}));U.forEach((function(t,e){if(Number.isFinite(f))if(p){var i=!0===p?o.ellipsis:p,n=l.clipTextWithSuffixVertical(t,{fontSize:m,fontWeight:_,fontFamily:y},f,i,!1,P);U[e]=n.verticalList,s=n.width}else{var r=l.clipTextVertical(t,{fontSize:m,fontWeight:_,fontFamily:y},f,!1);U[e]=r.verticalList,s=r.width}else s=0,t.forEach((function(t){var e=t.direction===Qn.HORIZONTAL?m:l.measureTextWidth(t.text,{fontSize:m,fontWeight:_,fontFamily:y});s+=e,t.width=e}))})),this.cache.verticalList=U,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((function(t){var i=t.reduce((function(t,e){return t+e.width}),0);s=e.max(i,s)}));var z=fa(O,s),H=this.cache.verticalList.length*M,V=va(R,H,m);return this._AABBBounds.set(V,z,V+H,z+s),k&&this._AABBBounds.expand(S/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Vi(this).text[t]}},{key:"needUpdateTags",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ga;return y(h(n.prototype),"needUpdateTags",this).call(this,t,e)}},{key:"needUpdateTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ga;return y(h(n.prototype),"needUpdateTag",this).call(this,t,e)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(Hn);ya.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},zn),ya.baselineMapAlign={top:"left",bottom:"right",middle:"center"},ya.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var ba=["heightLimit","lineClamp"],ma=function(t){u(n,t);var i=g(n);function n(){return a(this,n),i.apply(this,arguments)}return o(n,[{key:"_isValid",value:function(){var t=this.attribute.text;return e.isArray(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,i,n,r,a=Vi(this).text,s=this.attribute,o=s.fontFamily,l=void 0===o?a.fontFamily:o,u=s.textAlign,h=void 0===u?a.textAlign:u,d=s.textBaseline,c=void 0===d?a.textBaseline:d,f=s.fontSize,v=void 0===f?a.fontSize:f,p=s.ellipsis,g=void 0===p?a.ellipsis:p,y=s.maxLineWidth,b=s.stroke,m=void 0===b?a.stroke:b,x=s.lineWidth,_=void 0===x?a.lineWidth:x,A=s.wordBreak,k=void 0===A?a.wordBreak:A,B=s.fontWeight,S=void 0===B?a.fontWeight:B,w=s.ignoreBuf,T=void 0===w?a.ignoreBuf:w,C=s.heightLimit,P=void 0===C?0:C,M=s.lineClamp,E=null!==(e=An(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,O=T?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var L=this.cache.layoutData.bbox;return this._AABBBounds.set(L.xOffset,L.yOffset,L.xOffset+L.width,L.yOffset+L.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}var R=Ie.graphicUtil.textMeasure,I=new pa(l,{fontSize:v,fontWeight:S,fontFamily:l},R),j=t.map((function(t){return t.toString()})),D=[],N=[0,0],U=1/0;if(P>0&&(U=Math.max(Math.floor(P/E),1)),M&&(U=Math.min(U,M)),"number"==typeof y&&y!==1/0){if(y>0)for(var z=0;z<j.length;z++){var H=j[z],V=!0;if(z===U-1){var W=I.textMeasure.clipTextWithSuffix(H,I.textOptions,y,g,!1);D.push({str:W.str,width:W.width});break}var F=I.textMeasure.clipText(H,I.textOptions,y,"break-word"===k);if(""!==H&&""===F.str){if(g){var G=I.textMeasure.clipTextWithSuffix(H,I.textOptions,y,g,!1);F.str=null!==(n=G.str)&&void 0!==n?n:"",F.width=null!==(r=G.width)&&void 0!==r?r:0}else F.str="",F.width=0;V=!1}if(D.push({str:F.str,width:F.width}),F.str.length===H.length);else if(V){var Y=H.substring(F.str.length);j.splice(z+1,0,Y)}}var X=0;D.forEach((function(t){X=Math.max(X,t.width)})),N[0]=X}else{for(var $,q,K=0,Z=0,J=j.length;Z<J;Z++){if(Z===U-1){var Q=I.textMeasure.clipTextWithSuffix(j[Z],I.textOptions,y,g,!1);D.push({str:Q.str,width:Q.width}),K=Math.max(K,Q.width);break}q=j[Z],$=I.textMeasure.measureTextWidth(q,I.textOptions,"break-word"===k),K=Math.max(K,$),D.push({str:q,width:$})}N[0]=K}N[1]=D.length*(E+O);var tt={xOffset:0,yOffset:0,width:N[0],height:N[1]};I.LayoutBBox(tt,h,c);var et=I.layoutWithBBox(tt,D,h,c,E);return this.cache.layoutData=et,this.clearUpdateShapeTag(),this._AABBBounds.set(tt.xOffset,tt.yOffset,tt.xOffset+tt.width,tt.yOffset+tt.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<ba.length;e++){var i=ba[e];if(-1!==t.indexOf(i))return!0}return y(h(n.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<ba.length;e++)if(t===ba[e])return!0;return y(h(n.prototype),"needUpdateTag",this).call(this,t)}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(ya),xa=function(){function t(){a(this,t)}return o(t,[{key:"bounds",value:function(t,i){if(e.isNumber(t)){var n=t/2;i.x1=-n,i.x2=n,i.y1=-n,i.y2=n}else i.x1=-t[0]/2,i.x2=t[0]/2,i.y1=-t[1]/2,i.y2=t[1]/2}}]),t}();function _a(t,i,n,r,a){return a?t.arc(n,r,i,0,e.tau,!1,a):t.arc(n,r,i,0,e.tau),!1}var Aa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="circle",t.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return _a(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return _a(t,e/2+r,i,n,a)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," a ").concat(r,",").concat(r," 0 1,0 ").concat(2*r,",0 a ").concat(r,",").concat(r," 0 1,0 -").concat(2*r,",0")}}]),i}(xa),ka=new Aa;var Ba=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="cross",t.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",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return function(t,e,i,n,r,a){return t.moveTo(-3*e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-3*e+n-r,a),t.lineTo(e+i+r,-3*e+n-r,a),t.lineTo(e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,e+n+r,a),t.lineTo(e+i+r,e+n+r,a),t.lineTo(e+i+r,3*e+n+r,a),t.lineTo(-e+i-r,3*e+n+r,a),t.lineTo(-e+i-r,e+n+r,a),t.lineTo(-3*e+i-r,e+n+r,a),t.closePath(),!0}(t,e/6,i,n,r,a)}}]),i}(xa),Sa=new Ba;function wa(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Ta=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="diamond",t.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return wa(t,e/2,i,n,r)}},{key:"drawFitDir",value:function(t,e,i,n,r){return wa(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return wa(t,e/2+r,i,n,a)}}]),i}(xa),Ca=new Ta;function Pa(t,e,i,n){var r=2*e;return t.rect(i-e,n-e,r,r),!1}var Ma=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="square",t.pathStr="M-0.5,-0.5h1v1h-1Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Pa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Pa(t,e/2+r,i,n)}}]),i}(xa),Ea=new Ma;var Oa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleUp",t.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(xa),La=new Oa,Ra=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangle",t}return o(i)}(Oa),Ia=new Ra,ja=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Da=Math.sin(e.tau/10)*ja,Na=-Math.cos(e.tau/10)*ja;function Ua(t,i,n,r){var a=Da*i,s=Na*i;t.moveTo(n,-i+r),t.lineTo(a+n,s+r);for(var o=1;o<5;++o){var l=e.tau*o/5,u=Math.cos(l),h=Math.sin(l);t.lineTo(h*i+n,-u*i+r),t.lineTo(u*a-h*s+n,h*a+u*s+r)}return t.closePath(),!0}var za=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="star",t.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Ua(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ua(t,e/2+r,i,n)}}]),i}(xa),Ha=new za,Va=e.sqrt(3);function Wa(t,e,i,n){var r=e,a=r/Va,s=a/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(a/2+i,n),t.lineTo(s/2+i,n),t.lineTo(s/2+i,o+n),t.lineTo(-s/2+i,o+n),t.lineTo(-s/2+i,n),t.lineTo(-a/2+i,n),t.closePath(),!0}var Fa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow",t.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",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Wa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Wa(t,e/2+r,i,n)}}]),i}(xa),Ga=new Fa;function Ya(t,e,i,n){var r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Xa=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="wedge",t.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Ya(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ya(t,e/2+r,i,n)}}]),i}(xa),$a=new Xa;function qa(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Ka=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="stroke",t.pathStr="",t}return o(i,[{key:"draw",value:function(t,e,i,n){return qa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return qa(t,e/2+r,i,n)}}]),i}(xa),Za=new Ka,Ja=-.5,Qa=e.sqrt(3)/2,ts=1/e.sqrt(12);function es(t,e,i,n){var r=e/2,a=e*ts,s=r,o=e*ts+e,l=-s,u=o;return t.moveTo(r+i,a+n),t.lineTo(s+i,o+n),t.lineTo(l+i,u+n),t.lineTo(Ja*r-Qa*a+i,Qa*r+Ja*a+n),t.lineTo(Ja*s-Qa*o+i,Qa*s+Ja*o+n),t.lineTo(Ja*l-Qa*u+i,Qa*l+Ja*u+n),t.lineTo(Ja*r+Qa*a+i,Ja*a-Qa*r+n),t.lineTo(Ja*s+Qa*o+i,Ja*o-Qa*s+n),t.lineTo(Ja*l+Qa*u+i,Ja*u-Qa*l+n),t.closePath(),!1}var is=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="wye",t.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0",t}return o(i,[{key:"draw",value:function(t,e,i,n){return es(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return es(t,e/2+r,i,n)}}]),i}(xa),ns=new is;var rs=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleLeft",t.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(xa),as=new rs;var ss=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleRight",t.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(xa),os=new ss;var ls=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleDown",t.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(xa),us=new ls,hs=e.sqrt(3);function ds(t,e,i,n){var r=e*hs;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var cs=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ds(t,e/2/hs,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ds(t,e/2/hs+r,i,n)}}]),i}(Oa),fs=new cs;function vs(t,e,i,n){var r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var ps=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Left",t.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n){return vs(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return vs(t,e/4+r,i,n)}}]),i}(xa),gs=new ps;function ys(t,e,i,n){var r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var bs=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Right",t.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ys(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ys(t,e/4+r,i,n)}}]),i}(xa),ms=new bs;function xs(t,e,i,n){var r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var _s=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Up",t.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25",t}return o(i,[{key:"draw",value:function(t,e,i,n){return xs(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return xs(t,e/4+r,i,n)}}]),i}(xa),As=new _s;function ks(t,e,i,n){var r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var Bs=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Down",t.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ks(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ks(t,e/4+r,i,n)}}]),i}(xa),Ss=new Bs;function ws(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Ts=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="lineV",t.pathStr="M0,-0.5L0,0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return ws(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return ws(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e,", ").concat(i-r," L ").concat(e,",").concat(i+r)}}]),i}(xa),Cs=new Ts;function Ps(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var Ms=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="lineH",t.pathStr="M-0.5,0L0.5,0",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return Ps(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Ps(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," L ").concat(e+r,",").concat(i)}}]),i}(xa),Es=new Ms;function Os(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var Ls=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="close",t.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return Os(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Os(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i-r," L ").concat(e+r,",").concat(i+r," M ").concat(e+r,", ").concat(i-r," L ").concat(e-r,",").concat(i+r)}}]),i}(xa),Rs=new Ls;function Is(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function js(t,e,i,n){var r=e,a=e/2;return t.rect(i-r/2,n-a/2,r,a),!1}var Ds=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).type="rect",t.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",t}return o(n,[{key:"draw",value:function(t,i,n,r){return e.isNumber(i)?js(t,i,n,r):Is(t,i,n,r)}},{key:"drawOffset",value:function(t,i,n,r,a){return e.isNumber(i)?js(t,i+2*a,n,r):Is(t,[i[0]+2*a,i[1]+2*a],n,r)}}]),n}(xa),Ns=new Ds,Us=new e.AABBBounds,zs=function(){function t(i,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,t),this.pathStr="",this.type=i,e.isArray(n)?this.svgCache=n:this.path=n,this.isSvg=r}return o(t,[{key:"drawOffset",value:function(t,e,i,n,r,a,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),Rt(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(Rt(this.path.commandList,t,i,n,e+r,e+r),!1)}},{key:"draw",value:function(t,e,i,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),Rt(r.path.commandList,t,i,n,e,e),a&&a(r.path,r.attribute)})),!1):(Rt(this.path.commandList,t,i,n,e,e),!1)}},{key:"bounds",value:function(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((function(i){var n=i.path;Us.x1=n.bounds.x1*t,Us.y1=n.bounds.y1*t,Us.x2=n.bounds.x2*t,Us.y2=n.bounds.y2*t,e.union(Us)}))}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)}}]),t}(),Hs={};[ka,Sa,Ca,Ea,fs,Ia,Ha,Ga,$a,Za,ns,as,os,La,us,gs,ms,As,Ss,Ns,Cs,Es,Rs].forEach((function(t){Hs[t.type]=t}));var Vs={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},Ws=new e.AABBBounds,Fs=["symbolType","size"].concat(m(In)),Gs=function(t){u(n,t);var i=g(n);function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return a(this,n),(t=i.call(this,e)).type="symbol",t.numberType=_r,t}return o(n,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return e.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t,i=Vi(this).symbol,r=this.attribute.symbolType,a=void 0===r?i.symbolType:r,s=Hs[a];if(s)return this._parsedPath=s,s;if(s=n.userSymbolMap[a])return this._parsedPath=s,s;if(!0===((t=a=Vs[a]||a).startsWith("<svg")||t.startsWith("<?xml"))){var o=(new Zn).parse(a).svg;if(!o)return null;var l=e.isArray(o.path)?o.path:[o.path];Ws.clear();var u=[];l.forEach((function(t){var e=(new he).fromString(t.d),i={};wr.forEach((function(e){t[e]&&(i[Sr[e]]=t[e])})),u.push({path:e,attribute:i}),Ws.union(e.bounds)}));var h=Ws.width(),d=Ws.height(),c=1/e.max(h,d);return u.forEach((function(t){return t.path.transform(0,0,c,c)})),this._parsedPath=new zs(a,u,!0),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}var f=(new he).fromString(a),v=f.bounds.width(),p=f.bounds.height(),g=1/e.max(v,p);return f.transform(0,0,g,g),this._parsedPath=new zs(a,f),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=Vi(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Ie.graphicService.updateSymbolAABBBounds(i,Vi(this).symbol,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=fn(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Vi(this).symbol[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,Fs)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,Fs)}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),i=this.attribute.size,n=e.isArray(i)?i:[i,i];return t.path?(new he).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new he).fromString(t.pathStr,0,0,n[0],n[1])}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(Hn);Gs.userSymbolMap={},Gs.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},zn);var Ys=["segments","points","curveType"].concat(m(In)),Xs=function(t){u(i,t);var e=g(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,i),(t=e.call(this,n)).type="line",t.numberType=vr,t}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,i=t.segments;return i?0!==i.length:!(!e||e.length<=1)}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=bn(i,n,e))}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updateLineAABBBounds(e,Vi(this).line,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Vi(this).line[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Ys)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Ys)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new he,i=t.segments,n=function(t){if(t&&t.length){var i=!0;t.forEach((function(t){!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((function(t){n(t.points)})):t.points&&n(t.points),e}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(Hn);Xs.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},zn);var $s=["width","x1","y1","height","cornerRadius"].concat(m(In)),qs=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="rect",n.numberType=br,n}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){return!0}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updateRectAABBBounds(e,Vi(this).rect,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Vi(this).rect[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,$s)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,$s)}},{key:"toCustomPath",value:function(){throw new Error("暂不支持")}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(Hn);qs.NOWORK_ANIMATE_ATTR=zn;var Ks=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]],Zs=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="rect3d",e.numberType=mr,e}return o(n,[{key:"findFace",value:function(){for(var t={polygons:[],vertices:[],edges:[]},i=Vi(this).rect3d,n=this.attribute,r=n.width,a=void 0===r?i.width:r,s=n.height,o=void 0===s?i.width:s,l=n.length,u=void 0===l?e.min(i.width,i.height):l,h=0;h<Ks.length;h++){var d=Ks[h];t.vertices.push([d[0]*a,d[1]*o,d[2]*u])}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}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(qs);Zs.NOWORK_ANIMATE_ATTR=zn;var Js=function(){function t(e,i,n,r,s,o,l,u,h,d,c,f,v,p){a(this,t),this.left=e,this.top=i,this.width=n,this.height=r,this.actualHeight=0,this.bottom=i+r,this.right=e+n,this.ellipsis=s,this.wordBreak=o,this.verticalDirection=l,this.lines=[],this.globalAlign=u,this.globalBaseline=h,this.layoutDirection=d,this.directionKey=je[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=f,this.singleLine=v,p?(p.clear(),this.icons=p):this.icons=new Map}return o(t,[{key:"draw",value:function(t,e){var i=this.getActualSize(),n=i.width,r=i.height,a=this.isWidthMax?Math.min(this.width,n):this.width||n||0,s=this.isHeightMax?Math.min(this.height,r):this.height||r||0;s=Math.min(s,r);var o=0;switch(this.globalBaseline){case"top":o=0;break;case"middle":o=-s/2;break;case"bottom":o=-s}var l=0;switch(this.globalAlign){case"left":l=0;break;case"center":l=-a/2;break;case"right":l=-a}var u=this[this.directionKey.height];this.singleLine&&(u=this.lines[0].height+1);var h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=u&&0!==u)for(var d=0;d<this.lines.length;d++){var c=this.lines[d],f=c.top,v=c.height;if(f+v<this[this.directionKey.top]||f+v>this[this.directionKey.top]+u)return h;var p=!1;this.ellipsis&&this.lines[d+1]&&this.lines[d+1].top+this.lines[d+1].height>this[this.directionKey.top]+u&&(p=!0,h=!0),this.lines[d].draw(t,p,this.lines[d][this.directionKey.left]+l,this.lines[d][this.directionKey.top]+o,e)}else{var g=Math.floor((u-this.actualHeight)/2);"vertical"===this.layoutDirection?l+=g:o+=g;for(var y=0;y<this.lines.length;y++)this.lines[y].draw(t,!1,this.lines[y][this.directionKey.left]+l,this.lines[y][this.directionKey.top]+o,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(var b=0;b<this.lines.length;b++){var m=this.lines[b];m.top;var x=m.height,_=u-this.lines[b].top-this.lines[b].height;if(0===u)this.lines[b].draw(t,!1,l,_+o,e);else{if(_+x>this[this.directionKey.top]+u||_<this[this.directionKey.top])return h;var A=!1;this.ellipsis&&this.lines[b+1]&&_-this.lines[b+1].height<this[this.directionKey.top]&&(A=!0,h=!0),this.lines[b].draw(t,A,l,_+o,e)}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(var k=0;k<this.lines.length;k++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(l-=this.lines[k].height+this.lines[k].top);var B=this.lines[k],S=B.top,w=B.height;if(0===u)this.lines[k].draw(t,!1,this.lines[k][this.directionKey.left]+l,this.lines[k][this.directionKey.top]+o,e);else{if(S+w<this[this.directionKey.top]||S+w>this[this.directionKey.top]+u)return h;var T=!1;this.ellipsis&&this.lines[k+1]&&this.lines[k+1].top+this.lines[k+1].height>this[this.directionKey.top]+u&&(T=!0,h=!0),this.lines[k].draw(t,T,this.lines[k][this.directionKey.left]+l,this.lines[k][this.directionKey.top]+o,e)}}}return h}},{key:"getActualSize",value:function(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}},{key:"getRawActualSize",value:function(){for(var t=0,e=0,i=0;i<this.lines.length;i++){var n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}},{key:"getActualSizeWidthEllipsis",value:function(){var t=0,e=0,i=this.getRawActualSize();i.width;i.height;this.width,this.height;var n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(var r=0;r<this.lines.length;r++){var a=this.lines[r],s=a.top,o=a.height;if(s+o<this[this.directionKey.top]||s+o>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[r+1]&&this.lines[r+1].top+this.lines[r+1].height>this[this.directionKey.top]+n){var l=this.lines[r].getWidthWithEllips();l>t&&(t=l),e+=this.lines[r].height}else this.lines[r].actualWidth>t&&(t=this.lines[r].actualWidth),e+=this.lines[r].height}else{Math.floor((n-this.actualHeight)/2);for(var u=0;u<this.lines.length;u++)this.lines[u].actualWidth>t&&(t=this.lines[u].actualWidth),e+=this.lines[u].height}else if("bottom"===this.verticalDirection)for(var h=0;h<this.lines.length;h++){var d=this.lines[h];d.top;var c=d.height,f=n-this.lines[h].top-this.lines[h].height;if(0===n)this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height;else if(f+c>this[this.directionKey.top]+n||f<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[h+1]&&f-this.lines[h+1].height<this[this.directionKey.top]){var v=this.lines[h].getWidthWithEllips();v>t&&(t=v),e+=this.lines[h].height}else this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height}else for(var p=0;p<this.lines.length;p++){var g=this.lines[p],y=g.top,b=g.height;if(0===n)this.lines[p].actualWidth>t&&(t=this.lines[p].actualWidth),e+=this.lines[p].height;else if(y+b<this[this.directionKey.top]||y+b>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[p+1]&&this.lines[p+1].top+this.lines[p+1].height>this[this.directionKey.top]+n){var m=this.lines[p].getWidthWithEllips();m>t&&(t=m),e+=this.lines[p].height}else this.lines[p].actualWidth>t&&(t=this.lines[p].actualWidth),e+=this.lines[p].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}]),t}(),Qs=function(){function t(e,i,n){a(this,t),this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";var r=An(n.lineHeight,this.fontSize);this.lineHeight="number"==typeof r?r>this.fontSize?r:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;var s=Fe(e,n),o=s.ascent,l=s.height,u=s.descent,h=s.width,d=0,c=0,f=0;this.height>l&&(d=(this.height-l)/2,c=Math.ceil(d),f=Math.floor(d)),"top"===this.textBaseline?(this.ascent=d,this.descent=l-d):"bottom"===this.textBaseline?(this.ascent=l-d,this.descent=d):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+c,this.descent=u+f),this.length=e.length,this.width=h||0,this.text=e||"",this.newLine=i||!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)}return o(t,[{key:"updateWidth",value:function(){var t=Fe(this.text,this.character).width;this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}},{key:"draw",value:function(t,e,i,n,r){var a=this.text,s=this.left+i;e+=this.top;var o=this.direction;if(this.verticalEllipsis)a="...",o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)a+="...","right"===r&&(s-=this.ellipsisWidth);else if("replace"===this.ellipsis){var l=Ve(a,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,a.length-1);if(a=a.slice(0,l),a+="...","right"===r){var u=Fe(this.text.slice(l),this.character).width;"vertical"===o||(s-=this.ellipsisWidth-u)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,s,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(s,e),s=0,e=0),this.character.stroke&&(function(t,e){var i=e&&e.stroke||Ne;if(i){t.globalAlpha=1,t.lineWidth=e&&"number"==typeof e.lineHeight?e.lineHeight:1,t.strokeStyle=i;var n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),t.strokeText(a,s,e)),function(t,e){var i=e&&e.fill||De;if(i){t.globalAlpha=1,t.fillStyle=i;var n=e.fontSize||16;switch(e.script){case"super":case"sub":n*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:n,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),this.character.fill&&t.fillText(a,s,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(s,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(s,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(s,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(s,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}},{key:"getWidthWithEllips",value:function(t){var e=this.text,i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){var n=Ve(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,n),e+="...";var r=Fe(this.text.slice(n),this.character).width;return i+this.ellipsisWidth-r}return i}}]),t}();var to=["width","height","image"].concat(m(In)),eo=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="image",n.numberType=fr,n.loadImage(n.attribute.image),n}return o(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0},set:function(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0},set:function(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"repeatX",get:function(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}},{key:"repeatY",get:function(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}},{key:"image",get:function(){return this.attribute.image},set:function(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}},{key:"imageLoadSuccess",value:function(t,e,n){var r=this;y(h(i.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var n=this;y(h(i.prototype),"imageLoadFail",this).call(this,t,(function(){n.failCallback&&n.failCallback()}))}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updateImageAABBBounds(e,Vi(this).image,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Le[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,to)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,to)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(Hn);eo.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},zn);var io=function(t){u(n,t);var i=g(n);function n(t){var r;if(a(this,n),(r=i.call(this,t))._x=0,r._y=0,r._hovered=!1,r._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(r._hovered=!0),t.margin){var s=fn(t.margin);r._marginArray="number"==typeof s?[s,s,s,s]:s}return r.onBeforeAttributeUpdate=function(t,i,n){if(e.isArray(n)&&-1!==n.indexOf("margin")||"margin"===n)if(i.margin){var a=fn(i.margin);r._marginArray="number"==typeof a?[a,a,a,a]:a}else r._marginArray=[0,0,0,0]},p(r)}return o(n,[{key:"width",get:function(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}},{key:"height",get:function(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();var t=this.attribute,e=t.width,i=void 0===e?Le.width:e,n=t.height,r=void 0===n?Le.height:n,a=this.attribute,s=a.backgroundWidth,o=void 0===s?i:s,l=a.backgroundHeight,u=(o-i)/2,h=((void 0===l?r:l)-r)/2;return this._AABBBounds.expand([0,2*u,2*h,0]),this._AABBBounds}},{key:"setHoverState",value:function(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}]),n}(eo),no=function(){function t(e,i,n,r,s,o,l,u){var h=this;a(this,t),this.left=e,this.width=i,this.baseline=n,this.ascent=r,this.descent=s,this.top=n-r,this.paragraphs=o.map((function(t){return t})),this.textAlign=(this.paragraphs[0]instanceof io?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=l,this.directionKey=je[this.direction],this.actualWidth=0;var d=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof Qs){var i=He.exec(t.text);0!==(null==i?void 0:i.index)&&(t.text=t.text.slice(null==i?void 0:i.index),t.updateWidth())}h.actualWidth+=t[h.directionKey.width],d=Math.max(t[h.directionKey.height],d)})),this.height=d,this.blankWidth=u?0:this.width-this.actualWidth,this.calcOffset(i,u)}return o(t,[{key:"calcOffset",value:function(t,e){var i=this.directionKey,n=this.height,r=this.left,a=0;if(this.actualWidth<t&&!e)switch(this.textAlign){case"right":r=t-this.actualWidth;break;case"center":r=(t-this.actualWidth)/2;break;case"justify":this.paragraphs.length<2?r=(t-this.actualWidth)/2:a=(t-this.actualWidth)/(this.paragraphs.length-1)}this.paragraphs.map((function(t){t instanceof io?(t["_"+i.x]=r,r+=t[i.width]+a,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+a)}))}},{key:"draw",value:function(t,e,i,n,r){var a=this;if(e)for(var s=0,o=this.paragraphs.length-1;o>=0;o--){var l=this.paragraphs[o];if(l instanceof io)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var u=Fe("...",l.character).width||0;if(u<=this.blankWidth+s){l.ellipsis="add";break}if(u<=this.blankWidth+s+l.width){l.ellipsis="replace",l.ellipsisWidth=u,l.ellipsisOtherParagraphWidth=this.blankWidth+s;break}l.ellipsis="hide",s+=l.width}this.paragraphs.map((function(e,s){if(e instanceof io)return e.setAttributes({x:i+e._x,y:n+e._y}),void r(e,t,i+e._x,n+e._y,a.ascent);e.draw(t,n+a.ascent,i,0===s,a.textAlign)}))}},{key:"getWidthWithEllips",value:function(){for(var t=this,e=0,i=this.paragraphs.length-1;i>=0;i--){var n=this.paragraphs[i];if(n instanceof io)break;var r=Fe("...",n.character).width||0;if(r<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=r;break}if(r<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=r,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}var a=0;return this.paragraphs.map((function(e,i){a+=e instanceof io?e.width:e.getWidthWithEllips(t.direction)})),a}}]),t}(),ro=function(){function t(e){a(this,t),this.frame=e,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=e.layoutDirection,this.directionKey=je[this.direction]}return o(t,[{key:"store",value:function(t){if(t instanceof io){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];var e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}},{key:"send",value:function(){if(0!==this.lineBuffer.length){var t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new no(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}}},{key:"deal",value:function(t){t instanceof io?"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)))}},{key:"cut",value:function(t){var e=this[this.directionKey.width]-this.lineWidth||0,i=Math.ceil(e/t[this.directionKey.width]*t.length)||0,n=Ve(t.text,e,t.character,i,"break-word"===this.frame.wordBreak);if(0!==n){var r=function(t,e){var i=t.text.slice(0,e),n=t.text.slice(e);return[new Qs(i,t.newLine,t.character),new Qs(n,!0,t.character)]}(t,n),a=b(r,2),s=a[0],o=a[1];this.store(s),this.deal(o)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}]),t}(),ao=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection"].concat(m(In)),so=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="richtext",n._currentHoverIcon=null,n.numberType=xr,n}return o(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Oe.width},set:function(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:Oe.height},set:function(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxWidth",get:function(){return this.attribute.maxWidth},set:function(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}},{key:"maxHeight",get:function(){return this.attribute.maxHeight},set:function(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}},{key:"ellipsis",get:function(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:Oe.ellipsis},set:function(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}},{key:"wordBreak",get:function(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:Oe.wordBreak},set:function(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}},{key:"verticalDirection",get:function(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:Oe.verticalDirection},set:function(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}},{key:"textAlign",get:function(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:Oe.textAlign},set:function(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}},{key:"textBaseline",get:function(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:Oe.textBaseline},set:function(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}},{key:"textConfig",get:function(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:Oe.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updateRichTextAABBBounds(e,Vi(this).richtext,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Oe[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,ao)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,ao)}},{key:"getFrameCache",value:function(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}},{key:"doUpdateFrameCache",value:function(){for(var t,e=this,i=this.attribute,n=i.textConfig,r=void 0===n?[]:n,a=i.maxWidth,s=i.maxHeight,o=i.width,l=i.height,u=i.ellipsis,h=i.wordBreak,d=i.verticalDirection,c=i.textAlign,f=i.textBaseline,v=i.layoutDirection,p=i.singleLine,g=[],y=0;y<r.length;y++)if("image"in r[y]){var b=r[y],m=b.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(b.id);if(m)g.push(m);else{var x=new io(b);x.successCallback=function(){var t;e.addUpdateBoundTag(),null===(t=e.stage)||void 0===t||t.renderNextFrame()},x.richtextId=b.id,g.push(x)}}else if(r[y].text.includes("\n"))for(var _=r[y].text.split("\n"),A=0;A<_.length;A++)g.push(new Qs(_[A],0!==A,r[y]));else g.push(new Qs(r[y].text,!1,r[y]));for(var k="number"==typeof a&&Number.isFinite(a)&&a>0,B="number"==typeof s&&Number.isFinite(s)&&s>0,S="number"==typeof o&&Number.isFinite(o)&&o>0&&(!k||o<=a),w="number"==typeof l&&Number.isFinite(l)&&l>0&&(!B||l<=s),T=new Js(0,0,(S?o:k?a:0)||0,(w?l:B?s:0)||0,u,h,d,c,f,v||"horizontal",!S&&k,!w&&B,p||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),C=new ro(T),P=0;P<g.length;P++)C.deal(g[P]);if(C.send(),!("horizontal"===T.layoutDirection?S:w)){var M=T.getActualSizeWidthEllipsis(),E="horizontal"===T.layoutDirection?M.width:M.height;("horizontal"===T.layoutDirection?k:B)&&(E=Math.min(E,"horizontal"===T.layoutDirection?a:s)),T.lines.forEach((function(t){t.calcOffset(E,!1)}))}this._frameCache=T}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"setStage",value:function(t,e){y(h(i.prototype),"setStage",this).call(this,t,e),this.getFrameCache().icons.forEach((function(i){i.setStage(t,e)}))}},{key:"bindIconEvent",value:function(){var t=this;this.addEventListener("pointermove",(function(e){var i,n,r,a,s,o=t.pickIcon(e.global);o&&o===t._currentHoverIcon||(o?(null===(i=t._currentHoverIcon)||void 0===i||i.setHoverState(!1),t._currentHoverIcon=o,t._currentHoverIcon.setHoverState(!0),null===(n=t.stage)||void 0===n||n.setCursor(o.attribute.cursor),null===(r=t.stage)||void 0===r||r.renderNextFrame()):!o&&t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(a=t.stage)||void 0===a||a.setCursor(),null===(s=t.stage)||void 0===s||s.renderNextFrame()))})),this.addEventListener("pointerleave",(function(e){var i,n;t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(i=t.stage)||void 0===i||i.setCursor(),null===(n=t.stage)||void 0===n||n.renderNextFrame())}))}},{key:"pickIcon",value:function(t){var e,i=this.getFrameCache(),n=this.globalTransMatrix,r=n.e,a=n.f;return i.icons.forEach((function(i){var n,s;i.AABBBounds.containsPoint({x:t.x-r,y:t.y-a})&&(e=i,e.globalX=(null!==(n=e.attribute.x)&&void 0!==n?n:0)+r,e.globalY=(null!==(s=e.attribute.y)&&void 0!==s?s:0)+a)})),e}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(Hn);so.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},zn);var oo=["path","customPath"].concat(m(In)),lo=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="path",e.numberType=pr,e}return o(n,[{key:"pathShape",get:function(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}},{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.path;return null!=t&&""!==t}},{key:"getParsedPathShape",value:function(){var t=Vi(this).path;if(!this.valid)return t.path;var i=this.attribute;return i.path instanceof he?i.path:(e.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof he?this.cache:t.path)}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updatePathAABBBounds(e,Vi(this).path,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"doUpdatePathShape",value:function(){var t=this.attribute;e.isString(t.path,!0)?this.cache=(new he).fromString(t.path):t.customPath&&(this.cache=new he,t.customPath(this.cache,this))}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Vi(this).path[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,oo)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,oo)}},{key:"toCustomPath",value:function(){return(new he).fromCustomPath2D(this.getParsedPathShape(),0,0)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(Hn);lo.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},zn);var uo=["segments","points","curveType"].concat(m(In)),ho=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="area",n.numberType=ur,n}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,i=t.segments;return i?0!==i.length:!!e&&0!==e.length}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updateAreaAABBBounds(e,Vi(this).area,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=bn(i,n,e))}},{key:"getDefaultAttribute",value:function(t){return Vi(this).area[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,uo)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,uo)}},{key:"toCustomPath",value:function(){var t=new he,e=this.attribute,i=e.segments,n=function(e){if(e&&e.length){var i=!0,n=[];if(e.forEach((function(e){var r,a;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(a=e.y1)&&void 0!==a?a:e.y}),i=!1)})),n.length){for(var r=n.length-1;r>=0;r--)t.lineTo(n[r].x,n[r].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((function(t){n(t.points)})),t}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(Hn);ho.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},zn);var co=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(m(In)),fo=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="arc",e.numberType=or,e}return o(n,[{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,i=t.endAngle,n=t.outerRadius,r=t.innerRadius;return this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)&&this._validNumber(r)}},{key:"getParsedCornerRadius",value:function(){var t=Vi(this).arc,i=this.attribute,n=i.cornerRadius,r=void 0===n?t.cornerRadius:n,a=i.outerRadius,s=void 0===a?t.outerRadius:a,o=i.innerRadius,l=void 0===o?t.innerRadius:o;if(0===r||"0%"===r)return 0;var u=Math.abs(s-l);return Math.min(e.isNumber(r,!0)?r:u*parseFloat(r)/100,u/2)}},{key:"getParsedAngle",value:function(){var t=Vi(this).arc,i=this.attribute,n=i.startAngle,r=void 0===n?t.startAngle:n,a=i.endAngle,s=void 0===a?t.endAngle:a,o=this.attribute.cap,l=void 0===o?t.cap:o,u=s-r>=0?1:-1,h=s-r;if(s=(r=e.clampAngleByRadian(r))+h,l&&e.abs(h)<e.pi2-e.epsilon){var d=1,c=1;l.length&&(d=Number(l[0]),c=Number(l[1]));var f=this.attribute,v=f.outerRadius,p=void 0===v?t.outerRadius:v,g=f.innerRadius,y=void 0===g?t.innerRadius:g,b=Math.abs(p-y)/2,m=b/p;if(b>e.epsilon&&p>e.epsilon)return{startAngle:r-u*m*d,endAngle:s+u*m*c,sc:u*m*d,ec:u*m*c}}return{startAngle:r,endAngle:s}}},{key:"getParsePadAngle",value:function(t,i){var n=Vi(this).arc,r=this.attribute,a=r.outerRadius,s=void 0===a?n.outerRadius:a,o=r.innerRadius,l=void 0===o?n.innerRadius:o,u=r.padAngle,h=void 0===u?n.padAngle:u,d=this.attribute.padRadius,c=void 0===d?e.sqrt(s*s+l*l):d,f=e.abs(i-t),v=t,p=i,g=t,y=i,b=h/2,m=f,x=f;if(b>e.epsilon&&c>e.epsilon){var _=i>t?1:-1,A=e.asin(Number(c)/l*e.sin(b)),k=e.asin(Number(c)/s*e.sin(b));return(m-=2*A)>e.epsilon?(g+=A*=_,y-=A):(m=0,g=y=(t+i)/2),(x-=2*k)>e.epsilon?(v+=k*=_,p-=k):(x=0,v=p=(t+i)/2),{outerStartAngle:v,outerEndAngle:p,innerStartAngle:g,innerEndAngle:y,innerDeltaAngle:m,outerDeltaAngle:x}}return{outerStartAngle:v,outerEndAngle:p,innerStartAngle:g,innerEndAngle:y,innerDeltaAngle:m,outerDeltaAngle:x}}},{key:"doUpdateAABBBounds",value:function(t){var e=Vi(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Ie.graphicService.updateArcAABBBounds(i,Vi(this).arc,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=fn(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,co)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,co)}},{key:"getDefaultAttribute",value:function(t){return Vi(this).arc[t]}},{key:"toCustomPath",value:function(){var t=this.attribute,i=this.getParsedAngle(),n=i.startAngle,r=i.endAngle,a=t.innerRadius,s=t.outerRadius,o=e.abs(r-n),l=r>n;if(s<a){var u=s;s=a,a=u}var h=new he;if(s<=e.epsilon)h.moveTo(0,0);else if(o>=e.pi2-e.epsilon)h.moveTo(0+s*e.cos(n),0+s*e.sin(n)),h.arc(0,0,s,n,r,!l),a>e.epsilon&&(h.moveTo(0+a*e.cos(r),0+a*e.sin(r)),h.arc(0,0,a,r,n,l));else{var d=s*e.cos(n),c=s*e.sin(n),f=a*e.cos(r),v=a*e.sin(r);h.moveTo(0+d,0+c),h.arc(0,0,s,n,r,!l),h.lineTo(0+f,0+v),h.arc(0,0,a,r,n,l),h.closePath()}return h}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(Hn);fo.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},zn),Object.assign({cap:1},zn);var vo=["points","cornerRadius"].concat(m(In)),po=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="polygon",n.numberType=gr,n}return o(i,[{key:"isValid",value:function(){return y(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.points;return t&&t.length>=2}},{key:"doUpdateAABBBounds",value:function(){var t=Vi(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Ie.graphicService.updatePolygonAABBBounds(e,Vi(this).polygon,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=fn(r);return a&&i.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,i,n,r){"points"===t&&(r.points=bn(i,n,e))}},{key:"getDefaultAttribute",value:function(t){return Vi(this).polygon[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,vo)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,vo)}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new he;return t.forEach((function(t,i){0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(Hn);po.NOWORK_ANIMATE_ATTR=zn;var go=function(){function t(){a(this,t)}return o(t,[{key:"updateBounds",value:function(t,e,i,n){var r=t.outerBorder,a=t.shadowBlur,s=void 0===a?e.shadowBlur:a;if(r){var o=e.outerBorder,l=r.distance,u=void 0===l?o.distance:l,h=r.lineWidth,d=void 0===h?o.lineWidth:h;i.expand(u+(s+d)/2)}return i}}]),t}(),yo=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"updateBounds",value:function(t,e,i,n){var r=t.outerBorder,a=t.shadowBlur,s=void 0===a?e.shadowBlur:a,o=t.strokeBoundsBuffer,l=void 0===o?e.strokeBoundsBuffer:o;if(r){var u=e.outerBorder,h=r.distance,d=void 0===h?u.distance:h,c=r.lineWidth;Jn(i,d+(s+(void 0===c?u.lineWidth:c))/2,!0,l)}return i}}]),i}(go);var bo=function(){function t(){a(this,t),this.pools=[]}return o(t,[{key:"allocate",value:function(t,i,n,r,a,s){if(!this.pools.length)return new e.Matrix(t,i,n,r,a,s);var o=this.pools.pop();return o.a=t,o.b=i,o.c=n,o.d=r,o.e=a,o.f=s,o}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new e.Matrix(t.a,t.b,t.c,t.d,t.e,t.f);var i=this.pools.pop();return i.a=t.a,i.b=t.b,i.c=t.c,i.d=t.d,i.e=t.e,i.f=t.f,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),mo=function(){function t(){a(this,t),this.pools=[]}return o(t,[{key:"allocate",value:function(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var e=this.pools.pop();return t.identity(e),e}},{key:"allocateByObj",value:function(t){var 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(var i=0;i<e.length;i++)e[i]=t[i];return e}},{key:"free",value:function(t){t&&this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}],[{key:"identity",value:function(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}}]),t}(),xo=new bo,_o=new mo,Ao=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ko=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bo=function(t,e){return function(i,n){e(i,n,t)}};function So(t,e,i){var n,r,a,s,o,l,u,h,d,c,f,v,p=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*p+e[4]*g+e[8]*y+e[12],t[13]=e[1]*p+e[5]*g+e[9]*y+e[13],t[14]=e[2]*p+e[6]*g+e[10]*y+e[14],t[15]=e[3]*p+e[7]*g+e[11]*y+e[15]):(n=e[0],r=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],c=e[9],f=e[10],v=e[11],t[0]=n,t[1]=r,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=u,t[7]=h,t[8]=d,t[9]=c,t[10]=f,t[11]=v,t[12]=n*p+o*g+d*y+e[12],t[13]=r*p+l*g+c*y+e[13],t[14]=a*p+u*g+f*y+e[14],t[15]=s*p+h*g+v*y+e[15]),t}function wo(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 To(t,e,i){var n=e[0],r=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],c=e[9],f=e[10],v=e[11],p=e[12],g=e[13],y=e[14],b=e[15],m=i[0],x=i[1],_=i[2],A=i[3];return t[0]=m*n+x*o+_*d+A*p,t[1]=m*r+x*l+_*c+A*g,t[2]=m*a+x*u+_*f+A*y,t[3]=m*s+x*h+_*v+A*b,m=i[4],x=i[5],_=i[6],A=i[7],t[4]=m*n+x*o+_*d+A*p,t[5]=m*r+x*l+_*c+A*g,t[6]=m*a+x*u+_*f+A*y,t[7]=m*s+x*h+_*v+A*b,m=i[8],x=i[9],_=i[10],A=i[11],t[8]=m*n+x*o+_*d+A*p,t[9]=m*r+x*l+_*c+A*g,t[10]=m*a+x*u+_*f+A*y,t[11]=m*s+x*h+_*v+A*b,m=i[12],x=i[13],_=i[14],A=i[15],t[12]=m*n+x*o+_*d+A*p,t[13]=m*r+x*l+_*c+A*g,t[14]=m*a+x*u+_*f+A*y,t[15]=m*s+x*h+_*v+A*b,t}function Co(t,e,i){var n,r=e.attribute,a=r.x,s=void 0===a?i.x:a,o=r.y,l=void 0===o?i.y:o,u=r.z,h=void 0===u?i.z:u,d=r.dx,c=void 0===d?i.dx:d,f=r.dy,v=void 0===f?i.dy:f,p=r.dz,g=void 0===p?i.dz:p,y=r.scaleX,b=void 0===y?i.scaleX:y,m=r.scaleY,x=void 0===m?i.scaleY:m,_=r.scaleZ,A=void 0===_?i.scaleZ:_,k=r.alpha,B=void 0===k?i.alpha:k,S=r.beta,w=void 0===S?i.beta:S,T=r.angle,C=void 0===T?i.angle:T,P=r.anchor3d,M=void 0===P?e.attribute.anchor:P,E=r.anchor,O=[0,0,0];if(M){if("string"==typeof M[0]){var L=parseFloat(M[0])/100,R=e.AABBBounds;O[0]=R.x1+(R.x2-R.x1)*L}else O[0]=M[0];if("string"==typeof M[1]){var I=parseFloat(M[1])/100,j=e.AABBBounds;O[1]=j.x1+(j.x2-j.x1)*I}else O[1]=M[1];O[2]=null!==(n=M[2])&&void 0!==n?n: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),So(t,t,[s+c,l+v,h+g]),So(t,t,[O[0],O[1],O[2]]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],h=e[9],d=e[10],c=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]=a*r+u*n,t[5]=s*r+h*n,t[6]=o*r+d*n,t[7]=l*r+c*n,t[8]=u*r-a*n,t[9]=h*r-s*n,t[10]=d*r-o*n,t[11]=c*r-l*n}(t,t,w),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],s=e[1],o=e[2],l=e[3],u=e[8],h=e[9],d=e[10],c=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]=a*r-u*n,t[1]=s*r-h*n,t[2]=o*r-d*n,t[3]=l*r-c*n,t[8]=a*n+u*r,t[9]=s*n+h*r,t[10]=o*n+d*r,t[11]=l*n+c*r}(t,t,B),So(t,t,[-O[0],-O[1],O[2]]),function(t,e,i){var n=i[0],r=i[1],a=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[b,x,A]),C){var D=_o.allocate(),N=[0,0];if(E){if("string"==typeof M[0]){var U=parseFloat(M[0])/100,z=e.AABBBounds;N[0]=z.x1+(z.x2-z.x1)*U}else N[0]=M[0];if("string"==typeof M[1]){var H=parseFloat(M[1])/100,V=e.AABBBounds;N[1]=V.x1+(V.x2-V.x1)*H}else N[1]=M[1]}So(D,D,[N[0],N[1],0]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],s=e[1],o=e[2],l=e[3],u=e[4],h=e[5],d=e[6],c=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]=a*r+u*n,t[1]=s*r+h*n,t[2]=o*r+d*n,t[3]=l*r+c*n,t[4]=u*r-a*n,t[5]=h*r-s*n,t[6]=d*r-o*n,t[7]=c*r-l*n}(D,D,C),So(D,D,[-N[0],-N[1],0]),To(t,t,D)}}var Po=function(){function t(i){a(this,t),this.creator=i,this.hooks={onAttributeUpdate:new nt(["graphic"]),onSetStage:new nt(["graphic","stage"]),onRemove:new nt(["graphic"]),onRelease:new nt(["graphic"]),onAddIncremental:new nt(["graphic","group","stage"]),onClearIncremental:new nt(["graphic","group","stage"]),beforeUpdateAABBBounds:new nt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new nt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new e.AABBBounds,this.tempAABBBounds2=new e.AABBBounds,this._rectBoundsContribitions=[new go],this._symbolBoundsContribitions=[new yo],this._circleBoundsContribitions=[new go],this._arcBoundsContribitions=[new go],this._pathBoundsContribitions=[new go]}return o(t,[{key:"onAttributeUpdate",value:function(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}},{key:"onSetStage",value:function(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}},{key:"onRemove",value:function(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}},{key:"onRelease",value:function(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}},{key:"onAddIncremental",value:function(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}},{key:"afterUpdateAABBBounds",value:function(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;var n=new wt(t);return Rt(i.commandList,n,0,0),!0}},{key:"updateRectAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){var r=t.width,a=t.height,s=t.x1,o=t.y1,l=t.x,u=t.y;r=null!=r?r:s-l,a=null!=a?a:o-u,i.set(0,0,r||0,a||0)}var h=this.tempAABBBounds1,d=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),d.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((function(r){r.updateBounds(t,e,h,n),i.union(h),h.setValue(d.x1,d.y1,d.x2,d.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateGroupAABBBounds",value:function(t,e,i,n){var r=t.width,a=t.height,s=t.path,o=t.clip,l=void 0===o?e.clip:o;s&&s.length?s.forEach((function(t){i.union(t.AABBBounds)})):null!=r&&null!=a&&i.set(0,0,r,a),l||n.forEachChildren((function(t){i.union(t.AABBBounds)}));var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateGlyphAABBBounds",value:function(t,e,i,n){return this._validCheck(t,e,i,n)?(n.getSubGraphic().forEach((function(t){i.union(t.AABBBounds)})),i):i}},{key:"updateRichTextAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;var r=t.width,a=void 0===r?e.width:r,s=t.height,o=void 0===s?e.height:s,l=t.maxWidth,u=void 0===l?e.maxWidth:l,h=t.maxHeight,d=void 0===h?e.maxHeight:h,c=t.textAlign,f=void 0===c?e.textAlign:c,v=t.textBaseline,p=void 0===v?e.textBaseline:v;if(a>0&&o>0)i.set(0,0,a,o);else{var g=n.getFrameCache().getActualSize(),y=g.width,b=g.height,m=a||y||0,x=o||b||0;x="number"==typeof d&&x>d?d:x||0,m="number"==typeof u&&m>u?u:m||0,i.set(0,0,m,x)}var _=0;switch(p){case"top":_=0;break;case"middle":_=-i.height()/2;break;case"bottom":_=-i.height()}var A=0;switch(f){case"left":A=0;break;case"center":A=-i.width()/2;break;case"right":A=-i.width()}i.translate(A,_);var k=this.tempAABBBounds1,B=this.tempAABBBounds2;return k.setValue(i.x1,i.y1,i.x2,i.y2),B.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateTextAABBBounds",value:function(t,i,n,r){if(!this._validCheck(t,i,n,r))return n;if(!r)return n;var a=r.attribute.text,s=void 0===a?i.text:a;Array.isArray(s)?r.updateMultilineAABBBounds(s):r.updateSingallineAABBBounds(s);var o=this.tempAABBBounds1,l=this.tempAABBBounds2;o.setValue(n.x1,n.y1,n.x2,n.y2),l.setValue(n.x1,n.y1,n.x2,n.y2);var u=t.scaleX,h=void 0===u?i.scaleX:u,d=t.scaleY,c=void 0===d?i.scaleY:d,f=t.shadowBlur,v=void 0===f?i.shadowBlur:f,p=t.strokeBoundsBuffer,g=void 0===p?i.strokeBoundsBuffer:p;v&&(Jn(o,v/Math.abs(h+c),!0,g),n.union(o));return this.combindShadowAABBBounds(n,r),e.transformBoundsWithMatrix(n,n,r.transMatrix),n}},{key:"updatePathAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((function(s){s.updateBounds(t,e,r,n),i.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)}));var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updatePathAABBBoundsImprecise",value:function(t,e,i,n){if(!n)return i;var r=n.getParsedPathShape();return i.union(r.getBounds()),i}},{key:"updatePyramid3dAABBBounds",value:function(t,e,i,n){if(!n)return i;var r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((function(t){var e=t[0],n=t[1];i.add(e,n)}));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateArc3dAABBBounds",value:function(t,e,i,n){if(!n)return i;var r=n.stage;if(!r||!r.camera)return i;var a=t.outerRadius,s=void 0===a?e.outerRadius:a,o=t.height,l=s+(void 0===o?0:o);i.setValue(-l,-l,l,l);var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updatePolygonAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,i,n){var r=t.points;return(void 0===r?e.points:r).forEach((function(t){i.add(t.x,t.y)})),i}},{key:"updateLineAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,s=i;return a.forEach((function(t){s.add(t.x,t.y)})),s}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,s=i;return a.forEach((function(t){t.points.forEach((function(t){s.add(t.x,t.y)}))})),s}},{key:"updateAreaAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,s=i;return a.forEach((function(t){var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,s=i;return a.forEach((function(t){t.points.forEach((function(t){var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}},{key:"updateCircleAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,i,n){var r=t.radius,a=void 0===r?e.radius:r;return i.set(-a,-a,a,a),i}},{key:"updateCircleAABBBoundsAccurate",value:function(t,i,n,r){var a=t.startAngle,s=void 0===a?i.startAngle:a,o=t.endAngle,l=void 0===o?i.endAngle:o,u=t.radius,h=void 0===u?i.radius:u;return l-s>e.pi2-e.epsilon?n.set(-h,-h,h,h):gn(s,l,h,n),n}},{key:"updateArcAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)}));var o=t.lineJoin,l=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,i,e,"miter"===l,r),i}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,i,n){var r=t.outerRadius,a=void 0===r?e.outerRadius:r;return i.set(-a,-a,a,a),i}},{key:"updateArcAABBBoundsAccurate",value:function(t,i,n,r){var a=t.outerRadius,s=void 0===a?i.outerRadius:a,o=t.innerRadius,l=void 0===o?i.innerRadius:o;if(s<l){var u=s;s=l,l=u}var h=t.endAngle,d=void 0===h?i.endAngle:h,c=t.startAngle,f=void 0===c?i.startAngle:c;if(f>d){var v=f;f=d,d=v}return s<=e.epsilon?n.set(0,0,0,0):Math.abs(d-f)>e.pi2-e.epsilon?n.set(-s,-s,s,s):(gn(f,d,s,n),gn(f,d,l,n)),n}},{key:"updateSymbolAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)}));var o=t.lineJoin,l=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,i,e,"miter"===l,r),i}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,i,n,r){var a=t.size,s=void 0===a?i.size:a;if(e.isArray(s))n.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{var o=s/2;n.set(-o,-o,o,o)}return n}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,i,n){if(!n)return i;var r=t.size,a=void 0===r?e.size:r;return n.getParsedPath().bounds(a,i),i}},{key:"updateImageAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){var r=t.width,a=void 0===r?e.width:r,s=t.height,o=void 0===s?e.height:s;i.set(0,0,a,o)}var l=this.tempAABBBounds1,u=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),u.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var i=e.shadowRoot.AABBBounds;t.union(i)}}},{key:"transformAABBBounds",value:function(t,i,n,r,a){var s=t.scaleX,o=void 0===s?n.scaleX:s,l=t.scaleY,u=void 0===l?n.scaleY:l,h=t.stroke,d=void 0===h?n.stroke:h,c=t.shadowBlur,f=void 0===c?n.shadowBlur:c,v=t.lineWidth,p=void 0===v?n.lineWidth:v,g=t.strokeBoundsBuffer,y=void 0===g?n.strokeBoundsBuffer:g,b=this.tempAABBBounds1,m=this.tempAABBBounds2;d&&p&&(Jn(b,p/Math.abs(o+u),r,y),i.union(b),b.setValue(m.x1,m.y1,m.x2,m.y2));if(f){var x=t.shadowOffsetX,_=void 0===x?n.shadowOffsetX:x,A=t.shadowOffsetY,k=void 0===A?n.shadowOffsetY:A;Jn(b,f/Math.abs(o+u)*2+Math.max(_,k),r,y+1),i.union(b)}this.combindShadowAABBBounds(i,a);var B=!0,S=a.transMatrix;a&&a.isContainer&&(B=!(1===S.a&&0===S.b&&0===S.c&&1===S.d&&0===S.e&&0===S.f)),B&&e.transformBoundsWithMatrix(i,i,S)}},{key:"_validCheck",value:function(t,e,i,n){if(!n)return!0;if(!n.valid)return i.clear(),!1;var r=t.visible;return!!(void 0===r?e.visible:r)||(i.clear(),!1)}}]),t}();Po=Ao([D(),Bo(0,I(Br)),ko("design:paramtypes",[Object])],Po);var Mo=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this,{x:0,y:0})).type="shadowroot",n.shadowHost=t,n}return o(i,[{key:"addUpdateBoundTag",value:function(){y(h(i.prototype),"addUpdateBoundTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"addUpdateShapeAndBoundsTag",value:function(){y(h(i.prototype),"addUpdateShapeAndBoundsTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){var 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}},{key:"doUpdateGlobalMatrix",value:function(){if(this.shadowHost){var t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){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}}]),i}(Tr);function Eo(t){return new ca(t)}function Oo(t){return new Tr(t)}function Lo(t){return new Xs(t)}function Ro(t){return new lo(t)}function Io(t){return new qs(t)}function jo(t){return new ya(t)}function Do(t){return new Gs(t)}function No(t){return new eo(t)}function Uo(t){return new po(t)}function zo(t){return new so(t)}var Ho={arc:function(t){return new fo(t)},area:function(t){return new ho(t)},circle:Eo,group:Oo,image:No,line:Lo,path:Ro,rect:Io,rect3d:function(t){return new Zs(t)},symbol:Do,text:jo,richtext:zo,polygon:Uo,shadowRoot:function(t){return new Mo(t)},wrapText:function(t){return new ma(t)}},Vo=jo({text:""});function Wo(t){return Vo.setAttributes(t),Vo.AABBBounds}zo({});var Fo={x:0,y:0,z:0,lastModelMatrix:null},Go=function(){function t(){a(this,t)}return o(t,[{key:"init",value:function(t){var e=this;t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((function(t){return e._renderContribitions.push(t)})),this._renderContribitions.length&&(this._renderContribitions.sort((function(t,e){return e.order-t.order})),this._beforeRenderContribitions=this._renderContribitions.filter((function(t){return t.time===Bt.beforeFillStroke})),this._afterRenderContribitions=this._renderContribitions.filter((function(t){return t.time===Bt.afterFillStroke})))}},{key:"beforeRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}},{key:"afterRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}},{key:"valid",value:function(t,e,i,n){var r=t.attribute,a=r.fill,s=void 0===a?e.fill:a,o=r.background,l=r.stroke,u=void 0===l?e.stroke:l,h=r.opacity,d=void 0===h?e.opacity:h,c=r.fillOpacity,f=void 0===c?e.fillOpacity:c,v=r.lineWidth,p=void 0===v?e.lineWidth:v,g=r.strokeOpacity,y=void 0===g?e.strokeOpacity:g,b=r.visible,m=void 0===b?e.visible:b,x=Xr(d,f,s),_=qr(d,y),A=Gr(s,o),k=Yr(u,p);return!(!t.valid||!m)&&!(!A&&!k)&&!!(x||_||i||n||o)&&{fVisible:x,sVisible:_,doFill:A,doStroke:k}}},{key:"transform",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.attribute,a=r.x,s=void 0===a?e.x:a,o=r.y,l=void 0===o?e.y:o,u=r.z,h=void 0===u?e.z:u,d=r.scaleX,c=void 0===d?e.scaleX:d,f=r.scaleY,v=void 0===f?e.scaleY:f,p=r.angle,g=void 0===p?e.angle:p,y=r.postMatrix,b=i.modelMatrix,m=i.camera;Fo.x=s,Fo.y=l,Fo.z=h,Fo.lastModelMatrix=b;var x=m&&(n||function(t){var e=t.attribute,i=e.alpha,n=e.beta;return i||n}(t)),_=x?t.transMatrix.onlyTranslate()&&!y:1===c&&1===v&&0===g&&!y;if(x){var A=_o.allocate(),k=_o.allocate();Co(k,t,e),To(A,b||A,k),Fo.x=0,Fo.y=0,Fo.z=0,i.modelMatrix=A,i.setTransform(1,0,0,1,0,0,!0),_o.free(k)}if(_&&!b){var B=t.getOffsetXY(e);Fo.x+=B.x,Fo.y+=B.y,Fo.z=h,i.setTransformForCurrent()}else if(x)Fo.x=0,Fo.y=0,Fo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(m&&i.project){var S=t.getOffsetXY(e);Fo.x+=S.x,Fo.y+=S.y,this.transformWithoutTranslate(i,Fo.x,Fo.y,Fo.z,c,v,g)}else i.transformFromMatrix(t.transMatrix,!0),Fo.x=0,Fo.y=0,Fo.z=0;return Fo}},{key:"transformUseContext2d",value:function(t,e,i,n){var r=n.camera;if(this.camera=r,r){var a=t.AABBBounds,s=a.x2-a.x1,o=a.y2-a.y1,l=n.project(0,0,i),u=n.project(s,0,i),h=n.project(s,o,i),d={x:0,y:0},c={x:s,y:0},f={x:s,y:o};n.camera=null;var v=1/(d.x*(f.y-c.y)-c.x*f.y+f.x*c.y+(c.x-f.x)*d.y),p=-(d.y*(h.x-u.x)-c.y*h.x+f.y*u.x+(c.y-f.y)*l.x)*v,g=(c.y*h.y+d.y*(u.y-h.y)-f.y*u.y+(f.y-c.y)*l.y)*v,y=(d.x*(h.x-u.x)-c.x*h.x+f.x*u.x+(c.x-f.x)*l.x)*v,b=-(c.x*h.y+d.x*(u.y-h.y)-f.x*u.y+(f.x-c.x)*l.y)*v,m=(d.x*(f.y*u.x-c.y*h.x)+d.y*(c.x*h.x-f.x*u.x)+(f.x*c.y-c.x*f.y)*l.x)*v,x=(d.x*(f.y*u.y-c.y*h.y)+d.y*(c.x*h.y-f.x*u.y)+(f.x*c.y-c.x*f.y)*l.y)*v;n.setTransform(p,g,y,b,m,x,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,i,n){this.camera&&(n.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,i,n,r,a,s){var o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,a,!1),t.rotate(s,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}},{key:"_draw",value:function(t,e,i,n,r){var a=n.context;if(a){a.highPerformanceSave();var s=this.transform(t,e,a,i),o=s.x,l=s.y,u=s.z,h=s.lastModelMatrix;this.z=u,function(t,e,i,n,r,a,s,o){if(!t.pathProxy)return!1;var l=Vi(t,null==a?void 0:a.theme)[t.type],u=t.attribute,h=u.fill,d=void 0===h?l.fill:h,c=u.stroke,f=void 0===c?l.stroke:c,v=u.opacity,p=void 0===v?l.opacity:v,g=u.fillOpacity,y=void 0===g?l.fillOpacity:g,b=u.lineWidth,m=void 0===b?l.lineWidth:b,x=u.strokeOpacity,_=void 0===x?l.strokeOpacity:x,A=u.visible,k=void 0===A?l.visible:A,B=Xr(p,y,d),S=qr(p,_),w=Gr(d),T=Yr(f,m);return!k||!w&&!T||!(B||S||s||o)||(e.beginPath(),Rt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),T&&(o?o(e,t.attribute,l):S&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),w&&(s?s(e,t.attribute,l):B&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fill())),!0)}(t,a,o,l,0,r)||(this.drawShape(t,a,o,l,n,r),this.z=0,a.modelMatrix!==h&&_o.free(a.modelMatrix),a.modelMatrix=h),a.highPerformanceRestore()}}}]),t}();function Yo(t,e,i){var n=e,r=t.currentMatrix,a=r.a,s=r.b,o=r.c,l=r.d,u=Math.sign(a)*Math.sqrt(a*a+s*s),h=Math.sign(l)*Math.sqrt(o*o+l*l);return u+h===0?0:n=n/Math.abs(u+h)*2*i}function Xo(t,i,n,r,a){if(!i||!0===i)return"black";var s,o;if(e.isArray(i))for(var l=0;l<i.length&&!(o=i[l]);l++);else o=i;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i){var n,r,a,s,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=i.AABBBounds;if(!u)return;var h=u.x2-u.x1,d=u.y2-u.y1,c=u.x1-o,f=u.y1-l;if(i.attribute){var v=i.attribute,p=v.scaleX,g=void 0===p?1:p,y=v.scaleY,b=void 0===y?1:y;if(g*b==0)return;h/=g,d/=b,c/=g,f/=b}var m=t.createLinearGradient(c+(null!==(n=e.x0)&&void 0!==n?n:0)*h,f+(null!==(r=e.y0)&&void 0!==r?r:0)*d,c+(null!==(a=e.x1)&&void 0!==a?a:1)*h,f+(null!==(s=e.y1)&&void 0!==s?s:0)*d);return e.stops.forEach((function(t){m.addColorStop(t.offset,t.color)})),m}(t,o,n,r,a):"conical"===o.gradient?s=function(t,e,i){var n,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=i.AABBBounds;if(!o)return;var l=o.x2-o.x1,u=o.y2-o.y1,h=o.x1-a,d=o.y1-s;if(i.attribute){var c=i.attribute,f=c.scaleX,v=void 0===f?1:f,p=c.scaleY,g=void 0===p?1:p;if(v*g==0)return;l/=v,u/=g,h/=v,d/=g}var y=t.createConicGradient(h+(null!==(n=e.x)&&void 0!==n?n:0)*l,d+(null!==(r=e.y)&&void 0!==r?r:0)*u,e.startAngle,e.endAngle);return e.stops.forEach((function(t){y.addColorStop(t.offset,t.color)})),y.GetPattern(l+h,u+d,void 0)}(t,o,n,r,a):"radial"===o.gradient&&(s=function(t,e,i){var n,r,a,s,o,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,d=i.AABBBounds;if(!d)return;var c=d.x2-d.x1,f=d.y2-d.y1,v=d.x1-u,p=d.y1-h;if(i.attribute){var g=i.attribute,y=g.scaleX,b=void 0===y?1:y,m=g.scaleY,x=void 0===m?1:m;if(b*x==0)return;v/=b,p/=x,c/=b,f/=x}var _=t.createRadialGradient(v+(null!==(n=e.x0)&&void 0!==n?n:.5)*c,p+(null!==(r=e.y0)&&void 0!==r?r:.5)*f,Math.max(c,f)*(null!==(a=e.r0)&&void 0!==a?a:0),v+(null!==(s=e.x1)&&void 0!==s?s:.5)*c,p+(null!==(o=e.y1)&&void 0!==o?o:.5)*f,Math.max(c,f)*(null!==(l=e.r1)&&void 0!==l?l:.5));return e.stops.forEach((function(t){_.addColorStop(t.offset,t.color)})),_}(t,o,n,r,a)),s||"orange")}var $o=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ko=function(t,e){return function(i,n){e(i,n,t)}},Zo=function(){function t(){a(this,t),this.time=Bt.beforeFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute,v=f.background,p=f.backgroundMode,g=void 0===p?l.backgroundMode:p;if(v)if(t.backgroundImg&&t.resources){var y=t.resources.get(v);if("success"!==y.state||!y.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var b=Vi(t.parent).group,m=t.parent.attribute,x=m.scrollX,_=void 0===x?b.scrollX:x,A=m.scrollY,k=void 0===A?b.scrollY:A;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(_,k)}e.clip();var B=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,y.data,B,g),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=v,e.fill(),e.highPerformanceRestore()}},{key:"doDrawImage",value:function(t,e,i,n){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{var r=t.createPattern(e,n);t.fillStyle=r,t.translate(i.x1,i.y1),t.fillRect(0,0,i.width(),i.height()),t.translate(-i.x1,-i.y1)}}}]),t}(),Jo=new Zo,Qo=function(){function t(e){a(this,t),this.subRenderContribitions=e,this.time=Bt.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((function(f){f.render(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}}]),t}();Qo=$o([D(),Ko(0,I(tt)),Ko(0,N(ha)),qo("design:paramtypes",[Object])],Qo);var tl=function(){function t(){a(this,t),this.time=Bt.afterFillStroke,this.useStyle=!0,this.order=10}return o(t,[{key:"createCommonPattern",value:function(t,e,i,n,r){var a=(t-2*e)/2,s=n.dpr,o=Pi.allocate({width:t,height:t,dpr:s}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(a,l);var u=n.createPattern(o.nativeCanvas,"repeat");return u.setTransform&&u.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),Pi.free(o),u}},{key:"createCirclePattern",value:function(t,i,n,r){return this.createCommonPattern(t,i,n,r,(function(t,i){i.fillStyle=n,i.arc(t,t,t,0,e.pi2),i.fill()}))}},{key:"createDiamondPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){var r=t/2,a=r;n.fillStyle=i,n.moveTo(r,a-e),n.lineTo(e+r,a),n.lineTo(r,a+e),n.lineTo(r-e,a),n.closePath(),n.fill()}))}},{key:"createRectPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(a,0,2*n,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(0,a,t,2*n)}))}},{key:"createBiasLRLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);var r=t/2,a=-r;n.moveTo(r,a),n.lineTo(r+t,a+t),n.moveTo(-r,-a),n.lineTo(-r+t,-a+t),n.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);var r=t/2,a=r;n.moveTo(t+r,a),n.lineTo(r,a+t),n.moveTo(t-r,-a),n.lineTo(-r,-a+t),n.stroke()}))}},{key:"createGridPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,t,t),n.fillRect(r+t,a+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this.textureMap||this.initTextureMap(e,t.stage);var f=t.attribute,v=f.texture,p=void 0===v?l.texture:v,g=f.textureColor,y=void 0===g?l.textureColor:g,b=f.textureSize,m=void 0===b?l.textureSize:b,x=f.texturePadding,_=void 0===x?l.texturePadding:x;if(p){var A=this.textureMap.get(p);if(!A)switch(p){case"circle":A=this.createCirclePattern(m,_,y,e);break;case"diamond":A=this.createDiamondPattern(m,_,y,e);break;case"rect":A=this.createRectPattern(m,_,y,e);break;case"vertical-line":A=this.createVerticalLinePattern(m,_,y,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(m,_,y,e);break;case"bias-lr":A=this.createBiasLRLinePattern(m,_,y,e);break;case"bias-rl":A=this.createBiasRLLinePattern(m,_,y,e);break;case"grid":A=this.createGridPattern(m,_,y,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}}}]),t}(),el=new tl,il=new(function(){function t(){a(this,t),this.time=Bt.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.outerBorder,v=c.innerBorder,p=f&&!1!==f.visible,g=v&&!1!==v.visible;if(p||g){var y=t.attribute,b=y.innerRadius,m=void 0===b?l.innerRadius:b,x=y.outerRadius,_=void 0===x?l.outerRadius:x,A=y.startAngle,k=void 0===A?l.startAngle:A,B=y.endAngle,S=void 0===B?l.endAngle:B,w=y.opacity,T=void 0===w?l.opacity:w,C=y.x,P=void 0===C?l.x:C,M=y.y,E=void 0===M?l.y:M,O=y.scaleX,L=void 0===O?l.scaleX:O,R=y.scaleY,I=void 0===R?l.scaleY:R,j=!(!f||!f.stroke),D=!(!v||!v.stroke);if(p){var N=f.distance,U=void 0===N?l.outerBorder.distance:N,z=Yo(e,U,e.dpr),H=U/_;if(t.setAttributes({outerRadius:_+z,innerRadius:m-z,startAngle:k-H,endAngle:S+H}),e.beginPath(),Qr(t,e,i,n,_+z,m-z),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,f,l.outerBorder);else if(j){var V=l.outerBorder.opacity;l.outerBorder.opacity=T,e.setStrokeStyle(t,f,(P-i)/L,(E-n)/I,l.outerBorder),l.outerBorder.opacity=V,e.stroke()}}if(g){var W=v.distance,F=void 0===W?l.innerBorder.distance:W,G=Yo(e,F,e.dpr),Y=F/_;if(t.setAttributes({outerRadius:_-G,innerRadius:m+G,startAngle:k+Y,endAngle:S-Y}),e.beginPath(),Qr(t,e,i,n,_-G,m+G),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,v,l.innerBorder);else if(D){var X=l.innerBorder.opacity;l.innerBorder.opacity=T,e.setStrokeStyle(t,v,(P-i)/L,(E-n)/I,l.innerBorder),l.innerBorder.opacity=X,e.stroke()}}t.setAttributes({outerRadius:_,innerRadius:m,startAngle:k,endAngle:S})}}}]),t}()),nl=el,rl=Jo,al=function(){function t(){a(this,t),this.time=Bt.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.outerBorder,v=c.innerBorder,p=f&&!1!==f.visible,g=v&&!1!==v.visible;if(p||g){var y=t.attribute,b=y.radius,m=void 0===b?l.radius:b,x=y.startAngle,_=void 0===x?l.startAngle:x,A=y.endAngle,k=void 0===A?l.endAngle:A,B=y.opacity,S=void 0===B?l.opacity:B,w=y.x,T=void 0===w?l.x:w,C=y.y,P=void 0===C?l.y:C,M=y.scaleX,E=void 0===M?l.scaleX:M,O=y.scaleY,L=void 0===O?l.scaleY:O,R=!(!f||!f.stroke),I=!(!v||!v.stroke);if(p){var j=f.distance,D=Yo(e,void 0===j?l.outerBorder.distance:j,e.dpr);if(e.beginPath(),e.arc(i,n,m+D,_,k),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,f,l.outerBorder);else if(R){var N=l.outerBorder.opacity;l.outerBorder.opacity=S,e.setStrokeStyle(t,f,(T-i)/E,(P-n)/L,l.outerBorder),l.outerBorder.opacity=N,e.stroke()}}if(g){var U=v.distance,z=Yo(e,void 0===U?l.innerBorder.distance:U,e.dpr);if(e.beginPath(),e.arc(i,n,m-z,_,k),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,v,l.innerBorder);else if(I){var H=l.innerBorder.opacity;l.innerBorder.opacity=S,e.setStrokeStyle(t,v,(T-i)/E,(P-n)/L,l.innerBorder),l.innerBorder.opacity=H,e.stroke()}}}}}]),t}(),sl=new al,ol=el,ll=Jo,ul=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=Bt.beforeFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.background,v=c.backgroundMode,p=void 0===v?l.backgroundMode:v;if(f)if(t.backgroundImg&&t.resources){var g=t.resources.get(f);if("success"!==g.state||!g.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var y=t.AABBBounds;this.doDrawImage(e,g.data,y,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}}]),i}(Zo),hl=new ul,dl=e.pi/2;function cl(t,i,n,r,a,s){var o;if(r<0&&(i+=r,r=-r),a<0&&(n+=a,a=-a),e.isNumber(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){var l=s;switch(l.length){case 0:o=[0,0,0,0];break;case 1:o=[l[0],l[0],l[0],l[0]];break;case 2:case 3:o=[l[0],l[1],l[0],l[1]];break;default:o=l.slice(0,5)}}else o=[0,0,0,0];if(r<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(i,n,r,a);var u=[i,n],h=[i+r,n],d=[i+r,n+a],c=[i,n+a],f=Math.min(r/2,a/2),v=[Math.min(f,o[0]),Math.min(f,o[1]),Math.min(f,o[2]),Math.min(f,o[3])],p=[u[0]+v[0],u[1]],g=[u[0],u[1]+v[0]],y=[h[0]-v[1],h[1]],b=[h[0],h[1]+v[1]],m=[d[0]-v[2],d[1]],x=[d[0],d[1]-v[2]],_=[c[0]+v[3],c[1]],A=[c[0],c[1]-v[3]];if(t.moveTo(p[0],p[1]),t.lineTo(y[0],y[1]),!e.arrayEqual(y,b)){var k=y[0],B=y[1]+v[1];t.arc(k,B,v[1],-dl,0,!1)}if(t.lineTo(x[0],x[1]),!e.arrayEqual(m,x)){var S=x[0]-v[2],w=x[1];t.arc(S,w,v[2],0,dl,!1)}if(t.lineTo(_[0],_[1]),!e.arrayEqual(_,A)){var T=_[0],C=_[1]-v[3];t.arc(T,C,v[3],dl,e.pi,!1)}if(t.lineTo(g[0],g[1]),!e.arrayEqual(p,g)){var P=p[0],M=p[1]+v[0];t.arc(P,M,v[0],e.pi,e.pi+dl,!1)}return t.closePath(),t}var fl=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).time=Bt.beforeFillStroke,t}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute,v=f.background,p=f.backgroundMode,g=void 0===p?u.backgroundMode:p;if(v)if(t.backgroundImg){var y=t.resources.get(v);if("success"!==y.state||!y.data)return;if(i.save(),t.parent&&!t.transMatrix.onlyTranslate()){var b=Vi(t.parent).group,m=t.parent.attribute,x=m.scrollX,_=void 0===x?b.scrollX:x,A=m.scrollY,k=void 0===A?b.scrollY:A;i.setTransformFromMatrix(t.parent.globalTransMatrix,!0),i.translate(_,k)}var B=t.AABBBounds;this.doDrawImage(i,y.data,B,g),i.restore(),t.transMatrix.onlyTranslate()||i.setTransformForCurrent()}else if(e.isObject(v)){var S=v.stroke,w=v.fill,T=v.lineWidth,C=void 0===T?1:T,P=v.cornerRadius,M=void 0===P?0:P,E=v.expandX,O=void 0===E?0:E,L=v.expandY,R=void 0===L?0:L;if(!S&&!w)return;i.beginPath();var I=function(t){var i=fn(t.attribute.boundsPadding),n=t.AABBBounds,r=n.x1,a=n.y1,s=n.width(),o=n.height();return e.isNumber(i)?(r+=i,a+=i,s-=2*i,o-=2*i):(r+=i[3],a+=i[0],s-=i[1]+i[3],o-=i[0]+i[2]),{x:r,y:a,width:s,height:o}}(t),j=I.x,D=I.y,N=I.width,U=I.height;M?cl(i,j-O,D-R,N+2*O,U+2*R,M):i.rect(j-O,D-R,N+2*O,U+2*R),i.globalAlpha=1,w&&(i.fillStyle=w,i.fill()),S&&C>0&&(i.lineWidth=C,i.strokeStyle=S,i.stroke())}else{i.beginPath();var z=t.AABBBounds;i.rect(n,r,z.width(),z.height()),i.fillStyle=v,i.globalAlpha=1,i.fill()}}}]),n}(Zo);var vl=new fl,pl=function(){function t(){a(this,t),this.time=Bt.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute,v=f.outerBorder,p=f.innerBorder,g=v&&!1!==v.visible,y=p&&!1!==p.visible;if(g||y){var b=t.attribute,m=b.cornerRadius,x=void 0===m?u.cornerRadius:m,_=b.opacity,A=void 0===_?u.opacity:_,k=b.x,B=void 0===k?u.x:k,S=b.y,w=void 0===S?u.y:S,T=b.scaleX,C=void 0===T?u.scaleX:T,P=b.scaleY,M=void 0===P?u.scaleY:P,E=b.x1,O=b.y1,L=t.attribute,R=L.width,I=L.height;R=(null!=R?R:E-n)||0,I=(null!=I?I:O-r)||0;var j=!(!v||!v.stroke),D=!(!p||!p.stroke);if(g){var N=v.distance,U=Yo(i,void 0===N?u.outerBorder.distance:N,i.dpr),z=n-U,H=r-U,V=2*U;if(0===x||e.isArray(x)&&x.every((function(t){return 0===t}))?(i.beginPath(),i.rect(z,H,R+V,I+V)):(i.beginPath(),cl(i,z,H,R+V,I+V,x)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),c)c(i,v,u.outerBorder);else if(j){var W=u.outerBorder.opacity;u.outerBorder.opacity=A,i.setStrokeStyle(t,v,(B-n)/C,(w-r)/M,u.outerBorder),u.outerBorder.opacity=W,i.stroke()}}if(y){var F=p.distance,G=Yo(i,void 0===F?u.innerBorder.distance:F,i.dpr),Y=n+G,X=r+G,$=2*G;if(0===x||e.isArray(x)&&x.every((function(t){return 0===t}))?(i.beginPath(),i.rect(Y,X,R-$,I-$)):(i.beginPath(),cl(i,Y,X,R-$,I-$,x)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),c)c(i,p,u.innerBorder);else if(D){var q=u.innerBorder.opacity;u.innerBorder.opacity=A,i.setStrokeStyle(t,p,(B-n)/C,(w-r)/M,u.innerBorder),u.innerBorder.opacity=q,i.stroke()}}}}}]),t}(),gl=function(){function t(){a(this,t),this.time=Bt.beforeFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute.stroke,v=void 0===f?l.stroke:f;Array.isArray(v)&&v.some((function(t){return!1===t}))&&(c.doStroke=!1)}}]),t}(),yl=function(){function t(){a(this,t),this.time=Bt.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.width,v=void 0===f?l.width:f,p=c.height,g=void 0===p?l.height:p,y=c.stroke,b=void 0===y?l.stroke:y;if(Array.isArray(b)&&b.some((function(t){return!1===t}))){if(e.setStrokeStyle(t,t.attribute,i,n,l),e.beginPath(),e.moveTo(i,n),b[0]?e.lineTo(i+v,n):e.moveTo(i+v,n),b[1]?e.lineTo(i+v,n+g):e.moveTo(i+v,n+g),b[2]?e.lineTo(i,n+g):e.moveTo(i,n+g),b[3]){var m=b[0]?n-e.lineWidth/2:n;e.lineTo(i,m)}else e.moveTo(i,n);e.stroke()}}}]),t}(),bl=new pl,ml=new gl,xl=new yl,_l=el,Al=Jo,kl=new(function(){function t(){a(this,t),this.time=Bt.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.getParsedPath();if(c){var f=t.attribute,v=f.outerBorder,p=f.innerBorder,g=v&&!1!==v.visible,y=p&&!1!==p.visible;if(g||y){var b=t.attribute,m=b.size,x=void 0===m?l.size:m,_=b.opacity,A=void 0===_?l.opacity:_,k=b.x,B=void 0===k?l.x:k,S=b.y,w=void 0===S?l.y:S,T=b.scaleX,C=void 0===T?l.scaleX:T,P=b.scaleY,M=void 0===P?l.scaleY:P,E=!(!v||!v.stroke),O=!(!p||!p.stroke);if(g){var L=v.distance,R=Yo(e,void 0===L?l.outerBorder.distance:L,e.dpr);if(e.beginPath(),!1===c.drawOffset(e,x,i,n,R)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,v,l.outerBorder);else if(E){var I=l.outerBorder.opacity;l.outerBorder.opacity=A,e.setStrokeStyle(t,v,(B-i)/C,(w-n)/M,l.outerBorder),l.outerBorder.opacity=I,e.stroke()}}if(y){var j=p.distance,D=Yo(e,void 0===j?l.innerBorder.distance:j,e.dpr);if(e.beginPath(),!1===c.drawOffset(e,x,i,n,-D)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),d)d(e,p,l.innerBorder);else if(O){var N=l.innerBorder.opacity;l.innerBorder.opacity=A,e.setStrokeStyle(t,p,(B-i)/C,(w-n)/M,l.innerBorder),l.innerBorder.opacity=N,e.stroke()}}}}}}]),t}()),Bl=el,Sl=Jo,wl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Tl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cl=function(t,e){return function(i,n){e(i,n,t)}},Pl=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).arcRenderContribitions=t,e.numberType=or,e.builtinContributions=[il,rl,nl],e.init(t),e}return o(n,[{key:"drawArcTailCapPath",value:function(t,i,n,r,a,s,o,l){var u=l-o,h=t.getParsedAngle(),d=h.startAngle,c=h.endAngle;c=l;var f=e.abs(c-d),v=c>d,p=!1;if(a<s){var g=a;a=s,s=g}var y=t.getParsedCornerRadius(),b=t.getParsePadAngle(d,c);b.outerDeltaAngle;var m,x,_,A,k=b.innerDeltaAngle,B=b.outerStartAngle,S=b.outerEndAngle,w=b.innerEndAngle,T=b.innerStartAngle,C=y,P=y,M=y,E=y,O=Math.max(P,C),L=Math.max(M,E),R=O,I=L,j=a*e.cos(B),D=a*e.sin(B),N=s*e.cos(w),U=s*e.sin(w);if((L>e.epsilon||O>e.epsilon)&&(m=a*e.cos(S),x=a*e.sin(S),_=s*e.cos(T),A=s*e.sin(T),f<e.pi)){var z=Zr(j,D,_,A,m,x,N,U);if(z){var H=j-z[0],V=D-z[1],W=m-z[0],F=x-z[1],G=1/e.sin(e.acos((H*W+V*F)/(e.sqrt(H*H+V*V)*e.sqrt(W*W+F*F)))/2),Y=e.sqrt(z[0]*z[0]+z[1]*z[1]);I=e.min(L,(s-Y)/(G-1)),R=e.min(O,(a-Y)/(G+1))}}if(R>e.epsilon){var X=e.min(C,R),$=e.min(P,R),q=Jr(_,A,j,D,a,X,Number(v)),K=Jr(m,x,N,U,a,$,Number(v));if(R<O&&X===$)i.moveTo(n+q.cx+q.x01,r+q.cy+q.y01),i.arc(n+q.cx,r+q.cy,R,e.atan2(q.y01,q.x01),e.atan2(K.y01,K.x01),!v);else{var Z=c-u-.03,J=e.atan2(K.y11,K.x11);i.arc(n,r,a,Z,J,!v),$>0&&i.arc(n+K.cx,r+K.cy,$,e.atan2(K.y11,K.x11),e.atan2(K.y01,K.x01),!v)}}else i.moveTo(n+j,r+D);if(!(s>e.epsilon)||k<.001)i.lineTo(n+N,r+U),p=!0;else if(I>e.epsilon){var Q=e.min(E,I),tt=e.min(M,I),et=Jr(N,U,m,x,s,-tt,Number(v)),it=Jr(j,D,_,A,s,-Q,Number(v));if(i.lineTo(n+et.cx+et.x01,r+et.cy+et.y01),I<L&&Q===tt){var nt=e.atan2(it.y01,it.x01);i.arc(n+et.cx,r+et.cy,I,e.atan2(et.y01,et.x01),nt,!v)}else{tt>0&&i.arc(n+et.cx,r+et.cy,tt,e.atan2(et.y01,et.x01),e.atan2(et.y11,et.x11),!v);var rt=e.atan2(et.cy+et.y11,et.cx+et.x11),at=c-u-.03;i.arc(n,r,s,rt,at,v)}}else i.lineTo(n+s*e.cos(T),r+s*e.sin(T));return p}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Vi(t,null==s?void 0:s.theme).arc,h=t.attribute,d=h.fill,c=void 0===d?u.fill:d,f=h.stroke,v=void 0===f?u.stroke:f,p=h.x,g=void 0===p?u.x:p,y=h.y,b=void 0===y?u.y:y,m=this.valid(t,u,o,l);if(m){var x=m.fVisible,_=m.sVisible,A=m.doFill,k=m.doStroke,B=t.attribute,S=B.outerRadius,w=void 0===S?u.outerRadius:S,T=B.innerRadius,C=void 0===T?u.innerRadius:T,P=B.cap,M=void 0===P?u.cap:P,E=B.forceShowCap,O=void 0===E?u.forceShowCap:E,L=0,R=(e.isBoolean(M)&&M||M[0])&&"conical"===c.gradient;if(R){var I=t.getParsedAngle(),j=I.sc,D=I.startAngle,N=I.endAngle;e.abs(N-D)<e.pi2-e.epsilon&&(L=j||0,c.startAngle-=L,c.endAngle-=L)}var U=!1,z=function(t){var i,n=!0;if(e.isBoolean(t,!0)){for(var r=0;r<4;r++)dn[r]=t,n&&(n=!(null!==(i=dn[r])&&void 0!==i&&!i));n=t}else if(Array.isArray(t))for(var a=0;a<4;a++)dn[a]=!!t[a],n&&(n=!!dn[a]);else dn[0]=!1,dn[1]=!1,dn[2]=!1,dn[3]=!1;return{isFullStroke:n,stroke:dn}}(v),H=z.isFullStroke,V=z.stroke;if((A||H)&&(i.beginPath(),Qr(t,i,n,r,w,C),U=!0,i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),A&&(o?o(i,t.attribute,u):x&&(i.setCommonStyle(t,t.attribute,g-n,b-r,u),i.fill())),k&&H&&(l?l(i,t.attribute,u):_&&(i.setStrokeStyle(t,t.attribute,g-n,b-r,u),i.stroke()))),!H&&k&&(i.beginPath(),Qr(t,i,n,r,w,C,V),U||this.beforeRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),l?l(i,t.attribute,u):_&&(i.setStrokeStyle(t,t.attribute,n,r,u),i.stroke())),(e.isBoolean(M)&&M||M[1])&&O){var W=t.getParsedAngle(),F=W.startAngle,G=W.endAngle;if(e.abs(G-F)>=e.pi2-e.epsilon){i.beginPath();var Y=Math.abs(w-C)/2/w,X=t.attribute,$=X.endAngle,q=void 0===$?u.endAngle:$,K=X.fill,Z=void 0===K?u.fill:K,J=q;if(this.drawArcTailCapPath(t,i,n,r,w,C,J,J+Y),U||this.beforeRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),A){var Q=Z;if("conical"===Q.gradient){var tt=function(t,i,n,r){for(var a=r.stops,s=r.startAngle,o=r.endAngle;n<0;)n+=e.pi2;for(;n>e.pi2;)n-=e.pi2;if(n<s)return a[0].color;if(n>o)return a[0].color;for(var l,u,h=(n-s)/(o-s),d=0;d<a.length;d++)if(a[d].offset>=h){l=a[d-1],u=a[d];break}return h=(h-l.offset)/(u.offset-l.offset),Cn(l.color,u.color,h,!1)}(0,0,q,Q);o||Xr&&(i.setCommonStyle(t,t.attribute,n,r,u),i.fillStyle=tt,i.fill())}}k&&(l||_&&(i.setStrokeStyle(t,t.attribute,n,r,u),i.stroke()))}}this.afterRenderStep(t,i,n,r,A,k,x,_,u,a,o,l),R&&(c.startAngle+=L,c.endAngle+=L)}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}}]),n}(Go);Pl=wl([D(),Cl(0,I(tt)),Cl(0,N(ta)),Tl("design:paramtypes",[Object])],Pl);var Ml=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},El=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ol=function(t,e){return function(i,n){e(i,n,t)}},Ll=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).circleRenderContribitions=t,n.numberType=hr,n.builtinContributions=[sl,ll,ol],n.init(t),n}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l=Vi(t,null==a?void 0:a.theme).circle,u=t.attribute,h=u.radius,d=void 0===h?l.radius:h,c=u.startAngle,f=void 0===c?l.startAngle:c,v=u.endAngle,p=void 0===v?l.endAngle:v,g=u.x,y=void 0===g?l.x:g,b=u.y,m=void 0===b?l.y:b,x=this.valid(t,l,s,o);if(x){var _=x.fVisible,A=x.sVisible,k=x.doFill,B=x.doStroke;e.beginPath(),e.arc(i,n,d,f,p),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,k,B,_,A,l,r,s,o),k&&(s?s(e,t.attribute,l):_&&(e.setCommonStyle(t,t.attribute,y-i,m-n,l),e.fill())),B&&(o?o(e,t.attribute,l):A&&(e.setStrokeStyle(t,t.attribute,y-i,m-n,l),e.stroke())),this.afterRenderStep(t,e,i,n,k,B,_,A,l,r,s,o)}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}}]),i}(Go);function Rl(t,i,n,r,a){var s,o=a||{},l=o.offsetX,u=void 0===l?0:l,h=o.offsetY,d=void 0===h?0:h,c=o.offsetZ,f=void 0===c?0:c,v=o.mode,p=void 0===v?"none":v,g=o.drawConnect,y=void 0!==g&&g;if(o.zeroX,o.zeroY,(!y||"none"!==p)&&i){var b=!0,m=i.curves;if(n>=1)if(y){var x,_=!0;m.forEach((function(e,i){var n,r=e.p0;if(e.originP1!==e.originP2){if(x&&x.originP1===x.originP2&&(r=x.p0),e.defined)_||(t.lineTo(r.x+u,r.y+d,f),_=!_);else{var a,s=e.originP1,o=e.originP2;if(s&&!1!==s.defined?a=r:s&&!1!==o.defined&&(a=null!==(n=e.p3)&&void 0!==n?n:e.p1),_){_=!_;var l=a?a.x:e.p0.x,h=a?a.y:e.p0.y;t.moveTo(l+u,h+d,f)}else a&&(_=!_,t.lineTo(a.x+u,a.y+d,f))}x=e}else x=e}))}else m.forEach((function(e){e.defined?(b&&t.moveTo(e.p0.x+u,e.p0.y+d,f),Il(t,e,1,a),b=!1):b=!0}));else if(!(n<=0)){var A;"x"===r?A=At.ROW:"y"===r?A=At.COLUMN:"auto"===r&&(A=i.direction);for(var k=n*i.tryUpdateLength(A),B=0,S=!0,w=null,T=0,C=m.length;T<C;T++){var P=m[T],M=P.getLength(A),E=(k-B)/M;if(B+=M,E<0)break;if(y){var O=P.p0;if(P.originP1===P.originP2){w=P;continue}if(w&&w.originP1===w.originP2&&(O=w.p0),P.defined)S||(t.lineTo(O.x+u,O.y+d,f),S=!S);else{var L=P.originP1,R=P.originP2,I=void 0;if(L&&!1!==L.defined?I=O:L&&!1!==R.defined&&(I=null!==(s=P.p3)&&void 0!==s?s:P.p1),S){S=!S;var j=I?I.x:P.p0.x,D=I?I.y:P.p0.y;t.moveTo(j+u,D+d,f)}else I&&(S=!S,t.lineTo(I.x+u,I.y+d,f))}w=P}else{if(!P.defined){b=!0;continue}b&&t.moveTo(P.p0.x+u,P.p0.y+d,f),Il(t,P,e.min(E,1),a),b=!1}}}}}function Il(t,e,i,n){if(e.p1){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,l+e.p1.y,s+e.p2.x,l+e.p2.y,s+e.p3.x,l+e.p3.y,h):t.lineTo(s+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var d=b(Ut(e,i),1)[0];t.bezierCurveTo(s+d.p1.x,l+d.p1.y,s+d.p2.x,l+d.p2.y,s+d.p3.x,l+d.p3.y,h)}else{var c=e.getPointAt(i);t.lineTo(s+c.x,l+c.y,h)}}}Ll=Ml([D(),Ol(0,I(tt)),Ol(0,N(ia)),El("design:paramtypes",[Object])],Ll);var jl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Dl=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).numberType=vr,t}return o(n,[{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f,v,p){var g,y,b,m,x;if(i){t.beginPath();var _=null!==(g=this.z)&&void 0!==g?g:0;Rl(t.camera?t:t.nativeContext,i,u,h,{offsetX:d,offsetY:c,offsetZ:_}),f.cache&&!e.isArray(f.cache)&&f.cache.curves.every((function(t){return t.defined}))&&f.attribute.curveType&&f.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(f,o,l);var A=o.x,k=void 0===A?0:A,B=o.x,S=void 0===B?0:B;!1!==n&&(v?v(t,o,l):a&&(t.setCommonStyle(f,o,k-d,S-c,l),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,o,k-d,S-c,l),t.stroke()));var w=o.connectedType,T=o.connectedX,C=o.connectedY,P=o.connectedStyle;if(e.isArray(l)?(w=null!==(y=null!=w?w:l[0].connectedType)&&void 0!==y?y:l[1].connectedType,T=null!==(b=null!=T?T:l[0].connectedX)&&void 0!==b?b:l[1].connectedX,C=null!==(m=null!=C?C:l[0].connectedY)&&void 0!==m?m:l[1].connectedY,P=null!==(x=null!=P?P:l[0].connectedStyle)&&void 0!==x?x:l[1].connectedStyle):(w=null!=w?w:l.connectedType,T=null!=T?T:l.connectedX,C=null!=C?C:l.connectedY,P=null!=P?P:l.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),"none"!==w){t.beginPath(),Rl(t.camera?t:t.nativeContext,i,u,h,{offsetX:d,offsetY:c,offsetZ:_,drawConnect:!0,mode:w,zeroX:T,zeroY:C});var M=[];e.isArray(l)?l.forEach((function(t){return M.push(t)})):M.push(l),M.push(o),!1!==n&&(v?v(t,o,l):a&&(t.setCommonStyle(f,P,k-d,S-c,M),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,P,k-d,S-c,M),t.stroke()))}return!1}}},{key:"drawLinearLineHighPerformance",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f;e.beginPath();var v=null!==(f=this.z)&&void 0!==f?f:0,p=t.attribute.points,g=p[0];e.moveTo(g.x,g.y,v);for(var y=1;y<p.length;y++){var b=p[y];e.lineTo(b.x,b.y,v)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);var m=t.attribute,x=m.x,_=void 0===x?0:x,A=m.x,k=void 0===A?0:A;!1!==i&&(d?d(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,_-s,k-o,l),e.fill())),!1!==n&&(c?c(e,t.attribute,l):a&&(e.setStrokeStyle(t,t.attribute,_-s,k-o,l),e.stroke()))}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=this,h=Vi(t,null==s?void 0:s.theme).line,d=t.attribute,c=d.fill,f=void 0===c?h.fill:c,v=d.stroke,p=void 0===v?h.stroke:v,g=d.fillOpacity,y=void 0===g?h.fillOpacity:g,b=d.strokeOpacity,m=void 0===b?h.strokeOpacity:b,x=d.segments,_=d.points,A=d.closePath;if(this.valid(t,h,o,l)){var k=t.attribute.curveType,B=void 0===k?h.curveType:k;A&&"linear"===B&&(B="linearClosed");var S=t.attribute,w=S.clipRange,T=void 0===w?h.clipRange:w,C=S.clipRangeByDimension,P=void 0===C?h.clipRangeByDimension:C;if(1===T&&!x&&!_.some((function(t){return!1===t.defined}))&&"linear"===B)return this.drawLinearLineHighPerformance(t,i,!!f,!!p,y,m,n,r,h,a,s,o,l);if(t.shouldUpdateShape()){var M=t.attribute,E=M.points,O=M.segments,L=E;if(O&&O.length){var R,I;if(t.cache=O.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(I={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===e?R={x:I.endX,y:I.endY,defined:I.curves[I.curves.length-1].defined}:e>1&&(R.x=I.endX,R.y=I.endY,R.defined=I.curves[I.curves.length-1].defined);var i=ue(t.points,B,{startPoint:R});return I=i,i})).filter((function(t){return!!t})),"linearClosed"===B){for(var j,D=0;D<t.cache.length;D++){for(var N=t.cache[D],U=0;U<N.curves.length;U++)if(N.curves[U].defined){j=N.curves[U].p0;break}if(j)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(j.x,j.y,!0)}}else{if(!E||!E.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ue(L,B)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){var z=t.attribute.segments.filter((function(t){return t.points.length}));if(1===z[0].points.length&&z.shift(),1===T){var H=!1;t.cache.forEach((function(e,a){H||(H=u.drawSegmentItem(i,e,!!f,!!p,y,m,z[a],[h,t.attribute],T,P,n,r,t,o,l))}))}else{var V=t.cache.reduce((function(t,e){return t+e.getLength()}),0),W=T*V,F=0,G=!1;t.cache.forEach((function(a,s){if(!G){var d=a.getLength(),c=(W-F)/d;F+=d,c>0&&(G=u.drawSegmentItem(i,a,!!f,!!p,y,m,z[s],[h,t.attribute],e.min(c,1),P,n,r,t,o,l))}}))}}else this.drawSegmentItem(i,t.cache,!!f,!!p,y,m,t.attribute,h,T,P,n,r,t,o,l)}}}]),n}(Go);function Nl(t,e,i,n){if(!(e.length<2)){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;r.mode;var d=e[0];t.moveTo(d.p0.x+s,d.p0.y+l,h);var c=(d=e[e.length-1]).p3||d.p1;t.lineTo(c.x+s,c.y+l,h),d=i[i.length-1],t.lineTo(d.p0.x+s,d.p0.y+l,h),c=(d=i[0]).p3||d.p1,t.lineTo(c.x+s,c.y+l,h),t.closePath()}}function Ul(t,e,i,n){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u,d=!0;e.forEach((function(e){e.defined?(d&&t.moveTo(e.p0.x+s,e.p0.y+l,h),zl(t,e,1,n),d=!1):d=!0})),d=!0;for(var c=i.length-1;c>=0;c--){var f=i[c];f.defined?(d&&t.lineTo(f.p0.x+s,f.p0.y+l,h),zl(t,f,1,n),d=!1):d=!0}t.closePath()}function zl(t,e,i,n){if(e.p1){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,l+e.p1.y,s+e.p2.x,l+e.p2.y,s+e.p3.x,l+e.p3.y,h):t.lineTo(s+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var d=b(Ut(e,i),1)[0];t.bezierCurveTo(s+d.p1.x,l+d.p1.y,s+d.p2.x,l+d.p2.y,s+d.p3.x,l+d.p3.y,h)}else{var c=e.getPointAt(i);t.lineTo(s+c.x,l+c.y,h)}}}Dl=jl([D()],Dl);var Hl=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=Bt.afterFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f,v,p,g;this.textureMap||this.initTextureMap(e,t.stage);var y=(c||{}).attribute,b=void 0===y?t.attribute:y,m=b.texture,x=void 0===m?null!==(f=t.attribute.texture)&&void 0!==f?f:mn(l,"texture"):m,_=b.textureColor,A=void 0===_?null!==(v=t.attribute.textureColor)&&void 0!==v?v:mn(l,"textureColor"):_,k=b.textureSize,B=void 0===k?null!==(p=t.attribute.textureSize)&&void 0!==p?p:mn(l,"textureSize"):k,S=b.texturePadding,w=void 0===S?null!==(g=t.attribute.texturePadding)&&void 0!==g?g:mn(l,"texturePadding"):S;if(x){var T=this.textureMap.get(x);if(!T)switch(x){case"circle":T=this.createCirclePattern(B,w,A,e);break;case"diamond":T=this.createDiamondPattern(B,w,A,e);break;case"rect":T=this.createRectPattern(B,w,A,e);break;case"vertical-line":T=this.createVerticalLinePattern(B,w,A,e);break;case"horizontal-line":T=this.createHorizontalLinePattern(B,w,A,e);break;case"bias-lr":T=this.createBiasLRLinePattern(B,w,A,e);break;case"bias-rl":T=this.createBiasRLLinePattern(B,w,A,e);break;case"grid":T=this.createGridPattern(B,w,A,e)}T&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=T,e.fill(),e.highPerformanceRestore())}}}]),i}(tl),Vl=new Hl,Wl=Jo,Fl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Gl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yl=function(t,e){return function(i,n){e(i,n,t)}};function Xl(t,e,i){switch(e){case"linear":default:return Xt(t,i);case"basis":return Kt(t,i);case"monotoneX":return ne(t,i);case"monotoneY":return re(t,i);case"step":return se(t,.5,i);case"stepBefore":return se(t,0,i);case"stepAfter":return se(t,1,i);case"linearClosed":return le(t,i)}}var $l=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).areaRenderContribitions=t,e.numberType=ur,e.builtinContributions=[Vl,Wl],e.init(t),e}return o(n,[{key:"drawLinearAreaHighPerformance",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f){var v,p,g,y,b;i.beginPath();var m=null!==(v=this.z)&&void 0!==v?v:0,x=t.attribute.points,_=x[0];i.moveTo(_.x,_.y,m);for(var A=1;A<x.length;A++){var k=x[A];i.lineTo(k.x,k.y,m)}for(var B=x.length-1;B>=0;B--){var S=x[B];i.lineTo(null!==(p=S.x1)&&void 0!==p?p:S.x,null!==(g=S.y1)&&void 0!==g?g:S.y,m)}i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u);var w=t.attribute,T=w.x,C=void 0===T?0:T,P=w.x,M=void 0===P?0:P;if(!1!==n&&(c?c(i,t.attribute,u):a&&(i.setCommonStyle(t,t.attribute,C-o,M-l,u),i.fill())),r){var E=t.attribute.stroke,O=void 0===E?u&&u.stroke:E;if(e.isArray(O)&&(O[0]||O[2])&&!1===O[1])if(i.beginPath(),O[0]){i.moveTo(_.x,_.y,m);for(var L=1;L<x.length;L++){var R=x[L];i.lineTo(R.x,R.y,m)}}else if(O[2]){var I=x[x.length-1];i.moveTo(I.x,I.y,m);for(var j=x.length-2;j>=0;j--){var D=x[j];i.lineTo(null!==(y=D.x1)&&void 0!==y?y:D.x,null!==(b=D.y1)&&void 0!==b?b:D.y,m)}}i.setStrokeStyle(t,t.attribute,C-o,M-l,u),i.stroke()}}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h,d,c,f,v,p=this,g=Vi(t,null==s?void 0:s.theme).area,y=t.attribute,b=y.fill,m=void 0===b?g.fill:b,x=y.stroke;void 0===x&&g.stroke;var _=y.fillOpacity,A=void 0===_?g.fillOpacity:_,k=y.z,B=void 0===k?g.z:k,S=y.strokeOpacity,w=void 0===S?g.strokeOpacity:S,T=this.valid(t,g,o,l);if(T){var C=T.doFill,P=T.doStroke,M=t.attribute,E=M.clipRange,O=void 0===E?g.clipRange:E,L=M.closePath,R=M.points,I=M.segments,j=t.attribute.curveType,D=void 0===j?g.curveType:j;if(L&&"linear"===D&&(D="linearClosed"),1===O&&!I&&!R.some((function(t){return!1===t.defined}))&&"linear"===D)return this.drawLinearAreaHighPerformance(t,i,!!m,P,A,w,n,r,g,a,s,o,l);if(t.shouldUpdateShape()){if(I&&I.length){for(var N,U,z,H=I.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(U={endX:t.points[0].x,endY:t.points[0].y}),null;1===e?N={x:U.endX,y:U.endY}:e>1&&(N.x=U.endX,N.y=U.endY);var i=Xl(t.points,D,{startPoint:N});return U=i,i})).filter((function(t){return!!t})),V=[],W=I.length-1;W>=0;W--){for(var F=I[W].points,G=[],Y=F.length-1;Y>=0;Y--)G.push({x:null!==(u=F[Y].x1)&&void 0!==u?u:F[Y].x,y:null!==(h=F[Y].y1)&&void 0!==h?h:F[Y].y});if(0!==W){var X=I[W-1].points,$=X[X.length-1];$&&G.push({x:null!==(d=$.x1)&&void 0!==d?d:$.x,y:null!==(c=$.y1)&&void 0!==c?c:$.y})}z=Xl(G,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D),V.unshift(z)}t.cacheArea=V.map((function(t,e){return{top:H[e],bottom:t}}))}else{if(!R||!R.length)return t.cacheArea=null,void t.clearUpdateShapeTag();for(var q=R,K=[],Z=R.length-1;Z>=0;Z--)K.push({x:null!==(f=R[Z].x1)&&void 0!==f?f:R[Z].x,y:null!==(v=R[Z].y1)&&void 0!==v?v:R[Z].y});var J=Xl(q,D),Q=Xl(K,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D);t.cacheArea={top:J,bottom:Q}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){var tt=t.attribute.segments.filter((function(t){return t.points.length}));if(1===tt[0].points.length&&tt.shift(),1===O){var et=!1;t.cacheArea.forEach((function(e,s){et||(et=p.drawSegmentItem(i,e,C,A,P,w,tt[s],[g,t.attribute],O,n,r,B,t,a,o,l))}))}else{var it=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),nt=O*it,rt=0,at=!1;t.cacheArea.forEach((function(s,u){if(!at){var h=s.top.getLength(),d=(nt-rt)/h;rt+=h,d>0&&(at=p.drawSegmentItem(i,s,C,A,P,w,tt[u],[g,t.attribute],e.min(d,1),n,r,B,t,a,o,l))}}))}}else this.drawSegmentItem(i,t.cacheArea,C,A,P,w,t.attribute,g,O,n,r,B,t,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p){var g=!1;return g=(g=g||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,d,c,f,!1,v,p))||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,d,c,f,!0,v,p)}},{key:"_drawSegmentItem",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y){var b,m,x,_,A=o.connectedType,k=o.connectedX,B=o.connectedY,S=o.connectedStyle,w=[];if(p&&(e.isArray(l)?(A=null!==(b=null!=A?A:l[0].connectedType)&&void 0!==b?b:l[1].connectedType,k=null!==(m=null!=k?k:l[0].connectedX)&&void 0!==m?m:l[1].connectedX,B=null!==(x=null!=B?B:l[0].connectedY)&&void 0!==x?x:l[1].connectedY,S=null!==(_=null!=S?S:l[0].connectedStyle)&&void 0!==_?_:l[1].connectedStyle):(A=null!=A?A:l.connectedType,k=null!=k?k:l.connectedX,B=null!=B?B:l.connectedY,S=null!=S?S:l.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),e.isArray(l)?l.forEach((function(t){return w.push(t)})):w.push(l),w.push(o)),p&&"none"===A)return!1;if(i){t.beginPath();var T,C,P=f.attribute,M=P.points,E=P.segments,O=At.ROW;if(E){var L=E[E.length-1];C=E[0].points[0],T=L.points[L.points.length-1]}else C=M[0],T=M[M.length-1];O=e.abs(T.x-C.x)>e.abs(T.y-C.y)?At.ROW:At.COLUMN,function(t,i,n,r){var a,s=r||{},o=s.drawConnect,l=void 0!==o&&o,u=s.mode;if(!l||"none"!==(void 0===u?"none":u)){var h=i.top,d=i.bottom;if(n>=1){var c=[],f=[],v=!0;if(l){var p,g,y=!0,b=h.curves.length;h.curves.forEach((function(e,i){var n=d.curves[b-i-1],a=e,s=n;if(e.originP1===e.originP2)return p=e,void(g=n);if(p&&p.originP1===p.originP2&&(a=p,s=g),e.defined)y||(c.push(a),f.push(s),Nl(t,c,f,r),c.length=0,f.length=0,y=!y);else{var o,l,u=e.originP1,h=e.originP2;u&&!1!==u.defined?(o=a,l=s):u&&!1!==h.defined&&(o=e,l=n),y?(y=!y,c.push(o||e),f.push(l||n)):o&&(y=!y,c.push(o||e),f.push(l||n),Nl(t,c,f,r),c.length=0,f.length=0)}p=e})),Nl(t,c,f,r)}else{for(var m=0,x=h.curves.length;m<x;m++){var _=h.curves[m];v!==_.defined?(v?(Ul(t,c,f,r),c.length=0,f.length=0):(c.push(_),f.push(d.curves[x-m-1])),v=!v):v&&(c.push(_),f.push(d.curves[x-m-1]))}Ul(t,c,f,r)}}else if(!(n<=0)){var A=(r||{}).direction,k=h.curves,B=null!==(a=k[k.length-1].p3)&&void 0!==a?a:k[k.length-1].p1,S=e.abs(B.x-k[0].p0.x),w=e.abs(B.y-k[0].p0.y);A=null!=A?A:S>w?At.ROW:At.COLUMN,Number.isFinite(S)||(A=At.COLUMN),Number.isFinite(w)||(A=At.ROW);for(var T,C,P=n*(A===At.ROW?S:w),M=0,E=!0,O=[],L=[],R=!0,I=0,j=h.curves.length;I<j;I++){var D=h.curves[I],N=D.getLength(A),U=(P-M)/N;if(U<0)break;if(M+=N,l){var z=d.curves[j-I-1],H=D,V=z;if(D.originP1===D.originP2){T=D,C=z;continue}if(T&&T.originP1===T.originP2&&(H=T,V=C),D.defined)R||(O.push(H),L.push(V),Nl(t,O,L,r),O.length=0,L.length=0,R=!R);else{var W=D.originP1,F=D.originP2,G=void 0,Y=void 0;W&&!1!==W.defined?(G=H,Y=V):W&&!1!==F.defined&&(G=D,Y=z),R?(R=!R,O.push(G||D),L.push(Y||z)):G&&(R=!R,O.push(G||D),L.push(Y||z),Nl(t,O,L,r),O.length=0,L.length=0)}T=D}else{var X=null,$=null;E!==D.defined?(E?(Ul(t,O,L,r),O.length=0,L.length=0):(X=D,$=d.curves[j-I-1]),E=!E):E&&(X=D,$=d.curves[j-I-1]),X&&$&&(U<1&&(X=X.p2&&X.p3?Ut(X,U)[0]:Ht(X,U)[0],$=$.p2&&$.p3?Ut($,1-U)[1]:Ht($,1-U)[1]),X.defined=E,$.defined=E,O.push(X),L.push($)),X=null,$=null}}l?Nl(t,O,L,r):Ul(t,O,L,r)}}}(t.camera?t:t.nativeContext,i,u,{offsetX:h,offsetY:d,offsetZ:c,direction:O,drawConnect:p,mode:A,zeroX:k,zeroY:B}),this.beforeRenderStep(f,t,h,d,!!r,!1,n,!1,l,v,g,null,{attribute:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(f,o,l);var R=o.x,I=void 0===R?0:R,j=o.x,D=void 0===j?0:j;if(!1!==n&&(g?g(t,o,l):r&&(t.setCommonStyle(f,p?S:o,I-h,D-d,p?w:l),t.fill())),this.afterRenderStep(f,t,h,d,!!r,!1,n,!1,l,v,g,null,{attribute:o}),!1!==a)if(y)y(t,o,l);else{var N=o.stroke,U=void 0===N?l&&l[1]&&l[1].stroke:N;e.isArray(U)&&(U[0]||U[2])&&!1===U[1]&&(t.beginPath(),Rl(t.camera?t:t.nativeContext,U[0]?i.top:i.bottom,u,O===At.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:c,drawConnect:p,mode:A,zeroX:k,zeroY:B})),t.setStrokeStyle(f,p?S:o,I-h,D-d,p?w:l),t.stroke()}return!1}}}]),n}(Go);$l=Fl([D(),Yl(0,I(tt)),Yl(0,N(ea)),Gl("design:paramtypes",[Object])],$l);var ql=el,Kl=Jo,Zl=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Jl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ql=function(t,e){return function(i,n){e(i,n,t)}},tu=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).pathRenderContribitions=t,n.numberType=pr,n.builtinContributions=[Kl,ql],n.init(t),n}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l,u,h,d=null!==(l=this.tempTheme)&&void 0!==l?l:Vi(t,null==a?void 0:a.theme).path,c=t.attribute,f=c.x,v=void 0===f?d.x:f,p=c.y,g=void 0===p?d.y:p,y=null!==(u=this.z)&&void 0!==u?u:0,b=this.valid(t,d,s,o);if(b){var m=b.fVisible,x=b.sVisible,_=b.doFill,A=b.doStroke;if(e.beginPath(),t.pathShape)Rt(t.pathShape.commandList,e,i,n,1,1,y);else Rt((null!==(h=t.attribute.path)&&void 0!==h?h:d.path).commandList,e,i,n,1,1,y);e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,i,n,_,A,m,x,d,r,s,o),A&&(o?o(e,t.attribute,d):x&&(e.setStrokeStyle(t,t.attribute,v-i,g-n,d),e.stroke())),_&&(s?s(e,t.attribute,d):m&&(e.setCommonStyle(t,t.attribute,v-i,g-n,d),e.fill())),this.afterRenderStep(t,e,i,n,_,A,m,x,d,r,s,o)}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}]),i}(Go);tu=Zl([D(),Ql(0,I(tt)),Ql(0,N(aa)),Jl("design:paramtypes",[Object])],tu);var eu=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},iu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nu=function(t,e){return function(i,n){e(i,n,t)}},ru=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).rectRenderContribitions=t,e.type="rect",e.numberType=br,e.builtinContributions=[bl,Al,_l,xl,ml],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h=null!==(u=this.tempTheme)&&void 0!==u?u:Vi(t,null==s?void 0:s.theme).rect,d=t.attribute,c=d.fill,f=void 0===c?h.fill:c,v=d.background,p=d.stroke,g=void 0===p?h.stroke:p,y=d.cornerRadius,b=void 0===y?h.cornerRadius:y,m=d.opacity,x=void 0===m?h.opacity:m,_=d.fillOpacity,A=void 0===_?h.fillOpacity:_,k=d.lineWidth,B=void 0===k?h.lineWidth:k,S=d.strokeOpacity,w=void 0===S?h.strokeOpacity:S,T=d.visible,C=void 0===T?h.visible:T,P=d.x1,M=d.y1,E=d.x,O=void 0===E?h.x:E,L=d.y,R=void 0===L?h.y:L,I=t.attribute,j=I.width,D=I.height,N=$r(x,A,j=(null!=j?j:P-O)||0,D=(null!=D?D:M-R)||0,f),U=Kr(x,w,j,D),z=Gr(f,v),H=Yr(g,B);if(t.valid&&C&&(z||H)&&(N||U||o||l||v)){0===b||e.isArray(b)&&b.every((function(t){return 0===t}))?(i.beginPath(),i.rect(n,r,j,D)):(i.beginPath(),cl(i,n,r,j,D,b));var V={doFill:z,doStroke:H};i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,i,n,r,z,H,N,U,h,a,o,l,V),V.doFill&&(o?o(i,t.attribute,h):N&&(i.setCommonStyle(t,t.attribute,O-n,R-r,h),i.fill())),V.doStroke&&(l?l(i,t.attribute,h):U&&(i.setStrokeStyle(t,t.attribute,O-n,R-r,h),i.stroke())),this.afterRenderStep(t,i,n,r,z,H,N,U,h,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}]),n}(Go);ru=eu([D(),nu(0,I(tt)),nu(0,N(oa)),iu("design:paramtypes",[Object])],ru);var au=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},su=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ou=function(t,e){return function(i,n){e(i,n,t)}},lu=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).symbolRenderContribitions=t,n.numberType=_r,n.builtinContributions=[kl,Sl,Bl],n.init(t),n}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l,u=Vi(t,null==a?void 0:a.theme).symbol,h=t.attribute,d=h.size,c=void 0===d?u.size:d,f=h.x,v=void 0===f?u.x:f,p=h.y,g=void 0===p?u.y:p,y=h.scaleX,b=void 0===y?u.scaleX:y,m=h.scaleY,x=void 0===m?u.scaleY:m,_=this.valid(t,u,s,o);if(_){var A=_.fVisible,k=_.sVisible,B=_.doFill,S=_.doStroke,w=t.getParsedPath();if(w){var T=t.attribute.keepDirIn3d,C=void 0===T?u.keepDirIn3d:T,P=null!==(l=this.z)&&void 0!==l?l:0;if(e.beginPath(),C&&e.camera&&e.project){var M=e.project(i,n,P),E=e.camera;e.camera=null,!1===w.draw(e,c,M.x,M.y,void 0,(function(r,a){var l,h,d;if(t._parsedPath.svgCache){var c=Object.assign({},a);c.fill=null!==(l=a.fill)&&void 0!==l?l:t.attribute.fill,c.opacity=null!==(h=a.fill)&&void 0!==h?h:t.attribute.opacity,c.fillOpacity=t.attribute.fillOpacity,c.stroke=null!==(d=a.stroke)&&void 0!==d?d:t.attribute.stroke,a=c}a.fill&&(s?s(e,t.attribute,u):(e.setCommonStyle(t,a,v-i,g-n,u),e.fill())),a.stroke&&(o?o(e,t.attribute,u):(e.setStrokeStyle(t,a,(v-i)/b,(g-n)/x,u),e.stroke()))}))&&e.closePath(),e.camera=E}else!1===w.draw(e,c,i,n,P,(function(r,a){var l,h,d;if(t._parsedPath.svgCache){var c=Object.assign({},a);c.fill=null!==(l=a.fill)&&void 0!==l?l:t.attribute.fill,c.opacity=null!==(h=a.opacity)&&void 0!==h?h:t.attribute.opacity,c.fillOpacity=t.attribute.fillOpacity,c.stroke=null!==(d=a.stroke)&&void 0!==d?d:t.attribute.stroke,a=c}a.fill&&(s?s(e,t.attribute,u):(e.setCommonStyle(t,a,v-i,g-n,u),e.fill())),a.stroke&&(o?o(e,t.attribute,u):(e.setStrokeStyle(t,a,(v-i)/b,(g-n)/x,u),e.stroke()))}))&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,B,S,A,k,u,r,s,o),B&&!w.isSvg&&(s?s(e,t.attribute,u):A&&(e.setCommonStyle(t,t.attribute,v-i,g-n,u),e.fill())),S&&!w.isSvg&&(o?o(e,t.attribute,u):k&&(e.setStrokeStyle(t,t.attribute,(v-i)/b,(g-n)/x,u),e.stroke())),this.afterRenderStep(t,e,i,n,B,S,A,k,u,r,s,o)}}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}}]),i}(Go);lu=au([D(),ou(0,I(tt)),ou(0,N(la)),su("design:paramtypes",[Object])],lu);var uu=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=Bt.beforeFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.background,v=c.backgroundMode,p=void 0===v?l.backgroundMode:v;if(f){var g=t.AABBBounds;if(t.backgroundImg&&t.resources){var y=t.resources.get(f);if("success"!==y.state||!y.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),this.doDrawImage(e,y.data,g,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fillRect(g.x1,g.y1,g.width(),g.height()),e.highPerformanceRestore()}}}]),i}(Zo),hu=new uu,du=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},cu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fu=function(t,e){return function(i,n){e(i,n,t)}},vu=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).textRenderContribitions=t,e.numberType=Ar,e.builtinContributions=[hu],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h,d,c=this,f=Vi(t,null==s?void 0:s.theme).text,v=t.attribute,p=v.text,g=v.underline,y=void 0===g?f.underline:g,b=v.lineThrough,m=void 0===b?f.lineThrough:b,x=v.keepDirIn3d,_=void 0===x?f.keepDirIn3d:x,A=v.direction,k=void 0===A?f.direction:A,B=v.fontSize,S=void 0===B?f.fontSize:B,w=v.verticalMode,T=void 0===w?f.verticalMode:w,C=v.x,P=void 0===C?f.x:C,M=v.y,E=void 0===M?f.y:M,O=t.attribute,L=O.textAlign,R=void 0===L?f.textAlign:L,I=O.textBaseline,j=void 0===I?f.textBaseline:I;if(!T&&"vertical"===k){var D=R;R=null!==(u=t.getBaselineMapAlign()[j])&&void 0!==u?u:"left",j=null!==(h=t.getAlignMapBaseline()[D])&&void 0!==h?h:"top"}var N=null!==(d=An(t.attribute.lineHeight,S))&&void 0!==d?d:S,U=this.valid(t,f,o,l);if(U){var z=U.fVisible,H=U.sVisible,V=U.doFill,W=U.doStroke,F=!_,G=this.z||0;i.beginPath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,f),this.beforeRenderStep(t,i,n,r,V,W,z,H,f,a,o,l),F&&this.transformUseContext2d(t,f,G,i);var Y=function(e,a,s,u){var h=n+a,d=r+s;if(u){i.highPerformanceSave(),h+=S;var v=xo.allocate(1,0,0,1,0,0);v.rotateByCenter(Math.PI/2,h,d),i.transformFromMatrix(v,!0),xo.free(v)}W&&(l?l(i,t.attribute,f):H&&(i.setStrokeStyle(t,t.attribute,P-n,E-r,f),i.strokeText(e,h,d,G))),V&&(o?o(i,t.attribute,f):z&&(i.setCommonStyle(t,t.attribute,P-n,E-r,f),i.fillText(e,h,d,G),c.drawUnderLine(y,m,t,h,d,G,f,i))),u&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(Array.isArray(p))if(i.setTextStyleWithoutAlignBaseline(t.attribute,f,G),"horizontal"===k){var X=t.multilineLayout;if(!X)return void i.highPerformanceRestore();var $=X.bbox,q=$.xOffset,K=$.yOffset;W&&(l?l(i,t.attribute,f):H&&(i.setStrokeStyle(t,t.attribute,P-n,E-r,f),X.lines.forEach((function(t){i.strokeText(t.str,(t.leftOffset||0)+q+n,(t.topOffset||0)+K+r,G)})))),V&&(o?o(i,t.attribute,f):z&&(i.setCommonStyle(t,t.attribute,P-n,E-r,f),X.lines.forEach((function(e){i.fillText(e.str,(e.leftOffset||0)+q+n,(e.topOffset||0)+K+r,G),c.drawMultiUnderLine(y,m,t,(e.leftOffset||0)+n,(e.topOffset||0)+K+r,G,e.width,f,i)}))))}else{t.tryUpdateAABBBounds();var Z=t.cache.verticalList;i.textAlign="left",i.textBaseline="top";var J=N*Z.length,Q=0;Z.forEach((function(t){var i=t.reduce((function(t,e){return t+(e.width||0)}),0);Q=e.max(i,Q)}));var tt=0,et=0;"bottom"===j?et=-J:"middle"===j&&(et=-J/2),"center"===R?tt-=Q/2:"right"===R&&(tt-=Q),Z.forEach((function(t,e){var i=t.reduce((function(t,e){return t+(e.width||0)}),0),n=Q-i,r=tt;"center"===R?r+=n/2:"right"===R&&(r+=n),t.forEach((function(t){var i=t.text,n=t.width,a=t.direction;Y(i,J-(e+1)*N+et,r,a),r+=n}))}))}else if("horizontal"===k){i.setTextStyle(t.attribute,f,G);var it=t.clipedText,nt=0;N!==S&&("top"===j?nt=(N-S)/2:"middle"===j||"bottom"===j&&(nt=-(N-S)/2)),Y(it,0,nt,0)}else{t.tryUpdateAABBBounds();var rt=t.cache;if(rt){i.setTextStyleWithoutAlignBaseline(t.attribute,f,G);var at=rt.verticalList,st=0,ot=at[0].reduce((function(t,e){return t+(e.width||0)}),0),lt=0;"bottom"===j?lt=-N:"middle"===j&&(lt=-N/2),"center"===R?st-=ot/2:"right"===R&&(st-=ot),i.textAlign="left",i.textBaseline="top",at[0].forEach((function(t){var e=t.text,i=t.width,n=t.direction;Y(e,lt,st,n),st+=i}))}}F&&this.restoreTransformUseContext2d(t,f,G,i),this.afterRenderStep(t,i,n,r,V,W,z,H,f,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).text,a=t.attribute.keepDirIn3d,s=!(void 0===a?r.keepDirIn3d:a);this._draw(t,r,s,i,n)}},{key:"drawUnderLine",value:function(t,e,i,n,r,a,s,o){if(!(e+t<=0)){var l=i.attribute,u=l.textAlign,h=void 0===u?s.textAlign:u,d=l.textBaseline,c=void 0===d?s.textBaseline:d,f=l.fontSize,v=void 0===f?s.fontSize:f,p=l.fill,g=void 0===p?s.fill:p,y=l.opacity,b=void 0===y?s.opacity:y,m=l.fillOpacity,x=void 0===m?s.fillOpacity:m,_=i.clipedWidth,A=fa(h,_),k=va(c,v,v),B={lineWidth:0,stroke:g,opacity:b,strokeOpacity:x};if(t){B.lineWidth=t,o.setStrokeStyle(i,B,n,r,s),o.beginPath();var S=r+k+v;o.moveTo(n+A,S,a),o.lineTo(n+A+_,S,a),o.stroke()}if(e){B.lineWidth=e,o.setStrokeStyle(i,B,n,r,s),o.beginPath();var w=r+k+v/2;o.moveTo(n+A,w,a),o.lineTo(n+A+_,w,a),o.stroke()}}}},{key:"drawMultiUnderLine",value:function(t,e,i,n,r,a,s,o,l){if(!(e+t<=0)){var u=i.attribute,h=u.textAlign,d=void 0===h?o.textAlign:h,c=u.fontSize,f=void 0===c?o.fontSize:c,v=u.fill,p=void 0===v?o.fill:v,g=u.opacity,y=void 0===g?o.opacity:g,b=u.fillOpacity,m=void 0===b?o.fillOpacity:b,x=fa(d,s),_=va("alphabetic",f,f),A={lineWidth:0,stroke:p,opacity:y,strokeOpacity:m},k=-3;if(t){A.lineWidth=t,l.setStrokeStyle(i,A,n,r,o),l.beginPath();var B=r+_+f+k;l.moveTo(n+x,B,a),l.lineTo(n+x+s,B,a),l.stroke()}if(k=-1,e){A.lineWidth=e,l.setStrokeStyle(i,A,n,r,o),l.beginPath();var S=r+_+f/2+k;l.moveTo(n+x,S,a),l.lineTo(n+x+s,S,a),l.stroke()}}}}]),n}(Go);vu=du([D(),fu(0,I(tt)),fu(0,N(ua)),cu("design:paramtypes",[Object])],vu);var pu=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},gu=o((function t(){a(this,t)}));function yu(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(var r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function bu(t,e){return Math.sqrt(t*t+e*e)}function mu(t,e,i,n,r){var a=e/i;return{x:t.x-n*a,y:t.y-r*a}}gu=pu([D()],gu);var xu=el,_u=Jo,Au=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ku=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bu=function(t,e){return function(i,n){e(i,n,t)}},Su=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).polygonRenderContribitions=t,e.numberType=gr,e.builtinContributions=[_u,xu],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Vi(t,null==s?void 0:s.theme).polygon,h=t.attribute,d=h.points,c=void 0===d?u.points:d,f=h.cornerRadius,v=void 0===f?u.cornerRadius:f,p=h.x,g=void 0===p?u.x:p,y=h.y,b=void 0===y?u.y:y,m=h.closePath,x=void 0===m?u.closePath:m,_=this.valid(t,u,o,l);if(_){var A=_.fVisible,k=_.sVisible,B=_.doFill,S=_.doStroke;i.beginPath(),v<=0||e.isArray(v)&&v.every((function(t){return 0===t}))?yu(i.camera?i:i.nativeContext,c,n,r):function(t,e,i,n,r){var a,s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e.length<3)yu(t,e,i,n);else{var o=0,l=e.length-1;s||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+n));for(var u=o;u<=l;u++){var h=e[0===u?l:(u-1)%e.length],d=e[u%e.length],c=e[(u+1)%e.length],f=d.x-h.x,v=d.y-h.y,p=d.x-c.x,g=d.y-c.y,y=(Math.atan2(v,f)-Math.atan2(g,p))/2,b=Math.abs(Math.tan(y)),m=Array.isArray(r)?null!==(a=r[u%e.length])&&void 0!==a?a:0:r,x=m/b,_=bu(f,v),A=bu(p,g),k=Math.min(_,A);x>k&&(x=k,m=k*b);var B=mu(d,x,_,f,v),S=mu(d,x,A,p,g),w=2*d.x-B.x-S.x,T=2*d.y-B.y-S.y,C=bu(w,T),P=mu(d,bu(x,m),C,w,T),M=Math.atan2(B.y-P.y,B.x-P.x),E=Math.atan2(S.y-P.y,S.x-P.x),O=E-M;O<0&&(M=E,O=-O),O>Math.PI&&(O-=Math.PI),0===u?t.moveTo(B.x+i,B.y+n):t.lineTo(B.x+i,B.y+n),O&&t.arcTo(d.x+i,d.y+n,S.x+i,S.y+n,m),t.lineTo(S.x+i,S.y+n)}s||t.lineTo(e[l+1].x+i,e[l+1].y+n)}}(i.camera?i:i.nativeContext,c,n,r,v,x),x&&i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,i,n,r,B,S,A,k,u,a,o,l),B&&(o?o(i,t.attribute,u):A&&(i.setCommonStyle(t,t.attribute,g-n,b-r,u),i.fill())),S&&(l?l(i,t.attribute,u):k&&(i.setStrokeStyle(t,t.attribute,g-n,b-r,u),i.stroke())),this.afterRenderStep(t,i,n,r,B,S,A,k,u,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}}]),n}(Go);Su=Au([D(),Bu(0,I(tt)),Bu(0,N(sa)),ku("design:paramtypes",[Object])],Su);var wu=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Tu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cu=function(t,e){return function(i,n){e(i,n,t)}},Pu=["","repeat-x","repeat-y","repeat"],Mu=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).imageRenderContribitions=t,e.numberType=fr,e.builtinContributions=[vl],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o){var l=Vi(t).image,u=t.attribute,h=u.width,d=void 0===h?l.width:h,c=u.height,f=void 0===c?l.height:c,v=u.repeatX,p=void 0===v?l.repeatX:v,g=u.repeatY,y=void 0===g?l.repeatY:g,b=u.cornerRadius,m=void 0===b?l.cornerRadius:b,x=u.image,_=this.valid(t,l,o);if(_){var A=_.fVisible;_.sVisible;var k=_.doFill;if(_.doStroke,i.setShadowBlendStyle&&i.setShadowBlendStyle(t,l),this.beforeRenderStep(t,i,n,r,k,!1,A,!1,l,a,o),k)if(o)o(i,t.attribute,l);else if(A){if(!x||!t.resources)return;var B=t.resources.get(x);if("success"!==B.state)return;var S=!1;0===m||e.isArray(m)&&m.every((function(t){return 0===t}))||(i.beginPath(),cl(i,n,r,d,f,m),i.save(),i.clip(),S=!0),i.setCommonStyle(t,t.attribute,n,r,l);var w=0;if("repeat"===p&&(w|=1),"repeat"===y&&(w|=2),w){var T=i.createPattern(B.data,Pu[w]);i.fillStyle=T,i.translate(n,r,!0),i.fillRect(0,0,d,f),i.translate(-n,-r,!0)}else i.drawImage(B.data,n,r,d,f);S&&i.restore()}this.afterRenderStep(t,i,n,r,k,!1,A,!1,l,a,o)}}},{key:"draw",value:function(t,e,i){var n=t.attribute.image;if(n&&t.resources&&("success"===t.resources.get(n).state&&e.drawParams.context)){var r=Vi(t).image;this._draw(t,r,!1,i)}}}]),n}(Go);Mu=wu([D(),Cu(0,I(tt)),Cu(0,N(ra)),Tu("design:paramtypes",[Object])],Mu);var Eu=Symbol.for("IncrementalDrawContribution"),Ou=Symbol.for("ArcRender"),Lu=Symbol.for("Arc3dRender"),Ru=Symbol.for("AreaRender"),Iu=Symbol.for("CircleRender"),ju=Symbol.for("GraphicRender"),Du=Symbol.for("GroupRender"),Nu=Symbol.for("LineRender"),Uu=Symbol.for("PathRender"),zu=Symbol.for("PolygonRender"),Hu=Symbol.for("RectRender"),Vu=Symbol.for("Rect3DRender"),Wu=Symbol.for("SymbolRender"),Fu=Symbol.for("TextRender"),Gu=Symbol.for("RichTextRender"),Yu=Symbol.for("Pyramid3dRender"),Xu=Symbol.for("GlyphRender"),$u=Symbol.for("ImageRender"),qu=Symbol.for("DrawContribution"),Ku=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Zu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ju=function(t,e){return function(i,n){e(i,n,t)}},Qu=Symbol.for("RenderService"),th=function(){function t(e){a(this,t),this.drawContribution=e}return o(t,[{key:"prepare",value:function(t){var e=this;t&&this.renderTreeRoots.forEach((function(i){e._prepare(i,t)}))}},{key:"_prepare",value:function(t,e){var i=this;t.forEachChildren((function(t){i._prepare(t,e)})),t.update({bounds:e,trans:!0})}},{key:"prepareRenderList",value:function(){}},{key:"beforeDraw",value:function(t){}},{key:"draw",value:function(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}},{key:"afterDraw",value:function(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}},{key:"render",value:function(t,e){this.renderTreeRoots=t,this.drawParams=e;var i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}}]),t}();th=Ku([D(),Ju(0,I(qu)),Zu("design:paramtypes",[Object])],th);var eh=new B((function(t){t(Qu).to(th).inSingletonScope()})),ih=Symbol.for("PickerService"),nh=Symbol.for("GlobalPickerService"),rh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ah=Symbol.for("PickItemInterceptor"),sh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterPickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}},{key:"beforePickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}},{key:"_pickItem",value:function(t,i,n,r,a){if(!t.shadowRoot)return null;var s=(a||{}).parentMatrix;if(!s)return null;var o=i.pickContext;o.highPerformanceSave();var l=t.shadowRoot,u=xo.allocateByObj(s),h=new e.Point(n.x,n.y);s.transformPoint(h,h);var d=t.transMatrix;u.multiply(d.a,d.b,d.c,d.d,d.e,d.f);var c=i.pickGroup(l,h.clone(),u,r);return o.highPerformanceRestore(),c}}]),t}();sh=rh([D()],sh);var oh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforePickItem",value:function(t,i,n,r,a){var s=t.baseGraphic;if(s&&s.parent){var o=new e.Point(n.x,n.y),l=i.pickContext;l.highPerformanceSave();var u=s.parent.globalTransMatrix;u.transformPoint(o,o);var h=s.isContainer?i.pickGroup(s,o.clone(),u,r):i.pickItem(s,o.clone(),u,r);return l.highPerformanceRestore(),h}return null}}]),t}();oh=rh([D()],oh);var lh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforePickItem",value:function(t,i,n,r,a){if(!t.in3dMode||r.in3dInterceptor)return null;var s=i.pickContext,o=t.stage;if(!s||!o)return null;if(r.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){var l,u=!1,h=!1;if(t.forEachChildren((function(t){return!(u=t.numberType===lr)})),t.forEachChildren((function(t){return!(h=!!t.findFace)})),u){var d=t.getChildren(),c=m(d);c.sort((function(t,i){for(var n,r,a,s,o=(null!==(r=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==r?r:0)/2,l=(null!==(s=null!==(a=i.attribute.startAngle)&&void 0!==a?a:0+i.attribute.endAngle)&&void 0!==s?s:0)/2;o<0;)o+=e.pi2;for(;l<0;)l+=e.pi2;return l-o})),c.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),c.forEach((function(e){t.appendChild(e)})),r.hack_pieFace="outside",(l=i.pickGroup(t,n,a.parentMatrix,r)).graphic||(r.hack_pieFace="inside",l=i.pickGroup(t,n,a.parentMatrix,r)),l.graphic||(r.hack_pieFace="top",l=i.pickGroup(t,n,a.parentMatrix,r)),t.removeAllChild(),d.forEach((function(t){t._next=null,t._prev=null})),d.forEach((function(e){t.appendChild(e)}))}else if(h){var f=t.getChildren(),v=f.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));v.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),v.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),v.forEach((function(e){t.add(e.g)})),l=i.pickGroup(t,n,a.parentMatrix,r),t.removeAllChild(),f.forEach((function(t){t._next=null,t._prev=null})),t.update(),f.forEach((function(e){t.add(e)}))}else l=i.pickGroup(t,n,a.parentMatrix,r);return s.camera=null,r.in3dInterceptor=!1,s.restore(),l}return s.restore(),null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}();lh=rh([D()],lh);var uh=new B((function(t){t(ih).toService(nh),t(lh).toSelf().inSingletonScope(),t(ah).toService(lh),t(sh).toSelf().inSingletonScope(),t(ah).toService(sh),t(oh).toSelf().inSingletonScope(),t(ah).toService(oh),it(t,ah)})),hh=new B((function(t){t(kr).to(Po).inSingletonScope(),t(Br).toConstantValue(Ho)})),dh=Symbol.for("AutoEnablePlugins"),ch=Symbol.for("PluginService"),fh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ph=function(t,e){return function(i,n){e(i,n,t)}},gh=function(){function t(e){a(this,t),this.autoEnablePlugins=e,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}return o(t,[{key:"active",value:function(t,e){var i=this;this.stage=t,this.actived=!0;var n=e.pluginList;n&&Ke.isBound(dh)&&this.autoEnablePlugins.getContributions().forEach((function(t){n.includes(t.name)&&i.register(t)}))}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(i){i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((function(i){i.name===t&&e.push(i)})),e}},{key:"register",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}},{key:"release",value:function(){var t=this;this.onStartupFinishedPlugin.forEach((function(e){e.deactivate(t)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((function(e){e.deactivate(t)})),this.onRegisterPlugin=[]}}]),t}();gh=fh([D(),ph(0,I(tt)),ph(0,N(dh)),vh("design:paramtypes",[Object])],gh);var yh=new B((function(t){t(ch).to(gh),function(t,e){t(tt).toDynamicValue((function(t){var i=t.container;return new et(e,i)})).whenTargetNamed(e)}(t,dh)})),bh=new B((function(t){it(t,rt)})),mh=new B((function(t){t($e).to(qe).inSingletonScope(),it(t,$e)})),xh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},_h=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ah=function(){function t(){a(this,t),this.type="static",this.offscreen=!1,this.global=Ie.global}return o(t,[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{var n;this.main=!1,(n=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height})).style&&(n.style["pointer-events"]="none");var r=e.getContext().getCanvas().nativeCanvas,a=Je({nativeCanvas:n,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:r.offsetLeft,y:r.offsetTop});a.applyPosition(),this.canvas=a,this.context=a.getContext()}}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,i){var n;if(!this.main){var r=this.window.getContext().getCanvas().nativeCanvas;!r||this.canvas.x===r.offsetLeft&&this.canvas.y===r.offsetTop||(this.canvas.x=r.offsetLeft,this.canvas.y=r.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var i=t.getContext().canvas.nativeCanvas;e.context.drawImage(i,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,i){var n,r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}]),t}();Ah=xh([D(),_h("design:paramtypes",[])],Ah);var kh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sh=function(){function t(){a(this,t),this.offscreen=!1,this.type="virtual",this.global=Ie.global}return o(t,[{key:"setDpr",value:function(t){}},{key:"init",value:function(t,e,i){if(this.layer=t,this.window=e,i.main)throw new Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}},{key:"resize",value:function(t,e){}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,i){this.mainHandler.render(t,e,Object.assign(Object.assign({},i),{clear:!1}))}},{key:"merge",value:function(t){}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,i){var n,r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}},{key:"getContext",value:function(){return null}},{key:"release",value:function(){}}]),t}();Sh=kh([D(),Bh("design:paramtypes",[])],Sh);var wh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Th=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ch=function(){function t(){a(this,t),this.offscreen=!0,this.type="dynamic",this.global=Ie.global}return o(t,[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,i){this.layer=t;var n=Je({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){this.canvas.resize(t,e)}},{key:"render",value:function(t,e){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"}))}},{key:"prepare",value:function(t,e){}},{key:"release",value:function(){this.canvas.release()}},{key:"getContext",value:function(){return this.context}},{key:"drawTo",value:function(t,e,i){var n=t.getContext(),r=t.dpr,a=i.x,s=void 0===a?0:a,o=i.y,l=void 0===o?0:o,u=i.width,h=void 0===u?this.layer.viewWidth:u,d=i.height,c=void 0===d?this.layer.viewHeight:d;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,l,h,c),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,l,h,c),n.nativeContext.restore()}},{key:"merge",value:function(t){}}]),t}();Ch=wh([D(),Th("design:paramtypes",[])],Ch);var Ph=new B((function(t){t(Ah).toSelf(),t(Ch).toSelf(),t(Sh).toSelf(),t(Lr).toService(Ah),t(Rr).toService(Ch),t(Ir).toService(Sh)}));var Mh=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))};function Eh(t,e,i){var n,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s={},o=[],l=!1;a?l=!0:t.forEachChildren((function(t,i){var r=t.attribute.zIndex,a=void 0===r?e:r;if(0===i)n=a;else if(n!==a)return l=!0,!0;return!1}),r);if(l){t.forEachChildren((function(t){var i=t.attribute.zIndex,n=void 0===i?e:i;s[n]?s[n].push(t):(s[n]=[t],o.push(n))}),r),o.sort((function(t,e){return r?e-t:t-e}));for(var u=!1,h=0;h<o.length&&!u;h++){var d=o[h],c=s[d];a&&c.sort((function(t,e){var i,n;return(r?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(var f=0;f<c.length;f++)if(i(c[f],f)){u=!0;break}}}else t.forEachChildren(i,r)}function Oh(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Mh(this,void 0,void 0,n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(i,r);case 2:case"end":return e.stop()}}),e)})))}function Lh(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},a=[],s=!1;t.forEachChildren((function(t,e){var n=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===n?i:n))return s=!0,!0;return!1}),n);var o=null,l=!1;if(s){t.forEachChildren((function(t){var e=t.attribute.zIndex,n=void 0===e?i:e;r[n]?r[n].push(t):(r[n]=[t],a.push(n))}),n),a.sort((function(t,e){return n?e-t:t-e}));for(var u=!1,h=0;h<a.length&&!u;h++)for(var d=a[h],c=r[d],f=0;f<c.length;f++){if(l){u=!0,o=c[f];break}c[f]._uid!==e||(l=!0)}}else t.forEachChildren((function(t){return l?(o=t,!0):(t._uid===e&&(l=!0),!1)}),n);return o}var Rh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ih=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jh=Symbol.for("DrawItemInterceptor"),Dh=new e.AABBBounds,Nh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.shadowRoot)return!1;var a=i.context;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Dh.copy(n.dirtyBounds);var s=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(s)}return n.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),a.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(Dh),!0}}]),t}(),Uh=function(){function t(){a(this,t),this.order=1,this.interceptors=[new Nh,new Vh,new Hh]}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;var a=i.context;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);var s=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(a,t),a.strokeRect(s.x1,s.y1,s.width(),s.height()),a.highPerformanceRestore(),!0}}]),t}(),zh=function(){function t(){a(this,t),this.order=1,this.interceptors=[new Nh,new Vh,new Hh,new Uh]}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].afterDrawItem&&this.interceptors[a].afterDrawItem(t,e,i,n,r))return!0;return!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].beforeDrawItem&&this.interceptors[a].beforeDrawItem(t,e,i,n,r))return!0;return!1}}]),t}();zh=Rh([D(),Ih("design:paramtypes",[])],zh);var Hh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforeDrawItem",value:function(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}},{key:"beforeSetInteractive",value:function(t,e,i,n,r){var a=t.interactiveGraphic;if(t.attribute.globalZIndex){a||(a=t.clone(),t.interactiveGraphic=a,a.baseGraphic=t),a.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();var s=i.stage.getLayer("_builtin_interactive");return s&&this.getShadowRoot(s).add(a),!0}if(a){i.stage.tryInitInteractiveLayer();var o=i.stage.getLayer("_builtin_interactive");o&&this.getShadowRoot(o).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}},{key:"beforeDrawInteractive",value:function(t,e,i,n,r){var a=t.baseGraphic;if(a){this.processing=!0;var s=i.context;return s.highPerformanceSave(),s.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?n.renderGroup(a,i,a.parent.globalTransMatrix):n.renderItem(a,i),s.highPerformanceRestore(),this.processing=!1,!0}return!1}},{key:"getShadowRoot",value:function(t){var e,i=t.getElementById("_interactive_group");return i||((i=Oo({})).id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}]),t}(),Vh=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforeDrawItem",value:function(t,i,n,r,a){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;var s=i.drawParams,o=s.context,l=s.stage;o.canvas,o.save(),this.initCanvasCtx(o),o.camera=l.camera;var u=o.currentMatrix;u.a/=o.dpr,u.b/=o.dpr,u.c/=o.dpr,u.d/=o.dpr,u.e/=o.dpr,u.f/=o.dpr;var h=_o.allocate();wo(h,u);var d=o.modelMatrix;if(d){if(h){var c=_o.allocate();o.modelMatrix=To(c,d,h)}}else o.modelMatrix=h;if(o.setTransform(1,0,0,1,0,0,!0),t.isContainer){var f=!1,v=!1;if(t.forEachChildren((function(t){return!(f=t.numberType===lr)})),t.forEachChildren((function(t){return!(v=!!t.findFace)})),f){var p=t.getChildren(),g=m(p);g.sort((function(t,i){for(var n,r,a,s,o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(r=t.attribute.endAngle)&&void 0!==r?r:0))/2,l=((null!==(a=i.attribute.startAngle)&&void 0!==a?a:0)+(null!==(s=i.attribute.endAngle)&&void 0!==s?s:0))/2;o<0;)o+=e.pi2;for(;l<0;)l+=e.pi2;return l-o})),g.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),g.forEach((function(e){t.appendChild(e)}));var y=t.parent.globalTransMatrix;n.hack_pieFace="outside",r.renderGroup(t,n,y),n.hack_pieFace="inside",r.renderGroup(t,n,y),n.hack_pieFace="top",r.renderGroup(t,n,y),t.removeAllChild(),p.forEach((function(t){t._next=null,t._prev=null})),p.forEach((function(e){t.appendChild(e)}))}else if(v){var b=t.getChildren(),x=b.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var i;return o.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));x.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),x.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),x.forEach((function(e){t.add(e.g)})),r.renderGroup(t,n,t.parent.globalTransMatrix,!0),t.removeAllChild(),b.forEach((function(t){t._next=null,t._prev=null})),t.update(),b.forEach((function(e){t.add(e)}))}else r.renderGroup(t,n,t.parent.globalTransMatrix)}else r.renderItem(t,n);return o.camera=null,o.restore(),o.modelMatrix!==d&&_o.free(o.modelMatrix),o.modelMatrix=d,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}(),Wh=new(function(){function t(){a(this,t),this.pools=[];for(var i=0;i<10;i++)this.pools.push(new e.AABBBounds)}return o(t,[{key:"allocate",value:function(t,i,n,r){if(!this.pools.length)return(new e.AABBBounds).setValue(t,i,n,r);var a=this.pools.pop();return a.x1=t,a.y1=i,a.x2=n,a.y2=r,a}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new e.AABBBounds(t);var i=this.pools.pop();return i.x1=t.x1,i.y1=t.y1,i.x2=t.x2,i.y2=t.y2,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}()),Fh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Gh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yh=function(t,e){return function(i,n){e(i,n,t)}},Xh=function(){function t(i,n){a(this,t),this.contributions=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new e.Bounds,this.backupDirtyBounds=new e.Bounds,this.global=Ie.global,this.layerService=Ie.layerService,this.init()}return o(t,[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var i=t.styleRenderMap.get(e.style)||new Map;i.set(e.numberType,e),t.styleRenderMap.set(e.style,i)}else t.defaultRenderMap.set(e.numberType,e)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"prepareForDraw",value:function(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}},{key:"draw",value:function(t,i){var n=this;this.prepareForDraw(t,i),i.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(i.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var r=i.context,a=i.stage,s=i.x,o=void 0===s?0:s,l=i.y,u=void 0===l?0:l,h=i.width,d=i.height;if(r){var c=this.dirtyBounds.setValue(0,0,h,d);if(a.dirtyBounds&&!a.dirtyBounds.empty()){var f=e.getRectIntersect(c,a.dirtyBounds,!1);c.x1=Math.floor(f.x1),c.y1=Math.floor(f.y1),c.x2=Math.ceil(f.x2),c.y2=Math.ceil(f.y2)}var v=r.dpr%1;(v||.5!==v)&&(c.x1=Math.floor(c.x1*r.dpr)/r.dpr,c.y1=Math.floor(c.y1*r.dpr)/r.dpr,c.x2=Math.ceil(c.x2*r.dpr)/r.dpr,c.y2=Math.ceil(c.y2*r.dpr)/r.dpr),this.backupDirtyBounds.copy(c),r.inuse=!0,r.clearMatrix(),r.setTransformForCurrent(!0);var p=c.width()*r.dpr!==r.canvas.width||c.height()*r.dpr!==r.canvas.height;r.save(),r.translate(o,u,!0),p&&(r.beginPath(),r.rect(c.x1,c.y1,c.width(),c.height()),r.clip()),a.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,r,i),r.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:me.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:me.zIndex)})).forEach((function(t){n.renderGroup(t,i,xo.allocate(1,0,0,1,0,0))})),r.restore(),r.restore(),r.draw(),r.inuse=!1}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,i=t._uid;e;){var n=Lh(e,i,me.zIndex);if(n)return n;i=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,i,n,r){var a=this;if(!i.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==i.startAtId||i.startAtId===t._uid))return i.break=!0,void this._increaseRender(t,i);if(!this.useDirtyBounds||e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1)){var s,o=n;if(this.useDirtyBounds){s=Wh.allocateByObj(this.dirtyBounds);var l=t.transMatrix;o=xo.allocateByObj(n).multiply(l.a,l.b,l.c,l.d,l.e,l.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o.getInverse())}this.renderItem(t,i,{drawingCb:function(){var e;r?t.forEachChildren((function(t){i.break||(t.isContainer?a.renderGroup(t,i,o):a.renderItem(t,i))})):Eh(t,me.zIndex,(function(t){i.break||(t.isContainer?a.renderGroup(t,i,o):a.renderItem(t,i))}),!1,!!(null===(e=i.context)||void 0===e?void 0:e.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(s),Wh.free(s),xo.free(o))}}}},{key:"_increaseRender",value:function(t,e){var i=e.layer,n=e.stage,r=i.subLayers,a=r.get(t._uid);a||(a={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,a));var s=a.layer.getNativeHandler().getContext(),o=a.drawContribution||Ke.get(Eu);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:a.layer,context:s,startAtId:t._uid,break:!1})),a.drawContribution=o;var l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{var u=r.get(l._uid);u||(u={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(l._uid,u));var h=u.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:u.layer,context:h,startAtId:l._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e;return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,i,n){if(this.InterceptorContributions.length)for(var r=0;r<this.InterceptorContributions.length;r++){var a=this.InterceptorContributions[r];if(a.beforeDrawItem&&a.beforeDrawItem(t,this.currentRenderService,i,this,n))return}var s=this.getRenderContribution(t);if(s){var o,l=!1;if(t.parent){var u=t.parent.attribute,h=u.scrollX,d=void 0===h?0:h,c=u.scrollY,f=void 0===c?0:c;if(l=!(!d&&!f)){o=this.dirtyBounds.clone();var v=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(v),this.dirtyBounds.translate(-d,-f)}}if(!this.useDirtyBounds||t.isContainer||e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1)){var p=null!=i.startAtId&&t._uid!==i.startAtId;if(t._uid===i.startAtId&&(i.startAtId=null),n&&(n.skipDraw=p),p?t.isContainer&&s.draw(t,this.currentRenderService,i,n):s.draw(t,this.currentRenderService,i,n),l&&this.dirtyBounds.copy(o),this.InterceptorContributions.length)for(var g=0;g<this.InterceptorContributions.length;g++){var y=this.InterceptorContributions[g];if(y.afterDrawItem&&y.afterDrawItem(t,this.currentRenderService,i,this))return}}else l&&this.dirtyBounds.copy(o)}}},{key:"selectRenderByType",value:function(t){return e.Logger.getInstance().warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,i){var n,r=i.clear;if(r){var a=e.getCanvas(),s=i.width,o=void 0===s?a.width:s,l=i.height,u=void 0===l?a.height:l;e.clearRect(0,0,o,u);var h=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(h&&h.backgroundImg&&h.resources){var d=h.resources.get(r);d&&"success"===d.state&&d.data&&e.drawImage(d.data,0,0,o,u)}else e.fillStyle=Xo(e,r,{AABBBounds:{x1:0,y1:0,x2:0+o,y2:0+u}},0,0),e.fillRect(0,0,o,u)}}},{key:"afterDraw",value:function(t,e){}}]),t}();Xh=Fh([D(),Yh(0,j(ju)),Yh(1,I(tt)),Yh(1,N(jh)),Gh("design:paramtypes",[Array,Object])],Xh);var $h=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},qh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kh=function(t,e){return function(i,n){e(i,n,t)}},Zh=function(){function t(e){a(this,t),this.groupRenderContribitions=e,this.numberType=cr}return o(t,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Vi(t,null==s?void 0:s.theme).group,h=t.attribute,d=h.fill,c=void 0===d?u.fill:d,f=h.background,v=h.stroke,p=void 0===v?u.stroke:v,g=h.opacity,y=void 0===g?u.opacity:g,b=h.width,m=void 0===b?u.width:b,x=h.height,_=void 0===x?u.height:x,A=h.clip,k=void 0===A?u.clip:A,B=h.fillOpacity,S=void 0===B?u.fillOpacity:B,w=h.strokeOpacity,T=void 0===w?u.strokeOpacity:w,C=h.cornerRadius,P=void 0===C?u.cornerRadius:C,M=h.path,E=void 0===M?u.path:M,O=h.lineWidth,L=void 0===O?u.lineWidth:O,R=h.visible,I=void 0===R?u.visible:R,j=$r(y,S,m,_,c),D=Kr(y,T,m,_),N=Gr(c,f),U=Yr(p,L);if(t.valid&&I){if(!k){if(!N&&!U)return;if(!(j||D||o||l||f))return}if(E&&E.length&&a.drawContribution){var z=i.disableFill,H=i.disableStroke,V=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,E.forEach((function(t){a.drawContribution.getRenderContribution(t).draw(t,a.renderService,a,s)})),i.disableFill=z,i.disableStroke=H,i.disableBeginPath=V}else 0===P||e.isArray(P)&&P.every((function(t){return 0===t}))?(i.beginPath(),i.rect(n,r,m,_)):(i.beginPath(),cl(i,n,r,m,_,P));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(hl));var W={doFill:N,doStroke:U};this._groupRenderContribitions.forEach((function(e){e.time===Bt.beforeFillStroke&&e.drawShape(t,i,n,r,N,U,j,D,u,a,o,l,W)})),k&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),W.doFill&&(o?o(i,t.attribute,u):j&&(i.setCommonStyle(t,t.attribute,n,r,u),i.fill())),W.doStroke&&(l?l(i,t.attribute,u):D&&(i.setStrokeStyle(t,t.attribute,n,r,u),i.stroke())),this._groupRenderContribitions.forEach((function(e){e.time===Bt.afterFillStroke&&e.drawShape(t,i,n,r,N,U,j,D,u,a,o,l)}))}}},{key:"draw",value:function(t,e,i,n){var r=i.context;if(r){var a=t.attribute.clip;a?r.save():r.highPerformanceSave();var s=Vi(t,null==n?void 0:n.theme).group,o=r.modelMatrix;if(r.camera){var l=_o.allocate(),u=_o.allocate();Co(u,t,s),To(l,o||l,u),r.modelMatrix=l,_o.free(u),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,i);var h,d=t.attribute,c=d.scrollX,f=void 0===c?s.scrollX:c,v=d.scrollY,p=void 0===v?s.scrollY:v;(f||p)&&r.translate(f,p),n&&n.drawingCb&&(h=n.drawingCb()),r.modelMatrix!==o&&_o.free(r.modelMatrix),r.modelMatrix=o,h&&h.then?h.then((function(){a?r.restore():r.highPerformanceRestore()})):a?r.restore():r.highPerformanceRestore()}}}]),t}();Zh=$h([D(),Kh(0,I(tt)),Kh(0,N(na)),qh("design:paramtypes",[Object])],Zh);var Jh=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Qh=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).numberType=vr,t}return o(i,[{key:"drawShape",value:function(t,e,n,r,a,s,o,l){if(t.incremental&&a.multiGraphicOptions){var u=a.multiGraphicOptions,d=u.startAtIdx,c=u.length,f=t.attribute.segments,v=void 0===f?[]:f;if(d>v.length)return;var p=Vi(t).line,g=t.attribute,b=g.fill,m=void 0===b?p.fill:b,x=g.stroke,_=void 0===x?p.stroke:x,A=g.opacity,k=void 0===A?p.opacity:A,B=g.fillOpacity,S=void 0===B?p.fillOpacity:B,w=g.strokeOpacity,T=void 0===w?p.strokeOpacity:w,C=g.lineWidth,P=void 0===C?p.lineWidth:C,M=g.visible,E=void 0===M?p.visible:M,O=Xr(k,S,m),L=qr(k,T),R=Gr(m),I=Yr(_,P);if(!t.valid||!E)return;if(!R&&!I)return;if(!(O||L||o||l))return;for(var j=a.context,D=d;D<d+c;D++)this.drawIncreaseSegment(t,j,v[D-1],v[D],t.attribute.segments[D],[p,t.attribute],n,r)}else y(h(i.prototype),"drawShape",this).call(this,t,e,n,r,a,s,o,l)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,s,o){n&&(e.beginPath(),function(t,e,i,n){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=e?e.points[e.points.length-1]:i.points[0];t.moveTo(u.x+s,u.y+l),i.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+s,e.y+l):t.moveTo(e.x+s,e.y+l)}))}(e.nativeContext,i,n,{offsetX:s,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setStrokeStyle(t,r,s,o,a),e.stroke())}}]),i}(Dl);Qh=Jh([D()],Qh);var td=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ed=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).numberType=ur,t}return o(i,[{key:"drawShape",value:function(t,e,n,r,a,s,o){if(t.incremental&&a.multiGraphicOptions){var l=a.multiGraphicOptions,u=l.startAtIdx,d=l.length,c=t.attribute.segments,f=void 0===c?[]:c;if(u>f.length)return;var v=Vi(t).area,p=t.attribute,g=p.fill,b=void 0===g?v.fill:g,m=p.fillOpacity,x=void 0===m?v.fillOpacity:m,_=p.opacity,A=void 0===_?v.opacity:_,k=p.visible,B=void 0===k?v.visible:k,S=Xr(A,x,b),w=Gr(b);if(!t.valid||!B)return;if(!w)return;if(!S&&!o)return;for(var T=u;T<u+d;T++)this.drawIncreaseSegment(t,e,f[T-1],f[T],t.attribute.segments[T],[v,t.attribute],n,r)}else y(h(i.prototype),"drawShape",this).call(this,t,e,n,r,a,s,o)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,s,o){n&&(e.beginPath(),function(t,e,i,n){for(var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=i.points,h=[],d=0;d<u.length;d++)u[d].defined;h.push(u),h.forEach((function(i,n){var r,a,o,u,h=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(h.x+s,h.y+l),i.forEach((function(e){!1!==e.defined?t.lineTo(e.x+s,e.y+l):t.moveTo(e.x+s,e.y+l)}));for(var d=i.length-1;d>=0;d--){var c=i[d];t.lineTo(null!==(r=c.x1)&&void 0!==r?r:c.x,null!==(a=c.y1)&&void 0!==a?a:c.y)}t.lineTo(null!==(o=h.x1)&&void 0!==o?o:h.x,null!==(u=h.y1)&&void 0!==u?u:h.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,n,{offsetX:s,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setCommonStyle(t,r,s,o,a),e.fill())}}]),i}($l);ed=td([D()],ed);var id,nd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},rd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ad=function(t,e){return function(i,n){e(i,n,t)}},sd=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(id||(id={}));var od=function(t){u(i,t);var e=g(i);function i(t,n,r,s){var o;return a(this,i),(o=e.call(this,t,s)).contributions=t,o.lineRender=n,o.areaRender=r,o.drawItemInterceptorContributions=s,o.rendering=!1,o.currFrameStartAt=0,o.currentIdx=0,o.status=id.NORMAL,o.checkingForDrawPromise=null,o.hooks={completeDraw:new nt([])},o}return o(i,[{key:"init",value:function(){y(h(i.prototype),"init",this).call(this),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}},{key:"draw",value:function(t,e){return sd(this,void 0,void 0,n().mark((function i(){var r,a,s,o,l,u,h=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.checkingForDrawPromise){i.next=2;break}return i.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),i.next=5,this.checkingForDrawPromise;case 5:if(r=i.sent,this.checkingForDrawPromise=null,!r){i.next=8;break}return i.abrupt("return");case 8:this.currentRenderService=t,a=e.context,s=e.x,o=void 0===s?0:s,l=e.y,u=void 0===l?0:l,a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,a,e),a.translate(o,u,!0),a.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:me.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:me.zIndex)})).forEach((function(t){h.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){a.restore(),a.restore(),a.draw(),a.inuse=!1,h.rendering=!1})));case 11:case"end":return i.stop()}}),i,this)})))}},{key:"_increaseRender",value:function(t,e){return sd(this,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.rendering=!0,i.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return i.stop()}}),i,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return sd(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.count=t.count,i.next=3,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return sd(r,void 0,void 0,n().mark((function r(){var a,s=this;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(2===t.count){n.next=6;break}return n.next=3,Oh(t,me.zIndex,(function(i,n){if(s.status===id.STOP)return!0;if(i.isContainer)return!1;if(n<s.currentIdx)return!1;var r=s.currFrameStartAt+t.incremental;return n<r&&(s.currentIdx=n+1,s.renderItem(i,e)),n===r-1&&(s.currFrameStartAt=s.currentIdx,s.waitToNextFrame())}));case 3:i(!1),n.next=21;break;case 6:if(!(a=t.getChildAt(0)).incremental||!a.attribute.segments){n.next=19;break}a.incrementalAt||(a.incrementalAt=0);case 9:if(!(a.incrementalAt<a.attribute.segments.length)){n.next=17;break}return e.multiGraphicOptions={startAtIdx:a.incrementalAt,length:a.incremental},this.renderItem(a,e),a.incrementalAt+=a.incremental,n.next=15,this.waitToNextFrame();case 15:n.next=9;break;case 17:n.next=20;break;case 19:this.renderItem(a,e);case 20:i(!1);case 21:case"end":return n.stop()}}),r,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return i.stop()}}),i,this)})))}},{key:"waitToNextFrame",value:function(){return sd(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.global.getRequestAnimationFrame()((function(){t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"checkForDraw",value:function(t){return sd(this,void 0,void 0,n().mark((function e(){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return i=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return sd(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=this.rendering,!t.t0){t.next=5;break}return this.status=id.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=id.NORMAL,e.hooks.completeDraw.taps=e.hooks.completeDraw.taps.filter((function(t){return"stopCb"!==t.name})),t(!1)}))}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"resetToInit",value:function(){this.currFrameStartAt=0,this.currentIdx=0}},{key:"renderGroup",value:function(t,e){return sd(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.break||!1===t.attribute.visibleAll){i.next=11;break}if(!t.incremental||e.startAtId!==t._uid){i.next=7;break}return i.next=4,this._increaseRender(t,e);case 4:i.t0=void(e.break=!0),i.next=10;break;case 7:return i.next=9,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return sd(r,void 0,void 0,n().mark((function r(){var a=this;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Oh(t,me.zIndex,(function(t){return sd(a,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(i.t0=e.break,i.t0){i.next=6;break}if(i.t1=t.isContainer,!i.t1){i.next=6;break}return i.next=6,this.renderGroup(t,e);case 6:case"end":return i.stop()}}),i,this)})))}));case 2:i(!1);case 3:case"end":return r.stop()}}),r)})))}})}));case 9:i.t0=void i.sent;case 10:return i.abrupt("return",i.t0);case 11:case"end":return i.stop()}}),i,this)})))}}]),i}(Xh);od=nd([D(),ad(0,j(ju)),ad(1,I(Qh)),ad(2,I(ed)),ad(3,I(tt)),ad(3,N(jh)),rd("design:paramtypes",[Array,Object,Object,Object])],od);var ld=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ud=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="rect3d",t.numberType=mr,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l,u=Vi(t,null==a?void 0:a.theme).rect3d,h=t.attribute,d=h.fill,c=void 0===d?u.fill:d,f=h.stroke,v=void 0===f?u.stroke:f,p=h.width,g=void 0===p?u.width:p,y=h.height,b=void 0===y?u.height:y,m=h.opacity,x=void 0===m?u.opacity:m,_=h.fillOpacity,A=void 0===_?u.fillOpacity:_,k=h.lineWidth,B=void 0===k?u.lineWidth:k,S=h.strokeOpacity,w=void 0===S?u.strokeOpacity:S,T=h.visible,C=void 0===T?u.visible:T,P=null!==(l=this.z)&&void 0!==l?l:0,M=$r(x,A,g,b,c),E=Kr(x,w,g,b),O=Gr(c),L=Yr(v,B);if(t.valid&&C&&(O||L)&&(M||E||s||o)){var R=r.stage||{},I=R.light;R.camera;var j=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,u);var D=c;"string"!=typeof D&&(D="black"),this.fill(i,n,P,j,D,e,I,s)}!1!==v&&(e.setStrokeStyle(t,t.attribute,i,n,u),this.stroke(i,n,P,j,e))}}},{key:"stroke",value:function(t,e,i,n,r){var a=n.vertices;n.edges.forEach((function(n){var s=a[n[0]],o={x:t+s[0],y:e+s[1],z:i+s[2]},l=a[n[1]],u={x:t+l[0],y:e+l[1],z:i+l[2]};r.beginPath(),r.moveTo(o.x,o.y,o.z),r.lineTo(u.x,u.y,u.z),r.stroke()}))}},{key:"fill",value:function(t,e,i,n,r,a,s,o){var l=wn.Get(r,Bn.Color255),u=n.vertices,h=u.map((function(t){return a.view(t[0],t[1],t[2])[2]})),d=[];n.polygons.forEach((function(t,e){d.push({faceIdx:e,polygon:t});var i=t.polygon;t.normal;var n=h[i[0]],r=h[i[1]],a=h[i[2]],s=h[i[3]];t.ave_z=n+r+a+s})),d.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),d.forEach((function(n){var h=n.polygon,d=h.polygon,c=h.normal,f=u[d[0]],v=u[d[1]],p=u[d[2]],g=u[d[3]],y={x:t+f[0],y:e+f[1],z:i+f[2]},b={x:t+v[0],y:e+v[1],z:i+v[2]},m={x:t+p[0],y:e+p[1],z:i+p[2]},x={x:t+g[0],y:e+g[1],z:i+g[2]};a.beginPath(),a.moveTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(m.x,m.y,m.z),a.lineTo(x.x,x.y,x.z),a.closePath(),o?o(a,null,null):(a.fillStyle=s?s.computeColor(c,l):r,a.fill())}))}},{key:"draw",value:function(t,e,i){var n=Vi(t).rect;this._draw(t,n,!1,i)}}]),i}(Go);ud=ld([D()],ud);var hd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},dd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cd=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.call(this)).numberType=xr,t.builtinContributions=[hu],t.init(),t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r){var a=Vi(t).richtext,s=t.attribute,o=s.strokeOpacity,l=void 0===o?a.strokeOpacity:o,u=s.opacity,h=void 0===u?a.opacity:u,d=s.fillOpacity,c=void 0===d?a.fillOpacity:d,f=s.visible,v=void 0===f?a.visible:f;if(t.valid&&v){var p=Xr(h,c,!0),g=Xr(h,l,!0);p&&(e.translate(i,n),this.beforeRenderStep(t,e,i,n,p,g,p,g,a,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,p,g,p,g,a,r))}}},{key:"drawIcon",value:function(t,e,i,n,r){var a,s=Vi(t).richtextIcon,o=t.attribute,l=o.width,u=void 0===l?s.width:l,h=o.height,d=void 0===h?s.height:h,c=o.opacity,f=void 0===c?s.opacity:c,v=o.image,p=o.backgroundFill,g=void 0===p?s.backgroundFill:p,y=o.backgroundFillOpacity,b=void 0===y?s.backgroundFillOpacity:y,m=o.backgroundStroke,x=void 0===m?s.backgroundStroke:m,_=o.backgroundStrokeOpacity,A=void 0===_?s.backgroundStrokeOpacity:_,k=o.backgroundRadius,B=void 0===k?s.backgroundRadius:k,S=o.margin,w=t.attribute,T=w.backgroundWidth,C=void 0===T?u:T,P=w.backgroundHeight,M=void 0===P?d:P;if(S&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){var E=(C-u)/2,O=(M-d)/2;0===B?(e.beginPath(),e.rect(i-E,n-O,C,M)):(e.beginPath(),cl(e,i-E,n-O,C,M,B)),g&&(e.globalAlpha=b,e.fillStyle=g,e.fill()),x&&(e.globalAlpha=A,e.strokeStyle=x,e.stroke())}var L=v&&(null===(a=null==t?void 0:t.resources)||void 0===a?void 0:a.get(v));L&&"success"===L.state&&(e.globalAlpha=f,e.drawImage(L.data,i,n,u,d))}},{key:"draw",value:function(t,e,i){var n=Vi(t).richtext;this._draw(t,n,!1,i)}}]),i}(Go);cd=hd([D(),dd("design:paramtypes",[])],cd);var fd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vd=function(){function t(){a(this,t),this.numberType=dr}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){r.drawContribution&&t.getSubGraphic().forEach((function(t){var l=r.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,n,r,a,s,o)}))}},{key:"draw",value:function(t,e,i,n){var r=i.context;if(r&&(r.highPerformanceSave(),i.drawContribution)){var a=Vi(t),s=t.getSubGraphic();s.length&&s.forEach((function(t){i.drawContribution.renderItem(t,i,{theme:a})})),r.highPerformanceRestore()}}}]),t}();vd=fd([D()],vd);var pd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o};var gd=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).numberType=lr,t}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h=Vi(t,null==s?void 0:s.theme).arc,d=t.attribute.fill,c=void 0===d?h.fill:d,f=this.valid(t,h,o,l);if(f){var v=f.fVisible,p=f.sVisible,g=f.doFill,y=f.doStroke,b=null!==(u=this.z)&&void 0!==u?u:0,m=t.attribute,x=m.outerRadius,_=void 0===x?h.outerRadius:x,A=m.innerRadius,k=void 0===A?h.innerRadius:A,B=m.height,S=void 0===B?10:B,w=wn.Get(c,Bn.Color255),T=(a.stage||{}).light,C=a.hack_pieFace,P={top:b,bottom:b+S},M={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===C||"top"===C?(i.beginPath(),function(t,i,n,r,a,s,o){var l=t.getParsedAngle(),u=l.startAngle,h=l.endAngle,d=e.abs(h-u),c=h>u,f=!1;if(s<o){var v=s;s=o,o=v}if(s<=e.epsilon)i.moveTo(n,r,a);else if(d>=e.pi2-e.epsilon)i.moveTo(n+s*e.cos(u),r+s*e.sin(u),a),i.arc(n,r,s,u,h,!c,a),o>e.epsilon&&(i.moveTo(n+o*e.cos(h),r+o*e.sin(h),a),i.arc(n,r,o,h,u,c,a));else{var p=t.getParsePadAngle(u,h),g=p.outerDeltaAngle,y=p.innerDeltaAngle,b=p.outerStartAngle,m=p.outerEndAngle,x=p.innerEndAngle,_=p.innerStartAngle,A=s*e.cos(b),k=s*e.sin(b),B=o*e.cos(x),S=o*e.sin(x);g<.001?f=!0:(i.moveTo(n+A,r+k,a),i.arc(n,r,s,b,m,!c,a)),!(o>e.epsilon)||y<.001?(i.lineTo(n+B,r+S,a),f=!0):(i.lineTo(n+B,r+S,a),i.arc(n,r,o,x,_,c,a))}i.closePath()}(t,i,n,r,P[C],_,k),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,h),g&&(o?o(i,t.attribute,h):v&&(i.setCommonStyle(t,t.attribute,n,r,h),i.fillStyle=T?T.computeColor(M[C],w):c,i.fill())),y&&(l?l(i,t.attribute,h):p&&(i.setStrokeStyle(t,t.attribute,n,r,h),i.stroke()))):"outside"!==C&&"inside"!==C||("inside"===C&&(i.save(),i.beginPath(),i.arc(n,r,k,0,e.pi2,!0,P.top),i.clip()),i.beginPath(),function(t,i,n,r,a,s,o,l){var u=t.getParsedAngle(),h=u.startAngle,d=u.endAngle,c=e.abs(d-h),f=d>h,v=!1;if(o<=e.epsilon)i.moveTo(n,r,a);else if(c>=e.pi2-e.epsilon)i.moveTo(n+o*e.cos(h),r+o*e.sin(h),a),i.arc(n,r,o,h,d,!f,a),i.lineTo(n+o*e.cos(d),r+o*e.sin(d),s),i.arc(n,r,o,d,h,f,s);else{var p=l(h,d),g=p.innerouterDeltaAngle,y=p.innerouterStartAngle,b=p.innerouterEndAngle,m=o*e.cos(y),x=o*e.sin(y),_=o*e.cos(b),A=o*e.sin(b);g<.001?v=!0:(i.moveTo(n+m,r+x,a),i.arc(n,r,o,y,b,!f,a),i.lineTo(n+_,r+A,s),i.arc(n,r,o,b,y,f,s))}i.closePath()}(t,i,n,r,P.top,P.bottom,"outside"===C?_:k,(function(e,i){var n=t.getParsePadAngle(e,i),r=n.outerDeltaAngle,a=n.innerDeltaAngle,s=n.outerStartAngle,o=n.outerEndAngle,l=n.innerEndAngle,u=n.innerStartAngle;return"outside"===C?{innerouterDeltaAngle:r,innerouterEndAngle:o,innerouterStartAngle:s}:{innerouterDeltaAngle:a,innerouterEndAngle:l,innerouterStartAngle:u}})),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,h),g&&(o?o(i,t.attribute,h):v&&(i.setCommonStyle(t,t.attribute,n,r,h),i.fillStyle=T?T.computeColor(M[C],w):c,i.fill())),y&&(l?l(i,t.attribute,h):p&&(i.setStrokeStyle(t,t.attribute,n,r,h),i.stroke())),"inside"===C&&i.restore())}}},{key:"draw",value:function(t,e,i,n){var r=Vi(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}}]),n}(Go);gd=pd([D()],gd);var yd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},bd=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="pyramid3d",t.numberType=yr,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l,u=Vi(t,null==a?void 0:a.theme).polygon,h=t.attribute,d=h.fill,c=void 0===d?u.fill:d,f=h.stroke,v=void 0===f?u.stroke:f,p=h.face,g=void 0===p?[!0,!0,!0,!0,!0,!0]:p,y=null!==(l=this.z)&&void 0!==l?l:0;if(this.valid(t,u,s,o)){var b=r.stage||{},m=b.light,x=b.camera,_=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,u);var A=c;"string"!=typeof A&&(A="black"),this.fill(i,n,y,_,g,A,e,m,x,t,u,s)}!1!==v&&(e.setStrokeStyle(t,t.attribute,i,n,u),this.stroke(i,n,y,_,e))}}},{key:"stroke",value:function(t,e,i,n,r){var a=n.vertices;n.edges.forEach((function(n){var s=a[n[0]],o=a[n[1]],l={x:t+s[0],y:e+s[1],z:i+s[2]},u={x:t+o[0],y:e+o[1],z:i+o[2]};r.beginPath(),r.moveTo(l.x,l.y,l.z),r.lineTo(u.x,u.y,u.z),r.stroke()}))}},{key:"fill",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=wn.Get(a,Bn.Color255),f=n.vertices,v=f.map((function(t){return s.view(t[0],t[1],t[2])[2]})),p=[];n.polygons.forEach((function(t,e){if(r[e]){p.push({faceIdx:e,polygon:t});var i=t.polygon;t.normal;var n=v[i[0]],a=v[i[1]],s=v[i[2]],o=v[i[3]];t.ave_z=n+a+s+o}})),p.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),p.forEach((function(n){var r=n.polygon,l=r.polygon,v=r.normal,p=f[l[0]],g=f[l[1]],y=f[l[2]],b=f[l[3]],m={x:t+p[0],y:e+p[1],z:i+p[2]},x={x:t+g[0],y:e+g[1],z:i+g[2]},_={x:t+y[0],y:e+y[1],z:i+y[2]},A={x:t+b[0],y:e+b[1],z:i+b[2]};s.beginPath(),s.moveTo(m.x,m.y,m.z),s.lineTo(x.x,x.y,x.z),s.lineTo(_.x,_.y,_.z),s.lineTo(A.x,A.y,A.z),s.closePath(),d?d(s,u.attribute,h):(s.fillStyle=o?o.computeColor(v,c):a,s.fill())}))}},{key:"draw",value:function(t,e,i){var n=Vi(t).polygon;this._draw(t,n,!1,i)}}]),i}(Go);bd=yd([D()],bd);var md=new B((function(t){t(Zo).toSelf().inSingletonScope(),t(tl).toSelf().inSingletonScope(),t(qu).to(Xh),t(Eu).to(od),t(Ll).toSelf().inSingletonScope(),t(Iu).to(Ll).inSingletonScope(),t(ju).toService(Iu),it(t,ia),t(ru).toSelf().inSingletonScope(),t(Hu).to(ru).inSingletonScope(),t(ju).toService(Hu),t(Vu).to(ud).inSingletonScope(),t(ju).toService(Vu),it(t,oa),t(Fu).to(vu).inSingletonScope(),t(ju).toService(Fu),it(t,ua),t(tu).toSelf().inSingletonScope(),t(Uu).to(tu).inSingletonScope(),t(ju).toService(Uu),it(t,aa),t(lu).toSelf().inSingletonScope(),t(Wu).to(lu).inSingletonScope(),t(ju).toService(Wu),it(t,la),t(Pl).toSelf().inSingletonScope(),t(Ou).to(Pl).inSingletonScope(),t(ju).toService(Ou),t(Lu).to(gd).inSingletonScope(),t(ju).toService(Lu),it(t,ta),t(Dl).toSelf().inSingletonScope(),t(Nu).to(Dl).inSingletonScope(),t(ju).toService(Nu),t(Qh).toSelf().inSingletonScope(),t(ed).toSelf().inSingletonScope(),t($l).toSelf().inSingletonScope(),t(Ru).to($l).inSingletonScope(),t(ju).toService(Ru),it(t,ea),t(Du).to(Zh).inSingletonScope(),t(ju).toService(Du),it(t,na),t(zu).to(Su).inSingletonScope(),t(ju).toService(zu),it(t,sa),t(Xu).to(vd).inSingletonScope(),t(ju).toService(Xu),t($u).to(Mu).inSingletonScope(),t(ju).toService($u),it(t,ra),t(Gu).to(cd).inSingletonScope(),t(ju).toService(Gu),t(Yu).to(bd).inSingletonScope(),t(ju).toService(Yu),t(Qo).toSelf().inSingletonScope(),t(ua).toService(Qo),t(ta).toService(Qo),t(aa).toService(Qo),t(la).toService(Qo),t(oa).toService(Qo),t(ra).toService(Qo),t(ia).toService(Qo),t(ea).toService(Qo),t(sa).toService(Qo),it(t,ha),it(t,ju),t(zh).toSelf().inSingletonScope(),t(jh).toService(zh),it(t,jh)}));Ke.load(Fr),Ke.load(hh),Ke.load(eh),Ke.load(uh),Ke.load(yh),function(t){t.load(bh),t.load(mh),t.load(Ph)}(Ke),function(t){t.load(md)}(Ke);var xd=Ke.get(at);Ie.global=xd;var _d=Ke.get(Er);Ie.graphicUtil=_d;var Ad=Ke.get(Mr);Ie.transformUtil=Ad;var kd=Ke.get(kr);Ie.graphicService=kd;var Bd=Ke.get(Or);Ie.layerService=Bd,new e.AABBBounds,new e.AABBBounds;var Sd,wd=new Ji;wd.addTimeline(en),wd.setFPS(60),function(t){t[t.W=1]="W",t[t.H=2]="H",t[t.WH=3]="WH"}(Sd||(Sd={}));var Td=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Cd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pd=new e.Matrix(1,0,0,1,0,0),Md={x:0,y:0},Ed=function(){function t(i,n){a(this,t),this.matrix=new e.Matrix(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new e.Matrix(1,0,0,1,0,0),this.path=new he}return o(t,[{key:"nativeContext",get:function(){return this.path}},{key:"getCanvas",value:function(){throw new Error("不支持getCanvas")}},{key:"getContext",value:function(){throw new Error("不支持getContext")}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return xo.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.restore()}},{key:"restore",value:function(){this.stack.length>0&&(xo.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(xo.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,i,n){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,i,n,r,a){var s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*a),s&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var 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()}},{key:"transform",value:function(t,e,i,n,r,a){var s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,a),s&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=t*Math.PI/180;this.rotate(i,e)}},{key:"rotateAbout",value:function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.path.clear()}},{key:"clip",value:function(t,e){}},{key:"arc",value:function(t,e,i,n,r,a){this.path.arc(t,e,i,n,r,a)}},{key:"arcTo",value:function(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){this.path.bezierCurveTo(t,e,i,n,r,a)}},{key:"closePath",value:function(){this.path.closePath()}},{key:"ellipse",value:function(t,e,i,n,r,a,s,o){}},{key:"lineTo",value:function(t,e){this.path.lineTo(t,e)}},{key:"moveTo",value:function(t,e){this.path.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}},{key:"rect",value:function(t,e,i,n){this.path.rect(t,e,i,n)}},{key:"createImageData",value:function(t,e){return null}},{key:"createLinearGradient",value:function(t,e,i,n){throw new Error("不支持createLinearGradient")}},{key:"createPattern",value:function(t,e){throw new Error("不支持createPattern")}},{key:"createRadialGradient",value:function(t,e,i,n,r,a){throw new Error("不支持createRadialGradient")}},{key:"createConicGradient",value:function(t,e,i,n){return null}},{key:"fill",value:function(t,e){}},{key:"fillRect",value:function(t,e,i,n){this.path.rect(t,e,i,n)}},{key:"clearRect",value:function(t,e,i,n){}},{key:"fillText",value:function(t,e,i){}},{key:"getImageData",value:function(t,e,i,n){return null}},{key:"getLineDash",value:function(){return[]}},{key:"isPointInPath",value:function(t,e){return this.matrix.transformPoint({x:t,y:e},Md),function(t,e,i){return wi(t,0,!1,e,i)}(this.path.commandList,Md.x,Md.y)}},{key:"isPointInStroke",value:function(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},Md);var i=Yo(this,this.lineWidth,this.dpr);return function(t,e,i,n){return wi(t,e,!0,i,n)}(this.path.commandList,i,Md.x,Md.y)}},{key:"measureText",value:function(t){throw new Error("不支持measureText")}},{key:"putImageData",value:function(t,e,i){throw new Error("不支持measureText")}},{key:"setLineDash",value:function(t){}},{key:"stroke",value:function(t){}},{key:"strokeRect",value:function(t,e,i,n){this.path.rect(t,e,i,n)}},{key:"strokeText",value:function(t,e,i){}},{key:"drawImage",value:function(){}},{key:"setCommonStyle",value:function(t,e,i,n,r){}},{key:"_setCommonStyle",value:function(t,e,i,n){}},{key:"setStrokeStyle",value:function(t,e,i,n,r){}},{key:"_setStrokeStyle",value:function(t,e,i,n){}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){}},{key:"setTextStyle",value:function(t,e){}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(Pd,t,e)}},{key:"onlyTranslate",value:function(){var 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}},{key:"release",value:function(){this.stack.forEach((function(t){return xo.free(t)})),this.stack.length=0}}]),t}();Ed=Td([D(),Cd("design:paramtypes",[Object,Number])],Ed);var Od=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ld=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rd=500,Id=500,jd=1,Dd=function(){function t(e){var i;a(this,t);var n=e.nativeCanvas,r=e.width,s=void 0===r?Rd:r,o=e.height,l=void 0===o?Id:o,u=e.dpr,h=void 0===u?jd:u,d=e.x,c=e.y,f=e.id,v=e.canvasControled,p=void 0===v||v;this._x=null!=d?d:0,this._y=null!=c?c:0,this._pixelWidth=s*h,this._pixelHeight=l*h,this._visiable=!1!==e.visiable,this.controled=p,this._displayWidth=s,this._displayHeight=l,this._dpr=h,this._nativeCanvas=n,this._id=null!==(i=n.id)&&void 0!==i?i:f,f&&(n.id=f),this.init(e)}return o(t,[{key:"displayWidth",get:function(){return this._pixelWidth/this._dpr}},{key:"displayHeight",get:function(){return this._pixelHeight/this._dpr}},{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x},set:function(t){this._x=t}},{key:"y",get:function(){return this._y},set:function(t){this._y=t}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"applyPosition",value:function(){}},{key:"resetStyle",value:function(t){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,i,n){return this._context.getImageData(t,e,i,n)}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}]),t}();Dd.env="browser",Dd=Od([D(),Ld("design:paramtypes",[Object])],Dd);var Nd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ud=function(){function t(){a(this,t)}return o(t,[{key:"configure",value:function(t){t.env===this.type&&t.setActiveEnvContribution(this)}},{key:"getNativeAABBBounds",value:function(t){return new e.AABBBounds}},{key:"removeDom",value:function(t){return!1}},{key:"createDom",value:function(t){return null}},{key:"getDynamicCanvasCount",value:function(){return 999}},{key:"getStaticCanvasCount",value:function(){return 999}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadBlob",value:function(t){return fetch(t).then((function(t){return t.blob()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"getElementTop",value:function(t,e){return 0}},{key:"getElementLeft",value:function(t,e){return 0}},{key:"getElementTopLeft",value:function(t,e){return{top:0,left:0}}}]),t}();Ud=Nd([D()],Ud);var zd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Hd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vd=function(){function t(){a(this,t),this._uid=k.GenAutoIncrementId()}return o(t,[{key:"onChange",value:function(t){this._onChangeCb=t}},{key:"configure",value:function(t,e){e.env===this.type&&t.setWindowHandler(this)}},{key:"release",value:function(){this.releaseWindow()}},{key:"isVisible",value:function(t){return!0}},{key:"onVisibleChange",value:function(t){}},{key:"getTopLeft",value:function(t){return{top:0,left:0}}}]),t}();Vd=zd([D(),Hd("design:paramtypes",[])],Vd);var Wd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gd=function(t,e){return function(i,n){e(i,n,t)}},Yd=function(){function t(e){a(this,t),this.pickItemInterceptorContributions=e,this.type="default",this.global=Ie.global}return o(t,[{key:"_init",value:function(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"pick",value:function(t,i,n){var r={graphic:null,group:null};n.pickerService=this;var a=0,s=0;if(n&&n.bounds){if(!n.bounds.contains(i.x,i.y))return r;a=n.bounds.x1,s=n.bounds.y1}this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);for(var o,l=new e.Matrix(1,0,0,1,a,s),u=t.length-1;u>=0&&!(r=t[u].isContainer?this.pickGroup(t[u],i,l,n):this.pickItem(t[u],i,l,n)).graphic;u--)o||(o=r.group);if(r.graphic||(r.group=o),this.pickContext&&(this.pickContext.inuse=!1),r.graphic){for(var h=r.graphic;h.parent;)h=h.parent;h.shadowHost&&(r.params={shadowTarget:r.graphic},r.graphic=h.shadowHost)}return r}},{key:"containsPoint",value:function(t,e,i){var n;return!!(null===(n=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===n?void 0:n.graphic)}},{key:"pickGroup",value:function(t,i,n,r){var a=this,s={group:null,graphic:null};if(!1===t.attribute.visibleAll)return s;var o=r.pickContext,l=o.modelMatrix;if(o.camera){var u=t.transMatrix,h=_o.allocate();if(wo(h,u),l){if(h){var d=_o.allocate();o.modelMatrix=To(d,l,h),_o.free(h)}}else wo(h,t.globalTransMatrix),o.modelMatrix=h}if(this.InterceptorContributions.length)for(var c=0;c<this.InterceptorContributions.length;c++){var f=this.InterceptorContributions[c];if(f.beforePickItem){var v=f.beforePickItem(t,this,i,r,{parentMatrix:n});if(v)return o.modelMatrix!==l&&_o.free(o.modelMatrix),o.modelMatrix=l,v}}var p=t.transMatrix,g=xo.allocateByObj(n),y=new e.Point(i.x,i.y);g.transformPoint(y,y);var b=t.AABBBounds.containsPoint(y);if(!b&&!t.stage.camera)return s;var m=this.pickItem(t,y.clone(),n,r);m&&m.graphic&&(s.graphic=m.graphic,s.params=m.params);var x=!1!==t.attribute.pickable&&b;return g.multiply(p.a,p.b,p.c,p.d,p.e,p.f),!1===t.attribute.childrenPickable||m&&m.graphic||Eh(t,me.zIndex,(function(o){if(o.isContainer){var l=new e.Point(i.x,i.y),u=Vi(t).group,h=t.attribute,d=h.scrollX,c=void 0===d?u.scrollX:d,f=h.scrollY,v=void 0===f?u.scrollY:f;l.x-=c,l.y-=v,s=a.pickGroup(o,l,g,r)}else{var p=new e.Point(i.x,i.y);g.transformPoint(p,p);var y=Vi(t).group,b=t.attribute,m=b.scrollX,x=void 0===m?y.scrollX:m,_=b.scrollY,A=void 0===_?y.scrollY:_;p.x-=x,p.y-=A;var k=a.pickItem(o,p,n,r);k&&k.graphic&&(s.graphic=k.graphic,s.params=k.params)}return!!s.graphic||!!s.group}),!0,!!o.camera),o.modelMatrix!==l&&_o.free(o.modelMatrix),o.modelMatrix=l,s.graphic||s.group||!x||t.stage.camera||(s.group=t),xo.free(g),s}},{key:"selectPicker",value:function(t){return this.pickerMap.get(t.numberType)||null}}]),t}();Yd=Wd([D(),Gd(0,I(tt)),Gd(0,N(ah)),Fd("design:paramtypes",[Object])],Yd);var Xd=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$d=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qd=function(){function t(){var e=this;a(this,t),this.global=Ie.global,this.global.hooks.onSetEnv.tap("global-picker-service",(function(t,i,n){e.configure(n,i)})),this.configure(this.global,this.global.env)}return o(t,[{key:"configure",value:function(t,e){}},{key:"pick",value:function(t,i,n){for(var r,a={graphic:null,group:null},s=new e.Matrix(1,0,0,1,0,0),o=0;o<t.length;o++){if(t[o].isContainer)a=this.pickGroup(t[o],i,s,n);else{var l=this.pickItem(t[o],i,s,n);l&&(a.graphic=l.graphic,a.params=l.params)}if(a.graphic)break;r||(r=a.group)}if(a.graphic||(a.group=r),a.graphic){for(var u=a.graphic;u.parent;)u=u.parent;u.shadowHost&&(a.params={shadowTarget:a.graphic},a.graphic=u.shadowHost)}return a}},{key:"containsPoint",value:function(t,e,i){return!!this.pickItem(t,e,null,i)}},{key:"pickGroup",value:function(t,i,n,r){var a=this,s={group:null,graphic:null};if(!1===t.attribute.visibleAll)return s;var o=t.transMatrix,l=new e.Point(i.x,i.y);n.transformPoint(l,l);var u=t.AABBBounds.containsPoint(l);if(!u)return s;var h=!1!==t.attribute.pickable&&u;return n.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((function(t){if(t.isContainer)s=a.pickGroup(t,i,n,r);else{var o=new e.Point(i.x,i.y);n.transformPoint(o,o);var l=a.pickItem(t,o,n,r);l&&(s.graphic=l.graphic,s.params=l.params)}return!!s.graphic||!!s.group})),s.graphic||s.group||!h||(s.group=t),s}},{key:"pickItem",value:function(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}}]),t}();qd=Xd([D(),$d("design:paramtypes",[])],qd);var Kd=function(){function t(){a(this,t),this.pools=[]}return o(t,[{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),Zd=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.rect(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.rect(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd);new Zd;var Jd=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.arc(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.arc(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd);new Jd;var Qd=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.area(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.area(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd);new Qd;var tc=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.circle(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.circle(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd);new tc;var ec=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.line(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.line(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd);new ec;var ic=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.path(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.path(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd);new ic;var nc=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.symbol(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.symbol(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd),rc=new nc,ac=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"allocate",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.text(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Ie.graphicService.creator.text(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}]),i}(Kd),sc=new ac;new(function(){function t(){a(this,t),this.map={text:sc,symbol:rc}}return o(t,[{key:"gc",value:function(t){var e=this;t.isContainer?t.forEachChildren((function(t){return e.gc(t)})):this.gcItem(t)}},{key:"gcItem",value:function(t){var e=this.map[t.type];e&&e.free(t)}}]),t}());const oc=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class lc extends Tr{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,i,n){e.isPlainObject(this.attribute[t])&&e.isPlainObject(i)&&!e.isFunction(this.attribute[t])&&!e.isFunction(i)?e.merge(this.attribute[t],i):this.attribute[t]=i,oc.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>oc.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,i){e.isNil(i)&&(i=Object.keys(t));for(let n=0;n<i.length;n++){const r=i[n];!e.isPlainObject(this.attribute[r])||e.isFunction(this.attribute[r])||e.isFunction(t[r])?this.attribute[r]=t[r]:e.merge(this.attribute[r],t[r])}}bindEvents(){}_getNodeId(t){return`${this.id}-${this.name}-${t}`}}const uc={debounce:e.debounce,throttle:e.throttle};class hc extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},hc.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{var i,n;const{viewX:r,viewY:a}=t,{direction:s,width:o,height:l,range:u}=this.attribute,h=this._sliderSize,[d,c]=this._getScrollRange();let f;if("vertical"===s){const t=a-this._viewPosition.y,i=e.clamp(t-h/2,d,c);f=t/l,this._slider.setAttribute("y",i,!0)}else{const t=r-this._viewPosition.x,i=e.clamp(t-h/2,d,c);f=t/o,this._slider.setAttribute("x",i,!0)}this.setScrollRange([f-(u[1]-u[0])/2,f+(u[1]-u[0])/2],!1),(null===(i=this.stage)||void 0===i?void 0:i.autoRender)||null===(n=this.stage)||void 0===n||n.renderNextFrame()},this._onSliderPointerDown=t=>{t.stopPropagation();const{direction:e}=this.attribute;this._prePos="horizontal"===e?t.clientX:t.clientY,"browser"===xd.env?(xd.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),xd.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute;let i,n,r=0;const{width:a,height:s}=this._getSliderRenderBounds();return"vertical"===e?(n=t.clientY,r=n-this._prePos,i=r/s):(n=t.clientX,r=n-this._prePos,i=r/a),[n,i]},this._onSliderPointerMove=uc[this.attribute.delayType]((t=>{t.stopPropagation();const e=this.getScrollRange(),[i,n]=this._computeScrollValue(t);this.setScrollRange([e[0]+n,e[1]+n],!0),this._prePos=i}),this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:i=!0,range:n,limitRange:r=[0,1]}=this.attribute,a=this.getScrollRange(),[s,o]=this._computeScrollValue(t),l=[a[0]+o,a[1]+o];i||this._onChange({pre:n,value:e.clampRange(l,r[0],r[1])}),"browser"===xd.env?(xd.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),xd.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,i=!0){var n,r;const{direction:a="horizontal",limitRange:s=[0,1],range:o,realTime:l=!0}=this.attribute,u=e.clampRange(t,s[0],s[1]);if(i){const t=this._getSliderPos(u);this._slider&&("horizontal"===a?this._slider.setAttribute("x",t[0],!0):this._slider.setAttribute("y",t[0],!0),(null===(n=this.stage)||void 0===n?void 0:n.autoRender)||null===(r=this.stage)||void 0===r||r.renderNextFrame())}this.attribute.range=u,l&&this._onChange({pre:o,value:u})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",uc[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:i,height:n,range:r,limitRange:a=[0,1],railStyle:s,sliderStyle:o,padding:l=2}=this.attribute,u=this.createOrUpdateChild("scrollbar-container",{},"group"),h=u.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:i,height:n},s),"rect");this._rail=h;const d=this._getSliderRenderBounds(),c=this._getSliderPos(e.clampRange(r,a[0],a[1])),f=c[1]-c[0];let v;this._sliderSize=f,v="horizontal"===t?{x:c[0],y:d.y1,width:f,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:f};const p=u.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},v),{cornerRadius:this._getDefaultSliderCornerRadius()}),o),{boundsPadding:e.normalizePadding(l),pickMode:"imprecise"}),"rect");this._slider=p,this._container=u;const g=this._container.AABBBounds;this._viewPosition={x:g.x1,y:g.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:i,padding:n=2}=this.attribute,[r,a,s,o]=e.normalizePadding(n),l={x1:o,y1:r,x2:t-a,y2:i-s,width:t-(o+a),height:i-(r+s)};return this._sliderRenderBounds=l,l}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:n,x1:r,y1:a}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+r,i*t[1]+r]:[n*t[0]+a,n*t[1]+a]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:i}=this.attribute,[n,r]=e.clampRange(t,0,1),{width:a,height:s,x1:o,y1:l}=this._getSliderRenderBounds(),u=this._sliderSize;return"horizontal"===i?e.clampRange([o+n*a,o+r*a],o,a-u):e.clampRange([l+n*s,l+r*s],l,s-u)}_onChange(t){var e;const i=new Yi("scroll",t);i.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,this.dispatchEvent(i)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function dc(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}function cc(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function fc(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))}var vc;hc.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0},"function"==typeof SuppressedError&&SuppressedError;let pc=vc=class{constructor(){this.name="scrollbar",this.activeEvent="onRegister",this._uid=k.GenAutoIncrementId(),this.key=this.name+this._uid,this.scroll=t=>{var i;const n=t.target,r=this.getScrollContainer(n),{g:a}=r;let{showH:s,showV:o}=r;if(!a||1===a.count)return;this.scrollContainerBounds=a.AABBBounds.clone(),e.abs(t.deltaX)>e.abs(t.deltaY)?(s=s&&!0,o=o&&!1):(s=s&&!1,o=o&&!0),a.setAttributes({scrollX:s?(a.attribute.scrollX||0)+t.deltaX:a.attribute.scrollX||0,scrollY:o?(a.attribute.scrollY||0)+t.deltaY:a.attribute.scrollY||0});const l=this.childrenBounds,u=this.scrollContainerBounds;l.clear(),a.forEachChildren((t=>{l.union(t.AABBBounds)})),l.transformWithMatrix(a.transMatrix),s&&u.x1<=l.x1&&u.x2>=l.x2&&(s=!1),o&&u.y1<=l.y1&&u.y2>=l.y2&&(o=!1);const h=a.transMatrix;u.translate(-h.e,-h.f),l.translate(-h.e,-h.f),s&&(l.x1=e.min(l.x1,u.x1),l.x2=e.max(l.x2,u.x2)),o&&(l.y1=e.min(l.y1,u.y1),l.y2=e.max(l.y2,u.y2)),l.translate(a.attribute.scrollX,a.attribute.scrollY);const d=(null!==(i=a.shadowRoot)&&void 0!==i?i:a.attachShadow()).createOrUpdateChild("scroll-bar",{},"group"),{h:c,v:f,deltaH:v,deltaV:p}=this.addOrUpdateScroll(s,o,d,a);a.setAttributes({scrollX:c?a.attribute.scrollX||0:(a.attribute.scrollX||0)+v,scrollY:f?a.attribute.scrollY||0:(a.attribute.scrollY||0)+p})}}activate(t){this.pluginService=t;const{stage:i}=this.pluginService;this.childrenBounds=new e.AABBBounds,i.addEventListener("wheel",this.scroll),this.params=vc.defaultParams}addOrUpdateScroll(t,e,i,n){const r=i.children;let a=!1,s=!1,o=0,l=0;if(t){const t=r.filter((t=>"vertical"!==t.attribute.direction))[0],e=this.addOrUpdateHScroll(this.scrollContainerBounds,i,t);a=e.valid,o=e.delta,this.disappearScrollBar(t,s)}if(e){const t=r.filter((t=>"vertical"===t.attribute.direction))[0],e=this.addOrUpdateVScroll(this.scrollContainerBounds,i,t);s=e.valid,l=e.delta,this.disappearScrollBar(t,s)}return{h:a,deltaH:o,v:s,deltaV:l}}addOrUpdateHScroll(t,e,i){i||(i=new hc({direction:"horizontal",x:0,y:0,width:t.width(),height:12,padding:[2,0],railStyle:{fill:"rgba(0, 0, 0, .1)"},range:[0,.05]}),e.add(i));const n=i.AABBBounds,r=this.childrenBounds,a=t.y2-n.height(),s=Math.min(n.width()/this.childrenBounds.width(),1);let o=(t.x1-r.x1)/(r.width()-t.width())*(1-s),l=!0,u=0;return o<0?(o=0,l=!1,u=t.x1-r.x1):o+s>1&&(o=1-s,l=!1,u=t.x1-r.x1-(r.width()-t.width())),i.setAttributes({y:a,visibleAll:!0,range:[o,o+s]}),{valid:l,delta:u}}addOrUpdateVScroll(t,e,i){i||(i=new hc({direction:"vertical",x:0,y:0,width:12,height:t.height(),padding:[2,0],railStyle:{fill:"rgba(0, 0, 0, .1)"},range:[0,.05]}),e.add(i));const n=i.AABBBounds,r=t.x2-n.width(),a=this.childrenBounds,s=Math.min(n.height()/a.height(),1);let o=(t.y1-a.y1)/(a.height()-t.height())*(1-s),l=!0,u=0;return o<0?(o=0,l=!1,u=t.y1-a.y1):o+s>1&&(o=1-s,l=!1,u=t.y1-a.y1-(a.height()-t.height())),i.setAttributes({x:r,visibleAll:!0,range:[o,o+s]}),{valid:l,delta:u}}disappearScrollBar(t,e){var i;t._plugin_timeout&&clearTimeout(t._plugin_timeout),t._plugin_timeout=setTimeout((()=>{t.setAttribute("visibleAll",!1)}),null!==(i=this.params.timeout)&&void 0!==i?i:0)}getScrollContainer(t){let e=t;for(;e;){if(e.attribute.overflow&&"hidden"!==e.attribute.overflow){const t=e.attribute.overflow;let i=!1,n=!1;return"scroll"===t?(i=!0,n=!0):(i="scroll-x"===t,n=!i),{g:e,showH:i,showV:n}}e=e.parent}return null}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("wheel",this.scroll)}};pc.defaultParams={timeout:500},pc=vc=cc([D()],pc);const gc=new B(((t,e,i,n)=>{i(pc)||(t(pc).toSelf(),t(dh).toService(pc))}));function yc(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&yc(t,e)}))}const bc=t=>!e.isNil(t)&&!1!==t.visible;const mc=["#ffffff","#000000"],{Color:xc}=e.ColorUtil;function _c(t,e,i,n,r,a){if("string"!=typeof t||"string"!=typeof e)return t;const s=new xc(t).toHex(),o=new xc(e).toHex();return Ac(s,o,i,n,a)?s:function(t,e,i,n,r,a){const s=[];r&&(r instanceof Array?s.push(...r):s.push(r));s.push(...mc);for(const r of s)if(t!==r&&Ac(r,e,i,n,a))return r;return}(s,o,i,n,r,a)}function Ac(t,e,i,n,r){if("lightness"===r){const i=xc.getColorBrightness(new xc(e));return xc.getColorBrightness(new xc(t))<.5?i>=.5:i<.5}return n?kc(t,e)>n:"largeText"===i?kc(t,e)>3:kc(t,e)>4.5}function kc(t,e){const i=Bc(t),n=Bc(e);return((i>n?i:n)+.05)/((i>n?n:i)+.05)}function Bc(t){const i=e.ColorUtil.hexToRgb(t),n=i[0]/255,r=i[1]/255,a=i[2]/255;let s,o,l;s=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),o=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4),l=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4);return.2126*s+.7152*o+.0722*l}function Sc(t,e,i,n){let r;switch(t){case"base":r=e;break;case"invertBase":r=i;break;case"similarBase":r=n}return r}function wc(t,e){return[t[0]*e,t[1]*e]}function Tc(t,e,i){const n=function(t,e){const[i,n]=t,[r,a]=e,s=Math.sqrt((i*i+n*n)*(r*r+a*a)),o=s&&(i*r+n*a)/s;return Math.acos(Math.min(Math.max(o,-1),1))}(t,e),r=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return i?r?2*Math.PI-n:n:r?n:2*Math.PI-n}const Cc=-.5*Math.PI,Pc=1.5*Math.PI,Mc="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";var Ec;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Ec||(Ec={}));const Oc={[Ec.selectedReverse]:{},[Ec.selected]:{},[Ec.hover]:{},[Ec.hoverReverse]:{}},Lc={container:"",width:30,height:30,style:{}},Rc=(t,i,n)=>new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:Mc,fontSize:11},getTextBounds:n?void 0:Wo,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t);function Ic(t,e){var i;if(!t)return{width:0,height:0};const n=Wo({text:t,fontFamily:e.fontFamily,fontSize:e.fontSize||12,fontWeight:e.fontWeight,textAlign:null!==(i=e.textAlign)&&void 0!==i?i:"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||12});return{width:n.width(),height:n.height()}}class jc extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},jc.defaultAttributes,t)),this.name="tag"}render(){var t,i,n;const{text:r="",textStyle:a={},shape:s={},panel:o={},space:l=4,minWidth:u,maxWidth:h,padding:d=4,visible:c,state:f,type:v}=this.attribute,p=e.normalizePadding(d),g=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let y,b=p[1]+p[3],m=p[0]+p[2],x=0,_=0;const{visible:A}=s,k=dc(s,["visible"]);if(e.isBoolean(A)){const t=(null==k?void 0:k.size)||10,i=e.isNumber(t)?t:Math.max(t[0],t[1]);y=g.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},k),{visible:A,x:i/2,y:i/2}),"symbol"),e.isEmpty(null==f?void 0:f.shape)||(y.states=f.shape),A&&(_=i+l)}let B;if(b+=_,x+=_,"rich"===v){const n=Object.assign(Object.assign({textConfig:r,visible:e.isValid(r)&&!1!==c},a),{x:x,y:0,width:null!==(t=a.width)&&void 0!==t?t:0,height:null!==(i=a.height)&&void 0!==i?i:0});B=g.createOrUpdateChild("tag-text",n,"richtext");const{visible:s}=o,l=dc(o,["visible"]);if(c&&e.isBoolean(s)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},l),{visible:s&&!!r,x:B.AABBBounds.x1,y:B.AABBBounds.y1,width:B.AABBBounds.width(),height:B.AABBBounds.height()}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}else if("html"===v){const t=Object.assign(Object.assign({textConfig:[],visible:e.isValid(r)&&!1!==c,html:Object.assign(Object.assign({dom:r},Lc),a)},a),{x:x,y:0});B=g.createOrUpdateChild("tag-text",t,"richtext");const{visible:i}=o,n=dc(o,["visible"]);if(c&&e.isBoolean(i)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},n),{visible:i&&!!r,x:B.AABBBounds.x1,y:B.AABBBounds.y1,width:B.AABBBounds.width(),height:B.AABBBounds.height()}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}else{const t=Object.assign(Object.assign({text:r,visible:e.isValid(r)&&!1!==c,lineHeight:null==a?void 0:a.fontSize},a),{x:x,y:0});e.isNil(t.lineHeight)&&(t.lineHeight=a.fontSize),B=g.createOrUpdateChild("tag-text",t,"text"),e.isEmpty(null==f?void 0:f.text)||(B.states=f.text);const i=Ic(t.text,a),l=i.width,d=i.height;b+=l;const v=null!==(n=s.size)&&void 0!==n?n:10,A=e.isNumber(v)?v:Math.max(v[0],v[1]);m+=Math.max(d,(null==s?void 0:s.visible)?A:0);const{textAlign:k,textBaseline:S}=a;(e.isValid(u)||e.isValid(h))&&(e.isValid(u)&&b<u&&(b=u),e.isValid(h)&&b>h&&(b=h,B.setAttribute("maxLineWidth",h-p[1]-p[2])));let w=0,T=0;"center"===k?(w-=b/2,y&&y.setAttribute("x",(y.attribute.x||0)-l/2),g.setAttribute("x",-_/2)):"right"===k||"end"===k?(w-=b,y&&y.setAttribute("x",(y.attribute.x||0)-l),g.setAttribute("x",-p[1]-_)):"left"!==k&&"start"!==k||g.setAttribute("x",p[3]),"middle"===S?(T-=m/2,y&&y.setAttribute("y",0)):"bottom"===S?(T-=m,y&&y.setAttribute("y",-d/2),g.setAttribute("y",-p[2])):"top"===S&&(g.setAttribute("y",p[0]),y&&y.setAttribute("y",d/2));const{visible:C}=o,P=dc(o,["visible"]);if(c&&e.isBoolean(C)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},P),{visible:C&&!!r,x:w,y:T,width:b,height:m}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}}}jc.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const Dc=new e.AABBBounds;class Nc extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Nc.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,i,n,r,a,s,o,l;const{titleStyle:u={},position:h,contentStyle:d={},panel:c={},space:f=4,minWidth:v=0,maxWidth:p=1/0,padding:g=4,maxWidthPercent:y,visible:b,state:m,dx:x=0,dy:_=0}=this.attribute;let{title:A="",content:k=""}=this.attribute;A=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(A):A,k=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(k):k;const B=e.normalizePadding(g),S=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),w=p-B[1]-B[3],T=e.isValid(A)&&!1!==b,C=Object.assign(Object.assign({text:e.isArray(A)?A:[A],visible:T},u),{x:B[3],y:B[0],maxLineWidth:w,textAlign:"left",textBaseline:"top"}),P=S.createOrUpdateChild("poptip-title",C,"wrapText");e.isEmpty(null==m?void 0:m.title)||(P.states=m.title);const M=P.AABBBounds,E=M.height(),O=M.width();let L=E+f;T||(L=0);const R=e.isValid(k)&&!1!==b,I=Object.assign(Object.assign({text:e.isArray(k)?k:[k],visible:R},d),{x:B[3],y:B[0]+L,maxLineWidth:w,textAlign:"left",textBaseline:"top"}),j=S.createOrUpdateChild("poptip-content",I,"wrapText");e.isEmpty(null==m?void 0:m.content)||(j.states=m.content);const D=j.AABBBounds,N=D.height(),U=D.width();R&&(L+=N);let z=e.max(O+B[1]+B[3],U+B[1]+B[3]);z>p?z=p:z<v&&(z=v);let H=B[0]+B[2]+L;const{visible:V}=c,W=dc(c,["visible"]),F=null!==(t=W.size)&&void 0!==t?t:12,G=e.isArray(F)?[F[0]+(null!==(i=W.space)&&void 0!==i?i:0),F[1]+(null!==(n=W.space)&&void 0!==n?n:0)]:F+(null!==(r=W.space)&&void 0!==r?r:0),Y=null!==(a=W.lineWidth)&&void 0!==a?a:1,X=this.stage?[null!==(s=this.stage.viewWidth)&&void 0!==s?s:this.stage.width,null!==(o=this.stage.viewHeight)&&void 0!==o?o:this.stage.height]:void 0;if(X){const t=this.AABBBounds,i=null!==(l=this.attribute.x)&&void 0!==l?l:t.x1,n=X[0]-t.x1;let r=Math.max(i,n);const a=(e.isArray(F)?F[0]:12)+3;if(r=Math.min(r-a,r*y),r<z){z=r;const t=B[1]+B[3];P.setAttribute("maxLineWidth",r-t),j.setAttribute("maxLineWidth",r-t),H=B[0]+B[2],T&&(H+=P.AABBBounds.height()+f),H+=j.AABBBounds.height()}}const $="auto"===h;let q,K=-1/0;for(let t=0;t<this.positionList.length+1;t++){const i=$?this.positionList[t===this.positionList.length?q:t]:h,{angle:n,offset:r,rectOffset:a}=this.getAngleAndOffset(i,z,H,e.isArray(G)?G:[G,G-Y]);if(e.isBoolean(V)){const t=(e.isArray(F)?F[0]:F)/4,i=S.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},W),{visible:V&&(R||T),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:n,dx:r[0],dy:r[1],size:F,zIndex:-9}),"symbol");e.isEmpty(null==m?void 0:m.panel)||(i.states=m.panel);const a=S.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},W),{visible:V&&(R||T),x:0,y:0,width:z,height:H,zIndex:-8}),"rect");e.isEmpty(null==m?void 0:m.panel)||(a.states=m.panel)}if(S.setAttributes({x:-r[0]+x,y:-r[1]+_}),!$||!X)break;{Dc.setValue(0,0,z,H).transformWithMatrix(S.globalTransMatrix);const i=Dc,n=(new e.Bounds).setValue(0,0,X[0],X[1]);if(e.rectInsideAnotherRect(i,n,!1))break;{const r=e.getRectIntersect(i,n,!1),a=(r.x2-r.x1)*(r.y2-r.y1);a>K&&(K=a,q=t)}}}}getAngleAndOffset(t,i,n,r){const a=r[1]/2;switch(t){case"tl":return{angle:e.pi/2*3,offset:[i/4,n+a],rectOffset:[-i/4,-n-r[1]]};case"top":return{angle:e.pi/2*3,offset:[i/2,n+a],rectOffset:[0,-n-r[1]]};case"tr":return{angle:e.pi/2*3,offset:[i/4*3,n+a],rectOffset:[i/4*3,-n-r[1]]};case"rt":return{angle:0,offset:[-a,n/5],rectOffset:[i/4*3,-n-r[1]]};case"right":return{angle:0,offset:[-a,n/2],rectOffset:[i/4*3,-n-r[1]]};case"rb":return{angle:0,offset:[-a,n/5*4],rectOffset:[i/4*3,-n-r[1]]};case"bl":return{angle:e.pi/2,offset:[i/4,-a],rectOffset:[-i/4,-n-r[1]]};case"bottom":return{angle:e.pi/2,offset:[i/2,-a],rectOffset:[0,-n-r[1]]};case"br":return{angle:e.pi/2,offset:[i/4*3,-a],rectOffset:[i/4*3,-n-r[1]]};case"lt":return{angle:e.pi,offset:[i+a,n/5],rectOffset:[-i/4,-n-r[1]]};case"left":return{angle:e.pi,offset:[i+a,n/2],rectOffset:[0,-n-r[1]]};case"lb":return{angle:e.pi,offset:[i+a,n/5*4],rectOffset:[i/4*3,-n-r[1]]}}}}Nc.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};const Uc={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},zc={poptip:e.merge({},Uc)};let Hc=class{render(t,i,n,r,a,s,o,l,u,h,d,c,f){var v,p,g;if(1===t._showPoptip){const{visible:i,visibleCb:n}=t.attribute.poptip||{};if(!1===i||n&&!1===n(t))return;const r={};e.merge(r,Nc.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(r):this.poptipComponent=new Nc(r);let a=t.attribute.poptip||{};if("text"===t.type&&null==a.title&&null==a.content){const i={};p=i,g=a,e.merge(p,zc.poptip,g),a=i,a.content=null!==(v=a.content)&&void 0!==v?v:t.attribute.text}const s=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},a),{x:s.e,y:s.f})),h.stage.tryInitInteractiveLayer();const o=h.stage.getLayer("_builtin_interactive");o&&o.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};Hc=cc([D()],Hc);let Vc=class{constructor(){this.name="poptip",this.activeEvent="onRegister",this._uid=k.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if(e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};Vc=cc([D()],Vc);let Wc=class{constructor(){this.name="poptipForText",this.activeEvent="onRegister",this._uid=k.GenAutoIncrementId(),this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)},this.poptip=t=>{const e=t.target;if("text"!==e.type||!e.cliped||e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i={}}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip),e.addEventListener("pointerleave",this.pointerlave)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip),e.removeEventListener("pointerleave",this.pointerlave)}};Wc=cc([D()],Wc);const Fc=new B(((t,e,i,n)=>{i(Hc)||(t(Hc).toSelf().inSingletonScope(),t(ha).toService(Hc)),i(Vc)||(t(Vc).toSelf(),t(dh).toService(Vc)),i(Wc)||(t(Wc).toSelf(),t(dh).toService(Wc))}));class Gc extends lc{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}class Yc extends Gc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Yc.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},n),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}Yc.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};class Xc extends Gc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Xc.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},n),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}Xc.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}};class $c extends Gc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},$c.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),n),"arc")}setLocation(t){const{center:i}=this.attribute,n=e.PointService.distancePP(t,i);this.setAttribute("radius",n)}}$c.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};class qc extends Gc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},qc.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:n=0,sectorStyle:r}=this.attribute,{startAngle:a,endAngle:s}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:n,startAngle:a,endAngle:s}),r),"arc")}setLocation(t){const{center:i,startAngle:n=Cc,endAngle:r=Pc}=this.attribute,a=r-n,s=e.radianToDegree(e.getAngleByPoint(i,t));this.setAttributes({startAngle:s-a/2,endAngle:s+a/2})}}qc.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}};class Kc extends Gc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Kc.defaultAttributes,t))}renderCrosshair(t){const{center:i,radius:n,sides:r=6,lineStyle:a}=this.attribute,{startAngle:s,endAngle:o}=this.attribute,l=(o-s)%(2*Math.PI)==0,u=(o-s)/r;let h;for(let t=0;t<=r;t++){const a=s+u*t,o=e.polarToCartesian(i,n,a);0===t?h=`M${o.x},${o.y}`:h+=`L${o.x},${o.y}`,t===r&&l&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:h},a),"path")}setLocation(t){const{center:i}=this.attribute,n=e.PointService.distancePP(t,i);this.setAttribute("radius",n)}}Kc.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const Zc=5,Jc=31,Qc=32,tf=new Uint32Array(Qc+1),ef=new Uint32Array(Qc+1);ef[0]=0,tf[0]=~ef[0];for(let t=1;t<=Qc;++t)ef[t]=ef[t-1]<<1|1,tf[t]=~ef[t];function nf(t,e,i=0){const n=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*i+n)/n),a=~~((e+2*i+n)/n),s=t=>~~((t+i)/n);return s.invert=t=>t*n-i,s.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+Qc)/Qc));function n(t,e){i[t]|=e}function r(t,e){i[t]&=e}return{array:i,get:(e,n)=>{const r=n*t+e;return i[r>>>Zc]&1<<(r&Jc)},set:(e,i)=>{const r=i*t+e;n(r>>>Zc,1<<(r&Jc))},clear:(e,i)=>{const n=i*t+e;r(n>>>Zc,~(1<<(n&Jc)))},getRange:({x1:n,y1:r,x2:a,y2:s})=>{if(a<0||s<0||n>t||r>e)return!0;let o,l,u,h,d=s;for(;d>=r;--d)if(o=d*t+n,l=d*t+a,u=o>>>Zc,h=l>>>Zc,u===h){if(i[u]&tf[o&Jc]&ef[1+(l&Jc)])return!0}else{if(i[u]&tf[o&Jc])return!0;if(i[h]&ef[1+(l&Jc)])return!0;for(let t=u+1;t<h;++t)if(i[t])return!0}return!1},setRange:({x1:i,y1:r,x2:a,y2:s})=>{if(a<0||s<0||i>t||r>e)return;let o,l,u,h,d;for(;r<=s;++r)if(o=r*t+i,l=r*t+a,u=o>>>Zc,h=l>>>Zc,u===h)n(u,tf[o&Jc]&ef[1+(l&Jc)]);else for(n(u,tf[o&Jc]),n(h,ef[1+(l&Jc)]),d=u+1;d<h;++d)n(d,4294967295)},clearRange:({x1:e,y1:i,x2:n,y2:a})=>{let s,o,l,u,h;for(;i<=a;++i)if(s=i*t+e,o=i*t+n,l=s>>>Zc,u=o>>>Zc,l===u)r(l,ef[s&Jc]|tf[1+(o&Jc)]);else for(r(l,ef[s&Jc]),r(u,tf[1+(o&Jc)]),h=l+1;h<u;++h)r(h,0)},outOfBounds:({x1:i,y1:n,x2:r,y2:a})=>i<0||n<0||a>=e||r>=t,toImageData:n=>{const r=n.createImageData(t,e),a=r.data;for(let n=0;n<e;++n)for(let e=0;e<t;++e){const r=n*t+e,s=4*r,o=i[r>>>Zc]&1<<(r&Jc);a[s+0]=255*o,a[s+1]=255*o,a[s+2]=255*o,a[s+3]=31}return r}}}(r,a),s.ratio=n,s.padding=i,s.width=t,s.height=e,s}function rf(t,i,n=!1){if(n){const{x1:n,x2:r,y1:a,y2:s}=i,o=e.clamp(n,0,t.width),l=e.clamp(r,0,t.width),u=e.clamp(a,0,t.height),h=e.clamp(s,0,t.height);return{x1:t(o),x2:t(l),y1:t(u),y2:t(h)}}return{x1:t(i.x1),x2:t(i.x2),y1:t(i.y1),y2:t(i.y2)}}function af(t,e,i,n=!0,r=0){let a=i;r>0&&(a={x1:i.x1-r,x2:i.x2+r,y1:i.y1-r,y2:i.y2+r}),a=rf(t,a);return!(n&&e.outOfBounds(a))&&!e.getRange(a)}function sf(t,i,n,r=[],a=!0,s=0){const o=r.filter((t=>e.isValid(t)));for(let e=0;e<o.length;e++){const r=n.clone();if(r.setAttributes(o[e]),r.update(),af(t,i,rf(t,r.AABBBounds),a,s))return i.setRange(rf(t,r.AABBBounds,!0)),o[e]}return!1}function of(t,i,n,r,a,s,o){var l,u;const h=null===(l=r.overlap)||void 0===l?void 0:l.clampForce,d=null===(u=r.overlap)||void 0===u?void 0:u.overlapPadding;if("bound"===n.type||"position"===n.type){if(e.isFunction(o)){const l=((e.isFunction(n.position)?n.position(a.attribute):n.position)||function(t){if("rect"===t)return uf;return lf}(r.type)).map((t=>o(a.AABBBounds,s,t,r.offset)));return sf(t,i,a,l,h,d)}return!1}if("moveY"===n.type){const r=(n.offset?e.isFunction(n.offset)?n.offset(a.attribute):n.offset:[]).map((t=>({x:a.attribute.x,y:a.attribute.y+t})));return sf(t,i,a,r,h,d)}if("moveX"===n.type){const r=(n.offset?e.isFunction(n.offset)?n.offset(a.attribute):n.offset:[]).map((t=>({x:a.attribute.x+t,y:a.attribute.y})));return sf(t,i,a,r,h,d)}return!1}const lf=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],uf=["top","inside-top","inside"];function hf(t,e,i){const{x1:n,x2:r,y1:a,y2:s}=t.AABBBounds,o=Math.min(n,r),l=Math.max(n,r),u=Math.min(a,s),h=Math.max(a,s);let d=0,c=0;return o<0&&l-o<=e?d=-o:l>e&&o-(l-e)>=0&&(d=e-l),u<0&&h-u<=i?c=-u:h>i&&u-(h-i)>=0&&(c=i-h),{dx:d,dy:c}}const df={fadeIn:(t={})=>{var e,i,n;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(n=t.strokeOpacity)&&void 0!==n?n:1}}},fadeOut:(t={})=>{var e,i,n;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(n=t.strokeOpacity)&&void 0!==n?n:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function cf(t,e){var i,n;return null!==(n=null===(i=df[e])||void 0===i?void 0:i.call(df,t))&&void 0!==n?n:{from:{},to:{}}}const ff=(t,i,n,r)=>{const a=Object.assign({},t.attribute),s=Object.assign({},i.attribute);return e.array(null==r?void 0:r.excludeChannels).forEach((t=>{delete s[t]})),Object.keys(s).forEach((t=>{n&&!n.includes(t)&&delete s[t]})),{from:a,to:s}};function vf(t,i,n,r){t.attribute.text!==i.attribute.text&&e.isValidNumber(Number(t.attribute.text)*Number(i.attribute.text))&&t.animate().play(new kn({text:t.attribute.text},{text:i.attribute.text},n,r))}const pf={mode:"same-time",duration:300,easing:"linear"};function gf(t,e,i,n){const r=function(t){return t.radius?{x:Math.cos(t.angle)*t.radius,y:Math.sin(t.angle)*t.radius}:{x:0,y:0}}({radius:i,angle:n});return{x:t+r.x,y:e+r.y}}function yf(t){return(t=function(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function bf(t){return 3===t||4===t}function mf(t,e){const{x1:i,y1:n,x2:r,y2:a}=t,{x1:s,y1:o,x2:l,y2:u}=e;return!(i<=s&&r<=s||i>=l&&r>=l||n<=o&&a<=o||n>=u&&a>=u)}const xf=(t,e,i="top",n=0)=>{if(!t)return;const{x1:r,y1:a,x2:s,y2:o}=t,l=Math.abs(s-r),u=Math.abs(o-a),h=(e.x1+e.x2)/2,d=(e.y1+e.y2)/2;let c=0,f=0,v=0,p=0;e&&(v=Math.abs(e.x1-e.x2)/2,p=Math.abs(e.y1-e.y2)/2);const g={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":f=-1;break;case"bottom":f=1;break;case"left":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(g[i]*(Math.PI/180)),f=Math.cos(g[i]*(Math.PI/180));break;case"center":c=0,f=0}return{x:h+c*(n+v)+Math.sign(c)*(l/2),y:d+f*(n+p)+Math.sign(f)*(u/2)}},_f=t=>{if(!t||!t.attribute)return[];const{points:e,segments:i}=t.attribute;if(i&&i.length){const t=[];return i.forEach((e=>{e.points.forEach((e=>{t.push(e)}))})),t}return e};function Af(t,e,i="end",n=0){if(!t||!e)return;const{x1:r,x2:a}=t,s=Math.abs(a-r),o=e.x1;let l=o;return"end"===i?l=o+s/2+n:"start"===i&&(l=o-s/2-n),{x:l,y:e.y1}}class kf extends lc{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},kf.defaultAttributes,t)),this.name="label",this._onHover=t=>{const i=t.target;i===this._lastHover||e.isEmpty(i.states)||(i.addState(Ec.hover,!0),yc(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Ec.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(yc(this,(t=>{e.isEmpty(t.states)||(t.removeState(Ec.hoverReverse),t.removeState(Ec.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState("selected"))return this._lastSelect=null,void yc(this,(t=>{e.isEmpty(t.states)||(t.removeState(Ec.selectedReverse),t.removeState(Ec.selected))}));e.isEmpty(i.states)||(i.addState(Ec.selected,!0),yc(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Ec.selectedReverse,!0)})),this._lastSelect=i)},this._handleRelatedGraphicSetState=t=>{var e,i,n;if((null===(e=t.detail)||void 0===e?void 0:e.type)===bt.STATE){const e=null!==(n=null===(i=t.target)||void 0===i?void 0:i.currentStates)&&void 0!==n?n:[];(this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)]).forEach((t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))}))}}}labeling(t,e,i,n){}_labelLine(t){}render(){if(this._prepare(),e.isNil(this._idToGraphic)||this._isCollectionBase&&e.isNil(this._idToPoint))return;const{overlap:t,smartInvert:i,dataFilter:n,customLayoutFunc:r,customOverlapFunc:a}=this.attribute;let s,o=this.attribute.data;e.isFunction(n)&&(o=n(o)),s=e.isFunction(r)?r(o,this.getRelatedGrphic,this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(o),e.isFunction(a)?s=a(s,this.getRelatedGrphic,this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(s=this._overlapping(s)),!1!==i&&this._smartInvert(s),this._renderLabels(s)}_bindEvent(t){if(this.attribute.disableTriggerEvent)return;if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const i=this.attribute.state;i&&!e.isEmpty(i)&&(t.states=i)}_setStatesOfLabelLine(t){if(!t)return;const i=this.attribute.labelLineState;i&&!e.isEmpty(i)&&(t.states=i)}_createLabelText(t){var e,i;if("rich"===t.textType){t.textConfig=t.text,t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0;const n=zo(t);return this._bindEvent(n),this._setStatesOfText(n),n}if("html"===t.textType){t.textConfig=[],t.html=Object.assign(Object.assign({dom:t.text},Lc),t);const e=zo(t);return this._bindEvent(e),this._setStatesOfText(e),e}const n=jo(t);return this._bindEvent(n),this._setStatesOfText(n),n}_prepare(){var t,i,n,r,a;const s=[];let o;if(o=e.isFunction(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),o.forEach((t=>{"willRelease"!==t.releaseStatus&&s.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(i=this._idToPoint)||void 0===i||i.clear(),this._baseMarks=s,this._isCollectionBase="line-data"===this.attribute.type,!s||0===s.length)return;const{data:l}=this.attribute;if(l&&0!==l.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let i=0;i<s.length;i++){const n=s[i],r=_f(n);if(null==r?void 0:r.length)for(let i=0;i<r.length;i++){const a=l[t];a&&r[i]&&(e.isValid(a.id)||(a.id=`vrender-component-${this.name}-${t}`),this._idToPoint.set(a.id,r[i]),this._idToGraphic.set(a.id,n)),t++}}}else for(let t=0;t<s.length;t++){const i=l[t],n=s[t];i&&n&&(e.isValid(i.id)||(i.id=`vrender-component-${this.name}-${t}`),this._idToGraphic.set(i.id,n))}!1!==this.attribute.animation&&(this._animationConfig={enter:e.merge({},pf,this.attribute.animation,null!==(n=this.attribute.animationEnter)&&void 0!==n?n:{}),exit:e.merge({},pf,this.attribute.animation,null!==(r=this.attribute.animationExit)&&void 0!==r?r:{}),update:e.isArray(this.attribute.animationUpdate)?this.attribute.animationUpdate:e.merge({},pf,this.attribute.animation,null!==(a=this.attribute.animationUpdate)&&void 0!==a?a:{})})}}getRelatedGrphic(t){return this._idToGraphic.get(t.id)}_layout(t=[]){const{textStyle:i={},position:n,offset:r}=this.attribute,a=[];for(let s=0;s<t.length;s++){const o=t[s],l=this.getRelatedGrphic(o),u=Object.assign(Object.assign({fill:this._isCollectionBase?e.isArray(l.attribute.stroke)?l.attribute.stroke.find((t=>!!t&&!0!==t)):l.attribute.stroke:l.attribute.fill},i),o),h=this._createLabelText(u),d=this.getGraphicBounds(h),c=e.isFunction(n)?n(o):n,f=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(o.id),c):this.getGraphicBounds(l,{x:o.x,y:o.y},c),v=this.labeling(d,f,c,r);v&&(u.x=v.x,u.y=v.y,h.setAttributes(v)),a.push(h)}return a}_overlapping(t){var i,n,r,a;if(0===t.length)return[];const s=this.attribute.overlap,o=[],l=this.getBaseMarkGroup(),u=null!==(i=s.size)&&void 0!==i?i:{width:null!==(n=null==l?void 0:l.AABBBounds.width())&&void 0!==n?n:0,height:null!==(r=null==l?void 0:l.AABBBounds.height())&&void 0!==r?r:0};if(0===u.width||0===u.height)return t;const{avoidBaseMark:h,strategy:d=[],hideOnHit:c=!0,clampForce:f=!0,avoidMarks:v=[],overlapPadding:p}=s,g=this._bmpTool||nf(u.width,u.height),y=this._bitmap||g.bitmap(),b=d.some((t=>"bound"===t.type));h&&(null===(a=this._baseMarks)||void 0===a||a.forEach((t=>{t.AABBBounds&&y.setRange(rf(g,t.AABBBounds,!0))}))),v.length>0&&v.forEach((t=>{e.isString(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&y.setRange(rf(g,t.AABBBounds,!0))})):t.AABBBounds&&y.setRange(rf(g,t.AABBBounds,!0))}));for(let i=0;i<t.length;i++){if(!1===t[i].visible)continue;const n=t[i],r=this.getRelatedGrphic(n.attribute);if(n.update(),!e.isRectIntersect(r.AABBBounds,{x1:0,x2:g.width,y1:0,y2:g.height},!0))continue;if(af(g,y,n.AABBBounds,f,p)){if(!b){y.setRange(rf(g,n.AABBBounds,!0)),o.push(n);continue}if(b&&(null==r?void 0:r.AABBBounds)&&this._canPlaceInside(n.AABBBounds,null==r?void 0:r.AABBBounds)){y.setRange(rf(g,n.AABBBounds,!0)),o.push(n);continue}}let a=!1;for(let e=0;e<d.length;e++)if(a=of(g,y,d[e],this.attribute,n,this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(t[i].attribute.id)):this.getGraphicBounds(r,t[i].attribute),this.labeling),!1!==a){n.setAttributes({x:a.x,y:a.y}),o.push(n);break}if(!a&&f){const{dx:t=0,dy:e=0}=hf(n,g.width,g.height);if(0===t&&0===e){if(af(g,y,n.AABBBounds)){y.setRange(rf(g,n.AABBBounds,!0)),o.push(n);continue}}else if(af(g,y,{x1:n.AABBBounds.x1+t,x2:n.AABBBounds.x2+t,y1:n.AABBBounds.y1+e,y2:n.AABBBounds.y2+e})){n.setAttributes({x:n.attribute.x+t,y:n.attribute.y+e}),y.setRange(rf(g,n.AABBBounds,!0)),o.push(n);continue}}!a&&!c&&o.push(n)}return e.isFunction(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(y),o}getBaseMarkGroup(){const{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find((e=>e.name===t),!0)}getGraphicBounds(t,e={}){return(null==t?void 0:t.AABBBounds)||{x1:e.x,x2:e.x,y1:e.y,y2:e.y}}_renderLabels(t){!1===this._enableAnimation||!1===this.attribute.animation?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){const i=new Map,n=this._graphicToText||new Map,r=[];t.forEach(((t,a)=>{var s,o,l,u,h,d,c;const f=this._labelLine(t),v=this.getRelatedGrphic(t.attribute),p=t.attribute.id,g=this._isCollectionBase?p:v,y=(null==n?void 0:n.get(g))?"update":"enter";if("enter"===y){if(r.push(t),i.set(g,f?{text:t,labelLine:f}:{text:t}),v){const{from:e,to:i}=cf(t.attribute,"fadeIn");this.add(t),f&&(this._setStatesOfLabelLine(f),this.add(f)),this._syncStateWithRelatedGraphic(v),v.once("animate-bind",(n=>{t.setAttributes(e);const s=this._afterRelatedGraphicAttributeUpdate(t,r,a,v,i,this._animationConfig.enter);v.on("afterAttributeUpdate",s)}))}}else if("update"===y){const r=n.get(g);n.delete(g),i.set(g,r);const a=r.text,{duration:f,easing:v}=this._animationConfig.update;!function(t,i,n){if(!e.isArray(n)){const{duration:e,easing:r,increaseEffect:a=!0}=n;return t.animate().to(i.attribute,e,r),void(a&&vf(t,i,e,r))}n.forEach(((n,r)=>{const{duration:a,easing:s,increaseEffect:o=!0,channel:l}=n,{from:u,to:h}=ff(t,i,l,n.options);e.isEmpty(h)||t.animate().to(h,a,s),"text"in u&&"text"in h&&o&&vf(t,i,a,s)}))}(a,t,this._animationConfig.update),r.labelLine&&r.labelLine.animate().to(e.merge({},r.labelLine.attribute,{visible:null===(d=null!==(u=(null===(o=null===(s=t.attribute)||void 0===s?void 0:s.line)||void 0===o?void 0:o.visible)&&(null===(l=t.attribute)||void 0===l?void 0:l.visible))&&void 0!==u?u:null===(h=t.attribute)||void 0===h?void 0:h.visible)||void 0===d||d,points:null===(c=t.attribute)||void 0===c?void 0:c.points}),f,v)}})),n.forEach((t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(cf(t.text.attribute,"fadeOut").to,this._animationConfig.exit.duration,this._animationConfig.exit.easing).onEnd((()=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)}))})),this._graphicToText=i}_renderWithOutAnimation(t){const e=new Map,i=this._graphicToText||new Map;t.forEach((t=>{var n;const r=this._labelLine(t),a=this.getRelatedGrphic(t.attribute),s=(null==i?void 0:i.get(a))?"update":"enter",o=this._isCollectionBase?t.attribute.id:a;if("enter"===s)e.set(o,r?{text:t,labelLine:r}:{text:t}),this.add(t),r&&this.add(r),this._syncStateWithRelatedGraphic(a);else if("update"===s){const r=i.get(o);i.delete(o),e.set(o,r),r.text.setAttributes(t.attribute),(null==r?void 0:r.labelLine)&&r.labelLine.setAttributes({points:null===(n=t.attribute)||void 0===n?void 0:n.points})}})),i.forEach((t=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)})),this._graphicToText=e}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,n,r,{mode:a,duration:s,easing:o,delay:l}){const u=h=>{var d,c;const{detail:f}=h;if(!f)return{};if(!(f&&f.type===bt.ANIMATE_UPDATE&&f.animationState&&"wait"!==(null===(d=f.animationState.step)||void 0===d?void 0:d.type)))return{};if(f.type===bt.ANIMATE_END)return void t.setAttributes(r);const v=()=>{n&&(n.onAnimateBind=void 0,n.removeEventListener("afterAttributeUpdate",u))};switch(a){case"after":f.animationState.end&&t.animate({onStart:v}).wait(l).to(r,s,o);break;case"after-all":i===e.length-1&&f.animationState.end&&e.forEach((t=>{t.animate({onStart:v}).wait(l).to(r,s,o)}));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!n.containsPoint(e.x,e.y,yt.LOCAL,null===(c=this.stage)||void 0===c?void 0:c.pickerService)||t.animate({onStart:v}).wait(l).to(r,s,o)}else f.animationState.isFirstFrameOfStep&&t.animate({onStart:v}).wait(l).to(r,s,o)}};return u}_smartInvert(t){var e,i,n,r,a;const s=this.attribute.smartInvert||{},{textType:o,contrastRatiosThreshold:l,alternativeColors:u,mode:h}=s,d=null!==(e=s.fillStrategy)&&void 0!==e?e:"invertBase",c=null!==(i=s.strokeStrategy)&&void 0!==i?i:"base",f=null!==(n=s.brightColor)&&void 0!==n?n:"#ffffff",v=null!==(r=s.darkColor)&&void 0!==r?r:"#000000",p=null!==(a=s.outsideEnable)&&void 0!==a&&a;if("null"!==d||"null"!==c)for(let e=0;e<t.length;e++){const i=t[e];if(!i)continue;const n=this.getRelatedGrphic(i.attribute),r=n.attribute.fill,a=r,s=_c(i.attribute.fill,r,o,l,u,h),g=Ac(s,f)?f:v;if(p){const t=Sc(d,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=Sc(c,a,s,g);e&&i.setAttributes({stroke:e})}else{if(this._canPlaceInside(i.AABBBounds,null==n?void 0:n.AABBBounds)){const t=Sc(d,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=Sc(c,a,s,g);e&&i.setAttributes({stroke:e})}else{if(0===i.attribute.lineWidth)continue;if(i.attribute.stroke){i.setAttributes({fill:_c(i.attribute.fill,i.attribute.stroke,o,l,u,h)});continue}const t=Sc(d,a,s,g);t&&i.setAttributes({fill:t});const e=Sc(c,a,s,g);e&&i.setAttributes({stroke:e})}}}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}kf.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},offset:0,pickable:!1};class Bf extends kf{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Bf.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",n=0){return xf(t,e,i,n)}}Bf.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class Sf extends kf{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Sf.defaultAttributes,t))}labeling(t,e,i="top",n=0){if(!t||!e)return;const{x1:r,y1:a,x2:s,y2:o}=t,l=Math.abs(s-r),u=Math.abs(o-a),h=Math.abs(e.x2-e.x1),d=Math.abs(e.y2-e.y1);let c=(e.x1+e.x2)/2,f=(e.y1+e.y2)/2,v=0,p=0;switch(i){case"top":case"inside-top":p=-.5;break;case"bottom":case"inside-bottom":p=.5;break;case"left":case"inside-left":v=-.5;break;case"right":case"inside-right":v=.5;break;case"top-right":v=.5,p=-.5;break;case"top-left":v=-.5,p=-.5;break;case"bottom-right":v=.5,p=.5;break;case"bottom-left":v=-.5,p=.5}c+=v*h,f+=p*d;let g=0,y=0;const b=i.includes("inside");switch(i.includes("top")?y=b?1:-1:i.includes("bottom")?y=b?-1:1:i.includes("left")?g=b?1:-1:i.includes("right")&&(g=b?-1:1),i){case"top-right":case"bottom-right":g=-1;break;case"top-left":case"bottom-left":g=1}return{x:c+g*n+g*l/2,y:f+y*n+y*u/2}}}Sf.tag="rect-label",Sf.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class wf extends kf{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},wf.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var n;if(!t||"line"!==t.type)return super.getGraphicBounds(t,e);const r=(null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)||[e],a="start"===i?0:r.length-1;return{x1:r[a].x,x2:r[a].x,y1:r[a].y,y2:r[a].y}}labeling(t,e,i="end",n=0){return Af(t,e,i,n)}}wf.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Tf{constructor(t,e,i,n,r,a,s,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=n,this.radian=r,this.middleAngle=a,this.innerRadius=s,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class Cf extends kf{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Cf.defaultAttributes,t)),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map}_overlapping(t){return t}labeling(t,e,i="outside",n=0){if(t&&e)return{x:0,y:0}}_layout(t=[]){const e=super._layout(t),i=e.map((t=>this.getGraphicBounds(t))),n=Object.assign(Object.assign({},this.attribute.textStyle),{text:"..."}),r=this._createLabelText(n),a=this.getGraphicBounds(r),s=a.x2-a.x1,o=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),t,i,s);for(let i=0;i<t.length;i++){const n=t[i],r=o.find((t=>{var e;return(null===(e=t.refDatum)||void 0===e?void 0:e.id)===n.id})),a={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,maxLineWidth:r.labelLimit,points:(null==r?void 0:r.pointA)&&(null==r?void 0:r.pointB)&&(null==r?void 0:r.pointC)?[r.pointA,r.pointB,r.pointC]:void 0,line:null==r?void 0:r.labelLine};e[i].setAttributes(a)}return e}layoutArcLabels(t,i,n,r,a,s){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=s;let o=0;n.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)})),r.forEach(((t,n)=>{var s,l;const u=this._idToGraphic.get(t.id).attribute,h={x:null!==(s=null==u?void 0:u.x)&&void 0!==s?s:0,y:null!==(l=null==u?void 0:u.y)&&void 0!==l?l:0};if(!e.isNil(r[n])&&!e.isNil(a[n])){const t=r[n]?r[n]:null,e=a[n]?a[n]:{x1:0,x2:0,y1:0,y2:0},s=(u.startAngle+u.endAngle)/2,l=u.endAngle-u.startAngle,c=yf(u.endAngle-l/2),f=gf(h.x,h.y,u.outerRadius,s),v=gf(h.x,h.y,o+i.line.line1MinLength,s),p=new Tf(t,f,v,c,l,s,u.innerRadius,u.outerRadius,h);p.pointA=gf(h.x,h.y,this.computeDatumRadius(2*h.x,2*h.y,u.outerRadius),p.middleAngle),p.labelSize={width:e.x2-e.x1,height:e.y2-e.y1},1===(d=p.quadrant)||2===d?this._arcRight.set(p.refDatum,p):bf(p.quadrant)&&this._arcLeft.set(p.refDatum,p)}var d}));const l=Array.from(this._arcLeft.values()),u=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":h.push(...this._layoutInsideLabels(u,i,n)),h.push(...this._layoutInsideLabels(l,i,n));break;default:h.push(...this._layoutOutsideLabels(u,i,n)),h.push(...this._layoutOutsideLabels(l,i,n))}return h}_layoutInsideLabels(t,i,n){var r,a;const s=i,o=s.spaceWidth,l=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:"inside",u=null!==(a=null==s?void 0:s.offsetRadius)&&void 0!==a?a:-o;return t.forEach((t=>{var n,r,a;const{labelSize:h,radian:d}=t,c=t.innerRadius,f=t.outerRadius,v=function(t,e){return e>2*t?NaN:2*Math.asin(e/2/t)}(f,h.height);let p;if(d<v)p=0;else{let t;t=d>=Math.PI?c:Math.max(c,h.height/2/Math.tan(d/2)),p=f-t-o}!0!==(null==s?void 0:s.rotate)&&(p=f-o);const g=this._getFormatLabelText(t.refDatum,p);t.labelText=g;const y=Math.min(p,t.labelSize.width),b=this._computeAlign(t,i);let m,x=0;"inside"===l&&(x="left"===b?y:"right"===b?0:y/2),m="inside-inner"===l?c-u+x:f+u-x,t.labelPosition=gf(t.circleCenter.x,t.circleCenter.y,m,t.middleAngle),t.labelLimit=y,e.isGreater(y,0)||(t.labelVisible=!1),t.angle=null!==(r=null===(n=null==i?void 0:i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:t.middleAngle;let _=null!==(a=null==s?void 0:s.offsetAngle)&&void 0!==a?a:0;["inside-inner","inside-outer"].includes(l)&&(_+=Math.PI/2),t.angle+=_})),t}_layoutOutsideLabels(t,i,n){var r,a,s,o,l;const u=null!==(a=null===(r=n[0].attribute)||void 0===r?void 0:r.x)&&void 0!==a?a:0,h=2*(null!==(o=null===(s=n[0].attribute)||void 0===s?void 0:s.y)&&void 0!==o?o:0),d=i.line.line2MinLength,c=i.layout,f=i.spaceWidth;if(t.forEach((t=>{const e=bf(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+d+f),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==i.coverEnable||"none"===c.strategy){for(const e of t){const{labelPosition:t,labelSize:r}=e;e.labelLimit=r.width,e.pointB=bf(e.quadrant)?{x:t.x+r.width/2+d+f,y:t.y}:{x:t.x-r.width/2-d-f,y:t.y},this._computeX(e,i,n)}!1===i.coverEnable&&"none"===c.strategy&&this._coverLabels(t)}else{const e=h/((null===(l=i.textStyle)||void 0===l?void 0:l.fontSize)||16);this._adjustY(t,e,i,n);const{minY:r,maxY:a}=t.reduce(((t,e)=>{const{y1:i,y2:n}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(h,Math.max(n,t.maxY)),t}),{minY:1/0,maxY:-1/0}),s=Math.max(Math.abs(h/2-r),Math.abs(a-h/2)),o=this._computeLayoutRadius(s,i,n);for(const e of t)this._computePointB(e,o,i,n),this._computeX(e,i,n)}const v=2*u;return t.forEach((t=>{var n,r;t.labelVisible&&(e.isLess(t.pointB.x,d+f)||e.isGreater(t.pointB.x,v-d-f))&&(t.labelVisible=!1),t.angle=null!==(r=null===(n=null==i?void 0:i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:0,(null==i?void 0:i.offsetAngle)&&(t.angle+=i.offsetAngle),t.labelLine=Object.assign({},null==i?void 0:i.line)})),t}_computeX(t,i,n){var r;const a=t.circleCenter,s=2*a.x;a.y;let o=0;n.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)}));const l=this.computeLayoutOuterRadius(o,i.width,i.height),u=i.line.line1MinLength,h=i.line.line2MinLength,d=null===(r=i.layout)||void 0===r?void 0:r.align,c=i.spaceWidth,{labelPosition:f,quadrant:v,pointB:p}=t;e.isValidNumber(p.x*p.y)||(t.pointC={x:NaN,y:NaN},f.x=NaN,t.labelLimit=0);const g=this.computeRadius(l,i.width,i.height),y=bf(v)?-1:1;let b=0;let m=(y>0?s-p.x:p.x)-h-c;"labelLine"===d&&(b=(g+u+h)*y+a.x,m=(y>0?s-b:b)-c);const x=this._getFormatLabelText(t.refDatum,m);t.labelText=x;let _=Math.min(m,t.labelSize.width);switch(d){case"labelLine":break;case"edge":b=y>0?s-_-c:_+c;break;default:b=p.x+y*h}_=Math.max(this._ellipsisWidth,_),t.labelLimit=_,t.pointC={x:b,y:f.y};const A=.5*(t.labelLimit<t.labelSize.width?t.labelLimit:t.labelSize.width);if("edge"===d){const t=0;f.x=(y>0?s+t:t)-y*A}else{const t=0;f.x=b+t+y*(c+A)}}_computeAlign(t,i){var n,r,a,s,o,l;const u=i,h=null!==(r=null===(n=u.textStyle)||void 0===n?void 0:n.textAlign)&&void 0!==r?r:null===(a=u.textStyle)||void 0===a?void 0:a.align,d=null!==(o=null===(s=u.layout)||void 0===s?void 0:s.textAlign)&&void 0!==o?o:null===(l=u.layout)||void 0===l?void 0:l.align;return"inside"!==u.position?e.isNil(h)||"auto"===h?"edge"===d?bf(t.quadrant)?"left":"right":bf(t.quadrant)?"right":"left":h:e.isNil(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,i,n,r){var a,s,o,l;s=null===(a=r[0].attribute)||void 0===a?void 0:a.x;const u=2*(null!==(l=null===(o=r[0].attribute)||void 0===o?void 0:o.y)&&void 0!==l?l:0),h=n.layout;if("vertical"===h.strategy){let i,n=0;const r=t.length;if(r<=0)return;for(let a=0;a<r;a++){const{y1:s}=t[a].getLabelBounds();if(i=s-n,e.isLess(i,0)){const e=this._shiftY(t,a,r-1,-i);this._shiftY(t,e,0,i/2)}const{y2:o}=t[a].getLabelBounds();n=o}const{y1:a}=t[0].getLabelBounds();i=a-0,e.isLess(i,0)&&this._shiftY(t,0,r-1,-i);for(let e=t.length-1;e>=0&&t[e].getLabelBounds().y2>u;e--)t[e].labelVisible=!1}else if("none"!==h.strategy){const a=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));a.sort(((t,e)=>e.arc.radian-t.arc.radian)),a.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let s=1/0,o=-1/0;for(let l=0;l<i&&l<t.length;l++){this._storeY(t);const i=a[l].arc;this._computeYRange(i,n,r),i.labelVisible=!0;const d=i.labelPosition.y,{lastIndex:c,nextIndex:f}=this._findNeighborIndex(t,a[l]),v=t[c],p=t[f];if(-1===c&&-1!==f){const e=p.labelPosition.y;d>e?i.labelPosition.y=e-p.labelSize.height/2-i.labelSize.height/2:this._twoWayShift(t,i,p,f)}else if(-1!==c&&-1===f){const e=v.labelPosition.y;d<e?i.labelPosition.y=e+v.labelSize.height/2+i.labelSize.height/2:this._twoWayShift(t,v,i,a[l].originIndex)}else if(-1!==c&&-1!==f){const e=v.labelPosition.y,n=p.labelPosition.y;d>n?(i.labelPosition.y=n-p.labelSize.height/2-i.labelSize.height/2,this._twoWayShift(t,v,i,a[l].originIndex)):d<e?(i.labelPosition.y=e+v.labelSize.height/2+i.labelSize.height/2,this._twoWayShift(t,i,p,f)):(this._twoWayShift(t,v,i,a[l].originIndex),this._twoWayShift(t,i,p,f))}const g=Math.min(s,a[l].originIndex),y=Math.max(o,a[l].originIndex);let b;if(b=t[y].getLabelBounds().y2-u,e.isGreater(b,0)&&this._shiftY(t,y,0,-b),b=t[g].getLabelBounds().y1-0,e.isLess(b,0)&&this._shiftY(t,g,t.length-1,-b),b=t[y].getLabelBounds().y2-u,e.isGreater(b,0)){i.labelVisible=!1,this._restoreY(t);break}h.tangentConstraint&&!this._checkYRange(t)?(i.labelVisible=!1,this._restoreY(t)):(s=g,o=y)}}}_shiftY(t,e,i,n){const r=e<i?1:-1;let a=e;for(;-1!==a;){t[a].labelPosition.y+=n;const e=this._findNextVisibleIndex(t,a,i,r);if(e>=0&&e<t.length){const{y1:i,y2:n}=t[a].getLabelBounds(),{y1:s,y2:o}=t[e].getLabelBounds();if(r>0&&n<s||r<0&&i>o)return a}a=e}return i}_findNextVisibleIndex(t,e,i,n){const r=(i-e)*n;for(let i=1;i<=r;i++){const r=e+i*n;if(t[r].labelVisible)return r}return-1}_computePointB(t,i,n,r){const a=n;let s=0;r.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,n.width,n.height),l=a.line.line1MinLength;if("none"===a.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const r=t.circleCenter,a=this.computeRadius(o,n.width,n.height),{labelPosition:s,quadrant:u}=t,h=i-Math.max(a+l,t.outerRadius),d=Math.sqrt(i**2-Math.abs(r.y-s.y)**2)-h;e.isValidNumber(d)?t.pointB={x:r.x+d*(bf(u)?-1:1),y:s.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,i,n){const r=t.circleCenter,a={width:2*r.x,height:2*r.y};let s=0;n.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,i.width,i.height),l=i.line.line1MinLength,{width:u,height:h}=a,d=this.computeRadius(o,i.width,i.height),c=this._computeLayoutRadius(h/2,i,n),f=Math.abs(t.center.x-u/2),v=t.center.y-h/2;let p,g,y;if(e.isNumberClose(u/2,f))p=0,g=1,y=-v;else if(e.isNumberClose(h/2,v))p=1,g=0,y=-f;else{const t=-1/(v/f);p=t,g=-1,y=v-t*f}const b=function(t,e,i,n,r,a){if(0===t&&0===e||a<=0)return[];if(0===t){const t=-i/e,s=a**2-(t-r)**2;return s<0?[]:0===s?[{x:n,y:t}]:[{x:Math.sqrt(s)+n,y:t},{x:-Math.sqrt(s)+n,y:t}]}if(0===e){const e=-i/t,s=a**2-(e-n)**2;return s<0?[]:0===s?[{x:e,y:r}]:[{x:e,y:Math.sqrt(s)+r},{x:e,y:-Math.sqrt(s)+r}]}const s=(e/t)**2+1,o=2*((i/t+n)*(e/t)-r),l=o**2-4*s*((i/t+n)**2+r**2-a**2);if(l<0)return[];const u=(-o+Math.sqrt(l))/(2*s),h=(-o-Math.sqrt(l))/(2*s),d=-(e*u+i)/t;return 0===l?[{x:d,y:u}]:[{x:d,y:u},{x:-(e*h+i)/t,y:h}]}(p,g,y,l+d-c,0,c);if(b.length<2)return;let m,x;b[0].x>b[1].x&&b.reverse(),b[0].x<0?e.isNumberClose(b[0].y,b[1].y)?Math.abs(t.middleAngle)<Math.PI/2?(m=0,x=b[1].y+h/2):(m=b[1].y+h/2,x=h):b[0].y<b[1].y?(m=0,x=b[1].y+h/2):(m=b[1].y+h/2,x=a.height):(m=Math.min(b[0].y,b[1].y)+h/2,x=Math.max(b[0].y,b[1].y)+h/2),t.labelYRange=[m,x]}_computeLayoutRadius(t,e,i){const n=e,r=n.layoutArcGap,a=n.line.line1MinLength;let s=0;i.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,e.width,e.height),l=this.computeRadius(o,e.width,e.height)+a,u=l-r;return Math.max((u**2+t**2)/(2*u),l)}_findNeighborIndex(t,e){const i=e.originIndex;let n=-1,r=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){n=e;break}for(let e=i+1;e<t.length;e++)if(t[e].labelVisible){r=e;break}return{lastIndex:n,nextIndex:r}}_twoWayShift(t,i,n,r){const a=n.getLabelBounds().y1-i.getLabelBounds().y2;if(e.isLess(a,0)){const e=this._shiftY(t,r,t.length-1,-a);this._shiftY(t,e,0,a/2)}}_restoreY(t){for(const e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(const i of t){const{labelYRange:t,labelPosition:n}=i;if(i.labelVisible&&t&&(e.isLess(n.y,t[0])||e.isGreater(n.y,t[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){const n=t[i].getLabelBounds();mf(e,n)?t[i].labelVisible=!1:e=n}}_labelLine(t){var e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m;return(null===(e=t.attribute)||void 0===e?void 0:e.points)?Lo({visible:null===(o=null!==(a=(null===(n=null===(i=t.attribute)||void 0===i?void 0:i.line)||void 0===n?void 0:n.visible)&&(null===(r=t.attribute)||void 0===r?void 0:r.visible))&&void 0!==a?a:null===(s=t.attribute)||void 0===s?void 0:s.visible)||void 0===o||o,stroke:null!==(d=null===(h=null===(u=null===(l=t.attribute)||void 0===l?void 0:l.line)||void 0===u?void 0:u.style)||void 0===h?void 0:h.stroke)&&void 0!==d?d:null===(c=t.attribute)||void 0===c?void 0:c.fill,lineWidth:null!==(g=null===(p=null===(v=null===(f=t.attribute)||void 0===f?void 0:f.line)||void 0===v?void 0:v.style)||void 0===p?void 0:p.lineWidth)&&void 0!==g?g:1,points:null===(y=t.attribute)||void 0===y?void 0:y.points,curveType:(null===(m=null===(b=t.attribute)||void 0===b?void 0:b.line)||void 0===m?void 0:m.smooth)?"basis":null}):void 0}computeRadius(t,i,n,r){return this.computeLayoutRadius(i||0,n||0)*t*(e.isNil(r)?1:r)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return"inside"===this.attribute.position}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){const n=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*n}}Cf.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,textAlign:"center",textBaseline:"middle"},position:"outside",offset:0,line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0},pickable:!1};class Pf extends kf{constructor(t){super(e.merge({},Pf.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var n;if("area"!==t.type)return super.getGraphicBounds(t,e);const r=(null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)||[e],a="start"===i?0:r.length-1;return{x1:r[a].x,x2:r[a].x,y1:r[a].y,y2:r[a].y}}labeling(t,e,i="end",n=0){return Af(t,e,i,n)}}Pf.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Mf extends kf{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Mf.defaultAttributes,t)),this.name="line-data-label"}labeling(t,e,i="top",n=0){return xf(t,e,i,n)}}Mf.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};const Ef={rect:Sf,symbol:Bf,arc:Cf,line:wf,area:Pf,"line-data":Mf};class Of extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Of.defaultAttributes,t)),this.name="data-label"}render(){var t;const{dataLabels:i,size:n}=this.attribute;if(!i||0===i.length)return;const{width:r=0,height:a=0}=n||{};if(!r||!a||!e.isValidNumber(a*r))return;this._componentMap||(this._componentMap=new Map);const s=nf(r,a),o=s.bitmap(),l=new Map,u=this._componentMap;for(let e=0;e<i.length;e++){const n=i[e],r=Ef[n.type]||kf;if(r){const{baseMarkGroupName:i,type:a}=n,u=null!==(t=n.id)&&void 0!==t?t:`${i}-${a}-${e}`;let h=this._componentMap.get(u);h?(h.setBitmapTool(s),h.setBitmap(o),h.setAttributes(n),l.set(u,h)):(h=new r(n),h.setBitmap(o),h.setBitmapTool(s),this.add(h),l.set(u,h))}}u.forEach(((t,e)=>{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}Of.defaultAttributes={pickable:!1};class Lf extends lc{getStartAngle(){return this._startAngle}getEndAngle(){return this._endAngle}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Lf.defaultAttributes,t)),this.name="segment"}render(){this.removeAllChild(),this._reset();const{startSymbol:t,endSymbol:i,lineStyle:n,state:r,visible:a=!0,multiSegment:s,mainSegmentIndex:o}=this.attribute;if(!a)return;this._computeLineAngle();const l=this._renderSymbol(t,"start"),u=this._renderSymbol(i,"end");if(this.startSymbol=l,this.endSymbol=u,s){const t=[...this.attribute.points];if(e.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const i=this._clipPoints(e.flattenArray(t));t[0][0]=i[0],t[t.length-1][t[t.length-1].length-1]=i[i.length-1]}t.forEach(((t,i)=>{var a,s;const o=Lo(Object.assign(Object.assign({points:t},e.isArray(n)?null!==(a=n[i])&&void 0!==a?a:n[n.length-1]:n),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+i),e.isEmpty(null==r?void 0:r.line)||(o.states=e.isArray(r.line)?null!==(s=r.line[i])&&void 0!==s?s:r.line[r.line.length-1]:r.line),this.add(o)}))}else{const t=Uo(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},e.array(n)[0]),{fill:!1,closePath:!1}));t.name=`${this.name}-line`,t.id=this._getNodeId("line"),e.isEmpty(null==r?void 0:r.line)||(t.states=[].concat(r.line)[0]),this.add(t)}}_renderSymbol(t,i){const n=this._getMainSegmentPoints();if(!n.length)return;const{autoRotate:r=!0}=t;let a;if(null==t?void 0:t.visible){const s=this._startAngle,o=this._endAngle,{state:l}=this.attribute,u=n[0],h=n[n.length-1],{refX:d=0,refY:c=0,refAngle:f=0,style:v,symbolType:p,size:g=12}=t;let y,b;"start"===i?(y={x:u.x+(e.isValidNumber(s)?d*Math.cos(s)+c*Math.cos(s-Math.PI/2):0),y:u.y+(e.isValidNumber(s)?d*Math.sin(s)+c*Math.sin(s-Math.PI/2):0)},b=s+Math.PI/2):(y={x:h.x+(e.isValidNumber(o)?d*Math.cos(o)+c*Math.cos(o-Math.PI/2):0),y:h.y+(e.isValidNumber(o)?d*Math.sin(o)+c*Math.sin(o-Math.PI/2):0)},b=o+Math.PI/2),a=Do(Object.assign(Object.assign(Object.assign({},y),{symbolType:p,size:g,angle:r?b+f:0,strokeBoundsBuffer:0}),v)),a.name=`${this.name}-${i}-symbol`,a.id=this._getNodeId(`${i}-symbol`),e.isEmpty(null==l?void 0:l.symbol)||(a.states=l.symbol),this.add(a)}return a}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:i,mainSegmentIndex:n}=this.attribute;let r;return r=i?e.isValidNumber(n)?t[n]:e.flattenArray(t):t,this._mainSegmentPoints=r,r}_clipPoints(t){const{startSymbol:e,endSymbol:i}=this.attribute;let n=t;if(null==e?void 0:e.visible){const i=(null==e?void 0:e.clip)?(null==e?void 0:e.size)||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(null==i?void 0:i.visible){const e=(null==i?void 0:i.clip)?(null==i?void 0:i.size)||10:0,r={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),r]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],r=t[t.length-1],a=[e.x-i.x,e.y-i.y],s=Math.atan2(a[1],a[0]),o=[r.x-n.x,r.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=s,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}var Rf,If;Lf.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},t.AXIS_ELEMENT_NAME=void 0,(Rf=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",Rf.axisContainer="axis-container",Rf.labelContainer="axis-label-container",Rf.tickContainer="axis-tick-container",Rf.tick="axis-tick",Rf.subTick="axis-sub-tick",Rf.label="axis-label",Rf.title="axis-title",Rf.gridContainer="axis-grid-container",Rf.grid="axis-grid",Rf.gridRegion="axis-grid-region",Rf.line="axis-line",Rf.background="axis-background",Rf.axisLabelBackground="axis-label-background",t.AxisStateValue=void 0,(If=t.AxisStateValue||(t.AxisStateValue={})).selected="selected",If.selectedReverse="selected_reverse",If.hover="hover",If.hoverReverse="hover_reverse";const jf={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},Df={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}};class Nf extends lc{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{const i=t.target;i!==this._lastHover&&i.name&&!e.isEmpty(i.states)&&(i.addState(Ec.hover,!0),yc(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Ec.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(yc(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Ec.hoverReverse),t.removeState(Ec.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState(Ec.selected))return this._lastSelect=null,void yc(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Ec.selectedReverse),t.removeState(Ec.selected))}));i.name&&!e.isEmpty(i.states)&&(i.addState(Ec.selected,!0),yc(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Ec.selectedReverse,!0)})),this._lastSelect=i)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const i=e.cloneDeep(this.attribute);e.merge(this.attribute,t);const n=Oo({x:this.attribute.x,y:this.attribute.y});return this.add(n),this._renderInner(n),this.removeChild(n),this.attribute=i,n.AABBBounds}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=Oo({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(e){const{title:i,label:n,tick:r,line:a,items:s}=this.attribute,o=Oo({x:0,y:0,zIndex:1});if(o.name=t.AXIS_ELEMENT_NAME.axisContainer,o.id=this._getNodeId("container"),o.setMode(this.mode),this.axisContainer=o,e.add(o),(null==a?void 0:a.visible)&&this.renderLine(o),s&&s.length&&(this.data=this._transformItems(s[0]),(null==r?void 0:r.visible)&&this.renderTicks(o),null==n?void 0:n.visible)){const e=Oo({x:0,y:0,pickable:!1});e.name=t.AXIS_ELEMENT_NAME.labelContainer,e.id=this._getNodeId("label-container"),this.axisLabelsContainer=e,o.add(e),s.forEach(((t,i)=>{const n=this.renderLabels(e,t,i),r=n.getChildren();this.beforeLabelsOverlap(r,t,n,i,s.length),this.handleLabelsOverlap(r,t,n,i,s.length),this.afterLabelsOverlap(r,t,n,i,s.length)}))}(null==i?void 0:i.visible)&&this.renderTitle(o)}renderTicks(i){const n=this.getTickLineItems(),r=Oo({x:0,y:0,pickable:!1});r.name=t.AXIS_ELEMENT_NAME.tickContainer,r.id=this._getNodeId("tick-container"),i.add(r),n.forEach(((i,a)=>{var s;const o=Lo(Object.assign({},this._getTickLineAttribute("tick",i,a,n)));if(o.name=t.AXIS_ELEMENT_NAME.tick,o.id=this._getNodeId(i.id),e.isEmpty(null===(s=this.attribute.tick)||void 0===s?void 0:s.state))o.states=Oc;else{const t=this.data[a],i=e.merge({},Oc,this.attribute.tick.state);Object.keys(i).forEach((n=>{e.isFunction(i[n])&&(i[n]=i[n](t.rawValue,a,t,this.data))})),o.states=i}r.add(o)})),this.tickLineItems=n;const{subTick:a}=this.attribute;if(null==a?void 0:a.visible){const i=this.getSubTickLineItems();i.length&&i.forEach(((i,s)=>{const o=Lo(Object.assign({},this._getTickLineAttribute("subTick",i,s,n)));if(o.name=t.AXIS_ELEMENT_NAME.subTick,o.id=this._getNodeId(`${s}`),e.isEmpty(a.state))o.states=Oc;else{const t=e.merge({},Oc,a.state);Object.keys(t).forEach((r=>{e.isFunction(t[r])&&(t[r]=t[r](i.value,s,i,n))})),o.states=t}r.add(o)})),this.subTickLineItems=i}}renderLabels(i,n,r){const{dataFilter:a}=this.attribute.label;a&&e.isFunction(a)&&(n=a(n,r));const s=this._transformItems(n),o=Oo({x:0,y:0,pickable:!1});o.name=`${t.AXIS_ELEMENT_NAME.labelContainer}-layer-${r}`,o.id=this._getNodeId(`label-container-layer-${r}`),i.add(o);let l=0,u=0,h="center",d="middle";return s.forEach(((i,n)=>{var a,c,f,v;const p=this._getLabelAttribute(i,n,s,r);let g;if("rich"===p.type?(p.textConfig=p.text,p.width=null!==(a=p.width)&&void 0!==a?a:0,p.height=null!==(c=p.height)&&void 0!==c?c:0,g=zo(p)):"html"===p.type?(p.textConfig=[],p.html=Object.assign(Object.assign({dom:p.text},Lc),p),g=zo(p)):g=jo(p),g.name=t.AXIS_ELEMENT_NAME.label,g.id=this._getNodeId(`layer${r}-label-${i.id}`),e.isEmpty(null===(f=this.attribute.label)||void 0===f?void 0:f.state))g.states=Oc;else{const t=e.merge({},Oc,this.attribute.label.state);Object.keys(t).forEach((a=>{e.isFunction(t[a])&&(t[a]=t[a](i,n,s,r))})),g.states=t}o.add(g);const y=null!==(v=p.angle)&&void 0!==v?v:0;l=Math.max(l,g.AABBBounds.width()),u=Math.max(u,g.AABBBounds.height()),y&&(l=Math.abs(l*Math.cos(y)),u=Math.abs(u*Math.sin(y))),h=p.textAlign,d=p.textBaseline})),this.axisLabelLayerSize[r]={width:l,height:u,textAlign:h,textBaseline:d},o}renderTitle(e){const i=this.getTitleAttribute(),n=new jc(Object.assign({},i));n.name=t.AXIS_ELEMENT_NAME.title,n.id=this._getNodeId("title"),e.add(n)}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}getTextAlign(t){let i="center";return e.isNumberClose(t[0],0)?e.isNumberClose(t[1],0)?Object.is(t[1],-0)?i="start":Object.is(t[0],-0)&&(i="end"):i="center":t[0]>0?i="start":t[0]<0&&(i="end"),i}getTickLineItems(){const{tick:t}=this.attribute,i=this.data,n=[],{alignWithLabel:r,inside:a=!1,length:s,dataFilter:o}=t;let l=1;return i.length>=2&&(l=i[1].value-i[0].value),(o&&e.isFunction(o)?o(i):i).forEach((t=>{let i=t.point,o=t.value;if(!r){const e=t.value-l/2;if(this.isInValidValue(e))return;i=this.getTickCoord(e),o=e}const u=this.getVerticalCoord(i,s,a);if("3d"===this.mode){const r=this.getVerticalVector(s,a,i);let l=0,h=0;e.abs(r[0])>e.abs(r[1])?l=e.pi/2*(u.x>i.x?1:-1):h=e.pi/2*(u.y>i.y?-1:1),n.push({start:i,end:u,value:o,id:`tick-${t.id}`,anchor:[i.x,i.y],alpha:l,beta:h})}else n.push({start:i,end:u,value:o,id:`tick-${t.id}`})})),n}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:n=!1,length:r=2}=t,a=this.tickLineItems,s=a.length;if(s>=2)for(let t=0;t<s-1;t++){const s=a[t],o=a[t+1];for(let t=0;t<i;t++){const a=(t+1)/(i+1),l=(1-a)*s.value+a*o.value,u=this.getTickCoord(l),h=this.getVerticalCoord(u,r,n);e.push({start:u,end:h,value:l,id:`sub-tick-${l}`})}}return e}_getTickLineAttribute(t,i,n,r){let a=e.get(this.attribute,`${t}.style`);const s=this.data[n];a=e.isFunction(a)?e.merge({},e.get(Df,`${t}.style`),"tick"===t?a(s.rawValue,n,s,this.data):a(i.value,n,i,r)):a;const{start:o,end:l,anchor:u,alpha:h,beta:d}=i;return Object.assign({points:[o,l],anchor:u,alpha:h,beta:d},a)}_getLabelAttribute(t,i,n,r){var a,s,o,l,u,h;const d=this.attribute.label,{space:c=4,inside:f=!1,formatMethod:v,type:p="text",text:g}=d,y=dc(d,["space","inside","formatMethod","type","text"]);let b=c,m=0;(null===(a=this.attribute.tick)||void 0===a?void 0:a.visible)&&(null===(s=this.attribute.tick)||void 0===s?void 0:s.inside)===f&&(m=(null===(o=this.attribute.tick)||void 0===o?void 0:o.length)||4),(null===(l=this.attribute.subTick)||void 0===l?void 0:l.visible)&&(null===(u=this.attribute.subTick)||void 0===u?void 0:u.inside)===f&&(m=Math.max(m,(null===(h=this.attribute.subTick)||void 0===h?void 0:h.length)||2)),b+=m;const x=this.getRelativeVector(t.point);r>0&&(0===x[1]?b+=(this.axisLabelLayerSize[r-1].height+e.get(this.attribute,"label.space",4))*r:b+=(this.axisLabelLayerSize[r-1].width+e.get(this.attribute,"label.space",4))*r);const _=this.getVerticalCoord(t.point,b,f),A=this.getVerticalVector(b,f,_),k=v?v(`${t.label}`,t,i,n,r):t.label;let{style:B}=y;B=e.isFunction(B)?e.merge({},Df.label.style,B(t,i,n,r)):B;const S=this.getLabelAlign(A,f,B.angle);return B=e.merge(S,B),e.isFunction(B.text)&&(B.text=B.text({label:t.label,value:t.rawValue,index:t.index,layer:r})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(_,A,k,B)),{text:null!=g?g:k,lineHeight:null==B?void 0:B.fontSize,type:p}),B)}getLabelPosition(t,e,i,n){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}}function Uf(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(n=e.centerX,r=e.centerY,a=e.angle,s=t.attribute.x,o=t.attribute.y,{x:(n-s)*Math.cos(a)+(r-o)*Math.sin(a)+s,y:(n-s)*Math.sin(a)+(o-r)*Math.cos(a)+o});var n,r,a,s,o;const l=i.x-e.centerX,u=i.y-e.centerY;e.x1+=l,e.x2+=l,e.y1+=u,e.y2+=u,e.centerX+=l,e.centerY+=u,t.rotatedBounds=e}))}const zf={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,n)=>n&&Hf(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function Hf(t,e,i){const n=t.AABBBounds,r=e.AABBBounds;return i>Math.max(r.x1-n.x2,n.x1-r.x2,r.y1-n.y2,n.y1-r.y2)&&(!t.rotatedBounds||!e.rotatedBounds||i>Math.max(e.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.x1-e.rotatedBounds.x2,e.rotatedBounds.y1-t.rotatedBounds.y2,t.rotatedBounds.y1-e.rotatedBounds.y2))}function Vf(t,e){for(let i,n=1,r=t.length,a=t[0];n<r;a=i,++n)if(Hf(a,i=t[n],e))return!0}function Wf(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function Ff(t){for(let r=1;r<t.length;r++)if(i=t[r-1],n=t[r],e.isRectIntersect(i.AABBBounds,n.AABBBounds,!1)&&(!i.rotatedBounds||!n.rotatedBounds||e.isRotateAABBIntersect(i.rotatedBounds,n.rotatedBounds,!0)))return!0;var i,n;return!1}function Gf(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},Xf(t,e.attribute.angle)),{angle:Yf(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},$f(t,e.attribute.angle)),{angle:Yf(e.attribute.angle)}))}))}(t,e),Uf(e)}function Yf(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Xf(t,e=0){let i=["center","left","left","left","center","right","right","right","left"],n=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],n=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const r=(e=Yf(e))/(.5*Math.PI);let a;return a=r===Math.floor(r)?2*Math.floor(r):2*Math.floor(r)+1,{textAlign:i[a],textBaseline:n[a]}}function $f(t,e=0){let i=["right","right","center","left","center","left","center","right","right"],n=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","right","right","right","left","left","left","left","right"],n=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]);const r=(e=Yf(e))/(.5*Math.PI);let a;return a=r===Math.floor(r)?2*Math.floor(r):2*Math.floor(r)+1,{textAlign:i[a],textBaseline:n[a]}}class qf{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:n=1}=this.attribute,r=function(t){const[e,i]=t;let n=e*e+i*i;return n>0&&(n=1/Math.sqrt(n)),[t[0]*n,t[1]*n]}(this.getRelativeVector());return wc([r[1],-1*r[0]],t*(e?1:-1)*n)}}class Kf extends Nf{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Kf.defaultAttributes,t),i)}_renderInner(i){var n;super._renderInner(i);const{panel:r}=this.attribute;if(r&&r.visible){const i=this.axisContainer,a=i.AABBBounds,s=Io(Object.assign({x:a.x1,y:a.y1,width:a.width(),height:a.height()},r.style));s.name=t.AXIS_ELEMENT_NAME.background,s.id=this._getNodeId("background"),s.states=e.merge({},jf,null!==(n=r.state)&&void 0!==n?n:{}),i.insertBefore(s,i.firstChild)}}renderLine(i){const{start:n,end:r,line:a}=this.attribute,s=a,{startSymbol:o,endSymbol:l,style:u,breakRange:h,breakShape:d,breakShapeStyle:c,state:f}=s,v=dc(s,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),p=Object.assign({points:[n,r],startSymbol:o,endSymbol:l,lineStyle:u},v);e.isEmpty(f)||(p.state={line:e.merge({},jf,f),symbol:e.merge({},jf,f)});const g=new Lf(p);g.name=t.AXIS_ELEMENT_NAME.line,g.id=this._getNodeId("line"),i.add(g)}getTitleAttribute(){var t,i,n,r,a,s,o,l;const u=this.attribute.title,{position:h="middle",space:d=4,textStyle:c={},autoRotate:f=!0,shape:v,background:p,state:g}=u,y=dc(u,["position","space","textStyle","autoRotate","shape","background","state"]);let b=.5;"start"===h?b=0:"end"===h&&(b=1);const{verticalFactor:m=1}=this.attribute,x=-1*m,_=this.getTickCoord(b),A=this.getRelativeVector();let k=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(i=this.attribute.label)||void 0===i?void 0:i.inside)){const t=+e.get(this.attribute,"label.space",4);k+=t;const i=Object.keys(this.axisLabelLayerSize).length;if(0===A[1]){const e=this.axisLabelsContainer.AABBBounds.height();isFinite(e)?k+=e+(i-1)*t:k=0}else{if(0===A[0]){const e=this.axisLabelsContainer.AABBBounds.width();isFinite(e)?k+=e+(i-1)*t:k=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{k+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const e=this.axisLabelLayerSize[0].textAlign,n="start"===e||"left"===e,r="center"===e,a=A[1]>0;k=1===x?a?n?k:r?k/2:t:n?t:r?k/2:k:a?n?t:r?k/2:k:n?k:r?k/2:t}}let B=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&!1===(null===(r=this.attribute.tick)||void 0===r?void 0:r.inside)&&(B=(null===(a=this.attribute.tick)||void 0===a?void 0:a.length)||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&!1===(null===(o=this.attribute.subTick)||void 0===o?void 0:o.inside)&&(B=Math.max(B,(null===(l=this.attribute.subTick)||void 0===l?void 0:l.length)||2));const S=B+k+d,w=this.getVerticalCoord(_,S,!1),T=this.getVerticalVector(S,!1,{x:0,y:0});let C,P,{angle:M}=y;if(C="start"===h?"start":"end"===h?"end":"center",e.isNil(M)&&f){M=Tc(A,[1,0],!0);const{verticalFactor:t=1}=this.attribute;P=1===-1*t?"bottom":"top"}else C=this.getTextAlign(T),P=this.getTextBaseline(T,!1);const E=Object.assign(Object.assign(Object.assign({},w),y),{textStyle:Object.assign({textAlign:C,textBaseline:P},c),state:{text:e.merge({},jf,null==g?void 0:g.text),shape:e.merge({},jf,null==g?void 0:g.shape),panel:e.merge({},jf,null==g?void 0:g.background)}});return E.angle=M,v&&v.visible&&(E.shape=Object.assign({visible:!0},v.style),v.space&&(E.space=v.space)),p&&p.visible&&(E.panel=Object.assign({visible:!0},p.style)),E}getTextBaseline(t,i){let n="middle";const{verticalFactor:r=1}=this.attribute,a=(i?1:-1)*r;return e.isNumberClose(t[1],0)?n=!e.isNumberClose(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===a?"bottom":"top":t[1]>0?n="top":t[1]<0&&(n="bottom"),n}getLabelAlign(t,i,n){const r=this.attribute.orient;if(e.isValidNumber(n)){if("top"===r||"bottom"===r)return Xf(r,n);if("left"===r||"right"===r)return $f(r,n)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,i)}}beforeLabelsOverlap(t,i,n,r,a){const{flush:s=!1}=this.attribute.label||{};if(s&&t.length){const{orient:i,start:n,end:r}=this.attribute,a="bottom"===i||"top"===i,s=t[0],o=e.last(t),l=a?s.attribute.x>o.attribute.x:s.attribute.y<o.attribute.y;if(a)if(l){const t=r.x,e=n.x,i=s.AABBBounds.x2,a=o.AABBBounds.x1;i>t&&s.setAttributes({x:t,textAlign:"right"}),a<e&&o.setAttributes({x:e,textAlign:"left"})}else{const t=n.x,e=r.x,i=s.AABBBounds.x1,a=o.AABBBounds.x2;i<t&&s.setAttributes({x:t,textAlign:"left"}),a>e&&o.setAttributes({x:e,textAlign:"right"})}else if(l){const t=s.AABBBounds.y1,e=o.AABBBounds.y2,i=n.y,a=r.y;t<i&&s.setAttributes({y:i,textBaseline:"top"}),e>a&&o.setAttributes({y:a,textBaseline:"bottom"})}else{const t=r.y,e=n.y,i=s.AABBBounds.y2,a=o.AABBBounds.y1;i>t&&s.setAttributes({y:t,textBaseline:"bottom"}),a<e&&o.setAttributes({y:e,textBaseline:"top"})}}}handleLabelsOverlap(t,i,n,r,a){if(e.isEmpty(t))return;const{verticalLimitSize:s,label:o,orient:l}=this.attribute,u=this._getAxisLabelLimitLength(s,a),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:f,limitEllipsis:v,autoHide:p,autoHideMethod:g,autoHideSeparation:y}=o;e.isFunction(h)?h(t,i,r,this):(d&&function(t,i){if(e.isEmpty(t))return;const{orient:n,labelRotateAngle:r=[0,45,90]}=i;if(0===r.length||t.some((t=>!!t.attribute.angle)))return;let a=0,s=0;for(r&&r.length>0&&(s=r.length);a<s;){const i=r[a++];if(t.forEach((t=>{t.attribute.angle=e.degreeToRadian(i)})),Gf(n,t),!Ff(t))break}}(t,{labelRotateAngle:c,orient:l}),f&&e.isValidNumber(u)&&u>0&&function(t,i){const{limitLength:n,ellipsis:r="...",orient:a}=i;!e.isEmpty(t)&&e.isValidNumber(n)&&t.forEach((t=>{if(("top"===a||"bottom"===a)&&Math.floor(t.AABBBounds.height())<=n)return;if(("left"===a||"right"===a)&&Math.floor(t.AABBBounds.width())<=n)return;let i=0===t.attribute.angle||e.isNil(t.attribute.angle)?"top"===a||"bottom"===a?null:n:Math.abs(n/Math.sin(t.attribute.angle));e.isValidNumber(t.attribute.maxLineWidth)&&(i=e.isValidNumber(i)?Math.min(t.attribute.maxLineWidth,i):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:i,ellipsis:t.attribute.ellipsis||r})}))}(t,{limitLength:u,ellipsis:v,orient:l}),p&&function(t,i){if(e.isEmpty(t))return;const n=t.filter(Wf);if(e.isEmpty(n))return;let r;r=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(n),Uf(r);const{method:a="parity",separation:s=0}=i,o=e.isFunction(a)?a:zf[a]||zf.parity;if(r.length>=3&&Vf(r,s)){do{r=o(r,s)}while(r.length>=3&&Vf(r,s));r.length<3&&!e.last(n).attribute.opacity&&r.length>1&&(e.last(r).setAttribute("opacity",0),e.last(n).setAttribute("opacity",1))}n.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:l,method:g,separation:y}))}afterLabelsOverlap(i,n,r,a,s){const{verticalLimitSize:o,orient:l}=this.attribute,u="bottom"===l||"top"===l,h=r.AABBBounds;let d=u?h.height():h.width();const{verticalMinSize:c}=this.attribute;if(e.isValidNumber(c)&&(!e.isValidNumber(o)||c<=o)){const e=this._getAxisLabelLimitLength(c,s);let i,n;d=Math.max(d,e),"left"===l?(i=h.x2-d,n=h.y1):"right"===l?(i=h.x1,n=h.y1):"top"===l?(i=h.x1,n=h.y2-d):"bottom"===l&&(i=h.x1,n=h.y1);const a=Io({x:i,y:n,width:u?h.width():d,height:u?d:h.height(),pickable:!1});a.name=t.AXIS_ELEMENT_NAME.axisLabelBackground,a.id=this._getNodeId("axis-label-background"),r.insertBefore(a,r.firstChild)}if(e.isValid(this.attribute.label.containerAlign)){let t;"left"===l?t=h.x2:"right"===l?t=h.x1:"top"===l?t=h.y2:"bottom"===l&&(t=h.y1),function(t,e,i,n,r){if("right"===n||"left"===n){if("left"===r){const r="right"===n?0:-1;t.forEach((t=>{t.setAttributes({x:e+i*r,textAlign:"left"})}))}else if("right"===r){const r="right"===n?1:0;t.forEach((t=>{t.setAttributes({x:e+i*r,textAlign:"right"})}))}else if("center"===r){const r="right"===n?1:-1;t.forEach((t=>{t.setAttributes({x:e+.5*i*r,textAlign:"center"})}))}}else if("bottom"===n||"top"===n)if("top"===r){const r="bottom"===n?0:-1;t.forEach((t=>{t.setAttributes({y:e+i*r,textBaseline:"top"})}))}else if("bottom"===r){const r="bottom"===n?1:0;t.forEach((t=>{t.setAttributes({y:e+i*r,textBaseline:"bottom"})}))}else if("middle"===r){const r="bottom"===n?1:-1;t.forEach((t=>{t.setAttributes({y:e+.5*i*r,textBaseline:"middle"})}))}}(i,t,d,l,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,i){var n,r,a;const{label:s,title:o,line:l,tick:u}=this.attribute,h=null!==(n=s.space)&&void 0!==n?n:4;let d=t,c=0,f=0;const v=(null==l?void 0:l.visible)?null!==(r=l.style.lineWidth)&&void 0!==r?r:1:0,p=(null==u?void 0:u.visible)?null!==(a=u.length)&&void 0!==a?a:4:0;if((null==o?void 0:o.visible)&&"string"==typeof o.text){c=Ic(o.text,o.textStyle).height;const t=e.normalizePadding(o.padding);f=o.space+t[0]+t[2]}return d&&(d=(d-h-f-c-v-p)/i),d}}Kf.defaultAttributes=Df,e.mixin(Kf,qf);class Zf{isInValidValue(t){const{startAngle:e=Cc,endAngle:i=Pc}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:i=Cc,endAngle:n=Pc,center:r,radius:a,inside:s=!1,innerRadius:o=0}=this.attribute,l=i+(n-i)*t;return e.polarToCartesian(r,s&&o>0?o:a,l)}getVerticalVector(t,e=!1,i){const{inside:n=!1}=this.attribute,{center:r}=this.attribute,a=[i.x-r.x,i.y-r.y];return wc(a,(e?-1:1)*(n?-1:1)*t/function(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}(a))}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}const Jf=(t=0)=>{if(t<0)for(;t<0;)t+=e.tau;else if(t>0)for(;t>e.tau;)t-=e.tau;return t};function Qf(t,i,n){return!e.isLess(t,i,0,1e-6)&&!e.isGreater(t,n,0,1e-6)}class tv extends Nf{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},tv.defaultAttributes,t))}renderLine(i){const{startAngle:n=Cc,endAngle:r=Pc,radius:a,center:s,innerRadius:o=0,line:l,inside:u=!1}=this.attribute;let h=a,d=o;u&&o>0&&(h=o,d=0);const c=Eo(Object.assign(Object.assign(Object.assign({},s),{startAngle:n,endAngle:r,radius:h,innerRadius:d}),null==l?void 0:l.style));c.name=t.AXIS_ELEMENT_NAME.line,c.id=this._getNodeId("line"),e.isEmpty(null==l?void 0:l.state)||(c.states=e.merge({},jf,l.state)),i.add(c)}getTitleAttribute(){var t,i,n,r,a,s,o,l;const{center:u,radius:h,innerRadius:d=0}=this.attribute,c=this.attribute.title,{space:f=4,textStyle:v={},shape:p,background:g,state:y}=c,b=dc(c,["space","textStyle","shape","background","state"]);let m=u,x=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(i=this.attribute.label)||void 0===i?void 0:i.inside)&&(x=e.get(this.attribute.label,"style.fontSize",12)+e.get(this.attribute.label,"space",4));let _=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&!1===(null===(r=this.attribute.tick)||void 0===r?void 0:r.inside)&&(_=(null===(a=this.attribute.tick)||void 0===a?void 0:a.length)||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&!1===(null===(o=this.attribute.subTick)||void 0===o?void 0:o.inside)&&(_=Math.max(_,(null===(l=this.attribute.subTick)||void 0===l?void 0:l.length)||2));const A=h+_+x+f;let k="middle",{position:B}=this.attribute.title;e.isNil(B)&&(B=0===d?"end":"middle"),"start"===B?(k="bottom",m={x:u.x,y:u.y-A}):"end"===B&&(k="top",m={x:u.x,y:u.y+A});const S=Object.assign(Object.assign(Object.assign({},m),b),{textStyle:Object.assign({textBaseline:k,textAlign:"center"},v),state:{text:e.merge({},jf,null==y?void 0:y.text),shape:e.merge({},jf,null==y?void 0:y.shape),panel:e.merge({},jf,null==y?void 0:y.background)}}),{angle:w}=b;return S.angle=w,p&&p.visible&&(S.shape=Object.assign({visible:!0},p.style),p.space&&(S.space=p.space)),g&&g.visible&&(S.panel=Object.assign({visible:!0},g.style)),S}getSubTickLineItems(){var t,e;const{subTick:i}=this.attribute,n=[],{count:r=4,inside:a=!1,length:s=2}=i,o=this.tickLineItems,l=o.length;if(l>=2){const i=this.data[1].value-this.data[0].value,u=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t<l;t++){const e=o[t],l=o[t+1];for(let t=0;t<r;t++){const o=(t+1)/(r+1),h=(1-o)*e.value+o*(l?l.value:u?1:e.value+i),d=this.getTickCoord(h),c=this.getVerticalCoord(d,s,a);n.push({start:d,end:c,value:h})}}}return n}getTextBaseline(t){let i="middle";return e.isNumberClose(t[1],0)?i="middle":t[1]>0&&t[1]>Math.abs(t[0])?i="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(i="bottom"),i}beforeLabelsOverlap(t,e,i,n,r){}handleLabelsOverlap(t,e,i,n,r){}afterLabelsOverlap(t,e,i,n,r){}getLabelAlign(t,e,i){return{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,n){return function(t,e,i,n){const r=Wo(Object.assign({text:i},n)),a=r.width(),s=r.height(),o=Jf(Math.atan2(e[1],e[0]))-Math.PI,l=3*Math.PI/4,u=Math.PI/4,h=Math.PI/2,d=t.x;let c=0;c=Qf(o,-l,-u)?((o+l)/h-.5)*a:Qf(o,u,l)?(.5-(o-u)/h)*a:Math.cos(o)>=0?.5*a:.5*-a;const f=d-c,v=t.y;let p=0;return p=Qf(o,-l,-u)?.5*-s:Qf(o,u,l)?.5*s:Math.cos(o)>=0?(.5-(u-o)/h)*s:(.5-Jf(o-l)/h)*s,{x:f,y:v-p}}(t,e,i,n)}}tv.defaultAttributes=Df,e.mixin(tv,Zf);function ev(t,e){let i="";return 0===t.length||(t.forEach(((t,e)=>{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}function iv(t,i,n,r){let a="";if(!t||0===i.length)return a;const s=i[0],o=e.PointService.distancePP(t,s),l=n?0:1;return r?a+=`M${t.x},${t.y-o}A${o},${o},0,0,${l},${t.x},${t.y+o}A${o},${o},0,0,${l},${t.x},${t.y-o}Z`:i.forEach(((t,e)=>{0===e?a=`M${t.x},${t.y}`:a+=`A${o},${o},0,0,${l},${t.x},${t.y}`})),a}function nv(t,i,n){const{type:r,closed:a}=n,s=i.slice(0).reverse();let o="",l="";if("line"===r&&n.smoothLink&&n.center){const i=t[0],r=s[0],u=n.center;o=ev(t,!!a),l=ev(s,!!a);const h=e.PointService.distancePP(r,u),d=e.PointService.distancePP(i,u);o+=`A${h},${h},0,0,1,${r.x},${r.y}L${r.x},${r.y}`,l+=`A${d},${d},0,0,0,${i.x},${i.y}`}else if("circle"===r){const{center:e}=n;o=iv(e,t,!1,!!a),l=iv(e,s,!0,!!a)}else"line"!==r&&"polygon"!==r||(o=ev(t,!!a),l=ev(s,!!a));return a?o+=l:(l="L"+l.substring(1),o+=l,o+="Z"),o}class rv extends lc{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=Oo({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(i,n){const r=e.merge({},this.attribute,this.getGridAttribute(i)),{type:a,items:s,style:o,closed:l,alternateColor:u,depth:h=0}=r,d=i?`${t.AXIS_ELEMENT_NAME.grid}-sub`:`${t.AXIS_ELEMENT_NAME.grid}`;if(s.forEach(((t,i)=>{const{id:r,points:s}=t;let u="";if("line"===a||"polygon"===a)u=ev(s,!!l);else if("circle"===a){const{center:t}=this.attribute;u=iv(t,s,!1,!!l)}const c=Ro(Object.assign({path:u,z:h},e.isFunction(o)?e.merge({},this.skipDefault?null:rv.defaultAttributes.style,o(t,i)):o));c.name=`${d}-line`,c.id=this._getNodeId(`${d}-path-${r}`),n.add(c)})),h&&"line"===a&&s.forEach(((t,i)=>{const{id:r,points:a}=t,s=[];s.push(a[0]);const u=a[1].x-a[0].x,c=a[1].y-a[0].y,f=Math.sqrt(u*u+c*c),v=h/f;s.push({x:a[0].x+u*v,y:a[0].y+c*v});const p=ev(s,!!l),g=e.abs(s[0].x-s[1].x),y=e.abs(s[0].y-s[1].y),b=Ro(Object.assign({path:p,z:0,alpha:g>y?(a[1].x-a[0].x>0?-1:1)*e.pi/2:0,beta:g<y?-e.pi/2:0,anchor3d:g>y?[s[0].x,0]:[0,s[0].y]},e.isFunction(o)?e.merge({},this.skipDefault?null:rv.defaultAttributes.style,o(t,i)):o));b.name=`${d}-line`,b.id=this._getNodeId(`${d}-path-${r}`),n.add(b)})),s.length>1&&u){const t=e.isArray(u)?u:[u,"transparent"],i=e=>t[e%t.length];for(let t=0;t<s.length-1;t++){const[e,a]=[s[t].points,s[t+1].points],o=Ro({path:nv(e,a,r),fill:i(t)});o.name=`${d}-region`,o.id=this._getNodeId(`${d}-region-${t}`),n.add(o)}}}_getNodeId(t){return`${this.id}-${t}`}}rv.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};class av extends rv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},rv.defaultAttributes,t),i)}_getGridPoint(t,i){let n;if("line"===t){const{length:t}=this.attribute;n=[i,this.getVerticalCoord(i,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:r=6,startAngle:a=Cc,endAngle:s=Pc}=this.attribute;n=function(t,i,n,r,a){const s=[],o=a-r;for(let a=0;a<i;a++){const l=r+a*o/i;s.push(e.polarToCartesian(t,n,l))}return s}(t,r,e.PointService.distancePP(t,i),a,s)}return n}getGridAttribute(t){const{type:i,alignWithLabel:n=!0}=this.attribute;let r=1;let a;this.data.length>=2&&(r=this.data[1].value-this.data[0].value);let s=[];if(t){a=e.merge({},this.attribute,this.attribute.subGrid);const t=[],{count:o=4}=this.attribute.subGrid||{};if(this.data.length>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!n){const e=t.value-r/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let n=0;n<e.length-1;n++){const r=e[n],a=e[n+1];t.push({id:`sub-${n}-0`,points:this._getGridPoint(i,this.getTickCoord(r.value)),datum:{}});for(let e=0;e<o;e++){const s=(e+1)/(o+1),l=(1-s)*r.value+s*a.value,u=this.getTickCoord(l);t.push({id:`sub-${n}-${e+1}`,points:this._getGridPoint(i,u),datum:{}})}n===e.length-2&&t.push({id:`sub-${n}-${o+1}`,points:this._getGridPoint(i,this.getTickCoord(a.value)),datum:{}})}s=t}}else{a=this.attribute;const t=[];this.data.forEach((e=>{let{point:a}=e;if(!n){const t=e.value-r/2;if(this.isInValidValue(t))return;a=this.getTickCoord(t)}t.push({id:e.label,datum:e,points:this._getGridPoint(i,a)})})),s=t}return Object.assign(Object.assign({},a),{items:s})}}e.mixin(av,qf);class sv extends rv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},rv.defaultAttributes,t),i)}getGridAttribute(t){let i,n=[];const r=this.attribute,{radius:a,innerRadius:s=0,startAngle:o=Cc,endAngle:l=Pc,center:u,subGrid:h}=r,d=dc(r,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:c=!0}=d||{},f=a-s;let v=1;if(this.data.length>=2&&(v=this.data[1].value-this.data[0].value),t){i=e.merge({},d,h);const t=[],{count:r=4}=h||{},a=this.data.length;if(a>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!c){const e=t.value-v/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let i=0;i<a;i++){const n=e[i],a=e[i+1];t.push({id:`sub-${i}-0`,points:[this.getTickCoord(n.value),this.getVerticalCoord(this.getTickCoord(n.value),f,!0)],datum:{}});for(let e=0;e<r;e++){const s=(e+1)/(r+1),o=(1-s)*n.value+s*(a?a.value:c?1:n.value+v),l=this.getTickCoord(o),u=this.getVerticalCoord(l,f,!0);t.push({id:`sub-${i}-${e+1}`,points:[l,u],datum:{}})}}Math.abs(l-o)%(2*Math.PI)==0&&t.push(t[0]),n=t}}else{i=d;const t=[];let e;e=Math.abs(l-o)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data,e.forEach((e=>{let{point:i}=e;if(!c){const t=e.value-v/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const n=this.getVerticalCoord(i,f,!0);t.push({id:e.id,points:[i,n],datum:e})})),n=t}return Object.assign(Object.assign({},i),{items:n,center:u,type:"line"})}}e.mixin(sv,Zf);var ov;t.DataZoomActiveTag=void 0,(ov=t.DataZoomActiveTag||(t.DataZoomActiveTag={})).startHandler="startHandler",ov.endHandler="endHandler",ov.middleHandler="middleHandler",ov.background="background";const lv={debounce:e.debounce,throttle:e.throttle};class uv extends lc{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},uv.defaultAttributes,i)),this.name="dataZoom",this._previewData=[],this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},this._layoutCache={attPos:"x",attSize:"width",max:0},this.state={start:0,end:1},this._statePointToData=t=>t,this._onHandlerPointerDown=(e,i)=>{e.stopPropagation(),"start"===i?(this._activeTag=t.DataZoomActiveTag.startHandler,this._activeItem=this._startHandler):"end"===i?(this._activeTag=t.DataZoomActiveTag.endHandler,this._activeItem=this._endHandler):"middleRect"===i?(this._activeTag=t.DataZoomActiveTag.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===i?(this._activeTag=t.DataZoomActiveTag.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===i&&(this._activeTag=t.DataZoomActiveTag.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(e),this._activeCache.lastPos=this.eventPosToStagePos(e)},this._onHandlerPointerMove=e=>{var i;e.stopPropagation();const{start:n,end:r,brushSelect:a,realTime:s=!0}=this.attribute,o=this.eventPosToStagePos(e),{attPos:l,max:u}=this._layoutCache,h=(o[l]-this._activeCache.lastPos[l])/u;let{start:d,end:c}=this.state;this._activeState&&(this._activeTag===t.DataZoomActiveTag.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+h):this._activeTag===t.DataZoomActiveTag.startHandler?d+h>c?(d=c,c=d+h,this._activeTag=t.DataZoomActiveTag.endHandler):d+=h:this._activeTag===t.DataZoomActiveTag.endHandler&&(c+h<d?(c=d,d=c+h,this._activeTag=t.DataZoomActiveTag.startHandler):c+=h),this._activeCache.lastPos=o,a&&this.renderDragMask()),d=Math.min(Math.max(d,0),1),c=Math.min(Math.max(c,0),1),n===d&&r===c||(this.setStateAttr(d,c,!0),s&&(null===(i=this._updateStateCallback)||void 0===i||i.call(this,d,c,this._activeTag)),this._dispatchChangeEvent(d,c))};const{start:r,end:a,size:s,orient:o,showDetail:l,position:u,previewData:h,previewPointsX:d,previewPointsY:c,previewPointsX1:f,previewPointsY1:v,updateStateCallback:p}=this.attribute,{width:g,height:y}=s;r&&(this.state.start=r),a&&(this.state.end=a),this._spanCache=this.state.end-this.state.start,this._isHorizontal="top"===o||"bottom"===o,this._layoutCache.max=this._isHorizontal?g:y,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",this._activeCache.startPos=u,this._activeCache.lastPos=u,this._showText="auto"!==l&&l,h&&(this._previewData=h),e.isFunction(d)&&(this._previewPointsX=d),e.isFunction(c)&&(this._previewPointsY=c),e.isFunction(f)&&(this._previewPointsX1=f),e.isFunction(v)&&(this._previewPointsY1=v),e.isFunction(p)&&(this._updateStateCallback=p)}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{showDetail:t,brushSelect:e,delayType:i="throttle",delayTime:n=0}=this.attribute;this._startHandler&&this._startHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandler&&this._endHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const r=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,r))),e&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,r))),"browser"===xd.env&&(xd.addEventListener("pointermove",lv[i](this._onHandlerPointerMove.bind(this),n),{capture:!0}),xd.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",lv[i](this._onHandlerPointerMove,n),{capture:!0}),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:n=!1,minSpan:r=0,maxSpan:a=1}=this.attribute,s=e-t;s!==this._spanCache&&(n||s<r||s>a)||(this._spanCache=s,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){var e,i,n;const r=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==r?void 0:r.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==r?void 0:r.top)||0)-((null===(n=this.stage)||void 0===n?void 0:n.y)||0)}}_onHandlerPointerUp(e){var i;e.preventDefault();const{start:n,end:r,brushSelect:a,realTime:s=!0}=this.attribute;if(this._activeState&&this._activeTag===t.DataZoomActiveTag.background){const t=this.eventPosToStagePos(e);this.backgroundDragZoom(this._activeCache.startPos,t)}this._activeState=!1,a&&this.renderDragMask(),s&&n===this.state.start&&r===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),null===(i=this._updateStateCallback)||void 0===i||i.call(this,this.state.start,this.state.end,this._activeTag),this._dispatchChangeEvent(this.state.start,this.state.end))}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:n}=this._layoutCache,{position:r}=this.attribute,a=t[i]-r[i],s=e[i]-r[i],o=Math.min(Math.max(Math.min(a,s)/n,0),1),l=Math.min(Math.max(Math.max(a,s)/n,0),1);Math.abs(o-l)<.01?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:i}=this.attribute,{position:n,width:r,height:a}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,n.x,n.x+r),y:n.y,width:this._activeState&&this._activeTag===t.DataZoomActiveTag.background&&Math.abs(this.dragMaskSize())||0,height:a},i),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:n.x,y:e.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,n.y,n.y+a),width:r,height:this._activeState&&this._activeTag===t.DataZoomActiveTag.background&&Math.abs(this.dragMaskSize())||0},i),"rect")}renderText(){const{startTextStyle:t,endTextStyle:i}=this.attribute,{formatMethod:n}=t,r=dc(t,["formatMethod"]),{formatMethod:a}=i,s=dc(i,["formatMethod"]),{start:o,end:l}=this.state;this._startValue=this._statePointToData(o),this._endValue=this._statePointToData(l);const{position:u,width:h,height:d}=this.getLayoutAttrFromConfig();this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,e.merge({},r,{text:n?n(this._startValue):this._startValue,x:u.x+o*h,y:u.y+d/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,e.merge({},s,{text:a?a(this._endValue):this._endValue,x:u.x+l*h,y:u.y+d/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),`data-zoom-end-text-${u}`)):(this._startText=this.maybeAddLabel(this._container,e.merge({},r,{text:n?n(this._startValue):this._startValue,x:u.x+h/2,y:u.y+o*d,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,e.merge({},s,{text:a?a(this._endValue):this._endValue,x:u.x+h/2,y:u.y+l*d,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),`data-zoom-end-text-${u}`))}getLayoutAttrFromConfig(){var t,e,i,n;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:r,size:a,orient:s,middleHandlerStyle:o,startHandlerStyle:l,endHandlerStyle:u}=this.attribute,{width:h,height:d}=a,c=null!==(e=null===(t=null==o?void 0:o.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let f,v,p;(null==o?void 0:o.visible)?this._isHorizontal?(f=h,v=d-c,p={x:r.x,y:r.y+c}):(f=h-c,v=d,p={x:r.x+("left"===s?c:0),y:r.y}):(f=h,v=d,p=r);const g=null!==(i=null==l?void 0:l.size)&&void 0!==i?i:this._isHorizontal?v:f,y=null!==(n=null==u?void 0:u.size)&&void 0!==n?n:this._isHorizontal?v:f;return(null==l?void 0:l.visible)&&(this._isHorizontal?(f-=(g+y)/2,p={x:p.x+g/2,y:p.y}):(v-=(g+y)/2,p={x:p.x,y:p.y+g})),this._layoutAttrFromConfig={position:p,width:f,height:v},this._layoutAttrFromConfig}render(){var t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x;this._layoutAttrFromConfig=null;const{orient:_,backgroundStyle:A,backgroundChartStyle:k,selectedBackgroundStyle:B,selectedBackgroundChartStyle:S,middleHandlerStyle:w,startHandlerStyle:T,endHandlerStyle:C,brushSelect:P}=this.attribute,{start:M,end:E}=this.state,{position:O,width:L,height:R}=this.getLayoutAttrFromConfig(),I=this.createOrUpdateChild("dataZoom-container",{},"group");this._container=I,this._background=I.createOrUpdateChild("background",Object.assign({x:O.x,y:O.y,width:L,height:R,cursor:P?"crosshair":"auto"},A),"rect"),(null===(t=null==k?void 0:k.line)||void 0===t?void 0:t.visible)&&this.setPreviewAttributes("line",I),(null===(e=null==k?void 0:k.area)||void 0===e?void 0:e.visible)&&this.setPreviewAttributes("area",I),P&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=I.createOrUpdateChild("selectedBackground",Object.assign({x:O.x+M*L,y:O.y,width:(E-M)*L,height:R,cursor:P?"crosshair":"move"},B),"rect"):this._selectedBackground=I.createOrUpdateChild("selectedBackground",Object.assign({x:O.x,y:O.y+M*R,width:L,height:(E-M)*R,cursor:P?"crosshair":"move"},B),"rect"),(null===(i=null==S?void 0:S.line)||void 0===i?void 0:i.visible)&&this.setSelectedPreviewAttributes("line",I),(null===(n=null==S?void 0:S.area)||void 0===n?void 0:n.visible)&&this.setSelectedPreviewAttributes("area",I),this._showText&&this.renderText(),this._isHorizontal?(this._startHandler=I.createOrUpdateChild("startHandler",Object.assign({x:O.x+M*L,y:O.y+R/2,size:R,angle:0,symbolType:null!==(r=null==T?void 0:T.symbolType)&&void 0!==r?r:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},T),"symbol"),this._endHandler=I.createOrUpdateChild("endHandler",Object.assign({x:O.x+E*L,y:O.y+R/2,size:R,angle:0,symbolType:null!==(a=null==C?void 0:C.symbolType)&&void 0!==a?a:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},C),"symbol"),(null==w?void 0:w.visible)&&(this._middleHandlerRect=I.createOrUpdateChild("middleHandlerRect",Object.assign({x:O.x+M*L,y:O.y-((null===(s=null==w?void 0:w.background)||void 0===s?void 0:s.size)||10),width:(E-M)*L,height:(null===(o=null==w?void 0:w.background)||void 0===o?void 0:o.size)||10},null===(l=null==w?void 0:w.background)||void 0===l?void 0:l.style),"rect"),this._middleHandlerSymbol=I.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:O.x+(M+E)/2*L,y:O.y-((null===(u=null==w?void 0:w.background)||void 0===u?void 0:u.size)||10)/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(d=null===(h=null==w?void 0:w.icon)||void 0===h?void 0:h.symbolType)&&void 0!==d?d:"square"},null==w?void 0:w.icon),"symbol"))):(this._startHandler=I.createOrUpdateChild("startHandler",Object.assign({x:O.x+L/2,y:O.y+M*R,size:L,angle:Math.PI/180*90,symbolType:null!==(c=null==T?void 0:T.symbolType)&&void 0!==c?c:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},T),"symbol"),(null==w?void 0:w.visible)&&(this._middleHandlerRect=I.createOrUpdateChild("middleHandlerRect",Object.assign({x:"left"===_?O.x-((null===(f=null==w?void 0:w.background)||void 0===f?void 0:f.size)||10):O.x+L,y:O.y+M*R,width:(null===(v=null==w?void 0:w.background)||void 0===v?void 0:v.size)||10,height:(E-M)*R},null===(p=null==w?void 0:w.background)||void 0===p?void 0:p.style),"rect"),this._middleHandlerSymbol=I.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:"left"===_?O.x-((null===(g=null==w?void 0:w.background)||void 0===g?void 0:g.size)||10)/2:O.x+L+((null===(y=null==w?void 0:w.background)||void 0===y?void 0:y.size)||10)/2,y:O.y+(M+E)/2*R,angle:Math.PI/180*90,symbolType:null!==(m=null===(b=null==w?void 0:w.icon)||void 0===b?void 0:b.symbolType)&&void 0!==m?m:"square",strokeBoundsBuffer:0},null==w?void 0:w.icon),"symbol")),this._endHandler=I.createOrUpdateChild("endHandler",Object.assign({x:O.x+L/2,y:O.y+E*R,size:L,angle:Math.PI/180*90,symbolType:null!==(x=null==C?void 0:C.symbolType)&&void 0!==x?x:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},C),"symbol"))}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:n}=this.getLayoutAttrFromConfig();let r,a;return this._isHorizontal?(r=[{x:e.x,y:e.y+n}],a=[{x:e.x+i,y:e.y+n}]):"left"===t?(r=[{x:e.x+i,y:e.y}],a=[{x:e.x+i,y:e.y+n}]):(r=[{x:e.x,y:e.y+n}],a=[{x:e.x,y:e.y}]),{basePointStart:r,basePointEnd:a}}getPreviewLinePoints(){const t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){const t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},null==i?void 0:i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i}=this.attribute,{start:n,end:r}=this.state,{position:a,width:s,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?a.x+n*s:a.x,y:this._isHorizontal?a.y:a.y+n*o,width:this._isHorizontal?(r-n)*s:s,height:this._isHorizontal?o:(r-n)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?a.x+n*s:a.x),y:-(this._isHorizontal?a.y:a.y+n*o),width:this._isHorizontal?(r-n)*s:s,height:this._isHorizontal?o:(r-n)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},null==i?void 0:i.area))}maybeAddLabel(t,e,i){let n=this.find((t=>t.name===i),!0);return n?n.setAttributes(e):(n=new jc(e),n.name=i),t.add(n),n}_dispatchChangeEvent(t,e){var i;const n=new Yi("change",{start:t,end:e});n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}setStartAndEnd(t,i){var n;const{start:r,end:a}=this.attribute;e.isValid(t)&&e.isValid(i)&&(t!==this.state.start||i!==this.state.end)&&(this.state.start=t,this.state.end=i,r===this.state.start&&a===this.state.end||(this.setStateAttr(t,i,!0),null===(n=this._updateStateCallback)||void 0===n||n.call(this,t,i,this._activeTag),this._dispatchChangeEvent(t,i)))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,i,n,r;const{middleHandlerStyle:a}=this.attribute,s=null!==(i=null===(t=null==a?void 0:a.background)||void 0===t?void 0:t.size)&&void 0!==i?i:10,o=null!==(r=null===(n=null==a?void 0:a.icon)||void 0===n?void 0:n.size)&&void 0!==r?r:10;return Math.max(s,...e.array(o))}setUpdateStateCallback(t){e.isFunction(t)&&(this._updateStateCallback=t)}setPreviewPointsX(t){e.isFunction(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){e.isFunction(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){e.isFunction(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){e.isFunction(t)&&(this._previewPointsY1=t)}setStatePointToData(t){e.isFunction(t)&&(this._statePointToData=t)}}var hv,dv,cv;uv.defaultAttributes={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},t.IMarkLineLabelPosition=void 0,(hv=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",hv.middle="middle",hv.end="end",hv.insideStartTop="insideStartTop",hv.insideStartBottom="insideStartBottom",hv.insideMiddleTop="insideMiddleTop",hv.insideMiddleBottom="insideMiddleBottom",hv.insideEndTop="insideEndTop",hv.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(dv=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",dv.right="right",dv.top="top",dv.bottom="bottom",dv.middle="middle",dv.insideLeft="insideLeft",dv.insideRight="insideRight",dv.insideTop="insideTop",dv.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(cv=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",cv.bottom="bottom",cv.middle="middle",cv.insideTop="insideTop",cv.insideBottom="insideBottom",cv.insideMiddle="insideMiddle";class fv extends lc{constructor(){super(...arguments),this.name="marker"}_initContainer(){var t,e;const{limitRect:i,clipInRange:n}=this.attribute;let r;if(n){const n=Oo(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));r=Oo({x:-(null!==(t=null==i?void 0:i.x)&&void 0!==t?t:0),y:-(null!==(e=null==i?void 0:i.y)&&void 0!==e?e:0),pickable:!1}),n.add(r),this._containerClip=n,this.add(n)}else r=Oo({x:0,y:0,pickable:!1}),this.add(r);r.name="marker-container",this._container=r}_updateContainer(){var t,e,i;const{limitRect:n,clipInRange:r}=this.attribute;null===(t=this._containerClip)||void 0===t||t.setAttributes(Object.assign({},n)),this._container.setAttributes({x:r?-(null!==(e=null==n?void 0:n.x)&&void 0!==e?e:0):0,y:r?-(null!==(i=null==n?void 0:n.y)&&void 0!==i?i:0):0})}render(){var t;this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&(!this._container&&this.isValidPoints()?(this._initContainer(),this.initMarker(this._container)):this.isValidPoints()?(this._updateContainer(),this.updateMarker()):(this._container=null,this.removeAllChild()))}}const vv={startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:t.IMarkLineLabelPosition.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},pv={start:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},gv={label:{position:t.IMarkAreaLabelPosition.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},yv={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},bv={top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}};function mv(t,e){const{x1:i,y1:n,x2:r,y2:a}=e,{x1:s,y1:o,x2:l,y2:u}=t.AABBBounds,{dx:h=0,dy:d=0}=t.attribute;let c=0,f=0;s<i&&(c=i-s),o<n&&(f=n-o),l>r&&(c=r-l),u>a&&(f=a-u),c&&t.setAttribute("dx",c+h),f&&t.setAttribute("dy",f+d)}class xv extends fv{getLine(){return this._line}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},xv.defaultAttributes,t)),this.name="markLine"}setLabelPos(){var t,e;const{label:i={},limitRect:n}=this.attribute,{position:r="end",refX:a=0,refY:s=0,confine:o}=i,l=this._line.getMainSegmentPoints(),u=null!==(t=this._line.getEndAngle())&&void 0!==t?t:0,h=a*Math.cos(u)+s*Math.cos(u-Math.PI/2),d=a*Math.sin(u)+s*Math.sin(u-Math.PI/2);let c;if(c=r.includes("start")||r.includes("Start")?{x:l[0].x+h,y:l[0].y+d}:r.includes("middle")||r.includes("Middle")?{x:(l[0].x+l[l.length-1].x)/2+h,y:(l[0].y+l[l.length-1].y)/2+d}:{x:l[l.length-1].x+h,y:l[l.length-1].y+d},this._label.setAttributes(Object.assign(Object.assign({},c),{angle:i.autoRotate?u+(null!==(e=null==i?void 0:i.refAngle)&&void 0!==e?e:0):0,textStyle:Object.assign(Object.assign({},pv[r]),i.textStyle)})),n&&o){const{x:t,y:e,width:i,height:r}=n;mv(this._label,{x1:t,y1:e,x2:t+i,y2:e+r})}}initMarker(t){const{points:e,startSymbol:i,endSymbol:n,label:r,lineStyle:a,mainSegmentIndex:s,multiSegment:o}=this.attribute,l=new Lf({points:e,startSymbol:i,endSymbol:n,lineStyle:a,mainSegmentIndex:s,multiSegment:o,pickable:!1});l.name="mark-line-line",this._line=l,t.add(l);const u=new jc(Object.assign({},r));u.name="mark-line-label",this._label=u,t.add(u),this.setLabelPos()}updateMarker(){var t,e;const{points:i,startSymbol:n,endSymbol:r,label:a,lineStyle:s,mainSegmentIndex:o,multiSegment:l}=this.attribute;null===(t=this._line)||void 0===t||t.setAttributes({points:i,startSymbol:n,endSymbol:r,lineStyle:s,mainSegmentIndex:o,multiSegment:l}),null===(e=this._label)||void 0===e||e.setAttributes(Object.assign({dx:0,dy:0},a)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;return!(!t||t.length<2)}}xv.defaultAttributes=vv;class _v extends fv{getArea(){return this._area}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},_v.defaultAttributes,t)),this.name="markArea"}_getPositionByDirection(t,e){const{x1:i,x2:n,y1:r,y2:a}=this._area.AABBBounds;return e.includes("left")||e.includes("Left")?{x:i,y:(r+a)/2}:e.includes("right")||e.includes("Right")?{x:n,y:(r+a)/2}:e.includes("top")||e.includes("Top")?{x:(i+n)/2,y:r}:e.includes("bottom")||e.includes("Bottom")?{x:(i+n)/2,y:a}:{x:(i+n)/2,y:(r+a)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e}=this.attribute,i=null!==(t=null==e?void 0:e.position)&&void 0!==t?t:"middle",n=this._getPositionByDirection(this._area,i);if(this._label.setAttributes(Object.assign(Object.assign({},n),{textStyle:Object.assign(Object.assign({},yv[i]),e.textStyle)})),this.attribute.limitRect&&(null==e?void 0:e.confine)){const{x:t,y:e,width:i,height:n}=this.attribute.limitRect;mv(this._label,{x1:t,y1:e,x2:t+i,y2:e+n})}}}initMarker(t){const{points:e,label:i,areaStyle:n}=this.attribute,r=Uo(Object.assign({points:e},n));r.name="mark-area-area",this._area=r,t.add(r);const a=new jc(Object.assign({},i));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){var t,e;const{points:i,label:n,areaStyle:r}=this.attribute;null===(t=this._area)||void 0===t||t.setAttributes(Object.assign({points:i},r)),null===(e=this._label)||void 0===e||e.setAttributes(Object.assign({dx:0,dy:0},n)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;return!(!t||t.length<3)}}_v.defaultAttributes=gv;class Av extends fv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Av.defaultAttributes,t)),this.name="markPoint"}setLabelPos(){}setItemAttributes(e,i,n,r){var a;if(!e)return;const{autoRotate:s=!0,refX:o=0,refY:l=0,refAngle:u=0,textStyle:h,richTextStyle:d,imageStyle:c,position:f=t.IMarkPointItemPosition.middle}=i,v=(null===(a=this._line)||void 0===a?void 0:a.getEndAngle())||0,p=o*Math.cos(v)+l*Math.cos(v-Math.PI/2),g=o*Math.sin(v)+l*Math.sin(v-Math.PI/2);"text"===r?e.setAttributes(Object.assign(Object.assign({},h),{textStyle:Object.assign(Object.assign({},bv[(null==i?void 0:i.position)||"end"]),null==h?void 0:h.textStyle)})):"richText"===r?e.setAttributes({dx:this.getItemDx(e,f,d)+((null==d?void 0:d.dx)||0),dy:this.getItemDy(e,f,d)+((null==d?void 0:d.dy)||0)}):"image"===r&&e.setAttributes({dx:this.getItemDx(e,f,c)+((null==c?void 0:c.dx)||0),dy:this.getItemDy(e,f,c)+((null==c?void 0:c.dy)||0)}),e.setAttributes({x:n.x+(p||0),y:n.y+(g||0),angle:s&&v+u})}getItemDx(t,e,i){var n,r;const a=null!==(r=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==r?r:(null==i?void 0:i.width)||0;return e.includes("inside")?-a:0}getItemDy(t,e,i){var n,r;const a=null!==(r=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==r?r:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-a:e.includes("middle")||e.includes("Middle")?-a/2:0}initItem(t,e){const{type:i="text",symbolStyle:n,richTextStyle:r,imageStyle:a,renderCustomCallback:s}=t;let o;return"symbol"===i?o=Do(Object.assign(Object.assign({},e),n)):"text"===i?o=new jc(Object.assign({},e)):"richText"===i?o=zo(Object.assign(Object.assign({},e),r)):"image"===i?o=No(Object.assign(Object.assign({},e),a)):"custom"===i&&s&&(o=s()),this.setItemAttributes(o,t,e,i),o}getItemLineAttr(t,e,i){let n=[];const{type:r="type-s"}=t;return n="type-do"===r?[e,{x:(e.x+i.x)/2,y:i.y},i]:"type-po"===r?[e,{x:i.x,y:e.y},i]:"type-op"===r?[e,{x:e.x,y:i.y},i]:[e,i],n}setItemLineAttr(t,e,i,n){var r;const{startSymbol:a,endSymbol:s,lineStyle:o}=t,l=this.getItemLineAttr(t,e,i);null===(r=this._line)||void 0===r||r.setAttributes({points:l,startSymbol:a,endSymbol:s,lineStyle:o,visible:n})}getDecorativeLineAttr(t,e){var i;const n=(null===(i=null==t?void 0:t.decorativeLine)||void 0===i?void 0:i.length)||10,r=this._line.getEndAngle()||0;return{startPointOffsetX:n/2*Math.cos(r-Math.PI/2),startPointOffsetY:n/2*Math.sin(r-Math.PI/2),endPointOffsetX:-n/2*Math.cos(r-Math.PI/2),endPointOffsetY:-n/2*Math.sin(r-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var n;const{lineStyle:r}=t,{startPointOffsetX:a,startPointOffsetY:s,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t,e);null===(n=this._decorativeLine)||void 0===n||n.setAttributes(Object.assign(Object.assign({points:[{x:e.x+a,y:e.y+s},{x:e.x+o,y:e.y+l}]},r),{visible:i}))}initMarker(t){var e;const{position:i,itemLine:n,itemContent:r}=this.attribute,a={x:i.x+((null==r?void 0:r.offsetX)||0),y:i.y+((null==r?void 0:r.offsetY)||0)},s=new Lf({points:[],pickable:!1});s.name="mark-point-line",this._line=s,t.add(s);const o=Lo({points:[]});o.name="mark-point-decorativeLine",this._decorativeLine=o,t.add(o),this.setItemLineAttr(n,i,a,null==n?void 0:n.visible),this.setDecorativeLineAttr(n,a,null===(e=null==n?void 0:n.decorativeLine)||void 0===e?void 0:e.visible);const l=this.initItem(r,a);this._item=l,t.add(l)}updateMarker(){var t;const{position:e,itemLine:i,itemContent:n}=this.attribute,{type:r="text"}=n,a={x:e.x+((null==n?void 0:n.offsetX)||0),y:e.y+((null==n?void 0:n.offsetY)||0)};this.setItemLineAttr(i,e,a,null==i?void 0:i.visible),this.setDecorativeLineAttr(i,a,null===(t=null==i?void 0:i.decorativeLine)||void 0===t?void 0:t.visible),this.setItemAttributes(this._item,n,a,r)}isValidPoints(){return!0}}Av.defaultAttributes={itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10,symbolStyle:{symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},textStyle:{dx:0,dy:0},imageStyle:{width:80,height:80},richTextStyle:{width:100,height:100}}};const kv={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};class Bv extends lc{getCurrent(){return this._current}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Bv.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{var e,i;const n=t.target;if("preHandler"===n.name){if(1===this._current)return;this._current-=1,1===this._current?n.addState("disable"):n.removeState("disable");const i=new Yi("toPrev",{current:this._current,total:this._total,direction:"pre",event:t});i.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,this.dispatchEvent(i)}if("nextHandler"===n.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?n.addState("disable"):n.removeState("disable");const e=new Yi("toNext",{current:this._current,total:this._total,direction:"next",event:t});e.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(e)}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",`${this._current}/${this._total}`)}}render(){var t;this._reset();const{layout:i="horizontal",handler:n=kv,total:r,defaultCurrent:a=1,textStyle:s,padding:o=0}=this.attribute;this._current=a;const l=e.normalizePadding(o),u="horizontal"===i,h=Oo({x:0,y:0}),d=n.style||{},c=d.size||15,f=null!==(t=n.space)&&void 0!==t?t:8,v=n.state||{};let{preShape:p,nextShape:g}=n;p||(p=u?"triangleLeft":"triangleUp"),g||(g=u?"triangleRight":"triangleDown");const y=Do(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},d),{x:0,y:0,symbolType:p,size:c}));y.states=v,y.name="preHandler",this.preHandler=y,h.add(y);const{width:b,height:m}=Ic(`${r}/${r}`,Object.assign({textAlign:"center",textBaseline:"middle"},s)),x=e.isNumber(c)?c:c[0],_=e.isNumber(c)?c:c[1],A=jo(Object.assign({x:u?x/2+f+b/2:0,y:u?0:_/2+f+m/2,text:`${a}/${r}`,textAlign:"center",textBaseline:"middle",lineHeight:null==s?void 0:s.fontSize},s));this.text=A,h.add(A);const k=Do(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},d),{x:u?x+2*f+b:0,y:u?0:_+2*f+m,symbolType:g,size:c}));k.name="nextHandler",k.states=v,this.nextHandler=k,h.add(k),1===this._total?(y.addState("disable"),k.addState("disable")):1===this._current?y.addState("disable"):this._current===r&&k.addState("disable");const B=h.AABBBounds,S=B.width(),w=B.height();h.translateTo(0-B.x1+l[3],0-B.y1+l[0]),this.add(h),this.attribute.width=S+l[1]+l[3],this.attribute.height=w+l[0]+l[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}}Bv.defaultAttributes={handler:kv,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const Sv=16,wv=8,Tv=12,Cv=12;var Pv,Mv,Ev;t.LegendStateValue=void 0,(Pv=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",Pv.unSelected="unSelected",Pv.selectedHover="selectedHover",Pv.unSelectedHover="unSelectedHover",Pv.focus="focus",t.LegendEvent=void 0,(Mv=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",Mv.legendItemUnHover="legendItemUnHover",Mv.legendItemClick="legendItemClick",Mv.legendItemAttributeUpdate="legendItemAttributeUpdate",t.LEGEND_ELEMENT_NAME=void 0,(Ev=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",Ev.title="legendTitle",Ev.item="legendItem",Ev.itemShape="legendItemShape",Ev.itemLabel="legendItemLabel",Ev.itemValue="legendItemValue",Ev.focus="legendItemFocus";class Ov extends lc{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild();const{interactive:i=!0,title:n,padding:r=0}=this.attribute,a=e.normalizePadding(r),s=Oo({x:a[3],y:a[0],pickable:i,childrenPickable:i});s.name=t.LEGEND_ELEMENT_NAME.innerView,this.add(s),this._innerView=s,(null==n?void 0:n.visible)&&this._renderTitle(n),this._renderContent(),this._adjustLayout(),i&&this._bindEvents();const o=this._innerView.AABBBounds;this.attribute.width=o.width()+a[1]+a[3],this.attribute.height=o.height()+a[0]+a[2]}_renderTitle(i){const{text:n="",textStyle:r,padding:a=0,background:s,minWidth:o,maxWidth:l,shape:u}=i,h={x:0,y:0,text:n,textStyle:r,padding:e.normalizePadding(a),minWidth:o,maxWidth:l};u&&u.visible&&(h.shape=Object.assign({visible:!0},u.style),e.isValid(u.space)&&(h.space=u.space)),s&&s.visible&&(h.panel=Object.assign({visible:!0},s.style));const d=new jc(h);d.name=t.LEGEND_ELEMENT_NAME.title,this._title=d,this._innerView.add(d)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),n=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===n?this._title.setAttribute("x",(e-i)/2):"end"===n&&this._title.setAttribute("x",e-i)}}}const Lv={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};class Rv extends Ov{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},Rv.defaultAttributes,i)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=e=>{var i;const n=e.target;if(null===(i=null==n?void 0:n.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const t=n.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===t.id)return;this._unHover(this._lastActiveItem,e)}this._hover(t,e)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,e),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=e=>{var i,n,r,a,s;const o=e.target;if(null===(i=null==o?void 0:o.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const i=o.delegate;if(o.name===t.LEGEND_ELEMENT_NAME.focus){const a=i.hasState(t.LegendStateValue.focus);i.toggleState(t.LegendStateValue.focus),a?null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((i=>{this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover,t.LegendStateValue.focus],e),this._setLegendItemState(i,t.LegendStateValue.selected,e)})):(this._setLegendItemState(i,t.LegendStateValue.selected,e),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(r=this._itemsContainer)||void 0===r||r.getChildren().forEach((n=>{i!==n&&(this._removeLegendItemState(n,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover,t.LegendStateValue.focus],e),this._setLegendItemState(n,t.LegendStateValue.unSelected,e))})))}else{null===(a=this._itemsContainer)||void 0===a||a.getChildren().forEach((e=>{e.removeState(t.LegendStateValue.focus)}));const{selectMode:n="multiple",allowAllCanceled:r=!0}=this.attribute,o=i.hasState(t.LegendStateValue.selected),l=this._getSelectedLegends();if("multiple"===n){if(!1===r&&o&&1===l.length)return void this._dispatchEvent(t.LegendEvent.legendItemClick,i,e);o?(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(i,t.LegendStateValue.unSelected,e)):(this._setLegendItemState(i,t.LegendStateValue.selected,e),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e))}else this._setLegendItemState(i,t.LegendStateValue.selected,e),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((n=>{i!==n&&(this._removeLegendItemState(n,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(n,t.LegendStateValue.unSelected,e))}))}this._dispatchEvent(t.LegendEvent.legendItemClick,i,e)}}}setSelected(e){var i;(null===(i=this._itemsContainer)||void 0===i?void 0:i.getChildren()).forEach((i=>{const n=i.data;e.includes(n.label)?(this._setLegendItemState(i,t.LegendStateValue.selected),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover])):(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(i,t.LegendStateValue.unSelected))}))}_renderContent(){const{item:t={},items:i,reversed:n,maxCol:r=1,maxRow:a=2}=this.attribute;if(!1===t.visible||e.isEmpty(i))return;let s=i;n&&(s=null==i?void 0:i.reverse());const o=Oo({x:0,y:0});this._itemsContainer=o;const{layout:l,maxWidth:u,maxHeight:h,defaultSelected:d=[],autoPage:c}=this.attribute,f="horizontal"===l,{spaceCol:v=Sv,spaceRow:p=wv,maxWidth:g,width:y,height:b}=t;e.isValid(g)?e.isValid(y)?this._itemWidthByUser=Math.min(g,y):this._itemWidthByUser=g:e.isValid(y)&&(this._itemWidthByUser=y),e.isValid(b)&&(this._itemHeightByUser=b);let m=!1,x=0,_=0,A=0,k=1,B=1;s.forEach(((t,i)=>{t.id||(t.id=t.label),t.index=i;const n=this._renderEachItem(t,!!e.isEmpty(d)||(null==d?void 0:d.includes(t.label)),i,s),l=n.attribute.width,c=n.attribute.height;this._itemHeight=Math.max(this._itemHeight,c),x=Math.max(l,x),this._itemMaxWidth=Math.max(l,this._itemMaxWidth),f?(k=a,e.isValid(u)&&(l>=u?(m=!0,i>0&&(_=0,A+=c+p,B+=1)):u<_+l&&(m=!0,_=0,A+=c+p,B+=1)),i>0&&n.setAttributes({x:_,y:A}),_+=v+l):(k=r,e.isValid(h)&&h<A+c&&(m=!0,A=0,_+=x+v,x=0,B+=1),i>0&&n.setAttributes({x:_,y:A}),A+=p+c),o.add(n)}));let S=!1;m&&c&&B>k&&(S=this._renderPager(f)),S||(o.setAttribute("y",this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",8):0),this._innerView.add(o))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_renderEachItem(i,n,r,a){const{id:s,label:o,value:l,shape:u}=i,{padding:h=0,focus:d,focusIconStyle:c={}}=this.attribute.item;let{shape:f={},label:v={},value:p={},background:g={}}=this.attribute.item;f=this._handleStyle(f,i,n,r,a),v=this._handleStyle(v,i,n,r,a),p=this._handleStyle(p,i,n,r,a),g=this._handleStyle(g,i,n,r,a);const y=e.normalizePadding(h);let b;!1===g.visible?(b=Oo({x:0,y:0,cursor:(null==g?void 0:g.style).cursor}),this._appendDataToShape(b,t.LEGEND_ELEMENT_NAME.item,i,b)):(b=Oo(Object.assign({x:0,y:0},null==g?void 0:g.style)),this._appendDataToShape(b,t.LEGEND_ELEMENT_NAME.item,i,b,null==g?void 0:g.state)),b.id=`${null!=s?s:o}-${r}`,b.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const m=Oo({x:0,y:0,pickable:!1});b.add(m);let x,_=0,A=0,k=0;if(!1!==(null==f?void 0:f.visible)){A=e.get(f,"style.size",10),k=e.get(f,"space",8);const r=Do(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},u),f.style));Object.keys(f.state||{}).forEach((t=>{const i=f.state[t].fill||f.state[t].stroke;u.fill&&e.isNil(f.state[t].fill)&&i&&(f.state[t].fill=i),u.stroke&&e.isNil(f.state[t].stroke)&&i&&(f.state[t].stroke=i)})),this._appendDataToShape(r,t.LEGEND_ELEMENT_NAME.itemShape,i,b,null==f?void 0:f.state),r.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),m.add(r)}let B=0;if(d){const n=e.get(c,"size",10);x=Do(Object.assign(Object.assign({x:0,y:-n/2-1,strokeBoundsBuffer:0},c),{visible:!0,pickMode:"imprecise",boundsPadding:y})),this._appendDataToShape(x,t.LEGEND_ELEMENT_NAME.focus,i,b),B=n}const S=jo(Object.assign(Object.assign({x:A/2+k,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==v?void 0:v.style).fontSize},null==v?void 0:v.style),{text:v.formatMethod?v.formatMethod(o,i,r):o}));this._appendDataToShape(S,t.LEGEND_ELEMENT_NAME.itemLabel,i,b,null==v?void 0:v.state),S.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),m.add(S);const w=e.get(v,"space",8);if(e.isValid(l)){const a=e.get(p,"space",d?8:0),s=jo(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==p?void 0:p.style).fontSize},null==p?void 0:p.style),{text:p.formatMethod?p.formatMethod(l,i,r):l}));if(this._appendDataToShape(s,t.LEGEND_ELEMENT_NAME.itemValue,i,b,null==p?void 0:p.state),s.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-y[1]-y[3]-A-k-w-B-a,e=s.AABBBounds,i=S.AABBBounds,n=e.width(),r=i.width();r>t?(t-n)/r>.4?S.setAttribute("maxLineWidth",t-n):(s.setAttribute("maxLineWidth",.5*t),S.setAttribute("maxLineWidth",.5*t)):s.setAttribute("maxLineWidth",t-r),p.alignRight?s.setAttributes({textAlign:"right",x:this._itemWidthByUser-A/2-y[1]-y[3]-B-a}):s.setAttribute("x",S.AABBBounds.x2+a)}else s.setAttribute("x",S.AABBBounds.x2+a);_=s.AABBBounds.x2+a,m.add(s)}else this._itemWidthByUser?(S.setAttribute("maxLineWidth",this._itemWidthByUser-y[1]-y[3]-A-k-B),_=S.AABBBounds.x2+w):_=S.AABBBounds.x2+w;x&&(x.setAttribute("x",_),m.add(x));const T=m.AABBBounds,C=T.width(),P=T.height(),M=e.isValid(this.attribute.item.width)?this.attribute.item.width:C+y[1]+y[3],E=this._itemHeightByUser||P+y[0]+y[2];return b.attribute.width=M,b.attribute.height=E,x&&x.setAttribute("visible",!1),m.translateTo(-T.x1+y[3],-T.y1+y[0]),b}_renderPager(t){const i=this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",8):0,{maxWidth:n,maxHeight:r,maxCol:a=1,maxRow:s=2,item:o={},pager:l={},disableTriggerEvent:u}=this.attribute,{spaceCol:h=Sv,spaceRow:d=wv}=o,c=this._itemsContainer,{animation:f=!0,animationDuration:v=450,animationEasing:p="quadIn",space:g=Cv,position:y="middle"}=l,b=dc(l,["animation","animationDuration","animationEasing","space","position"]);let m,x=0,_=0,A=0,k=0,B=1;if(t){if(m=new Bv(Object.assign(Object.assign({layout:1===s?"horizontal":"vertical",total:99},e.merge({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},b)),{disableTriggerEvent:u})),this._pager=m,this._innerView.add(m),x=(s-1)*d+this._itemHeight*s,_=n-m.AABBBounds.width()-g,_<=0)return this._innerView.removeChild(m),!1;let t;c.getChildren().forEach(((t,e)=>{const{width:i,height:n}=t.attribute;_<A+i&&(A=0,k+=n+d,B+=1),e>0&&t.setAttributes({x:A,y:k}),A+=h+i})),m.setAttribute("total",Math.ceil(B/s)),t="start"===y?i:"end"===y?i+x-m.AABBBounds.height()/2:i+x/2-m.AABBBounds.height()/2,m.setAttributes({x:_,y:t})}else{if(m=new Bv(Object.assign({layout:"horizontal",total:99,disableTriggerEvent:u},b)),this._pager=m,this._innerView.add(m),_=this._itemMaxWidth*a+(a-1)*h,x=r-m.AABBBounds.height()-g-i,x<=0)return this._innerView.removeChild(m),!1;let t;c.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;x<k+i&&(k=0,A+=this._itemMaxWidth+h,B+=1),e>0&&t.setAttributes({x:A,y:k}),k+=d+i})),m.setAttribute("total",Math.ceil(B/a)),t="start"===y?0:"end"===y?_-m.AABBBounds.width():(_-m.AABBBounds.width())/2,m.setAttributes({x:t,y:r-m.AABBBounds.height()})}l.defaultCurrent>1&&(t?c.setAttribute("y",-(l.defaultCurrent-1)*(x+d)):c.setAttribute("x",-(l.defaultCurrent-1)*(_+h)));const S=Oo({x:0,y:i,width:_,height:x,clip:!0,pickable:!1});S.add(c),this._innerView.add(S);const w=e=>{const{current:i}=e.detail;f?c.animate().to(t?{y:-(i-1)*(x+d)}:{x:-(i-1)*(_+h)},v,p):t?c.setAttribute("y",-(i-1)*(x+d)):c.setAttribute("x",-(i-1)*(_+h))};return this._pager.addEventListener("toPrev",w),this._pager.addEventListener("toNext",w),!0}_hover(e,i){this._lastActiveItem=e;e.hasState(t.LegendStateValue.selected)?this._setLegendItemState(e,t.LegendStateValue.selectedHover,i):this._setLegendItemState(e,t.LegendStateValue.unSelectedHover,i);const n=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);n&&n.setAttribute("visible",!0),this._dispatchEvent(t.LegendEvent.legendItemHover,e,i)}_unHover(e,i){let n=!1;(e.hasState(t.LegendStateValue.unSelectedHover)||e.hasState(t.LegendStateValue.selectedHover))&&(n=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover),e.getChildren()[0].getChildren().forEach((e=>{n||!e.hasState(t.LegendStateValue.unSelectedHover)&&!e.hasState(t.LegendStateValue.selectedHover)||(n=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover)}));const r=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);r&&r.setAttribute("visible",!1),n&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e,i),this._dispatchEvent(t.LegendEvent.legendItemUnHover,e,i)}_setLegendItemState(e,i,n){let r=!1;e.hasState(i)||(r=!0),e.addState(i,true),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&(r||e.hasState(i)||(r=!0),e.addState(i,true))})),r&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e,n)}_removeLegendItemState(e,i,n){let r=!1;i.forEach((t=>{!r&&e.hasState(t)&&(r=!0),e.removeState(t)})),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&i.forEach((t=>{!r&&e.hasState(t)&&(r=!0),e.removeState(t)}))})),r&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e,n)}_getSelectedLegends(){var e;const i=[];return null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{e.hasState(t.LegendStateValue.selected)&&i.push(e.data)})),i}_appendDataToShape(t,i,n,r,a={}){t.name=i,t.data=n,t.delegate=r,t.states=e.merge({},Lv,a)}_dispatchEvent(e,i,n){var r;const a=this._getSelectedLegends();a.sort(((t,e)=>t.index-e.index));const s=a.map((t=>t.label)),o=new Yi(e,{item:i,data:i.data,selected:i.hasState(t.LegendStateValue.selected),currentSelectedItems:a,currentSelected:s,event:n});o.manager=null===(r=this.stage)||void 0===r?void 0:r.eventSystem.manager,this.dispatchEvent(o)}_handleStyle(t,i,n,r,a){const s=e.merge({},t);return t.style&&e.isFunction(t.style)&&(s.style=t.style(i,n,r,a)),t.state&&Object.keys(t.state).forEach((o=>{t.state[o]&&e.isFunction(t.state[o])&&(s.state[o]=t.state[o](i,n,r,a))})),s}}var Iv;function jv(t){return e.isArray(t)?t:[t,t]}function Dv(t){return t?"ew-resize":"ns-resize"}Rv.defaultAttributes={layout:"horizontal",title:{align:"start",space:Tv,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:Sv,spaceRow:wv,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:Cv,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(Iv=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",Iv.railContainer="sliderRailContainer",Iv.rail="sliderRail",Iv.startText="sliderStartText",Iv.endText="sliderEndText",Iv.startHandler="sliderStartHandler",Iv.startHandlerText="startHandlerText",Iv.endHandler="sliderEndHandler",Iv.endHandlerText="sliderEndHandlerText",Iv.track="sliderTrack",Iv.trackContainer="sliderTrackContainer";class Nv extends lc{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Nv.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._currentHandler=t.target,this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===xd.env?(xd.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),xd.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var i,n;t.stopPropagation();const{railWidth:r,railHeight:a,min:s,max:o}=this.attribute;if(o===s)return;let l,u,h,d=0;this._isHorizontal?(l=t.clientX,d=l-this._prePos,u=null===(n=this._currentHandler)||void 0===n?void 0:n.attribute.x,h=r):(l=t.clientY,d=l-this._prePos,u=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.y,h=a);const c=e.clamp(u+d,0,h),f=c/h*(o-s)+s;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,c,f):this._updateHandler(this._currentHandler,c,f),this._updateTrack(),this._prePos=l,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._currentHandler=null,"browser"===xd.env?(xd.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),xd.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===xd.env?(xd.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),xd.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation();const{railWidth:i,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const{startHandler:s,endHandler:o}=this._getHandlers();let l,u,h;this._isHorizontal?(l=t.clientX,u=this._track.attribute.width,h=i):(l=t.clientY,u=this._track.attribute.height,h=n);const d=l-this._prePos;if(s){const t=this._isHorizontal?s.attribute.x:s.attribute.y,i=e.clamp(t+d,0,h-u),n=i/h*(a-r)+r;this._updateHandler(s,i,n)}if(o){const t=this._isHorizontal?o.attribute.x:o.attribute.y,i=e.clamp(t+d,u,h),n=i/h*(a-r)+r;this._updateHandler(o,i,n),this._track.setAttributes(this._isHorizontal?{x:Math.min(null==s?void 0:s.attribute.x,null==o?void 0:o.attribute.x),width:Math.abs((null==s?void 0:s.attribute.x)-(null==o?void 0:o.attribute.x))}:{y:Math.min(null==s?void 0:s.attribute.y,null==o?void 0:o.attribute.y),height:Math.abs((null==s?void 0:s.attribute.y)-(null==o?void 0:o.attribute.y))})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),"browser"===xd.env?(xd.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),xd.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation();const{railWidth:i,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const s=this._startHandler,o=this._endHandler;let l,u,h,d;this._isHorizontal?(l=t.viewX-this._rail.globalAABBBounds.x1,u=null==s?void 0:s.attribute.x,h=null==o?void 0:o.attribute.x,d=i):(l=t.viewY-this._rail.globalAABBBounds.y1,u=null==s?void 0:s.attribute.y,h=null==o?void 0:o.attribute.y,d=n);const c=l/d*(a-r)+r;if(e.isValid(h)){const t=Math.abs(l-u)>Math.abs(l-h)?o:s;this._updateHandler(t,l,c)}else this._updateHandler(s,l,c);this._updateTrack(),this._dispatchChangeEvent()}}setValue(t){const{layout:i,railWidth:n,railHeight:r,min:a,max:s}=this.attribute;if(s===a)return;const[o,l]=e.array(t),{startHandler:u,endHandler:h}=this._getHandlers(),d="vertical"===i?r:n,c=(o-a)/(s-a)*d;if(u&&this._updateHandler(u,c,o),h){const t=(l-a)/(s-a)*d;this._updateHandler(h,t,l)}this._updateTrack()}render(){var i,n;this.removeAllChild();const{layout:r="horizontal",railWidth:a,railHeight:s,startText:o,endText:l,min:u,max:h,showHandler:d=!0}=this.attribute;let{value:c}=this.attribute;e.isNil(c)&&(c=[u,h]),this._currentValue={startValue:jv(c)[0],endValue:jv(c)[1]};const f="horizontal"===r;this._isHorizontal=f;const v=Oo({x:0,y:0});v.name=t.SLIDER_ELEMENT_NAME.innerView,this.add(v),this._innerView=v;let p,g=0;if(o&&o.visible){p=jo(Object.assign({x:f?0:a/2,y:f?s/2:0,textAlign:f?"start":"center",textBaseline:f?"middle":"top",text:o.text,lineHeight:null===(i=o.style)||void 0===i?void 0:i.fontSize},o.style)),p.name=t.SLIDER_ELEMENT_NAME.startText,v.add(p);const n=e.isValid(o.space)?o.space:0;g+=(f?p.AABBBounds.width():p.AABBBounds.height())+n}const y=Oo({x:f?g:0,y:f?0:g});v.add(y);const b=Oo({x:0,y:0});let m;if(b.name=t.SLIDER_ELEMENT_NAME.railContainer,this._railContainer=b,y.add(b),this._renderRail(b),g+=f?a:s,l&&l.visible){const i=e.isValid(l.space)?l.space:0;m=jo(Object.assign({x:f?g+i:a/2,y:f?s/2:g+i,textAlign:f?"start":"center",textBaseline:f?"middle":"top",text:l.text,lineHeight:null===(n=l.style)||void 0===n?void 0:n.fontSize},l.style)),m.name=t.SLIDER_ELEMENT_NAME.endText,v.add(m)}this._renderTrack(b),d&&(this._renderHandlers(y),this._bindEvents())}_renderRail(e){const{railWidth:i,railHeight:n,railStyle:r,slidable:a}=this.attribute;let s="default";!1!==a&&(s="pointer");const o=Io(Object.assign({x:0,y:0,width:i,height:n,cursor:s},r));return o.name=t.SLIDER_ELEMENT_NAME.rail,e.add(o),this._rail=o,o}_renderHandlers(i){const{range:n,min:r,max:a,handlerSize:s=14,handlerStyle:o,handlerText:l,railHeight:u,railWidth:h,slidable:d}=this.attribute;let{value:c}=this.attribute;e.isNil(c)&&(c=[r,a]);const f=l&&l.visible,v=this._isHorizontal,p=v?h:u,[g,y]=jv(c),b=a===r?n?0:p:(g-r)/(a-r)*p,m=this._renderHandler(Object.assign({x:v?b:h/2,y:v?u/2:b,size:s,strokeBoundsBuffer:0,cursor:!1===d?"default":Dv(v)},o));if(m.name=t.SLIDER_ELEMENT_NAME.startHandler,this._startHandler=m,i.add(m),this._currentValue.startPos=b,f){const e=this._renderHandlerText(g,n?"start":"end");e.name=t.SLIDER_ELEMENT_NAME.startHandlerText,i.add(e),this._startHandlerText=e}if(n){const e=a===r?p:(y-r)/(a-r)*p,n=this._renderHandler(Object.assign({x:v?e:h/2,y:v?u/2:e,size:s,strokeBoundsBuffer:0,cursor:!1===d?"default":Dv(v)},o));if(n.name=t.SLIDER_ELEMENT_NAME.endHandler,this._endHandler=n,i.add(n),this._currentValue.endPos=e,f){const e=this._renderHandlerText(y,"end");e.name=t.SLIDER_ELEMENT_NAME.endHandlerText,i.add(e),this._endHandlerText=e}}}_renderTrack(i){const{range:n,min:r,max:a,railHeight:s,railWidth:o,trackStyle:l,railStyle:u,slidable:h,value:d}=this.attribute;let c,f;if(e.isNil(d))n?(c=r,f=a):c=f=r;else if(n){const t=e.clampRange(d,r,a);c=t[0],f=t[1]}else c=r,f=e.clamp(d,r,a);const v=this._isHorizontal,p=v?o:s;n||(c=r);const g=Oo({x:0,y:0,width:o,height:s,cornerRadius:null==u?void 0:u.cornerRadius,clip:!0,pickable:!1});g.name=t.SLIDER_ELEMENT_NAME.trackContainer;const y=e.isObject(n)&&!0===n.draggableTrack;let b;b=!1===h?"default":!1===n||!1===y?"pointer":Dv(v);const m=a===r?p:(f-c)/(a-r)*p,x=a===r?0:(c-r)/(a-r)*p,_=Io(Object.assign({x:v?x:0,y:v?0:x,width:v?m:o,height:v?s:m,cursor:b},l));_.name=t.SLIDER_ELEMENT_NAME.track,this._track=_,g.add(_),i.add(g)}_renderHandler(t){return Do(t)}_renderHandlerText(t,e){var i,n,r;const{align:a,min:s,max:o,handlerSize:l=14,handlerText:u={},railHeight:h,railWidth:d,slidable:c}=this.attribute,f=this._isHorizontal,v=f?d:h,p=o===s?"start"===e?0:v:(t-s)/(o-s)*v,g=null!==(i=u.space)&&void 0!==i?i:4,y={text:(null==u?void 0:u.formatter)?u.formatter(t):t.toFixed(null!==(n=null==u?void 0:u.precision)&&void 0!==n?n:0),lineHeight:null===(r=u.style)||void 0===r?void 0:r.lineHeight,cursor:!1===c?"default":Dv(f)};f?"top"===a?(y.textBaseline="bottom",y.textAlign="center",y.x=p,y.y=(h-l)/2-g):(y.textBaseline="top",y.textAlign="center",y.x=p,y.y=(h+l)/2+g):"left"===a?(y.textBaseline="middle",y.textAlign="end",y.x=(d-l)/2-g,y.y=p):(y.textBaseline="middle",y.textAlign="start",y.x=(d+l)/2+g,y.y=p);return jo(Object.assign(Object.assign({},y),u.style))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:i}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),e.isObject(i)&&i.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_updateTrack(){const t=this._startHandler,e=this._endHandler;if(this._isHorizontal){const i=null==t?void 0:t.attribute.x;if(e){const t=null==e?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else this._track.setAttributes({width:i})}else{const i=null==t?void 0:t.attribute.y;if(e){const t=null==e?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(i,t),height:Math.abs(i-t)})}else this._track.setAttributes({height:i})}}_updateHandler(e,i,n){var r;const a=this._isHorizontal;e.setAttribute(a?"x":"y",i);const s=e.name===t.SLIDER_ELEMENT_NAME.startHandler?this._startHandlerText:this._endHandlerText;if(s){const{handlerText:t}=this.attribute;null==s||s.setAttributes({text:(null==t?void 0:t.formatter)?t.formatter(n):n.toFixed(null!==(r=null==t?void 0:t.precision)&&void 0!==r?r:0),[a?"x":"y"]:i})}e.name===t.SLIDER_ELEMENT_NAME.startHandler?(this._currentValue.startValue=n,this._currentValue.startPos=i):(this._currentValue.endValue=n,this._currentValue.endPos=i)}_updateHandlerText(e,i,n){var r;const a=this._isHorizontal,{handlerText:s}=this.attribute;e.setAttributes({[a?"x":"y"]:i,text:(null==s?void 0:s.formatter)?s.formatter(n):n.toFixed(null!==(r=null==s?void 0:s.precision)&&void 0!==r?r:0)});const o=e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?this._startHandler:this._endHandler;o&&(null==o||o.setAttributes({[a?"x":"y"]:i})),e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?(this._currentValue.startValue=n,this._currentValue.startPos=i):(this._currentValue.endValue=n,this._currentValue.endPos=i)}_dispatchChangeEvent(){var t;const e=!!this.attribute.range,i=this._currentValue,n=new Yi("change",{value:e?[Math.min(i.endValue,i.startValue),Math.max(i.endValue,i.startValue)]:i.startValue,position:e?[Math.min(i.endPos,i.startPos),Math.max(i.endPos,i.startPos)]:i.startPos});n.manager=null===(t=this.stage)||void 0===t?void 0:t.eventSystem.manager,this.dispatchEvent(n)}_getHandlers(){let t,e=this._startHandler,i=this._endHandler;return this._isHorizontal?i&&i.attribute.x<(null==e?void 0:e.attribute.x)&&(t=e,e=i,i=t):i&&i.attribute.y<(null==e?void 0:e.attribute.y)&&(t=e,e=i,i=t),{startHandler:e,endHandler:i}}}Nv.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}};class Uv extends Ov{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Uv.defaultAttributes,t)),this.name="colorLegend",this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:n,layout:r,align:a,min:s,max:o,value:l,railWidth:u,railHeight:h,showHandler:d=!0,handlerSize:c,handlerStyle:f,railStyle:v,trackStyle:p,startText:g,endText:y,handlerText:b,showTooltip:m,tooltip:x,disableTriggerEvent:_}=this.attribute,A=[],k=(o-s)/(t.length-1);for(let e=0;e<t.length;e++)A.push(s+k*e);this._colorScale=(new i.LinearScale).domain(A,!0).range(t),this._color=this._getTrackColor();const B=new Nv({x:0,y:0,range:{draggableTrack:!0},slidable:n,layout:r,align:a,min:s,max:o,value:l,railWidth:u,railHeight:h,showHandler:d,handlerSize:c,handlerStyle:f,railStyle:v,trackStyle:Object.assign({fill:this._color},p),startText:g,endText:y,handlerText:b,showTooltip:m,tooltip:x,disableTriggerEvent:_});this._innerView.add(B),this._slider=B,B.translateTo(0-B.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",Tv):0)-B.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}_getTrackColor(){const{colors:t,layout:i}=this.attribute;if(e.isEmpty(t))return;const n=t.length;if(1===n)return t[0];const r=[];for(let e=0;e<n;e++){const i=e/(n-1);r.push({offset:i,color:t[e]})}const a="horizontal"===i;return{gradient:"linear",stops:r,x0:0,y0:0,x1:a?1:0,y1:a?0:1}}_updateColor(){const{layout:t="horizontal",colors:e,railWidth:i,railHeight:n}=this.attribute,{startHandler:r,endHandler:a,track:s}=this._slider,{startValue:o,endValue:l,startPos:u,endPos:h}=this._slider.currentValue,d=this._colorScale.scale(o),c=this._colorScale.scale(l);null==r||r.setAttribute("fill",d),null==a||a.setAttribute("fill",c);const f="horizontal"===t?i:n;if(Math.abs(u-h)!==f&&e&&e.length>1){const t=this._color.stops,e=Math.min(u,h),i=Math.max(u,h),n=e/f,r=i/f,a=r-n,d=t.filter((t=>t.offset>n&&t.offset<r)),c=Math.min(o,l),v=Math.max(o,l),p=this._colorScale.scale(c),g=this._colorScale.scale(v),y=[{offset:0,color:p}];d.forEach((t=>{y.push({offset:(t.offset-n)/a,color:t.color})})),y.push({offset:1,color:g}),s.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:y}))}}}function zv(t="bottom"){let e=0;const i=3.5,n=2.5;return"top"===t?`\n M${e},-6L${e-i},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+n},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-n},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-i},2.5\n v-5\n h7\n v5\n Z\n`}Uv.defaultAttributes={layout:"horizontal",title:{align:"start",space:Tv,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}}};class Hv extends Ov{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Hv.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:i,align:n,min:r,max:a,value:s,railWidth:o,railHeight:l,showHandler:u=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:f,startText:v,endText:p,handlerText:g,showTooltip:y,tooltip:b,sizeBackground:m,disableTriggerEvent:x}=this.attribute,_=Oo({x:0,y:0});this._innerView.add(_);const A=new Nv({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:i,align:n,min:r,max:a,value:s,railWidth:o,railHeight:l,showHandler:u,handlerSize:h,handlerStyle:Object.assign({symbolType:zv(n)},d),railStyle:c,trackStyle:f,startText:v,endText:p,handlerText:g,showTooltip:y,tooltip:b,disableTriggerEvent:x});_.add(A);let k,B=0;const S=12;"horizontal"===i?"top"===n?(k=`M0,0L${o},0L${o},12Z`,B=l):(k=`M0,12L${o},12L${o},0Z`,A.setAttribute("y",S)):"left"===n?k=`M${o},0L${o},0L${o+S},${l}L${o},${l}Z`:(k=`M0,${l}L12,${l}L12,0Z`,A.setAttribute("x",S));const w=Ro(Object.assign(Object.assign({x:0,y:B,path:k},m),{zIndex:0}));_.add(w);const T=this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",Tv):0;_.translate(0-_.AABBBounds.x1,T-_.AABBBounds.y1),this._slider=A}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}Hv.defaultAttributes={layout:"horizontal",title:{align:"start",space:Tv,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};class Vv extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Vv.defaultAttributes,t)),this.name="title"}render(){var t,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_,A,k,B,S,w,T,C,P,M,E,O,L,R,I,j,D,N,U,z,H,V,W,F,G,Y,X,$,q,K,Z,J,Q,tt,et,it,nt,rt,at,st,ot,lt,ut,ht,dt,ct,ft,vt,pt,gt,yt,bt,mt,xt,_t,At,kt,Bt,St,wt;const{textType:Tt,text:Ct,subtextType:Pt,textStyle:Mt,subtext:Et,subtextStyle:Ot,width:Lt,height:Rt,minWidth:It,maxWidth:jt,minHeight:Dt,maxHeight:Nt,align:Ut,verticalAlign:zt,padding:Ht=0}=this.attribute,Vt=e.normalizePadding(Ht),Wt=this.createOrUpdateChild("title-container",{x:Vt[3],y:Vt[0],zIndex:1},"group");if(!1!==(null===(t=this.attribute)||void 0===t?void 0:t.visible)&&!1!==(null==Mt?void 0:Mt.visible))if("rich"===Tt||e.isValid(Mt.character)){const t=Object.assign({x:null!==(i=Mt.x)&&void 0!==i?i:0,y:null!==(n=Mt.y)&&void 0!==n?n:0,width:null!==(a=null!==(r=Mt.width)&&void 0!==r?r:Lt)&&void 0!==a?a:0,height:null!==(o=null!==(s=Mt.height)&&void 0!==s?s:Rt)&&void 0!==o?o:0,ellipsis:null===(l=Mt.ellipsis)||void 0===l||l,wordBreak:null!==(u=Mt.wordBreak)&&void 0!==u?u:"break-word",maxHeight:Mt.maxHeight,maxWidth:Mt.maxWidth,textConfig:null!==(h=Mt.character)&&void 0!==h?h:Ct},Mt);this._mainTitle=Wt.createOrUpdateChild("mainTitle",t,"richtext")}else if("html"===Tt){const t=Object.assign({html:Object.assign(Object.assign({dom:Ct},Lc),Mt),x:null!==(d=Mt.x)&&void 0!==d?d:0,y:null!==(c=Mt.y)&&void 0!==c?c:0,width:null!==(v=null!==(f=Mt.width)&&void 0!==f?f:Lt)&&void 0!==v?v:0,height:null!==(g=null!==(p=Mt.height)&&void 0!==p?p:Rt)&&void 0!==g?g:0,ellipsis:null===(y=Mt.ellipsis)||void 0===y||y,wordBreak:null!==(b=Mt.wordBreak)&&void 0!==b?b:"break-word",maxHeight:Mt.maxHeight,maxWidth:Mt.maxWidth,textConfig:[]},Mt);this._mainTitle=Wt.createOrUpdateChild("mainTitle",t,"richtext")}else e.isValid(Ct)&&(this._mainTitle=Wt.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:[Ct]},Mt),{maxLineWidth:null!==(m=null==Mt?void 0:Mt.maxLineWidth)&&void 0!==m?m:Lt,heightLimit:null==Mt?void 0:Mt.heightLimit,lineClamp:null==Mt?void 0:Mt.lineClamp,ellipsis:null===(x=null==Mt?void 0:Mt.ellipsis)||void 0===x||x,x:0,y:0}),"wrapText"));const Ft=this._mainTitle?null===(_=this._mainTitle)||void 0===_?void 0:_.AABBBounds.height():0,Gt=this._mainTitle?null===(A=this._mainTitle)||void 0===A?void 0:A.AABBBounds.width():0;if(!1!==(null===(k=this.attribute)||void 0===k?void 0:k.visible)&&!1!==(null==Ot?void 0:Ot.visible))if("rich"===Pt||e.isValid(Ot.character)){const t=Object.assign({x:null!==(B=Ot.x)&&void 0!==B?B:0,y:null!==(S=Ot.y)&&void 0!==S?S:0,width:null!==(T=null!==(w=Ot.width)&&void 0!==w?w:Lt)&&void 0!==T?T:0,height:null!==(P=null!==(C=Ot.height)&&void 0!==C?C:Rt)&&void 0!==P?P:0,ellipsis:null===(M=Ot.ellipsis)||void 0===M||M,wordBreak:null!==(E=Ot.wordBreak)&&void 0!==E?E:"break-word",maxHeight:Ot.maxHeight,maxWidth:Ot.maxWidth,textConfig:null!==(O=Ot.character)&&void 0!==O?O:Et},Ot);this._subTitle=Wt.createOrUpdateChild("subTitle",t,"richtext")}else if("html"===Pt){const t=Object.assign({html:Object.assign(Object.assign({dom:Et},Lc),Ot),x:null!==(L=Ot.x)&&void 0!==L?L:0,y:null!==(R=Ot.y)&&void 0!==R?R:0,width:null!==(j=null!==(I=Ot.width)&&void 0!==I?I:Lt)&&void 0!==j?j:0,height:null!==(N=null!==(D=Ot.height)&&void 0!==D?D:Rt)&&void 0!==N?N:0,ellipsis:null===(U=Ot.ellipsis)||void 0===U||U,wordBreak:null!==(z=Ot.wordBreak)&&void 0!==z?z:"break-word",maxHeight:Ot.maxHeight,maxWidth:Ot.maxWidth,textConfig:[]},Ot);this._subTitle=Wt.createOrUpdateChild("subTitle",t,"richtext")}else e.isValid(Et)&&(this._subTitle=Wt.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:[Et]},Ot),{maxLineWidth:null!==(H=null==Ot?void 0:Ot.maxLineWidth)&&void 0!==H?H:Lt,heightLimit:null==Ot?void 0:Ot.heightLimit,lineClamp:null==Ot?void 0:Ot.lineClamp,ellipsis:null===(V=null==Ot?void 0:Ot.ellipsis)||void 0===V||V,x:0,y:Ft}),"wrapText"));const Yt=this._subTitle?null===(W=this._subTitle)||void 0===W?void 0:W.AABBBounds.height():0,Xt=this._subTitle?null===(F=this._subTitle)||void 0===F?void 0:F.AABBBounds.width():0;let $t=Math.max(Gt,Xt),qt=Ft+(null!==(G=null==Ot?void 0:Ot.height)&&void 0!==G?G:Yt);if(e.isValid(Lt)&&($t=Lt,null===(Y=this._mainTitle)||void 0===Y||Y.setAttribute("maxLineWidth",Lt),null===(X=this._subTitle)||void 0===X||X.setAttribute("maxLineWidth",Lt)),e.isValid(Rt)&&(qt=Rt),e.isValid(It)&&$t<It&&($t=It),e.isValid(jt)&&(null===($=this._mainTitle)||void 0===$||$.setAttribute("maxLineWidth",jt),null===(q=this._subTitle)||void 0===q||q.setAttribute("maxLineWidth",jt),null===(K=this._mainTitle)||void 0===K||K.setAttribute("maxWidth",jt),null===(Z=this._subTitle)||void 0===Z||Z.setAttribute("maxWidth",jt),$t>jt&&($t=jt)),e.isValid(Dt)&&qt<Dt&&(qt=Dt),e.isValid(Nt)&&(null===(J=this._mainTitle)||void 0===J||J.setAttribute("maxHeight",Nt),null===(Q=this._subTitle)||void 0===Q||Q.setAttribute("maxHeight",Nt-Ft),qt>Nt&&(qt=Nt)),Wt.attribute.width=$t,Wt.attribute.height=qt,Wt.attribute.boundsPadding=Vt,e.isValid(Ut)||e.isValid(null==Mt?void 0:Mt.align)){const t=(null==Mt?void 0:Mt.align)?null==Mt?void 0:Mt.align:Ut,e=null!==(tt=null==Mt?void 0:Mt.width)&&void 0!==tt?tt:Gt;"left"===t?(null===(et=this._mainTitle)||void 0===et||et.setAttribute("x",0),null===(it=this._mainTitle)||void 0===it||it.setAttribute("textAlign","left")):"center"===t?(null===(nt=this._mainTitle)||void 0===nt||nt.setAttribute("x",e/2),null===(rt=this._mainTitle)||void 0===rt||rt.setAttribute("textAlign","center")):"right"===t&&(null===(at=this._mainTitle)||void 0===at||at.setAttribute("x",e),null===(st=this._mainTitle)||void 0===st||st.setAttribute("textAlign","right"))}if(e.isValid(zt)||e.isValid(null==Mt?void 0:Mt.verticalAlign)){const t=(null==Mt?void 0:Mt.verticalAlign)?null==Mt?void 0:Mt.verticalAlign:zt,e=(null==Mt?void 0:Mt.height)?null==Mt?void 0:Mt.height:qt;"top"===t?(null===(ot=this._mainTitle)||void 0===ot||ot.setAttribute("y",0),null===(lt=this._mainTitle)||void 0===lt||lt.setAttribute("textBaseline","top")):"middle"===t?(null===(ut=this._mainTitle)||void 0===ut||ut.setAttribute("y",e/2),null===(ht=this._mainTitle)||void 0===ht||ht.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(dt=this._mainTitle)||void 0===dt||dt.setAttribute("y",e),null===(ct=this._mainTitle)||void 0===ct||ct.setAttribute("textBaseline","bottom"))}if(e.isValid(Ut)||e.isValid(null==Ot?void 0:Ot.align)){const t=(null==Ot?void 0:Ot.align)?null==Ot?void 0:Ot.align:Ut,e=null!==(ft=null==Ot?void 0:Ot.width)&&void 0!==ft?ft:Xt;"left"===t?(null===(vt=this._subTitle)||void 0===vt||vt.setAttribute("x",0),null===(pt=this._subTitle)||void 0===pt||pt.setAttribute("textAlign","left")):"center"===t?(null===(gt=this._subTitle)||void 0===gt||gt.setAttribute("x",e/2),null===(yt=this._subTitle)||void 0===yt||yt.setAttribute("textAlign","center")):"right"===t&&(null===(bt=this._subTitle)||void 0===bt||bt.setAttribute("x",e),null===(mt=this._subTitle)||void 0===mt||mt.setAttribute("textAlign","right"))}if(e.isValid(zt)||e.isValid(null==Mt?void 0:Mt.verticalAlign)){const t=(null==Ot?void 0:Ot.verticalAlign)?null==Ot?void 0:Ot.verticalAlign:zt,e=Ft,i=null!==(xt=null==Ot?void 0:Ot.height)&&void 0!==xt?xt:0;"top"===t?(null===(_t=this._subTitle)||void 0===_t||_t.setAttribute("y",e),null===(At=this._subTitle)||void 0===At||At.setAttribute("textBaseline","top")):"middle"===t?(null===(kt=this._subTitle)||void 0===kt||kt.setAttribute("y",e+i/2),null===(Bt=this._subTitle)||void 0===Bt||Bt.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(St=this._subTitle)||void 0===St||St.setAttribute("y",e+i),null===(wt=this._subTitle)||void 0===wt||wt.setAttribute("textBaseline","bottom"))}}}Vv.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};const Wv={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};const Fv=(t,e)=>{let i=t.x0,n=t.x1;const r="number"==typeof e?t.thickness*e:t.thickness;let a=t.y0-t.thickness/2,s=t.y1-t.thickness/2;"center"===t.align?(a=t.y0-r/2,s=t.y1-r/2):"end"===t.align&&(a=t.y0+t.thickness/2-r,s=t.y1+t.thickness/2-r);let o=(i+n)/2,l=a+r,u=s+r;t.round&&(i=Math.round(i),n=Math.round(n),a=Math.round(a),s=Math.round(s),l=Math.round(l),u=Math.round(u),o=Math.round(o));const h=Math.abs(n-i)>1e-6,d=t.endArrow&&h?`L${n},${s-r/2}L${n+r},${(s+u)/2}L${n},${u+r/2}`:"",c=t.startArrow&&h?`L${i},${l+r/2}L${i-r},${(a+l)/2}L${i},${a-r/2}`:"";return!1===t.isSmooth?`M${i},${a}L${n},${s}${d}L${n},${u}L${i},${l}${c}Z`:`M${i},${a}\n C${o},${a},${o},${s},${n},${s}\n ${d}\n L${n},${u}\n C${o},${u},${o},${l},${i},${l}\n ${c}\n Z`},Gv=(t,e)=>{let i=t.y0,n=t.y1,r=t.x0-t.thickness/2,a=t.x1-t.thickness/2;const s="number"==typeof e?t.thickness*e:t.thickness;"center"===t.align?(r=t.x0-s/2,a=t.x1-s/2):"end"===t.align&&(r=t.x0+t.thickness/2-s,a=t.x1+t.thickness/2-s);let o=(i+n)/2,l=r+s,u=a+s;t.round&&(i=Math.round(i),n=Math.round(n),r=Math.round(r),a=Math.round(a),l=Math.round(l),u=Math.round(u),o=Math.round(o));const h=Math.abs(n-i)>1e-6,d=t.endArrow&&h?`L${a-s/2},${n}L${(a+u)/2},${n+s}L${u+s/2},${n}`:"",c=t.startArrow&&h?`L${l+s/2},${i}L${(l+r)/2},${i-s}L${r-s/2},${i}`:"";return!1===t.isSmooth?`M${r},${i}L${a},${n}${d}L${u},${n}L${l},${i}${c}Z`:`M${r},${i}\n C${r},${o},${a},${o},${a},${n}\n ${d}\n L${u},${n}\n C${u},${o},${l},${o},${l},${i}\n ${c}\n Z`};class Yv extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Yv.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?Gv:Fv,i="number"==typeof this.attribute.ratio&&this.attribute.ratio>=0&&this.attribute.ratio<=1,n=["direction","x0","x1","y0","y1","thickness","round","ratio","align","isSmooth","backgroudStyle"],r={};if(Object.keys(this.attribute).forEach((t=>{n.includes(t)||(r[t]=this.attribute[t])})),i){const t=this.createOrUpdateChild("sankey-link-background",Object.assign({},r,this.attribute.backgroudStyle,{path:e(this.attribute,1),visible:!0,pickable:!1,zIndex:-1}),"path");this._backPath=t}else this._backPath&&this._backPath.setAttribute("visible",!1);const a=this.createOrUpdateChild("sankey-link-front",Object.assign({},r,{path:e(this.attribute,i?this.attribute.ratio:1),pickable:!1}),"path");this._frontPath=a}}Yv.defaultAttributes={direction:"horizontal",align:"start"};class Xv extends Gs{constructor(t){super(t)}}var $v,qv;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}($v||($v={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(qv||(qv={}));class Kv extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Kv.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},Kv.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},Kv.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},Kv.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},Kv.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,n,r,a,s,o;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(e=null===(t=this._backwardAttr.style)||void 0===t?void 0:t.symbolType)&&void 0!==e?e:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(n=null===(i=this._forwardAttr.style)||void 0===i?void 0:i.symbolType)&&void 0!==n?n:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(a=null===(r=this._backwardAttr.style)||void 0===r?void 0:r.symbolType)&&void 0!==a?a:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(o=null===(s=this._forwardAttr.style)||void 0===s?void 0:s.symbolType)&&void 0!==o?o:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{e.isNil(this._playController)&&(this._playController=new Xv(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{e.isNil(this._backwardController)&&(this._backwardController=new Xv(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{e.isNil(this._forwardController)&&(this._forwardController=new Xv(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()})))},this._createCustomEvent=t=>{var e;const i=new Yi(t,{eventType:t});return i.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,i},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{const t=this._createCustomEvent($v.OnPlay);this.dispatchEvent(t)},this.pause=()=>{const t=this._createCustomEvent($v.OnPause);this.dispatchEvent(t)},this.forward=()=>{const t=this._createCustomEvent($v.OnForward);this.dispatchEvent(t)},this.backward=()=>{const t=this._createCustomEvent($v.OnBackward);this.dispatchEvent(t)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}Kv.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},Kv.defaultAttributes={[qv.Start]:{},[qv.Pause]:{},[qv.Backward]:{},[qv.Forward]:{}};const Zv={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},Jv=[200,10];var Qv,tp;t.DirectionEnum=void 0,(Qv=t.DirectionEnum||(t.DirectionEnum={})).Default="default",Qv.Reverse="reverse",t.PlayerEventEnum=void 0,(tp=t.PlayerEventEnum||(t.PlayerEventEnum={})).change="change",tp.play="play",tp.pause="pause",tp.backward="backward",tp.forward="forward",tp.end="end",tp.OnChange="change",tp.OnPlay="play",tp.OnPause="pause",tp.OnBackward="backward",tp.OnForward="forward",tp.OnEnd="end";const ep=({direction:e,maxIndex:i,minIndex:n,dataIndex:r})=>(({direction:e,maxIndex:i,dataIndex:n})=>e===t.DirectionEnum.Default&&n===i)({direction:e,maxIndex:i,dataIndex:r})||(({direction:e,minIndex:i,dataIndex:n})=>e===t.DirectionEnum.Reverse&&n===i)({direction:e,minIndex:n,dataIndex:r}),ip=({direction:e,maxIndex:i,minIndex:n,dataIndex:r})=>(({direction:e,minIndex:i,dataIndex:n})=>e===t.DirectionEnum.Default&&n===i)({direction:e,minIndex:n,dataIndex:r})||(({direction:e,maxIndex:i,dataIndex:n})=>e===t.DirectionEnum.Reverse&&n===i)({direction:e,maxIndex:i,dataIndex:r}),np=t=>"top"===t||"bottom"===t;class rp extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},rp.defaultAttributes,t)),this._data=[],this._layoutInfo={},this._updateSliderAttrs=()=>{var t,i,n;let r;e.isValidNumber(this._handlerStyle.size)?r=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(r=e.max(this._handlerStyle.size[0],this._handlerStyle.size[1]));const a={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:e.isValidNumber(r)?r:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(np(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(i=this._railStyle.height)&&void 0!==i?i:Jv[1];a.layout="horizontal",a.railHeight=e,a.railWidth=t,a.x=this._layoutInfo.slider.x,a.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(n=this._railStyle.width)&&void 0!==n?n:Jv[1];a.layout="vertical",a.railWidth=e,a.railHeight=t,a.x=this._layoutInfo.slider.x,a.y=this._layoutInfo.slider.y}return a},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new Nv(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return np(this._orient)?(t.layout="horizontal",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})):(t.layout="vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new Kv(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){var t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y;this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1,this._sliderVisible=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.slider)||void 0===e?void 0:e.visible,this._railStyle=Object.assign({},null===(n=null===(i=this.attribute)||void 0===i?void 0:i.slider)||void 0===n?void 0:n.railStyle),this._trackStyle=Object.assign({},null===(a=null===(r=this.attribute)||void 0===r?void 0:r.slider)||void 0===a?void 0:a.trackStyle),this._handlerStyle=Object.assign({},null===(o=null===(s=this.attribute)||void 0===s?void 0:s.slider)||void 0===o?void 0:o.handlerStyle),this._controllerVisible=null===(u=null===(l=this.attribute)||void 0===l?void 0:l.controller)||void 0===u?void 0:u.visible,this._start=Object.assign({},null===(d=null===(h=this.attribute)||void 0===h?void 0:h.controller)||void 0===d?void 0:d.start),this._pause=Object.assign({},null===(f=null===(c=this.attribute)||void 0===c?void 0:c.controller)||void 0===f?void 0:f.pause),this._forward=Object.assign({},null===(p=null===(v=this.attribute)||void 0===v?void 0:v.controller)||void 0===p?void 0:p.forward),this._backward=Object.assign({},null===(y=null===(g=this.attribute)||void 0===g?void 0:g.controller)||void 0===y?void 0:y.backward)}_initLayoutInfo(){var t,i,n;const r=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),a=r.filter((t=>"end"!==t.position)),s=r.filter((t=>"end"===t.position)),o=null!==(t=np(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:Jv[1],l=r.reduce(((t,i)=>{const n=i.style.size,r=e.isNumber(n)?n:e.max(n[0],n[1]);return t+i.space+r}),0),u=this._sliderVisible?(np(this._orient)?null===(i=this._size)||void 0===i?void 0:i.width:null===(n=this._size)||void 0===n?void 0:n.height)-l:0,h=u-this.attribute.slider.space,d=a.reduce(((t,i)=>{const{key:n,space:r,style:{size:a}}=i,s=e.isNumber(a)?a:e.max(a[0],a[1]);return this._layoutInfo[n]=Object.assign(Object.assign({},this._layoutInfo[n]),{size:s,x:np(this._orient)?t+r:(this._size.width-s)/2,y:np(this._orient)?(this._size.height-s)/2:t+r}),t+r+s}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:np(this._orient)?d+this.attribute.slider.space:(this._size.width-o)/2,y:np(this._orient)?(this._size.height-o)/2:d+this.attribute.slider.space}),s.reduce(((t,i)=>{const{key:n,space:r,style:{size:a}}=i,s=e.isNumber(a)?a:e.max(a[0],a[1]);return this._layoutInfo[n]=Object.assign(Object.assign({},this._layoutInfo[n]),{size:s,x:np(this._orient)?t+r:(this._size.width-s)/2,y:np(this._orient)?(this._size.height-s)/2:t+r}),t+r+s}),d+u)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){var i;const n=new Yi(t,{eventType:t,index:e,value:this._data[e]});n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}rp.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},Zv),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},Zv),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},Zv),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},Zv),{key:"backward",position:"start"})}};var ap;t.IOperateType=void 0,(ap=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",ap.drawEnd="drawEnd",ap.drawing="drawing",ap.moving="moving",ap.moveStart="moveStart",ap.moveEnd="moveEnd",ap.brushClear="brushClear";const sp={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},op=5,lp={debounce:e.debounce,throttle:e.throttle};class up extends lc{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},up.defaultAttributes,i)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e,i;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const n=null===(i=null===(e=this.attribute)||void 0===e?void 0:e.brushMoved)||void 0===i||i;this._activeMoveState=n&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||(t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushEnd=e=>{var i;e.preventDefault();const{removeOnClick:n=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&n?(this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={},this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.brushClear,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})):this._outOfInteractiveRange(e)||this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:this._activeDrawState?t.IOperateType.drawEnd:t.IOperateType.moveEnd,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict}),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,null===(i=this._operatingMask)||void 0===i||i.setAttribute("pickable",!1)}}bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0,trigger:i=sp.trigger,updateTrigger:n=sp.updateTrigger,endTrigger:r=sp.endTrigger,resetTrigger:a=sp.resetTrigger}=this.attribute;this.stage.addEventListener(i,this._onBrushStart),this.stage.addEventListener(n,lp[t](this._onBrushing,e)),this.stage.addEventListener(r,this._onBrushEnd),this.stage.addEventListener(a,this._onBrushEnd)}_isPosInBrushMask(t){const i=this.eventPosToStagePos(t),n=this._container.getChildren();for(let t=0;t<n.length;t++){const{points:r=[],dx:a=0,dy:s=0}=n[t].attribute,o=r.map((t=>({x:t.x+a,y:t.y+s})));if(e.polygonContainPoint(o,i.x,i.y))return this._operatingMask=n[t],!0}return!1}_initDraw(e){const{brushMode:i}=this.attribute,n=this.eventPosToStagePos(e);this._cacheDrawPoints=[n],this._isDrawedBeforeEnd=!1,"single"===i&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_initMove(e){var i,n;this._cacheMovePoint=this.eventPosToStagePos(e),this._operatingMaskMoveDx=null!==(i=this._operatingMask.attribute.dx)&&void 0!==i?i:0,this._operatingMaskMoveDy=null!==(n=this._operatingMask.attribute.dy)&&void 0!==n?n:0;const{interactiveRange:r}=this.attribute,{minY:a=-1/0,maxY:s=1/0,minX:o=-1/0,maxX:l=1/0}=r,{x1:u,x2:h,y1:d,y2:c}=this._operatingMask.globalAABBBounds,f=o-u,v=l-h,p=a-d,g=s-c;this._operatingMaskMoveRangeX=[f,v],this._operatingMaskMoveRangeY=[p,g],this._operatingMask.setAttribute("pickable",!0),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moveStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_drawing(e){var i;const n=this.eventPosToStagePos(e),{x1:r=0,x2:a=0,y1:s=0,y2:o=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds,{sizeThreshold:l=op,brushType:u}=this.attribute,h=this._cacheDrawPoints.length;if(this._isDrawedBeforeEnd=!!(Math.abs(a-r)>l||Math.abs(s-o)>l),h>0){const t=this._cacheDrawPoints[this._cacheDrawPoints.length-1];if(n.x===(null==t?void 0:t.x)&&n.y===(null==t?void 0:t.y))return}"polygon"===u||h<=1?this._cacheDrawPoints.push(n):this._cacheDrawPoints[h-1]=n;const d=this._computeMaskPoints();this._operatingMask.setAttribute("points",d),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawing,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_moving(e){const i=this._cacheMovePoint,n=this.eventPosToStagePos(e);if(n.x===(null==i?void 0:i.x)&&n.y===(null==i?void 0:i.y))return;const r=n.x-i.x,a=n.y-i.y,s=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],r))+this._operatingMaskMoveDx,o=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],a))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:s,dy:o}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moving,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_computeMaskPoints(){const{brushType:t,xRange:i=[0,0],yRange:n=[0,0]}=this.attribute;let r=[];const a=this._cacheDrawPoints[0],s=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return r="rect"===t?[a,{x:s.x,y:a.y},s,{x:a.x,y:s.y}]:"x"===t?[{x:a.x,y:n[0]},{x:s.x,y:n[0]},{x:s.x,y:n[1]},{x:a.x,y:n[1]}]:"y"===t?[{x:i[0],y:a.y},{x:i[0],y:s.y},{x:i[1],y:s.y},{x:i[1],y:a.y}]:e.cloneDeep(this._cacheDrawPoints),r}_addBrushMask(){var t;const{brushStyle:i,hasMask:n}=this.attribute,r=Uo(Object.assign(Object.assign({points:e.cloneDeep(this._cacheDrawPoints),cursor:"move",pickable:!1},i),{opacity:n?null!==(t=i.opacity)&&void 0!==t?t:1:0}));r.name=`brush-${Date.now()}`,this._operatingMask=r,this._container.add(r),this._brushMaskAABBBoundsDict[r.name]=r.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:n=1/0,minX:r=-1/0,maxX:a=1/0}=e,s=this.eventPosToStagePos(t);return s.x>a||s.x<r||s.y>n||s.y<i}eventPosToStagePos(t){var e,i,n;const r=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==r?void 0:r.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==r?void 0:r.top)||0)-((null===(n=this.stage)||void 0===n?void 0:n.y)||0)}}render(){this.bindBrushEvents();const t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}setUpdateDragMaskCallback(t){e.isFunction(t)&&(this._updateDragMaskCallback=t)}releaseBrushEvents(){const{delayType:t="throttle",delayTime:e=0,trigger:i=sp.trigger,updateTrigger:n=sp.updateTrigger,endTrigger:r=sp.endTrigger,resetTrigger:a=sp.resetTrigger}=this.attribute;this.stage.removeEventListener(i,this._onBrushStart),this.stage.removeEventListener(n,lp[t](this._onBrushing,e)),this.stage.removeEventListener(r,this._onBrushEnd),this.stage.removeEventListener(a,this._onBrushEnd)}}up.defaultAttributes=sp;const hp=(t,...i)=>{const n=[t.shape,...i.map((t=>null==t?void 0:t.shape))],r=[t.key,...i.map((t=>null==t?void 0:t.key))],a=[t.value,...i.map((t=>null==t?void 0:t.value))];return e.merge(t,...i,{shape:n.every(e.isNil)?void 0:e.merge({},...n),key:r.every(e.isNil)?void 0:e.merge({},...r),value:a.every(e.isNil)?void 0:e.merge({},...a)})},dp=t=>{const{width:i,height:n,wordBreak:r="break-word",textAlign:a,textBaseline:s,text:o}=t;return Array.isArray(o)?{width:i,height:n,wordBreak:r,textAlign:a,textBaseline:s,singleLine:!1,textConfig:e.array(o).map((e=>Object.assign(Object.assign({},t),{text:e})))}:{width:i,height:n,wordBreak:r,textAlign:a,textBaseline:s,singleLine:!1,textConfig:o.text}},cp={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:Mc,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Mc,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Mc,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new e.AABBBounds).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},fp=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"],vp="tooltip-title",pp="tooltip-content",gp="shape",yp="value";class bp extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},bp.defaultAttributes,t),i),this.name="tooltip"}render(){var t;const{visible:i,content:n,panel:r,keyWidth:a,valueWidth:s,hasContentShape:o,autoCalculatePosition:l,autoMeasure:u}=this.attribute;if(!i)return void this.hideAll();u&&bp.measureTooltip(this.attribute),l&&bp.calculateTooltipPosition(this.attribute);const h=e.normalizePadding(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},r),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild(vp,{visible:!0,x:h[3],y:h[0]},"group");const d=bp.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${vp}-${gp}`,e.merge({symbolType:"circle"},d.shape,{visible:bc(d)&&bc(d.shape)}),"symbol"),"object"!=typeof d.value.text||null===d.value.text||"rich"!==d.value.text.type&&"html"!==d.value.text.type?d.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${vp}-${yp}`,Object.assign({visible:bc(d)&&bc(d.value)},dp(d.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${vp}-${yp}`,Object.assign({text:null!==(t=d.value.text)&&void 0!==t?t:"",visible:bc(d)&&bc(d.value)},d.value),"text"):"rich"===d.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${vp}-${yp}`,Object.assign({visible:bc(d)&&bc(d.value)},dp(d.value)),"richtext"):"html"===d.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${vp}-${yp}`,Object.assign({html:Object.assign(Object.assign({dom:d.value.text.text},Lc),d.value),visible:bc(d)&&bc(d.value),width:d.value.width,height:d.value.height,wordBreak:d.value.wordBreak,textAlign:d.value.textAlign,textBaseline:d.value.textBaseline,singleLine:!1,textConfig:[]},d.value),"richtext"));const c=bc(d.shape)?d.shape.size+d.shape.spacing:0,{textAlign:f,textBaseline:v}=d.value,p=r.width-h[3]-h[0]-c;"center"===f?this._tooltipTitle.setAttribute("x",c+p/2):"right"===f||"end"===f?this._tooltipTitle.setAttribute("x",c+p):this._tooltipTitle.setAttribute("x",c),"bottom"===v?this._tooltipTitle.setAttribute("y",d.height):"middle"===v?this._tooltipTitle.setAttribute("y",d.height/2):this._tooltipTitle.setAttribute("y",0);const g=bc(d)?d.height+d.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(pp,{visible:!0},"group"),this._tooltipContent.removeAllChild(),null==n?void 0:n.length){this._tooltipContent.setAttribute("x",h[3]),this._tooltipContent.setAttribute("y",h[0]+g);let t=0;n.forEach(((i,n)=>{var r,l,u;const h=bp.getContentAttr(this.attribute,n);if(!bc(h))return;const d=`${pp}-${n}`,c=this._tooltipContent.createOrUpdateChild(d,{visible:!0,x:0,y:t},"group");let f=0;if(bc(h.shape)&&c.createOrUpdateChild(`${d}-${gp}`,Object.assign({visible:!0,x:h.shape.size/2,y:h.shape.size/2+((null!==(r=An(h.key.lineHeight,h.key.fontSize))&&void 0!==r?r:h.key.fontSize)-h.shape.size)/2},h.shape),"symbol"),o&&(f+=h.shape.size+h.shape.spacing),bc(h.key)){let t;t=h.key.multiLine?c.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},dp(h.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.key.text||null===h.key.text||"rich"!==h.key.text.type&&"html"!==h.key.text.type?c.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0,text:null!==(l=h.key.text)&&void 0!==l?l:""},h.key),{textBaseline:"top"}),"text"):"rich"===h.key.text.type?c.createOrUpdateChild(`${d}-${yp}`,Object.assign(Object.assign({visible:!0},dp(h.key)),{textBaseline:"top"}),"richtext"):c.createOrUpdateChild(`${d}-${yp}`,{html:Object.assign(Object.assign({dom:h.key.text.text},Lc),h.key)},"richtext");const{textAlign:e}=h.key;"center"===e?t.setAttribute("x",f+a/2):"right"===e||"end"===e?t.setAttribute("x",f+a):t.setAttribute("x",f),t.setAttribute("y",0),f+=a+h.key.spacing}if(bc(h.value)){let t;t=h.value.multiLine?c.createOrUpdateChild(`${d}-${yp}`,Object.assign(Object.assign({visible:!0},dp(h.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.value.text||null===h.value.text||"rich"!==h.value.text.type&&"html"!==h.value.text.type?c.createOrUpdateChild(`${d}-${yp}`,Object.assign(Object.assign({visible:!0,text:null!==(u=h.value.text)&&void 0!==u?u:""},h.value),{textBaseline:"top"}),"text"):"rich"===h.value.text.type?c.createOrUpdateChild(`${d}-${yp}`,Object.assign(Object.assign({visible:!0},dp(h.value)),{textBaseline:"top"}),"richtext"):c.createOrUpdateChild(`${d}-${yp}`,{html:Object.assign({dom:h.value.text.text,container:"",width:30,height:30,style:{}},h.value)},"richtext");let i="right";e.isValid(h.value.textAlign)?i=h.value.textAlign:bc(h.key)||(i="left"),t.setAttribute("textAlign",i),"center"===i?t.setAttribute("x",f+s/2):"right"===i||"end"===i?t.setAttribute("x",f+s):t.setAttribute("x",f),f+=s,t.setAttribute("y",0),c.add(t)}t+=h.height+h.spaceRow}))}}setAttributes(t,i){const n=Object.keys(t);this.attribute.autoCalculatePosition&&n.every((t=>fp.includes(t)))?(this._mergeAttributes(t,n),e.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&bp.measureTooltip(this.attribute),bp.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},i)):super.setAttributes(t,i)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:n,offsetY:r,pointerX:a,pointerY:s,positionX:o,positionY:l,parentBounds:u}=t;let h=a,d=s;return"left"===o?h-=e+n:"center"===o?h-=e/2:h+=n,"top"===l?d-=i+r:"middle"===l?d-=i/2:d+=r,h+e>u.x2&&(h-=e+n),d+i>u.y2&&(d-=i+r),h<u.x1&&(h=u.x1),d<u.y1&&(d=u.y1),t.x=h,t.y=d,t}static measureTooltip(t){const{content:i,contentStyle:n}=t,r=e.normalizePadding(t.padding),a=bp.getTitleAttr(t);let s=0,o=r[0]+r[2],l=0;const{value:u,shape:h}=a,{visible:d=!1,symbolType:c=""}=null!=h?h:{};if(e.isValid(u)&&"object"!=typeof a.value.text){const{width:t,height:e}=Rc(u).quickMeasure(u.text);s=t,l=e}if(d&&Hs[c]&&(s+=h.size+h.spacing,l=Math.max(h.size,l)),t.title&&(t.title.width=s,t.title.height=l),bc(a)&&(o+=l+a.spaceRow),null==i?void 0:i.length){const e=[];if(i.forEach(((i,n)=>{const r=bp.getContentAttr(t,n);(i.key||i.value)&&bc(r)&&e.push([i,r])})),e.length){let r=!1;const a=[],l=[],u=[];e.forEach((([t,i],s)=>{var h;const{key:d,value:c,shape:f,spaceRow:v}=i,p=bc(f),g=null!==(h=null==f?void 0:f.symbolType)&&void 0!==h?h:"",y=Rc(d),b=Rc(c);let m=0;if(bc(d)){const{width:t,height:e}=y.quickMeasure(d.text);l.push(t),m=Math.max(m,e)}if(bc(c)){const{width:t,height:e}=b.quickMeasure(c.text);u.push(t),m=Math.max(m,e)}p&&Hs[g]&&(r=!0,a.push(f.size),m=Math.max(f.size,m)),t.height=m,o+=m,s<e.length-1&&(o+=null!=v?v:n.spaceRow)}));const h=a.length?Math.max(...a):0,d=l.length?Math.max(...l):0,c=u.length?Math.max(...u):0;s=Math.max(d+c+n.key.spacing+n.value.spacing+(r?h+n.shape.spacing:0),s),i.forEach((t=>{t.width=s})),t.hasContentShape=r,t.keyWidth=d,t.valueWidth=c}}return t.panel.width=s+r[1]+r[3],t.panel.height=o,t}static getTitleAttr(t){return hp({},bp.defaultAttributes.titleStyle,bp.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return hp({},bp.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}bp.defaultAttributes=cp;class mp extends lc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},mp.defaultAttributes,t)),this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,i)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("click",this.handleClick)}render(){this.removeAllChild(),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new qs(e.merge({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t&&this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new eo(e.merge({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new eo(e.merge({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new ma(e.merge({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,i=this._text.AABBBounds.height(),n=Math.max(t,e,i),r=n/2-t/2,a=n/2-e/2,s=n/2-i/2,o=this.attribute.box.width,l=this.attribute.icon.width,u=Math.max(o,l),h=u/2-o/2,d=u/2-l/2,c=u+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:h,y:r}),this._checkIcon.setAttributes({x:d,y:a}),this._indeterminateIcon.setAttributes({x:d,y:a}),this._text.setAttributes({x:c,y:s})}handleClick(){var t;if(this.attribute.disabled)return;this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1));const e=new Yi("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked});e.manager=null===(t=this.stage)||void 0===t?void 0:t.eventSystem.manager,this.dispatchEvent(e)}}mp.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:'<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',indeterminateIconImage:'<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>',width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};t.AbstractComponent=lc,t.ArcInfo=Tf,t.ArcLabel=Cf,t.AreaLabel=Pf,t.BasePlayer=rp,t.Brush=up,t.CheckBox=mp,t.CircleAxis=tv,t.CircleAxisGrid=sv,t.CircleCrosshair=$c,t.ColorContinuousLegend=Uv,t.ContinuousPlayer=class extends rp{constructor(e){super(e),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t,e;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3,this._dataIndex=null!==(e=this.attribute.dataIndex)&&void 0!==e?e:this._minIndex;const i=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=i?i:1)):(this._totalDuration=this._interval*i,this._interval=this.attribute.interval)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener($v.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener($v.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener($v.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener($v.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,n=i/this._maxIndex;this._elapsed=n*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)})))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=e=>{const i=Math.floor(e);i!==this._activeIndex&&(this._dataIndex=i,this._activeIndex=i,i!==this._maxIndex&&this.dispatchCustomEvent(t.PlayerEventEnum.change))},this.play=()=>fc(this,void 0,void 0,(function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(t.PlayerEventEnum.play),this._rafId=xd.getRequestAnimationFrame()(this._play.bind(this)))})),this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=xd.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,xd.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,xd.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed-i;n<=0?(this._elapsed=0,this._startTime=e):(this._elapsed=n,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed+i;n>=this._totalDuration?(this._startTime=e-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-i,this._elapsed=n),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}},t.DEFAULT_ITEM_SPACE_COL=Sv,t.DEFAULT_ITEM_SPACE_ROW=wv,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=Cv,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=jf,t.DEFAULT_TITLE_SPACE=Tv,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=Of,t.DataZoom=uv,t.DiscreteLegend=Rv,t.DiscretePlayer=class extends rp{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},i)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var i,n,r,a;super._initAttributes(),this._alternate=null!==(i=this.attribute.alternate)&&void 0!==i&&i,this._interval=null!==(n=this.attribute.interval)&&void 0!==n?n:1e3,this._direction=null!==(r=this.attribute.direction)&&void 0!==r?r:t.DirectionEnum.Default,this._dataIndex=e.isNil(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(a=this.attribute.dataIndex)&&void 0!==a?a:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener($v.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener($v.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener($v.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener($v.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(e=>{const i=Math.floor(e.detail.value)+.5;this._dataIndex=e.detail.value>=i?Math.ceil(e.detail.value):Math.floor(e.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(t.PlayerEventEnum.change)})))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(ep({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||ip({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===t.DirectionEnum.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(t.PlayerEventEnum.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=xd.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=e=>{const i=Date.now();if(this._isReachEnd&&i-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();e&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(t.PlayerEventEnum.change),this._activeIndex=this._dataIndex):i-this._tickTime>=this._interval&&(this._tickTime=i,this._updateDataIndex(((t,e,i,n)=>"default"===t?Math.min(e+1,n):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(t.PlayerEventEnum.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=xd.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),xd.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,xd.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}},t.GroupFadeIn=class extends nn{constructor(t,e,i,n){super(null,null,i,n)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends nn{constructor(t,e,i,n){super(null,null,i,n)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupTransition=class extends nn{constructor(){super(...arguments),this.mode=xt.NORMAL}onBind(){const t=this.target.getInnerView(),i=this.target.getPrevInnerView();i&&(this._oldElementMap=function(t){const e={};return yc(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(i),this._newElementAttrMap={},yc(t,(t=>{var i,n,r,a,s,o;if("group"!==t.type&&t.id){const l=this._oldElementMap[t.id];if(l){if(!e.isEqual(t.attribute,l.attribute)){const a=e.cloneDeep(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:Object.assign(Object.assign({},a),{opacity:null!==(i=a.opacity)&&void 0!==i?i:1,fillOpacity:null!==(n=a.fillOpacity)&&void 0!==n?n:1,strokeOpacity:null!==(r=a.strokeOpacity)&&void 0!==r?r:1})},t.setAttributes(l.attribute)}}else{const e={opacity:null!==(a=t.attribute.opacity)&&void 0!==a?a:1,fillOpacity:null!==(s=t.attribute.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(o=t.attribute.strokeOpacity)&&void 0!==o?o:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,i=this.easing;Object.keys(this._newElementAttrMap).forEach((n=>{var r,a,s,o,l,u,h;const{node:d,attrs:c,state:f}=this._newElementAttrMap[n];"enter"===f&&(t=e.isValidNumber(null===(a=null===(r=this.params)||void 0===r?void 0:r.enter)||void 0===a?void 0:a.duration)?null===(s=this.params)||void 0===s?void 0:s.enter.duration:t,i=(null===(l=null===(o=this.params)||void 0===o?void 0:o.enter)||void 0===l?void 0:l.easing)?null===(h=null===(u=this.params)||void 0===u?void 0:u.enter)||void 0===h?void 0:h.easing:i),"path"===d.type?d.animate({interpolate:(t,i,n,r,a)=>"path"===t&&(a.path=e.interpolateString(n,r)(i),!0)}).to(c,t,i):d.animate().to(c,t,i)}))}onUpdate(t,e,i){}},t.Indicator=class extends lc{constructor(){super(...arguments),this.name="indicator"}render(){var t,i,n;const{visible:r,title:a,content:s,size:o,limitRatio:l=1/0}=this.attribute,u=Math.min(o.width,o.height)*l,h=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1},"group");if(!0!==r)return void(h&&h.hideAll());if(e.isValid(a))if(!1!==a.visible){const n=e.merge({},e.get(Wv,"title.style"),a.style);"rich"===n.type?this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:n.text},n),{visible:a.visible,x:0,y:0,width:null!==(t=n.width)&&void 0!==t?t:0,height:null!==(i=n.height)&&void 0!==i?i:0}),"richtext"):"html"===n.type?this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:n.text},Lc),n)},n),{visible:a.visible,x:0,y:0}),"richtext"):this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({},n),{lineHeight:e.isValid(n.lineHeight)?n.lineHeight:n.fontSize,visible:a.visible,x:0,y:0}),"text"),a.autoFit&&e.isValidNumber(u)&&this._setAutoFit(u,this._title,a),a.autoLimit&&e.isValidNumber(l)&&this._title.setAttribute("maxLineWidth",u)}else{const t=h.find((t=>"indicator-title"===t.name),!1);t&&h.removeChild(t),this._title=void 0}const d=this._title?this._title.AABBBounds.height():0;if(e.isValid(s)){const t=this._title&&(null==a?void 0:a.space)?a.space:0,i=e.array(s),n=[];let r=0;i.forEach(((i,s)=>{var o,c;if(!1!==i.visible){const f=e.merge({},e.get(Wv,"content.style"),i.style);let v;v="rich"===f.type?h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({textConfig:f.text},f),{visible:a.visible,x:0,y:d+t+r,width:null!==(o=f.width)&&void 0!==o?o:0,height:null!==(c=f.height)&&void 0!==c?c:0}),"richtext"):"html"===f.type?h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:f.text},Lc),f)},f),{visible:a.visible,x:0,y:d+t+r}),"richtext"):h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({},f),{lineHeight:e.isValid(f.lineHeight)?f.lineHeight:f.fontSize,visible:i.visible,x:0,y:d+t+r}),"text"),i.autoFit&&e.isValidNumber(u)&&this._setAutoFit(u,v,i),i.autoLimit&&e.isValidNumber(l)&&v.setAttribute("maxLineWidth",u),n.push(v);const p=(null==i?void 0:i.space)?i.space:0;r+=v.AABBBounds.height()+p}else{const t=h.find((t=>t.name==="indicator-content-"+s),!1);t&&h.removeChild(t)}})),this._content=n}const c=null!==(n=null==h?void 0:h.AABBBounds.height())&&void 0!==n?n:0;h.setAttribute("y",o.height/2-c/2),h.setAttribute("x",o.width/2)}_setAutoFit(t,i,n){var r,a,s,o,l,u;const h=Ic(null!==(a=null===(r=n.style)||void 0===r?void 0:r.text)&&void 0!==a?a:"",null!==(s=n.style)&&void 0!==s?s:{}).width;if(h>0){const r=t*(null!==(o=n.fitPercent)&&void 0!==o?o:.5)/h,a=Math.floor((null!==(u=null===(l=n.style)||void 0===l?void 0:l.fontSize)&&void 0!==u?u:20)*r);i.setAttribute("fontSize",a),i.setAttribute("lineHeight",e.isValid(n.style.lineHeight)?n.style.lineHeight:a)}}},t.LabelBase=kf,t.LineAxis=Kf,t.LineAxisGrid=av,t.LineCrosshair=Yc,t.LineDataLabel=Mf,t.LineLabel=wf,t.LinkPath=Yv,t.MarkArea=_v,t.MarkLine=xv,t.MarkPoint=Av,t.Pager=Bv,t.PolygonCrosshair=Kc,t.PopTip=Nc,t.RectCrosshair=Xc,t.RectLabel=Sf,t.ScrollBar=hc,t.SectorCrosshair=qc,t.Segment=Lf,t.SizeContinuousLegend=Hv,t.Slider=Nv,t.SymbolLabel=Bf,t.Tag=jc,t.Title=Vv,t.Tooltip=bp,t.VTag=function(t){return new jc(t?t.attribute:{})},t.getHorizontalPath=Fv,t.getSizeHandlerPath=zv,t.getVerticalPath=Gv,t.loadPoptip=function(){Ke.load(Fc)},t.loadScrollbar=function(){Ke.load(gc)},t.popTipModule=Fc,t.scrollbarModule=gc,t.setPoptipTheme=function(t){e.merge(zc.poptip,Uc,t)},t.version="0.17.0"}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vutils"),require("@visactor/vscale")):"function"==typeof define&&define.amd?define(["exports","@visactor/vutils","@visactor/vscale"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VRender=t.VRender||{},t.VRender.Components={}),t.VUtils,t.VScale)}(this,(function(t,e,i){"use strict";function n(){n=function(){return e};var t,e={},i=Object.prototype,r=i.hasOwnProperty,a=Object.defineProperty||function(t,e,i){t[e]=i.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function h(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var r=e&&e.prototype instanceof b?e:b,s=Object.create(r.prototype),o=new P(n||[]);return a(s,"_invoke",{value:T(t,i,o)}),s}function c(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var f="suspendedStart",v="suspendedYield",p="executing",g="completed",y={};function b(){}function m(){}function x(){}var _={};h(_,o,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(L([])));k&&k!==i&&r.call(k,o)&&(_=k);var B=x.prototype=b.prototype=Object.create(_);function w(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function i(n,a,s,o){var l=c(t[n],t,a);if("throw"!==l.type){var u=l.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,o)}),(function(t){i("throw",t,s,o)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return i("throw",t,s,o)}))}o(l.arg)}var n;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,n){i(t,r,e,n)}))}return n=n?n.then(a,a):a()}})}function T(e,i,n){var r=f;return function(a,s){if(r===p)throw new Error("Generator is already running");if(r===g){if("throw"===a)throw s;return{value:t,done:!0}}for(n.method=a,n.arg=s;;){var o=n.delegate;if(o){var l=C(o,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=c(e,i,n);if("normal"===u.type){if(r=n.done?g:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=g,n.method="throw",n.arg=u.arg)}}}function C(e,i){var n=i.method,r=e.iterator[n];if(r===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=c(r,e.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,y;var s=a.arg;return s?s.done?(i[e.resultName]=s.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function L(e){if(e||""===e){var i=e[o];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function i(){for(;++n<e.length;)if(r.call(e,n))return i.value=e[n],i.done=!1,i;return i.value=t,i.done=!0,i};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=x,a(B,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:m,configurable:!0}),m.displayName=h(x,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,h(t,u,"GeneratorFunction")),t.prototype=Object.create(B),t},e.awrap=function(t){return{__await:t}},w(S.prototype),h(S.prototype,l,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var s=new S(d(t,i,n,r),a);return e.isGeneratorFunction(i)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},w(B),h(B,u,"Generator"),h(B,o,(function(){return this})),h(B,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function n(n,r){return o.type="throw",o.arg=e,i.next=n,r&&(i.method="next",i.arg=t),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var s=this.tryEntries[a],o=s.completion;if("root"===s.tryLoc)return n("end");if(s.tryLoc<=this.prev){var l=r.call(s,"catchLoc"),u=r.call(s,"finallyLoc");if(l&&u){if(this.prev<s.catchLoc)return n(s.catchLoc,!0);if(this.prev<s.finallyLoc)return n(s.finallyLoc)}else if(l){if(this.prev<s.catchLoc)return n(s.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return n(s.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var s=a?a.completion:{};return s.type=t,s.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),M(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;M(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:L(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function o(t,e,i){return e&&s(t.prototype,e),i&&s(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,i){return(e=_(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function f(t,e,i){return f=c()?Reflect.construct.bind():function(t,e,i){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(t,n));return i&&d(r,i.prototype),r},f.apply(null,arguments)}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t){var e=c();return function(){var i,n=h(t);if(e){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}(this,i)}}function g(){return g="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},g.apply(this,arguments)}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,s,o=[],l=!0,u=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(o.push(n.value),o.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(u)throw r}}return o}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t){return function(t){if(Array.isArray(t))return x(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return x(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?x(t,e):void 0}}function x(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function _(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var A=function(){function t(){a(this,t)}return o(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}]),t}();A.auto_increment_id=0;var k=o((function t(e){a(this,t),this.id=A.GenAutoIncrementId(),this.registry=e})),B="named",w="inject",S="multi_inject",T="inversify:tagged",C="inversify:paramtypes",E=function(){function t(e,i){a(this,t),this.key=e,this.value=i}return o(t,[{key:"toString",value:function(){return this.key===B?"named: ".concat(String(this.value).toString()," "):"tagged: { key:".concat(this.key.toString(),", value: ").concat(String(this.value)," }")}}]),t}(),M=function(t){var e;return function(t){var e=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,n=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,l=!s&&!o,u={create:s?function(){return w(Object.create(null))}:o?function(){return w({__proto__:null})}:function(){return w({})},has:l?function(t,i){return e.call(t,i)}:function(t,e){return e in t},get:l?function(t,i){return e.call(t,i)?t[i]:void 0}:function(t,e){return t[e]}},h=Object.getPrototypeOf(Function),d="object"==("undefined"==typeof process?"undefined":r(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,c=d||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],i=function(){function t(t,e,i){this._index=0,this._keys=t,this._values=e,this._selector=i}return t.prototype["@@iterator"]=function(){return this},t.prototype[a]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var i=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:i,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var i=this._find(t,!0);return this._values[i]=e,this},e.prototype.delete=function(e){var i=this._find(e,!1);if(i>=0){for(var n=this._keys.length,r=i+1;r<n;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new i(this._keys,this._values,n)},e.prototype.values=function(){return new i(this._keys,this._values,r)},e.prototype.entries=function(){return new i(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[a]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function n(t,e){return t}function r(t,e){return e}function s(t,e){return[t,e]}}():Map,f=(d||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new c}Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[a]=function(){return this.keys()}}():Set,new(d||"function"!=typeof WeakMap?function(){var t=16,i=u.create(),n=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=a(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=a(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return a(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=a(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=r()},t}();function r(){var t;do{t="@@WeakMap@@"+o()}while(u.has(i,t));return i[t]=!0,t}function a(t,i){if(!e.call(t,n)){if(!i)return;Object.defineProperty(t,n,{value:u.create()})}return t[n]}function s(t,e){for(var i=0;i<e;++i)t[i]=255*Math.random()|0;return t}function o(){var e,i=(e=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):s(new Uint8Array(e),e):s(new Array(e),e));i[6]=79&i[6]|64,i[8]=191&i[8]|128;for(var n="",r=0;r<t;++r){var a=i[r];4!==r&&6!==r&&8!==r||(n+="-"),a<16&&(n+="0"),n+=a.toString(16).toLowerCase()}return n}}():WeakMap));function v(t,e,i){var n=f.get(t);if(b(n)){if(!i)return;n=new c,f.set(t,n)}var r=n.get(e);if(b(r)){if(!i)return;r=new c,n.set(e,r)}return r}function p(t,e,i){if(g(t,e,i))return!0;var n=B(e);return!m(n)&&p(t,n,i)}function g(t,e,i){var n=v(e,i,!1);return!b(n)&&!!n.has(t)}function y(t,e,i){if(g(t,e,i))return function(t,e,i){var n=v(e,i,!1);if(!b(n))return n.get(t)}(t,e,i);var n=B(e);return m(n)?void 0:y(t,n,i)}function b(t){return void 0===t}function m(t){return null===t}function x(t){return"object"==r(t)?null!==t:"function"==typeof t}function _(t,e){switch(function(t){if(null===t)return 1;switch(r(t)){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var i=3===e?"string":5===e?"number":"default",a=function(t,e){var i=t[e];if(null!=i){if(!k(i))throw new TypeError;return i}}(t,n);if(void 0!==a){var s=a.call(t,i);if(x(s))throw new TypeError;return s}return function(t,e){if("string"===e){var i=t.toString;if(k(i)){var n=i.call(t);if(!x(n))return n}var r=t.valueOf;if(k(r)){var a=r.call(t);if(!x(a))return a}}else{var s=t.valueOf;if(k(s)){var o=s.call(t);if(!x(o))return o}var l=t.toString;if(k(l)){var u=l.call(t);if(!x(u))return u}}throw new TypeError}(t,"default"===i?"number":i)}function A(t){var e=_(t,3);return"symbol"==r(e)?e:function(t){return""+t}(e)}function k(t){return"function"==typeof t}function B(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===h)return e;if(e!==h)return e;var i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;var r=n.constructor;return"function"!=typeof r||r===t?e:r}function w(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,i,n){if(!x(i))throw new TypeError;return r=t,a=e,void v(i,n,!0).set(r,a);var r,a})),t("hasMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),p(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),g(t,e,i)})),t("getMetadata",(function(t,e,i){if(!x(e))throw new TypeError;return b(i)||(i=A(i)),y(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function P(t,e,i,n){!function(t,e,i,n){var r,a=[n],s={};M.hasOwnMetadata(t,e)&&(s=M.getMetadata(t,e));var o=s[i];void 0===o&&(o=[]),(r=o).push.apply(r,a),s[i]=o,M.defineMetadata(t,s,e)}(T,t,i.toString(),n)}function L(t){return function(e,i,n){P(e,0,n,t)}}function O(t){return function(e){return function(i,n,r){return L(new E(t,e))(i,n,r)}}}var I=O(w),R=O(S);function j(){return function(t){return M.defineMetadata(C,null,t),t}}function D(t){return L(new E(B,t))}var N,U="Singleton",z="Transient",H="ConstantValue",V="DynamicValue",W="Factory",F="Function",G="Instance",$="Invalid",Y=function(){function t(e,i){a(this,t),this.id=A.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=e,this.scope=i,this.type=$,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}return o(t,[{key:"clone",value:function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===U&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.provider=this.provider,e.constraint=this.constraint,e.cache=this.cache,e}}]),t}(),X=function(){function t(){a(this,t)}return o(t,[{key:"getConstructorMetadata",value:function(t){return{compilerGeneratedMetadata:M.getMetadata(C,t),userGeneratedMetadata:M.getMetadata(T,t)||{}}}},{key:"getPropertiesMetadata",value:function(t){throw new Error("暂未实现")}}]),t}(),q=(N=B,function(t){var e=function(e){if(null==e)return!1;if(e.key===N&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;for(var i=e.constructorArgsMetadata,n=0;n<i.length;n++)if(i[n].key===N&&i[n].value===t)return!0;return!1};return e.metaData=new E(N,t),e}),Z=function(){function t(e){a(this,t),this._binding=e}return o(t,[{key:"inRequestScope",value:function(){throw new Error("暂未实现")}},{key:"inSingletonScope",value:function(){return this._binding.scope=U,this}},{key:"inTransientScope",value:function(){return this._binding.scope=z,this}},{key:"whenTargetNamed",value:function(t){return this._binding.constraint=q(t),this}}]),t}(),K=function(){function t(e){a(this,t),this._binding=e}return o(t,[{key:"to",value:function(t){return this._binding.type=G,this._binding.implementationType=t,new Z(this._binding)}},{key:"toSelf",value:function(){var t=this._binding.serviceIdentifier;return this.to(t)}},{key:"toDynamicValue",value:function(t){return this._binding.type=V,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Z(this._binding)}},{key:"toConstantValue",value:function(t){return this._binding.type=H,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=U,new Z(this._binding)}},{key:"toFactory",value:function(t){return this._binding.type=W,this._binding.factory=t,this._binding.scope=U,new Z(this._binding)}},{key:"toService",value:function(t){this.toDynamicValue((function(e){return e.container.get(t)}))}}]),t}(),J=function(){function t(e){a(this,t);var i=e||{};i.defaultScope=i.defaultScope||z,this.options=i,this.id=A.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new X}return o(t,[{key:"load",value:function(t){var e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}},{key:"get",value:function(t){var e=this._getNotAllArgs(t,!1);return this._get(e)}},{key:"getAll",value:function(t){var e=this._getAllArgs(t);return this._get(e)}},{key:"getTagged",value:function(t,e,i){var n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}},{key:"getNamed",value:function(t,e){return this.getTagged(t,B,e)}},{key:"isBound",value:function(t){return this._bindingDictionary.has(t)}},{key:"bind",value:function(t){var e=this.options.defaultScope,i=new Y(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new K(i)}},{key:"unbind",value:function(t){this._bindingDictionary.delete(t)}},{key:"rebind",value:function(t){return this.unbind(t),this.bind(t)}},{key:"_getContainerModuleHelpersFactory",value:function(){var t=this,e=function(t,e){t._binding.moduleId=e},i=function(i){return function(n){var r=t.rebind(n);return e(r,i),r}};return function(n){return{bindFunction:(r=n,function(i){var n=t.bind(i);return e(n,r),n}),isboundFunction:function(e){return t.isBound(e)},rebindFunction:i(n),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(t){return null}};var r}}},{key:"_getNotAllArgs",value:function(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}},{key:"_getAllArgs",value:function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}},{key:"_get",value:function(t){var e=this,i=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((function(e){return e.constraint(t)})).forEach((function(t){i.push(e._resolveFromBinding(t))})),t.isMultiInject||1!==i.length?i:i[0]}},{key:"_getChildRequest",value:function(t){for(var e=this,i=t.implementationType,n=this._metadataReader.getConstructorMetadata(i).userGeneratedMetadata,r=Object.keys(n),a=[],s=function(){var t=n[o],i={};t.forEach((function(t){i[t.key]=t.value}));var r={inject:i[w],multiInject:i[S]},s=r.inject||r.multiInject,l={serviceIdentifier:s,constructorArgsMetadata:t},u={injectIdentifier:s,metadata:t,bindings:e._bindingDictionary.get(s).filter((function(t){return t.constraint(l)}))};a.push(u)},o=0;o<r.length;o++)s();return a}},{key:"_resolveFromBinding",value:function(t){var e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}},{key:"_getResolvedFromBinding",value:function(t){var e;switch(t.type){case H:case F:e=t.cache;break;case G:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}},{key:"_resolveInstance",value:function(t,e){if(t.activated)return t.cache;var i=this._getChildRequest(t);return this._createInstance(e,i)}},{key:"_createInstance",value:function(t,e){return e.length?f(t,b(this._resolveRequests(e))):new t}},{key:"_resolveRequests",value:function(t){var e=this;return t.map((function(t){return t.bindings.length>1?t.bindings.map((function(t){return e._resolveFromBinding(t)})):e._resolveFromBinding(t.bindings[0])}))}},{key:"_saveToScope",value:function(t,e){t.scope===U&&(t.cache=e,t.activated=!0)}}]),t}(),Q=Symbol("ContributionProvider"),tt=function(){function t(e,i){a(this,t),this.serviceIdentifier=e,this.container=i}return o(t,[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&(t=this.caches).push.apply(t,b(this.container.getAll(this.serviceIdentifier)))),this.caches}}]),t}();function et(t,e){t(Q).toDynamicValue((function(t){var i=t.container;return new tt(e,i)})).inSingletonScope().whenTargetNamed(e)}var it=function(t){u(i,t);var e=p(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}]),i}(function(){function t(e,i){a(this,t),this._args=e,this.name=i,this.taps=[]}return o(t,[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((function(t){return t.name!==i&&(!e||t.fn===e)})))}},{key:"_parseOptions",value:function(t,e,i){var n;if("string"==typeof e)n={name:e.trim()};else if("object"!=r(e)||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n)}},{key:"_tap",value:function(t,e,i){this._insert(this._parseOptions(t,e,i))}},{key:"_insert",value:function(t){var e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var i=0;"number"==typeof t.stage&&(i=t.stage);for(var n=this.taps.length;n>0;){n--;var r=this.taps[n];this.taps[n+1]=r;var a=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(!(a>i)){n++;break}}this.taps[n]=t}}]),t}()),nt=Symbol.for("EnvContribution"),rt=Symbol.for("VGlobal"),at=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},st=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ot=function(t,e){return function(i,n){e(i,n,t)}},lt=function(){function t(e){a(this,t),this.contributions=e,this.id=A.GenAutoIncrementId(),this.hooks={onSetEnv:new it(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}return o(t,[{key:"env",get:function(){return this._env}},{key:"devicePixelRatio",get:function(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}},{key:"supportEvent",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}},{key:"supportsTouchEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}},{key:"supportsPointerEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}},{key:"supportsMouseEvents",get:function(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents},set:function(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}},{key:"applyStyles",get:function(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles},set:function(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}},{key:"bindContribution",value:function(t){var e=this,i=[];if(this.contributions.getContributions().forEach((function(n){var r=n.configure(e,t);r&&r.then&&i.push(r)})),i.length)return Promise.all(i)}},{key:"getDynamicCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}},{key:"getStaticCanvasCount",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}},{key:"setEnv",value:function(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}},{key:"deactiveCurrentEnv",value:function(){this.envContribution&&this.envContribution.release()}},{key:"activeEnv",value:function(t,e){var i=this,n=this._env;this._env=t;var r=this.bindContribution(e);if(r&&r.then)return r.then((function(){i.envParams=e,i.hooks.onSetEnv.call(n,t,i)}));this.envParams=e,this.hooks.onSetEnv.call(n,t,this)}},{key:"setActiveEnvContribution",value:function(t){this.envContribution=t}},{key:"createCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}},{key:"createOffscreenCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}},{key:"releaseCanvas",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}},{key:"addEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}},{key:"getRequestAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}},{key:"getCancelAnimationFrame",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}},{key:"getElementById",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}},{key:"getRootElement",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}},{key:"getDocument",value:function(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}},{key:"mapToCanvasPoint",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}},{key:"loadImage",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}},{key:"loadSvg",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}},{key:"loadJson",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}},{key:"loadArrayBuffer",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}},{key:"loadBlob",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}},{key:"isChrome",value:function(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}},{key:"isSafari",value:function(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}},{key:"getNativeAABBBounds",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}},{key:"removeDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}},{key:"createDom",value:function(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}},{key:"getElementTop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}},{key:"getElementLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}},{key:"getElementTopLeft",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}}]),t}();lt=at([j(),ot(0,I(Q)),ot(0,D(nt)),st("design:paramtypes",[Object])],lt);var ut,ht,dt,ct,ft,vt,pt,gt,yt,bt,mt,xt,_t,At,kt,Bt=e.tau-1e-8,wt=function(){function t(e){a(this,t),this.init(e)}return o(t,[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,i,n,r,a,s){if(Math.abs(a-r)>Bt)return this.bounds.add(t-n,i-n),void this.bounds.add(t+n,i+n);var o,l,u,h,d=1/0,c=-1/0,f=1/0,v=-1/0;function p(t){u=n*Math.cos(t),h=n*Math.sin(t),u<d&&(d=u),u>c&&(c=u),h<f&&(f=h),h>v&&(v=h)}if(p(r),p(a),a!==r)if((r%=e.tau)<0&&(r+=e.tau),(a%=e.tau)<0&&(a+=e.tau),a<r&&(s=!s,o=r,r=a,a=o),s)for(a-=e.tau,o=r-r%e.halfPi,l=0;l<4&&o>a;++l,o-=e.halfPi)p(o);else for(o=r-r%e.halfPi+e.halfPi,l=0;l<4&&o<a;++l,o+=e.halfPi)p(o);this.bounds.add(t+d,i+f),this.bounds.add(t+c,i+v)}},{key:"arcTo",value:function(t,e,i,n,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,a)}},{key:"closePath",value:function(){}},{key:"ellipse",value:function(){throw new Error("不支持ellipse")}},{key:"lineTo",value:function(t,e){this.bounds.add(t,e)}},{key:"moveTo",value:function(t,e){this.bounds.add(t,e)}},{key:"quadraticCurveTo",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}},{key:"rect",value:function(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}]),t}(),St=function(){function t(){a(this,t),this.curves=[],this.bounds=new e.AABBBounds}return o(t,[{key:"getCurveLengths",value:function(){return this.curves.map((function(t){return t.getLength()}))}},{key:"getPointAt",value:function(t){return{x:0,y:0}}},{key:"getLength",value:function(){return 0}},{key:"getBounds",value:function(){return this.bounds}}]),t}(),Tt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Ct={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Et=0,Mt=1,Pt=2,Lt=3,Ot=4,It=5,Rt=6,jt=7,Dt=8;function Nt(t,i,n,r){for(var a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_,A,k,B,w,S,T,C,E,M,P=function(t,i,n,r,a,s,o,l,u){var h=e.degreeToRadian(o),d=Math.sin(h),c=Math.cos(h),f=c*(l-t)*.5+d*(u-i)*.5,v=c*(u-i)*.5-d*(l-t)*.5,p=f*f/((n=Math.abs(n))*n)+v*v/((r=Math.abs(r))*r);p>1&&(n*=p=Math.sqrt(p),r*=p);var g=c/n,y=d/n,b=-d/r,m=c/r,x=g*l+y*u,_=b*l+m*u,A=g*t+y*i,k=b*t+m*i,B=1/((A-x)*(A-x)+(k-_)*(k-_))-.25;B<0&&(B=0);var w=Math.sqrt(B);s===a&&(w=-w);var S=.5*(x+A)-w*(k-_),T=.5*(_+k)+w*(A-x),C=Math.atan2(_-T,x-S),E=Math.atan2(k-T,A-S)-C;E<0&&1===s?E+=e.tau:E>0&&0===s&&(E-=e.tau);for(var M=Math.ceil(Math.abs(E/(e.halfPi+.001))),P=[],L=0;L<M;++L){var O=C+L*E/M,I=C+(L+1)*E/M;P[L]=[S,T,O,I,n,r,d,c]}return P}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],i,n),L=0;L<P.length;++L){var O=(a=P[L],s=void 0,o=void 0,l=void 0,u=void 0,h=void 0,d=void 0,c=void 0,f=void 0,v=void 0,p=void 0,g=void 0,y=void 0,b=void 0,m=void 0,x=void 0,_=void 0,A=void 0,k=void 0,B=void 0,w=void 0,S=void 0,T=void 0,C=void 0,E=void 0,M=void 0,s=a[0],o=a[1],l=a[2],u=a[3],h=a[4],d=a[5],c=a[6],f=a[7],v=f*h,p=-c*d,g=c*h,y=f*d,b=Math.cos(l),m=Math.sin(l),x=Math.cos(u),_=Math.sin(u),A=.5*(u-l),k=Math.sin(.5*A),B=8/3*k*k/Math.sin(A),[v*(w=s+b-B*m)+p*(S=o+m+B*b),g*w+y*S,v*(E=(T=s+x)+B*_)+p*(M=(C=o+_)-B*x),g*E+y*M,v*T+p*C,g*T+y*C]);t.bezierCurveTo(O[0],O[1],O[2],O[3],O[4],O[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"}(pt||(pt={})),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"}(gt||(gt={})),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"}(yt||(yt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(bt||(bt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(mt||(mt={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(xt||(xt={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(_t||(_t={})),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"}(At||(At={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(kt||(kt={}));var Ut=[function(t,e,i,n,r,a,s){return e.arc(t[1]*r+i,t[2]*a+n,t[3]*(r+a)/2,t[4],t[5],t[6],s)},function(t,e,i,n,r,a,s){return e.arcTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*(r+a)/2,s)},function(t,e,i,n,r,a,s){return e.bezierCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,t[5]*r+i,t[6]*a+n,s)},function(t,e,i,n){return e.closePath()},function(t,e,i,n,r,a){return e.ellipse(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8])},function(t,e,i,n,r,a,s){return e.lineTo(t[1]*r+i,t[2]*a+n,s)},function(t,e,i,n,r,a,s){return e.moveTo(t[1]*r+i,t[2]*a+n,s)},function(t,e,i,n,r,a,s){return e.quadraticCurveTo(t[1]*r+i,t[2]*a+n,t[3]*r+i,t[4]*a+n,s)},function(t,e,i,n,r,a,s){return e.rect(t[1]*r+i,t[2]*a+n,t[3]*r,t[4]*a,s)}];function zt(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0,o=0;o<t.length;o++){var l=t[o];Ut[l[0]](l,e,i,n,r,a,s)}}var Ht=function(){function t(){a(this,t)}return o(t,[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}]),t}();function Vt(t,i,n,r,a){return function(t,i){for(var n=0,r=t.length,a=0;a<r;a++){var s=t[a],o=i[a],l=t[(a+1)%r],u=i[(a+1)%r];n+=e.PointService.distanceNN(s,o,l,u)}return n/2}([t.x,i.x,n.x,r.x],[t.y,i.y,n.y,r.y])}function Wt(t,e,i,n,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*i*r*r*a+n*r*r*r}function Ft(t,i,n,r,a){var s=Wt(t.x,i.x,n.x,r.x,a),o=Wt(t.y,i.y,n.y,r.y,a);return new e.Point(s,o)}function Gt(t,i){var n=t.p0,r=t.p1,a=t.p2,s=t.p3,o=Ft(n,r,a,s,i),l=e.PointService.pointAtPP(n,r,i),u=e.PointService.pointAtPP(r,a,i),h=e.PointService.pointAtPP(a,s,i),d=e.PointService.pointAtPP(l,u,i),c=e.PointService.pointAtPP(u,h,i);return[new $t(n,l,d,o),new $t(o,c,h,s)]}var $t=function(t){u(n,t);var i=p(n);function n(t,e,r,s){var o;return a(this,n),(o=i.call(this)).type=At.CubicBezierCurve,o.p0=t,o.p1=e,o.p2=r,o.p3=s,o}return o(n,[{key:"_validPoint",value:function(){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)}},{key:"getPointAt",value:function(t){if(!1!==this.defined)return Ft(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?Vt(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(t){return t===_t.ROW?e.abs(this.p0.x-this.p3.x):t===_t.COLUMN?e.abs(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var i=e.max(t-.01,0),n=e.min(t+.01,1),r=this.getPointAt(i),a=this.getPointAt(n);return e.atan2(a.y-r.y,a.x-r.x)}}]),n}(Ht);function Yt(t,i){var n=t.p0,r=t.p1,a=e.PointService.pointAtPP(n,r,i);return[new Xt(n,a),new Xt(a,r)]}var Xt=function(t){u(n,t);var i=p(n);function n(t,e){var r;return a(this,n),(r=i.call(this)).type=At.LineCurve,r.p0=t,r.p1=e,r}return o(n,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return e.PointService.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=e.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}},{key:"_validPoint",value:function(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}},{key:"calcLength",value:function(){return this._validPoint()?e.PointService.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(t){return t===_t.ROW?e.abs(this.p0.x-this.p1.x):t===_t.COLUMN?e.abs(this.p0.y-this.p1.y):0}}]),n}(Ht),qt=function(){function t(e,i){a(this,t),this.init(e,i)}return o(t,[{key:"endX",get:function(){return this._lastX}},{key:"endY",get:function(){return this._lastY}},{key:"init",value:function(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}},{key:"bezierCurveTo",value:function(t,i,n,r,a,s,o,l){var u=new $t(new e.Point(this._lastX,this._lastY),new e.Point(t,i),new e.Point(n,r),new e.Point(a,s));u.originP1=this._lastOriginP,u.originP2=l,u.defined=o,this.curves.push(u),this._lastX=a,this._lastY=s,this._lastOriginP=l}},{key:"closePath",value:function(){if(!(this.curves.length<2)){var t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}}},{key:"ellipse",value:function(){throw new Error("SegContext不支持调用ellipse")}},{key:"lineTo",value:function(t,e,i,n){var r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}},{key:"moveTo",value:function(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}},{key:"quadraticCurveTo",value:function(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}},{key:"clear",value:function(){this.curves=[],this.length=NaN}},{key:"tryUpdateLength",value:function(t){return this.getLength(t)}},{key:"addLinearCurve",value:function(t,i,n,r,a){var s=new Xt(new e.Point(this._lastX,this._lastY),new e.Point(t,i));return s.originP1=r,s.originP2=a,s.defined=n,s}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(t){var i,n;if(t===_t.COLUMN){if(!this.curves.length)return 0;var r=this.curves[0],a=this.curves[this.curves.length-1],s=null!==(i=a.p3)&&void 0!==i?i:a.p1;return e.abs(r.p0.y-s.y)}if(t===_t.ROW){if(!this.curves.length)return 0;var o=this.curves[0],l=this.curves[this.curves.length-1],u=null!==(n=l.p3)&&void 0!==n?n:l.p1;return e.abs(o.p0.x-u.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}]),t}(),Zt=function(t){u(i,t);var e=p(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"bezierCurveTo",value:function(t,e,n,r,a,s,o,l){return g(h(i.prototype),"bezierCurveTo",this).call(this,e,t,r,n,s,a,o,l)}},{key:"lineTo",value:function(t,e,n,r){return g(h(i.prototype),"lineTo",this).call(this,e,t,n,r)}},{key:"moveTo",value:function(t,e,n){return g(h(i.prototype),"moveTo",this).call(this,e,t,n)}},{key:"clear",value:function(){return g(h(i.prototype),"clear",this).call(this)}}]),i}(qt);function Kt(t,e){for(var i=!1,n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}var Jt=function(){function t(e,i){a(this,t),this.context=e,i&&(this.startPoint=i)}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function Qt(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;var a=new qt("linear",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?_t.ROW:_t.COLUMN);return function(t,e){Kt(t,e)}(new Jt(a,r),t),a}function te(t,e,i,n,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+i)/6,n,t.lastPoint1)}var ee=function(){function t(e,i){a(this,t),this.context=e,this.startPoint=i}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){2===this._point&&te(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}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:te(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ie(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return Qt(t,i);var a=new qt("basis",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?_t.ROW:_t.COLUMN);return function(t,e){Kt(t,e)}(new ee(a,r),t),a}function ne(t){return t<0?-1:1}function re(t,e,i){var n=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(n||Number(r<0&&-0)),s=(i-t._y1)/(r||Number(n<0&&-0)),o=(a*r+s*n)/(n+r);return(ne(a)+ne(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function ae(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function se(t,e,i,n,r){var a=t._x0,s=t._y0,o=t._x1,l=t._y1,u=(o-a)/3;t.context.bezierCurveTo(a+u,s+u*e,o-u,l-u*i,o,l,n,t.lastPoint1)}var oe=function(){function t(e,i){a(this,t),this.context=e,this.startPoint=i}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:se(this,this._t0,ae(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=NaN,i=t.x,n=t.y;if(i!==this._x1||n!==this._y1){switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,se(this,ae(this,e=re(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:se(this,this._t0,e=re(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}(),le=function(t){u(i,t);var e=p(i);function i(t,n){return a(this,i),e.call(this,t,n)}return o(i,[{key:"point",value:function(t){return g(h(i.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}]),i}(oe);function ue(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return Qt(t,i);var a=new qt("monotoneX",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?_t.ROW:_t.COLUMN);return function(t,e){Kt(t,e)}(new oe(a,r),t),a}function he(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;if(t.length<3-Number(!!r))return Qt(t,i);var a=new Zt("monotoneY",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?_t.ROW:_t.COLUMN);return function(t,e){Kt(t,e)}(new le(a,r),t),a}var de=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=arguments.length>2?arguments[2]:void 0;a(this,t),this.context=e,this._t=i,this.startPoint=n}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){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)}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{var n=this._x*(1-this._t)+e*this._t;this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ce(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.direction,a=n.startPoint;if(t.length<2-Number(!!a))return null;var s=new qt("step",null!=r?r:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?_t.ROW:_t.COLUMN);return function(t,e){Kt(t,e)}(new de(s,i,a),t),s}var fe=function(){function t(e,i){a(this,t),this.context=e,i&&(this.startPoint=i)}return o(t,[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._point=0,this.startPoint&&this.point(this.startPoint)}},{key:"lineEnd",value:function(){this.context.closePath()}},{key:"point",value:function(t){var e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ve(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.direction,r=i.startPoint;if(t.length<2-Number(!!r))return null;var a=new qt("linear",null!=n?n:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?_t.ROW:_t.COLUMN);return function(t,e){Kt(t,e)}(new fe(a,r),t),a}function pe(t,e,i){switch(e){case"linear":default:return Qt(t,i);case"basis":return ie(t,i);case"monotoneX":return ue(t,i);case"monotoneY":return he(t,i);case"step":return ce(t,.5,i);case"stepBefore":return ce(t,0,i);case"stepAfter":return ce(t,1,i);case"linearClosed":return ve(t,i)}}var ge=function(t){u(n,t);var i=p(n);function n(t){var e;return a(this,n),(e=i.call(this)).commandList=[],t&&(e._ctx=t),e._boundsContext=new wt(e.bounds),e}return o(n,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([Rt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([It,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,i,n){return this.commandList.push([jt,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}},{key:"bezierCurveTo",value:function(t,e,i,n,r,a){return this.commandList.push([Pt,t,e,i,n,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,a),this}},{key:"arcTo",value:function(t,e,i,n,r){return this.commandList.push([Mt,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}},{key:"ellipse",value:function(t,e,i,n,r,a,s,o){return this.commandList.push([Ot,t,e,i,n,r,a,s,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,a,s,o),this}},{key:"rect",value:function(t,e,i,n){return this.commandList.push([Dt,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}},{key:"arc",value:function(t,e,i,n,r,a){return this.commandList.push([Et,t,e,i,n,r,a]),this._ctx&&this._ctx.arc(t,e,i,n,r,a),this}},{key:"closePath",value:function(){return this.commandList.push([Lt]),this._ctx&&this._ctx.closePath(),this}},{key:"addCurve",value:function(t){this.curves.push(t)}},{key:"clear",value:function(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[Rt]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[It]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[jt]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[Pt]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[Et]=function(t){var e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_=[];e=_,i=t[4],n=t[5],r=t[1],a=t[2],s=t[3],o=t[3],l=Math.abs(n-i),u=4*Math.tan(l/4)/3,h=n<i?-1:1,d=Math.cos(i),c=Math.sin(i),f=Math.cos(n),v=Math.sin(n),p=d*s+r,g=c*o+a,y=f*s+r,b=v*o+a,m=s*u*h,x=o*u*h,e.push(p-m*c,g+x*d,y+m*v,b-x*f,y,b);for(var A="",k=0;k<_.length;k+=6)A+="C".concat(_[k]," ").concat(_[k+1]," ").concat(_[k+2]," ").concat(_[k+3]," ").concat(_[k+4]," ").concat(_[k+5]);return A},t[Lt]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,i="";return this.commandList.forEach((function(t){i+=e[t[0]](t)})),i}},{key:"fromString",value:function(t,e,i,n,r){this.clear();var a=function(t){if(!t)return[];var e,i,n=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===n)return[];for(var r=[],a=0,s=n.length;a<s;a++)if(ut=n[a],ht=ut.slice(1),e=[dt=ut[0]],null!==(i=ht.match(Tt))){for(var o=0,l=i.length;o<l;o++)ct=i[o],ft=parseFloat(ct),Number.isNaN(ft)||e.push(ft);if(vt=Ct[dt],e.length-1>vt)for(var u=void 0,h=1,d=e.length;h<d;h+=vt){u=[dt];for(var c=h,f=h+vt;c<f;c++)u.push(e[c]);r.push(u)}else r.push(e)}else r.push(e);return r}(t);return this._runCommandStrList(a,e,i,n,r),this._updateBounds(),this}},{key:"fromLine",value:function(t){var e=t.attribute,i=e.points,n=e.curveType,r=e.clipRangeByDimension;if(i){var a=pe(i,n);"x"===r?this.direction=_t.ROW:"y"===r?this.direction=_t.COLUMN:"auto"===r&&(this.direction=a.direction),this.curves=a.curves}}},{key:"fromCustomPath2D",value:function(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,i,n){var r=this,a=this.commandList;if(!this.transformCbList){var s=[];s[Rt]=this.moveToTransform,s[It]=this.lineToTransform,s[jt]=this.quadraticCurveToTransform,s[Pt]=this.bezierCurveToTransform,s[Mt]=this.arcToTransform,s[Ot]=this.ellipseTransform,s[Dt]=this.rectTransform,s[Et]=this.arcTransform,s[Lt]=this.closePathTransform,this.transformCbList=s}a.forEach((function(a){r.transformCbList[a[0]](a,t,e,i,n)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"lineToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}},{key:"quadraticCurveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}},{key:"bezierCurveToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}},{key:"arcToTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}},{key:"ellipseTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}},{key:"rectTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}},{key:"arcTransform",value:function(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,i,n,r,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,h=null,d=0,c=0,f=0,v=0,p=0,g=t.length;p<g;++p){switch(e=t[p],1===l&&1===u||(e=be(e,l,u)),e[0]){case"l":d+=e[1],c+=e[2],this.lineTo(d+s,c+o);break;case"L":d=e[1],c=e[2],this.lineTo(d+s,c+o);break;case"h":d+=e[1],this.lineTo(d+s,c+o);break;case"H":d=e[1],this.lineTo(d+s,c+o);break;case"v":c+=e[1],this.lineTo(d+s,c+o);break;case"V":c=e[1],this.lineTo(d+s,c+o);break;case"m":d+=e[1],c+=e[2],this.moveTo(d+s,c+o);break;case"M":d=e[1],c=e[2],this.moveTo(d+s,c+o);break;case"c":i=d+e[5],n=c+e[6],f=d+e[3],v=c+e[4],this.bezierCurveTo(d+e[1]+s,c+e[2]+o,f+s,v+o,i+s,n+o),d=i,c=n;break;case"C":d=e[5],c=e[6],f=e[3],v=e[4],this.bezierCurveTo(e[1]+s,e[2]+o,f+s,v+o,d+s,c+o);break;case"s":i=d+e[3],n=c+e[4],f=2*d-f,v=2*c-v,this.bezierCurveTo(f+s,v+o,d+e[1]+s,c+e[2]+o,i+s,n+o),f=d+e[1],v=c+e[2],d=i,c=n;break;case"S":i=e[3],n=e[4],f=2*d-f,v=2*c-v,this.bezierCurveTo(f+s,v+o,e[1]+s,e[2]+o,i+s,n+o),d=i,c=n,f=e[1],v=e[2];break;case"q":i=d+e[3],n=c+e[4],f=d+e[1],v=c+e[2],this.quadraticCurveTo(f+s,v+o,i+s,n+o),d=i,c=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+s,e[2]+o,i+s,n+o),d=i,c=n,f=e[1],v=e[2];break;case"t":i=d+e[1],n=c+e[2],null===h[0].match(/[QqTt]/)?(f=d,v=c):"t"===h[0]?(f=2*d-r,v=2*c-a):"q"===h[0]&&(f=2*d-f,v=2*c-v),r=f,a=v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),c=n,f=(d=i)+e[1],v=c+e[2];break;case"T":i=e[1],n=e[2],f=2*d-f,v=2*c-v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),d=i,c=n;break;case"a":Nt(this,d+s,c+o,[e[1],e[2],e[3],e[4],e[5],e[6]+d+s,e[7]+c+o]),d+=e[6],c+=e[7];break;case"A":Nt(this,d+s,c+o,[e[1],e[2],e[3],e[4],e[5],e[6]+s,e[7]+o]),d=e[6],c=e[7];break;case"z":case"Z":this.closePath()}h=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(var a=0,s=t.length;a<s;++a){var o=t[a].slice();switch(o[0]){case It:this.lineToTransform(o,e,i,n,r);break;case Rt:this.moveToTransform(o,e,i,n,r);break;case Pt:this.bezierCurveToTransform(o,e,i,n,r);break;case jt:this.quadraticCurveToTransform(o,e,i,n,r);break;case Et:this.arcToTransform(o,e,i,n,r);break;case Ot:this.ellipseTransform(o,e,i,n,r);break;case Dt:this.rectTransform(o,e,i,n,r);break;case Mt:this.arcToTransform(o,e,i,n,r);break;case Lt:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),zt(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===_t.COLUMN){if(!this.curves.length)return 0;var t=this.curves[0],i=this.curves[this.curves.length-1];return e.abs(t.p0.y-i.p1.y)}if(this.direction===_t.ROW){if(!this.curves.length)return 0;var n=this.curves[0],r=this.curves[this.curves.length-1];return e.abs(n.p0.x-r.p1.x)}return this.curves.reduce((function(t,e){return t+e.getLength()}),0)}},{key:"getAttrAt",value:function(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};for(var e,i=0,n=0;n<this.curves.length;n++){var r=(e=this.curves[n]).getLength(this.direction);if(i+r>=t)break;i+=r}var a=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(a),angle:e.getAngleAt(a)}}}]),n}(St),ye=["l",0,0,0,0,0,0,0];function be(t,e,i){var n=ye[0]=t[0];if("a"===n||"A"===n)ye[1]=e*t[1],ye[2]=i*t[2],ye[3]=t[3],ye[4]=t[4],ye[5]=t[5],ye[6]=e*t[6],ye[7]=i*t[7];else if("h"===n||"H"===n)ye[1]=e*t[1];else if("v"===n||"V"===n)ye[1]=i*t[1];else for(var r=1,a=t.length;r<a;++r)ye[r]=(r%2==1?e:i)*t[r];return ye}var me={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new e.Matrix},xe={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},_e=Object.assign({outerBorder:Object.assign(Object.assign({},xe),{distance:0}),innerBorder:Object.assign(Object.assign({},xe),{distance:0})},xe),Ae={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end"},ke=Object.assign(Object.assign(Object.assign({opacity:1,background:null,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",blur:0,cursor:null,html:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),_e),{alignSelf:"auto"}),Be={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},we=Object.assign(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,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden"},{_debug_bounds:!1}),ke),me),Se=Object.assign(Object.assign({},we),{startAngle:0,endAngle:e.pi2,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Te=Object.assign(Object.assign(Object.assign({},we),Be),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),Ce=Object.assign(Object.assign({},we),{radius:1,startAngle:0,endAngle:e.pi2}),Ee=Object.assign(Object.assign({},we),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start"}),Me=Object.assign(Object.assign({},we),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Pe=Object.assign(Object.assign(Object.assign({},we),Be),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),Le=Object.assign(Object.assign({},we),{path:new ge,customPath:function(){e.Logger.getInstance().warn("空函数")}}),Oe=Object.assign(Object.assign({},we),{points:[],cornerRadius:0,closePath:!0}),Ie=Object.assign(Object.assign({},we),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),Re=Object.assign(Object.assign({},we),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),je=Object.assign(Object.assign({},we),{symbolType:"circle",size:10,keepDirIn3d:!0}),De=Object.assign(Object.assign(Object.assign({},we),Ae),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Ne=Object.assign(Object.assign({},we),{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}),Ue=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},we),{fill:!0,cornerRadius:0}),ze=Object.assign(Object.assign({},Ue),{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}),He=new(o((function t(){a(this,t)}))),Ve=/\w|\(|\)|-/,We=/[.?!,;:/,。?!、;:]/;function Fe(t,e){for(var i=e;Ve.test(t[i-1])&&Ve.test(t[i])||We.test(t[i]);)if(--i<=0)return e;return i}var Ge=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},$e=function(){function t(){a(this,t)}return o(t,[{key:"configure",value:function(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}},{key:"measureTextWidth",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}},{key:"estimate",value:function(t,e){for(var i=e.fontSize,n=void 0===i?De.fontSize:i,r=0,a=0,s=0;s<t.length;s++)t.charCodeAt(s)<128?r++:a++;return{width:~~(.8*r*n+a*n),height:n}}},{key:"measureTextPixelHeight",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Ae.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.actualBoundingBoxAscent-n.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:Ae.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var n=this.context.measureText(t);return Math.abs(n.fontBoundingBoxAscent-n.fontBoundingBoxDescent)}},{key:"measureText",value:function(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}},{key:"clipTextVertical",value:function(t,e,i,n){var r=this;if(0===t.length)return{verticalList:t,width:0};var a=e.fontSize,s=void 0===a?12:a;t.forEach((function(t){t.width=0===t.direction?s:r.measureTextWidth(t.text,e)}));for(var o=[],l=0,u=0;u<t.length&&l+t[u].width<i;u++)l+=t[u].width,o.push(t[u]);if(t[u]&&t[u].text.length>1){var h=this._clipText(t[u].text,e,i-l,0,t[u].text.length-1,"end",!1);if(n&&h.str!==t[u].text){for(var d="",c=0,f=0;f<u;f++){var v=t[f];d+=v.text,c+=v.text.length}var p=Fe(d+=t[u].text,c+h.str.length);(p-=c)!==h.str.length-1&&(h.str=h.str.substring(0,p),h.width=this.measureTextWidth(h.str,e))}o.push(Object.assign(Object.assign({},t[u]),{text:h.str,width:h.width})),l+=h.width}return{verticalList:o,width:l}}},{key:"clipText",value:function(t,e,i,n){if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if((r=this.measureTextWidth(t[0],e))>i)return{str:"",width:0};var a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&a.str!==t){var s=Fe(t,a.str.length);s!==a.str.length&&(a.str=t.substring(0,s),a.width=this.measureTextWidth(a.str,e))}return a}},{key:"_clipText",value:function(t,e,i,n,r,a,s){var o;if("end"===a)o=this._clipTextEnd(t,e,i,n,r),s&&(o.result=o.str+s);else if("start"===a)o=this._clipTextStart(t,e,i,n,r),s&&(o.result=s+o.str);else if("middle"===a){var l=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:l.width,result:l.left+s+l.right}}return o}},{key:"_clipTextEnd",value:function(t,e,i,n,r){var a,s=Math.floor((n+r)/2),o=t.substring(0,s+1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};var u=t.substring(0,s);return(a=this.measureTextWidth(u,e))<=i?{str:u,width:a}:this._clipTextEnd(t,e,i,n,s)}if(l<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(0,s+2);return(a=this.measureTextWidth(h,e))>=i?{str:o,width:l}:this._clipTextEnd(t,e,i,s,r)}return{str:o,width:l}}},{key:"_clipTextStart",value:function(t,e,i,n,r){var a,s=Math.ceil((n+r)/2),o=t.substring(s-1,t.length-1),l=this.measureTextWidth(o,e);if(l>i){if(o.length<=1)return{str:"",width:0};var u=t.substring(s,t.length-1);return(a=this.measureTextWidth(u,e))<=i?{str:u,width:a}:this._clipTextStart(t,e,i,s,t.length-1)}if(l<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};var h=t.substring(s-2,t.length-1);return(a=this.measureTextWidth(h,e))>=i?{str:o,width:l}:this._clipTextStart(t,e,i,n,s)}return{str:o,width:l}}},{key:"_clipTextMiddle",value:function(t,e,i,n,r,a,s,o){var l=t.substring(0,o),u=this.measureTextWidth(l,e);if(u+s>i)return{left:n,right:r,width:a+s};var h=t.substring(t.length-o,t.length),d=this.measureTextWidth(h,e);return u+d>i?{left:l,right:r,width:u+s}:this._clipTextMiddle(t,e,i,l,h,u,d,o+1)}},{key:"clipTextWithSuffixVertical",value:function(t,e,i,n,r,a){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};var s=this.clipTextVertical(t,e,i,r);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;var o,l=this.measureTextWidth(n,e);if(l>i)return s;if(i-=l,"start"===a){var u=this.revertVerticalList(t);o=this.clipTextVertical(u,e,i,r);var h=this.revertVerticalList(o.verticalList);h.unshift({text:n,direction:1,width:l}),o.verticalList=h}else if("middle"===a){var d=this.clipTextVertical(t,e,i/2,r),c=this.revertVerticalList(t),f=this.clipTextVertical(c,e,i/2,r);d.verticalList.push({text:n,direction:1,width:l}),this.revertVerticalList(f.verticalList).forEach((function(t){return d.verticalList.push(t)})),o={verticalList:d.verticalList,width:d.width+f.width}}else(o=this.clipTextVertical(t,e,i,r)).verticalList.push({text:n,direction:1,width:l});return o.width+=l,o}},{key:"revertVerticalList",value:function(t){return t.reverse().map((function(t){var e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}},{key:"clipTextWithSuffix",value:function(t,e,i,n,r,a){if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};var s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};var o=this.measureTextWidth(n,e);if(o>i)return{str:"",width:0};i-=o;var l=this._clipText(t,e,i,0,t.length-1,a,n);if(r&&l.str!==t){var u=Fe(t,l.str.length);u!==l.str.length&&(l.str=t.substring(0,u),l.width=this.measureTextWidth(l.str,e))}return l.str=l.result,l.width+=o,l}}]),t}();$e=Ge([j()],$e);var Ye=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Xe=Symbol.for("TextMeasureContribution"),qe=function(t){u(i,t);var e=p(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i)}($e);qe=Ye([j()],qe);var Ze=new J,Ke=Symbol.for("CanvasFactory");function Je(t){return Ze.getNamed(Ke,He.global.env)(t)}var Qe,ti=function(){function t(){a(this,t),this.pools=[],this.allocatedCanvas=[]}return o(t,[{key:"shareCanvas",value:function(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}},{key:"getCommonCanvas",value:function(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}},{key:"allocate",value:function(t){if(!this.pools.length){var e=Je(Object.assign({nativeCanvas:He.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}var i=this.pools.pop();return i.resize(t.width,t.height),i.dpr=t.dpr,i}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Je(Object.assign({nativeCanvas:He.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}var n=this.pools.pop();return n.width=t.width,n.height=t.height,n}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),ei=new ti,ii=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ni=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ri=function(t,e){return function(i,n){e(i,n,t)}},ai=function(){function t(e){var i=this;a(this,t),this.contributions=e,this.configured=!1,this.global=He.global,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,n){i.configured=!1,i.configure(n,e)}))}return o(t,[{key:"canvas",get:function(){return this.tryInitCanvas(),this._canvas}},{key:"context",get:function(){return this.tryInitCanvas(),this._context}},{key:"textMeasure",get:function(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}},{key:"configure",value:function(t,e){var i=this;this.configured||(this.contributions.getContributions().forEach((function(t){t.configure(i,e)})),this.configured=!0)}},{key:"tryInitCanvas",value:function(){if(!this._canvas){var t=ei.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";this.configure(this.global,this.global.env);var r=this.global.measureTextMethod;this.global.measureTextMethod=n;var a={width:this._textMeasure.measureTextWidth(t,e),height:null!==(i=e.fontSize)&&void 0!==i?i:Ae.fontSize};return this.global.measureTextMethod=r,a}},{key:"createTextMeasureInstance",value:function(t,i,n){var r=this;return this.configure(this.global,this.global.env),new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:Ae.fontFamily,fontSize:Ae.fontSize},getCanvasForMeasure:n||function(){return r.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t)}}]),t}();ai=ii([j(),ri(0,I(Q)),ri(0,D(Xe)),ni("design:paramtypes",[Object])],ai),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Qe||(Qe={}));var si=new e.Matrix,oi=function(){function t(){a(this,t),this.matrix=new e.Matrix}return o(t,[{key:"init",value:function(t){return this.mode=Qe.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=Qe.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,i){var n=this.outSourceMatrix;if(si.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){var r=i.x,a=i.y;this.outTargetMatrix.translate(r,a),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-r,-a)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(si.a,si.b,si.c,si.d,si.e,si.f),this}},{key:"rotateMatrix",value:function(t,e){var i=this.outSourceMatrix;if(si.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){var n=e.x,r=e.y;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(si.a,si.b,si.c,si.d,si.e,si.f),this}},{key:"scale",value:function(t,e,i){return this.mode===Qe.matrix?this.scaleMatrix(t,e,i):this}},{key:"rotate",value:function(t,e){return this.mode===Qe.matrix?this.rotateMatrix(t,e):this}},{key:"translateMatrix",value:function(t,e){var i=this.outSourceMatrix;return si.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(si.a,si.b,si.c,si.d,si.e,si.f),this}},{key:"translate",value:function(t,e){return this.mode===Qe.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===Qe.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}]),t}();oi=ii([j(),ni("design:paramtypes",[])],oi);var li={arc:Se,area:Te,circle:Ce,line:Pe,path:Le,symbol:je,text:De,rect:Ie,rect3d:Re,polygon:Oe,richtext:Ne,richtextIcon:ze,image:Ue,group:Ee,glyph:Me},ui=Object.keys(li);function hi(t,e){Object.keys(e).forEach((function(i){t[i]=e[i]}))}var di={arc:Object.assign({},li.arc),area:Object.assign({},li.area),circle:Object.assign({},li.circle),line:Object.assign({},li.line),path:Object.assign({},li.path),symbol:Object.assign({},li.symbol),text:Object.assign({},li.text),rect:Object.assign({},li.rect),rect3d:Object.assign({},li.rect3d),polygon:Object.assign({},li.polygon),richtext:Object.assign({},li.richtext),richtextIcon:Object.assign({},li.richtextIcon),image:Object.assign({},li.image),group:Object.assign({},li.group),glyph:Object.assign({},li.glyph)},ci=function(){function t(){a(this,t),this.initTheme(),this.dirty=!1}return o(t,[{key:"initTheme",value:function(){var t=this;this._defaultTheme={},ui.forEach((function(e){t._defaultTheme[e]=Object.create(di[e])})),this.combinedTheme=this._defaultTheme}},{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}},{key:"getParentWithTheme",value:function(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}},{key:"applyTheme",value:function(t,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){var r=this.getParentWithTheme(t);if(r){var a=r.theme;(a.dirty||n)&&a.applyTheme(r,i,!0)}this.userTheme?this.doCombine(r&&r.theme.combinedTheme):(r?this.combinedTheme=r.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,e.Logger.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this,i=this.userTheme,n=this.combinedTheme;ui.forEach((function(r){var a=Object.create(di[r]);t&&t[r]&&hi(a,t[r]),n[r]&&hi(a,n[r]),i[r]&&hi(a,i[r]),e.combinedTheme[r]=a})),i.common&&ui.forEach((function(t){hi(e.combinedTheme[t],i.common)})),this.dirty=!1}},{key:"setTheme",value:function(t,e){var i=this.userTheme;i?Object.keys(t).forEach((function(e){i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}},{key:"resetTheme",value:function(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}},{key:"dirtyChildren",value:function(t){var e=this;t.forEachChildren((function(t){t.isContainer&&(t.theme&&(t.theme.dirty=!0),e.dirtyChildren(t))}))}}]),t}(),fi=new ci;function vi(t,e){return t.glyphHost?vi(t.glyphHost):e?(t.isContainer,e):function(t){var 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)):fi.getTheme()}return null}(t)||fi.getTheme()}var pi=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))},gi=function(t){u(r,t);var i=p(r);function r(){var t;return a(this,r),(t=i.call(this))._uid=A.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return o(r,[{key:"previousSibling",get:function(){return this._prev}},{key:"nextSibling",get:function(){return this._next}},{key:"children",get:function(){return this.getChildren()}},{key:"firstChild",get:function(){return this._firstChild}},{key:"lastChild",get:function(){return this._lastChild}},{key:"count",get:function(){return this._count}},{key:"childrenCount",get:function(){return this._idMap?this._idMap.size:0}},{key:"forEachChildren",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])for(var e=this._lastChild,i=0;e;){if(t(e,i++))return;e=e._prev}else for(var n=this._firstChild,r=0;n;){if(t(n,r++))return;n=n._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return pi(this,void 0,void 0,n().mark((function i(){var r,a,s,o,l,u;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!e){i.next=16;break}r=this._lastChild,a=0;case 2:if(!r){i.next=14;break}if(s=t(r,a++),i.t0=s.then,!i.t0){i.next=9;break}return i.next=8,s;case 8:s=i.sent;case 9:if(!s){i.next=11;break}return i.abrupt("return");case 11:r=r._prev;case 12:i.next=2;break;case 14:i.next=29;break;case 16:o=this._firstChild,l=0;case 17:if(!o){i.next=29;break}if(u=t(o,l++),i.t1=u.then,!i.t1){i.next=24;break}return i.next=23,u;case 23:u=i.sent;case 24:if(!u){i.next=26;break}return i.abrupt("return");case 26:o=o._next;case 27:i.next=17;break;case 29:case"end":return i.stop()}}),i,this)})))}},{key:"forEach",value:function(t){return this.forEachChildren(t)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}},{key:"appendChildArrHighPerformance",value:function(t){return console.error("暂不支持该函数"),t}},{key:"insertBefore",value:function(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)}},{key:"insertAfter",value:function(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)}},{key:"insertInto",value:function(t,i){if(!this._ignoreWarn&&this._nodeList&&e.Logger.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),i>=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===i)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var n=this._firstChild,r=0;r<i;r++){if(!n)return null;r>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}},{key:"insertIntoKeepIdx",value:function(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){var i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}var n;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(n=this._nodeList[r]);r--);if(n)return n._next?this.insertBefore(t,n._next):this.appendChild(t);this._ignoreWarn=!0;var a=this.insertInto(t,0);return this._ignoreWarn=!1,a}},{key:"removeChild",value:function(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){var e=this._nodeList.findIndex((function(e){return 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}},{key:"delete",value:function(){this.parent&&this.parent.removeChild(this)}},{key:"removeAllChild",value:function(){if(this._idMap){for(var t=this._firstChild;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)}}},{key:"replaceChild",value:function(t,e){throw new Error("暂不支持")}},{key:"find",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null;return this.forEachChildren((function(i,r){return!(i===e||!t(i,r)||(n=i,0))})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.find(t,!0);if(i)return n=i,!0}return!1})),n}},{key:"findAll",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];return this.forEachChildren((function(i,r){i!==e&&t(i,r)&&n.push(i)})),i&&this.forEachChildren((function(e){if(e.isContainer){var i=e.findAll(t,!0);i.length&&(n=n.concat(i))}})),n}},{key:"getElementById",value:function(t){return this.find((function(e){return e.id===t}),!0)}},{key:"findChildById",value:function(t){return this.getElementById(t)}},{key:"findChildByUid",value:function(t){return this._idMap&&this._idMap.get(t)||null}},{key:"getElementsByName",value:function(t){return this.findAll((function(e){return e.name===t}),!0)}},{key:"findChildrenByName",value:function(t){return this.getElementsByName(t)}},{key:"getElementsByType",value:function(t){return this.findAll((function(e){return e.type===t}),!0)}},{key:"getChildByName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((function(e){return e.name===t}),e)}},{key:"getChildAt",value:function(t){var e=this._firstChild;if(!e)return null;for(var i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}},{key:"at",value:function(t){return this.getChildAt(t)}},{key:"containNode",value:function(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;for(var e=this._firstChild;e;){if(e.containNode(t))return!0;e=e._next}return!1}},{key:"getRootNode",value:function(){for(var t=this.parent;null==t?void 0:t.parent;)t=t.parent;return t||this}},{key:"hasChildNodes",value:function(){return null!==this._firstChild}},{key:"addChild",value:function(t){return this.appendChild(t)}},{key:"add",value:function(t){return this.appendChild(t)}},{key:"getChildren",value:function(){for(var t=[],e=this._firstChild;e;)t.push(e),e=e._next;return t}},{key:"isChildOf",value:function(t){return!!this.parent&&this.parent._uid===t._uid}},{key:"isParentOf",value:function(t){return t.isChildOf(this)}},{key:"isDescendantsOf",value:function(t){var e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}},{key:"isAncestorsOf",value:function(t){return t.isDescendantsOf(this)}},{key:"getAncestor",value:function(t){throw new Error("暂不支持")}},{key:"setAllDescendantsProps",value:function(t,e){for(var i=this._firstChild;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}},{key:"setCount",value:function(t){this._count+=t;var e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}},{key:"clone",value:function(){throw new Error("暂不支持")}},{key:"cloneTo",value:function(t){throw new Error("暂不支持")}},{key:"getParent",value:function(){return this.parent}},{key:"del",value:function(t){return this.removeChild(t)}},{key:"addEventListener",value:function(t,i,n){var a=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isObject(n)&&n.once,o=e.isFunction(i)?void 0:i;return t=a?"".concat(t,"capture"):t,i=e.isFunction(i)?i:i.handleEvent,s?g(h(r.prototype),"once",this).call(this,t,i,o):g(h(r.prototype),"on",this).call(this,t,i,o),this}},{key:"on",value:function(t,e,i){return this.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,i,n){var a=e.isBoolean(n,!0)&&n||e.isObject(n)&&n.capture,s=e.isFunction(i)?void 0:i;t=a?"".concat(t,"capture"):t,i=e.isFunction(i)?i:i.handleEvent;var o=e.isObject(n)&&n.once;return g(h(r.prototype),"off",this).call(this,t,i,s,o),this}},{key:"off",value:function(t,e,i){return this.removeEventListener(t,e,i)}},{key:"once",value:function(t,i,n){return e.isObject(n)?(n.once=!0,this.addEventListener(t,i,n)):this.addEventListener(t,i,{once:!0})}},{key:"removeAllEventListeners",value:function(){return g(h(r.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,i=arguments.length,n=new Array(i>1?i-1:0),a=1;a<i;a++)n[a-1]=arguments[a];return(e=g(h(r.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(n)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}]),r}(e.EventEmitter),yi=function(){function t(e){a(this,t),this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=t.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return o(t,[{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewX",get:function(){return this.viewport.x}},{key:"viewY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation(),this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error("Method not implemented.")}}]),t}(),bi=function(t){u(i,t);var e=p(i);function i(t,n){var r;return a(this,i),(r=e.call(this)).type=t,r.detail=n,r}return o(i)}(yi),mi={pickable:!0,visible:!0,dispatchEvent:function(t){var e;if(!(t instanceof yi))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:function(t,e){return this.dispatchEvent(new bi(t,e))}},xi=function(){function t(){a(this,t)}return o(t,null,[{key:"linear",value:function(t){return t}},{key:"none",value:function(){return this.linear}},{key:"get",value:function(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))}}},{key:"getPowIn",value:function(t){return function(e){return Math.pow(e,t)}}},{key:"getPowOut",value:function(t){return function(e){return 1-Math.pow(1-e,t)}}},{key:"getPowInOut",value:function(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}},{key:"getBackIn",value:function(t){return function(e){return e*e*((t+1)*e-t)}}},{key:"getBackOut",value:function(t){return function(e){return--e*e*((t+1)*e+t)+1}}},{key:"getBackInOut",value:function(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)}}},{key:"sineIn",value:function(t){return 1-Math.cos(t*Math.PI/2)}},{key:"sineOut",value:function(t){return Math.sin(t*Math.PI/2)}},{key:"sineInOut",value:function(t){return-(Math.cos(Math.PI*t)-1)/2}},{key:"expoIn",value:function(t){return 0===t?0:Math.pow(2,10*t-10)}},{key:"expoOut",value:function(t){return 1===t?1:1-Math.pow(2,-10*t)}},{key:"expoInOut",value:function(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}},{key:"circIn",value:function(t){return-(Math.sqrt(1-t*t)-1)}},{key:"circOut",value:function(t){return Math.sqrt(1- --t*t)}},{key:"circInOut",value:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{key:"bounceOut",value:function(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}},{key:"bounceIn",value:function(e){return 1-t.bounceOut(1-e)}},{key:"bounceInOut",value:function(e){return e<.5?.5*t.bounceIn(2*e):.5*t.bounceOut(2*e-1)+.5}},{key:"getElasticIn",value:function(t,i){return function(n){if(0===n||1===n)return n;var r=i/e.pi2*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)}}},{key:"getElasticOut",value:function(t,i){return function(n){if(0===n||1===n)return n;var r=i/e.pi2*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-r)*e.pi2/i)+1}}},{key:"getElasticInOut",value:function(t,i){return function(n){var r=i/e.pi2*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-r)*e.pi2/i)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-r)*e.pi2/i)*.5+1}}}]),t}();xi.quadIn=xi.getPowIn(2),xi.quadOut=xi.getPowOut(2),xi.quadInOut=xi.getPowInOut(2),xi.cubicIn=xi.getPowIn(3),xi.cubicOut=xi.getPowOut(3),xi.cubicInOut=xi.getPowInOut(3),xi.quartIn=xi.getPowIn(4),xi.quartOut=xi.getPowOut(4),xi.quartInOut=xi.getPowInOut(4),xi.quintIn=xi.getPowIn(5),xi.quintOut=xi.getPowOut(5),xi.quintInOut=xi.getPowInOut(5),xi.backIn=xi.getBackIn(1.7),xi.backOut=xi.getBackOut(1.7),xi.backInOut=xi.getBackInOut(1.7),xi.elasticIn=xi.getElasticIn(1,.3),xi.elasticOut=xi.getElasticOut(1,.3),xi.elasticInOut=xi.getElasticInOut(1,.3*1.5);var _i=function(){function t(){a(this,t),this.id=A.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}return o(t,[{key:"addAnimate",value:function(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++}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}},{key:"tick",value:function(t){if(!this.paused){var e=this.animateHead;for(this.animateCount=0;e;)e.status===bt.END?this.removeAnimate(e):e.status===bt.RUNNING||e.status===bt.INITIAL?(this.animateCount++,e.advance(t)):e.status===bt.PAUSED&&this.animateCount++,e=e.nextAnimate}}},{key:"clear",value:function(){for(var t=this.animateHead;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}},{key:"removeAnimate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((function(t){return 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()}}]),t}(),Ai=new _i,ki=function(){function t(e,i,n,r,s){a(this,t),this.from=e,this.to=i,this.duration=n,this.easing=r,this.params=s,this.updateCount=0}return o(t,[{key:"bind",value:function(t,e){this.target=t,this.subAnimate=e,this.onBind()}},{key:"onBind",value:function(){}},{key:"onFirstRun",value:function(){}},{key:"onStart",value:function(){}},{key:"onEnd",value:function(){}},{key:"getEndProps",value:function(){}},{key:"getFromProps",value:function(){return this.from}},{key:"getMergedEndProps",value:function(){var t,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}},{key:"update",value:function(t,e,i){var n=this;if(0===this.updateCount){this.onFirstRun();var r=this.step.getLastProps();Object.keys(r).forEach((function(t){n.subAnimate.animate.validAttr(t)&&(i[t]=r[t])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}]),t}(),Bi=function(t){u(i,t);var e=p(i);function i(t){var n;return a(this,i),(n=e.call(this,null,null,0,"linear")).cb=t,n}return o(i,[{key:"onUpdate",value:function(t,e,i){}},{key:"onStart",value:function(){this.cb()}}]),i}(ki),wi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ai;a(this,t),this.id=e,this.timeline=i,this.status=bt.INITIAL,this.tailAnimate=new Ti(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return o(t,[{key:"setTimeline",value:function(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}},{key:"getStartTime",value:function(){return this._startTime}},{key:"getDuration",value:function(){return this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0)}},{key:"after",value:function(t){var e=t.getDuration();return this._startTime=e,this}},{key:"afterAll",value:function(t){var i=-1/0;return t.forEach((function(t){i=e.max(t.getDuration(),i)})),this._startTime=i,this}},{key:"parallel",value:function(t){return this._startTime=t.getStartTime(),this}},{key:"play",value:function(t){if(this.tailAnimate.play(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.duration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}},{key:"trySetAttribute",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.mode;e&&i&mt.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:yt.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,i=new Bi((function(){t(e,i.step.prev)}));return this.tailAnimate.play(i),this}},{key:"customInterpolate",value:function(e,i,n,r,a,s){var o=t.interpolateMap.get(e)||t.interpolateMap.get("");return!!o&&o(e,i,n,r,a,s)}},{key:"pause",value:function(){this.status===bt.RUNNING&&(this.status=bt.PAUSED)}},{key:"resume",value:function(){this.status===bt.PAUSED&&(this.status=bt.RUNNING)}},{key:"to",value:function(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"wait",value:function(t){if(this.tailAnimate.wait(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"startAt",value:function(t){if(this.tailAnimate.startAt(t),this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"loop",value:function(t){if(this.tailAnimate.loop=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"reversed",value:function(t){if(this.tailAnimate.reversed=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"bounce",value:function(t){if(this.tailAnimate.bounce=t,this.target){var e=this.target.stage;e&&e.renderNextFrame()}return this}},{key:"subAnimate",value:function(){var t=new Ti(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}},{key:"getStartProps",value:function(){return this.subAnimates[0].getStartProps()}},{key:"getEndProps",value:function(){return this.tailAnimate.getEndProps()}},{key:"depreventAttr",value:function(t){this._preventAttrs&&this._preventAttrs.delete(t)}},{key:"preventAttr",value:function(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}},{key:"preventAttrs",value:function(t){var e=this;t.forEach((function(t){return e.preventAttr(t)}))}},{key:"validAttr",value:function(t){return!this._preventAttrs||!this._preventAttrs.has(t)}},{key:"bind",value:function(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((function(e){e.bind(t)})),this}},{key:"advance",value:function(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===bt.INITIAL&&(this.status=bt.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===bt.RUNNING&&(this.status=bt.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,i=0,n=this.rawPosition,r=this.subAnimates.reduce((function(t,e){return t+e.totalDuration}),0);t<0&&(t=0);var a=t>=r;if(a&&(t=r),t===n)return a;for(var s=0;s<this.subAnimates.length&&!(i+(e=this.subAnimates[s]).totalDuration>=t);s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),a}},{key:"onStart",value:function(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}},{key:"onEnd",value:function(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}},{key:"onRemove",value:function(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}},{key:"onFrame",value:function(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}},{key:"release",value:function(){this.status=bt.END}},{key:"stop",value:function(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()}}],[{key:"AddInterpolate",value:function(e,i){t.interpolateMap.set(e,i)}}]),t}();wi.mode=mt.NORMAL,wi.interpolateMap=new Map;var Si,Ti=function(){function t(e,i){a(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new Ci(0,0,i?Object.assign({},i.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}return o(t,[{key:"totalDuration",get:function(){return this.calcAttr(),this._totalDuration+this._startAt}},{key:"calcAttr",value:function(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}},{key:"bind",value:function(t){return this.target=t,this}},{key:"play",value:function(t){var e=t.duration;(null==e||e<0)&&(e=0);var i=t.easing,n="string"==typeof i?xi[i]:i,r=this._addStep(e,null,n);return r.type=xt.customAnimate,this._appendProps(t.getEndProps(),r,!1),this._appendCustomAnimate(t,r),this}},{key:"to",value:function(t,e,i,n){var r=this;(null==e||e<0)&&(e=0);var a="string"==typeof i?xi[i]:i,s=this._addStep(e,null,a);return s.type=xt.to,this._appendProps(t,s,!!n&&n.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),n&&n.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==r.animate.id&&t.preventAttrs(s.propKeys)})),this}},{key:"from",value:function(t,e,i,n){var r=this;this.to(t,0,i,n);var a={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){a[t]=r.getLastPropByName(t,r.stepTail)})),this.to(a,e,i,n),this.stepTail.type=xt.from}},{key:"startAt",value:function(t){return t<0&&(t=0),this._startAt=t,this}},{key:"getStartProps",value:function(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}},{key:"getEndProps",value:function(){return this.stepTail.props}},{key:"getLastStep",value:function(){return this._lastStep}},{key:"wait",value:function(t){if(t>0){var e=this._addStep(+t,null);e.type=xt.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}},{key:"_addStep",value:function(t,e,i){var n=new Ci(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}},{key:"_appendProps",value:function(t,e,i){var n=this;e.props=i?t:Object.assign({},t);var r=e.prev,a=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((function(t){void 0===e.props[t]&&(e.props[t]=n.target.getDefaultAttribute(t))}));r.prev;)r.props&&(r.propKeys||(r.propKeys=Object.keys(r.props)),r.propKeys.forEach((function(t){void 0===a[t]&&(a[t]=r.props[t])}))),e.propKeys=Object.keys(e.props),r=r.prev;var s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(a)),e.propKeys.forEach((function(t){if(void 0===s[t]){var e=n.animate.getStartProps();s[t]=e[t]=n.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}},{key:"_appendCustomAnimate",value:function(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}},{key:"setPosition",value:function(t){var e,i,n,r=this.duration,a=this.loop,s=this.rawPosition,o=!1,l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<l)return this.rawPosition=t,!1;if(r<=0)return o=!0;if(n=(t-=l)-(i=Math.floor(t/r))*r,(o=t>=a*r+r)&&(t=(n=r)*(i=a)+r),t===s)return o;var u=!this.reversed!=!(this.bounce&&i%2);return u&&(n=r-n),this._deltaPosition=n-this.position,this.position=n,this.rawPosition=t+l,this.updatePosition(o,u),o}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var i=this.stepHead.next,n=this.position,r=this.duration;if(this.target&&i){for(var a=i.next;a&&a.position<=n;)a=(i=a).next;var s=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(s=i.easing(s)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,s,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(i,s)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,i){if(t!==e)if(i){for(var n=e.prev;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{for(var r=e.next;r&&r!==t;)r.customAnimate&&(r.customAnimate.onStart&&r.customAnimate.onStart(),r.customAnimate.onEnd&&r.customAnimate.onEnd()),r=r.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}},{key:"getLastPropByName",value:function(t,i){for(var n=i.prev;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){var r=n.customAnimate.getEndProps()[t];if(void 0!==r)return r}n=n.prev}return e.Logger.getInstance().warn("未知错误,step中找不到属性"),i.props[t]}},{key:"updateTarget",value:function(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}]),t}(),Ci=function(){function t(e,i,n,r){a(this,t),this.duration=i,this.position=e,this.props=n,this.easing=r}return o(t,[{key:"append",value:function(t){t.prev=this,t.next=this.next,this.next=t}},{key:"getLastProps",value:function(){for(var t=this.prev;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}]),t}(),Ei=200,Mi="cubicOut";!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"}(Si||(Si={}));var Pi=[0,0,0,0],Li=function(t){return t?e.isArray(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Pi[0]=t[0],Pi[2]=t[0],Pi[1]=t[1],Pi[3]=t[1],Pi):t:t:0},Oi=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Ii=[1,2,3,0,1,2,3,0];function Ri(t,i,n,r){for(;t>=e.pi2;)t-=e.pi2;for(;t<0;)t+=e.pi2;for(;t>i;)i+=e.pi2;Oi[0].x=n,Oi[1].y=n,Oi[2].x=-n,Oi[3].y=-n;var a=Math.ceil(t/e.halfPi)%4,s=Math.ceil(i/e.halfPi)%4;if(r.add(e.cos(t)*n,e.sin(t)*n),r.add(e.cos(i)*n,e.sin(i)*n),a!==s||i-t>e.pi)for(var o=!1,l=0;l<Ii.length;l++)if(o||a!==Ii[l]){if(o&&s===Ii[l])break;if(o){var u=Oi[Ii[l]];r.add(u.x,u.y)}}else{o=!0;var h=Oi[a];r.add(h.x,h.y)}}function ji(t,i){if(e.isArray(t)){for(var n,r=0;r<t.length&&void 0===n;r++)n=t[r][i];return n}return t[i]}var Di=function(){function t(){a(this,t),this.durations=[],this.timeout=t.TimeOut,this.lastDate=0,this.durationsListThreshold=30}return o(t,[{key:"call",value:function(t){var e=this;return this.lastDate=Date.now(),setTimeout((function(){e.appendDuration(Date.now()-e.lastDate),t(0)}),this.timeout,!0)}},{key:"clear",value:function(t){clearTimeout(t)}},{key:"appendDuration",value:function(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce((function(t,e){return t+e}),0)/this.durations.length,1e3/60),1e3/30)}}]),t}();Di.TimeOut=1e3/60,new Di;var Ni,Ui=function(t,i){return e.isString(t)&&"%"===t[t.length-1]?i*(Number.parseFloat(t.substring(0,t.length-1))/100):t},zi=function(t){u(n,t);var i=p(n);function n(t,e,r,s,o){return a(this,n),i.call(this,t,e,r,s,o)}return o(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,i,n,r,a,s,o,l;this.fromNumber=e.isNumber(null===(t=this.from)||void 0===t?void 0:t.text)?null===(i=this.from)||void 0===i?void 0:i.text:Number.parseFloat(null===(n=this.from)||void 0===n?void 0:n.text),this.toNumber=e.isNumber(null===(r=this.to)||void 0===r?void 0:r.text)?null===(a=this.to)||void 0===a?void 0:a.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(l=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==l?l:Math.max(e.getDecimalPlaces(this.fromNumber),e.getDecimalPlaces(this.toNumber)))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}]),n}(ki);!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"}(Ni||(Ni={}));var Hi,Vi=e.ColorUtil.Color;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Hi||(Hi={}));var Wi=function(){function t(){a(this,t)}return o(t,null,[{key:"Get",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hi.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===Hi.Color1){var r=t.store1[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;var a=Vi.parseColorString(e);if(a){var s=[a.r/255,a.g/255,a.b/255,a.opacity];t.store1[e]=s,t.store255[e]=[a.r,a.g,a.b,a.opacity],n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3]}return n}var o=t.store255[e];if(o)return n[0]=o[0],n[1]=o[1],n[2]=o[2],n[3]=o[3],n;var l=Vi.parseColorString(e);return l&&(t.store1[e]=[l.r/255,l.g/255,l.b/255,l.opacity],t.store255[e]=[l.r,l.g,l.b,l.opacity],n[0]=l.r,n[1]=l.g,n[2]=l.b,n[3]=l.opacity),n}},{key:"Set",value:function(e,i,n){if(i===Hi.Color1){if(t.store1[e])return;t.store1[e]=n,t.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(t.store255[e])return;t.store255[e]=n,t.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}]),t}();function Fi(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)?e?"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),",").concat(t[3].toFixed(2),")"):"rgb(".concat(Math.round(t[0]),",").concat(Math.round(t[1]),",").concat(Math.round(t[2]),")"):t}function Gi(t,e,i,n,r){if(!t||!e)return t&&Fi(t)||e&&Fi(e)||!1;var a,s,o=!1,l=!1;if(Array.isArray(t)?a=t:"string"==typeof t?a=Wi.Get(t,Hi.Color255):o=!0,Array.isArray(e)?s=e:"string"==typeof e?s=Wi.Get(e,Hi.Color255):l=!0,o!==l){var u=o?t:e,h=o?e:t,d=Object.assign(Object.assign({},u),{stops:u.stops.map((function(t){return Object.assign(Object.assign({},t),{color:Fi(h)})}))});return o?Gi(u,d,i,n,r):Gi(d,u,i,n,r)}if(o){if(t.gradient===e.gradient){var c=t,f=e,v=c.stops,p=f.stops;if(v.length!==p.length)return!1;if("linear"===c.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:Xi(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i);if("radial"===c.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:Xi(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i);if("conical"===c.gradient)return function(t,e,i){var n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map((function(t,e){return{color:Xi(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(c,f,i)}return!1}return r&&r(a,s),Fi(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(a,s,i),n)}Wi.store255={},Wi.store1={};var $i=[0,0,0,0],Yi=[0,0,0,0];function Xi(t,e,i){return Wi.Get(t,Hi.Color255,$i),Wi.Get(e,Hi.Color255,Yi),"rgba(".concat(Math.round($i[0]+(Yi[0]-$i[0])*i),",").concat(Math.round($i[1]+(Yi[1]-$i[1])*i),",").concat(Math.round($i[2]+(Yi[2]-$i[2])*i),",").concat($i[3]+(Yi[3]-$i[3])*i,")")}var qi=function(){function t(){a(this,t)}return o(t,null,[{key:"GetImage",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?He.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&i.imageLoadSuccess(e,r.data):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=He.global.loadImage(e),r.dataPromise?(r.waitingMark=[i],r.dataPromise.then((function(t){var i;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(i=r.waitingMark)||void 0===i||i.map((function(i,n){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,i.imageLoadSuccess(e,t.data)):(r.loadState="fail",i.imageLoadFail(e))}))}))):(r.loadState="fail",i.imageLoadFail(e)))}},{key:"GetSvg",value:function(e,i){var n,r=t.cache.get(e);r?"fail"===r.loadState?He.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&He.global.getRequestAnimationFrame()((function(){i.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=He.global.loadSvg(e),r.dataPromise?(r.waitingMark=[i],r.dataPromise.then((function(t){var i;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(i=r.waitingMark)||void 0===i||i.map((function(i,n){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,i.imageLoadSuccess(e,t.data)):(r.loadState="fail",i.imageLoadFail(e))}))}))):(r.loadState="fail",i.imageLoadFail(e)))}},{key:"GetFile",value:function(e,i){var n=t.cache.get(e);return n?"init"===n.loadState||"fail"===n.loadState?Promise.reject():"loading"===n.loadState?n.dataPromise.then((function(t){return t.data})):Promise.resolve(n.data):(n={type:i,loadState:"init"},t.cache.set(e,n),"arrayBuffer"===i?n.dataPromise=He.global.loadArrayBuffer(e):"blob"===i?n.dataPromise=He.global.loadBlob(e):"json"===i&&(n.dataPromise=He.global.loadJson(e)),n.dataPromise.then((function(t){return t.data})))}}]),t}();qi.cache=new Map;var Zi=new e.Matrix,Ki=new e.AABBBounds,Ji=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Qi=["x","y"],tn=["scaleX","scaleY"],en=["angle"],nn=new e.Point,rn={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1},an=function(t){u(n,t);var i=p(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a(this,n),(t=i.call(this))._AABBBounds=new e.AABBBounds,t._updateTag=pt.INIT,t.attribute=r,t.valid=t.isValid(),r.background&&t.loadImage(r.background,!0),t}return o(n,[{key:"AABBBounds",get:function(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}},{key:"OBBBounds",get:function(){return this.tryUpdateOBBBounds()}},{key:"globalAABBBounds",get:function(){return this.tryUpdateGlobalAABBBounds()}},{key:"transMatrix",get:function(){return this.tryUpdateLocalTransMatrix(!0)}},{key:"globalTransMatrix",get:function(){return this.tryUpdateGlobalTransMatrix(!0)}},{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"getOffsetXY",value:function(t){var e,i,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attribute,a=r.dx,s=void 0===a?t.dx:a,o=r.dy,l=void 0===o?t.dy:o;if(n&&this.parent){var u=this.parent.attribute;nn.x=s+(null!==(e=u.scrollX)&&void 0!==e?e:0),nn.y=l+(null!==(i=u.scrollY)&&void 0!==i?i:0)}else nn.x=s,nn.y=l;return nn}},{key:"onAnimateBind",value:function(t){this._emitCustomEvent("animate-bind",t)}},{key:"tryUpdateAABBBounds",value:function(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;He.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),He.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}},{key:"combindShadowAABBBounds",value:function(t){if(this.shadowRoot){var e=this.shadowRoot.AABBBounds.clone();t.union(e)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){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}},{key:"tryUpdateGlobalTransMatrix",value:function(){if(this._globalTransMatrix){if(this.parent){var 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}},{key:"shouldUpdateGlobalMatrix",value:function(){return!0}},{key:"tryUpdateLocalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new e.Matrix),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&pt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&pt.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&pt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&pt.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&pt.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag&pt.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=pt.CLEAR_SHAPE}},{key:"containsPoint",value:function(t,i,n,r){if(!r)return!1;if(n===gt.GLOBAL){var a=new e.Point(t,i);this.parent&&this.parent.globalTransMatrix.transformPoint(a,a),t=a.x,i=a.y}return r.containsPoint(this,{x:t,y:i})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background&&this.loadImage(t.background,!0),this._setAttributes(t,e,i)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0,n=Object.keys(t),r=0;r<n.length;r++){var a=n[r];this.attribute[a]=t[a]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}},{key:"setAttribute",value:function(t,i,n,r){var a,s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(l({},t,i),this.attribute,t,r);s?this._setAttributes(s,n,r):e.isNil(null===(a=this.normalAttrs)||void 0===a?void 0:a[t])?(this.attribute[t]=i,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r)):this.normalAttrs[t]=i,"background"===t&&this.loadImage(i,!0)}},{key:"needUpdateTags",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ji,i=0;i<e.length;i++){var n=e[i];if(-1!==t.indexOf(n))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ji,i=0;i<e.length;i++)if(t===e[i])return!0;return!1}},{key:"initAttributes",value:function(t){var e={type:yt.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=pt.INIT,this.onAttributeUpdate(e)}},{key:"translate",value:function(t,e){var i,n;if(0===t&&0===e)return this;var r={type:yt.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Qi,r);a&&(t=a.x,e=a.y,delete a.x,delete a.y,this._setAttributes(a));var s=this.attribute,o=s.postMatrix;return o?He.transformUtil.fromMatrix(o,o).translate(t,e):(s.x=(null!==(i=s.x)&&void 0!==i?i:me.x)+t,s.y=(null!==(n=s.y)&&void 0!==n?n:me.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"translateTo",value:function(t,e){var i=this.attribute;if(i.x===t&&i.y===e)return this;var n={type:yt.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,Qi,n);return r?(this._setAttributes(r,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"scale",value:function(t,i,n){var r,a;if(1===t&&1===i)return this;var s={type:yt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:i,scaleCenter:n},this.attribute,tn,s);o&&(t=o.scaleX,i=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));var l=this.attribute;if(n){var u=this.attribute.postMatrix;u||(u=new e.Matrix,l.postMatrix=u),He.transformUtil.fromMatrix(u,u).scale(t,i,n)}else l.scaleX=(null!==(r=l.scaleX)&&void 0!==r?r:me.scaleX)*t,l.scaleY=(null!==(a=l.scaleY)&&void 0!==a?a:me.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}},{key:"scaleTo",value:function(t,e){var i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;var n={type:yt.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,tn,n);return r?(this._setAttributes(r,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}},{key:"rotate",value:function(t,i){var n;if(0===t)return this;var r={type:yt.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:i},this.attribute,en,r);a&&(delete a.angle,this._setAttributes(a,!1,r));var s=this.attribute;if(i){var o=this.attribute.postMatrix;o||(o=new e.Matrix,s.postMatrix=o),He.transformUtil.fromMatrix(o,o).rotate(t,i)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:me.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"rotateTo",value:function(t){var e=this.attribute;if(e.angle===t)return this;var i={type:yt.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,en,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}},{key:"skewTo",value:function(t,e){return this}},{key:"animate",value:function(t){var e=this;this.animates||(this.animates=new Map);var i=new wi(null==t?void 0:t.id).bind(this);if(t){var n=t.onStart,r=t.onFrame,a=t.onEnd,s=t.onRemove;null!=n&&i.onStart(n),null!=r&&i.onFrame(r),null!=a&&i.onEnd(a),null!=s&&i.onRemove(s),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((function(){e.animates.delete(i.id)})),i}},{key:"onAttributeUpdate",value:function(t){t&&t.skipUpdateCallback||(He.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}},{key:"update",value:function(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}},{key:"hasState",value:function(t){return!(!this.currentStates||!this.currentStates.length)&&(!!e.isNil(t)||this.currentStates.includes(t))}},{key:"getState",value:function(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}},{key:"applyStateAttrs",value:function(t,e,i,n){var r,a,s,o,l=this;if(i){var u,h=Object.keys(t),d=this.getNoWorkAnimateAttr(),c={};n?h.forEach((function(e){d[e]?(u||(u={}),u[e]=t[e]):c[e]=void 0===t[e]?l.getDefaultAttribute(e):t[e]})):h.forEach((function(e){d[e]?(u||(u={}),u[e]=t[e]):c[e]=t[e]}));var f=this.animate();f.stateNames=e,f.to(c,null!==(a=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==a?a:Ei,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==o?o:Mi),u&&this.setAttributes(u,!1,{type:yt.STATE})}else this.setAttributes(t,!1,{type:yt.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,i={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(i[t]=e.normalAttrs[t],delete e.normalAttrs[t]):i[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(i){t[i]=e.normalAttrs[i]}))):Object.keys(t).forEach((function(t){i[t]=e.getNormalAttribute(t)})),this.normalAttrs=i}},{key:"getNormalAttribute",value:function(t){var i=this.attribute[t];return this.animates&&this.animates.forEach((function(n){if(n.stateNames){var r=n.getEndProps();e.has(r,t)&&(i=r[t])}})),i}},{key:"clearStates",value:function(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}},{key:"removeState",value:function(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){var i=this.currentStates.filter((function(e){return e!==t}));this.useStates(i,e)}}},{key:"toggleState",value:function(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){var i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}},{key:"addState",value:function(t,e,i){var n;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}}},{key:"useStates",value:function(t,e){var i,n=this;if(t.length){if((null===(i=this.currentStates)||void 0===i?void 0:i.length)!==t.length||t.some((function(t,e){return n.currentStates[e]!==t}))){var r={};t.forEach((function(e){var i,a=n.stateProxy?n.stateProxy(e,t):null===(i=n.states)||void 0===i?void 0:i[e];a&&Object.assign(r,a)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=pt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=pt.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=pt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&pt.UPDATE_SHAPE_AND_BOUNDS)===pt.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=pt.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=pt.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=pt.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=pt.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=pt.CLEAR_GLOBAL_MATRIX}},{key:"addUpdateLayoutTag",value:function(){this._updateTag|=pt.UPDATE_LAYOUT}},{key:"clearUpdateLayoutTag",value:function(){this._updateTag&=pt.CLEAR_LAYOUT}},{key:"needUpdateLayout",value:function(){return!!(this._updateTag&pt.UPDATE_LAYOUT)}},{key:"getAnchor",value:function(t,e){var i=this,n=[0,0],r=function(){if(e.b)return e.b;var t=i.attribute,n=t.scaleX,r=t.scaleY,a=t.angle;return Ki.copy(i._AABBBounds),i.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=i.AABBBounds.clone(),i._AABBBounds.copy(Ki),i.setAttributes({scaleX:n,scaleY:r,angle:a}),e.b};if("string"==typeof t[0]){var a=parseFloat(t[0])/100,s=r();n[0]=s.x1+(s.x2-s.x1)*a}else n[0]=t[0];if("string"==typeof t[1]){var o=parseFloat(t[1])/100,l=r();n[1]=l.y1+(l.y2-l.y1)*o}else n[1]=t[1];return n}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,i=t.x,n=void 0===i?me.x:i,r=t.y,a=void 0===r?me.y:r,s=t.scaleX,o=void 0===s?me.scaleX:s,l=t.scaleY,u=void 0===l?me.scaleY:l,h=t.angle,d=void 0===h?me.angle:h,c=t.scaleCenter,f=t.anchor,v=t.postMatrix,p=[0,0],g={};if(f&&(p=this.getAnchor(f,g)),!c||1===o&&1===u)e.normalTransform(this._transMatrix,this._transMatrix.reset(),n,a,o,u,d,f&&p);else{var y=this._transMatrix;y.reset(),y.translate(p[0],p[1]),y.rotate(d),y.translate(-p[0],-p[1]),y.translate(n,a),p=this.getAnchor(c,g),He.transformUtil.fromMatrix(y,y).scale(o,u,{x:p[0],y:p[1]})}var b=this.getOffsetXY(me);if(this._transMatrix.e+=b.x,this._transMatrix.f+=b.y,v){var m=Zi.setValue(v.a,v.b,v.c,v.d,v.e,v.f),x=this._transMatrix;m.multiply(x.a,x.b,x.c,x.d,x.e,x.f),x.setValue(m.a,m.b,m.c,m.d,m.e,m.f)}}},{key:"doUpdateGlobalMatrix",value:function(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);var t=this.parent.attribute,e=t.scrollX,i=void 0===e?0:e,n=t.scrollY,r=void 0===n?0:n;this._globalTransMatrix.translate(i,r)}}},{key:"setStage",value:function(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){var i=t.getTimeline();this.animates.forEach((function(t){t.setTimeline(i)}))}this._onSetStage&&this._onSetStage(this,t,e),He.graphicService.onSetStage(this,t)}}},{key:"setStageToShadowRoot",value:function(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}},{key:"onAddStep",value:function(t){}},{key:"onStop",value:function(t){t&&this.setAttributes(t,!1,{type:yt.ANIMATE_END})}},{key:"onStep",value:function(t,e,i,n,r){var a={};if(i.customAnimate)i.customAnimate.update(r,n,a);else{var s=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,a,i,n,r,s,void 0,o,l)}this.setAttributes(a,!1,{type:yt.ANIMATE_UPDATE,animationState:{ratio:n,end:r,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,i,n,r,a,s,o,l,u){var h=this;u||(u=Object.keys(s),n.propKeys=u),a?n.propKeys.forEach((function(t){e.validAttr(t)&&(i[t]=s[t])})):u.forEach((function(a){var u;if(e.validAttr(a)){var d=s[a],c=null!==(u=o&&o[a])&&void 0!==u?u:t.getLastPropByName(a,n);if(null!=d&&null!=c)e.interpolateFunc&&e.interpolateFunc(a,r,c,d,i)||(e.customInterpolate(a,r,c,d,h,i)||h.defaultInterpolate(d,c,a,i,l,r)||h._interpolate(a,r,c,d,i));else i[a]=d}})),n.parsedProps=l}},{key:"defaultInterpolate",value:function(t,e,i,n,r,a){if(Number.isFinite(t))return n[i]=e+(t-e)*a,!0;if("fill"===i){r||(r={});var s=r.fillColorArray,o=Gi(e,null!=s?s:t,a,!1,(function(t,e){r.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){r||(r={});var l=r.strokeColorArray,u=Gi(e,null!=l?l:t,a,!1,(function(t,e){r.strokeColorArray=e}));return u&&(n[i]=u),!0}if("shadowColor"===i){r||(r={});var h=r.shadowColorArray,d=Gi(e,null!=h?h:t,a,!0,(function(t,e){r.shadowColorArray=e}));return d&&(n[i]=d),!0}return!1}},{key:"_interpolate",value:function(t,e,i,n,r){}},{key:"getDefaultAttribute",value:function(t){return vi(this)[this.type][t]}},{key:"getComputedAttribute",value:function(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}},{key:"onSetStage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}},{key:"attachShadow",value:function(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:He.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}},{key:"detachShadow",value:function(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}},{key:"toJson",value:function(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((function(t){return t.toJson()}))}}},{key:"createPathProxy",value:function(t){return e.isString(t,!0)?this.pathProxy=(new ge).fromString(t):this.pathProxy=new ge,this.pathProxy}},{key:"loadImage",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!t||i&&function(t){return!(!t.fill&&!t.stroke)}(t))){var n=t;this.resources||(this.resources=new Map);var r={data:"init",state:null};this.resources.set(n,r),"string"==typeof t?(r.state="loading",t.startsWith("<svg")?(qi.GetSvg(t,this),this.backgroundImg=this.backgroundImg||i):(e.isValidUrl(t)||t.includes("/")||e.isBase64(t))&&(qi.GetImage(t,this),this.backgroundImg=this.backgroundImg||i)):(r.state="success",r.data=t,this.backgroundImg=this.backgroundImg||i)}}},{key:"imageLoadSuccess",value:function(t,e,i){if(this.resources){var n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var i=this.resources.get(t);i&&(i.state="fail",e&&e())}}},{key:"_stopAnimates",value:function(t){t&&t.forEach((function(t){t.stop()}))}},{key:"stopAnimates",value:function(){var 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((function(e){e.stopAnimates(t)}))}},{key:"release",value:function(){this.releaseStatus="released",He.graphicService.onRelease(this)}},{key:"_emitCustomEvent",value:function(t,e){var i,n;if(this._events&&t in this._events){var r=new bi(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),i=0;i<e.length;++i){var r=e[i];Object.defineProperty(n.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}]),n}(gi);an.mixin(mi);var sn=function(){function t(e){a(this,t),this.tagname=e,this.child=[],this[":@"]={}}return o(t,[{key:"add",value:function(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push(l({},t,e))}},{key:"addChild",value:function(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(l(l({},t.tagname,t.child),":@",t[":@"])):this.child.push(l({},t.tagname,t.child))}}]),t}();function on(t,e,i,n){var r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function ln(t,e,i){var n=function(t,e){for(var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",a=e;a<t.length;a++){var s=t[a];if(i)s===i&&(i="");else if('"'===s||"'"===s)i=s;else if(s===n[0]){if(!n[1])return{data:r,index:a};if(t[a+1]===n[1])return{data:r,index:a}}else"\t"===s&&(s=" ");r+=s}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(n){var r=n.data,a=n.index,s=r.search(/\s/),o=r,l=!0;-1!==s&&(o=r.substr(0,s).replace(/\s\s*$/,""),r=r.substr(s+1));var u=o;if(i){var h=o.indexOf(":");-1!==h&&(l=(o=o.substr(h+1))!==n.data.substr(h+1))}return{tagName:o,tagExp:r,closeIndex:a,attrExpPresent:l,rawTagName:u}}}var un=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm"),hn=function(){function t(e){a(this,t),this.currentNode=null,this.options=e,this.tagsNodeStack=[],this.docTypeEntities={}}return o(t,[{key:"addChild",value:function(t,e,i){var n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}},{key:"buildAttributesMap",value:function(t,e,i){var n={};if(t){for(var r=function(t,e){for(var i=[],n=e.exec(t);n;){var r=[];r.startIndex=e.lastIndex-n[0].length;for(var a=n.length,s=0;s<a;s++)r.push(n[s]);i.push(r),n=e.exec(t)}return i}(t,un),a=r.length,s=0;s<a;s++){var o=r[s][1],l=r[s][4];o&&(n[o]=void 0===l||(isNaN(l)?l:Number(l)))}return n}}},{key:"parseXml",value:function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new sn("!xml"),i=e,n="",r="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var s=on(t,">",a,"Closing Tag is not closed."),o=r.lastIndexOf(".");r=r.substring(0,o),(i=this.tagsNodeStack.pop())&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",a=s}else if("?"===t[a+1])a=ln(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=on(t,"--\x3e",a+4,"Comment is not closed.");else{var l=ln(t,a,!1),u=l.tagName,h=l.tagExp,d=l.attrExpPresent,c=l.closeIndex;if(u!==e.tagname&&(r+=r?"."+u:u),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===u[u.length-1]?(u=u.substr(0,u.length-1),r=r.substr(0,r.length-1),h=u):h=h.substr(0,h.length-1);var f=new sn(u);u!==h&&d&&(f[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,f,r),r=r.substr(0,r.lastIndexOf("."))}else{var v=new sn(u);this.tagsNodeStack.push(i),u!==h&&d&&(v[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,v,r),i=v}n="",a=c}else n+=t[a];return e.child}}]),t}();function dn(t,e){return cn(t)}function cn(t,e){for(var i,n={},r=0;r<t.length;r++){var a=t[r],s=fn(a);if(void 0!==s&&a[s]){var o=cn(a[s]);i=o,Object.keys(i).length,a[":@"]&&vn(o,a[":@"]),void 0!==n[s]&&n.hasOwnProperty(s)?(Array.isArray(n[s])||(n[s]=[n[s]]),n[s].push(o)):n[s]=o}}return n}function fn(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function vn(t,e,i){if(e)for(var n=Object.keys(e),r=n.length,a=0;a<r;a++){var s=n[a];t[s]=e[s]}}var pn=function(){function t(e){a(this,t),this.options=Object.assign({},t.defaultOptions,e)}return o(t,[{key:"valid",value:function(t){return t.startsWith("<")}},{key:"parse",value:function(t){return!!this.valid&&dn(new hn(this.options).parseXml(t),this.options)}}]),t}();function gn(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}pn.defaultOptions={};var yn,bn=0;function mn(){return bn++}function xn(t){for(var e=[],i=0,n="",r=0;r<t.length;r++)kn(t[r])?i?n+=t[r]:(i=1,n=t[r]):(i&&(e.push({text:n,direction:yn.VERTICAL}),n="",i=0),e.push({text:t[r],direction:yn.HORIZONTAL}));return n&&e.push({text:n,direction:yn.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(yn||(yn={}));var _n=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((function(t){return _n.set(t,!0)}));var An=new Map;function kn(t){if(_n.has(t))return!0;if(An.has(t))return!1;var e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((function(t){return An.set(t,!0)})),mn();var Bn=mn(),wn=mn();mn(),mn();var Sn=mn(),Tn=mn(),Cn=mn();mn(),mn(),mn();var En=mn();mn(),mn();var Mn,Pn=mn(),Ln=mn(),On=Symbol.for("GraphicService"),In=Symbol.for("GraphicCreator"),Rn={"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"},jn=Object.keys(Rn);!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Mn||(Mn={}));var Dn=function(t){u(n,t);var i=p(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="group",e.parent=null,e.isContainer=!0,e.numberType=Sn,e._childUpdateTag=pt.UPDATE_BOUNDS,e}return o(n,[{key:"setMode",value:function(t){"3d"===t?this.set3dMode():this.set2dMode()}},{key:"set3dMode",value:function(){this.in3dMode=!0}},{key:"set2dMode",value:function(){this.in3dMode=!1}},{key:"setTheme",value:function(t){return this.theme||(this.theme=new ci),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new ci)}},{key:"hideAll",value:function(){this.setAttribute("visible",!1),this.forEachChildren((function(t){t.isContainer&&t.hideAll?t.hideAll():t.setAttribute("visible",!1)}))}},{key:"showAll",value:function(){this.setAttribute("visible",!0),this.forEachChildren((function(t){t.isContainer&&t.showAll?t.showAll():t.setAttribute("visible",!0)}))}},{key:"containsPoint",value:function(t,i,n){if(n===gt.GLOBAL){var r=new e.Point(t,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),this.AABBBounds.contains(r.x,r.y)}return this.AABBBounds.contains(t,i)}},{key:"shouldUpdateAABBBounds",value:function(){return!!g(h(n.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag&pt.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;He.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),He.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,i=void 0===e?me.x:e,r=t.y,a=void 0===r?me.y:r,s=t.dx,o=void 0===s?me.dx:s,l=t.dy,u=void 0===l?me.dy:l,d=t.scaleX,c=void 0===d?me.scaleX:d,f=t.scaleY,v=void 0===f?me.scaleY:f,p=t.angle,y=void 0===p?me.angle:p,b=t.postMatrix;if(0!==i||0!==a||0!==o||0!==u||1!==c||1!==v||0!==y||b)return g(h(n.prototype),"doUpdateLocalMatrix",this).call(this);this._transMatrix.reset()}},{key:"doUpdateAABBBounds",value:function(){var t=this.attribute,e=vi(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=He.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),n=t.boundsPadding,r=void 0===n?e.boundsPadding:n,a=Li(r);return a&&i.expand(a),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=pt.CLEAR_BOUNDS,this._childUpdateTag&=pt.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=pt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&pt.UPDATE_BOUNDS||(this._childUpdateTag|=pt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=g(h(n.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),He.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){g(h(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),He.graphicService.onClearIncremental(this,this.stage)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=g(h(n.prototype),"appendChild",this).call(this,t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertBefore",value:function(t,e){var i=g(h(n.prototype),"insertBefore",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertAfter",value:function(t,e){var i=g(h(n.prototype),"insertAfter",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"insertInto",value:function(t,e){var i=g(h(n.prototype),"insertInto",this).call(this,t,e);return this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}},{key:"removeChild",value:function(t){var e=g(h(n.prototype),"removeChild",this).call(this,t);return t.stage=null,He.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){this.forEachChildren((function(t){He.graphicService.onRemove(t)})),g(h(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var i=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),He.graphicService.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,i.layer)})))}},{key:"addUpdatePositionTag",value:function(){g(h(n.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){g(h(n.prototype),"addUpdateGlobalPositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){var e=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"shouldUpdateGlobalMatrix",value:function(){return!!(this._updateTag&pt.UPDATE_GLOBAL_MATRIX)}},{key:"_getChildByName",value:function(t,e){return this.find((function(e){return e.name===t}),e)}},{key:"createOrUpdateChild",value:function(t,e,i){var n=this._getChildByName(t);return n?n.setAttributes(e):((n=He.graphicService.creator[i](e)).name=t,this.add(n)),n}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(an);Dn.NOWORK_ANIMATE_ATTR=rn;var Nn,Un=function(t){u(i,t);var e=p(i);function i(t,n,r,s){var o,l;return a(this,i),(o=e.call(this,{})).stage=t,o.global=n,o.window=r,o.main=s.main,o.layerHandler=s.layerHandler,o.layerHandler.init(v(o),r,{main:s.main,canvasId:s.canvasId,width:o.viewWidth,height:o.viewHeight,zIndex:null!==(l=s.zIndex)&&void 0!==l?l:0}),o.layer=v(o),o.subLayers=new Map,o.theme=new ci,o.background="rgba(0, 0, 0, 0)",o.afterDrawCbs=[],o}return o(i,[{key:"offscreen",get:function(){return this.layerHandler.offscreen}},{key:"layerMode",get:function(){return this.layerHandler.type}},{key:"width",get:function(){return this.stage?this.stage.width:0}},{key:"height",get:function(){return this.stage?this.stage.height:0}},{key:"viewWidth",get:function(){return this.stage?this.stage.viewWidth:0}},{key:"viewHeight",get:function(){return this.stage?this.stage.viewHeight:0}},{key:"dirtyBound",get:function(){throw new Error("暂不支持")}},{key:"dpr",get:function(){return this._dpr}},{key:"combineSubLayer",value:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(i.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&i.forEach((function(t){t.group&&(t.group.incremental=0)})),i.forEach((function(e){He.layerService.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){g(h(i.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"tryRenderSecondaryLayer",value:function(t,e){var i=this;this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((function(n){n.layer.renderCount=i.renderCount,n.layer.render(t,e)}))}},{key:"render",value:function(t,e){var i,n=this,r=this.stage;this.layerHandler.render([this],{renderService:t.renderService,x:r.x,y:r.y,width:this.viewWidth,height:this.viewHeight,stage:this.stage,layer:this,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((function(t){return t(n)})),this.tryRenderSecondaryLayer(t,e)}},{key:"resize",value:function(t,e){this.layerHandler.resize(t,e)}},{key:"resizeView",value:function(t,e){this.layerHandler.resizeView(t,e)}},{key:"setDpr",value:function(t){this.layerHandler.setDpr(t)}},{key:"afterDraw",value:function(t){this.afterDrawCbs.push(t)}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"prepare",value:function(t,e){}},{key:"combineTo",value:function(t,e){var i,n,r,a=this;this.offscreen&&(this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n: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((function(t){return t(a)})))}},{key:"release",value:function(){var t=this;g(h(i.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){He.layerService.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var i,n,r,a=this;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,x:null!==(n=e.x)&&void 0!==n?n: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((function(t){return t(a)}))}}]),i}(Dn),zn=Symbol.for("TransformUtil"),Hn=Symbol.for("GraphicUtil"),Vn=Symbol.for("LayerService"),Wn=Symbol.for("StaticLayerHandlerContribution"),Fn=Symbol.for("DynamicLayerHandlerContribution"),Gn=Symbol.for("VirtualLayerHandlerContribution"),$n=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Yn=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xn=Nn=function(){function t(){a(this,t),this.layerMap=new Map,this.global=He.global}return o(t,[{key:"tryInit",value:function(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}},{key:"getStageLayer",value:function(t){return this.layerMap.get(t)}},{key:"getRecommendedLayerType",value:function(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}},{key:"getLayerHandler",value:function(t){return"static"===t?Ze.get(Wn):"dynamic"===t?Ze.get(Fn):Ze.get(Gn)}},{key:"createLayer",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();var n=this.getRecommendedLayerType(i.layerMode);n=i.canvasId?"static":n;var r=this.getLayerHandler(n),a=new Un(t,this.global,t.window,Object.assign(Object.assign({main:!1},i),{layerMode:n,canvasId:null!==(e=i.canvasId)&&void 0!==e?e:Nn.GenerateLayerId(),layerHandler:r})),s=this.layerMap.get(t)||[];return s.push(a),this.layerMap.set(t,s),this.staticLayerCountInEnv--,a}},{key:"prepareStageLayer",value:function(t){var e;t.forEachChildren((function(t){var i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i).secondaryHandlers=[]}))}},{key:"releaseLayer",value:function(t,e){e.release();var i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((function(t){return t!==e})))}},{key:"layerCount",value:function(t){return(this.layerMap.get(t)||[]).length}},{key:"restLayerCount",value:function(t){return"browser"===this.global.env?10:0}}],[{key:"GenerateLayerId",value:function(){return"".concat(Nn.idprefix,"_").concat(Nn.prefix_count++)}}]),t}();Xn.idprefix="visactor_layer",Xn.prefix_count=0,Xn=Nn=$n([j(),Yn("design:paramtypes",[])],Xn);var qn=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Zn=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kn=Symbol.for("VWindow"),Jn=Symbol.for("WindowHandlerContribution"),Qn=function(){function t(){a(this,t),this.hooks={onChange:new it(["x","y","width","height"])},this._uid=A.GenAutoIncrementId(),this.global=He.global,this.postInit()}return o(t,[{key:"width",get:function(){if(this._handler){var t=this._handler.getWH();return this._width=t.width}return this._width}},{key:"height",get:function(){if(this._handler){var t=this._handler.getWH();return this._height=t.height}return this._height}},{key:"dpr",get:function(){return this._handler.getDpr()}},{key:"postInit",value:function(){var t=this;this.global.hooks.onSetEnv.tap("window",(function(){t.active()})),this.active()}},{key:"active",value:function(){var t=this.global;t.env&&!this.actived&&(Ze.getNamed(Jn,t.env).configure(this,t),this.actived=!0)}},{key:"style",get:function(){return this._handler.getStyle()},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){this._handler.createWindow(t);var e=this._handler.getWH();this._width=e.width,this._height=e.height,this.title=this._handler.getTitle(),this.resizable=!0}},{key:"setWindowHandler",value:function(t){this._handler=t}},{key:"setDpr",value:function(t){return this._handler.setDpr(t)}},{key:"resize",value:function(t,e){return this._handler.resizeWindow(t,e)}},{key:"configure",value:function(){throw new Error("暂不支持")}},{key:"release",value:function(){return this._handler.releaseWindow()}},{key:"getContext",value:function(){return this._handler.getContext()}},{key:"getNativeHandler",value:function(){return this._handler.getNativeHandler()}},{key:"getImageBuffer",value:function(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}},{key:"addEventListener",value:function(t,e,i){return this._handler.addEventListener(t,e,i)}},{key:"removeEventListener",value:function(t,e,i){return this._handler.removeEventListener(t,e,i)}},{key:"dispatchEvent",value:function(t){return this._handler.dispatchEvent(t)}},{key:"getBoundingClientRect",value:function(){return this._handler.getBoundingClientRect()}},{key:"getContainer",value:function(){return this._handler.container}},{key:"clearViewBox",value:function(t,e){this._handler.clearViewBox(t,e)}},{key:"isVisible",value:function(t){return this._handler.isVisible(t)}},{key:"onVisibleChange",value:function(t){return this._handler.onVisibleChange(t)}},{key:"getTopLeft",value:function(t){return this._handler.getTopLeft(t)}}]),t}();Qn=qn([j(),Zn("design:paramtypes",[])],Qn);var tr=new k((function(t){t(rt).to(lt).inSingletonScope(),t(Kn).to(Qn),t(Hn).to(ai).inSingletonScope(),t(zn).to(oi).inSingletonScope(),t(Vn).to(Xn).inSingletonScope()}));function er(t,e){return!(!t&&!e)}function ir(t,i){return(e.isArray(t)?t.some((function(t){return t||void 0===t})):!!t)&&i>0}function nr(t,e,i){return i&&t*e>0}function rr(t,e){return t*e>0}var ar=Symbol.for("AreaRenderContribution"),sr=Symbol.for("GroupRenderContribution"),or=Symbol.for("InteractiveSubRenderContribution");function lr(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function ur(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}var hr=function(){function t(e,i,n){a(this,t),this.fontFamily=e,this.textOptions=i,this.textMeasure=n}return o(t,[{key:"LayoutBBox",value:function(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}},{key:"GetLayout",value:function(t,e,i,n,r,a,s,o,l){for(var u=[],h=[e,i],d=[0,0];t.length>0;){var c=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,s,o,l).str;u.push({str:c,width:this.textMeasure.measureTextWidth(c,this.textOptions)}),t=t.substring(c.length)}"left"===n||"start"===n||("center"===n?d[0]=h[0]/-2:"right"!==n&&"end"!==n||(d[0]=-h[0])),"top"===r||("middle"===r?d[1]=h[1]/-2:"bottom"===r&&(d[1]=-h[1]));var f={xOffset:d[0],yOffset:d[1],width:h[0],height:h[1]};return this.layoutWithBBox(f,u,n,r,a)}},{key:"GetLayoutByLines",value:function(t,e,i,n){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((function(t){return t.toString()}));var l=[],u=[0,0];if("number"==typeof s&&s!==1/0){for(var h,d=0,c=t.length;d<c;d++)h=Math.min(this.textMeasure.measureTextWidth(t[d],this.textOptions),s),l.push({str:this.textMeasure.clipTextWithSuffix(t[d],this.textOptions,h,r,a,o).str,width:h});u[0]=s}else{var f,v;s=0;for(var p=0,g=t.length;p<g;p++)v=t[p],f=this.textMeasure.measureTextWidth(v,this.textOptions),s=Math.max(s,f),l.push({str:v,width:f});u[0]=s}u[1]=l.length*n,u[0]=l.reduce((function(t,e){return Math.max(t,e.width)}),0);var y={xOffset:0,yOffset:0,width:u[0],height:u[1]};return this.LayoutBBox(y,e,i),this.layoutWithBBox(y,l,e,i,n)}},{key:"layoutWithBBox",value:function(t,e,i,n,r){var a=[0,0],s=e.length*r;"top"===n||("middle"===n?a[1]=(t.height-s)/2:"bottom"===n&&(a[1]=t.height-s));for(var o=0;o<e.length;o++)this.lineOffset(t,e[o],i,n,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}},{key:"lineOffset",value:function(t,e,i,n,r,a){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+a[1],a[1]+=r,e}}]),t}(),dr=["text","maxLineWidth","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak"].concat(b(Ji)),cr=function(t){u(n,t);var i=p(n);function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return a(this,n),(t=i.call(this,e)).type="text",t.numberType=Ln,t.cache={},t}return o(n,[{key:"font",get:function(){var t=vi(this).text;return this._font||(this._font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);var n=t.fontStyle,r=void 0===n?e.fontStyle:n,a=t.fontVariant,s=void 0===a?e.fontVariant:a,o=t.fontWeight,l=void 0===o?e.fontWeight:o,u=t.fontSize,h=void 0===u?e.fontSize:u,d=t.fontFamily;return(r?r+" ":"")+(s?s+" ":"")+(l?l+" ":"")+h*i+"px "+((void 0===d?e.fontFamily:d)||"sans-serif")}(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,i=vi(this).text;if(!Array.isArray(e.text)){var n=e.maxLineWidth,r=void 0===n?i.maxLineWidth:n;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}}},{key:"clipedWidth",get:function(){if(!Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=vi(this).text,e=this.attribute;if(!Array.isArray(e.text)){var i=e.maxLineWidth,n=void 0===i?t.maxLineWidth:i;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),this.clipedText!==e.text.toString())}}},{key:"multilineLayout",get:function(){if(Array.isArray(this.attribute.text))return this.tryUpdateAABBBounds(),this.cache.layoutData}},{key:"isValid",value:function(){return g(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=vi(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=He.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),n=this.attribute.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Li(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"updateWrapAABBBounds",value:function(t){var i,n,r,a,s=vi(this).text,o=this.attribute,l=o.fontFamily,u=void 0===l?s.fontFamily:l,h=o.textAlign,d=void 0===h?s.textAlign:h,c=o.textBaseline,f=void 0===c?s.textBaseline:c,v=o.fontSize,p=void 0===v?s.fontSize:v,g=o.ellipsis,y=void 0===g?s.ellipsis:g,b=o.maxLineWidth,m=o.stroke,x=void 0===m?s.stroke:m,_=o.lineWidth,A=void 0===_?s.lineWidth:_,k=o.wordBreak,B=void 0===k?s.wordBreak:k,w=o.fontWeight,S=void 0===w?s.fontWeight:w,T=o.ignoreBuf,C=void 0===T?s.ignoreBuf:T,E=o.heightLimit,M=void 0===E?0:E,P=o.lineClamp,L=null!==(i=Ui(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==i?i:this.attribute.fontSize||s.fontSize,O=C?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var I=this.cache.layoutData.bbox;return this._AABBBounds.set(I.xOffset,I.yOffset,I.xOffset+I.width,I.yOffset+I.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}var R=He.graphicUtil.textMeasure,j=new hr(u,{fontSize:p,fontWeight:S,fontFamily:u},R),D=e.isArray(t)?t.map((function(t){return t.toString()})):[t.toString()],N=[],U=[0,0],z=1/0;if(M>0&&(z=Math.max(Math.floor(M/L),1)),P&&(z=Math.min(z,P)),"number"==typeof b&&b!==1/0){if(b>0)for(var H=0;H<D.length;H++){var V=D[H],W=!0;if(H===z-1){var F=j.textMeasure.clipTextWithSuffix(V,j.textOptions,b,y,!1);N.push({str:F.str,width:F.width});break}var G=j.textMeasure.clipText(V,j.textOptions,b,"break-word"===B);if(""!==V&&""===G.str){if(y){var $=j.textMeasure.clipTextWithSuffix(V,j.textOptions,b,y,!1);G.str=null!==(r=$.str)&&void 0!==r?r:"",G.width=null!==(a=$.width)&&void 0!==a?a:0}else G.str="",G.width=0;W=!1}if(N.push({str:G.str,width:G.width}),G.str.length===V.length);else if(W){var Y=V.substring(G.str.length);D.splice(H+1,0,Y)}}var X=0;N.forEach((function(t){X=Math.max(X,t.width)})),U[0]=X}else{for(var q,Z,K=0,J=0,Q=D.length;J<Q;J++){if(J===z-1){var tt=j.textMeasure.clipTextWithSuffix(D[J],j.textOptions,b,y,!1);N.push({str:tt.str,width:tt.width}),K=Math.max(K,tt.width);break}Z=D[J],q=j.textMeasure.measureTextWidth(Z,j.textOptions,"break-word"===B),K=Math.max(K,q),N.push({str:Z,width:q})}U[0]=K}U[1]=N.length*(L+O);var et={xOffset:0,yOffset:0,width:U[0],height:U[1]};j.LayoutBBox(et,d,f);var it=j.layoutWithBBox(et,N,d,f,L);return this.cache.layoutData=it,this.clearUpdateShapeTag(),this._AABBBounds.set(et.xOffset,et.yOffset,et.xOffset+et.width,et.yOffset+et.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"updateSingallineAABBBounds",value:function(t){var e=vi(this).text,i=this.attribute.direction;return"horizontal"===(void 0===i?e.direction:i)?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t)}},{key:"updateMultilineAABBBounds",value:function(t){var e=vi(this).text,i=this.attribute.direction;return"horizontal"===(void 0===i?e.direction:i)?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t)}},{key:"updateHorizontalSinglelineAABBBounds",value:function(t){var e,i,n,r,a=vi(this).text,s=He.graphicUtil.textMeasure,o=this.attribute,l=o.maxLineWidth,u=void 0===l?a.maxLineWidth:l,h=o.ellipsis,d=void 0===h?a.ellipsis:h,c=o.textAlign,f=void 0===c?a.textAlign:c,v=o.textBaseline,p=void 0===v?a.textBaseline:v,g=o.fontFamily,y=void 0===g?a.fontFamily:g,b=o.fontSize,m=void 0===b?a.fontSize:b,x=o.fontWeight,_=void 0===x?a.fontWeight:x,A=o.stroke,k=void 0===A?a.stroke:A,B=o.lineWidth,w=void 0===B?a.lineWidth:B,S=o.ignoreBuf,T=void 0===S?a.ignoreBuf:S,C=o.whiteSpace,E=void 0===C?a.whiteSpace:C,M=o.suffixPosition,P=void 0===M?a.suffixPosition:M;if("normal"===E)return this.updateWrapAABBBounds(t);var L=T?0:Math.max(2,.075*m),O=o.fontSize||a.fontSize,I=null!==(e=Ui(o.lineHeight,O))&&void 0!==e?e:O+L;if(!this.shouldUpdateShape()&&this.cache){var R=lr(f,n=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0),j=ur(p,I,m);return this._AABBBounds.set(R,j,R+n,j+I),k&&this._AABBBounds.expand(w/2),this._AABBBounds}if(Number.isFinite(u)){if(d){var D=!0===d?a.ellipsis:d,N=s.clipTextWithSuffix(t.toString(),{fontSize:m,fontWeight:_,fontFamily:y},u,D,!1,P);r=N.str,n=N.width}else{var U=s.clipText(t.toString(),{fontSize:m,fontWeight:_,fontFamily:y},u,!1);r=U.str,n=U.width}this.cache.clipedText=r,this.cache.clipedWidth=n}else n=s.measureTextWidth(t.toString(),{fontSize:m,fontWeight:_,fontFamily:y}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=n;this.clearUpdateShapeTag();var z=lr(f,n),H=I;He.global&&He.global.isSafari()&&(H+=.2*m);var V=ur(p,H,m,L);return this._AABBBounds.set(z,V,z+n,V+H),k&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"getBaselineMapAlign",value:function(){return n.baselineMapAlign}},{key:"getAlignMapBaseline",value:function(){return n.alignMapBaseline}},{key:"updateVerticalSinglelineAABBBounds",value:function(t){var e,i,r,a,s=vi(this).text,o=He.graphicUtil.textMeasure,l=this.attribute,u=l.ignoreBuf,h=(void 0===u?s.ignoreBuf:u)?0:2,d=l.maxLineWidth,c=void 0===d?s.maxLineWidth:d,f=l.ellipsis,v=void 0===f?s.ellipsis:f,p=l.fontSize,g=void 0===p?s.fontSize:p,y=l.fontWeight,b=void 0===y?s.fontWeight:y,m=l.fontFamily,x=void 0===m?s.fontFamily:m,_=l.stroke,A=void 0===_?s.stroke:_,k=l.lineWidth,B=void 0===k?s.lineWidth:k,w=l.verticalMode,S=void 0===w?s.verticalMode:w,T=l.suffixPosition,C=void 0===T?s.suffixPosition:T,E=null!==(e=Ui(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==e?e:(l.fontSize||s.fontSize)+h,M=l.textAlign,P=void 0===M?s.textAlign:M,L=l.textBaseline,O=void 0===L?s.textBaseline:L;if(!S){var I=P;P=null!==(i=n.baselineMapAlign[O])&&void 0!==i?i:"left",O=null!==(r=n.alignMapBaseline[I])&&void 0!==r?r:"top"}if(!this.shouldUpdateShape()&&this.cache){var R=lr(P,a=this.cache.clipedWidth),j=ur(O,E,g);return this._AABBBounds.set(j,R,j+E,R+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}var D=[xn(t.toString())];if(Number.isFinite(c)){if(v){var N=!0===v?s.ellipsis:v,U=o.clipTextWithSuffixVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},c,N,!1,C);D=[U.verticalList],a=U.width}else{var z=o.clipTextVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},c,!1);D=[z.verticalList],a=z.width}this.cache.verticalList=D,this.cache.clipedWidth=a}else a=0,D[0].forEach((function(t){var e=t.direction===yn.HORIZONTAL?g:o.measureTextWidth(t.text,{fontSize:g,fontWeight:b,fontFamily:x});a+=e,t.width=e})),this.cache.verticalList=D,this.cache.clipedWidth=a;this.clearUpdateShapeTag();var H=lr(P,a),V=ur(O,E,g);return this._AABBBounds.set(V,H,V+E,H+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}},{key:"updateHorizontalMultilineAABBBounds",value:function(t){var e,i,n=vi(this).text,r=this.attribute,a=r.fontFamily,s=void 0===a?n.fontFamily:a,o=r.textAlign,l=void 0===o?n.textAlign:o,u=r.textBaseline,h=void 0===u?n.textBaseline:u,d=r.fontSize,c=void 0===d?n.fontSize:d,f=r.fontWeight,v=void 0===f?n.fontWeight:f,p=r.ellipsis,g=void 0===p?n.ellipsis:p,y=r.maxLineWidth,b=r.stroke,m=void 0===b?n.stroke:b,x=r.lineWidth,_=void 0===x?n.lineWidth:x,A=r.whiteSpace,k=void 0===A?n.whiteSpace:A,B=r.suffixPosition,w=void 0===B?n.suffixPosition:B,S=null!==(e=Ui(r.lineHeight,r.fontSize||n.fontSize))&&void 0!==e?e:r.fontSize||n.fontSize;if("normal"===k)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var T=this.cache.layoutData.bbox;return this._AABBBounds.set(T.xOffset,T.yOffset,T.xOffset+T.width,T.yOffset+T.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}var C=He.graphicUtil.textMeasure,E=new hr(s,{fontSize:c,fontWeight:v,fontFamily:s},C).GetLayoutByLines(t,l,h,S,!0===g?n.ellipsis:g||void 0,!1,y,w),M=E.bbox;return this.cache.layoutData=E,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"updateVerticalMultilineAABBBounds",value:function(t){var i,r,a,s,o=vi(this).text,l=He.graphicUtil.textMeasure,u=this.attribute,h=u.ignoreBuf,d=(void 0===h?o.ignoreBuf:h)?0:2,c=u.maxLineWidth,f=void 0===c?o.maxLineWidth:c,v=u.ellipsis,p=void 0===v?o.ellipsis:v,g=u.fontFamily,y=void 0===g?o.fontFamily:g,b=u.fontSize,m=void 0===b?o.fontSize:b,x=u.fontWeight,_=void 0===x?o.fontWeight:x,A=u.stroke,k=void 0===A?o.stroke:A,B=u.lineWidth,w=void 0===B?o.lineWidth:B,S=u.verticalMode,T=void 0===S?o.verticalMode:S,C=u.suffixPosition,E=void 0===C?o.suffixPosition:C,M=null!==(i=Ui(u.lineHeight,u.fontSize||o.fontSize))&&void 0!==i?i:(u.fontSize||o.fontSize)+d,P=u.textAlign,L=void 0===P?o.textAlign:P,O=u.textBaseline,I=void 0===O?o.textBaseline:O;if(!T){var R=L;L=null!==(r=n.baselineMapAlign[I])&&void 0!==r?r:"left",I=null!==(a=n.alignMapBaseline[R])&&void 0!==a?a:"top"}if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((function(t){var i=t.reduce((function(t,e){return t+e.width}),0);s=e.max(i,s)}));var j=lr(L,s),D=this.cache.verticalList.length*M,N=ur(I,D,m);return this._AABBBounds.set(N,j,N+D,j+s),k&&this._AABBBounds.expand(w/2),this._AABBBounds}var U=t.map((function(t){return xn(t.toString())}));U.forEach((function(t,e){if(Number.isFinite(f))if(p){var i=!0===p?o.ellipsis:p,n=l.clipTextWithSuffixVertical(t,{fontSize:m,fontWeight:_,fontFamily:y},f,i,!1,E);U[e]=n.verticalList,s=n.width}else{var r=l.clipTextVertical(t,{fontSize:m,fontWeight:_,fontFamily:y},f,!1);U[e]=r.verticalList,s=r.width}else s=0,t.forEach((function(t){var e=t.direction===yn.HORIZONTAL?m:l.measureTextWidth(t.text,{fontSize:m,fontWeight:_,fontFamily:y});s+=e,t.width=e}))})),this.cache.verticalList=U,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((function(t){var i=t.reduce((function(t,e){return t+e.width}),0);s=e.max(i,s)}));var z=lr(L,s),H=this.cache.verticalList.length*M,V=ur(I,H,m);return this._AABBBounds.set(V,z,V+H,z+s),k&&this._AABBBounds.expand(w/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return vi(this).text[t]}},{key:"needUpdateTags",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dr;return g(h(n.prototype),"needUpdateTags",this).call(this,t,e)}},{key:"needUpdateTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dr;return g(h(n.prototype),"needUpdateTag",this).call(this,t,e)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(an);cr.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},rn),cr.baselineMapAlign={top:"left",bottom:"right",middle:"center"},cr.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var fr=["heightLimit","lineClamp"],vr=function(t){u(n,t);var i=p(n);function n(){return a(this,n),i.apply(this,arguments)}return o(n,[{key:"_isValid",value:function(){var t=this.attribute.text;return e.isArray(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,i,n,r,a=vi(this).text,s=this.attribute,o=s.fontFamily,l=void 0===o?a.fontFamily:o,u=s.textAlign,h=void 0===u?a.textAlign:u,d=s.textBaseline,c=void 0===d?a.textBaseline:d,f=s.fontSize,v=void 0===f?a.fontSize:f,p=s.ellipsis,g=void 0===p?a.ellipsis:p,y=s.maxLineWidth,b=s.stroke,m=void 0===b?a.stroke:b,x=s.lineWidth,_=void 0===x?a.lineWidth:x,A=s.wordBreak,k=void 0===A?a.wordBreak:A,B=s.fontWeight,w=void 0===B?a.fontWeight:B,S=s.ignoreBuf,T=void 0===S?a.ignoreBuf:S,C=s.heightLimit,E=void 0===C?0:C,M=s.lineClamp,P=null!==(e=Ui(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,L=T?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var O=this.cache.layoutData.bbox;return this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}var I=He.graphicUtil.textMeasure,R=new hr(l,{fontSize:v,fontWeight:w,fontFamily:l},I),j=t.map((function(t){return t.toString()})),D=[],N=[0,0],U=1/0;if(E>0&&(U=Math.max(Math.floor(E/P),1)),M&&(U=Math.min(U,M)),"number"==typeof y&&y!==1/0){if(y>0)for(var z=0;z<j.length;z++){var H=j[z],V=!0;if(z===U-1){var W=R.textMeasure.clipTextWithSuffix(H,R.textOptions,y,g,!1);D.push({str:W.str,width:W.width});break}var F=R.textMeasure.clipText(H,R.textOptions,y,"break-word"===k);if(""!==H&&""===F.str){if(g){var G=R.textMeasure.clipTextWithSuffix(H,R.textOptions,y,g,!1);F.str=null!==(n=G.str)&&void 0!==n?n:"",F.width=null!==(r=G.width)&&void 0!==r?r:0}else F.str="",F.width=0;V=!1}if(D.push({str:F.str,width:F.width}),F.str.length===H.length);else if(V){var $=H.substring(F.str.length);j.splice(z+1,0,$)}}var Y=0;D.forEach((function(t){Y=Math.max(Y,t.width)})),N[0]=Y}else{for(var X,q,Z=0,K=0,J=j.length;K<J;K++){if(K===U-1){var Q=R.textMeasure.clipTextWithSuffix(j[K],R.textOptions,y,g,!1);D.push({str:Q.str,width:Q.width}),Z=Math.max(Z,Q.width);break}q=j[K],X=R.textMeasure.measureTextWidth(q,R.textOptions,"break-word"===k),Z=Math.max(Z,X),D.push({str:q,width:X})}N[0]=Z}N[1]=D.length*(P+L);var tt={xOffset:0,yOffset:0,width:N[0],height:N[1]};R.LayoutBBox(tt,h,c);var et=R.layoutWithBBox(tt,D,h,c,P);return this.cache.layoutData=et,this.clearUpdateShapeTag(),this._AABBBounds.set(tt.xOffset,tt.yOffset,tt.xOffset+tt.width,tt.yOffset+tt.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<fr.length;e++){var i=fr[e];if(-1!==t.indexOf(i))return!0}return g(h(n.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<fr.length;e++)if(t===fr[e])return!0;return g(h(n.prototype),"needUpdateTag",this).call(this,t)}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(cr),pr=function(){function t(){a(this,t)}return o(t,[{key:"bounds",value:function(t,i){if(e.isNumber(t)){var n=t/2;i.x1=-n,i.x2=n,i.y1=-n,i.y2=n}else i.x1=-t[0]/2,i.x2=t[0]/2,i.y1=-t[1]/2,i.y2=t[1]/2}}]),t}();function gr(t,i,n,r,a){return a?t.arc(n,r,i,0,e.tau,!1,a):t.arc(n,r,i,0,e.tau),!1}var yr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="circle",t.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return gr(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return gr(t,e/2+r,i,n,a)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," a ").concat(r,",").concat(r," 0 1,0 ").concat(2*r,",0 a ").concat(r,",").concat(r," 0 1,0 -").concat(2*r,",0")}}]),i}(pr),br=new yr;var mr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="cross",t.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",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,e/6,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return function(t,e,i,n,r,a){return t.moveTo(-3*e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-e+n-r,a),t.lineTo(-e+i-r,-3*e+n-r,a),t.lineTo(e+i+r,-3*e+n-r,a),t.lineTo(e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,-e+n-r,a),t.lineTo(3*e+i+r,e+n+r,a),t.lineTo(e+i+r,e+n+r,a),t.lineTo(e+i+r,3*e+n+r,a),t.lineTo(-e+i-r,3*e+n+r,a),t.lineTo(-e+i-r,e+n+r,a),t.lineTo(-3*e+i-r,e+n+r,a),t.closePath(),!0}(t,e/6,i,n,r,a)}}]),i}(pr),xr=new mr;function _r(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Ar=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="diamond",t.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return _r(t,e/2,i,n,r)}},{key:"drawFitDir",value:function(t,e,i,n,r){return _r(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return _r(t,e/2+r,i,n,a)}}]),i}(pr),kr=new Ar;function Br(t,e,i,n){var r=2*e;return t.rect(i-e,n-e,r,r),!1}var wr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="square",t.pathStr="M-0.5,-0.5h1v1h-1Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Br(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Br(t,e/2+r,i,n)}}]),i}(pr),Sr=new wr;var Tr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleUp",t.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(i+e,e+n),t.lineTo(i-e,e+n),t.lineTo(i,n-e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(pr),Cr=new Tr,Er=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangle",t}return o(i)}(Tr),Mr=new Er,Pr=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),Lr=Math.sin(e.tau/10)*Pr,Or=-Math.cos(e.tau/10)*Pr;function Ir(t,i,n,r){var a=Lr*i,s=Or*i;t.moveTo(n,-i+r),t.lineTo(a+n,s+r);for(var o=1;o<5;++o){var l=e.tau*o/5,u=Math.cos(l),h=Math.sin(l);t.lineTo(h*i+n,-u*i+r),t.lineTo(u*a-h*s+n,h*a+u*s+r)}return t.closePath(),!0}var Rr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="star",t.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Ir(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ir(t,e/2+r,i,n)}}]),i}(pr),jr=new Rr,Dr=e.sqrt(3);function Nr(t,e,i,n){var r=e,a=r/Dr,s=a/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(a/2+i,n),t.lineTo(s/2+i,n),t.lineTo(s/2+i,o+n),t.lineTo(-s/2+i,o+n),t.lineTo(-s/2+i,n),t.lineTo(-a/2+i,n),t.closePath(),!0}var Ur=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow",t.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",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Nr(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Nr(t,e/2+r,i,n)}}]),i}(pr),zr=new Ur;function Hr(t,e,i,n){var r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Vr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="wedge",t.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Hr(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Hr(t,e/2+r,i,n)}}]),i}(pr),Wr=new Vr;function Fr(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Gr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="stroke",t.pathStr="",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Fr(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Fr(t,e/2+r,i,n)}}]),i}(pr),$r=new Gr,Yr=-.5,Xr=e.sqrt(3)/2,qr=1/e.sqrt(12);function Zr(t,e,i,n){var r=e/2,a=e*qr,s=r,o=e*qr+e,l=-s,u=o;return t.moveTo(r+i,a+n),t.lineTo(s+i,o+n),t.lineTo(l+i,u+n),t.lineTo(Yr*r-Xr*a+i,Xr*r+Yr*a+n),t.lineTo(Yr*s-Xr*o+i,Xr*s+Yr*o+n),t.lineTo(Yr*l-Xr*u+i,Xr*l+Yr*u+n),t.lineTo(Yr*r+Xr*a+i,Yr*a-Xr*r+n),t.lineTo(Yr*s+Xr*o+i,Yr*o-Xr*s+n),t.lineTo(Yr*l+Xr*u+i,Yr*u-Xr*l+n),t.closePath(),!1}var Kr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="wye",t.pathStr="M4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,-4.51351666838205,0A4.51351666838205,4.51351666838205,0,1,1,4.51351666838205,0",t}return o(i,[{key:"draw",value:function(t,e,i,n){return Zr(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Zr(t,e/2+r,i,n)}}]),i}(pr),Jr=new Kr;var Qr=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleLeft",t.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(e+i,e+n),t.lineTo(e+i,n-e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(pr),ta=new Qr;var ea=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleRight",t.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,e+n),t.lineTo(e+i,n),t.lineTo(i-e,n-e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(pr),ia=new ea;var na=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="triangleDown",t.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return function(t,e,i,n){return t.moveTo(i-e,n-e),t.lineTo(i+e,n-e),t.lineTo(i,n+e),t.closePath(),!0}(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}(t,e/2,i,n,r)}}]),i}(pr),ra=new na,aa=e.sqrt(3);function sa(t,e,i,n){var r=e*aa;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var oa=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return o(i,[{key:"draw",value:function(t,e,i,n){return sa(t,e/2/aa,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return sa(t,e/2/aa+r,i,n)}}]),i}(Tr),la=new oa;function ua(t,e,i,n){var r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var ha=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Left",t.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ua(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ua(t,e/4+r,i,n)}}]),i}(pr),da=new ha;function ca(t,e,i,n){var r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var fa=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Right",t.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ca(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ca(t,e/4+r,i,n)}}]),i}(pr),va=new fa;function pa(t,e,i,n){var r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var ga=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Up",t.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25",t}return o(i,[{key:"draw",value:function(t,e,i,n){return pa(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return pa(t,e/4+r,i,n)}}]),i}(pr),ya=new ga;function ba(t,e,i,n){var r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var ma=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="arrow2Down",t.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25",t}return o(i,[{key:"draw",value:function(t,e,i,n){return ba(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ba(t,e/4+r,i,n)}}]),i}(pr),xa=new ma;function _a(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var Aa=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="lineV",t.pathStr="M0,-0.5L0,0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return _a(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return _a(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e,", ").concat(i-r," L ").concat(e,",").concat(i+r)}}]),i}(pr),ka=new Aa;function Ba(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var wa=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="lineH",t.pathStr="M-0.5,0L0.5,0",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return Ba(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Ba(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i," L ").concat(e+r,",").concat(i)}}]),i}(pr),Sa=new wa;function Ta(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var Ca=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).type="close",t.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return Ta(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Ta(t,e/2+r,i,n)}},{key:"drawToSvgPath",value:function(t,e,i,n){var r=t/2;return"M ".concat(e-r,", ").concat(i-r," L ").concat(e+r,",").concat(i+r," M ").concat(e+r,", ").concat(i-r," L ").concat(e-r,",").concat(i+r)}}]),i}(pr),Ea=new Ca;function Ma(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function Pa(t,e,i,n){var r=e,a=e/2;return t.rect(i-r/2,n-a/2,r,a),!1}var La=function(t){u(n,t);var i=p(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).type="rect",t.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",t}return o(n,[{key:"draw",value:function(t,i,n,r){return e.isNumber(i)?Pa(t,i,n,r):Ma(t,i,n,r)}},{key:"drawOffset",value:function(t,i,n,r,a){return e.isNumber(i)?Pa(t,i+2*a,n,r):Ma(t,[i[0]+2*a,i[1]+2*a],n,r)}}]),n}(pr),Oa=new La,Ia=new e.AABBBounds,Ra=function(){function t(i,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];a(this,t),this.pathStr="",this.type=i,e.isArray(n)?this.svgCache=n:this.path=n,this.isSvg=r}return o(t,[{key:"drawOffset",value:function(t,e,i,n,r,a,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),zt(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(zt(this.path.commandList,t,i,n,e+r,e+r),!1)}},{key:"draw",value:function(t,e,i,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),zt(r.path.commandList,t,i,n,e,e),a&&a(r.path,r.attribute)})),!1):(zt(this.path.commandList,t,i,n,e,e),!1)}},{key:"bounds",value:function(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((function(i){var n=i.path;Ia.x1=n.bounds.x1*t,Ia.y1=n.bounds.y1*t,Ia.x2=n.bounds.x2*t,Ia.y2=n.bounds.y2*t,e.union(Ia)}))}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)}}]),t}(),ja={};[br,xr,kr,Sr,la,Mr,jr,zr,Wr,$r,Jr,ta,ia,Cr,ra,da,va,ya,xa,Oa,ka,Sa,Ea].forEach((function(t){ja[t.type]=t}));var Da={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},Na=new e.AABBBounds,Ua=["symbolType","size"].concat(b(Ji)),za=function(t){u(n,t);var i=p(n);function n(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return a(this,n),(t=i.call(this,e)).type="symbol",t.numberType=Pn,t}return o(n,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return g(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return e.isArray(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t,i=vi(this).symbol,r=this.attribute.symbolType,a=void 0===r?i.symbolType:r,s=ja[a];if(s)return this._parsedPath=s,s;if(s=n.userSymbolMap[a])return this._parsedPath=s,s;if(!0===((t=a=Da[a]||a).startsWith("<svg")||t.startsWith("<?xml"))){var o=(new pn).parse(a).svg;if(!o)return null;var l=e.isArray(o.path)?o.path:[o.path];Na.clear();var u=[];l.forEach((function(t){var e=(new ge).fromString(t.d),i={};jn.forEach((function(e){t[e]&&(i[Rn[e]]=t[e])})),u.push({path:e,attribute:i}),Na.union(e.bounds)}));var h=Na.width(),d=Na.height(),c=1/e.max(h,d);return u.forEach((function(t){return t.path.transform(0,0,c,c)})),this._parsedPath=new Ra(a,u,!0),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}var f=(new ge).fromString(a),v=f.bounds.width(),p=f.bounds.height(),g=1/e.max(v,p);return f.transform(0,0,g,g),this._parsedPath=new Ra(a,f),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=vi(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=He.graphicService.updateSymbolAABBBounds(i,vi(this).symbol,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=Li(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return vi(this).symbol[t]}},{key:"needUpdateTags",value:function(t){return g(h(n.prototype),"needUpdateTags",this).call(this,t,Ua)}},{key:"needUpdateTag",value:function(t){return g(h(n.prototype),"needUpdateTag",this).call(this,t,Ua)}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),i=this.attribute.size,n=e.isArray(i)?i:[i,i];return t.path?(new ge).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new ge).fromString(t.pathStr,0,0,n[0],n[1])}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(an);za.userSymbolMap={},za.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},rn);var Ha=["width","x1","y1","height","cornerRadius"].concat(b(Ji)),Va=function(t){u(i,t);var e=p(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="rect",n.numberType=En,n}return o(i,[{key:"isValid",value:function(){return g(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){return!0}},{key:"doUpdateAABBBounds",value:function(){var t=vi(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=He.graphicService.updateRectAABBBounds(e,vi(this).rect,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Li(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return vi(this).rect[t]}},{key:"needUpdateTags",value:function(t){return g(h(i.prototype),"needUpdateTags",this).call(this,t,Ha)}},{key:"needUpdateTag",value:function(t){return g(h(i.prototype),"needUpdateTag",this).call(this,t,Ha)}},{key:"toCustomPath",value:function(){throw new Error("暂不支持")}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(an);Va.NOWORK_ANIMATE_ATTR=rn;var Wa=["width","height","image"].concat(b(Ji)),Fa=function(t){u(i,t);var e=p(i);function i(t){var n;return a(this,i),(n=e.call(this,t)).type="image",n.numberType=Tn,n.loadImage(n.attribute.image),n}return o(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0},set:function(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}},{key:"height",get:function(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0},set:function(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}},{key:"repeatX",get:function(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}},{key:"repeatY",get:function(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"},set:function(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}},{key:"image",get:function(){return this.attribute.image},set:function(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}},{key:"imageLoadSuccess",value:function(t,e,n){var r=this;g(h(i.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var n=this;g(h(i.prototype),"imageLoadFail",this).call(this,t,(function(){n.failCallback&&n.failCallback()}))}},{key:"doUpdateAABBBounds",value:function(){var t=vi(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=He.graphicService.updateImageAABBBounds(e,vi(this).image,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=Li(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ue[t]}},{key:"needUpdateTags",value:function(t){return g(h(i.prototype),"needUpdateTags",this).call(this,t,Wa)}},{key:"needUpdateTag",value:function(t){return g(h(i.prototype),"needUpdateTag",this).call(this,t,Wa)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(an);Fa.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},rn);var Ga=function(){function t(){a(this,t)}return o(t,[{key:"updateBounds",value:function(t,e,i,n){var r=t.outerBorder,a=t.shadowBlur,s=void 0===a?e.shadowBlur:a;if(r){var o=e.outerBorder,l=r.distance,u=void 0===l?o.distance:l,h=r.lineWidth,d=void 0===h?o.lineWidth:h;i.expand(u+(s+d)/2)}return i}}]),t}(),$a=function(t){u(i,t);var e=p(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"updateBounds",value:function(t,e,i,n){var r=t.outerBorder,a=t.shadowBlur,s=void 0===a?e.shadowBlur:a,o=t.strokeBoundsBuffer,l=void 0===o?e.strokeBoundsBuffer:o;if(r){var u=e.outerBorder,h=r.distance,d=void 0===h?u.distance:h,c=r.lineWidth;gn(i,d+(s+(void 0===c?u.lineWidth:c))/2,!0,l)}return i}}]),i}(Ga);var Ya=function(){function t(){a(this,t),this.pools=[]}return o(t,[{key:"allocate",value:function(t,i,n,r,a,s){if(!this.pools.length)return new e.Matrix(t,i,n,r,a,s);var o=this.pools.pop();return o.a=t,o.b=i,o.c=n,o.d=r,o.e=a,o.f=s,o}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new e.Matrix(t.a,t.b,t.c,t.d,t.e,t.f);var i=this.pools.pop();return i.a=t.a,i.b=t.b,i.c=t.c,i.d=t.d,i.e=t.e,i.f=t.f,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}(),Xa=function(){function t(){a(this,t),this.pools=[]}return o(t,[{key:"allocate",value:function(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];var e=this.pools.pop();return t.identity(e),e}},{key:"allocateByObj",value:function(t){var 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(var i=0;i<e.length;i++)e[i]=t[i];return e}},{key:"free",value:function(t){t&&this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}],[{key:"identity",value:function(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}}]),t}(),qa=new Ya,Za=new Xa,Ka=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ja=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qa=function(t,e){return function(i,n){e(i,n,t)}};function ts(t,e,i){var n,r,a,s,o,l,u,h,d,c,f,v,p=i[0],g=i[1],y=i[2];return e===t?(t[12]=e[0]*p+e[4]*g+e[8]*y+e[12],t[13]=e[1]*p+e[5]*g+e[9]*y+e[13],t[14]=e[2]*p+e[6]*g+e[10]*y+e[14],t[15]=e[3]*p+e[7]*g+e[11]*y+e[15]):(n=e[0],r=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],c=e[9],f=e[10],v=e[11],t[0]=n,t[1]=r,t[2]=a,t[3]=s,t[4]=o,t[5]=l,t[6]=u,t[7]=h,t[8]=d,t[9]=c,t[10]=f,t[11]=v,t[12]=n*p+o*g+d*y+e[12],t[13]=r*p+l*g+c*y+e[13],t[14]=a*p+u*g+f*y+e[14],t[15]=s*p+h*g+v*y+e[15]),t}function es(t,e,i){var n=e[0],r=e[1],a=e[2],s=e[3],o=e[4],l=e[5],u=e[6],h=e[7],d=e[8],c=e[9],f=e[10],v=e[11],p=e[12],g=e[13],y=e[14],b=e[15],m=i[0],x=i[1],_=i[2],A=i[3];return t[0]=m*n+x*o+_*d+A*p,t[1]=m*r+x*l+_*c+A*g,t[2]=m*a+x*u+_*f+A*y,t[3]=m*s+x*h+_*v+A*b,m=i[4],x=i[5],_=i[6],A=i[7],t[4]=m*n+x*o+_*d+A*p,t[5]=m*r+x*l+_*c+A*g,t[6]=m*a+x*u+_*f+A*y,t[7]=m*s+x*h+_*v+A*b,m=i[8],x=i[9],_=i[10],A=i[11],t[8]=m*n+x*o+_*d+A*p,t[9]=m*r+x*l+_*c+A*g,t[10]=m*a+x*u+_*f+A*y,t[11]=m*s+x*h+_*v+A*b,m=i[12],x=i[13],_=i[14],A=i[15],t[12]=m*n+x*o+_*d+A*p,t[13]=m*r+x*l+_*c+A*g,t[14]=m*a+x*u+_*f+A*y,t[15]=m*s+x*h+_*v+A*b,t}function is(t,e,i){var n,r=e.attribute,a=r.x,s=void 0===a?i.x:a,o=r.y,l=void 0===o?i.y:o,u=r.z,h=void 0===u?i.z:u,d=r.dx,c=void 0===d?i.dx:d,f=r.dy,v=void 0===f?i.dy:f,p=r.dz,g=void 0===p?i.dz:p,y=r.scaleX,b=void 0===y?i.scaleX:y,m=r.scaleY,x=void 0===m?i.scaleY:m,_=r.scaleZ,A=void 0===_?i.scaleZ:_,k=r.alpha,B=void 0===k?i.alpha:k,w=r.beta,S=void 0===w?i.beta:w,T=r.angle,C=void 0===T?i.angle:T,E=r.anchor3d,M=void 0===E?e.attribute.anchor:E,P=r.anchor,L=[0,0,0];if(M){if("string"==typeof M[0]){var O=parseFloat(M[0])/100,I=e.AABBBounds;L[0]=I.x1+(I.x2-I.x1)*O}else L[0]=M[0];if("string"==typeof M[1]){var R=parseFloat(M[1])/100,j=e.AABBBounds;L[1]=j.x1+(j.x2-j.x1)*R}else L[1]=M[1];L[2]=null!==(n=M[2])&&void 0!==n?n: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),ts(t,t,[s+c,l+v,h+g]),ts(t,t,[L[0],L[1],L[2]]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],h=e[9],d=e[10],c=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]=a*r+u*n,t[5]=s*r+h*n,t[6]=o*r+d*n,t[7]=l*r+c*n,t[8]=u*r-a*n,t[9]=h*r-s*n,t[10]=d*r-o*n,t[11]=c*r-l*n}(t,t,S),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],s=e[1],o=e[2],l=e[3],u=e[8],h=e[9],d=e[10],c=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]=a*r-u*n,t[1]=s*r-h*n,t[2]=o*r-d*n,t[3]=l*r-c*n,t[8]=a*n+u*r,t[9]=s*n+h*r,t[10]=o*n+d*r,t[11]=l*n+c*r}(t,t,B),ts(t,t,[-L[0],-L[1],L[2]]),function(t,e,i){var n=i[0],r=i[1],a=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[b,x,A]),C){var D=Za.allocate(),N=[0,0];if(P){if("string"==typeof M[0]){var U=parseFloat(M[0])/100,z=e.AABBBounds;N[0]=z.x1+(z.x2-z.x1)*U}else N[0]=M[0];if("string"==typeof M[1]){var H=parseFloat(M[1])/100,V=e.AABBBounds;N[1]=V.x1+(V.x2-V.x1)*H}else N[1]=M[1]}ts(D,D,[N[0],N[1],0]),function(t,e,i){var n=Math.sin(i),r=Math.cos(i),a=e[0],s=e[1],o=e[2],l=e[3],u=e[4],h=e[5],d=e[6],c=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]=a*r+u*n,t[1]=s*r+h*n,t[2]=o*r+d*n,t[3]=l*r+c*n,t[4]=u*r-a*n,t[5]=h*r-s*n,t[6]=d*r-o*n,t[7]=c*r-l*n}(D,D,C),ts(D,D,[-N[0],-N[1],0]),es(t,t,D)}}var ns=function(){function t(i){a(this,t),this.creator=i,this.hooks={onAttributeUpdate:new it(["graphic"]),onSetStage:new it(["graphic","stage"]),onRemove:new it(["graphic"]),onRelease:new it(["graphic"]),onAddIncremental:new it(["graphic","group","stage"]),onClearIncremental:new it(["graphic","group","stage"]),beforeUpdateAABBBounds:new it(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new it(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new e.AABBBounds,this.tempAABBBounds2=new e.AABBBounds,this._rectBoundsContribitions=[new Ga],this._symbolBoundsContribitions=[new $a],this._circleBoundsContribitions=[new Ga],this._arcBoundsContribitions=[new Ga],this._pathBoundsContribitions=[new Ga]}return o(t,[{key:"onAttributeUpdate",value:function(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}},{key:"onSetStage",value:function(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}},{key:"onRemove",value:function(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}},{key:"onRelease",value:function(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}},{key:"onAddIncremental",value:function(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}},{key:"afterUpdateAABBBounds",value:function(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;var n=new wt(t);return zt(i.commandList,n,0,0),!0}},{key:"updateRectAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){var r=t.width,a=t.height,s=t.x1,o=t.y1,l=t.x,u=t.y;r=null!=r?r:s-l,a=null!=a?a:o-u,i.set(0,0,r||0,a||0)}var h=this.tempAABBBounds1,d=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),d.setValue(i.x1,i.y1,i.x2,i.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((function(r){r.updateBounds(t,e,h,n),i.union(h),h.setValue(d.x1,d.y1,d.x2,d.y2)})),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateGroupAABBBounds",value:function(t,e,i,n){var r=t.width,a=t.height,s=t.path,o=t.clip,l=void 0===o?e.clip:o;s&&s.length?s.forEach((function(t){i.union(t.AABBBounds)})):null!=r&&null!=a&&i.set(0,0,r,a),l||n.forEachChildren((function(t){i.union(t.AABBBounds)}));var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateGlyphAABBBounds",value:function(t,e,i,n){return this._validCheck(t,e,i,n)?(n.getSubGraphic().forEach((function(t){i.union(t.AABBBounds)})),i):i}},{key:"updateRichTextAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!n)return i;var r=t.width,a=void 0===r?e.width:r,s=t.height,o=void 0===s?e.height:s,l=t.maxWidth,u=void 0===l?e.maxWidth:l,h=t.maxHeight,d=void 0===h?e.maxHeight:h,c=t.textAlign,f=void 0===c?e.textAlign:c,v=t.textBaseline,p=void 0===v?e.textBaseline:v;if(a>0&&o>0)i.set(0,0,a,o);else{var g=n.getFrameCache().getActualSize(),y=g.width,b=g.height,m=a||y||0,x=o||b||0;x="number"==typeof d&&x>d?d:x||0,m="number"==typeof u&&m>u?u:m||0,i.set(0,0,m,x)}var _=0;switch(p){case"top":_=0;break;case"middle":_=-i.height()/2;break;case"bottom":_=-i.height()}var A=0;switch(f){case"left":A=0;break;case"center":A=-i.width()/2;break;case"right":A=-i.width()}i.translate(A,_);var k=this.tempAABBBounds1,B=this.tempAABBBounds2;return k.setValue(i.x1,i.y1,i.x2,i.y2),B.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateTextAABBBounds",value:function(t,i,n,r){if(!this._validCheck(t,i,n,r))return n;if(!r)return n;var a=r.attribute.text,s=void 0===a?i.text:a;Array.isArray(s)?r.updateMultilineAABBBounds(s):r.updateSingallineAABBBounds(s);var o=this.tempAABBBounds1,l=this.tempAABBBounds2;o.setValue(n.x1,n.y1,n.x2,n.y2),l.setValue(n.x1,n.y1,n.x2,n.y2);var u=t.scaleX,h=void 0===u?i.scaleX:u,d=t.scaleY,c=void 0===d?i.scaleY:d,f=t.shadowBlur,v=void 0===f?i.shadowBlur:f,p=t.strokeBoundsBuffer,g=void 0===p?i.strokeBoundsBuffer:p;v&&(gn(o,v/Math.abs(h+c),!0,g),n.union(o));return this.combindShadowAABBBounds(n,r),e.transformBoundsWithMatrix(n,n,r.transMatrix),n}},{key:"updatePathAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePathAABBBoundsImprecise(t,e,i,n);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((function(s){s.updateBounds(t,e,r,n),i.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)}));var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updatePathAABBBoundsImprecise",value:function(t,e,i,n){if(!n)return i;var r=n.getParsedPathShape();return i.union(r.getBounds()),i}},{key:"updatePyramid3dAABBBounds",value:function(t,e,i,n){if(!n)return i;var r=n.stage;if(!r||!r.camera)return i;n.findFace().vertices.forEach((function(t){var e=t[0],n=t[1];i.add(e,n)}));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updateArc3dAABBBounds",value:function(t,e,i,n){if(!n)return i;var r=n.stage;if(!r||!r.camera)return i;var a=t.outerRadius,s=void 0===a?e.outerRadius:a,o=t.height,l=s+(void 0===o?0:o);i.setValue(-l,-l,l,l);var u=this.tempAABBBounds1,h=this.tempAABBBounds2;return u.setValue(i.x1,i.y1,i.x2,i.y2),h.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"updatePolygonAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||this.updatePolygonAABBBoundsImprecise(t,e,i,n);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,i,n){var r=t.points;return(void 0===r?e.points:r).forEach((function(t){i.add(t.x,t.y)})),i}},{key:"updateLineAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i,n):this.updateLineAABBBoundsByPoints(t,e,i,n));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,s=i;return a.forEach((function(t){s.add(t.x,t.y)})),s}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,s=i;return a.forEach((function(t){t.points.forEach((function(t){s.add(t.x,t.y)}))})),s}},{key:"updateAreaAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;this.updatePathProxyAABBBounds(i,n)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i,n):this.updateAreaAABBBoundsByPoints(t,e,i,n));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(i.x1,i.y1,i.x2,i.y2),a.setValue(i.x1,i.y1,i.x2,i.y2);var s=t.lineJoin,o=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,i,e,"miter"===o,n),i}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,i,n){var r=t.points,a=void 0===r?e.points:r,s=i;return a.forEach((function(t){var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,i,n){var r=t.segments,a=void 0===r?e.segments:r,s=i;return a.forEach((function(t){t.points.forEach((function(t){var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}},{key:"updateCircleAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateCircleAABBBoundsImprecise(t,e,i,r):this.updateCircleAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;return a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)})),this.transformAABBBounds(t,i,e,!1,r),i}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,i,n){var r=t.radius,a=void 0===r?e.radius:r;return i.set(-a,-a,a,a),i}},{key:"updateCircleAABBBoundsAccurate",value:function(t,i,n,r){var a=t.startAngle,s=void 0===a?i.startAngle:a,o=t.endAngle,l=void 0===o?i.endAngle:o,u=t.radius,h=void 0===u?i.radius:u;return l-s>e.pi2-e.epsilon?n.set(-h,-h,h,h):Ri(s,l,h,n),n}},{key:"updateArcAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateArcAABBBoundsImprecise(t,e,i,r):this.updateArcAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)}));var o=t.lineJoin,l=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,i,e,"miter"===l,r),i}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,i,n){var r=t.outerRadius,a=void 0===r?e.outerRadius:r;return i.set(-a,-a,a,a),i}},{key:"updateArcAABBBoundsAccurate",value:function(t,i,n,r){var a=t.outerRadius,s=void 0===a?i.outerRadius:a,o=t.innerRadius,l=void 0===o?i.innerRadius:o;if(s<l){var u=s;s=l,l=u}var h=t.endAngle,d=void 0===h?i.endAngle:h,c=t.startAngle,f=void 0===c?i.startAngle:c;if(f>d){var v=f;f=d,d=v}return s<=e.epsilon?n.set(0,0,0,0):Math.abs(d-f)>e.pi2-e.epsilon?n.set(-s,-s,s,s):(Ri(f,d,s,n),Ri(f,d,l,n)),n}},{key:"updateSymbolAABBBounds",value:function(t,e,i,n,r){if(!this._validCheck(t,e,i,r))return i;this.updatePathProxyAABBBounds(i,r)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i,r):this.updateSymbolAABBBoundsAccurate(t,e,i,r));var a=this.tempAABBBounds1,s=this.tempAABBBounds2;a.setValue(i.x1,i.y1,i.x2,i.y2),s.setValue(i.x1,i.y1,i.x2,i.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((function(n){n.updateBounds(t,e,a,r),i.union(a),a.setValue(s.x1,s.y1,s.x2,s.y2)}));var o=t.lineJoin,l=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,i,e,"miter"===l,r),i}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,i,n,r){var a=t.size,s=void 0===a?i.size:a;if(e.isArray(s))n.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{var o=s/2;n.set(-o,-o,o,o)}return n}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,i,n){if(!n)return i;var r=t.size,a=void 0===r?e.size:r;return n.getParsedPath().bounds(a,i),i}},{key:"updateImageAABBBounds",value:function(t,e,i,n){if(!this._validCheck(t,e,i,n))return i;if(!this.updatePathProxyAABBBounds(i,n)){var r=t.width,a=void 0===r?e.width:r,s=t.height,o=void 0===s?e.height:s;i.set(0,0,a,o)}var l=this.tempAABBBounds1,u=this.tempAABBBounds2;return l.setValue(i.x1,i.y1,i.x2,i.y2),u.setValue(i.x1,i.y1,i.x2,i.y2),this.transformAABBBounds(t,i,e,!1,n),i}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var i=e.shadowRoot.AABBBounds;t.union(i)}}},{key:"transformAABBBounds",value:function(t,i,n,r,a){var s=t.scaleX,o=void 0===s?n.scaleX:s,l=t.scaleY,u=void 0===l?n.scaleY:l,h=t.stroke,d=void 0===h?n.stroke:h,c=t.shadowBlur,f=void 0===c?n.shadowBlur:c,v=t.lineWidth,p=void 0===v?n.lineWidth:v,g=t.strokeBoundsBuffer,y=void 0===g?n.strokeBoundsBuffer:g,b=this.tempAABBBounds1,m=this.tempAABBBounds2;d&&p&&(gn(b,p/Math.abs(o+u),r,y),i.union(b),b.setValue(m.x1,m.y1,m.x2,m.y2));if(f){var x=t.shadowOffsetX,_=void 0===x?n.shadowOffsetX:x,A=t.shadowOffsetY,k=void 0===A?n.shadowOffsetY:A;gn(b,f/Math.abs(o+u)*2+Math.max(_,k),r,y+1),i.union(b)}this.combindShadowAABBBounds(i,a);var B=!0,w=a.transMatrix;a&&a.isContainer&&(B=!(1===w.a&&0===w.b&&0===w.c&&1===w.d&&0===w.e&&0===w.f)),B&&e.transformBoundsWithMatrix(i,i,w)}},{key:"_validCheck",value:function(t,e,i,n){if(!n)return!0;if(!n.valid)return i.clear(),!1;var r=t.visible;return!!(void 0===r?e.visible:r)||(i.clear(),!1)}}]),t}();ns=Ka([j(),Qa(0,I(In)),Ja("design:paramtypes",[Object])],ns);var rs,as=new(function(){function t(){a(this,t),this.store=new Map}return o(t,[{key:"RegisterGraphicCreator",value:function(t,e){this.store.set(t,e),this[t]=e}},{key:"CreateGraphic",value:function(t,e){var i=this.store.get(t);return i?i(e):null}}]),t}());function ss(t){return rs||(rs=as.CreateGraphic("text",{})),rs.setAttributes(t),rs.AABBBounds}var os={x:0,y:0,z:0,lastModelMatrix:null},ls=function(){function t(){a(this,t)}return o(t,[{key:"init",value:function(t){var e=this;t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((function(t){return e._renderContribitions.push(t)})),this._renderContribitions.length&&(this._renderContribitions.sort((function(t,e){return e.order-t.order})),this._beforeRenderContribitions=this._renderContribitions.filter((function(t){return t.time===kt.beforeFillStroke})),this._afterRenderContribitions=this._renderContribitions.filter((function(t){return t.time===kt.afterFillStroke})))}},{key:"beforeRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}},{key:"afterRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}},{key:"valid",value:function(t,e,i,n){var r=t.attribute,a=r.fill,s=void 0===a?e.fill:a,o=r.background,l=r.stroke,u=void 0===l?e.stroke:l,h=r.opacity,d=void 0===h?e.opacity:h,c=r.fillOpacity,f=void 0===c?e.fillOpacity:c,v=r.lineWidth,p=void 0===v?e.lineWidth:v,g=r.strokeOpacity,y=void 0===g?e.strokeOpacity:g,b=r.visible,m=void 0===b?e.visible:b,x=nr(d,f,s),_=rr(d,y),A=er(s,o),k=ir(u,p);return!(!t.valid||!m)&&!(!A&&!k)&&!!(x||_||i||n||o)&&{fVisible:x,sVisible:_,doFill:A,doStroke:k}}},{key:"transform",value:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.attribute,a=r.x,s=void 0===a?e.x:a,o=r.y,l=void 0===o?e.y:o,u=r.z,h=void 0===u?e.z:u,d=r.scaleX,c=void 0===d?e.scaleX:d,f=r.scaleY,v=void 0===f?e.scaleY:f,p=r.angle,g=void 0===p?e.angle:p,y=r.postMatrix,b=i.modelMatrix,m=i.camera;os.x=s,os.y=l,os.z=h,os.lastModelMatrix=b;var x=m&&(n||function(t){var e=t.attribute,i=e.alpha,n=e.beta;return i||n}(t)),_=x?t.transMatrix.onlyTranslate()&&!y:1===c&&1===v&&0===g&&!y;if(x){var A=Za.allocate(),k=Za.allocate();is(k,t,e),es(A,b||A,k),os.x=0,os.y=0,os.z=0,i.modelMatrix=A,i.setTransform(1,0,0,1,0,0,!0),Za.free(k)}if(_&&!b){var B=t.getOffsetXY(e);os.x+=B.x,os.y+=B.y,os.z=h,i.setTransformForCurrent()}else if(x)os.x=0,os.y=0,os.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(m&&i.project){var w=t.getOffsetXY(e);os.x+=w.x,os.y+=w.y,this.transformWithoutTranslate(i,os.x,os.y,os.z,c,v,g)}else i.transformFromMatrix(t.transMatrix,!0),os.x=0,os.y=0,os.z=0;return os}},{key:"transformUseContext2d",value:function(t,e,i,n){var r=n.camera;if(this.camera=r,r){var a=t.AABBBounds,s=a.x2-a.x1,o=a.y2-a.y1,l=n.project(0,0,i),u=n.project(s,0,i),h=n.project(s,o,i),d={x:0,y:0},c={x:s,y:0},f={x:s,y:o};n.camera=null;var v=1/(d.x*(f.y-c.y)-c.x*f.y+f.x*c.y+(c.x-f.x)*d.y),p=-(d.y*(h.x-u.x)-c.y*h.x+f.y*u.x+(c.y-f.y)*l.x)*v,g=(c.y*h.y+d.y*(u.y-h.y)-f.y*u.y+(f.y-c.y)*l.y)*v,y=(d.x*(h.x-u.x)-c.x*h.x+f.x*u.x+(c.x-f.x)*l.x)*v,b=-(c.x*h.y+d.x*(u.y-h.y)-f.x*u.y+(f.x-c.x)*l.y)*v,m=(d.x*(f.y*u.x-c.y*h.x)+d.y*(c.x*h.x-f.x*u.x)+(f.x*c.y-c.x*f.y)*l.x)*v,x=(d.x*(f.y*u.y-c.y*h.y)+d.y*(c.x*h.y-f.x*u.y)+(f.x*c.y-c.x*f.y)*l.y)*v;n.setTransform(p,g,y,b,m,x,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,i,n){this.camera&&(n.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,i,n,r,a,s){var o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,a,!1),t.rotate(s,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}},{key:"_draw",value:function(t,e,i,n,r){var a=n.context;if(a){a.highPerformanceSave();var s=this.transform(t,e,a,i),o=s.x,l=s.y,u=s.z,h=s.lastModelMatrix;this.z=u,function(t,e,i,n,r,a,s,o){if(!t.pathProxy)return!1;var l=vi(t,null==a?void 0:a.theme)[t.type],u=t.attribute,h=u.fill,d=void 0===h?l.fill:h,c=u.stroke,f=void 0===c?l.stroke:c,v=u.opacity,p=void 0===v?l.opacity:v,g=u.fillOpacity,y=void 0===g?l.fillOpacity:g,b=u.lineWidth,m=void 0===b?l.lineWidth:b,x=u.strokeOpacity,_=void 0===x?l.strokeOpacity:x,A=u.visible,k=void 0===A?l.visible:A,B=nr(p,y,d),w=rr(p,_),S=er(d),T=ir(f,m);return!k||!S&&!T||!(B||w||s||o)||(e.beginPath(),zt(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),T&&(o?o(e,t.attribute,l):w&&(e.setStrokeStyle(t,t.attribute,i,n,l),e.stroke())),S&&(s?s(e,t.attribute,l):B&&(e.setCommonStyle(t,t.attribute,i,n,l),e.fill())),!0)}(t,a,o,l,0,r)||(this.drawShape(t,a,o,l,n,r),this.z=0,a.modelMatrix!==h&&Za.free(a.modelMatrix),a.modelMatrix=h),a.highPerformanceRestore()}}}]),t}();function us(t,i,n,r,a){if(!i||!0===i)return"black";var s,o;if(e.isArray(i))for(var l=0;l<i.length&&!(o=i[l]);l++);else o=i;return"string"==typeof o?o:("linear"===o.gradient?s=function(t,e,i){var n,r,a,s,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,u=i.AABBBounds;if(!u)return;var h=u.x2-u.x1,d=u.y2-u.y1,c=u.x1-o,f=u.y1-l;if(i.attribute){var v=i.attribute,p=v.scaleX,g=void 0===p?1:p,y=v.scaleY,b=void 0===y?1:y;if(g*b==0)return;h/=g,d/=b,c/=g,f/=b}var m=t.createLinearGradient(c+(null!==(n=e.x0)&&void 0!==n?n:0)*h,f+(null!==(r=e.y0)&&void 0!==r?r:0)*d,c+(null!==(a=e.x1)&&void 0!==a?a:1)*h,f+(null!==(s=e.y1)&&void 0!==s?s:0)*d);return e.stops.forEach((function(t){m.addColorStop(t.offset,t.color)})),m}(t,o,n,r,a):"conical"===o.gradient?s=function(t,e,i){var n,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=i.AABBBounds;if(!o)return;var l=o.x2-o.x1,u=o.y2-o.y1,h=o.x1-a,d=o.y1-s;if(i.attribute){var c=i.attribute,f=c.scaleX,v=void 0===f?1:f,p=c.scaleY,g=void 0===p?1:p;if(v*g==0)return;l/=v,u/=g,h/=v,d/=g}var y=t.createConicGradient(h+(null!==(n=e.x)&&void 0!==n?n:0)*l,d+(null!==(r=e.y)&&void 0!==r?r:0)*u,e.startAngle,e.endAngle);return e.stops.forEach((function(t){y.addColorStop(t.offset,t.color)})),y.GetPattern(l+h,u+d,void 0)}(t,o,n,r,a):"radial"===o.gradient&&(s=function(t,e,i){var n,r,a,s,o,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,d=i.AABBBounds;if(!d)return;var c=d.x2-d.x1,f=d.y2-d.y1,v=d.x1-u,p=d.y1-h;if(i.attribute){var g=i.attribute,y=g.scaleX,b=void 0===y?1:y,m=g.scaleY,x=void 0===m?1:m;if(b*x==0)return;v/=b,p/=x,c/=b,f/=x}var _=t.createRadialGradient(v+(null!==(n=e.x0)&&void 0!==n?n:.5)*c,p+(null!==(r=e.y0)&&void 0!==r?r:.5)*f,Math.max(c,f)*(null!==(a=e.r0)&&void 0!==a?a:0),v+(null!==(s=e.x1)&&void 0!==s?s:.5)*c,p+(null!==(o=e.y1)&&void 0!==o?o:.5)*f,Math.max(c,f)*(null!==(l=e.r1)&&void 0!==l?l:.5));return e.stops.forEach((function(t){_.addColorStop(t.offset,t.color)})),_}(t,o,n,r,a)),s||"orange")}var hs=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ds=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cs=function(t,e){return function(i,n){e(i,n,t)}},fs=function(){function t(){a(this,t),this.time=kt.beforeFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f=t.attribute,v=f.background,p=f.backgroundMode,g=void 0===p?l.backgroundMode:p;if(v)if(t.backgroundImg&&t.resources){var y=t.resources.get(v);if("success"!==y.state||!y.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var b=vi(t.parent).group,m=t.parent.attribute,x=m.scrollX,_=void 0===x?b.scrollX:x,A=m.scrollY,k=void 0===A?b.scrollY:A;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(_,k)}e.clip();var B=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,l),this.doDrawImage(e,y.data,B,g),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=v,e.fill(),e.highPerformanceRestore()}},{key:"doDrawImage",value:function(t,e,i,n){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{var r=t.createPattern(e,n);t.fillStyle=r,t.translate(i.x1,i.y1),t.fillRect(0,0,i.width(),i.height()),t.translate(-i.x1,-i.y1)}}}]),t}(),vs=new fs,ps=function(){function t(e){a(this,t),this.subRenderContribitions=e,this.time=kt.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((function(f){f.render(t,e,i,n,r,a,s,o,l,u,h,d,c)}))}}]),t}();ps=hs([j(),cs(0,I(Q)),cs(0,D(or)),ds("design:paramtypes",[Object])],ps);var gs=function(){function t(){a(this,t),this.time=kt.afterFillStroke,this.useStyle=!0,this.order=10}return o(t,[{key:"createCommonPattern",value:function(t,e,i,n,r){var a=(t-2*e)/2,s=n.dpr,o=ei.allocate({width:t,height:t,dpr:s}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),r(a,l);var u=n.createPattern(o.nativeCanvas,"repeat");return u.setTransform&&u.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),ei.free(o),u}},{key:"createCirclePattern",value:function(t,i,n,r){return this.createCommonPattern(t,i,n,r,(function(t,i){i.fillStyle=n,i.arc(t,t,t,0,e.pi2),i.fill()}))}},{key:"createDiamondPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){var r=t/2,a=r;n.fillStyle=i,n.moveTo(r,a-e),n.lineTo(e+r,a),n.lineTo(r,a+e),n.lineTo(r-e,a),n.closePath(),n.fill()}))}},{key:"createRectPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(a,0,2*n,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(n,r){var a=e;r.fillStyle=i,r.fillRect(0,a,t,2*n)}))}},{key:"createBiasLRLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);var r=t/2,a=-r;n.moveTo(r,a),n.lineTo(r+t,a+t),n.moveTo(-r,-a),n.lineTo(-r+t,-a+t),n.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(e,n){n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);var r=t/2,a=r;n.moveTo(t+r,a),n.lineTo(r,a+t),n.moveTo(t-r,-a),n.lineTo(-r,-a+t),n.stroke()}))}},{key:"createGridPattern",value:function(t,e,i,n){return this.createCommonPattern(t,e,i,n,(function(t,n){var r=e,a=r;n.fillStyle=i,n.fillRect(r,a,t,t),n.fillRect(r+t,a+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){this.textureMap||this.initTextureMap(e,t.stage);var f=t.attribute,v=f.texture,p=void 0===v?l.texture:v,g=f.textureColor,y=void 0===g?l.textureColor:g,b=f.textureSize,m=void 0===b?l.textureSize:b,x=f.texturePadding,_=void 0===x?l.texturePadding:x;if(p){var A=this.textureMap.get(p);if(!A)switch(p){case"circle":A=this.createCirclePattern(m,_,y,e);break;case"diamond":A=this.createDiamondPattern(m,_,y,e);break;case"rect":A=this.createRectPattern(m,_,y,e);break;case"vertical-line":A=this.createVerticalLinePattern(m,_,y,e);break;case"horizontal-line":A=this.createHorizontalLinePattern(m,_,y,e);break;case"bias-lr":A=this.createBiasLRLinePattern(m,_,y,e);break;case"bias-rl":A=this.createBiasRLLinePattern(m,_,y,e);break;case"grid":A=this.createGridPattern(m,_,y,e)}A&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=A,e.fill(),e.highPerformanceRestore())}}}]),t}();new gs;var ys=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=kt.beforeFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d){var c=t.attribute,f=c.background,v=c.backgroundMode,p=void 0===v?l.backgroundMode:v;if(f)if(t.backgroundImg&&t.resources){var g=t.resources.get(f);if("success"!==g.state||!g.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var y=t.AABBBounds;this.doDrawImage(e,g.data,y,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}}]),i}(fs),bs=new ys,ms=e.pi/2;function xs(t,i,n,r,a){var s,o=a||{},l=o.offsetX,u=void 0===l?0:l,h=o.offsetY,d=void 0===h?0:h,c=o.offsetZ,f=void 0===c?0:c,v=o.mode,p=void 0===v?"none":v,g=o.drawConnect,y=void 0!==g&&g;if(o.zeroX,o.zeroY,(!y||"none"!==p)&&i){var b=!0,m=i.curves;if(n>=1)if(y){var x,_=!0;m.forEach((function(e,i){var n,r=e.p0;if(e.originP1!==e.originP2){if(x&&x.originP1===x.originP2&&(r=x.p0),e.defined)_||(t.lineTo(r.x+u,r.y+d,f),_=!_);else{var a,s=e.originP1,o=e.originP2;if(s&&!1!==s.defined?a=r:s&&!1!==o.defined&&(a=null!==(n=e.p3)&&void 0!==n?n:e.p1),_){_=!_;var l=a?a.x:e.p0.x,h=a?a.y:e.p0.y;t.moveTo(l+u,h+d,f)}else a&&(_=!_,t.lineTo(a.x+u,a.y+d,f))}x=e}else x=e}))}else m.forEach((function(e){e.defined?(b&&t.moveTo(e.p0.x+u,e.p0.y+d,f),_s(t,e,1,a),b=!1):b=!0}));else if(!(n<=0)){var A;"x"===r?A=_t.ROW:"y"===r?A=_t.COLUMN:"auto"===r&&(A=i.direction);for(var k=n*i.tryUpdateLength(A),B=0,w=!0,S=null,T=0,C=m.length;T<C;T++){var E=m[T],M=E.getLength(A),P=(k-B)/M;if(B+=M,P<0)break;if(y){var L=E.p0;if(E.originP1===E.originP2){S=E;continue}if(S&&S.originP1===S.originP2&&(L=S.p0),E.defined)w||(t.lineTo(L.x+u,L.y+d,f),w=!w);else{var O=E.originP1,I=E.originP2,R=void 0;if(O&&!1!==O.defined?R=L:O&&!1!==I.defined&&(R=null!==(s=E.p3)&&void 0!==s?s:E.p1),w){w=!w;var j=R?R.x:E.p0.x,D=R?R.y:E.p0.y;t.moveTo(j+u,D+d,f)}else R&&(w=!w,t.lineTo(R.x+u,R.y+d,f))}S=E}else{if(!E.defined){b=!0;continue}b&&t.moveTo(E.p0.x+u,E.p0.y+d,f),_s(t,E,e.min(P,1),a),b=!1}}}}}function _s(t,e,i,n){if(e.p1){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,l+e.p1.y,s+e.p2.x,l+e.p2.y,s+e.p3.x,l+e.p3.y,h):t.lineTo(s+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var d=y(Gt(e,i),1)[0];t.bezierCurveTo(s+d.p1.x,l+d.p1.y,s+d.p2.x,l+d.p2.y,s+d.p3.x,l+d.p3.y,h)}else{var c=e.getPointAt(i);t.lineTo(s+c.x,l+c.y,h)}}}var As=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ks=function(t){u(n,t);var i=p(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).numberType=Cn,t}return o(n,[{key:"draw",value:function(t,e,i,n){var r=vi(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f,v,p){var g,y,b,m,x;if(i){t.beginPath();var _=null!==(g=this.z)&&void 0!==g?g:0;xs(t.camera?t:t.nativeContext,i,u,h,{offsetX:d,offsetY:c,offsetZ:_}),f.cache&&!e.isArray(f.cache)&&f.cache.curves.every((function(t){return t.defined}))&&f.attribute.curveType&&f.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(f,o,l);var A=o.x,k=void 0===A?0:A,B=o.x,w=void 0===B?0:B;!1!==n&&(v?v(t,o,l):a&&(t.setCommonStyle(f,o,k-d,w-c,l),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,o,k-d,w-c,l),t.stroke()));var S=o.connectedType,T=o.connectedX,C=o.connectedY,E=o.connectedStyle;if(e.isArray(l)?(S=null!==(y=null!=S?S:l[0].connectedType)&&void 0!==y?y:l[1].connectedType,T=null!==(b=null!=T?T:l[0].connectedX)&&void 0!==b?b:l[1].connectedX,C=null!==(m=null!=C?C:l[0].connectedY)&&void 0!==m?m:l[1].connectedY,E=null!==(x=null!=E?E:l[0].connectedStyle)&&void 0!==x?x:l[1].connectedStyle):(S=null!=S?S:l.connectedType,T=null!=T?T:l.connectedX,C=null!=C?C:l.connectedY,E=null!=E?E:l.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),"none"!==S){t.beginPath(),xs(t.camera?t:t.nativeContext,i,u,h,{offsetX:d,offsetY:c,offsetZ:_,drawConnect:!0,mode:S,zeroX:T,zeroY:C});var M=[];e.isArray(l)?l.forEach((function(t){return M.push(t)})):M.push(l),M.push(o),!1!==n&&(v?v(t,o,l):a&&(t.setCommonStyle(f,E,k-d,w-c,M),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,E,k-d,w-c,M),t.stroke()))}return!1}}},{key:"drawLinearLineHighPerformance",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f;e.beginPath();var v=null!==(f=this.z)&&void 0!==f?f:0,p=t.attribute.points,g=p[0];e.moveTo(g.x,g.y,v);for(var y=1;y<p.length;y++){var b=p[y];e.lineTo(b.x,b.y,v)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l);var m=t.attribute,x=m.x,_=void 0===x?0:x,A=m.x,k=void 0===A?0:A;!1!==i&&(d?d(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,_-s,k-o,l),e.fill())),!1!==n&&(c?c(e,t.attribute,l):a&&(e.setStrokeStyle(t,t.attribute,_-s,k-o,l),e.stroke()))}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=this,h=vi(t,null==s?void 0:s.theme).line,d=t.attribute,c=d.fill,f=void 0===c?h.fill:c,v=d.stroke,p=void 0===v?h.stroke:v,g=d.fillOpacity,y=void 0===g?h.fillOpacity:g,b=d.strokeOpacity,m=void 0===b?h.strokeOpacity:b,x=d.segments,_=d.points,A=d.closePath;if(this.valid(t,h,o,l)){var k=t.attribute.curveType,B=void 0===k?h.curveType:k;A&&"linear"===B&&(B="linearClosed");var w=t.attribute,S=w.clipRange,T=void 0===S?h.clipRange:S,C=w.clipRangeByDimension,E=void 0===C?h.clipRangeByDimension:C;if(1===T&&!x&&!_.some((function(t){return!1===t.defined}))&&"linear"===B)return this.drawLinearLineHighPerformance(t,i,!!f,!!p,y,m,n,r,h,a,s,o,l);if(t.shouldUpdateShape()){var M=t.attribute,P=M.points,L=M.segments,O=P;if(L&&L.length){var I,R;if(t.cache=L.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(R={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===e?I={x:R.endX,y:R.endY,defined:R.curves[R.curves.length-1].defined}:e>1&&(I.x=R.endX,I.y=R.endY,I.defined=R.curves[R.curves.length-1].defined);var i=pe(t.points,B,{startPoint:I});return R=i,i})).filter((function(t){return!!t})),"linearClosed"===B){for(var j,D=0;D<t.cache.length;D++){for(var N=t.cache[D],U=0;U<N.curves.length;U++)if(N.curves[U].defined){j=N.curves[U].p0;break}if(j)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(j.x,j.y,!0)}}else{if(!P||!P.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=pe(O,B)}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){var z=t.attribute.segments.filter((function(t){return t.points.length}));if(1===z[0].points.length&&z.shift(),1===T){var H=!1;t.cache.forEach((function(e,a){H||(H=u.drawSegmentItem(i,e,!!f,!!p,y,m,z[a],[h,t.attribute],T,E,n,r,t,o,l))}))}else{var V=t.cache.reduce((function(t,e){return t+e.getLength()}),0),W=T*V,F=0,G=!1;t.cache.forEach((function(a,s){if(!G){var d=a.getLength(),c=(W-F)/d;F+=d,c>0&&(G=u.drawSegmentItem(i,a,!!f,!!p,y,m,z[s],[h,t.attribute],e.min(c,1),E,n,r,t,o,l))}}))}}else this.drawSegmentItem(i,t.cache,!!f,!!p,y,m,t.attribute,h,T,E,n,r,t,o,l)}}}]),n}(ls);function Bs(t,e,i,n){if(!(e.length<2)){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;r.mode;var d=e[0];t.moveTo(d.p0.x+s,d.p0.y+l,h);var c=(d=e[e.length-1]).p3||d.p1;t.lineTo(c.x+s,c.y+l,h),d=i[i.length-1],t.lineTo(d.p0.x+s,d.p0.y+l,h),c=(d=i[0]).p3||d.p1,t.lineTo(c.x+s,c.y+l,h),t.closePath()}}function ws(t,e,i,n){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u,d=!0;e.forEach((function(e){e.defined?(d&&t.moveTo(e.p0.x+s,e.p0.y+l,h),Ss(t,e,1,n),d=!1):d=!0})),d=!0;for(var c=i.length-1;c>=0;c--){var f=i[c];f.defined?(d&&t.lineTo(f.p0.x+s,f.p0.y+l,h),Ss(t,f,1,n),d=!1):d=!0}t.closePath()}function Ss(t,e,i,n){if(e.p1){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=r.offsetZ,h=void 0===u?0:u;if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,l+e.p1.y,s+e.p2.x,l+e.p2.y,s+e.p3.x,l+e.p3.y,h):t.lineTo(s+e.p1.x,l+e.p1.y,h);else if(e.p2&&e.p3){var d=y(Gt(e,i),1)[0];t.bezierCurveTo(s+d.p1.x,l+d.p1.y,s+d.p2.x,l+d.p2.y,s+d.p3.x,l+d.p3.y,h)}else{var c=e.getPointAt(i);t.lineTo(s+c.x,l+c.y,h)}}}ks=As([j()],ks);var Ts=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=kt.afterFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c){var f,v,p,g;this.textureMap||this.initTextureMap(e,t.stage);var y=(c||{}).attribute,b=void 0===y?t.attribute:y,m=b.texture,x=void 0===m?null!==(f=t.attribute.texture)&&void 0!==f?f:ji(l,"texture"):m,_=b.textureColor,A=void 0===_?null!==(v=t.attribute.textureColor)&&void 0!==v?v:ji(l,"textureColor"):_,k=b.textureSize,B=void 0===k?null!==(p=t.attribute.textureSize)&&void 0!==p?p:ji(l,"textureSize"):k,w=b.texturePadding,S=void 0===w?null!==(g=t.attribute.texturePadding)&&void 0!==g?g:ji(l,"texturePadding"):w;if(x){var T=this.textureMap.get(x);if(!T)switch(x){case"circle":T=this.createCirclePattern(B,S,A,e);break;case"diamond":T=this.createDiamondPattern(B,S,A,e);break;case"rect":T=this.createRectPattern(B,S,A,e);break;case"vertical-line":T=this.createVerticalLinePattern(B,S,A,e);break;case"horizontal-line":T=this.createHorizontalLinePattern(B,S,A,e);break;case"bias-lr":T=this.createBiasLRLinePattern(B,S,A,e);break;case"bias-rl":T=this.createBiasRLLinePattern(B,S,A,e);break;case"grid":T=this.createGridPattern(B,S,A,e)}T&&(e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,l),e.fillStyle=T,e.fill(),e.highPerformanceRestore())}}}]),i}(gs),Cs=new Ts,Es=vs,Ms=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Ps=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ls=function(t,e){return function(i,n){e(i,n,t)}};function Os(t,e,i){switch(e){case"linear":default:return Qt(t,i);case"basis":return ie(t,i);case"monotoneX":return ue(t,i);case"monotoneY":return he(t,i);case"step":return ce(t,.5,i);case"stepBefore":return ce(t,0,i);case"stepAfter":return ce(t,1,i);case"linearClosed":return ve(t,i)}}var Is=function(t){u(n,t);var i=p(n);function n(t){var e;return a(this,n),(e=i.call(this)).areaRenderContribitions=t,e.numberType=wn,e.builtinContributions=[Cs,Es],e.init(t),e}return o(n,[{key:"drawLinearAreaHighPerformance",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f){var v,p,g,y,b;i.beginPath();var m=null!==(v=this.z)&&void 0!==v?v:0,x=t.attribute.points,_=x[0];i.moveTo(_.x,_.y,m);for(var A=1;A<x.length;A++){var k=x[A];i.lineTo(k.x,k.y,m)}for(var B=x.length-1;B>=0;B--){var w=x[B];i.lineTo(null!==(p=w.x1)&&void 0!==p?p:w.x,null!==(g=w.y1)&&void 0!==g?g:w.y,m)}i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u);var S=t.attribute,T=S.x,C=void 0===T?0:T,E=S.x,M=void 0===E?0:E;if(!1!==n&&(c?c(i,t.attribute,u):a&&(i.setCommonStyle(t,t.attribute,C-o,M-l,u),i.fill())),r){var P=t.attribute.stroke,L=void 0===P?u&&u.stroke:P;if(e.isArray(L)&&(L[0]||L[2])&&!1===L[1])if(i.beginPath(),L[0]){i.moveTo(_.x,_.y,m);for(var O=1;O<x.length;O++){var I=x[O];i.lineTo(I.x,I.y,m)}}else if(L[2]){var R=x[x.length-1];i.moveTo(R.x,R.y,m);for(var j=x.length-2;j>=0;j--){var D=x[j];i.lineTo(null!==(y=D.x1)&&void 0!==y?y:D.x,null!==(b=D.y1)&&void 0!==b?b:D.y,m)}}i.setStrokeStyle(t,t.attribute,C-o,M-l,u),i.stroke()}}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h,d,c,f,v,p=this,g=vi(t,null==s?void 0:s.theme).area,y=t.attribute,b=y.fill,m=void 0===b?g.fill:b,x=y.stroke;void 0===x&&g.stroke;var _=y.fillOpacity,A=void 0===_?g.fillOpacity:_,k=y.z,B=void 0===k?g.z:k,w=y.strokeOpacity,S=void 0===w?g.strokeOpacity:w,T=this.valid(t,g,o,l);if(T){var C=T.doFill,E=T.doStroke,M=t.attribute,P=M.clipRange,L=void 0===P?g.clipRange:P,O=M.closePath,I=M.points,R=M.segments,j=t.attribute.curveType,D=void 0===j?g.curveType:j;if(O&&"linear"===D&&(D="linearClosed"),1===L&&!R&&!I.some((function(t){return!1===t.defined}))&&"linear"===D)return this.drawLinearAreaHighPerformance(t,i,!!m,E,A,S,n,r,g,a,s,o,l);if(t.shouldUpdateShape()){if(R&&R.length){for(var N,U,z,H=R.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(U={endX:t.points[0].x,endY:t.points[0].y}),null;1===e?N={x:U.endX,y:U.endY}:e>1&&(N.x=U.endX,N.y=U.endY);var i=Os(t.points,D,{startPoint:N});return U=i,i})).filter((function(t){return!!t})),V=[],W=R.length-1;W>=0;W--){for(var F=R[W].points,G=[],$=F.length-1;$>=0;$--)G.push({x:null!==(u=F[$].x1)&&void 0!==u?u:F[$].x,y:null!==(h=F[$].y1)&&void 0!==h?h:F[$].y});if(0!==W){var Y=R[W-1].points,X=Y[Y.length-1];X&&G.push({x:null!==(d=X.x1)&&void 0!==d?d:X.x,y:null!==(c=X.y1)&&void 0!==c?c:X.y})}z=Os(G,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D),V.unshift(z)}t.cacheArea=V.map((function(t,e){return{top:H[e],bottom:t}}))}else{if(!I||!I.length)return t.cacheArea=null,void t.clearUpdateShapeTag();for(var q=I,Z=[],K=I.length-1;K>=0;K--)Z.push({x:null!==(f=I[K].x1)&&void 0!==f?f:I[K].x,y:null!==(v=I[K].y1)&&void 0!==v?v:I[K].y});var J=Os(q,D),Q=Os(Z,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D);t.cacheArea={top:J,bottom:Q}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){var tt=t.attribute.segments.filter((function(t){return t.points.length}));if(1===tt[0].points.length&&tt.shift(),1===L){var et=!1;t.cacheArea.forEach((function(e,s){et||(et=p.drawSegmentItem(i,e,C,A,E,S,tt[s],[g,t.attribute],L,n,r,B,t,a,o,l))}))}else{var it=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),nt=L*it,rt=0,at=!1;t.cacheArea.forEach((function(s,u){if(!at){var h=s.top.getLength(),d=(nt-rt)/h;rt+=h,d>0&&(at=p.drawSegmentItem(i,s,C,A,E,S,tt[u],[g,t.attribute],e.min(d,1),n,r,B,t,a,o,l))}}))}}else this.drawSegmentItem(i,t.cacheArea,C,A,E,S,t.attribute,g,L,n,r,B,t,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=vi(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}},{key:"drawSegmentItem",value:function(t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p){var g=!1;return g=(g=g||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,d,c,f,!1,v,p))||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,d,c,f,!0,v,p)}},{key:"_drawSegmentItem",value:function(t,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y){var b,m,x,_,A=o.connectedType,k=o.connectedX,B=o.connectedY,w=o.connectedStyle,S=[];if(p&&(e.isArray(l)?(A=null!==(b=null!=A?A:l[0].connectedType)&&void 0!==b?b:l[1].connectedType,k=null!==(m=null!=k?k:l[0].connectedX)&&void 0!==m?m:l[1].connectedX,B=null!==(x=null!=B?B:l[0].connectedY)&&void 0!==x?x:l[1].connectedY,w=null!==(_=null!=w?w:l[0].connectedStyle)&&void 0!==_?_:l[1].connectedStyle):(A=null!=A?A:l.connectedType,k=null!=k?k:l.connectedX,B=null!=B?B:l.connectedY,w=null!=w?w:l.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),e.isArray(l)?l.forEach((function(t){return S.push(t)})):S.push(l),S.push(o)),p&&"none"===A)return!1;if(i){t.beginPath();var T,C,E=f.attribute,M=E.points,P=E.segments,L=_t.ROW;if(P){var O=P[P.length-1];C=P[0].points[0],T=O.points[O.points.length-1]}else C=M[0],T=M[M.length-1];L=e.abs(T.x-C.x)>e.abs(T.y-C.y)?_t.ROW:_t.COLUMN,function(t,i,n,r){var a,s=r||{},o=s.drawConnect,l=void 0!==o&&o,u=s.mode;if(!l||"none"!==(void 0===u?"none":u)){var h=i.top,d=i.bottom;if(n>=1){var c=[],f=[],v=!0;if(l){var p,g,y=!0,b=h.curves.length;h.curves.forEach((function(e,i){var n=d.curves[b-i-1],a=e,s=n;if(e.originP1===e.originP2)return p=e,void(g=n);if(p&&p.originP1===p.originP2&&(a=p,s=g),e.defined)y||(c.push(a),f.push(s),Bs(t,c,f,r),c.length=0,f.length=0,y=!y);else{var o,l,u=e.originP1,h=e.originP2;u&&!1!==u.defined?(o=a,l=s):u&&!1!==h.defined&&(o=e,l=n),y?(y=!y,c.push(o||e),f.push(l||n)):o&&(y=!y,c.push(o||e),f.push(l||n),Bs(t,c,f,r),c.length=0,f.length=0)}p=e})),Bs(t,c,f,r)}else{for(var m=0,x=h.curves.length;m<x;m++){var _=h.curves[m];v!==_.defined?(v?(ws(t,c,f,r),c.length=0,f.length=0):(c.push(_),f.push(d.curves[x-m-1])),v=!v):v&&(c.push(_),f.push(d.curves[x-m-1]))}ws(t,c,f,r)}}else if(!(n<=0)){var A=(r||{}).direction,k=h.curves,B=null!==(a=k[k.length-1].p3)&&void 0!==a?a:k[k.length-1].p1,w=e.abs(B.x-k[0].p0.x),S=e.abs(B.y-k[0].p0.y);A=null!=A?A:w>S?_t.ROW:_t.COLUMN,Number.isFinite(w)||(A=_t.COLUMN),Number.isFinite(S)||(A=_t.ROW);for(var T,C,E=n*(A===_t.ROW?w:S),M=0,P=!0,L=[],O=[],I=!0,R=0,j=h.curves.length;R<j;R++){var D=h.curves[R],N=D.getLength(A),U=(E-M)/N;if(U<0)break;if(M+=N,l){var z=d.curves[j-R-1],H=D,V=z;if(D.originP1===D.originP2){T=D,C=z;continue}if(T&&T.originP1===T.originP2&&(H=T,V=C),D.defined)I||(L.push(H),O.push(V),Bs(t,L,O,r),L.length=0,O.length=0,I=!I);else{var W=D.originP1,F=D.originP2,G=void 0,$=void 0;W&&!1!==W.defined?(G=H,$=V):W&&!1!==F.defined&&(G=D,$=z),I?(I=!I,L.push(G||D),O.push($||z)):G&&(I=!I,L.push(G||D),O.push($||z),Bs(t,L,O,r),L.length=0,O.length=0)}T=D}else{var Y=null,X=null;P!==D.defined?(P?(ws(t,L,O,r),L.length=0,O.length=0):(Y=D,X=d.curves[j-R-1]),P=!P):P&&(Y=D,X=d.curves[j-R-1]),Y&&X&&(U<1&&(Y=Y.p2&&Y.p3?Gt(Y,U)[0]:Yt(Y,U)[0],X=X.p2&&X.p3?Gt(X,1-U)[1]:Yt(X,1-U)[1]),Y.defined=P,X.defined=P,L.push(Y),O.push(X)),Y=null,X=null}}l?Bs(t,L,O,r):ws(t,L,O,r)}}}(t.camera?t:t.nativeContext,i,u,{offsetX:h,offsetY:d,offsetZ:c,direction:L,drawConnect:p,mode:A,zeroX:k,zeroY:B}),this.beforeRenderStep(f,t,h,d,!!r,!1,n,!1,l,v,g,null,{attribute:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(f,o,l);var I=o.x,R=void 0===I?0:I,j=o.x,D=void 0===j?0:j;if(!1!==n&&(g?g(t,o,l):r&&(t.setCommonStyle(f,p?w:o,R-h,D-d,p?S:l),t.fill())),this.afterRenderStep(f,t,h,d,!!r,!1,n,!1,l,v,g,null,{attribute:o}),!1!==a)if(y)y(t,o,l);else{var N=o.stroke,U=void 0===N?l&&l[1]&&l[1].stroke:N;e.isArray(U)&&(U[0]||U[2])&&!1===U[1]&&(t.beginPath(),xs(t.camera?t:t.nativeContext,U[0]?i.top:i.bottom,u,L===_t.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:c,drawConnect:p,mode:A,zeroX:k,zeroY:B})),t.setStrokeStyle(f,p?w:o,R-h,D-d,p?S:l),t.stroke()}return!1}}}]),n}(ls);Is=Ms([j(),Ls(0,I(Q)),Ls(0,D(ar)),Ps("design:paramtypes",[Object])],Is);var Rs=Symbol.for("IncrementalDrawContribution"),js=Symbol.for("GraphicRender"),Ds=Symbol.for("GroupRender"),Ns=Symbol.for("DrawContribution"),Us=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},zs=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hs=function(t,e){return function(i,n){e(i,n,t)}},Vs=Symbol.for("RenderService"),Ws=function(){function t(e){a(this,t),this.drawContribution=e}return o(t,[{key:"prepare",value:function(t){var e=this;t&&this.renderTreeRoots.forEach((function(i){e._prepare(i,t)}))}},{key:"_prepare",value:function(t,e){var i=this;t.forEachChildren((function(t){i._prepare(t,e)})),t.update({bounds:e,trans:!0})}},{key:"prepareRenderList",value:function(){}},{key:"beforeDraw",value:function(t){}},{key:"draw",value:function(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}},{key:"afterDraw",value:function(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}},{key:"render",value:function(t,e){this.renderTreeRoots=t,this.drawParams=e;var i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e)}}]),t}();Ws=Us([j(),Hs(0,I(Ns)),zs("design:paramtypes",[Object])],Ws);var Fs=new k((function(t){t(Vs).to(Ws).inSingletonScope()})),Gs=Symbol.for("PickerService"),$s=Symbol.for("GlobalPickerService"),Ys=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Xs=Symbol.for("PickItemInterceptor"),qs=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterPickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}},{key:"beforePickItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}},{key:"_pickItem",value:function(t,i,n,r,a){if(!t.shadowRoot)return null;var s=(a||{}).parentMatrix;if(!s)return null;var o=i.pickContext;o.highPerformanceSave();var l=t.shadowRoot,u=qa.allocateByObj(s),h=new e.Point(n.x,n.y);s.transformPoint(h,h);var d=t.transMatrix;u.multiply(d.a,d.b,d.c,d.d,d.e,d.f);var c=i.pickGroup(l,h.clone(),u,r);return o.highPerformanceRestore(),c}}]),t}();qs=Ys([j()],qs);var Zs=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforePickItem",value:function(t,i,n,r,a){var s=t.baseGraphic;if(s&&s.parent){var o=new e.Point(n.x,n.y),l=i.pickContext;l.highPerformanceSave();var u=s.parent.globalTransMatrix;u.transformPoint(o,o);var h=s.isContainer?i.pickGroup(s,o.clone(),u,r):i.pickItem(s,o.clone(),u,r);return l.highPerformanceRestore(),h}return null}}]),t}();Zs=Ys([j()],Zs);var Ks=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforePickItem",value:function(t,i,n,r,a){if(!t.in3dMode||r.in3dInterceptor)return null;var s=i.pickContext,o=t.stage;if(!s||!o)return null;if(r.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=o.camera,t.isContainer){var l,u=!1,h=!1;if(t.forEachChildren((function(t){return!(u=t.numberType===Bn)})),t.forEachChildren((function(t){return!(h=!!t.findFace)})),u){var d=t.getChildren(),c=b(d);c.sort((function(t,i){for(var n,r,a,s,o=(null!==(r=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==r?r:0)/2,l=(null!==(s=null!==(a=i.attribute.startAngle)&&void 0!==a?a:0+i.attribute.endAngle)&&void 0!==s?s:0)/2;o<0;)o+=e.pi2;for(;l<0;)l+=e.pi2;return l-o})),c.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),c.forEach((function(e){t.appendChild(e)})),r.hack_pieFace="outside",(l=i.pickGroup(t,n,a.parentMatrix,r)).graphic||(r.hack_pieFace="inside",l=i.pickGroup(t,n,a.parentMatrix,r)),l.graphic||(r.hack_pieFace="top",l=i.pickGroup(t,n,a.parentMatrix,r)),t.removeAllChild(),d.forEach((function(t){t._next=null,t._prev=null})),d.forEach((function(e){t.appendChild(e)}))}else if(h){var f=t.getChildren(),v=f.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var i;return s.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));v.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),v.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),v.forEach((function(e){t.add(e.g)})),l=i.pickGroup(t,n,a.parentMatrix,r),t.removeAllChild(),f.forEach((function(t){t._next=null,t._prev=null})),t.update(),f.forEach((function(e){t.add(e)}))}else l=i.pickGroup(t,n,a.parentMatrix,r);return s.camera=null,r.in3dInterceptor=!1,s.restore(),l}return s.restore(),null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}();Ks=Ys([j()],Ks);var Js=new k((function(t){t(Gs).toService($s),t(Ks).toSelf().inSingletonScope(),t(Xs).toService(Ks),t(qs).toSelf().inSingletonScope(),t(Xs).toService(qs),t(Zs).toSelf().inSingletonScope(),t(Xs).toService(Zs),et(t,Xs)})),Qs=new k((function(t){t(On).to(ns).inSingletonScope(),t(In).toConstantValue(as)})),to=Symbol.for("AutoEnablePlugins"),eo=Symbol.for("PluginService"),io=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},no=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ro=function(t,e){return function(i,n){e(i,n,t)}},ao=function(){function t(e){a(this,t),this.autoEnablePlugins=e,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}return o(t,[{key:"active",value:function(t,e){var i=this;this.stage=t,this.actived=!0;var n=e.pluginList;n&&Ze.isBound(to)&&this.autoEnablePlugins.getContributions().forEach((function(t){n.includes(t.name)&&i.register(t)}))}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(i){i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((function(i){i.name===t&&e.push(i)})),e}},{key:"register",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}},{key:"release",value:function(){var t=this;this.onStartupFinishedPlugin.forEach((function(e){e.deactivate(t)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((function(e){e.deactivate(t)})),this.onRegisterPlugin=[]}}]),t}();ao=io([j(),ro(0,I(Q)),ro(0,D(to)),no("design:paramtypes",[Object])],ao);var so=new k((function(t){t(eo).to(ao),function(t,e){t(Q).toDynamicValue((function(t){var i=t.container;return new tt(e,i)})).whenTargetNamed(e)}(t,to)})),oo=new k((function(t){et(t,nt)})),lo=new k((function(t){t(Xe).to(qe).inSingletonScope(),et(t,Xe)})),uo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},ho=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},co=function(){function t(){a(this,t),this.type="static",this.offscreen=!1,this.global=He.global}return o(t,[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{var n;this.main=!1,(n=i.canvasId?this.global.getElementById(i.canvasId):this.global.createCanvas({width:e.width,height:e.height})).style&&(n.style["pointer-events"]="none");var r=e.getContext().getCanvas().nativeCanvas,a=Je({nativeCanvas:n,width:e.width,height:e.height,dpr:e.dpr,canvasControled:!0,container:e.getContainer(),x:r.offsetLeft,y:r.offsetTop});a.applyPosition(),this.canvas=a,this.context=a.getContext()}}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,i){var n;if(!this.main){var r=this.window.getContext().getCanvas().nativeCanvas;!r||this.canvas.x===r.offsetLeft&&this.canvas.y===r.offsetTop||(this.canvas.x=r.offsetLeft,this.canvas.y=r.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var i=t.getContext().canvas.nativeCanvas;e.context.drawImage(i,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,i){var n,r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}]),t}();co=uo([j(),ho("design:paramtypes",[])],co);var fo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},vo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},po=function(){function t(){a(this,t),this.offscreen=!1,this.type="virtual",this.global=He.global}return o(t,[{key:"setDpr",value:function(t){}},{key:"init",value:function(t,e,i){if(this.layer=t,this.window=e,i.main)throw new Error("virtual layer不能作为main layer");this.main=!1,this.canvas=null,this.context=null}},{key:"resize",value:function(t,e){}},{key:"resizeView",value:function(t,e){}},{key:"render",value:function(t,e,i){this.mainHandler.render(t,e,Object.assign(Object.assign({},i),{clear:!1}))}},{key:"merge",value:function(t){}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,i){var n,r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}},{key:"getContext",value:function(){return null}},{key:"release",value:function(){}}]),t}();po=fo([j(),vo("design:paramtypes",[])],po);var go=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},yo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bo=function(){function t(){a(this,t),this.offscreen=!0,this.type="dynamic",this.global=He.global}return o(t,[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,i){this.layer=t;var n=Je({nativeCanvas:this.global.createOffscreenCanvas({width:i.width,height:i.height,dpr:e.dpr}),width:i.width,height:i.height,dpr:e.dpr,canvasControled:!0});this.canvas=n,this.context=n.getContext()}},{key:"resize",value:function(t,e){this.canvas.resize(t,e)}},{key:"resizeView",value:function(t,e){this.canvas.resize(t,e)}},{key:"render",value:function(t,e){var i;e.renderService.render(t,Object.assign(Object.assign({context:this.context},e),{x:0,y:0,clear:null!==(i=e.background)&&void 0!==i?i:"#ffffff"}))}},{key:"prepare",value:function(t,e){}},{key:"release",value:function(){this.canvas.release()}},{key:"getContext",value:function(){return this.context}},{key:"drawTo",value:function(t,e,i){var n=t.getContext(),r=t.dpr,a=i.x,s=void 0===a?0:a,o=i.y,l=void 0===o?0:o,u=i.width,h=void 0===u?this.layer.viewWidth:u,d=i.height,c=void 0===d?this.layer.viewHeight:d;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,l,h,c),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,l,h,c),n.nativeContext.restore()}},{key:"merge",value:function(t){}}]),t}();bo=go([j(),yo("design:paramtypes",[])],bo);var mo=new k((function(t){t(co).toSelf(),t(bo).toSelf(),t(po).toSelf(),t(Wn).toService(co),t(Fn).toService(bo),t(Gn).toService(po)}));var xo=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))};function _o(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return xo(this,void 0,void 0,n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(i,r);case 2:case"end":return e.stop()}}),e)})))}function Ao(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},a=[],s=!1;t.forEachChildren((function(t,e){var n=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===n?i:n))return s=!0,!0;return!1}),n);var o=null,l=!1;if(s){t.forEachChildren((function(t){var e=t.attribute.zIndex,n=void 0===e?i:e;r[n]?r[n].push(t):(r[n]=[t],a.push(n))}),n),a.sort((function(t,e){return n?e-t:t-e}));for(var u=!1,h=0;h<a.length&&!u;h++)for(var d=a[h],c=r[d],f=0;f<c.length;f++){if(l){u=!0,o=c[f];break}c[f]._uid!==e||(l=!0)}}else t.forEachChildren((function(t){return l?(o=t,!0):(t._uid===e&&(l=!0),!1)}),n);return o}var ko=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Bo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wo=Symbol.for("DrawItemInterceptor"),So=new e.AABBBounds,To=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){return(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx)&&this.drawItem(t,e,i,n,r),!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){return t.attribute.shadowRootIdx<0&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.shadowRoot)return!1;var a=i.context;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){So.copy(n.dirtyBounds);var s=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(s)}return n.renderGroup(t.shadowRoot,i,t.parent.globalTransMatrix),a.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&n.dirtyBounds.copy(So),!0}}]),t}(),Co=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}},{key:"drawItem",value:function(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;var a=i.context;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);var s=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(a,t),a.strokeRect(s.x1,s.y1,s.width(),s.height()),a.highPerformanceRestore(),!0}}]),t}(),Eo=function(){function t(){a(this,t),this.order=1,this.interceptors=[new To,new Po,new Mo,new Co]}return o(t,[{key:"afterDrawItem",value:function(t,e,i,n,r){for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].afterDrawItem&&this.interceptors[a].afterDrawItem(t,e,i,n,r))return!0;return!1}},{key:"beforeDrawItem",value:function(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].beforeDrawItem&&this.interceptors[a].beforeDrawItem(t,e,i,n,r))return!0;return!1}}]),t}();Eo=ko([j(),Bo("design:paramtypes",[])],Eo);var Mo=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforeDrawItem",value:function(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}},{key:"beforeSetInteractive",value:function(t,e,i,n,r){var a=t.interactiveGraphic;if(t.attribute.globalZIndex){a||(a=t.clone(),t.interactiveGraphic=a,a.baseGraphic=t),a.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();var s=i.stage.getLayer("_builtin_interactive");return s&&this.getShadowRoot(s).add(a),!0}if(a){i.stage.tryInitInteractiveLayer();var o=i.stage.getLayer("_builtin_interactive");o&&this.getShadowRoot(o).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}},{key:"beforeDrawInteractive",value:function(t,e,i,n,r){var a=t.baseGraphic;if(a){this.processing=!0;var s=i.context;return s.highPerformanceSave(),s.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?n.renderGroup(a,i,a.parent.globalTransMatrix):n.renderItem(a,i),s.highPerformanceRestore(),this.processing=!1,!0}return!1}},{key:"getShadowRoot",value:function(t){var e,i=t.getElementById("_interactive_group");return i||((i=as.CreateGraphic("group",{})).id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}]),t}(),Po=function(){function t(){a(this,t),this.order=1}return o(t,[{key:"beforeDrawItem",value:function(t,i,n,r,a){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;var s=i.drawParams,o=s.context,l=s.stage;o.canvas,o.save(),this.initCanvasCtx(o),o.camera=l.camera;var u=o.currentMatrix;u.a/=o.dpr,u.b/=o.dpr,u.c/=o.dpr,u.d/=o.dpr,u.e/=o.dpr,u.f/=o.dpr;var h,d,c=Za.allocate();d=u,(h=c)[0]=d.a,h[1]=d.b,h[2]=0,h[3]=0,h[4]=d.c,h[5]=d.d,h[6]=0,h[7]=0,h[8]=0,h[9]=0,h[10]=1,h[11]=0,h[12]=d.e,h[13]=d.f,h[14]=0,h[15]=1;var f=o.modelMatrix;if(f){if(c){var v=Za.allocate();o.modelMatrix=es(v,f,c)}}else o.modelMatrix=c;if(o.setTransform(1,0,0,1,0,0,!0),t.isContainer){var p=!1,g=!1;if(t.forEachChildren((function(t){return!(p=t.numberType===Bn)})),t.forEachChildren((function(t){return!(g=!!t.findFace)})),p){var y=t.getChildren(),m=b(y);m.sort((function(t,i){for(var n,r,a,s,o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(r=t.attribute.endAngle)&&void 0!==r?r:0))/2,l=((null!==(a=i.attribute.startAngle)&&void 0!==a?a:0)+(null!==(s=i.attribute.endAngle)&&void 0!==s?s:0))/2;o<0;)o+=e.pi2;for(;l<0;)l+=e.pi2;return l-o})),m.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),m.forEach((function(e){t.appendChild(e)}));var x=t.parent.globalTransMatrix;n.hack_pieFace="outside",r.renderGroup(t,n,x),n.hack_pieFace="inside",r.renderGroup(t,n,x),n.hack_pieFace="top",r.renderGroup(t,n,x),t.removeAllChild(),y.forEach((function(t){t._next=null,t._prev=null})),y.forEach((function(e){t.appendChild(e)}))}else if(g){var _=t.getChildren(),A=_.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var i;return o.view(e[0],e[1],null!==(i=e[2]+t.attribute.z)&&void 0!==i?i:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));A.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),A.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),A.forEach((function(e){t.add(e.g)})),r.renderGroup(t,n,t.parent.globalTransMatrix,!0),t.removeAllChild(),_.forEach((function(t){t._next=null,t._prev=null})),t.update(),_.forEach((function(e){t.add(e)}))}else r.renderGroup(t,n,t.parent.globalTransMatrix)}else r.renderItem(t,n);return o.camera=null,o.restore(),o.modelMatrix!==f&&Za.free(o.modelMatrix),o.modelMatrix=f,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}(),Lo=new(function(){function t(){a(this,t),this.pools=[];for(var i=0;i<10;i++)this.pools.push(new e.AABBBounds)}return o(t,[{key:"allocate",value:function(t,i,n,r){if(!this.pools.length)return(new e.AABBBounds).setValue(t,i,n,r);var a=this.pools.pop();return a.x1=t,a.y1=i,a.x2=n,a.y2=r,a}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new e.AABBBounds(t);var i=this.pools.pop();return i.x1=t.x1,i.y1=t.y1,i.x2=t.x2,i.y2=t.y2,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}]),t}()),Oo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Io=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ro=function(t,e){return function(i,n){e(i,n,t)}},jo=function(){function t(i,n){a(this,t),this.contributions=i,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new e.Bounds,this.backupDirtyBounds=new e.Bounds,this.global=He.global,this.layerService=He.layerService,this.init()}return o(t,[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var i=t.styleRenderMap.get(e.style)||new Map;i.set(e.numberType,e),t.styleRenderMap.set(e.style,i)}else t.defaultRenderMap.set(e.numberType,e)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"prepareForDraw",value:function(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}},{key:"draw",value:function(t,i){var n=this;this.prepareForDraw(t,i),i.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(i.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var r=i.context,a=i.stage,s=i.x,o=void 0===s?0:s,l=i.y,u=void 0===l?0:l,h=i.width,d=i.height;if(r){var c=this.dirtyBounds.setValue(0,0,h,d);if(a.dirtyBounds&&!a.dirtyBounds.empty()){var f=e.getRectIntersect(c,a.dirtyBounds,!1);c.x1=Math.floor(f.x1),c.y1=Math.floor(f.y1),c.x2=Math.ceil(f.x2),c.y2=Math.ceil(f.y2)}var v=r.dpr%1;(v||.5!==v)&&(c.x1=Math.floor(c.x1*r.dpr)/r.dpr,c.y1=Math.floor(c.y1*r.dpr)/r.dpr,c.x2=Math.ceil(c.x2*r.dpr)/r.dpr,c.y2=Math.ceil(c.y2*r.dpr)/r.dpr),this.backupDirtyBounds.copy(c),r.inuse=!0,r.clearMatrix(),r.setTransformForCurrent(!0);var p=c.width()*r.dpr!==r.canvas.width||c.height()*r.dpr!==r.canvas.height;r.save(),r.translate(o,u,!0),p&&(r.beginPath(),r.rect(c.x1,c.y1,c.width(),c.height()),r.clip()),a.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,r,i),r.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:we.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:we.zIndex)})).forEach((function(t){n.renderGroup(t,i,qa.allocate(1,0,0,1,0,0))})),r.restore(),r.restore(),r.draw(),r.inuse=!1}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,i=t._uid;e;){var n=Ao(e,i,we.zIndex);if(n)return n;i=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,i,n,r){var a=this;if(!i.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==i.startAtId||i.startAtId===t._uid))return i.break=!0,void this._increaseRender(t,i);if(!this.useDirtyBounds||e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1)){var s,o=n;if(this.useDirtyBounds){s=Lo.allocateByObj(this.dirtyBounds);var l=t.transMatrix;o=qa.allocateByObj(n).multiply(l.a,l.b,l.c,l.d,l.e,l.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o.getInverse())}this.renderItem(t,i,{drawingCb:function(){var e;r?t.forEachChildren((function(t){i.break||(t.isContainer?a.renderGroup(t,i,o):a.renderItem(t,i))})):function(t,e,i){var n,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s={},o=[],l=!1;if(a?l=!0:t.forEachChildren((function(t,i){var r=t.attribute.zIndex,a=void 0===r?e:r;if(0===i)n=a;else if(n!==a)return l=!0,!0;return!1}),r),l){t.forEachChildren((function(t){var i=t.attribute.zIndex,n=void 0===i?e:i;s[n]?s[n].push(t):(s[n]=[t],o.push(n))}),r),o.sort((function(t,e){return r?e-t:t-e}));for(var u=!1,h=0;h<o.length&&!u;h++){var d=o[h],c=s[d];a&&c.sort((function(t,e){var i,n;return(r?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(var f=0;f<c.length;f++)if(i(c[f],f)){u=!0;break}}}else t.forEachChildren(i,r)}(t,we.zIndex,(function(t){i.break||(t.isContainer?a.renderGroup(t,i,o):a.renderItem(t,i))}),!1,!!(null===(e=i.context)||void 0===e?void 0:e.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(s),Lo.free(s),qa.free(o))}}}},{key:"_increaseRender",value:function(t,e){var i=e.layer,n=e.stage,r=i.subLayers,a=r.get(t._uid);a||(a={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,a));var s=a.layer.getNativeHandler().getContext(),o=a.drawContribution||Ze.get(Rs);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:a.layer,context:s,startAtId:t._uid,break:!1})),a.drawContribution=o;var l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{var u=r.get(l._uid);u||(u={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(l._uid,u));var h=u.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:u.layer,context:h,startAtId:l._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e;return e||(e=this.selectRenderByNumberType(t.numberType)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,i,n){if(this.InterceptorContributions.length)for(var r=0;r<this.InterceptorContributions.length;r++){var a=this.InterceptorContributions[r];if(a.beforeDrawItem&&a.beforeDrawItem(t,this.currentRenderService,i,this,n))return}var s=this.getRenderContribution(t);if(s){var o,l=!1;if(t.parent){var u=t.parent.attribute,h=u.scrollX,d=void 0===h?0:h,c=u.scrollY,f=void 0===c?0:c;if(l=!(!d&&!f)){o=this.dirtyBounds.clone();var v=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(v),this.dirtyBounds.translate(-d,-f)}}if(!this.useDirtyBounds||t.isContainer||e.isRectIntersect(t.AABBBounds,this.dirtyBounds,!1)){var p=null!=i.startAtId&&t._uid!==i.startAtId;if(t._uid===i.startAtId&&(i.startAtId=null),n&&(n.skipDraw=p),p?t.isContainer&&s.draw(t,this.currentRenderService,i,n):s.draw(t,this.currentRenderService,i,n),l&&this.dirtyBounds.copy(o),this.InterceptorContributions.length)for(var g=0;g<this.InterceptorContributions.length;g++){var y=this.InterceptorContributions[g];if(y.afterDrawItem&&y.afterDrawItem(t,this.currentRenderService,i,this))return}}else l&&this.dirtyBounds.copy(o)}}},{key:"selectRenderByType",value:function(t){return e.Logger.getInstance().warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t){return this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,i){var n,r=i.clear;if(r){var a=e.getCanvas(),s=i.width,o=void 0===s?a.width:s,l=i.height,u=void 0===l?a.height:l;e.clearRect(0,0,o,u);var h=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(h&&h.backgroundImg&&h.resources){var d=h.resources.get(r);d&&"success"===d.state&&d.data&&e.drawImage(d.data,0,0,o,u)}else e.fillStyle=us(e,r,{AABBBounds:{x1:0,y1:0,x2:0+o,y2:0+u}},0,0),e.fillRect(0,0,o,u)}}},{key:"afterDraw",value:function(t,e){}}]),t}();jo=Oo([j(),Ro(0,R(js)),Ro(1,I(Q)),Ro(1,D(wo)),Io("design:paramtypes",[Array,Object])],jo);var Do=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},No=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uo=function(t,e){return function(i,n){e(i,n,t)}},zo=function(){function t(e){a(this,t),this.groupRenderContribitions=e,this.numberType=Sn}return o(t,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=vi(t,null==s?void 0:s.theme).group,h=t.attribute,d=h.fill,c=void 0===d?u.fill:d,f=h.background,v=h.stroke,p=void 0===v?u.stroke:v,g=h.opacity,y=void 0===g?u.opacity:g,b=h.width,m=void 0===b?u.width:b,x=h.height,_=void 0===x?u.height:x,A=h.clip,k=void 0===A?u.clip:A,B=h.fillOpacity,w=void 0===B?u.fillOpacity:B,S=h.strokeOpacity,T=void 0===S?u.strokeOpacity:S,C=h.cornerRadius,E=void 0===C?u.cornerRadius:C,M=h.path,P=void 0===M?u.path:M,L=h.lineWidth,O=void 0===L?u.lineWidth:L,I=h.visible,R=void 0===I?u.visible:I,j=function(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}(y,w,m,_,c),D=function(t,e,i,n){return t*e>0&&0!==i&&0!==n}(y,T,m,_),N=er(c,f),U=ir(p,O);if(t.valid&&R){if(!k){if(!N&&!U)return;if(!(j||D||o||l||f))return}if(P&&P.length&&a.drawContribution){var z=i.disableFill,H=i.disableStroke,V=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,P.forEach((function(t){a.drawContribution.getRenderContribution(t).draw(t,a.renderService,a,s)})),i.disableFill=z,i.disableStroke=H,i.disableBeginPath=V}else 0===E||e.isArray(E)&&E.every((function(t){return 0===t}))?(i.beginPath(),i.rect(n,r,m,_)):(i.beginPath(),function(t,i,n,r,a,s){var o;if(r<0&&(i+=r,r=-r),a<0&&(n+=a,a=-a),e.isNumber(s,!0))o=[s,s,s,s];else if(Array.isArray(s)){var l=s;switch(l.length){case 0:o=[0,0,0,0];break;case 1:o=[l[0],l[0],l[0],l[0]];break;case 2:case 3:o=[l[0],l[1],l[0],l[1]];break;default:o=l.slice(0,5)}}else o=[0,0,0,0];if(r<0||Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])+Math.abs(o[3])<1e-12)return t.rect(i,n,r,a);var u=[i,n],h=[i+r,n],d=[i+r,n+a],c=[i,n+a],f=Math.min(r/2,a/2),v=[Math.min(f,o[0]),Math.min(f,o[1]),Math.min(f,o[2]),Math.min(f,o[3])],p=[u[0]+v[0],u[1]],g=[u[0],u[1]+v[0]],y=[h[0]-v[1],h[1]],b=[h[0],h[1]+v[1]],m=[d[0]-v[2],d[1]],x=[d[0],d[1]-v[2]],_=[c[0]+v[3],c[1]],A=[c[0],c[1]-v[3]];if(t.moveTo(p[0],p[1]),t.lineTo(y[0],y[1]),!e.arrayEqual(y,b)){var k=y[0],B=y[1]+v[1];t.arc(k,B,v[1],-ms,0,!1)}if(t.lineTo(x[0],x[1]),!e.arrayEqual(m,x)){var w=x[0]-v[2],S=x[1];t.arc(w,S,v[2],0,ms,!1)}if(t.lineTo(_[0],_[1]),!e.arrayEqual(_,A)){var T=_[0],C=_[1]-v[3];t.arc(T,C,v[3],ms,e.pi,!1)}if(t.lineTo(g[0],g[1]),!e.arrayEqual(p,g)){var E=p[0],M=p[1]+v[0];t.arc(E,M,v[0],e.pi,e.pi+ms,!1)}t.closePath()}(i,n,r,m,_,E));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(bs));var W={doFill:N,doStroke:U};this._groupRenderContribitions.forEach((function(e){e.time===kt.beforeFillStroke&&e.drawShape(t,i,n,r,N,U,j,D,u,a,o,l,W)})),k&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),W.doFill&&(o?o(i,t.attribute,u):j&&(i.setCommonStyle(t,t.attribute,n,r,u),i.fill())),W.doStroke&&(l?l(i,t.attribute,u):D&&(i.setStrokeStyle(t,t.attribute,n,r,u),i.stroke())),this._groupRenderContribitions.forEach((function(e){e.time===kt.afterFillStroke&&e.drawShape(t,i,n,r,N,U,j,D,u,a,o,l)}))}}},{key:"draw",value:function(t,e,i,n){var r=i.context;if(r){var a=t.attribute.clip;a?r.save():r.highPerformanceSave();var s=vi(t,null==n?void 0:n.theme).group,o=r.modelMatrix;if(r.camera){var l=Za.allocate(),u=Za.allocate();is(u,t,s),es(l,o||l,u),r.modelMatrix=l,Za.free(u),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,i);var h,d=t.attribute,c=d.scrollX,f=void 0===c?s.scrollX:c,v=d.scrollY,p=void 0===v?s.scrollY:v;(f||p)&&r.translate(f,p),n&&n.drawingCb&&(h=n.drawingCb()),r.modelMatrix!==o&&Za.free(r.modelMatrix),r.modelMatrix=o,h&&h.then?h.then((function(){a?r.restore():r.highPerformanceRestore()})):a?r.restore():r.highPerformanceRestore()}}}]),t}();zo=Do([j(),Uo(0,I(Q)),Uo(0,D(sr)),No("design:paramtypes",[Object])],zo);var Ho=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Vo=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).numberType=Cn,t}return o(i,[{key:"drawShape",value:function(t,e,n,r,a,s,o,l){if(t.incremental&&a.multiGraphicOptions){var u=a.multiGraphicOptions,d=u.startAtIdx,c=u.length,f=t.attribute.segments,v=void 0===f?[]:f;if(d>v.length)return;var p=vi(t).line,y=t.attribute,b=y.fill,m=void 0===b?p.fill:b,x=y.stroke,_=void 0===x?p.stroke:x,A=y.opacity,k=void 0===A?p.opacity:A,B=y.fillOpacity,w=void 0===B?p.fillOpacity:B,S=y.strokeOpacity,T=void 0===S?p.strokeOpacity:S,C=y.lineWidth,E=void 0===C?p.lineWidth:C,M=y.visible,P=void 0===M?p.visible:M,L=nr(k,w,m),O=rr(k,T),I=er(m),R=ir(_,E);if(!t.valid||!P)return;if(!I&&!R)return;if(!(L||O||o||l))return;for(var j=a.context,D=d;D<d+c;D++)this.drawIncreaseSegment(t,j,v[D-1],v[D],t.attribute.segments[D],[p,t.attribute],n,r)}else g(h(i.prototype),"drawShape",this).call(this,t,e,n,r,a,s,o,l)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,s,o){n&&(e.beginPath(),function(t,e,i,n){var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=e?e.points[e.points.length-1]:i.points[0];t.moveTo(u.x+s,u.y+l),i.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+s,e.y+l):t.moveTo(e.x+s,e.y+l)}))}(e.nativeContext,i,n,{offsetX:s,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setStrokeStyle(t,r,s,o,a),e.stroke())}}]),i}(ks);Vo=Ho([j()],Vo);var Wo=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Fo=function(t){u(i,t);var e=p(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).numberType=wn,t}return o(i,[{key:"drawShape",value:function(t,e,n,r,a,s,o){if(t.incremental&&a.multiGraphicOptions){var l=a.multiGraphicOptions,u=l.startAtIdx,d=l.length,c=t.attribute.segments,f=void 0===c?[]:c;if(u>f.length)return;var v=vi(t).area,p=t.attribute,y=p.fill,b=void 0===y?v.fill:y,m=p.fillOpacity,x=void 0===m?v.fillOpacity:m,_=p.opacity,A=void 0===_?v.opacity:_,k=p.visible,B=void 0===k?v.visible:k,w=nr(A,x,b),S=er(b);if(!t.valid||!B)return;if(!S)return;if(!w&&!o)return;for(var T=u;T<u+d;T++)this.drawIncreaseSegment(t,e,f[T-1],f[T],t.attribute.segments[T],[v,t.attribute],n,r)}else g(h(i.prototype),"drawShape",this).call(this,t,e,n,r,a,s,o)}},{key:"drawIncreaseSegment",value:function(t,e,i,n,r,a,s,o){n&&(e.beginPath(),function(t,e,i,n){for(var r=n||{},a=r.offsetX,s=void 0===a?0:a,o=r.offsetY,l=void 0===o?0:o,u=i.points,h=[],d=0;d<u.length;d++)u[d].defined;h.push(u),h.forEach((function(i,n){var r,a,o,u,h=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(h.x+s,h.y+l),i.forEach((function(e){!1!==e.defined?t.lineTo(e.x+s,e.y+l):t.moveTo(e.x+s,e.y+l)}));for(var d=i.length-1;d>=0;d--){var c=i[d];t.lineTo(null!==(r=c.x1)&&void 0!==r?r:c.x,null!==(a=c.y1)&&void 0!==a?a:c.y)}t.lineTo(null!==(o=h.x1)&&void 0!==o?o:h.x,null!==(u=h.y1)&&void 0!==u?u:h.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,n,{offsetX:s,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setCommonStyle(t,r,s,o,a),e.fill())}}]),i}(Is);Fo=Wo([j()],Fo);var Go,$o=function(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o},Yo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xo=function(t,e){return function(i,n){e(i,n,t)}},qo=function(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Go||(Go={}));var Zo=function(t){u(i,t);var e=p(i);function i(t,n,r,s){var o;return a(this,i),(o=e.call(this,t,s)).contributions=t,o.lineRender=n,o.areaRender=r,o.drawItemInterceptorContributions=s,o.rendering=!1,o.currFrameStartAt=0,o.currentIdx=0,o.status=Go.NORMAL,o.checkingForDrawPromise=null,o.hooks={completeDraw:new it([])},o}return o(i,[{key:"init",value:function(){g(h(i.prototype),"init",this).call(this),this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}},{key:"draw",value:function(t,e){return qo(this,void 0,void 0,n().mark((function i(){var r,a,s,o,l,u,h=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.checkingForDrawPromise){i.next=2;break}return i.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),i.next=5,this.checkingForDrawPromise;case 5:if(r=i.sent,this.checkingForDrawPromise=null,!r){i.next=8;break}return i.abrupt("return");case 8:this.currentRenderService=t,a=e.context,s=e.x,o=void 0===s?0:s,l=e.y,u=void 0===l?0:l,a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,a,e),a.translate(o,u,!0),a.save(),t.renderTreeRoots.sort((function(t,e){var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:we.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:we.zIndex)})).forEach((function(t){h.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){a.restore(),a.restore(),a.draw(),a.inuse=!1,h.rendering=!1})));case 11:case"end":return i.stop()}}),i,this)})))}},{key:"_increaseRender",value:function(t,e){return qo(this,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.rendering=!0,i.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return i.stop()}}),i,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return qo(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return this.count=t.count,i.next=3,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return qo(r,void 0,void 0,n().mark((function r(){var a,s=this;return n().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(2===t.count){n.next=6;break}return n.next=3,_o(t,we.zIndex,(function(i,n){if(s.status===Go.STOP)return!0;if(i.isContainer)return!1;if(n<s.currentIdx)return!1;var r=s.currFrameStartAt+t.incremental;return n<r&&(s.currentIdx=n+1,s.renderItem(i,e)),n===r-1&&(s.currFrameStartAt=s.currentIdx,s.waitToNextFrame())}));case 3:i(!1),n.next=21;break;case 6:if(!(a=t.getChildAt(0)).incremental||!a.attribute.segments){n.next=19;break}a.incrementalAt||(a.incrementalAt=0);case 9:if(!(a.incrementalAt<a.attribute.segments.length)){n.next=17;break}return e.multiGraphicOptions={startAtIdx:a.incrementalAt,length:a.incremental},this.renderItem(a,e),a.incrementalAt+=a.incremental,n.next=15,this.waitToNextFrame();case 15:n.next=9;break;case 17:n.next=20;break;case 19:this.renderItem(a,e);case 20:i(!1);case 21:case"end":return n.stop()}}),r,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return i.stop()}}),i,this)})))}},{key:"waitToNextFrame",value:function(){return qo(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise((function(t){e.global.getRequestAnimationFrame()((function(){t(!1)}))})));case 1:case"end":return t.stop()}}),t)})))}},{key:"checkForDraw",value:function(t){return qo(this,void 0,void 0,n().mark((function e(){var i;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return i=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",i);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return qo(this,void 0,void 0,n().mark((function t(){var e=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=this.rendering,!t.t0){t.next=5;break}return this.status=Go.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=Go.NORMAL,e.hooks.completeDraw.taps=e.hooks.completeDraw.taps.filter((function(t){return"stopCb"!==t.name})),t(!1)}))}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"resetToInit",value:function(){this.currFrameStartAt=0,this.currentIdx=0}},{key:"renderGroup",value:function(t,e){return qo(this,void 0,void 0,n().mark((function i(){var r=this;return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.break||!1===t.attribute.visibleAll){i.next=11;break}if(!t.incremental||e.startAtId!==t._uid){i.next=7;break}return i.next=4,this._increaseRender(t,e);case 4:i.t0=void(e.break=!0),i.next=10;break;case 7:return i.next=9,new Promise((function(i){r.renderItem(t,e,{drawingCb:function(){return qo(r,void 0,void 0,n().mark((function r(){var a=this;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,_o(t,we.zIndex,(function(t){return qo(a,void 0,void 0,n().mark((function i(){return n().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(i.t0=e.break,i.t0){i.next=6;break}if(i.t1=t.isContainer,!i.t1){i.next=6;break}return i.next=6,this.renderGroup(t,e);case 6:case"end":return i.stop()}}),i,this)})))}));case 2:i(!1);case 3:case"end":return r.stop()}}),r)})))}})}));case 9:i.t0=void i.sent;case 10:return i.abrupt("return",i.t0);case 11:case"end":return i.stop()}}),i,this)})))}}]),i}(jo);Zo=$o([j(),Xo(0,R(js)),Xo(1,I(Vo)),Xo(2,I(Fo)),Xo(3,I(Q)),Xo(3,D(wo)),Yo("design:paramtypes",[Array,Object,Object,Object])],Zo);var Ko=new k((function(t){t(fs).toSelf().inSingletonScope(),t(gs).toSelf().inSingletonScope(),t(Ns).to(jo),t(Rs).to(Zo),t(Ds).to(zo).inSingletonScope(),t(js).toService(Ds),et(t,sr),t(ps).toSelf().inSingletonScope(),et(t,or),et(t,js),t(Eo).toSelf().inSingletonScope(),t(wo).toService(Eo),et(t,wo)}));Ze.load(tr),Ze.load(Qs),Ze.load(Fs),Ze.load(Js),Ze.load(so),function(t){t.load(oo),t.load(lo),t.load(mo)}(Ze),function(t){t.load(Ko)}(Ze);var Jo=Ze.get(rt);He.global=Jo;var Qo=Ze.get(Hn);He.graphicUtil=Qo;var tl=Ze.get(zn);He.transformUtil=tl;var el=Ze.get(On);He.graphicService=el;var il=Ze.get(Vn);He.layerService=il;const nl=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class rl extends Dn{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,i,n){e.isPlainObject(this.attribute[t])&&e.isPlainObject(i)&&!e.isFunction(this.attribute[t])&&!e.isFunction(i)?e.merge(this.attribute[t],i):this.attribute[t]=i,nl.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>nl.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,i){e.isNil(i)&&(i=Object.keys(t));for(let n=0;n<i.length;n++){const r=i[n];!e.isPlainObject(this.attribute[r])||e.isFunction(this.attribute[r])||e.isFunction(t[r])?this.attribute[r]=t[r]:e.merge(this.attribute[r],t[r])}}bindEvents(){}_getNodeId(t){return`${this.id}-${this.name}-${t}`}}const al={debounce:e.debounce,throttle:e.throttle};class sl extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},sl.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{var i,n;const{viewX:r,viewY:a}=t,{direction:s,width:o,height:l,range:u}=this.attribute,h=this._sliderSize,[d,c]=this._getScrollRange();let f;if("vertical"===s){const t=a-this._viewPosition.y,i=e.clamp(t-h/2,d,c);f=t/l,this._slider.setAttribute("y",i,!0)}else{const t=r-this._viewPosition.x,i=e.clamp(t-h/2,d,c);f=t/o,this._slider.setAttribute("x",i,!0)}this.setScrollRange([f-(u[1]-u[0])/2,f+(u[1]-u[0])/2],!1),(null===(i=this.stage)||void 0===i?void 0:i.autoRender)||null===(n=this.stage)||void 0===n||n.renderNextFrame()},this._onSliderPointerDown=t=>{t.stopPropagation();const{direction:e}=this.attribute;this._prePos="horizontal"===e?t.clientX:t.clientY,"browser"===Jo.env?(Jo.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),Jo.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute;let i,n,r=0;const{width:a,height:s}=this._getSliderRenderBounds();return"vertical"===e?(n=t.clientY,r=n-this._prePos,i=r/s):(n=t.clientX,r=n-this._prePos,i=r/a),[n,i]},this._onSliderPointerMove=al[this.attribute.delayType]((t=>{t.stopPropagation();const e=this.getScrollRange(),[i,n]=this._computeScrollValue(t);this.setScrollRange([e[0]+n,e[1]+n],!0),this._prePos=i}),this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:i=!0,range:n,limitRange:r=[0,1]}=this.attribute,a=this.getScrollRange(),[s,o]=this._computeScrollValue(t),l=[a[0]+o,a[1]+o];i||this._onChange({pre:n,value:e.clampRange(l,r[0],r[1])}),"browser"===Jo.env?(Jo.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),Jo.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,i=!0){var n,r;const{direction:a="horizontal",limitRange:s=[0,1],range:o,realTime:l=!0}=this.attribute,u=e.clampRange(t,s[0],s[1]);if(i){const t=this._getSliderPos(u);this._slider&&("horizontal"===a?this._slider.setAttribute("x",t[0],!0):this._slider.setAttribute("y",t[0],!0),(null===(n=this.stage)||void 0===n?void 0:n.autoRender)||null===(r=this.stage)||void 0===r||r.renderNextFrame())}this.attribute.range=u,l&&this._onChange({pre:o,value:u})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",al[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:i,height:n,range:r,limitRange:a=[0,1],railStyle:s,sliderStyle:o,padding:l=2}=this.attribute,u=this.createOrUpdateChild("scrollbar-container",{},"group"),h=u.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:i,height:n},s),"rect");this._rail=h;const d=this._getSliderRenderBounds(),c=this._getSliderPos(e.clampRange(r,a[0],a[1])),f=c[1]-c[0];let v;this._sliderSize=f,v="horizontal"===t?{x:c[0],y:d.y1,width:f,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:f};const p=u.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},v),{cornerRadius:this._getDefaultSliderCornerRadius()}),o),{boundsPadding:e.normalizePadding(l),pickMode:"imprecise"}),"rect");this._slider=p,this._container=u;const g=this._container.AABBBounds;this._viewPosition={x:g.x1,y:g.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:i,padding:n=2}=this.attribute,[r,a,s,o]=e.normalizePadding(n),l={x1:o,y1:r,x2:t-a,y2:i-s,width:t-(o+a),height:i-(r+s)};return this._sliderRenderBounds=l,l}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:n,x1:r,y1:a}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+r,i*t[1]+r]:[n*t[0]+a,n*t[1]+a]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:i}=this.attribute,[n,r]=e.clampRange(t,0,1),{width:a,height:s,x1:o,y1:l}=this._getSliderRenderBounds(),u=this._sliderSize;return"horizontal"===i?e.clampRange([o+n*a,o+r*a],o,a-u):e.clampRange([l+n*s,l+r*s],l,s-u)}_onChange(t){var e;const i=new bi("scroll",t);i.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,this.dispatchEvent(i)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function ol(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}function ll(t,e,i,n){var a,s=arguments.length,o=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"===("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var l=t.length-1;l>=0;l--)(a=t[l])&&(o=(s<3?a(o):s>3?a(e,i,o):a(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function ul(t,e,i,n){return new(i||(i=Promise))((function(r,a){function s(t){try{l(n.next(t))}catch(t){a(t)}}function o(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,o)}l((n=n.apply(t,e||[])).next())}))}var hl;sl.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0},"function"==typeof SuppressedError&&SuppressedError;let dl=hl=class{constructor(){this.name="scrollbar",this.activeEvent="onRegister",this._uid=A.GenAutoIncrementId(),this.key=this.name+this._uid,this.scroll=t=>{var i;const n=t.target,r=this.getScrollContainer(n),{g:a}=r;let{showH:s,showV:o}=r;if(!a||1===a.count)return;this.scrollContainerBounds=a.AABBBounds.clone(),e.abs(t.deltaX)>e.abs(t.deltaY)?(s=s&&!0,o=o&&!1):(s=s&&!1,o=o&&!0),a.setAttributes({scrollX:s?(a.attribute.scrollX||0)+t.deltaX:a.attribute.scrollX||0,scrollY:o?(a.attribute.scrollY||0)+t.deltaY:a.attribute.scrollY||0});const l=this.childrenBounds,u=this.scrollContainerBounds;l.clear(),a.forEachChildren((t=>{l.union(t.AABBBounds)})),l.transformWithMatrix(a.transMatrix),s&&u.x1<=l.x1&&u.x2>=l.x2&&(s=!1),o&&u.y1<=l.y1&&u.y2>=l.y2&&(o=!1);const h=a.transMatrix;u.translate(-h.e,-h.f),l.translate(-h.e,-h.f),s&&(l.x1=e.min(l.x1,u.x1),l.x2=e.max(l.x2,u.x2)),o&&(l.y1=e.min(l.y1,u.y1),l.y2=e.max(l.y2,u.y2)),l.translate(a.attribute.scrollX,a.attribute.scrollY);const d=(null!==(i=a.shadowRoot)&&void 0!==i?i:a.attachShadow()).createOrUpdateChild("scroll-bar",{},"group"),{h:c,v:f,deltaH:v,deltaV:p}=this.addOrUpdateScroll(s,o,d,a);a.setAttributes({scrollX:c?a.attribute.scrollX||0:(a.attribute.scrollX||0)+v,scrollY:f?a.attribute.scrollY||0:(a.attribute.scrollY||0)+p})}}activate(t){this.pluginService=t;const{stage:i}=this.pluginService;this.childrenBounds=new e.AABBBounds,i.addEventListener("wheel",this.scroll),this.params=hl.defaultParams}addOrUpdateScroll(t,e,i,n){const r=i.children;let a=!1,s=!1,o=0,l=0;if(t){const t=r.filter((t=>"vertical"!==t.attribute.direction))[0],e=this.addOrUpdateHScroll(this.scrollContainerBounds,i,t);a=e.valid,o=e.delta,this.disappearScrollBar(t,s)}if(e){const t=r.filter((t=>"vertical"===t.attribute.direction))[0],e=this.addOrUpdateVScroll(this.scrollContainerBounds,i,t);s=e.valid,l=e.delta,this.disappearScrollBar(t,s)}return{h:a,deltaH:o,v:s,deltaV:l}}addOrUpdateHScroll(t,e,i){i||(i=new sl({direction:"horizontal",x:0,y:0,width:t.width(),height:12,padding:[2,0],railStyle:{fill:"rgba(0, 0, 0, .1)"},range:[0,.05]}),e.add(i));const n=i.AABBBounds,r=this.childrenBounds,a=t.y2-n.height(),s=Math.min(n.width()/this.childrenBounds.width(),1);let o=(t.x1-r.x1)/(r.width()-t.width())*(1-s),l=!0,u=0;return o<0?(o=0,l=!1,u=t.x1-r.x1):o+s>1&&(o=1-s,l=!1,u=t.x1-r.x1-(r.width()-t.width())),i.setAttributes({y:a,visibleAll:!0,range:[o,o+s]}),{valid:l,delta:u}}addOrUpdateVScroll(t,e,i){i||(i=new sl({direction:"vertical",x:0,y:0,width:12,height:t.height(),padding:[2,0],railStyle:{fill:"rgba(0, 0, 0, .1)"},range:[0,.05]}),e.add(i));const n=i.AABBBounds,r=t.x2-n.width(),a=this.childrenBounds,s=Math.min(n.height()/a.height(),1);let o=(t.y1-a.y1)/(a.height()-t.height())*(1-s),l=!0,u=0;return o<0?(o=0,l=!1,u=t.y1-a.y1):o+s>1&&(o=1-s,l=!1,u=t.y1-a.y1-(a.height()-t.height())),i.setAttributes({x:r,visibleAll:!0,range:[o,o+s]}),{valid:l,delta:u}}disappearScrollBar(t,e){var i;t._plugin_timeout&&clearTimeout(t._plugin_timeout),t._plugin_timeout=setTimeout((()=>{t.setAttribute("visibleAll",!1)}),null!==(i=this.params.timeout)&&void 0!==i?i:0)}getScrollContainer(t){let e=t;for(;e;){if(e.attribute.overflow&&"hidden"!==e.attribute.overflow){const t=e.attribute.overflow;let i=!1,n=!1;return"scroll"===t?(i=!0,n=!0):(i="scroll-x"===t,n=!i),{g:e,showH:i,showV:n}}e=e.parent}return null}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("wheel",this.scroll)}};dl.defaultParams={timeout:500},dl=hl=ll([j()],dl);const cl=new k(((t,e,i,n)=>{i(dl)||(t(dl).toSelf(),t(to).toService(dl))}));function fl(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&fl(t,e)}))}const vl=t=>!e.isNil(t)&&!1!==t.visible;const pl=["#ffffff","#000000"],{Color:gl}=e.ColorUtil;function yl(t,e,i,n,r,a){if("string"!=typeof t||"string"!=typeof e)return t;const s=new gl(t).toHex(),o=new gl(e).toHex();return bl(s,o,i,n,a)?s:function(t,e,i,n,r,a){const s=[];r&&(r instanceof Array?s.push(...r):s.push(r));s.push(...pl);for(const r of s)if(t!==r&&bl(r,e,i,n,a))return r;return}(s,o,i,n,r,a)}function bl(t,e,i,n,r){if("lightness"===r){const i=gl.getColorBrightness(new gl(e));return gl.getColorBrightness(new gl(t))<.5?i>=.5:i<.5}return n?ml(t,e)>n:"largeText"===i?ml(t,e)>3:ml(t,e)>4.5}function ml(t,e){const i=xl(t),n=xl(e);return((i>n?i:n)+.05)/((i>n?n:i)+.05)}function xl(t){const i=e.ColorUtil.hexToRgb(t),n=i[0]/255,r=i[1]/255,a=i[2]/255;let s,o,l;s=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),o=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4),l=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4);return.2126*s+.7152*o+.0722*l}function _l(t,e,i,n){let r;switch(t){case"base":r=e;break;case"invertBase":r=i;break;case"similarBase":r=n}return r}function Al(t,e){return[t[0]*e,t[1]*e]}function kl(t,e,i){const n=function(t,e){const[i,n]=t,[r,a]=e,s=Math.sqrt((i*i+n*n)*(r*r+a*a)),o=s&&(i*r+n*a)/s;return Math.acos(Math.min(Math.max(o,-1),1))}(t,e),r=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return i?r?2*Math.PI-n:n:r?n:2*Math.PI-n}const Bl=-.5*Math.PI,wl=1.5*Math.PI,Sl="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol";var Tl;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Tl||(Tl={}));const Cl={[Tl.selectedReverse]:{},[Tl.selected]:{},[Tl.hover]:{},[Tl.hoverReverse]:{}},El={container:"",width:30,height:30,style:{}},Ml=(t,i,n)=>new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:Sl,fontSize:11},getTextBounds:n?void 0:ss,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t);function Pl(t,e){var i;if(!t)return{width:0,height:0};const n=ss({text:t,fontFamily:e.fontFamily,fontSize:e.fontSize||12,fontWeight:e.fontWeight,textAlign:null!==(i=e.textAlign)&&void 0!==i?i:"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||12});return{width:n.width(),height:n.height()}}class Ll extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ll.defaultAttributes,t)),this.name="tag"}render(){var t,i,n;const{text:r="",textStyle:a={},shape:s={},panel:o={},space:l=4,minWidth:u,maxWidth:h,padding:d=4,visible:c,state:f,type:v}=this.attribute,p=e.normalizePadding(d),g=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let y,b=p[1]+p[3],m=p[0]+p[2],x=0,_=0;const{visible:A}=s,k=ol(s,["visible"]);if(e.isBoolean(A)){const t=(null==k?void 0:k.size)||10,i=e.isNumber(t)?t:Math.max(t[0],t[1]);y=g.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},k),{visible:A,x:i/2,y:i/2}),"symbol"),e.isEmpty(null==f?void 0:f.shape)||(y.states=f.shape),A&&(_=i+l)}let B;if(b+=_,x+=_,"rich"===v){const n=Object.assign(Object.assign({textConfig:r,visible:e.isValid(r)&&!1!==c},a),{x:x,y:0,width:null!==(t=a.width)&&void 0!==t?t:0,height:null!==(i=a.height)&&void 0!==i?i:0});B=g.createOrUpdateChild("tag-text",n,"richtext");const{visible:s}=o,l=ol(o,["visible"]);if(c&&e.isBoolean(s)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},l),{visible:s&&!!r,x:B.AABBBounds.x1,y:B.AABBBounds.y1,width:B.AABBBounds.width(),height:B.AABBBounds.height()}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}else if("html"===v){const t=Object.assign(Object.assign({textConfig:[],visible:e.isValid(r)&&!1!==c,html:Object.assign(Object.assign({dom:r},El),a)},a),{x:x,y:0});B=g.createOrUpdateChild("tag-text",t,"richtext");const{visible:i}=o,n=ol(o,["visible"]);if(c&&e.isBoolean(i)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},n),{visible:i&&!!r,x:B.AABBBounds.x1,y:B.AABBBounds.y1,width:B.AABBBounds.width(),height:B.AABBBounds.height()}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}else{const t=Object.assign(Object.assign({text:r,visible:e.isValid(r)&&!1!==c,lineHeight:null==a?void 0:a.fontSize},a),{x:x,y:0});e.isNil(t.lineHeight)&&(t.lineHeight=a.fontSize),B=g.createOrUpdateChild("tag-text",t,"text"),e.isEmpty(null==f?void 0:f.text)||(B.states=f.text);const i=Pl(t.text,a),l=i.width,d=i.height;b+=l;const v=null!==(n=s.size)&&void 0!==n?n:10,A=e.isNumber(v)?v:Math.max(v[0],v[1]);m+=Math.max(d,(null==s?void 0:s.visible)?A:0);const{textAlign:k,textBaseline:w}=a;(e.isValid(u)||e.isValid(h))&&(e.isValid(u)&&b<u&&(b=u),e.isValid(h)&&b>h&&(b=h,B.setAttribute("maxLineWidth",h-p[1]-p[2])));let S=0,T=0;"center"===k?(S-=b/2,y&&y.setAttribute("x",(y.attribute.x||0)-l/2),g.setAttribute("x",-_/2)):"right"===k||"end"===k?(S-=b,y&&y.setAttribute("x",(y.attribute.x||0)-l),g.setAttribute("x",-p[1]-_)):"left"!==k&&"start"!==k||g.setAttribute("x",p[3]),"middle"===w?(T-=m/2,y&&y.setAttribute("y",0)):"bottom"===w?(T-=m,y&&y.setAttribute("y",-d/2),g.setAttribute("y",-p[2])):"top"===w&&(g.setAttribute("y",p[0]),y&&y.setAttribute("y",d/2));const{visible:C}=o,E=ol(o,["visible"]);if(c&&e.isBoolean(C)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},E),{visible:C&&!!r,x:S,y:T,width:b,height:m}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}}}Ll.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const Ol=new e.AABBBounds;class Il extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Il.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,i,n,r,a,s,o,l;const{titleStyle:u={},position:h,contentStyle:d={},panel:c={},space:f=4,minWidth:v=0,maxWidth:p=1/0,padding:g=4,maxWidthPercent:y,visible:b,state:m,dx:x=0,dy:_=0}=this.attribute;let{title:A="",content:k=""}=this.attribute;A=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(A):A,k=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(k):k;const B=e.normalizePadding(g),w=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),S=p-B[1]-B[3],T=e.isValid(A)&&!1!==b,C=Object.assign(Object.assign({text:e.isArray(A)?A:[A],visible:T},u),{x:B[3],y:B[0],maxLineWidth:S,textAlign:"left",textBaseline:"top"}),E=w.createOrUpdateChild("poptip-title",C,"wrapText");e.isEmpty(null==m?void 0:m.title)||(E.states=m.title);const M=E.AABBBounds,P=M.height(),L=M.width();let O=P+f;T||(O=0);const I=e.isValid(k)&&!1!==b,R=Object.assign(Object.assign({text:e.isArray(k)?k:[k],visible:I},d),{x:B[3],y:B[0]+O,maxLineWidth:S,textAlign:"left",textBaseline:"top"}),j=w.createOrUpdateChild("poptip-content",R,"wrapText");e.isEmpty(null==m?void 0:m.content)||(j.states=m.content);const D=j.AABBBounds,N=D.height(),U=D.width();I&&(O+=N);let z=e.max(L+B[1]+B[3],U+B[1]+B[3]);z>p?z=p:z<v&&(z=v);let H=B[0]+B[2]+O;const{visible:V}=c,W=ol(c,["visible"]),F=null!==(t=W.size)&&void 0!==t?t:12,G=e.isArray(F)?[F[0]+(null!==(i=W.space)&&void 0!==i?i:0),F[1]+(null!==(n=W.space)&&void 0!==n?n:0)]:F+(null!==(r=W.space)&&void 0!==r?r:0),$=null!==(a=W.lineWidth)&&void 0!==a?a:1,Y=this.stage?[null!==(s=this.stage.viewWidth)&&void 0!==s?s:this.stage.width,null!==(o=this.stage.viewHeight)&&void 0!==o?o:this.stage.height]:void 0;if(Y){const t=this.AABBBounds,i=null!==(l=this.attribute.x)&&void 0!==l?l:t.x1,n=Y[0]-t.x1;let r=Math.max(i,n);const a=(e.isArray(F)?F[0]:12)+3;if(r=Math.min(r-a,r*y),r<z){z=r;const t=B[1]+B[3];E.setAttribute("maxLineWidth",r-t),j.setAttribute("maxLineWidth",r-t),H=B[0]+B[2],T&&(H+=E.AABBBounds.height()+f),H+=j.AABBBounds.height()}}const X="auto"===h;let q,Z=-1/0;for(let t=0;t<this.positionList.length+1;t++){const i=X?this.positionList[t===this.positionList.length?q:t]:h,{angle:n,offset:r,rectOffset:a}=this.getAngleAndOffset(i,z,H,e.isArray(G)?G:[G,G-$]);if(e.isBoolean(V)){const t=(e.isArray(F)?F[0]:F)/4,i=w.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},W),{visible:V&&(I||T),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:n,dx:r[0],dy:r[1],size:F,zIndex:-9}),"symbol");e.isEmpty(null==m?void 0:m.panel)||(i.states=m.panel);const a=w.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},W),{visible:V&&(I||T),x:0,y:0,width:z,height:H,zIndex:-8}),"rect");e.isEmpty(null==m?void 0:m.panel)||(a.states=m.panel)}if(w.setAttributes({x:-r[0]+x,y:-r[1]+_}),!X||!Y)break;{Ol.setValue(0,0,z,H).transformWithMatrix(w.globalTransMatrix);const i=Ol,n=(new e.Bounds).setValue(0,0,Y[0],Y[1]);if(e.rectInsideAnotherRect(i,n,!1))break;{const r=e.getRectIntersect(i,n,!1),a=(r.x2-r.x1)*(r.y2-r.y1);a>Z&&(Z=a,q=t)}}}}getAngleAndOffset(t,i,n,r){const a=r[1]/2;switch(t){case"tl":return{angle:e.pi/2*3,offset:[i/4,n+a],rectOffset:[-i/4,-n-r[1]]};case"top":return{angle:e.pi/2*3,offset:[i/2,n+a],rectOffset:[0,-n-r[1]]};case"tr":return{angle:e.pi/2*3,offset:[i/4*3,n+a],rectOffset:[i/4*3,-n-r[1]]};case"rt":return{angle:0,offset:[-a,n/5],rectOffset:[i/4*3,-n-r[1]]};case"right":return{angle:0,offset:[-a,n/2],rectOffset:[i/4*3,-n-r[1]]};case"rb":return{angle:0,offset:[-a,n/5*4],rectOffset:[i/4*3,-n-r[1]]};case"bl":return{angle:e.pi/2,offset:[i/4,-a],rectOffset:[-i/4,-n-r[1]]};case"bottom":return{angle:e.pi/2,offset:[i/2,-a],rectOffset:[0,-n-r[1]]};case"br":return{angle:e.pi/2,offset:[i/4*3,-a],rectOffset:[i/4*3,-n-r[1]]};case"lt":return{angle:e.pi,offset:[i+a,n/5],rectOffset:[-i/4,-n-r[1]]};case"left":return{angle:e.pi,offset:[i+a,n/2],rectOffset:[0,-n-r[1]]};case"lb":return{angle:e.pi,offset:[i+a,n/5*4],rectOffset:[i/4*3,-n-r[1]]}}}}Il.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};const Rl={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},jl={poptip:e.merge({},Rl)};let Dl=class{render(t,i,n,r,a,s,o,l,u,h,d,c,f){var v,p,g;if(1===t._showPoptip){const{visible:i,visibleCb:n}=t.attribute.poptip||{};if(!1===i||n&&!1===n(t))return;const r={};e.merge(r,Il.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(r):this.poptipComponent=new Il(r);let a=t.attribute.poptip||{};if("text"===t.type&&null==a.title&&null==a.content){const i={};p=i,g=a,e.merge(p,jl.poptip,g),a=i,a.content=null!==(v=a.content)&&void 0!==v?v:t.attribute.text}const s=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},a),{x:s.e,y:s.f})),h.stage.tryInitInteractiveLayer();const o=h.stage.getLayer("_builtin_interactive");o&&o.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&this.poptipComponent.setAttributes({visibleAll:!1}))}};Dl=ll([j()],Dl);let Nl=class{constructor(){this.name="poptip",this.activeEvent="onRegister",this._uid=A.GenAutoIncrementId(),this.key=this.name+this._uid,this.poptip=t=>{const e=t.target;if(e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}};Nl=ll([j()],Nl);let Ul=class{constructor(){this.name="poptipForText",this.activeEvent="onRegister",this._uid=A.GenAutoIncrementId(),this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)},this.poptip=t=>{const e=t.target;if("text"!==e.type||!e.cliped||e.isContainer||!e.attribute)return void this.unpoptip(t);if(e===this.activeGraphic)return;const{poptip:i={}}=e.attribute;i&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0)},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip),e.addEventListener("pointerleave",this.pointerlave)}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip),e.removeEventListener("pointerleave",this.pointerlave)}};Ul=ll([j()],Ul);const zl=new k(((t,e,i,n)=>{i(Dl)||(t(Dl).toSelf().inSingletonScope(),t(or).toService(Dl)),i(Nl)||(t(Nl).toSelf(),t(to).toService(Nl)),i(Ul)||(t(Ul).toSelf(),t(to).toService(Ul))}));class Hl extends rl{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}class Vl extends Hl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Vl.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},n),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}Vl.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};class Wl extends Hl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Wl.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},n),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}Wl.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}};class Fl extends Hl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Fl.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:n}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),n),"arc")}setLocation(t){const{center:i}=this.attribute,n=e.PointService.distancePP(t,i);this.setAttribute("radius",n)}}Fl.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};class Gl extends Hl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Gl.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:n=0,sectorStyle:r}=this.attribute,{startAngle:a,endAngle:s}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:n,startAngle:a,endAngle:s}),r),"arc")}setLocation(t){const{center:i,startAngle:n=Bl,endAngle:r=wl}=this.attribute,a=r-n,s=e.radianToDegree(e.getAngleByPoint(i,t));this.setAttributes({startAngle:s-a/2,endAngle:s+a/2})}}Gl.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}};class $l extends Hl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},$l.defaultAttributes,t))}renderCrosshair(t){const{center:i,radius:n,sides:r=6,lineStyle:a}=this.attribute,{startAngle:s,endAngle:o}=this.attribute,l=(o-s)%(2*Math.PI)==0,u=(o-s)/r;let h;for(let t=0;t<=r;t++){const a=s+u*t,o=e.polarToCartesian(i,n,a);0===t?h=`M${o.x},${o.y}`:h+=`L${o.x},${o.y}`,t===r&&l&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:h},a),"path")}setLocation(t){const{center:i}=this.attribute,n=e.PointService.distancePP(t,i);this.setAttribute("radius",n)}}$l.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const Yl=5,Xl=31,ql=32,Zl=new Uint32Array(ql+1),Kl=new Uint32Array(ql+1);Kl[0]=0,Zl[0]=~Kl[0];for(let t=1;t<=ql;++t)Kl[t]=Kl[t-1]<<1|1,Zl[t]=~Kl[t];function Jl(t,e,i=0){const n=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*i+n)/n),a=~~((e+2*i+n)/n),s=t=>~~((t+i)/n);return s.invert=t=>t*n-i,s.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+ql)/ql));function n(t,e){i[t]|=e}function r(t,e){i[t]&=e}return{array:i,get:(e,n)=>{const r=n*t+e;return i[r>>>Yl]&1<<(r&Xl)},set:(e,i)=>{const r=i*t+e;n(r>>>Yl,1<<(r&Xl))},clear:(e,i)=>{const n=i*t+e;r(n>>>Yl,~(1<<(n&Xl)))},getRange:({x1:n,y1:r,x2:a,y2:s})=>{if(a<0||s<0||n>t||r>e)return!0;let o,l,u,h,d=s;for(;d>=r;--d)if(o=d*t+n,l=d*t+a,u=o>>>Yl,h=l>>>Yl,u===h){if(i[u]&Zl[o&Xl]&Kl[1+(l&Xl)])return!0}else{if(i[u]&Zl[o&Xl])return!0;if(i[h]&Kl[1+(l&Xl)])return!0;for(let t=u+1;t<h;++t)if(i[t])return!0}return!1},setRange:({x1:i,y1:r,x2:a,y2:s})=>{if(a<0||s<0||i>t||r>e)return;let o,l,u,h,d;for(;r<=s;++r)if(o=r*t+i,l=r*t+a,u=o>>>Yl,h=l>>>Yl,u===h)n(u,Zl[o&Xl]&Kl[1+(l&Xl)]);else for(n(u,Zl[o&Xl]),n(h,Kl[1+(l&Xl)]),d=u+1;d<h;++d)n(d,4294967295)},clearRange:({x1:e,y1:i,x2:n,y2:a})=>{let s,o,l,u,h;for(;i<=a;++i)if(s=i*t+e,o=i*t+n,l=s>>>Yl,u=o>>>Yl,l===u)r(l,Kl[s&Xl]|Zl[1+(o&Xl)]);else for(r(l,Kl[s&Xl]),r(u,Zl[1+(o&Xl)]),h=l+1;h<u;++h)r(h,0)},outOfBounds:({x1:i,y1:n,x2:r,y2:a})=>i<0||n<0||a>=e||r>=t,toImageData:n=>{const r=n.createImageData(t,e),a=r.data;for(let n=0;n<e;++n)for(let e=0;e<t;++e){const r=n*t+e,s=4*r,o=i[r>>>Yl]&1<<(r&Xl);a[s+0]=255*o,a[s+1]=255*o,a[s+2]=255*o,a[s+3]=31}return r}}}(r,a),s.ratio=n,s.padding=i,s.width=t,s.height=e,s}function Ql(t,i,n=!1){if(n){const{x1:n,x2:r,y1:a,y2:s}=i,o=e.clamp(n,0,t.width),l=e.clamp(r,0,t.width),u=e.clamp(a,0,t.height),h=e.clamp(s,0,t.height);return{x1:t(o),x2:t(l),y1:t(u),y2:t(h)}}return{x1:t(i.x1),x2:t(i.x2),y1:t(i.y1),y2:t(i.y2)}}function tu(t,e,i,n=!0,r=0){let a=i;r>0&&(a={x1:i.x1-r,x2:i.x2+r,y1:i.y1-r,y2:i.y2+r}),a=Ql(t,a);return!(n&&e.outOfBounds(a))&&!e.getRange(a)}function eu(t,i,n,r=[],a=!0,s=0){const o=r.filter((t=>e.isValid(t)));for(let e=0;e<o.length;e++){const r=n.clone();if(r.setAttributes(o[e]),r.update(),tu(t,i,Ql(t,r.AABBBounds),a,s))return i.setRange(Ql(t,r.AABBBounds,!0)),o[e]}return!1}function iu(t,i,n,r,a,s,o){var l,u;const h=null===(l=r.overlap)||void 0===l?void 0:l.clampForce,d=null===(u=r.overlap)||void 0===u?void 0:u.overlapPadding;if("bound"===n.type||"position"===n.type){if(e.isFunction(o)){const l=((e.isFunction(n.position)?n.position(a.attribute):n.position)||function(t){if("rect"===t)return ru;return nu}(r.type)).map((t=>o(a.AABBBounds,s,t,r.offset)));return eu(t,i,a,l,h,d)}return!1}if("moveY"===n.type){const r=(n.offset?e.isFunction(n.offset)?n.offset(a.attribute):n.offset:[]).map((t=>({x:a.attribute.x,y:a.attribute.y+t})));return eu(t,i,a,r,h,d)}if("moveX"===n.type){const r=(n.offset?e.isFunction(n.offset)?n.offset(a.attribute):n.offset:[]).map((t=>({x:a.attribute.x+t,y:a.attribute.y})));return eu(t,i,a,r,h,d)}return!1}const nu=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],ru=["top","inside-top","inside"];function au(t,e,i){const{x1:n,x2:r,y1:a,y2:s}=t.AABBBounds,o=Math.min(n,r),l=Math.max(n,r),u=Math.min(a,s),h=Math.max(a,s);let d=0,c=0;return o<0&&l-o<=e?d=-o:l>e&&o-(l-e)>=0&&(d=e-l),u<0&&h-u<=i?c=-u:h>i&&u-(h-i)>=0&&(c=i-h),{dx:d,dy:c}}const su={fadeIn:(t={})=>{var e,i,n;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(n=t.strokeOpacity)&&void 0!==n?n:1}}},fadeOut:(t={})=>{var e,i,n;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(n=t.strokeOpacity)&&void 0!==n?n:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function ou(t,e){var i,n;return null!==(n=null===(i=su[e])||void 0===i?void 0:i.call(su,t))&&void 0!==n?n:{from:{},to:{}}}const lu=(t,i,n,r)=>{const a=Object.assign({},t.attribute),s=Object.assign({},i.attribute);return e.array(null==r?void 0:r.excludeChannels).forEach((t=>{delete s[t]})),Object.keys(s).forEach((t=>{n&&!n.includes(t)&&delete s[t]})),{from:a,to:s}};function uu(t,i,n,r){t.attribute.text!==i.attribute.text&&e.isValidNumber(Number(t.attribute.text)*Number(i.attribute.text))&&t.animate().play(new zi({text:t.attribute.text},{text:i.attribute.text},n,r))}const hu={mode:"same-time",duration:300,easing:"linear"};function du(t,e,i,n){const r=function(t){return t.radius?{x:Math.cos(t.angle)*t.radius,y:Math.sin(t.angle)*t.radius}:{x:0,y:0}}({radius:i,angle:n});return{x:t+r.x,y:e+r.y}}function cu(t){return(t=function(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function fu(t){return 3===t||4===t}function vu(t,e){const{x1:i,y1:n,x2:r,y2:a}=t,{x1:s,y1:o,x2:l,y2:u}=e;return!(i<=s&&r<=s||i>=l&&r>=l||n<=o&&a<=o||n>=u&&a>=u)}const pu=(t,e,i="top",n=0)=>{if(!t)return;const{x1:r,y1:a,x2:s,y2:o}=t,l=Math.abs(s-r),u=Math.abs(o-a),h=(e.x1+e.x2)/2,d=(e.y1+e.y2)/2;let c=0,f=0,v=0,p=0;e&&(v=Math.abs(e.x1-e.x2)/2,p=Math.abs(e.y1-e.y2)/2);const g={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":f=-1;break;case"bottom":f=1;break;case"left":c=-1;break;case"right":c=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":c=Math.sin(g[i]*(Math.PI/180)),f=Math.cos(g[i]*(Math.PI/180));break;case"center":c=0,f=0}return{x:h+c*(n+v)+Math.sign(c)*(l/2),y:d+f*(n+p)+Math.sign(f)*(u/2)}},gu=t=>{if(!t||!t.attribute)return[];const{points:e,segments:i}=t.attribute;if(i&&i.length){const t=[];return i.forEach((e=>{e.points.forEach((e=>{t.push(e)}))})),t}return e};function yu(t,e,i="end",n=0){if(!t||!e)return;const{x1:r,x2:a}=t,s=Math.abs(a-r),o=e.x1;let l=o;return"end"===i?l=o+s/2+n:"start"===i&&(l=o-s/2-n),{x:l,y:e.y1}}class bu extends rl{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},bu.defaultAttributes,t)),this.name="label",this._onHover=t=>{const i=t.target;i===this._lastHover||e.isEmpty(i.states)||(i.addState(Tl.hover,!0),fl(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Tl.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(fl(this,(t=>{e.isEmpty(t.states)||(t.removeState(Tl.hoverReverse),t.removeState(Tl.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState("selected"))return this._lastSelect=null,void fl(this,(t=>{e.isEmpty(t.states)||(t.removeState(Tl.selectedReverse),t.removeState(Tl.selected))}));e.isEmpty(i.states)||(i.addState(Tl.selected,!0),fl(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Tl.selectedReverse,!0)})),this._lastSelect=i)},this._handleRelatedGraphicSetState=t=>{var e,i,n;if((null===(e=t.detail)||void 0===e?void 0:e.type)===yt.STATE){const e=null!==(n=null===(i=t.target)||void 0===i?void 0:i.currentStates)&&void 0!==n?n:[];(this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)]).forEach((t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))}))}}}labeling(t,e,i,n){}_labelLine(t){}render(){if(this._prepare(),e.isNil(this._idToGraphic)||this._isCollectionBase&&e.isNil(this._idToPoint))return;const{overlap:t,smartInvert:i,dataFilter:n,customLayoutFunc:r,customOverlapFunc:a}=this.attribute;let s,o=this.attribute.data;e.isFunction(n)&&(o=n(o)),s=e.isFunction(r)?r(o,this.getRelatedGrphic,this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(o),e.isFunction(a)?s=a(s,this.getRelatedGrphic,this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(s=this._overlapping(s)),!1!==i&&this._smartInvert(s),this._renderLabels(s)}_bindEvent(t){if(this.attribute.disableTriggerEvent)return;if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const i=this.attribute.state;i&&!e.isEmpty(i)&&(t.states=i)}_setStatesOfLabelLine(t){if(!t)return;const i=this.attribute.labelLineState;i&&!e.isEmpty(i)&&(t.states=i)}_createLabelText(t){var e,i;if("rich"===t.textType){t.textConfig=t.text,t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0;const n=as.richtext(t);return this._bindEvent(n),this._setStatesOfText(n),n}if("html"===t.textType){t.textConfig=[],t.html=Object.assign(Object.assign({dom:t.text},El),t);const e=as.richtext(t);return this._bindEvent(e),this._setStatesOfText(e),e}const n=as.text(t);return this._bindEvent(n),this._setStatesOfText(n),n}_prepare(){var t,i,n,r,a;const s=[];let o;if(o=e.isFunction(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),o.forEach((t=>{"willRelease"!==t.releaseStatus&&s.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(i=this._idToPoint)||void 0===i||i.clear(),this._baseMarks=s,this._isCollectionBase="line-data"===this.attribute.type,!s||0===s.length)return;const{data:l}=this.attribute;if(l&&0!==l.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let i=0;i<s.length;i++){const n=s[i],r=gu(n);if(null==r?void 0:r.length)for(let i=0;i<r.length;i++){const a=l[t];a&&r[i]&&(e.isValid(a.id)||(a.id=`vrender-component-${this.name}-${t}`),this._idToPoint.set(a.id,r[i]),this._idToGraphic.set(a.id,n)),t++}}}else for(let t=0;t<s.length;t++){const i=l[t],n=s[t];i&&n&&(e.isValid(i.id)||(i.id=`vrender-component-${this.name}-${t}`),this._idToGraphic.set(i.id,n))}!1!==this.attribute.animation&&(this._animationConfig={enter:e.merge({},hu,this.attribute.animation,null!==(n=this.attribute.animationEnter)&&void 0!==n?n:{}),exit:e.merge({},hu,this.attribute.animation,null!==(r=this.attribute.animationExit)&&void 0!==r?r:{}),update:e.isArray(this.attribute.animationUpdate)?this.attribute.animationUpdate:e.merge({},hu,this.attribute.animation,null!==(a=this.attribute.animationUpdate)&&void 0!==a?a:{})})}}getRelatedGrphic(t){return this._idToGraphic.get(t.id)}_layout(t=[]){const{textStyle:i={},position:n,offset:r}=this.attribute,a=[];for(let s=0;s<t.length;s++){const o=t[s],l=this.getRelatedGrphic(o),u=Object.assign(Object.assign({fill:this._isCollectionBase?e.isArray(l.attribute.stroke)?l.attribute.stroke.find((t=>!!t&&!0!==t)):l.attribute.stroke:l.attribute.fill},i),o),h=this._createLabelText(u),d=this.getGraphicBounds(h),c=e.isFunction(n)?n(o):n,f=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(o.id),c):this.getGraphicBounds(l,{x:o.x,y:o.y},c),v=this.labeling(d,f,c,r);v&&(u.x=v.x,u.y=v.y,h.setAttributes(v)),a.push(h)}return a}_overlapping(t){var i,n,r,a;if(0===t.length)return[];const s=this.attribute.overlap,o=[],l=this.getBaseMarkGroup(),u=null!==(i=s.size)&&void 0!==i?i:{width:null!==(n=null==l?void 0:l.AABBBounds.width())&&void 0!==n?n:0,height:null!==(r=null==l?void 0:l.AABBBounds.height())&&void 0!==r?r:0};if(0===u.width||0===u.height)return t;const{avoidBaseMark:h,strategy:d=[],hideOnHit:c=!0,clampForce:f=!0,avoidMarks:v=[],overlapPadding:p}=s,g=this._bmpTool||Jl(u.width,u.height),y=this._bitmap||g.bitmap(),b=d.some((t=>"bound"===t.type));h&&(null===(a=this._baseMarks)||void 0===a||a.forEach((t=>{t.AABBBounds&&y.setRange(Ql(g,t.AABBBounds,!0))}))),v.length>0&&v.forEach((t=>{e.isString(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&y.setRange(Ql(g,t.AABBBounds,!0))})):t.AABBBounds&&y.setRange(Ql(g,t.AABBBounds,!0))}));for(let i=0;i<t.length;i++){if(!1===t[i].visible)continue;const n=t[i],r=this.getRelatedGrphic(n.attribute);if(n.update(),!e.isRectIntersect(r.AABBBounds,{x1:0,x2:g.width,y1:0,y2:g.height},!0))continue;if(tu(g,y,n.AABBBounds,f,p)){if(!b){y.setRange(Ql(g,n.AABBBounds,!0)),o.push(n);continue}if(b&&(null==r?void 0:r.AABBBounds)&&this._canPlaceInside(n.AABBBounds,null==r?void 0:r.AABBBounds)){y.setRange(Ql(g,n.AABBBounds,!0)),o.push(n);continue}}let a=!1;for(let e=0;e<d.length;e++)if(a=iu(g,y,d[e],this.attribute,n,this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(t[i].attribute.id)):this.getGraphicBounds(r,t[i].attribute),this.labeling),!1!==a){n.setAttributes({x:a.x,y:a.y}),o.push(n);break}if(!a&&f){const{dx:t=0,dy:e=0}=au(n,g.width,g.height);if(0===t&&0===e){if(tu(g,y,n.AABBBounds)){y.setRange(Ql(g,n.AABBBounds,!0)),o.push(n);continue}}else if(tu(g,y,{x1:n.AABBBounds.x1+t,x2:n.AABBBounds.x2+t,y1:n.AABBBounds.y1+e,y2:n.AABBBounds.y2+e})){n.setAttributes({x:n.attribute.x+t,y:n.attribute.y+e}),y.setRange(Ql(g,n.AABBBounds,!0)),o.push(n);continue}}!a&&!c&&o.push(n)}return e.isFunction(this.onAfterLabelOverlap)&&this.onAfterLabelOverlap(y),o}getBaseMarkGroup(){const{baseMarkGroupName:t}=this.attribute;if(t)return this.getRootNode().find((e=>e.name===t),!0)}getGraphicBounds(t,e={}){return(null==t?void 0:t.AABBBounds)||{x1:e.x,x2:e.x,y1:e.y,y2:e.y}}_renderLabels(t){!1===this._enableAnimation||!1===this.attribute.animation?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){const i=new Map,n=this._graphicToText||new Map,r=[];t.forEach(((t,a)=>{var s,o,l,u,h,d,c;const f=this._labelLine(t),v=this.getRelatedGrphic(t.attribute),p=t.attribute.id,g=this._isCollectionBase?p:v,y=(null==n?void 0:n.get(g))?"update":"enter";if("enter"===y){if(r.push(t),i.set(g,f?{text:t,labelLine:f}:{text:t}),v){const{from:e,to:i}=ou(t.attribute,"fadeIn");this.add(t),f&&(this._setStatesOfLabelLine(f),this.add(f)),this._syncStateWithRelatedGraphic(v),v.once("animate-bind",(n=>{t.setAttributes(e);const s=this._afterRelatedGraphicAttributeUpdate(t,r,a,v,i,this._animationConfig.enter);v.on("afterAttributeUpdate",s)}))}}else if("update"===y){const r=n.get(g);n.delete(g),i.set(g,r);const a=r.text,{duration:f,easing:v}=this._animationConfig.update;!function(t,i,n){if(!e.isArray(n)){const{duration:e,easing:r,increaseEffect:a=!0}=n;return t.animate().to(i.attribute,e,r),void(a&&uu(t,i,e,r))}n.forEach(((n,r)=>{const{duration:a,easing:s,increaseEffect:o=!0,channel:l}=n,{from:u,to:h}=lu(t,i,l,n.options);e.isEmpty(h)||t.animate().to(h,a,s),"text"in u&&"text"in h&&o&&uu(t,i,a,s)}))}(a,t,this._animationConfig.update),r.labelLine&&r.labelLine.animate().to(e.merge({},r.labelLine.attribute,{visible:null===(d=null!==(u=(null===(o=null===(s=t.attribute)||void 0===s?void 0:s.line)||void 0===o?void 0:o.visible)&&(null===(l=t.attribute)||void 0===l?void 0:l.visible))&&void 0!==u?u:null===(h=t.attribute)||void 0===h?void 0:h.visible)||void 0===d||d,points:null===(c=t.attribute)||void 0===c?void 0:c.points}),f,v)}})),n.forEach((t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(ou(t.text.attribute,"fadeOut").to,this._animationConfig.exit.duration,this._animationConfig.exit.easing).onEnd((()=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)}))})),this._graphicToText=i}_renderWithOutAnimation(t){const e=new Map,i=this._graphicToText||new Map;t.forEach((t=>{var n;const r=this._labelLine(t),a=this.getRelatedGrphic(t.attribute),s=(null==i?void 0:i.get(a))?"update":"enter",o=this._isCollectionBase?t.attribute.id:a;if("enter"===s)e.set(o,r?{text:t,labelLine:r}:{text:t}),this.add(t),r&&this.add(r),this._syncStateWithRelatedGraphic(a);else if("update"===s){const r=i.get(o);i.delete(o),e.set(o,r),r.text.setAttributes(t.attribute),(null==r?void 0:r.labelLine)&&r.labelLine.setAttributes({points:null===(n=t.attribute)||void 0===n?void 0:n.points})}})),i.forEach((t=>{this.removeChild(t.text),(null==t?void 0:t.labelLine)&&this.removeChild(t.labelLine)})),this._graphicToText=e}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,n,r,{mode:a,duration:s,easing:o,delay:l}){const u=h=>{var d,c;const{detail:f}=h;if(!f)return{};if(!(f&&f.type===yt.ANIMATE_UPDATE&&f.animationState&&"wait"!==(null===(d=f.animationState.step)||void 0===d?void 0:d.type)))return{};if(f.type===yt.ANIMATE_END)return void t.setAttributes(r);const v=()=>{n&&(n.onAnimateBind=void 0,n.removeEventListener("afterAttributeUpdate",u))};switch(a){case"after":f.animationState.end&&t.animate({onStart:v}).wait(l).to(r,s,o);break;case"after-all":i===e.length-1&&f.animationState.end&&e.forEach((t=>{t.animate({onStart:v}).wait(l).to(r,s,o)}));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!n.containsPoint(e.x,e.y,gt.LOCAL,null===(c=this.stage)||void 0===c?void 0:c.pickerService)||t.animate({onStart:v}).wait(l).to(r,s,o)}else f.animationState.isFirstFrameOfStep&&t.animate({onStart:v}).wait(l).to(r,s,o)}};return u}_smartInvert(t){var e,i,n,r,a;const s=this.attribute.smartInvert||{},{textType:o,contrastRatiosThreshold:l,alternativeColors:u,mode:h}=s,d=null!==(e=s.fillStrategy)&&void 0!==e?e:"invertBase",c=null!==(i=s.strokeStrategy)&&void 0!==i?i:"base",f=null!==(n=s.brightColor)&&void 0!==n?n:"#ffffff",v=null!==(r=s.darkColor)&&void 0!==r?r:"#000000",p=null!==(a=s.outsideEnable)&&void 0!==a&&a;if("null"!==d||"null"!==c)for(let e=0;e<t.length;e++){const i=t[e];if(!i)continue;const n=this.getRelatedGrphic(i.attribute),r=n.attribute.fill,a=r,s=yl(i.attribute.fill,r,o,l,u,h),g=bl(s,f)?f:v;if(p){const t=_l(d,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=_l(c,a,s,g);e&&i.setAttributes({stroke:e})}else{if(this._canPlaceInside(i.AABBBounds,null==n?void 0:n.AABBBounds)){const t=_l(d,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=_l(c,a,s,g);e&&i.setAttributes({stroke:e})}else{if(0===i.attribute.lineWidth)continue;if(i.attribute.stroke){i.setAttributes({fill:yl(i.attribute.fill,i.attribute.stroke,o,l,u,h)});continue}const t=_l(d,a,s,g);t&&i.setAttributes({fill:t});const e=_l(c,a,s,g);e&&i.setAttributes({stroke:e})}}}}_canPlaceInside(t,e){return!(!t||!e)&&e.encloses(t)}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._enableAnimation=!1}enableAnimation(){this._enableAnimation=!0}}bu.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},offset:0,pickable:!1};class mu extends bu{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},mu.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",n=0){return pu(t,e,i,n)}}mu.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class xu extends bu{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},xu.defaultAttributes,t))}labeling(t,e,i="top",n=0){if(!t||!e)return;const{x1:r,y1:a,x2:s,y2:o}=t,l=Math.abs(s-r),u=Math.abs(o-a),h=Math.abs(e.x2-e.x1),d=Math.abs(e.y2-e.y1);let c=(e.x1+e.x2)/2,f=(e.y1+e.y2)/2,v=0,p=0;switch(i){case"top":case"inside-top":p=-.5;break;case"bottom":case"inside-bottom":p=.5;break;case"left":case"inside-left":v=-.5;break;case"right":case"inside-right":v=.5;break;case"top-right":v=.5,p=-.5;break;case"top-left":v=-.5,p=-.5;break;case"bottom-right":v=.5,p=.5;break;case"bottom-left":v=-.5,p=.5}c+=v*h,f+=p*d;let g=0,y=0;const b=i.includes("inside");switch(i.includes("top")?y=b?1:-1:i.includes("bottom")?y=b?-1:1:i.includes("left")?g=b?1:-1:i.includes("right")&&(g=b?-1:1),i){case"top-right":case"bottom-right":g=-1;break;case"top-left":case"bottom-left":g=1}return{x:c+g*n+g*l/2,y:f+y*n+y*u/2}}}xu.tag="rect-label",xu.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class _u extends bu{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},_u.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var n;if(!t||"line"!==t.type)return super.getGraphicBounds(t,e);const r=(null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)||[e],a="start"===i?0:r.length-1;return{x1:r[a].x,x2:r[a].x,y1:r[a].y,y2:r[a].y}}labeling(t,e,i="end",n=0){return yu(t,e,i,n)}}_u.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Au{constructor(t,e,i,n,r,a,s,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=n,this.radian=r,this.middleAngle=a,this.innerRadius=s,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class ku extends bu{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ku.defaultAttributes,t)),this.name="arc-label",this._ellipsisWidth=0,this._arcLeft=new Map,this._arcRight=new Map}_overlapping(t){return t}labeling(t,e,i="outside",n=0){if(t&&e)return{x:0,y:0}}_layout(t=[]){const e=super._layout(t),i=e.map((t=>this.getGraphicBounds(t))),n=Object.assign(Object.assign({},this.attribute.textStyle),{text:"..."}),r=this._createLabelText(n),a=this.getGraphicBounds(r),s=a.x2-a.x1,o=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),t,i,s);for(let i=0;i<t.length;i++){const n=t[i],r=o.find((t=>{var e;return(null===(e=t.refDatum)||void 0===e?void 0:e.id)===n.id})),a={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,maxLineWidth:r.labelLimit,points:(null==r?void 0:r.pointA)&&(null==r?void 0:r.pointB)&&(null==r?void 0:r.pointC)?[r.pointA,r.pointB,r.pointC]:void 0,line:null==r?void 0:r.labelLine};e[i].setAttributes(a)}return e}layoutArcLabels(t,i,n,r,a,s){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=s;let o=0;n.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)})),r.forEach(((t,n)=>{var s,l;const u=this._idToGraphic.get(t.id).attribute,h={x:null!==(s=null==u?void 0:u.x)&&void 0!==s?s:0,y:null!==(l=null==u?void 0:u.y)&&void 0!==l?l:0};if(!e.isNil(r[n])&&!e.isNil(a[n])){const t=r[n]?r[n]:null,e=a[n]?a[n]:{x1:0,x2:0,y1:0,y2:0},s=(u.startAngle+u.endAngle)/2,l=u.endAngle-u.startAngle,c=cu(u.endAngle-l/2),f=du(h.x,h.y,u.outerRadius,s),v=du(h.x,h.y,o+i.line.line1MinLength,s),p=new Au(t,f,v,c,l,s,u.innerRadius,u.outerRadius,h);p.pointA=du(h.x,h.y,this.computeDatumRadius(2*h.x,2*h.y,u.outerRadius),p.middleAngle),p.labelSize={width:e.x2-e.x1,height:e.y2-e.y1},1===(d=p.quadrant)||2===d?this._arcRight.set(p.refDatum,p):fu(p.quadrant)&&this._arcLeft.set(p.refDatum,p)}var d}));const l=Array.from(this._arcLeft.values()),u=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":h.push(...this._layoutInsideLabels(u,i,n)),h.push(...this._layoutInsideLabels(l,i,n));break;default:h.push(...this._layoutOutsideLabels(u,i,n)),h.push(...this._layoutOutsideLabels(l,i,n))}return h}_layoutInsideLabels(t,i,n){var r,a;const s=i,o=s.spaceWidth,l=null!==(r=null==s?void 0:s.position)&&void 0!==r?r:"inside",u=null!==(a=null==s?void 0:s.offsetRadius)&&void 0!==a?a:-o;return t.forEach((t=>{var n,r,a;const{labelSize:h,radian:d}=t,c=t.innerRadius,f=t.outerRadius,v=function(t,e){return e>2*t?NaN:2*Math.asin(e/2/t)}(f,h.height);let p;if(d<v)p=0;else{let t;t=d>=Math.PI?c:Math.max(c,h.height/2/Math.tan(d/2)),p=f-t-o}!0!==(null==s?void 0:s.rotate)&&(p=f-o);const g=this._getFormatLabelText(t.refDatum,p);t.labelText=g;const y=Math.min(p,t.labelSize.width),b=this._computeAlign(t,i);let m,x=0;"inside"===l&&(x="left"===b?y:"right"===b?0:y/2),m="inside-inner"===l?c-u+x:f+u-x,t.labelPosition=du(t.circleCenter.x,t.circleCenter.y,m,t.middleAngle),t.labelLimit=y,e.isGreater(y,0)||(t.labelVisible=!1),t.angle=null!==(r=null===(n=null==i?void 0:i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:t.middleAngle;let _=null!==(a=null==s?void 0:s.offsetAngle)&&void 0!==a?a:0;["inside-inner","inside-outer"].includes(l)&&(_+=Math.PI/2),t.angle+=_})),t}_layoutOutsideLabels(t,i,n){var r,a,s,o,l;const u=null!==(a=null===(r=n[0].attribute)||void 0===r?void 0:r.x)&&void 0!==a?a:0,h=2*(null!==(o=null===(s=n[0].attribute)||void 0===s?void 0:s.y)&&void 0!==o?o:0),d=i.line.line2MinLength,c=i.layout,f=i.spaceWidth;if(t.forEach((t=>{const e=fu(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+d+f),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==i.coverEnable||"none"===c.strategy){for(const e of t){const{labelPosition:t,labelSize:r}=e;e.labelLimit=r.width,e.pointB=fu(e.quadrant)?{x:t.x+r.width/2+d+f,y:t.y}:{x:t.x-r.width/2-d-f,y:t.y},this._computeX(e,i,n)}!1===i.coverEnable&&"none"===c.strategy&&this._coverLabels(t)}else{const e=h/((null===(l=i.textStyle)||void 0===l?void 0:l.fontSize)||16);this._adjustY(t,e,i,n);const{minY:r,maxY:a}=t.reduce(((t,e)=>{const{y1:i,y2:n}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(h,Math.max(n,t.maxY)),t}),{minY:1/0,maxY:-1/0}),s=Math.max(Math.abs(h/2-r),Math.abs(a-h/2)),o=this._computeLayoutRadius(s,i,n);for(const e of t)this._computePointB(e,o,i,n),this._computeX(e,i,n)}const v=2*u;return t.forEach((t=>{var n,r;t.labelVisible&&(e.isLess(t.pointB.x,d+f)||e.isGreater(t.pointB.x,v-d-f))&&(t.labelVisible=!1),t.angle=null!==(r=null===(n=null==i?void 0:i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:0,(null==i?void 0:i.offsetAngle)&&(t.angle+=i.offsetAngle),t.labelLine=Object.assign({},null==i?void 0:i.line)})),t}_computeX(t,i,n){var r;const a=t.circleCenter,s=2*a.x;a.y;let o=0;n.forEach((t=>{t.attribute.outerRadius>o&&(o=t.attribute.outerRadius)}));const l=this.computeLayoutOuterRadius(o,i.width,i.height),u=i.line.line1MinLength,h=i.line.line2MinLength,d=null===(r=i.layout)||void 0===r?void 0:r.align,c=i.spaceWidth,{labelPosition:f,quadrant:v,pointB:p}=t;e.isValidNumber(p.x*p.y)||(t.pointC={x:NaN,y:NaN},f.x=NaN,t.labelLimit=0);const g=this.computeRadius(l,i.width,i.height),y=fu(v)?-1:1;let b=0;let m=(y>0?s-p.x:p.x)-h-c;"labelLine"===d&&(b=(g+u+h)*y+a.x,m=(y>0?s-b:b)-c);const x=this._getFormatLabelText(t.refDatum,m);t.labelText=x;let _=Math.min(m,t.labelSize.width);switch(d){case"labelLine":break;case"edge":b=y>0?s-_-c:_+c;break;default:b=p.x+y*h}_=Math.max(this._ellipsisWidth,_),t.labelLimit=_,t.pointC={x:b,y:f.y};const A=.5*(t.labelLimit<t.labelSize.width?t.labelLimit:t.labelSize.width);if("edge"===d){const t=0;f.x=(y>0?s+t:t)-y*A}else{const t=0;f.x=b+t+y*(c+A)}}_computeAlign(t,i){var n,r,a,s,o,l;const u=i,h=null!==(r=null===(n=u.textStyle)||void 0===n?void 0:n.textAlign)&&void 0!==r?r:null===(a=u.textStyle)||void 0===a?void 0:a.align,d=null!==(o=null===(s=u.layout)||void 0===s?void 0:s.textAlign)&&void 0!==o?o:null===(l=u.layout)||void 0===l?void 0:l.align;return"inside"!==u.position?e.isNil(h)||"auto"===h?"edge"===d?fu(t.quadrant)?"left":"right":fu(t.quadrant)?"right":"left":h:e.isNil(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,i,n,r){var a,s,o,l;s=null===(a=r[0].attribute)||void 0===a?void 0:a.x;const u=2*(null!==(l=null===(o=r[0].attribute)||void 0===o?void 0:o.y)&&void 0!==l?l:0),h=n.layout;if("vertical"===h.strategy){let i,n=0;const r=t.length;if(r<=0)return;for(let a=0;a<r;a++){const{y1:s}=t[a].getLabelBounds();if(i=s-n,e.isLess(i,0)){const e=this._shiftY(t,a,r-1,-i);this._shiftY(t,e,0,i/2)}const{y2:o}=t[a].getLabelBounds();n=o}const{y1:a}=t[0].getLabelBounds();i=a-0,e.isLess(i,0)&&this._shiftY(t,0,r-1,-i);for(let e=t.length-1;e>=0&&t[e].getLabelBounds().y2>u;e--)t[e].labelVisible=!1}else if("none"!==h.strategy){const a=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));a.sort(((t,e)=>e.arc.radian-t.arc.radian)),a.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let s=1/0,o=-1/0;for(let l=0;l<i&&l<t.length;l++){this._storeY(t);const i=a[l].arc;this._computeYRange(i,n,r),i.labelVisible=!0;const d=i.labelPosition.y,{lastIndex:c,nextIndex:f}=this._findNeighborIndex(t,a[l]),v=t[c],p=t[f];if(-1===c&&-1!==f){const e=p.labelPosition.y;d>e?i.labelPosition.y=e-p.labelSize.height/2-i.labelSize.height/2:this._twoWayShift(t,i,p,f)}else if(-1!==c&&-1===f){const e=v.labelPosition.y;d<e?i.labelPosition.y=e+v.labelSize.height/2+i.labelSize.height/2:this._twoWayShift(t,v,i,a[l].originIndex)}else if(-1!==c&&-1!==f){const e=v.labelPosition.y,n=p.labelPosition.y;d>n?(i.labelPosition.y=n-p.labelSize.height/2-i.labelSize.height/2,this._twoWayShift(t,v,i,a[l].originIndex)):d<e?(i.labelPosition.y=e+v.labelSize.height/2+i.labelSize.height/2,this._twoWayShift(t,i,p,f)):(this._twoWayShift(t,v,i,a[l].originIndex),this._twoWayShift(t,i,p,f))}const g=Math.min(s,a[l].originIndex),y=Math.max(o,a[l].originIndex);let b;if(b=t[y].getLabelBounds().y2-u,e.isGreater(b,0)&&this._shiftY(t,y,0,-b),b=t[g].getLabelBounds().y1-0,e.isLess(b,0)&&this._shiftY(t,g,t.length-1,-b),b=t[y].getLabelBounds().y2-u,e.isGreater(b,0)){i.labelVisible=!1,this._restoreY(t);break}h.tangentConstraint&&!this._checkYRange(t)?(i.labelVisible=!1,this._restoreY(t)):(s=g,o=y)}}}_shiftY(t,e,i,n){const r=e<i?1:-1;let a=e;for(;-1!==a;){t[a].labelPosition.y+=n;const e=this._findNextVisibleIndex(t,a,i,r);if(e>=0&&e<t.length){const{y1:i,y2:n}=t[a].getLabelBounds(),{y1:s,y2:o}=t[e].getLabelBounds();if(r>0&&n<s||r<0&&i>o)return a}a=e}return i}_findNextVisibleIndex(t,e,i,n){const r=(i-e)*n;for(let i=1;i<=r;i++){const r=e+i*n;if(t[r].labelVisible)return r}return-1}_computePointB(t,i,n,r){const a=n;let s=0;r.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,n.width,n.height),l=a.line.line1MinLength;if("none"===a.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const r=t.circleCenter,a=this.computeRadius(o,n.width,n.height),{labelPosition:s,quadrant:u}=t,h=i-Math.max(a+l,t.outerRadius),d=Math.sqrt(i**2-Math.abs(r.y-s.y)**2)-h;e.isValidNumber(d)?t.pointB={x:r.x+d*(fu(u)?-1:1),y:s.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,i,n){const r=t.circleCenter,a={width:2*r.x,height:2*r.y};let s=0;n.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,i.width,i.height),l=i.line.line1MinLength,{width:u,height:h}=a,d=this.computeRadius(o,i.width,i.height),c=this._computeLayoutRadius(h/2,i,n),f=Math.abs(t.center.x-u/2),v=t.center.y-h/2;let p,g,y;if(e.isNumberClose(u/2,f))p=0,g=1,y=-v;else if(e.isNumberClose(h/2,v))p=1,g=0,y=-f;else{const t=-1/(v/f);p=t,g=-1,y=v-t*f}const b=function(t,e,i,n,r,a){if(0===t&&0===e||a<=0)return[];if(0===t){const t=-i/e,s=a**2-(t-r)**2;return s<0?[]:0===s?[{x:n,y:t}]:[{x:Math.sqrt(s)+n,y:t},{x:-Math.sqrt(s)+n,y:t}]}if(0===e){const e=-i/t,s=a**2-(e-n)**2;return s<0?[]:0===s?[{x:e,y:r}]:[{x:e,y:Math.sqrt(s)+r},{x:e,y:-Math.sqrt(s)+r}]}const s=(e/t)**2+1,o=2*((i/t+n)*(e/t)-r),l=o**2-4*s*((i/t+n)**2+r**2-a**2);if(l<0)return[];const u=(-o+Math.sqrt(l))/(2*s),h=(-o-Math.sqrt(l))/(2*s),d=-(e*u+i)/t;return 0===l?[{x:d,y:u}]:[{x:d,y:u},{x:-(e*h+i)/t,y:h}]}(p,g,y,l+d-c,0,c);if(b.length<2)return;let m,x;b[0].x>b[1].x&&b.reverse(),b[0].x<0?e.isNumberClose(b[0].y,b[1].y)?Math.abs(t.middleAngle)<Math.PI/2?(m=0,x=b[1].y+h/2):(m=b[1].y+h/2,x=h):b[0].y<b[1].y?(m=0,x=b[1].y+h/2):(m=b[1].y+h/2,x=a.height):(m=Math.min(b[0].y,b[1].y)+h/2,x=Math.max(b[0].y,b[1].y)+h/2),t.labelYRange=[m,x]}_computeLayoutRadius(t,e,i){const n=e,r=n.layoutArcGap,a=n.line.line1MinLength;let s=0;i.forEach((t=>{t.attribute.outerRadius>s&&(s=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(s,e.width,e.height),l=this.computeRadius(o,e.width,e.height)+a,u=l-r;return Math.max((u**2+t**2)/(2*u),l)}_findNeighborIndex(t,e){const i=e.originIndex;let n=-1,r=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){n=e;break}for(let e=i+1;e<t.length;e++)if(t[e].labelVisible){r=e;break}return{lastIndex:n,nextIndex:r}}_twoWayShift(t,i,n,r){const a=n.getLabelBounds().y1-i.getLabelBounds().y2;if(e.isLess(a,0)){const e=this._shiftY(t,r,t.length-1,-a);this._shiftY(t,e,0,a/2)}}_restoreY(t){for(const e of t)e.labelVisible&&(e.labelPosition.y=e.lastLabelY)}_checkYRange(t){for(const i of t){const{labelYRange:t,labelPosition:n}=i;if(i.labelVisible&&t&&(e.isLess(n.y,t[0])||e.isGreater(n.y,t[1])))return!1}return!0}_coverLabels(t){if(t.length<=1)return;let e=t[0].getLabelBounds();for(let i=1;i<t.length;i++){const n=t[i].getLabelBounds();vu(e,n)?t[i].labelVisible=!1:e=n}}_labelLine(t){var e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m;return(null===(e=t.attribute)||void 0===e?void 0:e.points)?as.line({visible:null===(o=null!==(a=(null===(n=null===(i=t.attribute)||void 0===i?void 0:i.line)||void 0===n?void 0:n.visible)&&(null===(r=t.attribute)||void 0===r?void 0:r.visible))&&void 0!==a?a:null===(s=t.attribute)||void 0===s?void 0:s.visible)||void 0===o||o,stroke:null!==(d=null===(h=null===(u=null===(l=t.attribute)||void 0===l?void 0:l.line)||void 0===u?void 0:u.style)||void 0===h?void 0:h.stroke)&&void 0!==d?d:null===(c=t.attribute)||void 0===c?void 0:c.fill,lineWidth:null!==(g=null===(p=null===(v=null===(f=t.attribute)||void 0===f?void 0:f.line)||void 0===v?void 0:v.style)||void 0===p?void 0:p.lineWidth)&&void 0!==g?g:1,points:null===(y=t.attribute)||void 0===y?void 0:y.points,curveType:(null===(m=null===(b=t.attribute)||void 0===b?void 0:b.line)||void 0===m?void 0:m.smooth)?"basis":null}):void 0}computeRadius(t,i,n,r){return this.computeLayoutRadius(i||0,n||0)*t*(e.isNil(r)?1:r)}computeLayoutRadius(t,e){return Math.min(t/2,e/2)}_canPlaceInside(t,e){return"inside"===this.attribute.position}computeLayoutOuterRadius(t,e,i){return t/(Math.min(e,i)/2)}computeDatumRadius(t,e,i){const n=this.computeLayoutOuterRadius(i,t,e);return this.computeLayoutRadius(t||0,e||0)*n}}ku.defaultAttributes={coverEnable:!1,spaceWidth:5,layoutArcGap:6,textStyle:{visible:!0,fontSize:14,fontWeight:"normal",fillOpacity:1,textAlign:"center",textBaseline:"middle"},position:"outside",offset:0,line:{visible:!0,line1MinLength:20,line2MinLength:10},layout:{align:"arc",strategy:"priority",tangentConstraint:!0},pickable:!1};class Bu extends bu{constructor(t){super(e.merge({},Bu.defaultAttributes,t)),this.name="line-label"}getGraphicBounds(t,e={},i="end"){var n;if("area"!==t.type)return super.getGraphicBounds(t,e);const r=(null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)||[e],a="start"===i?0:r.length-1;return{x1:r[a].x,x2:r[a].x,y1:r[a].y,y2:r[a].y}}labeling(t,e,i="end",n=0){return yu(t,e,i,n)}}Bu.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class wu extends bu{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},wu.defaultAttributes,t)),this.name="line-data-label"}labeling(t,e,i="top",n=0){return pu(t,e,i,n)}}wu.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};const Su={rect:xu,symbol:mu,arc:ku,line:_u,area:Bu,"line-data":wu};class Tu extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Tu.defaultAttributes,t)),this.name="data-label"}render(){var t;const{dataLabels:i,size:n}=this.attribute;if(!i||0===i.length)return;const{width:r=0,height:a=0}=n||{};if(!r||!a||!e.isValidNumber(a*r))return;this._componentMap||(this._componentMap=new Map);const s=Jl(r,a),o=s.bitmap(),l=new Map,u=this._componentMap;for(let e=0;e<i.length;e++){const n=i[e],r=Su[n.type]||bu;if(r){const{baseMarkGroupName:i,type:a}=n,u=null!==(t=n.id)&&void 0!==t?t:`${i}-${a}-${e}`;let h=this._componentMap.get(u);h?(h.setBitmapTool(s),h.setBitmap(o),h.setAttributes(n),l.set(u,h)):(h=new r(n),h.setBitmap(o),h.setBitmapTool(s),this.add(h),l.set(u,h))}}u.forEach(((t,e)=>{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}Tu.defaultAttributes={pickable:!1};class Cu extends rl{getStartAngle(){return this._startAngle}getEndAngle(){return this._endAngle}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Cu.defaultAttributes,t)),this.name="segment"}render(){this.removeAllChild(),this._reset();const{startSymbol:t,endSymbol:i,lineStyle:n,state:r,visible:a=!0,multiSegment:s,mainSegmentIndex:o}=this.attribute;if(!a)return;this._computeLineAngle();const l=this._renderSymbol(t,"start"),u=this._renderSymbol(i,"end");if(this.startSymbol=l,this.endSymbol=u,s){const t=[...this.attribute.points];if(e.isValidNumber(o))t[o]=this._clipPoints(t[o]);else{const i=this._clipPoints(e.flattenArray(t));t[0][0]=i[0],t[t.length-1][t[t.length-1].length-1]=i[i.length-1]}t.forEach(((t,i)=>{var a,s;const o=as.line(Object.assign(Object.assign({points:t},e.isArray(n)?null!==(a=n[i])&&void 0!==a?a:n[n.length-1]:n),{fill:!1}));o.name=`${this.name}-line`,o.id=this._getNodeId("line"+i),e.isEmpty(null==r?void 0:r.line)||(o.states=e.isArray(r.line)?null!==(s=r.line[i])&&void 0!==s?s:r.line[r.line.length-1]:r.line),this.add(o)}))}else{const t=as.polygon(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},e.array(n)[0]),{fill:!1,closePath:!1}));t.name=`${this.name}-line`,t.id=this._getNodeId("line"),e.isEmpty(null==r?void 0:r.line)||(t.states=[].concat(r.line)[0]),this.add(t)}}_renderSymbol(t,i){const n=this._getMainSegmentPoints();if(!n.length)return;const{autoRotate:r=!0}=t;let a;if(null==t?void 0:t.visible){const s=this._startAngle,o=this._endAngle,{state:l}=this.attribute,u=n[0],h=n[n.length-1],{refX:d=0,refY:c=0,refAngle:f=0,style:v,symbolType:p,size:g=12}=t;let y,b;"start"===i?(y={x:u.x+(e.isValidNumber(s)?d*Math.cos(s)+c*Math.cos(s-Math.PI/2):0),y:u.y+(e.isValidNumber(s)?d*Math.sin(s)+c*Math.sin(s-Math.PI/2):0)},b=s+Math.PI/2):(y={x:h.x+(e.isValidNumber(o)?d*Math.cos(o)+c*Math.cos(o-Math.PI/2):0),y:h.y+(e.isValidNumber(o)?d*Math.sin(o)+c*Math.sin(o-Math.PI/2):0)},b=o+Math.PI/2),a=as.symbol(Object.assign(Object.assign(Object.assign({},y),{symbolType:p,size:g,angle:r?b+f:0,strokeBoundsBuffer:0}),v)),a.name=`${this.name}-${i}-symbol`,a.id=this._getNodeId(`${i}-symbol`),e.isEmpty(null==l?void 0:l.symbol)||(a.states=l.symbol),this.add(a)}return a}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:i,mainSegmentIndex:n}=this.attribute;let r;return r=i?e.isValidNumber(n)?t[n]:e.flattenArray(t):t,this._mainSegmentPoints=r,r}_clipPoints(t){const{startSymbol:e,endSymbol:i}=this.attribute;let n=t;if(null==e?void 0:e.visible){const i=(null==e?void 0:e.clip)?(null==e?void 0:e.size)||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(null==i?void 0:i.visible){const e=(null==i?void 0:i.clip)?(null==i?void 0:i.size)||10:0,r={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};n=[...n.slice(0,n.length-1),r]}return n}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],n=t[t.length-2],r=t[t.length-1],a=[e.x-i.x,e.y-i.y],s=Math.atan2(a[1],a[0]),o=[r.x-n.x,r.y-n.y],l=Math.atan2(o[1],o[0]);this._startAngle=s,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}var Eu,Mu;Cu.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},t.AXIS_ELEMENT_NAME=void 0,(Eu=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",Eu.axisContainer="axis-container",Eu.labelContainer="axis-label-container",Eu.tickContainer="axis-tick-container",Eu.tick="axis-tick",Eu.subTick="axis-sub-tick",Eu.label="axis-label",Eu.title="axis-title",Eu.gridContainer="axis-grid-container",Eu.grid="axis-grid",Eu.gridRegion="axis-grid-region",Eu.line="axis-line",Eu.background="axis-background",Eu.axisLabelBackground="axis-label-background",t.AxisStateValue=void 0,(Mu=t.AxisStateValue||(t.AxisStateValue={})).selected="selected",Mu.selectedReverse="selected_reverse",Mu.hover="hover",Mu.hoverReverse="hover_reverse";const Pu={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},Lu={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}};class Ou extends rl{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{const i=t.target;i!==this._lastHover&&i.name&&!e.isEmpty(i.states)&&(i.addState(Tl.hover,!0),fl(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Tl.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(fl(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Tl.hoverReverse),t.removeState(Tl.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState(Tl.selected))return this._lastSelect=null,void fl(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Tl.selectedReverse),t.removeState(Tl.selected))}));i.name&&!e.isEmpty(i.states)&&(i.addState(Tl.selected,!0),fl(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Tl.selectedReverse,!0)})),this._lastSelect=i)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const i=e.cloneDeep(this.attribute);e.merge(this.attribute,t);const n=as.group({x:this.attribute.x,y:this.attribute.y});return this.add(n),this._renderInner(n),this.removeChild(n),this.attribute=i,n.AABBBounds}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=as.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(e){const{title:i,label:n,tick:r,line:a,items:s}=this.attribute,o=as.group({x:0,y:0,zIndex:1});if(o.name=t.AXIS_ELEMENT_NAME.axisContainer,o.id=this._getNodeId("container"),o.setMode(this.mode),this.axisContainer=o,e.add(o),(null==a?void 0:a.visible)&&this.renderLine(o),s&&s.length&&(this.data=this._transformItems(s[0]),(null==r?void 0:r.visible)&&this.renderTicks(o),null==n?void 0:n.visible)){const e=as.group({x:0,y:0,pickable:!1});e.name=t.AXIS_ELEMENT_NAME.labelContainer,e.id=this._getNodeId("label-container"),this.axisLabelsContainer=e,o.add(e),s.forEach(((t,i)=>{const n=this.renderLabels(e,t,i),r=n.getChildren();this.beforeLabelsOverlap(r,t,n,i,s.length),this.handleLabelsOverlap(r,t,n,i,s.length),this.afterLabelsOverlap(r,t,n,i,s.length)}))}(null==i?void 0:i.visible)&&this.renderTitle(o)}renderTicks(i){const n=this.getTickLineItems(),r=as.group({x:0,y:0,pickable:!1});r.name=t.AXIS_ELEMENT_NAME.tickContainer,r.id=this._getNodeId("tick-container"),i.add(r),n.forEach(((i,a)=>{var s;const o=as.line(Object.assign({},this._getTickLineAttribute("tick",i,a,n)));if(o.name=t.AXIS_ELEMENT_NAME.tick,o.id=this._getNodeId(i.id),e.isEmpty(null===(s=this.attribute.tick)||void 0===s?void 0:s.state))o.states=Cl;else{const t=this.data[a],i=e.merge({},Cl,this.attribute.tick.state);Object.keys(i).forEach((n=>{e.isFunction(i[n])&&(i[n]=i[n](t.rawValue,a,t,this.data))})),o.states=i}r.add(o)})),this.tickLineItems=n;const{subTick:a}=this.attribute;if(null==a?void 0:a.visible){const i=this.getSubTickLineItems();i.length&&i.forEach(((i,s)=>{const o=as.line(Object.assign({},this._getTickLineAttribute("subTick",i,s,n)));if(o.name=t.AXIS_ELEMENT_NAME.subTick,o.id=this._getNodeId(`${s}`),e.isEmpty(a.state))o.states=Cl;else{const t=e.merge({},Cl,a.state);Object.keys(t).forEach((r=>{e.isFunction(t[r])&&(t[r]=t[r](i.value,s,i,n))})),o.states=t}r.add(o)})),this.subTickLineItems=i}}renderLabels(i,n,r){const{dataFilter:a}=this.attribute.label;a&&e.isFunction(a)&&(n=a(n,r));const s=this._transformItems(n),o=as.group({x:0,y:0,pickable:!1});o.name=`${t.AXIS_ELEMENT_NAME.labelContainer}-layer-${r}`,o.id=this._getNodeId(`label-container-layer-${r}`),i.add(o);let l=0,u=0,h="center",d="middle";return s.forEach(((i,n)=>{var a,c,f,v;const p=this._getLabelAttribute(i,n,s,r);let g;if("rich"===p.type?(p.textConfig=p.text,p.width=null!==(a=p.width)&&void 0!==a?a:0,p.height=null!==(c=p.height)&&void 0!==c?c:0,g=as.richtext(p)):"html"===p.type?(p.textConfig=[],p.html=Object.assign(Object.assign({dom:p.text},El),p),g=as.richtext(p)):g=as.text(p),g.name=t.AXIS_ELEMENT_NAME.label,g.id=this._getNodeId(`layer${r}-label-${i.id}`),e.isEmpty(null===(f=this.attribute.label)||void 0===f?void 0:f.state))g.states=Cl;else{const t=e.merge({},Cl,this.attribute.label.state);Object.keys(t).forEach((a=>{e.isFunction(t[a])&&(t[a]=t[a](i,n,s,r))})),g.states=t}o.add(g);const y=null!==(v=p.angle)&&void 0!==v?v:0;l=Math.max(l,g.AABBBounds.width()),u=Math.max(u,g.AABBBounds.height()),y&&(l=Math.abs(l*Math.cos(y)),u=Math.abs(u*Math.sin(y))),h=p.textAlign,d=p.textBaseline})),this.axisLabelLayerSize[r]={width:l,height:u,textAlign:h,textBaseline:d},o}renderTitle(e){const i=this.getTitleAttribute(),n=new Ll(Object.assign({},i));n.name=t.AXIS_ELEMENT_NAME.title,n.id=this._getNodeId("title"),e.add(n)}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}getTextAlign(t){let i="center";return e.isNumberClose(t[0],0)?e.isNumberClose(t[1],0)?Object.is(t[1],-0)?i="start":Object.is(t[0],-0)&&(i="end"):i="center":t[0]>0?i="start":t[0]<0&&(i="end"),i}getTickLineItems(){const{tick:t}=this.attribute,i=this.data,n=[],{alignWithLabel:r,inside:a=!1,length:s,dataFilter:o}=t;let l=1;return i.length>=2&&(l=i[1].value-i[0].value),(o&&e.isFunction(o)?o(i):i).forEach((t=>{let i=t.point,o=t.value;if(!r){const e=t.value-l/2;if(this.isInValidValue(e))return;i=this.getTickCoord(e),o=e}const u=this.getVerticalCoord(i,s,a);if("3d"===this.mode){const r=this.getVerticalVector(s,a,i);let l=0,h=0;e.abs(r[0])>e.abs(r[1])?l=e.pi/2*(u.x>i.x?1:-1):h=e.pi/2*(u.y>i.y?-1:1),n.push({start:i,end:u,value:o,id:`tick-${t.id}`,anchor:[i.x,i.y],alpha:l,beta:h})}else n.push({start:i,end:u,value:o,id:`tick-${t.id}`})})),n}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:n=!1,length:r=2}=t,a=this.tickLineItems,s=a.length;if(s>=2)for(let t=0;t<s-1;t++){const s=a[t],o=a[t+1];for(let t=0;t<i;t++){const a=(t+1)/(i+1),l=(1-a)*s.value+a*o.value,u=this.getTickCoord(l),h=this.getVerticalCoord(u,r,n);e.push({start:u,end:h,value:l,id:`sub-tick-${l}`})}}return e}_getTickLineAttribute(t,i,n,r){let a=e.get(this.attribute,`${t}.style`);const s=this.data[n];a=e.isFunction(a)?e.merge({},e.get(Lu,`${t}.style`),"tick"===t?a(s.rawValue,n,s,this.data):a(i.value,n,i,r)):a;const{start:o,end:l,anchor:u,alpha:h,beta:d}=i;return Object.assign({points:[o,l],anchor:u,alpha:h,beta:d},a)}_getLabelAttribute(t,i,n,r){var a,s,o,l,u,h;const d=this.attribute.label,{space:c=4,inside:f=!1,formatMethod:v,type:p="text",text:g}=d,y=ol(d,["space","inside","formatMethod","type","text"]);let b=c,m=0;(null===(a=this.attribute.tick)||void 0===a?void 0:a.visible)&&(null===(s=this.attribute.tick)||void 0===s?void 0:s.inside)===f&&(m=(null===(o=this.attribute.tick)||void 0===o?void 0:o.length)||4),(null===(l=this.attribute.subTick)||void 0===l?void 0:l.visible)&&(null===(u=this.attribute.subTick)||void 0===u?void 0:u.inside)===f&&(m=Math.max(m,(null===(h=this.attribute.subTick)||void 0===h?void 0:h.length)||2)),b+=m;const x=this.getRelativeVector(t.point);r>0&&(0===x[1]?b+=(this.axisLabelLayerSize[r-1].height+e.get(this.attribute,"label.space",4))*r:b+=(this.axisLabelLayerSize[r-1].width+e.get(this.attribute,"label.space",4))*r);const _=this.getVerticalCoord(t.point,b,f),A=this.getVerticalVector(b,f,_),k=v?v(`${t.label}`,t,i,n,r):t.label;let{style:B}=y;B=e.isFunction(B)?e.merge({},Lu.label.style,B(t,i,n,r)):B;const w=this.getLabelAlign(A,f,B.angle);return B=e.merge(w,B),e.isFunction(B.text)&&(B.text=B.text({label:t.label,value:t.rawValue,index:t.index,layer:r})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(_,A,k,B)),{text:null!=g?g:k,lineHeight:null==B?void 0:B.fontSize,type:p}),B)}getLabelPosition(t,e,i,n){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}}function Iu(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(n=e.centerX,r=e.centerY,a=e.angle,s=t.attribute.x,o=t.attribute.y,{x:(n-s)*Math.cos(a)+(r-o)*Math.sin(a)+s,y:(n-s)*Math.sin(a)+(o-r)*Math.cos(a)+o});var n,r,a,s,o;const l=i.x-e.centerX,u=i.y-e.centerY;e.x1+=l,e.x2+=l,e.y1+=u,e.y2+=u,e.centerX+=l,e.centerY+=u,t.rotatedBounds=e}))}const Ru={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,n)=>n&&ju(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function ju(t,e,i){const n=t.AABBBounds,r=e.AABBBounds;return i>Math.max(r.x1-n.x2,n.x1-r.x2,r.y1-n.y2,n.y1-r.y2)&&(!t.rotatedBounds||!e.rotatedBounds||i>Math.max(e.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.x1-e.rotatedBounds.x2,e.rotatedBounds.y1-t.rotatedBounds.y2,t.rotatedBounds.y1-e.rotatedBounds.y2))}function Du(t,e){for(let i,n=1,r=t.length,a=t[0];n<r;a=i,++n)if(ju(a,i=t[n],e))return!0}function Nu(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function Uu(t){for(let r=1;r<t.length;r++)if(i=t[r-1],n=t[r],e.isRectIntersect(i.AABBBounds,n.AABBBounds,!1)&&(!i.rotatedBounds||!n.rotatedBounds||e.isRotateAABBIntersect(i.rotatedBounds,n.rotatedBounds,!0)))return!0;var i,n;return!1}function zu(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},Vu(t,e.attribute.angle)),{angle:Hu(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},Wu(t,e.attribute.angle)),{angle:Hu(e.attribute.angle)}))}))}(t,e),Iu(e)}function Hu(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Vu(t,e=0){let i=["center","left","left","left","center","right","right","right","left"],n=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],n=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const r=(e=Hu(e))/(.5*Math.PI);let a;return a=r===Math.floor(r)?2*Math.floor(r):2*Math.floor(r)+1,{textAlign:i[a],textBaseline:n[a]}}function Wu(t,e=0){let i=["right","right","center","left","center","left","center","right","right"],n=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","right","right","right","left","left","left","left","right"],n=["middle","bottom","middle","top","top","top","middle","bottom","bottom"]);const r=(e=Hu(e))/(.5*Math.PI);let a;return a=r===Math.floor(r)?2*Math.floor(r):2*Math.floor(r)+1,{textAlign:i[a],textBaseline:n[a]}}class Fu{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:n=1}=this.attribute,r=function(t){const[e,i]=t;let n=e*e+i*i;return n>0&&(n=1/Math.sqrt(n)),[t[0]*n,t[1]*n]}(this.getRelativeVector());return Al([r[1],-1*r[0]],t*(e?1:-1)*n)}}class Gu extends Ou{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Gu.defaultAttributes,t),i)}_renderInner(i){var n;super._renderInner(i);const{panel:r}=this.attribute;if(r&&r.visible){const i=this.axisContainer,a=i.AABBBounds,s=as.rect(Object.assign({x:a.x1,y:a.y1,width:a.width(),height:a.height()},r.style));s.name=t.AXIS_ELEMENT_NAME.background,s.id=this._getNodeId("background"),s.states=e.merge({},Pu,null!==(n=r.state)&&void 0!==n?n:{}),i.insertBefore(s,i.firstChild)}}renderLine(i){const{start:n,end:r,line:a}=this.attribute,s=a,{startSymbol:o,endSymbol:l,style:u,breakRange:h,breakShape:d,breakShapeStyle:c,state:f}=s,v=ol(s,["startSymbol","endSymbol","style","breakRange","breakShape","breakShapeStyle","state"]),p=Object.assign({points:[n,r],startSymbol:o,endSymbol:l,lineStyle:u},v);e.isEmpty(f)||(p.state={line:e.merge({},Pu,f),symbol:e.merge({},Pu,f)});const g=new Cu(p);g.name=t.AXIS_ELEMENT_NAME.line,g.id=this._getNodeId("line"),i.add(g)}getTitleAttribute(){var t,i,n,r,a,s,o,l;const u=this.attribute.title,{position:h="middle",space:d=4,textStyle:c={},autoRotate:f=!0,shape:v,background:p,state:g}=u,y=ol(u,["position","space","textStyle","autoRotate","shape","background","state"]);let b=.5;"start"===h?b=0:"end"===h&&(b=1);const{verticalFactor:m=1}=this.attribute,x=-1*m,_=this.getTickCoord(b),A=this.getRelativeVector();let k=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(i=this.attribute.label)||void 0===i?void 0:i.inside)){const t=+e.get(this.attribute,"label.space",4);k+=t;const i=Object.keys(this.axisLabelLayerSize).length;if(0===A[1]){const e=this.axisLabelsContainer.AABBBounds.height();isFinite(e)?k+=e+(i-1)*t:k=0}else{if(0===A[0]){const e=this.axisLabelsContainer.AABBBounds.width();isFinite(e)?k+=e+(i-1)*t:k=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{k+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const e=this.axisLabelLayerSize[0].textAlign,n="start"===e||"left"===e,r="center"===e,a=A[1]>0;k=1===x?a?n?k:r?k/2:t:n?t:r?k/2:k:a?n?t:r?k/2:k:n?k:r?k/2:t}}let B=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&!1===(null===(r=this.attribute.tick)||void 0===r?void 0:r.inside)&&(B=(null===(a=this.attribute.tick)||void 0===a?void 0:a.length)||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&!1===(null===(o=this.attribute.subTick)||void 0===o?void 0:o.inside)&&(B=Math.max(B,(null===(l=this.attribute.subTick)||void 0===l?void 0:l.length)||2));const w=B+k+d,S=this.getVerticalCoord(_,w,!1),T=this.getVerticalVector(w,!1,{x:0,y:0});let C,E,{angle:M}=y;if(C="start"===h?"start":"end"===h?"end":"center",e.isNil(M)&&f){M=kl(A,[1,0],!0);const{verticalFactor:t=1}=this.attribute;E=1===-1*t?"bottom":"top"}else C=this.getTextAlign(T),E=this.getTextBaseline(T,!1);const P=Object.assign(Object.assign(Object.assign({},S),y),{textStyle:Object.assign({textAlign:C,textBaseline:E},c),state:{text:e.merge({},Pu,null==g?void 0:g.text),shape:e.merge({},Pu,null==g?void 0:g.shape),panel:e.merge({},Pu,null==g?void 0:g.background)}});return P.angle=M,v&&v.visible&&(P.shape=Object.assign({visible:!0},v.style),v.space&&(P.space=v.space)),p&&p.visible&&(P.panel=Object.assign({visible:!0},p.style)),P}getTextBaseline(t,i){let n="middle";const{verticalFactor:r=1}=this.attribute,a=(i?1:-1)*r;return e.isNumberClose(t[1],0)?n=!e.isNumberClose(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===a?"bottom":"top":t[1]>0?n="top":t[1]<0&&(n="bottom"),n}getLabelAlign(t,i,n){const r=this.attribute.orient;if(e.isValidNumber(n)){if("top"===r||"bottom"===r)return Vu(r,n);if("left"===r||"right"===r)return Wu(r,n)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,i)}}beforeLabelsOverlap(t,i,n,r,a){const{flush:s=!1}=this.attribute.label||{};if(s&&t.length){const{orient:i,start:n,end:r}=this.attribute,a="bottom"===i||"top"===i,s=t[0],o=e.last(t),l=a?s.attribute.x>o.attribute.x:s.attribute.y<o.attribute.y;if(a)if(l){const t=r.x,e=n.x,i=s.AABBBounds.x2,a=o.AABBBounds.x1;i>t&&s.setAttributes({x:t,textAlign:"right"}),a<e&&o.setAttributes({x:e,textAlign:"left"})}else{const t=n.x,e=r.x,i=s.AABBBounds.x1,a=o.AABBBounds.x2;i<t&&s.setAttributes({x:t,textAlign:"left"}),a>e&&o.setAttributes({x:e,textAlign:"right"})}else if(l){const t=s.AABBBounds.y1,e=o.AABBBounds.y2,i=n.y,a=r.y;t<i&&s.setAttributes({y:i,textBaseline:"top"}),e>a&&o.setAttributes({y:a,textBaseline:"bottom"})}else{const t=r.y,e=n.y,i=s.AABBBounds.y2,a=o.AABBBounds.y1;i>t&&s.setAttributes({y:t,textBaseline:"bottom"}),a<e&&o.setAttributes({y:e,textBaseline:"top"})}}}handleLabelsOverlap(t,i,n,r,a){if(e.isEmpty(t))return;const{verticalLimitSize:s,label:o,orient:l}=this.attribute,u=this._getAxisLabelLimitLength(s,a),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:f,limitEllipsis:v,autoHide:p,autoHideMethod:g,autoHideSeparation:y}=o;e.isFunction(h)?h(t,i,r,this):(d&&function(t,i){if(e.isEmpty(t))return;const{orient:n,labelRotateAngle:r=[0,45,90]}=i;if(0===r.length||t.some((t=>!!t.attribute.angle)))return;let a=0,s=0;for(r&&r.length>0&&(s=r.length);a<s;){const i=r[a++];if(t.forEach((t=>{t.attribute.angle=e.degreeToRadian(i)})),zu(n,t),!Uu(t))break}}(t,{labelRotateAngle:c,orient:l}),f&&e.isValidNumber(u)&&u>0&&function(t,i){const{limitLength:n,ellipsis:r="...",orient:a}=i;!e.isEmpty(t)&&e.isValidNumber(n)&&t.forEach((t=>{if(("top"===a||"bottom"===a)&&Math.floor(t.AABBBounds.height())<=n)return;if(("left"===a||"right"===a)&&Math.floor(t.AABBBounds.width())<=n)return;let i=0===t.attribute.angle||e.isNil(t.attribute.angle)?"top"===a||"bottom"===a?null:n:Math.abs(n/Math.sin(t.attribute.angle));e.isValidNumber(t.attribute.maxLineWidth)&&(i=e.isValidNumber(i)?Math.min(t.attribute.maxLineWidth,i):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:i,ellipsis:t.attribute.ellipsis||r})}))}(t,{limitLength:u,ellipsis:v,orient:l}),p&&function(t,i){if(e.isEmpty(t))return;const n=t.filter(Nu);if(e.isEmpty(n))return;let r;r=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(n),Iu(r);const{method:a="parity",separation:s=0}=i,o=e.isFunction(a)?a:Ru[a]||Ru.parity;if(r.length>=3&&Du(r,s)){do{r=o(r,s)}while(r.length>=3&&Du(r,s));r.length<3&&!e.last(n).attribute.opacity&&r.length>1&&(e.last(r).setAttribute("opacity",0),e.last(n).setAttribute("opacity",1))}n.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:l,method:g,separation:y}))}afterLabelsOverlap(i,n,r,a,s){const{verticalLimitSize:o,orient:l}=this.attribute,u="bottom"===l||"top"===l,h=r.AABBBounds;let d=u?h.height():h.width();const{verticalMinSize:c}=this.attribute;if(e.isValidNumber(c)&&(!e.isValidNumber(o)||c<=o)){const e=this._getAxisLabelLimitLength(c,s);let i,n;d=Math.max(d,e),"left"===l?(i=h.x2-d,n=h.y1):"right"===l?(i=h.x1,n=h.y1):"top"===l?(i=h.x1,n=h.y2-d):"bottom"===l&&(i=h.x1,n=h.y1);const a=as.rect({x:i,y:n,width:u?h.width():d,height:u?d:h.height(),pickable:!1});a.name=t.AXIS_ELEMENT_NAME.axisLabelBackground,a.id=this._getNodeId("axis-label-background"),r.insertBefore(a,r.firstChild)}if(e.isValid(this.attribute.label.containerAlign)){let t;"left"===l?t=h.x2:"right"===l?t=h.x1:"top"===l?t=h.y2:"bottom"===l&&(t=h.y1),function(t,e,i,n,r){if("right"===n||"left"===n){if("left"===r){const r="right"===n?0:-1;t.forEach((t=>{t.setAttributes({x:e+i*r,textAlign:"left"})}))}else if("right"===r){const r="right"===n?1:0;t.forEach((t=>{t.setAttributes({x:e+i*r,textAlign:"right"})}))}else if("center"===r){const r="right"===n?1:-1;t.forEach((t=>{t.setAttributes({x:e+.5*i*r,textAlign:"center"})}))}}else if("bottom"===n||"top"===n)if("top"===r){const r="bottom"===n?0:-1;t.forEach((t=>{t.setAttributes({y:e+i*r,textBaseline:"top"})}))}else if("bottom"===r){const r="bottom"===n?1:0;t.forEach((t=>{t.setAttributes({y:e+i*r,textBaseline:"bottom"})}))}else if("middle"===r){const r="bottom"===n?1:-1;t.forEach((t=>{t.setAttributes({y:e+.5*i*r,textBaseline:"middle"})}))}}(i,t,d,l,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,i){var n,r,a;const{label:s,title:o,line:l,tick:u}=this.attribute,h=null!==(n=s.space)&&void 0!==n?n:4;let d=t,c=0,f=0;const v=(null==l?void 0:l.visible)?null!==(r=l.style.lineWidth)&&void 0!==r?r:1:0,p=(null==u?void 0:u.visible)?null!==(a=u.length)&&void 0!==a?a:4:0;if((null==o?void 0:o.visible)&&"string"==typeof o.text){c=Pl(o.text,o.textStyle).height;const t=e.normalizePadding(o.padding);f=o.space+t[0]+t[2]}return d&&(d=(d-h-f-c-v-p)/i),d}}Gu.defaultAttributes=Lu,e.mixin(Gu,Fu);class $u{isInValidValue(t){const{startAngle:e=Bl,endAngle:i=wl}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:i=Bl,endAngle:n=wl,center:r,radius:a,inside:s=!1,innerRadius:o=0}=this.attribute,l=i+(n-i)*t;return e.polarToCartesian(r,s&&o>0?o:a,l)}getVerticalVector(t,e=!1,i){const{inside:n=!1}=this.attribute,{center:r}=this.attribute,a=[i.x-r.x,i.y-r.y];return Al(a,(e?-1:1)*(n?-1:1)*t/function(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}(a))}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}const Yu=(t=0)=>{if(t<0)for(;t<0;)t+=e.tau;else if(t>0)for(;t>e.tau;)t-=e.tau;return t};function Xu(t,i,n){return!e.isLess(t,i,0,1e-6)&&!e.isGreater(t,n,0,1e-6)}class qu extends Ou{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},qu.defaultAttributes,t))}renderLine(i){const{startAngle:n=Bl,endAngle:r=wl,radius:a,center:s,innerRadius:o=0,line:l,inside:u=!1}=this.attribute;let h=a,d=o;u&&o>0&&(h=o,d=0);const c=Object.assign(Object.assign(Object.assign({},s),{startAngle:n,endAngle:r,radius:h,innerRadius:d}),null==l?void 0:l.style),f=as.circle(c);f.name=t.AXIS_ELEMENT_NAME.line,f.id=this._getNodeId("line"),e.isEmpty(null==l?void 0:l.state)||(f.states=e.merge({},Pu,l.state)),i.add(f)}getTitleAttribute(){var t,i,n,r,a,s,o,l;const{center:u,radius:h,innerRadius:d=0}=this.attribute,c=this.attribute.title,{space:f=4,textStyle:v={},shape:p,background:g,state:y}=c,b=ol(c,["space","textStyle","shape","background","state"]);let m=u,x=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===(null===(i=this.attribute.label)||void 0===i?void 0:i.inside)&&(x=e.get(this.attribute.label,"style.fontSize",12)+e.get(this.attribute.label,"space",4));let _=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&!1===(null===(r=this.attribute.tick)||void 0===r?void 0:r.inside)&&(_=(null===(a=this.attribute.tick)||void 0===a?void 0:a.length)||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&!1===(null===(o=this.attribute.subTick)||void 0===o?void 0:o.inside)&&(_=Math.max(_,(null===(l=this.attribute.subTick)||void 0===l?void 0:l.length)||2));const A=h+_+x+f;let k="middle",{position:B}=this.attribute.title;e.isNil(B)&&(B=0===d?"end":"middle"),"start"===B?(k="bottom",m={x:u.x,y:u.y-A}):"end"===B&&(k="top",m={x:u.x,y:u.y+A});const w=Object.assign(Object.assign(Object.assign({},m),b),{textStyle:Object.assign({textBaseline:k,textAlign:"center"},v),state:{text:e.merge({},Pu,null==y?void 0:y.text),shape:e.merge({},Pu,null==y?void 0:y.shape),panel:e.merge({},Pu,null==y?void 0:y.background)}}),{angle:S}=b;return w.angle=S,p&&p.visible&&(w.shape=Object.assign({visible:!0},p.style),p.space&&(w.space=p.space)),g&&g.visible&&(w.panel=Object.assign({visible:!0},g.style)),w}getSubTickLineItems(){var t,e;const{subTick:i}=this.attribute,n=[],{count:r=4,inside:a=!1,length:s=2}=i,o=this.tickLineItems,l=o.length;if(l>=2){const i=this.data[1].value-this.data[0].value,u=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t<l;t++){const e=o[t],l=o[t+1];for(let t=0;t<r;t++){const o=(t+1)/(r+1),h=(1-o)*e.value+o*(l?l.value:u?1:e.value+i),d=this.getTickCoord(h),c=this.getVerticalCoord(d,s,a);n.push({start:d,end:c,value:h})}}}return n}getTextBaseline(t){let i="middle";return e.isNumberClose(t[1],0)?i="middle":t[1]>0&&t[1]>Math.abs(t[0])?i="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(i="bottom"),i}beforeLabelsOverlap(t,e,i,n,r){}handleLabelsOverlap(t,e,i,n,r){}afterLabelsOverlap(t,e,i,n,r){}getLabelAlign(t,e,i){return{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,n){return function(t,e,i,n){const r=ss(Object.assign({text:i},n)),a=r.width(),s=r.height(),o=Yu(Math.atan2(e[1],e[0]))-Math.PI,l=3*Math.PI/4,u=Math.PI/4,h=Math.PI/2,d=t.x;let c=0;c=Xu(o,-l,-u)?((o+l)/h-.5)*a:Xu(o,u,l)?(.5-(o-u)/h)*a:Math.cos(o)>=0?.5*a:.5*-a;const f=d-c,v=t.y;let p=0;return p=Xu(o,-l,-u)?.5*-s:Xu(o,u,l)?.5*s:Math.cos(o)>=0?(.5-(u-o)/h)*s:(.5-Yu(o-l)/h)*s,{x:f,y:v-p}}(t,e,i,n)}}qu.defaultAttributes=Lu,e.mixin(qu,$u);function Zu(t,e){let i="";return 0===t.length||(t.forEach(((t,e)=>{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}function Ku(t,i,n,r){let a="";if(!t||0===i.length)return a;const s=i[0],o=e.PointService.distancePP(t,s),l=n?0:1;return r?a+=`M${t.x},${t.y-o}A${o},${o},0,0,${l},${t.x},${t.y+o}A${o},${o},0,0,${l},${t.x},${t.y-o}Z`:i.forEach(((t,e)=>{0===e?a=`M${t.x},${t.y}`:a+=`A${o},${o},0,0,${l},${t.x},${t.y}`})),a}function Ju(t,i,n){const{type:r,closed:a}=n,s=i.slice(0).reverse();let o="",l="";if("line"===r&&n.smoothLink&&n.center){const i=t[0],r=s[0],u=n.center;o=Zu(t,!!a),l=Zu(s,!!a);const h=e.PointService.distancePP(r,u),d=e.PointService.distancePP(i,u);o+=`A${h},${h},0,0,1,${r.x},${r.y}L${r.x},${r.y}`,l+=`A${d},${d},0,0,0,${i.x},${i.y}`}else if("circle"===r){const{center:e}=n;o=Ku(e,t,!1,!!a),l=Ku(e,s,!0,!!a)}else"line"!==r&&"polygon"!==r||(o=Zu(t,!!a),l=Zu(s,!!a));return a?o+=l:(l="L"+l.substring(1),o+=l,o+="Z"),o}class Qu extends rl{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this.removeAllChild(),this._prevInnerView=this._innerView,this._innerView=as.group({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){const n=this.getVerticalVector(e,i,t);return{x:t.x+n[0],y:t.y+n[1]}}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(i,n){const r=e.merge({},this.attribute,this.getGridAttribute(i)),{type:a,items:s,style:o,closed:l,alternateColor:u,depth:h=0}=r,d=i?`${t.AXIS_ELEMENT_NAME.grid}-sub`:`${t.AXIS_ELEMENT_NAME.grid}`;if(s.forEach(((t,i)=>{const{id:r,points:s}=t;let u="";if("line"===a||"polygon"===a)u=Zu(s,!!l);else if("circle"===a){const{center:t}=this.attribute;u=Ku(t,s,!1,!!l)}const c=as.path(Object.assign({path:u,z:h},e.isFunction(o)?e.merge({},this.skipDefault?null:Qu.defaultAttributes.style,o(t,i)):o));c.name=`${d}-line`,c.id=this._getNodeId(`${d}-path-${r}`),n.add(c)})),h&&"line"===a&&s.forEach(((t,i)=>{const{id:r,points:a}=t,s=[];s.push(a[0]);const u=a[1].x-a[0].x,c=a[1].y-a[0].y,f=Math.sqrt(u*u+c*c),v=h/f;s.push({x:a[0].x+u*v,y:a[0].y+c*v});const p=Zu(s,!!l),g=e.abs(s[0].x-s[1].x),y=e.abs(s[0].y-s[1].y),b=as.path(Object.assign({path:p,z:0,alpha:g>y?(a[1].x-a[0].x>0?-1:1)*e.pi/2:0,beta:g<y?-e.pi/2:0,anchor3d:g>y?[s[0].x,0]:[0,s[0].y]},e.isFunction(o)?e.merge({},this.skipDefault?null:Qu.defaultAttributes.style,o(t,i)):o));b.name=`${d}-line`,b.id=this._getNodeId(`${d}-path-${r}`),n.add(b)})),s.length>1&&u){const t=e.isArray(u)?u:[u,"transparent"],i=e=>t[e%t.length];for(let t=0;t<s.length-1;t++){const[e,a]=[s[t].points,s[t+1].points],o=Ju(e,a,r),l=as.path({path:o,fill:i(t)});l.name=`${d}-region`,l.id=this._getNodeId(`${d}-region-${t}`),n.add(l)}}}_getNodeId(t){return`${this.id}-${t}`}}Qu.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}};class th extends Qu{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Qu.defaultAttributes,t),i)}_getGridPoint(t,i){let n;if("line"===t){const{length:t}=this.attribute;n=[i,this.getVerticalCoord(i,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:r=6,startAngle:a=Bl,endAngle:s=wl}=this.attribute;n=function(t,i,n,r,a){const s=[],o=a-r;for(let a=0;a<i;a++){const l=r+a*o/i;s.push(e.polarToCartesian(t,n,l))}return s}(t,r,e.PointService.distancePP(t,i),a,s)}return n}getGridAttribute(t){const{type:i,alignWithLabel:n=!0}=this.attribute;let r=1;let a;this.data.length>=2&&(r=this.data[1].value-this.data[0].value);let s=[];if(t){a=e.merge({},this.attribute,this.attribute.subGrid);const t=[],{count:o=4}=this.attribute.subGrid||{};if(this.data.length>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!n){const e=t.value-r/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let n=0;n<e.length-1;n++){const r=e[n],a=e[n+1];t.push({id:`sub-${n}-0`,points:this._getGridPoint(i,this.getTickCoord(r.value)),datum:{}});for(let e=0;e<o;e++){const s=(e+1)/(o+1),l=(1-s)*r.value+s*a.value,u=this.getTickCoord(l);t.push({id:`sub-${n}-${e+1}`,points:this._getGridPoint(i,u),datum:{}})}n===e.length-2&&t.push({id:`sub-${n}-${o+1}`,points:this._getGridPoint(i,this.getTickCoord(a.value)),datum:{}})}s=t}}else{a=this.attribute;const t=[];this.data.forEach((e=>{let{point:a}=e;if(!n){const t=e.value-r/2;if(this.isInValidValue(t))return;a=this.getTickCoord(t)}t.push({id:e.label,datum:e,points:this._getGridPoint(i,a)})})),s=t}return Object.assign(Object.assign({},a),{items:s})}}e.mixin(th,Fu);class eh extends Qu{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Qu.defaultAttributes,t),i)}getGridAttribute(t){let i,n=[];const r=this.attribute,{radius:a,innerRadius:s=0,startAngle:o=Bl,endAngle:l=wl,center:u,subGrid:h}=r,d=ol(r,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:c=!0}=d||{},f=a-s;let v=1;if(this.data.length>=2&&(v=this.data[1].value-this.data[0].value),t){i=e.merge({},d,h);const t=[],{count:r=4}=h||{},a=this.data.length;if(a>=2){const e=[];this.data.forEach((t=>{let i=t.value;if(!c){const e=t.value-v/2;if(this.isInValidValue(e))return;i=e}e.push({value:i})}));for(let i=0;i<a;i++){const n=e[i],a=e[i+1];t.push({id:`sub-${i}-0`,points:[this.getTickCoord(n.value),this.getVerticalCoord(this.getTickCoord(n.value),f,!0)],datum:{}});for(let e=0;e<r;e++){const s=(e+1)/(r+1),o=(1-s)*n.value+s*(a?a.value:c?1:n.value+v),l=this.getTickCoord(o),u=this.getVerticalCoord(l,f,!0);t.push({id:`sub-${i}-${e+1}`,points:[l,u],datum:{}})}}Math.abs(l-o)%(2*Math.PI)==0&&t.push(t[0]),n=t}}else{i=d;const t=[];let e;e=Math.abs(l-o)%(2*Math.PI)==0?[...this.data].concat(this.data[0]):this.data,e.forEach((e=>{let{point:i}=e;if(!c){const t=e.value-v/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const n=this.getVerticalCoord(i,f,!0);t.push({id:e.id,points:[i,n],datum:e})})),n=t}return Object.assign(Object.assign({},i),{items:n,center:u,type:"line"})}}e.mixin(eh,$u);var ih;t.DataZoomActiveTag=void 0,(ih=t.DataZoomActiveTag||(t.DataZoomActiveTag={})).startHandler="startHandler",ih.endHandler="endHandler",ih.middleHandler="middleHandler",ih.background="background";const nh={debounce:e.debounce,throttle:e.throttle};class rh extends rl{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},rh.defaultAttributes,i)),this.name="dataZoom",this._previewData=[],this._activeState=!1,this._activeCache={startPos:{x:0,y:0},lastPos:{x:0,y:0}},this._layoutCache={attPos:"x",attSize:"width",max:0},this.state={start:0,end:1},this._statePointToData=t=>t,this._onHandlerPointerDown=(e,i)=>{e.stopPropagation(),"start"===i?(this._activeTag=t.DataZoomActiveTag.startHandler,this._activeItem=this._startHandler):"end"===i?(this._activeTag=t.DataZoomActiveTag.endHandler,this._activeItem=this._endHandler):"middleRect"===i?(this._activeTag=t.DataZoomActiveTag.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===i?(this._activeTag=t.DataZoomActiveTag.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===i&&(this._activeTag=t.DataZoomActiveTag.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(e),this._activeCache.lastPos=this.eventPosToStagePos(e)},this._onHandlerPointerMove=e=>{var i;e.stopPropagation();const{start:n,end:r,brushSelect:a,realTime:s=!0}=this.attribute,o=this.eventPosToStagePos(e),{attPos:l,max:u}=this._layoutCache,h=(o[l]-this._activeCache.lastPos[l])/u;let{start:d,end:c}=this.state;this._activeState&&(this._activeTag===t.DataZoomActiveTag.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+h):this._activeTag===t.DataZoomActiveTag.startHandler?d+h>c?(d=c,c=d+h,this._activeTag=t.DataZoomActiveTag.endHandler):d+=h:this._activeTag===t.DataZoomActiveTag.endHandler&&(c+h<d?(c=d,d=c+h,this._activeTag=t.DataZoomActiveTag.startHandler):c+=h),this._activeCache.lastPos=o,a&&this.renderDragMask()),d=Math.min(Math.max(d,0),1),c=Math.min(Math.max(c,0),1),n===d&&r===c||(this.setStateAttr(d,c,!0),s&&(null===(i=this._updateStateCallback)||void 0===i||i.call(this,d,c,this._activeTag)),this._dispatchChangeEvent(d,c))};const{start:r,end:a,size:s,orient:o,showDetail:l,position:u,previewData:h,previewPointsX:d,previewPointsY:c,previewPointsX1:f,previewPointsY1:v,updateStateCallback:p}=this.attribute,{width:g,height:y}=s;r&&(this.state.start=r),a&&(this.state.end=a),this._spanCache=this.state.end-this.state.start,this._isHorizontal="top"===o||"bottom"===o,this._layoutCache.max=this._isHorizontal?g:y,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",this._activeCache.startPos=u,this._activeCache.lastPos=u,this._showText="auto"!==l&&l,h&&(this._previewData=h),e.isFunction(d)&&(this._previewPointsX=d),e.isFunction(c)&&(this._previewPointsY=c),e.isFunction(f)&&(this._previewPointsX1=f),e.isFunction(v)&&(this._previewPointsY1=v),e.isFunction(p)&&(this._updateStateCallback=p)}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{showDetail:t,brushSelect:e,delayType:i="throttle",delayTime:n=0}=this.attribute;this._startHandler&&this._startHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandler&&this._endHandler.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const r=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,r))),e&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,r))),"browser"===Jo.env&&(Jo.addEventListener("pointermove",nh[i](this._onHandlerPointerMove.bind(this),n),{capture:!0}),Jo.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",nh[i](this._onHandlerPointerMove,n),{capture:!0}),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:n=!1,minSpan:r=0,maxSpan:a=1}=this.attribute,s=e-t;s!==this._spanCache&&(n||s<r||s>a)||(this._spanCache=s,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){var e,i,n;const r=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==r?void 0:r.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==r?void 0:r.top)||0)-((null===(n=this.stage)||void 0===n?void 0:n.y)||0)}}_onHandlerPointerUp(e){var i;e.preventDefault();const{start:n,end:r,brushSelect:a,realTime:s=!0}=this.attribute;if(this._activeState&&this._activeTag===t.DataZoomActiveTag.background){const t=this.eventPosToStagePos(e);this.backgroundDragZoom(this._activeCache.startPos,t)}this._activeState=!1,a&&this.renderDragMask(),s&&n===this.state.start&&r===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),null===(i=this._updateStateCallback)||void 0===i||i.call(this,this.state.start,this.state.end,this._activeTag),this._dispatchChangeEvent(this.state.start,this.state.end))}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:n}=this._layoutCache,{position:r}=this.attribute,a=t[i]-r[i],s=e[i]-r[i],o=Math.min(Math.max(Math.min(a,s)/n,0),1),l=Math.min(Math.max(Math.max(a,s)/n,0),1);Math.abs(o-l)<.01?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:i}=this.attribute,{position:n,width:r,height:a}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,n.x,n.x+r),y:n.y,width:this._activeState&&this._activeTag===t.DataZoomActiveTag.background&&Math.abs(this.dragMaskSize())||0,height:a},i),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:n.x,y:e.clamp(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,n.y,n.y+a),width:r,height:this._activeState&&this._activeTag===t.DataZoomActiveTag.background&&Math.abs(this.dragMaskSize())||0},i),"rect")}renderText(){const{startTextStyle:t,endTextStyle:i}=this.attribute,{formatMethod:n}=t,r=ol(t,["formatMethod"]),{formatMethod:a}=i,s=ol(i,["formatMethod"]),{start:o,end:l}=this.state;this._startValue=this._statePointToData(o),this._endValue=this._statePointToData(l);const{position:u,width:h,height:d}=this.getLayoutAttrFromConfig();this._isHorizontal?(this._startText=this.maybeAddLabel(this._container,e.merge({},r,{text:n?n(this._startValue):this._startValue,x:u.x+o*h,y:u.y+d/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"right",textBaseline:"middle"}}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,e.merge({},s,{text:a?a(this._endValue):this._endValue,x:u.x+l*h,y:u.y+d/2,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"left",textBaseline:"middle"}}),`data-zoom-end-text-${u}`)):(this._startText=this.maybeAddLabel(this._container,e.merge({},r,{text:n?n(this._startValue):this._startValue,x:u.x+h/2,y:u.y+o*d,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"bottom"}}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,e.merge({},s,{text:a?a(this._endValue):this._endValue,x:u.x+h/2,y:u.y+l*d,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:{textAlign:"center",textBaseline:"top"}}),`data-zoom-end-text-${u}`))}getLayoutAttrFromConfig(){var t,e,i,n;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:r,size:a,orient:s,middleHandlerStyle:o,startHandlerStyle:l,endHandlerStyle:u}=this.attribute,{width:h,height:d}=a,c=null!==(e=null===(t=null==o?void 0:o.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let f,v,p;(null==o?void 0:o.visible)?this._isHorizontal?(f=h,v=d-c,p={x:r.x,y:r.y+c}):(f=h-c,v=d,p={x:r.x+("left"===s?c:0),y:r.y}):(f=h,v=d,p=r);const g=null!==(i=null==l?void 0:l.size)&&void 0!==i?i:this._isHorizontal?v:f,y=null!==(n=null==u?void 0:u.size)&&void 0!==n?n:this._isHorizontal?v:f;return(null==l?void 0:l.visible)&&(this._isHorizontal?(f-=(g+y)/2,p={x:p.x+g/2,y:p.y}):(v-=(g+y)/2,p={x:p.x,y:p.y+g})),this._layoutAttrFromConfig={position:p,width:f,height:v},this._layoutAttrFromConfig}render(){var t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x;this._layoutAttrFromConfig=null;const{orient:_,backgroundStyle:A,backgroundChartStyle:k,selectedBackgroundStyle:B,selectedBackgroundChartStyle:w,middleHandlerStyle:S,startHandlerStyle:T,endHandlerStyle:C,brushSelect:E}=this.attribute,{start:M,end:P}=this.state,{position:L,width:O,height:I}=this.getLayoutAttrFromConfig(),R=this.createOrUpdateChild("dataZoom-container",{},"group");this._container=R,this._background=R.createOrUpdateChild("background",Object.assign({x:L.x,y:L.y,width:O,height:I,cursor:E?"crosshair":"auto"},A),"rect"),(null===(t=null==k?void 0:k.line)||void 0===t?void 0:t.visible)&&this.setPreviewAttributes("line",R),(null===(e=null==k?void 0:k.area)||void 0===e?void 0:e.visible)&&this.setPreviewAttributes("area",R),E&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=R.createOrUpdateChild("selectedBackground",Object.assign({x:L.x+M*O,y:L.y,width:(P-M)*O,height:I,cursor:E?"crosshair":"move"},B),"rect"):this._selectedBackground=R.createOrUpdateChild("selectedBackground",Object.assign({x:L.x,y:L.y+M*I,width:O,height:(P-M)*I,cursor:E?"crosshair":"move"},B),"rect"),(null===(i=null==w?void 0:w.line)||void 0===i?void 0:i.visible)&&this.setSelectedPreviewAttributes("line",R),(null===(n=null==w?void 0:w.area)||void 0===n?void 0:n.visible)&&this.setSelectedPreviewAttributes("area",R),this._showText&&this.renderText(),this._isHorizontal?(this._startHandler=R.createOrUpdateChild("startHandler",Object.assign({x:L.x+M*O,y:L.y+I/2,size:I,angle:0,symbolType:null!==(r=null==T?void 0:T.symbolType)&&void 0!==r?r:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},T),"symbol"),this._endHandler=R.createOrUpdateChild("endHandler",Object.assign({x:L.x+P*O,y:L.y+I/2,size:I,angle:0,symbolType:null!==(a=null==C?void 0:C.symbolType)&&void 0!==a?a:"square",cursor:"ew-resize",strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise"},C),"symbol"),(null==S?void 0:S.visible)&&(this._middleHandlerRect=R.createOrUpdateChild("middleHandlerRect",Object.assign({x:L.x+M*O,y:L.y-((null===(s=null==S?void 0:S.background)||void 0===s?void 0:s.size)||10),width:(P-M)*O,height:(null===(o=null==S?void 0:S.background)||void 0===o?void 0:o.size)||10},null===(l=null==S?void 0:S.background)||void 0===l?void 0:l.style),"rect"),this._middleHandlerSymbol=R.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:L.x+(M+P)/2*O,y:L.y-((null===(u=null==S?void 0:S.background)||void 0===u?void 0:u.size)||10)/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(d=null===(h=null==S?void 0:S.icon)||void 0===h?void 0:h.symbolType)&&void 0!==d?d:"square"},null==S?void 0:S.icon),"symbol"))):(this._startHandler=R.createOrUpdateChild("startHandler",Object.assign({x:L.x+O/2,y:L.y+M*I,size:O,angle:Math.PI/180*90,symbolType:null!==(c=null==T?void 0:T.symbolType)&&void 0!==c?c:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},T),"symbol"),(null==S?void 0:S.visible)&&(this._middleHandlerRect=R.createOrUpdateChild("middleHandlerRect",Object.assign({x:"left"===_?L.x-((null===(f=null==S?void 0:S.background)||void 0===f?void 0:f.size)||10):L.x+O,y:L.y+M*I,width:(null===(v=null==S?void 0:S.background)||void 0===v?void 0:v.size)||10,height:(P-M)*I},null===(p=null==S?void 0:S.background)||void 0===p?void 0:p.style),"rect"),this._middleHandlerSymbol=R.createOrUpdateChild("middleHandlerSymbol",Object.assign({x:"left"===_?L.x-((null===(g=null==S?void 0:S.background)||void 0===g?void 0:g.size)||10)/2:L.x+O+((null===(y=null==S?void 0:S.background)||void 0===y?void 0:y.size)||10)/2,y:L.y+(M+P)/2*I,angle:Math.PI/180*90,symbolType:null!==(m=null===(b=null==S?void 0:S.icon)||void 0===b?void 0:b.symbolType)&&void 0!==m?m:"square",strokeBoundsBuffer:0},null==S?void 0:S.icon),"symbol")),this._endHandler=R.createOrUpdateChild("endHandler",Object.assign({x:L.x+O/2,y:L.y+P*I,size:O,angle:Math.PI/180*90,symbolType:null!==(x=null==C?void 0:C.symbolType)&&void 0!==x?x:"square",cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0},C),"symbol"))}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:n}=this.getLayoutAttrFromConfig();let r,a;return this._isHorizontal?(r=[{x:e.x,y:e.y+n}],a=[{x:e.x+i,y:e.y+n}]):"left"===t?(r=[{x:e.x+i,y:e.y}],a=[{x:e.x+i,y:e.y+n}]):(r=[{x:e.x,y:e.y+n}],a=[{x:e.x,y:e.y}]),{basePointStart:r,basePointEnd:a}}getPreviewLinePoints(){const t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){const t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)})));if(0===t.length)return t;const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},null==i?void 0:i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i}=this.attribute,{start:n,end:r}=this.state,{position:a,width:s,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?a.x+n*s:a.x,y:this._isHorizontal?a.y:a.y+n*o,width:this._isHorizontal?(r-n)*s:s,height:this._isHorizontal?o:(r-n)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?a.x+n*s:a.x),y:-(this._isHorizontal?a.y:a.y+n*o),width:this._isHorizontal?(r-n)*s:s,height:this._isHorizontal?o:(r-n)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},null==i?void 0:i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},null==i?void 0:i.area))}maybeAddLabel(t,e,i){let n=this.find((t=>t.name===i),!0);return n?n.setAttributes(e):(n=new Ll(e),n.name=i),t.add(n),n}_dispatchChangeEvent(t,e){var i;const n=new bi("change",{start:t,end:e});n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}setStartAndEnd(t,i){var n;const{start:r,end:a}=this.attribute;e.isValid(t)&&e.isValid(i)&&(t!==this.state.start||i!==this.state.end)&&(this.state.start=t,this.state.end=i,r===this.state.start&&a===this.state.end||(this.setStateAttr(t,i,!0),null===(n=this._updateStateCallback)||void 0===n||n.call(this,t,i,this._activeTag),this._dispatchChangeEvent(t,i)))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,i,n,r;const{middleHandlerStyle:a}=this.attribute,s=null!==(i=null===(t=null==a?void 0:a.background)||void 0===t?void 0:t.size)&&void 0!==i?i:10,o=null!==(r=null===(n=null==a?void 0:a.icon)||void 0===n?void 0:n.size)&&void 0!==r?r:10;return Math.max(s,...e.array(o))}setUpdateStateCallback(t){e.isFunction(t)&&(this._updateStateCallback=t)}setPreviewPointsX(t){e.isFunction(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){e.isFunction(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){e.isFunction(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){e.isFunction(t)&&(this._previewPointsY1=t)}setStatePointToData(t){e.isFunction(t)&&(this._statePointToData=t)}}var ah,sh,oh;rh.defaultAttributes={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,symbolType:"M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},t.IMarkLineLabelPosition=void 0,(ah=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",ah.middle="middle",ah.end="end",ah.insideStartTop="insideStartTop",ah.insideStartBottom="insideStartBottom",ah.insideMiddleTop="insideMiddleTop",ah.insideMiddleBottom="insideMiddleBottom",ah.insideEndTop="insideEndTop",ah.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(sh=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",sh.right="right",sh.top="top",sh.bottom="bottom",sh.middle="middle",sh.insideLeft="insideLeft",sh.insideRight="insideRight",sh.insideTop="insideTop",sh.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(oh=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",oh.bottom="bottom",oh.middle="middle",oh.insideTop="insideTop",oh.insideBottom="insideBottom",oh.insideMiddle="insideMiddle";class lh extends rl{constructor(){super(...arguments),this.name="marker"}_initContainer(){var t,e;const{limitRect:i,clipInRange:n}=this.attribute;let r;if(n){const n=as.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));r=as.group({x:-(null!==(t=null==i?void 0:i.x)&&void 0!==t?t:0),y:-(null!==(e=null==i?void 0:i.y)&&void 0!==e?e:0),pickable:!1}),n.add(r),this._containerClip=n,this.add(n)}else r=as.group({x:0,y:0,pickable:!1}),this.add(r);r.name="marker-container",this._container=r}_updateContainer(){var t,e,i;const{limitRect:n,clipInRange:r}=this.attribute;null===(t=this._containerClip)||void 0===t||t.setAttributes(Object.assign({},n)),this._container.setAttributes({x:r?-(null!==(e=null==n?void 0:n.x)&&void 0!==e?e:0):0,y:r?-(null!==(i=null==n?void 0:n.y)&&void 0!==i?i:0):0})}render(){var t;this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&(!this._container&&this.isValidPoints()?(this._initContainer(),this.initMarker(this._container)):this.isValidPoints()?(this._updateContainer(),this.updateMarker()):(this._container=null,this.removeAllChild()))}}const uh={startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:t.IMarkLineLabelPosition.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},hh={start:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},dh={label:{position:t.IMarkAreaLabelPosition.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},ch={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},fh={top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}};function vh(t,e){const{x1:i,y1:n,x2:r,y2:a}=e,{x1:s,y1:o,x2:l,y2:u}=t.AABBBounds,{dx:h=0,dy:d=0}=t.attribute;let c=0,f=0;s<i&&(c=i-s),o<n&&(f=n-o),l>r&&(c=r-l),u>a&&(f=a-u),c&&t.setAttribute("dx",c+h),f&&t.setAttribute("dy",f+d)}class ph extends lh{getLine(){return this._line}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ph.defaultAttributes,t)),this.name="markLine"}setLabelPos(){var t,e;const{label:i={},limitRect:n}=this.attribute,{position:r="end",refX:a=0,refY:s=0,confine:o}=i,l=this._line.getMainSegmentPoints(),u=null!==(t=this._line.getEndAngle())&&void 0!==t?t:0,h=a*Math.cos(u)+s*Math.cos(u-Math.PI/2),d=a*Math.sin(u)+s*Math.sin(u-Math.PI/2);let c;if(c=r.includes("start")||r.includes("Start")?{x:l[0].x+h,y:l[0].y+d}:r.includes("middle")||r.includes("Middle")?{x:(l[0].x+l[l.length-1].x)/2+h,y:(l[0].y+l[l.length-1].y)/2+d}:{x:l[l.length-1].x+h,y:l[l.length-1].y+d},this._label.setAttributes(Object.assign(Object.assign({},c),{angle:i.autoRotate?u+(null!==(e=null==i?void 0:i.refAngle)&&void 0!==e?e:0):0,textStyle:Object.assign(Object.assign({},hh[r]),i.textStyle)})),n&&o){const{x:t,y:e,width:i,height:r}=n;vh(this._label,{x1:t,y1:e,x2:t+i,y2:e+r})}}initMarker(t){const{points:e,startSymbol:i,endSymbol:n,label:r,lineStyle:a,mainSegmentIndex:s,multiSegment:o}=this.attribute,l=new Cu({points:e,startSymbol:i,endSymbol:n,lineStyle:a,mainSegmentIndex:s,multiSegment:o,pickable:!1});l.name="mark-line-line",this._line=l,t.add(l);const u=new Ll(Object.assign({},r));u.name="mark-line-label",this._label=u,t.add(u),this.setLabelPos()}updateMarker(){var t,e;const{points:i,startSymbol:n,endSymbol:r,label:a,lineStyle:s,mainSegmentIndex:o,multiSegment:l}=this.attribute;null===(t=this._line)||void 0===t||t.setAttributes({points:i,startSymbol:n,endSymbol:r,lineStyle:s,mainSegmentIndex:o,multiSegment:l}),null===(e=this._label)||void 0===e||e.setAttributes(Object.assign({dx:0,dy:0},a)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;return!(!t||t.length<2)}}ph.defaultAttributes=uh;class gh extends lh{getArea(){return this._area}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},gh.defaultAttributes,t)),this.name="markArea"}_getPositionByDirection(t,e){const{x1:i,x2:n,y1:r,y2:a}=this._area.AABBBounds;return e.includes("left")||e.includes("Left")?{x:i,y:(r+a)/2}:e.includes("right")||e.includes("Right")?{x:n,y:(r+a)/2}:e.includes("top")||e.includes("Top")?{x:(i+n)/2,y:r}:e.includes("bottom")||e.includes("Bottom")?{x:(i+n)/2,y:a}:{x:(i+n)/2,y:(r+a)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e}=this.attribute,i=null!==(t=null==e?void 0:e.position)&&void 0!==t?t:"middle",n=this._getPositionByDirection(this._area,i);if(this._label.setAttributes(Object.assign(Object.assign({},n),{textStyle:Object.assign(Object.assign({},ch[i]),e.textStyle)})),this.attribute.limitRect&&(null==e?void 0:e.confine)){const{x:t,y:e,width:i,height:n}=this.attribute.limitRect;vh(this._label,{x1:t,y1:e,x2:t+i,y2:e+n})}}}initMarker(t){const{points:e,label:i,areaStyle:n}=this.attribute,r=as.polygon(Object.assign({points:e},n));r.name="mark-area-area",this._area=r,t.add(r);const a=new Ll(Object.assign({},i));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){var t,e;const{points:i,label:n,areaStyle:r}=this.attribute;null===(t=this._area)||void 0===t||t.setAttributes(Object.assign({points:i},r)),null===(e=this._label)||void 0===e||e.setAttributes(Object.assign({dx:0,dy:0},n)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;return!(!t||t.length<3)}}gh.defaultAttributes=dh;class yh extends lh{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},yh.defaultAttributes,t)),this.name="markPoint"}setLabelPos(){}setItemAttributes(e,i,n,r){var a;if(!e)return;const{autoRotate:s=!0,refX:o=0,refY:l=0,refAngle:u=0,textStyle:h,richTextStyle:d,imageStyle:c,position:f=t.IMarkPointItemPosition.middle}=i,v=(null===(a=this._line)||void 0===a?void 0:a.getEndAngle())||0,p=o*Math.cos(v)+l*Math.cos(v-Math.PI/2),g=o*Math.sin(v)+l*Math.sin(v-Math.PI/2);"text"===r?e.setAttributes(Object.assign(Object.assign({},h),{textStyle:Object.assign(Object.assign({},fh[(null==i?void 0:i.position)||"end"]),null==h?void 0:h.textStyle)})):"richText"===r?e.setAttributes({dx:this.getItemDx(e,f,d)+((null==d?void 0:d.dx)||0),dy:this.getItemDy(e,f,d)+((null==d?void 0:d.dy)||0)}):"image"===r&&e.setAttributes({dx:this.getItemDx(e,f,c)+((null==c?void 0:c.dx)||0),dy:this.getItemDy(e,f,c)+((null==c?void 0:c.dy)||0)}),e.setAttributes({x:n.x+(p||0),y:n.y+(g||0),angle:s&&v+u})}getItemDx(t,e,i){var n,r;const a=null!==(r=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.width())&&void 0!==r?r:(null==i?void 0:i.width)||0;return e.includes("inside")?-a:0}getItemDy(t,e,i){var n,r;const a=null!==(r=null===(n=null==t?void 0:t.AABBBounds)||void 0===n?void 0:n.height())&&void 0!==r?r:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-a:e.includes("middle")||e.includes("Middle")?-a/2:0}initItem(t,e){const{type:i="text",symbolStyle:n,richTextStyle:r,imageStyle:a,renderCustomCallback:s}=t;let o;return"symbol"===i?o=as.symbol(Object.assign(Object.assign({},e),n)):"text"===i?o=new Ll(Object.assign({},e)):"richText"===i?o=as.richtext(Object.assign(Object.assign({},e),r)):"image"===i?o=as.image(Object.assign(Object.assign({},e),a)):"custom"===i&&s&&(o=s()),this.setItemAttributes(o,t,e,i),o}getItemLineAttr(t,e,i){let n=[];const{type:r="type-s"}=t;return n="type-do"===r?[e,{x:(e.x+i.x)/2,y:i.y},i]:"type-po"===r?[e,{x:i.x,y:e.y},i]:"type-op"===r?[e,{x:e.x,y:i.y},i]:[e,i],n}setItemLineAttr(t,e,i,n){var r;const{startSymbol:a,endSymbol:s,lineStyle:o}=t,l=this.getItemLineAttr(t,e,i);null===(r=this._line)||void 0===r||r.setAttributes({points:l,startSymbol:a,endSymbol:s,lineStyle:o,visible:n})}getDecorativeLineAttr(t,e){var i;const n=(null===(i=null==t?void 0:t.decorativeLine)||void 0===i?void 0:i.length)||10,r=this._line.getEndAngle()||0;return{startPointOffsetX:n/2*Math.cos(r-Math.PI/2),startPointOffsetY:n/2*Math.sin(r-Math.PI/2),endPointOffsetX:-n/2*Math.cos(r-Math.PI/2),endPointOffsetY:-n/2*Math.sin(r-Math.PI/2)}}setDecorativeLineAttr(t,e,i){var n;const{lineStyle:r}=t,{startPointOffsetX:a,startPointOffsetY:s,endPointOffsetX:o,endPointOffsetY:l}=this.getDecorativeLineAttr(t,e);null===(n=this._decorativeLine)||void 0===n||n.setAttributes(Object.assign(Object.assign({points:[{x:e.x+a,y:e.y+s},{x:e.x+o,y:e.y+l}]},r),{visible:i}))}initMarker(t){var e;const{position:i,itemLine:n,itemContent:r}=this.attribute,a={x:i.x+((null==r?void 0:r.offsetX)||0),y:i.y+((null==r?void 0:r.offsetY)||0)},s=new Cu({points:[],pickable:!1});s.name="mark-point-line",this._line=s,t.add(s);const o=as.line({points:[]});o.name="mark-point-decorativeLine",this._decorativeLine=o,t.add(o),this.setItemLineAttr(n,i,a,null==n?void 0:n.visible),this.setDecorativeLineAttr(n,a,null===(e=null==n?void 0:n.decorativeLine)||void 0===e?void 0:e.visible);const l=this.initItem(r,a);this._item=l,t.add(l)}updateMarker(){var t;const{position:e,itemLine:i,itemContent:n}=this.attribute,{type:r="text"}=n,a={x:e.x+((null==n?void 0:n.offsetX)||0),y:e.y+((null==n?void 0:n.offsetY)||0)};this.setItemLineAttr(i,e,a,null==i?void 0:i.visible),this.setDecorativeLineAttr(i,a,null===(t=null==i?void 0:i.decorativeLine)||void 0===t?void 0:t.visible),this.setItemAttributes(this._item,n,a,r)}isValidPoints(){return!0}}yh.defaultAttributes={itemLine:{visible:!0,decorativeLine:{visible:!1,length:30},startSymbol:{visible:!0,clip:!0,symbolType:"circle",size:20,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},endSymbol:{visible:!1,clip:!0,symbolType:"triangle",size:12,style:{fill:!1,stroke:"rgba(46, 47, 50)"}},lineStyle:{stroke:"#000",lineWidth:1}},itemContent:{type:"text",position:"middle",refX:10,symbolStyle:{symbolType:"star",fill:"rgb(48, 115, 242)",fillOpacity:.8,size:20},textStyle:{dx:0,dy:0},imageStyle:{width:80,height:80},richTextStyle:{width:100,height:100}}};const bh={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};class mh extends rl{getCurrent(){return this._current}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},mh.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{var e,i;const n=t.target;if("preHandler"===n.name){if(1===this._current)return;this._current-=1,1===this._current?n.addState("disable"):n.removeState("disable");const i=new bi("toPrev",{current:this._current,total:this._total,direction:"pre",event:t});i.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,this.dispatchEvent(i)}if("nextHandler"===n.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?n.addState("disable"):n.removeState("disable");const e=new bi("toNext",{current:this._current,total:this._total,direction:"next",event:t});e.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(e)}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",`${this._current}/${this._total}`)}}render(){var t;this._reset();const{layout:i="horizontal",handler:n=bh,total:r,defaultCurrent:a=1,textStyle:s,padding:o=0}=this.attribute;this._current=a;const l=e.normalizePadding(o),u="horizontal"===i,h=as.group({x:0,y:0}),d=n.style||{},c=d.size||15,f=null!==(t=n.space)&&void 0!==t?t:8,v=n.state||{};let{preShape:p,nextShape:g}=n;p||(p=u?"triangleLeft":"triangleUp"),g||(g=u?"triangleRight":"triangleDown");const y=as.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},d),{x:0,y:0,symbolType:p,size:c}));y.states=v,y.name="preHandler",this.preHandler=y,h.add(y);const{width:b,height:m}=Pl(`${r}/${r}`,Object.assign({textAlign:"center",textBaseline:"middle"},s)),x=e.isNumber(c)?c:c[0],_=e.isNumber(c)?c:c[1],A=as.text(Object.assign({x:u?x/2+f+b/2:0,y:u?0:_/2+f+m/2,text:`${a}/${r}`,textAlign:"center",textBaseline:"middle",lineHeight:null==s?void 0:s.fontSize},s));this.text=A,h.add(A);const k=as.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},d),{x:u?x+2*f+b:0,y:u?0:_+2*f+m,symbolType:g,size:c}));k.name="nextHandler",k.states=v,this.nextHandler=k,h.add(k),1===this._total?(y.addState("disable"),k.addState("disable")):1===this._current?y.addState("disable"):this._current===r&&k.addState("disable");const B=h.AABBBounds,w=B.width(),S=B.height();h.translateTo(0-B.x1+l[3],0-B.y1+l[0]),this.add(h),this.attribute.width=w+l[1]+l[3],this.attribute.height=S+l[0]+l[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}}mh.defaultAttributes={handler:bh,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const xh=16,_h=8,Ah=12,kh=12;var Bh,wh,Sh;t.LegendStateValue=void 0,(Bh=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",Bh.unSelected="unSelected",Bh.selectedHover="selectedHover",Bh.unSelectedHover="unSelectedHover",Bh.focus="focus",t.LegendEvent=void 0,(wh=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",wh.legendItemUnHover="legendItemUnHover",wh.legendItemClick="legendItemClick",wh.legendItemAttributeUpdate="legendItemAttributeUpdate",t.LEGEND_ELEMENT_NAME=void 0,(Sh=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",Sh.title="legendTitle",Sh.item="legendItem",Sh.itemShape="legendItemShape",Sh.itemLabel="legendItemLabel",Sh.itemValue="legendItemValue",Sh.focus="legendItemFocus";class Th extends rl{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild();const{interactive:i=!0,title:n,padding:r=0}=this.attribute,a=e.normalizePadding(r),s=as.group({x:a[3],y:a[0],pickable:i,childrenPickable:i});s.name=t.LEGEND_ELEMENT_NAME.innerView,this.add(s),this._innerView=s,(null==n?void 0:n.visible)&&this._renderTitle(n),this._renderContent(),this._adjustLayout(),i&&this._bindEvents();const o=this._innerView.AABBBounds;this.attribute.width=o.width()+a[1]+a[3],this.attribute.height=o.height()+a[0]+a[2]}_renderTitle(i){const{text:n="",textStyle:r,padding:a=0,background:s,minWidth:o,maxWidth:l,shape:u}=i,h={x:0,y:0,text:n,textStyle:r,padding:e.normalizePadding(a),minWidth:o,maxWidth:l};u&&u.visible&&(h.shape=Object.assign({visible:!0},u.style),e.isValid(u.space)&&(h.space=u.space)),s&&s.visible&&(h.panel=Object.assign({visible:!0},s.style));const d=new Ll(h);d.name=t.LEGEND_ELEMENT_NAME.title,this._title=d,this._innerView.add(d)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),n=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===n?this._title.setAttribute("x",(e-i)/2):"end"===n&&this._title.setAttribute("x",e-i)}}}const Ch={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};class Eh extends Th{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},Eh.defaultAttributes,i)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=e=>{var i;const n=e.target;if(null===(i=null==n?void 0:n.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const t=n.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===t.id)return;this._unHover(this._lastActiveItem,e)}this._hover(t,e)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,e),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=e=>{var i,n,r,a,s;const o=e.target;if(null===(i=null==o?void 0:o.name)||void 0===i?void 0:i.startsWith(t.LEGEND_ELEMENT_NAME.item)){const i=o.delegate;if(o.name===t.LEGEND_ELEMENT_NAME.focus){const a=i.hasState(t.LegendStateValue.focus);i.toggleState(t.LegendStateValue.focus),a?null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((i=>{this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover,t.LegendStateValue.focus],e),this._setLegendItemState(i,t.LegendStateValue.selected,e)})):(this._setLegendItemState(i,t.LegendStateValue.selected,e),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(r=this._itemsContainer)||void 0===r||r.getChildren().forEach((n=>{i!==n&&(this._removeLegendItemState(n,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover,t.LegendStateValue.focus],e),this._setLegendItemState(n,t.LegendStateValue.unSelected,e))})))}else{null===(a=this._itemsContainer)||void 0===a||a.getChildren().forEach((e=>{e.removeState(t.LegendStateValue.focus)}));const{selectMode:n="multiple",allowAllCanceled:r=!0}=this.attribute,o=i.hasState(t.LegendStateValue.selected),l=this._getSelectedLegends();if("multiple"===n){if(!1===r&&o&&1===l.length)return void this._dispatchEvent(t.LegendEvent.legendItemClick,i,e);o?(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(i,t.LegendStateValue.unSelected,e)):(this._setLegendItemState(i,t.LegendStateValue.selected,e),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e))}else this._setLegendItemState(i,t.LegendStateValue.selected,e),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((n=>{i!==n&&(this._removeLegendItemState(n,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(n,t.LegendStateValue.unSelected,e))}))}this._dispatchEvent(t.LegendEvent.legendItemClick,i,e)}}}setSelected(e){var i;(null===(i=this._itemsContainer)||void 0===i?void 0:i.getChildren()).forEach((i=>{const n=i.data;e.includes(n.label)?(this._setLegendItemState(i,t.LegendStateValue.selected),this._removeLegendItemState(i,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover])):(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover]),this._setLegendItemState(i,t.LegendStateValue.unSelected))}))}_renderContent(){const{item:t={},items:i,reversed:n,maxCol:r=1,maxRow:a=2}=this.attribute;if(!1===t.visible||e.isEmpty(i))return;let s=i;n&&(s=null==i?void 0:i.reverse());const o=as.group({x:0,y:0});this._itemsContainer=o;const{layout:l,maxWidth:u,maxHeight:h,defaultSelected:d=[],autoPage:c}=this.attribute,f="horizontal"===l,{spaceCol:v=xh,spaceRow:p=_h,maxWidth:g,width:y,height:b}=t;e.isValid(g)?e.isValid(y)?this._itemWidthByUser=Math.min(g,y):this._itemWidthByUser=g:e.isValid(y)&&(this._itemWidthByUser=y),e.isValid(b)&&(this._itemHeightByUser=b);let m=!1,x=0,_=0,A=0,k=1,B=1;s.forEach(((t,i)=>{t.id||(t.id=t.label),t.index=i;const n=this._renderEachItem(t,!!e.isEmpty(d)||(null==d?void 0:d.includes(t.label)),i,s),l=n.attribute.width,c=n.attribute.height;this._itemHeight=Math.max(this._itemHeight,c),x=Math.max(l,x),this._itemMaxWidth=Math.max(l,this._itemMaxWidth),f?(k=a,e.isValid(u)&&(l>=u?(m=!0,i>0&&(_=0,A+=c+p,B+=1)):u<_+l&&(m=!0,_=0,A+=c+p,B+=1)),i>0&&n.setAttributes({x:_,y:A}),_+=v+l):(k=r,e.isValid(h)&&h<A+c&&(m=!0,A=0,_+=x+v,x=0,B+=1),i>0&&n.setAttributes({x:_,y:A}),A+=p+c),o.add(n)}));let w=!1;m&&c&&B>k&&(w=this._renderPager(f)),w||(o.setAttribute("y",this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",8):0),this._innerView.add(o))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_renderEachItem(i,n,r,a){const{id:s,label:o,value:l,shape:u}=i,{padding:h=0,focus:d,focusIconStyle:c={}}=this.attribute.item;let{shape:f={},label:v={},value:p={},background:g={}}=this.attribute.item;f=this._handleStyle(f,i,n,r,a),v=this._handleStyle(v,i,n,r,a),p=this._handleStyle(p,i,n,r,a),g=this._handleStyle(g,i,n,r,a);const y=e.normalizePadding(h);let b;!1===g.visible?(b=as.group({x:0,y:0,cursor:(null==g?void 0:g.style).cursor}),this._appendDataToShape(b,t.LEGEND_ELEMENT_NAME.item,i,b)):(b=as.group(Object.assign({x:0,y:0},null==g?void 0:g.style)),this._appendDataToShape(b,t.LEGEND_ELEMENT_NAME.item,i,b,null==g?void 0:g.state)),b.id=`${null!=s?s:o}-${r}`,b.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const m=as.group({x:0,y:0,pickable:!1});b.add(m);let x,_=0,A=0,k=0;if(!1!==(null==f?void 0:f.visible)){A=e.get(f,"style.size",10),k=e.get(f,"space",8);const r=as.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},u),f.style));Object.keys(f.state||{}).forEach((t=>{const i=f.state[t].fill||f.state[t].stroke;u.fill&&e.isNil(f.state[t].fill)&&i&&(f.state[t].fill=i),u.stroke&&e.isNil(f.state[t].stroke)&&i&&(f.state[t].stroke=i)})),this._appendDataToShape(r,t.LEGEND_ELEMENT_NAME.itemShape,i,b,null==f?void 0:f.state),r.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),m.add(r)}let B=0;if(d){const n=e.get(c,"size",10);x=as.symbol(Object.assign(Object.assign({x:0,y:-n/2-1,strokeBoundsBuffer:0},c),{visible:!0,pickMode:"imprecise",boundsPadding:y})),this._appendDataToShape(x,t.LEGEND_ELEMENT_NAME.focus,i,b),B=n}const w=as.text(Object.assign(Object.assign({x:A/2+k,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==v?void 0:v.style).fontSize},null==v?void 0:v.style),{text:v.formatMethod?v.formatMethod(o,i,r):o}));this._appendDataToShape(w,t.LEGEND_ELEMENT_NAME.itemLabel,i,b,null==v?void 0:v.state),w.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),m.add(w);const S=e.get(v,"space",8);if(e.isValid(l)){const a=e.get(p,"space",d?8:0),s=as.text(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:(null==p?void 0:p.style).fontSize},null==p?void 0:p.style),{text:p.formatMethod?p.formatMethod(l,i,r):l}));if(this._appendDataToShape(s,t.LEGEND_ELEMENT_NAME.itemValue,i,b,null==p?void 0:p.state),s.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-y[1]-y[3]-A-k-S-B-a,e=s.AABBBounds,i=w.AABBBounds,n=e.width(),r=i.width();r>t?(t-n)/r>.4?w.setAttribute("maxLineWidth",t-n):(s.setAttribute("maxLineWidth",.5*t),w.setAttribute("maxLineWidth",.5*t)):s.setAttribute("maxLineWidth",t-r),p.alignRight?s.setAttributes({textAlign:"right",x:this._itemWidthByUser-A/2-y[1]-y[3]-B-a}):s.setAttribute("x",w.AABBBounds.x2+a)}else s.setAttribute("x",w.AABBBounds.x2+a);_=s.AABBBounds.x2+a,m.add(s)}else this._itemWidthByUser?(w.setAttribute("maxLineWidth",this._itemWidthByUser-y[1]-y[3]-A-k-B),_=w.AABBBounds.x2+S):_=w.AABBBounds.x2+S;x&&(x.setAttribute("x",_),m.add(x));const T=m.AABBBounds,C=T.width(),E=T.height(),M=e.isValid(this.attribute.item.width)?this.attribute.item.width:C+y[1]+y[3],P=this._itemHeightByUser||E+y[0]+y[2];return b.attribute.width=M,b.attribute.height=P,x&&x.setAttribute("visible",!1),m.translateTo(-T.x1+y[3],-T.y1+y[0]),b}_renderPager(t){const i=this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",8):0,{maxWidth:n,maxHeight:r,maxCol:a=1,maxRow:s=2,item:o={},pager:l={},disableTriggerEvent:u}=this.attribute,{spaceCol:h=xh,spaceRow:d=_h}=o,c=this._itemsContainer,{animation:f=!0,animationDuration:v=450,animationEasing:p="quadIn",space:g=kh,position:y="middle"}=l,b=ol(l,["animation","animationDuration","animationEasing","space","position"]);let m,x=0,_=0,A=0,k=0,B=1;if(t){if(m=new mh(Object.assign(Object.assign({layout:1===s?"horizontal":"vertical",total:99},e.merge({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},b)),{disableTriggerEvent:u})),this._pager=m,this._innerView.add(m),x=(s-1)*d+this._itemHeight*s,_=n-m.AABBBounds.width()-g,_<=0)return this._innerView.removeChild(m),!1;let t;c.getChildren().forEach(((t,e)=>{const{width:i,height:n}=t.attribute;_<A+i&&(A=0,k+=n+d,B+=1),e>0&&t.setAttributes({x:A,y:k}),A+=h+i})),m.setAttribute("total",Math.ceil(B/s)),t="start"===y?i:"end"===y?i+x-m.AABBBounds.height()/2:i+x/2-m.AABBBounds.height()/2,m.setAttributes({x:_,y:t})}else{if(m=new mh(Object.assign({layout:"horizontal",total:99,disableTriggerEvent:u},b)),this._pager=m,this._innerView.add(m),_=this._itemMaxWidth*a+(a-1)*h,x=r-m.AABBBounds.height()-g-i,x<=0)return this._innerView.removeChild(m),!1;let t;c.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;x<k+i&&(k=0,A+=this._itemMaxWidth+h,B+=1),e>0&&t.setAttributes({x:A,y:k}),k+=d+i})),m.setAttribute("total",Math.ceil(B/a)),t="start"===y?0:"end"===y?_-m.AABBBounds.width():(_-m.AABBBounds.width())/2,m.setAttributes({x:t,y:r-m.AABBBounds.height()})}l.defaultCurrent>1&&(t?c.setAttribute("y",-(l.defaultCurrent-1)*(x+d)):c.setAttribute("x",-(l.defaultCurrent-1)*(_+h)));const w=as.group({x:0,y:i,width:_,height:x,clip:!0,pickable:!1});w.add(c),this._innerView.add(w);const S=e=>{const{current:i}=e.detail;f?c.animate().to(t?{y:-(i-1)*(x+d)}:{x:-(i-1)*(_+h)},v,p):t?c.setAttribute("y",-(i-1)*(x+d)):c.setAttribute("x",-(i-1)*(_+h))};return this._pager.addEventListener("toPrev",S),this._pager.addEventListener("toNext",S),!0}_hover(e,i){this._lastActiveItem=e;e.hasState(t.LegendStateValue.selected)?this._setLegendItemState(e,t.LegendStateValue.selectedHover,i):this._setLegendItemState(e,t.LegendStateValue.unSelectedHover,i);const n=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);n&&n.setAttribute("visible",!0),this._dispatchEvent(t.LegendEvent.legendItemHover,e,i)}_unHover(e,i){let n=!1;(e.hasState(t.LegendStateValue.unSelectedHover)||e.hasState(t.LegendStateValue.selectedHover))&&(n=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover),e.getChildren()[0].getChildren().forEach((e=>{n||!e.hasState(t.LegendStateValue.unSelectedHover)&&!e.hasState(t.LegendStateValue.selectedHover)||(n=!0),e.removeState(t.LegendStateValue.unSelectedHover),e.removeState(t.LegendStateValue.selectedHover)}));const r=e.getChildren()[0].find((e=>e.name===t.LEGEND_ELEMENT_NAME.focus),!1);r&&r.setAttribute("visible",!1),n&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e,i),this._dispatchEvent(t.LegendEvent.legendItemUnHover,e,i)}_setLegendItemState(e,i,n){let r=!1;e.hasState(i)||(r=!0),e.addState(i,true),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&(r||e.hasState(i)||(r=!0),e.addState(i,true))})),r&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e,n)}_removeLegendItemState(e,i,n){let r=!1;i.forEach((t=>{!r&&e.hasState(t)&&(r=!0),e.removeState(t)})),e.getChildren()[0].getChildren().forEach((e=>{e.name!==t.LEGEND_ELEMENT_NAME.focus&&i.forEach((t=>{!r&&e.hasState(t)&&(r=!0),e.removeState(t)}))})),r&&this._dispatchEvent(t.LegendEvent.legendItemAttributeUpdate,e,n)}_getSelectedLegends(){var e;const i=[];return null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{e.hasState(t.LegendStateValue.selected)&&i.push(e.data)})),i}_appendDataToShape(t,i,n,r,a={}){t.name=i,t.data=n,t.delegate=r,t.states=e.merge({},Ch,a)}_dispatchEvent(e,i,n){var r;const a=this._getSelectedLegends();a.sort(((t,e)=>t.index-e.index));const s=a.map((t=>t.label)),o=new bi(e,{item:i,data:i.data,selected:i.hasState(t.LegendStateValue.selected),currentSelectedItems:a,currentSelected:s,event:n});o.manager=null===(r=this.stage)||void 0===r?void 0:r.eventSystem.manager,this.dispatchEvent(o)}_handleStyle(t,i,n,r,a){const s=e.merge({},t);return t.style&&e.isFunction(t.style)&&(s.style=t.style(i,n,r,a)),t.state&&Object.keys(t.state).forEach((o=>{t.state[o]&&e.isFunction(t.state[o])&&(s.state[o]=t.state[o](i,n,r,a))})),s}}var Mh;function Ph(t){return e.isArray(t)?t:[t,t]}function Lh(t){return t?"ew-resize":"ns-resize"}Eh.defaultAttributes={layout:"horizontal",title:{align:"start",space:Ah,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:xh,spaceRow:_h,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:kh,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(Mh=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",Mh.railContainer="sliderRailContainer",Mh.rail="sliderRail",Mh.startText="sliderStartText",Mh.endText="sliderEndText",Mh.startHandler="sliderStartHandler",Mh.startHandlerText="startHandlerText",Mh.endHandler="sliderEndHandler",Mh.endHandlerText="sliderEndHandlerText",Mh.track="sliderTrack",Mh.trackContainer="sliderTrackContainer";class Oh extends rl{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Oh.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._currentHandler=t.target,this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===Jo.env?(Jo.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Jo.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var i,n;t.stopPropagation();const{railWidth:r,railHeight:a,min:s,max:o}=this.attribute;if(o===s)return;let l,u,h,d=0;this._isHorizontal?(l=t.clientX,d=l-this._prePos,u=null===(n=this._currentHandler)||void 0===n?void 0:n.attribute.x,h=r):(l=t.clientY,d=l-this._prePos,u=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.y,h=a);const c=e.clamp(u+d,0,h),f=c/h*(o-s)+s;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,c,f):this._updateHandler(this._currentHandler,c,f),this._updateTrack(),this._prePos=l,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._currentHandler=null,"browser"===Jo.env?(Jo.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),Jo.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._prePos=this._isHorizontal?t.clientX:t.clientY,"browser"===Jo.env?(Jo.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),Jo.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation();const{railWidth:i,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const{startHandler:s,endHandler:o}=this._getHandlers();let l,u,h;this._isHorizontal?(l=t.clientX,u=this._track.attribute.width,h=i):(l=t.clientY,u=this._track.attribute.height,h=n);const d=l-this._prePos;if(s){const t=this._isHorizontal?s.attribute.x:s.attribute.y,i=e.clamp(t+d,0,h-u),n=i/h*(a-r)+r;this._updateHandler(s,i,n)}if(o){const t=this._isHorizontal?o.attribute.x:o.attribute.y,i=e.clamp(t+d,u,h),n=i/h*(a-r)+r;this._updateHandler(o,i,n),this._track.setAttributes(this._isHorizontal?{x:Math.min(null==s?void 0:s.attribute.x,null==o?void 0:o.attribute.x),width:Math.abs((null==s?void 0:s.attribute.x)-(null==o?void 0:o.attribute.x))}:{y:Math.min(null==s?void 0:s.attribute.y,null==o?void 0:o.attribute.y),height:Math.abs((null==s?void 0:s.attribute.y)-(null==o?void 0:o.attribute.y))})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),"browser"===Jo.env?(Jo.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),Jo.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation();const{railWidth:i,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const s=this._startHandler,o=this._endHandler;let l,u,h,d;this._isHorizontal?(l=t.viewX-this._rail.globalAABBBounds.x1,u=null==s?void 0:s.attribute.x,h=null==o?void 0:o.attribute.x,d=i):(l=t.viewY-this._rail.globalAABBBounds.y1,u=null==s?void 0:s.attribute.y,h=null==o?void 0:o.attribute.y,d=n);const c=l/d*(a-r)+r;if(e.isValid(h)){const t=Math.abs(l-u)>Math.abs(l-h)?o:s;this._updateHandler(t,l,c)}else this._updateHandler(s,l,c);this._updateTrack(),this._dispatchChangeEvent()}}setValue(t){const{layout:i,railWidth:n,railHeight:r,min:a,max:s}=this.attribute;if(s===a)return;const[o,l]=e.array(t),{startHandler:u,endHandler:h}=this._getHandlers(),d="vertical"===i?r:n,c=(o-a)/(s-a)*d;if(u&&this._updateHandler(u,c,o),h){const t=(l-a)/(s-a)*d;this._updateHandler(h,t,l)}this._updateTrack()}render(){var i,n;this.removeAllChild();const{layout:r="horizontal",railWidth:a,railHeight:s,startText:o,endText:l,min:u,max:h,showHandler:d=!0}=this.attribute;let{value:c}=this.attribute;e.isNil(c)&&(c=[u,h]),this._currentValue={startValue:Ph(c)[0],endValue:Ph(c)[1]};const f="horizontal"===r;this._isHorizontal=f;const v=as.group({x:0,y:0});v.name=t.SLIDER_ELEMENT_NAME.innerView,this.add(v),this._innerView=v;let p,g=0;if(o&&o.visible){p=as.text(Object.assign({x:f?0:a/2,y:f?s/2:0,textAlign:f?"start":"center",textBaseline:f?"middle":"top",text:o.text,lineHeight:null===(i=o.style)||void 0===i?void 0:i.fontSize},o.style)),p.name=t.SLIDER_ELEMENT_NAME.startText,v.add(p);const n=e.isValid(o.space)?o.space:0;g+=(f?p.AABBBounds.width():p.AABBBounds.height())+n}const y=as.group({x:f?g:0,y:f?0:g});v.add(y);const b=as.group({x:0,y:0});let m;if(b.name=t.SLIDER_ELEMENT_NAME.railContainer,this._railContainer=b,y.add(b),this._renderRail(b),g+=f?a:s,l&&l.visible){const i=e.isValid(l.space)?l.space:0;m=as.text(Object.assign({x:f?g+i:a/2,y:f?s/2:g+i,textAlign:f?"start":"center",textBaseline:f?"middle":"top",text:l.text,lineHeight:null===(n=l.style)||void 0===n?void 0:n.fontSize},l.style)),m.name=t.SLIDER_ELEMENT_NAME.endText,v.add(m)}this._renderTrack(b),d&&(this._renderHandlers(y),this._bindEvents())}_renderRail(e){const{railWidth:i,railHeight:n,railStyle:r,slidable:a}=this.attribute;let s="default";!1!==a&&(s="pointer");const o=as.rect(Object.assign({x:0,y:0,width:i,height:n,cursor:s},r));return o.name=t.SLIDER_ELEMENT_NAME.rail,e.add(o),this._rail=o,o}_renderHandlers(i){const{range:n,min:r,max:a,handlerSize:s=14,handlerStyle:o,handlerText:l,railHeight:u,railWidth:h,slidable:d}=this.attribute;let{value:c}=this.attribute;e.isNil(c)&&(c=[r,a]);const f=l&&l.visible,v=this._isHorizontal,p=v?h:u,[g,y]=Ph(c),b=a===r?n?0:p:(g-r)/(a-r)*p,m=this._renderHandler(Object.assign({x:v?b:h/2,y:v?u/2:b,size:s,strokeBoundsBuffer:0,cursor:!1===d?"default":Lh(v)},o));if(m.name=t.SLIDER_ELEMENT_NAME.startHandler,this._startHandler=m,i.add(m),this._currentValue.startPos=b,f){const e=this._renderHandlerText(g,n?"start":"end");e.name=t.SLIDER_ELEMENT_NAME.startHandlerText,i.add(e),this._startHandlerText=e}if(n){const e=a===r?p:(y-r)/(a-r)*p,n=this._renderHandler(Object.assign({x:v?e:h/2,y:v?u/2:e,size:s,strokeBoundsBuffer:0,cursor:!1===d?"default":Lh(v)},o));if(n.name=t.SLIDER_ELEMENT_NAME.endHandler,this._endHandler=n,i.add(n),this._currentValue.endPos=e,f){const e=this._renderHandlerText(y,"end");e.name=t.SLIDER_ELEMENT_NAME.endHandlerText,i.add(e),this._endHandlerText=e}}}_renderTrack(i){const{range:n,min:r,max:a,railHeight:s,railWidth:o,trackStyle:l,railStyle:u,slidable:h,value:d}=this.attribute;let c,f;if(e.isNil(d))n?(c=r,f=a):c=f=r;else if(n){const t=e.clampRange(d,r,a);c=t[0],f=t[1]}else c=r,f=e.clamp(d,r,a);const v=this._isHorizontal,p=v?o:s;n||(c=r);const g=as.group({x:0,y:0,width:o,height:s,cornerRadius:null==u?void 0:u.cornerRadius,clip:!0,pickable:!1});g.name=t.SLIDER_ELEMENT_NAME.trackContainer;const y=e.isObject(n)&&!0===n.draggableTrack;let b;b=!1===h?"default":!1===n||!1===y?"pointer":Lh(v);const m=a===r?p:(f-c)/(a-r)*p,x=a===r?0:(c-r)/(a-r)*p,_=as.rect(Object.assign({x:v?x:0,y:v?0:x,width:v?m:o,height:v?s:m,cursor:b},l));_.name=t.SLIDER_ELEMENT_NAME.track,this._track=_,g.add(_),i.add(g)}_renderHandler(t){return as.symbol(t)}_renderHandlerText(t,e){var i,n,r;const{align:a,min:s,max:o,handlerSize:l=14,handlerText:u={},railHeight:h,railWidth:d,slidable:c}=this.attribute,f=this._isHorizontal,v=f?d:h,p=o===s?"start"===e?0:v:(t-s)/(o-s)*v,g=null!==(i=u.space)&&void 0!==i?i:4,y={text:(null==u?void 0:u.formatter)?u.formatter(t):t.toFixed(null!==(n=null==u?void 0:u.precision)&&void 0!==n?n:0),lineHeight:null===(r=u.style)||void 0===r?void 0:r.lineHeight,cursor:!1===c?"default":Lh(f)};f?"top"===a?(y.textBaseline="bottom",y.textAlign="center",y.x=p,y.y=(h-l)/2-g):(y.textBaseline="top",y.textAlign="center",y.x=p,y.y=(h+l)/2+g):"left"===a?(y.textBaseline="middle",y.textAlign="end",y.x=(d-l)/2-g,y.y=p):(y.textBaseline="middle",y.textAlign="start",y.x=(d+l)/2+g,y.y=p);return as.text(Object.assign(Object.assign({},y),u.style))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:i}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),e.isObject(i)&&i.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_updateTrack(){const t=this._startHandler,e=this._endHandler;if(this._isHorizontal){const i=null==t?void 0:t.attribute.x;if(e){const t=null==e?void 0:e.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else this._track.setAttributes({width:i})}else{const i=null==t?void 0:t.attribute.y;if(e){const t=null==e?void 0:e.attribute.y;this._track.setAttributes({y:Math.min(i,t),height:Math.abs(i-t)})}else this._track.setAttributes({height:i})}}_updateHandler(e,i,n){var r;const a=this._isHorizontal;e.setAttribute(a?"x":"y",i);const s=e.name===t.SLIDER_ELEMENT_NAME.startHandler?this._startHandlerText:this._endHandlerText;if(s){const{handlerText:t}=this.attribute;null==s||s.setAttributes({text:(null==t?void 0:t.formatter)?t.formatter(n):n.toFixed(null!==(r=null==t?void 0:t.precision)&&void 0!==r?r:0),[a?"x":"y"]:i})}e.name===t.SLIDER_ELEMENT_NAME.startHandler?(this._currentValue.startValue=n,this._currentValue.startPos=i):(this._currentValue.endValue=n,this._currentValue.endPos=i)}_updateHandlerText(e,i,n){var r;const a=this._isHorizontal,{handlerText:s}=this.attribute;e.setAttributes({[a?"x":"y"]:i,text:(null==s?void 0:s.formatter)?s.formatter(n):n.toFixed(null!==(r=null==s?void 0:s.precision)&&void 0!==r?r:0)});const o=e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?this._startHandler:this._endHandler;o&&(null==o||o.setAttributes({[a?"x":"y"]:i})),e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?(this._currentValue.startValue=n,this._currentValue.startPos=i):(this._currentValue.endValue=n,this._currentValue.endPos=i)}_dispatchChangeEvent(){var t;const e=!!this.attribute.range,i=this._currentValue,n=new bi("change",{value:e?[Math.min(i.endValue,i.startValue),Math.max(i.endValue,i.startValue)]:i.startValue,position:e?[Math.min(i.endPos,i.startPos),Math.max(i.endPos,i.startPos)]:i.startPos});n.manager=null===(t=this.stage)||void 0===t?void 0:t.eventSystem.manager,this.dispatchEvent(n)}_getHandlers(){let t,e=this._startHandler,i=this._endHandler;return this._isHorizontal?i&&i.attribute.x<(null==e?void 0:e.attribute.x)&&(t=e,e=i,i=t):i&&i.attribute.y<(null==e?void 0:e.attribute.y)&&(t=e,e=i,i=t),{startHandler:e,endHandler:i}}}Oh.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}};class Ih extends Th{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ih.defaultAttributes,t)),this.name="colorLegend",this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:n,layout:r,align:a,min:s,max:o,value:l,railWidth:u,railHeight:h,showHandler:d=!0,handlerSize:c,handlerStyle:f,railStyle:v,trackStyle:p,startText:g,endText:y,handlerText:b,showTooltip:m,tooltip:x,disableTriggerEvent:_}=this.attribute,A=[],k=(o-s)/(t.length-1);for(let e=0;e<t.length;e++)A.push(s+k*e);this._colorScale=(new i.LinearScale).domain(A,!0).range(t),this._color=this._getTrackColor();const B=new Oh({x:0,y:0,range:{draggableTrack:!0},slidable:n,layout:r,align:a,min:s,max:o,value:l,railWidth:u,railHeight:h,showHandler:d,handlerSize:c,handlerStyle:f,railStyle:v,trackStyle:Object.assign({fill:this._color},p),startText:g,endText:y,handlerText:b,showTooltip:m,tooltip:x,disableTriggerEvent:_});this._innerView.add(B),this._slider=B,B.translateTo(0-B.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",Ah):0)-B.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}_getTrackColor(){const{colors:t,layout:i}=this.attribute;if(e.isEmpty(t))return;const n=t.length;if(1===n)return t[0];const r=[];for(let e=0;e<n;e++){const i=e/(n-1);r.push({offset:i,color:t[e]})}const a="horizontal"===i;return{gradient:"linear",stops:r,x0:0,y0:0,x1:a?1:0,y1:a?0:1}}_updateColor(){const{layout:t="horizontal",colors:e,railWidth:i,railHeight:n}=this.attribute,{startHandler:r,endHandler:a,track:s}=this._slider,{startValue:o,endValue:l,startPos:u,endPos:h}=this._slider.currentValue,d=this._colorScale.scale(o),c=this._colorScale.scale(l);null==r||r.setAttribute("fill",d),null==a||a.setAttribute("fill",c);const f="horizontal"===t?i:n;if(Math.abs(u-h)!==f&&e&&e.length>1){const t=this._color.stops,e=Math.min(u,h),i=Math.max(u,h),n=e/f,r=i/f,a=r-n,d=t.filter((t=>t.offset>n&&t.offset<r)),c=Math.min(o,l),v=Math.max(o,l),p=this._colorScale.scale(c),g=this._colorScale.scale(v),y=[{offset:0,color:p}];d.forEach((t=>{y.push({offset:(t.offset-n)/a,color:t.color})})),y.push({offset:1,color:g}),s.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:y}))}}}function Rh(t="bottom"){let e=0;const i=3.5,n=2.5;return"top"===t?`\n M${e},-6L${e-i},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+n},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-n},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-i},2.5\n v-5\n h7\n v5\n Z\n`}Ih.defaultAttributes={layout:"horizontal",title:{align:"start",space:Ah,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}}};class jh extends Th{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},jh.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:i,align:n,min:r,max:a,value:s,railWidth:o,railHeight:l,showHandler:u=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:f,startText:v,endText:p,handlerText:g,showTooltip:y,tooltip:b,sizeBackground:m,disableTriggerEvent:x}=this.attribute,_=as.group({x:0,y:0});this._innerView.add(_);const A=new Oh({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:i,align:n,min:r,max:a,value:s,railWidth:o,railHeight:l,showHandler:u,handlerSize:h,handlerStyle:Object.assign({symbolType:Rh(n)},d),railStyle:c,trackStyle:f,startText:v,endText:p,handlerText:g,showTooltip:y,tooltip:b,disableTriggerEvent:x});_.add(A);let k,B=0;const w=12;"horizontal"===i?"top"===n?(k=`M0,0L${o},0L${o},12Z`,B=l):(k=`M0,12L${o},12L${o},0Z`,A.setAttribute("y",w)):"left"===n?k=`M${o},0L${o},0L${o+w},${l}L${o},${l}Z`:(k=`M0,${l}L12,${l}L12,0Z`,A.setAttribute("x",w));const S=as.path(Object.assign(Object.assign({x:0,y:B,path:k},m),{zIndex:0}));_.add(S);const T=this._title?this._title.AABBBounds.height()+e.get(this.attribute,"title.space",Ah):0;_.translate(0-_.AABBBounds.x1,T-_.AABBBounds.y1),this._slider=A}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}jh.defaultAttributes={layout:"horizontal",title:{align:"start",space:Ah,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};class Dh extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Dh.defaultAttributes,t)),this.name="title"}render(){var t,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y,b,m,x,_,A,k,B,w,S,T,C,E,M,P,L,O,I,R,j,D,N,U,z,H,V,W,F,G,$,Y,X,q,Z,K,J,Q,tt,et,it,nt,rt,at,st,ot,lt,ut,ht,dt,ct,ft,vt,pt,gt,yt,bt,mt,xt,_t,At,kt,Bt,wt,St;const{textType:Tt,text:Ct,subtextType:Et,textStyle:Mt,subtext:Pt,subtextStyle:Lt,width:Ot,height:It,minWidth:Rt,maxWidth:jt,minHeight:Dt,maxHeight:Nt,align:Ut,verticalAlign:zt,padding:Ht=0}=this.attribute,Vt=e.normalizePadding(Ht),Wt=this.createOrUpdateChild("title-container",{x:Vt[3],y:Vt[0],zIndex:1},"group");if(!1!==(null===(t=this.attribute)||void 0===t?void 0:t.visible)&&!1!==(null==Mt?void 0:Mt.visible))if("rich"===Tt||e.isValid(Mt.character)){const t=Object.assign({x:null!==(i=Mt.x)&&void 0!==i?i:0,y:null!==(n=Mt.y)&&void 0!==n?n:0,width:null!==(a=null!==(r=Mt.width)&&void 0!==r?r:Ot)&&void 0!==a?a:0,height:null!==(o=null!==(s=Mt.height)&&void 0!==s?s:It)&&void 0!==o?o:0,ellipsis:null===(l=Mt.ellipsis)||void 0===l||l,wordBreak:null!==(u=Mt.wordBreak)&&void 0!==u?u:"break-word",maxHeight:Mt.maxHeight,maxWidth:Mt.maxWidth,textConfig:null!==(h=Mt.character)&&void 0!==h?h:Ct},Mt);this._mainTitle=Wt.createOrUpdateChild("mainTitle",t,"richtext")}else if("html"===Tt){const t=Object.assign({html:Object.assign(Object.assign({dom:Ct},El),Mt),x:null!==(d=Mt.x)&&void 0!==d?d:0,y:null!==(c=Mt.y)&&void 0!==c?c:0,width:null!==(v=null!==(f=Mt.width)&&void 0!==f?f:Ot)&&void 0!==v?v:0,height:null!==(g=null!==(p=Mt.height)&&void 0!==p?p:It)&&void 0!==g?g:0,ellipsis:null===(y=Mt.ellipsis)||void 0===y||y,wordBreak:null!==(b=Mt.wordBreak)&&void 0!==b?b:"break-word",maxHeight:Mt.maxHeight,maxWidth:Mt.maxWidth,textConfig:[]},Mt);this._mainTitle=Wt.createOrUpdateChild("mainTitle",t,"richtext")}else e.isValid(Ct)&&(this._mainTitle=Wt.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:[Ct]},Mt),{maxLineWidth:null!==(m=null==Mt?void 0:Mt.maxLineWidth)&&void 0!==m?m:Ot,heightLimit:null==Mt?void 0:Mt.heightLimit,lineClamp:null==Mt?void 0:Mt.lineClamp,ellipsis:null===(x=null==Mt?void 0:Mt.ellipsis)||void 0===x||x,x:0,y:0}),"wrapText"));const Ft=this._mainTitle?null===(_=this._mainTitle)||void 0===_?void 0:_.AABBBounds.height():0,Gt=this._mainTitle?null===(A=this._mainTitle)||void 0===A?void 0:A.AABBBounds.width():0;if(!1!==(null===(k=this.attribute)||void 0===k?void 0:k.visible)&&!1!==(null==Lt?void 0:Lt.visible))if("rich"===Et||e.isValid(Lt.character)){const t=Object.assign({x:null!==(B=Lt.x)&&void 0!==B?B:0,y:null!==(w=Lt.y)&&void 0!==w?w:0,width:null!==(T=null!==(S=Lt.width)&&void 0!==S?S:Ot)&&void 0!==T?T:0,height:null!==(E=null!==(C=Lt.height)&&void 0!==C?C:It)&&void 0!==E?E:0,ellipsis:null===(M=Lt.ellipsis)||void 0===M||M,wordBreak:null!==(P=Lt.wordBreak)&&void 0!==P?P:"break-word",maxHeight:Lt.maxHeight,maxWidth:Lt.maxWidth,textConfig:null!==(L=Lt.character)&&void 0!==L?L:Pt},Lt);this._subTitle=Wt.createOrUpdateChild("subTitle",t,"richtext")}else if("html"===Et){const t=Object.assign({html:Object.assign(Object.assign({dom:Pt},El),Lt),x:null!==(O=Lt.x)&&void 0!==O?O:0,y:null!==(I=Lt.y)&&void 0!==I?I:0,width:null!==(j=null!==(R=Lt.width)&&void 0!==R?R:Ot)&&void 0!==j?j:0,height:null!==(N=null!==(D=Lt.height)&&void 0!==D?D:It)&&void 0!==N?N:0,ellipsis:null===(U=Lt.ellipsis)||void 0===U||U,wordBreak:null!==(z=Lt.wordBreak)&&void 0!==z?z:"break-word",maxHeight:Lt.maxHeight,maxWidth:Lt.maxWidth,textConfig:[]},Lt);this._subTitle=Wt.createOrUpdateChild("subTitle",t,"richtext")}else e.isValid(Pt)&&(this._subTitle=Wt.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:[Pt]},Lt),{maxLineWidth:null!==(H=null==Lt?void 0:Lt.maxLineWidth)&&void 0!==H?H:Ot,heightLimit:null==Lt?void 0:Lt.heightLimit,lineClamp:null==Lt?void 0:Lt.lineClamp,ellipsis:null===(V=null==Lt?void 0:Lt.ellipsis)||void 0===V||V,x:0,y:Ft}),"wrapText"));const $t=this._subTitle?null===(W=this._subTitle)||void 0===W?void 0:W.AABBBounds.height():0,Yt=this._subTitle?null===(F=this._subTitle)||void 0===F?void 0:F.AABBBounds.width():0;let Xt=Math.max(Gt,Yt),qt=Ft+(null!==(G=null==Lt?void 0:Lt.height)&&void 0!==G?G:$t);if(e.isValid(Ot)&&(Xt=Ot,null===($=this._mainTitle)||void 0===$||$.setAttribute("maxLineWidth",Ot),null===(Y=this._subTitle)||void 0===Y||Y.setAttribute("maxLineWidth",Ot)),e.isValid(It)&&(qt=It),e.isValid(Rt)&&Xt<Rt&&(Xt=Rt),e.isValid(jt)&&(null===(X=this._mainTitle)||void 0===X||X.setAttribute("maxLineWidth",jt),null===(q=this._subTitle)||void 0===q||q.setAttribute("maxLineWidth",jt),null===(Z=this._mainTitle)||void 0===Z||Z.setAttribute("maxWidth",jt),null===(K=this._subTitle)||void 0===K||K.setAttribute("maxWidth",jt),Xt>jt&&(Xt=jt)),e.isValid(Dt)&&qt<Dt&&(qt=Dt),e.isValid(Nt)&&(null===(J=this._mainTitle)||void 0===J||J.setAttribute("maxHeight",Nt),null===(Q=this._subTitle)||void 0===Q||Q.setAttribute("maxHeight",Nt-Ft),qt>Nt&&(qt=Nt)),Wt.attribute.width=Xt,Wt.attribute.height=qt,Wt.attribute.boundsPadding=Vt,e.isValid(Ut)||e.isValid(null==Mt?void 0:Mt.align)){const t=(null==Mt?void 0:Mt.align)?null==Mt?void 0:Mt.align:Ut,e=null!==(tt=null==Mt?void 0:Mt.width)&&void 0!==tt?tt:Gt;"left"===t?(null===(et=this._mainTitle)||void 0===et||et.setAttribute("x",0),null===(it=this._mainTitle)||void 0===it||it.setAttribute("textAlign","left")):"center"===t?(null===(nt=this._mainTitle)||void 0===nt||nt.setAttribute("x",e/2),null===(rt=this._mainTitle)||void 0===rt||rt.setAttribute("textAlign","center")):"right"===t&&(null===(at=this._mainTitle)||void 0===at||at.setAttribute("x",e),null===(st=this._mainTitle)||void 0===st||st.setAttribute("textAlign","right"))}if(e.isValid(zt)||e.isValid(null==Mt?void 0:Mt.verticalAlign)){const t=(null==Mt?void 0:Mt.verticalAlign)?null==Mt?void 0:Mt.verticalAlign:zt,e=(null==Mt?void 0:Mt.height)?null==Mt?void 0:Mt.height:qt;"top"===t?(null===(ot=this._mainTitle)||void 0===ot||ot.setAttribute("y",0),null===(lt=this._mainTitle)||void 0===lt||lt.setAttribute("textBaseline","top")):"middle"===t?(null===(ut=this._mainTitle)||void 0===ut||ut.setAttribute("y",e/2),null===(ht=this._mainTitle)||void 0===ht||ht.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(dt=this._mainTitle)||void 0===dt||dt.setAttribute("y",e),null===(ct=this._mainTitle)||void 0===ct||ct.setAttribute("textBaseline","bottom"))}if(e.isValid(Ut)||e.isValid(null==Lt?void 0:Lt.align)){const t=(null==Lt?void 0:Lt.align)?null==Lt?void 0:Lt.align:Ut,e=null!==(ft=null==Lt?void 0:Lt.width)&&void 0!==ft?ft:Yt;"left"===t?(null===(vt=this._subTitle)||void 0===vt||vt.setAttribute("x",0),null===(pt=this._subTitle)||void 0===pt||pt.setAttribute("textAlign","left")):"center"===t?(null===(gt=this._subTitle)||void 0===gt||gt.setAttribute("x",e/2),null===(yt=this._subTitle)||void 0===yt||yt.setAttribute("textAlign","center")):"right"===t&&(null===(bt=this._subTitle)||void 0===bt||bt.setAttribute("x",e),null===(mt=this._subTitle)||void 0===mt||mt.setAttribute("textAlign","right"))}if(e.isValid(zt)||e.isValid(null==Mt?void 0:Mt.verticalAlign)){const t=(null==Lt?void 0:Lt.verticalAlign)?null==Lt?void 0:Lt.verticalAlign:zt,e=Ft,i=null!==(xt=null==Lt?void 0:Lt.height)&&void 0!==xt?xt:0;"top"===t?(null===(_t=this._subTitle)||void 0===_t||_t.setAttribute("y",e),null===(At=this._subTitle)||void 0===At||At.setAttribute("textBaseline","top")):"middle"===t?(null===(kt=this._subTitle)||void 0===kt||kt.setAttribute("y",e+i/2),null===(Bt=this._subTitle)||void 0===Bt||Bt.setAttribute("textBaseline","middle")):"bottom"===t&&(null===(wt=this._subTitle)||void 0===wt||wt.setAttribute("y",e+i),null===(St=this._subTitle)||void 0===St||St.setAttribute("textBaseline","bottom"))}}}Dh.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};const Nh={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};const Uh=(t,e)=>{let i=t.x0,n=t.x1;const r="number"==typeof e?t.thickness*e:t.thickness;let a=t.y0-t.thickness/2,s=t.y1-t.thickness/2;"center"===t.align?(a=t.y0-r/2,s=t.y1-r/2):"end"===t.align&&(a=t.y0+t.thickness/2-r,s=t.y1+t.thickness/2-r);let o=(i+n)/2,l=a+r,u=s+r;t.round&&(i=Math.round(i),n=Math.round(n),a=Math.round(a),s=Math.round(s),l=Math.round(l),u=Math.round(u),o=Math.round(o));const h=Math.abs(n-i)>1e-6,d=t.endArrow&&h?`L${n},${s-r/2}L${n+r},${(s+u)/2}L${n},${u+r/2}`:"",c=t.startArrow&&h?`L${i},${l+r/2}L${i-r},${(a+l)/2}L${i},${a-r/2}`:"";return!1===t.isSmooth?`M${i},${a}L${n},${s}${d}L${n},${u}L${i},${l}${c}Z`:`M${i},${a}\n C${o},${a},${o},${s},${n},${s}\n ${d}\n L${n},${u}\n C${o},${u},${o},${l},${i},${l}\n ${c}\n Z`},zh=(t,e)=>{let i=t.y0,n=t.y1,r=t.x0-t.thickness/2,a=t.x1-t.thickness/2;const s="number"==typeof e?t.thickness*e:t.thickness;"center"===t.align?(r=t.x0-s/2,a=t.x1-s/2):"end"===t.align&&(r=t.x0+t.thickness/2-s,a=t.x1+t.thickness/2-s);let o=(i+n)/2,l=r+s,u=a+s;t.round&&(i=Math.round(i),n=Math.round(n),r=Math.round(r),a=Math.round(a),l=Math.round(l),u=Math.round(u),o=Math.round(o));const h=Math.abs(n-i)>1e-6,d=t.endArrow&&h?`L${a-s/2},${n}L${(a+u)/2},${n+s}L${u+s/2},${n}`:"",c=t.startArrow&&h?`L${l+s/2},${i}L${(l+r)/2},${i-s}L${r-s/2},${i}`:"";return!1===t.isSmooth?`M${r},${i}L${a},${n}${d}L${u},${n}L${l},${i}${c}Z`:`M${r},${i}\n C${r},${o},${a},${o},${a},${n}\n ${d}\n L${u},${n}\n C${u},${o},${l},${o},${l},${i}\n ${c}\n Z`};class Hh extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Hh.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?zh:Uh,i="number"==typeof this.attribute.ratio&&this.attribute.ratio>=0&&this.attribute.ratio<=1,n=["direction","x0","x1","y0","y1","thickness","round","ratio","align","isSmooth","backgroudStyle"],r={};if(Object.keys(this.attribute).forEach((t=>{n.includes(t)||(r[t]=this.attribute[t])})),i){const t=this.createOrUpdateChild("sankey-link-background",Object.assign({},r,this.attribute.backgroudStyle,{path:e(this.attribute,1),visible:!0,pickable:!1,zIndex:-1}),"path");this._backPath=t}else this._backPath&&this._backPath.setAttribute("visible",!1);const a=this.createOrUpdateChild("sankey-link-front",Object.assign({},r,{path:e(this.attribute,i?this.attribute.ratio:1),pickable:!1}),"path");this._frontPath=a}}Hh.defaultAttributes={direction:"horizontal",align:"start"};class Vh extends za{constructor(t){super(t)}}var Wh,Fh;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(Wh||(Wh={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(Fh||(Fh={}));class Gh extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Gh.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},Gh.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},Gh.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},Gh.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},Gh.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,n,r,a,s,o;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(e=null===(t=this._backwardAttr.style)||void 0===t?void 0:t.symbolType)&&void 0!==e?e:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(n=null===(i=this._forwardAttr.style)||void 0===i?void 0:i.symbolType)&&void 0!==n?n:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(a=null===(r=this._backwardAttr.style)||void 0===r?void 0:r.symbolType)&&void 0!==a?a:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(o=null===(s=this._forwardAttr.style)||void 0===s?void 0:s.symbolType)&&void 0!==o?o:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{e.isNil(this._playController)&&(this._playController=new Vh(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{e.isNil(this._backwardController)&&(this._backwardController=new Vh(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{e.isNil(this._forwardController)&&(this._forwardController=new Vh(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()})))},this._createCustomEvent=t=>{var e;const i=new bi(t,{eventType:t});return i.manager=null===(e=this.stage)||void 0===e?void 0:e.eventSystem.manager,i},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{const t=this._createCustomEvent(Wh.OnPlay);this.dispatchEvent(t)},this.pause=()=>{const t=this._createCustomEvent(Wh.OnPause);this.dispatchEvent(t)},this.forward=()=>{const t=this._createCustomEvent(Wh.OnForward);this.dispatchEvent(t)},this.backward=()=>{const t=this._createCustomEvent(Wh.OnBackward);this.dispatchEvent(t)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}Gh.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},Gh.defaultAttributes={[Fh.Start]:{},[Fh.Pause]:{},[Fh.Backward]:{},[Fh.Forward]:{}};const $h={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},Yh=[200,10];var Xh,qh;t.DirectionEnum=void 0,(Xh=t.DirectionEnum||(t.DirectionEnum={})).Default="default",Xh.Reverse="reverse",t.PlayerEventEnum=void 0,(qh=t.PlayerEventEnum||(t.PlayerEventEnum={})).change="change",qh.play="play",qh.pause="pause",qh.backward="backward",qh.forward="forward",qh.end="end",qh.OnChange="change",qh.OnPlay="play",qh.OnPause="pause",qh.OnBackward="backward",qh.OnForward="forward",qh.OnEnd="end";const Zh=({direction:e,maxIndex:i,minIndex:n,dataIndex:r})=>(({direction:e,maxIndex:i,dataIndex:n})=>e===t.DirectionEnum.Default&&n===i)({direction:e,maxIndex:i,dataIndex:r})||(({direction:e,minIndex:i,dataIndex:n})=>e===t.DirectionEnum.Reverse&&n===i)({direction:e,minIndex:n,dataIndex:r}),Kh=({direction:e,maxIndex:i,minIndex:n,dataIndex:r})=>(({direction:e,minIndex:i,dataIndex:n})=>e===t.DirectionEnum.Default&&n===i)({direction:e,minIndex:n,dataIndex:r})||(({direction:e,maxIndex:i,dataIndex:n})=>e===t.DirectionEnum.Reverse&&n===i)({direction:e,maxIndex:i,dataIndex:r}),Jh=t=>"top"===t||"bottom"===t;class Qh extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Qh.defaultAttributes,t)),this._data=[],this._layoutInfo={},this._updateSliderAttrs=()=>{var t,i,n;let r;e.isValidNumber(this._handlerStyle.size)?r=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(r=e.max(this._handlerStyle.size[0],this._handlerStyle.size[1]));const a={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:e.isValidNumber(r)?r:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(Jh(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(i=this._railStyle.height)&&void 0!==i?i:Yh[1];a.layout="horizontal",a.railHeight=e,a.railWidth=t,a.x=this._layoutInfo.slider.x,a.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(n=this._railStyle.width)&&void 0!==n?n:Yh[1];a.layout="vertical",a.railWidth=e,a.railHeight=t,a.x=this._layoutInfo.slider.x,a.y=this._layoutInfo.slider.y}return a},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new Oh(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return Jh(this._orient)?(t.layout="horizontal",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})):(t.layout="vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})})),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new Gh(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){var t,e,i,n,r,a,s,o,l,u,h,d,c,f,v,p,g,y;this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1,this._sliderVisible=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.slider)||void 0===e?void 0:e.visible,this._railStyle=Object.assign({},null===(n=null===(i=this.attribute)||void 0===i?void 0:i.slider)||void 0===n?void 0:n.railStyle),this._trackStyle=Object.assign({},null===(a=null===(r=this.attribute)||void 0===r?void 0:r.slider)||void 0===a?void 0:a.trackStyle),this._handlerStyle=Object.assign({},null===(o=null===(s=this.attribute)||void 0===s?void 0:s.slider)||void 0===o?void 0:o.handlerStyle),this._controllerVisible=null===(u=null===(l=this.attribute)||void 0===l?void 0:l.controller)||void 0===u?void 0:u.visible,this._start=Object.assign({},null===(d=null===(h=this.attribute)||void 0===h?void 0:h.controller)||void 0===d?void 0:d.start),this._pause=Object.assign({},null===(f=null===(c=this.attribute)||void 0===c?void 0:c.controller)||void 0===f?void 0:f.pause),this._forward=Object.assign({},null===(p=null===(v=this.attribute)||void 0===v?void 0:v.controller)||void 0===p?void 0:p.forward),this._backward=Object.assign({},null===(y=null===(g=this.attribute)||void 0===g?void 0:g.controller)||void 0===y?void 0:y.backward)}_initLayoutInfo(){var t,i,n;const r=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),a=r.filter((t=>"end"!==t.position)),s=r.filter((t=>"end"===t.position)),o=null!==(t=Jh(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:Yh[1],l=r.reduce(((t,i)=>{const n=i.style.size,r=e.isNumber(n)?n:e.max(n[0],n[1]);return t+i.space+r}),0),u=this._sliderVisible?(Jh(this._orient)?null===(i=this._size)||void 0===i?void 0:i.width:null===(n=this._size)||void 0===n?void 0:n.height)-l:0,h=u-this.attribute.slider.space,d=a.reduce(((t,i)=>{const{key:n,space:r,style:{size:a}}=i,s=e.isNumber(a)?a:e.max(a[0],a[1]);return this._layoutInfo[n]=Object.assign(Object.assign({},this._layoutInfo[n]),{size:s,x:Jh(this._orient)?t+r:(this._size.width-s)/2,y:Jh(this._orient)?(this._size.height-s)/2:t+r}),t+r+s}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:h,x:Jh(this._orient)?d+this.attribute.slider.space:(this._size.width-o)/2,y:Jh(this._orient)?(this._size.height-o)/2:d+this.attribute.slider.space}),s.reduce(((t,i)=>{const{key:n,space:r,style:{size:a}}=i,s=e.isNumber(a)?a:e.max(a[0],a[1]);return this._layoutInfo[n]=Object.assign(Object.assign({},this._layoutInfo[n]),{size:s,x:Jh(this._orient)?t+r:(this._size.width-s)/2,y:Jh(this._orient)?(this._size.height-s)/2:t+r}),t+r+s}),d+u)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){var i;const n=new bi(t,{eventType:t,index:e,value:this._data[e]});n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}Qh.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},$h),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},$h),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},$h),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},$h),{key:"backward",position:"start"})}};var td;t.IOperateType=void 0,(td=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",td.drawEnd="drawEnd",td.drawing="drawing",td.moving="moving",td.moveStart="moveStart",td.moveEnd="moveEnd",td.brushClear="brushClear";const ed={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},id=5,nd={debounce:e.debounce,throttle:e.throttle};class rd extends rl{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},rd.defaultAttributes,i)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e,i;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const n=null===(i=null===(e=this.attribute)||void 0===e?void 0:e.brushMoved)||void 0===i||i;this._activeMoveState=n&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||(t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushEnd=e=>{var i;e.preventDefault();const{removeOnClick:n=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&n?(this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={},this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.brushClear,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})):this._outOfInteractiveRange(e)||this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:this._activeDrawState?t.IOperateType.drawEnd:t.IOperateType.moveEnd,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict}),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,null===(i=this._operatingMask)||void 0===i||i.setAttribute("pickable",!1)}}bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0,trigger:i=ed.trigger,updateTrigger:n=ed.updateTrigger,endTrigger:r=ed.endTrigger,resetTrigger:a=ed.resetTrigger}=this.attribute;this.stage.addEventListener(i,this._onBrushStart),this.stage.addEventListener(n,nd[t](this._onBrushing,e)),this.stage.addEventListener(r,this._onBrushEnd),this.stage.addEventListener(a,this._onBrushEnd)}_isPosInBrushMask(t){const i=this.eventPosToStagePos(t),n=this._container.getChildren();for(let t=0;t<n.length;t++){const{points:r=[],dx:a=0,dy:s=0}=n[t].attribute,o=r.map((t=>({x:t.x+a,y:t.y+s})));if(e.polygonContainPoint(o,i.x,i.y))return this._operatingMask=n[t],!0}return!1}_initDraw(e){const{brushMode:i}=this.attribute,n=this.eventPosToStagePos(e);this._cacheDrawPoints=[n],this._isDrawedBeforeEnd=!1,"single"===i&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_initMove(e){var i,n;this._cacheMovePoint=this.eventPosToStagePos(e),this._operatingMaskMoveDx=null!==(i=this._operatingMask.attribute.dx)&&void 0!==i?i:0,this._operatingMaskMoveDy=null!==(n=this._operatingMask.attribute.dy)&&void 0!==n?n:0;const{interactiveRange:r}=this.attribute,{minY:a=-1/0,maxY:s=1/0,minX:o=-1/0,maxX:l=1/0}=r,{x1:u,x2:h,y1:d,y2:c}=this._operatingMask.globalAABBBounds,f=o-u,v=l-h,p=a-d,g=s-c;this._operatingMaskMoveRangeX=[f,v],this._operatingMaskMoveRangeY=[p,g],this._operatingMask.setAttribute("pickable",!0),this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moveStart,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_drawing(e){var i;const n=this.eventPosToStagePos(e),{x1:r=0,x2:a=0,y1:s=0,y2:o=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds,{sizeThreshold:l=id,brushType:u}=this.attribute,h=this._cacheDrawPoints.length;if(this._isDrawedBeforeEnd=!!(Math.abs(a-r)>l||Math.abs(s-o)>l),h>0){const t=this._cacheDrawPoints[this._cacheDrawPoints.length-1];if(n.x===(null==t?void 0:t.x)&&n.y===(null==t?void 0:t.y))return}"polygon"===u||h<=1?this._cacheDrawPoints.push(n):this._cacheDrawPoints[h-1]=n;const d=this._computeMaskPoints();this._operatingMask.setAttribute("points",d),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.drawing,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_moving(e){const i=this._cacheMovePoint,n=this.eventPosToStagePos(e);if(n.x===(null==i?void 0:i.x)&&n.y===(null==i?void 0:i.y))return;const r=n.x-i.x,a=n.y-i.y,s=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],r))+this._operatingMaskMoveDx,o=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],a))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:s,dy:o}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._updateDragMaskCallback&&this._updateDragMaskCallback({operateType:t.IOperateType.moving,operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict})}_computeMaskPoints(){const{brushType:t,xRange:i=[0,0],yRange:n=[0,0]}=this.attribute;let r=[];const a=this._cacheDrawPoints[0],s=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return r="rect"===t?[a,{x:s.x,y:a.y},s,{x:a.x,y:s.y}]:"x"===t?[{x:a.x,y:n[0]},{x:s.x,y:n[0]},{x:s.x,y:n[1]},{x:a.x,y:n[1]}]:"y"===t?[{x:i[0],y:a.y},{x:i[0],y:s.y},{x:i[1],y:s.y},{x:i[1],y:a.y}]:e.cloneDeep(this._cacheDrawPoints),r}_addBrushMask(){var t;const{brushStyle:i,hasMask:n}=this.attribute,r=as.polygon(Object.assign(Object.assign({points:e.cloneDeep(this._cacheDrawPoints),cursor:"move",pickable:!1},i),{opacity:n?null!==(t=i.opacity)&&void 0!==t?t:1:0}));r.name=`brush-${Date.now()}`,this._operatingMask=r,this._container.add(r),this._brushMaskAABBBoundsDict[r.name]=r.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:n=1/0,minX:r=-1/0,maxX:a=1/0}=e,s=this.eventPosToStagePos(t);return s.x>a||s.x<r||s.y>n||s.y<i}eventPosToStagePos(t){var e,i,n;const r=null===(e=this.stage)||void 0===e?void 0:e.window.getBoundingClientRect();return{x:t.clientX-((null==r?void 0:r.left)||0)-((null===(i=this.stage)||void 0===i?void 0:i.x)||0),y:t.clientY-((null==r?void 0:r.top)||0)-((null===(n=this.stage)||void 0===n?void 0:n.y)||0)}}render(){this.bindBrushEvents();const t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}setUpdateDragMaskCallback(t){e.isFunction(t)&&(this._updateDragMaskCallback=t)}releaseBrushEvents(){const{delayType:t="throttle",delayTime:e=0,trigger:i=ed.trigger,updateTrigger:n=ed.updateTrigger,endTrigger:r=ed.endTrigger,resetTrigger:a=ed.resetTrigger}=this.attribute;this.stage.removeEventListener(i,this._onBrushStart),this.stage.removeEventListener(n,nd[t](this._onBrushing,e)),this.stage.removeEventListener(r,this._onBrushEnd),this.stage.removeEventListener(a,this._onBrushEnd)}}rd.defaultAttributes=ed;const ad=(t,...i)=>{const n=[t.shape,...i.map((t=>null==t?void 0:t.shape))],r=[t.key,...i.map((t=>null==t?void 0:t.key))],a=[t.value,...i.map((t=>null==t?void 0:t.value))];return e.merge(t,...i,{shape:n.every(e.isNil)?void 0:e.merge({},...n),key:r.every(e.isNil)?void 0:e.merge({},...r),value:a.every(e.isNil)?void 0:e.merge({},...a)})},sd=t=>{const{width:i,height:n,wordBreak:r="break-word",textAlign:a,textBaseline:s,text:o}=t;return Array.isArray(o)?{width:i,height:n,wordBreak:r,textAlign:a,textBaseline:s,singleLine:!1,textConfig:e.array(o).map((e=>Object.assign(Object.assign({},t),{text:e})))}:{width:i,height:n,wordBreak:r,textAlign:a,textBaseline:s,singleLine:!1,textConfig:o.text}},od={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:Sl,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Sl,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Sl,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new e.AABBBounds).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},ld=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"],ud="tooltip-title",hd="tooltip-content",dd="shape",cd="value";class fd extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},fd.defaultAttributes,t),i),this.name="tooltip"}render(){var t;const{visible:i,content:n,panel:r,keyWidth:a,valueWidth:s,hasContentShape:o,autoCalculatePosition:l,autoMeasure:u}=this.attribute;if(!i)return void this.hideAll();u&&fd.measureTooltip(this.attribute),l&&fd.calculateTooltipPosition(this.attribute);const h=e.normalizePadding(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},r),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild(ud,{visible:!0,x:h[3],y:h[0]},"group");const d=fd.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${ud}-${dd}`,e.merge({symbolType:"circle"},d.shape,{visible:vl(d)&&vl(d.shape)}),"symbol"),"object"!=typeof d.value.text||null===d.value.text||"rich"!==d.value.text.type&&"html"!==d.value.text.type?d.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${ud}-${cd}`,Object.assign({visible:vl(d)&&vl(d.value)},sd(d.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${ud}-${cd}`,Object.assign({text:null!==(t=d.value.text)&&void 0!==t?t:"",visible:vl(d)&&vl(d.value)},d.value),"text"):"rich"===d.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${ud}-${cd}`,Object.assign({visible:vl(d)&&vl(d.value)},sd(d.value)),"richtext"):"html"===d.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${ud}-${cd}`,Object.assign({html:Object.assign(Object.assign({dom:d.value.text.text},El),d.value),visible:vl(d)&&vl(d.value),width:d.value.width,height:d.value.height,wordBreak:d.value.wordBreak,textAlign:d.value.textAlign,textBaseline:d.value.textBaseline,singleLine:!1,textConfig:[]},d.value),"richtext"));const c=vl(d.shape)?d.shape.size+d.shape.spacing:0,{textAlign:f,textBaseline:v}=d.value,p=r.width-h[3]-h[0]-c;"center"===f?this._tooltipTitle.setAttribute("x",c+p/2):"right"===f||"end"===f?this._tooltipTitle.setAttribute("x",c+p):this._tooltipTitle.setAttribute("x",c),"bottom"===v?this._tooltipTitle.setAttribute("y",d.height):"middle"===v?this._tooltipTitle.setAttribute("y",d.height/2):this._tooltipTitle.setAttribute("y",0);const g=vl(d)?d.height+d.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(hd,{visible:!0},"group"),this._tooltipContent.removeAllChild(),null==n?void 0:n.length){this._tooltipContent.setAttribute("x",h[3]),this._tooltipContent.setAttribute("y",h[0]+g);let t=0;n.forEach(((i,n)=>{var r,l,u;const h=fd.getContentAttr(this.attribute,n);if(!vl(h))return;const d=`${hd}-${n}`,c=this._tooltipContent.createOrUpdateChild(d,{visible:!0,x:0,y:t},"group");let f=0;if(vl(h.shape)&&c.createOrUpdateChild(`${d}-${dd}`,Object.assign({visible:!0,x:h.shape.size/2,y:h.shape.size/2+((null!==(r=Ui(h.key.lineHeight,h.key.fontSize))&&void 0!==r?r:h.key.fontSize)-h.shape.size)/2},h.shape),"symbol"),o&&(f+=h.shape.size+h.shape.spacing),vl(h.key)){let t;t=h.key.multiLine?c.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0},sd(h.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.key.text||null===h.key.text||"rich"!==h.key.text.type&&"html"!==h.key.text.type?c.createOrUpdateChild(`${d}-key`,Object.assign(Object.assign({visible:!0,text:null!==(l=h.key.text)&&void 0!==l?l:""},h.key),{textBaseline:"top"}),"text"):"rich"===h.key.text.type?c.createOrUpdateChild(`${d}-${cd}`,Object.assign(Object.assign({visible:!0},sd(h.key)),{textBaseline:"top"}),"richtext"):c.createOrUpdateChild(`${d}-${cd}`,{html:Object.assign(Object.assign({dom:h.key.text.text},El),h.key)},"richtext");const{textAlign:e}=h.key;"center"===e?t.setAttribute("x",f+a/2):"right"===e||"end"===e?t.setAttribute("x",f+a):t.setAttribute("x",f),t.setAttribute("y",0),f+=a+h.key.spacing}if(vl(h.value)){let t;t=h.value.multiLine?c.createOrUpdateChild(`${d}-${cd}`,Object.assign(Object.assign({visible:!0},sd(h.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.value.text||null===h.value.text||"rich"!==h.value.text.type&&"html"!==h.value.text.type?c.createOrUpdateChild(`${d}-${cd}`,Object.assign(Object.assign({visible:!0,text:null!==(u=h.value.text)&&void 0!==u?u:""},h.value),{textBaseline:"top"}),"text"):"rich"===h.value.text.type?c.createOrUpdateChild(`${d}-${cd}`,Object.assign(Object.assign({visible:!0},sd(h.value)),{textBaseline:"top"}),"richtext"):c.createOrUpdateChild(`${d}-${cd}`,{html:Object.assign({dom:h.value.text.text,container:"",width:30,height:30,style:{}},h.value)},"richtext");let i="right";e.isValid(h.value.textAlign)?i=h.value.textAlign:vl(h.key)||(i="left"),t.setAttribute("textAlign",i),"center"===i?t.setAttribute("x",f+s/2):"right"===i||"end"===i?t.setAttribute("x",f+s):t.setAttribute("x",f),f+=s,t.setAttribute("y",0),c.add(t)}t+=h.height+h.spaceRow}))}}setAttributes(t,i){const n=Object.keys(t);this.attribute.autoCalculatePosition&&n.every((t=>ld.includes(t)))?(this._mergeAttributes(t,n),e.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&fd.measureTooltip(this.attribute),fd.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},i)):super.setAttributes(t,i)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:n,offsetY:r,pointerX:a,pointerY:s,positionX:o,positionY:l,parentBounds:u}=t;let h=a,d=s;return"left"===o?h-=e+n:"center"===o?h-=e/2:h+=n,"top"===l?d-=i+r:"middle"===l?d-=i/2:d+=r,h+e>u.x2&&(h-=e+n),d+i>u.y2&&(d-=i+r),h<u.x1&&(h=u.x1),d<u.y1&&(d=u.y1),t.x=h,t.y=d,t}static measureTooltip(t){const{content:i,contentStyle:n}=t,r=e.normalizePadding(t.padding),a=fd.getTitleAttr(t);let s=0,o=r[0]+r[2],l=0;const{value:u,shape:h}=a,{visible:d=!1,symbolType:c=""}=null!=h?h:{};if(e.isValid(u)&&"object"!=typeof a.value.text){const{width:t,height:e}=Ml(u).quickMeasure(u.text);s=t,l=e}if(d&&ja[c]&&(s+=h.size+h.spacing,l=Math.max(h.size,l)),t.title&&(t.title.width=s,t.title.height=l),vl(a)&&(o+=l+a.spaceRow),null==i?void 0:i.length){const e=[];if(i.forEach(((i,n)=>{const r=fd.getContentAttr(t,n);(i.key||i.value)&&vl(r)&&e.push([i,r])})),e.length){let r=!1;const a=[],l=[],u=[];e.forEach((([t,i],s)=>{var h;const{key:d,value:c,shape:f,spaceRow:v}=i,p=vl(f),g=null!==(h=null==f?void 0:f.symbolType)&&void 0!==h?h:"",y=Ml(d),b=Ml(c);let m=0;if(vl(d)){const{width:t,height:e}=y.quickMeasure(d.text);l.push(t),m=Math.max(m,e)}if(vl(c)){const{width:t,height:e}=b.quickMeasure(c.text);u.push(t),m=Math.max(m,e)}p&&ja[g]&&(r=!0,a.push(f.size),m=Math.max(f.size,m)),t.height=m,o+=m,s<e.length-1&&(o+=null!=v?v:n.spaceRow)}));const h=a.length?Math.max(...a):0,d=l.length?Math.max(...l):0,c=u.length?Math.max(...u):0;s=Math.max(d+c+n.key.spacing+n.value.spacing+(r?h+n.shape.spacing:0),s),i.forEach((t=>{t.width=s})),t.hasContentShape=r,t.keyWidth=d,t.valueWidth=c}}return t.panel.width=s+r[1]+r[3],t.panel.height=o,t}static getTitleAttr(t){return ad({},fd.defaultAttributes.titleStyle,fd.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return ad({},fd.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}fd.defaultAttributes=od;class vd extends rl{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},vd.defaultAttributes,t)),this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,i)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("click",this.handleClick)}render(){this.removeAllChild(),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new Va(e.merge({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t&&this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new Fa(e.merge({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Fa(e.merge({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new vr(e.merge({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,i=this._text.AABBBounds.height(),n=Math.max(t,e,i),r=n/2-t/2,a=n/2-e/2,s=n/2-i/2,o=this.attribute.box.width,l=this.attribute.icon.width,u=Math.max(o,l),h=u/2-o/2,d=u/2-l/2,c=u+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:h,y:r}),this._checkIcon.setAttributes({x:d,y:a}),this._indeterminateIcon.setAttributes({x:d,y:a}),this._text.setAttributes({x:c,y:s})}handleClick(){var t;if(this.attribute.disabled)return;this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1));const e=new bi("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked});e.manager=null===(t=this.stage)||void 0===t?void 0:t.eventSystem.manager,this.dispatchEvent(e)}}vd.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:'<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',indeterminateIconImage:'<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>',width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};t.AbstractComponent=rl,t.ArcInfo=Au,t.ArcLabel=ku,t.AreaLabel=Bu,t.BasePlayer=Qh,t.Brush=rd,t.CheckBox=vd,t.CircleAxis=qu,t.CircleAxisGrid=eh,t.CircleCrosshair=Fl,t.ColorContinuousLegend=Ih,t.ContinuousPlayer=class extends Qh{constructor(e){super(e),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t,e;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3,this._dataIndex=null!==(e=this.attribute.dataIndex)&&void 0!==e?e:this._minIndex;const i=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=i?i:1)):(this._totalDuration=this._interval*i,this._interval=this.attribute.interval)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(Wh.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(Wh.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(Wh.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(Wh.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,n=i/this._maxIndex;this._elapsed=n*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)})))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=e=>{const i=Math.floor(e);i!==this._activeIndex&&(this._dataIndex=i,this._activeIndex=i,i!==this._maxIndex&&this.dispatchCustomEvent(t.PlayerEventEnum.change))},this.play=()=>ul(this,void 0,void 0,(function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(t.PlayerEventEnum.play),this._rafId=Jo.getRequestAnimationFrame()(this._play.bind(this)))})),this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=Jo.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,Jo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,Jo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed-i;n<=0?(this._elapsed=0,this._startTime=e):(this._elapsed=n,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Date.now(),i=1*this._interval,n=this._elapsed+i;n>=this._totalDuration?(this._startTime=e-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-i,this._elapsed=n),this._updateSlider(),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}},t.DEFAULT_ITEM_SPACE_COL=xh,t.DEFAULT_ITEM_SPACE_ROW=_h,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=kh,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=Pu,t.DEFAULT_TITLE_SPACE=Ah,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=Tu,t.DataZoom=rh,t.DiscreteLegend=Eh,t.DiscretePlayer=class extends Qh{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},i)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var i,n,r,a;super._initAttributes(),this._alternate=null!==(i=this.attribute.alternate)&&void 0!==i&&i,this._interval=null!==(n=this.attribute.interval)&&void 0!==n?n:1e3,this._direction=null!==(r=this.attribute.direction)&&void 0!==r?r:t.DirectionEnum.Default,this._dataIndex=e.isNil(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(a=this.attribute.dataIndex)&&void 0!==a?a:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(Wh.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(Wh.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(Wh.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(Wh.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(e=>{const i=Math.floor(e.detail.value)+.5;this._dataIndex=e.detail.value>=i?Math.ceil(e.detail.value):Math.floor(e.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(t.PlayerEventEnum.change)})))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,(Zh({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||Kh({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===t.DirectionEnum.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(t.PlayerEventEnum.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=Jo.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=e=>{const i=Date.now();if(this._isReachEnd&&i-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();e&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(t.PlayerEventEnum.change),this._activeIndex=this._dataIndex):i-this._tickTime>=this._interval&&(this._tickTime=i,this._updateDataIndex(((t,e,i,n)=>"default"===t?Math.min(e+1,n):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(t.PlayerEventEnum.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=Jo.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),Jo.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,Jo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.pause))},this.backward=()=>{const e=Math.max(this._dataIndex-1,this._minIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.backward)},this.forward=()=>{const e=Math.min(this._dataIndex+1,this._maxIndex);this._updateDataIndex(e),this.dispatchCustomEvent(t.PlayerEventEnum.change),this.dispatchCustomEvent(t.PlayerEventEnum.forward)},this._initAttributes(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}},t.GroupFadeIn=class extends ki{constructor(t,e,i,n){super(null,null,i,n)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends ki{constructor(t,e,i,n){super(null,null,i,n)}getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupTransition=class extends ki{constructor(){super(...arguments),this.mode=mt.NORMAL}onBind(){const t=this.target.getInnerView(),i=this.target.getPrevInnerView();i&&(this._oldElementMap=function(t){const e={};return fl(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(i),this._newElementAttrMap={},fl(t,(t=>{var i,n,r,a,s,o;if("group"!==t.type&&t.id){const l=this._oldElementMap[t.id];if(l){if(!e.isEqual(t.attribute,l.attribute)){const a=e.cloneDeep(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:Object.assign(Object.assign({},a),{opacity:null!==(i=a.opacity)&&void 0!==i?i:1,fillOpacity:null!==(n=a.fillOpacity)&&void 0!==n?n:1,strokeOpacity:null!==(r=a.strokeOpacity)&&void 0!==r?r:1})},t.setAttributes(l.attribute)}}else{const e={opacity:null!==(a=t.attribute.opacity)&&void 0!==a?a:1,fillOpacity:null!==(s=t.attribute.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(o=t.attribute.strokeOpacity)&&void 0!==o?o:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,i=this.easing;Object.keys(this._newElementAttrMap).forEach((n=>{var r,a,s,o,l,u,h;const{node:d,attrs:c,state:f}=this._newElementAttrMap[n];"enter"===f&&(t=e.isValidNumber(null===(a=null===(r=this.params)||void 0===r?void 0:r.enter)||void 0===a?void 0:a.duration)?null===(s=this.params)||void 0===s?void 0:s.enter.duration:t,i=(null===(l=null===(o=this.params)||void 0===o?void 0:o.enter)||void 0===l?void 0:l.easing)?null===(h=null===(u=this.params)||void 0===u?void 0:u.enter)||void 0===h?void 0:h.easing:i),"path"===d.type?d.animate({interpolate:(t,i,n,r,a)=>"path"===t&&(a.path=e.interpolateString(n,r)(i),!0)}).to(c,t,i):d.animate().to(c,t,i)}))}onUpdate(t,e,i){}},t.Indicator=class extends rl{constructor(){super(...arguments),this.name="indicator"}render(){var t,i,n;const{visible:r,title:a,content:s,size:o,limitRatio:l=1/0}=this.attribute,u=Math.min(o.width,o.height)*l,h=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1},"group");if(!0!==r)return void(h&&h.hideAll());if(e.isValid(a))if(!1!==a.visible){const n=e.merge({},e.get(Nh,"title.style"),a.style);"rich"===n.type?this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:n.text},n),{visible:a.visible,x:0,y:0,width:null!==(t=n.width)&&void 0!==t?t:0,height:null!==(i=n.height)&&void 0!==i?i:0}),"richtext"):"html"===n.type?this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:n.text},El),n)},n),{visible:a.visible,x:0,y:0}),"richtext"):this._title=h.createOrUpdateChild("indicator-title",Object.assign(Object.assign({},n),{lineHeight:e.isValid(n.lineHeight)?n.lineHeight:n.fontSize,visible:a.visible,x:0,y:0}),"text"),a.autoFit&&e.isValidNumber(u)&&this._setAutoFit(u,this._title,a),a.autoLimit&&e.isValidNumber(l)&&this._title.setAttribute("maxLineWidth",u)}else{const t=h.find((t=>"indicator-title"===t.name),!1);t&&h.removeChild(t),this._title=void 0}const d=this._title?this._title.AABBBounds.height():0;if(e.isValid(s)){const t=this._title&&(null==a?void 0:a.space)?a.space:0,i=e.array(s),n=[];let r=0;i.forEach(((i,s)=>{var o,c;if(!1!==i.visible){const f=e.merge({},e.get(Nh,"content.style"),i.style);let v;v="rich"===f.type?h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({textConfig:f.text},f),{visible:a.visible,x:0,y:d+t+r,width:null!==(o=f.width)&&void 0!==o?o:0,height:null!==(c=f.height)&&void 0!==c?c:0}),"richtext"):"html"===f.type?h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:f.text},El),f)},f),{visible:a.visible,x:0,y:d+t+r}),"richtext"):h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({},f),{lineHeight:e.isValid(f.lineHeight)?f.lineHeight:f.fontSize,visible:i.visible,x:0,y:d+t+r}),"text"),i.autoFit&&e.isValidNumber(u)&&this._setAutoFit(u,v,i),i.autoLimit&&e.isValidNumber(l)&&v.setAttribute("maxLineWidth",u),n.push(v);const p=(null==i?void 0:i.space)?i.space:0;r+=v.AABBBounds.height()+p}else{const t=h.find((t=>t.name==="indicator-content-"+s),!1);t&&h.removeChild(t)}})),this._content=n}const c=null!==(n=null==h?void 0:h.AABBBounds.height())&&void 0!==n?n:0;h.setAttribute("y",o.height/2-c/2),h.setAttribute("x",o.width/2)}_setAutoFit(t,i,n){var r,a,s,o,l,u;const h=Pl(null!==(a=null===(r=n.style)||void 0===r?void 0:r.text)&&void 0!==a?a:"",null!==(s=n.style)&&void 0!==s?s:{}).width;if(h>0){const r=t*(null!==(o=n.fitPercent)&&void 0!==o?o:.5)/h,a=Math.floor((null!==(u=null===(l=n.style)||void 0===l?void 0:l.fontSize)&&void 0!==u?u:20)*r);i.setAttribute("fontSize",a),i.setAttribute("lineHeight",e.isValid(n.style.lineHeight)?n.style.lineHeight:a)}}},t.LabelBase=bu,t.LineAxis=Gu,t.LineAxisGrid=th,t.LineCrosshair=Vl,t.LineDataLabel=wu,t.LineLabel=_u,t.LinkPath=Hh,t.MarkArea=gh,t.MarkLine=ph,t.MarkPoint=yh,t.Pager=mh,t.PolygonCrosshair=$l,t.PopTip=Il,t.RectCrosshair=Wl,t.RectLabel=xu,t.ScrollBar=sl,t.SectorCrosshair=Gl,t.Segment=Cu,t.SizeContinuousLegend=jh,t.Slider=Oh,t.SymbolLabel=mu,t.Tag=Ll,t.Title=Dh,t.Tooltip=fd,t.VTag=function(t){return new Ll(t?t.attribute:{})},t.getHorizontalPath=Uh,t.getSizeHandlerPath=Rh,t.getVerticalPath=zh,t.loadPoptip=function(){Ze.load(zl)},t.loadScrollbar=function(){Ze.load(cl)},t.popTipModule=zl,t.scrollbarModule=cl,t.setPoptipTheme=function(t){e.merge(jl.poptip,Rl,t)},t.version="0.17.1-alpha.2"}));
|