@visactor/vrender-components 0.17.11-alpha.3 → 0.17.12-alpha.1

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/dist/index.min.js DELETED
@@ -1 +0,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 c(t,e,i,n){var r=e&&e.prototype instanceof b?e:b,s=Object.create(r.prototype),o=new O(n||[]);return a(s,"_invoke",{value:T(t,i,o)}),s}function d(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;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(E([])));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=d(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=P(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=d(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 P(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,P(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=d(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 M(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function E(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(c(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=E,O.prototype={constructor:O,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(C),!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),C(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;C(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:E(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&&c(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function c(t,e){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},c(t,e)}function d(){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=d()?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&&c(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=d();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",P="inversify:tagged",M="inversify:paramtypes",C=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}(),O=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),c="object"==("undefined"==typeof process?"undefined":r(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=c||"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=(c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function t(){this._map=new d}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(c||"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 d,f.set(t,n)}var r=n.get(e);if(b(r)){if(!i)return;r=new d,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 E(t,e,i,n){!function(t,e,i,n){var r,a=[n],s={};O.hasOwnMetadata(t,e)&&(s=O.getMetadata(t,e));var o=s[i];void 0===o&&(o=[]),(r=o).push.apply(r,a),s[i]=o,O.defineMetadata(t,s,e)}(P,t,i.toString(),n)}function L(t){return function(e,i,n){E(e,0,n,t)}}function R(t){return function(e){return function(i,n,r){return L(new C(t,e))(i,n,r)}}}var I=R(w),j=R(T);function D(){return function(t){return O.defineMetadata(M,null,t),t}}function N(t){return L(new C(S,t))}var U,z="Singleton",H="Transient",W="ConstantValue",V="DynamicValue",F="Factory",G="Function",Y="Instance",$="Invalid",X=function(){function t(e,i){a(this,t),this.id=k.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===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:O.getMetadata(M,t),userGeneratedMetadata:O.getMetadata(P,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 C(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=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=W,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 X(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 W: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}(),et=Symbol("ContributionProvider"),it=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 nt(t,e){t(et).toDynamicValue((function(t){var i=t.container;return new it(e,i)})).inSingletonScope().whenTargetNamed(e)}var rt=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}()),at=Symbol.for("EnvContribution"),st=Symbol.for("VGlobal"),ot=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},lt=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ut=function(t,e){return function(i,n){e(i,n,t)}},ht=function(){function t(e){a(this,t),this.contributions=e,this.id=k.GenAutoIncrementId(),this.hooks={onSetEnv:new rt(["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}();ht=ot([D(),ut(0,I(et)),ut(0,N(at)),lt("design:paramtypes",[Object])],ht);var ct,dt,ft,vt,pt,gt,yt,bt,mt,xt,_t,At,kt,Bt,St,wt=e.tau-1e-8,Tt=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)>wt)return this.bounds.add(t-n,i-n),void this.bounds.add(t+n,i+n);var o,l,u,h,c=1/0,d=-1/0,f=1/0,v=-1/0;function p(t){u=n*Math.cos(t),h=n*Math.sin(t),u<c&&(c=u),u>d&&(d=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+c,i+f),this.bounds.add(t+d,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}(),Pt=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}(),Mt=/([-+]?((\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},Ot=0,Et=1,Lt=2,Rt=3,It=4,jt=5,Dt=6,Nt=7,Ut=8;function zt(t,i,n,r){for(var a,s,o,l,u,h,c,d,f,v,p,g,y,b,m,x,_,A,k,B,S,w,T,P,M,C,O=function(t,i,n,r,a,s,o,l,u){var h=e.degreeToRadian(o),c=Math.sin(h),d=Math.cos(h),f=d*(l-t)*.5+c*(u-i)*.5,v=d*(u-i)*.5-c*(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=d/n,y=c/n,b=-c/r,m=d/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),P=Math.atan2(_-T,x-w),M=Math.atan2(k-T,A-w)-P;M<0&&1===s?M+=e.tau:M>0&&0===s&&(M-=e.tau);for(var C=Math.ceil(Math.abs(M/(e.halfPi+.001))),O=[],E=0;E<C;++E){var L=P+E*M/C,R=P+(E+1)*M/C;O[E]=[w,T,L,R,n,r,c,d]}return O}(r[5],r[6],r[0],r[1],r[3],r[4],r[2],i,n),E=0;E<O.length;++E){var L=(a=O[E],s=void 0,o=void 0,l=void 0,u=void 0,h=void 0,c=void 0,d=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,S=void 0,w=void 0,T=void 0,P=void 0,M=void 0,C=void 0,s=a[0],o=a[1],l=a[2],u=a[3],h=a[4],c=a[5],d=a[6],f=a[7],v=f*h,p=-d*c,g=d*h,y=f*c,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*(S=s+b-B*m)+p*(w=o+m+B*b),g*S+y*w,v*(M=(T=s+x)+B*_)+p*(C=(P=o+_)-B*x),g*M+y*C,v*T+p*P,g*T+y*P]);t.bezierCurveTo(L[0],L[1],L[2],L[3],L[4],L[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"}(yt||(yt={})),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"}(bt||(bt={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(mt||(mt={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(xt||(xt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(_t||(_t={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(At||(At={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(kt||(kt={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Bt||(Bt={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(St||(St={}));var Ht=[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 Wt(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];Ht[l[0]](l,e,i,n,r,a,s)}}var Vt=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 Ft(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 Gt(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 Yt(t,i,n,r,a){var s=Gt(t.x,i.x,n.x,r.x,a),o=Gt(t.y,i.y,n.y,r.y,a);return new e.Point(s,o)}function $t(t,i){var n=t.p0,r=t.p1,a=t.p2,s=t.p3,o=Yt(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),c=e.PointService.pointAtPP(l,u,i),d=e.PointService.pointAtPP(u,h,i);return[new Xt(n,l,c,o),new Xt(o,d,h,s)]}var Xt=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=Bt.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 Yt(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?Ft(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(t){return t===kt.ROW?e.abs(this.p0.x-this.p3.x):t===kt.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}(Vt);function qt(t,i){var n=t.p0,r=t.p1,a=e.PointService.pointAtPP(n,r,i);return[new Kt(n,a),new Kt(a,r)]}var Kt=function(t){u(n,t);var i=g(n);function n(t,e){var r;return a(this,n),(r=i.call(this)).type=Bt.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===kt.ROW?e.abs(this.p0.x-this.p1.x):t===kt.COLUMN?e.abs(this.p0.y-this.p1.y):0}}]),n}(Vt),Zt=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 Xt(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 Kt(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===kt.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===kt.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}(),Jt=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}(Zt);function Qt(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])}function te(t,i,n){var r=null!=i?i:e.abs(n[n.length-1].x-n[0].x)>e.abs(n[n.length-1].y-n[0].y)?kt.ROW:kt.COLUMN;return"monotoneY"===t?new Jt(t,r):new Zt(t,r)}var ee=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 ie(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;var r=te("linear",i,t);return function(t,e){Qt(t,e)}(new ee(r,n),t),r}function ne(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 re=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&&ne(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{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:ne(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}();function ae(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return ie(t,e);var r=te("basis",i,t);return function(t,e){Qt(t,e)}(new re(r,n),t),r}function se(t){return t<0?-1:1}function oe(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(se(a)+se(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(o))||0}function le(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function ue(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 he=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:ue(this,this._t0,le(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=NaN,i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,ue(this,le(this,e=oe(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:ue(this,this._t0,e=oe(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}]),t}(),ce=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}(he);function de(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return ie(t,e);var r=te("monotoneX",i,t);return function(t,e){Qt(t,e)}(new he(r,n),t),r}function fe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return ie(t,e);var r=te("monotoneY",i,t);return function(t,e){Qt(t,e)}(new ce(r,n),t),r}var ve=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 pe(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 Zt("step",null!=r?r:e.abs(t[t.length-1].x-t[0].x)>e.abs(t[t.length-1].y-t[0].y)?kt.ROW:kt.COLUMN);return function(t,e){Qt(t,e)}(new ve(s,i,a),t),s}var ge=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i,[{key:"lineEnd",value:function(){this.context.closePath()}}]),i}(ee);function ye(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.direction,n=e.startPoint;if(t.length<2-Number(!!n))return null;var r=te("linear",i,t);return function(t,e){Qt(t,e)}(new ge(r,n),t),r}function be(t,e,i){switch(e){case"linear":default:return ie(t,i);case"basis":return ae(t,i);case"monotoneX":return de(t,i);case"monotoneY":return fe(t,i);case"step":return pe(t,.5,i);case"stepBefore":return pe(t,0,i);case"stepAfter":return pe(t,1,i);case"linearClosed":return ye(t,i)}}var me=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 Tt(e.bounds),e}return o(n,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([Dt,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([jt,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,i,n){return this.commandList.push([Nt,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([Lt,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([Et,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([It,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([Ut,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([Ot,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([Rt]),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[Dt]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[jt]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[Nt]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[Lt]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[Ot]=function(t){var e,i,n,r,a,s,o,l,u,h,c,d,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,c=Math.cos(i),d=Math.sin(i),f=Math.cos(n),v=Math.sin(n),p=c*s+r,g=d*o+a,y=f*s+r,b=v*o+a,m=s*u*h,x=o*u*h,e.push(p-m*d,g+x*c,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[Rt]=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(ct=n[a],dt=ct.slice(1),e=[ft=ct[0]],null!==(i=dt.match(Mt))){for(var o=0,l=i.length;o<l;o++)vt=i[o],pt=parseFloat(vt),Number.isNaN(pt)||e.push(pt);if(gt=Ct[ft],e.length-1>gt)for(var u=void 0,h=1,c=e.length;h<c;h+=gt){u=[ft];for(var d=h,f=h+gt;d<f;d++)u.push(e[d]);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=be(i,n);"x"===r?this.direction=kt.ROW:"y"===r?this.direction=kt.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[Dt]=this.moveToTransform,s[jt]=this.lineToTransform,s[Nt]=this.quadraticCurveToTransform,s[Lt]=this.bezierCurveToTransform,s[Et]=this.arcToTransform,s[It]=this.ellipseTransform,s[Ut]=this.rectTransform,s[Ot]=this.arcTransform,s[Rt]=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,c=0,d=0,f=0,v=0,p=0,g=t.length;p<g;++p){switch(e=t[p],1===l&&1===u||(e=_e(e,l,u)),e[0]){case"l":c+=e[1],d+=e[2],this.lineTo(c+s,d+o);break;case"L":c=e[1],d=e[2],this.lineTo(c+s,d+o);break;case"h":c+=e[1],this.lineTo(c+s,d+o);break;case"H":c=e[1],this.lineTo(c+s,d+o);break;case"v":d+=e[1],this.lineTo(c+s,d+o);break;case"V":d=e[1],this.lineTo(c+s,d+o);break;case"m":c+=e[1],d+=e[2],this.moveTo(c+s,d+o);break;case"M":c=e[1],d=e[2],this.moveTo(c+s,d+o);break;case"c":i=c+e[5],n=d+e[6],f=c+e[3],v=d+e[4],this.bezierCurveTo(c+e[1]+s,d+e[2]+o,f+s,v+o,i+s,n+o),c=i,d=n;break;case"C":c=e[5],d=e[6],f=e[3],v=e[4],this.bezierCurveTo(e[1]+s,e[2]+o,f+s,v+o,c+s,d+o);break;case"s":i=c+e[3],n=d+e[4],f=2*c-f,v=2*d-v,this.bezierCurveTo(f+s,v+o,c+e[1]+s,d+e[2]+o,i+s,n+o),f=c+e[1],v=d+e[2],c=i,d=n;break;case"S":i=e[3],n=e[4],f=2*c-f,v=2*d-v,this.bezierCurveTo(f+s,v+o,e[1]+s,e[2]+o,i+s,n+o),c=i,d=n,f=e[1],v=e[2];break;case"q":i=c+e[3],n=d+e[4],f=c+e[1],v=d+e[2],this.quadraticCurveTo(f+s,v+o,i+s,n+o),c=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+s,e[2]+o,i+s,n+o),c=i,d=n,f=e[1],v=e[2];break;case"t":i=c+e[1],n=d+e[2],null===h[0].match(/[QqTt]/)?(f=c,v=d):"t"===h[0]?(f=2*c-r,v=2*d-a):"q"===h[0]&&(f=2*c-f,v=2*d-v),r=f,a=v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),d=n,f=(c=i)+e[1],v=d+e[2];break;case"T":i=e[1],n=e[2],f=2*c-f,v=2*d-v,this.quadraticCurveTo(f+s,v+o,i+s,n+o),c=i,d=n;break;case"a":zt(this,c+s,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+c+s,e[7]+d+o]),c+=e[6],d+=e[7];break;case"A":zt(this,c+s,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+s,e[7]+o]),c=e[6],d=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 jt:this.lineToTransform(o,e,i,n,r);break;case Dt:this.moveToTransform(o,e,i,n,r);break;case Lt:this.bezierCurveToTransform(o,e,i,n,r);break;case Nt:this.quadraticCurveToTransform(o,e,i,n,r);break;case Ot:this.arcToTransform(o,e,i,n,r);break;case It:this.ellipseTransform(o,e,i,n,r);break;case Ut:this.rectTransform(o,e,i,n,r);break;case Et:this.arcToTransform(o,e,i,n,r);break;case Rt:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),Wt(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===kt.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===kt.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}(Pt),xe=["l",0,0,0,0,0,0,0];function _e(t,e,i){var n=xe[0]=t[0];if("a"===n||"A"===n)xe[1]=e*t[1],xe[2]=i*t[2],xe[3]=t[3],xe[4]=t[4],xe[5]=t[5],xe[6]=e*t[6],xe[7]=i*t[7];else if("h"===n||"H"===n)xe[1]=e*t[1];else if("v"===n||"V"===n)xe[1]=i*t[1];else for(var r=1,a=t.length;r<a;++r)xe[r]=(r%2==1?e:i)*t[r];return xe}var Ae={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},ke={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Be=Object.assign({outerBorder:Object.assign(Object.assign({},ke),{distance:0}),innerBorder:Object.assign(Object.assign({},ke),{distance:0})},ke),Se={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",disableAutoClipedPoptip:void 0},we=Object.assign(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}),Be),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Te={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Pe=Object.assign(Object.assign(Object.assign({strokeSeg:null,pickable:!0,childrenPickable:!0,fillPickable:!0,strokePickable:!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}),we),Ae),Me=Object.assign(Object.assign({},Pe),{startAngle:0,endAngle:e.pi2,innerRadius:0,outerRadius:1,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Ce=Object.assign(Object.assign(Object.assign({},Pe),Te),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1}),Oe=Object.assign(Object.assign({},Pe),{radius:1,startAngle:0,endAngle:e.pi2}),Ee=Object.assign(Object.assign({},Pe),{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"}),Le=Object.assign(Object.assign({},Pe),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Re=Object.assign(Object.assign(Object.assign({},Pe),Te),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1}),Ie=Object.assign(Object.assign({},Pe),{path:new me,customPath:function(){e.Logger.getInstance().warn("空函数")}}),je=Object.assign(Object.assign({},Pe),{points:[],cornerRadius:0,closePath:!0}),De=Object.assign(Object.assign({},Pe),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),Ne=Object.assign(Object.assign({},Pe),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Ue=Object.assign(Object.assign({},Pe),{symbolType:"circle",size:10,keepDirIn3d:!0}),ze=Object.assign(Object.assign(Object.assign({},Pe),Se),{strokeBoundsBuffer:0,keepDirIn3d:!0}),He=Object.assign(Object.assign({},Pe),{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}),We=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Pe),{fill:!0,cornerRadius:0}),Ve=Object.assign(Object.assign({},We),{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}),Fe=new(o((function t(){a(this,t)}))),Ge={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"}},Ye=!0,$e=!1,Xe=/\w|\(|\)|-/,qe=/[.?!,;:/,。?!、;:]/,Ke=/\S/;function Ze(t,e,i,n,r){if(!e||e<=0)return 0;for(var a=Fe.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=Je(t,s)),s}function Je(t,e){for(var i=e;Xe.test(t[i-1])&&Xe.test(t[i])||qe.test(t[i]);)if(--i<=0)return e;return i}function Qe(t,e){var i=Fe.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 ti=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(){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?ze.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:Se.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:Se.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 c="",d=0,f=0;f<u;f++){var v=t[f];c+=v.text,d+=v.text.length}var p=Je(c+=t[u].text,d+h.str.length);(p-=d)!==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=Je(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("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}}else o=this._clipTextEnd(t,e,i,n,r),s&&(o.result=o.str+s);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),c=this.measureTextWidth(h,e);return u+c>i?{left:l,right:r,width:u+s}:this._clipTextMiddle(t,e,i,l,h,u,c,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 c=this.clipTextVertical(t,e,i/2,r),d=this.revertVerticalList(t),f=this.clipTextVertical(d,e,i/2,r);c.verticalList.push({text:n,direction:1,width:l}),this.revertVerticalList(f.verticalList).forEach((function(t){return c.verticalList.push(t)})),o={verticalList:c.verticalList,width:c.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=Je(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}();ei=ti([D()],ei);var 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=Symbol.for("TextMeasureContribution"),ri=function(t){u(i,t);var e=g(i);function i(){return a(this,i),e.apply(this,arguments)}return o(i)}(ei);ri=ii([D()],ri);var ai=new Q,si=Symbol.for("CanvasFactory");function oi(t){return ai.getNamed(si,Fe.global.env)(t)}var li=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=oi(Object.assign({nativeCanvas:Fe.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=oi(Object.assign({nativeCanvas:Fe.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}(),ui=new li,hi=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},ci=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},di=Symbol.for("VWindow"),fi=Symbol.for("WindowHandlerContribution"),vi=function(){function t(){a(this,t),this.hooks={onChange:new rt(["x","y","width","height"])},this._uid=k.GenAutoIncrementId(),this.global=Fe.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&&(ai.getNamed(fi,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}();vi=hi([D(),ci("design:paramtypes",[])],vi);var pi,gi=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},yi=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bi=function(t,e){return function(i,n){e(i,n,t)}},mi=function(){function t(e){var i=this;a(this,t),this.contributions=e,this.configured=!1,this.global=Fe.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=ui.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:Se.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:Se.fontFamily,fontSize:Se.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)}},{key:"drawGraphicToCanvas",value:function(t,e,i){if(!e.defaultLayer)return null;var n=ai.get(di),r=t.AABBBounds,a=r.width(),s=r.height();n.create({width:a,height:s,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});var o=-r.x1,l=-r.y1,u=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{x:o,y:l,width:a,height:s,stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=u;var h=n.getNativeHandler();return h.nativeCanvas?h.nativeCanvas:null}}]),t}();mi=gi([D(),bi(0,I(et)),bi(0,N(ni)),yi("design:paramtypes",[Object])],mi),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(pi||(pi={}));var xi=new e.Matrix,_i=function(){function t(){a(this,t),this.matrix=new e.Matrix}return o(t,[{key:"init",value:function(t){return this.mode=pi.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=pi.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,i){var n=this.outSourceMatrix;if(xi.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(xi.a,xi.b,xi.c,xi.d,xi.e,xi.f),this}},{key:"rotateMatrix",value:function(t,e){var i=this.outSourceMatrix;if(xi.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(xi.a,xi.b,xi.c,xi.d,xi.e,xi.f),this}},{key:"scale",value:function(t,e,i){return this.mode===pi.matrix?this.scaleMatrix(t,e,i):this}},{key:"rotate",value:function(t,e){return this.mode===pi.matrix?this.rotateMatrix(t,e):this}},{key:"translateMatrix",value:function(t,e){var i=this.outSourceMatrix;return xi.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(xi.a,xi.b,xi.c,xi.d,xi.e,xi.f),this}},{key:"translate",value:function(t,e){return this.mode===pi.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===pi.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}]),t}();_i=gi([D(),yi("design:paramtypes",[])],_i);var Ai={arc:Me,area:Ce,circle:Oe,line:Re,path:Ie,symbol:Ue,text:ze,rect:De,rect3d:Ne,polygon:je,richtext:He,richtextIcon:Ve,image:We,group:Ee,glyph:Le},ki=Object.keys(Ai);function Bi(t,e){Object.keys(e).forEach((function(i){t[i]=e[i]}))}var Si={arc:Object.assign({},Ai.arc),area:Object.assign({},Ai.area),circle:Object.assign({},Ai.circle),line:Object.assign({},Ai.line),path:Object.assign({},Ai.path),symbol:Object.assign({},Ai.symbol),text:Object.assign({},Ai.text),rect:Object.assign({},Ai.rect),rect3d:Object.assign({},Ai.rect3d),polygon:Object.assign({},Ai.polygon),richtext:Object.assign({},Ai.richtext),richtextIcon:Object.assign({},Ai.richtextIcon),image:Object.assign({},Ai.image),group:Object.assign({},Ai.group),glyph:Object.assign({},Ai.glyph)},wi=function(){function t(){a(this,t),this.initTheme(),this.dirty=!1}return o(t,[{key:"initTheme",value:function(){var t=this;this._defaultTheme={},ki.forEach((function(e){t._defaultTheme[e]=Object.create(Si[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;ki.forEach((function(r){var a=Object.create(Si[r]);t&&t[r]&&Bi(a,t[r]),n[r]&&Bi(a,n[r]),i[r]&&Bi(a,i[r]),e.combinedTheme[r]=a})),i.common&&ki.forEach((function(t){Bi(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}(),Ti=new wi;function Pi(t,e){return t.glyphHost?Pi(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)):Ti.getTheme()}return null}(t)||Ti.getTheme()}var Mi=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())}))},Ci=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 Mi(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),Oi=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}(),Ei=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)}(Oi),Li={pickable:!0,visible:!0,dispatchEvent:function(t){var e;if(!(t instanceof Oi))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 Ei(t,e))}},Ri=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}();Ri.quadIn=Ri.getPowIn(2),Ri.quadOut=Ri.getPowOut(2),Ri.quadInOut=Ri.getPowInOut(2),Ri.cubicIn=Ri.getPowIn(3),Ri.cubicOut=Ri.getPowOut(3),Ri.cubicInOut=Ri.getPowInOut(3),Ri.quartIn=Ri.getPowIn(4),Ri.quartOut=Ri.getPowOut(4),Ri.quartInOut=Ri.getPowInOut(4),Ri.quintIn=Ri.getPowIn(5),Ri.quintOut=Ri.getPowOut(5),Ri.quintInOut=Ri.getPowInOut(5),Ri.backIn=Ri.getBackIn(1.7),Ri.backOut=Ri.getBackOut(1.7),Ri.backInOut=Ri.getBackInOut(1.7),Ri.elasticIn=Ri.getElasticIn(1,.3),Ri.elasticOut=Ri.getElasticOut(1,.3),Ri.elasticInOut=Ri.getElasticInOut(1,.3*1.5);var Ii=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===xt.END?this.removeAnimate(e):e.status===xt.RUNNING||e.status===xt.INITIAL?(this.animateCount++,e.advance(t)):e.status===xt.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}(),ji=new Ii,Di=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}(),Ni=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}(Di),Ui=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]:ji;a(this,t),this.id=e,this.timeline=i,this.status=xt.INITIAL,this.tailAnimate=new Hi(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}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&_t.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:mt.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,i=new Ni((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===xt.RUNNING&&(this.status=xt.PAUSED)}},{key:"resume",value:function(){this.status===xt.PAUSED&&(this.status=xt.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 Hi(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===xt.INITIAL&&(this.status=xt.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+t*this.timeScale)&&this.status===xt.RUNNING&&(this.status=xt.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=xt.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}();Ui.mode=_t.NORMAL,Ui.interpolateMap=new Map;var zi,Hi=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 Wi(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?Ri[i]:i,r=this._addStep(e,null,n);return r.type=At.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?Ri[i]:i,s=this._addStep(e,null,a);return s.type=At.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=At.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=At.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 Wi(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}(),Wi=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}(),Vi=200,Fi="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"}(zi||(zi={}));var Gi=[!1,!1,!1,!1],Yi=[0,0,0,0],$i=function(t){return t?e.isArray(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Yi[0]=t[0],Yi[2]=t[0],Yi[1]=t[1],Yi[3]=t[1],Yi):t:t:0},Xi=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],qi=[1,2,3,0,1,2,3,0];function Ki(t,i,n,r){for(;t>=e.pi2;)t-=e.pi2;for(;t<0;)t+=e.pi2;for(;t>i;)i+=e.pi2;Xi[0].x=n,Xi[1].y=n,Xi[2].x=-n,Xi[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<qi.length;l++)if(o||a!==qi[l]){if(o&&s===qi[l])break;if(o){var u=Xi[qi[l]];r.add(u.x,u.y)}}else{o=!0;var h=Xi[a];r.add(h.x,h.y)}}function Zi(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 Ji(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]=Zi(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]=Zi(t[s],i[s],n)}return r}function Qi(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 tn=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}();tn.TimeOut=1e3/60,new tn;var en,nn,rn=function(t,i){return e.isString(t)&&"%"===t[t.length-1]?i*(Number.parseFloat(t.substring(0,t.length-1))/100):t},an=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}(Di);!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"}(en||(en={})),function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(nn||(nn={}));var sn=function(){function t(){a(this,t)}return o(t,null,[{key:"Get",value:function(i){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nn.Color1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(n===nn.Color1){var a=t.store1[i];if(a)return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r;var s=e.Color.parseColorString(i);if(s){var o=[s.r/255,s.g/255,s.b/255,s.opacity];t.store1[i]=o,t.store255[i]=[s.r,s.g,s.b,s.opacity],r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3]}return r}var l=t.store255[i];if(l)return r[0]=l[0],r[1]=l[1],r[2]=l[2],r[3]=l[3],r;var u=e.Color.parseColorString(i);return u&&(t.store1[i]=[u.r/255,u.g/255,u.b/255,u.opacity],t.store255[i]=[u.r,u.g,u.b,u.opacity],r[0]=u.r,r[1]=u.g,r[2]=u.b,r[3]=u.opacity),r}},{key:"Set",value:function(e,i,n){if(i===nn.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 on(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 ln(t,e,i,n,r){if(!t||!e)return t&&on(t)||e&&on(e)||!1;var a,s,o=!1,l=!1;if(Array.isArray(t)?a=t:"string"==typeof t?a=sn.Get(t,nn.Color255):o=!0,Array.isArray(e)?s=e:"string"==typeof e?s=sn.Get(e,nn.Color255):l=!0,o!==l){var u=o?t:e,h=o?e:t,c=Object.assign(Object.assign({},u),{stops:u.stops.map((function(t){return Object.assign(Object.assign({},t),{color:on(h)})}))});return o?ln(u,c,i,n,r):ln(c,u,i,n,r)}if(o){if(t.gradient===e.gradient){var d=t,f=e,v=d.stops,p=f.stops;if(v.length!==p.length)return!1;if("linear"===d.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:cn(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(d,f,i);if("radial"===d.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:cn(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(d,f,i);if("conical"===d.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:cn(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i}}))}}(d,f,i)}return!1}return r&&r(a,s),on(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)}sn.store255={},sn.store1={};var un=[0,0,0,0],hn=[0,0,0,0];function cn(t,e,i){return sn.Get(t,nn.Color255,un),sn.Get(e,nn.Color255,hn),"rgba(".concat(Math.round(un[0]+(hn[0]-un[0])*i),",").concat(Math.round(un[1]+(hn[1]-un[1])*i),",").concat(Math.round(un[2]+(hn[2]-un[2])*i),",").concat(un[3]+(hn[3]-un[3])*i,")")}var dn=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?Fe.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=Fe.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?Fe.global.getRequestAnimationFrame()((function(){i.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(n=r.waitingMark)||void 0===n||n.push(i):i&&Fe.global.getRequestAnimationFrame()((function(){i.imageLoadSuccess(e,r.data)})):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Fe.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=Fe.global.loadArrayBuffer(e):"blob"===i?n.dataPromise=Fe.global.loadBlob(e):"json"===i&&(n.dataPromise=Fe.global.loadJson(e)),n.dataPromise.then((function(t){return t.data})))}}]),t}();dn.cache=new Map;var fn=new e.Matrix,vn=new e.AABBBounds,pn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],gn=["x","y"],yn=["scaleX","scaleY"],bn=["angle"],mn=new e.Point,xn={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},_n=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=yt.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;mn.x=s+(null!==(e=u.scrollX)&&void 0!==e?e:0),mn.y=l+(null!==(i=u.scrollY)&&void 0!==i?i:0)}else mn.x=s,mn.y=l;return mn}},{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;Fe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return this.addUpdateLayoutTag(),Fe.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&yt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&yt.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&yt.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&yt.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&yt.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&yt.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=yt.CLEAR_SHAPE}},{key:"containsPoint",value:function(t,i,n,r){if(!r)return!1;if(n===bt.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]:pn,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]:pn,i=0;i<e.length;i++)if(t===e[i])return!0;return!1}},{key:"initAttributes",value:function(t){var e={type:mt.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background&&this.loadImage(t.background,!0),this._updateTag=yt.INIT,this.onAttributeUpdate(e)}},{key:"translate",value:function(t,e){var i,n;if(0===t&&0===e)return this;var r={type:mt.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,gn,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?Fe.transformUtil.fromMatrix(o,o).translate(t,e):(s.x=(null!==(i=s.x)&&void 0!==i?i:Ae.x)+t,s.y=(null!==(n=s.y)&&void 0!==n?n:Ae.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:mt.TRANSLATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,gn,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:mt.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:i,scaleCenter:n},this.attribute,yn,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),Fe.transformUtil.fromMatrix(u,u).scale(t,i,n)}else l.scaleX=(null!==(r=l.scaleX)&&void 0!==r?r:Ae.scaleX)*t,l.scaleY=(null!==(a=l.scaleY)&&void 0!==a?a:Ae.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:mt.SCALE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,yn,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:mt.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:i},this.attribute,bn,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),Fe.transformUtil.fromMatrix(o,o).rotate(t,i)}else s.angle=(null!==(n=s.angle)&&void 0!==n?n:Ae.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:mt.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,bn,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 Ui(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||(Fe.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),c=this.getNoWorkAnimateAttr(),d={};n?h.forEach((function(e){c[e]?(u||(u={}),u[e]=t[e]):d[e]=void 0===t[e]?l.getDefaultAttribute(e):t[e]})):h.forEach((function(e){c[e]?(u||(u={}),u[e]=t[e]):d[e]=t[e]}));var f=this.animate();f.stateNames=e,f.to(d,null!==(a=null===(r=this.stateAnimateConfig)||void 0===r?void 0:r.duration)&&void 0!==a?a:Vi,null!==(o=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==o?o:Fi),u&&this.setAttributes(u,!1,{type:mt.STATE})}else this.setAttributes(t,!1,{type:mt.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|=yt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=yt.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=yt.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&yt.UPDATE_SHAPE_AND_BOUNDS)===yt.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=yt.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=yt.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=yt.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=yt.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=yt.CLEAR_GLOBAL_MATRIX}},{key:"addUpdateLayoutTag",value:function(){this._updateTag|=yt.UPDATE_LAYOUT}},{key:"clearUpdateLayoutTag",value:function(){this._updateTag&=yt.CLEAR_LAYOUT}},{key:"needUpdateLayout",value:function(){return!!(this._updateTag&yt.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 vn.copy(i._AABBBounds),i.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=i.AABBBounds.clone(),i._AABBBounds.copy(vn),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?Ae.x:i,r=t.y,a=void 0===r?Ae.y:r,s=t.scaleX,o=void 0===s?Ae.scaleX:s,l=t.scaleY,u=void 0===l?Ae.scaleY:l,h=t.angle,c=void 0===h?Ae.angle:h,d=t.scaleCenter,f=t.anchor,v=t.postMatrix,p=[0,0],g={};if(f&&(p=this.getAnchor(f,g)),!d||1===o&&1===u)e.normalTransform(this._transMatrix,this._transMatrix.reset(),n,a,o,u,c,f&&p);else{var y=this._transMatrix;y.reset(),y.translate(p[0],p[1]),y.rotate(c),y.translate(-p[0],-p[1]),y.translate(n,a),p=this.getAnchor(d,g),Fe.transformUtil.fromMatrix(y,y).scale(o,u,{x:p[0],y:p[1]})}var b=this.getOffsetXY(Ae);if(this._transMatrix.e+=b.x,this._transMatrix.f+=b.y,v){var m=fn.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),Fe.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:mt.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:mt.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 c=s[a],d=null!==(u=o&&o[a])&&void 0!==u?u:t.getLastPropByName(a,n);if(null!=c&&null!=d)e.interpolateFunc&&e.interpolateFunc(a,r,d,c,i)||(e.customInterpolate(a,r,d,c,h,i)||h.defaultInterpolate(c,d,a,i,l,r)||h._interpolate(a,r,d,c,i));else i[a]=c}})),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=ln(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=ln(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,c=ln(e,null!=h?h:t,a,!0,(function(t,e){r.shadowColorArray=e}));return c&&(n[i]=c),!0}return!1}},{key:"_interpolate",value:function(t,e,i,n,r){}},{key:"getDefaultAttribute",value:function(t){return Pi(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:Fe.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 me).fromString(t):this.pathProxy=new me,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")?(dn.GetSvg(t,this),this.backgroundImg=this.backgroundImg||i):(e.isValidUrl(t)||t.includes("/")||e.isBase64(t))&&(dn.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",Fe.graphicService.onRelease(this)}},{key:"_emitCustomEvent",value:function(t,e){var i,n;if(this._events&&t in this._events){var r=new Ei(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}(Ci);_n.mixin(Li);var An=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 kn(t,e,i,n){var r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Bn(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 Sn=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm"),wn=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,Sn),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 An("!xml"),i=e,n="",r="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var s=kn(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=Bn(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=kn(t,"--\x3e",a+4,"Comment is not closed.");else{var l=Bn(t,a,!1),u=l.tagName,h=l.tagExp,c=l.attrExpPresent,d=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 An(u);u!==h&&c&&(f[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,f,r),r=r.substr(0,r.lastIndexOf("."))}else{var v=new An(u);this.tagsNodeStack.push(i),u!==h&&c&&(v[":@"]=this.buildAttributesMap(h,r,u)),this.addChild(i,v,r),i=v}n="",a=d}else n+=t[a];return e.child}}]),t}();function Tn(t,e){return Pn(t)}function Pn(t,e){for(var i,n={},r=0;r<t.length;r++){var a=t[r],s=Mn(a);if(void 0!==s&&a[s]){var o=Pn(a[s]);i=o,Object.keys(i).length,a[":@"]&&Cn(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 Mn(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var n=e[i];if(":@"!==n)return n}}function Cn(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 On=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&&Tn(new wn(this.options).parseXml(t),this.options)}}]),t}();function En(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}On.defaultOptions={};var Ln,Rn=0;function In(){return Rn++}function jn(t){for(var e=[],i=0,n="",r=0;r<t.length;r++)Un(t[r])?i?n+=t[r]:(i=1,n=t[r]):(i&&(e.push({text:n,direction:Ln.VERTICAL}),n="",i=0),e.push({text:t[r],direction:Ln.HORIZONTAL}));return n&&e.push({text:n,direction:Ln.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Ln||(Ln={}));var Dn=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((function(t){return Dn.set(t,!0)}));var Nn=new Map;function Un(t){if(Dn.has(t))return!0;if(Nn.has(t))return!1;var e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((function(t){return Nn.set(t,!0)}));var zn=In(),Hn=In(),Wn=In(),Vn=In();In();var Fn=In(),Gn=In(),Yn=In(),$n=In(),Xn=In();In();var qn=In();In();var Kn,Zn=In(),Jn=In(),Qn=In(),tr=Symbol.for("GraphicService"),er=Symbol.for("GraphicCreator"),ir={"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"},nr=Object.keys(ir);!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Kn||(Kn={}));var rr=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=Fn,e._childUpdateTag=yt.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 wi),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new wi)}},{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===bt.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&yt.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Fe.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Fe.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?Ae.x:e,r=t.y,a=void 0===r?Ae.y:r,s=t.dx,o=void 0===s?Ae.dx:s,l=t.dy,u=void 0===l?Ae.dy:l,c=t.scaleX,d=void 0===c?Ae.scaleX:c,f=t.scaleY,v=void 0===f?Ae.scaleY:f,p=t.angle,g=void 0===p?Ae.angle:p,b=t.postMatrix;if(0!==i||0!==a||0!==o||0!==u||1!==d||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=Pi(this).group;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=Fe.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),n=t.boundsPadding,r=void 0===n?e.boundsPadding:n,a=$i(r);return a&&i.expand(a),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),i}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=yt.CLEAR_BOUNDS,this._childUpdateTag&=yt.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=yt.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&yt.UPDATE_BOUNDS||(this._childUpdateTag|=yt.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(),Fe.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){y(h(n.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),Fe.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,Fe.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){this.forEachChildren((function(t){Fe.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),Fe.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&yt.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=Fe.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}(_n);function ar(t){return new rr(t)}rr.NOWORK_ANIMATE_ATTR=xn;var sr,or=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 wi,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){Fe.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){Fe.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}(rr),lr=Symbol.for("TransformUtil"),ur=Symbol.for("GraphicUtil"),hr=Symbol.for("LayerService"),cr=Symbol.for("StaticLayerHandlerContribution"),dr=Symbol.for("DynamicLayerHandlerContribution"),fr=Symbol.for("VirtualLayerHandlerContribution"),vr=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},pr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gr=sr=function(){function t(){a(this,t),this.layerMap=new Map,this.global=Fe.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?ai.get(cr):"dynamic"===t?ai.get(dr):ai.get(fr)}},{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.main||i.canvasId?"static":n;var r=this.getLayerHandler(n),a=new or(t,this.global,t.window,Object.assign(Object.assign({main:!1},i),{layerMode:n,canvasId:null!==(e=i.canvasId)&&void 0!==e?e:sr.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(sr.idprefix,"_").concat(sr.prefix_count++)}}]),t}();gr.idprefix="visactor_layer",gr.prefix_count=0,gr=sr=vr([D(),pr("design:paramtypes",[])],gr);var yr=new B((function(t){t(st).to(ht).inSingletonScope(),t(di).to(vi),t(ur).to(mi).inSingletonScope(),t(lr).to(_i).inSingletonScope(),t(hr).to(gr).inSingletonScope()}));function br(t,e){return!(!t&&!e)}function mr(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 Ar(t,e){return t*e>0}function kr(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Br(t,i,n,r,a,s,o,l){var u=n-t,h=r-i,c=o-a,d=l-s,f=d*u-c*h;return f*f<e.epsilon?[]:[t+(f=(c*(i-s)-d*(t-a))/f)*u,i+f*h]}function Sr(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,c=-u*o,d=t+h,f=e+c,v=i+h,p=n+c,g=(d+v)/2,y=(f+p)/2,b=v-d,m=p-f,x=b*b+m*m,_=r-a,A=d*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,P=B-g,M=S-y,C=w-g,O=T-y;return P*P+M*M>C*C+O*O&&(B=w,S=T),{cx:B,cy:S,x01:-h,y01:-c,x11:B*(r/_-1),y11:S*(r/_-1)}}function wr(t,i,n,r,a,s,o){var l=t.getParsedAngle(),u=l.startAngle,h=l.endAngle,c=e.abs(h-u),d=h>u,f=!1;if(a<s){var v=a;a=s,s=v}if(a<=e.epsilon)i.moveTo(n,r);else if(c>=e.pi2-e.epsilon)i.moveTo(n+a*e.cos(u),r+a*e.sin(u)),i.arc(n,r,a,u,h,!d),s>e.epsilon&&(i.moveTo(n+s*e.cos(h),r+s*e.sin(h)),i.arc(n,r,s,h,u,d));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,P=m,M=m,C=m,O=Math.max(P,T),E=Math.max(M,C),L=O,R=E,I=a*e.cos(k),j=a*e.sin(k),D=s*e.cos(S),N=s*e.sin(S);if((E>e.epsilon||O>e.epsilon)&&(p=a*e.cos(B),g=a*e.sin(B),y=s*e.cos(w),b=s*e.sin(w),c<e.pi)){var U=Br(I,j,y,b,p,g,D,N);if(U){var z=I-U[0],H=j-U[1],W=p-U[0],V=g-U[1],F=1/e.sin(e.acos((z*W+H*V)/(e.sqrt(z*z+H*H)*e.sqrt(W*W+V*V)))/2),G=e.sqrt(U[0]*U[0]+U[1]*U[1]);R=e.min(E,(s-G)/(F-1)),L=e.min(O,(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),$=e.min(P,L),X=Sr(y,b,I,j,a,Y,Number(d)),q=Sr(p,g,D,N,a,$,Number(d));L<O&&Y===$?!o||o[0]?(i.moveTo(n+X.cx+X.x01,r+X.cy+X.y01),i.arc(n+X.cx,r+X.cy,L,e.atan2(X.y01,X.x01),e.atan2(q.y01,q.x01),!d)):i.moveTo(n+X.cx+L*e.cos(e.atan2(q.y01,q.x01)),r+X.cy+L*e.sin(e.atan2(q.y01,q.x01))):!o||o[0]?(i.moveTo(n+X.cx+X.x01,r+X.cy+X.y01),Y>0&&i.arc(n+X.cx,r+X.cy,Y,e.atan2(X.y01,X.x01),e.atan2(X.y11,X.x11),!d),i.arc(n,r,a,e.atan2(X.cy+X.y11,X.cx+X.x11),e.atan2(q.cy+q.y11,q.cx+q.x11),!d),$>0&&i.arc(n+q.cx,r+q.cy,$,e.atan2(q.y11,q.x11),e.atan2(q.y01,q.x01),!d)):$>0?i.moveTo(n+q.cx+$*e.cos(e.atan2(q.y01,q.x01)),r+q.cy+$*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,!d)):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(C,R),Z=e.min(M,R),J=Sr(D,N,p,g,s,-Z,Number(d)),Q=Sr(I,j,y,b,s,-K,Number(d));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<E&&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,!d):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),!d),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),d),K>0&&i.arc(n+Q.cx,r+Q.cy,K,e.atan2(Q.y11,Q.x11),e.atan2(Q.y01,Q.x01),!d)):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,d):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 Tr=Symbol.for("ArcRenderContribution"),Pr=Symbol.for("AreaRenderContribution"),Mr=Symbol.for("CircleRenderContribution"),Cr=Symbol.for("GroupRenderContribution"),Or=Symbol.for("ImageRenderContribution"),Er=Symbol.for("PathRenderContribution"),Lr=Symbol.for("PolygonRenderContribution"),Rr=Symbol.for("RectRenderContribution"),Ir=Symbol.for("SymbolRenderContribution"),jr=Symbol.for("TextRenderContribution"),Dr=Symbol.for("InteractiveSubRenderContribution"),Nr=["radius","startAngle","endAngle"].concat(m(pn)),Ur=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=Vn,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=Pi(this).circle;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Fe.graphicService.updateCircleAABBBounds(i,Pi(this).circle,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=$i(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Pi(this).circle[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Nr)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Nr)}},{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 me;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}(_n);function zr(t){return new Ur(t)}function Hr(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Wr(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)}Ur.NOWORK_ANIMATE_ATTR=xn;var Vr=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],c=[0,0];t.length>0;){var d=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,s,o,l).str;u.push({str:d,width:this.textMeasure.measureTextWidth(d,this.textOptions)}),t=t.substring(d.length)}"left"===n||"start"===n||("center"===n?c[0]=h[0]/-2:"right"!==n&&"end"!==n||(c[0]=-h[0])),"top"===r||("middle"===r?c[1]=h[1]/-2:"bottom"===r&&(c[1]=-h[1]));var f={xOffset:c[0],yOffset:c[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,c=0,d=t.length;c<d;c++)h=Math.min(this.textMeasure.measureTextWidth(t[c],this.textOptions),s),l.push({str:this.textMeasure.clipTextWithSuffix(t[c],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}(),Fr=["text","maxLineWidth","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp"].concat(m(pn)),Gr=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=Qn,t.cache={},t}return o(n,[{key:"font",get:function(){var t=Pi(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,c=t.fontFamily;return(r?r+" ":"")+(s?s+" ":"")+(l?l+" ":"")+h*i+"px "+((void 0===c?e.fontFamily:c)||"sans-serif")}(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,i=Pi(this).text;if(this.isSimplify()){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(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=Pi(this).text,e=this.attribute;if(this.isSimplify()){var i=e.maxLineWidth,n=void 0===i?t.maxLineWidth:i;return!!Number.isFinite(n)&&(this.tryUpdateAABBBounds(),null!=this.clipedText&&this.clipedText!==e.text.toString())}}},{key:"multilineLayout",get:function(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}},{key:"isSimplify",value:function(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}},{key:"isMultiLine",get:function(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}},{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 e.isArray(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=Pi(this).text;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),n=this.attribute.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"updateWrapAABBBounds",value:function(t){var i,n,r,a,s=Pi(this).text,o=this.attribute,l=o.fontFamily,u=void 0===l?s.fontFamily:l,h=o.textAlign,c=void 0===h?s.textAlign:h,d=o.textBaseline,f=void 0===d?s.textBaseline:d,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,P=void 0===T?s.ignoreBuf:T,M=o.suffixPosition,C=void 0===M?s.suffixPosition:M,O=o.heightLimit,E=void 0===O?0:O,L=o.lineClamp,R=null!==(i=rn(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==i?i:this.attribute.fontSize||s.fontSize,I=P?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var j=this.cache.layoutData.bbox;return this._AABBBounds.set(j.xOffset,j.yOffset,j.xOffset+j.width,j.yOffset+j.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}var D=Fe.graphicUtil.textMeasure,N=new Vr(u,{fontSize:p,fontWeight:w,fontFamily:u},D),U=e.isArray(t)?t.map((function(t){return t.toString()})):[t.toString()],z=[],H=[0,0],W=1/0;if(E>0&&(W=Math.max(Math.floor(E/R),1)),L&&(W=Math.min(W,L)),"number"==typeof b&&b!==1/0){if(b>0)for(var V=0;V<U.length;V++){var F=U[V],G=!0;if(V===W-1){var Y=N.textMeasure.clipTextWithSuffix(F,N.textOptions,b,y,!1,C);z.push({str:Y.str,width:Y.width});break}var $=N.textMeasure.clipText(F,N.textOptions,b,"break-word"===B);if(""!==F&&""===$.str){if(y){var X=N.textMeasure.clipTextWithSuffix(F,N.textOptions,b,y,!1,C);$.str=null!==(r=X.str)&&void 0!==r?r:"",$.width=null!==(a=X.width)&&void 0!==a?a:0}else $.str="",$.width=0;G=!1}if(z.push({str:$.str,width:$.width}),$.str.length===F.length);else if(G){var q=F.substring($.str.length);U.splice(V+1,0,q)}}var K=0;z.forEach((function(t){K=Math.max(K,t.width)})),H[0]=K}else{for(var Z,J,Q=0,tt=0,et=U.length;tt<et;tt++){if(tt===W-1){var it=N.textMeasure.clipTextWithSuffix(U[tt],N.textOptions,b,y,!1,C);z.push({str:it.str,width:it.width}),Q=Math.max(Q,it.width);break}J=U[tt],Z=N.textMeasure.measureTextWidth(J,N.textOptions,"break-word"===B),Q=Math.max(Q,Z),z.push({str:J,width:Z})}H[0]=Q}H[1]=z.length*(R+I);var nt={xOffset:0,yOffset:0,width:H[0],height:H[1]};N.LayoutBBox(nt,c,f);var rt=N.layoutWithBBox(nt,z,c,f,R);return this.cache.layoutData=rt,this.clearUpdateShapeTag(),this._AABBBounds.set(nt.xOffset,nt.yOffset,nt.xOffset+nt.width,nt.yOffset+nt.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"updateSingallineAABBBounds",value:function(t){var e=Pi(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=Pi(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=Pi(this).text,r=this.attribute.wrap;if(void 0===r?n.wrap:r)return this.updateWrapAABBBounds([t]);var a,s,o=Fe.graphicUtil.textMeasure,l=this.attribute,u=l.maxLineWidth,h=void 0===u?n.maxLineWidth:u,c=l.ellipsis,d=void 0===c?n.ellipsis:c,f=l.textAlign,v=void 0===f?n.textAlign:f,p=l.textBaseline,g=void 0===p?n.textBaseline:p,y=l.fontFamily,b=void 0===y?n.fontFamily:y,m=l.fontSize,x=void 0===m?n.fontSize:m,_=l.fontWeight,A=void 0===_?n.fontWeight:_,k=l.stroke,B=void 0===k?n.stroke:k,S=l.lineWidth,w=void 0===S?n.lineWidth:S,T=l.ignoreBuf,P=void 0===T?n.ignoreBuf:T,M=l.whiteSpace,C=void 0===M?n.whiteSpace:M,O=l.suffixPosition,E=void 0===O?n.suffixPosition:O;if("normal"===C)return this.updateWrapAABBBounds(t);var L=P?0:Math.max(2,.075*x),R=l.fontSize||n.fontSize,I=null!==(e=rn(l.lineHeight,R))&&void 0!==e?e:R+L;if(!this.shouldUpdateShape()&&this.cache){var j=Hr(v,a=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0),D=Wr(g,I,x);return this._AABBBounds.set(j,D,j+a,D+I),B&&this._AABBBounds.expand(w/2),this._AABBBounds}if(Number.isFinite(h)){if(d){var N=!0===d?n.ellipsis:d,U=o.clipTextWithSuffix(t.toString(),{fontSize:x,fontWeight:A,fontFamily:b},h,N,!1,E);s=U.str,a=U.width}else{var z=o.clipText(t.toString(),{fontSize:x,fontWeight:A,fontFamily:b},h,!1);s=z.str,a=z.width}this.cache.clipedText=s,this.cache.clipedWidth=a}else a=o.measureTextWidth(t.toString(),{fontSize:x,fontWeight:A,fontFamily:b}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=a;this.clearUpdateShapeTag();var H=Hr(v,a),W=I;Fe.global&&Fe.global.isSafari()&&(W+=.2*x);var V=Wr(g,W,x,L);return this._AABBBounds.set(H,V,H+a,V+W),B&&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=Pi(this).text,o=Fe.graphicUtil.textMeasure,l=this.attribute,u=l.ignoreBuf,h=(void 0===u?s.ignoreBuf:u)?0:2,c=l.maxLineWidth,d=void 0===c?s.maxLineWidth:c,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,P=void 0===T?s.suffixPosition:T,M=null!==(e=rn(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==e?e:(l.fontSize||s.fontSize)+h,C=l.textAlign,O=void 0===C?s.textAlign:C,E=l.textBaseline,L=void 0===E?s.textBaseline:E;if(!w){var R=O;O=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=Hr(O,a=this.cache.clipedWidth),j=Wr(L,M,g);return this._AABBBounds.set(j,I,j+M,I+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}var D=[jn(t.toString())];if(Number.isFinite(d)){if(v){var N=!0===v?s.ellipsis:v,U=o.clipTextWithSuffixVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},d,N,!1,P);D=[U.verticalList],a=U.width}else{var z=o.clipTextVertical(D[0],{fontSize:g,fontWeight:b,fontFamily:x},d,!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===Ln.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=Hr(O,a),W=Wr(L,M,g);return this._AABBBounds.set(W,H,W+M,H+a),A&&this._AABBBounds.expand(B/2),this._AABBBounds}},{key:"updateHorizontalMultilineAABBBounds",value:function(t){var e,i,n=Pi(this).text,r=this.attribute.wrap;if(void 0===r?n.wrap:r)return this.updateWrapAABBBounds(t);var a=this.attribute,s=a.fontFamily,o=void 0===s?n.fontFamily:s,l=a.textAlign,u=void 0===l?n.textAlign:l,h=a.textBaseline,c=void 0===h?n.textBaseline:h,d=a.fontSize,f=void 0===d?n.fontSize:d,v=a.fontWeight,p=void 0===v?n.fontWeight:v,g=a.ellipsis,y=void 0===g?n.ellipsis:g,b=a.maxLineWidth,m=a.stroke,x=void 0===m?n.stroke:m,_=a.lineWidth,A=void 0===_?n.lineWidth:_,k=a.whiteSpace,B=void 0===k?n.whiteSpace:k,S=a.suffixPosition,w=void 0===S?n.suffixPosition:S,T=null!==(e=rn(a.lineHeight,a.fontSize||n.fontSize))&&void 0!==e?e:a.fontSize||n.fontSize;if("normal"===B)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var P=this.cache.layoutData.bbox;return this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}var M=Fe.graphicUtil.textMeasure,C=new Vr(o,{fontSize:f,fontWeight:p,fontFamily:o},M).GetLayoutByLines(t,u,c,T,!0===y?n.ellipsis:y||void 0,!1,b,w),O=C.bbox;return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(O.xOffset,O.yOffset,O.xOffset+O.width,O.yOffset+O.height),x&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"updateVerticalMultilineAABBBounds",value:function(t){var i,r,a,s,o=Pi(this).text,l=Fe.graphicUtil.textMeasure,u=this.attribute,h=u.ignoreBuf,c=(void 0===h?o.ignoreBuf:h)?0:2,d=u.maxLineWidth,f=void 0===d?o.maxLineWidth:d,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,P=u.suffixPosition,M=void 0===P?o.suffixPosition:P,C=null!==(i=rn(u.lineHeight,u.fontSize||o.fontSize))&&void 0!==i?i:(u.fontSize||o.fontSize)+c,O=u.textAlign,E=void 0===O?o.textAlign:O,L=u.textBaseline,R=void 0===L?o.textBaseline:L;if(!T){var I=E;E=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=Hr(E,s),D=this.cache.verticalList.length*C,N=Wr(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 jn(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,M);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===Ln.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=Hr(E,s),H=this.cache.verticalList.length*C,W=Wr(R,H,m);return this._AABBBounds.set(W,z,W+H,z+s),k&&this._AABBBounds.expand(S/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Pi(this).text[t]}},{key:"needUpdateTags",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fr;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]:Fr;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}(_n);function Yr(t){return new Gr(t)}Gr.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},xn),Gr.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Gr.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var $r=["heightLimit","lineClamp"],Xr=function(t){u(n,t);var i=g(n);function n(t){return a(this,n),i.call(this,Object.assign(Object.assign({},t),{wrap:!0}))}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=Pi(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,c=s.textBaseline,d=void 0===c?a.textBaseline:c,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,P=s.heightLimit,M=void 0===P?0:P,C=s.suffixPosition,O=void 0===C?a.suffixPosition:C,E=s.lineClamp,L=null!==(e=rn(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,R=T?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){var I=this.cache.layoutData.bbox;return this._AABBBounds.set(I.xOffset,I.yOffset,I.xOffset+I.width,I.yOffset+I.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}var j=Fe.graphicUtil.textMeasure,D=new Vr(l,{fontSize:v,fontWeight:S,fontFamily:l},j),N=t.map((function(t){return t.toString()})),U=[],z=[0,0],H=1/0;if(M>0&&(H=Math.max(Math.floor(M/L),1)),E&&(H=Math.min(H,E)),"number"==typeof y&&y!==1/0){if(y>0)for(var W=0;W<N.length;W++){var V=N[W],F=!0;if(W===H-1){var G=D.textMeasure.clipTextWithSuffix(V,D.textOptions,y,g,!1,O);U.push({str:G.str,width:G.width});break}var Y=D.textMeasure.clipText(V,D.textOptions,y,"break-word"===k);if(""!==V&&""===Y.str){if(g){var $=D.textMeasure.clipTextWithSuffix(V,D.textOptions,y,g,!1,O);Y.str=null!==(n=$.str)&&void 0!==n?n:"",Y.width=null!==(r=$.width)&&void 0!==r?r:0}else Y.str="",Y.width=0;F=!1}if(U.push({str:Y.str,width:Y.width}),Y.str.length===V.length);else if(F){var X=V.substring(Y.str.length);N.splice(W+1,0,X)}}var q=0;U.forEach((function(t){q=Math.max(q,t.width)})),z[0]=q}else{for(var K,Z,J=0,Q=0,tt=N.length;Q<tt;Q++){if(Q===H-1){var et=D.textMeasure.clipTextWithSuffix(N[Q],D.textOptions,y,g,!1,O);U.push({str:et.str,width:et.width}),J=Math.max(J,et.width);break}Z=N[Q],K=D.textMeasure.measureTextWidth(Z,D.textOptions,"break-word"===k),J=Math.max(J,K),U.push({str:Z,width:K})}z[0]=J}z[1]=U.length*(L+R);var it={xOffset:0,yOffset:0,width:z[0],height:z[1]};D.LayoutBBox(it,h,d);var nt=D.layoutWithBBox(it,U,h,d,L);return this.cache.layoutData=nt,this.clearUpdateShapeTag(),this._AABBBounds.set(it.xOffset,it.yOffset,it.xOffset+it.width,it.yOffset+it.height),m&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<$r.length;e++){var i=$r[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<$r.length;e++)if(t===$r[e])return!0;return y(h(n.prototype),"needUpdateTag",this).call(this,t)}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(Gr);function qr(t){return new Xr(t)}var Kr=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 Zr(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 Jr=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 Zr(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return Zr(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}(Kr),Qr=new Jr;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="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}(Kr),ea=new ta;function ia(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 na=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 ia(t,e/2,i,n,r)}},{key:"drawFitDir",value:function(t,e,i,n,r){return ia(t,e/2,i,n,r)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return ia(t,e/2+r,i,n,a)}}]),i}(Kr),ra=new na;function aa(t,e,i,n){var r=2*e;return t.rect(i-e,n-e,r,r),!1}var sa=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 aa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return aa(t,e/2+r,i,n)}}]),i}(Kr),oa=new sa;var la=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}(Kr),ua=new la,ha=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)}(la),ca=new ha,da=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),fa=Math.sin(e.tau/10)*da,va=-Math.cos(e.tau/10)*da;function pa(t,i,n,r){var a=fa*i,s=va*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 ga=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 pa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return pa(t,e/2+r,i,n)}}]),i}(Kr),ya=new ga,ba=e.sqrt(3);function ma(t,e,i,n){var r=e,a=r/ba,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 xa=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 ma(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return ma(t,e/2+r,i,n)}}]),i}(Kr),_a=new xa;function Aa(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 ka=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 Aa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Aa(t,e/2+r,i,n)}}]),i}(Kr),Ba=new ka;function Sa(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var wa=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 Sa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Sa(t,e/2+r,i,n)}}]),i}(Kr),Ta=new wa,Pa=-.5,Ma=e.sqrt(3)/2,Ca=1/e.sqrt(12);function Oa(t,e,i,n){var r=e/2,a=e*Ca,s=r,o=e*Ca+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(Pa*r-Ma*a+i,Ma*r+Pa*a+n),t.lineTo(Pa*s-Ma*o+i,Ma*s+Pa*o+n),t.lineTo(Pa*l-Ma*u+i,Ma*l+Pa*u+n),t.lineTo(Pa*r+Ma*a+i,Pa*a-Ma*r+n),t.lineTo(Pa*s+Ma*o+i,Pa*o-Ma*s+n),t.lineTo(Pa*l+Ma*u+i,Pa*u-Ma*l+n),t.closePath(),!1}var Ea=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 Oa(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Oa(t,e/2+r,i,n)}}]),i}(Kr),La=new Ea;var Ra=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}(Kr),Ia=new Ra;var ja=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}(Kr),Da=new ja;var Na=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}(Kr),Ua=new Na,za=e.sqrt(3);function Ha(t,e,i,n){var r=e*za;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var Wa=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 Ha(t,e/2/za,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ha(t,e/2/za+r,i,n)}}]),i}(la),Va=new Wa;function Fa(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 Ga=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 Fa(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Fa(t,e/4+r,i,n)}}]),i}(Kr),Ya=new Ga;function $a(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 Xa=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 $a(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return $a(t,e/4+r,i,n)}}]),i}(Kr),qa=new Xa;function Ka(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 Za=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 Ka(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Ka(t,e/4+r,i,n)}}]),i}(Kr),Ja=new Za;function Qa(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 ts=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 Qa(t,e/4,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r){return Qa(t,e/4+r,i,n)}}]),i}(Kr),es=new ts;function is(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var ns=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 is(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return is(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}(Kr),rs=new ns;function as(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}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="lineH",t.pathStr="M-0.5,0L0.5,0",t}return o(i,[{key:"draw",value:function(t,e,i,n,r){return as(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return as(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}(Kr),os=new ss;function ls(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 us=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 ls(t,e/2,i,n)}},{key:"drawOffset",value:function(t,e,i,n,r,a){return ls(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}(Kr),hs=new us;function cs(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function ds(t,e,i,n){var r=e,a=e/2;return t.rect(i-r/2,n-a/2,r,a),!1}var fs=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)?ds(t,i,n,r):cs(t,i,n,r)}},{key:"drawOffset",value:function(t,i,n,r,a){return e.isNumber(i)?ds(t,i+2*a,n,r):cs(t,[i[0]+2*a,i[1]+2*a],n,r)}}]),n}(Kr),vs=new fs,ps=new e.AABBBounds,gs=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(),Wt(r.path.commandList,t,i,n,e,e),s&&s(r.path,r.attribute)})),!1):(Wt(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(),Wt(r.path.commandList,t,i,n,e,e),a&&a(r.path,r.attribute)})),!1):(Wt(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;ps.x1=n.bounds.x1*t,ps.y1=n.bounds.y1*t,ps.x2=n.bounds.x2*t,ps.y2=n.bounds.y2*t,e.union(ps)}))}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}(),ys={};[Qr,ea,ra,oa,Va,ca,ya,_a,Ba,Ta,La,Ia,Da,ua,Ua,Ya,qa,Ja,es,vs,rs,os,hs].forEach((function(t){ys[t.type]=t}));var bs={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"},ms=new e.AABBBounds,xs=["symbolType","size"].concat(m(pn)),_s=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=Jn,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=Pi(this).symbol,r=this.attribute.symbolType,a=void 0===r?i.symbolType:r,s=ys[a];if(s)return this._parsedPath=s,s;if(s=n.userSymbolMap[a])return this._parsedPath=s,s;if(!0===((t=a=bs[a]||a).startsWith("<svg")||t.startsWith("<?xml"))){var o=(new On).parse(a).svg;if(!o)return null;var l=e.isArray(o.path)?o.path:[o.path];ms.clear();var u=[];l.forEach((function(t){var e=(new me).fromString(t.d),i={};nr.forEach((function(e){t[e]&&(i[ir[e]]=t[e])})),u.push({path:e,attribute:i}),ms.union(e.bounds)}));var h=ms.width(),c=ms.height(),d=1/e.max(h,c);return u.forEach((function(t){return t.path.transform(0,0,d,d)})),this._parsedPath=new gs(a,u,!0),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}var f=(new me).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 gs(a,f),n.userSymbolMap[a]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=Pi(this).symbol;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Fe.graphicService.updateSymbolAABBBounds(i,Pi(this).symbol,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=$i(a);return s&&n.expand(s),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Pi(this).symbol[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,xs)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,xs)}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),i=this.attribute.size,n=e.isArray(i)?i:[i,i];return t.path?(new me).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new me).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}(_n);function As(t){return new _s(t)}_s.userSymbolMap={},_s.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},xn);var ks=["segments","points","curveType"].concat(m(pn)),Bs=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=Yn,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=Ji(i,n,e))}},{key:"doUpdateAABBBounds",value:function(){var t=Pi(this).line;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updateLineAABBBounds(e,Pi(this).line,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Pi(this).line[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,ks)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,ks)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new me,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}(_n);function Ss(t){return new Bs(t)}Bs.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},xn);var ws=["width","x1","y1","height","cornerRadius"].concat(m(pn)),Ts=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this,t)).type="rect",e.numberType=qn,e}return o(n,[{key:"isValid",value:function(){return y(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){return!0}},{key:"doUpdateAABBBounds",value:function(){var t=Pi(this).rect;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updateRectAABBBounds(e,Pi(this).rect,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Pi(this).rect[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,ws)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,ws)}},{key:"toCustomPath",value:function(){var t=this.attribute,i=e.isNil(t.width)?t.x1-t.x:t.width,n=e.isNil(t.height)?t.y1-t.y:t.height,r=0,a=0;i<0&&(r=i,i=-i),n<0&&(a=n,n=-n);var s=new me;return s.moveTo(r,a),s.rect(r,a,i,n),s}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}]),n}(_n);function Ps(t){return new Ts(t)}Ts.NOWORK_ANIMATE_ATTR=xn;var Ms=function(){function t(e,i,n,r,s,o,l,u,h,c,d,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=c,this.directionKey=Ge[this.layoutDirection],this.isWidthMax=d,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 c=0;c<this.lines.length;c++){var d=this.lines[c],f=d.top,v=d.height;if(f+v<this[this.directionKey.top]||f+v>this[this.directionKey.top]+u)return h;var p=!1;this.ellipsis&&this.lines[c+1]&&this.lines[c+1].top+this.lines[c+1].height>this[this.directionKey.top]+u&&(p=!0,h=!0),this.lines[c].draw(t,p,this.lines[c][this.directionKey.left]+l,this.lines[c][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 c=this.lines[h];c.top;var d=c.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+d>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}(),Cs=function(){function t(e,i,n){a(this,t),this.fontSize=n.fontSize||16,this.textBaseline=n.textBaseline||"alphabetic";var r=rn(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=Qe(e,n),o=s.ascent,l=s.height,u=s.descent,h=s.width,c=0,d=0,f=0;this.height>l&&(c=(this.height-l)/2,d=Math.ceil(c),f=Math.floor(c)),"top"===this.textBaseline?(this.ascent=c,this.descent=l-c):"bottom"===this.textBaseline?(this.ascent=l-c,this.descent=c):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=o+d,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=Qe(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=Ze(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=Qe(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||$e;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||Ye;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=Ze(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,n),e+="...";var r=Qe(this.text.slice(n),this.character).width;return i+this.ellipsisWidth-r}return i}}]),t}();var Os=["width","height","image"].concat(m(pn)),Es=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=Gn,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=Pi(this).image;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updateImageAABBBounds(e,Pi(this).image,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return We[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Os)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Os)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}]),i}(_n);function Ls(t){return new Es(t)}Es.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},xn);var Rs=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=$i(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=$i(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?We.width:e,n=t.height,r=void 0===n?We.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}(Es),Is=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 Rs?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=l,this.directionKey=Ge[this.direction],this.actualWidth=0;var c=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof Cs){var i=Ke.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],c=Math.max(t[h.directionKey.height],c)})),this.height=c,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 Rs?(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 Rs)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var u=Qe("...",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 Rs)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 Rs)break;var r=Qe("...",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 Rs?e.width:e.getWidthWithEllips(t.direction)})),a}}]),t}(),js=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=Ge[this.direction]}return o(t,[{key:"store",value:function(t){if(t instanceof Rs){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 Is(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 Rs?"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=Ze(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 Cs(i,t.newLine,t.character),new Cs(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}(),Ds=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection"].concat(m(pn)),Ns=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=Zn,n}return o(i,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:He.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:He.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:He.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:He.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:He.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:He.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:He.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:He.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"doUpdateAABBBounds",value:function(){var t=Pi(this).richtext;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updateRichTextAABBBounds(e,Pi(this).richtext,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(r);return a&&i.expand(a),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return He[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Ds)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Ds)}},{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,c=i.verticalDirection,d=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 Rs(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 Cs(_[A],0!==A,r[y]));else g.push(new Cs(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 Ms(0,0,(S?o:k?a:0)||0,(w?l:B?s:0)||0,u,h,c,d,f,v||"horizontal",!S&&k,!w&&B,p||!1,null===(t=this._frameCache)||void 0===t?void 0:t.icons),P=new js(T),M=0;M<g.length;M++)P.deal(g[M]);if(P.send(),!("horizontal"===T.layoutDirection?S:w)){var C=T.getActualSizeWidthEllipsis(),O="horizontal"===T.layoutDirection?C.width:C.height;("horizontal"===T.layoutDirection?k:B)&&(O=Math.min(O,"horizontal"===T.layoutDirection?a:s)),T.lines.forEach((function(t){t.calcOffset(O,!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}(_n);function Us(t){return new Ns(t)}Ns.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},xn);var zs=["path","customPath"].concat(m(pn)),Hs=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=$n,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=Pi(this).path;if(!this.valid)return t.path;var i=this.attribute;return i.path instanceof me?i.path:(e.isNil(this.cache)&&this.doUpdatePathShape(),this.cache instanceof me?this.cache:t.path)}},{key:"doUpdateAABBBounds",value:function(){var t=Pi(this).path;this.doUpdatePathShape(),this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updatePathAABBBounds(e,Pi(this).path,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(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 me).fromString(t.path):t.customPath&&(this.cache=new me,t.customPath(this.cache,this))}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Pi(this).path[t]}},{key:"needUpdateTags",value:function(t){return y(h(n.prototype),"needUpdateTags",this).call(this,t,zs)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,zs)}},{key:"toCustomPath",value:function(){return(new me).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}(_n);function Ws(t){return new Hs(t)}Hs.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},xn);var Vs=["segments","points","curveType"].concat(m(pn)),Fs=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=Wn,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=Pi(this).area;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updateAreaAABBBounds(e,Pi(this).area,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(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=Ji(i,n,e))}},{key:"getDefaultAttribute",value:function(t){return Pi(this).area[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,Vs)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,Vs)}},{key:"toCustomPath",value:function(){var t=new me,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}(_n);function Gs(t){return new Fs(t)}Fs.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},xn);var Ys=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(m(pn)),$s=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=zn,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=Pi(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=Pi(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 c=1,d=1;l.length&&(c=Number(l[0]),d=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*c,endAngle:s+u*m*d,sc:u*m*c,ec:u*m*d}}return{startAngle:r,endAngle:s}}},{key:"getParsePadAngle",value:function(t,i){var n=Pi(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,c=this.attribute.padRadius,d=void 0===c?e.sqrt(s*s+l*l):c,f=e.abs(i-t),v=t,p=i,g=t,y=i,b=h/2,m=f,x=f;if(b>e.epsilon&&d>e.epsilon){var _=i>t?1:-1,A=e.asin(Number(d)/l*e.sin(b)),k=e.asin(Number(d)/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=Pi(this).arc;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var i=this.attribute,n=Fe.graphicService.updateArcAABBBounds(i,Pi(this).arc,this._AABBBounds,t,this),r=i.boundsPadding,a=void 0===r?e.boundsPadding:r,s=$i(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,Ys)}},{key:"needUpdateTag",value:function(t){return y(h(n.prototype),"needUpdateTag",this).call(this,t,Ys)}},{key:"getDefaultAttribute",value:function(t){return Pi(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 me;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 c=s*e.cos(n),d=s*e.sin(n),f=a*e.cos(r),v=a*e.sin(r);h.moveTo(0+c,0+d),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}(_n);function Xs(t){return new $s(t)}$s.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},xn);var qs=["points","cornerRadius"].concat(m(pn)),Ks=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=Xn,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=Pi(this).polygon;this._AABBBounds.setValue(1/0,1/0,-1/0,-1/0);var e=this.attribute,i=Fe.graphicService.updatePolygonAABBBounds(e,Pi(this).polygon,this._AABBBounds,this),n=e.boundsPadding,r=void 0===n?t.boundsPadding:n,a=$i(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=Ji(i,n,e))}},{key:"getDefaultAttribute",value:function(t){return Pi(this).polygon[t]}},{key:"needUpdateTags",value:function(t){return y(h(i.prototype),"needUpdateTags",this).call(this,t,qs)}},{key:"needUpdateTag",value:function(t){return y(h(i.prototype),"needUpdateTag",this).call(this,t,qs)}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new me;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}(_n);function Zs(t){return new Ks(t)}Ks.NOWORK_ANIMATE_ATTR=xn;var Js=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,c=void 0===h?o.lineWidth:h;i.expand(u+(s+c)/2)}return i}}]),t}(),Qs=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,c=void 0===h?u.distance:h,d=r.lineWidth;En(i,c+(s+(void 0===d?u.lineWidth:d))/2,!0,l)}return i}}]),i}(Js);var to=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}(),eo=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}(),io=new to,no=new eo,ro=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},ao=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},so=function(t,e){return function(i,n){e(i,n,t)}};function oo(t,e,i){var n,r,a,s,o,l,u,h,c,d,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],c=e[8],d=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]=c,t[9]=d,t[10]=f,t[11]=v,t[12]=n*p+o*g+c*y+e[12],t[13]=r*p+l*g+d*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 lo(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],c=e[8],d=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+_*c+A*p,t[1]=m*r+x*l+_*d+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+_*c+A*p,t[5]=m*r+x*l+_*d+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+_*c+A*p,t[9]=m*r+x*l+_*d+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+_*c+A*p,t[13]=m*r+x*l+_*d+A*g,t[14]=m*a+x*u+_*f+A*y,t[15]=m*s+x*h+_*v+A*b,t}function uo(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,c=r.dx,d=void 0===c?i.dx:c,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,P=void 0===T?i.angle:T,M=r.anchor3d,C=void 0===M?e.attribute.anchor:M,O=r.anchor,E=[0,0,0];if(C){if("string"==typeof C[0]){var L=parseFloat(C[0])/100,R=e.AABBBounds;E[0]=R.x1+(R.x2-R.x1)*L}else E[0]=C[0];if("string"==typeof C[1]){var I=parseFloat(C[1])/100,j=e.AABBBounds;E[1]=j.x1+(j.x2-j.x1)*I}else E[1]=C[1];E[2]=null!==(n=C[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),oo(t,t,[s+d,l+v,h+g]),oo(t,t,[E[0],E[1],E[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],c=e[10],d=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*r+u*n,t[5]=s*r+h*n,t[6]=o*r+c*n,t[7]=l*r+d*n,t[8]=u*r-a*n,t[9]=h*r-s*n,t[10]=c*r-o*n,t[11]=d*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],c=e[10],d=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r-u*n,t[1]=s*r-h*n,t[2]=o*r-c*n,t[3]=l*r-d*n,t[8]=a*n+u*r,t[9]=s*n+h*r,t[10]=o*n+c*r,t[11]=l*n+d*r}(t,t,B),oo(t,t,[-E[0],-E[1],E[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]),P){var D=no.allocate(),N=[0,0];if(O){if("string"==typeof C[0]){var U=parseFloat(C[0])/100,z=e.AABBBounds;N[0]=z.x1+(z.x2-z.x1)*U}else N[0]=C[0];if("string"==typeof C[1]){var H=parseFloat(C[1])/100,W=e.AABBBounds;N[1]=W.x1+(W.x2-W.x1)*H}else N[1]=C[1]}oo(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],c=e[6],d=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*r+u*n,t[1]=s*r+h*n,t[2]=o*r+c*n,t[3]=l*r+d*n,t[4]=u*r-a*n,t[5]=h*r-s*n,t[6]=c*r-o*n,t[7]=d*r-l*n}(D,D,P),oo(D,D,[-N[0],-N[1],0]),lo(t,t,D)}}var ho=function(){function t(i){a(this,t),this.creator=i,this.hooks={onAttributeUpdate:new rt(["graphic"]),onSetStage:new rt(["graphic","stage"]),onRemove:new rt(["graphic"]),onRelease:new rt(["graphic"]),onAddIncremental:new rt(["graphic","group","stage"]),onClearIncremental:new rt(["graphic","group","stage"]),beforeUpdateAABBBounds:new rt(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new rt(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new e.AABBBounds,this.tempAABBBounds2=new e.AABBBounds,this._rectBoundsContribitions=[new Js],this._symbolBoundsContribitions=[new Qs],this._circleBoundsContribitions=[new Js],this._arcBoundsContribitions=[new Js],this._pathBoundsContribitions=[new Js]}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 Tt(t);return Wt(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,c=this.tempAABBBounds2;return h.setValue(i.x1,i.y1,i.x2,i.y2),c.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(c.x1,c.y1,c.x2,c.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,c=void 0===h?e.maxHeight:h,d=t.textAlign,f=void 0===d?e.textAlign:d,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 c&&x>c?c: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,c=t.scaleY,d=void 0===c?i.scaleY:c,f=t.shadowBlur,v=void 0===f?i.shadowBlur:f,p=t.strokeBoundsBuffer,g=void 0===p?i.strokeBoundsBuffer:p;v&&(En(o,v/Math.abs(h+d),!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):Ki(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.innerRadius,a=void 0===r?e.innerRadius:r,s=t.outerRadius,o=void 0===s?e.outerRadius:s;return o<a&&(o=a),i.set(-o,-o,o,o),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,c=void 0===h?i.endAngle:h,d=t.startAngle,f=void 0===d?i.startAngle:d;if(f>c){var v=f;f=c,c=v}return s<=e.epsilon?n.set(0,0,0,0):Math.abs(c-f)>e.pi2-e.epsilon?n.set(-s,-s,s,s):(Ki(f,c,s,n),Ki(f,c,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,c=void 0===h?n.stroke:h,d=t.shadowBlur,f=void 0===d?n.shadowBlur:d,v=t.lineWidth,p=void 0===v?n.lineWidth:v,g=t.pickStrokeBuffer,y=void 0===g?n.pickStrokeBuffer:g,b=t.strokeBoundsBuffer,m=void 0===b?n.strokeBoundsBuffer:b,x=this.tempAABBBounds1,_=this.tempAABBBounds2;c&&p&&(En(x,(p+y)/Math.abs(o+u),r,m),i.union(x),x.setValue(_.x1,_.y1,_.x2,_.y2));if(f){var A=t.shadowOffsetX,k=void 0===A?n.shadowOffsetX:A,B=t.shadowOffsetY,S=void 0===B?n.shadowOffsetY:B;En(x,f/Math.abs(o+u)*2,!1,m+1),x.translate(k,S),i.union(x)}this.combindShadowAABBBounds(i,a);var w=!0,T=a.transMatrix;a&&a.isContainer&&(w=!(1===T.a&&0===T.b&&0===T.c&&1===T.d&&0===T.e&&0===T.f)),w&&e.transformBoundsWithMatrix(i,i,T)}},{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}();ho=ro([D(),so(0,I(er)),ao("design:paramtypes",[Object])],ho);var co,fo=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 vo(t){return co||(co=fo.CreateGraphic("text",{})),co.setAttributes(t),co.AABBBounds}var po={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===St.beforeFillStroke})),this._afterRenderContribitions=this._renderContribitions.filter((function(t){return t.time===St.afterFillStroke})))}},{key:"beforeRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,c,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,c,d)}))}},{key:"afterRenderStep",value:function(t,e,i,n,r,a,s,o,l,u,h,c,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((function(f){f.drawShape(t,e,i,n,r,a,s,o,l,u,h,c,d)}))}},{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,c=void 0===h?e.opacity:h,d=r.fillOpacity,f=void 0===d?e.fillOpacity:d,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(c,f,s),_=Ar(c,y),A=br(s,o),k=mr(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,c=r.scaleX,d=void 0===c?e.scaleX:c,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;po.x=s,po.y=l,po.z=h,po.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===d&&1===v&&0===g&&!y;if(x){var A=no.allocate(),k=no.allocate();uo(k,t,e),lo(A,b||A,k),po.x=0,po.y=0,po.z=0,i.modelMatrix=A,i.setTransform(1,0,0,1,0,0,!0),no.free(k)}if(_&&!b){var B=t.getOffsetXY(e);po.x+=B.x,po.y+=B.y,po.z=h,i.setTransformForCurrent()}else if(x)po.x=0,po.y=0,po.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(m&&i.project){var S=t.getOffsetXY(e);po.x+=S.x,po.y+=S.y,this.transformWithoutTranslate(i,po.x,po.y,po.z,d,v,g)}else i.transformFromMatrix(t.transMatrix,!0),po.x=0,po.y=0,po.z=0;return po}},{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),c={x:0,y:0},d={x:s,y:0},f={x:s,y:o};n.camera=null;var v=1/(c.x*(f.y-d.y)-d.x*f.y+f.x*d.y+(d.x-f.x)*c.y),p=-(c.y*(h.x-u.x)-d.y*h.x+f.y*u.x+(d.y-f.y)*l.x)*v,g=(d.y*h.y+c.y*(u.y-h.y)-f.y*u.y+(f.y-d.y)*l.y)*v,y=(c.x*(h.x-u.x)-d.x*h.x+f.x*u.x+(d.x-f.x)*l.x)*v,b=-(d.x*h.y+c.x*(u.y-h.y)-f.x*u.y+(f.x-d.x)*l.y)*v,m=(c.x*(f.y*u.x-d.y*h.x)+c.y*(d.x*h.x-f.x*u.x)+(f.x*d.y-d.x*f.y)*l.x)*v,x=(c.x*(f.y*u.y-d.y*h.y)+c.y*(d.x*h.y-f.x*u.y)+(f.x*d.y-d.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=Pi(t,null==a?void 0:a.theme)[t.type],u=t.attribute,h=u.fill,c=void 0===h?l.fill:h,d=u.stroke,f=void 0===d?l.stroke:d,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,c),S=Ar(p,_),w=br(c),T=mr(f,m);return!k||!w&&!T||!(B||S||s||o)||(e.beginPath(),Wt(("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&&no.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 bo(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,c=u.y2-u.y1,d=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,c/=b,d/=g,f/=b}var m=t.createLinearGradient(d+(null!==(n=e.x0)&&void 0!==n?n:0)*h,f+(null!==(r=e.y0)&&void 0!==r?r:0)*c,d+(null!==(a=e.x1)&&void 0!==a?a:1)*h,f+(null!==(s=e.y1)&&void 0!==s?s:0)*c);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,c=o.y1-s;if(i.attribute){var d=i.attribute,f=d.scaleX,v=void 0===f?1:f,p=d.scaleY,g=void 0===p?1:p;if(v*g==0)return;l/=v,u/=g,h/=v,c/=g}var y=t.createConicGradient(h+(null!==(n=e.x)&&void 0!==n?n:0)*l,c+(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+c,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,c=i.AABBBounds;if(!c)return;var d=c.x2-c.x1,f=c.y2-c.y1,v=c.x1-u,p=c.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,d/=b,f/=x}var _=t.createRadialGradient(v+(null!==(n=e.x0)&&void 0!==n?n:.5)*d,p+(null!==(r=e.y0)&&void 0!==r?r:.5)*f,Math.max(d,f)*(null!==(a=e.r0)&&void 0!==a?a:0),v+(null!==(s=e.x1)&&void 0!==s?s:.5)*d,p+(null!==(o=e.y1)&&void 0!==o?o:.5)*f,Math.max(d,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 mo=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},xo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_o=function(t,e){return function(i,n){e(i,n,t)}},Ao=function(){function t(){a(this,t),this.time=St.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,c,d){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=Pi(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}(),ko=new Ao,Bo=function(){function t(e){a(this,t),this.subRenderContribitions=e,this.time=St.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,c,d){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,c,d)}))}}]),t}();Bo=mo([D(),_o(0,I(et)),_o(0,N(Dr)),xo("design:paramtypes",[Object])],Bo);var So=function(){function t(){a(this,t),this.time=St.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=ui.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])),ui.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,c,d){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;p&&this.drawTexture(p,t,e,i,n,l,y,m,_)}},{key:"drawTexture",value:function(t,e,i,n,r,a,s,o,l){var u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(o,l,s,i);break;case"diamond":u=this.createDiamondPattern(o,l,s,i);break;case"rect":u=this.createRectPattern(o,l,s,i);break;case"vertical-line":u=this.createVerticalLinePattern(o,l,s,i);break;case"horizontal-line":u=this.createHorizontalLinePattern(o,l,s,i);break;case"bias-lr":u=this.createBiasLRLinePattern(o,l,s,i);break;case"bias-rl":u=this.createBiasRLLinePattern(o,l,s,i);break;case"grid":u=this.createGridPattern(o,l,s,i)}u&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,a),i.fillStyle=u,i.fill(),i.highPerformanceRestore())}}]),t}(),wo=new So,To=new(function(){function t(){a(this,t),this.time=St.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,c){var d=t.attribute,f=d.outerBorder,v=d.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,P=y.x,M=void 0===P?l.x:P,C=y.y,O=void 0===C?l.y:C,E=y.scaleX,L=void 0===E?l.scaleX:E,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(),wr(t,e,i,n,_+z,m-z),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,f,l.outerBorder);else if(j){var W=l.outerBorder.opacity;l.outerBorder.opacity=T,e.setStrokeStyle(t,f,(M-i)/L,(O-n)/I,l.outerBorder),l.outerBorder.opacity=W,e.stroke()}}if(g){var V=v.distance,F=void 0===V?l.innerBorder.distance:V,G=yo(e,F,e.dpr),Y=F/_;if(t.setAttributes({outerRadius:_-G,innerRadius:m+G,startAngle:k+Y,endAngle:S-Y}),e.beginPath(),wr(t,e,i,n,_-G,m+G),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,v,l.innerBorder);else if(D){var $=l.innerBorder.opacity;l.innerBorder.opacity=T,e.setStrokeStyle(t,v,(M-i)/L,(O-n)/I,l.innerBorder),l.innerBorder.opacity=$,e.stroke()}}t.setAttributes({outerRadius:_,innerRadius:m,startAngle:k,endAngle:S})}}}]),t}()),Po=wo,Mo=ko,Co=function(){function t(){a(this,t),this.time=St.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,c){var d=t.attribute,f=d.outerBorder,v=d.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,P=y.y,M=void 0===P?l.y:P,C=y.scaleX,O=void 0===C?l.scaleX:C,E=y.scaleY,L=void 0===E?l.scaleY:E,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),c)c(e,f,l.outerBorder);else if(R){var N=l.outerBorder.opacity;l.outerBorder.opacity=S,e.setStrokeStyle(t,f,(T-i)/O,(M-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),c)c(e,v,l.innerBorder);else if(I){var H=l.innerBorder.opacity;l.innerBorder.opacity=S,e.setStrokeStyle(t,v,(T-i)/O,(M-n)/L,l.innerBorder),l.innerBorder.opacity=H,e.stroke()}}}}}]),t}(),Oo=new Co,Eo=wo,Lo=ko,Ro=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=St.beforeFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,c){var d=t.attribute,f=d.background,v=d.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}(Ao),Io=new Ro,jo=e.pi/2;function Do(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=e.abs(s),s,s,s];else if(Array.isArray(s)){var l,u,h=s;switch(h.length){case 0:o=[0,0,0,0];break;case 1:o=[l=e.abs(h[0]),l,l,l];break;case 2:case 3:o=[l=e.abs(h[0]),u=e.abs(h[1]),l,u];break;default:(o=h)[0]=e.abs(o[0]),o[1]=e.abs(o[1]),o[2]=e.abs(o[2]),o[3]=e.abs(o[3])}}else o=[0,0,0,0];if(r<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(i,n,r,a);var c=[i,n],d=[i+r,n],f=[i+r,n+a],v=[i,n+a],p=Math.min(r/2,a/2),g=[Math.min(p,o[0]),Math.min(p,o[1]),Math.min(p,o[2]),Math.min(p,o[3])],y=[c[0]+g[0],c[1]],b=[c[0],c[1]+g[0]],m=[d[0]-g[1],d[1]],x=[d[0],d[1]+g[1]],_=[f[0]-g[2],f[1]],A=[f[0],f[1]-g[2]],k=[v[0]+g[3],v[1]],B=[v[0],v[1]-g[3]];if(t.moveTo(y[0],y[1]),t.lineTo(m[0],m[1]),!e.arrayEqual(m,x)){var S=m[0],w=m[1]+g[1];t.arc(S,w,g[1],-jo,0,!1)}if(t.lineTo(A[0],A[1]),!e.arrayEqual(_,A)){var T=A[0]-g[2],P=A[1];t.arc(T,P,g[2],0,jo,!1)}if(t.lineTo(k[0],k[1]),!e.arrayEqual(k,B)){var M=k[0],C=k[1]-g[3];t.arc(M,C,g[3],jo,e.pi,!1)}if(t.lineTo(b[0],b[1]),!e.arrayEqual(y,b)){var O=y[0],E=y[1]+g[0];t.arc(O,E,g[0],e.pi,e.pi+jo,!1)}return t.closePath(),t}var No=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).time=St.beforeFillStroke,t}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l,u,h,c,d){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=Pi(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,P=void 0===T?1:T,M=v.cornerRadius,C=void 0===M?0:M,O=v.expandX,E=void 0===O?0:O,L=v.expandY,R=void 0===L?0:L;if(!S&&!w)return;i.beginPath();var I=function(t){var i=$i(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;C?Do(i,j-E,D-R,N+2*E,U+2*R,C):i.rect(j-E,D-R,N+2*E,U+2*R),i.globalAlpha=1,w&&(i.fillStyle=w,i.fill()),S&&P>0&&(i.lineWidth=P,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}(Ao);var Uo=new No,zo=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(){function t(){a(this,t),this.time=St.afterFillStroke,this.useStyle=!0,this.order=0}return o(t,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l,u,h,c,d){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,P=void 0===T?u.scaleX:T,M=b.scaleY,C=void 0===M?u.scaleY:M,O=b.x1,E=b.y1,L=t.attribute,R=L.width,I=L.height;R=(null!=R?R:O-n)||0,I=(null!=I?I:E-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,W=2*U;if(0===x||e.isArray(x)&&x.every((function(t){return 0===t}))?(i.beginPath(),i.rect(z,H,R+W,I+W)):(i.beginPath(),Do(i,z,H,R+W,I+W,x)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),d)d(i,v,u.outerBorder);else if(j){var V=u.outerBorder.opacity;u.outerBorder.opacity=A,i.setStrokeStyle(t,v,(B-n)/P,(w-r)/C,u.outerBorder),u.outerBorder.opacity=V,i.stroke()}}if(y){var F=p.distance,G=yo(i,void 0===F?u.innerBorder.distance:F,i.dpr),Y=n+G,$=r+G,X=2*G;if(0===x||e.isArray(x)&&x.every((function(t){return 0===t}))?(i.beginPath(),i.rect(Y,$,R-X,I-X)):(i.beginPath(),Do(i,Y,$,R-X,I-X,x)),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),d)d(i,p,u.innerBorder);else if(D){var q=u.innerBorder.opacity;u.innerBorder.opacity=A,i.setStrokeStyle(t,p,(B-n)/P,(w-r)/C,u.innerBorder),u.innerBorder.opacity=q,i.stroke()}}}}}]),t}(),Wo=function(){function t(){a(this,t),this.time=St.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,c,d){var f=t.attribute.stroke,v=void 0===f?l.stroke:f;Array.isArray(v)&&v.some((function(t){return!1===t}))&&(d.doStroke=!1)}}]),t}();Wo=zo([D()],Wo);var Vo=function(){function t(){a(this,t),this.time=St.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,c){var d=t.attribute,f=d.width,v=void 0===f?l.width:f,p=d.height,g=void 0===p?l.height:p,y=d.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}();Vo=zo([D()],Vo);var Fo=new Ho,Go=wo,Yo=ko,$o=new(function(){function t(){a(this,t),this.time=St.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,c){var d=t.getParsedPath();if(d){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,P=void 0===T?l.scaleX:T,M=b.scaleY,C=void 0===M?l.scaleY:M,O=!(!v||!v.stroke),E=!(!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===d.drawOffset(e,x,i,n,R)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,v,l.outerBorder);else if(O){var I=l.outerBorder.opacity;l.outerBorder.opacity=A,e.setStrokeStyle(t,v,(B-i)/P,(w-n)/C,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===d.drawOffset(e,x,i,n,-D)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,p,l.innerBorder);else if(E){var N=l.innerBorder.opacity;l.innerBorder.opacity=A,e.setStrokeStyle(t,p,(B-i)/P,(w-n)/C,l.innerBorder),l.innerBorder.opacity=N,e.stroke()}}}}}}]),t}()),Xo=wo,qo=ko,Ko=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=St.afterFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,c,d){var f,v,p,g;this.textureMap||this.initTextureMap(e,t.stage);var y=(d||{}).attribute,b=void 0===y?t.attribute:y,m=b.texture,x=void 0===m?null!==(f=t.attribute.texture)&&void 0!==f?f:Qi(l,"texture"):m,_=b.textureColor,A=void 0===_?null!==(v=t.attribute.textureColor)&&void 0!==v?v:Qi(l,"textureColor"):_,k=b.textureSize,B=void 0===k?null!==(p=t.attribute.textureSize)&&void 0!==p?p:Qi(l,"textureSize"):k,S=b.texturePadding,w=void 0===S?null!==(g=t.attribute.texturePadding)&&void 0!==g?g:Qi(l,"texturePadding"):S;x&&this.drawTexture(x,t,e,i,n,l,A,B,w)}}]),i}(So),Zo=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},Jo=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qo=function(t,e){return function(i,n){e(i,n,t)}},tl=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=zn,e.builtinContributions=[To,Mo,Po],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(),c=h.startAngle,d=h.endAngle;d=l;var f=e.abs(d-c),v=d>c,p=!1;if(a<s){var g=a;a=s,s=g}var y=t.getParsedCornerRadius(),b=t.getParsePadAngle(c,d);b.outerDeltaAngle;var m,x,_,A,k=b.innerDeltaAngle,B=b.outerStartAngle,S=b.outerEndAngle,w=b.innerEndAngle,T=b.innerStartAngle,P=y,M=y,C=y,O=y,E=Math.max(M,P),L=Math.max(C,O),R=E,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||E>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=Br(j,D,_,A,m,x,N,U);if(z){var H=j-z[0],W=D-z[1],V=m-z[0],F=x-z[1],G=1/e.sin(e.acos((H*V+W*F)/(e.sqrt(H*H+W*W)*e.sqrt(V*V+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(E,(a-Y)/(G+1))}}if(R>e.epsilon){var $=e.min(P,R),X=e.min(M,R),q=Sr(_,A,j,D,a,$,Number(v)),K=Sr(m,x,N,U,a,X,Number(v));if(R<E&&$===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=d-u-.03,J=e.atan2(K.y11,K.x11);i.arc(n,r,a,Z,J,!v),X>0&&i.arc(n+K.cx,r+K.cy,X,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(O,I),tt=e.min(C,I),et=Sr(N,U,m,x,s,-tt,Number(v)),it=Sr(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=d-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=Pi(t,null==s?void 0:s.theme).arc,h=t.attribute,c=h.fill,d=void 0===c?u.fill:c,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,P=void 0===T?u.innerRadius:T,M=B.cap,C=void 0===M?u.cap:M,O=B.forceShowCap,E=void 0===O?u.forceShowCap:O,L=0,R=(e.isBoolean(C)&&C||C[0])&&"conical"===d.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,d.startAngle-=L,d.endAngle-=L)}var U=!1,z=function(t){var i,n=!0;if(e.isBoolean(t,!0)){for(var r=0;r<4;r++)Gi[r]=t,n&&(n=!(null!==(i=Gi[r])&&void 0!==i&&!i));n=t}else if(Array.isArray(t))for(var a=0;a<4;a++)Gi[a]=!!t[a],n&&(n=!!Gi[a]);else Gi[0]=!1,Gi[1]=!1,Gi[2]=!1,Gi[3]=!1;return{isFullStroke:n,stroke:Gi}}(v),H=z.isFullStroke,W=z.stroke;if((A||H)&&(i.beginPath(),wr(t,i,n,r,w,P),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(),wr(t,i,n,r,w,P,W),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(C)&&C||C[1])&&E){var V=t.getParsedAngle(),F=V.startAngle,G=V.endAngle;if(e.abs(G-F)>=e.pi2-e.epsilon){i.beginPath();var Y=Math.abs(w-P)/2/w,$=t.attribute,X=$.endAngle,q=void 0===X?u.endAngle:X,K=$.fill,Z=void 0===K?u.fill:K,J=q;if(this.drawArcTailCapPath(t,i,n,r,w,P,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),c=0;c<a.length;c++)if(a[c].offset>=h){l=a[c-1],u=a[c];break}return h=(h-l.offset)/(u.offset-l.offset),ln(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&&(d.startAngle+=L,d.endAngle+=L)}}},{key:"draw",value:function(t,e,i,n){var r=Pi(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}}]),n}(go);tl=Zo([D(),Qo(0,I(et)),Qo(0,N(Tr)),Jo("design:paramtypes",[Object])],tl);var el=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},il=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},nl=function(t,e){return function(i,n){e(i,n,t)}},rl=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=Vn,n.builtinContributions=[Oo,Lo,Eo],n.init(t),n}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l=Pi(t,null==a?void 0:a.theme).circle,u=t.attribute,h=u.radius,c=void 0===h?l.radius:h,d=u.startAngle,f=void 0===d?l.startAngle:d,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,c,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=Pi(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}}]),i}(go);function al(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 c=b($t(e,i),1)[0];t.bezierCurveTo(s+c.p1.x,l+c.p1.y,s+c.p2.x,l+c.p2.y,s+c.p3.x,l+c.p3.y,h)}else{var d=e.getPointAt(i);t.lineTo(s+d.x,l+d.y,h)}}}function sl(t,i,n,r,a){var s,o=a||{},l=o.offsetX,u=void 0===l?0:l,h=o.offsetY,c=void 0===h?0:h,d=o.offsetZ,f=void 0===d?0:d,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+c,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+c,f)}else a&&(_=!_,t.lineTo(a.x+u,a.y+c,f))}x=e}else x=e}))}else m.forEach((function(e){e.defined?(b&&t.moveTo(e.p0.x+u,e.p0.y+c,f),al(t,e,1,a),b=!1):b=!0}));else if(!(n<=0)){var A;"x"===r?A=kt.ROW:"y"===r?A=kt.COLUMN:"auto"===r&&(A=i.direction);for(var k=n*i.tryUpdateLength(A),B=0,S=!0,w=null,T=0,P=m.length;T<P;T++){var M=m[T],C=M.getLength(A),O=(k-B)/C;if(B+=C,O<0)break;if(y){var E=M.p0;if(M.originP1===M.originP2){w=M;continue}if(w&&w.originP1===w.originP2&&(E=w.p0),M.defined)S||(t.lineTo(E.x+u,E.y+c,f),S=!S);else{var L=M.originP1,R=M.originP2,I=void 0;if(L&&!1!==L.defined?I=E:L&&!1!==R.defined&&(I=null!==(s=M.p3)&&void 0!==s?s:M.p1),S){S=!S;var j=I?I.x:M.p0.x,D=I?I.y:M.p0.y;t.moveTo(j+u,D+c,f)}else I&&(S=!S,t.lineTo(I.x+u,I.y+c,f))}w=M}else{if(!M.defined){b=!0;continue}b&&t.moveTo(M.p0.x+u,M.p0.y+c,f),al(t,M,e.min(O,1),a),b=!1}}}}}rl=el([D(),nl(0,I(et)),nl(0,N(Mr)),il("design:paramtypes",[Object])],rl);var ol=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},ll=function(t){u(n,t);var i=g(n);function n(){var t;return a(this,n),(t=i.apply(this,arguments)).numberType=Yn,t}return o(n,[{key:"draw",value:function(t,e,i,n){var r=Pi(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,c,d,f,v,p){var g,y,b,m,x;if(i){t.beginPath();var _=null!==(g=this.z)&&void 0!==g?g:0;sl(t.camera?t:t.nativeContext,i,u,h,{offsetX:c,offsetY:d,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-c,S-d,l),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,o,k-c,S-d,l),t.stroke()));var w=o.connectedType,T=o.connectedX,P=o.connectedY,M=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,P=null!==(m=null!=P?P:l[0].connectedY)&&void 0!==m?m:l[1].connectedY,M=null!==(x=null!=M?M:l[0].connectedStyle)&&void 0!==x?x:l[1].connectedStyle):(w=null!=w?w:l.connectedType,T=null!=T?T:l.connectedX,P=null!=P?P:l.connectedY,M=null!=M?M:l.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),"none"!==w){t.beginPath(),sl(t.camera?t:t.nativeContext,i,u,h,{offsetX:c,offsetY:d,offsetZ:_,drawConnect:!0,mode:w,zeroX:T,zeroY:P});var C=[];e.isArray(l)?l.forEach((function(t){return C.push(t)})):C.push(l),C.push(o),!1!==n&&(v?v(t,o,l):a&&(t.setCommonStyle(f,M,k-c,S-d,C),t.fill())),!1!==r&&(p?p(t,o,l):s&&(t.setStrokeStyle(f,M,k-c,S-d,C),t.stroke()))}return!1}}},{key:"drawLinearLineHighPerformance",value:function(t,e,i,n,r,a,s,o,l,u,h,c,d){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+s,g.y+o,v);for(var y=1;y<p.length;y++){var b=p[y];e.lineTo(b.x+s,b.y+o,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&&(c?c(e,t.attribute,l):r&&(e.setCommonStyle(t,t.attribute,_-s,k-o,l),e.fill())),!1!==n&&(d?d(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=Pi(t,null==s?void 0:s.theme).line,c=t.attribute,d=c.fill,f=void 0===d?h.fill:d,v=c.stroke,p=void 0===v?h.stroke:v,g=c.fillOpacity,y=void 0===g?h.fillOpacity:g,b=c.strokeOpacity,m=void 0===b?h.strokeOpacity:b,x=c.segments,_=c.points,A=c.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,P=S.clipRangeByDimension,M=void 0===P?h.clipRangeByDimension:P;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 C=t.attribute,O=C.points,E=C.segments,L=O;if(E&&E.length){var R,I;if(t.cache=E.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=be(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(!O||!O.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=be(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,M,n,r,t,o,l))}))}else{var W=t.cache.reduce((function(t,e){return t+e.getLength()}),0),V=T*W,F=0,G=!1;t.cache.forEach((function(a,s){if(!G){var c=a.getLength(),d=(V-F)/c;F+=c,d>0&&(G=u.drawSegmentItem(i,a,!!f,!!p,y,m,z[s],[h,t.attribute],e.min(d,1),M,n,r,t,o,l))}}))}}else this.drawSegmentItem(i,t.cache,!!f,!!p,y,m,t.attribute,h,T,M,n,r,t,o,l)}}}]),n}(go);function ul(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 c=e[0];t.moveTo(c.p0.x+s,c.p0.y+l,h);var d=(c=e[e.length-1]).p3||c.p1;t.lineTo(d.x+s,d.y+l,h),c=i[i.length-1],t.lineTo(c.p0.x+s,c.p0.y+l,h),d=(c=i[0]).p3||c.p1,t.lineTo(d.x+s,d.y+l,h),t.closePath()}}function hl(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,c=!0;e.forEach((function(e){e.defined?(c&&t.moveTo(e.p0.x+s,e.p0.y+l,h),al(t,e,1,n),c=!1):c=!0})),c=!0;for(var d=i.length-1;d>=0;d--){var f=i[d];f.defined?(c&&t.lineTo(f.p0.x+s,f.p0.y+l,h),al(t,f,1,n),c=!1):c=!0}t.closePath()}ll=ol([D()],ll);var cl=new Ko,dl=ko,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},vl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pl=function(t,e){return function(i,n){e(i,n,t)}};function gl(t,e,i){switch(e){case"linear":default:return ie(t,i);case"basis":return ae(t,i);case"monotoneX":return de(t,i);case"monotoneY":return fe(t,i);case"step":return pe(t,.5,i);case"stepBefore":return pe(t,0,i);case"stepAfter":return pe(t,1,i);case"linearClosed":return ye(t,i)}}var yl=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=Wn,e.builtinContributions=[cl,dl],e.init(t),e}return o(n,[{key:"drawLinearAreaHighPerformance",value:function(t,i,n,r,a,s,o,l,u,h,c,d,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+o,_.y+l,m);for(var A=1;A<x.length;A++){var k=x[A];i.lineTo(k.x+o,k.y+l,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)+o,(null!==(g=S.y1)&&void 0!==g?g:S.y)+l,m)}i.closePath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,i,o,l,!!a,!1,n,!1,u,h,d,null,{attribute:t.attribute});var w=t.attribute,T=w.x,P=void 0===T?0:T,M=w.x,C=void 0===M?0:M;if(!1!==n&&(d?d(i,t.attribute,u):a&&(i.setCommonStyle(t,t.attribute,P-o,C-l,u),i.fill())),this.afterRenderStep(t,i,o,l,!!a,!1,n,!1,u,h,d,null,{attribute:t.attribute}),r){var O=t.attribute.stroke,E=void 0===O?u&&u.stroke:O;if(e.isArray(E)&&(E[0]||E[2])&&!1===E[1])if(i.beginPath(),E[0]){i.moveTo(_.x+o,_.y+l,m);for(var L=1;L<x.length;L++){var R=x[L];i.lineTo(R.x+o,R.y+l,m)}}else if(E[2]){var I=x[x.length-1];i.moveTo(I.x+o,I.y+l,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)+o,(null!==(b=D.y1)&&void 0!==b?b:D.y)+l,m)}}f?f(i,t.attribute,u):(i.setStrokeStyle(t,t.attribute,P-o,C-l,u),i.stroke())}}},{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h,c,d,f,v,p=this,g=Pi(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 P=T.doFill,M=T.doStroke,C=t.attribute,O=C.clipRange,E=void 0===O?g.clipRange:O,L=C.closePath,R=C.points,I=C.segments,j=t.attribute.curveType,D=void 0===j?g.curveType:j;if(L&&"linear"===D&&(D="linearClosed"),1===E&&!I&&!R.some((function(t){return!1===t.defined}))&&"linear"===D)return this.drawLinearAreaHighPerformance(t,i,!!m,M,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=gl(t.points,D,{startPoint:N});return U=i,i})).filter((function(t){return!!t})),W=[],V=I.length-1;V>=0;V--){for(var F=I[V].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!==V){var $=I[V-1].points,X=$[$.length-1];X&&G.push({x:null!==(c=X.x1)&&void 0!==c?c:X.x,y:null!==(d=X.y1)&&void 0!==d?d:X.y})}G.length>1&&(z=gl(G,"stepBefore"===D?"stepAfter":"stepAfter"===D?"stepBefore":D),W.unshift(z))}t.cacheArea=W.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=gl(q,D),Q=gl(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===E){var et=!1;t.cacheArea.forEach((function(e,s){et||(et=p.drawSegmentItem(i,e,P,A,M,w,tt[s],[g,t.attribute],E,n,r,B,t,a,o,l))}))}else{var it=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),nt=E*it,rt=0,at=!1;t.cacheArea.forEach((function(s,u){if(!at){var h=s.top.getLength(),c=(nt-rt)/h;rt+=h,c>0&&(at=p.drawSegmentItem(i,s,P,A,M,w,tt[u],[g,t.attribute],e.min(c,1),n,r,B,t,a,o,l))}}))}}else this.drawSegmentItem(i,t.cacheArea,P,A,M,w,t.attribute,g,E,n,r,B,t,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Pi(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,c,d,f,v,p){var g=!1;return g=(g=g||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,c,d,f,!1,v,p))||this._drawSegmentItem(t,e,i,n,r,a,s,o,l,u,h,c,d,f,!0,v,p)}},{key:"_drawSegmentItem",value:function(t,i,n,r,a,s,o,l,u,h,c,d,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,P,M=f.attribute,C=M.points,O=M.segments,E=kt.ROW;if(O){var L=O[O.length-1];P=O[0].points[0],T=L.points[L.points.length-1]}else P=C[0],T=C[C.length-1];E=e.abs(T.x-P.x)>e.abs(T.y-P.y)?kt.ROW:kt.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,c=i.bottom;if(h.curves.length===c.curves.length)if(n>=1){var d=[],f=[],v=!0;if(l){var p,g,y=!0,b=h.curves.length;h.curves.forEach((function(e,i){var n=c.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||(d.push(a),f.push(s),ul(t,d,f,r),d.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,d.push(o||e),f.push(l||n)):o&&(y=!y,d.push(o||e),f.push(l||n),ul(t,d,f,r),d.length=0,f.length=0)}p=e})),ul(t,d,f,r)}else{for(var m=0,x=h.curves.length;m<x;m++){var _=h.curves[m];v!==_.defined?(v?(hl(t,d,f,r),d.length=0,f.length=0):(d.push(_),f.push(c.curves[x-m-1])),v=!v):v&&(d.push(_),f.push(c.curves[x-m-1]))}hl(t,d,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?kt.ROW:kt.COLUMN,Number.isFinite(S)||(A=kt.COLUMN),Number.isFinite(w)||(A=kt.ROW);for(var T,P,M=n*(A===kt.ROW?S:w),C=0,O=!0,E=[],L=[],R=!0,I=0,j=h.curves.length;I<j;I++){var D=h.curves[I],N=D.getLength(A),U=(M-C)/N;if(U<0)break;if(C+=N,l){var z=c.curves[j-I-1],H=D,W=z;if(D.originP1===D.originP2){T=D,P=z;continue}if(T&&T.originP1===T.originP2&&(H=T,W=P),D.defined)R||(E.push(H),L.push(W),ul(t,E,L,r),E.length=0,L.length=0,R=!R);else{var V=D.originP1,F=D.originP2,G=void 0,Y=void 0;V&&!1!==V.defined?(G=H,Y=W):V&&!1!==F.defined&&(G=D,Y=z),R?(R=!R,E.push(G||D),L.push(Y||z)):G&&(R=!R,E.push(G||D),L.push(Y||z),ul(t,E,L,r),E.length=0,L.length=0)}T=D}else{var $=null,X=null;O!==D.defined?(O?(hl(t,E,L,r),E.length=0,L.length=0):($=D,X=c.curves[j-I-1]),O=!O):O&&($=D,X=c.curves[j-I-1]),$&&X&&(U<1&&($=$.p2&&$.p3?$t($,U)[0]:qt($,U)[0],X=X.p2&&X.p3?$t(X,1-U)[1]:qt(X,1-U)[1]),$.defined=O,X.defined=O,E.push($),L.push(X)),$=null,X=null}}l?ul(t,E,L,r):hl(t,E,L,r)}}}(t.camera?t:t.nativeContext,i,u,{offsetX:h,offsetY:c,offsetZ:d,direction:E,drawConnect:p,mode:A,zeroX:k,zeroY:B}),this.beforeRenderStep(f,t,h,c,!!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-c,p?w:l),t.fill())),this.afterRenderStep(f,t,h,c,!!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(),sl(t.camera?t:t.nativeContext,U[0]?i.top:i.bottom,u,E===kt.ROW?"x":"y",{offsetX:h,offsetY:c,offsetZ:d,drawConnect:p,mode:A,zeroX:k,zeroY:B})),t.setStrokeStyle(f,p?S:o,I-h,D-c,p?w:l),t.stroke()}return!1}}}]),n}(go);yl=fl([D(),pl(0,I(et)),pl(0,N(Pr)),vl("design:paramtypes",[Object])],yl);var bl=wo,ml=ko,xl=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},_l=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Al=function(t,e){return function(i,n){e(i,n,t)}},kl=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=$n,n.builtinContributions=[ml,bl],n.init(t),n}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o){var l,u,h,c=null!==(l=this.tempTheme)&&void 0!==l?l:Pi(t,null==a?void 0:a.theme).path,d=t.attribute,f=d.x,v=void 0===f?c.x:f,p=d.y,g=void 0===p?c.y:p,y=null!==(u=this.z)&&void 0!==u?u:0,b=this.valid(t,c,s,o);if(b){var m=b.fVisible,x=b.sVisible,_=b.doFill,A=b.doStroke;if(e.beginPath(),t.pathShape)Wt(t.pathShape.commandList,e,i,n,1,1,y);else Wt((null!==(h=t.attribute.path)&&void 0!==h?h:c.path).commandList,e,i,n,1,1,y);e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,n,_,A,m,x,c,r,s,o),A&&(o?o(e,t.attribute,c):x&&(e.setStrokeStyle(t,t.attribute,v-i,g-n,c),e.stroke())),_&&(s?s(e,t.attribute,c):m&&(e.setCommonStyle(t,t.attribute,v-i,g-n,c),e.fill())),this.afterRenderStep(t,e,i,n,_,A,m,x,c,r,s,o)}}},{key:"draw",value:function(t,e,i,n){var r=Pi(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}]),i}(go);kl=xl([D(),Al(0,I(et)),Al(0,N(Er)),_l("design:paramtypes",[Object])],kl);var Bl=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},Sl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},wl=function(t,e){return function(i,n){e(i,n,t)}},Tl=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=qn,e.builtinContributions=[Fo,Yo,Go],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:Pi(t,null==s?void 0:s.theme).rect,c=t.attribute,d=c.fill,f=void 0===d?h.fill:d,v=c.background,p=c.stroke,g=void 0===p?h.stroke:p,y=c.cornerRadius,b=void 0===y?h.cornerRadius:y,m=c.opacity,x=void 0===m?h.opacity:m,_=c.fillOpacity,A=void 0===_?h.fillOpacity:_,k=c.lineWidth,B=void 0===k?h.lineWidth:k,S=c.strokeOpacity,w=void 0===S?h.strokeOpacity:S,T=c.visible,P=void 0===T?h.visible:T,M=c.x1,C=c.y1,O=c.x,E=void 0===O?h.x:O,L=c.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:M-E)||0,D=(null!=D?D:C-R)||0,f),U=kr(x,w,j,D),z=br(f,v),H=mr(g,B);if(t.valid&&P&&(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(),Do(i,n,r,j,D,b));var W={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,W),W.doFill&&(o?o(i,t.attribute,h):N&&(i.setCommonStyle(t,t.attribute,E-n,R-r,h),i.fill())),W.doStroke&&(l?l(i,t.attribute,h):U&&(i.setStrokeStyle(t,t.attribute,E-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=Pi(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}}]),n}(go);Tl=Bl([D(),wl(0,I(et)),wl(0,N(Rr)),Sl("design:paramtypes",[Object])],Tl);var Pl=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},Ml=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)}},Ol=function(t){u(n,t);var i=g(n);function n(t){var e;return a(this,n),(e=i.call(this)).symbolRenderContribitions=t,e.numberType=Jn,e.builtinContributions=[$o,qo,Xo],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h=Pi(t,null==s?void 0:s.theme).symbol,c=t.attribute,d=c.size,f=void 0===d?h.size:d,v=c.x,p=void 0===v?h.x:v,g=c.y,y=void 0===g?h.y:g,b=c.scaleX,m=void 0===b?h.scaleX:b,x=c.scaleY,_=void 0===x?h.scaleY:x,A=this.valid(t,h,o,l);if(A){var k=A.fVisible,B=A.sVisible,S=A.doFill,w=A.doStroke,T=t.getParsedPath();if(T){var P=t.attribute.keepDirIn3d,M=void 0===P?h.keepDirIn3d:P,C=null!==(u=this.z)&&void 0!==u?u:0;if(i.beginPath(),M&&i.camera&&i.project){var O=i.project(n,r,C),E=i.camera;i.camera=null,!1===T.draw(i,e.isArray(f)?[f[0]*m,f[1]*_]:f*m,O.x,O.y,void 0,(function(e,a){var s,u,c;if(t._parsedPath.svgCache){var d=Object.assign({},a);d.fill=null!==(s=a.fill)&&void 0!==s?s:t.attribute.fill,d.opacity=null!==(u=a.fill)&&void 0!==u?u:t.attribute.opacity,d.fillOpacity=t.attribute.fillOpacity,d.stroke=null!==(c=a.stroke)&&void 0!==c?c:t.attribute.stroke,a=d}a.fill&&(o?o(i,t.attribute,h):(i.setCommonStyle(t,a,p-n,y-r,h),i.fill())),a.stroke&&(l?l(i,t.attribute,h):(i.setStrokeStyle(t,a,(p-n)/m,(y-r)/_,h),i.stroke()))}))&&i.closePath(),i.camera=E}else!1===T.draw(i,f,n,r,C,(function(e,a){var s,u,c;if(t._parsedPath.svgCache){var d=Object.assign({},a);d.fill=null!==(s=a.fill)&&void 0!==s?s:t.attribute.fill,d.opacity=null!==(u=a.opacity)&&void 0!==u?u:t.attribute.opacity,d.fillOpacity=t.attribute.fillOpacity,d.stroke=null!==(c=a.stroke)&&void 0!==c?c:t.attribute.stroke,a=d}a.fill&&(o?o(i,t.attribute,h):(i.setCommonStyle(t,a,p-n,y-r,h),i.fill())),a.stroke&&(l?l(i,t.attribute,h):(i.setStrokeStyle(t,a,(p-n)/m,(y-r)/_,h),i.stroke()))}))&&i.closePath();i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,i,n,r,S,w,k,B,h,a,o,l),S&&!T.isSvg&&(o?o(i,t.attribute,h):k&&(i.setCommonStyle(t,t.attribute,p-n,y-r,h),i.fill())),w&&!T.isSvg&&(l?l(i,t.attribute,h):B&&(i.setStrokeStyle(t,t.attribute,(p-n)/m,(y-r)/_,h),i.stroke())),this.afterRenderStep(t,i,n,r,S,w,k,B,h,a,o,l)}}}},{key:"draw",value:function(t,e,i,n){var r=Pi(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}}]),n}(go);Ol=Pl([D(),Cl(0,I(et)),Cl(0,N(Ir)),Ml("design:paramtypes",[Object])],Ol);var El=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).time=St.beforeFillStroke,t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r,a,s,o,l,u,h,c){var d=t.attribute,f=d.background,v=d.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}(Ao),Ll=new El,Rl=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},Il=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jl=function(t,e){return function(i,n){e(i,n,t)}},Dl=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=Qn,e.builtinContributions=[Ll],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u,h,c,d=this,f=Pi(t,null==s?void 0:s.theme).text,v=t.attribute;v.text;var p=v.underline,g=void 0===p?f.underline:p,y=v.lineThrough,b=void 0===y?f.lineThrough:y,m=v.keepDirIn3d,x=void 0===m?f.keepDirIn3d:m,_=v.direction,A=void 0===_?f.direction:_,k=v.whiteSpace;void 0===k&&f.whiteSpace;var B=v.fontSize,S=void 0===B?f.fontSize:B,w=v.verticalMode,T=void 0===w?f.verticalMode:w,P=v.x,M=void 0===P?f.x:P,C=v.y,O=void 0===C?f.y:C,E=t.attribute,L=E.textAlign,R=void 0===L?f.textAlign:L,I=E.textBaseline,j=void 0===I?f.textBaseline:I;if(!T&&"vertical"===A){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!==(c=rn(t.attribute.lineHeight,S))&&void 0!==c?c:S,U=this.valid(t,f,o,l);if(U){var z=U.fVisible,H=U.sVisible,W=U.doFill,V=U.doStroke,F=!x,G=this.z||0;i.beginPath(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,f),this.beforeRenderStep(t,i,n,r,W,V,z,H,f,a,o,l),F&&this.transformUseContext2d(t,f,G,i);var Y=function(e,a,s,u){var h=n+a,c=r+s;if(u){i.highPerformanceSave(),h+=S;var v=io.allocate(1,0,0,1,0,0);v.rotateByCenter(Math.PI/2,h,c),i.transformFromMatrix(v,!0),io.free(v)}V&&(l?l(i,t.attribute,f):H&&(i.setStrokeStyle(t,t.attribute,M-n,O-r,f),i.strokeText(e,h,c,G))),W&&(o?o(i,t.attribute,f):z&&(i.setCommonStyle(t,t.attribute,M-n,O-r,f),i.fillText(e,h,c,G),d.drawUnderLine(g,b,t,h,c,G,f,i))),u&&(i.highPerformanceRestore(),i.setTransformForCurrent())};if(t.isMultiLine)if(i.setTextStyleWithoutAlignBaseline(t.attribute,f,G),"horizontal"===A){var $=t.multilineLayout;if(!$)return void i.highPerformanceRestore();var X=$.bbox,q=X.xOffset,K=X.yOffset;V&&(l?l(i,t.attribute,f):H&&(i.setStrokeStyle(t,t.attribute,M-n,O-r,f),$.lines.forEach((function(t){i.strokeText(t.str,(t.leftOffset||0)+q+n,(t.topOffset||0)+K+r,G)})))),W&&(o?o(i,t.attribute,f):z&&(i.setCommonStyle(t,t.attribute,M-n,O-r,f),$.lines.forEach((function(e){i.fillText(e.str,(e.leftOffset||0)+q+n,(e.topOffset||0)+K+r,G),d.drawMultiUnderLine(g,b,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"===A){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,W,V,z,H,f,a,o,l)}}},{key:"draw",value:function(t,e,i,n){var r=Pi(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,c=l.textBaseline,d=void 0===c?s.textBaseline:c,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=Hr(h,_),k=Wr(d,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,c=void 0===h?o.textAlign:h,d=u.fontSize,f=void 0===d?o.fontSize:d,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=Hr(c,s),_=Wr("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);function Nl(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 Ul(t,e){return Math.sqrt(t*t+e*e)}function zl(t,e,i,n,r){var a=e/i;return{x:t.x-n*a,y:t.y-r*a}}Dl=Rl([D(),jl(0,I(et)),jl(0,N(jr)),Il("design:paramtypes",[Object])],Dl);var Hl=wo,Wl=ko,Vl=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},Fl=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gl=function(t,e){return function(i,n){e(i,n,t)}},Yl=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=Xn,e.builtinContributions=[Wl,Hl],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Pi(t,null==s?void 0:s.theme).polygon,h=t.attribute,c=h.points,d=void 0===c?u.points:c,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}))?Nl(i.camera?i:i.nativeContext,d,n,r):function(t,e,i,n,r){var a,s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e.length<3)Nl(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],c=e[u%e.length],d=e[(u+1)%e.length],f=c.x-h.x,v=c.y-h.y,p=c.x-d.x,g=c.y-d.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,_=Ul(f,v),A=Ul(p,g),k=Math.min(_,A);x>k&&(x=k,m=k*b);var B=zl(c,x,_,f,v),S=zl(c,x,A,p,g),w=2*c.x-B.x-S.x,T=2*c.y-B.y-S.y,P=Ul(w,T),M=zl(c,Ul(x,m),P,w,T),C=Math.atan2(B.y-M.y,B.x-M.x),O=Math.atan2(S.y-M.y,S.x-M.x),E=O-C;E<0&&(C=O,E=-E),E>Math.PI&&(E-=Math.PI),0===u?t.moveTo(B.x+i,B.y+n):t.lineTo(B.x+i,B.y+n),E&&t.arcTo(c.x+i,c.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,d,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=Pi(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}}]),n}(go);Yl=Vl([D(),Gl(0,I(et)),Gl(0,N(Lr)),Fl("design:paramtypes",[Object])],Yl);var $l=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},Xl=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)}},Kl=["","repeat-x","repeat-y","repeat"],Zl=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=Gn,e.builtinContributions=[Uo],e.init(t),e}return o(n,[{key:"drawShape",value:function(t,i,n,r,a,s,o){var l=Pi(t).image,u=t.attribute,h=u.width,c=void 0===h?l.width:h,d=u.height,f=void 0===d?l.height:d,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(),Do(i,n,r,c,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,Kl[w]);i.fillStyle=T,i.translate(n,r,!0),i.fillRect(0,0,c,f),i.translate(-n,-r,!0)}else i.drawImage(B.data,n,r,c,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=Pi(t).image;this._draw(t,r,!1,i)}}}]),n}(go);Zl=$l([D(),ql(0,I(et)),ql(0,N(Or)),Xl("design:paramtypes",[Object])],Zl);var Jl=Symbol.for("IncrementalDrawContribution"),Ql=Symbol.for("ArcRender"),tu=Symbol.for("AreaRender"),eu=Symbol.for("CircleRender"),iu=Symbol.for("GraphicRender"),nu=Symbol.for("GroupRender"),ru=Symbol.for("LineRender"),au=Symbol.for("PathRender"),su=Symbol.for("PolygonRender"),ou=Symbol.for("RectRender"),lu=Symbol.for("SymbolRender"),uu=Symbol.for("TextRender"),hu=Symbol.for("RichTextRender"),cu=Symbol.for("ImageRender"),du=Symbol.for("DrawContribution"),fu=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},vu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pu=function(t,e){return function(i,n){e(i,n,t)}},gu=Symbol.for("RenderService"),yu=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}();yu=fu([D(),pu(0,I(du)),vu("design:paramtypes",[Object])],yu);var bu=new B((function(t){t(gu).to(yu).inSingletonScope()})),mu=Symbol.for("PickerService"),xu=Symbol.for("GlobalPickerService"),_u=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},Au=Symbol.for("PickItemInterceptor"),ku=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=io.allocateByObj(s),h=new e.Point(u.a*n.x+u.c*n.y+u.e,u.b*n.x+u.d*n.y+u.f),c=i.pickGroup(l,h,u,r);return o.highPerformanceRestore(),c}}]),t}();ku=_u([D()],ku);var Bu=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}();Bu=_u([D()],Bu);var Su=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===Hn)})),t.forEachChildren((function(t){return!(h=!!t.findFace)})),u){var c=t.getChildren(),d=m(c);d.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})),d.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),d.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(),c.forEach((function(t){t._next=null,t._prev=null})),c.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}();Su=_u([D()],Su);var wu=new B((function(t,e,i){i(mu)||(t(xu).toSelf(),t(mu).toService(xu)),t(Su).toSelf().inSingletonScope(),t(Au).toService(Su),t(ku).toSelf().inSingletonScope(),t(Au).toService(ku),t(Bu).toSelf().inSingletonScope(),t(Au).toService(Bu),nt(t,Au)})),Tu=new B((function(t){t(tr).to(ho).inSingletonScope(),t(er).toConstantValue(fo)})),Pu=Symbol.for("AutoEnablePlugins"),Mu=Symbol.for("PluginService"),Cu=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},Ou=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Eu=function(t,e){return function(i,n){e(i,n,t)}},Lu=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&&ai.isBound(Pu)&&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:"unRegister",value:function(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(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}();Lu=Cu([D(),Eu(0,I(et)),Eu(0,N(Pu)),Ou("design:paramtypes",[Object])],Lu);var Ru=new B((function(t){t(Mu).to(Lu),function(t,e){t(et).toDynamicValue((function(t){var i=t.container;return new it(e,i)})).whenTargetNamed(e)}(t,Pu)})),Iu=new B((function(t){nt(t,at)})),ju=new B((function(t){t(ni).to(ri).inSingletonScope(),nt(t,ni)})),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},Nu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uu=function(){function t(){a(this,t),this.type="static",this.offscreen=!1,this.global=Fe.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,i.canvasId&&(n=this.global.getElementById(i.canvasId)),n||(n=this.global.createCanvas({width:e.width,height:e.height})),n.style&&(n.style["pointer-events"]="none");var r=e.getContext().getCanvas().nativeCanvas,a=oi({nativeCanvas:n,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,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}();Uu=Du([D(),Nu("design:paramtypes",[])],Uu);var zu=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},Hu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wu=function(){function t(){a(this,t),this.offscreen=!1,this.type="virtual",this.global=Fe.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}();Wu=zu([D(),Hu("design:paramtypes",[])],Wu);var Vu=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},Fu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gu=function(){function t(){a(this,t),this.offscreen=!0,this.type="dynamic",this.global=Fe.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=oi({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,c=i.height,d=void 0===c?this.layer.viewHeight:c;n.nativeContext.save(),n.nativeContext.setTransform(r,0,0,r,0,0),i.clear&&n.clearRect(s,l,h,d),n.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,s,l,h,d),n.nativeContext.restore()}},{key:"merge",value:function(t){}}]),t}();Gu=Vu([D(),Fu("design:paramtypes",[])],Gu);var Yu=new B((function(t){t(Uu).toSelf(),t(Gu).toSelf(),t(Wu).toSelf(),t(cr).toService(Uu),t(dr).toService(Gu),t(fr).toService(Wu)}));var $u=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 Xu(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return $u(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 qu(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 c=a[h],d=r[c],f=0;f<d.length;f++){if(l){u=!0,o=d[f];break}d[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 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=Symbol.for("DrawItemInterceptor"),Qu=new e.AABBBounds,th=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){Qu.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(Qu),!0}}]),t}(),eh=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}(),ih=function(){function t(){a(this,t),this.order=1,this.interceptors=[new th,new rh,new nh,new eh]}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}();ih=Ku([D(),Zu("design:paramtypes",[])],ih);var nh=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=fo.CreateGraphic("group",{})).id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}]),t}(),rh=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,c,d=no.allocate();c=u,(h=d)[0]=c.a,h[1]=c.b,h[2]=0,h[3]=0,h[4]=c.c,h[5]=c.d,h[6]=0,h[7]=0,h[8]=0,h[9]=0,h[10]=1,h[11]=0,h[12]=c.e,h[13]=c.f,h[14]=0,h[15]=1;var f=o.modelMatrix;if(f){if(d){var v=no.allocate();o.modelMatrix=lo(v,f,d)}}else o.modelMatrix=d;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===Hn)})),t.forEachChildren((function(t){return!(g=!!t.findFace)})),p){var y=t.getChildren(),b=m(y);b.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})),b.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),b.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&&no.free(o.modelMatrix),o.modelMatrix=f,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}]),t}(),ah=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}()),sh=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},oh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lh=function(t,e){return function(i,n){e(i,n,t)}},uh=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=Fe.global,this.layerService=Fe.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,c=i.height;if(r){var d=this.dirtyBounds.setValue(0,0,h,c);if(a.dirtyBounds&&!a.dirtyBounds.empty()){var f=e.getRectIntersect(d,a.dirtyBounds,!1);d.x1=Math.floor(f.x1),d.y1=Math.floor(f.y1),d.x2=Math.ceil(f.x2),d.y2=Math.ceil(f.y2)}var v=r.dpr%1;(v||.5!==v)&&(d.x1=Math.floor(d.x1*r.dpr)/r.dpr,d.y1=Math.floor(d.y1*r.dpr)/r.dpr,d.x2=Math.ceil(d.x2*r.dpr)/r.dpr,d.y2=Math.ceil(d.y2*r.dpr)/r.dpr),this.backupDirtyBounds.copy(d),r.inuse=!0,r.clearMatrix(),r.setTransformForCurrent(!0);var p=d.width()*r.dpr<r.canvas.width||d.height()*r.dpr<r.canvas.height;r.save(),r.translate(o,u,!0),p&&(r.beginPath(),r.rect(d.x1,d.y1,d.width(),d.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:Pe.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Pe.zIndex)})).forEach((function(t){t.isContainer?n.renderGroup(t,i,io.allocate(1,0,0,1,0,0)):n.renderItem(t,i)})),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=qu(e,i,Pe.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=ah.allocateByObj(this.dirtyBounds);var l=t.transMatrix;o=io.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 c=o[h],d=s[c];a&&d.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<d.length;f++)if(i(d[f],f)){u=!0;break}}}else t.forEachChildren(i,r)}(t,Pe.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),ah.free(s),io.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||ai.get(Jl);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,c=void 0===h?0:h,d=u.scrollY,f=void 0===d?0:d;if(l=!(!c&&!f)){o=this.dirtyBounds.clone();var v=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(v),this.dirtyBounds.translate(-c,-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 c=h.resources.get(r);c&&"success"===c.state&&c.data&&e.drawImage(c.data,0,0,o,u)}else e.fillStyle=bo(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}();uh=sh([D(),lh(0,j(iu)),lh(1,I(et)),lh(1,N(Ju)),oh("design:paramtypes",[Array,Object])],uh);var hh=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},ch=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dh=function(t,e){return function(i,n){e(i,n,t)}},fh=function(){function t(e){a(this,t),this.groupRenderContribitions=e,this.numberType=Fn}return o(t,[{key:"drawShape",value:function(t,i,n,r,a,s,o,l){var u=Pi(t,null==s?void 0:s.theme).group,h=t.attribute,c=h.fill,d=void 0===c?u.fill:c,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,P=h.cornerRadius,M=void 0===P?u.cornerRadius:P,C=h.path,O=void 0===C?u.path:C,E=h.lineWidth,L=void 0===E?u.lineWidth:E,R=h.visible,I=void 0===R?u.visible:R,j=_r(y,S,m,_,d),D=kr(y,T,m,_),N=br(d,f),U=mr(p,L);if(t.valid&&I){if(!k){if(!N&&!U)return;if(!(j||D||o||l||f))return}if(O&&O.length&&a.drawContribution){var z=i.disableFill,H=i.disableStroke,W=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,O.forEach((function(t){a.drawContribution.getRenderContribution(t).draw(t,a.renderService,a,s)})),i.disableFill=z,i.disableStroke=H,i.disableBeginPath=W}else 0===M||e.isArray(M)&&M.every((function(t){return 0===t}))?(i.beginPath(),i.rect(n,r,m,_)):(i.beginPath(),Do(i,n,r,m,_,M));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Io));var V={doFill:N,doStroke:U};this._groupRenderContribitions.forEach((function(e){e.time===St.beforeFillStroke&&e.drawShape(t,i,n,r,N,U,j,D,u,a,o,l,V)})),k&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(t,t.attribute,u),V.doFill&&(o?o(i,t.attribute,u):j&&(i.setCommonStyle(t,t.attribute,n,r,u),i.fill())),V.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===St.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=Pi(t,null==n?void 0:n.theme).group,o=r.modelMatrix;if(r.camera){var l=no.allocate(),u=no.allocate();uo(u,t,s),lo(l,o||l,u),r.modelMatrix=l,no.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,c=t.attribute,d=c.scrollX,f=void 0===d?s.scrollX:d,v=c.scrollY,p=void 0===v?s.scrollY:v;(f||p)&&r.translate(f,p),n&&n.drawingCb&&(h=n.drawingCb()),r.modelMatrix!==o&&no.free(r.modelMatrix),r.modelMatrix=o,h&&h.then?h.then((function(){a?r.restore():r.highPerformanceRestore()})):a?r.restore():r.highPerformanceRestore()}}}]),t}();fh=hh([D(),dh(0,I(et)),dh(0,N(Cr)),ch("design:paramtypes",[Object])],fh);var vh=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},ph=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.apply(this,arguments)).numberType=Yn,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,c=u.startAtIdx,d=u.length,f=t.attribute.segments,v=void 0===f?[]:f;if(c>v.length)return;var p=Pi(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,P=g.lineWidth,M=void 0===P?p.lineWidth:P,C=g.visible,O=void 0===C?p.visible:C,E=xr(k,S,m),L=Ar(k,T),R=br(m),I=mr(_,M);if(!t.valid||!O)return;if(!R&&!I)return;if(!(E||L||o||l))return;for(var j=a.context,D=c;D<c+d;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}(ll);ph=vh([D()],ph);var gh=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},yh=function(t){u(i,t);var e=g(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,c=l.length,d=t.attribute.segments,f=void 0===d?[]:d;if(u>f.length)return;var v=Pi(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=br(b);if(!t.valid||!B)return;if(!w)return;if(!S&&!o)return;for(var T=u;T<u+c;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=[],c=0;c<u.length;c++)u[c].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 c=i.length-1;c>=0;c--){var d=i[c];t.lineTo(null!==(r=d.x1)&&void 0!==r?r:d.x,null!==(a=d.y1)&&void 0!==a?a:d.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}(yl);yh=gh([D()],yh);var bh,mh=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},xh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_h=function(t,e){return function(i,n){e(i,n,t)}},Ah=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"}(bh||(bh={}));var kh=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=bh.NORMAL,o.checkingForDrawPromise=null,o.hooks={completeDraw:new rt([])},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 Ah(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:Pe.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Pe.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 Ah(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 Ah(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 Ah(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,Xu(t,Pe.zIndex,(function(i,n){if(s.status===bh.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 Ah(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 Ah(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 Ah(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=bh.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=bh.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 Ah(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 Ah(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,Xu(t,Pe.zIndex,(function(t){return Ah(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}(uh);kh=mh([D(),_h(0,j(iu)),_h(1,I(ph)),_h(2,I(yh)),_h(3,I(et)),_h(3,N(Ju)),xh("design:paramtypes",[Array,Object,Object,Object])],kh);var Bh=new B((function(t){t(Ao).toSelf().inSingletonScope(),t(So).toSelf().inSingletonScope(),t(du).to(uh),t(Jl).to(kh),t(nu).to(fh).inSingletonScope(),t(iu).toService(nu),nt(t,Cr),t(Bo).toSelf().inSingletonScope(),nt(t,Dr),nt(t,iu),t(ih).toSelf().inSingletonScope(),t(Ju).toService(ih),nt(t,Ju)}));var Sh=!1;Sh||(Sh=!0,ai.load(yr),ai.load(Tu),ai.load(bu),ai.load(wu),ai.load(Ru),function(t){t.load(Iu),t.load(ju),t.load(Yu)}(ai),function(t){t.load(Bh)}(ai));var wh=ai.get(st);Fe.global=wh;var Th=ai.get(ur);Fe.graphicUtil=Th;var Ph=ai.get(lr);Fe.transformUtil=Ph;var Mh=ai.get(tr);Fe.graphicService=Mh;var Ch,Oh=ai.get(hr);Fe.layerService=Oh;var Eh=!1,Lh=new B((function(t){Eh||(Eh=!0,t(tl).toSelf().inSingletonScope(),t(Ql).to(tl).inSingletonScope(),t(iu).toService(Ql),t(Tr).toService(Bo),nt(t,Tr))})),Rh=!1,Ih=new B((function(t){Rh||(Rh=!0,t(Tl).toSelf().inSingletonScope(),t(ou).to(Tl).inSingletonScope(),t(iu).toService(ou),t(Vo).toSelf(),t(Wo).toSelf(),t(Rr).toService(Vo),t(Rr).toService(Wo),t(Rr).toService(Bo),nt(t,Rr))})),jh=!1,Dh=new B((function(t){jh||(jh=!0,t(ll).toSelf().inSingletonScope(),t(ph).toSelf().inSingletonScope(),t(ru).to(ll).inSingletonScope(),t(iu).toService(ru))})),Nh=!1,Uh=new B((function(t){Nh||(Nh=!0,t(yl).toSelf().inSingletonScope(),t(tu).to(yl).inSingletonScope(),t(iu).toService(tu),t(Pr).toService(Bo),nt(t,Pr),t(yh).toSelf().inSingletonScope())})),zh=!1,Hh=new B((function(t){zh||(zh=!0,t(Ol).toSelf().inSingletonScope(),t(lu).to(Ol).inSingletonScope(),t(iu).toService(lu),t(Ir).toService(Bo),nt(t,Ir))})),Wh=!1,Vh=new B((function(t){Wh||(Wh=!0,t(rl).toSelf().inSingletonScope(),t(eu).to(rl).inSingletonScope(),t(iu).toService(eu),t(Mr).toService(Bo),nt(t,Mr))})),Fh=!1,Gh=new B((function(t){Fh||(Fh=!0,t(uu).to(Dl).inSingletonScope(),t(iu).toService(uu),t(jr).toService(Bo),nt(t,jr))})),Yh=!1,$h=new B((function(t){Yh||(Yh=!0,t(kl).toSelf().inSingletonScope(),t(au).to(kl).inSingletonScope(),t(iu).toService(au),t(Er).toService(Bo),nt(t,Er))})),Xh=!1,qh=new B((function(t){Xh||(Xh=!0,t(su).to(Yl).inSingletonScope(),t(iu).toService(su),t(Lr).toService(Bo),nt(t,Lr))})),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},Zh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jh=function(t){u(i,t);var e=g(i);function i(){var t;return a(this,i),(t=e.call(this)).numberType=Zn,t.builtinContributions=[Ll],t.init(),t}return o(i,[{key:"drawShape",value:function(t,e,i,n,r){var a=Pi(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,c=s.fillOpacity,d=void 0===c?a.fillOpacity:c,f=s.visible,v=void 0===f?a.visible:f;if(t.valid&&v){var p=xr(h,d,!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=Pi(t).richtextIcon,o=t.attribute,l=o.width,u=void 0===l?s.width:l,h=o.height,c=void 0===h?s.height:h,d=o.opacity,f=void 0===d?s.opacity:d,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,P=void 0===T?u:T,M=w.backgroundHeight,C=void 0===M?c:M;if(S&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){var O=(P-u)/2,E=(C-c)/2;0===B?(e.beginPath(),e.rect(i-O,n-E,P,C)):(e.beginPath(),Do(e,i-O,n-E,P,C,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,c))}},{key:"draw",value:function(t,e,i){var n=Pi(t).richtext;this._draw(t,n,!1,i)}}]),i}(go);Jh=Kh([D(),Zh("design:paramtypes",[])],Jh);var Qh=!1,tc=new B((function(t){Qh||(Qh=!0,t(hu).to(Jh).inSingletonScope(),t(iu).toService(hu))})),ec=!1,ic=new B((function(t){ec||(ec=!0,t(cu).to(Zl).inSingletonScope(),t(iu).toService(cu),t(Or).toService(Bo),nt(t,Or))}));const nc=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class rc extends rr{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,nc.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=>nc.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}`}_dispatchEvent(t,e){var i;const n=new Ei(t,e);n.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(n)}}var ac=Symbol.for("MathPickerContribution"),sc=Symbol.for("MathArcPicker"),oc=Symbol.for("MathAreaPicker"),lc=Symbol.for("MathCirclePicker"),uc=Symbol.for("MathImagePicker"),hc=Symbol.for("MathLinePicker"),cc=Symbol.for("MathPathPicker"),dc=Symbol.for("MathRectPicker"),fc=Symbol.for("MathSymbolPicker"),vc=Symbol.for("MathTextPicker"),pc=Symbol.for("MathPolygonPicker"),gc=Symbol.for("CanvasArcPicker"),yc=Symbol.for("CanvasAreaPicker"),bc=Symbol.for("CanvasCirclePicker"),mc=Symbol.for("CanvasImagePicker"),xc=Symbol.for("CanvasLinePicker"),_c=Symbol.for("CanvasPathPicker"),Ac=Symbol.for("CanvasRectPicker"),kc=Symbol.for("CanvasSymbolPicker"),Bc=Symbol.for("CanvasTextPicker"),Sc=Symbol.for("CanvasPolygonPicker"),wc=Symbol.for("CanvasRichTextPicker"),Tc=Symbol.for("CanvasPickerContribution"),Pc=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},Mc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cc=function(t,e){return function(i,n){e(i,n,t)}},Oc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=zn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).arc;n.highPerformanceSave();var a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=yo(n,a+s,n.dpr),c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();Oc=Pc([D(),Cc(0,I(Ql)),Mc("design:paramtypes",[Object])],Oc);var Ec=!1,Lc=new B((function(t,e,i,n){Ec||(Ec=!0,t(gc).to(Oc).inSingletonScope(),t(Tc).toService(gc))})),Rc=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},Ic=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jc=function(t,e){return function(i,n){e(i,n,t)}},Dc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=zn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).arc;n.highPerformanceSave();var a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();Dc=Rc([D(),jc(0,I(Ql)),Ic("design:paramtypes",[Object])],Dc);var Nc=!1,Uc=new B((function(t,e,i,n){Nc||(Nc=!0,t(sc).to(Dc).inSingletonScope(),t(ac).toService(sc))})),zc=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},Hc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wc=function(t,e){return function(i,n){e(i,n,t)}},Vc=new e.AABBBounds,Fc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=qn}return o(t,[{key:"contains",value:function(t,i,n){if(!t.AABBBounds.containsPoint(i))return!1;if("imprecise"===t.attribute.pickMode)return!0;var r=(null!=n?n:{}).pickContext;if(!r)return!1;var a=Pi(t).rect,s=t.attribute.cornerRadius,o=void 0===s?a.cornerRadius:s,l=t.attribute,u=l.x,h=void 0===u?a.x:u,c=l.y,d=void 0===c?a.y:c;r.highPerformanceSave();var f=!0;if(t.transMatrix.onlyTranslate()){var v=t.getOffsetXY(a);h+=v.x,d+=v.y,r.setTransformForCurrent()}else h=0,d=0,f=!1,r.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!f||t.shadowRoot||e.isNumber(o,!0)&&0!==o||e.isArray(o)&&o.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,r,h,d,{},null,(function(t,e,n){return!!p||(p=t.isPointInPath(i.x,i.y))}),(function(t,e,n){if(p)return!0;var a=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=yo(r,a+s,r.dpr),p=t.isPointInStroke(i.x,i.y)}));else{var g=t.attribute,y=g.fill,b=void 0===y?a.fill:y,m=g.stroke,x=void 0===m?a.stroke:m,_=g.lineWidth,A=void 0===_?a.lineWidth:_;if(b)p=!0;else if(x){var k=t.AABBBounds;Vc.setValue(k.x1,k.y1,k.x2,k.y2),Vc.expand(-A/2),p=!Vc.containsPoint(i)}}return r.highPerformanceRestore(),p}}]),t}();Fc=zc([D(),Wc(0,I(ou)),Hc("design:paramtypes",[Object])],Fc);var Gc=!1,Yc=new B((function(t,e,i,n){Gc||(Gc=!0,t(Ac).to(Fc).inSingletonScope(),t(Tc).toService(Ac))})),$c=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},Xc=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qc=function(t,e){return function(i,n){e(i,n,t)}},Kc=new e.AABBBounds,Zc=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=qn}return o(t,[{key:"contains",value:function(t,i,n){if(!t.AABBBounds.containsPoint(i))return!1;if("imprecise"===t.attribute.pickMode)return!0;var r=(null!=n?n:{}).pickContext;if(!r)return!1;var a=Pi(t).rect,s=t.attribute.cornerRadius,o=void 0===s?a.cornerRadius:s,l=t.attribute,u=l.x,h=void 0===u?a.x:u,c=l.y,d=void 0===c?a.y:c;r.highPerformanceSave();var f=!0;if(t.transMatrix.onlyTranslate()){var v=t.getOffsetXY(a);h+=v.x,d+=v.y,r.setTransformForCurrent()}else h=0,d=0,f=!1,r.transformFromMatrix(t.transMatrix,!0);var p=!0;if(!f||e.isNumber(o,!0)&&0!==o||e.isArray(o)&&o.some((function(t){return 0!==t})))p=!1,this.canvasRenderer.drawShape(t,r,h,d,{},null,(function(t,e,n){return!!p||(p=t.isPointInPath(i.x,i.y))}),(function(t,e,n){if(p)return!0;var a=e.lineWidth||n.lineWidth,s=e.pickStrokeBuffer||n.pickStrokeBuffer;return r.lineWidth=a+s,p=t.isPointInStroke(i.x,i.y)}));else if(p){var g=t.attribute,y=g.fill,b=void 0===y?a.fill:y,m=g.stroke,x=void 0===m?a.stroke:m,_=g.lineWidth,A=void 0===_?a.lineWidth:_;if(b)p=!0;else if(x){var k=t.AABBBounds;Kc.setValue(k.x1,k.y1,k.x2,k.y2),Kc.expand(-A/2),p=!Kc.containsPoint(i)}}return r.highPerformanceRestore(),p}}]),t}();Zc=$c([D(),qc(0,I(ou)),Xc("design:paramtypes",[Object])],Zc);var Jc=!1,Qc=new B((function(t,e,i,n){Jc||(Jc=!0,t(dc).to(Zc).inSingletonScope(),t(ac).toService(dc))})),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(){return a(this,i),e.apply(this,arguments)}return o(i)}(go),id=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},nd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rd=function(t,e){return function(i,n){e(i,n,t)}},ad=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="line",n.numberType=Yn,n}return o(i,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;n.highPerformanceSave();var r=Pi(t).line,a=this.transform(t,r,n),s=a.x,o=a.y,l=a.z,u=a.lastModelMatrix,h=e;if(n.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(function(t){return!!d||(d=t.isPointInPath(h.x,h.y))}),(function(t,e,i){if(d)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=yo(n,r+a,n.dpr),d=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,n.modelMatrix!==u&&no.free(n.modelMatrix),n.modelMatrix=u,n.highPerformanceRestore(),d}}]),i}(ed=td([D()],ed));ad=id([D(),rd(0,I(ru)),nd("design:paramtypes",[Object])],ad);var sd=!1,od=new B((function(t,e,i,n){sd||(sd=!0,t(xc).to(ad).inSingletonScope(),t(Tc).toService(xc))})),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,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},hd=function(t,e){return function(i,n){e(i,n,t)}},cd=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="line",this.numberType=Yn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).line,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();cd=ld([D(),hd(0,I(ru)),ud("design:paramtypes",[Object])],cd);var dd=!1,fd=new B((function(t,e,i,n){dd||(dd=!0,t(hc).to(cd).inSingletonScope(),t(ac).toService(hc))})),vd=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},pd=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.canvasRenderer=e,this.type="area",this.numberType=Wn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).area,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l,h=t.attribute,c=h.fillPickable,d=void 0===c?r.fillPickable:c,f=h.strokePickable,v=void 0===f?r.strokePickable:f;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var p=t.getOffsetXY(r);o+=p.x,u+=p.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var g=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t){return!!g||!!d&&(g=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(g)return!0;if(!v)return!1;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=yo(n,a+s,n.dpr),g=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),g}}]),t}();yd=vd([D(),gd(0,I(tu)),pd("design:paramtypes",[Object])],yd);var bd=!1,md=new B((function(t,e,i,n){bd||(bd=!0,t(yc).to(yd).inSingletonScope(),t(Tc).toService(yc))})),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)},Ad=function(t,e){return function(i,n){e(i,n,t)}},kd=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Wn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).area,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t){return!!c||(c=t.isPointInPath(e.x,e.y))})),n.highPerformanceRestore(),c}}]),t}();kd=xd([D(),Ad(0,I(tu)),_d("design:paramtypes",[Object])],kd);var Bd=!1,Sd=new B((function(t,e,i,n){Bd||(Bd=!0,t(oc).to(kd).inSingletonScope(),t(ac).toService(oc))})),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},Td=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pd=function(t,e){return function(i,n){e(i,n,t)}},Md=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="symbol",n.numberType=Jn,n}return o(i,[{key:"contains",value:function(t,e,i){var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();var a=Pi(t).symbol,s=this.transform(t,a,n),o=s.x,l=s.y,u=s.z,h=s.lastModelMatrix,c=e;if(n.camera){c=e.clone();var d=t.parent.globalTransMatrix;c.x=d.a*e.x+d.c*e.y+d.e,c.y=d.b*e.x+d.d*e.y+d.f}this.canvasRenderer.z=u;var f=!1;return this.canvasRenderer.drawShape(t,n,o,l,{},null,(function(t,e,i){return!!f||(f=t.isPointInPath(c.x,c.y))}),(function(t,e,i){if(f)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=yo(n,r+a,n.dpr),f=t.isPointInStroke(c.x,c.y)})),this.canvasRenderer.z=0,n.modelMatrix!==h&&no.free(n.modelMatrix),n.modelMatrix=h,n.highPerformanceRestore(),f}}]),i}(ed);Md=wd([D(),Pd(0,I(lu)),Td("design:paramtypes",[Object])],Md);var Cd=!1,Od=new B((function(t,e,i,n){Cd||(Cd=!0,t(kc).to(Md).inSingletonScope(),t(Tc).toService(kc))})),Ed=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=function(t,e){return function(i,n){e(i,n,t)}},Id=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="symbol",this.numberType=Jn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).symbol,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();Id=Ed([D(),Rd(0,I(lu)),Ld("design:paramtypes",[Object])],Id);var jd=!1,Dd=new B((function(t,e,i,n){jd||(jd=!0,t(fc).to(Id).inSingletonScope(),t(ac).toService(fc))})),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(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zd=function(t,e){return function(i,n){e(i,n,t)}},Hd=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Vn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).circle,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=yo(n,a+s,n.dpr),c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();Hd=Nd([D(),zd(0,I(eu)),Ud("design:paramtypes",[Object])],Hd);var Wd=!1,Vd=new B((function(t,e,i,n){Wd||(Wd=!0,t(bc).to(Hd).inSingletonScope(),t(Tc).toService(bc))})),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},Gd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yd=function(t,e){return function(i,n){e(i,n,t)}},$d=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=Vn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).circle,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();$d=Fd([D(),Yd(0,I(eu)),Gd("design:paramtypes",[Object])],$d);var Xd=!1,qd=new B((function(t,e,i,n){Xd||(Xd=!0,t(lc).to($d).inSingletonScope(),t(ac).toService(lc))})),Kd=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},Zd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jd=function(t,e){return function(i,n){e(i,n,t)}},Qd=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="text",n.numberType=Qn,n}return o(i,[{key:"contains",value:function(t,e,i){var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();var a=Pi(t).text,s=t.attribute.keepDirIn3d,o=!(void 0===s?a.keepDirIn3d:s),l=this.transform(t,a,n,o),u=l.x,h=l.y,c=l.z,d=l.lastModelMatrix;this.canvasRenderer.z=c;var f=e;if(n.camera){f=e.clone();var v=t.parent.globalTransMatrix;f.x=v.a*e.x+v.c*e.y+v.e,f.y=v.b*e.x+v.d*e.y+v.f}var p=!1;return this.canvasRenderer.drawShape(t,n,u,h,{},null,(function(e,i,n){if(p)return!0;var r=t.attribute,s=r.fontSize,o=void 0===s?a.fontSize:s,l=r.textBaseline,d=void 0===l?a.textBaseline:l,v=r.textAlign,g=void 0===v?a.textAlign:v,y=t.AABBBounds,b=y.height(),m=y.width(),x=Wr(d,b,o),_=Hr(g,m);return e.rect(_+u,x+h,m,b,c),p=e.isPointInPath(f.x,f.y)}),(function(t,e,i){return p})),this.canvasRenderer.z=0,n.modelMatrix!==d&&no.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),p}}]),i}(ed);Qd=Kd([D(),Jd(0,I(uu)),Zd("design:paramtypes",[Object])],Qd);var tf=!1,ef=new B((function(t,e,i,n){tf||(tf=!0,t(Bc).to(Qd).inSingletonScope(),t(Tc).toService(Bc))})),nf=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},rf=function(){function t(){a(this,t),this.type="text",this.numberType=Qn}return o(t,[{key:"contains",value:function(t,e,i){return!!t.AABBBounds.containsPoint(e)}}]),t}();rf=nf([D()],rf);var af=!1,sf=new B((function(t,e,i,n){af||(af=!0,t(vc).to(rf).inSingletonScope(),t(ac).toService(vc))})),of=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},lf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},uf=function(t,e){return function(i,n){e(i,n,t)}},hf=function(t){u(i,t);var e=g(i);function i(t){var n;return a(this,i),(n=e.call(this)).canvasRenderer=t,n.type="path",n.numberType=$n,n}return o(i,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).path;n.highPerformanceSave();var a=this.transform(t,r,n),s=a.x,o=a.y,l=a.z,u=a.lastModelMatrix,h=e;if(n.camera){h=e.clone();var c=t.parent.globalTransMatrix;h.x=c.a*e.x+c.c*e.y+c.e,h.y=c.b*e.x+c.d*e.y+c.f}this.canvasRenderer.z=l;var d=!1;return this.canvasRenderer.drawShape(t,n,s,o,{},null,(function(t,e,i){return!!d||(d=t.isPointInPath(h.x,h.y))}),(function(t,e,i){if(d)return!0;var r=e.lineWidth||i.lineWidth,a=e.pickStrokeBuffer||i.pickStrokeBuffer;return n.lineWidth=yo(n,r+a,n.dpr),d=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,n.modelMatrix!==u&&no.free(n.modelMatrix),n.modelMatrix=u,n.highPerformanceRestore(),d}}]),i}(ed);hf=of([D(),uf(0,I(au)),lf("design:paramtypes",[Object])],hf);var cf=!1,df=new B((function(t,e,i,n){cf||(cf=!0,t(_c).to(hf).inSingletonScope(),t(Tc).toService(_c))})),ff=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},vf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pf=function(t,e){return function(i,n){e(i,n,t)}},gf=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="path",this.numberType=$n}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).path,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();gf=ff([D(),pf(0,I(au)),vf("design:paramtypes",[Object])],gf);var yf=!1,bf=new B((function(t,e,i,n){yf||(yf=!0,t(cc).to(gf).inSingletonScope(),t(ac).toService(cc))})),mf=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},xf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_f=function(t,e){return function(i,n){e(i,n,t)}},Af=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Xn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).polygon,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=yo(n,a+s,n.dpr),c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();Af=mf([D(),_f(0,I(su)),xf("design:paramtypes",[Object])],Af);var kf=!1,Bf=new B((function(t,e,i,n){kf||(kf=!0,t(Sc).to(Af).inSingletonScope(),t(Tc).toService(Sc))})),Sf=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},wf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tf=function(t,e){return function(i,n){e(i,n,t)}},Pf=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Xn}return o(t,[{key:"contains",value:function(t,e,i){if(!t.AABBBounds.contains(e.x,e.y))return!1;var n=(null!=i?i:{}).pickContext;if(!n)return!1;var r=Pi(t).polygon,a=t.attribute,s=a.x,o=void 0===s?r.x:s,l=a.y,u=void 0===l?r.y:l;if(n.highPerformanceSave(),t.transMatrix.onlyTranslate()){var h=t.getOffsetXY(r);o+=h.x,u+=h.y,n.setTransformForCurrent()}else o=0,u=0,n.transformFromMatrix(t.transMatrix,!0);var c=!1;return this.canvasRenderer.drawShape(t,n,o,u,{},null,(function(t,i,n){return!!c||(c=t.isPointInPath(e.x,e.y))}),(function(t,i,r){if(c)return!0;var a=i.lineWidth||r.lineWidth,s=i.pickStrokeBuffer||r.pickStrokeBuffer;return n.lineWidth=a+s,c=t.isPointInStroke(e.x,e.y)})),n.highPerformanceRestore(),c}}]),t}();Pf=Sf([D(),Tf(0,I(su)),wf("design:paramtypes",[Object])],Pf);var Mf=!1,Cf=new B((function(t,e,i,n){Mf||(Mf=!0,t(pc).to(Pf).inSingletonScope(),t(ac).toService(pc))})),Of=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},Ef=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":r(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lf=function(t,e){return function(i,n){e(i,n,t)}},Rf=function(){function t(e){a(this,t),this.canvasRenderer=e,this.type="richtext",this.numberType=Zn}return o(t,[{key:"contains",value:function(t,e,i){return!!t.AABBBounds.containsPoint(e)}}]),t}();Rf=Of([D(),Lf(0,I(hu)),Ef("design:paramtypes",[Object])],Rf);var If=!1,jf=new B((function(t,e,i,n){If||(If=!0,t(wc).to(Rf).inSingletonScope(),t(Tc).toService(wc))})),Df=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},Nf=function(){function t(){a(this,t),this.type="image",this.numberType=Gn}return o(t,[{key:"contains",value:function(t,e,i){return!!(null!=i?i:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}]),t}();Nf=Df([D()],Nf);var Uf=!1,zf=new B((function(t,e,i,n){Uf||(Uf=!0,t(uc).to(Nf).inSingletonScope(),t(Nf).toService(uc))})),Hf=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},Wf=function(){function t(){a(this,t),this.type="image",this.numberType=Gn}return o(t,[{key:"contains",value:function(t,e,i){return!!(null!=i?i:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}]),t}();Wf=Hf([D()],Wf);var Vf=!1,Ff=new B((function(t,e,i,n){Vf||(Vf=!0,t(mc).to(Wf).inSingletonScope(),t(Tc).toService(mc))})),Gf=!1,Yf=new B((function(t,e,i,n){Gf||(Gf=!0,t(uc).to(Nf).inSingletonScope(),t(Nf).toService(uc))})),$f=(function(){if(null==Ch){try{Ch=!!window}catch(t){Ch=!1}if(Ch)try{Ch=!tt}catch(t){Ch=!0}}}(),Ch),Xf=!1;function qf(){Xf||(Xf=!0,fo.RegisterGraphicCreator("arc",Xs),ai.load(Lh),ai.load($f?Lc:Uc))}var Kf=!1;function Zf(){Kf||(Kf=!0,fo.RegisterGraphicCreator("area",Gs),ai.load(Uh),ai.load($f?md:Sd))}var Jf=!1;function Qf(){Jf||(Jf=!0,fo.RegisterGraphicCreator("circle",zr),ai.load(Vh),ai.load($f?Vd:qd))}var tv=!1;function ev(){tv||(tv=!0,fo.RegisterGraphicCreator("group",ar))}var iv=!1;function nv(){iv||(iv=!0,fo.RegisterGraphicCreator("image",Ls),ai.load(ic),ai.load($f?Ff:Yf))}var rv=!1;function av(){rv||(rv=!0,fo.RegisterGraphicCreator("line",Ss),ai.load(Dh),ai.load($f?od:fd))}var sv=!1;function ov(){sv||(sv=!0,fo.RegisterGraphicCreator("path",Ws),ai.load($h),ai.load($f?df:bf))}var lv=!1;function uv(){lv||(lv=!0,fo.RegisterGraphicCreator("polygon",Zs),ai.load(qh),ai.load($f?Bf:Cf))}var hv=!1;function cv(){hv||(hv=!0,fo.RegisterGraphicCreator("rect",Ps),ai.load(Ih),ai.load($f?Yc:Qc))}var dv=!1;function fv(){dv||(dv=!0,fo.RegisterGraphicCreator("richtext",Us),ai.load(tc),ai.load($f?jf:zf))}var vv=!1;function pv(){vv||(vv=!0,fo.RegisterGraphicCreator("symbol",As),ai.load(Hh),ai.load($f?Od:Dd))}var gv=!1;function yv(){gv||(gv=!0,fo.RegisterGraphicCreator("text",Yr),ai.load(Gh),ai.load($f?ef:sf))}var bv=!1;function mv(){bv||(bv=!0,fo.RegisterGraphicCreator("wrapText",qr))}const xv={debounce:e.debounce,throttle:e.throttle};ev(),cv();class _v extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},_v.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:i,viewY:n}=t,{direction:r,width:a,height:s,range:o}=this.attribute,l=this._sliderSize,[u,h]=this._getScrollRange();let c;if("vertical"===r){const t=n-this._viewPosition.y,i=e.clamp(t-l/2,u,h);c=t/s,this._slider.setAttribute("y",i,!0)}else{const t=i-this._viewPosition.x,n=e.clamp(t-l/2,u,h);c=t/a,this._slider.setAttribute("x",n,!0)}this.setScrollRange([c-(o[1]-o[0])/2,c+(o[1]-o[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{t.stopPropagation();const{direction:e}=this.attribute;this._prePos="horizontal"===e?t.clientX:t.clientY,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===wh.env?(wh.addEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),wh.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=xv[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._dispatchEvent("scroll",{pre:n,value:e.clampRange(l,r[0],r[1])}),this._dispatchEvent("scrollUp",{pre:n,value:e.clampRange(l,r[0],r[1])}),"browser"===wh.env?(wh.removeEventListener("pointermove",this._onSliderPointerMove,{capture:!0}),wh.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){const{direction:n="horizontal",limitRange:r=[0,1],range:a,realTime:s=!0}=this.attribute,o=e.clampRange(t,r[0],r[1]);if(i){const t=this._getSliderPos(o);this._slider&&("horizontal"===n?this._slider.setAttribute("x",t[0],!0):this._slider.setAttribute("y",t[0],!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame())}this.attribute.range=o,s&&(this._dispatchEvent("scroll",{pre:a,value:o}),this._dispatchEvent("scrollDrag",{pre:a,value:o}))}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",xv[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 c=this._getSliderRenderBounds(),d=this._getSliderPos(e.clampRange(r,a[0],a[1])),f=d[1]-d[0];let v;this._sliderSize=f,v="horizontal"===t?{x:d[0],y:c.y1,width:f,height:c.height}:{x:c.x1,y:d[0],width:c.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:Math.max(0,t-(o+a)),height:Math.max(0,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)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function Av(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 kv(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 Bv(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 Sv(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&Sv(t,e)}))}_v.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;const wv=t=>!e.isNil(t)&&!1!==t.visible;const Tv=["#ffffff","#000000"];function Pv(t,i,n,r,a,s){if("string"!=typeof t||"string"!=typeof i)return t;const o=new e.Color(t).toHex(),l=new e.Color(i).toHex();return Mv(o,l,n,r,s)?o:function(t,e,i,n,r,a){const s=[];r&&(r instanceof Array?s.push(...r):s.push(r));s.push(...Tv);for(const r of s)if(t!==r&&Mv(r,e,i,n,a))return r;return}(o,l,n,r,a,s)}function Mv(t,i,n,r,a){if("lightness"===a){const n=e.Color.getColorBrightness(new e.Color(i));return e.Color.getColorBrightness(new e.Color(t))<.5?n>=.5:n<.5}return r?Cv(t,i)>r:"largeText"===n?Cv(t,i)>3:Cv(t,i)>4.5}function Cv(t,e){const i=Ov(t),n=Ov(e);return((i>n?i:n)+.05)/((i>n?n:i)+.05)}function Ov(t){const i=e.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 Ev(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 Lv(t,e){return[t[0]*e,t[1]*e]}function Rv(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 Iv=-.5*Math.PI,jv=1.5*Math.PI,Dv="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 Nv;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Nv||(Nv={}));const Uv={[Nv.selectedReverse]:{},[Nv.selected]:{},[Nv.hover]:{},[Nv.hoverReverse]:{}},zv={container:"",width:30,height:30,style:{}},Hv=(t,i,n)=>new e.TextMeasure(Object.assign({defaultFontParams:{fontFamily:Dv,fontSize:11},getTextBounds:n?void 0:vo,specialCharSet:"-/: .,@%'\"~"+e.TextMeasure.ALPHABET_CHAR_SET+e.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()},null!=i?i:{}),t);function Wv(t,e){var i;if(!t)return{width:0,height:0};const n=vo({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()}}function Vv(){ev(),cv(),pv(),fv(),yv()}Vv();class Fv extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Fv.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:c=4,visible:d,state:f,type:v,textAlwaysCenter:p}=this.attribute,g=e.normalizePadding(c),y=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let b,m=g[1]+g[3],x=g[0]+g[2],_=0,A=0;const{visible:k}=s,B=Av(s,["visible"]);if(e.isBoolean(k)){const t=(null==B?void 0:B.size)||10,i=e.isNumber(t)?t:Math.max(t[0],t[1]);b=y.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},B),{visible:k,x:i/2,y:i/2}),"symbol"),e.isEmpty(null==f?void 0:f.shape)||(b.states=f.shape),k&&(A=i+l)}let S;if(m+=A,_+=A,"rich"===v){const n=Object.assign(Object.assign({textConfig:r,visible:e.isValid(r)&&!1!==d},a),{x:_,y:0,width:null!==(t=a.width)&&void 0!==t?t:0,height:null!==(i=a.height)&&void 0!==i?i:0});S=y.createOrUpdateChild("tag-text",n,"richtext");const{visible:s}=o,l=Av(o,["visible"]);if(d&&e.isBoolean(s)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},l),{visible:s&&!!r,x:S.AABBBounds.x1,y:S.AABBBounds.y1,width:S.AABBBounds.width(),height:S.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!==d,html:Object.assign(Object.assign({dom:r},zv),a)},a),{x:_,y:0});S=y.createOrUpdateChild("tag-text",t,"richtext");const{visible:i}=o,n=Av(o,["visible"]);if(d&&e.isBoolean(i)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},n),{visible:i&&!!r,x:S.AABBBounds.x1,y:S.AABBBounds.y1,width:S.AABBBounds.width(),height:S.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!==d,lineHeight:null==a?void 0:a.fontSize},a),{x:_,y:0});e.isNil(t.lineHeight)&&(t.lineHeight=a.fontSize),S=y.createOrUpdateChild("tag-text",t,"text"),e.isEmpty(null==f?void 0:f.text)||(S.states=f.text);const i=Wv(t.text,a),l=i.width,c=i.height;m+=l;const v=null!==(n=s.size)&&void 0!==n?n:10,k=e.isNumber(v)?v:Math.max(v[0],v[1]);x+=Math.max(c,s.visible?k:0);const{textAlign:B,textBaseline:w}=a;(e.isValid(u)||e.isValid(h))&&(e.isValid(u)&&m<u&&(m=u),e.isValid(h)&&m>h&&(m=h,S.setAttribute("maxLineWidth",h-g[1]-g[2])));let T=0,P=0;"center"===B?(T-=m/2,b&&b.setAttribute("x",(b.attribute.x||0)-l/2),y.setAttribute("x",-A/2)):"right"===B||"end"===B?(T-=m,b&&b.setAttribute("x",(b.attribute.x||0)-l),y.setAttribute("x",-g[1]-A)):"left"!==B&&"start"!==B||y.setAttribute("x",g[3]),!p||"left"!==B&&"start"!==B||S.setAttributes({x:_+m/2,textAlign:"center"}),"middle"===w?(P-=x/2,b&&b.setAttribute("y",0)):"bottom"===w?(P-=x,b&&b.setAttribute("y",-c/2),y.setAttribute("y",-g[2])):"top"===w&&(y.setAttribute("y",g[0]),b&&b.setAttribute("y",c/2));const{visible:M}=o,C=Av(o,["visible"]);if(d&&e.isBoolean(M)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},C),{visible:M&&!!r,x:T,y:P,width:m,height:x}),"rect");e.isEmpty(null==f?void 0:f.panel)||(t.states=f.panel)}}}}Fv.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const Gv={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}},Yv={poptip:e.merge({},Gv)};const $v=new e.AABBBounds;ev(),mv(),pv(),cv();class Xv extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Xv.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:c={},panel:d={},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,P=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"}),M=S.createOrUpdateChild("poptip-title",P,"wrapText");e.isEmpty(null==m?void 0:m.title)||(M.states=m.title);const C=M.AABBBounds,O=C.height(),E=C.width();let L=O+f;T||(L=0);const R=e.isValid(k)&&!1!==b,I=Object.assign(Object.assign({text:e.isArray(k)?k:[k],visible:R},c),{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(E+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:W}=d,V=Av(d,["visible"]),F=null!==(t=V.size)&&void 0!==t?t:12,G=e.isArray(F)?[F[0]+(null!==(i=V.space)&&void 0!==i?i:0),F[1]+(null!==(n=V.space)&&void 0!==n?n:0)]:F+(null!==(r=V.space)&&void 0!==r?r:0),Y=null!==(a=V.lineWidth)&&void 0!==a?a:1,$=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($){const t=this.AABBBounds,i=null!==(l=this.attribute.x)&&void 0!==l?l:t.x1,n=$[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];M.setAttribute("maxLineWidth",r-t),j.setAttribute("maxLineWidth",r-t),H=B[0]+B[2],T&&(H+=M.AABBBounds.height()+f),H+=j.AABBBounds.height()}}const X="auto"===h;let q,K=-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-Y]);if(e.isBoolean(W)){const t=(e.isArray(F)?F[0]:F)/4,i=S.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},V),{visible:W&&(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({},V),{visible:W&&(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;{$v.setValue(0,0,z,H).transformWithMatrix(S.globalTransMatrix);const i=$v,n=(new e.Bounds).setValue(0,0,$[0],$[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]]}}}}Xv.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};let qv=class{render(t,i,n,r,a,s,o,l,u,h,c,d,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,Xv.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(r):this.poptipComponent=new Xv(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,Yv.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}))}};qv=kv([D()],qv);let Kv=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)}};Kv=kv([D()],Kv);let Zv=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||e.attribute.disableAutoClipedPoptip)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)}};Zv=kv([D()],Zv);const Jv=new B(((t,e,i,n)=>{i(qv)||(t(qv).toSelf().inSingletonScope(),t(Dr).toService(qv)),i(Kv)||(t(Kv).toSelf(),t(Pu).toService(Kv)),i(Zv)||(t(Zv).toSelf(),t(Pu).toService(Zv))}));class Qv extends rc{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}ev(),av();class tp extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},tp.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})}}tp.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},ev(),cv();class ep extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ep.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})}}ep.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},ev(),qf();class ip extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ip.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)}}ip.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}},ev(),qf();class np extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},np.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=Iv,endAngle:r=jv}=this.attribute,a=r-n,s=e.radianToDegree(e.getAngleByPoint(i,t));this.setAttributes({startAngle:s-a/2,endAngle:s+a/2})}}np.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},ev(),ov();class rp extends Qv{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},rp.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)}}rp.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}};const ap=5,sp=31,op=32,lp=new Uint32Array(op+1),up=new Uint32Array(op+1);up[0]=0,lp[0]=~up[0];for(let t=1;t<=op;++t)up[t]=up[t-1]<<1|1,lp[t]=~up[t];function hp(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+op)/op));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>>>ap]&1<<(r&sp)},set:(e,i)=>{const r=i*t+e;n(r>>>ap,1<<(r&sp))},clear:(e,i)=>{const n=i*t+e;r(n>>>ap,~(1<<(n&sp)))},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,c=s;for(;c>=r;--c)if(o=c*t+n,l=c*t+a,u=o>>>ap,h=l>>>ap,u===h){if(i[u]&lp[o&sp]&up[1+(l&sp)])return!0}else{if(i[u]&lp[o&sp])return!0;if(i[h]&up[1+(l&sp)])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,c;for(;r<=s;++r)if(o=r*t+i,l=r*t+a,u=o>>>ap,h=l>>>ap,u===h)n(u,lp[o&sp]&up[1+(l&sp)]);else for(n(u,lp[o&sp]),n(h,up[1+(l&sp)]),c=u+1;c<h;++c)n(c,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>>>ap,u=o>>>ap,l===u)r(l,up[s&sp]|lp[1+(o&sp)]);else for(r(l,up[s&sp]),r(u,lp[1+(o&sp)]),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>>>ap]&1<<(r&sp);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 cp(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 dp(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=cp(t,a);return!(n&&e.outOfBounds(a))&&!e.getRange(a)}function fp(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(),dp(t,i,cp(t,r.AABBBounds),a,s))return i.setRange(cp(t,r.AABBBounds,!0)),o[e]}return!1}function vp(t,i,n,r,a,s,o){var l,u;const h=null===(l=r.overlap)||void 0===l?void 0:l.clampForce,c=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 gp;return pp}(r.type)).map((t=>o(a.AABBBounds,s,t,r.offset)));return fp(t,i,a,l,h,c)}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 fp(t,i,a,r,h,c)}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 fp(t,i,a,r,h,c)}return!1}const pp=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],gp=["top","inside-top","inside"];function yp(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 c=0,d=0;return o<0&&l-o<=e?c=-o:l>e&&o-(l-e)>=0&&(c=e-l),u<0&&h-u<=i?d=-u:h>i&&u-(h-i)>=0&&(d=i-h),{dx:c,dy:d}}const bp={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 mp(t,e){var i,n;return null!==(n=null===(i=bp[e])||void 0===i?void 0:i.call(bp,t))&&void 0!==n?n:{from:{},to:{}}}const xp=(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 _p(t,i,n,r){t.attribute.text!==i.attribute.text&&e.isValidNumber(Number(t.attribute.text)*Number(i.attribute.text))&&t.animate().play(new an({text:t.attribute.text},{text:i.attribute.text},n,r))}const Ap={mode:"same-time",duration:300,easing:"linear"};function kp(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 Bp(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 Sp(t){return 3===t||4===t}function wp(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 Tp=(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,c=(e.y1+e.y2)/2;let d=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":d=-1;break;case"right":d=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":d=Math.sin(g[i]*(Math.PI/180)),f=Math.cos(g[i]*(Math.PI/180));break;case"center":d=0,f=0}return{x:h+d*(n+v)+Math.sign(d)*(l/2),y:c+f*(n+p)+Math.sign(f)*(u/2)}},Pp=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 Mp(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}}function Cp(t,e,i,n,r,a){return Math.abs(e/t)<a/r?{x:i+(t>0?r:-r),y:n+e*r/Math.abs(t)}:{x:i+t*a/Math.abs(e),y:n+(e>0?a:-a)}}ev(),yv(),fv(),av();class Op extends rc{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Op.defaultAttributes,t)),this.name="label",this._onHover=t=>{const i=t.target;i===this._lastHover||e.isEmpty(i.states)||(i.addState(Nv.hover,!0),Sv(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Nv.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(Sv(this,(t=>{e.isEmpty(t.states)||(t.removeState(Nv.hoverReverse),t.removeState(Nv.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState("selected"))return this._lastSelect=null,void Sv(this,(t=>{e.isEmpty(t.states)||(t.removeState(Nv.selectedReverse),t.removeState(Nv.selected))}));e.isEmpty(i.states)||(i.addState(Nv.selected,!0),Sv(this,(t=>{t===i||e.isEmpty(t.states)||t.addState(Nv.selectedReverse,!0)})),this._lastSelect=i)},this._handleRelatedGraphicSetState=t=>{var e,i,n,r,a;if((null===(e=t.detail)||void 0===e?void 0:e.type)===mt.STATE||(null===(i=t.detail)||void 0===i?void 0:i.type)===mt.ANIMATE_UPDATE&&(null===(n=t.detail.animationState)||void 0===n?void 0:n.isFirstFrameOfStep)){const e=null!==(a=null===(r=t.target)||void 0===r?void 0:r.currentStates)&&void 0!==a?a:[];(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){}_createLabelLine(t,i){const n=function(t,i){if(!t||!i)return;if(e.isRectIntersect(t,i,!0))return;const n=Math.min(t.x1,t.x2),r=Math.min(t.y1,t.y2),a=Math.min(i.x1,i.x2),s=Math.min(i.y1,i.y2),o=Math.abs(t.x2-n)/2,l=Math.abs(t.y2-r)/2,u=Math.abs(i.x2-a)/2,h=Math.abs(i.y2-s)/2,c=n+o,d=r+l,f=a+u,v=s+h,p=f-c,g=v-d;return[Cp(p,g,c,d,o,l),Cp(-p,-g,f,v,u,h)]}(t.AABBBounds,null==i?void 0:i.AABBBounds);if(n){const t=fo.line({points:n});return i&&i.attribute.fill&&t.setAttribute("stroke",i.attribute.fill),this.attribute.line&&!e.isEmpty(this.attribute.line.style)&&t.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(t),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.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(o),e.isFunction(a)?s=a(s,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(s=this._overlapping(s)),s&&s.length&&s.forEach((t=>{this._bindEvent(t),this._setStatesOfText(t)})),!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;return fo.richtext(t)}if("html"===t.textType){t.textConfig=[],t.html=Object.assign(Object.assign({dom:t.text},zv),t);return fo.richtext(t)}return fo.text(t)}_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=Pp(n);if(r&&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({},Ap,this.attribute.animation,null!==(n=this.attribute.animationEnter)&&void 0!==n?n:{}),exit:e.merge({},Ap,this.attribute.animation,null!==(r=this.attribute.animationExit)&&void 0!==r?r:{}),update:e.isArray(this.attribute.animationUpdate)?this.attribute.animationUpdate:e.merge({},Ap,this.attribute.animation,null!==(a=this.attribute.animationUpdate)&&void 0!==a?a:{})})}}getRelatedGraphic(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.getRelatedGraphic(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),c=this.getGraphicBounds(h),d=e.isFunction(n)?n(o):n,f=this._isCollectionBase?this.getGraphicBounds(null,this._idToPoint.get(o.id),d):this.getGraphicBounds(l,{x:o.x,y:o.y},d),v=this.labeling(c,f,d,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:c=[],hideOnHit:d=!0,clampForce:f=!0,avoidMarks:v=[],overlapPadding:p}=s,g=this._bmpTool||hp(u.width,u.height),y=this._bitmap||g.bitmap(),b=c.some((t=>"bound"===t.type));h&&(null===(a=this._baseMarks)||void 0===a||a.forEach((t=>{t.AABBBounds&&y.setRange(cp(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(cp(g,t.AABBBounds,!0))})):t.AABBBounds&&y.setRange(cp(g,t.AABBBounds,!0))}));for(let i=0;i<t.length;i++){if(!1===t[i].visible)continue;const n=t[i],r=this.getRelatedGraphic(n.attribute);if(n.update(),!e.isRectIntersect(r.AABBBounds,{x1:0,x2:g.width,y1:0,y2:g.height},!0))continue;if(dp(g,y,n.AABBBounds,f,p)){if(!b){y.setRange(cp(g,n.AABBBounds,!0)),o.push(n);continue}if(b&&r&&r.AABBBounds&&this._canPlaceInside(n.AABBBounds,r.AABBBounds)){y.setRange(cp(g,n.AABBBounds,!0)),o.push(n);continue}}let a=!1;for(let e=0;e<c.length;e++)if(a=vp(g,y,c[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}=yp(n,g.width,g.height);if(0===t&&0===e){if(dp(g,y,n.AABBBounds)){y.setRange(cp(g,n.AABBBounds,!0)),o.push(n);continue}}else if(dp(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(cp(g,n.AABBBounds,!0)),o.push(n);continue}}!a&&!d&&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){var i;const n=new Map,r=this._graphicToText||new Map,a=[],s=[],{visible:o}=null!==(i=this.attribute.line)&&void 0!==i?i:{};t.forEach(((t,i)=>{const l=this.getRelatedGraphic(t.attribute),u=t.attribute.id,h=this._isCollectionBase?u:l,c=(null==r?void 0:r.get(h))?"update":"enter";let d;if(o&&(d=this._createLabelLine(t,l)),"enter"===c){if(a.push(t),n.set(h,d?{text:t,labelLine:d}:{text:t}),l){const{from:e,to:n}=mp(t.attribute,"fadeIn");this.add(t),d&&(s.push(d),this.add(d)),this._syncStateWithRelatedGraphic(l),this._animationConfig.enter.duration>0&&l.once("animate-bind",(r=>{t.setAttributes(e),d&&d.setAttributes(e);const o=this._afterRelatedGraphicAttributeUpdate(t,a,d,s,i,l,n,this._animationConfig.enter);l.on("afterAttributeUpdate",o)}))}}else if("update"===c){const i=r.get(h);r.delete(h),n.set(h,i);const a=i.text,{duration:s,easing:o}=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&&_p(t,i,e,r))}n.forEach(((n,r)=>{const{duration:a,easing:s,increaseEffect:o=!0,channel:l}=n,{from:u,to:h}=xp(t,i,l,n.options);e.isEmpty(h)||t.animate().to(h,a,s),"text"in u&&"text"in h&&o&&_p(t,i,a,s)}))}(a,t,this._animationConfig.update),i.labelLine&&d&&i.labelLine.animate().to(e.merge({},i.labelLine.attribute,{points:d.attribute.points}),s,o)}})),r.forEach((t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(mp(t.text.attribute,"fadeOut").to,this._animationConfig.exit.duration,this._animationConfig.exit.easing).onEnd((()=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)}))})),this._graphicToText=n}_renderWithOutAnimation(t){var e;const i=new Map,n=this._graphicToText||new Map,{visible:r}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t.forEach((t=>{const e=this.getRelatedGraphic(t.attribute),a=(null==n?void 0:n.get(e))?"update":"enter",s=this._isCollectionBase?t.attribute.id:e;let o;if(r&&(o=this._createLabelLine(t,e)),"enter"===a)i.set(s,o?{text:t,labelLine:o}:{text:t}),this.add(t),o&&this.add(o),this._syncStateWithRelatedGraphic(e);else if("update"===a){const e=n.get(s);n.delete(s),i.set(s,e),e.text.setAttributes(t.attribute),e.labelLine&&o&&e.labelLine.setAttributes({points:o.attribute.points})}})),n.forEach((t=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)})),this._graphicToText=i}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,n,r,a,s,{mode:o,duration:l,easing:u,delay:h}){const c=d=>{var f,v,p;const{detail:g}=d;if(!g)return{};const y=null===(f=g.animationState)||void 0===f?void 0:f.step;if(!(g.type===mt.ANIMATE_UPDATE&&y&&!("wait"===y.type&&null==(null===(v=y.prev)||void 0===v?void 0:v.type))))return{};if(g.type===mt.ANIMATE_END)return t.setAttributes(s),void(i&&i.setAttributes(s));const b=()=>{a&&(a.onAnimateBind=void 0,a.removeEventListener("afterAttributeUpdate",c))};switch(o){case"after":g.animationState.end&&(t.animate({onStart:b}).wait(h).to(s,l,u),i&&i.animate().wait(h).to(s,l,u));break;case"after-all":r===e.length-1&&g.animationState.end&&(e.forEach((t=>{t.animate({onStart:b}).wait(h).to(s,l,u)})),n.forEach((t=>{t.animate().wait(h).to(s,l,u)})));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!a.containsPoint(e.x,e.y,bt.LOCAL,null===(p=this.stage)||void 0===p?void 0:p.pickerService)||(t.animate({onStart:b}).wait(h).to(s,l,u),i&&i.animate().wait(h).to(s,l,u))}else g.animationState.isFirstFrameOfStep&&(t.animate({onStart:b}).wait(h).to(s,l,u),i&&i.animate().wait(h).to(s,l,u))}};return c}_smartInvert(t){var e,i,n,r,a;const s=this.attribute.smartInvert||{},{textType:o,contrastRatiosThreshold:l,alternativeColors:u,mode:h}=s,c=null!==(e=s.fillStrategy)&&void 0!==e?e:"invertBase",d=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"!==c||"null"!==d)for(let e=0;e<t.length;e++){const i=t[e];if(!i)continue;const n=this.getRelatedGraphic(i.attribute),r=n.attribute.fill,a=r,s=Pv(i.attribute.fill,r,o,l,u,h),g=Mv(s,f)?f:v;if(p){const t=Ev(c,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=Ev(d,a,s,g);e&&i.setAttributes({stroke:e})}else{if(this._canPlaceInside(i.AABBBounds,n.AABBBounds)){const t=Ev(c,a,s,g);if(t&&i.setAttributes({fill:t}),0===i.attribute.lineWidth)continue;const e=Ev(d,a,s,g);e&&i.setAttributes({stroke:e})}else{if(0===i.attribute.lineWidth)continue;if(i.attribute.stroke){i.setAttributes({fill:Pv(i.attribute.fill,i.attribute.stroke,o,l,u,h)});continue}const t=Ev(c,a,s,g);t&&i.setAttributes({fill:t});const e=Ev(d,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}}Op.defaultAttributes={textStyle:{fontSize:12,textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},offset:0,pickable:!1};class Ep extends Op{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ep.defaultAttributes,t)),this.name="symbol-label"}labeling(t,e,i="top",n=0){return Tp(t,e,i,n)}}Ep.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class Lp extends Op{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Lp.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),c=Math.abs(e.y2-e.y1);let d=(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}d+=v*h,f+=p*c;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:d+g*n+g*l/2,y:f+y*n+y*u/2}}}Lp.tag="rect-label",Lp.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};class Rp extends Op{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Rp.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 Mp(t,e,i,n)}}Rp.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Ip{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 jp extends Op{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},jp.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}));if(r){const t={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,maxLineWidth:r.labelLimit,points:r.pointA&&r.pointB&&r.pointC?[r.pointA,r.pointB,r.pointC]:void 0,line:r.labelLine};e[i].setAttributes(t)}}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,d=Bp(u.endAngle-l/2),f=kp(h.x,h.y,u.outerRadius,s),v=kp(h.x,h.y,o+i.line.line1MinLength,s),p=new Ip(t,f,v,d,l,s,u.innerRadius,u.outerRadius,h);p.pointA=kp(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===(c=p.quadrant)||2===c?this._arcRight.set(p.refDatum,p):Sp(p.quadrant)&&this._arcLeft.set(p.refDatum,p)}var c}));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=s.position)&&void 0!==r?r:"inside",u=null!==(a=s.offsetRadius)&&void 0!==a?a:-o;return t.forEach((t=>{var n,r,a;const{labelSize:h,radian:c}=t,d=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(c<v)p=0;else{let t;t=c>=Math.PI?d:Math.max(d,h.height/2/Math.tan(c/2)),p=f-t-o}!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?d-u+x:f+u-x,t.labelPosition=kp(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=i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:t.middleAngle;let _=null!==(a=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;const o=null!==(r=n[0].attribute.x)&&void 0!==r?r:0,l=2*(null!==(a=n[0].attribute.y)&&void 0!==a?a:0),u=i.line.line2MinLength,h=i.layout,c=i.spaceWidth;if(t.forEach((t=>{const e=Sp(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+u+c),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==i.coverEnable||"none"===h.strategy){for(const e of t){const{labelPosition:t,labelSize:r}=e;e.labelLimit=r.width,e.pointB=Sp(e.quadrant)?{x:t.x+r.width/2+u+c,y:t.y}:{x:t.x-r.width/2-u-c,y:t.y},this._computeX(e,i,n)}!1===i.coverEnable&&"none"===h.strategy&&this._coverLabels(t)}else{const e=l/((null===(s=i.textStyle)||void 0===s?void 0:s.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(l,Math.max(n,t.maxY)),t}),{minY:1/0,maxY:-1/0}),o=Math.max(Math.abs(l/2-r),Math.abs(a-l/2)),u=this._computeLayoutRadius(o,i,n);for(const e of t)this._computePointB(e,u,i,n),this._computeX(e,i,n)}const d=2*o;return t.forEach((t=>{var n,r;t.labelVisible&&(e.isLess(t.pointB.x,u+c)||e.isGreater(t.pointB.x,d-u-c))&&(t.labelVisible=!1),t.angle=null!==(r=null===(n=i.textStyle)||void 0===n?void 0:n.angle)&&void 0!==r?r:0,i.offsetAngle&&(t.angle+=i.offsetAngle),t.labelLine=Object.assign({},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,c=null===(r=i.layout)||void 0===r?void 0:r.align,d=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=Sp(v)?-1:1;let b=0;let m=(y>0?s-p.x:p.x)-h-d;"labelLine"===c&&(b=(g+u+h)*y+a.x,m=(y>0?s-b:b)-d);const x=this._getFormatLabelText(t.refDatum,m);t.labelText=x;let _=Math.min(m,t.labelSize.width);switch(c){case"labelLine":break;case"edge":b=y>0?s-_-d:_+d;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"===c){const t=0;f.x=(y>0?s+t:t)-y*A}else{const t=0;f.x=b+t+y*(d+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,c=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"===c?Sp(t.quadrant)?"left":"right":Sp(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;a=r[0].attribute.x;const o=2*(null!==(s=r[0].attribute.y)&&void 0!==s?s:0),l=n.layout;if("vertical"===l.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>o;e--)t[e].labelVisible=!1}else if("none"!==l.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,u=-1/0;for(let h=0;h<i&&h<t.length;h++){this._storeY(t);const i=a[h].arc;this._computeYRange(i,n,r),i.labelVisible=!0;const c=i.labelPosition.y,{lastIndex:d,nextIndex:f}=this._findNeighborIndex(t,a[h]),v=t[d],p=t[f];if(-1===d&&-1!==f){const e=p.labelPosition.y;c>e?i.labelPosition.y=e-p.labelSize.height/2-i.labelSize.height/2:this._twoWayShift(t,i,p,f)}else if(-1!==d&&-1===f){const e=v.labelPosition.y;c<e?i.labelPosition.y=e+v.labelSize.height/2+i.labelSize.height/2:this._twoWayShift(t,v,i,a[h].originIndex)}else if(-1!==d&&-1!==f){const e=v.labelPosition.y,n=p.labelPosition.y;c>n?(i.labelPosition.y=n-p.labelSize.height/2-i.labelSize.height/2,this._twoWayShift(t,v,i,a[h].originIndex)):c<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[h].originIndex),this._twoWayShift(t,i,p,f))}const g=Math.min(s,a[h].originIndex),y=Math.max(u,a[h].originIndex);let b;if(b=t[y].getLabelBounds().y2-o,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-o,e.isGreater(b,0)){i.labelVisible=!1,this._restoreY(t);break}l.tangentConstraint&&!this._checkYRange(t)?(i.labelVisible=!1,this._restoreY(t)):(s=g,u=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),c=Math.sqrt(i**2-Math.abs(r.y-s.y)**2)-h;e.isValidNumber(c)?t.pointB={x:r.x+c*(Sp(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,c=this.computeRadius(o,i.width,i.height),d=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),c=-(e*u+i)/t;return 0===l?[{x:c,y:u}]:[{x:c,y:u},{x:-(e*h+i)/t,y:h}]}(p,g,y,l+c-d,0,d);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)?e.isGreater(t.middleAngle,-Math.PI)&&e.isLess(t.middleAngle,0)||e.isGreater(t.middleAngle,Math.PI)&&e.isLess(t.middleAngle,2*Math.PI)?(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();wp(e,n)?t[i].labelVisible=!1:e=n}}_createLabelLine(t,e){var i,n,r,a,s,o,l;const{points:u,line:h={},visible:c,fill:d}=t.attribute,f=t.attribute.points?fo.line({visible:null===(r=null!==(i=h.visible&&c)&&void 0!==i?i:null===(n=t.attribute)||void 0===n?void 0:n.visible)||void 0===r||r,stroke:null!==(s=null===(a=h.style)||void 0===a?void 0:a.stroke)&&void 0!==s?s:d,lineWidth:null!==(l=null===(o=h.style)||void 0===o?void 0:o.lineWidth)&&void 0!==l?l:1,points:u,curveType:h.smooth?"basis":null}):void 0;return f&&this._setStatesOfLabelLine(f),f}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}}jp.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 Dp extends Op{constructor(t){super(e.merge({},Dp.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 Mp(t,e,i,n)}}Dp.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"end",offset:6,pickable:!1};class Np extends Op{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Np.defaultAttributes,t)),this.name="line-data-label"}labeling(t,e,i="top",n=0){return Tp(t,e,i,n)}}Np.defaultAttributes={textStyle:{fontSize:12,fill:"#000",textAlign:"center",textBaseline:"middle",boundsPadding:[-1,0,-1,0]},position:"top",offset:5,pickable:!1};const Up={rect:Lp,symbol:Ep,arc:jp,line:Rp,area:Dp,"line-data":Np};class zp extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},zp.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=hp(r,a),o=s.bitmap(),l=new Map,u=this._componentMap;for(let e=0;e<i.length;e++){const n=i[e],r=Up[n.type]||Op;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()}))}}function Hp(){ev(),av(),uv(),pv()}zp.defaultAttributes={pickable:!1},Hp();class Wp extends rc{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({},Wp.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=fo.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=fo.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(t&&t.visible){const s=this._startAngle,o=this._endAngle,{state:l}=this.attribute,u=n[0],h=n[n.length-1],{refX:c=0,refY:d=0,refAngle:f=0,style:v,symbolType:p,size:g=12}=t;let y,b;"start"===i?(y={x:u.x+(e.isValidNumber(s)?c*Math.cos(s)+d*Math.cos(s-Math.PI/2):0),y:u.y+(e.isValidNumber(s)?c*Math.sin(s)+d*Math.sin(s-Math.PI/2):0)},b=s+Math.PI/2):(y={x:h.x+(e.isValidNumber(o)?c*Math.cos(o)+d*Math.cos(o-Math.PI/2):0),y:h.y+(e.isValidNumber(o)?c*Math.sin(o)+d*Math.sin(o-Math.PI/2):0)},b=o+Math.PI/2),a=fo.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(e.visible){const i=e.clip?e.size||10:0;n=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...n.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,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 Vp,Fp;Wp.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,(Vp=t.AXIS_ELEMENT_NAME||(t.AXIS_ELEMENT_NAME={})).innerView="inner-view",Vp.axisContainer="axis-container",Vp.labelContainer="axis-label-container",Vp.tickContainer="axis-tick-container",Vp.tick="axis-tick",Vp.subTick="axis-sub-tick",Vp.label="axis-label",Vp.title="axis-title",Vp.gridContainer="axis-grid-container",Vp.grid="axis-grid",Vp.gridRegion="axis-grid-region",Vp.line="axis-line",Vp.background="axis-background",Vp.axisLabelBackground="axis-label-background",t.AxisStateValue=void 0,(Fp=t.AxisStateValue||(t.AxisStateValue={})).selected="selected",Fp.selectedReverse="selected_reverse",Fp.hover="hover",Fp.hoverReverse="hover_reverse";const Gp={[t.AxisStateValue.selectedReverse]:{},[t.AxisStateValue.selected]:{},[t.AxisStateValue.hover]:{},[t.AxisStateValue.hoverReverse]:{}},Yp={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 $p extends rc{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(Nv.hover,!0),Sv(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Nv.hoverReverse,!0)})),this._lastHover=i)},this._onUnHover=t=>{this._lastHover&&(Sv(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Nv.hoverReverse),t.removeState(Nv.hover))})),this._lastHover=null)},this._onClick=t=>{const i=t.target;if(this._lastSelect===i&&i.hasState(Nv.selected))return this._lastSelect=null,void Sv(this.axisContainer,(t=>{t.name&&!e.isEmpty(t.states)&&(t.removeState(Nv.selectedReverse),t.removeState(Nv.selected))}));i.name&&!e.isEmpty(i.states)&&(i.addState(Nv.selected,!0),Sv(this.axisContainer,(t=>{t!==i&&t.name&&!e.isEmpty(t.states)&&t.addState(Nv.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=fo.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=fo.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=fo.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),a&&a.visible&&this.renderLine(o),s&&s.length&&(this.data=this._transformItems(s[0]),r&&r.visible&&this.renderTicks(o),n&&n.visible)){const e=fo.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);let a=0,o=0,l="center",u="middle";r.forEach((t=>{var e;const i=t.attribute,n=null!==(e=i.angle)&&void 0!==e?e:0,r=t.AABBBounds;let s=r.width(),h=r.height();n&&(s=Math.abs(s*Math.cos(n)),h=Math.abs(h*Math.sin(n))),a=Math.max(a,s),o=Math.max(o,h),l=i.textAlign,u=i.textBaseline})),this.axisLabelLayerSize[i]={width:a,height:o,textAlign:l,textBaseline:u}}))}i&&i.visible&&this.renderTitle(o)}renderTicks(i){const n=this.getTickLineItems(),r=fo.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=fo.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=Uv;else{const t=this.data[a],i=e.merge({},Uv,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(a&&a.visible){const i=this.getSubTickLineItems();i.length&&i.forEach(((i,s)=>{const o=fo.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=Uv;else{const t=e.merge({},Uv,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=fo.group({x:0,y:0,pickable:!1});return o.name=`${t.AXIS_ELEMENT_NAME.labelContainer}-layer-${r}`,o.id=this._getNodeId(`label-container-layer-${r}`),i.add(o),s.forEach(((i,n)=>{var a,l,u;const h=this._getLabelAttribute(i,n,s,r);let c;if("rich"===h.type?(h.textConfig=h.text,h.width=null!==(a=h.width)&&void 0!==a?a:0,h.height=null!==(l=h.height)&&void 0!==l?l:0,c=fo.richtext(h)):"html"===h.type?(h.textConfig=[],h.html=Object.assign(Object.assign({dom:h.text},zv),h),c=fo.richtext(h)):c=fo.text(h),c.name=t.AXIS_ELEMENT_NAME.label,c.id=this._getNodeId(`layer${r}-label-${i.id}`),e.isEmpty(null===(u=this.attribute.label)||void 0===u?void 0:u.state))c.states=Uv;else{const t=e.merge({},Uv,this.attribute.label.state);Object.keys(t).forEach((a=>{e.isFunction(t[a])&&(t[a]=t[a](i,n,s,r))})),c.states=t}o.add(c)})),o}renderTitle(e){const i=this.getTitleAttribute(),n=new Fv(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(Yp,`${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:c}=i;return Object.assign({points:[o,l],anchor:u,alpha:h,beta:c},a)}_getLabelAttribute(t,i,n,r){var a,s;const{space:o=4,inside:l=!1,formatMethod:u,type:h="text",text:c}=this.attribute.label;let d=o,f=0;(null===(a=this.attribute.tick)||void 0===a?void 0:a.visible)&&this.attribute.tick.inside===l&&(f=this.attribute.tick.length||4),(null===(s=this.attribute.subTick)||void 0===s?void 0:s.visible)&&this.attribute.subTick.inside===l&&(f=Math.max(f,this.attribute.subTick.length||2)),d+=f;const v=this.getRelativeVector(t.point);r>0&&(0===v[1]?d+=(this.axisLabelLayerSize[r-1].height+e.get(this.attribute,"label.space",4))*r:d+=(this.axisLabelLayerSize[r-1].width+e.get(this.attribute,"label.space",4))*r);const p=this.getVerticalCoord(t.point,d,l),g=this.getVerticalVector(d||1,l,p),y=u?u(`${t.label}`,t,i,n,r):t.label;let{style:b}=this.attribute.label;b=e.isFunction(b)?e.merge({},Yp.label.style,b(t,i,n,r)):b;const m=this.getLabelAlign(g,l,b.angle);return b=e.merge(m,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(p,g,y,b)),{text:null!=c?c:y,lineHeight:null==b?void 0:b.fontSize,type:h}),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 Xp(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 qp={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&&Kp(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function Kp(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 Zp(t,e){for(let i,n=1,r=t.length,a=t[0];n<r;a=i,++n)if(Kp(a,i=t[n],e))return!0}function Jp(t){const e=t.AABBBounds;return e.width()>1&&e.height()>1}function Qp(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 tg(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},ig(t,e.attribute.angle)),{angle:eg(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({},ng(t,e.attribute.angle)),{angle:eg(e.attribute.angle)}))}))}(t,e),Xp(e)}function eg(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 ig(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=eg(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 ng(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=eg(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 rg{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 Lv([r[1],-1*r[0]],t*(e?1:-1)*n)}}function ag(){ev(),av(),fv(),yv()}ag(),cv();class sg extends $p{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},sg.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=fo.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({},Gp,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:c,breakShapeStyle:d,state:f}=s,v=Av(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({},Gp,f),symbol:e.merge({},Gp,f)});const g=new Wp(p);g.name=t.AXIS_ELEMENT_NAME.line,g.id=this._getNodeId("line"),i.add(g)}getTitleAttribute(){var t,i,n;const r=this.attribute.title,{position:a="middle",space:s=4,textStyle:o={},autoRotate:l=!0,shape:u,background:h,state:c={}}=r,d=Av(r,["position","space","textStyle","autoRotate","shape","background","state"]);let f=.5;"start"===a?f=0:"end"===a&&(f=1);const{verticalFactor:v=1}=this.attribute,p=-1*v,g=this.getTickCoord(f),y=this.getRelativeVector();let b=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){const t=+e.get(this.attribute,"label.space",4);b+=t;const i=Object.keys(this.axisLabelLayerSize).length;if(0===y[1]){const e=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(e)?b+=e+(i-1)*t:b=0}else{if(0===y[0]){const e=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.width():0;isFinite(e)?b+=e+(i-1)*t:b=0}else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{b+=this.axisLabelLayerSize[e].width+(i>0?t:0)}));const e=this.axisLabelLayerSize[0].textAlign,n="start"===e||"left"===e,r="center"===e,a=y[1]>0;b=1===p?a?n?b:r?b/2:t:n?t:r?b/2:b:a?n?t:r?b/2:b:n?b:r?b/2:t}}let m=0;(null===(i=this.attribute.tick)||void 0===i?void 0:i.visible)&&!1===this.attribute.tick.inside&&(m=this.attribute.tick.length||4),(null===(n=this.attribute.subTick)||void 0===n?void 0:n.visible)&&!1===this.attribute.subTick.inside&&(m=Math.max(m,this.attribute.subTick.length||2));const x=m+b+s,_=this.getVerticalCoord(g,x,!1),A=this.getVerticalVector(x,!1,{x:0,y:0});let k,B,{angle:S}=d;if(k="start"===a?"start":"end"===a?"end":"center",e.isNil(S)&&l){S=Rv(y,[1,0],!0);const{verticalFactor:t=1}=this.attribute;B=1===-1*t?"bottom":"top"}else k=this.getTextAlign(A),B=this.getTextBaseline(A,!1);const w=Object.assign(Object.assign(Object.assign({},_),d),{textStyle:Object.assign({textAlign:k,textBaseline:B},o),state:{text:e.merge({},Gp,c.text),shape:e.merge({},Gp,c.shape),panel:e.merge({},Gp,c.background)}});return w.angle=S,u&&u.visible&&(w.shape=Object.assign({visible:!0},u.style),u.space&&(w.space=u.space)),h&&h.visible&&(w.panel=Object.assign({visible:!0},h.style)),w}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)||0===t[0]&&0===t[1]){if("top"===r||"bottom"===r)return ig(r,n);if("left"===r||"right"===r)return ng(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:c,autoRotateAngle:d,autoLimit:f,limitEllipsis:v,autoHide:p,autoHideMethod:g,autoHideSeparation:y,lastVisible:b}=o;if(e.isFunction(h))h(t,i,r,this);else{if(c&&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)})),tg(n,t),!Qp(t))break}}(t,{labelRotateAngle:d,orient:l}),f&&e.isValidNumber(u)&&u>0){const i="left"!==l&&"right"!==l||!t.some((t=>"vertical"===t.attribute.direction))?1/0:Math.abs(this.attribute.start.y-this.attribute.end.y)/t.length;!function(t,i){const{limitLength:n,verticalLimitLength:r,ellipsis:a="...",orient:s}=i;!e.isEmpty(t)&&e.isValidNumber(n)&&t.forEach((t=>{if(("top"===s||"bottom"===s)&&Math.floor(t.AABBBounds.height())<=n)return;const i=t.attribute.direction;if(("left"===s||"right"===s)&&("vertical"===i&&Math.floor(t.AABBBounds.height())<=r||"vertical"!==i&&Math.floor(t.AABBBounds.width())<=n))return;const o=t.attribute.angle;let l=0===o||e.isNil(o)?"top"===s||"bottom"===s?null:"vertical"===i?r:n:Math.abs(n/Math.sin(o));e.isValidNumber(t.attribute.maxLineWidth)&&(l=e.isValidNumber(l)?Math.min(t.attribute.maxLineWidth,l):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:l,ellipsis:t.attribute.ellipsis||a})}))}(t,{limitLength:u,verticalLimitLength:i,ellipsis:v,orient:l})}p&&function(t,i){if(e.isEmpty(t))return;const n=t.filter(Jp);if(e.isEmpty(n))return;let r;r=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(n),Xp(r);const{method:a="parity",separation:s=0}=i,o=e.isFunction(a)?a:qp[a]||qp.parity;if(r.length>=3&&Zp(r,s)){do{r=o(r,s)}while(r.length>=3&&Zp(r,s));if(r.length<3||i.lastVisible){const t=e.last(n);if(!t.attribute.opacity){const e=r.length;if(e>1){t.setAttribute("opacity",1);for(let i=e-1;i>=0&&Kp(r[i],t,s);i--)r[i].setAttribute("opacity",0)}}}}n.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:l,method:g,separation:y,lastVisible:b})}}afterLabelsOverlap(i,n,r,a,s){const{verticalLimitSize:o,orient:l}=this.attribute,u="bottom"===l||"top"===l,h=r.AABBBounds;let c=u?h.height():h.width();const{verticalMinSize:d}=this.attribute;if(e.isValidNumber(d)&&(!e.isValidNumber(o)||d<=o)){const e=this._getAxisLabelLimitLength(d,s);let i,n;c=Math.max(c,e),"left"===l?(i=h.x2-c,n=h.y1):"right"===l?(i=h.x1,n=h.y1):"top"===l?(i=h.x1,n=h.y2-c):"bottom"===l&&(i=h.x1,n=h.y1);const a=fo.rect({x:i,y:n,width:u?h.width():c,height:u?c: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,c,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 c=t,d=0,f=0;const v=l&&l.visible?null!==(r=l.style.lineWidth)&&void 0!==r?r:1:0,p=u&&u.visible?null!==(a=u.length)&&void 0!==a?a:4:0;if(o&&o.visible&&"string"==typeof o.text){d=Wv(o.text,o.textStyle).height;const t=e.normalizePadding(o.padding);f=o.space+t[0]+t[2]}return c&&(c=(c-h-f-d-v-p)/i),c}}sg.defaultAttributes=Yp,e.mixin(sg,rg);class og{isInValidValue(t){const{startAngle:e=Iv,endAngle:i=jv}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:i=Iv,endAngle:n=jv,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 Lv(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 lg=(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 ug(t,i,n){return!e.isLess(t,i,0,1e-6)&&!e.isGreater(t,n,0,1e-6)}ag(),Qf();class hg extends $p{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},hg.defaultAttributes,t))}renderLine(i){const{startAngle:n=Iv,endAngle:r=jv,radius:a,center:s,innerRadius:o=0,line:l={},inside:u=!1}=this.attribute;let h=a,c=o;u&&o>0&&(h=o,c=0);const d=Object.assign(Object.assign(Object.assign({},s),{startAngle:n,endAngle:r,radius:h,innerRadius:c}),l.style),f=fo.circle(d);f.name=t.AXIS_ELEMENT_NAME.line,f.id=this._getNodeId("line"),e.isEmpty(l.state)||(f.states=e.merge({},Gp,l.state)),i.add(f)}getTitleAttribute(){var t,i,n;const{center:r,radius:a,innerRadius:s=0}=this.attribute,o=this.attribute.title,{space:l=4,textStyle:u={},shape:h,background:c,state:d={}}=o,f=Av(o,["space","textStyle","shape","background","state"]);let v=r,p=0;(null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside&&(p=e.get(this.attribute.label,"style.fontSize",12)+e.get(this.attribute.label,"space",4));let g=0;(null===(i=this.attribute.tick)||void 0===i?void 0:i.visible)&&!1===this.attribute.tick.inside&&(g=this.attribute.tick.length||4),(null===(n=this.attribute.subTick)||void 0===n?void 0:n.visible)&&!1===this.attribute.subTick.inside&&(g=Math.max(g,this.attribute.subTick.length||2));const y=a+g+p+l;let b="middle",{position:m}=this.attribute.title;e.isNil(m)&&(m=0===s?"end":"middle"),"start"===m?(b="bottom",v={x:r.x,y:r.y-y}):"end"===m&&(b="top",v={x:r.x,y:r.y+y});const x=Object.assign(Object.assign(Object.assign({},v),f),{textStyle:Object.assign({textBaseline:b,textAlign:"center"},u),state:{text:e.merge({},Gp,d.text),shape:e.merge({},Gp,d.shape),panel:e.merge({},Gp,d.background)}}),{angle:_}=f;return x.angle=_,h&&h.visible&&(x.shape=Object.assign({visible:!0},h.style),h.space&&(x.space=h.space)),c&&c.visible&&(x.panel=Object.assign({visible:!0},c.style)),x}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),c=this.getTickCoord(h),d=this.getVerticalCoord(c,s,a);n.push({start:c,end:d,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=vo(Object.assign({text:i},n)),a=r.width(),s=r.height(),o=lg(Math.atan2(e[1],e[0]))-Math.PI,l=3*Math.PI/4,u=Math.PI/4,h=Math.PI/2,c=t.x;let d=0;d=ug(o,-l,-u)?((o+l)/h-.5)*a:ug(o,u,l)?(.5-(o-u)/h)*a:Math.cos(o)>=0?.5*a:.5*-a;const f=c-d,v=t.y;let p=0;return p=ug(o,-l,-u)?.5*-s:ug(o,u,l)?.5*s:Math.cos(o)>=0?(.5-(u-o)/h)*s:(.5-lg(o-l)/h)*s,{x:f,y:v-p}}(t,e,i,n)}}hg.defaultAttributes=Yp,e.mixin(hg,og);function cg(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 dg(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 fg(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=cg(t,!!a),l=cg(s,!!a);const h=e.PointService.distancePP(r,u),c=e.PointService.distancePP(i,u);o+=`A${h},${h},0,0,1,${r.x},${r.y}L${r.x},${r.y}`,l+=`A${c},${c},0,0,0,${i.x},${i.y}`}else if("circle"===r){const{center:e}=n;o=dg(e,t,!1,!!a),l=dg(e,s,!0,!!a)}else"line"!==r&&"polygon"!==r||(o=cg(t,!!a),l=cg(s,!!a));return a?o+=l:(l="L"+l.substring(1),o+=l,o+="Z"),o}class vg extends rc{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=fo.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,c=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=cg(s,!!l);else if("circle"===a){const{center:t}=this.attribute;u=dg(t,s,!1,!!l)}const d=fo.path(Object.assign({path:u,z:h},e.isFunction(o)?e.merge({},this.skipDefault?null:vg.defaultAttributes.style,o(t,i)):o));d.name=`${c}-line`,d.id=this._getNodeId(`${c}-path-${r}`),n.add(d)})),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,d=a[1].y-a[0].y,f=Math.sqrt(u*u+d*d),v=h/f;s.push({x:a[0].x+u*v,y:a[0].y+d*v});const p=cg(s,!!l),g=e.abs(s[0].x-s[1].x),y=e.abs(s[0].y-s[1].y),b=fo.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:vg.defaultAttributes.style,o(t,i)):o));b.name=`${c}-line`,b.id=this._getNodeId(`${c}-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=fg(e,a,r),l=fo.path({path:o,fill:i(t)});l.name=`${c}-region`,l.id=this._getNodeId(`${c}-region-${t}`),n.add(l)}}}_getNodeId(t){return`${this.id}-${t}`}}vg.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}},ev(),ov();class pg extends vg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},vg.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=Iv,endAngle:s=jv}=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(pg,rg),ev(),ov();class gg extends vg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},vg.defaultAttributes,t),i)}getGridAttribute(t){let i,n=[];const r=this.attribute,{radius:a,innerRadius:s=0,startAngle:o=Iv,endAngle:l=jv,center:u,subGrid:h}=r,c=Av(r,["radius","innerRadius","startAngle","endAngle","center","subGrid"]),{alignWithLabel:d=!0}=c||{},f=a-s;let v=1;if(this.data.length>=2&&(v=this.data[1].value-this.data[0].value),t){i=e.merge({},c,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(!d){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:d?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=c;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(!d){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(gg,og);const yg="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",bg={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,triggerMinSize:0,symbolType:yg,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:yg,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},mg={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};var xg;t.DataZoomActiveTag=void 0,(xg=t.DataZoomActiveTag||(t.DataZoomActiveTag={})).startHandler="startHandler",xg.endHandler="endHandler",xg.middleHandler="middleHandler",xg.background="background";const _g={debounce:e.debounce,throttle:e.throttle};Vv(),cv(),pv(),Zf(),av();class Ag extends rc{setPropsFromAttrs(){const{start:t,end:i,orient:n,previewData:r,previewPointsX:a,previewPointsY:s,previewPointsX1:o,previewPointsY1:l}=this.attribute;t&&(this.state.start=t),i&&(this.state.end=i);const{width:u,height:h}=this.getLayoutAttrFromConfig();this._spanCache=this.state.end-this.state.start,this._isHorizontal="top"===n||"bottom"===n,this._layoutCache.max=this._isHorizontal?u:h,this._layoutCache.attPos=this._isHorizontal?"x":"y",this._layoutCache.attSize=this._isHorizontal?"width":"height",r&&(this._previewData=r),e.isFunction(a)&&(this._previewPointsX=a),e.isFunction(s)&&(this._previewPointsY=s),e.isFunction(o)&&(this._previewPointsX1=o),e.isFunction(l)&&(this._previewPointsY1=l)}constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},Ag.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._startHandlerMask):"end"===i?(this._activeTag=t.DataZoomActiveTag.endHandler,this._activeItem=this._endHandlerMask):"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),"browser"===wh.env&&(wh.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.addEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._onHandlerPointerMove=_g[this.attribute.delayType]((e=>{e.stopPropagation();const{start:i,end:n,brushSelect:r,realTime:a=!0}=this.attribute,s=this.eventPosToStagePos(e),{attPos:o,max:l}=this._layoutCache,u=(s[o]-this._activeCache.lastPos[o])/l;let{start:h,end:c}=this.state;this._activeState&&(this._activeTag===t.DataZoomActiveTag.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+u):this._activeTag===t.DataZoomActiveTag.startHandler?h+u>c?(h=c,c=h+u,this._activeTag=t.DataZoomActiveTag.endHandler):h+=u:this._activeTag===t.DataZoomActiveTag.endHandler&&(c+u<h?(c=h,h=c+u,this._activeTag=t.DataZoomActiveTag.startHandler):c+=u),this._activeCache.lastPos=s,r&&this.renderDragMask()),h=Math.min(Math.max(h,0),1),c=Math.min(Math.max(c,0),1),i===h&&n===c||(this.setStateAttr(h,c,!0),this._dispatchEvent("change",{start:h,end:c,tag:this._activeTag}))}),this.attribute.delayTime);const{position:r,showDetail:a}=i;this._activeCache.startPos=r,this._activeCache.lastPos=r,this._showText="auto"!==a&&a,this.setPropsFromAttrs()}setAttributes(t,e){super.setAttributes(t,e),this.setPropsFromAttrs()}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandlerMask&&this._endHandlerMask.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 i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),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,i))),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;const{x:n,y:r}=wh.mapToCanvasPoint(t);return{x:n-((null===(e=this.stage)||void 0===e?void 0:e.x)||0),y:r-((null===(i=this.stage)||void 0===i?void 0:i.y)||0)}}_onHandlerPointerUp(e){e.preventDefault();const{start:i,end:n,brushSelect:r,realTime:a=!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,r&&this.renderDragMask(),a&&i===this.state.start&&n===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag})),"browser"===wh.env&&(wh.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.removeEventListener("pointerup",this._onHandlerPointerUp.bind(this))),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})}_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")}isTextOverflow(t,e,i,n,r){const{width:a,height:s}=i.fullMeasure(n);if(this._isHorizontal)if("start"===r){if(e.x-a<t.x1)return!0}else{if(e.x+a>t.x2)return!0}else if("start"===r){if(e.y-s<t.y1)return!0}else{if(e.y+s>t.y2)return!0}return!1}renderText(){const{startTextStyle:t,endTextStyle:i}=this.attribute,{formatMethod:n}=t,r=Av(t,["formatMethod"]),{formatMethod:a}=i,s=Av(i,["formatMethod"]),{start:o,end:l}=this.state;this._startValue=this._statePointToData(o),this._endValue=this._statePointToData(l);const{position:u,width:h,height:c}=this.getLayoutAttrFromConfig(),d=n?n(this._startValue):this._startValue,f=a?a(this._endValue):this._endValue,v=new e.TextMeasure({defaultFontParams:r.textStyle}),p=new e.TextMeasure({defaultFontParams:s.textStyle}),g={x1:u.x,y1:u.y,x2:u.x+h,y2:u.y+c};let y,b,m,x;this._isHorizontal?(y={x:u.x+o*h,y:u.y+c/2},b={x:u.x+l*h,y:u.y+c/2},m={textAlign:this.isTextOverflow(g,y,v,d,"start")?"left":"right",textBaseline:"middle"},x={textAlign:this.isTextOverflow(g,b,p,f,"end")?"right":"left",textBaseline:"middle"}):(y={x:u.x+h/2,y:u.y+o*c},b={x:u.x+h/2,y:u.y+l*c},m={textAlign:"center",textBaseline:this.isTextOverflow(g,y,v,d,"start")?"top":"bottom"},x={textAlign:"center",textBaseline:this.isTextOverflow(g,b,p,f,"end")?"bottom":"top"}),this._startText=this.maybeAddLabel(this._container,e.merge({},r,{text:d,x:y.x,y:y.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:m}),`data-zoom-start-text-${u}`),this._endText=this.maybeAddLabel(this._container,e.merge({},s,{text:f,x:b.x,y:b.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:x}),`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:c}=a,d=null!==(e=null===(t=o.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let f,v,p;o.visible?this._isHorizontal?(f=h,v=c-d,p={x:r.x,y:r.y+d}):(f=h-d,v=c,p={x:r.x+("left"===s?d:0),y:r.y}):(f=h,v=c,p=r);const g=null!==(i=l.size)&&void 0!==i?i:this._isHorizontal?v:f,y=null!==(n=u.size)&&void 0!==n?n:this._isHorizontal?v:f;return 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,c,d,f,v,p,g,y;this._layoutAttrFromConfig=null;const{orient:b,backgroundStyle:m,backgroundChartStyle:x={},selectedBackgroundStyle:_={},selectedBackgroundChartStyle:A={},middleHandlerStyle:k={},startHandlerStyle:B={},endHandlerStyle:S={},brushSelect:w,zoomLock:T}=this.attribute,{start:P,end:M}=this.state,{position:C,width:O,height:E}=this.getLayoutAttrFromConfig(),L=null!==(t=B.triggerMinSize)&&void 0!==t?t:40,R=null!==(e=S.triggerMinSize)&&void 0!==e?e:40,I=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=I,this._background=I.createOrUpdateChild("background",Object.assign(Object.assign({x:C.x,y:C.y,width:O,height:E,cursor:w?"crosshair":"auto"},m),{pickable:!T}),"rect"),(null===(i=x.line)||void 0===i?void 0:i.visible)&&this.setPreviewAttributes("line",I),(null===(n=x.area)||void 0===n?void 0:n.visible)&&this.setPreviewAttributes("area",I),w&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=I.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:C.x+P*O,y:C.y,width:(M-P)*O,height:E,cursor:w?"crosshair":"move"},_),{pickable:!T}),"rect"):this._selectedBackground=I.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:C.x,y:C.y+P*E,width:O,height:(M-P)*E,cursor:w?"crosshair":"move"},_),{pickable:!T}),"rect"),(null===(r=A.line)||void 0===r?void 0:r.visible)&&this.setSelectedPreviewAttributes("line",I),(null===(a=A.area)||void 0===a?void 0:a.visible)&&this.setSelectedPreviewAttributes("area",I),this._showText&&this.renderText(),this._isHorizontal){if(k.visible){const t=(null===(s=k.background)||void 0===s?void 0:s.size)||10;this._middleHandlerRect=I.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:C.x+P*O,y:C.y-t,width:(M-P)*O,height:t},null===(o=k.background)||void 0===o?void 0:o.style),{pickable:!T}),"rect"),this._middleHandlerSymbol=I.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:C.x+(P+M)/2*O,y:C.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(u=null===(l=k.icon)||void 0===l?void 0:l.symbolType)&&void 0!==u?u:"square"},k.icon),{pickable:!T}),"symbol")}this._startHandler=I.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:C.x+P*O,y:C.y+E/2,size:E,symbolType:null!==(h=B.symbolType)&&void 0!==h?h:"square"},mg.horizontal),B),{pickable:!T}),"symbol"),this._endHandler=I.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:C.x+M*O,y:C.y+E/2,size:E,symbolType:null!==(c=S.symbolType)&&void 0!==c?c:"square"},mg.horizontal),S),{pickable:!T}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),L),e=Math.max(this._startHandler.AABBBounds.height(),L),i=Math.max(this._endHandler.AABBBounds.width(),R),n=Math.max(this._endHandler.AABBBounds.height(),R);this._startHandlerMask=I.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:C.x+P*O-t/2,y:C.y+E/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},mg.horizontal),{pickable:!T}),"rect"),this._endHandlerMask=I.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:C.x+M*O-i/2,y:C.y+E/2-n/2,width:i,height:n,fill:"white",fillOpacity:0,zIndex:999},mg.horizontal),{pickable:!T}),"rect")}else{if(k.visible){const t=(null===(d=k.background)||void 0===d?void 0:d.size)||10;this._middleHandlerRect=I.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:"left"===b?C.x-t:C.x+O,y:C.y+P*E,width:t,height:(M-P)*E},null===(f=k.background)||void 0===f?void 0:f.style),{pickable:!T}),"rect"),this._middleHandlerSymbol=I.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:"left"===b?C.x-t/2:C.x+O+t/2,y:C.y+(P+M)/2*E,angle:Math.PI/180*90,symbolType:null!==(p=null===(v=k.icon)||void 0===v?void 0:v.symbolType)&&void 0!==p?p:"square",strokeBoundsBuffer:0},k.icon),{pickable:!T}),"symbol")}this._startHandler=I.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:C.x+O/2,y:C.y+P*E,size:O,symbolType:null!==(g=B.symbolType)&&void 0!==g?g:"square"},mg.vertical),B),{pickable:!T}),"symbol"),this._endHandler=I.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:C.x+O/2,y:C.y+M*E,size:O,symbolType:null!==(y=S.symbolType)&&void 0!==y?y:"square"},mg.vertical),S),{pickable:!T}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),L),e=Math.max(this._startHandler.AABBBounds.height(),L),i=Math.max(this._endHandler.AABBBounds.width(),R),n=Math.max(this._endHandler.AABBBounds.height(),R);this._startHandlerMask=I.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:C.x+O/2+t/2,y:C.y+P*E-e/2,width:n,height:i,fill:"white",fillOpacity:0,zIndex:999},mg.vertical),{pickable:!T}),"rect"),this._endHandlerMask=I.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:C.x+O/2+i/2,y:C.y+M*E-n/2,width:n,height:i,fill:"white",fillOpacity:0,zIndex:999},mg.vertical),{pickable:!T}),"rect")}}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},i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},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},i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let n=this.find((t=>t.name===i),!0);return n?n.setAttributes(e):(n=new Fv(e),n.name=i),t.add(n),n}setStartAndEnd(t,i){const{start:n,end:r}=this.attribute;e.isValid(t)&&e.isValid(i)&&(t!==this.state.start||i!==this.state.end)&&(this.state.start=t,this.state.end=i,n===this.state.start&&r===this.state.end||(this.setStateAttr(t,i,!0),this._dispatchEvent("change",{start:t,end:i,tag:this._activeTag})))}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=a.background)||void 0===t?void 0:t.size)&&void 0!==i?i:10,o=null!==(r=null===(n=a.icon)||void 0===n?void 0:n.size)&&void 0!==r?r:10;return Math.max(s,...e.array(o))}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 kg,Bg,Sg;Ag.defaultAttributes=bg,t.IMarkLineLabelPosition=void 0,(kg=t.IMarkLineLabelPosition||(t.IMarkLineLabelPosition={})).start="start",kg.middle="middle",kg.end="end",kg.insideStartTop="insideStartTop",kg.insideStartBottom="insideStartBottom",kg.insideMiddleTop="insideMiddleTop",kg.insideMiddleBottom="insideMiddleBottom",kg.insideEndTop="insideEndTop",kg.insideEndBottom="insideEndBottom",t.IMarkAreaLabelPosition=void 0,(Bg=t.IMarkAreaLabelPosition||(t.IMarkAreaLabelPosition={})).left="left",Bg.right="right",Bg.top="top",Bg.bottom="bottom",Bg.middle="middle",Bg.insideLeft="insideLeft",Bg.insideRight="insideRight",Bg.insideTop="insideTop",Bg.insideBottom="insideBottom",t.IMarkPointItemPosition=void 0,(Sg=t.IMarkPointItemPosition||(t.IMarkPointItemPosition={})).top="top",Sg.bottom="bottom",Sg.middle="middle",Sg.insideTop="insideTop",Sg.insideBottom="insideBottom",Sg.insideMiddle="insideMiddle";class wg extends rc{constructor(){super(...arguments),this.name="marker"}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_initContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;let r;if(n){const n=fo.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));r=fo.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),n.add(r),this._containerClip=n,this.add(n)}else r=fo.group({x:0,y:0,pickable:!1}),this.add(r);r.name="marker-container",this._container=r}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:n}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:n?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:n?-(null!==(e=i.y)&&void 0!==e?e: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.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker()):(this._initContainer(),this.initMarker(this._container)):(this._container=null,this.removeAllChild())}}const Tg={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]}},Pg={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"}},Mg={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}},Cg={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"}},Og={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 Eg(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:c=0}=t.attribute;let d=0,f=0;s<i&&(d=i-s),o<n&&(f=n-o),l>r&&(d=r-l),u>a&&(f=a-u),d&&t.setAttribute("dx",d+h),f&&t.setAttribute("dy",f+c)}function Lg(){ev(),Vv()}Lg(),Hp();class Rg extends wg{getLine(){return this._line}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Rg.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),c=a*Math.sin(u)+s*Math.sin(u-Math.PI/2);let d;if(d=r.includes("start")||r.includes("Start")?{x:l[0].x+h,y:l[0].y+c}: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+c}:{x:l[l.length-1].x+h,y:l[l.length-1].y+c},this._label.setAttributes(Object.assign(Object.assign({},d),{angle:i.autoRotate?u+(null!==(e=i.refAngle)&&void 0!==e?e:0):0,textStyle:Object.assign(Object.assign({},Pg[r]),i.textStyle)})),n&&o){const{x:t,y:e,width:i,height:r}=n;Eg(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 Wp({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 Fv(Object.assign({},r));u.name="mark-line-label",this._label=u,t.add(u),this.setLabelPos()}updateMarker(){const{points:t,startSymbol:e,endSymbol:i,label:n,lineStyle:r,mainSegmentIndex:a,multiSegment:s}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:r,mainSegmentIndex:a,multiSegment:s}),this._label&&this._label.setAttributes(Object.assign({dx:0,dy:0},n)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<2)return!1;let i=!0;return t.forEach((t=>{if(t.length)t.forEach((t=>{e.isValidNumber(t.x)&&e.isValidNumber(t.y)||(i=!1)}));else if(!e.isValidNumber(t.x)||!e.isValidNumber(t.y))return void(i=!1)})),i}}Rg.defaultAttributes=Tg,Lg(),uv();class Ig extends wg{getArea(){return this._area}getLabel(){return this._label}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ig.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=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({},Cg[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:n}=this.attribute.limitRect;Eg(this._label,{x1:t,y1:e,x2:t+i,y2:e+n})}}}initMarker(t){const{points:e,label:i,areaStyle:n}=this.attribute,r=fo.polygon(Object.assign({points:e},n));r.name="mark-area-area",this._area=r,t.add(r);const a=new Fv(Object.assign({},i));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){const{points:t,label:e,areaStyle:i}=this.attribute;this._area&&this._area.setAttributes(Object.assign({points:t},i)),this._area&&this._label.setAttributes(Object.assign({dx:0,dy:0},e)),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<3)return!1;let i=!0;return t.forEach((t=>{e.isValidNumber(t.x)&&e.isValidNumber(t.y)||(i=!1)})),i}}Ig.defaultAttributes=Mg,Lg(),Hp(),pv(),nv(),av();class jg extends wg{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},jg.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:c={},imageStyle:d={},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({},Og[(null==i?void 0:i.position)||"end"]),h.textStyle)})):"richText"===r?e.setAttributes({dx:this.getItemDx(e,f,c)+(c.dx||0),dy:this.getItemDy(e,f,c)+(c.dy||0)}):"image"===r&&e.setAttributes({dx:this.getItemDx(e,f,d)+(d.dx||0),dy:this.getItemDy(e,f,d)+(d.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=fo.symbol(Object.assign(Object.assign({},e),n)):"text"===i?o=new Fv(Object.assign({},e)):"richText"===i?o=fo.richtext(Object.assign(Object.assign({},e),r)):"image"===i?o=fo.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){if(this._line){const{startSymbol:r,endSymbol:a,lineStyle:s}=t,o=this.getItemLineAttr(t,e,i);this._line.setAttributes({points:o,startSymbol:r,endSymbol:a,lineStyle:s,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){if(this._decorativeLine){const{lineStyle:n}=t,{startPointOffsetX:r,startPointOffsetY:a,endPointOffsetX:s,endPointOffsetY:o}=this.getDecorativeLineAttr(t,e);this._decorativeLine.setAttributes(Object.assign(Object.assign({points:[{x:e.x+r,y:e.y+a},{x:e.x+s,y:e.y+o}]},n),{visible:i}))}}initMarker(t){var e;const{position:i,itemLine:n={},itemContent:r={}}=this.attribute,a={x:i.x+(r.offsetX||0),y:i.y+(r.offsetY||0)},s=new Wp({points:[],pickable:!1});s.name="mark-point-line",this._line=s,t.add(s);const o=fo.line({points:[]});o.name="mark-point-decorativeLine",this._decorativeLine=o,t.add(o),this.setItemLineAttr(n,i,a,n.visible),this.setDecorativeLineAttr(n,a,null===(e=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+(n.offsetX||0),y:e.y+(n.offsetY||0)};this.setItemLineAttr(i,e,a,i.visible),this.setDecorativeLineAttr(i,a,null===(t=i.decorativeLine)||void 0===t?void 0:t.visible),this.setItemAttributes(this._item,n,a,r)}isValidPoints(){const{position:t}=this.attribute;return!(!e.isValidNumber(t.x)||!e.isValidNumber(t.y))}}function Dg(){ev(),pv(),yv()}jg.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 Ng={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};Dg();class Ug extends rc{getCurrent(){return this._current}constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Ug.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=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}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=Ng,total:r,defaultCurrent:a=1,textStyle:s,padding:o=0}=this.attribute;this._current=a;const l=e.normalizePadding(o),u="horizontal"===i,h=fo.group({x:0,y:0}),c=n.style||{},d=c.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=fo.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:0,y:0,symbolType:p,size:d}));y.states=v,y.name="preHandler",this.preHandler=y,h.add(y);const{width:b,height:m}=Wv(`${r}/${r}`,Object.assign({textAlign:"center",textBaseline:"middle"},s)),x=e.isNumber(d)?d:d[0],_=e.isNumber(d)?d:d[1],A=fo.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=fo.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},c),{x:u?x+2*f+b:0,y:u?0:_+2*f+m,symbolType:g,size:d}));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}}Ug.defaultAttributes={handler:Ng,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const zg=16,Hg=8,Wg=12,Vg=12;var Fg,Gg,Yg;t.LegendStateValue=void 0,(Fg=t.LegendStateValue||(t.LegendStateValue={})).selected="selected",Fg.unSelected="unSelected",Fg.selectedHover="selectedHover",Fg.unSelectedHover="unSelectedHover",Fg.focus="focus",t.LegendEvent=void 0,(Gg=t.LegendEvent||(t.LegendEvent={})).legendItemHover="legendItemHover",Gg.legendItemUnHover="legendItemUnHover",Gg.legendItemClick="legendItemClick",Gg.legendItemAttributeUpdate="legendItemAttributeUpdate",t.LEGEND_ELEMENT_NAME=void 0,(Yg=t.LEGEND_ELEMENT_NAME||(t.LEGEND_ELEMENT_NAME={})).innerView="innerView",Yg.title="legendTitle",Yg.item="legendItem",Yg.itemShape="legendItemShape",Yg.itemLabel="legendItemLabel",Yg.itemValue="legendItemValue",Yg.focus="legendItemFocus";class $g extends rc{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=fo.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 c=new Fv(h);c.name=t.LEGEND_ELEMENT_NAME.title,this._title=c,this._innerView.add(c)}_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)}}}function Xg(){ev(),yv(),cv(),pv()}function qg(){ev(),Vv()}const Kg={[t.LegendStateValue.focus]:{},[t.LegendStateValue.selected]:{},[t.LegendStateValue.selectedHover]:{},[t.LegendStateValue.unSelected]:{},[t.LegendStateValue.unSelectedHover]:{}};qg(),Dg();class Zg extends $g{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},Zg.defaultAttributes,i)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._onHover=e=>{const i=e.target;if(i&&i.name&&i.name.startsWith(t.LEGEND_ELEMENT_NAME.item)){const t=i.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;const s=e.target;if(s&&s.name&&s.name.startsWith(t.LEGEND_ELEMENT_NAME.item)){const o=s.delegate;if(s.name===t.LEGEND_ELEMENT_NAME.focus){const r=o.hasState(t.LegendStateValue.focus);o.toggleState(t.LegendStateValue.focus),r?null===(i=this._itemsContainer)||void 0===i||i.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(o,t.LegendStateValue.selected,e),this._removeLegendItemState(o,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((i=>{o!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover,t.LegendStateValue.focus],e),this._setLegendItemState(i,t.LegendStateValue.unSelected,e))})))}else{null===(r=this._itemsContainer)||void 0===r||r.getChildren().forEach((e=>{e.removeState(t.LegendStateValue.focus)}));const{selectMode:i="multiple",allowAllCanceled:n=!0}=this.attribute,s=o.hasState(t.LegendStateValue.selected),l=this._getSelectedLegends();if("multiple"===i){if(!1===n&&s&&1===l.length)return void this._dispatchLegendEvent(t.LegendEvent.legendItemClick,o,e);s?(this._removeLegendItemState(o,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(o,t.LegendStateValue.unSelected,e)):(this._setLegendItemState(o,t.LegendStateValue.selected,e),this._removeLegendItemState(o,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e))}else this._setLegendItemState(o,t.LegendStateValue.selected,e),this._removeLegendItemState(o,[t.LegendStateValue.unSelected,t.LegendStateValue.unSelectedHover],e),null===(a=this._itemsContainer)||void 0===a||a.getChildren().forEach((i=>{o!==i&&(this._removeLegendItemState(i,[t.LegendStateValue.selected,t.LegendStateValue.selectedHover],e),this._setLegendItemState(i,t.LegendStateValue.unSelected,e))}))}this._dispatchLegendEvent(t.LegendEvent.legendItemClick,o,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=fo.group({x:0,y:0});this._itemsContainer=o;const{layout:l,maxWidth:u,maxHeight:h,defaultSelected:c=[],autoPage:d}=this.attribute,f="horizontal"===l,{spaceCol:v=zg,spaceRow:p=Hg,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(c)||(null==c?void 0:c.includes(t.label)),i,s),l=n.attribute.width,d=n.attribute.height;this._itemHeight=Math.max(this._itemHeight,d),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+=d+p,B+=1)):u<_+l&&(m=!0,_=0,A+=d+p,B+=1)),i>0&&n.setAttributes({x:_,y:A}),_+=v+l):(k=r,e.isValid(h)&&h<A+d&&(m=!0,A=0,_+=x+v,x=0,B+=1),i>0&&n.setAttributes({x:_,y:A}),A+=p+d),o.add(n)}));let S=!1;m&&d&&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){var s,o;const{id:l,label:u,value:h,shape:c}=i,{padding:d=0,focus:f,focusIconStyle:v}=this.attribute.item,{shape:p,label:g,value:y,background:b}=this.attribute.item,m=this._handleStyle(p,i,n,r,a),x=this._handleStyle(g,i,n,r,a),_=this._handleStyle(y,i,n,r,a),A=this._handleStyle(b,i,n,r,a),k=e.normalizePadding(d);let B;!1===b.visible?(B=fo.group({x:0,y:0,cursor:null===(s=A.style)||void 0===s?void 0:s.cursor}),this._appendDataToShape(B,t.LEGEND_ELEMENT_NAME.item,i,B)):(B=fo.group(Object.assign({x:0,y:0},A.style)),this._appendDataToShape(B,t.LEGEND_ELEMENT_NAME.item,i,B,A.state)),B.id=`${null!=l?l:u}-${r}`,B.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected);const S=fo.group({x:0,y:0,pickable:!1});B.add(S);let w,T=0,P=0,M=0;if(p&&!1!==p.visible){const r=e.get(m,"style.size",10);P=e.isArray(r)?r[0]||0:r,M=e.get(p,"space",8);const a=fo.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},c),m.style));Object.keys(m.state||{}).forEach((t=>{const i=m.state[t].fill||m.state[t].stroke;c.fill&&e.isNil(m.state[t].fill)&&i&&(m.state[t].fill=i),c.stroke&&e.isNil(m.state[t].stroke)&&i&&(m.state[t].stroke=i)})),this._appendDataToShape(a,t.LEGEND_ELEMENT_NAME.itemShape,i,B,m.state),a.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),S.add(a)}let C=0;if(f){const n=e.get(v,"size",10);w=fo.symbol(Object.assign(Object.assign({x:0,y:-n/2-1,strokeBoundsBuffer:0},v),{visible:!0,pickMode:"imprecise",boundsPadding:k})),this._appendDataToShape(w,t.LEGEND_ELEMENT_NAME.focus,i,B),C=n}const O=fo.text(Object.assign(Object.assign({x:P/2+M,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(o=x.style)||void 0===o?void 0:o.fontSize},x.style),{text:g.formatMethod?g.formatMethod(u,i,r):u}));this._appendDataToShape(O,t.LEGEND_ELEMENT_NAME.itemLabel,i,B,x.state),O.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),S.add(O);const E=e.get(g,"space",8);if(e.isValid(h)){const a=e.get(y,"space",f?8:0),s=fo.text(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:_.style.fontSize},_.style),{text:y.formatMethod?y.formatMethod(h,i,r):h}));if(this._appendDataToShape(s,t.LEGEND_ELEMENT_NAME.itemValue,i,B,_.state),s.addState(n?t.LegendStateValue.selected:t.LegendStateValue.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-k[1]-k[3]-P-M-E-C-a,e=s.AABBBounds,i=O.AABBBounds,n=e.width(),r=i.width();r>t?(t-n)/r>.4?O.setAttribute("maxLineWidth",t-n):(s.setAttribute("maxLineWidth",.5*t),O.setAttribute("maxLineWidth",.5*t)):s.setAttribute("maxLineWidth",t-r),y.alignRight?s.setAttributes({textAlign:"right",x:this._itemWidthByUser-P/2-k[1]-k[3]-C-a}):s.setAttribute("x",O.AABBBounds.x2+a)}else s.setAttribute("x",O.AABBBounds.x2+a);T=s.AABBBounds.x2+a,S.add(s)}else this._itemWidthByUser?(O.setAttribute("maxLineWidth",this._itemWidthByUser-k[1]-k[3]-P-M-C),T=O.AABBBounds.x2+E):T=O.AABBBounds.x2+E;w&&(w.setAttribute("x",T),S.add(w));const L=S.AABBBounds,R=L.width(),I=L.height(),j=e.isValid(this.attribute.item.width)?this.attribute.item.width:R+k[1]+k[3],D=this._itemHeightByUser||I+k[0]+k[2];return B.attribute.width=j,B.attribute.height=D,w&&w.setAttribute("visible",!1),S.translateTo(-L.x1+k[3],-L.y1+k[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=zg,spaceRow:c=Hg}=o,d=this._itemsContainer,{animation:f=!0,animationDuration:v=450,animationEasing:p="quadIn",space:g=Vg,position:y="middle"}=l,b=Av(l,["animation","animationDuration","animationEasing","space","position"]);let m,x=0,_=0,A=0,k=0,B=1;if(t){if(m=new Ug(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)*c+this._itemHeight*s,_=n-m.AABBBounds.width()-g,_<=0)return this._innerView.removeChild(m),!1;let t;d.getChildren().forEach(((t,e)=>{const{width:i,height:n}=t.attribute;_<A+i&&(A=0,k+=n+c,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 Ug(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;d.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+=c+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?d.setAttribute("y",-(l.defaultCurrent-1)*(x+c)):d.setAttribute("x",-(l.defaultCurrent-1)*(_+h)));const S=fo.group({x:0,y:i,width:_,height:x,clip:!0,pickable:!1});S.add(d),this._innerView.add(S);const w=e=>{const{current:i}=e.detail;f?d.animate().to(t?{y:-(i-1)*(x+c)}:{x:-(i-1)*(_+h)},v,p):t?d.setAttribute("y",-(i-1)*(x+c)):d.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._dispatchLegendEvent(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._dispatchLegendEvent(t.LegendEvent.legendItemAttributeUpdate,e,i),this._dispatchLegendEvent(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._dispatchLegendEvent(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._dispatchLegendEvent(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({},Kg,a)}_dispatchLegendEvent(e,i,n){const r=this._getSelectedLegends();r.sort(((t,e)=>t.index-e.index));const a=r.map((t=>t.label));this._dispatchEvent(e,{item:i,data:i.data,selected:i.hasState(t.LegendStateValue.selected),currentSelectedItems:r,currentSelected:a,event:n})}_handleStyle(t,i,n,r,a){const s={};return t.style&&(e.isFunction(t.style)?s.style=t.style(i,n,r,a):s.style=t.style),t.state&&(s.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.state[o]=t.state[o])}))),s}}var Jg;function Qg(t){return e.isArray(t)?t:[t,t]}function ty(t){return t?"ew-resize":"ns-resize"}Zg.defaultAttributes={layout:"horizontal",title:{align:"start",space:Wg,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:zg,spaceRow:Hg,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:Vg,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},t.SLIDER_ELEMENT_NAME=void 0,(Jg=t.SLIDER_ELEMENT_NAME||(t.SLIDER_ELEMENT_NAME={})).innerView="innerView",Jg.railContainer="sliderRailContainer",Jg.rail="sliderRail",Jg.startText="sliderStartText",Jg.endText="sliderEndText",Jg.startHandler="sliderStartHandler",Jg.startHandlerText="startHandlerText",Jg.endHandler="sliderEndHandler",Jg.endHandlerText="sliderEndHandlerText",Jg.track="sliderTrack",Jg.trackContainer="sliderTrackContainer",Xg();class ey extends rc{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({},ey.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"===wh.env?(wh.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.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,c=0;this._isHorizontal?(l=t.clientX,c=l-this._prePos,u=null===(n=this._currentHandler)||void 0===n?void 0:n.attribute.x,h=r):(l=t.clientY,c=l-this._prePos,u=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.y,h=a);const d=e.clamp(u+c,0,h),f=d/h*(o-s)+s;"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,d,f):this._updateHandler(this._currentHandler,d,f),this._updateTrack(),this._prePos=l,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._currentHandler=null,"browser"===wh.env?(wh.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),wh.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"===wh.env?(wh.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),wh.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 c=l-this._prePos;if(s){const t=this._isHorizontal?s.attribute.x:s.attribute.y,i=e.clamp(t+c,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+c,u,h),n=i/h*(a-r)+r,l=null==s?void 0:s.attribute;this._updateHandler(o,i,n),this._track.setAttributes(this._isHorizontal?{x:Math.min(l.x,o.attribute.x),width:Math.abs(l.x-o.attribute.x)}:{y:Math.min(l.y,o.attribute.y),height:Math.abs(l.y-o.attribute.y)})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),"browser"===wh.env?(wh.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),wh.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,c;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,c=i):(l=t.viewY-this._rail.globalAABBBounds.y1,u=null==s?void 0:s.attribute.y,h=null==o?void 0:o.attribute.y,c=n);const d=l/c*(a-r)+r;if(e.isValid(h)){const t=Math.abs(l-u)>Math.abs(l-h)?o:s;this._updateHandler(t,l,d)}else this._updateHandler(s,l,d);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(),c="vertical"===i?r:n,d=(o-a)/(s-a)*c;if(u&&this._updateHandler(u,d,o),h){const t=(l-a)/(s-a)*c;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:c=!0}=this.attribute;let{value:d}=this.attribute;e.isNil(d)&&(d=[u,h]),this._currentValue={startValue:Qg(d)[0],endValue:Qg(d)[1]};const f="horizontal"===r;this._isHorizontal=f;const v=fo.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=fo.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=fo.group({x:f?g:0,y:f?0:g});v.add(y);const b=fo.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=fo.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),c&&(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=fo.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:c}=this.attribute;let{value:d}=this.attribute;e.isNil(d)&&(d=[r,a]);const f=l&&l.visible,v=this._isHorizontal,p=v?h:u,[g,y]=Qg(d),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===c?"default":ty(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===c?"default":ty(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:c}=this.attribute;let d,f;if(e.isNil(c))n?(d=r,f=a):d=f=r;else if(n){const t=e.clampRange(c,r,a);d=t[0],f=t[1]}else d=r,f=e.clamp(c,r,a);const v=this._isHorizontal,p=v?o:s;n||(d=r);const g=fo.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":ty(v);const m=a===r?p:(f-d)/(a-r)*p,x=a===r?0:(d-r)/(a-r)*p,_=fo.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 fo.symbol(t)}_renderHandlerText(t,e){var i,n,r;const{align:a,min:s,max:o,handlerSize:l=14,handlerText:u={},railHeight:h,railWidth:c,slidable:d}=this.attribute,f=this._isHorizontal,v=f?c: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:u.formatter?u.formatter(t):t.toFixed(null!==(n=u.precision)&&void 0!==n?n:0),lineHeight:null===(r=u.style)||void 0===r?void 0:r.lineHeight,cursor:!1===d?"default":ty(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=(c-l)/2-g,y.y=p):(y.textBaseline="middle",y.textAlign="start",y.x=(c+l)/2+g,y.y=p);return fo.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;s.setAttributes({text:t.formatter?t.formatter(n):n.toFixed(null!==(r=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:s.formatter?s.formatter(n):n.toFixed(null!==(r=s.precision)&&void 0!==r?r:0)});const o=e.name===t.SLIDER_ELEMENT_NAME.startHandlerText?this._startHandler:this._endHandler;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(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_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}}}ey.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}}},qg(),Xg();class iy extends $g{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},iy.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:c=!0,handlerSize:d,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 ey({x:0,y:0,range:{draggableTrack:!0},slidable:n,layout:r,align:a,min:s,max:o,value:l,railWidth:u,railHeight:h,showHandler:c,handlerSize:d,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",Wg):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,c=this._colorScale.scale(o),d=this._colorScale.scale(l);null==r||r.setAttribute("fill",c),null==a||a.setAttribute("fill",d);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,c=t.filter((t=>t.offset>n&&t.offset<r)),d=Math.min(o,l),v=Math.max(o,l),p=this._colorScale.scale(d),g=this._colorScale.scale(v),y=[{offset:0,color:p}];c.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 ny(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`}iy.defaultAttributes={layout:"horizontal",title:{align:"start",space:Wg,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"}}},qg(),Xg(),ov();class ry extends $g{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ry.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:c,railStyle:d,trackStyle:f,startText:v,endText:p,handlerText:g,showTooltip:y,tooltip:b,sizeBackground:m,disableTriggerEvent:x}=this.attribute,_=fo.group({x:0,y:0});this._innerView.add(_);const A=new ey({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:ny(n)},c),railStyle:d,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=fo.path(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",Wg):0;_.translate(0-_.AABBBounds.x1,T-_.AABBBounds.y1),this._slider=A}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&this._slider.addEventListener("change",this._onSliderChange)}}ry.defaultAttributes={layout:"horizontal",title:{align:"start",space:Wg,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)"}},ev(),mv(),fv();class ay extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},ay.defaultAttributes,t)),this.name="title"}render(){var t,i,n,r,a,s,o,l,u,h,c,d,f,v,p,g,y,b,m,x,_,A,k,B,S,w,T,P,M,C,O,E,L,R,I,j,D,N,U,z,H,W;const{textType:V,text:F,subtextType:G,textStyle:Y={},subtext:$,subtextStyle:X={},width:q,height:K,minWidth:Z,maxWidth:J,minHeight:Q,maxHeight:tt,align:et,verticalAlign:it,padding:nt=0}=this.attribute,rt=e.normalizePadding(nt),at=this.createOrUpdateChild("title-container",{x:rt[3],y:rt[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==Y.visible)if("rich"===V||e.isValid(Y.character)){const e=Object.assign({x:null!==(t=Y.x)&&void 0!==t?t:0,y:null!==(i=Y.y)&&void 0!==i?i:0,width:null!==(r=null!==(n=Y.width)&&void 0!==n?n:q)&&void 0!==r?r:0,height:null!==(s=null!==(a=Y.height)&&void 0!==a?a:K)&&void 0!==s?s:0,ellipsis:null===(o=Y.ellipsis)||void 0===o||o,wordBreak:null!==(l=Y.wordBreak)&&void 0!==l?l:"break-word",maxHeight:Y.maxHeight,maxWidth:Y.maxWidth,textConfig:null!==(u=Y.character)&&void 0!==u?u:F},Y);this._mainTitle=at.createOrUpdateChild("mainTitle",e,"richtext")}else if("html"===V){const t=Object.assign({html:Object.assign(Object.assign({dom:F},zv),Y),x:null!==(h=Y.x)&&void 0!==h?h:0,y:null!==(c=Y.y)&&void 0!==c?c:0,width:null!==(f=null!==(d=Y.width)&&void 0!==d?d:q)&&void 0!==f?f:0,height:null!==(p=null!==(v=Y.height)&&void 0!==v?v:K)&&void 0!==p?p:0,ellipsis:null===(g=Y.ellipsis)||void 0===g||g,wordBreak:null!==(y=Y.wordBreak)&&void 0!==y?y:"break-word",maxHeight:Y.maxHeight,maxWidth:Y.maxWidth,textConfig:[]},Y);this._mainTitle=at.createOrUpdateChild("mainTitle",t,"richtext")}else e.isValid(F)&&(this._mainTitle=at.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:[F]},Y),{maxLineWidth:null!==(b=Y.maxLineWidth)&&void 0!==b?b:q,heightLimit:Y.heightLimit,lineClamp:Y.lineClamp,ellipsis:null===(m=Y.ellipsis)||void 0===m||m,x:0,y:0}),"wrapText"));const st=this._mainTitle?this._mainTitle.AABBBounds.height():0,ot=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==X.visible)if("rich"===G||e.isValid(X.character)){const t=Object.assign({x:null!==(x=X.x)&&void 0!==x?x:0,y:null!==(_=X.y)&&void 0!==_?_:0,width:null!==(k=null!==(A=X.width)&&void 0!==A?A:q)&&void 0!==k?k:0,height:null!==(S=null!==(B=X.height)&&void 0!==B?B:K)&&void 0!==S?S:0,ellipsis:null===(w=X.ellipsis)||void 0===w||w,wordBreak:null!==(T=X.wordBreak)&&void 0!==T?T:"break-word",maxHeight:X.maxHeight,maxWidth:X.maxWidth,textConfig:null!==(P=X.character)&&void 0!==P?P:$},X);this._subTitle=at.createOrUpdateChild("subTitle",t,"richtext")}else if("html"===G){const t=Object.assign({html:Object.assign(Object.assign({dom:$},zv),X),x:null!==(M=X.x)&&void 0!==M?M:0,y:null!==(C=X.y)&&void 0!==C?C:0,width:null!==(E=null!==(O=X.width)&&void 0!==O?O:q)&&void 0!==E?E:0,height:null!==(R=null!==(L=X.height)&&void 0!==L?L:K)&&void 0!==R?R:0,ellipsis:null===(I=X.ellipsis)||void 0===I||I,wordBreak:null!==(j=X.wordBreak)&&void 0!==j?j:"break-word",maxHeight:X.maxHeight,maxWidth:X.maxWidth,textConfig:[]},X);this._subTitle=at.createOrUpdateChild("subTitle",t,"richtext")}else e.isValid($)&&(this._subTitle=at.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:[$]},X),{maxLineWidth:null!==(D=X.maxLineWidth)&&void 0!==D?D:q,heightLimit:X.heightLimit,lineClamp:X.lineClamp,ellipsis:null===(N=X.ellipsis)||void 0===N||N,x:0,y:st}),"wrapText"));const lt=this._subTitle?this._subTitle.AABBBounds.height():0,ut=this._subTitle?this._subTitle.AABBBounds.width():0;let ht=Math.max(ot,ut),ct=st+(null!==(U=X.height)&&void 0!==U?U:lt);if(e.isValid(q)&&(ht=q,this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",q),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",q)),e.isValid(K)&&(ct=K),e.isValid(Z)&&ht<Z&&(ht=Z),e.isValid(J)&&(this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",J),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",J),this._mainTitle&&this._mainTitle.setAttribute("maxWidth",J),this._subTitle&&this._subTitle.setAttribute("maxWidth",J),ht>J&&(ht=J)),e.isValid(Q)&&ct<Q&&(ct=Q),e.isValid(tt)&&(this._mainTitle&&this._mainTitle.setAttribute("maxHeight",tt),this._subTitle&&this._subTitle.setAttribute("maxHeight",tt-st),ct>tt&&(ct=tt)),at.attribute.width=ht,at.attribute.height=ct,at.attribute.boundsPadding=rt,this._mainTitle){if(e.isValid(et)||e.isValid(Y.align)){const t=Y.align?Y.align:et,e=null!==(z=Y.width)&&void 0!==z?z:ot;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(e.isValid(it)||e.isValid(Y.verticalAlign)){const t=Y.verticalAlign?Y.verticalAlign:it,e=Y.height?Y.height:ct;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(e.isValid(et)||e.isValid(X.align)){const t=X.align?X.align:et,e=null!==(H=X.width)&&void 0!==H?H:ut;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(e.isValid(it)||e.isValid(Y.verticalAlign)){const t=X.verticalAlign?X.verticalAlign:it,e=st,i=null!==(W=X.height)&&void 0!==W?W:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}}ay.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 sy={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"}}};ev(),yv(),fv();const oy=(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,c=t.endArrow&&h?`L${n},${s-r/2}L${n+r},${(s+u)/2}L${n},${u+r/2}`:"",d=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}${c}L${n},${u}L${i},${l}${d}Z`:`M${i},${a}\n C${o},${a},${o},${s},${n},${s}\n ${c}\n L${n},${u}\n C${o},${u},${o},${l},${i},${l}\n ${d}\n Z`},ly=(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,c=t.endArrow&&h?`L${a-s/2},${n}L${(a+u)/2},${n+s}L${u+s/2},${n}`:"",d=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}${c}L${u},${n}L${l},${i}${d}Z`:`M${r},${i}\n C${r},${o},${a},${o},${a},${n}\n ${c}\n L${u},${n}\n C${u},${o},${l},${o},${l},${i}\n ${d}\n Z`};ev(),ov();class uy extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},uy.defaultAttributes,t))}render(){const{direction:t="horizontal"}=this.attribute,e="vertical"===t?ly:oy,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}}uy.defaultAttributes={direction:"horizontal",align:"start"};class hy extends _s{constructor(t){super(t)}}var cy,dy;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(cy||(cy={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(dy||(dy={}));class fy extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},fy.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"},fy.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"},fy.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},fy.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},fy.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,n;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(t=this._backwardAttr.style.symbolType)&&void 0!==t?t:"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!==(e=this._forwardAttr.style.symbolType)&&void 0!==e?e:"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!==(i=this._backwardAttr.style.symbolType)&&void 0!==i?i:"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!==(n=this._forwardAttr.style.symbolType)&&void 0!==n?n:"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 hy(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{e.isNil(this._backwardController)&&(this._backwardController=new hy(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{e.isNil(this._forwardController)&&(this._forwardController=new hy(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.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=()=>{this._dispatchEvent("ControllerEventEnum.OnPlay")},this.pause=()=>{this._dispatchEvent("ControllerEventEnum.OnPause")},this.forward=()=>{this._dispatchEvent("ControllerEventEnum.OnForward")},this.backward=()=>{this._dispatchEvent("ControllerEventEnum.OnBackward")},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()}}fy.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},fy.defaultAttributes={[dy.Start]:{},[dy.Pause]:{},[dy.Backward]:{},[dy.Forward]:{}};const vy={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},py=[200,10];var gy,yy;t.DirectionEnum=void 0,(gy=t.DirectionEnum||(t.DirectionEnum={})).Default="default",gy.Reverse="reverse",t.PlayerEventEnum=void 0,(yy=t.PlayerEventEnum||(t.PlayerEventEnum={})).change="change",yy.play="play",yy.pause="pause",yy.backward="backward",yy.forward="forward",yy.end="end",yy.OnChange="change",yy.OnPlay="play",yy.OnPause="pause",yy.OnBackward="backward",yy.OnForward="forward",yy.OnEnd="end";const by=({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}),my=({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}),xy=t=>"top"===t||"bottom"===t;class _y extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},_y.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(xy(this._orient)){const t=Math.max(0,this._layoutInfo.slider.size),e=null!==(i=this._railStyle.height)&&void 0!==i?i:py[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:py[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 ey(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 xy(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 fy(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;const{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.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=xy(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:py[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?(xy(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,c=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:xy(this._orient)?t+r:(this._size.width-s)/2,y:xy(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:xy(this._orient)?c+this.attribute.slider.space:(this._size.width-o)/2,y:xy(this._orient)?(this._size.height-o)/2:c+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:xy(this._orient)?t+r:(this._size.width-s)/2,y:xy(this._orient)?(this._size.height-s)/2:t+r}),t+r+s}),c+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){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}function Ay(){Xg(),ev(),pv()}_y.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({},vy),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},vy),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},vy),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},vy),{key:"backward",position:"start"})}},Ay();Ay();var ky;t.IOperateType=void 0,(ky=t.IOperateType||(t.IOperateType={})).drawStart="drawStart",ky.drawEnd="drawEnd",ky.drawing="drawing",ky.moving="moving",ky.moveStart="moveStart",ky.moveEnd="moveEnd",ky.brushClear="brushClear";const By={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}},Sy=5;const wy={debounce:e.debounce,throttle:e.throttle};ev(),uv();class Ty extends rc{constructor(i,n){super((null==n?void 0:n.skipDefault)?i:e.merge({},Ty.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;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const i=null===(e=this.attribute.brushMoved)||void 0===e||e;this._activeMoveState=i&&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=>{e.preventDefault();const{removeOnClick:i=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&i?(this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={},this._dispatchEvent(t.IOperateType.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})):this._outOfInteractiveRange(e)||(this._activeDrawState&&this._dispatchEvent(t.IOperateType.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e}),this._activeMoveState&&this._dispatchEvent(t.IOperateType.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0,trigger:i=By.trigger,updateTrigger:n=By.updateTrigger,endTrigger:r=By.endTrigger,resetTrigger:a=By.resetTrigger}=this.attribute;this.stage.addEventListener(i,this._onBrushStart),this.stage.addEventListener(n,wy[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._dispatchEvent(t.IOperateType.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_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:c,y2:d}=this._operatingMask.globalAABBBounds,f=o-u,v=l-h,p=a-c,g=s-d;this._operatingMaskMoveRangeX=[f,v],this._operatingMaskMoveRangeY=[p,g],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(t.IOperateType.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_drawing(e){var i,n;const r=this.eventPosToStagePos(e),{x1:a=0,x2:s=0,y1:o=0,y2:l=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds,{sizeThreshold:u=Sy,brushType:h}=this.attribute,c=this._cacheDrawPoints.length;if(this._isDrawedBeforeEnd=!!(Math.abs(s-a)>u||Math.abs(o-l)>u),c>0){const t=null!==(n=this._cacheDrawPoints[this._cacheDrawPoints.length-1])&&void 0!==n?n:{};if(r.x===t.x&&r.y===t.y)return}"polygon"===h||c<=1?this._cacheDrawPoints.push(r):this._cacheDrawPoints[c-1]=r;const d=this._computeMaskPoints();this._operatingMask.setAttribute("points",d),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(t.IOperateType.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_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._dispatchEvent(t.IOperateType.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:e})}_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=fo.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;const{x:n,y:r}=wh.mapToCanvasPoint(t);return{x:n-((null===(e=this.stage)||void 0===e?void 0:e.x)||0),y:r-((null===(i=this.stage)||void 0===i?void 0:i.y)||0)}}render(){this._bindBrushEvents();const t=this.createOrUpdateChild("brush-container",{},"group");this._container=t}releaseBrushEvents(){const{delayType:t="throttle",delayTime:e=0,trigger:i=By.trigger,updateTrigger:n=By.updateTrigger,endTrigger:r=By.endTrigger,resetTrigger:a=By.resetTrigger}=this.attribute;this.stage.removeEventListener(i,this._onBrushStart),this.stage.removeEventListener(n,wy[t](this._onBrushing,e)),this.stage.removeEventListener(r,this._onBrushEnd),this.stage.removeEventListener(a,this._onBrushEnd)}}Ty.defaultAttributes=By;const Py=(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)})},My=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}},Cy={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:Dv,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Dv,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Dv,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},Oy=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];const Ey="tooltip-title",Ly="tooltip-content",Ry="shape",Iy="value";ev(),cv(),pv(),yv(),fv();class jy extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},jy.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&&jy.measureTooltip(this.attribute),l&&jy.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(Ey,{visible:!0,x:h[3],y:h[0]},"group");const c=jy.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild(`${Ey}-${Ry}`,e.merge({symbolType:"circle"},c.shape,{visible:wv(c)&&wv(c.shape)}),"symbol"),"object"!=typeof c.value.text||null===c.value.text||"rich"!==c.value.text.type&&"html"!==c.value.text.type?c.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ey}-${Iy}`,Object.assign({visible:wv(c)&&wv(c.value)},My(c.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ey}-${Iy}`,Object.assign({text:null!==(t=c.value.text)&&void 0!==t?t:"",visible:wv(c)&&wv(c.value)},c.value),"text"):"rich"===c.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ey}-${Iy}`,Object.assign({visible:wv(c)&&wv(c.value)},My(c.value)),"richtext"):"html"===c.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild(`${Ey}-${Iy}`,Object.assign({html:Object.assign(Object.assign({dom:c.value.text.text},zv),c.value),visible:wv(c)&&wv(c.value),width:c.value.width,height:c.value.height,wordBreak:c.value.wordBreak,textAlign:c.value.textAlign,textBaseline:c.value.textBaseline,singleLine:!1,textConfig:[]},c.value),"richtext"));const d=wv(c.shape)?c.shape.size+c.shape.spacing:0,{textAlign:f,textBaseline:v}=c.value,p=r.width-h[3]-h[0]-d;"center"===f?this._tooltipTitle.setAttribute("x",d+p/2):"right"===f||"end"===f?this._tooltipTitle.setAttribute("x",d+p):this._tooltipTitle.setAttribute("x",d),"bottom"===v?this._tooltipTitle.setAttribute("y",c.height):"middle"===v?this._tooltipTitle.setAttribute("y",c.height/2):this._tooltipTitle.setAttribute("y",0);const g=wv(c)?c.height+c.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild(Ly,{visible:!0},"group"),this._tooltipContent.removeAllChild(),n&&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=jy.getContentAttr(this.attribute,n);if(!wv(h))return;const c=`${Ly}-${n}`,d=this._tooltipContent.createOrUpdateChild(c,{visible:!0,x:0,y:t},"group");let f=0;if(wv(h.shape)&&d.createOrUpdateChild(`${c}-${Ry}`,Object.assign({visible:!0,x:h.shape.size/2,y:h.shape.size/2+((null!==(r=rn(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),wv(h.key)){let t;t=h.key.multiLine?d.createOrUpdateChild(`${c}-key`,Object.assign(Object.assign({visible:!0},My(h.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.key.text||null===h.key.text||"rich"!==h.key.text.type&&"html"!==h.key.text.type?d.createOrUpdateChild(`${c}-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?d.createOrUpdateChild(`${c}-${Iy}`,Object.assign(Object.assign({visible:!0},My(h.key)),{textBaseline:"top"}),"richtext"):d.createOrUpdateChild(`${c}-${Iy}`,{html:Object.assign(Object.assign({dom:h.key.text.text},zv),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(wv(h.value)){let t;t=h.value.multiLine?d.createOrUpdateChild(`${c}-${Iy}`,Object.assign(Object.assign({visible:!0},My(h.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof h.value.text||null===h.value.text||"rich"!==h.value.text.type&&"html"!==h.value.text.type?d.createOrUpdateChild(`${c}-${Iy}`,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?d.createOrUpdateChild(`${c}-${Iy}`,Object.assign(Object.assign({visible:!0},My(h.value)),{textBaseline:"top"}),"richtext"):d.createOrUpdateChild(`${c}-${Iy}`,{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:wv(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),d.add(t)}t+=h.height+h.spaceRow}))}}setAttributes(t,i){const n=Object.keys(t);this.attribute.autoCalculatePosition&&n.every((t=>Oy.includes(t)))?(this._mergeAttributes(t,n),e.isNil(this.attribute.panel.width)&&this.attribute.autoMeasure&&jy.measureTooltip(this.attribute),jy.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,c=s;return"left"===o?h-=e+n:"center"===o?h-=e/2:h+=n,"top"===l?c-=i+r:"middle"===l?c-=i/2:c+=r,h+e>u.x2&&(h-=e+n),c+i>u.y2&&(c-=i+r),h<u.x1&&(h=u.x1),c<u.y1&&(c=u.y1),t.x=h,t.y=c,t}static measureTooltip(t){const{content:i,contentStyle:n}=t,r=e.normalizePadding(t.padding),a=jy.getTitleAttr(t);let s=0,o=r[0]+r[2],l=0;const{value:u,shape:h}=a,{visible:c=!1,symbolType:d=""}=null!=h?h:{};if(e.isValid(u)&&"object"!=typeof a.value.text){const{width:t,height:e}=Hv(u).quickMeasure(u.text);s=t,l=e}if(c&&ys[d]&&(s+=h.size+h.spacing,l=Math.max(h.size,l)),t.title&&(t.title.width=s,t.title.height=l),wv(a)&&(o+=l+a.spaceRow),i&&i.length){const e=[];if(i.forEach(((i,n)=>{const r=jy.getContentAttr(t,n);(i.key||i.value)&&wv(r)&&e.push([i,r])})),e.length){let r=!1;const a=[],l=[],u=[];e.forEach((([t,i],s)=>{var h;const{key:c,value:d,shape:f,spaceRow:v}=i,p=wv(f),g=null!==(h=null==f?void 0:f.symbolType)&&void 0!==h?h:"",y=Hv(c),b=Hv(d);let m=0;if(wv(c)){const{width:t,height:e}=y.quickMeasure(c.text);l.push(t),m=Math.max(m,e)}if(wv(d)){const{width:t,height:e}=b.quickMeasure(d.text);u.push(t),m=Math.max(m,e)}p&&ys[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,c=l.length?Math.max(...l):0,d=u.length?Math.max(...u):0;s=Math.max(c+d+n.key.spacing+n.value.spacing+(r?h+n.shape.spacing:0),s),i.forEach((t=>{t.width=s})),t.hasContentShape=r,t.keyWidth=c,t.valueWidth=d}}return t.panel.width=s+r[1]+r[3],t.panel.height=o,t}static getTitleAttr(t){return Py({},jy.defaultAttributes.titleStyle,jy.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return Py({},jy.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}jy.defaultAttributes=Cy;ev(),cv(),mv(),nv();class Dy extends rc{constructor(t,i){super((null==i?void 0:i.skipDefault)?t:e.merge({},Dy.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 Ts(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 Es(e.merge({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new Es(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 Xr(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,c=u/2-l/2,d=u+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:h,y:r}),this._checkIcon.setAttributes({x:c,y:a}),this._indeterminateIcon.setAttributes({x:c,y:a}),this._text.setAttributes({x:d,y:s})}handleClick(){this.attribute.disabled||(this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1)),this._dispatchEvent("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked}))}}Dy.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=rc,t.ArcInfo=Ip,t.ArcLabel=jp,t.AreaLabel=Dp,t.BasePlayer=_y,t.Brush=Ty,t.CheckBox=Dy,t.CircleAxis=hg,t.CircleAxisGrid=gg,t.CircleCrosshair=ip,t.ColorContinuousLegend=iy,t.ContinuousPlayer=class extends _y{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(cy.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(cy.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(cy.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(cy.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=()=>Bv(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=wh.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=wh.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,wh.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,wh.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=zg,t.DEFAULT_ITEM_SPACE_ROW=Hg,t.DEFAULT_LABEL_SPACE=8,t.DEFAULT_PAGER_SPACE=Vg,t.DEFAULT_SHAPE_SIZE=10,t.DEFAULT_SHAPE_SPACE=8,t.DEFAULT_STATES=Gp,t.DEFAULT_TITLE_SPACE=Wg,t.DEFAULT_VALUE_SPACE=8,t.DataLabel=zp,t.DataZoom=Ag,t.DiscreteLegend=Zg,t.DiscretePlayer=class extends _y{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(cy.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(cy.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(cy.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(cy.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,(by({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||my({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=wh.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=wh.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(),wh.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(t.PlayerEventEnum.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,wh.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 Di{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 Di{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 Di{constructor(){super(...arguments),this.mode=_t.NORMAL}onBind(){const t=this.target.getInnerView(),i=this.target.getPrevInnerView();i&&(this._oldElementMap=function(t){const e={};return Sv(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(i),this._newElementAttrMap={},Sv(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;const{node:a,attrs:s,state:o}=this._newElementAttrMap[n];if("enter"===o){const{enter:n={}}=null!==(r=this.params)&&void 0!==r?r:{};t=e.isValidNumber(n.duration)?n.duration:t,i=n.easing?n.easing:i}"path"===a.type?a.animate({interpolate:(t,i,n,r,a)=>"path"===t&&(a.path=e.interpolateString(n,r)(i),!0)}).to(s,t,i):a.animate().to(s,t,i)}))}onUpdate(t,e,i){}},t.Indicator=class extends rc{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(sy,"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},zv),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 c=this._title?this._title.AABBBounds.height():0;if(e.isValid(s)){const t=this._title&&a.space?a.space:0,i=e.array(s),n=[];let r=0;i.forEach(((i,s)=>{var o,d;if(!1!==i.visible){const f=e.merge({},e.get(sy,"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:c+t+r,width:null!==(o=f.width)&&void 0!==o?o:0,height:null!==(d=f.height)&&void 0!==d?d:0}),"richtext"):"html"===f.type?h.createOrUpdateChild("indicator-content-"+s,Object.assign(Object.assign({textConfig:[],html:Object.assign(Object.assign({dom:f.text},zv),f)},f),{visible:a.visible,x:0,y:c+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:c+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=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 d=null!==(n=null==h?void 0:h.AABBBounds.height())&&void 0!==n?n:0;h.setAttribute("y",o.height/2-d/2),h.setAttribute("x",o.width/2)}_setAutoFit(t,i,n){var r,a,s,o,l,u;const h=Wv(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=Op,t.LineAxis=sg,t.LineAxisGrid=pg,t.LineCrosshair=tp,t.LineDataLabel=Np,t.LineLabel=Rp,t.LinkPath=uy,t.MarkArea=Ig,t.MarkLine=Rg,t.MarkPoint=jg,t.Pager=Ug,t.PolygonCrosshair=rp,t.PopTip=Xv,t.RectCrosshair=ep,t.RectLabel=Lp,t.ScrollBar=_v,t.SectorCrosshair=np,t.Segment=Wp,t.SizeContinuousLegend=ry,t.Slider=ey,t.SymbolLabel=Ep,t.Tag=Fv,t.Title=ay,t.Tooltip=jy,t.VTag=function(t){return new Fv(t?t.attribute:{})},t.getHorizontalPath=oy,t.getSizeHandlerPath=ny,t.getVerticalPath=ly,t.loadPoptip=function(){ai.load(Jv)},t.setPoptipTheme=function(t){e.merge(Yv.poptip,Gv,t)},t.version="0.17.11-alpha.3"}));