@visactor/vstory 0.0.4-alpha.1 → 0.0.4-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/cjs/constants/config.js +1 -2
  2. package/cjs/dsl/types/Datum.js +2 -1
  3. package/cjs/dsl/types/index.js +1 -1
  4. package/cjs/dsl/utils/datum.js +1 -2
  5. package/cjs/edit/edit-component/image-selection.js +1 -1
  6. package/cjs/edit/edit-component/index.js +1 -1
  7. package/cjs/scene/action.js +0 -2
  8. package/cjs/story/canvas/canvas.d.ts +2 -4
  9. package/cjs/story/canvas/canvas.js +9 -16
  10. package/cjs/story/canvas/canvas.js.map +1 -1
  11. package/cjs/story/character/chart/character.js +2 -2
  12. package/cjs/story/character/chart/character.js.map +1 -1
  13. package/cjs/story/interface/runtime-interface.d.ts +3 -1
  14. package/cjs/story/interface/runtime-interface.js.map +1 -1
  15. package/cjs/story/story.js +1 -1
  16. package/cjs/story/story.js.map +1 -1
  17. package/cjs/util/space.js +1 -2
  18. package/cjs/util/vrender-api.js +2 -1
  19. package/es/constants/config.js +1 -2
  20. package/es/dsl/types/Datum.js +2 -1
  21. package/es/dsl/types/index.js +1 -1
  22. package/es/dsl/utils/datum.js +1 -2
  23. package/es/edit/edit-component/image-selection.js +1 -1
  24. package/es/edit/edit-component/index.js +1 -1
  25. package/es/scene/action.js +0 -2
  26. package/es/story/canvas/canvas.d.ts +2 -4
  27. package/es/story/canvas/canvas.js +9 -17
  28. package/es/story/canvas/canvas.js.map +1 -1
  29. package/es/story/character/chart/character.js +3 -3
  30. package/es/story/character/chart/character.js.map +1 -1
  31. package/es/story/interface/runtime-interface.d.ts +3 -1
  32. package/es/story/interface/runtime-interface.js.map +1 -1
  33. package/es/story/story.js +1 -1
  34. package/es/story/story.js.map +1 -1
  35. package/es/util/space.js +1 -2
  36. package/es/util/vrender-api.js +2 -1
  37. package/package.json +1 -1
  38. package/dist/index.js +0 -61487
  39. package/dist/index.min.js +0 -1
package/dist/index.min.js DELETED
@@ -1 +0,0 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VStory={})}(this,(function(t){"use strict";function e(t,e,i){return e=h(e),v(t,n()?Reflect.construct(e,i||[],h(t).constructor):e.apply(t,i))}function n(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(n=function(){return!!t})()}function i(){i=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function h(t,e,n,i){var r=e&&e.prototype instanceof m?e:m,o=Object.create(r.prototype),s=new M(i||[]);return a(o,"_invoke",{value:C(t,n,s)}),o}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",v="suspendedYield",p="executing",g="completed",y={};function m(){}function k(){}function b(){}var _={};c(_,s,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(P([])));w&&w!==n&&r.call(w,s)&&(_=w);var S=b.prototype=m.prototype=Object.create(_);function A(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function n(i,a,o,s){var u=d(t[i],t,a);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==typeof c&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){n("next",t,o,s)}),(function(t){n("throw",t,o,s)})):e.resolve(c).then((function(t){l.value=t,o(l)}),(function(t){return n("throw",t,o,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(t,r){function a(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(a,a):a()}})}function C(e,n,i){var r=f;return function(a,o){if(r===p)throw Error("Generator is already running");if(r===g){if("throw"===a)throw o;return{value:t,done:!0}}for(i.method=a,i.arg=o;;){var s=i.delegate;if(s){var u=E(s,i);if(u){if(u===y)continue;return u}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===f)throw r=g,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=p;var l=d(e,n,i);if("normal"===l.type){if(r=i.done?g:v,l.arg===y)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(r=g,i.method="throw",i.arg=l.arg)}}}function E(e,n){var i=n.method,r=e.iterator[i];if(r===t)return n.delegate=null,"throw"===i&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==i&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+i+"' method")),y;var a=d(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function R(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 B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function P(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return k.prototype=b,a(S,"constructor",{value:b,configurable:!0}),a(b,"constructor",{value:k,configurable:!0}),k.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===k||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,c(t,l,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},A(T.prototype),c(T.prototype,u,(function(){return this})),e.AsyncIterator=T,e.async=function(t,n,i,r,a){void 0===a&&(a=Promise);var o=new T(h(t,n,i,r),a);return e.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},A(S),c(S,l,"Generator"),c(S,s,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},e.values=P,M.prototype={constructor:M,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(B),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function i(i,r){return s.type="throw",s.arg=e,n.next=i,r&&(n.method="next",n.arg=t),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var u=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(u&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},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 n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),B(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;B(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:P(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),y}},e}function r(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function a(t){return a="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},a(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,r(i.key),i)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&d(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v(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 f(t)}function p(){return p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=h(t)););return t}(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},p.apply(this,arguments)}function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(i=a.call(n)).done)&&(s.push(i.value),s.length!==e);u=!0);}catch(t){l=!0,r=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw r}}return s}}(t,e)||m(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||m(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){if(t){if("string"==typeof t)return k(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function b(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=m(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var _=function(){function t(){o(this,t)}return u(t,null,[{key:"GenAutoIncrementId",value:function(){return t.auto_increment_id++}}])}();_.auto_increment_id=0;var x=u((function t(e){o(this,t),this.id=_.GenAutoIncrementId(),this.registry=e})),w="named",S="inject",A="multi_inject",T="inversify:tagged",C="inversify:paramtypes",E=function(){return u((function t(e,n){o(this,t),this.key=e,this.value=n}),[{key:"toString",value:function(){return this.key===w?"named: ".concat(String(this.value).toString()," "):"tagged: { key:".concat(this.key.toString(),", value: ").concat(String(this.value)," }")}}])}(),R=function(t){var e;return function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!o&&!s,l={create:o?function(){return A(Object.create(null))}:s?function(){return A({__proto__:null})}:function(){return A({})},has:u?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:u?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),h="object"==("undefined"==typeof process?"undefined":a(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[r]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=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:n,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 n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var i=this._keys.length,r=n+1;r<i;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 n(this._keys,this._values,i)},e.prototype.values=function(){return new n(this._keys,this._values,a)},e.prototype.entries=function(){return new n(this._keys,this._values,o)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[r]=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 i(t,e){return t}function a(t,e){return e}function o(t,e){return[t,e]}}():Map,f=(h||"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[r]=function(){return this.keys()}}():Set,new(h||"function"!=typeof WeakMap?function(){var t=16,n=l.create(),i=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=a(t,!1);return void 0!==e&&l.has(e,this._key)},t.prototype.get=function(t){var e=a(t,!1);return void 0!==e?l.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@@"+s()}while(l.has(n,t));return n[t]=!0,t}function a(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:l.create()})}return t[i]}function o(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(){var e,n=(e=t,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):o(new Uint8Array(e),e):o(new Array(e),e));n[6]=79&n[6]|64,n[8]=191&n[8]|128;for(var i="",r=0;r<t;++r){var a=n[r];4!==r&&6!==r&&8!==r||(i+="-"),a<16&&(i+="0"),i+=a.toString(16).toLowerCase()}return i}}():WeakMap));function v(t,e,n){var i=f.get(t);if(m(i)){if(!n)return;i=new d,f.set(t,i)}var r=i.get(e);if(m(r)){if(!n)return;r=new d,i.set(e,r)}return r}function p(t,e,n){if(g(t,e,n))return!0;var i=S(e);return!k(i)&&p(t,i,n)}function g(t,e,n){var i=v(e,n,!1);return!m(i)&&!!i.has(t)}function y(t,e,n){if(g(t,e,n))return function(t,e,n){var i=v(e,n,!1);if(!m(i))return i.get(t)}(t,e,n);var i=S(e);return k(i)?void 0:y(t,i,n)}function m(t){return void 0===t}function k(t){return null===t}function b(t){return"object"==a(t)?null!==t:"function"==typeof t}function _(t,e){switch(function(t){if(null===t)return 1;switch(a(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 n=3===e?"string":5===e?"number":"default",r=function(t,e){var n=t[e];if(null!=n){if(!w(n))throw new TypeError;return n}}(t,i);if(void 0!==r){var o=r.call(t,n);if(b(o))throw new TypeError;return o}return function(t,e){if("string"===e){var n=t.toString;if(w(n)){var i=n.call(t);if(!b(i))return i}var r=t.valueOf;if(w(r)){var a=r.call(t);if(!b(a))return a}}else{var o=t.valueOf;if(w(o)){var s=o.call(t);if(!b(s))return s}var u=t.toString;if(w(u)){var l=u.call(t);if(!b(l))return l}}throw new TypeError}(t,"default"===n?"number":n)}function x(t){var e=_(t,3);return function(t){return"symbol"==a(t)}(e)?e:function(t){return""+t}(e)}function w(t){return"function"==typeof t}function S(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var r=i.constructor;return"function"!=typeof r||r===t?e:r}function A(t){return t.__=void 0,delete t.__,t}t("defineMetadata",(function(t,e,n,i){if(!b(n))throw new TypeError;return function(t,e,n,i){v(n,i,!0).set(t,e)}(t,e,n,i)})),t("hasMetadata",(function(t,e,n){if(!b(e))throw new TypeError;return m(n)||(n=x(n)),p(t,e,n)})),t("hasOwnMetadata",(function(t,e,n){if(!b(e))throw new TypeError;return m(n)||(n=x(n)),g(t,e,n)})),t("getMetadata",(function(t,e,n){if(!b(e))throw new TypeError;return m(n)||(n=x(n)),y(t,e,n)}))}((e=t,function(t,n){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:n})})),t}({});function B(t,e,n,i){!function(t,e,n,i){var r,a=[i],o={};R.hasOwnMetadata(t,e)&&(o=R.getMetadata(t,e));var s=o[n];void 0===s&&(s=[]),(r=s).push.apply(r,a),o[n]=s,R.defineMetadata(t,o,e)}(T,t,n.toString(),i)}function M(t){return function(e,n,i){B(e,0,i,t)}}function P(t){return function(e){return function(n,i,r){return M(new E(t,e))(n,i,r)}}}var O=P(S),I=P(A);function L(){return function(t){return R.defineMetadata(C,null,t),t}}function D(t){return M(new E(w,t))}var j,F="Singleton",N="Transient",G="ConstantValue",z="DynamicValue",U="Factory",W="Function",V="Instance",H="Invalid",Y=function(){function t(e,n){o(this,t),this.id=_.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=e,this.scope=n,this.type=H,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}return u(t,[{key:"clone",value:function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===F&&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}}])}(),X=function(){return u((function t(){o(this,t)}),[{key:"getConstructorMetadata",value:function(t){return{compilerGeneratedMetadata:R.getMetadata(C,t),userGeneratedMetadata:R.getMetadata(T,t)||{}}}},{key:"getPropertiesMetadata",value:function(t){throw new Error("暂未实现")}}])}(),K=(j=w,function(t){var e=function(e){if(null==e)return!1;if(e.key===j&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;for(var n=e.constructorArgsMetadata,i=0;i<n.length;i++)if(n[i].key===j&&n[i].value===t)return!0;return!1};return e.metaData=new E(j,t),e}),q=function(){return u((function t(e){o(this,t),this._binding=e}),[{key:"inRequestScope",value:function(){throw new Error("暂未实现")}},{key:"inSingletonScope",value:function(){return this._binding.scope=F,this}},{key:"inTransientScope",value:function(){return this._binding.scope=N,this}},{key:"whenTargetNamed",value:function(t){return this._binding.constraint=K(t),this}}])}(),Z=function(){return u((function t(e){o(this,t),this._binding=e}),[{key:"to",value:function(t){return this._binding.type=V,this._binding.implementationType=t,new q(this._binding)}},{key:"toSelf",value:function(){var t=this._binding.serviceIdentifier;return this.to(t)}},{key:"toDynamicValue",value:function(t){return this._binding.type=z,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new q(this._binding)}},{key:"toConstantValue",value:function(t){return this._binding.type=G,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=F,new q(this._binding)}},{key:"toFactory",value:function(t){return this._binding.type=U,this._binding.factory=t,this._binding.scope=F,new q(this._binding)}},{key:"toService",value:function(t){this.toDynamicValue((function(e){return e.container.get(t)}))}}])}(),J=function(){return u((function t(e){o(this,t);var n=e||{};n.defaultScope=n.defaultScope||N,this.options=n,this.id=_.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new X}),[{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,n){var i=this._getNotAllArgs(t,!1,e,n);return this._get(i)}},{key:"getNamed",value:function(t,e){return this.getTagged(t,w,e)}},{key:"isBound",value:function(t){return this._bindingDictionary.has(t)}},{key:"bind",value:function(t){var e=this.options.defaultScope,n=new Y(t,e),i=this._bindingDictionary.get(t)||[];return i.push(n),this._bindingDictionary.set(t,i),new Z(n)}},{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},n=function(n){return function(i){var r=t.rebind(i);return e(r,n),r}};return function(i){return{bindFunction:(r=i,function(n){var i=t.bind(n);return e(i,r),i}),isboundFunction:function(e){return t.isBound(e)},rebindFunction:n(i),unbindFunction:function(e){return t.unbind(e)},unbindAsyncFunction:function(t){return null}};var r}}},{key:"_getNotAllArgs",value:function(t,e,n,i){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:n,value:i}}},{key:"_getAllArgs",value:function(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}},{key:"_get",value:function(t){var e=this,n=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((function(e){return e.constraint(t)})).forEach((function(t){n.push(e._resolveFromBinding(t))})),t.isMultiInject||1!==n.length?n:n[0]}},{key:"_getChildRequest",value:function(t){for(var e=this,n=t.implementationType,i=this._metadataReader.getConstructorMetadata(n).userGeneratedMetadata,r=Object.keys(i),a=[],o=function(){var t=i[s],n={};t.forEach((function(t){n[t.key]=t.value}));var r={inject:n[S],multiInject:n[A]},o=r.inject||r.multiInject,u={serviceIdentifier:o,constructorArgsMetadata:t},l={injectIdentifier:o,metadata:t,bindings:e._bindingDictionary.get(o).filter((function(t){return t.constraint(u)}))};a.push(l)},s=0;s<r.length;s++)o();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 G:case W:e=t.cache;break;case V: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 n=this._getChildRequest(t);return this._createInstance(e,n)}},{key:"_createInstance",value:function(t,e){return e.length?function(t,e,i){if(n())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var a=new(t.bind.apply(t,r));return i&&d(a,i.prototype),a}(t,y(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===F&&(t.cache=e,t.activated=!0)}}])}(),$=Symbol("ContributionProvider"),Q=function(){return u((function t(e,n){o(this,t),this.serviceIdentifier=e,this.container=n}),[{key:"getContributions",value:function(){var t;return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&(t=this.caches).push.apply(t,y(this.container.getAll(this.serviceIdentifier)))),this.caches}}])}();function et(t,e){t($).toDynamicValue((function(t){var n=t.container;return new Q(e,n)})).inSingletonScope().whenTargetNamed(e)}function nt(t,e){t($).toDynamicValue((function(t){var n=t.container;return new Q(e,n)})).whenTargetNamed(e)}var it=function(){return u((function t(e,n){o(this,t),this._args=e,this.name=n,this.taps=[]}),[{key:"tap",value:function(t,e){this._tap("sync",t,e)}},{key:"unTap",value:function(t,e){var n="string"==typeof t?t.trim():t.name;n&&(this.taps=this.taps.filter((function(t){return!(t.name===n&&(!e||t.fn===e))})))}},{key:"_parseOptions",value:function(t,e,n){var i;if("string"==typeof e)i={name:e.trim()};else if("object"!=a(e)||null===e)throw new Error("Invalid tap options");if("string"!=typeof i.name||""===i.name)throw new Error("Missing name for tap");return i=Object.assign({type:t,fn:n},i)}},{key:"_tap",value:function(t,e,n){this._insert(this._parseOptions(t,e,n))}},{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 n=0;"number"==typeof t.stage&&(n=t.stage);for(var i=this.taps.length;i>0;){i--;var r=this.taps[i];this.taps[i+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>n)){i++;break}}this.taps[i]=t}}])}(),rt=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.taps.map((function(t){return t.fn})).forEach((function(t){return t.apply(void 0,e)}))}}])}(it),at=Symbol.for("EnvContribution"),ot=Symbol.for("VGlobal"),st=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ut=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lt=function(t,e){return function(n,i){e(n,i,t)}};function ct(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.DefaultGlobal=function(){return u((function t(e){o(this,t),this.contributions=e,this.id=_.GenAutoIncrementId(),this.hooks={onSetEnv:new rt(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}),[{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,n=[];if(this.contributions.getContributions().forEach((function(i){var r=i.configure(e,t);r&&r.then&&n.push(r)})),n.length)return Promise.all(n)}},{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 n=this,i=this._env;this._env=t;var r=this.bindContribution(e);if(r&&r.then)return r.then((function(){n.envParams=e,n.hooks.onSetEnv.call(i,t,n)}));this.envParams=e,this.hooks.onSetEnv.call(i,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,n){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,n)}},{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:"updateDom",value:function(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}},{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.DefaultGlobal=st([L(),lt(0,O($)),lt(0,D(at)),ut("design:paramtypes",[Object])],t.DefaultGlobal);var ht={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,i,a,o){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,a||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=n?n+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,a=i.length,o=new Array(a);r<a;r++)o[r]=i[r].fn;return o},s.prototype.listenerCount=function(t){var e=n?n+t:t,i=this._events[e];return i?i.fn?1:i.length:0},s.prototype.emit=function(t,e,i,r,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,i),!0;case 4:return c.fn.call(c.context,e,i,r),!0;case 5:return c.fn.call(c.context,e,i,r,a),!0;case 6:return c.fn.call(c.context,e,i,r,a,o),!0}for(l=1,u=new Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var d,f=c.length;for(l=0;l<f;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,i);break;case 4:c[l].fn.call(c[l].context,e,i,r);break;default:if(!u)for(d=1,u=new Array(h-1);d<h;d++)u[d-1]=arguments[d];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||o(this,a);else{for(var u=0,l=[],c=s.length;u<c;u++)(s[u].fn!==e||r&&!s[u].once||i&&s[u].context!==i)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&o(this,e)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(ht);var dt=ct(ht.exports),ft=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},vt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||ft(t,"Boolean")},pt=function(t){return"function"==typeof t},gt=function(t){return null==t},yt=function(t){return null!=t},mt=function(t){var e=a(t);return null!==t&&"object"===e||"function"===e},kt=function(t){return"object"==a(t)&&null!==t},bt=function(t){if(!kt(t)||!ft(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},_t=function(t){return void 0===t},xt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"string"===n:"string"===n||ft(t,"String")},wt=function(t){return Array.isArray?Array.isArray(t):ft(t,"Array")},St=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},At=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"number"===n:"number"===n||ft(t,"Number")},Tt=function(t){return At(t)&&Number.isFinite(t)},Ct=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},Et=function(t){return new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t)},Rt=Object.prototype.hasOwnProperty,Bt=function(t,e){return null!=t&&Rt.call(t,e)};function Mt(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(yt(e)&&"object"==a(e)){var r=Object(e),o=[];for(var s in r)o.push(s);for(var u=o.length,l=-1;u--;){var c=o[++l];!yt(r[c])||"object"!=a(r[c])||i&&wt(t[c])?Ot(t,c,r[c]):Pt(t,e,c,n,i)}}}}function Pt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=t[n],s=e[n],u=e[n],l=!0;if(wt(s)){if(i)u=[];else if(wt(o))u=o;else if(St(o)){u=new Array(o.length);for(var c=-1,h=o.length;++c<h;)u[c]=o[c]}}else bt(s)?(u=o,"function"!=typeof o&&"object"==a(o)||(u={})):l=!1;l&&Mt(u,s,i,r),Ot(t,n,u)}function Ot(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function It(t){for(var e=-1,n=arguments.length<=1?0:arguments.length-1;++e<n;)Mt(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function Lt(t,e){if(!wt(t)||!wt(e))return!1;if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var Dt,jt="undefined"!=typeof console;function Ft(t,e,n){var i=[e].concat([].slice.call(n));jt&&console[t].apply(console,i)}!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(Dt||(Dt={}));var Nt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dt.None,n=arguments.length>1?arguments[1]:void 0;o(this,t),this._onErrorHandler=[],this._level=e,this._method=n}return u(t,[{key:"addErrorHandler",value:function(t){this._onErrorHandler.find((function(e){return e===t}))||this._onErrorHandler.push(t)}},{key:"removeErrorHandler",value:function(t){var e=this._onErrorHandler.findIndex((function(e){return e===t}));e<0||this._onErrorHandler.splice(e,1)}},{key:"callErrorHandler",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._onErrorHandler.forEach((function(t){return t.apply(void 0,e)}))}},{key:"canLogInfo",value:function(){return this._level>=Dt.Info}},{key:"canLogDebug",value:function(){return this._level>=Dt.Debug}},{key:"canLogError",value:function(){return this._level>=Dt.Error}},{key:"canLogWarn",value:function(){return this._level>=Dt.Warn}},{key:"level",value:function(t){return arguments.length?(this._level=+t,this):this._level}},{key:"error",value:function(){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this._level>=Dt.Error&&(this._onErrorHandler.length?this.callErrorHandler.apply(this,n):Ft(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",n)),this}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Dt.Warn&&Ft(this._method||"warn","WARN",e),this}},{key:"info",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Dt.Info&&Ft(this._method||"log","INFO",e),this}},{key:"debug",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=Dt.Debug&&Ft(this._method||"log","DEBUG",e),this}}],[{key:"getInstance",value:function(e,n){return t._instance&&At(e)?t._instance.level(e):t._instance||(t._instance=new t(e,n)),t._instance}},{key:"setInstance",value:function(e){return t._instance=e}},{key:"setInstanceLevel",value:function(e){t._instance?t._instance.level(e):t._instance=new t(e)}},{key:"clearInstance",value:function(){t._instance=null}}])}();Nt._instance=null;var Gt=1e-10,zt=1e-10;function Ut(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Gt,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:zt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}var Wt=function(t,e,n){return t<e?e:t>n?n:t},Vt=1e-12,Ht=Math.PI,Yt=Ht/2,Xt=2*Ht,Kt=2*Math.PI,qt=Math.abs,Zt=Math.atan2,Jt=Math.cos,$t=Math.max,Qt=Math.min,te=Math.sin,ee=Math.sqrt,ne=Math.pow;function ie(t){return t>1?0:t<-1?Ht:Math.acos(t)}function re(t){return t>=1?Yt:t<=-1?-Yt:Math.asin(t)}function ae(t,e,n,i,r){var a=n,o=i;return"number"==typeof t&&"number"==typeof n&&(a=(1-r)*t+r*n),"number"==typeof e&&"number"==typeof i&&(o=(1-r)*e+r*i),{x:a,y:o}}function oe(t,e){return t[0]*e[1]-t[1]*e[0]}function se(t){var e=t.toString().split(/[eE]/),n=(e[0].split(".")[1]||"").length-(+e[1]||0);return n>0?n:0}var ue=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n,this.x1=i,this.y1=r}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return At(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return At(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}])}(),le=function(){return u((function t(){o(this,t)}),null,[{key:"distancePP",value:function(t,e){return ee(ne(t.x-e.x,2)+ne(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,n,i){return ee(ne(t-n,2)+ne(e-i,2))}},{key:"distancePN",value:function(t,e,n){return ee(ne(e-t.x,2)+ne(n-t.y,2))}},{key:"pointAtPP",value:function(t,e,n){return new ue((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}])}();function ce(t,e,n){var i=e.x1,r=e.y1,a=e.x2,o=e.y2;return n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f),e):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*a+n.c*r+n.e,n.b*a+n.d*r+n.f),t.add(n.a*a+n.c*o+n.e,n.b*a+n.d*o+n.f),t.add(n.a*i+n.c*o+n.e,n.b*i+n.d*o+n.f),e)}var he=function(){function t(e){o(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return u(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return wt(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return ce(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,n){var i=this.x1,r=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*i-u*r+l,u*i+s*r+c,s*i-u*o+l,u*i+s*o+c,s*a-u*r+l,u*a+s*r+c,s*a-u*o+l,u*a+s*o+c]}},{key:"scalePoints",value:function(t,e,n,i){return[t*this.x1+(1-t)*n,e*this.y1+(1-e)*i,t*this.x2+(1-t)*n,e*this.y2+(1-e)*i]}}])}(),de=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(he);var fe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Xt;)t+=Xt;else if(t>0)for(;t>Xt;)t-=Xt;return t};function ve(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}var pe=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;o(this,t),this.a=e,this.b=n,this.c=i,this.d=r,this.e=a,this.f=s}return u(t,[{key:"equalToMatrix",value:function(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}},{key:"equalTo",value:function(t,e,n,i,r,a){return!(this.e!==r||this.f!==a||this.a!==t||this.d!==i||this.b!==e||this.c!==n)}},{key:"setValue",value:function(t,e,n,i,r,a){return this.a=t,this.b=e,this.c=n,this.d=i,this.e=r,this.f=a,this}},{key:"reset",value:function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}},{key:"getInverse",value:function(){var e=this.a,n=this.b,i=this.c,r=this.d,a=this.e,o=this.f,s=new t,u=e*r-n*i;return s.a=r/u,s.b=-n/u,s.c=-i/u,s.d=e/u,s.e=(i*o-r*a)/u,s.f=-(e*o-n*a)/u,s}},{key:"rotate",value:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.a*e+this.c*n,r=this.b*e+this.d*n,a=this.a*-n+this.c*e,o=this.b*-n+this.d*e;return this.a=i,this.b=r,this.c=a,this.d=o,this}},{key:"rotateByCenter",value:function(t,e,n){var i=Math.cos(t),r=Math.sin(t),a=(1-i)*e+r*n,o=(1-i)*n-r*e,s=i*this.a-r*this.b,u=r*this.a+i*this.b,l=i*this.c-r*this.d,c=r*this.c+i*this.d,h=i*this.e-r*this.f+a,d=r*this.e+i*this.f+o;return this.a=s,this.b=u,this.c=l,this.d=c,this.e=h,this.f=d,this}},{key:"scale",value:function(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}},{key:"setScale",value:function(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}},{key:"transform",value:function(t,e,n,i,r,a){return this.multiply(t,e,n,i,r,a),this}},{key:"translate",value:function(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}},{key:"transpose",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=this.e,a=this.f;return this.a=e,this.b=t,this.c=i,this.d=n,this.e=a,this.f=r,this}},{key:"multiply",value:function(t,e,n,i,r,a){var o=this.a,s=this.b,u=this.c,l=this.d,c=o*t+u*e,h=s*t+l*e,d=o*n+u*i,f=s*n+l*i,v=o*r+u*a+this.e,p=s*r+l*a+this.f;return this.a=c,this.b=h,this.c=d,this.d=f,this.e=v,this.f=p,this}},{key:"interpolate",value:function(e,n){var i=new t;return i.a=this.a+(e.a-this.a)*n,i.b=this.b+(e.b-this.b)*n,i.c=this.c+(e.c-this.c)*n,i.d=this.d+(e.d-this.d)*n,i.e=this.e+(e.e-this.e)*n,i.f=this.f+(e.f-this.f)*n,i}},{key:"transformPoint",value:function(t,e){var n=this.a,i=this.b,r=this.c,a=this.d,o=this.e,s=this.f,u=n*a-i*r,l=a/u,c=-i/u,h=-r/u,d=n/u,f=(r*s-a*o)/u,v=-(n*s-i*o)/u,p=t.x,g=t.y;e.x=p*l+g*h+f,e.y=p*c+g*d+v}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}},{key:"clone",value:function(){return new t(this.a,this.b,this.c,this.d,this.e,this.f)}},{key:"toTransformAttrs",value:function(){var t=this.a,e=this.b,n=this.c,i=this.d,r=t*i-e*n,a={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){var o=Math.sqrt(t*t+e*e);a.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),a.scaleX=o,a.scaleY=r/o,a.skewX=(t*n+e*i)/r,a.skewY=0}else if(0!==n||0!==i){var s=Math.sqrt(n*n+i*i);a.rotateDeg=Math.PI/2-(i>0?Math.acos(-n/s):-Math.acos(n/s)),a.scaleX=r/s,a.scaleY=s,a.skewX=0,a.skewY=(t*n+e*i)/r}return a.rotateDeg=180*a.rotateDeg/Math.PI,a}}])}();var ge=function(){return u((function t(){o(this,t),this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}),[{key:"clearCache",value:function(t,e){var n=e.CLEAN_THRESHOLD,i=void 0===n?this.CLEAN_THRESHOLD:n,r=e.L_TIME,a=void 0===r?this.L_TIME:r,o=e.R_COUNT,s=void 0===o?this.R_COUNT:o;if(t.size<i)return 0;var u=0,l=function(e){u++,t.delete(e)},c=Date.now();return t.forEach((function(t,e){if(t.timestamp.length<s)return l(e);for(var n=0;c-t.timestamp[t.timestamp.length-1-n]<a&&!(++n>=s););if(n<s)return l(e);for(;c-t.timestamp[0]>a;)t.timestamp.shift()})),u}},{key:"addLimitedTimestamp",value:function(t,e,n){var i=n.R_TIMESTAMP_MAX_SIZE,r=void 0===i?this.R_TIMESTAMP_MAX_SIZE:i;t.timestamp.length>r&&t.timestamp.shift(),t.timestamp.push(e)}},{key:"clearTimeStamp",value:function(t,e){var n=e.L_TIME,i=void 0===n?this.L_TIME:n,r=Date.now();t.forEach((function(t){for(;r-t.timestamp[0]>i;)t.timestamp.shift()}))}},{key:"clearItemTimestamp",value:function(t,e){for(var n=e.L_TIME,i=void 0===n?this.L_TIME:n,r=Date.now();r-t.timestamp[0]>i;)t.timestamp.shift()}}])}();function ye(t,e,n){e/=100,n/=100;var i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),a=n-i/2,o=0,s=0,u=0;return 0<=t&&t<60?(o=i,s=r,u=0):60<=t&&t<120?(o=r,s=i,u=0):120<=t&&t<180?(o=0,s=i,u=r):180<=t&&t<240?(o=0,s=r,u=i):240<=t&&t<300?(o=r,s=0,u=i):300<=t&&t<360&&(o=i,s=0,u=r),{r:o=Math.round(255*(o+a)),g:s=Math.round(255*(s+a)),b:u=Math.round(255*(u+a))}}function me(t,e,n){t/=255,e/=255,n/=255;var i=Math.min(t,e,n),r=Math.max(t,e,n),a=r-i,o=0,s=0;return o=0===a?0:r===t?(e-n)/a%6:r===e?(n-t)/a+2:(t-e)/a+4,(o=Math.round(60*o))<0&&(o+=360),s=(r+i)/2,{h:o,s:+(100*(0===a?0:a/(1-Math.abs(2*s-1)))).toFixed(1),l:s=+(100*s).toFixed(1)}}var ke=/^#([0-9a-f]{3,8})$/,be={transparent:4294967040},_e={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function xe(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function we(t){return At(t)?new Re(t>>16,t>>8&255,255&t,1):wt(t)?new Re(t[0],t[1],t[2]):new Re(255,255,255)}function Se(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ae(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var Te,Ce=function(t,e){var n=ke.exec(t);if(e||n){var i=parseInt(n[1],16),r=n[1].length;return 3===r?new Re((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===r?we(i):8===r?new Re(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):null}},Ee=function(){function t(e){o(this,t);var n=t.parseColorString(e);n?this.color=n:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new Re(255,255,255))}return u(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"brighter",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}},{key:"add",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r+=Math.min(255,n+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}},{key:"sub",value:function(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}},{key:"multiply",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,n){var i=this.color.opacity,r=me(this.color.r,this.color.g,this.color.b),a=ye(gt(t)?r.h:Wt(t,0,360),gt(e)?r.s:e>=0&&e<=1?100*e:e,gt(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new Re(a.r,a.g,a.b,i),this}},{key:"setRGB",value:function(t,e,n){return!gt(t)&&(this.color.r=t),!gt(e)&&(this.color.g=e),!gt(n)&&(this.color.b=n),this}},{key:"setHex",value:function(t){var e="".concat(t).trim().toLowerCase(),n=Ce(e,!0);return null!=n?n:this}},{key:"setColorName",value:function(t){var e=_e[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"setScalar",value:function(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}},{key:"clone",value:function(){return new t(this.color.toString())}},{key:"copyGammaToLinear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}},{key:"copyLinearToGamma",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}},{key:"convertGammaToLinear",value:function(t){return this.copyGammaToLinear(this,t),this}},{key:"convertLinearToGamma",value:function(t){return this.copyLinearToGamma(this,t),this}},{key:"copySRGBToLinear",value:function(t){return this.color.r=Se(t.color.r),this.color.g=Se(t.color.g),this.color.b=Se(t.color.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.color.r=Ae(t.color.r),this.color.g=Ae(t.color.g),this.color.b=Ae(t.color.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}}],[{key:"Brighter",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).brighter(n).toRGBA()}},{key:"SetOpacity",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).setOpacity(n).toRGBA()}},{key:"getColorBrightness",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",i=e instanceof t?e:new t(e);switch(n){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}},{key:"parseColorString",value:function(t){if(yt(be[t]))return function(t){return At(t)?new Re(t>>>24,t>>>16&255,t>>>8&255,255&t):wt(t)?new Re(t[0],t[1],t[2],t[3]):new Re(255,255,255,1)}(be[t]);if(yt(_e[t]))return we(_e[t]);var e="".concat(t).trim().toLowerCase(),n=Ce(e);if(void 0!==n)return n;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var i=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Re(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10),parseFloat(i[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var r=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),a=ye(parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10));return new Re(a.r,a.g,a.b,parseFloat(r[3]))}}}])}(),Re=function(){return u((function t(e,n,i,r){o(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),yt(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}),[{key:"formatHex",value:function(){return"#".concat(xe(this.r)+xe(this.g)+xe(this.b)+(1===this.opacity?"":xe(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=me(this.r,this.g,this.b),n=e.h,i=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(n,",").concat(i,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}])}();function Be(t,e,n){t[0]=e[0]-n[0],t[1]=e[1]-n[1]}function Me(t,e,n,i){if(!function(t,e,n,i){var r,a,o,s,u=t[0],l=e[0],c=n[0],h=i[0];return l<u&&(u=(r=[l,u])[0],l=r[1]),h<c&&(h=(a=[c,h])[0],c=a[1]),!(l<c||h<u||(u=t[1],l=e[1],c=n[1],h=i[1],l<u&&(o=[l,u],u=o[0],l=o[1]),h<c&&(s=[c,h],h=s[0],c=s[1]),l<c||h<u))}(t,e,n,i))return!1;var r=[0,0],a=[0,0],o=[0,0];if(Be(r,e,t),Be(a,i,n),function(t,e){return qt(t[0]-e[0])+qt(t[1]-e[1])<1e-12}(r,a))return!0;Be(o,n,t);var s=oe(o,a)/oe(r,a);return s>=0&&s<=1&&[t[0]+r[0]*s,t[1]+r[1]*s]}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Te||(Te={}));var Pe=function(t,e,n){var i,r,a,o,s=t.x1,u=t.x2,l=t.y1,c=t.y2,h=e.x1,d=e.x2,f=e.y1,v=e.y2;return n&&(s>u&&(s=(i=[u,s])[0],u=i[1]),l>c&&(l=(r=[c,l])[0],c=r[1]),h>d&&(h=(a=[d,h])[0],d=a[1]),f>v&&(f=(o=[v,f])[0],v=o[1])),{x11:s,x12:u,y11:l,y12:c,x21:h,x22:d,y21:f,y22:v}};function Oe(t,e,n){if(t&&e){if(!n)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);var i=Pe(t,e,!0),r=i.x11,a=i.x12,o=i.y11,s=i.y12,u=i.x21,l=i.x22,c=i.y21,h=i.y22;return!(r>l||a<u||o>h||s<c)}return!0}var Ie=function(t){var e=t.charCodeAt(0),n=2===t.length?t.charCodeAt(1):0,i=e;return 55296<=e&&e<=56319&&56320<=n&&n<=57343&&(i=(e&=1023)<<10|(n&=1023),i+=65536),12288===i||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":8361===i||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||172===i||175===i||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":161===i||164===i||167<=i&&i<=168||170===i||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||198===i||208===i||215<=i&&i<=216||222<=i&&i<=225||230===i||232<=i&&i<=234||236<=i&&i<=237||240===i||242<=i&&i<=243||247<=i&&i<=250||252===i||254===i||257===i||273===i||275===i||283===i||294<=i&&i<=295||299===i||305<=i&&i<=307||312===i||319<=i&&i<=322||324===i||328<=i&&i<=331||333===i||338<=i&&i<=339||358<=i&&i<=359||363===i||462===i||464===i||466===i||468===i||470===i||472===i||474===i||476===i||593===i||609===i||708===i||711===i||713<=i&&i<=715||717===i||720===i||728<=i&&i<=731||733===i||735===i||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||1025===i||1040<=i&&i<=1103||1105===i||8208===i||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||8240===i||8242<=i&&i<=8243||8245===i||8251===i||8254===i||8308===i||8319===i||8321<=i&&i<=8324||8364===i||8451===i||8453===i||8457===i||8467===i||8470===i||8481<=i&&i<=8482||8486===i||8491===i||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||8585===i||8592<=i&&i<=8601||8632<=i&&i<=8633||8658===i||8660===i||8679===i||8704===i||8706<=i&&i<=8707||8711<=i&&i<=8712||8715===i||8719===i||8721===i||8725===i||8730===i||8733<=i&&i<=8736||8739===i||8741===i||8743<=i&&i<=8748||8750===i||8756<=i&&i<=8759||8764<=i&&i<=8765||8776===i||8780===i||8786===i||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||8853===i||8857===i||8869===i||8895===i||8978===i||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||9675===i||9678<=i&&i<=9681||9698<=i&&i<=9701||9711===i||9733<=i&&i<=9734||9737===i||9742<=i&&i<=9743||9748<=i&&i<=9749||9756===i||9758===i||9792===i||9794===i||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||9839===i||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||9955===i||9960<=i&&i<=9983||10045===i||10071===i||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||65533===i||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"};var Le=function(){function t(e,n){o(this,t),this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=e,this._userSpec=null!=n?n:{},this.textSpec=this._initSpec(),yt(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=yt(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return u(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(gt(this._canvas)&&(yt(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),gt(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&yt(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),gt(this._context)&&yt(this._canvas)){var t=this._canvas.getContext("2d");yt(t)&&(t.save(),t.font=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);var i=t.fontStyle,r=void 0===i?e.fontStyle:i,a=t.fontVariant,o=void 0===a?e.fontVariant:a,s=t.fontWeight,u=void 0===s?e.fontWeight:s,l=t.fontSize,c=void 0===l?e.fontSize:l,h=t.fontFamily;return(r?r+" ":"")+(o?o+" ":"")+(u?u+" ":"")+c*n+"px "+((void 0===h?e.fontFamily:h)||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!gt(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,n,i=this._option.defaultFontParams,r=void 0===i?{}:i,a=this._userSpec,o=a.fontStyle,s=void 0===o?r.fontStyle:o,u=a.fontVariant,l=void 0===u?r.fontVariant:u,c=a.fontWeight,h=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=a.fontSize,f=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,v=a.fontFamily,p=void 0===v?null!==(n=r.fontFamily)&&void 0!==n?n:"sans-serif":v,g=a.align,y=a.textAlign,m=void 0===y?null!=g?g:"center":y,k=a.baseline,b=a.textBaseline,_=void 0===b?null!=k?k:"middle":b,x=a.ellipsis,w=a.limit,S=this._userSpec.lineHeight,A=void 0===S?f:S;if(xt(A)&&"%"===A[A.length-1]){var T=Number.parseFloat(A.substring(0,A.length-1))/100;A=f*T}return{fontStyle:s,fontVariant:l,fontFamily:p,fontSize:f,fontWeight:h,textAlign:m,textBaseline:_,ellipsis:x,limit:w,lineHeight:A}}},{key:"measure",value:function(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}},{key:"fullMeasure",value:function(t){if(gt(t))return{width:0,height:0};if(gt(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,n=this.textSpec,i=n.fontFamily,r=n.fontSize,a=n.fontWeight,o=n.textAlign,s=n.textBaseline,u=n.ellipsis,l=n.limit,c=n.lineHeight;try{var h=this._option.getTextBounds({text:t,fontFamily:i,fontSize:r,fontWeight:a,textAlign:o,textBaseline:s,ellipsis:!!u,maxLineWidth:l||1/0,lineHeight:c});e={width:h.width(),height:h.height()}}catch(n){this._notSupportVRender=!0,e=this.measureWithNaiveCanvas(t)}return e}},{key:"measureWithNaiveCanvas",value:function(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}},{key:"_measureWithNaiveCanvas",value:function(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);var n=this._context.measureText(t),i=this.textSpec,r=i.fontSize,a=i.lineHeight;return{width:n.width,height:null!==(e=a)&&void 0!==e?e:r}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var n={width:0,height:0},i=0;i<e.length;i++){var r=e[i],a=this._measureSpecialChar(r);gt(a)&&t.NUMBERS_CHAR_SET.includes(r)&&(a=this._measureNumberChar()),gt(a)&&["F","W"].includes(Ie(r))&&(a=this._measureFullSizeChar()),gt(a)&&(a=this._measureLetterChar()),n.width+=a.width,n.height=Math.max(n.height,a.height)}return n}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e,n={width:0,height:0},i=this.textSpec,r=i.fontSize,a=i.lineHeight,o=0;o<t.length;o++){var s=t[o],u=["F","W"].includes(Ie(s))?1:.53;n.width+=u*r}return n.height=null!==(e=a)&&void 0!==e?e:r,n}},{key:"_measureReduce",value:function(t,e){var n,i=this.textSpec,r=i.fontSize,a=i.lineHeight,o={width:0,height:0};if(gt(t))return o;if(wt(t)){var s=t.filter(yt).map((function(t){return t.toString()}));return 0===s.length?o:1===s.length?e(s[0]):{width:s.reduce((function(t,n){return Math.max(t,e(n).width)}),0),height:s.length*((null!==(n=a)&&void 0!==n?n:r)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(gt(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return gt(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(gt(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return yt(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){yt(this._canvas)&&(this._canvas=null),yt(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}])}();Le.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Le.NUMBERS_CHAR_SET="0123456789",Le.FULL_SIZE_CHAR="字";var De,je,Fe,Ne,Ge,ze,Ue,We,Ve,He,Ye,Xe,Ke,qe,Ze=function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()},Je=Xt-1e-8,$e=function(){return u((function t(e){o(this,t),this.init(e)}),[{key:"init",value:function(t){this.bounds=t}},{key:"arc",value:function(t,e,n,i,r,a){if(Math.abs(r-i)>Je)return this.bounds.add(t-n,e-n),void this.bounds.add(t+n,e+n);var o,s,u,l,c=1/0,h=-1/0,d=1/0,f=-1/0;function v(t){u=n*Math.cos(t),l=n*Math.sin(t),u<c&&(c=u),u>h&&(h=u),l<d&&(d=l),l>f&&(f=l)}if(v(i),v(r),r!==i)if((i%=Xt)<0&&(i+=Xt),(r%=Xt)<0&&(r+=Xt),r<i&&(a=!a,o=i,i=r,r=o),a)for(r-=Xt,o=i-i%Yt,s=0;s<4&&o>r;++s,o-=Yt)v(o);else for(o=i-i%Yt+Yt,s=0;s<4&&o<r;++s,o+=Yt)v(o);this.bounds.add(t+c,e+d),this.bounds.add(t+h,e+f)}},{key:"arcTo",value:function(t,e,n,i,r){throw new Error("不支持arcTo")}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){this.bounds.add(t,e),this.bounds.add(n,i),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,n,i){this.bounds.add(t,e),this.bounds.add(n,i)}},{key:"rect",value:function(t,e,n,i){this.bounds.add(t,e),this.bounds.add(t+n,e+i)}},{key:"clear",value:function(){this.bounds.clear()}},{key:"release",value:function(){}}])}(),Qe=function(){return u((function t(){o(this,t),this.curves=[],this.bounds=new de}),[{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}}])}(),tn=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,en={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},nn={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};function rn(t){if(!t)return[];var e,n,i=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===i)return[];for(var r=[],a=0,o=i.length;a<o;a++)if(De=i[a],je=De.slice(1),e=[Fe=De[0]],null!==(n=je.match(tn))){for(var s=0,u=n.length;s<u;s++)Ne=n[s],Ge=parseFloat(Ne),Number.isNaN(Ge)||e.push(Ge);if(ze=en[Fe],e.length-1>ze)for(var l=void 0,c=1,h=e.length;c<h;c+=ze){l=[Fe];for(var d=c,f=c+ze;d<f;d++)l.push(e[d]);r.push(l)}else r.push(e)}else r.push(e);return r}function an(t,e,n,i,r,a,o,s,u){var l=o*(Math.PI/180),c=Math.sin(l),h=Math.cos(l),d=h*(s-t)*.5+c*(u-e)*.5,f=h*(u-e)*.5-c*(s-t)*.5,v=d*d/((n=Math.abs(n))*n)+f*f/((i=Math.abs(i))*i);v>1&&(n*=v=Math.sqrt(v),i*=v);var p=h/n,g=c/n,y=-c/i,m=h/i,k=p*s+g*u,b=y*s+m*u,_=p*t+g*e,x=y*t+m*e,w=1/((_-k)*(_-k)+(x-b)*(x-b))-.25;w<0&&(w=0);var S=Math.sqrt(w);a===r&&(S=-S);var A=.5*(k+_)-S*(x-b),T=.5*(b+x)+S*(_-k),C=Math.atan2(b-T,k-A),E=Math.atan2(x-T,_-A)-C;E<0&&1===a?E+=Xt:E>0&&0===a&&(E-=Xt);for(var R=Math.ceil(Math.abs(E/(Yt+.001))),B=[],M=0;M<R;++M){var P=C+M*E/R,O=C+(M+1)*E/R;B[M]=[A,T,P,O,n,i,c,h]}return B}function on(t){var e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=u*a,c=-s*o,h=s*a,d=u*o,f=Math.cos(i),v=Math.sin(i),p=Math.cos(r),g=Math.sin(r),y=.5*(r-i),m=Math.sin(.5*y),k=8/3*m*m/Math.sin(y),b=e+f-k*v,_=n+v+k*f,x=e+p,w=n+g,S=x+k*g,A=w-k*p;return[l*b+c*_,h*b+d*_,l*S+c*A,h*S+d*A,l*x+c*w,h*x+d*w]}function sn(t,e,n,i){for(var r=an(i[5],i[6],i[0],i[1],i[3],i[4],i[2],e,n),a=0;a<r.length;++a){var o=on(r[a]);t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5])}}t.UpdateTag=void 0,(Ue=t.UpdateTag||(t.UpdateTag={}))[Ue.NONE=0]="NONE",Ue[Ue.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",Ue[Ue.UPDATE_SHAPE=2]="UPDATE_SHAPE",Ue[Ue.CLEAR_SHAPE=253]="CLEAR_SHAPE",Ue[Ue.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",Ue[Ue.INIT=179]="INIT",Ue[Ue.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",Ue[Ue.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",Ue[Ue.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",Ue[Ue.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",Ue[Ue.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",Ue[Ue.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",Ue[Ue.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",Ue[Ue.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(We=t.IContainPointMode||(t.IContainPointMode={}))[We.GLOBAL=1]="GLOBAL",We[We.LOCAL=16]="LOCAL",We[We.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",We[We.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Ve=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Ve.INIT=0]="INIT",Ve[Ve.DEFAULT=1]="DEFAULT",Ve[Ve.STATE=2]="STATE",Ve[Ve.ANIMATE_BIND=10]="ANIMATE_BIND",Ve[Ve.ANIMATE_PLAY=11]="ANIMATE_PLAY",Ve[Ve.ANIMATE_START=12]="ANIMATE_START",Ve[Ve.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Ve[Ve.ANIMATE_END=14]="ANIMATE_END",Ve[Ve.TRANSLATE=20]="TRANSLATE",Ve[Ve.TRANSLATE_TO=21]="TRANSLATE_TO",Ve[Ve.SCALE=22]="SCALE",Ve[Ve.SCALE_TO=23]="SCALE_TO",Ve[Ve.ROTATE=24]="ROTATE",Ve[Ve.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(He=t.AnimateStatus||(t.AnimateStatus={}))[He.INITIAL=0]="INITIAL",He[He.RUNNING=1]="RUNNING",He[He.PAUSED=2]="PAUSED",He[He.END=3]="END",t.AnimateMode=void 0,(Ye=t.AnimateMode||(t.AnimateMode={}))[Ye.NORMAL=0]="NORMAL",Ye[Ye.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(Xe=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",Xe.from="from",Xe.to="to",Xe.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(Ke=t.CurveTypeEnum||(t.CurveTypeEnum={}))[Ke.CubicBezierCurve=0]="CubicBezierCurve",Ke[Ke.QuadraticBezierCurve=1]="QuadraticBezierCurve",Ke[Ke.ArcCurve=2]="ArcCurve",Ke[Ke.LineCurve=3]="LineCurve",Ke[Ke.EllipseCurve=4]="EllipseCurve",Ke[Ke.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(qe=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[qe.beforeFillStroke=0]="beforeFillStroke",qe[qe.afterFillStroke=1]="afterFillStroke";var un=function(t,e,n,i,r,a,o){var s=Math.abs(n-e),u=4*Math.tan(s/4)/3,l=n<e?-1:1,c=Math.cos(e),h=Math.sin(e),d=Math.cos(n),f=Math.sin(n),v=c*a+i,p=h*o+r,g=d*a+i,y=f*o+r,m=a*u*l,k=o*u*l;t.push(v-m*h,p+k*c,g+m*f,y-k*d,g,y)},ln=[function(t,e,n,i,r,a,o){return e.arc(t[1]*r+n,t[2]*a+i,t[3]*(r+a)/2,t[4],t[5],t[6],o)},function(t,e,n,i,r,a,o){return e.arcTo(t[1]*r+n,t[2]*a+i,t[3]*r+n,t[4]*a+i,t[5]*(r+a)/2,o)},function(t,e,n,i,r,a,o){return e.bezierCurveTo(t[1]*r+n,t[2]*a+i,t[3]*r+n,t[4]*a+i,t[5]*r+n,t[6]*a+i,o)},function(t,e,n,i){return e.closePath()},function(t,e,n,i,r,a){return e.ellipse(t[1]*r+n,t[2]*a+i,t[3]*r,t[4]*a,t[5],t[6],t[7],t[8])},function(t,e,n,i,r,a,o){return e.lineTo(t[1]*r+n,t[2]*a+i,o)},function(t,e,n,i,r,a,o){return e.moveTo(t[1]*r+n,t[2]*a+i,o)},function(t,e,n,i,r,a,o){return e.quadraticCurveTo(t[1]*r+n,t[2]*a+i,t[3]*r+n,t[4]*a+i,o)},function(t,e,n,i,r,a,o){return e.rect(t[1]*r+n,t[2]*a+i,t[3]*r,t[4]*a,o)}];function cn(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0,s=0;s<t.length;s++){var u=t[s];ln[u[0]](u,e,n,i,r,a,o)}}var hn=function(){return u((function t(){o(this,t)}),[{key:"getLength",value:function(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}])}();function dn(t,e){for(var n=0,i=t.length,r=0;r<i;r++){var a=t[r],o=e[r],s=t[(r+1)%i],u=e[(r+1)%i];n+=le.distanceNN(a,o,s,u)}return n/2}function fn(t,e,n,i,r){return dn([t.x,e.x,n.x,i.x],[t.y,e.y,n.y,i.y])}function vn(t,e,n,i,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*n*r*r*a+i*r*r*r}function pn(t,e,n,i,r){var a=vn(t.x,e.x,n.x,i.x,r),o=vn(t.y,e.y,n.y,i.y,r);return new ue(a,o)}function gn(t,e){var n=t.p0,i=t.p1,r=t.p2,a=t.p3,o=pn(n,i,r,a,e),s=le.pointAtPP(n,i,e),u=le.pointAtPP(i,r,e),l=le.pointAtPP(r,a,e),c=le.pointAtPP(s,u,e),h=le.pointAtPP(u,l,e);return[new yn(n,s,c,o),new yn(o,h,l,a)]}var yn=function(n){function i(n,r,a,s){var u;return o(this,i),(u=e(this,i)).type=t.CurveTypeEnum.CubicBezierCurve,u.p0=n,u.p1=r,u.p2=a,u.p3=s,u}return c(i,n),u(i,[{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 pn(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}},{key:"calcLength",value:function(){return this._validPoint()?fn(this.p0,this.p1,this.p2,this.p3):60}},{key:"calcProjLength",value:function(e){return e===t.Direction.ROW?qt(this.p0.x-this.p3.x):e===t.Direction.COLUMN?qt(this.p0.y-this.p3.y):0}},{key:"getAngleAt",value:function(t){var e=$t(t-.01,0),n=Qt(t+.01,1),i=this.getPointAt(e),r=this.getPointAt(n);return Zt(r.y-i.y,r.x-i.x)}}])}(hn);function mn(t,e){var n=t.p0,i=t.p1,r=le.pointAtPP(n,i,e);return[new kn(n,r),new kn(r,i)]}var kn=function(n){function i(n,r){var a;return o(this,i),(a=e(this,i)).type=t.CurveTypeEnum.LineCurve,a.p0=n,a.p1=r,a}return c(i,n),u(i,[{key:"getPointAt",value:function(t){if(!1!==this.defined)return le.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}},{key:"getAngleAt",value:function(t){return null==this.angle&&(this.angle=Zt(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()?le.distancePP(this.p0,this.p1):60}},{key:"calcProjLength",value:function(e){return e===t.Direction.ROW?qt(this.p0.x-this.p1.x):e===t.Direction.COLUMN?qt(this.p0.y-this.p1.y):0}}])}(hn),bn=function(){return u((function t(e,n){o(this,t),this.init(e,n)}),[{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,e,n,i,r,a,o,s){var u=new yn(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i),new ue(r,a));u.originP1=this._lastOriginP,u.originP2=s,u.defined=o,this.curves.push(u),this._lastX=r,this._lastY=a,this._lastOriginP=s}},{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,n,i){var r=this.addLinearCurve(t,e,n,this._lastOriginP,i);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=i}},{key:"moveTo",value:function(t,e,n){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=n,this._startOriginP=n,this}},{key:"quadraticCurveTo",value:function(t,e,n,i){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,e,n,i,r){var a=new kn(new ue(this._lastX,this._lastY),new ue(t,e));return a.originP1=i,a.originP2=r,a.defined=n,a}},{key:"getPointAt",value:function(t){throw new Error("暂未实现")}},{key:"getCurveLengths",value:function(){return[]}},{key:"getLength",value:function(e){var n,i;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;var r=this.curves[0],a=this.curves[this.curves.length-1],o=null!==(n=a.p3)&&void 0!==n?n:a.p1;return qt(r.p0.y-o.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;var s=this.curves[0],u=this.curves[this.curves.length-1],l=null!==(i=u.p3)&&void 0!==i?i:u.p1;return qt(s.p0.x-l.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce((function(t,e){return t+e.getLength()}),0)),this.length}}])}(),_n=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"bezierCurveTo",value:function(t,e,i,r,a,o,s,u){return p(h(n.prototype),"bezierCurveTo",this).call(this,e,t,r,i,o,a,s,u)}},{key:"lineTo",value:function(t,e,i,r){return p(h(n.prototype),"lineTo",this).call(this,e,t,i,r)}},{key:"moveTo",value:function(t,e,i){return p(h(n.prototype),"moveTo",this).call(this,e,t,i)}},{key:"clear",value:function(){return p(h(n.prototype),"clear",this).call(this)}}])}(bn);function xn(t,e){for(var n=!1,i=0,r=e.length;i<=r;i++)i>=r===n&&((n=!n)?t.lineStart():t.lineEnd()),n&&t.point(e[i])}function wn(e,n,i){var r=null!=n?n:qt(i[i.length-1].x-i[0].x)>qt(i[i.length-1].y-i[0].y)?t.Direction.ROW:t.Direction.COLUMN;return"monotoneY"===e?new _n(e,r):new bn(e,r)}var Sn=function(){return u((function t(e,n){o(this,t),this.context=e,n&&(this.startPoint=n)}),[{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function An(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=wn("linear",n,t);return Tn(new Sn(r,i),t),r}function Tn(t,e){return xn(t,e)}function Cn(t,e,n,i,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6,i,t.lastPoint1)}var En=function(){return u((function t(e,n){o(this,t),this.context=e,this.startPoint=n}),[{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&&Cn(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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;break;default:Cn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function Rn(t,e){return xn(t,e)}function Bn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return An(t,e);var r=wn("basis",n,t);return Rn(new En(r,i),t),r}function Mn(t){return t<0?-1:1}function Pn(t,e,n){var i=t._x1-t._x0,r=e-t._x1,a=(t._y1-t._y0)/(i||Number(r<0&&-0)),o=(n-t._y1)/(r||Number(i<0&&-0)),s=(a*r+o*i)/(i+r);return(Mn(a)+Mn(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function On(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function In(t,e,n,i,r){var a=t._x0,o=t._y0,s=t._x1,u=t._y1,l=(s-a)/3;t.context.bezierCurveTo(a+l,o+l*e,s-l,u-l*n,s,u,i,t.lastPoint1)}var Ln=function(){return u((function t(e,n){o(this,t),this.context=e,this.startPoint=n}),[{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:In(this,this._t0,On(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,n=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(n,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(n,i,t);break;case 1:this._point=2;break;case 2:this._point=3,In(this,On(this,e=Pn(this,n,i)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:In(this,this._t0,e=Pn(this,n,i),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=i,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}(),Dn=function(t){function n(t,i){return o(this,n),e(this,n,[t,i])}return c(n,t),u(n,[{key:"point",value:function(t){return p(h(n.prototype),"point",this).call(this,{y:t.x,x:t.y,defined:t.defined})}}])}(Ln);function jn(t,e){return xn(t,e)}function Fn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return An(t,e);var r=wn("monotoneX",n,t);return jn(new Ln(r,i),t),r}function Nn(t,e){return xn(t,e)}function Gn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;if(t.length<3-Number(!!i))return An(t,e);var r=wn("monotoneY",n,t);return Nn(new Dn(r,i),t),r}var zn=function(){return u((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;o(this,t),this.context=e,this._t=n,this.startPoint=i}),[{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,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,n,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,n,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,n,!1!==this._lastDefined&&!1!==t.defined,t);else{var i=this._x*(1-this._t)+e*this._t;this.context.lineTo(i,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(i,n,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=n,this.lastPoint=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function Un(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.direction,a=i.startPoint;if(e.length<2-Number(!!a))return null;var o=new bn("step",null!=r?r:qt(e[e.length-1].x-e[0].x)>qt(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Wn(new zn(o,n,a),e),o}function Wn(t,e){return xn(t,e)}var Vn=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"lineEnd",value:function(){this.context.closePath()}}])}(Sn);function Hn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.direction,i=e.startPoint;if(t.length<2-Number(!!i))return null;var r=wn("linear",n,t);return Yn(new Vn(r,i),t),r}function Yn(t,e){return xn(t,e)}function Xn(t,e,n,i,r){var a=t._x1,o=t._y1,s=t._x2,u=t._y2;if(t._l01_a>Vt){var l=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);a=(a*l-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,o=(o*l-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Vt){var h=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,d=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*h+t._x1*t._l23_2a-e*t._l12_2a)/d,u=(u*h+t._y1*t._l23_2a-n*t._l12_2a)/d}t.context.bezierCurveTo(a,o,s,u,t._x2,t._y2,i,t.lastPoint1)}var Kn=function(){return u((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;o(this,t),this.context=e,this.startPoint=i,this._alpha=n}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}},{key:"lineEnd",value:function(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}},{key:"point",value:function(t){var e=t.x,n=t.y;if(this._point){var i=this._x2-e,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Xn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}();function qn(t,e){return function(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r.direction,o=r.startPoint;if(n.length<2-Number(!!o))return null;if(n.length<3-Number(!!o))return An(n,r);var s=wn(t,a,n);return xn(new e(s,i,o),n),s}}var Zn=qn("catmullRom",Kn),Jn=function(){return u((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;o(this,t),this.context=e,this.startPoint=i,this._alpha=n}),[{key:"areaStart",value:function(){this._line=0}},{key:"areaEnd",value:function(){this._line=NaN}},{key:"lineStart",value:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}},{key:"lineEnd",value:function(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}},{key:"point",value:function(t){var e=t.x,n=t.y;if(this._point){var i=this._x2-e,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=n;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=n,t);break;case 2:this._point=3,this._x5=e,this._y5=n;break;default:Xn(this,e,n,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=n,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}},{key:"tryUpdateLength",value:function(){return this.context.tryUpdateLength()}}])}(),$n=qn("catmullRomClosed",Jn),Qn=function(){return u((function t(e){o(this,t),this.path=e,this._lastX=this._lastY=this._startX=this._startY=0}),[{key:"moveTo",value:function(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}},{key:"lineTo",value:function(t,e){var n=this.addLinearCurve(t,e);this.path.curves.push(n),this._lastX=t,this._lastY=e}},{key:"addLinearCurve",value:function(t,e){return new kn(new ue(this._lastX,this._lastY),new ue(t,e))}},{key:"quadraticCurveTo",value:function(t,e,n,i){throw new Error("CurveContext不支持调用quadraticCurveTo")}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){var o=new yn(new ue(this._lastX,this._lastY),new ue(t,e),new ue(n,i),new ue(r,a));this.path.curves.push(o),this._lastX=r,this._lastY=a}},{key:"arcTo",value:function(t,e,n,i,r){throw new Error("CurveContext不支持调用arcTo")}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){throw new Error("CurveContext不支持调用ellipse")}},{key:"rect",value:function(t,e,n,i){throw new Error("CurveContext不支持调用rect")}},{key:"arc",value:function(t,e,n,i,r,a){throw new Error("CurveContext不支持调用arc")}},{key:"closePath",value:function(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}])}();function ti(t,e,n){var i,r;switch(e){case"linear":default:return An(t,n);case"basis":return Bn(t,n);case"monotoneX":return Fn(t,n);case"monotoneY":return Gn(t,n);case"step":return Un(t,.5,n);case"stepBefore":return Un(t,0,n);case"stepAfter":return Un(t,1,n);case"catmullRom":return Zn(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return $n(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Hn(t,n)}}var ei=function(n){function i(t){var n;return o(this,i),(n=e(this,i)).commandList=[],t&&(n._ctx=t),n._boundsContext=new $e(n.bounds),n}return c(i,n),u(i,[{key:"setCtx",value:function(t){this._ctx=t}},{key:"moveTo",value:function(t,e){return this.commandList.push([nn.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}},{key:"lineTo",value:function(t,e){return this.commandList.push([nn.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}},{key:"quadraticCurveTo",value:function(t,e,n,i){return this.commandList.push([nn.Q,t,e,n,i]),this._ctx&&this._ctx.quadraticCurveTo(t,e,n,i),this}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){return this.commandList.push([nn.C,t,e,n,i,r,a]),this._ctx&&this._ctx.bezierCurveTo(t,e,n,i,r,a),this}},{key:"arcTo",value:function(t,e,n,i,r){return this.commandList.push([nn.AT,t,e,n,i,r]),this._ctx&&this._ctx.arcTo(t,e,n,i,r),this}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){return this.commandList.push([nn.E,t,e,n,i,r,a,o,s]),this._ctx&&this._ctx.ellipse(t,e,n,i,r,a,o,s),this}},{key:"rect",value:function(t,e,n,i){return this.commandList.push([nn.R,t,e,n,i]),this._ctx&&this._ctx.rect(t,e,n,i),this}},{key:"arc",value:function(t,e,n,i,r,a){return this.commandList.push([nn.A,t,e,n,i,r,a]),this._ctx&&this._ctx.arc(t,e,n,i,r,a),this}},{key:"closePath",value:function(){return this.commandList.push([nn.Z]),this._ctx&&this._ctx.closePath(),this}},{key:"addCurve",value:function(t){this.curves.push(t)}},{key:"clear",value:function(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}},{key:"beginPath",value:function(){this.clear()}},{key:"toString",value:function(){if(!this.toStringCbList){var t=[];t[nn.M]=function(t){return"M".concat(t[1]," ").concat(t[2])},t[nn.L]=function(t){return"L".concat(t[1]," ").concat(t[2])},t[nn.Q]=function(t){return"Q".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4])},t[nn.C]=function(t){return"C".concat(t[1]," ").concat(t[2]," ").concat(t[3]," ").concat(t[4]," ").concat(t[5]," ").concat(t[6])},t[nn.A]=function(t){var e=[];un(e,t[4],t[5],t[1],t[2],t[3],t[3]);for(var n="",i=0;i<e.length;i+=6)n+="C".concat(e[i]," ").concat(e[i+1]," ").concat(e[i+2]," ").concat(e[i+3]," ").concat(e[i+4]," ").concat(e[i+5]);return n},t[nn.R]=function(t){return"M".concat(t[1]," ").concat(t[2]," h").concat(t[3]," v").concat(t[4]," H").concat(t[1],"Z")},t[nn.Z]=function(t){return"Z"},this.toStringCbList=t}var e=this.toStringCbList,n="";return this.commandList.forEach((function(t){n+=e[t[0]](t)})),n}},{key:"fromString",value:function(t,e,n,i,r){this.clear();var a=rn(t);return this._runCommandStrList(a,e,n,i,r),this._updateBounds(),this}},{key:"fromLine",value:function(e){var n=e.attribute,i=n.points,r=n.curveType,a=n.clipRangeByDimension;if(i){var o=ti(i,r);"x"===a?this.direction=t.Direction.ROW:"y"===a?this.direction=t.Direction.COLUMN:"auto"===a&&(this.direction=o.direction),this.curves=o.curves}}},{key:"fromCustomPath2D",value:function(t,e,n,i,r){return this.clear(),this._runCommandList(t.commandList,e,n,i,r),this._updateBounds(),this}},{key:"transform",value:function(t,e,n,i){var r=this,a=this.commandList;if(!this.transformCbList){var o=[];o[nn.M]=this.moveToTransform,o[nn.L]=this.lineToTransform,o[nn.Q]=this.quadraticCurveToTransform,o[nn.C]=this.bezierCurveToTransform,o[nn.AT]=this.arcToTransform,o[nn.E]=this.ellipseTransform,o[nn.R]=this.rectTransform,o[nn.A]=this.arcTransform,o[nn.Z]=this.closePathTransform,this.transformCbList=o}a.forEach((function(a){r.transformCbList[a[0]](a,t,e,n,i)})),this._updateBounds()}},{key:"moveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"lineToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n}},{key:"quadraticCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n}},{key:"bezierCurveToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*i+e,t[6]=t[6]*r+n}},{key:"arcToTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i+e,t[4]=t[4]*r+n,t[5]=t[5]*(i+r)/2}},{key:"ellipseTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"rectTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*i,t[4]=t[4]*r}},{key:"arcTransform",value:function(t,e,n,i,r){t[1]=t[1]*i+e,t[2]=t[2]*r+n,t[3]=t[3]*(i+r)/2}},{key:"closePathTransform",value:function(){}},{key:"_runCommandStrList",value:function(t){for(var e,n,i,r,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,h=0,d=0,f=0,v=0,p=0,g=t.length;p<g;++p){switch(e=t[p],1===u&&1===l||(e=ii(e,u,l)),e[0]){case"l":h+=e[1],d+=e[2],this.lineTo(h+o,d+s);break;case"L":h=e[1],d=e[2],this.lineTo(h+o,d+s);break;case"h":h+=e[1],this.lineTo(h+o,d+s);break;case"H":h=e[1],this.lineTo(h+o,d+s);break;case"v":d+=e[1],this.lineTo(h+o,d+s);break;case"V":d=e[1],this.lineTo(h+o,d+s);break;case"m":h+=e[1],d+=e[2],this.moveTo(h+o,d+s);break;case"M":h=e[1],d=e[2],this.moveTo(h+o,d+s);break;case"c":n=h+e[5],i=d+e[6],f=h+e[3],v=d+e[4],this.bezierCurveTo(h+e[1]+o,d+e[2]+s,f+o,v+s,n+o,i+s),h=n,d=i;break;case"C":h=e[5],d=e[6],f=e[3],v=e[4],this.bezierCurveTo(e[1]+o,e[2]+s,f+o,v+s,h+o,d+s);break;case"s":n=h+e[3],i=d+e[4],f=2*h-f,v=2*d-v,this.bezierCurveTo(f+o,v+s,h+e[1]+o,d+e[2]+s,n+o,i+s),f=h+e[1],v=d+e[2],h=n,d=i;break;case"S":n=e[3],i=e[4],f=2*h-f,v=2*d-v,this.bezierCurveTo(f+o,v+s,e[1]+o,e[2]+s,n+o,i+s),h=n,d=i,f=e[1],v=e[2];break;case"q":n=h+e[3],i=d+e[4],f=h+e[1],v=d+e[2],this.quadraticCurveTo(f+o,v+s,n+o,i+s),h=n,d=i;break;case"Q":n=e[3],i=e[4],this.quadraticCurveTo(e[1]+o,e[2]+s,n+o,i+s),h=n,d=i,f=e[1],v=e[2];break;case"t":n=h+e[1],i=d+e[2],null===c[0].match(/[QqTt]/)?(f=h,v=d):"t"===c[0]?(f=2*h-r,v=2*d-a):"q"===c[0]&&(f=2*h-f,v=2*d-v),r=f,a=v,this.quadraticCurveTo(f+o,v+s,n+o,i+s),d=i,f=(h=n)+e[1],v=d+e[2];break;case"T":n=e[1],i=e[2],f=2*h-f,v=2*d-v,this.quadraticCurveTo(f+o,v+s,n+o,i+s),h=n,d=i;break;case"a":sn(this,h+o,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+h+o,e[7]+d+s]),h+=e[6],d+=e[7];break;case"A":sn(this,h+o,d+s,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+s]),h=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}},{key:"_runCommandList",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==n||1!==i||1!==r)for(var a=0,o=t.length;a<o;++a){var s=t[a].slice();switch(s[0]){case nn.L:this.lineToTransform(s,e,n,i,r);break;case nn.M:this.moveToTransform(s,e,n,i,r);break;case nn.C:this.bezierCurveToTransform(s,e,n,i,r);break;case nn.Q:this.quadraticCurveToTransform(s,e,n,i,r);break;case nn.A:this.arcToTransform(s,e,n,i,r);break;case nn.E:this.ellipseTransform(s,e,n,i,r);break;case nn.R:this.rectTransform(s,e,n,i,r);break;case nn.AT:this.arcToTransform(s,e,n,i,r);break;case nn.Z:this.closePath()}}else this.commandList=t.map((function(t){return t.slice()}))}},{key:"_updateBounds",value:function(){this.bounds.clear(),cn(this.commandList,this._boundsContext)}},{key:"release",value:function(){this.commandList=[],this._boundsContext=null,this._ctx=null}},{key:"getLength",value:function(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;var e=this.curves[0],n=this.curves[this.curves.length-1];return qt(e.p0.y-n.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;var i=this.curves[0],r=this.curves[this.curves.length-1];return qt(i.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,n=0,i=0;i<this.curves.length;i++){var r=(e=this.curves[i]).getLength(this.direction);if(n+r>=t)break;n+=r}var a=(t-n)/e.getLength(this.direction);return{pos:e.getPointAt(a),angle:e.getAngleAt(a)}}}])}(Qe),ni=["l",0,0,0,0,0,0,0];function ii(t,e,n){var i=ni[0]=t[0];if("a"===i||"A"===i)ni[1]=e*t[1],ni[2]=n*t[2],ni[3]=t[3],ni[4]=t[4],ni[5]=t[5],ni[6]=e*t[6],ni[7]=n*t[7];else if("h"===i||"H"===i)ni[1]=e*t[1];else if("v"===i||"V"===i)ni[1]=n*t[1];else for(var r=1,a=t.length;r<a;++r)ni[r]=(r%2==1?e:n)*t[r];return ni}var ri={alignSelf:"auto"},ai={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 pe},oi={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},si={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},ui=Object.assign({outerBorder:Object.assign(Object.assign({},si),{distance:0}),innerBorder:Object.assign(Object.assign({},si),{distance:0})},si),li={text:"",maxLineWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0},ci={pickStrokeBuffer:0},hi=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},oi),ui),ri),ci),di={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},fi={_debug_bounds:!1},vi=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic"},fi),hi),ai);var pi=Object.assign(Object.assign({},vi),{startAngle:0,endAngle:Kt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),gi=Object.assign(Object.assign(Object.assign({},vi),di),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),yi=Object.assign(Object.assign({},vi),{radius:1,startAngle:0,endAngle:Kt}),mi=Object.assign(Object.assign({},vi),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),ki=Object.assign(Object.assign({},vi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),bi=Object.assign(Object.assign(Object.assign({},vi),di),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),_i=Object.assign(Object.assign({},vi),{path:new ei,customPath:function(){Nt.getInstance().warn("空函数")}}),xi=Object.assign(Object.assign({},vi),{points:[],cornerRadius:0,closePath:!0}),wi=Object.assign(Object.assign({},vi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),Si=Object.assign(Object.assign({},vi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Ai=Object.assign(Object.assign({},vi),{symbolType:"circle",size:10,keepDirIn3d:!0}),Ti=Object.assign(Object.assign(Object.assign({},vi),li),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Ci=Object.assign(Object.assign(Object.assign({},vi),li),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Ei=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},vi),{fill:!0,cornerRadius:0}),Ri=Object.assign(Object.assign({},Ei),{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}),Bi=u((function t(){o(this,t)})),Mi=new Bi,Pi={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"}},Oi=!0,Ii=!1,Li=/\w|\(|\)|-/,Di=/[.?!,;:/,。?!、;:]/,ji=/\S/;function Fi(t,e,n,i,r){if(!e||e<=0)return 0;for(var a=Mi.graphicUtil.textMeasure,o=i,s=t.slice(0,o),u=Math.floor(a.measureText(s,n).width),l=t.slice(0,o+1),c=Math.floor(a.measureText(l,n).width);u>e||c<=e;){if(u>e?o--:o++,o>t.length){o=t.length;break}if(o<0){o=0;break}s=t.slice(0,o),u=Math.floor(a.measureText(s,n).width),l=t.slice(0,o+1),c=Math.floor(a.measureText(l,n).width)}return r&&(o=Ni(t,o)),o}function Ni(t,e){for(var n=e;Li.test(t[n-1])&&Li.test(t[n])||Di.test(t[n]);)if(--n<=0)return e;return n}function Gi(t,e){var n=Mi.graphicUtil.textMeasure.measureText(t,e),i={ascent:0,height:0,descent:0,width:0};return"number"!=typeof n.actualBoundingBoxAscent||"number"!=typeof n.actualBoundingBoxDescent?(i.width=Math.floor(n.width),i.height=e.fontSize||0,i.ascent=i.height,i.descent=0):(i.width=Math.floor(n.width),i.height=Math.floor(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent),i.ascent=Math.floor(n.actualBoundingBoxAscent),i.descent=i.height-i.ascent),i}var zi=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ui=function(){return u((function t(){o(this,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 n=e.fontSize,i=void 0===n?Ti.fontSize:n,r=0,a=0,o=0;o<t.length;o++)t.charCodeAt(o)<128?r++:a++;return{width:~~(.8*r*i+a*i),height:i}}},{key:"measureTextPixelHeight",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:li.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)}},{key:"measureTextBoundHieght",value:function(t,e){var n;if(!this.context)return null!==(n=e.fontSize)&&void 0!==n?n:li.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);var i=this.context.measureText(t);return Math.abs(i.fontBoundingBoxAscent-i.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,n,i){var r=this;if(0===t.length)return{verticalList:t,width:0};var a=e.fontSize,o=void 0===a?12:a;t.forEach((function(t){t.width=0===t.direction?o:r.measureTextWidth(t.text,e)}));for(var s=[],u=0,l=0;l<t.length&&u+t[l].width<n;l++)u+=t[l].width,s.push(t[l]);if(t[l]&&t[l].text.length>1){var c=this._clipText(t[l].text,e,n-u,0,t[l].text.length-1,"end",!1);if(i&&c.str!==t[l].text){for(var h="",d=0,f=0;f<l;f++){var v=t[f];h+=v.text,d+=v.text.length}var p=Ni(h+=t[l].text,d+c.str.length);(p-=d)!==c.str.length-1&&(c.str=c.str.substring(0,p),c.width=this.measureTextWidth(c.str,e))}s.push(Object.assign(Object.assign({},t[l]),{text:c.str,width:c.width})),u+=c.width}return{verticalList:s,width:u}}},{key:"clipText",value:function(t,e,n,i){if(0===t.length)return{str:"",width:0};var r=this.measureTextWidth(t,e);if(r<=n)return{str:t,width:r};if((r=this.measureTextWidth(t[0],e))>n)return{str:"",width:0};var a=this._clipText(t,e,n,0,t.length-1,"end",!1);if(i&&a.str!==t){var o=Ni(t,a.str.length);o!==a.str.length&&(a.str=t.substring(0,o),a.width=this.measureTextWidth(a.str,e))}return a}},{key:"_clipText",value:function(t,e,n,i,r,a,o){var s;if("start"===a)s=this._clipTextStart(t,e,n,i,r),o&&(s.result=o+s.str);else if("middle"===a){var u=this._clipTextMiddle(t,e,n,"","",0,0,1);s={str:"none",width:u.width,result:u.left+o+u.right}}else s=this._clipTextEnd(t,e,n,i,r),o&&(s.result=s.str+o);return s}},{key:"_clipTextEnd",value:function(t,e,n,i,r){var a,o=Math.floor((i+r)/2),s=t.substring(0,o+1),u=this.measureTextWidth(s,e);if(u>n){if(s.length<=1)return{str:"",width:0};var l=t.substring(0,o);return(a=this.measureTextWidth(l,e))<=n?{str:l,width:a}:this._clipTextEnd(t,e,n,i,o)}if(u<n){if(o>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};var c=t.substring(0,o+2);return(a=this.measureTextWidth(c,e))>=n?{str:s,width:u}:this._clipTextEnd(t,e,n,o,r)}return{str:s,width:u}}},{key:"_clipTextStart",value:function(t,e,n,i,r){var a,o=Math.ceil((i+r)/2),s=t.substring(o-1,t.length-1),u=this.measureTextWidth(s,e);if(u>n){if(s.length<=1)return{str:"",width:0};var l=t.substring(o,t.length-1);return(a=this.measureTextWidth(l,e))<=n?{str:l,width:a}:this._clipTextStart(t,e,n,o,t.length-1)}if(u<n){if(o<=0)return{str:t,width:this.measureTextWidth(t,e)};var c=t.substring(o-2,t.length-1);return(a=this.measureTextWidth(c,e))>=n?{str:s,width:u}:this._clipTextStart(t,e,n,i,o)}return{str:s,width:u}}},{key:"_clipTextMiddle",value:function(t,e,n,i,r,a,o,s){var u=t.substring(0,s),l=this.measureTextWidth(u,e);if(l+o>n)return{left:i,right:r,width:a+o};var c=t.substring(t.length-s,t.length),h=this.measureTextWidth(c,e);return l+h>n?{left:u,right:r,width:l+o}:this._clipTextMiddle(t,e,n,u,c,l,h,s+1)}},{key:"clipTextWithSuffixVertical",value:function(t,e,n,i,r,a){if(""===i)return this.clipTextVertical(t,e,n,r);if(0===t.length)return{verticalList:t,width:0};var o=this.clipTextVertical(t,e,n,r);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;var s,u=this.measureTextWidth(i,e);if(u>n)return o;if(n-=u,"start"===a){var l=this.revertVerticalList(t);s=this.clipTextVertical(l,e,n,r);var c=this.revertVerticalList(s.verticalList);c.unshift({text:i,direction:1,width:u}),s.verticalList=c}else if("middle"===a){var h=this.clipTextVertical(t,e,n/2,r),d=this.revertVerticalList(t),f=this.clipTextVertical(d,e,n/2,r);h.verticalList.push({text:i,direction:1,width:u}),this.revertVerticalList(f.verticalList).forEach((function(t){return h.verticalList.push(t)})),s={verticalList:h.verticalList,width:h.width+f.width}}else(s=this.clipTextVertical(t,e,n,r)).verticalList.push({text:i,direction:1,width:u});return s.width+=u,s}},{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,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===i)return this.clipText(t,e,n,r);if(0===t.length)return{str:"",width:0};var s=this.measureTextWidth(t,e);if(!o&&s<=n)return{str:t,width:s};var u=this.measureTextWidth(i,e);if(u>n)return{str:"",width:0};if(o&&s+u<=n)return{str:t+i,width:s+u};n-=u;var l=this._clipText(t,e,n,0,t.length-1,a,i);if(r&&l.str!==t){var c=Ni(t,l.str.length);c!==l.str.length&&(l.result=t.substring(0,c),l.width=this.measureTextWidth(l.str,e))}else o&&l.str===t&&(l.result=t+i);return l.str=l.result,l.width+=u,l}}])}();Ui=zi([L()],Ui);var Wi=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Vi=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(Ui),t.DefaultTextMeasureContribution=Wi([L()],t.DefaultTextMeasureContribution);var Hi=new J,Yi=Symbol.for("CanvasFactory"),Xi=Symbol.for("Context2dFactory");function Ki(t){return Hi.getNamed(Yi,Mi.global.env)(t)}var qi=1e-4,Zi=Math.sqrt(3),Ji=1/3;function $i(t){return t>-dr&&t<dr}function Qi(t){return t>dr||t<-dr}var tr=[0,0],er=[0,0],nr=[0,0];function ir(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function rr(t,e,n,i){var r=1-i;return r*(r*t+2*i*e)+i*i*n}function ar(t,e,n,i,r){var a=1-r;return a*a*(a*t+3*r*e)+r*r*(r*i+3*a*n)}function or(t){return(t%=Kt)<0&&(t+=Kt),t}function sr(t,e,n,i,r,a){if(a>e&&a>i||a<e&&a<i)return 0;if(i===e)return 0;var o=(a-e)/(i-e),s=i<e?1:-1;1!==o&&0!==o||(s=i<e?.5:-.5);var u=o*(n-t)+t;return u===r?1/0:u>r?s:0}function ur(t,e,n,i,r,a,o,s,u){if(0===o)return!1;var l=o;return!(u>e+l&&u>i+l&&u>a+l||u<e-l&&u<i-l&&u<a-l||s>t+l&&s>n+l&&s>r+l||s<t-l&&s<n-l&&s<r-l)&&function(t,e,n,i,r,a,o,s,u){var l=0,c=.005,h=1/0;tr[0]=o,tr[1]=s;for(var d=0;d<1;d+=.05){er[0]=rr(t,n,r,d),er[1]=rr(e,i,a,d);var f=ir(tr,er);f<h&&(l=d,h=f)}h=1/0;for(var v=0;v<32&&!(c<qi);v++){var p=l-c,g=l+c;er[0]=rr(t,n,r,p),er[1]=rr(e,i,a,p);var y=ir(er,tr);if(p>=0&&y<h)l=p,h=y;else{nr[0]=rr(t,n,r,g),nr[1]=rr(e,i,a,g);var m=ir(nr,tr);g<=1&&m<h?(l=g,h=m):c*=.5}}return u&&(u[0]=rr(t,n,r,l),u[1]=rr(e,i,a,l)),Math.sqrt(h)}(t,e,n,i,r,a,s,u,null)<=l/2}function lr(t,e,n,i,r,a,o,s,u,l,c){if(0===u)return!1;var h=u;return!(c>e+h&&c>i+h&&c>a+h&&c>s+h||c<e-h&&c<i-h&&c<a-h&&c<s-h||l>t+h&&l>n+h&&l>r+h&&l>o+h||l<t-h&&l<n-h&&l<r-h&&l<o-h)&&function(t,e,n,i,r,a,o,s,u,l,c){var h,d,f,v,p=0,g=.005,y=1/0;tr[0]=u,tr[1]=l;for(var m=0;m<1;m+=.05)er[0]=ar(t,n,r,o,m),er[1]=ar(e,i,a,s,m),(f=ir(tr,er))<y&&(p=m,y=f);y=1/0;for(var k=0;k<32&&!(g<qi);k++)h=p-g,d=p+g,er[0]=ar(t,n,r,o,h),er[1]=ar(e,i,a,s,h),f=ir(er,tr),h>=0&&f<y?(p=h,y=f):(nr[0]=ar(t,n,r,o,d),nr[1]=ar(e,i,a,s,d),v=ir(nr,tr),d<=1&&v<y?(p=d,y=v):g*=.5);return c&&(c[0]=ar(t,n,r,o,p),c[1]=ar(e,i,a,s,p)),Math.sqrt(y)}(t,e,n,i,r,a,o,s,l,c,null)<=h/2}function cr(t,e,n,i,r,a,o,s,u){if(0===o)return!1;var l=o;s-=t,u-=e;var c=Math.sqrt(s*s+u*u);if(c-l>n||c+l<n)return!1;if(Math.abs(i-r)%Kt<1e-4)return!0;if(a){var h=i;i=or(r),r=or(h)}else i=or(i),r=or(r);i>r&&(r+=Kt);var d=Math.atan2(u,s);return d<0&&(d+=Kt),d>=i&&d<=r||d+Kt>=i&&d+Kt<=r}function hr(t,e,n,i,r,a,o){if(0===r)return!1;var s,u=r,l=r/2;if(o>e+l&&o>i+l||o<e-l&&o<i-l||a>t+l&&a>n+l||a<t-l&&a<n-l)return!1;if(t===n)return Math.abs(a-t)<=u/2;var c=(s=(e-i)/(t-n))*a-o+(t*i-n*e)/(t-n);return c*c/(s*s+1)<=u/2*u/2}var dr=1e-4;function fr(t,e,n,i,r){var a=6*n-12*e+6*t,o=9*e+3*i-3*t-9*n,s=3*e-3*t,u=0;if($i(o)){if(Qi(a)){var l=-s/a;l>=0&&l<=1&&(r[u++]=l)}}else{var c=a*a-4*o*s;if($i(c))r[0]=-a/(2*o);else if(c>0){var h=Math.sqrt(c),d=(-a+h)/(2*o),f=(-a-h)/(2*o);d>=0&&d<=1&&(r[u++]=d),f>=0&&f<=1&&(r[u++]=f)}}return u}var vr=[-1,-1,-1],pr=[-1,-1];function gr(t,e,n,i,r,a,o,s,u,l){if(l>e&&l>i&&l>a&&l>s||l<e&&l<i&&l<a&&l<s)return 0;var c=function(t,e,n,i,r,a){var o=i+3*(e-n)-t,s=3*(n-2*e+t),u=3*(e-t),l=t-r,c=s*s-3*o*u,h=s*u-9*o*l,d=u*u-3*s*l,f=0;if($i(c)&&$i(h))if($i(s))a[0]=0;else{var v=-u/s;v>=0&&v<=1&&(a[f++]=v)}else{var p=h*h-4*c*d;if($i(p)){var g=h/c,y=-s/o+g,m=-g/2;y>=0&&y<=1&&(a[f++]=y),m>=0&&m<=1&&(a[f++]=m)}else if(p>0){var k=Math.sqrt(p),b=c*s+1.5*o*(-h+k),_=c*s+1.5*o*(-h-k),x=(-s-((b=b<0?-Math.pow(-b,Ji):Math.pow(b,Ji))+(_=_<0?-Math.pow(-_,Ji):Math.pow(_,Ji))))/(3*o);x>=0&&x<=1&&(a[f++]=x)}else{var w=(2*c*s-3*o*h)/(2*Math.sqrt(c*c*c)),S=Math.acos(w)/3,A=Math.sqrt(c),T=Math.cos(S),C=(-s-2*A*T)/(3*o),E=(-s+A*(T+Zi*Math.sin(S)))/(3*o),R=(-s+A*(T-Zi*Math.sin(S)))/(3*o);C>=0&&C<=1&&(a[f++]=C),E>=0&&E<=1&&(a[f++]=E),R>=0&&R<=1&&(a[f++]=R)}}return f}(e,i,a,s,l,vr);if(0===c)return 0;for(var h,d=0,f=-1,v=0,p=0,g=0;g<c;g++){var y=vr[g],m=0===y||1===y?.5:1;ar(t,n,r,o,y)<u||(f<0&&(f=fr(e,i,a,s,pr),pr[1]<pr[0]&&f>1&&(h=void 0,h=pr[0],pr[0]=pr[1],pr[1]=h),v=ar(e,i,a,s,pr[0]),f>1&&(p=ar(e,i,a,s,pr[1]))),2===f?y<pr[0]?d+=v<e?m:-m:y<pr[1]?d+=p<v?m:-m:d+=s<p?m:-m:y<pr[0]?d+=v<e?m:-m:d+=s<v?m:-m)}return d}function yr(t,e,n,i,r,a,o,s){if(s>e&&s>i&&s>a||s<e&&s<i&&s<a)return 0;var u=function(t,e,n,i,r){var a=t-2*e+n,o=2*(e-t),s=t-i,u=0;if($i(a)){if(Qi(o)){var l=-s/o;l>=0&&l<=1&&(r[u++]=l)}}else{var c=o*o-4*a*s;if($i(c)){var h=-o/(2*a);h>=0&&h<=1&&(r[u++]=h)}else if(c>0){var d=Math.sqrt(c),f=(-o+d)/(2*a),v=(-o-d)/(2*a);f>=0&&f<=1&&(r[u++]=f),v>=0&&v<=1&&(r[u++]=v)}}return u}(e,i,a,s,vr);if(0===u)return 0;var l,c,h,d=0===(h=(l=e)+a-2*(c=i))?.5:(l-c)/h;if(d>=0&&d<=1){for(var f=0,v=rr(e,i,a,d),p=0;p<u;p++){var g=0===vr[p]||1===vr[p]?.5:1;rr(t,n,r,vr[p])<o||(vr[p]<d?f+=v<e?g:-g:f+=a<v?g:-g)}return f}var y=0===vr[0]||1===vr[0]?.5:1;return rr(t,n,r,vr[0])<o?0:a<e?y:-y}function mr(t,e,n,i,r,a,o,s){if((s-=e)>n||s<-n)return 0;var u=Math.sqrt(n*n-s*s);vr[0]=-u,vr[1]=u;var l=Math.abs(i-r);if(l<1e-4)return 0;if(l>=Kt-1e-4){i=0,r=Kt;var c=a?1:-1;return o>=vr[0]+t&&o<=vr[1]+t?c:0}if(i>r){var h=i;i=r,r=h}i<0&&(i+=Kt,r+=Kt);for(var d=0,f=0;f<2;f++){var v=vr[f];if(v+t>o){var p=Math.atan2(s,v),g=a?1:-1;p<0&&(p=Kt+p),(p>=i&&p<=r||p+Kt>=i&&p+Kt<=r)&&(p>Ht/2&&p<1.5*Ht&&(g=-g),d+=g)}}return d}function kr(t){return Math.round(t/Ht*1e8)/1e8%2*Ht}function br(t,e){var n=kr(t[0]);n<0&&(n+=Kt);var i=n-t[0],r=t[1];r+=i,!e&&r-n>=Kt?r=n+Kt:e&&n-r>=Kt?r=n-Kt:!e&&n>r?r=n+(Kt-kr(n-r)):e&&n<r&&(r=n-(Kt-kr(r-n))),t[0]=n,t[1]=r}var _r=[0,0];function xr(t,e,n,i,r){for(var a,o,s=t,u=t.length,l=0,c=0,h=0,d=0,f=0,v=0;v<u;v++){var p=s[v],g=0===v;p[0]===nn.M&&v>1&&(n||(l+=sr(c,h,d,f,i,r))),g&&(d=c=p[1],f=h=p[2]);var y=p[0],m=p[1],k=p[2],b=p[3],_=p[4],x=p[5],w=p[6],S=_,A=x;_r[0]=S,_r[1]=A,br(_r,Boolean(p[6]));var T=S=_r[0],C=(A=_r[1])-S,E=!!(1-(p[6]?0:1)),R=(i-m)*b/b+m;switch(y){case nn.M:c=d=m,h=f=k;break;case nn.L:if(n){if(hr(c,h,m,k,e,i,r))return!0}else l+=sr(c,h,m,k,i,r)||0;c=m,h=k;break;case nn.C:if(n){if(lr(c,h,m,k,b,_,x,w,e,i,r))return!0}else l+=gr(c,h,m,k,b,_,x,w,i,r)||0;c=x,h=w;break;case nn.Q:if(n){if(ur(c,h,m,k,b,_,e,i,r))return!0}else l+=yr(c,h,m,k,b,_,i,r)||0;c=b,h=_;break;case nn.A:if(a=Math.cos(T)*b+m,o=Math.sin(T)*b+k,g?(d=a,f=o):l+=sr(c,h,a,o,i,r),n){if(cr(m,k,b,T,T+C,E,e,R,r))return!0}else l+=mr(m,k,b,T,T+C,E,R,r);c=Math.cos(T+C)*b+m,h=Math.sin(T+C)*b+k;break;case nn.R:if(a=(d=c=m)+b,o=(f=h=k)+_,n){if(hr(d,f,a,f,e,i,r)||hr(a,f,a,o,e,i,r)||hr(a,o,d,o,e,i,r)||hr(d,o,d,f,e,i,r))return!0}else l+=sr(a,f,a,o,i,r),l+=sr(d,o,d,f,i,r);break;case nn.Z:if(n){if(hr(c,h,d,f,e,i,r))return!0}else l+=sr(c,h,d,f,i,r);c=d,h=f}}return n||function(t,e){return Math.abs(t-e)<dr}(h,f)||(l+=sr(c,h,d,f,i,r)||0),0!==l}var wr=function(){return u((function t(){o(this,t),this.pools=[],this.allocatedCanvas=[]}),[{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=Ki(Object.assign({nativeCanvas:Mi.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}var n=this.pools.pop();return n.resize(t.width,t.height),n.dpr=t.dpr,n}},{key:"allocateByObj",value:function(t){if(!this.pools.length){var e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},n=Ki(Object.assign({nativeCanvas:Mi.global.createCanvas(e)},e));return this.allocatedCanvas.push(n),n}var i=this.pools.pop();return i.width=t.width,i.height=t.height,i}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),Sr=new wr,Ar=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Tr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cr=Symbol.for("VWindow"),Er=Symbol.for("WindowHandlerContribution");t.DefaultWindow=function(){return u((function t(){var e=this;o(this,t),this.hooks={onChange:new rt(["x","y","width","height"])},this.active=function(){var t=e.global;t.env&&!e.actived&&(Hi.getNamed(Er,t.env).configure(e,t),e.actived=!0)},this._uid=_.GenAutoIncrementId(),this.global=Mi.global,this.postInit()}),[{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(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}},{key:"style",get:function(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}},set:function(t){this._handler.setStyle(t)}},{key:"create",value:function(t){var e,n;this._handler.createWindow(t);var i=this._handler.getWH();this._width=i.width,this._height=i.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(n=t.height)&&void 0!==n?n:this._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.global.hooks.onSetEnv.unTap("window",this.active),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,n){return this._handler.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this._handler.removeEventListener(t,e,n)}},{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){this._handler.clearViewBox(t)}},{key:"setViewBox",value:function(t){this._handler.setViewBox(t)}},{key:"setViewBoxTransform",value:function(t,e,n,i,r,a){this._handler.setViewBoxTransform(t,e,n,i,r,a)}},{key:"getViewBox",value:function(){return this._handler.getViewBox()}},{key:"getViewBoxTransform",value:function(){return this._handler.getViewBoxTransform()}},{key:"pointTransform",value:function(t,e){var n=this._handler.getViewBox(),i={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},i),i.x-=n.x1,i.y-=n.y1,i}},{key:"hasSubView",value:function(){var t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}},{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.DefaultWindow=Ar([L(),Tr("design:paramtypes",[])],t.DefaultWindow);var Rr,Br=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Mr=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pr=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultGraphicUtil=function(){return u((function t(e){var n=this;o(this,t),this.contributions=e,this.configured=!1,this.global=Mi.global,this.global.hooks.onSetEnv.tap("graphic-util",(function(t,e,i){n.configured=!1,n.configure(i,e)}))}),[{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 n=this;this.configured||(this.contributions.getContributions().forEach((function(t){t.configure(n,e)})),this.configured=!0)}},{key:"tryInitCanvas",value:function(){if(!this._canvas){var t=Sr.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}},{key:"bindTextMeasure",value:function(t){this._textMeasure=t}},{key:"measureText",value:function(t,e){var n,i=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=i;var a={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:li.fontSize};return this.global.measureTextMethod=r,a}},{key:"createTextMeasureInstance",value:function(t,e,n){var i=this;return this.configure(this.global,this.global.env),new Le(Object.assign({defaultFontParams:{fontFamily:li.fontFamily,fontSize:li.fontSize},getCanvasForMeasure:n||function(){return i.canvas},getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Le.ALPHABET_CHAR_SET+Le.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}},{key:"drawGraphicToCanvas",value:function(t,e,n){if(!e.defaultLayer)return null;var i=Hi.get(Cr),r=t.AABBBounds,a=r.width(),o=r.height(),s=-r.x1,u=-r.y1;i.create({viewBox:{x1:s,y1:u,x2:r.x2,y2:r.y2},width:a,height:o,canvas:n,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});var l=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(i,[t],{transMatrix:i.getViewBoxTransform(),viewBox:i.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=l;var c=i.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}}])}(),t.DefaultGraphicUtil=Br([L(),Pr(0,O($)),Pr(0,D(Vi)),Mr("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Rr||(Rr={}));var Or=new pe;t.DefaultTransformUtil=function(){return u((function t(){o(this,t),this.matrix=new pe}),[{key:"init",value:function(t){return this.mode=Rr.transform,this.originTransform=t,this.matrix.reset(),this}},{key:"fromMatrix",value:function(t,e){return this.mode=Rr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}},{key:"scaleMatrix",value:function(t,e,n){var i=this.outSourceMatrix;if(Or.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),n){var r=n.x,a=n.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(Or.a,Or.b,Or.c,Or.d,Or.e,Or.f),this}},{key:"rotateMatrix",value:function(t,e){var n=this.outSourceMatrix;if(Or.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),e){var i=e.x,r=e.y;this.outTargetMatrix.translate(i,r),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-r)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Or.a,Or.b,Or.c,Or.d,Or.e,Or.f),this}},{key:"scale",value:function(t,e,n){return this.mode===Rr.matrix?this.scaleMatrix(t,e,n):this}},{key:"rotate",value:function(t,e){return this.mode===Rr.matrix?this.rotateMatrix(t,e):this}},{key:"translateMatrix",value:function(t,e){var n=this.outSourceMatrix;return Or.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Or.a,Or.b,Or.c,Or.d,Or.e,Or.f),this}},{key:"translate",value:function(t,e){return this.mode===Rr.matrix?this.translateMatrix(t,e):this}},{key:"simplify",value:function(t){return this.mode===Rr.matrix?this.simplifyMatrix(t):this}},{key:"simplifyMatrix",value:function(t){return this}}])}(),t.DefaultTransformUtil=Br([L(),Mr("design:paramtypes",[])],t.DefaultTransformUtil);var Ir={arc:pi,area:gi,circle:yi,line:bi,path:_i,symbol:Ai,text:Ti,rect:wi,polygon:xi,richtext:Ci,richtextIcon:Ri,image:Ei,group:mi,glyph:ki},Lr=Object.keys(Ir);function Dr(){return{arc:Object.assign({},Ir.arc),area:Object.assign({},Ir.area),circle:Object.assign({},Ir.circle),line:Object.assign({},Ir.line),path:Object.assign({},Ir.path),symbol:Object.assign({},Ir.symbol),text:Object.assign({},Ir.text),rect:Object.assign({},Ir.rect),polygon:Object.assign({},Ir.polygon),richtext:Object.assign({},Ir.richtext),richtextIcon:Object.assign({},Ir.richtextIcon),image:Object.assign({},Ir.image),group:Object.assign({},Ir.group),glyph:Object.assign({},Ir.glyph)}}function jr(t,e){Object.keys(e).forEach((function(n){t[n]=e[n]}))}var Fr=Dr(),Nr=function(){return u((function t(){o(this,t),this.initTheme(),this.dirty=!1}),[{key:"initTheme",value:function(){var t=this;this._defaultTheme={},Lr.forEach((function(e){t._defaultTheme[e]=Object.create(Fr[e])})),this.combinedTheme=this._defaultTheme}},{key:"getTheme",value:function(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;var e={},n=this.getParentWithTheme(t);return n&&(e=n.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,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){var i=this.getParentWithTheme(t);if(i){var r=i.theme;(r.dirty||n)&&r.applyTheme(i,e,!0)}this.userTheme?this.doCombine(i&&i.theme.combinedTheme):(i?this.combinedTheme=i.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,Nt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}},{key:"doCombine",value:function(t){var e=this,n=this.userTheme,i=this.combinedTheme;Lr.forEach((function(r){var a=Object.create(Fr[r]);t&&t[r]&&jr(a,t[r]),i[r]&&jr(a,i[r]),n[r]&&jr(a,n[r]),e.combinedTheme[r]=a})),n.common&&Lr.forEach((function(t){jr(e.combinedTheme[t],n.common)})),this.dirty=!1}},{key:"setTheme",value:function(t,e){var n=this.userTheme;n?Object.keys(t).forEach((function(e){n[e]?Object.assign(n[e],t[e]):n[e]=Object.assign({},t[e])})):n=t,this.userTheme=n,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))}))}}])}(),Gr=new Nr;function zr(t,e){return t.glyphHost?zr(t.glyphHost):e?(t.isContainer,e):Ur(t)||t.attachedThemeGraphic&&zr(t.attachedThemeGraphic)||Gr.getTheme()}function Ur(t){var e;if(e=t.isContainer?t:t.parent){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Gr.getTheme()}return null}var Wr=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},Vr=function(t){function n(){var t;return o(this,n),(t=e(this,n))._uid=_.GenAutoIncrementId(),t._firstChild=null,t._lastChild=null,t.parent=null,t._count=1,t}return c(n,t),u(n,[{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,n=0;e;){if(t(e,n++))return;e=e._prev}else for(var i=this._firstChild,r=0;i;){if(t(i,r++))return;i=i._next}}},{key:"forEachChildrenAsync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Wr(this,void 0,void 0,i().mark((function n(){var r,a,o,s,u,l;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e){n.next=16;break}r=this._lastChild,a=0;case 2:if(!r){n.next=14;break}if(o=t(r,a++),n.t0=o.then,!n.t0){n.next=9;break}return n.next=8,o;case 8:o=n.sent;case 9:if(!o){n.next=11;break}return n.abrupt("return");case 11:r=r._prev;case 12:n.next=2;break;case 14:n.next=29;break;case 16:s=this._firstChild,u=0;case 17:if(!s){n.next=29;break}if(l=t(s,u++),n.t1=l.then,!n.t1){n.next=24;break}return n.next=23,l;case 23:l=n.sent;case 24:if(!l){n.next=26;break}return n.abrupt("return");case 26:s=s._next;case 27:n.next=17;break;case 29:case"end":return n.stop()}}),n,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,e){if(!this._ignoreWarn&&this._nodeList&&Nt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{for(var n=this._firstChild,i=0;i<e;i++){if(!n)return null;i>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 n=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,n)}var i;this._nodeList[e]=t;for(var r=e-1;r>=0&&!(i=this._nodeList[r]);r--);if(i)return i._next?this.insertBefore(t,i._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(t){if(this._idMap){this._nodeList&&(this._nodeList.length=0);for(var e=this._firstChild;e;){var n=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=n}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,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren((function(n,r){return!(n===e||!t(n,r)||(i=n,0))})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}},{key:"findAll",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren((function(n,r){n!==e&&t(n,r)&&i.push(n)})),n&&this.forEachChildren((function(e){if(e.isContainer){var n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}},{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 n=0;n<t;n++){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 n=this._firstChild;n;)n[t]=e,n.setAllDescendantsProps(t,e),n=n._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,e,i){var r=vt(i,!0)&&i||mt(i)&&i.capture,a=mt(i)&&i.once,o=pt(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=pt(e)?e:e.handleEvent,a?p(h(n.prototype),"once",this).call(this,t,e,o):p(h(n.prototype),"on",this).call(this,t,e,o),this}},{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,i){var r=vt(i,!0)&&i||mt(i)&&i.capture,a=pt(e)?void 0:e;t=r?"".concat(t,"capture"):t,e=pt(e)?e:e.handleEvent;var o=mt(i)&&i.once;return p(h(n.prototype),"off",this).call(this,t,e,a,o),this}},{key:"off",value:function(t,e,n){return this.removeEventListener(t,e,n)}},{key:"once",value:function(t,e,n){return mt(n)?(n.once=!0,this.addEventListener(t,e,n)):this.addEventListener(t,e,{once:!0})}},{key:"removeAllEventListeners",value:function(){return p(h(n.prototype),"removeAllListeners",this).call(this),this}},{key:"removeAllListeners",value:function(){return this.removeAllEventListeners()}},{key:"dispatchEvent",value:function(t){for(var e,i=arguments.length,r=new Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];return(e=p(h(n.prototype),"emit",this)).call.apply(e,[this,t.type,t].concat(r)),!t.defaultPrevented}},{key:"emit",value:function(t,e){return this.dispatchEvent(t,e)}},{key:"release",value:function(){this.removeAllListeners()}}])}(dt),Hr=function(){return u((function t(e){o(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}),[{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.composedDetailPath(),this.path}},{key:"composedDetailPath",value:function(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}},{key:"_composedDetailPath",value:function(t){if(t&&t.graphic){var e=this.pickParams.graphic;if(e.stage){var n=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(n),this._composedDetailPath(t.params)}}}},{key:"preventDefault",value:function(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&pt(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&pt(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error("Method not implemented.")}}])}(),Yr=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).client={x:0,y:0},t.movement={x:0,y:0},t.offset={x:0,y:0},t.global={x:0,y:0},t.screen={x:0,y:0},t}return c(n,t),u(n,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d,f,v){throw new Error("Method not implemented.")}}])}(Hr),Xr=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).width=0,t.height=0,t.isPrimary=!1,t}return c(n,t),u(n,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){var t,e,i,r=new n(this.manager);r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.detailPath=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice();var a=this.composedDetailPath();return r.detailPath=a&&a.slice(),r.type=this.type,r}}])}(Yr),Kr=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).DOM_DELTA_PIXEL=0,t.DOM_DELTA_LINE=1,t.DOM_DELTA_PAGE=2,t}return c(n,t),u(n,[{key:"clone",value:function(){var t,e,i,r=new n(this.manager);r.eventPhase=r.NONE,r.currentTarget=null,r.path=[],r.detailPath=[],r.target=null,r.nativeEvent=this.nativeEvent,r.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,r),null===(e=this.manager)||void 0===e||e.copyMouseData(this,r),null===(i=this.manager)||void 0===i||i.copyData(this,r),r.target=this.target,r.path=this.composedPath().slice();var a=this.composedDetailPath();return r.detailPath=a&&a.slice(),r.type=this.type,r}}])}(Yr);Kr.DOM_DELTA_PIXEL=0,Kr.DOM_DELTA_LINE=1,Kr.DOM_DELTA_PAGE=2;var qr=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n)).type=t,r.detail=i,r}return c(n,t),u(n)}(Hr),Zr="object"==("undefined"==typeof performance?"undefined":a(performance))&&performance.now?performance:Date;function Jr(t){return"mouse"===t||"pen"===t}var $r,Qr=function(){return u((function t(e,n){var i=this;o(this,t),this.dispatch=new dt,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=function(t,e){if(t instanceof Xr){var n=i.createPointerEvent(t,t.type,e);if(i.dispatchEvent(n,"pointerdown"),"touch"===n.pointerType)i.dispatchEvent(n,"touchstart");else if(Jr(n.pointerType)){var r=2===n.button;i.dispatchEvent(n,r?"rightdown":"mousedown")}i.trackingData(t.pointerId).pressTargetsByButton[t.button]=n.composedPath(),i.freeEvent(n)}else Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerMove=function(t,e){var n,r;if(t instanceof Xr){var a=i.createPointerEvent(t,t.type,e),o=Jr(a.pointerType),s=i.trackingData(t.pointerId),u=i.findMountedTarget(s.overTargets);if(s.overTargets&&u&&u!==i.rootTarget&&u!==a.target){var l="mousemove"===t.type?"mouseout":"pointerout",c=i.createPointerEvent(t,l,u||void 0);if(i.dispatchEvent(c,"pointerout"),o&&i.dispatchEvent(c,"mouseout"),!a.composedPath().includes(u)){var h=i.createPointerEvent(t,"pointerleave",u||void 0);for(h.eventPhase=h.AT_TARGET;h.target&&!a.composedPath().includes(h.target);)h.currentTarget=h.target,i.notifyTarget(h),o&&i.notifyTarget(h,"mouseleave"),h.target=h.target.parent;i.freeEvent(h)}i.freeEvent(c)}if(u!==a.target){var d="mousemove"===t.type?"mouseover":"pointerover",f=i.clonePointerEvent(a,d);i.dispatchEvent(f,"pointerover"),o&&i.dispatchEvent(f,"mouseover");for(var v=null==u?void 0:u.parent;v&&v!==i.rootTarget.parent&&v!==a.target;)v=v.parent;if(!v||v===i.rootTarget.parent){var p=i.clonePointerEvent(a,"pointerenter");p.eventPhase=p.AT_TARGET;for(var g=p.target,y=new Set,m=u;m&&m!==i.rootTarget;)y.add(m),m=m.parent;for(;g&&g!==u&&g!==i.rootTarget.parent;)y.has(g)||(p.currentTarget=g,i.notifyTarget(p),o&&i.notifyTarget(p,"mouseenter")),g=g.parent;i.freeEvent(p)}i.freeEvent(f)}i.dispatchEvent(a,"pointermove"),"touch"===a.pointerType&&i.dispatchEvent(a,"touchmove"),o&&(i.dispatchEvent(a,"mousemove"),i.cursorTarget=a.target,i.cursor=(null===(r=null===(n=a.target)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.cursor)||i.rootTarget.getCursor()),s.overTargets=a.composedPath(),i.freeEvent(a)}else Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOver=function(t,e){var n,r;if(t instanceof Xr){var a=i.trackingData(t.pointerId),o=i.createPointerEvent(t,t.type,e),s=Jr(o.pointerType);i.dispatchEvent(o,"pointerover"),s&&i.dispatchEvent(o,"mouseover"),"mouse"===o.pointerType&&(i.cursorTarget=o.target,i.cursor=(null===(r=null===(n=o.target)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.cursor)||i.rootTarget.getCursor());var u=i.clonePointerEvent(o,"pointerenter");for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==i.rootTarget.parent;)u.currentTarget=u.target,i.notifyTarget(u),s&&i.notifyTarget(u,"mouseenter"),u.target=u.target.parent;a.overTargets=o.composedPath(),i.freeEvent(o),i.freeEvent(u)}else Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerOut=function(t,e){if(t instanceof Xr){var n=i.trackingData(t.pointerId);if(n.overTargets){var r=Jr(t.pointerType),a=i.findMountedTarget(n.overTargets),o=i.createPointerEvent(t,"pointerout",a||void 0);i.dispatchEvent(o),r&&i.dispatchEvent(o,"mouseout");var s=i.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==i.rootTarget.parent;)s.currentTarget=s.target,i.notifyTarget(s),r&&i.notifyTarget(s,"mouseleave"),s.target=s.target.parent;n.overTargets=[],i.freeEvent(o),i.freeEvent(s)}i.cursorTarget=null,i.cursor=""}else Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUp=function(t,e){var n;if(t instanceof Xr){var r=Zr.now(),a=i.createPointerEvent(t,t.type,e);if(i.dispatchEvent(a,"pointerup"),"touch"===a.pointerType)i.dispatchEvent(a,"touchend");else if(Jr(a.pointerType)){var o=2===a.button;i.dispatchEvent(a,o?"rightup":"mouseup")}var s=i.trackingData(t.pointerId),u=i.findMountedTarget(s.pressTargetsByButton[t.button]),l=u;if(u&&!a.composedPath().includes(u)){for(var c=u;c&&!a.composedPath().includes(c);){if(a.currentTarget=c,i.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType)i.notifyTarget(a,"touchendoutside");else if(Jr(a.pointerType)){var h=2===a.button;i.notifyTarget(a,h?"rightupoutside":"mouseupoutside")}c=c.parent}delete s.pressTargetsByButton[t.button],l=c}if(l){var d=i.clonePointerEvent(a,"click");d.target=l,d.path=[],d.detailPath=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:d.target,timeStamp:r});var f=s.clicksByButton[t.button];f.target===d.target&&r-f.timeStamp<(null!==(n=i._config.clickInterval)&&void 0!==n?n:200)?++f.clickCount:f.clickCount=1,f.target=d.target,f.timeStamp=r,d.detail=f.clickCount,Jr(d.pointerType)?(i.dispatchEvent(d,"click"),2===f.clickCount&&i.dispatchEvent(d,"dblclick")):"touch"===d.pointerType&&(i.dispatchEvent(d,"tap"),2===f.clickCount&&i.dispatchEvent(d,"dbltap")),i.dispatchEvent(d,"pointertap"),i.freeEvent(d)}i.freeEvent(a)}else Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onPointerUpOutside=function(t,e){if(t instanceof Xr){var n=i.trackingData(t.pointerId),r=i.findMountedTarget(n.pressTargetsByButton[t.button]),a=i.createPointerEvent(t,t.type,e);if(r){for(var o=r;o;)a.currentTarget=o,i.notifyTarget(a,"pointerupoutside"),"touch"===a.pointerType?i.notifyTarget(a,"touchendoutside"):Jr(a.pointerType)&&i.notifyTarget(a,2===a.button?"rightupoutside":"mouseupoutside"),o=o.parent;delete n.pressTargetsByButton[t.button]}i.freeEvent(a)}else Nt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event")},this.onWheel=function(t,e){if(t instanceof Kr){var n=i.createWheelEvent(t,e);i.dispatchEvent(n),i.freeEvent(n)}else Nt.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event")},this.rootTarget=e,this.mappingTable={},this._config=Object.assign({clickInterval:200},n),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}),[{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))}},{key:"dispatchEvent",value:function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}},{key:"mapEvent",value:function(t){var e,n,i,r,a,o,s;if(this.rootTarget){var u,c=this.mappingTable[t.type],h="".concat(t.canvasX,"-").concat(t.canvasY);if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[h])&&(null===(i=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[h])||void 0===i?void 0:i.stage)&&(null===(a=null===(r=this._prePointTargetCache)||void 0===r?void 0:r[h])||void 0===a?void 0:a.stage.renderCount)===(null===(o=this._prePointTargetCache)||void 0===o?void 0:o.stageRenderCount)?u=this._prePointTargetCache[h]:(u=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache=l(l({},h,u),"stageRenderCount",null!==(s=null==u?void 0:u.stage.renderCount)&&void 0!==s?s:-1))),c)for(var d=0,f=c.length;d<f;d++)c[d].fn(t,u);else Nt.getInstance().warn("[EventManager]: Event mapping not defined for ".concat(t.type))}}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=0,r=n.length-1;i<r;i++)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(var a=n.length-2;a>=0;a--)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){for(var e=[t],n=0;n<2048&&t!==this.rootTarget&&t.parent;n++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}},{key:"notifyTarget",value:function(t,e){if(!this.pauseNotify){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[0],n=1;n<t.length&&t[n].parent===e;n++)e=t[n];return e}},{key:"createPointerEvent",value:function(t,e,n){var i,r,a=this.allocateEvent(Xr);return this.copyPointerData(t,a),this.copyMouseData(t,a),this.copyData(t,a),a.nativeEvent=t.nativeEvent,a.originalEvent=t,a.target=n||this.pickTarget(null!==(i=a.viewX)&&void 0!==i?i:a.global.x,null!==(r=a.viewY)&&void 0!==r?r:a.global.y,a),"string"==typeof e&&(a.type=e),a}},{key:"createWheelEvent",value:function(t,e){var n,i,r=this.allocateEvent(Kr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!==(n=r.viewX)&&void 0!==n?n:r.global.x,null!==(i=r.viewY)&&void 0!==i?i:r.global.y,r),r}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Xr);n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice();var i=t.composedDetailPath();return n.detailPath=i&&i.slice(),n.type=null!=e?e:n.type,n}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyPointerData",value:function(t,e){t instanceof Xr&&e instanceof Xr&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}},{key:"copyMouseData",value:function(t,e){t instanceof Yr&&e instanceof Yr&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((function(n){e[n].x=t[n].x,e[n].y=t[n].y})))}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Zr.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"allocateEvent",value:function(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);var n=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n}},{key:"freeEvent",value:function(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),null===(e=this.eventPool.get(n))||void 0===e||e.push(t)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget._events[e];if(n)if("fn"in n)n.once&&t.currentTarget.removeEventListener(e,n.fn,{once:!0}),n.fn.call(n.context,t);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].once&&t.currentTarget.removeEventListener(e,n[i].fn,{once:!0}),n[i].fn.call(n[i].context,t);this.emitDelegation(t,e)}},{key:"emitDelegation",value:function(t,e){var n=t.currentTarget._events["*"];if(n)if("fn"in n)n.fn.call(n.context,t,e);else for(var i=0,r=n.length;i<r&&!t.propagationImmediatelyStopped;i++)n[i].fn.call(n[i].context,t,e)}},{key:"pickTarget",value:function(t,e,n){var i,r=this.rootTarget.pick(t,e);return i=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,n&&(n.pickParams=r.params),i}},{key:"release",value:function(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}])}(),ta={dispatchEvent:function(t){var e;if(!(t instanceof Hr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit:function(t,e){return this.dispatchEvent(new qr(t,e))}},ea={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},na=function(){return u((function t(e){var n=this;o(this,t),this.resolution=1,this.onPointerDown=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerData(t);n.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i=0,r=e.length;i<r;i++){var a=e[i],o=n.bootstrapEvent(n.rootPointerEvent,a);n.manager.mapEvent(o)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onPointerMove=function(t){if(!(n.supportsTouchEvents&&"touch"===t.pointerType||n.isEventOutsideOfTargetElement(t))){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var a=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(a)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onPointerUp=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.isEventOutsideOfTargetViewPort(t)?"outside":"",i=n.normalizeToPointerData(t),r=0,a=i.length;r<a;r++){var o=n.bootstrapEvent(n.rootPointerEvent,i[r]);o.type+=e,n.manager.mapEvent(o)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onPointerOverOut=function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var e=n.normalizeToPointerData(t),i=0,r=e.length;i<r;i++){var a=n.bootstrapEvent(n.rootPointerEvent,e[i]);n.manager.mapEvent(a)}n.setCursor(n.manager.cursor,n.manager.cursorTarget)}},this.onWheel=function(t){var e=n.normalizeWheelEvent(t);n.manager.mapEvent(e)};var i=e.targetElement,r=e.resolution,a=e.rootNode,s=e.global,u=e.autoPreventDefault,l=void 0!==u&&u,c=e.clickInterval,h=e.supportsTouchEvents,d=void 0===h?s.supportsTouchEvents:h,f=e.supportsPointerEvents,v=void 0===f?s.supportsPointerEvents:f;this.manager=new Qr(a,{clickInterval:c}),this.globalObj=s,this.supportsPointerEvents=v,this.supportsTouchEvents=d,this.supportsMouseEvents=s.supportsMouseEvents,this.applyStyles=s.applyStyles,this.autoPreventDefault=l,this.eventsAdded=!1,this.rootPointerEvent=new Xr,this.rootWheelEvent=new Kr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=r,this.setTargetElement(i)}),[{key:"release",value:function(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}},{key:"setCursor",value:function(t,e){if(e||this.manager.rootTarget.window._handler.canvas.controled){t||(t="default");var n=this.applyStyles,i=this.domElement;if(this.currentCursor!==t){this.currentCursor=t;var r=this.cursorStyles[t];r?"string"==typeof r&&n?i.style.cursor=r:"function"==typeof r?r(t):"object"==a(r)&&n&&Object.assign(i.style,r):n&&xt(t)&&!Bt(this.cursorStyles,t)&&(i.style.cursor=t)}}}},{key:"setTargetElement",value:function(t){this.removeEvents(),this.domElement=t,this.addEvents()}},{key:"addEvents",value:function(){if(!this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}}},{key:"removeEvents",value:function(){if(this.eventsAdded&&this.domElement){var t=this.globalObj,e=this.domElement;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}}},{key:"mapToViewportPoint",value:function(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}},{key:"mapToCanvasPoint",value:function(t){var e,n,i=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(i)return i;var r=0,a=0;if(t.changedTouches){var o=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};r=o.clientX||0,a=o.clientY||0}else r=t.clientX||0,a=t.clientY||0;var s=this.domElement.getBoundingClientRect();return{x:r-s.left,y:a-s.top}}},{key:"normalizeToPointerData",value:function(t){var e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(var n=0,i=t.changedTouches.length;n<i;n++){var r=t.changedTouches[n];_t(r.button)&&(r.button=0),_t(r.buttons)&&(r.buttons=1),_t(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),_t(r.width)&&(r.width=r.radiusX||1),_t(r.height)&&(r.height=r.radiusY||1),_t(r.tiltX)&&(r.tiltX=0),_t(r.tiltY)&&(r.tiltY=0),_t(r.pointerType)&&(r.pointerType="touch"),_t(r.pointerId)&&(r.pointerId=r.identifier||0),_t(r.pressure)&&(r.pressure=r.force||.5),_t(r.twist)&&(r.twist=0),_t(r.tangentialPressure)&&(r.tangentialPressure=0),_t(r.layerX)&&(r.layerX=r.offsetX=r.clientX),_t(r.layerY)&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=t.type,e.push(r)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){var a=t;_t(a.isPrimary)&&(a.isPrimary=!0),_t(a.width)&&(a.width=1),_t(a.height)&&(a.height=1),_t(a.tiltX)&&(a.tiltX=0),_t(a.tiltY)&&(a.tiltY=0),_t(a.pointerType)&&(a.pointerType="mouse"),_t(a.pointerId)&&(a.pointerId=1),_t(a.pressure)&&(a.pressure=.5),_t(a.twist)&&(a.twist=0),_t(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,e.push(a)}else e.push(t);return e}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.mapToCanvasPoint(t),i=n.x,r=n.y;e.canvas.x=i,e.canvas.y=r,e.global.x=i,e.global.y=r,e.offset.x=i,e.offset.y=r;var a=this.mapToViewportPoint(e),o=a.x,s=a.y;return e.viewport.x=o,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}},{key:"bootstrapEvent",value:function(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var n=this.mapToCanvasPoint(e),i=n.x,r=n.y;t.canvas.x=i,t.canvas.y=r,t.global.x=i,t.global.y=r,t.offset.x=i,t.offset.y=r;var a=this.mapToViewportPoint(t),o=a.x,s=a.y;return t.viewport.x=o,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ea[t.type]||t.type),t}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Zr.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}},{key:"isEventOutsideOfTargetViewPort",value:function(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){var e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),n=this.domElement.getViewBox(),i=n.width(),r=n.height();return!(e.x<i&&e.y<r&&e.x>0&&e.y>0)}return!1}},{key:"isEventOutsideOfTargetElement",value:function(t){var e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}},{key:"pauseTriggerEvent",value:function(){this.manager.pauseNotify=!0}},{key:"resumeTriggerEvent",value:function(){this.manager.pauseNotify=!1}}])}(),ia=function(){function t(){o(this,t),this.time=0}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}},{key:"tickTo",value:function(t,e){this.time=Math.max(0,t),e(this,{once:!0})}},{key:"release",value:function(){this.timerId>0&&(this.timerId=-1)}},{key:"getTime",value:function(){return this.time}}],[{key:"Avaliable",value:function(){return!0}}])}(),ra=function(){function t(){o(this,t)}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;this.timerId=setTimeout((function(){e(n)}),t)}},{key:"release",value:function(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!0}}])}(),aa=function(){function t(){o(this,t)}return u(t,[{key:"avaliable",value:function(){return t.Avaliable()}},{key:"tick",value:function(t,e){var n=this;Mi.global.getRequestAnimationFrame()((function(){n.released||e(n)}))}},{key:"release",value:function(){this.released=!0}},{key:"getTime",value:function(){return Date.now()}}],[{key:"Avaliable",value:function(){return!!Mi.global.getRequestAnimationFrame()}}])}();!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}($r||($r={}));var oa=function(){return u((function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o(this,t),this.handleTick=function(t,n){var i=(null!=n?n:{}).once,r=void 0!==i&&i;e.ifCanStop()?e.stop():(e._handlerTick(t),r||t.tick(e.interval,e.handleTick))},this._handlerTick=function(t){var n=e.tickerHandler.getTime(),i=0;e.lastFrameTime>=0&&(i=n-e.lastFrameTime),e.lastFrameTime=n,e.status===$r.RUNNING&&(e.tickCounts++,e.timelines.forEach((function(t){t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=n,this.autoStop=!0}),[{key:"mode",get:function(){return this._mode},set:function(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}},{key:"init",value:function(){var t=this;this.interval=NaN,this.status=$r.INITIAL,Mi.global.hooks.onSetEnv.tap("default-ticker",(function(){t.initHandler()})),Mi.global.env&&this.initHandler()}},{key:"addTimeline",value:function(t){this.timelines.push(t)}},{key:"remTimeline",value:function(t){this.timelines=this.timelines.filter((function(e){return e!==t}))}},{key:"initHandler",value:function(){if(this._mode)return null;for(var t=[{mode:"raf",cons:aa},{mode:"timeout",cons:ra},{mode:"manual",cons:ia}],e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}},{key:"setupTickHandler",value:function(){var t;switch(this._mode){case"raf":t=new aa;break;case"timeout":t=new ra;break;case"manual":t=new ia;break;default:Nt.getInstance().warn("非法的计时器模式"),t=new aa}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}},{key:"setInterval",value:function(t){this.interval=t}},{key:"getInterval",value:function(){return this.interval}},{key:"setFPS",value:function(t){this.setInterval(1e3/t)}},{key:"getFPS",value:function(){return 1e3/this.interval}},{key:"tick",value:function(t){var e=this;this.tickerHandler.tick(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"tickTo",value:function(t){var e=this;this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(function(t){e.handleTick(t,{once:!0})}))}},{key:"pause",value:function(){return this.status!==$r.INITIAL&&(this.status=$r.PAUSE,!0)}},{key:"resume",value:function(){return this.status!==$r.INITIAL&&(this.status=$r.RUNNING,!0)}},{key:"ifCanStop",value:function(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!0}return!1}},{key:"start",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===$r.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===$r.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce((function(t,e){return t+e.animateCount}),0))return!1}return this.status=$r.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}},{key:"stop",value:function(){this.status=$r.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}])}(),sa=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"mode",get:function(){return this._mode},set:function(t){this.setupTickHandler()}},{key:"initHandler",value:function(){return this.mode="manual",null}},{key:"setupTickHandler",value:function(){var t=new ia;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}},{key:"tickAt",value:function(t){var e=this;this.tickerHandler.tick(t-this.lastFrameTime,(function(t){e.handleTick(t,{once:!0})}))}},{key:"ifCanStop",value:function(){return!1}}])}(oa),ua=function(){function t(){o(this,t)}return u(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,e){return function(n){if(0===n||1===n)return n;var i=e/Kt*Math.asin(1/t);return-t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*Kt/e)}}},{key:"getElasticOut",value:function(t,e){return function(n){if(0===n||1===n)return n;var i=e/Kt*Math.asin(1/t);return t*Math.pow(2,-10*n)*Math.sin((n-i)*Kt/e)+1}}},{key:"getElasticInOut",value:function(t,e){return function(n){var i=e/Kt*Math.asin(1/t);return(n*=2)<1?t*Math.pow(2,10*(n-=1))*Math.sin((n-i)*Kt/e)*-.5:t*Math.pow(2,-10*(n-=1))*Math.sin((n-i)*Kt/e)*.5+1}}}])}();ua.quadIn=ua.getPowIn(2),ua.quadOut=ua.getPowOut(2),ua.quadInOut=ua.getPowInOut(2),ua.cubicIn=ua.getPowIn(3),ua.cubicOut=ua.getPowOut(3),ua.cubicInOut=ua.getPowInOut(3),ua.quartIn=ua.getPowIn(4),ua.quartOut=ua.getPowOut(4),ua.quartInOut=ua.getPowInOut(4),ua.quintIn=ua.getPowIn(5),ua.quintOut=ua.getPowOut(5),ua.quintInOut=ua.getPowInOut(5),ua.backIn=ua.getBackIn(1.7),ua.backOut=ua.getBackOut(1.7),ua.backInOut=ua.getBackInOut(1.7),ua.elasticIn=ua.getElasticIn(1,.3),ua.elasticOut=ua.getElasticOut(1,.3),ua.elasticInOut=ua.getElasticInOut(1,.3*1.5);var la=function(){return u((function t(){o(this,t),this.id=_.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}),[{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(e){if(!this.paused){var n=this.animateHead;for(this.animateCount=0;n;)n.status===t.AnimateStatus.END?this.removeAnimate(n):n.status===t.AnimateStatus.RUNNING||n.status===t.AnimateStatus.INITIAL?(this.animateCount++,n.advance(e)):n.status===t.AnimateStatus.PAUSED&&this.animateCount++,n=n.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()}}])}(),ca=new la,ha=function(){return u((function t(e,n,i,r,a){o(this,t),this.from=e,this.to=n,this.duration=i,this.easing=r,this.params=a,this.updateCount=0}),[{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(){return this.to}},{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,n){var i=this;if(0===this.updateCount){this.onFirstRun();var r=this.step.getLastProps();Object.keys(r).forEach((function(t){i.subAnimate.animate.validAttr(t)&&(n[t]=r[t])}))}this.updateCount+=1,this.onUpdate(t,e,n),t&&this.onEnd()}}])}(),da=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[null,null,0,"linear"])).cb=t,i}return c(n,t),u(n,[{key:"onUpdate",value:function(t,e,n){}},{key:"onStart",value:function(){this.cb()}}])}(ha),fa=function(){function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ca;o(this,e),this.id=n,this.timeline=i,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new pa(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}return u(e,[{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 e=-1/0;return t.forEach((function(t){e=$t(t.getDuration(),e)})),this._startTime=e,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.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}},{key:"trySetAttribute",value:function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.mode;n&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(n,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}},{key:"runCb",value:function(t){var e=this,n=new da((function(){t(e,n.step.prev)}));return this.tailAnimate.play(n),this}},{key:"customInterpolate",value:function(t,n,i,r,a,o){var s=e.interpolateMap.get(t)||e.interpolateMap.get("");return!!s&&s(t,n,i,r,a,o)}},{key:"pause",value:function(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}},{key:"resume",value:function(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}},{key:"to",value:function(t,e,n,i){if(this.tailAnimate.to(t,e,n,i),this.target){var r=this.target.stage;r&&r.renderNextFrame()}return this}},{key:"from",value:function(t,e,n,i){if(this.tailAnimate.from(t,e,n,i),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 pa(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(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((function(t){return t()}))),this.setPosition(this.rawPosition+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((function(t){return t()})))}},{key:"setPosition",value:function(t){var e,n=0,i=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===i)return a;for(var o=0;o<this.subAnimates.length&&!(n+(e=this.subAnimates[o]).totalDuration>=t);o++)n+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-n),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=t.AnimateStatus.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(t,n){e.interpolateMap.set(t,n)}}])}();fa.mode=t.AnimateMode.NORMAL,fa.interpolateMap=new Map;var va,pa=function(){return u((function t(e,n){o(this,t),this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=e,this.stepHead=new ga(0,0,n?Object.assign({},n.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}),[{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(e){var n=e.duration;(null==n||n<0)&&(n=0);var i=e.easing,r="string"==typeof i?ua[i]:i,a=this._addStep(n,null,r);return a.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),a,!1),this._appendCustomAnimate(e,a),this}},{key:"to",value:function(e,n,i,r){var a=this;(null==n||n<0)&&(n=0);var o="string"==typeof i?ua[i]:i,s=this._addStep(n,null,o);return s.type=t.AnimateStepType.to,this._appendProps(e,s,!!r&&r.tempProps),s.propKeys||(s.propKeys=Object.keys(s.props)),r&&r.noPreventAttrs||this.target.animates.forEach((function(t){t.id!==a.animate.id&&t.preventAttrs(s.propKeys)})),this}},{key:"from",value:function(e,n,i,r){var a=this;this.to(e,0,i,r);var o={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((function(t){o[t]=a.getLastPropByName(t,a.stepTail)})),this.to(o,n,i,r),this.stepTail.type=t.AnimateStepType.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(e){if(e>0){var n=this._addStep(+e,null);n.type=t.AnimateStepType.wait,n.prev.customAnimate?n.props=n.prev.customAnimate.getEndProps():n.props=n.prev.props,this.target.onAddStep&&this.target.onAddStep(n)}return this}},{key:"_addStep",value:function(t,e,n){var i=new ga(this.duration,t,e,n);return this.duration+=t,this.stepTail.append(i),this.stepTail=i,i}},{key:"_appendProps",value:function(t,e,n){var i=this;e.props=n?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]=i.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 o=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(a)),e.propKeys.forEach((function(t){if(void 0===o[t]){var e=i.animate.getStartProps();o[t]=e[t]=i.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,n,i,r=this.duration,a=this.loop,o=this.rawPosition,s=!1,u=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<u)return this.rawPosition=t,!1;if(r<=0)return s=!0;if(i=(t-=u)-(n=Math.floor(t/r))*r,(s=t>=a*r+r)&&(t=(i=r)*(n=a)+r),t===o)return s;var l=!this.reversed!=!(this.bounce&&n%2);return l&&(i=r-i),this._deltaPosition=i-this.position,this.position=i,this.rawPosition=t+u,this.updatePosition(s,l),s}},{key:"updatePosition",value:function(t,e){if(this.stepHead){var n=this.stepHead.next,i=this.position,r=this.duration;if(this.target&&n){for(var a=n.next;a&&a.position<=i;)a=(n=a).next;var o=t?0===r?1:i/r:(i-n.position)/n.duration;n.easing&&(o=n.easing(o)),this.tryCallCustomAnimateLifeCycle(n,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(n,o,t),this._lastStep=n,this.animate._onFrame&&this.animate._onFrame.forEach((function(t){return t(n,o)}))}}}},{key:"tryCallCustomAnimateLifeCycle",value:function(t,e,n){if(t!==e)if(n){for(var i=e.prev;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{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,e){for(var n=e.prev;n;){if(n.props&&void 0!==n.props[t])return n.props[t];if(n.customAnimate){var i=n.customAnimate.getEndProps()[t];if(void 0!==i)return i}n=n.prev}return Nt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}},{key:"updateTarget",value:function(t,e,n){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,n)}}])}(),ga=function(){return u((function t(e,n,i,r){o(this,t),this.duration=n,this.position=e,this.props=i,this.easing=r}),[{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}}])}(),ya={duration:200,easing:"cubicOut"},ma={duration:1e3,easing:"quadInOut"};t.Edge=void 0,(va=t.Edge||(t.Edge={}))[va.Top=1]="Top",va[va.Right=2]="Right",va[va.Bottom=4]="Bottom",va[va.Left=8]="Left",va[va.ALL=15]="ALL";var ka=[!1,!1,!1,!1],ba=function(t){var e,n=!0;if(vt(t,!0)){for(var i=0;i<4;i++)ka[i]=t,n&&(n=!(null!==(e=ka[i])&&void 0!==e&&!e));n=t}else if(Array.isArray(t))for(var r=0;r<4;r++)ka[r]=!!t[r],n&&(n=!!ka[r]);else ka[0]=!1,ka[1]=!1,ka[2]=!1,ka[3]=!1;return{isFullStroke:n,stroke:ka}},_a=[0,0,0,0],xa=function(t){return t?wt(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(_a[0]=t[0],_a[2]=t[0],_a[1]=t[1],_a[3]=t[1],_a):t:t:0},wa=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Sa=[1,2,3,0,1,2,3,0];function Aa(t,e,n,i){for(;t>=Kt;)t-=Kt;for(;t<0;)t+=Kt;for(;t>e;)e+=Kt;wa[0].x=n,wa[1].y=n,wa[2].x=-n,wa[3].y=-n;var r=Math.ceil(t/Yt)%4,a=Math.ceil(e/Yt)%4;if(i.add(Jt(t)*n,te(t)*n),i.add(Jt(e)*n,te(e)*n),r!==a||e-t>Ht)for(var o=!1,s=0;s<Sa.length;s++)if(o||r!==Sa[s]){if(o&&a===Sa[s])break;if(o){var u=wa[Sa[s]];i.add(u.x,u.y)}}else{o=!0;var l=wa[r];i.add(l.x,l.y)}}function Ta(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function Ca(t,e,n){var i=ae(t.x,t.y,e.x,e.y,n),r=i.x,a=i.y,o=ae(t.x1,t.y1,e.x1,e.y1,n),s=o.x,u=o.y,l=new ue(r,a,s,u);return l.defined=e.defined,l}function Ea(t,e,n){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);var i=[];if(t.length>e.length){i=e.map((function(t){var e=new ue(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var r=0;r<e.length;r++)i[r]=Ca(t[r],e[r],n)}else{i=e.map((function(t){var e=new ue(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(var a=0;a<t.length;a++)i[a]=Ca(t[a],e[a],n)}return i}var Ra=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],Ba=function(t){return Ra.includes(t)};function Ma(t,e){if(wt(t)){for(var n,i=0;i<t.length&&void 0===n;i++)n=t[i][e];return n}return t[e]}var Pa=function(){return u((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.TimeOut;o(this,t),this.durations=[],this.timeout=e,this.lastDate=0,this.durationsListThreshold=30}),[{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)}}])}();Pa.TimeOut=1e3/60;var Oa,Ia=new Pa,La=function(t,e){return xt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t},Da=function(t){function n(t,i,r,a,s){return o(this,n),e(this,n,[t,i,r,a,s])}return c(n,t),u(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,e,n,i,r,a,o,s;this.fromNumber=At(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(n=this.from)||void 0===n?void 0:n.text),this.toNumber=At(null===(i=this.to)||void 0===i?void 0:i.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(a=this.to)||void 0===a?void 0:a.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(s=null===(o=this.params)||void 0===o?void 0:o.fixed)&&void 0!==s?s:Math.max(se(this.fromNumber),se(this.toNumber)))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){!1!==this.valid&&(n.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}])}(ha);!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"}(Oa||(Oa={}));var ja=function(t){function n(t,i,r,a,s){var u;o(this,n),u=e(this,n,[t,i,r,a,s]);var l=s||{},c=l.direction,h=void 0===c?Oa.LEFT_TO_RIGHT:c,d=l.fill,f=void 0===d||d,v=l.stroke,p=void 0===v||v;return u.direction=h,u.fill=f,u.stroke=p,u.fillGradient={gradient:"linear",stops:[]},u.strokeGradient={gradient:"linear",stops:[]},u}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{fill:this.toFill,stroke:this.toStroke}}},{key:"onBind",value:function(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){if(this.toFill&&this.toStroke)switch(this.direction){case Oa.RIGHT_TO_LEFT:this.rightToLeft(t,e,n);break;case Oa.TOP_TO_BOTTOM:this.topToBottom(t,e,n);break;case Oa.BOTTOM_TO_TOP:this.bottomToTop(t,e,n);break;case Oa.STROKE:this.strokePath(t,e,n);break;default:this.leftToRight(t,e,n)}}},{key:"leftToRight",value:function(t,e,n){if(this.fill){var i=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:i},{offset:e,color:i},{offset:Math.min(1,2*e),color:"transparent"}],n.fill=this.fillGradient}if(this.stroke){var r=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:r},{offset:e,color:r},{offset:Math.min(1,6*e),color:"transparent"}],n.stroke=this.strokeGradient}}},{key:"strokePath",value:function(t,e,n){if(this.fill){var i=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:i},{offset:e,color:i},{offset:Math.min(1,2*e),color:"transparent"}],n.fill=this.fillGradient}if(this.stroke){var r=300*e;n.lineDash=[r,300-r]}}},{key:"rightToLeft",value:function(t,e,n){}},{key:"topToBottom",value:function(t,e,n){}},{key:"bottomToTop",value:function(t,e,n){}}])}(ha),Fa=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).fromText="",t.toText="",t}return c(n,t),u(n,[{key:"getEndProps",value:function(){return!1===this.valid?{}:{text:this.to}}},{key:"onBind",value:function(){var t,e,n,i;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(i=null===(n=this.to)||void 0===n?void 0:n.text)&&void 0!==i?i:"",!this.toText||wt(this.toText))this.valid=!1;else{this.toText=this.toText.toString();var r=this.target.attachShadow(),a=Mi.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});r.add(a)}}},{key:"onEnd",value:function(){this.target.detachShadow()}},{key:"onUpdate",value:function(t,e,n){var i;if(!1!==this.valid){var r=this.fromText.length,a=this.toText.length,o=Math.ceil(r+(a-r)*e);n.text=this.toText.substr(0,o);var s=null===(i=this.target.shadowRoot)||void 0===i?void 0:i.at(0),u=this.target.clipedWidth+2;s.setAttribute("x",u)}}}])}(ha),Na=function(n){function i(t,n,r,a,s){return o(this,i),e(this,i,[t,n,r,a,s])}return c(i,n),u(i,[{key:"getEndProps",value:function(){return{}}},{key:"onStart",value:function(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}},{key:"onStartLineOrArea",value:function(t){var e,n=this.target.attachShadow(),i=Mi.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=i,i.pathProxy=new ei,n.add(i)}},{key:"onStartRect",value:function(){var t,e,n,i=this.target.attachShadow(),r=null===(e=null===(t=this.params)||void 0===t?void 0:t.isHorizontal)||void 0===e||e,a=r?"height":"width",o=r?"width":"height",s=this.target.AABBBounds[a](),u=r?0:this.target.AABBBounds.y1,c=Mi.graphicService.creator.rect(Object.assign(Object.assign(l(l(l(l({},a,s),"fill","#bcdeff"),"shadowBlur",30),"shadowColor","#bcdeff"),null===(n=this.params)||void 0===n?void 0:n.attribute),l({x:0,y:u},o,0)));this.rect=c,i.add(c)}},{key:"onBind",value:function(){}},{key:"onEnd",value:function(){this.target.detachShadow()}},{key:"onUpdate",value:function(t,e,n){return this.rect?this.onUpdateRect(t,e,n):this.line||this.area?this.onUpdateLineOrArea(t,e,n):void 0}},{key:"onUpdateRect",value:function(e,n,i){var r,a,o,s,u,l,c,h,d,f,v,p,g,y,m,k,b=null===(a=null===(r=this.params)||void 0===r?void 0:r.isHorizontal)||void 0===a||a,_=this.target.attribute;if(b){var x=null!==(s=null!==(o=_.width)&&void 0!==o?o:Math.abs(_.x1-_.x))&&void 0!==s?s:250,w=null!==(l=null===(u=this.params)||void 0===u?void 0:u.streamLength)&&void 0!==l?l:x,S=null!==(d=null===(h=null===(c=this.params)||void 0===c?void 0:c.attribute)||void 0===h?void 0:h.width)&&void 0!==d?d:60,A=-S,T=A+(w-A)*n,C=Math.max(T,0),E=Math.min(Math.min(T+S,S),w-T),R=E+C>x?Math.max(x-C,0):E;this.rect.setAttributes({x:C,width:R,dx:Math.min(_.x1-_.x,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:n,end:e}})}else{var B,M=null!==(v=null!==(f=_.height)&&void 0!==f?f:Math.abs(_.y1-_.y))&&void 0!==v?v:250,P=null!==(g=null===(p=this.params)||void 0===p?void 0:p.streamLength)&&void 0!==g?g:M,O=null!==(k=null===(m=null===(y=this.params)||void 0===y?void 0:y.attribute)||void 0===m?void 0:m.height)&&void 0!==k?k:60,I=M-(P+O)*n,L=Math.min(I,M),D=Math.min(M-I,O);L<=0?(B=Math.max(L+D,0),L=0):B=D,this.rect.setAttributes({y:L,height:B,dy:Math.min(_.y1-_.y,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:n,end:e}})}}},{key:"onUpdateLineOrArea",value:function(t,e,n){var i=this.line||this.area;if(i){var r=i.pathProxy,a=this.target;a.cache||a.cacheArea?this._onUpdateLineOrAreaWithCache(r,a,t,e,n):this._onUpdateLineWithoutCache(r,a,t,e,n);var o=a.attribute;i.setAttributes(Object.assign({stroke:o.stroke},i.attribute)),i.addUpdateBoundTag()}}},{key:"_onUpdateLineOrAreaWithCache",value:function(t,e,n,i,r){if(t.clear(),"line"===e.type){var a=e.cache;Array.isArray(a)||(a=[a]);var o=a.reduce((function(t,e){return t+e.getLength()}),0),s=[];return a.forEach((function(t){t.curves.forEach((function(t){return s.push(t)}))})),this._updateCurves(t,s,o,i)}if("area"===e.type){var u=e.cacheArea,l=u.top.curves.reduce((function(t,e){return t+e.getLength()}),0);return this._updateCurves(t,u.top.curves,l,i)}}},{key:"_updateCurves",value:function(t,e,n,i){for(var r,a,o=n*i,s=Math.min(null!==(a=o+(null===(r=this.params)||void 0===r?void 0:r.streamLength))&&void 0!==a?a:10,n),u=0,l=!1,c=0;c<e.length;c++){var h=e[c],d=h.getLength(),f=1-(u+d-o)/d,v=void 0,p=1-(u+d-s)/d;if(u<o&&u+d>o)if(l=!0,h.p2&&h.p3){var y=g(gn(h,f),2);y[0];var m=y[1];t.moveTo(m.p0.x,m.p0.y),v=m}else{var k=h.getPointAt(f);t.moveTo(k.x,k.y)}if(u<s&&u+d>s){if(h.p2&&h.p3){v&&(p=(s-o)/v.getLength());var b=g(gn(v||h,p),1)[0];t.bezierCurveTo(b.p1.x,b.p1.y,b.p2.x,b.p2.y,b.p3.x,b.p3.y)}else{var _=h.getPointAt(p);t.lineTo(_.x,_.y)}break}if(l)if(h.p2&&h.p3){var x=v||h;t.bezierCurveTo(x.p1.x,x.p1.y,x.p2.x,x.p2.y,x.p3.x,x.p3.y)}else t.lineTo(h.p1.x,h.p1.y);u+=d}}},{key:"_onUpdateLineWithoutCache",value:function(t,e,n,i,r){var a,o,s=e.attribute,u=s.points,l=s.curveType;if(u&&!(u.length<2)&&"linear"===l){for(var c=0,h=1;h<u.length;h++)c+=le.distancePP(u[h],u[h-1]);for(var d=c*i,f=Math.min(null!==(o=d+(null===(a=this.params)||void 0===a?void 0:a.streamLength))&&void 0!==o?o:10,c),v=[],p=0,g=1;g<u.length;g++){var y=le.distancePP(u[g],u[g-1]);if(p<d&&p+y>d&&v.push(le.pointAtPP(u[g-1],u[g],1-(p+y-d)/y)),p<f&&p+y>f){v.push(le.pointAtPP(u[g-1],u[g],1-(p+y-f)/y));break}v.length&&v.push(u[g]),p+=y}if(v.length&&!(v.length<2)){t.clear(),t.moveTo(v[0].x,v[0].y);for(var m=1;m<v.length;m++)t.lineTo(v[m].x,v[m].y)}}}}])}(ha),Ga=function(n){function i(t,n,r,a){var s;return o(this,i),(s=e(this,i,[null,null,n,r,a])).size=t,s.posList=[],s}return c(i,n),u(i,[{key:"lastPos",get:function(){return this.posList[this.posList.length-1]}},{key:"onBind",value:function(){var e=this.target.attachShadow();this.root=e;for(var n=0;n<this.size;n++){var i=this.target.clone(),r=Math.min((this.size-n)/this.size*3,1),a=Math.min(.2+.7/this.size);i.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:a},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(i)}}},{key:"onUpdate",value:function(t,e,n){var i=this;if(t)return this.target.detachShadow(),void(this.posList.length=0);var r=this.target.getComputedAttribute("x"),a=this.target.getComputedAttribute("y"),o=new ue(r,a);this.posList.length?(this.target.shadowRoot.forEachChildren((function(t,e){var n=i.posList[Math.max(i.posList.length-e-1,0)];t.setAttributes({x:n.x-r,y:n.y-a},!1)})),this.posList.push(o)):this.posList.push(o)}}])}(ha),za=function(t){function n(t,i,r,a,s){var u,l;return o(this,n),u=e(this,n,[t,i,r,a,s]),s&&(u.pathLength=s.path.getLength(),u.path=s.path,u.distance=s.distance,u.to=s.distance*u.pathLength,u.initAngle=null!==(l=s.initAngle)&&void 0!==l?l:0,u.changeAngle=!!s.changeAngle,u.cb=s.cb),u}return c(n,t),u(n,[{key:"onUpdate",value:function(t,e,n){var i=this.to*e,r=this.path.getAttrAt(i),a=r.pos,o=r.angle;n.x=a.x,n.y=a.y,this.changeAngle&&(n.angle=o+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}}])}(ha),Ua=function(t){function n(t,i,r,a,s){var u,l,c;return o(this,n),(u=e(this,n,[t,i,r,a,s])).newPointAnimateType=null!==(l=null==s?void 0:s.newPointAnimateType)&&void 0!==l?l:"grow",u.clipRangeByDimension=null!==(c=null==s?void 0:s.clipRangeByDimension)&&void 0!==c?c:"x",u}return c(n,t),u(n,[{key:"onBind",value:function(){var t,e,n=this,i=null===(t=this.from)||void 0===t?void 0:t.points,r=null===(e=this.to)||void 0===e?void 0:e.points;this.fromPoints=i?Array.isArray(i)?i:[i]:[],this.toPoints=r?Array.isArray(r)?r:[r]:[];var a=new Map;this.fromPoints.forEach((function(t){t.context&&a.set(t.context,t)}));for(var o,s,u=1/0,l=-1/0,c=0;c<this.toPoints.length;c+=1)if(a.has(this.toPoints[c].context)){u=c,o=a.get(this.toPoints[c].context);break}for(var h=this.toPoints.length-1;h>=0;h-=1)if(a.has(this.toPoints[h].context)){l=h,s=a.get(this.toPoints[h].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(l)?(this.clipRange=this.toPoints[l][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],Tt(this.clipRange)?this.clipRange=Wt(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);var d=this.toPoints[0];this.interpolatePoints=this.toPoints.map((function(t,e){var i=a.get(t.context);return i?(d=i,[i,t]):"appear"===n.newPointAnimateType||"clip"===n.newPointAnimateType?[t,t]:e<u&&o?[o,t]:e>l&&s?[s,t]:[d,t]})),this.points=this.interpolatePoints.map((function(t){var e=t[0],n=t[1],i=new ue(e.x,e.y,e.x1,e.y1);return i.defined=n.defined,i.context=n.context,i}))}},{key:"onUpdate",value:function(t,e,n){var i=this;this.points=this.points.map((function(t,n){var r=Ca(i.interpolatePoints[n][0],i.interpolatePoints[n][1],e);return r.context=t.context,r})),this.clipRange&&(n.clipRange=this.clipRange+(1-this.clipRange)*e),n.points=this.points}}])}(ha),Wa=function(t){function n(t,i,r,a,s){var u;return o(this,n),(u=e(this,n,[t,i,r,a,s])).graphic=null==s?void 0:s.graphic,u}return c(n,t),u(n,[{key:"onUpdate",value:function(t,e,n){var i=this;this.graphic&&Object.keys(this.from).forEach((function(t){n[t]=i.from[t]+(i.to[t]-i.from[t])*e}))}}])}(ha),Va=function(n){function i(t,n,r,a,s){var u;return o(this,i),(u=e(this,i,[null,null,r,a,s])).clipFromAttribute=t,u.clipToAttribute=n,u._group=null==s?void 0:s.group,u._clipGraphic=null==s?void 0:s.clipGraphic,u}return c(i,n),u(i,[{key:"onBind",value:function(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}},{key:"onEnd",value:function(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}},{key:"onUpdate",value:function(e,n,i){var r=this;if(this._clipGraphic){var a={};Object.keys(this.clipFromAttribute).forEach((function(t){a[t]=r.clipFromAttribute[t]+(r.clipToAttribute[t]-r.clipFromAttribute[t])*n})),this._clipGraphic.setAttributes(a,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:n,end:e}})}}}])}(ha),Ha=function(t){function n(t,i,r,a,s){var u,l,c,h,d,f,v,p,g,y,m,k;o(this,n);var b=null!==(l=null===(u=null==s?void 0:s.group)||void 0===u?void 0:u.attribute)&&void 0!==l?l:{},_=null!==(c=b.width)&&void 0!==c?c:0,x=null!==(h=b.height)&&void 0!==h?h:0,w=null!==(d=null==s?void 0:s.animationType)&&void 0!==d?d:"in",S=null!==(f=null==s?void 0:s.startAngle)&&void 0!==f?f:0,A=null!==(v=null==s?void 0:s.orient)&&void 0!==v?v:"clockwise",T=0,C=0;"anticlockwise"===A?(C="in"===w?S+2*Math.PI:S,C=S+2*Math.PI):(T=S,C="out"===w?S+2*Math.PI:S);var E,R,B=Mi.graphicService.creator.arc({x:null!==(g=null===(p=null==s?void 0:s.center)||void 0===p?void 0:p.x)&&void 0!==g?g:_/2,y:null!==(m=null===(y=null==s?void 0:s.center)||void 0===y?void 0:y.y)&&void 0!==m?m:x/2,outerRadius:null!==(k=null==s?void 0:s.radius)&&void 0!==k?k:(_+x)/2,innerRadius:0,startAngle:T,endAngle:C,fill:!0});return"anticlockwise"===A?(E={startAngle:S+2*Math.PI},R={startAngle:S}):(E={endAngle:S},R={endAngle:S+2*Math.PI}),e(this,n,["in"===w?E:R,"in"===w?R:E,r,a,{group:null==s?void 0:s.group,clipGraphic:B}])}return c(n,t),u(n)}(Va),Ya=function(t){function n(t,i,r,a,s){var u,l,c,h,d,f,v,p,g,y,m;o(this,n);var k=null!==(l=null===(u=null==s?void 0:s.group)||void 0===u?void 0:u.attribute)&&void 0!==l?l:{},b=null!==(c=k.width)&&void 0!==c?c:0,_=null!==(h=k.height)&&void 0!==h?h:0,x=null!==(d=null==s?void 0:s.animationType)&&void 0!==d?d:"in",w=null!==(f=null==s?void 0:s.startRadius)&&void 0!==f?f:0,S=null!==(v=null==s?void 0:s.endRadius)&&void 0!==v?v:Math.sqrt(Math.pow(b/2,2)+Math.pow(_/2,2)),A=Mi.graphicService.creator.arc({x:null!==(g=null===(p=null==s?void 0:s.center)||void 0===p?void 0:p.x)&&void 0!==g?g:b/2,y:null!==(m=null===(y=null==s?void 0:s.center)||void 0===y?void 0:y.y)&&void 0!==m?m:_/2,outerRadius:"out"===x?S:w,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),T={outerRadius:w},C={outerRadius:S};return e(this,n,["in"===x?T:C,"in"===x?C:T,r,a,{group:null==s?void 0:s.group,clipGraphic:A}])}return c(n,t),u(n)}(Va),Xa=function(t){function n(t,i,r,a,s){var u,l,c,h,d,f,v,p,g;o(this,n);var y=null!==(l=null===(u=null==s?void 0:s.group)||void 0===u?void 0:u.attribute)&&void 0!==l?l:{},m=null!==(h=null!==(c=null==s?void 0:s.width)&&void 0!==c?c:y.width)&&void 0!==h?h:0,k=null!==(f=null!==(d=null==s?void 0:s.height)&&void 0!==d?d:y.height)&&void 0!==f?f:0,b=null!==(v=null==s?void 0:s.animationType)&&void 0!==v?v:"in",_=null!==(p=null==s?void 0:s.direction)&&void 0!==p?p:"x",x=null!==(g=null==s?void 0:s.orient)&&void 0!==g?g:"positive",w=Mi.graphicService.creator.rect({x:0,y:0,width:"in"===b&&"x"===_?0:m,height:"in"===b&&"y"===_?0:k,fill:!0}),S={},A={};return"y"===_?"negative"===x?(S={y:k,height:0},A={y:0,height:k}):(S={height:0},A={height:k}):"negative"===x?(S={x:m,width:0},A={x:0,width:m}):(S={width:0},A={width:m}),e(this,n,["in"===b?S:A,"in"===b?A:S,r,a,{group:null==s?void 0:s.group,clipGraphic:w}])}return c(n,t),u(n)}(Va),Ka=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"onStart",value:function(){var t="function"==typeof this.params?this.params():this.params,e=t.center,n=t.r,i=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),a=this.target.getComputedAttribute("z"),o=Math.acos((r-e.y)/n),s=Math.acos((i-e.x)/n/Math.sin(o));a-e.z<0&&(s=Kt-s),this.theta=s,this.phi=o}},{key:"onBind",value:function(){}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){if(null!=this.phi&&null!=this.theta){var i="function"==typeof this.params?this.params():this.params,r=i.center,a=i.r,o=i.cb,s=2*Math.PI*e,u=this.theta+s,l=this.phi,c=a*Math.sin(l)*Math.cos(u)+r.x,h=a*Math.cos(l)+r.y,d=a*Math.sin(l)*Math.sin(u)+r.z;for(n.x=c,n.y=h,n.z=d,n.alpha=u+Ht/2;n.alpha>Kt;)n.alpha-=Kt;n.alpha=Kt-n.alpha,n.zIndex=-1e4*n.z,o&&o(n)}}}])}(ha),qa=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.target.setTheme({common:{opacity:0}})}},{key:"onEnd",value:function(){this.target.setTheme({common:{opacity:1}})}},{key:"onUpdate",value:function(t,e,n){this.target.setTheme({common:{opacity:e}})}}])}(ha),Za=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.target.setTheme({common:{opacity:1}})}},{key:"onEnd",value:function(){this.target.setTheme({common:{opacity:0}})}},{key:"onUpdate",value:function(t,e,n){this.target.setTheme({common:{opacity:1-e}})}}])}(ha),Ja=function(t){function n(t,i,r){return o(this,n),e(this,n,[{},t,i,r])}return c(n,t),u(n,[{key:"getEndProps",value:function(){return this.to}},{key:"onBind",value:function(){var t=this;Object.keys(this.to).forEach((function(e){t.from[e]=t.target.getComputedAttribute(e)}))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,n,this.step,e,t,this.to,this.from)}}])}(ha),$a=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[null,null,t,"linear"])).customAnimates=i,r}return c(n,t),u(n,[{key:"initAnimates",value:function(){var t=this;this.customAnimates.forEach((function(e){e.step=t.step,e.subAnimate=t.subAnimate,e.target=t.target}))}},{key:"getEndProps",value:function(){var t={};return this.customAnimates.forEach((function(e){Object.assign(t,e.getEndProps())})),t}},{key:"onBind",value:function(){this.initAnimates(),this.customAnimates.forEach((function(t){t.onBind()}))}},{key:"onEnd",value:function(){this.customAnimates.forEach((function(t){t.onEnd()}))}},{key:"onStart",value:function(){this.customAnimates.forEach((function(t){t.onStart()}))}},{key:"onUpdate",value:function(t,e,n){this.updating||(this.updating=!0,this.customAnimates.forEach((function(i){var r=i.easing,a="string"==typeof r?ua[r]:r;e=a(e),i.onUpdate(t,e,n)})),this.updating=!1)}}])}(ha),Qa=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[null,null,t,"linear"])).customAnimates=i,r}return c(n,t),u(n,[{key:"initAnimates",value:function(){var t=this;this.customAnimates.forEach((function(e){e.step=t.step,e.subAnimate=t.subAnimate,e.target=t.target}))}},{key:"getEndProps",value:function(){var t={};return this.customAnimates.forEach((function(e){Object.assign(t,e.getEndProps())})),t}},{key:"onBind",value:function(){this.initAnimates(),this.customAnimates.forEach((function(t){t.onBind()}))}},{key:"onEnd",value:function(){this.customAnimates.forEach((function(t){t.onEnd()}))}},{key:"onUpdate",value:function(t,e,n){this.updating||(this.updating=!0,this.customAnimates.forEach((function(i){var r=i.easing,a="string"==typeof r?ua[r]:r;e=a(e),i.onUpdate(t,e,n)})),this.updating=!1)}}])}(ha);function to(t,e,n,i,r,a){var o=(e-t)*r+t,s=(n-e)*r+e,u=(i-n)*r+n,l=(s-o)*r+o,c=(u-s)*r+s,h=(c-l)*r+l;a[0]=t,a[1]=o,a[2]=l,a[3]=h,a[4]=h,a[5]=c,a[6]=u,a[7]=i}function eo(t,e){var n=t.length,i=e.length;if(n===i)return[t,e];for(var r=[],a=[],o=n<i?t:e,s=Math.min(n,i),u=Math.abs(i-n)/6,l=(s-2)/6,c=Math.ceil(u/l),h=[o[0],o[1]],d=u,f=2;f<s;f+=6){var v=o[f-2],p=o[f-1],g=o[f],y=o[f+1],m=o[f+2],k=o[f+3],b=o[f+4],_=o[f+5];if(d<=0)h.push(g,y,m,k,b,_);else{for(var x=Math.min(d,c)+1,w=1;w<=x;w++){var S=w/x;to(v,g,m,b,S,r),to(p,y,k,_,S,a),v=r[3],p=a[3],h.push(r[1],a[1],r[2],a[2],v,p),g=r[5],y=a[5],m=r[6],k=a[6]}d-=x-1}}return o===t?[h,e]:[t,h]}function no(t,e){for(var n=t||e,i=n.length,r=n[i-2],a=n[i-1],o=[],s=0;s<e.length;s+=2)o[s]=r,o[s+1]=a;return o}function io(t){for(var e=[],n=t.length,i=0;i<n;i+=2)e[i]=t[n-i-2],e[i+1]=t[n-i-1];return e}function ro(t){for(var e=0,n=0,i=0,r=t.length,a=0,o=r-2;a<r;o=a,a+=2){var s=t[o],u=t[o+1],l=t[a],c=t[a+1],h=s*c-l*u;e+=h,n+=(s+l)*h,i+=(u+c)*h}return 0===e?[t[0]||0,t[1]||0,0]:[n/e/3,i/e/3,e]}function ao(t,e,n,i){for(var r=(t.length-2)/6,a=1/0,o=0,s=t.length,u=s-2,l=0;l<r;l++){for(var c=6*l,h=0,d=0;d<s;d+=2){var f=0===d?c:(c+d-2)%u+2,v=t[f]-n[0],p=t[f+1]-n[1],g=e[d]-i[0]-v,y=e[d+1]-i[1]-p;h+=g*g+y*y}h<a&&(a=h,o=l)}return o}function oo(t,e,n,i){for(var r,a=[],o=0;o<t.length;o++){var s=t[o],u=e[o],l=ro(s),c=ro(u);null==r&&(r=l[2]<0!=c[2]<0);var h=[],d=[],f=0,v=1/0,p=[],g=s.length;r&&(s=io(s));for(var y=6*ao(s,u,l,c),m=g-2,k=0;k<m;k+=2){var b=(y+k)%m+2;h[k+2]=s[b]-l[0],h[k+3]=s[b+1]-l[1]}if(h[0]=s[y]-l[0],h[1]=s[y+1]-l[1],n>0)for(var _=i/n,x=-i/2;x<=i/2;x+=_){for(var w=Math.sin(x),S=Math.cos(x),A=0,T=0;T<s.length;T+=2){var C=h[T],E=h[T+1],R=u[T]-c[0],B=u[T+1]-c[1],M=R*S-B*w,P=R*w+B*S;p[T]=M,p[T+1]=P;var O=M-C,I=P-E;A+=O*O+I*I}if(A<v){v=A,f=x;for(var L=0;L<p.length;L++)d[L]=p[L]}}else for(var D=0;D<g;D+=2)d[D]=u[D]-c[0],d[D+1]=u[D+1]-c[1];a.push({from:h,to:d,fromCp:l,toCp:c,rotation:-f})}return a}function so(t,e){for(var n,i,r=[],a=[],o=0;o<Math.max(t.length,e.length);o++){var s,u=t[o],l=e[o],c=void 0,h=void 0;u?l?(n=c=(s=g(eo(u,l),2))[0],i=h=s[1]):(h=no(i,u),c=u):(c=no(n,l),h=l),r.push(c),a.push(h)}return[r,a]}var uo=function(t,e,n,i,r){Ut(e,i)&&Ut(n,r)||t.push(e,n,i,r,i,r)};function lo(t){for(var e,n,i,r,a,o=t.commandList,s=[],u=0,l=0,c=0,h=0,d=function(t,n){e&&e.length>2&&s.push(e),e=[t,n]},f=0,v=o.length;f<v;f++){var p=o[f],g=0===f;switch(g&&(c=u=p[1],h=l=p[2],[nn.L,nn.C,nn.Q].includes(p[0])&&(e=[c,h])),p[0]){case nn.M:u=c=p[1],l=h=p[2],d(c,h);break;case nn.L:n=p[1],i=p[2],uo(e,u,l,n,i),u=n,l=i;break;case nn.C:e.push(p[1],p[2],p[3],p[4],u=p[5],l=p[6]);break;case nn.Q:n=p[1],i=p[2],r=p[3],a=p[4],e.push(u+2/3*(n-u),l+2/3*(i-l),r+2/3*(n-r),a+2/3*(i-a),r,a),u=r,l=a;break;case nn.A:var y=p[1],m=p[2],k=p[3],b=k,_=p[4],x=p[5],w=!!p[6];n=Math.cos(_)*k+y,i=Math.sin(_)*k+m,g?d(c=n,h=i):uo(e,u,l,n,i),u=Math.cos(x)*k+y,l=Math.sin(x)*k+m;for(var S=(w?-1:1)*Math.PI/2,A=_;w?A>x:A<x;A+=S){var T=w?Math.max(A+S,x):Math.min(A+S,x);un(e,A,T,y,m,k,b)}break;case nn.E:var C=p[1],E=p[2],R=p[3],B=p[4],M=p[5],P=p[6],O=p[7]+P,I=!!p[8],L=!Ut(M,0),D=Math.cos(M),j=Math.sin(M),F=Math.cos(P)*R,N=Math.sin(P)*B;L?(n=F*D-N*j+C,i=F*j+N*D+E):(n=F+C,i=N+E),g?d(c=n,h=i):uo(e,u,l,n,i),F=Math.cos(O)*R,N=Math.sin(O)*B,L?(u=F*D-N*j+C,l=F*j+N*D+E):(u=F+C,l=N+E);for(var G=(I?-1:1)*Math.PI/2,z=P;I?z>O:z<O;z+=G){var U=I?Math.max(z+G,O):Math.min(z+G,O);if(un(e,z,U,C,E,R,B),L)for(var W=e.length,V=W-6;V<=W-1;V+=2)F=e[V],N=e[V+1],e[V]=(F-C)*D-(N-E)*j+C,e[V+1]=(F-C)*j+(N-E)*D+E}break;case nn.R:c=u=p[1],h=l=p[2],n=c+p[3],i=h+p[4],d(n,h),uo(e,n,h,n,i),uo(e,n,i,c,i),uo(e,c,i,c,h),uo(e,c,h,n,h);break;case nn.AT:var H=p[1],Y=p[2],X=p[3],K=p[4],q=p[5],Z=le.distancePP({x:u,y:l},{x:H,y:Y}),J=le.distancePP({x:X,y:K},{x:H,y:Y}),$=((u-H)*(X-H)+(l-Y)*(K-Y))/(Z*J),Q=q/Math.sin($/2),tt=(u+X-2*H)/2,et=(l+K-2*Y)/2,nt=le.distancePP({x:tt,y:et},{x:0,y:0}),it=H+Q*tt/nt,rt=X+Q*et/nt,at=Math.sqrt(Q*Q-q*q);uo(e,u,l,c=H+at*(u-H)/Z,h=Y+at*(l-Y)/Z),u=H+at*(X-H)/J,l=Y+at*(K-Y)/J;var ot=ve({x:it,y:rt},{x:c,y:h}),st=ve({x:it,y:rt},{x:u,y:l});un(e,ot,st,it,rt,q,q);break;case nn.Z:e&&uo(e,u,l,c,h),u=c,l=h}}return e&&e.length>2&&s.push(e),s}function co(t,e){for(var n=0;n<t.length;n++)for(var i=t[n],r=0;r<i.length;r+=2){var a=i[r],o=i[r+1],s={x:a,y:o};e.transformPoint({x:a,y:o},s),i[r]=s.x,i[r+1]=s.y}}function ho(t){for(var e=new ei,n=0;n<t.length;n++){var i=t[n];if(i.length>2){e.moveTo(i[0],i[1]);for(var r=2;r<i.length;r+=6)e.bezierCurveTo(i[r],i[r+1],i[r+2],i[r+3],i[r+4],i[r+5])}}return e}var fo=function(t){if(!t)return{x:0,y:0,width:0,height:0};var e=gt(t.width)?t.x1-t.x:t.width,n=gt(t.height)?t.y1-t.y:t.height,i=0,r=0;return e<0?(i=e,e=-e):Number.isNaN(e)&&(e=0),n<0?(r=n,n=-n):Number.isNaN(n)&&(n=0),{x:i,y:r,width:e,height:n}};function vo(t,e,n){var i,r,a=t/e;t>=e?(r=Math.ceil(Math.sqrt(n*a)),0===(i=Math.floor(n/r))&&(i=1,r=n)):(i=Math.ceil(Math.sqrt(n/a)),0===(r=Math.floor(n/i))&&(r=1,i=n));for(var o=[],s=0;s<i;s++)o.push(r);var u=n-i*r;if(u>0)for(var l=0;l<u;l+=r)l+r<u?o.push(r):o.push(u-l);return o}var po=function(t,e){for(var n=fo(t.attribute),i=n.width,r=n.height,a=vo(i,r,e),o=[],s=r/a.length,u=0,l=a.length;u<l;u++)for(var c=a[u],h=i/c,d=0;d<c;d++)o.push({x:0+d*h,y:0+u*s,width:h,height:s});return o},go=function(t,e){for(var n=t.getParsedAngle(),i=n.startAngle,r=n.endAngle,a=t.getComputedAttribute("innerRadius"),o=t.getComputedAttribute("outerRadius"),s=Math.abs(i-r),u=Math.abs(o-a),l=vo(s*(a+o)/2,u,e),c=[],h=u/l.length,d=o>=a?1:-1,f=r>=i?1:-1,v=0,p=l.length;v<p;v++)for(var g=l[v],y=s/g,m=0;m<g;m++)c.push({innerRadius:o-h*v*d,outerRadius:o-h*(v+1)*d,startAngle:i+y*m*f,endAngle:i+y*(m+1)*f});return c},yo=function(t,e){for(var n=t.getComputedAttribute("startAngle"),i=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),a=Math.abs(n-i),o=vo(a*r,r,e),s=[],u=a/o[0],l=r/o.length,c=i>=n?1:-1,h=0,d=o.length;h<d;h++)for(var f=0,v=o[h];f<v;f++)s.push({innerRadius:l*h,outerRadius:l*(h+1),startAngle:n+u*f*c,endAngle:n+u*(f+1)*c});return s},mo=function(t,e){var n=t.filter((function(t){return!1!==t.defined&&At(t.x)&&At(t.y)}));if(0===n.length)return[];if(1===n.length)return new Array(e).fill(0).map((function(t){return n[0]}));var i=[];if(e<=n.length){for(var r=n.length/e,a=0,o=0;a<e;)i.push(n[Math.floor(o)]),o+=r,a++;return i}for(var s=e-n.length,u=1/(s/(n.length-1)+1),l=0,c=0,h=t.length;c<h;c++)if(i.push(t[c]),c<h-1)for(var d=u,f=t[c].x,v=t[c].y,p=t[c+1].x,g=t[c+1].y;d<1&&l<s;)i.push({x:f+(p-f)*d,y:v+(g-v)*d}),d+=u,l+=1;return i},ko=function(t,e){var n,i,r=t.attribute,a=r.points,o=r.segments;a||(a=o.reduce((function(t,e){var n;return t.concat(null!==(n=e.points)&&void 0!==n?n:[])}),[]));var s=a.filter((function(t){return!1!==t.defined&&At(t.x)&&At(t.y)}));if(!s.length)return[];var u=[];s.forEach((function(t){u.push({x:t.x,y:t.y})}));for(var l=s.length-1;l>=0;l--){var c=s[l];u.push({x:null!==(n=c.x1)&&void 0!==n?n:c.x,y:null!==(i=c.y1)&&void 0!==i?i:c.y})}var h=[];return Ao(a,e,h),h},bo=function(t,e){var n=t.attribute,i=n.points;if(i)return mo(i,e);if(n.segments){var r=n.segments.reduce((function(t,e){var n;return t.concat(null!==(n=e.points)&&void 0!==n?n:[])}),[]);return mo(r,e)}return[]};var _o,xo=function(t){return t.map((function(t){return{x:t.x,y:t.y}}))},wo=function(t,e,n){for(var i,r,a,o=t.length,s=[],u=0;u<o;u++){var l=t[u],c=u===o-1?t[0]:t[u+1],h=Me([e.x,e.y],[n.x,n.y],[l.x,l.y],[c.x,c.y]);h&&"boolean"!=typeof h&&s.push({dot:(r=[h[0]-e.x,h[1]-e.x],a=[n.x-e.x,n.y-e.x],r[0]*a[1]-r[1]*a[0]),point:{x:h[0],y:h[1]},edgeIndex:u})}if(s.length<2)return[xo(t),xo(t)];s.sort((function(t,e){return t.dot-e.dot}));var d=s[0],f=s[s.length-1];d.edgeIndex>f.edgeIndex&&(d=(i=[f,d])[0],f=i[1]);for(var v=d.point,p=f.point,g=[{x:v.x,y:v.y}],y=d.edgeIndex+1;y<=f.edgeIndex;y++)g.push({x:t[y].x,y:t[y].y});g.push({x:p.x,y:p.y});for(var m=[{x:p.x,y:p.y}],k=f.edgeIndex+1,b=d.edgeIndex+o;k<=b;k++){var _=t[k%o];m.push({x:_.x,y:_.y})}return m.push({x:v.x,y:v.y}),[g,m]},So=function(t){var e=new he;t.forEach((function(t){e.add(t.x,t.y)}));var n=e.width(),i=e.height();if(n>=i){var r=e.x1+n/2;return wo(t,{x:r,y:e.y1},{x:r,y:e.y2})}var a=e.y1+i/2;return wo(t,{x:e.x1,y:a},{x:e.x2,y:a})},Ao=function t(e,n,i){if(1===n)i.push({points:e});else{var r=Math.floor(n/2),a=So(e);t(a[0],r,i),t(a[1],n-r,i)}},To=function(t,e){var n=t.attribute.points;if(!n||!n.length)return[];if(1===e)return[{points:xo(n)}];var i=[];return Ao(n,e,i),i},Co=function(t,e){var n=lo(t.getParsedPathShape());if(!n.length||e<0)return[];var i=n.length;if(n.length>=e){for(var r=[],a=Math.floor(n.length/e),o=0;o<e;o++){var s=n.slice(o*a,o===e-1?i:(o+1)*a);r.push({path:ho(s)})}return r}for(var u=[],l=Math.floor(e/i),c=e,h=0;h<i;h++){for(var d=[],f=2,v=n[h].length;f<v;f+=2)d.push({x:n[0][f],y:n[0][f+1]});Ao(d,h===i-1?c:l,u),c-=l}return u};t.ColorType=void 0,(_o=t.ColorType||(t.ColorType={}))[_o.Color255=0]="Color255",_o[_o.Color1=1]="Color1";var Eo=function(){function e(){o(this,e)}return u(e,null,[{key:"Get",value:function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ColorType.Color1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===t.ColorType.Color1){var a=e.store1[n];if(a)return r[0]=a[0],r[1]=a[1],r[2]=a[2],r[3]=a[3],r;var o=Ee.parseColorString(n);if(o){var s=[o.r/255,o.g/255,o.b/255,o.opacity];e.store1[n]=s,e.store255[n]=[o.r,o.g,o.b,o.opacity],r[0]=s[0],r[1]=s[1],r[2]=s[2],r[3]=s[3]}return r}var u=e.store255[n];if(u)return r[0]=u[0],r[1]=u[1],r[2]=u[2],r[3]=u[3],r;var l=Ee.parseColorString(n);return l&&(e.store1[n]=[l.r/255,l.g/255,l.b/255,l.opacity],e.store255[n]=[l.r,l.g,l.b,l.opacity],r[0]=l.r,r[1]=l.g,r[2]=l.b,r[3]=l.opacity),r}},{key:"Set",value:function(n,i,r){if(i===t.ColorType.Color1){if(e.store1[n])return;e.store1[n]=r,e.store255[n]=[Math.floor(255*r[0]),Math.floor(255*r[1]),Math.floor(255*r[2]),Math.floor(255*r[3])]}else{if(e.store255[n])return;e.store255[n]=r,e.store1[n]=[r[0]/255,r[1]/255,r[2]/255,r[3]]}}}])}();function Ro(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&At(t[0])?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 Bo(t,e,n,i,r){return Array.isArray(t)&&!At(t[0])||Array.isArray(e)&&!At(e[0])?new Array(4).fill(0).map((function(r,a){return Mo(wt(t)?t[a]:t,wt(e)?e[a]:e,n,i)})):Mo(t,e,n,i,r)}function Mo(e,n,i,r,a){if(!e||!n)return e&&Ro(e)||n&&Ro(n)||!1;var o,s,u=!1,l=!1;if(Array.isArray(e)?o=e:"string"==typeof e?o=Eo.Get(e,t.ColorType.Color255):u=!0,Array.isArray(n)?s=n:"string"==typeof n?s=Eo.Get(n,t.ColorType.Color255):l=!0,u!==l){var c=u?e:n,h=u?n:e,d=Object.assign(Object.assign({},c),{stops:c.stops.map((function(t){return Object.assign(Object.assign({},t),{color:Ro(h)})}))});return u?Bo(c,d,i,r,a):Bo(d,c,i,r,a)}if(u){if(e.gradient===n.gradient){var f=e,v=n,p=f.stops,g=v.stops;if(p.length!==g.length)return!1;if("linear"===f.gradient)return Po(f,v,i);if("radial"===f.gradient)return Oo(f,v,i);if("conical"===f.gradient)return Io(f,v,i)}return!1}return a&&a(o,s),Ro(Lo(o,s,i),r)}function Po(t,e,n){var i=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:Fo(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}function Oo(t,e,n){var i=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*n,x1:t.x1+(e.x1-t.x1)*n,y0:t.y0+(e.y0-t.y0)*n,y1:t.y1+(e.y1-t.y1)*n,r0:t.r0+(e.r0-t.r0)*n,r1:t.r1+(e.r1-t.r1)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:Fo(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}function Io(t,e,n){var i=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*n,endAngle:t.endAngle+(e.endAngle-t.endAngle)*n,x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n,stops:new Array(i.length).fill(0).map((function(t,e){return{color:Fo(i[e].color,r[e].color,n),offset:i[e].offset+(r[e].offset-i[e].offset)*n}}))}}function Lo(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}Eo.store255={},Eo.store1={};var Do=[0,0,0,0],jo=[0,0,0,0];function Fo(e,n,i){return Eo.Get(e,t.ColorType.Color255,Do),Eo.Get(n,t.ColorType.Color255,jo),"rgba(".concat(Math.round(Do[0]+(jo[0]-Do[0])*i),",").concat(Math.round(Do[1]+(jo[1]-Do[1])*i),",").concat(Math.round(Do[2]+(jo[2]-Do[2])*i),",").concat(Do[3]+(jo[3]-Do[3])*i,")")}var No=function(t,e,n){t.forEach((function(t){if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*n;else if("fill"===t.key||"stroke"===t.key){var i=Bo(t.from,t.to,n,!1);i&&(e[t.key]=i)}}))},Go=function(t,e,n){var i=[],r=[];e.clear();for(var a=0;a<t.length;a++){var o=t[a],s=o.from,u=o.to,l=o.rotation*n,c=o.fromCp,h=o.toCp,d=Math.sin(l),f=Math.cos(l);r[0]=c[0]+(h[0]-c[0])*n,r[1]=c[1]+(h[1]-c[1])*n;for(var v=0;v<s.length;v+=2){var p=s[v],g=s[v+1],y=p*(1-n)+u[v]*n,m=g*(1-n)+u[v+1]*n;i[v]=y*f-m*d+r[0],i[v+1]=y*d+m*f+r[1]}var k=i[0],b=i[1];e.moveTo(k,b);for(var _=2;_<s.length;_+=6){var x=i[_],w=i[_+1],S=i[_+2],A=i[_+3],T=i[_+4],C=i[_+5];k===x&&b===w&&S===T&&A===C?e.lineTo(T,C):e.bezierCurveTo(x,w,S,A,T,C),k=T,b=C}}},zo=function(t,e,n){var i=t?lo(t):[],r=lo(e);n&&i&&(n.fromTransform&&co(i,n.fromTransform.clone().getInverse()),co(i,n.toTransfrom));var a=g(so(i,r),2),o=a[0],s=a[1];return t?oo(o,s,10,Math.PI):s.map((function(t,e){return{from:o[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0}}))},Uo=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],Wo=function(e,n){if(!e||!n)return null;var i=[],r=!1;return Object.keys(e).forEach((function(a){if(Uo.includes(a)){var o=n[a];gt(o)||gt(e[a])||o===e[a]||("fill"===a||"stroke"===a?i.push({from:"string"==typeof e[a]?Eo.Get(e[a],t.ColorType.Color255):e[a],to:"string"==typeof o?Eo.Get(o,t.ColorType.Color255):o,key:a}):i.push({from:e[a],to:o,key:a}),r=!0)}})),r?i:null},Vo=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[0,1,i,r])).morphingData=t.morphingData,a.otherAttrs=t.otherAttrs,a.saveOnEnd=t.saveOnEnd,a}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){var i=this.target,r="function"==typeof i.pathProxy?i.pathProxy(i.attribute):i.pathProxy;Go(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&No(this.otherAttrs,n,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}])}(ha),Ho=function(t,e,n,i){var r,a,o;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;var s=null==t?void 0:t.globalTransMatrix;i&&s&&(s=i.clone().multiply(s.a,s.b,s.c,s.d,s.e,s.f));var u=zo(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:s,toTransfrom:e.globalTransMatrix}),l=Wo(null==t?void 0:t.attribute,e.attribute),c=e.animate(n);return(null==n?void 0:n.delay)&&c.wait(n.delay),c.play(new Vo({morphingData:u,otherAttrs:l},null!==(a=null==n?void 0:n.duration)&&void 0!==a?a:ma.duration,null!==(o=null==n?void 0:n.easing)&&void 0!==o?o:ma.easing)),c},Yo=function(t,e,n){var i,r=e.filter((function(t){return t&&t.toCustomPath&&t.valid}));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");var a=("clone"===(null==n?void 0:n.splitPath)?Zo:null!==(i=null==n?void 0:n.splitPath)&&void 0!==i?i:Jo)(t,r.length,!1),o=null==n?void 0:n.onEnd,s=r.length,u=function(){0===--s&&o&&o()};r.forEach((function(e,i){var o,s=a[i],l=(null!==(o=null==n?void 0:n.delay)&&void 0!==o?o:0)+((null==n?void 0:n.individualDelay)?n.individualDelay(i,r.length,s,e):0);Ho(s,e,Object.assign({},n,{onEnd:u,delay:l}),t.globalTransMatrix)}))},Xo=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[0,1,i,r])).morphingData=t.morphingData,a.otherAttrs=t.otherAttrs,a}return c(n,t),u(n,[{key:"getEndProps",value:function(){return{}}},{key:"onBind",value:function(){this.addPathProxy()}},{key:"addPathProxy",value:function(){this.target.shadowRoot.forEachChildren((function(t){t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}},{key:"clearPathProxy",value:function(){this.target.shadowRoot.forEachChildren((function(t){t.pathProxy=null}))}},{key:"onEnd",value:function(){}},{key:"onUpdate",value:function(t,e,n){var i=this;this.target.shadowRoot.forEachChildren((function(t,n){var r;Go(i.morphingData[n],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(r=i.otherAttrs)||void 0===r?void 0:r[n])&&i.otherAttrs[n].length&&No(i.otherAttrs[n],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}])}(ha),Ko=function(t){var e={};return Object.keys(t).forEach((function(n){Ba(n)||(e[n]=t[n])})),e},qo=function(t,e,n){var i=Ko(t.attribute),r=t.attachShadow();if(e.length)r.setTheme(l({},e[0].type,i)),e.forEach((function(t){r.appendChild(t)}));else{var a=t.AABBBounds,o=a.width(),s=a.height();r.setTheme({rect:i}),new Array(n).fill(0).forEach((function(t){var n=Mi.graphicService.creator.rect({x:0,y:0,width:o,height:s});r.appendChild(n),e.push(n)}))}},Zo=function(t,e,n){for(var i=[],r=n?null:Ko(t.attribute),a=t.toCustomPath(),o=0;o<e;o++){var s={path:(new ei).fromCustomPath2D(a)};i.push(Mi.graphicService.creator.path(n?s:Object.assign({},r,s)))}return n&&qo(t,i,e),i},Jo=function(t,e,n){var i=[],r=n?null:Ko(t.attribute);if("rect"===t.type)po(t,e).forEach((function(t){i.push(Mi.graphicService.creator.rect(n?t:Object.assign({},r,t)))}));else if("arc"===t.type)go(t,e).forEach((function(t){i.push(Mi.graphicService.creator.arc(n?t:Object.assign({},r,t)))}));else if("circle"===t.type)yo(t,e).forEach((function(t){i.push(Mi.graphicService.creator.arc(n?t:Object.assign({},r,t)))}));else if("line"===t.type){var a=bo(t,e),o={size:10,symbolType:"circle"};a.forEach((function(t){i.push(Mi.graphicService.creator.symbol(n?Object.assign({},t,o):Object.assign({},r,t,o)))}))}else"polygon"===t.type?To(t,e).forEach((function(t){i.push(Mi.graphicService.creator.polygon(n?t:Object.assign({},r,t)))})):"area"===t.type?ko(t,e).forEach((function(t){i.push(Mi.graphicService.creator.polygon(n?t:Object.assign({},r,t)))})):"path"===t.type&&Co(t,e).forEach((function(t){"path"in t?i.push(Mi.graphicService.creator.path(n?t:Object.assign({},r,t))):i.push(Mi.graphicService.creator.polygon(n?t:Object.assign({},r,t)))}));return n&&qo(t,i,e),i},$o=function(e,n,i){var r,a,o,s=e.filter((function(t){return t.toCustomPath&&t.valid}));s.length||__DEV__&&console.error(e," is not validate"),n.valid&&n.toCustomPath||__DEV__&&console.error(n," is not validate");var u=("clone"===(null==i?void 0:i.splitPath)?Zo:null!==(r=null==i?void 0:i.splitPath)&&void 0!==r?r:Jo)(n,s.length,!0),l=n.attribute;n.setAttribute("visible",!1);var c=s.map((function(t,e){return zo(t.toCustomPath(),u[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:u[e].globalTransMatrix})})),h=s.map((function(t,e){return Wo(t.attribute,l)}));if(null==i?void 0:i.individualDelay){var d=i.onEnd,f=s.length,v=function(){0===--f&&(n.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),n.detachShadow(),d&&d())};u.forEach((function(t,n){var r,a,o,u=(null!==(r=i.delay)&&void 0!==r?r:0)+i.individualDelay(n,s.length,e[n],t),l=t.animate(Object.assign({},i,{onEnd:v}));l.wait(u),l.play(new Vo({morphingData:c[n],saveOnEnd:!0,otherAttrs:h[n]},null!==(a=i.duration)&&void 0!==a?a:ma.duration,null!==(o=i.easing)&&void 0!==o?o:ma.easing))}))}else{var p=null==i?void 0:i.onEnd,g=i?Object.assign({},i):{};g.onEnd=function(){n.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),n.detachShadow(),p&&p()};var y=n.animate(g);(null==i?void 0:i.delay)&&y.wait(i.delay),y.play(new Xo({morphingData:c,otherAttrs:h},null!==(a=null==i?void 0:i.duration)&&void 0!==a?a:ma.duration,null!==(o=null==i?void 0:i.easing)&&void 0!==o?o:ma.easing))}},Qo=function(){function t(){o(this,t)}return u(t,null,[{key:"GetImage",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?Mi.global.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&n.imageLoadSuccess(e,r.data):t.loadImage(e,n)}},{key:"GetSvg",value:function(e,n){var i,r=t.cache.get(e);r?"fail"===r.loadState?Mi.global.getRequestAnimationFrame()((function(){n.imageLoadFail(e)})):"init"===r.loadState||"loading"===r.loadState?null===(i=r.waitingMark)||void 0===i||i.push(n):n&&n.imageLoadSuccess(e,r.data):(r={type:"image",loadState:"init"},t.cache.set(e,r),r.dataPromise=Mi.global.loadSvg(e),r.dataPromise?(r.waitingMark=[n],r.dataPromise.then((function(t){var n;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(n=r.waitingMark)||void 0===n||n.map((function(n,i){(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,n.imageLoadSuccess(e,t.data)):(r.loadState="fail",n.imageLoadFail(e))}))}))):(r.loadState="fail",n.imageLoadFail(e)))}},{key:"GetFile",value:function(e,n){var i=t.cache.get(e);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((function(t){return t.data})):Promise.resolve(i.data):(i={type:n,loadState:"init"},t.cache.set(e,i),"arrayBuffer"===n?i.dataPromise=Mi.global.loadArrayBuffer(e):"blob"===n?i.dataPromise=Mi.global.loadBlob(e):"json"===n&&(i.dataPromise=Mi.global.loadJson(e)),i.dataPromise.then((function(t){return t.data})))}},{key:"loading",value:function(){var e=this;setTimeout((function(){if(!t.isLoading&&t.toLoadAueue.length){t.isLoading=!0;var n=t.toLoadAueue.splice(0,10),i=[];n.forEach((function(e){var n=e.url,r=e.marks,a={type:"image",loadState:"init"};if(t.cache.set(n,a),a.dataPromise=Mi.global.loadImage(n),a.dataPromise){a.waitingMark=r;var o=a.dataPromise.then((function(t){var e;a.loadState=(null==t?void 0:t.data)?"success":"fail",a.data=null==t?void 0:t.data,null===(e=a.waitingMark)||void 0===e||e.map((function(e,i){(null==t?void 0:t.data)?(a.loadState="success",a.data=t.data,e.imageLoadSuccess(n,t.data)):(a.loadState="fail",e.imageLoadFail(n))}))}));i.push(o)}else a.loadState="fail",r.forEach((function(t){return t.imageLoadFail(n)}))})),Promise.all(i).then((function(){t.isLoading=!1,e.onLoadSuccessCb.forEach((function(t){return t()})),t.loading()})).catch((function(n){console.error(n),t.isLoading=!1,e.onLoadSuccessCb.forEach((function(t){return t()})),t.loading()}))}}),0)}},{key:"loadImage",value:function(e,n){var i=ts(e,t.toLoadAueue);if(-1!==i)return t.toLoadAueue[i].marks.push(n),void t.loading();t.toLoadAueue.push({url:e,marks:[n]}),t.loading()}},{key:"improveImageLoading",value:function(e){var n=ts(e,t.toLoadAueue);if(-1!==n){var i=t.toLoadAueue.splice(n,1);t.toLoadAueue.unshift(i[0])}}},{key:"onLoadSuccess",value:function(t){this.onLoadSuccessCb.push(t)}}])}();function ts(t,e){for(var n=0;n<e.length;n++)if(e[n].url===t)return n;return-1}Qo.cache=new Map,Qo.isLoading=!1,Qo.toLoadAueue=[],Qo.onLoadSuccessCb=[];var es=new pe,ns=new de,is=["lineWidth","scaleX","scaleY","angle","anchor","visible"],rs=["x","y"],as=["scaleX","scaleY"],os=["angle"],ss=new ue,us={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1},ls=function(n){function i(){var n,r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,i),(n=e(this,i))._AABBBounds=new de,n._updateTag=t.UpdateTag.INIT,n.attribute=a,n.valid=n.isValid(),a.background?n.loadImage(null!==(r=a.background.background)&&void 0!==r?r:a.background,!0):a.shadowGraphic&&n.setShadowGraphic(a.shadowGraphic),n}return c(i,n),u(i,[{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,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attribute,a=r.dx,o=void 0===a?t.dx:a,s=r.dy,u=void 0===s?t.dy:s;if(i&&this.parent){var l=this.parent.attribute;ss.x=o+(null!==(e=l.scrollX)&&void 0!==e?e:0),ss.y=u+(null!==(n=l.scrollY)&&void 0!==n?n:0)}else ss.x=o,ss.y=u;return ss}},{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;Mi.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var e=this.doUpdateAABBBounds(t);return Mi.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(){var t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}},{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 pe),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}},{key:"shouldUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}},{key:"shouldSelfChangeUpdateAABBBounds",value:function(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}},{key:"shouldUpdateLocalMatrix",value:function(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}},{key:"isValid",value:function(){var t,e,n=this.attribute;return Number.isFinite((null!==(t=n.x)&&void 0!==t?t:0)+(null!==(e=n.y)&&void 0!==e?e:0))}},{key:"_validNumber",value:function(t){return null==t||Number.isFinite(t)}},{key:"shouldUpdateShape",value:function(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}},{key:"clearUpdateShapeTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}},{key:"containsPoint",value:function(e,n,i,r){if(!r)return!1;if(i===t.IContainPointMode.GLOBAL){var a=new ue(e,n);this.parent&&this.parent.globalTransMatrix.transformPoint(a,a),e=a.x,n=a.y}return r.containsPoint(this,{x:e,y:n})}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,n)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,n)}},{key:"_setAttributes",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=Object.keys(t),r=0;r<i.length;r++){var a=i[r];this.attribute[a]=t[a]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)}},{key:"setAttribute",value:function(t,e,n,i){var r,a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(l({},t,e),this.attribute,t,i);a?this._setAttributes(a,n,i):gt(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}},{key:"needUpdateTags",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:is,n=0;n<e.length;n++){var i=e[n];if(-1!==t.indexOf(i))return!0}return!1}},{key:"needUpdateTag",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:is,n=0;n<e.length;n++)if(t===e[n])return!0;return!1}},{key:"initAttributes",value:function(e){var n={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,n)||e,this.attribute=e,e.background?this.loadImage(e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic),this._updateTag=t.UpdateTag.INIT,this.valid=this.isValid(),this.onAttributeUpdate(n)}},{key:"translate",value:function(e,n){var i,r;if(0===e&&0===n)return this;var a={type:t.AttributeUpdateType.TRANSLATE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:n},this.attribute,rs,a);o&&(e=o.x,n=o.y,delete o.x,delete o.y,this._setAttributes(o));var s=this.attribute,u=s.postMatrix;return u?Mi.transformUtil.fromMatrix(u,u).translate(e,n):(s.x=(null!==(i=s.x)&&void 0!==i?i:ai.x)+e,s.y=(null!==(r=s.y)&&void 0!==r?r:ai.y)+n),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}},{key:"translateTo",value:function(e,n){var i=this.attribute;if(i.x===e&&i.y===n)return this;var r={type:t.AttributeUpdateType.TRANSLATE_TO},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:n},this.attribute,rs,r);return a?(this._setAttributes(a,!1,r),this):(i.x=e,i.y=n,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}},{key:"scale",value:function(e,n,i){var r,a;if(1===e&&1===n)return this;var o={type:t.AttributeUpdateType.SCALE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:n,scaleCenter:i},this.attribute,as,o);s&&(e=s.scaleX,n=s.scaleY,delete s.scaleX,delete s.scaleY,this._setAttributes(s));var u=this.attribute;if(i){var l=this.attribute.postMatrix;l||(l=new pe,u.postMatrix=l),Mi.transformUtil.fromMatrix(l,l).scale(e,n,i)}else u.scaleX=(null!==(r=u.scaleX)&&void 0!==r?r:ai.scaleX)*e,u.scaleY=(null!==(a=u.scaleY)&&void 0!==a?a:ai.scaleY)*n;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}},{key:"scaleTo",value:function(e,n){var i=this.attribute;if(i.scaleX===e&&i.scaleY===n)return this;var r={type:t.AttributeUpdateType.SCALE_TO},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:n},this.attribute,as,r);return a?(this._setAttributes(a,!1,r),this):(i.scaleX=e,i.scaleY=n,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}},{key:"rotate",value:function(e,n){var i;if(0===e)return this;var r={type:t.AttributeUpdateType.ROTATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:n},this.attribute,os,r);a&&(delete a.angle,this._setAttributes(a,!1,r));var o=this.attribute;if(n){var s=this.attribute.postMatrix;s||(s=new pe,o.postMatrix=s),Mi.transformUtil.fromMatrix(s,s).rotate(e,n)}else o.angle=(null!==(i=o.angle)&&void 0!==i?i:ai.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}},{key:"rotateTo",value:function(e){var n=this.attribute;if(n.angle===e)return this;var i={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,os,i);return r?(this._setAttributes(r,!1,i),this):(n.angle=e,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 n=new fa(null==t?void 0:t.id,this.stage&&this.stage.getTimeline()).bind(this);if(t){var i=t.onStart,r=t.onFrame,a=t.onEnd,o=t.onRemove;null!=i&&n.onStart(i),null!=r&&n.onFrame(r),null!=a&&n.onEnd(a),null!=o&&n.onRemove(o),n.interpolateFunc=t.interpolate}return this.animates.set(n.id,n),n.onRemove((function(){e.animates.delete(n.id)})),n}},{key:"onAttributeUpdate",value:function(t){t&&t.skipUpdateCallback||(Mi.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)&&(!!gt(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(e,n,i,r){var a,o,s,u,l=this;if(i){var c,h=Object.keys(e),d=this.getNoWorkAnimateAttr(),f={};h.forEach((function(t){d[t]?(c||(c={}),c[t]=e[t]):f[t]=r&&void 0===e[t]?l.getDefaultAttribute(t):e[t]}));var v=this.animate();v.stateNames=n,v.to(f,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.duration)&&void 0!==o?o:ya.duration,null!==(u=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==u?u:ya.easing),c&&this.setAttributes(c,!1,{type:t.AttributeUpdateType.STATE})}else this.stopStateAnimates(),this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}},{key:"updateNormalAttrs",value:function(t){var e=this,n={};this.normalAttrs?(Object.keys(t).forEach((function(t){t in e.normalAttrs?(n[t]=e.normalAttrs[t],delete e.normalAttrs[t]):n[t]=e.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((function(n){t[n]=e.normalAttrs[n]}))):Object.keys(t).forEach((function(t){n[t]=e.getNormalAttribute(t)})),this.normalAttrs=n}},{key:"stopStateAnimates",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((function(n){n.stateNames&&(n.stop(e),t.animates.delete(n.id))}))}},{key:"getNormalAttribute",value:function(t){var e=this.attribute[t];return this.animates&&this.animates.forEach((function(n){if(n.stateNames){var i=n.getEndProps();Bt(i,t)&&(e=i[t])}})),e}},{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 n=this.currentStates.filter((function(e){return e!==t}));this.useStates(n,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 n=this.currentStates?this.currentStates.slice():[];n.push(t),this.useStates(n,e)}}},{key:"addState",value:function(t,e,n){var i;if(!this.currentStates||!this.currentStates.includes(t)||!e&&1!==this.currentStates.length){var r=e&&(null===(i=this.currentStates)||void 0===i?void 0:i.length)?this.currentStates.concat([t]):[t];this.useStates(r,n)}}},{key:"useStates",value:function(t,e){var n,i=this;if(t.length){if((null===(n=this.currentStates)||void 0===n?void 0:n.length)!==t.length||t.some((function(t,e){return i.currentStates[e]!==t}))){var r={};t.forEach((function(e){var n,a=i.stateProxy?i.stateProxy(e,t):null===(n=i.states)||void 0===n?void 0:n[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|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"addUpdateShapeTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}},{key:"addUpdateShapeAndBoundsTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}},{key:"updateShapeAndBoundsTagSetted",value:function(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}},{key:"addUpdatePositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}},{key:"addUpdateGlobalPositionTag",value:function(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}},{key:"clearUpdateLocalPositionTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}},{key:"clearUpdateGlobalPositionTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}},{key:"addUpdateLayoutTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}},{key:"clearUpdateLayoutTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}},{key:"needUpdateLayout",value:function(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}},{key:"getAnchor",value:function(t,e){var n=this,i=[0,0],r=function(){if(e.b)return e.b;var t=n.attribute,i=t.scaleX,r=t.scaleY,a=t.angle;return ns.copy(n._AABBBounds),n.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=n.AABBBounds.clone(),n._AABBBounds.copy(ns),n.setAttributes({scaleX:i,scaleY:r,angle:a}),e.b};if("string"==typeof t[0]){var a=parseFloat(t[0])/100,o=r();i[0]=o.x1+(o.x2-o.x1)*a}else i[0]=t[0];if("string"==typeof t[1]){var s=parseFloat(t[1])/100,u=r();i[1]=u.y1+(u.y2-u.y1)*s}else i[1]=t[1];return i}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,n=void 0===e?ai.x:e,i=t.y,r=void 0===i?ai.y:i,a=t.scaleX,o=void 0===a?ai.scaleX:a,s=t.scaleY,u=void 0===s?ai.scaleY:s,l=t.angle,c=void 0===l?ai.angle:l,h=t.scaleCenter,d=t.anchor,f=t.postMatrix,v=[0,0],p={};if(d&&(v=this.getAnchor(d,p)),!h||1===o&&1===u)!function(t,e,n,i,r,a,o,s){var u,l,c=e.a,h=e.b,d=e.c,f=e.d,v=e.e,p=e.f,g=Jt(o),y=te(o);s?(u=s[0],l=s[1]):(u=n,l=i);var m=u-n,k=l-i,b=c*g+d*y,_=h*g+f*y,x=d*g-c*y,w=f*g-h*y;t.a=r*b,t.b=r*_,t.c=a*x,t.d=a*w,t.e=v+c*u+d*l-b*m-x*k,t.f=p+h*u+f*l-_*m-w*k}(this._transMatrix,this._transMatrix.reset(),n,r,o,u,c,d&&v);else{var g=this._transMatrix;g.reset(),g.translate(v[0],v[1]),g.rotate(c),g.translate(-v[0],-v[1]),g.translate(n,r),v=this.getAnchor(h,p),Mi.transformUtil.fromMatrix(g,g).scale(o,u,{x:v[0],y:v[1]})}var y=this.getOffsetXY(ai);if(this._transMatrix.e+=y.x,this._transMatrix.f+=y.y,f){var m=es.setValue(f.a,f.b,f.c,f.d,f.e,f.f),k=this._transMatrix;m.multiply(k.a,k.b,k.c,k.d,k.e,k.f),k.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,n=void 0===e?0:e,i=t.scrollY,r=void 0===i?0:i;this._globalTransMatrix.translate(n,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 n=t.getTimeline();this.animates.forEach((function(t){t.setTimeline(n)}))}this._onSetStage&&this._onSetStage(this,t,e),Mi.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(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}},{key:"onStep",value:function(e,n,i,r,a){var o={};if(i.customAnimate)i.customAnimate.update(a,r,o);else{var s=i.props,u=i.parsedProps,l=i.propKeys;this.stepInterpolate(e,n,o,i,r,a,s,void 0,u,l)}this.setAttributes(o,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:a,step:i,isFirstFrameOfStep:e.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}},{key:"stepInterpolate",value:function(t,e,n,i,r,a,o,s,u,l){var c=this;l||(l=Object.keys(o),i.propKeys=l),a?i.propKeys.forEach((function(t){e.validAttr(t)&&(n[t]=o[t])})):l.forEach((function(a){var l;if(e.validAttr(a)){var h=o[a],d=null!==(l=s&&s[a])&&void 0!==l?l:t.getLastPropByName(a,i);if(null!=h&&null!=d)e.interpolateFunc&&e.interpolateFunc(a,r,d,h,n)||(e.customInterpolate(a,r,d,h,c,n)||c.defaultInterpolate(h,d,a,n,u,r)||c._interpolate(a,r,d,h,n));else n[a]=h}})),i.parsedProps=u}},{key:"defaultInterpolate",value:function(t,e,n,i,r,a){if(Number.isFinite(t))return i[n]=e+(t-e)*a,!0;if("fill"===n){r||(r={});var o=r.fillColorArray,s=Bo(e,null!=o?o:t,a,!1,(function(t,e){r.fillColorArray=e}));return s&&(i[n]=s),!0}if("stroke"===n){r||(r={});var u=r.strokeColorArray,l=Bo(e,null!=u?u:t,a,!1,(function(t,e){r.strokeColorArray=e}));return l&&(i[n]=l),!0}if("shadowColor"===n){r||(r={});var c=r.shadowColorArray,h=Bo(e,null!=c?c:t,a,!0,(function(t,e){r.shadowColorArray=e}));return h&&(i[n]=h),!0}return!1}},{key:"_interpolate",value:function(t,e,n,i,r){}},{key:"getDefaultAttribute",value:function(t){return zr(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:Mi.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 xt(t,!0)?this.pathProxy=(new ei).fromString(t):this.pathProxy=new ei,this.pathProxy}},{key:"loadImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))){var n=t;this.resources||(this.resources=new Map);var i={data:"init",state:null};this.resources.set(n,i),"string"==typeof t?(i.state="loading",t.startsWith("<svg")?(Qo.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(Ct(t)||t.includes("/")||Et(t))&&(Qo.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):mt(t)?(i.state="success",i.data=t,this.backgroundImg=this.backgroundImg||e):i.state="fail"}}},{key:"setShadowGraphic",value:function(t){t?this.attachShadow().add(t):this.detachShadow()}},{key:"imageLoadSuccess",value:function(t,e,n){if(this.resources){var i=this.resources.get(t);i&&(i.state="success",i.data=e,n&&n(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}}},{key:"imageLoadFail",value:function(t,e){if(this.resources){var n=this.resources.get(t);n&&(n.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",Mi.graphicService.onRelease(this)}},{key:"_emitCustomEvent",value:function(t,e){var n,i;if(this._events&&t in this._events){var r=new qr(t,e);r.bubbles=!1,r.manager=null===(i=null===(n=this.stage)||void 0===n?void 0:n.eventSystem)||void 0===i?void 0:i.manager,this.dispatchEvent(r)}}}],[{key:"mixin",value:function(t){for(var e=Object.keys(t),n=0;n<e.length;++n){var r=e[n];Object.defineProperty(i.prototype,r,Object.getOwnPropertyDescriptor(t,r))}}}])}(Vr);ls.mixin(ta);var cs=function(){return u((function t(e){o(this,t),this.tagname=e,this.child=[],this[":@"]={}}),[{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))}}])}();function hs(t,e,n,i){var r=t.indexOf(e,n);if(-1===r)throw new Error(i);return r+e.length-1}function ds(t,e,n){var i=function(t,e){for(var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="",a=e;a<t.length;a++){var o=t[a];if(n)o===n&&(n="");else if('"'===o||"'"===o)n=o;else if(o===i[0]){if(!i[1])return{data:r,index:a};if(t[a+1]===i[1])return{data:r,index:a}}else"\t"===o&&(o=" ");r+=o}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(i){var r=i.data,a=i.index,o=r.search(/\s/),s=r,u=!0;-1!==o&&(s=r.substr(0,o).replace(/\s\s*$/,""),r=r.substr(o+1));var l=s;if(n){var c=s.indexOf(":");-1!==c&&(u=(s=s.substr(c+1))!==i.data.substr(c+1))}return{tagName:s,tagExp:r,closeIndex:a,attrExpPresent:u,rawTagName:l}}}var fs=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm"),vs=function(){return u((function t(e){o(this,t),this.currentNode=null,this.options=e,this.tagsNodeStack=[],this.docTypeEntities={}}),[{key:"addChild",value:function(t,e,n){var i=e.tagname;"string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e)}},{key:"buildAttributesMap",value:function(t,e,n){var i={};if(t){for(var r=function(t,e){for(var n=[],i=e.exec(t);i;){var r=[];r.startIndex=e.lastIndex-i[0].length;for(var a=i.length,o=0;o<a;o++)r.push(i[o]);n.push(r),i=e.exec(t)}return n}(t,fs),a=r.length,o=0;o<a;o++){var s=r[o][1],u=r[o][4];s&&(i[s]=void 0===u||(isNaN(u)?u:Number(u)))}return i}}},{key:"parseXml",value:function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new cs("!xml"),n=e,i="",r="",a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var o=hs(t,">",a,"Closing Tag is not closed."),s=r.lastIndexOf(".");r=r.substring(0,s),(n=this.tagsNodeStack.pop())&&n.child&&i&&n.child[n.child.length-1][":@"]&&(n.child[n.child.length-1][":@"].text=i),i="",a=o}else if("?"===t[a+1])a=ds(t,a,!1,"?>").closeIndex+1;else if("!--"===t.substr(a+1,3))a=hs(t,"--\x3e",a+4,"Comment is not closed.");else{var u=ds(t,a,!1),l=u.tagName,c=u.tagExp,h=u.attrExpPresent,d=u.closeIndex;if(l!==e.tagname&&(r+=r?"."+l:l),c.length>0&&c.lastIndexOf("/")===c.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),r=r.substr(0,r.length-1),c=l):c=c.substr(0,c.length-1);var f=new cs(l);l!==c&&h&&(f[":@"]=this.buildAttributesMap(c,r,l)),this.addChild(n,f,r),r=r.substr(0,r.lastIndexOf("."))}else{var v=new cs(l);this.tagsNodeStack.push(n),l!==c&&h&&(v[":@"]=this.buildAttributesMap(c,r,l)),this.addChild(n,v,r),n=v}i="",a=d}else i+=t[a];return e.child}}])}();function ps(t,e){return gs(t)}function gs(t,e){for(var n,i={},r=0;r<t.length;r++){var a=t[r],o=ys(a);if(void 0!==o&&a[o]){var s=gs(a[o]);n=s,Object.keys(n).length,a[":@"]&&ms(s,a[":@"]),void 0!==i[o]&&i.hasOwnProperty(o)?(Array.isArray(i[o])||(i[o]=[i[o]]),i[o].push(s)):i[o]=s}}return i}function ys(t){for(var e=Object.keys(t),n=0;n<e.length;n++){var i=e[n];if(":@"!==i)return i}}function ms(t,e,n){if(e)for(var i=Object.keys(e),r=i.length,a=0;a<r;a++){var o=i[a];t[o]=e[o]}}var ks=function(){return u((function t(e){o(this,t),this.options=Object.assign({},t.defaultOptions,e)}),[{key:"valid",value:function(t){return t.startsWith("<")}},{key:"parse",value:function(t){return!!this.valid&&ps(new vs(this.options).parseXml(t),this.options)}}])}();function bs(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function _s(t){return t.startsWith("<")}ks.defaultOptions={};var xs=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};function ws(t){return xs(this,void 0,void 0,i().mark((function e(){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],r=t.getChildren(),e.next=3,new Promise((function(t){Mi.global.getRequestAnimationFrame()((function(){t(null)}))}));case 3:return r.forEach((function(t){t.subLayers.size&&t.subLayers.forEach((function(t){t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&n.push(new Promise((function(e){t.drawContribution.hooks.completeDraw.tap("outWait",(function(){t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((function(t){return"outWait"!==t.name})),e(null)}))})))}))})),e.next=6,Promise.all(n);case 6:case"end":return e.stop()}}),e)})))}function Ss(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(i/2+(n?function(t,e){return t?e:0}(n,e):0))),t}var As,Ts=0;function Cs(){return Ts++}function Es(e){for(var n=[],i=0,r="",a=0;a<e.length;a++)Ms(e[a])?i?r+=e[a]:(i=1,r=e[a]):(i&&(n.push({text:r,direction:t.TextDirection.VERTICAL}),r="",i=0),n.push({text:e[a],direction:t.TextDirection.HORIZONTAL}));return r&&n.push({text:r,direction:t.TextDirection.VERTICAL}),n}t.TextDirection=void 0,(As=t.TextDirection||(t.TextDirection={}))[As.HORIZONTAL=0]="HORIZONTAL",As[As.VERTICAL=1]="VERTICAL";var Rs=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((function(t){return Rs.set(t,!0)}));var Bs=new Map;function Ms(t){if(Rs.has(t))return!0;if(Bs.has(t))return!1;var e=!1;return t.codePointAt(0)<256&&(e=!0),e}function Ps(t,e){var n=t.attribute;n&&n.split(";").forEach((function(t){if(t){var n=t.split(":");if(2===n.length){var i=parseFloat(n[1]);e[n[0].trim()]=isFinite(i)?i:n[1].trim()}else{for(var r="",a=1;a<n.length;a++)a>1&&(r+=":"),r+=n[a].trim();e[n[0].trim()]=r}}}))}[""].forEach((function(t){return Bs.set(t,!0)}));var Os,Is=Cs(),Ls=Cs(),Ds=Cs(),js=Cs(),Fs=Cs(),Ns=Cs(),Gs=Cs(),zs=Cs(),Us=Cs(),Ws=Cs(),Vs=Cs(),Hs=Cs(),Ys=Cs(),Xs=Cs(),Ks=Cs(),qs=Cs(),Zs=Symbol.for("GraphicService"),Js=Symbol.for("GraphicCreator"),$s={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},Qs=Object.keys($s),tu={"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"},eu=Object.keys(tu);t.GroupUpdateAABBBoundsMode=void 0,(Os=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[Os.LESS_GROUP=0]="LESS_GROUP",Os[Os.MORE_GROUP=1]="MORE_GROUP";var nu=function(n){function i(n){var r;return o(this,i),(r=e(this,i,[n])).type="group",r.parent=null,r.isContainer=!0,r.numberType=Ns,r._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS,r}return c(i,n),u(i,[{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 Nr),this.theme.setTheme(t,this)}},{key:"createTheme",value:function(){this.theme||(this.theme=new Nr)}},{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(e,n,i){if(i===t.IContainPointMode.GLOBAL){var r=new ue(e,n);return this.parent&&this.parent.globalTransMatrix.transformPoint(r,r),this.AABBBounds.contains(r.x,r.y)}return this.AABBBounds.contains(e,n)}},{key:"shouldUpdateAABBBounds",value:function(){return!!p(h(i.prototype),"shouldUpdateAABBBounds",this).call(this)||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}},{key:"tryUpdateAABBBounds",value:function(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Mi.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);var t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Mi.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}},{key:"doUpdateLocalMatrix",value:function(){var t=this.attribute,e=t.x,n=void 0===e?ai.x:e,r=t.y,a=void 0===r?ai.y:r,o=t.dx,s=void 0===o?ai.dx:o,u=t.dy,l=void 0===u?ai.dy:u,c=t.scaleX,d=void 0===c?ai.scaleX:c,f=t.scaleY,v=void 0===f?ai.scaleY:f,g=t.angle,y=void 0===g?ai.angle:g,m=t.postMatrix;if(0!==n||0!==a||0!==s||0!==l||1!==d||1!==v||0!==y||m)return p(h(i.prototype),"doUpdateLocalMatrix",this).call(this);this._transMatrix.reset()}},{key:"doUpdateAABBBounds",value:function(){var t=this.attribute,e=zr(this).group;this._AABBBounds.clear();var n=Mi.graphicService.updateGroupAABBBounds(t,e,this._AABBBounds,this),i=t.boundsPadding,r=void 0===i?e.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),n}},{key:"clearUpdateBoundTag",value:function(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"addUpdateBoundTag",value:function(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}},{key:"addChildUpdateBoundTag",value:function(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}},{key:"getTheme",value:function(){return this.theme.getTheme(this)}},{key:"incrementalAppendChild",value:function(t){var e=p(h(i.prototype),"appendChild",this).call(this,t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),Mi.graphicService.onAddIncremental(t,this,this.stage),e}},{key:"incrementalClearChild",value:function(){p(h(i.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag(),Mi.graphicService.onClearIncremental(this,this.stage)}},{key:"appendChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=p(h(i.prototype),"appendChild",this).call(this,t);return e&&this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"insertBefore",value:function(t,e){var n=p(h(i.prototype),"insertBefore",this).call(this,t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"insertAfter",value:function(t,e){var n=p(h(i.prototype),"insertAfter",this).call(this,t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"insertInto",value:function(t,e){var n=p(h(i.prototype),"insertInto",this).call(this,t,e);return this.stage&&n&&n.setStage(this.stage,this.layer),this.addUpdateBoundTag(),n}},{key:"removeChild",value:function(t){var e=p(h(i.prototype),"removeChild",this).call(this,t);return t.stage=null,Mi.graphicService.onRemove(t),this.addUpdateBoundTag(),e}},{key:"removeAllChild",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((function(e){Mi.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),p(h(i.prototype),"removeAllChild",this).call(this),this.addUpdateBoundTag()}},{key:"setStage",value:function(t,e){var n=this;this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),Mi.graphicService.onSetStage(this,t),this.forEachChildren((function(e){e.setStage(t,n.layer)})))}},{key:"addUpdatePositionTag",value:function(){p(h(i.prototype),"addUpdatePositionTag",this).call(this),this.forEachChildren((function(t){t.isContainer&&t.addUpdateGlobalPositionTag()}))}},{key:"addUpdateGlobalPositionTag",value:function(){p(h(i.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&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}},{key:"_getChildByName",value:function(t,e){return this.find((function(e){return e.name===t}),e)}},{key:"createOrUpdateChild",value:function(t,e,n){var i=this._getChildByName(t);return i?i.setAttributes(e):((i=Mi.graphicService.creator[n](e)).name=t,this.add(i)),i}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(ls);function iu(t){return new nu(t)}nu.NOWORK_ANIMATE_ATTR=us;var ru,au=function(t){function n(t,i,r,a){var s,u;return o(this,n),(s=e(this,n,[{}])).stage=t,s.global=i,s.window=r,s.main=a.main,s.layerHandler=a.layerHandler,s.layerHandler.init(f(s),r,{main:a.main,canvasId:a.canvasId,width:s.viewWidth,height:s.viewHeight,zIndex:null!==(u=a.zIndex)&&void 0!==u?u:0}),s.layer=f(s),s.subLayers=new Map,s.theme=new Nr,s.background="rgba(0, 0, 0, 0)",s.afterDrawCbs=[],s}return c(n,t),u(n,[{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],n=Array.from(this.subLayers.values()).sort((function(t,e){return t.zIndex-e.zIndex}));this.layerHandler.merge(n.map((function(t){return t.layer.subLayers.size&&t.layer.combineSubLayer(e),t.layer.getNativeHandler()}))),e&&n.forEach((function(t){t.group&&(t.group.incremental=0)})),n.forEach((function(e){Mi.layerService.releaseLayer(t.stage,e.layer)})),this.subLayers.clear()}},{key:"getNativeHandler",value:function(){return this.layerHandler}},{key:"setStage",value:function(t,e){p(h(n.prototype),"setStage",this).call(this,t,this)}},{key:"pick",value:function(t,e){throw new Error("暂不支持")}},{key:"tryRenderSecondaryLayer",value:function(t,e){var n=this;this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((function(i){i.layer.renderCount=n.renderCount,i.layer.render(t,e)}))}},{key:"render",value:function(t,e){var n,i=this;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(n=t.background)&&void 0!==n?n:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((function(t){return t(i)})),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:"release",value:function(){var t=this;p(h(n.prototype),"release",this).call(this),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((function(e){Mi.layerService.releaseLayer(t.stage,e.layer)}))}},{key:"drawTo",value:function(t,e){var n,i=this;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(n=e.background)&&void 0!==n?n:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((function(t){return t(i)}))}}])}(nu),ou=Symbol.for("TransformUtil"),su=Symbol.for("GraphicUtil"),uu=Symbol.for("LayerService"),lu=Symbol.for("StaticLayerHandlerContribution"),cu=Symbol.for("DynamicLayerHandlerContribution"),hu=Symbol.for("VirtualLayerHandlerContribution"),du=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},fu=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.DefaultLayerService=ru=function(){return u((function t(){o(this,t),this.layerMap=new Map,this.global=Mi.global}),[{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?Hi.get(lu):"dynamic"===t?Hi.get(cu):Hi.get(hu)}},{key:"createLayer",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};this.tryInit();var i=this.getRecommendedLayerType(n.layerMode);i=n.main||n.canvasId?"static":i;var r=this.getLayerHandler(i),a=new au(t,this.global,t.window,Object.assign(Object.assign({main:!1},n),{layerMode:i,canvasId:null!==(e=n.canvasId)&&void 0!==e?e:ru.GenerateLayerId(),layerHandler:r})),o=this.layerMap.get(t)||[];return o.push(a),this.layerMap.set(t,o),this.staticLayerCountInEnv--,a}},{key:"prepareStageLayer",value:function(t){var e;t.forEachChildren((function(t){var n=t.getNativeHandler();"virtual"===n.type?(n.mainHandler=e,e.secondaryHandlers.push(n)):(e=n).secondaryHandlers=[]}))}},{key:"releaseLayer",value:function(t,e){e.release();var n=this.layerMap.get(t)||[];this.layerMap.set(t,n.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:"releaseStage",value:function(t){this.layerMap.delete(t)}}],[{key:"GenerateLayerId",value:function(){return"".concat(ru.idprefix,"_").concat(ru.prefix_count++)}}])}(),t.DefaultLayerService.idprefix="visactor_layer",t.DefaultLayerService.prefix_count=0,t.DefaultLayerService=ru=du([L(),fu("design:paramtypes",[])],t.DefaultLayerService);var vu=new x((function(e){e(ot).to(t.DefaultGlobal).inSingletonScope(),e(Cr).to(t.DefaultWindow),e(su).to(t.DefaultGraphicUtil).inSingletonScope(),e(ou).to(t.DefaultTransformUtil).inSingletonScope(),e(uu).to(t.DefaultLayerService).inSingletonScope()}));function pu(t,e){return!(!t&&!e)}function gu(t,e){return(wt(t)?t.some((function(t){return t||void 0===t})):!!t)&&e>0}function yu(t,e,n){return n&&t*e>0}function mu(t,e,n,i,r){return r&&t*e>0&&0!==n&&0!==i}function ku(t,e){return t*e>0}function bu(t,e,n,i){return t*e>0&&0!==n&&0!==i}function _u(t,e,n,i,r,a,o,s){if(!t.pathProxy)return!1;var u=zr(t,null==a?void 0:a.theme)[t.type.replace("3d","")],l=t.attribute,c=l.fill,h=void 0===c?u.fill:c,d=l.stroke,f=void 0===d?u.stroke:d,v=l.opacity,p=void 0===v?u.opacity:v,g=l.fillOpacity,y=void 0===g?u.fillOpacity:g,m=l.lineWidth,k=void 0===m?u.lineWidth:m,b=l.strokeOpacity,_=void 0===b?u.strokeOpacity:b,x=l.visible,w=void 0===x?u.visible:x,S=l.x,A=void 0===S?u.x:S,T=l.y,C=void 0===T?u.y:T,E=yu(p,y,h),R=ku(p,_),B=pu(h),M=gu(f,k);return!w||(!B&&!M||(!(E||R||o||s)||(e.beginPath(),cn(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,n,i),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),M&&(s?s(e,t.attribute,u):R&&(e.setStrokeStyle(t,t.attribute,n-A,i-C,u),e.stroke())),B&&(o?o(e,t.attribute,u):E&&(e.setCommonStyle(t,t.attribute,n-A,i-C,u),e.fill())),!0)))}function xu(t,e,n,i,r,a,o,s){var u=n-t,l=i-e,c=o-r,h=s-a,d=h*u-c*l;return d*d<Vt?[]:[t+(d=(c*(e-a)-h*(t-r))/d)*u,e+d*l]}function wu(t,e,n,i,r,a,o){var s=t-n,u=e-i,l=(o?a:-a)/Math.sqrt(s*s+u*u),c=l*u,h=-l*s,d=t+c,f=e+h,v=n+c,p=i+h,g=(d+v)/2,y=(f+p)/2,m=v-d,k=p-f,b=m*m+k*k,_=r-a,x=d*p-v*f,w=(k<0?-1:1)*Math.sqrt(Math.max(0,_*_*b-x*x)),S=(x*k-m*w)/b,A=(-x*m-k*w)/b,T=(x*k+m*w)/b,C=(-x*m+k*w)/b,E=S-g,R=A-y,B=T-g,M=C-y;return E*E+R*R>B*B+M*M&&(S=T,A=C),{cx:S,cy:A,x01:-c,y01:-h,x11:S*(r/_-1),y11:A*(r/_-1)}}function Su(t,e,n,i,r,a,o){var s=t.getParsedAngle(),u=s.startAngle,l=s.endAngle,c=qt(l-u),h=l>u,d=!1;if(r<a){var f=r;r=a,a=f}if(r<=Vt)e.moveTo(n,i);else if(c>=Kt-Vt)e.moveTo(n+r*Jt(u),i+r*te(u)),e.arc(n,i,r,u,l,!h),a>Vt&&(e.moveTo(n+a*Jt(l),i+a*te(l)),e.arc(n,i,a,l,u,h));else{var v,p,g,y,m=t.getParsedCornerRadius(),k=wt(m),b=t.getParsePadAngle(u,l),_=b.outerDeltaAngle,x=b.innerDeltaAngle,w=b.outerStartAngle,S=b.outerEndAngle,A=b.innerEndAngle,T=b.innerStartAngle,C=k?m[0]:m,E=k?m[1]:m,R=k?m[2]:m,B=k?m[3]:m,M=Math.max(E,C),P=Math.max(R,B),O=M,I=P,L=r*Jt(w),D=r*te(w),j=a*Jt(A),F=a*te(A);if((P>Vt||M>Vt)&&(v=r*Jt(S),p=r*te(S),g=a*Jt(T),y=a*te(T),c<Ht)){var N=xu(L,D,g,y,v,p,j,F);if(N){var G=L-N[0],z=D-N[1],U=v-N[0],W=p-N[1],V=1/te(ie((G*U+z*W)/(ee(G*G+z*z)*ee(U*U+W*W)))/2),H=ee(N[0]*N[0]+N[1]*N[1]);I=Qt(P,(a-H)/(V-1)),O=Qt(M,(r-H)/(V+1))}}if(_<.001)o&&(o[3]||o[1])&&e.moveTo(n+L,i+D),d=!0;else if(O>Vt){var Y=Qt(C,O),X=Qt(E,O),K=wu(g,y,L,D,r,Y,Number(h)),q=wu(v,p,j,F,r,X,Number(h));O<M&&Y===X?!o||o[0]?(e.moveTo(n+K.cx+K.x01,i+K.cy+K.y01),e.arc(n+K.cx,i+K.cy,O,Zt(K.y01,K.x01),Zt(q.y01,q.x01),!h)):e.moveTo(n+K.cx+O*Jt(Zt(q.y01,q.x01)),i+K.cy+O*te(Zt(q.y01,q.x01))):!o||o[0]?(e.moveTo(n+K.cx+K.x01,i+K.cy+K.y01),Y>0&&e.arc(n+K.cx,i+K.cy,Y,Zt(K.y01,K.x01),Zt(K.y11,K.x11),!h),e.arc(n,i,r,Zt(K.cy+K.y11,K.cx+K.x11),Zt(q.cy+q.y11,q.cx+q.x11),!h),X>0&&e.arc(n+q.cx,i+q.cy,X,Zt(q.y11,q.x11),Zt(q.y01,q.x01),!h)):X>0?e.moveTo(n+q.cx+X*Jt(Zt(q.y01,q.x01)),i+q.cy+X*te(Zt(q.y01,q.x01))):e.moveTo(n+v,i+r*te(S))}else!o||o[0]?(e.moveTo(n+L,i+D),e.arc(n,i,r,w,S,!h)):e.moveTo(n+r*Jt(S),i+r*te(S));if(!(a>Vt)||x<.001)!o||o[1]?e.lineTo(n+j,i+F):e.moveTo(n+j,i+F),d=!0;else if(I>Vt){var Z=Qt(B,I),J=Qt(R,I),$=wu(j,F,v,p,a,-J,Number(h)),Q=wu(L,D,g,y,a,-Z,Number(h));if(!o||o[1]?e.lineTo(n+$.cx+$.x01,i+$.cy+$.y01):e.moveTo(n+$.cx+$.x01,i+$.cy+$.y01),I<P&&Z===J){var tt=Zt(Q.y01,Q.x01);!o||o[2]?e.arc(n+$.cx,i+$.cy,I,Zt($.y01,$.x01),tt,!h):e.moveTo(n+$.cx+Jt(tt),i+$.cy+te(tt))}else!o||o[2]?(J>0&&e.arc(n+$.cx,i+$.cy,J,Zt($.y01,$.x01),Zt($.y11,$.x11),!h),e.arc(n,i,a,Zt($.cy+$.y11,$.cx+$.x11),Zt(Q.cy+Q.y11,Q.cx+Q.x11),h),Z>0&&e.arc(n+Q.cx,i+Q.cy,Z,Zt(Q.y11,Q.x11),Zt(Q.y01,Q.x01),!h)):Z>0?e.moveTo(n+Q.cx+Z*Jt(Zt(Q.y01,Q.x01)),i+Q.cy+Z*te(Zt(Q.y01,Q.x01))):e.moveTo(n+g,i+y)}else!o||o[1]?e.lineTo(n+j,i+F):e.moveTo(n+j,i+F),!o||o[2]?e.arc(n,i,a,A,T,h):e.moveTo(n+a*Jt(T),i+a*te(T))}return o?o[3]&&e.lineTo(n+r*Jt(u),i+r*te(u)):e.closePath(),d}var Au=function(){function t(){o(this,t)}return u(t,null,[{key:"GetCanvas",value:function(){try{return t.canvas||(t.canvas=Mi.global.createCanvas({})),t.canvas}catch(t){return null}}},{key:"GetCtx",value:function(){if(!t.ctx){var e=t.GetCanvas();t.ctx=e.getContext("2d")}return t.ctx}}])}(),Tu=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;o(this,n),(t=e(this,n)).cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},t.dataMap=new Map;var a=Au.GetCanvas(),s=Au.GetCtx();if(a.width=r,a.height=1,!s)return v(t);if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");var u=s.createLinearGradient(0,0,r,0);return i.forEach((function(t){u.addColorStop(t[0],t[1])})),s.fillStyle=u,s.fillRect(0,0,r,1),t.rgbaSet=s.getImageData(0,0,r,1).data,t}return c(n,t),u(n,[{key:"getColor",value:function(t){var e=this.rgbaSet.slice(4*t,4*t+4);return"rgba(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3]/255,")")}},{key:"GetOrCreate",value:function(t,e,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,s="".concat(t).concat(e).concat(i).concat(r);a.forEach((function(t){return s+=t.join()})),s+=o;var u=this.dataMap.get(s);return u||(u={data:new n(a,o),timestamp:[]},this.addLimitedTimestamp(u,Date.now(),{}),this.dataMap.set(s,u)),this.clearCache(this.dataMap,this.cacheParams),u.data}}],[{key:"getInstance",value:function(){return n._instance||(n._instance=new n),n._instance}}])}(ge),Cu=function(){function t(){o(this,t)}return u(t,null,[{key:"GetSize",value:function(e){for(var n=0;n<t.ImageSize.length;n++)if(t.ImageSize[n]>=e)return t.ImageSize[n];return e}},{key:"Get",value:function(e,n,i,r,a,o,s){var u=t.GenKey(e,n,i,r,a),l=t.cache[u];if(!l||0===l.length)return null;for(var c=0;c<l.length;c++)if(l[c].width>=o&&l[c].height>=s)return l[c].pattern;return null}},{key:"Set",value:function(e,n,i,r,a,o,s,u){var l=t.GenKey(e,n,i,r,a);t.cache[l]?t.cache[l].push({width:s,height:u,pattern:o}):t.cache[l]=[{width:s,height:u,pattern:o}]}},{key:"GenKey",value:function(t,e,n,i,r){return"".concat(e,",").concat(n,",").concat(i,",").concat(r,",").concat(t.join())}}])}();function Eu(t,e,n,i){for(var r=i.stops,a=i.startAngle,o=i.endAngle;n<0;)n+=Kt;for(;n>Kt;)n-=Kt;if(n<a)return r[0].color;if(n>o)return r[0].color;for(var s,u,l=(n-a)/(o-a),c=0;c<r.length;c++)if(r[c].offset>=l){s=r[c-1],u=r[c];break}return l=(l-s.offset)/(u.offset-s.offset),Bo(s.color,u.color,l,!1)}function Ru(t,e,n,i,r,a,o,s,u){var l=Math.floor(180*r/Math.PI),c=Au.GetCanvas(),h=Au.GetCtx();if(!h)return null;var d=Cu.GetSize(s),f=Cu.GetSize(u),v=Cu.Get(e,n,i,a,o,d,f);if(v)return v;var p=Math.sqrt(Math.max(Math.max(Math.pow(n,2)+Math.pow(i,2),Math.pow(d-n,2)+Math.pow(i,2)),Math.max(Math.pow(d-n,2)+Math.pow(f-i,2),Math.pow(n,2)+Math.pow(f-i,2)))),g=l+1,y=r/Math.max(1,g-1),m=Tu.getInstance().GetOrCreate(n,i,d,f,e,g),k=2*Math.PI*p/360;c.width=d,c.height=f,h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,d,f),h.translate(n,i),h.rotate(a);for(var b=0,_=g-1;b<_&&!(a+b*y>o);b++){var x=m.getColor(b);h.beginPath(),h.rotate(y),h.moveTo(0,0),h.lineTo(p,-2*k),h.lineTo(p,0),h.fillStyle=x,h.closePath(),h.fill()}var w=h.getImageData(0,0,d,f);return c.width=w.width,c.height=w.height,h.putImageData(w,0,0),(v=t.createPattern(c,"no-repeat"))&&Cu.Set(e,n,i,a,o,v,d,f),v}Cu.cache={},Cu.ImageSize=[20,40,80,160,320,640,1280,2560];var Bu=Symbol.for("ArcRenderContribution"),Mu=Symbol.for("AreaRenderContribution"),Pu=Symbol.for("CircleRenderContribution"),Ou=Symbol.for("GroupRenderContribution"),Iu=Symbol.for("ImageRenderContribution"),Lu=Symbol.for("PathRenderContribution"),Du=Symbol.for("PolygonRenderContribution"),ju=Symbol.for("RectRenderContribution"),Fu=Symbol.for("SymbolRenderContribution"),Nu=Symbol.for("TextRenderContribution"),Gu=Symbol.for("CommonRenderContribution"),zu=Symbol.for("InteractiveSubRenderContribution"),Uu=["radius","startAngle","endAngle"].concat(y(is)),Wu=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1};return o(this,n),(t=e(this,n,[i])).type="circle",t.numberType=js,t}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.radius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)}},{key:"doUpdateAABBBounds",value:function(t){var e=zr(this).circle;this._AABBBounds.clear();var n=this.attribute,i=Mi.graphicService.updateCircleAABBBounds(n,zr(this).circle,this._AABBBounds,t,this),r=n.boundsPadding,a=void 0===r?e.boundsPadding:r,o=xa(a);return o&&i.expand(o),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return zr(this).circle[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Uu)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Uu)}},{key:"toCustomPath",value:function(){var t,e,n,i=this.attribute,r=null!==(t=i.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),a=null!==(e=i.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),o=null!==(n=i.endAngle)&&void 0!==n?n:this.getDefaultAttribute("endAngle"),s=new ei;return s.arc(0,0,r,a,o),s}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function Vu(t){return new Wu(t)}function Hu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;n||(n=1);var i=t.fontStyle,r=void 0===i?e.fontStyle:i,a=t.fontVariant,o=void 0===a?e.fontVariant:a,s=t.fontWeight,u=void 0===s?e.fontWeight:s,l=t.fontSize,c=void 0===l?e.fontSize:l,h=t.fontFamily;return(r?r+" ":"")+(o?o+" ":"")+(u?u+" ":"")+c*n+"px "+((void 0===h?e.fontFamily:h)||"sans-serif")}function Yu(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0}function Xu(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Ku(t,e,n){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(n||(n=e),-(e-n)/2-.79*n)}function qu(t){var e={},n=function(t){return/^\d+(\.\d+)?$/.test("".concat(t))?"".concat(t,"px"):"".concat(t)};return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((function(n){t[n]&&(e[Ze(n)]=t[n])})),["fontSize","lineHeight"].forEach((function(i){var r=Ze(i);gt(t[i])||(e[r]=n(t[i]))})),yt(t.maxLineWidth)&&(e["max-width"]=n(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&xt(t.fill)&&(e.color=t.fill),e}Wu.NOWORK_ANIMATE_ATTR=us;var Zu=function(){return u((function t(e,n,i){o(this,t),this.fontFamily=e,this.textOptions=n,this.textMeasure=i}),[{key:"LayoutBBox",value:function(t,e,n){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===n?0:"middle"===n?t.height/-2:"alphabetic"===n?-.79*t.height:-t.height,t}},{key:"GetLayout",value:function(t,e,n,i,r,a,o,s,u){for(var l=[],c=[e,n],h=[0,0];t.length>0;){var d=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,o,s,u).str;l.push({str:d,width:this.textMeasure.measureTextWidth(d,this.textOptions)}),t=t.substring(d.length)}"left"===i||"start"===i||("center"===i?h[0]=c[0]/-2:"right"!==i&&"end"!==i||(h[0]=-c[0])),"top"===r||("middle"===r?h[1]=c[1]/-2:"bottom"===r&&(h[1]=-c[1]));var f={xOffset:h[0],yOffset:h[1],width:c[0],height:c[1]};return this.layoutWithBBox(f,l,i,r,a)}},{key:"GetLayoutByLines",value:function(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((function(t){return t.toString()}));var u=[],l=[0,0];if("number"==typeof o&&o!==1/0){for(var c,h=0,d=t.length;h<d;h++)c=Math.min(this.textMeasure.measureTextWidth(t[h],this.textOptions),o),u.push({str:this.textMeasure.clipTextWithSuffix(t[h],this.textOptions,c,r,a,s).str,width:c});l[0]=o}else{var f,v;o=0;for(var p=0,g=t.length;p<g;p++)v=t[p],f=this.textMeasure.measureTextWidth(v,this.textOptions),o=Math.max(o,f),u.push({str:v,width:f});l[0]=o}l[1]=u.length*i,l[0]=u.reduce((function(t,e){return Math.max(t,e.width)}),0);var y={xOffset:0,yOffset:0,width:l[0],height:l[1]};return this.LayoutBBox(y,e,n),this.layoutWithBBox(y,u,e,n,i)}},{key:"layoutWithBBox",value:function(t,e,n,i,r){var a=[0,0],o=e.length*r;"top"===i||("middle"===i?a[1]=(t.height-o)/2:"bottom"===i&&(a[1]=t.height-o));for(var s=0;s<e.length;s++)this.lineOffset(t,e[s],n,i,r,a);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:n,textBaseline:i}}},{key:"lineOffset",value:function(t,e,n,i,r,a){return"left"===n||"start"===n?e.leftOffset=0:"center"===n?e.leftOffset=(t.width-e.width)/2:"right"!==n&&"end"!==n||(e.leftOffset=t.width-e.width),e.topOffset=(r-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+a[1],a[1]+=r,e}}])}(),Ju=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp"].concat(y(is)),$u=function(n){function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16};return o(this,i),(t=e(this,i,[n])).type="text",t.numberType=qs,t.cache={},t}return c(i,n),u(i,[{key:"font",get:function(){var t=zr(this).text;return this._font||(this._font=Hu(this.attribute,t)),this._font}},{key:"clipedText",get:function(){var t,e=this.attribute,n=zr(this).text;if(this.isSimplify()){var i=e.maxLineWidth,r=void 0===i?n.maxLineWidth:i;return Number.isFinite(r)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:n.text).toString()}}},{key:"clipedWidth",get:function(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}},{key:"cliped",get:function(){var t=zr(this).text,e=this.attribute;if(!this.isMultiLine){var n=e.maxLineWidth,i=void 0===n?t.maxLineWidth:n;return!!Number.isFinite(i)&&(this.tryUpdateAABBBounds(),"vertical"===e.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((function(t){return t.text})).join("")!==e.text.toString():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 p(h(i.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.text;return wt(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"doUpdateAABBBounds",value:function(){var t=zr(this).text;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updateTextAABBBounds(e,t,this._AABBBounds,this),i=this.attribute.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"updateWrapAABBBounds",value:function(t){var e,n,i,r,a=zr(this).text,o=this.attribute,s=o.fontFamily,u=void 0===s?a.fontFamily:s,l=o.textAlign,c=void 0===l?a.textAlign:l,h=o.textBaseline,d=void 0===h?a.textBaseline:h,f=o.fontSize,v=void 0===f?a.fontSize:f,p=o.ellipsis,g=void 0===p?a.ellipsis:p,y=o.maxLineWidth,m=o.stroke,k=void 0===m?a.stroke:m,b=o.lineWidth,_=void 0===b?a.lineWidth:b,x=o.wordBreak,w=void 0===x?a.wordBreak:x,S=o.fontWeight,A=void 0===S?a.fontWeight:S,T=o.ignoreBuf,C=void 0===T?a.ignoreBuf:T,E=o.suffixPosition,R=void 0===E?a.suffixPosition:E,B=o.heightLimit,M=void 0===B?0:B,P=o.lineClamp,O=null!==(e=La(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,I=C?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var L=this.cache.layoutData.bbox;return this._AABBBounds.set(L.xOffset,L.yOffset,L.xOffset+L.width,L.yOffset+L.height),k&&this._AABBBounds.expand(_/2),this._AABBBounds}var D=Mi.graphicUtil.textMeasure,j=new Zu(u,{fontSize:v,fontWeight:A,fontFamily:u},D),F=wt(t)?t.map((function(t){return t.toString()})):[t.toString()],N=[],G=[0,0],z=1/0;if(M>0&&(z=Math.max(Math.floor(M/O),1)),P&&(z=Math.min(z,P)),"number"==typeof y&&y!==1/0){if(y>0)for(var U=0;U<F.length;U++){var W=F[U],V=!0;if(U===z-1){var H=j.textMeasure.clipTextWithSuffix(W,j.textOptions,y,g,!1,R,U!==F.length-1);N.push({str:H.str,width:H.width});break}var Y=j.textMeasure.clipText(W,j.textOptions,y,"break-word"===w);if(""!==W&&""===Y.str){if(g){var X=j.textMeasure.clipTextWithSuffix(W,j.textOptions,y,g,!1,R);Y.str=null!==(i=X.str)&&void 0!==i?i:"",Y.width=null!==(r=X.width)&&void 0!==r?r:0}else Y.str="",Y.width=0;V=!1}if(N.push({str:Y.str,width:Y.width}),Y.str.length===W.length);else if(V){var K=W.substring(Y.str.length);F.splice(U+1,0,K)}}var q=0;N.forEach((function(t){q=Math.max(q,t.width)})),G[0]=q}else{for(var Z,J,$=0,Q=0,tt=F.length;Q<tt;Q++){if(Q===z-1){var et=j.textMeasure.clipTextWithSuffix(F[Q],j.textOptions,y,g,!1,R);N.push({str:et.str,width:et.width}),$=Math.max($,et.width);break}J=F[Q],Z=j.textMeasure.measureTextWidth(J,j.textOptions,"break-word"===w),$=Math.max($,Z),N.push({str:J,width:Z})}G[0]=$}G[1]=N.length*(O+I);var nt={xOffset:0,yOffset:0,width:G[0],height:G[1]};j.LayoutBBox(nt,c,d);var it=j.layoutWithBBox(nt,N,c,d,O);return this.cache.layoutData=it,this.clearUpdateShapeTag(),this._AABBBounds.set(nt.xOffset,nt.yOffset,nt.xOffset+nt.width,nt.yOffset+nt.height),k&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"updateSingallineAABBBounds",value:function(t){var e=zr(this).text,n=this.attribute,i=n.direction,r=void 0===i?e.direction:i,a=n.underlineOffset,o=void 0===a?e.underlineOffset:a,s="horizontal"===r?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===r&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),s}},{key:"updateMultilineAABBBounds",value:function(t){var e=zr(this).text,n=this.attribute,i=n.direction,r=void 0===i?e.direction:i,a=n.underlineOffset,o=void 0===a?e.underlineOffset:a,s="horizontal"===r?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===r&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),s}},{key:"updateHorizontalSinglelineAABBBounds",value:function(t){var e,n,i=zr(this).text,r=this.attribute.wrap;if(void 0===r?i.wrap:r)return this.updateWrapAABBBounds([t]);var a,o,s=Mi.graphicUtil.textMeasure,u=this.attribute,l=u.maxLineWidth,c=void 0===l?i.maxLineWidth:l,h=u.ellipsis,d=void 0===h?i.ellipsis:h,f=u.textAlign,v=void 0===f?i.textAlign:f,p=u.textBaseline,g=void 0===p?i.textBaseline:p,y=u.fontFamily,m=void 0===y?i.fontFamily:y,k=u.fontSize,b=void 0===k?i.fontSize:k,_=u.fontWeight,x=void 0===_?i.fontWeight:_,w=u.stroke,S=void 0===w?i.stroke:w,A=u.lineWidth,T=void 0===A?i.lineWidth:A,C=u.ignoreBuf,E=void 0===C?i.ignoreBuf:C,R=u.whiteSpace,B=void 0===R?i.whiteSpace:R,M=u.suffixPosition,P=void 0===M?i.suffixPosition:M;if("normal"===B)return this.updateWrapAABBBounds(t);var O=E?0:Math.max(2,.075*b),I=u.fontSize||i.fontSize,L=null!==(e=La(u.lineHeight,I))&&void 0!==e?e:I+O;if(!this.shouldUpdateShape()&&this.cache){var D=Xu(v,a=null!==(n=this.cache.clipedWidth)&&void 0!==n?n:0),j=Ku(g,L,b);return this._AABBBounds.set(D,j,D+a,j+L),S&&this._AABBBounds.expand(T/2),this._AABBBounds}if(Number.isFinite(c)){if(d){var F=!0===d?i.ellipsis:d,N=s.clipTextWithSuffix(t.toString(),{fontSize:b,fontWeight:x,fontFamily:m},c,F,!1,P);o=N.str,a=N.width}else{var G=s.clipText(t.toString(),{fontSize:b,fontWeight:x,fontFamily:m},c,!1);o=G.str,a=G.width}this.cache.clipedText=o,this.cache.clipedWidth=a}else a=s.measureTextWidth(t.toString(),{fontSize:b,fontWeight:x,fontFamily:m}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=a;this.clearUpdateShapeTag();var z=Xu(v,a),U=L;Mi.global&&Mi.global.isSafari()&&(U+=.2*b);var W=Ku(g,U,b,O);return this._AABBBounds.set(z,W,z+a,W+U),S&&this._AABBBounds.expand(T/2),this._AABBBounds}},{key:"getBaselineMapAlign",value:function(){return i.baselineMapAlign}},{key:"getAlignMapBaseline",value:function(){return i.alignMapBaseline}},{key:"updateVerticalSinglelineAABBBounds",value:function(e){var n,r,a,o,s=zr(this).text,u=Mi.graphicUtil.textMeasure,l=this.attribute,c=l.ignoreBuf,h=(void 0===c?s.ignoreBuf:c)?0:2,d=l.maxLineWidth,f=void 0===d?s.maxLineWidth:d,v=l.ellipsis,p=void 0===v?s.ellipsis:v,g=l.fontSize,y=void 0===g?s.fontSize:g,m=l.fontWeight,k=void 0===m?s.fontWeight:m,b=l.fontFamily,_=void 0===b?s.fontFamily:b,x=l.stroke,w=void 0===x?s.stroke:x,S=l.lineWidth,A=void 0===S?s.lineWidth:S,T=l.verticalMode,C=void 0===T?s.verticalMode:T,E=l.suffixPosition,R=void 0===E?s.suffixPosition:E,B=null!==(n=La(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==n?n:(l.fontSize||s.fontSize)+h,M=l.textAlign,P=void 0===M?s.textAlign:M,O=l.textBaseline,I=void 0===O?s.textBaseline:O;if(!C){var L=P;P=null!==(r=i.baselineMapAlign[I])&&void 0!==r?r:"left",I=null!==(a=i.alignMapBaseline[L])&&void 0!==a?a:"top"}if(!this.shouldUpdateShape()&&this.cache){var D=Xu(P,o=this.cache.clipedWidth),j=Ku(I,B,y);return this._AABBBounds.set(j,D,j+B,D+o),w&&this._AABBBounds.expand(A/2),this._AABBBounds}var F=[Es(e.toString())];if(Number.isFinite(f)){if(p){var N=!0===p?s.ellipsis:p,G=u.clipTextWithSuffixVertical(F[0],{fontSize:y,fontWeight:k,fontFamily:_},f,N,!1,R);F=[G.verticalList],o=G.width}else{var z=u.clipTextVertical(F[0],{fontSize:y,fontWeight:k,fontFamily:_},f,!1);F=[z.verticalList],o=z.width}this.cache.verticalList=F,this.cache.clipedWidth=o}else o=0,F[0].forEach((function(e){var n=e.direction===t.TextDirection.HORIZONTAL?y:u.measureTextWidth(e.text,{fontSize:y,fontWeight:k,fontFamily:_});o+=n,e.width=n})),this.cache.verticalList=F,this.cache.clipedWidth=o;this.clearUpdateShapeTag();var U=Xu(P,o),W=Ku(I,B,y);return this._AABBBounds.set(W,U,W+B,U+o),w&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"updateHorizontalMultilineAABBBounds",value:function(t){var e,n,i=zr(this).text,r=this.attribute.wrap;if(void 0===r?i.wrap:r)return this.updateWrapAABBBounds(t);var a=this.attribute,o=a.fontFamily,s=void 0===o?i.fontFamily:o,u=a.textAlign,l=void 0===u?i.textAlign:u,c=a.textBaseline,h=void 0===c?i.textBaseline:c,d=a.fontSize,f=void 0===d?i.fontSize:d,v=a.fontWeight,p=void 0===v?i.fontWeight:v,g=a.ellipsis,y=void 0===g?i.ellipsis:g,m=a.maxLineWidth,k=a.stroke,b=void 0===k?i.stroke:k,_=a.lineWidth,x=void 0===_?i.lineWidth:_,w=a.whiteSpace,S=void 0===w?i.whiteSpace:w,A=a.suffixPosition,T=void 0===A?i.suffixPosition:A,C=null!==(e=La(a.lineHeight,a.fontSize||i.fontSize))&&void 0!==e?e:a.fontSize||i.fontSize;if("normal"===S)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var E=this.cache.layoutData.bbox;return this._AABBBounds.set(E.xOffset,E.yOffset,E.xOffset+E.width,E.yOffset+E.height),b&&this._AABBBounds.expand(x/2),this._AABBBounds}var R=Mi.graphicUtil.textMeasure,B=new Zu(s,{fontSize:f,fontWeight:p,fontFamily:s},R).GetLayoutByLines(t,l,h,C,!0===y?i.ellipsis:y||void 0,!1,m,T),M=B.bbox;return this.cache.layoutData=B,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),b&&this._AABBBounds.expand(x/2),this._AABBBounds}},{key:"updateVerticalMultilineAABBBounds",value:function(e){var n,r,a,o,s=zr(this).text,u=Mi.graphicUtil.textMeasure,l=this.attribute,c=l.ignoreBuf,h=(void 0===c?s.ignoreBuf:c)?0:2,d=l.maxLineWidth,f=void 0===d?s.maxLineWidth:d,v=l.ellipsis,p=void 0===v?s.ellipsis:v,g=l.fontFamily,y=void 0===g?s.fontFamily:g,m=l.fontSize,k=void 0===m?s.fontSize:m,b=l.fontWeight,_=void 0===b?s.fontWeight:b,x=l.stroke,w=void 0===x?s.stroke:x,S=l.lineWidth,A=void 0===S?s.lineWidth:S,T=l.verticalMode,C=void 0===T?s.verticalMode:T,E=l.suffixPosition,R=void 0===E?s.suffixPosition:E,B=null!==(n=La(l.lineHeight,l.fontSize||s.fontSize))&&void 0!==n?n:(l.fontSize||s.fontSize)+h,M=l.textAlign,P=void 0===M?s.textAlign:M,O=l.textBaseline,I=void 0===O?s.textBaseline:O;if(!C){var L=P;P=null!==(r=i.baselineMapAlign[I])&&void 0!==r?r:"left",I=null!==(a=i.alignMapBaseline[L])&&void 0!==a?a:"top"}if(o=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((function(t){var e=t.reduce((function(t,e){return t+e.width}),0);o=$t(e,o)}));var D=Xu(P,o),j=this.cache.verticalList.length*B,F=Ku(I,j,k);return this._AABBBounds.set(F,D,F+j,D+o),w&&this._AABBBounds.expand(A/2),this._AABBBounds}var N=e.map((function(t){return Es(t.toString())}));N.forEach((function(e,n){if(Number.isFinite(f))if(p){var i=!0===p?s.ellipsis:p,r=u.clipTextWithSuffixVertical(e,{fontSize:k,fontWeight:_,fontFamily:y},f,i,!1,R);N[n]=r.verticalList,o=r.width}else{var a=u.clipTextVertical(e,{fontSize:k,fontWeight:_,fontFamily:y},f,!1);N[n]=a.verticalList,o=a.width}else o=0,e.forEach((function(e){var n=e.direction===t.TextDirection.HORIZONTAL?k:u.measureTextWidth(e.text,{fontSize:k,fontWeight:_,fontFamily:y});o+=n,e.width=n}))})),this.cache.verticalList=N,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((function(t){var e=t.reduce((function(t,e){return t+e.width}),0);o=$t(e,o)}));var G=Xu(P,o),z=this.cache.verticalList.length*B,U=Ku(I,z,k);return this._AABBBounds.set(U,G,U+z,G+o),w&&this._AABBBounds.expand(A/2),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return zr(this).text[t]}},{key:"needUpdateTags",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ju;return p(h(i.prototype),"needUpdateTags",this).call(this,t,e)}},{key:"needUpdateTag",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ju;return p(h(i.prototype),"needUpdateTag",this).call(this,t,e)}},{key:"clone",value:function(){return new i(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return i.NOWORK_ANIMATE_ATTR}}])}(ls);function Qu(t){return new $u(t)}$u.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},us),$u.baselineMapAlign={top:"left",bottom:"right",middle:"center"},$u.alignMapBaseline={left:"top",right:"bottom",center:"middle"};var tl=["heightLimit","lineClamp"],el=function(t){function n(t){return o(this,n),e(this,n,[Object.assign(Object.assign({},t),{wrap:!0})])}return c(n,t),u(n,[{key:"_isValid",value:function(){var t=this.attribute.text;return wt(t)?!t.every((function(t){return null==t||""===t})):null!=t&&""!==t}},{key:"updateMultilineAABBBounds",value:function(t){var e,n,i,r,a=zr(this).text,o=this.attribute,s=o.fontFamily,u=void 0===s?a.fontFamily:s,l=o.textAlign,c=void 0===l?a.textAlign:l,h=o.textBaseline,d=void 0===h?a.textBaseline:h,f=o.fontSize,v=void 0===f?a.fontSize:f,p=o.ellipsis,g=void 0===p?a.ellipsis:p,y=o.maxLineWidth,m=o.stroke,k=void 0===m?a.stroke:m,b=o.lineWidth,_=void 0===b?a.lineWidth:b,x=o.wordBreak,w=void 0===x?a.wordBreak:x,S=o.fontWeight,A=void 0===S?a.fontWeight:S,T=o.ignoreBuf,C=void 0===T?a.ignoreBuf:T,E=o.heightLimit,R=void 0===E?0:E,B=o.suffixPosition,M=void 0===B?a.suffixPosition:B,P=o.lineClamp,O=null!==(e=La(this.attribute.lineHeight,this.attribute.fontSize||a.fontSize))&&void 0!==e?e:this.attribute.fontSize||a.fontSize,I=C?0:2;if(!this.shouldUpdateShape()&&(null===(n=this.cache)||void 0===n?void 0:n.layoutData)){var L=this.cache.layoutData.bbox;return this._AABBBounds.set(L.xOffset,L.yOffset,L.xOffset+L.width,L.yOffset+L.height),k&&this._AABBBounds.expand(_/2),this._AABBBounds}var D=Mi.graphicUtil.textMeasure,j=new Zu(u,{fontSize:v,fontWeight:A,fontFamily:u},D),F=t.map((function(t){return t.toString()})),N=[],G=[0,0],z=1/0;if(R>0&&(z=Math.max(Math.floor(R/O),1)),P&&(z=Math.min(z,P)),"number"==typeof y&&y!==1/0){if(y>0)for(var U=0;U<F.length;U++){var W=F[U],V=!0;if(U===z-1){var H=j.textMeasure.clipTextWithSuffix(W,j.textOptions,y,g,!1,M);N.push({str:H.str,width:H.width});break}var Y=j.textMeasure.clipText(W,j.textOptions,y,"break-word"===w);if(""!==W&&""===Y.str){if(g){var X=j.textMeasure.clipTextWithSuffix(W,j.textOptions,y,g,!1,M);Y.str=null!==(i=X.str)&&void 0!==i?i:"",Y.width=null!==(r=X.width)&&void 0!==r?r:0}else Y.str="",Y.width=0;V=!1}if(N.push({str:Y.str,width:Y.width}),Y.str.length===W.length);else if(V){var K=W.substring(Y.str.length);F.splice(U+1,0,K)}}var q=0;N.forEach((function(t){q=Math.max(q,t.width)})),G[0]=q}else{for(var Z,J,$=0,Q=0,tt=F.length;Q<tt;Q++){if(Q===z-1){var et=j.textMeasure.clipTextWithSuffix(F[Q],j.textOptions,y,g,!1,M);N.push({str:et.str,width:et.width}),$=Math.max($,et.width);break}J=F[Q],Z=j.textMeasure.measureTextWidth(J,j.textOptions,"break-word"===w),$=Math.max($,Z),N.push({str:J,width:Z})}G[0]=$}G[1]=N.length*(O+I);var nt={xOffset:0,yOffset:0,width:G[0],height:G[1]};j.LayoutBBox(nt,c,d);var it=j.layoutWithBBox(nt,N,c,d,O);return this.cache.layoutData=it,this.clearUpdateShapeTag(),this._AABBBounds.set(nt.xOffset,nt.yOffset,nt.xOffset+nt.width,nt.yOffset+nt.height),k&&this._AABBBounds.expand(_/2),this._AABBBounds}},{key:"needUpdateTags",value:function(t){for(var e=0;e<tl.length;e++){var i=tl[e];if(-1!==t.indexOf(i))return!0}return p(h(n.prototype),"needUpdateTags",this).call(this,t)}},{key:"needUpdateTag",value:function(t){for(var e=0;e<tl.length;e++)if(t===tl[e])return!0;return p(h(n.prototype),"needUpdateTag",this).call(this,t)}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}($u);function nl(t){return new el(t)}var il=function(){return u((function t(){o(this,t)}),[{key:"bounds",value:function(t,e){if(At(t)){var n=t/2;e.x1=-n,e.x2=n,e.y1=-n,e.y2=n}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}])}();function rl(t,e,n,i,r){return r?t.arc(n,i,e,0,Xt,!1,r):t.arc(n,i,e,0,Xt),!1}var al=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return rl(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return rl(t,e/2+r,n,i,a)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e-r,", ").concat(n," a ").concat(r,",").concat(r," 0 1,0 ").concat(2*r,",0 a ").concat(r,",").concat(r," 0 1,0 -").concat(2*r,",0")}}])}(il),ol=new al;var sl=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-3*e+n,-e+i,r),t.lineTo(-e+n,-e+i,r),t.lineTo(-e+n,-3*e+i,r),t.lineTo(e+n,-3*e+i,r),t.lineTo(e+n,-e+i,r),t.lineTo(3*e+n,-e+i,r),t.lineTo(3*e+n,e+i,r),t.lineTo(e+n,e+i,r),t.lineTo(e+n,3*e+i,r),t.lineTo(-e+n,3*e+i,r),t.lineTo(-e+n,e+i,r),t.lineTo(-3*e+n,e+i,r),t.closePath(),!0}(t,e/6,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return function(t,e,n,i,r,a){return t.moveTo(-3*e+n-r,-e+i-r,a),t.lineTo(-e+n-r,-e+i-r,a),t.lineTo(-e+n-r,-3*e+i-r,a),t.lineTo(e+n+r,-3*e+i-r,a),t.lineTo(e+n+r,-e+i-r,a),t.lineTo(3*e+n+r,-e+i-r,a),t.lineTo(3*e+n+r,e+i+r,a),t.lineTo(e+n+r,e+i+r,a),t.lineTo(e+n+r,3*e+i+r,a),t.lineTo(-e+n-r,3*e+i+r,a),t.lineTo(-e+n-r,e+i+r,a),t.lineTo(-3*e+n-r,e+i+r,a),t.closePath(),!0}(t,e/6,n,i,r,a)}}])}(il),ul=new sl;function ll(t,e,n,i,r){return t.moveTo(n,i-e,r),t.lineTo(e+n,i,r),t.lineTo(n,i+e,r),t.lineTo(n-e,i,r),t.closePath(),!0}var cl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="diamond",t.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return ll(t,e/2,n,i,r)}},{key:"drawFitDir",value:function(t,e,n,i,r){return ll(t,e/2,n,i,r)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return ll(t,e/2+r,n,i,a)}}])}(il),hl=new cl;function dl(t,e,n,i){var r=2*e;return t.rect(n-e,i-e,r,r),!1}var fl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="square",t.pathStr="M-0.5,-0.5h1v1h-1Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return dl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return dl(t,e/2+r,n,i)}}])}(il),vl=new fl;var pl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleUp",t.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n+e,e+i),t.lineTo(n-e,e+i),t.lineTo(n,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n+e+2*r,e+i+r),t.lineTo(n-e-2*r,e+i+r),t.lineTo(n,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(il),gl=new pl,yl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangle",t}return c(n,t),u(n)}(pl),ml=new yl,kl=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),bl=Math.sin(Xt/10)*kl,_l=-Math.cos(Xt/10)*kl;function xl(t,e,n,i){var r=bl*e,a=_l*e;t.moveTo(n,-e+i),t.lineTo(r+n,a+i);for(var o=1;o<5;++o){var s=Xt*o/5,u=Math.cos(s),l=Math.sin(s);t.lineTo(l*e+n,-u*e+i),t.lineTo(u*r-l*a+n,l*r+u*a+i)}return t.closePath(),!0}var wl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="star",t.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return xl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return xl(t,e/2+r,n,i)}}])}(il),Sl=new wl,Al=ee(3);function Tl(t,e,n,i){var r=e,a=r/Al,o=a/5,s=e;return t.moveTo(0+n,-r+i),t.lineTo(a/2+n,i),t.lineTo(o/2+n,i),t.lineTo(o/2+n,s+i),t.lineTo(-o/2+n,s+i),t.lineTo(-o/2+n,i),t.lineTo(-a/2+n,i),t.closePath(),!0}var Cl=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Tl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Tl(t,e/2+r,n,i)}}])}(il),El=new Cl;function Rl(t,e,n,i){var r=2*e;return t.moveTo(n,-e+i),t.lineTo(r/3/2+n,e+i),t.lineTo(-r/3/2+n,e+i),t.closePath(),!0}var Bl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="wedge",t.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Rl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Rl(t,e/2+r,n,i)}}])}(il),Ml=new Bl;function Pl(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(n,e+i),!1}var Ol=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="stroke",t.pathStr="",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Pl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Pl(t,e/2+r,n,i)}}])}(il),Il=new Ol,Ll=-.5,Dl=ee(3)/2,jl=1/ee(12);function Fl(t,e,n,i){var r=e/2,a=e*jl,o=r,s=e*jl+e,u=-o,l=s;return t.moveTo(r+n,a+i),t.lineTo(o+n,s+i),t.lineTo(u+n,l+i),t.lineTo(Ll*r-Dl*a+n,Dl*r+Ll*a+i),t.lineTo(Ll*o-Dl*s+n,Dl*o+Ll*s+i),t.lineTo(Ll*u-Dl*l+n,Dl*u+Ll*l+i),t.lineTo(Ll*r+Dl*a+n,Ll*a-Dl*r+i),t.lineTo(Ll*o+Dl*s+n,Ll*s-Dl*o+i),t.lineTo(Ll*u+Dl*l+n,Ll*l-Dl*u+i),t.closePath(),!1}var Nl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="wye",t.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Fl(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Fl(t,e/2+r,n,i)}}])}(il),Gl=new Nl;var zl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleLeft",t.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(-e+n,i),t.lineTo(e+n,e+i),t.lineTo(e+n,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(-e+n-2*r,i),t.lineTo(e+n+r,e+i+2*r),t.lineTo(e+n+r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(il),Ul=new zl;var Wl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleRight",t.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,e+i),t.lineTo(e+n,i),t.lineTo(n-e,i-e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-r,e+i+2*r),t.lineTo(e+n+2*r,i),t.lineTo(n-e-r,i-e-2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(il),Vl=new Wl;var Hl=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="triangleDown",t.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return function(t,e,n,i){return t.moveTo(n-e,i-e),t.lineTo(n+e,i-e),t.lineTo(n,i+e),t.closePath(),!0}(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return function(t,e,n,i,r){return t.moveTo(n-e-2*r,i-e-r),t.lineTo(n+e+2*r,i-e-r),t.lineTo(n,i+e+2*r),t.closePath(),!0}(t,e/2,n,i,r)}}])}(il),Yl=new Hl,Xl=ee(3);function Kl(t,e,n,i){var r=e*Xl;return t.moveTo(n,i+-r/3*2),t.lineTo(e+n,i+r),t.lineTo(n-e,i+r),t.closePath(),!0}var ql=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="thinTriangle",t.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Kl(t,e/2/Xl,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Kl(t,e/2/Xl+r,n,i)}}])}(pl),Zl=new ql;function Jl(t,e,n,i){var r=2*e;return t.moveTo(e+n,i-r),t.lineTo(n-e,i),t.lineTo(e+n,r+i),!0}var $l=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Left",t.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return Jl(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return Jl(t,e/4+r,n,i)}}])}(il),Ql=new $l;function tc(t,e,n,i){var r=2*e;return t.moveTo(n-e,i-r),t.lineTo(n+e,i),t.lineTo(n-e,r+i),!0}var ec=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Right",t.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return tc(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return tc(t,e/4+r,n,i)}}])}(il),nc=new ec;function ic(t,e,n,i){var r=2*e;return t.moveTo(n-r,i+e),t.lineTo(n,i-e),t.lineTo(n+r,i+e),!0}var rc=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Up",t.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return ic(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return ic(t,e/4+r,n,i)}}])}(il),ac=new rc;function oc(t,e,n,i){var r=2*e;return t.moveTo(n-r,i-e),t.lineTo(n,i+e),t.lineTo(n+r,i-e),!0}var sc=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="arrow2Down",t.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return oc(t,e/4,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return oc(t,e/4+r,n,i)}}])}(il),uc=new sc;function lc(t,e,n,i,r){return t.moveTo(n,i-e),t.lineTo(n,i+e),!0}var cc=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="lineV",t.pathStr="M0,-0.5L0,0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return lc(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return lc(t,e/2+r,n,i)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e,", ").concat(n-r," L ").concat(e,",").concat(n+r)}}])}(il),hc=new cc;function dc(t,e,n,i,r){return t.moveTo(n-e,i),t.lineTo(n+e,i),!0}var fc=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="lineH",t.pathStr="M-0.5,0L0.5,0",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return dc(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return dc(t,e/2+r,n,i)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e-r,", ").concat(n," L ").concat(e+r,",").concat(n)}}])}(il),vc=new fc;function pc(t,e,n,i,r){return t.moveTo(n-e,i-e),t.lineTo(n+e,i+e),t.moveTo(n+e,i-e),t.lineTo(n-e,i+e),!0}var gc=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="close",t.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5",t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i,r){return pc(t,e/2,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r,a){return pc(t,e/2+r,n,i)}},{key:"drawToSvgPath",value:function(t,e,n,i){var r=t/2;return"M ".concat(e-r,", ").concat(n-r," L ").concat(e+r,",").concat(n+r," M ").concat(e+r,", ").concat(n-r," L ").concat(e-r,",").concat(n+r)}}])}(il),yc=new gc;function mc(t,e,n,i){return t.rect(n-e[0]/2,i-e[1]/2,e[0],e[1]),!1}function kc(t,e,n,i){var r=e,a=e/2;return t.rect(n-r/2,i-a/2,r,a),!1}var bc=function(t){function n(){var t;return o(this,n),(t=e(this,n,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 c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){return At(e)?kc(t,e,n,i):mc(t,e,n,i)}},{key:"drawOffset",value:function(t,e,n,i,r){return At(e)?kc(t,e+2*r,n,i):mc(t,[e[0]+2*r,e[1]+2*r],n,i)}}])}(il),_c=new bc,xc=new de,wc=function(){return u((function t(e,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,t),this.pathStr="",this.type=e,wt(n)?this.svgCache=n:this.path=n,this.isSvg=i}),[{key:"drawOffset",value:function(t,e,n,i,r,a,o){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),cn(r.path.commandList,t,n,i,e,e),o&&o(r.path,r.attribute)})),!1):(cn(this.path.commandList,t,n,i,e+r,e+r),!1)}},{key:"draw",value:function(t,e,n,i,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((function(r){t.beginPath(),cn(r.path.commandList,t,n,i,e,e),a&&a(r.path,r.attribute)})),!1):(cn(this.path.commandList,t,n,i,e,e),!1)}},{key:"bounds",value:function(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((function(n){var i=n.path;xc.x1=i.bounds.x1*t,xc.y1=i.bounds.y1*t,xc.x2=i.bounds.x2*t,xc.y2=i.bounds.y2*t,e.union(xc)}))}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)}}])}(),Sc=[ol,ul,hl,vl,Zl,ml,Sl,El,Ml,Il,Gl,Ul,Vl,gl,Yl,Ql,nc,ac,uc,_c,hc,vc,yc],Ac={};Sc.forEach((function(t){Ac[t.type]=t}));var Tc={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"},Cc=new de,Ec=["symbolType","size"].concat(y(is)),Rc=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"};return o(this,n),(t=e(this,n,[i])).type="symbol",t.numberType=Ks,t}return c(n,t),u(n,[{key:"getParsedPath",value:function(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}},{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute.size;return wt(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}},{key:"doUpdateParsedPath",value:function(){var t=zr(this).symbol,e=this.attribute.symbolType,i=void 0===e?t.symbolType:e,r=Ac[i];if(r)return this._parsedPath=r,r;if(r=n.userSymbolMap[i])return this._parsedPath=r,r;if(!0===bs(i=Tc[i]||i)){var a=(new ks).parse(i).svg;if(!a)return null;var o=wt(a.path)?a.path:[a.path];Cc.clear();var s=[];o.forEach((function(t){var e=(new ei).fromString(t.d),n={};eu.forEach((function(e){t[e]&&(n[tu[e]]=t[e])})),s.push({path:e,attribute:n}),Cc.union(e.bounds)}));var u=Cc.width(),l=Cc.height(),c=1/$t(u,l);return s.forEach((function(t){return t.path.transform(0,0,c,c)})),this._parsedPath=new wc(i,s,!0),n.userSymbolMap[i]=this._parsedPath,this._parsedPath}var h=(new ei).fromString(i),d=h.bounds.width(),f=h.bounds.height(),v=1/$t(d,f);return h.transform(0,0,v,v),this._parsedPath=new wc(i,h),n.userSymbolMap[i]=this._parsedPath,this._parsedPath}},{key:"doUpdateAABBBounds",value:function(t){var e=zr(this).symbol;this._AABBBounds.clear();var n=this.attribute,i=Mi.graphicService.updateSymbolAABBBounds(n,zr(this).symbol,this._AABBBounds,t,this),r=n.boundsPadding,a=void 0===r?e.boundsPadding:r,o=xa(a);return o&&i.expand(o),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return zr(this).symbol[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Ec)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Ec)}},{key:"toCustomPath",value:function(){var t=this.getParsedPath(),e=this.attribute.size,n=wt(e)?e:[e,e];return t.path?(new ei).fromCustomPath2D(t.path,0,0,n[0],n[1]):(new ei).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}}])}(ls);function Bc(t){return new Rc(t)}Rc.userSymbolMap={},Rc.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},us);var Mc=["segments","points","curveType","curveTension"].concat(y(is)),Pc=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(t=e(this,n,[i])).type="line",t.numberType=zs,t}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!(!e||e.length<=1)}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Ea(n,i,e))}},{key:"doUpdateAABBBounds",value:function(){var t=zr(this).line;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updateLineAABBBounds(e,zr(this).line,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return zr(this).line[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Mc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Mc)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=new ei,n=t.segments,i=function(t){if(t&&t.length){var n=!0;t.forEach((function(t){!1!==t.defined&&(n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),n=!1)}))}};return n&&n.length?n.forEach((function(t){i(t.points)})):t.points&&i(t.points),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function Oc(t){return new Pc(t)}Pc.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},us);var Ic=["width","x1","y1","height","cornerRadius"].concat(y(is)),Lc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="rect",i.numberType=Hs,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){return!0}},{key:"doUpdateAABBBounds",value:function(){var t=zr(this).rect;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updateRectAABBBounds(e,zr(this).rect,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return zr(this).rect[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Ic)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Ic)}},{key:"toCustomPath",value:function(){var t=this.attribute,e=fo(t),n=e.x,i=e.y,r=e.width,a=e.height,o=new ei;return o.moveTo(n,i),o.rect(n,i,r,a),o}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function Dc(t){return new Lc(t)}Lc.NOWORK_ANIMATE_ATTR=us;var jc=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]],Fc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="rect3d",i.numberType=Ys,i}return c(n,t),u(n,[{key:"findFace",value:function(){var t={polygons:[],vertices:[],edges:[]},e=zr(this).rect,n=this.attribute,i=n.x1,r=n.y1,a=n.x,o=n.y,s=n.length,u=void 0===s?Qt(e.width,e.height):s,l=this.attribute,c=l.width,h=l.height;c=null!=c?c:i-a,h=null!=h?h:r-o;for(var d=0;d<jc.length;d++){var f=jc[d];t.vertices.push([f[0]*c,f[1]*h,f[2]*u])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(Lc);function Nc(t){return new Fc(t)}Fc.NOWORK_ANIMATE_ATTR=us;var Gc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="glyph",i.numberType=Fs,i.subGraphic=[],i._onInit&&i._onInit(f(i)),i.valid=i.isValid(),i}return c(n,t),u(n,[{key:"setSubGraphic",value:function(t){var e=this;this.detachSubGraphic(),this.subGraphic=t,t.forEach((function(t){t.glyphHost=e,Object.setPrototypeOf(t.attribute,e.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}},{key:"detachSubGraphic",value:function(){this.subGraphic.forEach((function(t){t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}},{key:"getSubGraphic",value:function(){return this.subGraphic}},{key:"onInit",value:function(t){this._onInit=t}},{key:"onUpdate",value:function(t){this._onUpdate=t}},{key:"isValid",value:function(){return!0}},{key:"setAttribute",value:function(t,e,i,r){p(h(n.prototype),"setAttribute",this).call(this,t,e,i,r),this.subGraphic.forEach((function(t){t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}},{key:"setAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;p(h(n.prototype),"setAttributes",this).call(this,t,e,i),this.subGraphic.forEach((function(t){t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}},{key:"translate",value:function(t,e){return p(h(n.prototype),"translate",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"translateTo",value:function(t,e){return p(h(n.prototype),"translateTo",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"scale",value:function(t,e,i){return p(h(n.prototype),"scale",this).call(this,t,e,i),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"scaleTo",value:function(t,e){return p(h(n.prototype),"scaleTo",this).call(this,t,e),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"rotate",value:function(t){return p(h(n.prototype),"rotate",this).call(this,t),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"rotateTo",value:function(t){return p(h(n.prototype),"rotate",this).call(this,t),this.subGraphic.forEach((function(t){t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}},{key:"doUpdateAABBBounds",value:function(){this._AABBBounds.clear();var t=Mi.graphicService.updateGlyphAABBBounds(this.attribute,zr(this).glyph,this._AABBBounds,this);return this.clearUpdateBoundTag(),t}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){return!1}},{key:"needUpdateTag",value:function(t){return!1}},{key:"useStates",value:function(t,e){var n,i=this;if(t.length){if((null===(n=this.currentStates)||void 0===n?void 0:n.length)!==t.length||t.some((function(t,e){return i.currentStates[e]!==t}))){this.stopStateAnimates();var r={},a=this.subGraphic.map((function(){return{}}));t.forEach((function(e){var n,o=i.glyphStateProxy?i.glyphStateProxy(e,t):i.glyphStates[e];o&&(Object.assign(r,o.attributes),(null===(n=o.subAttributes)||void 0===n?void 0:n.length)&&a.forEach((function(t,e){Object.assign(t,o.subAttributes[e])})))})),this.subGraphic.forEach((function(n,i){n.updateNormalAttrs(a[i]),n.applyStateAttrs(a[i],t,e)})),this.updateNormalAttrs(r),this.currentStates=t,this.applyStateAttrs(r,t,e)}}else this.clearStates(e)}},{key:"clearStates",value:function(t){var e=this;this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((function(n){n.applyStateAttrs(n.normalAttrs,e.currentStates,t,!0),n.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}},{key:"clone",value:function(){var t=new n(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((function(t){return t.clone()}))),t}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function zc(t){return new Gc(t)}Gc.NOWORK_ANIMATE_ATTR=us;var Uc=function(){return u((function t(e,n,i,r,a,s,u,l,c,h,d,f,v,p){o(this,t),this.left=e,this.top=n,this.width=i,this.height=r,this.actualHeight=0,this.bottom=n+r,this.right=e+i,this.ellipsis=a,this.wordBreak=s,this.verticalDirection=u,this.lines=[],this.globalAlign=l,this.globalBaseline=c,this.layoutDirection=h,this.directionKey=Pi[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=f,this.singleLine=v,p?(p.clear(),this.icons=p):this.icons=new Map}),[{key:"draw",value:function(t,e){var n=this.getActualSize(),i=n.width,r=n.height,a=this.isWidthMax?Math.min(this.width,i):this.width||i||0,o=this.isHeightMax?Math.min(this.height,r):this.height||r||0;o=Math.min(o,r);var s=0;switch(this.globalBaseline){case"top":s=0;break;case"middle":s=-o/2;break;case"bottom":s=-o}var u=0;"right"===this.globalAlign||"end"===this.globalAlign?u=-a:"center"===this.globalAlign&&(u=-a/2);var l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);var c=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(var h=0;h<this.lines.length;h++){var d=this.lines[h],f=d.top,v=d.height;if(f+v<this[this.directionKey.top]||f+v>this[this.directionKey.top]+l)return c;var p=!1;this.ellipsis&&this.lines[h+1]&&this.lines[h+1].top+this.lines[h+1].height>this[this.directionKey.top]+l&&(p=!0,c=!0),this.lines[h].draw(t,p,this.lines[h][this.directionKey.left]+u,this.lines[h][this.directionKey.top]+s,this.ellipsis,e)}else{var g=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?u+=g:s+=g;for(var y=0;y<this.lines.length;y++)this.lines[y].draw(t,!1,this.lines[y][this.directionKey.left]+u,this.lines[y][this.directionKey.top]+s,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(var m=0;m<this.lines.length;m++){var k=this.lines[m];k.top;var b=k.height,_=l-this.lines[m].top-this.lines[m].height;if(0===l)this.lines[m].draw(t,!1,u,_+s,this.ellipsis,e);else{if(_+b>this[this.directionKey.top]+l||_<this[this.directionKey.top])return c;var x=!1;this.ellipsis&&this.lines[m+1]&&_-this.lines[m+1].height<this[this.directionKey.top]&&(x=!0,c=!0),this.lines[m].draw(t,x,u,_+s,this.ellipsis,e)}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(u+=this.lines[0].height+1);for(var w=0;w<this.lines.length;w++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(u-=this.lines[w].height+this.lines[w].top);var S=this.lines[w],A=S.top,T=S.height;if(0===l)this.lines[w].draw(t,!1,this.lines[w][this.directionKey.left]+u,this.lines[w][this.directionKey.top]+s,this.ellipsis,e);else{if(A+T<this[this.directionKey.top]||A+T>this[this.directionKey.top]+l)return c;var C=!1;this.ellipsis&&this.lines[w+1]&&this.lines[w+1].top+this.lines[w+1].height>this[this.directionKey.top]+l&&(C=!0,c=!0),this.lines[w].draw(t,C,this.lines[w][this.directionKey.left]+u,this.lines[w][this.directionKey.top]+s,this.ellipsis,e)}}}return c}},{key:"getActualSize",value:function(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}},{key:"getRawActualSize",value:function(){for(var t=0,e=0,n=0;n<this.lines.length;n++){var i=this.lines[n];i.actualWidth>t&&(t=i.actualWidth),e+=i.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}},{key:"getActualSizeWidthEllipsis",value:function(){var t=0,e=0,n=this.getRawActualSize();n.width;n.height;this.width,this.height;var i=this[this.directionKey.height];if(this.singleLine&&(i=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=i&&0!==i)for(var r=0;r<this.lines.length;r++){var a=this.lines[r],o=a.top,s=a.height;if(o+s<this[this.directionKey.top]||o+s>this[this.directionKey.top]+i);else if(this.ellipsis&&this.lines[r+1]&&this.lines[r+1].top+this.lines[r+1].height>this[this.directionKey.top]+i){var u=!0===this.ellipsis?"...":this.ellipsis||"",l=this.lines[r].getWidthWithEllips(u);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((i-this.actualHeight)/2);for(var c=0;c<this.lines.length;c++)this.lines[c].actualWidth>t&&(t=this.lines[c].actualWidth),e+=this.lines[c].height}else if("bottom"===this.verticalDirection)for(var h=0;h<this.lines.length;h++){var d=this.lines[h];d.top;var f=d.height,v=i-this.lines[h].top-this.lines[h].height;if(0===i)this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height;else if(v+f>this[this.directionKey.top]+i||v<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[h+1]&&v-this.lines[h+1].height<this[this.directionKey.top]){var p=!0===this.ellipsis?"...":this.ellipsis||"",g=this.lines[h].getWidthWithEllips(p);g>t&&(t=g),e+=this.lines[h].height}else this.lines[h].actualWidth>t&&(t=this.lines[h].actualWidth),e+=this.lines[h].height}else for(var y=0;y<this.lines.length;y++){var m=this.lines[y],k=m.top,b=m.height;if(0===i)this.lines[y].actualWidth>t&&(t=this.lines[y].actualWidth),e+=this.lines[y].height;else if(k+b<this[this.directionKey.top]||k+b>this[this.directionKey.top]+i);else if(this.ellipsis&&this.lines[y+1]&&this.lines[y+1].top+this.lines[y+1].height>this[this.directionKey.top]+i){var _=!0===this.ellipsis?"...":this.ellipsis||"",x=this.lines[y].getWidthWithEllips(_);x>t&&(t=x),e+=this.lines[y].height}else this.lines[y].actualWidth>t&&(t=this.lines[y].actualWidth),e+=this.lines[y].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}])}(),Wc=function(){return u((function t(e,n,i){o(this,t),this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";var r=La(i.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 a=Gi(e,i),s=a.ascent,u=a.height,l=a.descent,c=a.width,h=0,d=0,f=0;this.height>u&&(h=(this.height-u)/2,d=Math.ceil(h),f=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=u-h):"bottom"===this.textBaseline?(this.ascent=u-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=s+d,this.descent=l+f),this.length=e.length,this.width=c||0,this.text=e||"",this.newLine=n||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}),[{key:"updateWidth",value:function(){var t=Gi(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,n,i,r){var a=this.text,o=this.left+n;e+=this.top;var s=this.direction;if(this.verticalEllipsis)a=this.ellipsisStr,s="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)a+=this.ellipsisStr,"right"!==r&&"end"!==r||(o-=this.ellipsisWidth);else if("replace"===this.ellipsis){var u=Fi(a,("vertical"===s?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,a.length-1);if(a=a.slice(0,u),a+=this.ellipsisStr,"right"===r||"end"===r){var l=Gi(this.text.slice(u),this.character).width;"vertical"===s||(o-=this.ellipsisWidth-l)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===s&&(t.save(),t.rotateAbout(Math.PI/2,o,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(o,e),o=0,e=0),this.character.stroke&&(function(t,e){var n=e&&e.stroke||Ii;if(n){var i=e.strokeOpacity,r=void 0===i?1:i,a=e.opacity,o=void 0===a?1:a;t.globalAlpha=r*o,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=n;var s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),t.strokeText(a,o,e)),function(t,e){var n=e&&e.fill||Oi;if(n){var i=e.fillOpacity,r=void 0===i?1:i,a=e.opacity,o=void 0===a?1:a;t.globalAlpha=r*o,t.fillStyle=n;var s=e.fontSize||16;switch(e.script){case"super":case"sub":s*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:s,fontFamily:e.fontFamily||"sans-serif"})}else t.globalAlpha=0}(t,this.character),this.character.fill&&t.fillText(a,o,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(o,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(o,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===s&&t.restore()}},{key:"getWidthWithEllips",value:function(t){var e=this.text,n="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return n;if("add"===this.ellipsis)return n+this.ellipsisWidth;if("replace"===this.ellipsis){var i=Fi(e,n-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,i),e+=this.ellipsisStr;var r=Gi(this.text.slice(i),this.character).width;return n+this.ellipsisWidth-r}return n}}])}();var Vc=["width","height","image"].concat(y(is)),Hc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="image",i.numberType=Gs,i.loadImage(i.attribute.image),i}return c(n,t),u(n,[{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,i){var r=this;p(h(n.prototype),"imageLoadSuccess",this).call(this,t,e,(function(){r.successCallback&&r.successCallback()}))}},{key:"imageLoadFail",value:function(t,e){var i=this;p(h(n.prototype),"imageLoadFail",this).call(this,t,(function(){i.failCallback&&i.failCallback()}))}},{key:"setAttributes",value:function(t,e,i){return t.image&&this.loadImage(t.image),p(h(n.prototype),"setAttributes",this).call(this,t,e,i)}},{key:"setAttribute",value:function(t,e,i,r){return"image"===t&&this.loadImage(e),p(h(n.prototype),"setAttribute",this).call(this,t,e,i,r)}},{key:"doUpdateAABBBounds",value:function(){var t=zr(this).image;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updateImageAABBBounds(e,zr(this).image,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ei[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Vc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Vc)}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function Yc(t){return new Hc(t)}Hc.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},us);var Xc=function(t){function n(t){var i;if(o(this,n),(i=e(this,n,[t]))._x=0,i._y=0,i._hovered=!1,i._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(i._hovered=!0),t.margin){var r=xa(t.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}return i.onBeforeAttributeUpdate=function(t,e,n){if(wt(n)&&-1!==n.indexOf("margin")||"margin"===n)if(e.margin){var r=xa(e.margin);i._marginArray="number"==typeof r?[r,r,r,r]:r}else i._marginArray=[0,0,0,0]},f(i)}return c(n,t),u(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,n=void 0===e?Ei.width:e,i=t.height,r=void 0===i?Ei.height:i,a=this.attribute,o=a.backgroundWidth,s=void 0===o?n:o,u=a.backgroundHeight,l=(s-n)/2,c=((void 0===u?r:u)-r)/2;return this._AABBBounds.expand([0,2*l,2*c,0]),this._AABBBounds}},{key:"setHoverState",value:function(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}])}(Hc),Kc=function(){return u((function t(e,n,i,r,a,s,u,l){var c=this;o(this,t),this.left=e,this.width=n,this.baseline=i,this.ascent=r,this.descent=a,this.top=i-r,this.paragraphs=s.map((function(t){return t})),this.textAlign=(this.paragraphs[0]instanceof Xc?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=u,this.directionKey=Pi[this.direction],this.actualWidth=0;var h=0;this.paragraphs.forEach((function(t,e){if(0===e&&t instanceof Wc){var n=ji.exec(t.text);0!==(null==n?void 0:n.index)&&(t.text=t.text.slice(null==n?void 0:n.index),t.updateWidth())}c.actualWidth+=t[c.directionKey.width],h=Math.max(t[c.directionKey.height],h)})),this.height=h,this.blankWidth=l?0:this.width-this.actualWidth,this.calcOffset(n,l)}),[{key:"calcOffset",value:function(t,e){var n=this.directionKey,i=this.height,r=this.left,a=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:a=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof Xc?(t["_"+n.x]=r,r+=t[n.width]+a,t["_"+n.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?i-t.height:(i-t.height)/2):(t[n.left]=r,r+=t[n.width]+a)}))}},{key:"draw",value:function(t,e,n,i,r,a){var o=this;if(r&&(e||this.paragraphs.some((function(t){return t.overflow}))))for(var s=0,u=this.paragraphs.length-1;u>=0;u--){var l=this.paragraphs[u];if(!l.overflow){if(l instanceof Xc)break;if("vertical"===this.direction&&"vertical"!==l.direction){l.verticalEllipsis=!0;break}var c=!0===r?"...":r||"";l.ellipsisStr=c;var h=Gi(c,l.character).width||0;if(h<=this.blankWidth+s){e&&(l.ellipsis="add");break}if(h<=this.blankWidth+s+l.width){l.ellipsis="replace",l.ellipsisWidth=h,l.ellipsisOtherParagraphWidth=this.blankWidth+s;break}l.ellipsis="hide",s+=l.width}}this.paragraphs.map((function(e,r){if(e instanceof Xc)return e.setAttributes({x:n+e._x,y:i+e._y}),void a(e,t,n+e._x,i+e._y,o.ascent);e.draw(t,i+o.ascent,n,0===r,o.textAlign)}))}},{key:"getWidthWithEllips",value:function(t){for(var e=this,n=0,i=this.paragraphs.length-1;i>=0;i--){var r=this.paragraphs[i];if(r instanceof Xc)break;var a=Gi(t,r.character).width||0;if(a<=this.blankWidth+n){r.ellipsis="add",r.ellipsisWidth=a;break}if(a<=this.blankWidth+n+r.width){r.ellipsis="replace",r.ellipsisWidth=a,r.ellipsisOtherParagraphWidth=this.blankWidth+n;break}r.ellipsis="hide",n+=r.width}var o=0;return this.paragraphs.map((function(t,n){o+=t instanceof Xc?t.width:t.getWidthWithEllips(e.direction)})),o}}])}(),qc=function(){return u((function t(e){o(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=Pi[this.direction]}),[{key:"store",value:function(t){if(t instanceof Xc){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];var e=0,n=0;"top"===t.attribute.textBaseline?(e=0,n=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,n=0):(e=t.height/2,n=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,n)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}},{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,n=new Kc(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(n),this.frame.actualHeight+=n.height,this.y+=n.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}}},{key:"deal",value:function(t){t instanceof Xc?"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,n=Math.ceil(e/t[this.directionKey.width]*t.length)||0,i=Fi(t.text,e,t.character,n,"break-word"===this.frame.wordBreak);if(0!==i){var r=function(t,e){var n=t.text.slice(0,e),i=t.text.slice(e);return[new Wc(n,t.newLine,t.character),new Wc(i,!0,t.character)]}(t,i),a=g(r,2),o=a[0],s=a[1];this.store(o),this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}])}(),Zc=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection"].concat(y(is)),Jc=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="richtext",i._currentHoverIcon=null,i.numberType=Xs,i}return c(n,t),u(n,[{key:"width",get:function(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Ci.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:Ci.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:Ci.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:Ci.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:Ci.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:Ci.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:Ci.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:Ci.textConfig},set:function(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}},{key:"doUpdateAABBBounds",value:function(){var t=zr(this).richtext;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updateRichTextAABBBounds(e,zr(this).richtext,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return Ci[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Zc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Zc)}},{key:"getFrameCache",value:function(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}},{key:"combinedStyleToCharacter",value:function(t){var e=this.attribute,n=e.fill,i=e.stroke,r=e.fontSize,a=e.fontFamily,o=e.fontStyle,s=e.fontWeight,u=e.lineWidth,l=e.opacity,c=e.fillOpacity,h=e.strokeOpacity;return Object.assign({fill:n,stroke:i,fontSize:r,fontFamily:a,fontStyle:o,fontWeight:s,lineWidth:u,opacity:l,fillOpacity:c,strokeOpacity:h},t)}},{key:"doUpdateFrameCache",value:function(t){for(var e,n=this,i=this.attribute,r=i.textConfig,a=void 0===r?[]:r,o=i.maxWidth,s=i.maxHeight,u=i.width,l=i.height,c=i.ellipsis,h=i.wordBreak,d=i.verticalDirection,f=i.textAlign,v=i.textBaseline,p=i.layoutDirection,g=i.singleLine,y=i.disableAutoWrapLine,m=[],k=null!=t?t:a,b=0;b<k.length;b++)if("image"in k[b]){var _=this.combinedStyleToCharacter(k[b]),x=_.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(_.id);if(x)m.push(x);else{var w=new Xc(_);w.successCallback=function(){var t;n.addUpdateBoundTag(),null===(t=n.stage)||void 0===t||t.renderNextFrame()},w.richtextId=_.id,m.push(w)}}else{var S=this.combinedStyleToCharacter(k[b]);if(At(S.text)&&(S.text="".concat(S.text)),S.text&&S.text.includes("\n"))for(var A=S.text.split("\n"),T=0;T<A.length;T++)m.push(new Wc(A[T],0!==T,S));else S.text&&m.push(new Wc(S.text,!1,S))}var C="number"==typeof o&&Number.isFinite(o)&&o>0,E="number"==typeof s&&Number.isFinite(s)&&s>0,R="number"==typeof u&&Number.isFinite(u)&&u>0&&(!C||u<=o),B="number"==typeof l&&Number.isFinite(l)&&l>0&&(!E||l<=s),M=new Uc(0,0,(R?u:C?o:0)||0,(B?l:E?s:0)||0,c,h,d,f,v,p||"horizontal",!R&&C,!B&&E,g||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),P=new qc(M);if(y)for(var O=0,I=!1,L=0;L<m.length;L++){var D=m[L];I?(D.overflow=!0,D.left=1/0,D.top=1/0,!D.newLine&&M.lines[M.lines.length-1].paragraphs.push(D)):P.deal(D),M.lines.length!==O&&(O=M.lines.length,P.lineBuffer.length=0,D.overflow=!0,D.left=1e3,D.top=1e3,M.lines[M.lines.length-1].paragraphs.push(D),I=!0),D.newLine&&(I=!1,P.lineWidth=0)}else for(var j=0;j<m.length;j++)P.deal(m[j]);if(P.send(),!("horizontal"===M.layoutDirection?R:B)){var F=M.getActualSizeWidthEllipsis(),N="horizontal"===M.layoutDirection?F.width:F.height;("horizontal"===M.layoutDirection?C:E)&&(N=Math.min(N,"horizontal"===M.layoutDirection?o:s)),M.lines.forEach((function(t){t.calcOffset(N,!1)}))}this._frameCache=M}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"setStage",value:function(t,e){p(h(n.prototype),"setStage",this).call(this,t,e),this.getFrameCache().icons.forEach((function(n){n.setStage(t,e)}))}},{key:"bindIconEvent",value:function(){var t=this;this.addEventListener("pointermove",(function(e){var n,i,r,a,o,s=t.pickIcon(e.global);s&&s===t._currentHoverIcon||(s?(null===(n=t._currentHoverIcon)||void 0===n||n.setHoverState(!1),t._currentHoverIcon=s,t._currentHoverIcon.setHoverState(!0),null===(i=t.stage)||void 0===i||i.setCursor(s.attribute.cursor),null===(r=t.stage)||void 0===r||r.renderNextFrame()):!s&&t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(a=t.stage)||void 0===a||a.setCursor(),null===(o=t.stage)||void 0===o||o.renderNextFrame()))})),this.addEventListener("pointerleave",(function(e){var n,i;t._currentHoverIcon&&(t._currentHoverIcon.setHoverState(!1),t._currentHoverIcon=null,null===(n=t.stage)||void 0===n||n.setCursor(),null===(i=t.stage)||void 0===i||i.renderNextFrame())}))}},{key:"pickIcon",value:function(t){var e,n=this.getFrameCache(),i=this.globalTransMatrix,r=i.e,a=i.f;return n.icons.forEach((function(n){var i,o;n.AABBBounds.containsPoint({x:t.x-r,y:t.y-a})&&(e=n,e.globalX=(null!==(i=e.attribute.x)&&void 0!==i?i:0)+r,e.globalY=(null!==(o=e.attribute.y)&&void 0!==o?o:0)+a)})),e}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function $c(t){return new Jc(t)}Jc.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},us);var Qc=["path","customPath"].concat(y(is)),th=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="path",i.numberType=Us,i}return c(n,t),u(n,[{key:"pathShape",get:function(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}},{key:"isValid",value:function(){return p(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=zr(this).path;if(!this.valid)return t.path;var e=this.attribute;return e.path instanceof ei?e.path:(gt(this.cache)&&this.doUpdatePathShape(),this.cache instanceof ei?this.cache:t.path)}},{key:"doUpdateAABBBounds",value:function(){var t=zr(this).path;this.doUpdatePathShape(),this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updatePathAABBBounds(e,zr(this).path,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"doUpdatePathShape",value:function(){var t=this.attribute;xt(t.path,!0)?this.cache=(new ei).fromString(t.path):t.customPath&&(this.cache=new ei,t.customPath(this.cache,this))}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"getDefaultAttribute",value:function(t){return zr(this).path[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,Qc)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,Qc)}},{key:"toCustomPath",value:function(){return(new ei).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}}])}(ls);function eh(t){return new th(t)}th.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},us);var nh=["segments","points","curveType","curveTension"].concat(y(is)),ih=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="area",i.numberType=Ds,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){if(this.pathProxy)return!0;var t=this.attribute,e=t.points,n=t.segments;return n?0!==n.length:!!e&&0!==e.length}},{key:"doUpdateAABBBounds",value:function(){var t=zr(this).area;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updateAreaAABBBounds(e,zr(this).area,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),n}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Ea(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return zr(this).area[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,nh)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,nh)}},{key:"toCustomPath",value:function(){var t=new ei,e=this.attribute,n=e.segments,i=function(e){if(e&&e.length){var n=!0,i=[];if(e.forEach((function(e){var r,a;!1!==e.defined&&(n?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(a=e.y1)&&void 0!==a?a:e.y}),n=!1)})),i.length){for(var r=i.length-1;r>=0;r--)t.lineTo(i[r].x,i[r].y);t.closePath()}}};return e.points?i(e.points):n&&n.length&&n.forEach((function(t){i(t.points)})),t}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function rh(t){return new ih(t)}ih.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},us);var ah=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap"].concat(y(is)),oh=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="arc",i.numberType=Is,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.prototype),"isValid",this).call(this)&&this._isValid()}},{key:"_isValid",value:function(){var t=this.attribute,e=t.startAngle,n=t.endAngle,i=t.outerRadius,r=t.innerRadius;return this._validNumber(e)&&this._validNumber(n)&&this._validNumber(i)&&this._validNumber(r)}},{key:"getParsedCornerRadius",value:function(){var t=zr(this).arc,e=this.attribute,n=e.cornerRadius,i=void 0===n?t.cornerRadius:n,r=e.innerPadding,a=void 0===r?t.innerPadding:r,o=e.outerPadding,s=void 0===o?t.outerPadding:o,u=this.attribute,l=u.outerRadius,c=void 0===l?t.outerRadius:l,h=u.innerRadius,d=void 0===h?t.innerRadius:h;if(c+=s,d-=a,0===i||"0%"===i)return 0;var f=Math.abs(c-d),v=function(t){return Math.min(At(t,!0)?t:f*parseFloat(t)/100,f/2)};if(wt(i)){var p=i.map((function(t){return v(t)||0}));return 0===p.length?[p[0],p[0],p[0],p[0]]:2===p.length?[p[0],p[1],p[0],p[1]]:(3===p.length&&p.push(0),p)}return v(i)}},{key:"getParsedAngle",value:function(){var t=zr(this).arc,e=this.attribute,n=e.startAngle,i=void 0===n?t.startAngle:n,r=e.endAngle,a=void 0===r?t.endAngle:r,o=this.attribute.cap,s=void 0===o?t.cap:o,u=a-i>=0?1:-1,l=a-i;if(a=(i=fe(i))+l,s&&qt(l)<Kt-Vt){var c=1,h=1;s.length&&(c=Number(s[0]),h=Number(s[1]));var d=this.attribute,f=d.outerRadius,v=void 0===f?t.outerRadius:f,p=d.innerRadius,g=void 0===p?t.innerRadius:p,y=this.attribute,m=y.outerPadding,k=void 0===m?t.outerPadding:m,b=y.innerPadding;v+=k,g-=void 0===b?t.innerPadding:b;var _=Math.abs(v-g)/2,x=_/v;if(_>Vt&&v>Vt)return{startAngle:i-u*x*c,endAngle:a+u*x*h,sc:u*x*c,ec:u*x*h}}return{startAngle:i,endAngle:a}}},{key:"getParsePadAngle",value:function(t,e){var n=zr(this).arc,i=this.attribute,r=i.innerPadding,a=void 0===r?n.innerPadding:r,o=i.outerPadding,s=void 0===o?n.outerPadding:o,u=i.padAngle,l=void 0===u?n.padAngle:u,c=this.attribute,h=c.outerRadius,d=void 0===h?n.outerRadius:h,f=c.innerRadius,v=void 0===f?n.innerRadius:f;d+=s,v-=a;var p=this.attribute.padRadius,g=void 0===p?ee(d*d+v*v):p,y=qt(e-t),m=t,k=e,b=t,_=e,x=l/2,w=y,S=y;if(x>Vt&&g>Vt){var A=e>t?1:-1,T=re(Number(g)/v*te(x)),C=re(Number(g)/d*te(x));return(w-=2*T)>Vt?(b+=T*=A,_-=T):(w=0,b=_=(t+e)/2),(S-=2*C)>Vt?(m+=C*=A,k-=C):(S=0,m=k=(t+e)/2),{outerStartAngle:m,outerEndAngle:k,innerStartAngle:b,innerEndAngle:_,innerDeltaAngle:w,outerDeltaAngle:S}}return{outerStartAngle:m,outerEndAngle:k,innerStartAngle:b,innerEndAngle:_,innerDeltaAngle:w,outerDeltaAngle:S}}},{key:"doUpdateAABBBounds",value:function(t){var e=zr(this).arc;this._AABBBounds.clear();var n=this.attribute,i=Mi.graphicService.updateArcAABBBounds(n,zr(this).arc,this._AABBBounds,t,this),r=n.boundsPadding,a=void 0===r?e.boundsPadding:r,o=xa(a);return o&&i.expand(o),this.clearUpdateBoundTag(),i}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,ah)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,ah)}},{key:"getDefaultAttribute",value:function(t){return zr(this).arc[t]}},{key:"toCustomPath",value:function(){var t=this.attribute,e=this.getParsedAngle(),n=e.startAngle,i=e.endAngle,r=t.innerRadius-(t.innerPadding||0),a=t.outerRadius-(t.outerPadding||0),o=qt(i-n),s=i>n;if(a<r){var u=a;a=r,r=u}var l=new ei;if(a<=Vt)l.moveTo(0,0);else if(o>=Kt-Vt)l.moveTo(0+a*Jt(n),0+a*te(n)),l.arc(0,0,a,n,i,!s),r>Vt&&(l.moveTo(0+r*Jt(i),0+r*te(i)),l.arc(0,0,r,i,n,s));else{var c=a*Jt(n),h=a*te(n),d=r*Jt(i),f=r*te(i);l.moveTo(0+c,0+h),l.arc(0,0,a,n,i,!s),l.lineTo(0+d,0+f),l.arc(0,0,r,i,n,s),l.closePath()}return l}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function sh(t){return new oh(t)}oh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},us);var uh=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="arc3d",i.numberType=Ls,i}return c(n,t),u(n,[{key:"doUpdateAABBBounds",value:function(){var t=zr(this).arc;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updateArc3dAABBBounds(e,zr(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(oh);function lh(t){return new uh(t)}uh.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},us);var ch=["points","cornerRadius"].concat(y(is)),hh=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="polygon",i.numberType=Ws,i}return c(n,t),u(n,[{key:"isValid",value:function(){return p(h(n.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=zr(this).polygon;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updatePolygonAABBBounds(e,zr(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"tryUpdateOBBBounds",value:function(){throw new Error("暂不支持")}},{key:"_interpolate",value:function(t,e,n,i,r){"points"===t&&(r.points=Ea(n,i,e))}},{key:"getDefaultAttribute",value:function(t){return zr(this).polygon[t]}},{key:"needUpdateTags",value:function(t){return p(h(n.prototype),"needUpdateTags",this).call(this,t,ch)}},{key:"needUpdateTag",value:function(t){return p(h(n.prototype),"needUpdateTag",this).call(this,t,ch)}},{key:"toCustomPath",value:function(){var t=this.attribute.points,e=new ei;return t.forEach((function(t,n){0===n?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}},{key:"clone",value:function(){return new n(Object.assign({},this.attribute))}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(ls);function dh(t){return new hh(t)}hh.NOWORK_ANIMATE_ATTR=us;var fh=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).type="pyramid3d",i.numberType=Vs,i}return c(n,t),u(n,[{key:"doUpdateAABBBounds",value:function(){var t=zr(this).polygon;this._AABBBounds.clear();var e=this.attribute,n=Mi.graphicService.updatePyramid3dAABBBounds(e,zr(this).polygon,this._AABBBounds,this),i=e.boundsPadding,r=void 0===i?t.boundsPadding:i,a=xa(r);return a&&n.expand(a),this.clearUpdateBoundTag(),this._AABBBounds}},{key:"findFace",value:function(){for(var t=this.attribute.points,e=t.map((function(e,n){var i=3===n?t[0]:t[n+1],r=e.x-i.x;return 0===r?0:(e.y-i.y)/r})),n=t.map((function(t){return{p:t,d:0}})),i=!1,r=0,a=0;a<e.length-1;a++){for(var o=a+1;o<e.length;o++){if(e[a]===e[o]){i=!0;var s=le.distancePP(n[a].p,n[a+1].p);n[a].d=s,n[a+1].d=s,r=$t(r,s);var u=le.distancePP(n[o].p,n[o+1].p);n[o].d=u,n[o+1].d=u,r=$t(r,u)}if(i)break}if(i)break}for(var l=t.length-1;l>=0;l--){var c=t[l];n.unshift({p:c,d:0})}for(var h=0;h<t.length;h++){var d=(r-n[h+t.length].d)/2;n[h].d+=d,n[h+t.length].d+=d}var f={polygons:[],vertices:[],edges:[]};return n.forEach((function(t){f.vertices.push([t.p.x,t.p.y,t.d])})),f.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),f.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),f.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),f.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),f.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),f.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),f.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],f}},{key:"_isValid",value:function(){return p(h(n.prototype),"_isValid",this).call(this)&&4===this.attribute.points.length}},{key:"getNoWorkAnimateAttr",value:function(){return n.NOWORK_ANIMATE_ATTR}}])}(hh);function vh(t){return new fh(t)}fh.NOWORK_ANIMATE_ATTR=us;var ph=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[{x:0,y:0}])).type="shadowroot",i.shadowHost=t,i}return c(n,t),u(n,[{key:"addUpdateBoundTag",value:function(){p(h(n.prototype),"addUpdateBoundTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"addUpdateShapeAndBoundsTag",value:function(){p(h(n.prototype),"addUpdateShapeAndBoundsTag",this).call(this),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}},{key:"tryUpdateGlobalTransMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){var e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}},{key:"doUpdateGlobalMatrix",value:function(){if(this.shadowHost){var t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}},{key:"tryUpdateGlobalAABBBounds",value:function(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}])}(nu);function gh(t){return new ph(t)}var yh=function(){return u((function t(){o(this,t)}),[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,a=t.shadowBlur,o=void 0===a?e.shadowBlur:a;if(r){var s=e.outerBorder,u=r.distance,l=void 0===u?s.distance:u,c=r.lineWidth,h=void 0===c?s.lineWidth:c;n.expand(l+(o+h)/2)}return n}}])}(),mh=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"updateBounds",value:function(t,e,n,i){var r=t.outerBorder,a=t.shadowBlur,o=void 0===a?e.shadowBlur:a,s=t.strokeBoundsBuffer,u=void 0===s?e.strokeBoundsBuffer:s;if(r){var l=e.outerBorder,c=r.distance,h=void 0===c?l.distance:c,d=r.lineWidth;Ss(n,h+(o+(void 0===d?l.lineWidth:d))/2,!0,u)}return n}}])}(yh),kh=Symbol.for("MatrixAllocate"),bh=Symbol.for("Mat4Allocate");function _h(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}var xh=function(){return u((function t(){o(this,t),this.pools=[]}),[{key:"allocate",value:function(t,e,n,i,r,a){if(!this.pools.length)return new pe(t,e,n,i,r,a);var o=this.pools.pop();return o.a=t,o.b=e,o.c=n,o.d=i,o.e=r,o.f=a,o}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new pe(t.a,t.b,t.c,t.d,t.e,t.f);var e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),wh=function(){function t(){o(this,t),this.pools=[]}return u(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 n=0;n<e.length;n++)e[n]=t[n];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}}])}(),Sh=new xh,Ah=new wh,Th=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ch=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Eh=function(t,e){return function(n,i){e(n,i,t)}};function Rh(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],d=e[11];return 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+l*i,t[5]=o*r+c*i,t[6]=s*r+h*i,t[7]=u*r+d*i,t[8]=l*r-a*i,t[9]=c*r-o*i,t[10]=h*r-s*i,t[11]=d*r-u*i,t}function Bh(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],d=e[11];return 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-l*i,t[1]=o*r-c*i,t[2]=s*r-h*i,t[3]=u*r-d*i,t[8]=a*i+l*r,t[9]=o*i+c*r,t[10]=s*i+h*r,t[11]=u*i+d*r,t}function Mh(t,e,n){var i,r,a,o,s,u,l,c,h,d,f,v,p=n[0],g=n[1],y=n[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]):(i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=v,t[12]=i*p+s*g+h*y+e[12],t[13]=r*p+u*g+d*y+e[13],t[14]=a*p+l*g+f*y+e[14],t[15]=o*p+c*g+v*y+e[15]),t}function Ph(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Oh(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],p=e[12],g=e[13],y=e[14],m=e[15],k=n[0],b=n[1],_=n[2],x=n[3];return t[0]=k*i+b*s+_*h+x*p,t[1]=k*r+b*u+_*d+x*g,t[2]=k*a+b*l+_*f+x*y,t[3]=k*o+b*c+_*v+x*m,k=n[4],b=n[5],_=n[6],x=n[7],t[4]=k*i+b*s+_*h+x*p,t[5]=k*r+b*u+_*d+x*g,t[6]=k*a+b*l+_*f+x*y,t[7]=k*o+b*c+_*v+x*m,k=n[8],b=n[9],_=n[10],x=n[11],t[8]=k*i+b*s+_*h+x*p,t[9]=k*r+b*u+_*d+x*g,t[10]=k*a+b*l+_*f+x*y,t[11]=k*o+b*c+_*v+x*m,k=n[12],b=n[13],_=n[14],x=n[15],t[12]=k*i+b*s+_*h+x*p,t[13]=k*r+b*u+_*d+x*g,t[14]=k*a+b*l+_*f+x*y,t[15]=k*o+b*c+_*v+x*m,t}function Ih(t,e,n){var i,r=e.attribute,a=r.x,o=void 0===a?n.x:a,s=r.y,u=void 0===s?n.y:s,l=r.z,c=void 0===l?n.z:l,h=r.dx,d=void 0===h?n.dx:h,f=r.dy,v=void 0===f?n.dy:f,p=r.dz,g=void 0===p?n.dz:p,y=r.scaleX,m=void 0===y?n.scaleX:y,k=r.scaleY,b=void 0===k?n.scaleY:k,_=r.scaleZ,x=void 0===_?n.scaleZ:_,w=r.alpha,S=void 0===w?n.alpha:w,A=r.beta,T=void 0===A?n.beta:A,C=r.angle,E=void 0===C?n.angle:C,R=r.anchor3d,B=void 0===R?e.attribute.anchor:R,M=r.anchor,P=[0,0,0];if(B){if("string"==typeof B[0]){var O=parseFloat(B[0])/100,I=e.AABBBounds;P[0]=I.x1+(I.x2-I.x1)*O}else P[0]=B[0];if("string"==typeof B[1]){var L=parseFloat(B[1])/100,D=e.AABBBounds;P[1]=D.x1+(D.x2-D.x1)*L}else P[1]=B[1];P[2]=null!==(i=B[2])&&void 0!==i?i:0}if(function(t){t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1}(t),Mh(t,t,[o+d,u+v,c+g]),Mh(t,t,[P[0],P[1],P[2]]),Rh(t,t,T),Bh(t,t,S),Mh(t,t,[-P[0],-P[1],P[2]]),function(t,e,n){var i=n[0],r=n[1],a=n[2];t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*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,[m,b,x]),E){var j=Ah.allocate(),F=[0,0];if(M){if("string"==typeof B[0]){var N=parseFloat(B[0])/100,G=e.AABBBounds;F[0]=G.x1+(G.x2-G.x1)*N}else F[0]=B[0];if("string"==typeof B[1]){var z=parseFloat(B[1])/100,U=e.AABBBounds;F[1]=U.x1+(U.x2-U.x1)*z}else F[1]=B[1]}Mh(j,j,[F[0],F[1],0]),function(t,e,n){var i=Math.sin(n),r=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=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+l*i,t[1]=o*r+c*i,t[2]=s*r+h*i,t[3]=u*r+d*i,t[4]=l*r-a*i,t[5]=c*r-o*i,t[6]=h*r-s*i,t[7]=d*r-u*i}(j,j,E),Mh(j,j,[-F[0],-F[1],0]),Oh(t,t,j)}}function Lh(t){var e=t.attribute,n=e.alpha,i=e.beta;return n||i}t.DefaultGraphicService=function(){return u((function t(e){o(this,t),this.creator=e,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 de,this.tempAABBBounds2=new de,this._rectBoundsContribitions=[new yh],this._symbolBoundsContribitions=[new mh],this._imageBoundsContribitions=[new yh],this._circleBoundsContribitions=[new yh],this._arcBoundsContribitions=[new yh],this._pathBoundsContribitions=[new yh]}),[{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,n){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,n)}},{key:"onClearIncremental",value:function(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}},{key:"beforeUpdateAABBBounds",value:function(t,e,n,i){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,n,i)}},{key:"afterUpdateAABBBounds",value:function(t,e,n,i,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,n,i,r)}},{key:"updatePathProxyAABBBounds",value:function(t,e){var n="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!n)return!1;var i=new $e(t);return cn(n.commandList,i,0,0),!0}},{key:"updateRectAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,a=t.height,o=t.x1,s=t.y1,u=t.x,l=t.y;r=null!=r?r:o-u,a=null!=a?a:s-l,(isFinite(r)||isFinite(a)||isFinite(u)||isFinite(l))&&n.set(0,0,r||0,a||0)}var c=this.tempAABBBounds1,h=this.tempAABBBounds2;return c.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this._rectBoundsContribitions.length&&this._rectBoundsContribitions.forEach((function(r){r.updateBounds(t,e,c,i),n.union(c),c.setValue(h.x1,h.y1,h.x2,h.y2)})),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updateGroupAABBBounds",value:function(t,e,n,i){var r=n;n=n.clone();var a=t.width,o=t.height,s=t.path,u=t.clip,l=void 0===u?e.clip:u;t.display,s&&s.length?s.forEach((function(t){n.union(t.AABBBounds)})):null!=a&&null!=o&&n.set(0,0,Math.max(0,a),Math.max(0,o)),l||i.forEachChildren((function(t){n.union(t.AABBBounds)}));var c=this.tempAABBBounds1,h=this.tempAABBBounds2;return c.setValue(n.x1,n.y1,n.x2,n.y2),h.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),r.copy(n),r}},{key:"updateGlyphAABBBounds",value:function(t,e,n,i){return this._validCheck(t,e,n,i)?(i.getSubGraphic().forEach((function(t){n.union(t.AABBBounds)})),n):n}},{key:"updateHTMLTextAABBBounds",value:function(t,e,n,i){var r=t.textAlign,a=t.textBaseline;if(null!=t.forceBoundsHeight){var o=At(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=Ku(a,o,o);n.set(n.x1,s,n.x2,s+o)}if(null!=t.forceBoundsWidth){var u=At(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),l=Xu(r,u);n.set(l,n.y1,l+u,n.y2)}}},{key:"updateRichTextAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!i)return n;var r=t.width,a=void 0===r?e.width:r,o=t.height,s=void 0===o?e.height:o,u=t.maxWidth,l=void 0===u?e.maxWidth:u,c=t.maxHeight,h=void 0===c?e.maxHeight:c,d=t.textAlign,f=void 0===d?e.textAlign:d,v=t.textBaseline,p=void 0===v?e.textBaseline:v;if(a>0&&s>0)n.set(0,0,a,s);else{var g=i.getFrameCache().getActualSize(),y=g.width,m=g.height,k=a||y||0,b=s||m||0;b="number"==typeof h&&b>h?h:b||0,k="number"==typeof l&&k>l?l:k||0,n.set(0,0,k,b)}var _=0;switch(p){case"top":_=0;break;case"middle":_=-n.height()/2;break;case"bottom":_=-n.height()}var x=0;switch(f){case"left":x=0;break;case"center":x=-n.width()/2;break;case"right":x=-n.width()}n.translate(x,_);var w=this.tempAABBBounds1,S=this.tempAABBBounds2;return w.setValue(n.x1,n.y1,n.x2,n.y2),S.setValue(n.x1,n.y1,n.x2,n.y2),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,n),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updateTextAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!i)return n;var r=i.attribute.text,a=void 0===r?e.text:r;Array.isArray(a)?i.updateMultilineAABBBounds(a):i.updateSingallineAABBBounds(a);var o=this.tempAABBBounds1,s=this.tempAABBBounds2;o.setValue(n.x1,n.y1,n.x2,n.y2),s.setValue(n.x1,n.y1,n.x2,n.y2);var u=t.scaleX,l=void 0===u?e.scaleX:u,c=t.scaleY,h=void 0===c?e.scaleY:c,d=t.shadowBlur,f=void 0===d?e.shadowBlur:d,v=t.strokeBoundsBuffer,p=void 0===v?e.strokeBoundsBuffer:v;f&&(Ss(o,f/Math.abs(l+h),!0,p),n.union(o));return this.combindShadowAABBBounds(n,i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||this.updateHTMLTextAABBBounds(t,e,n),ce(n,n,i.transMatrix),n}},{key:"updatePathAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||this.updatePathAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2),this._pathBoundsContribitions.length&&this._pathBoundsContribitions.forEach((function(o){o.updateBounds(t,e,r,i),n.union(r),r.setValue(a.x1,a.y1,a.x2,a.y2)}));var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updatePathAABBBoundsImprecise",value:function(t,e,n,i){if(!i)return n;var r=i.getParsedPathShape();return n.union(r.getBounds()),n}},{key:"updatePyramid3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;i.findFace().vertices.forEach((function(t){var e=t[0],i=t[1];n.add(e,i)}));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;return a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updateArc3dAABBBounds",value:function(t,e,n,i){if(!i)return n;var r=i.stage;if(!r||!r.camera)return n;var a=t.outerRadius,o=void 0===a?e.outerRadius:a,s=t.height,u=o+(void 0===s?0:s);n.setValue(-u,-u,u,u);var l=this.tempAABBBounds1,c=this.tempAABBBounds2;return l.setValue(n.x1,n.y1,n.x2,n.y2),c.setValue(n.x1,n.y1,n.x2,n.y2),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"updatePolygonAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||this.updatePolygonAABBBoundsImprecise(t,e,n,i);var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2);var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updatePolygonAABBBoundsImprecise",value:function(t,e,n,i){var r=t.points;return(void 0===r?e.points:r).forEach((function(t){n.add(t.x,t.y)})),n}},{key:"updateLineAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,n,i):this.updateLineAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2);var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updateLineAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,a=void 0===r?e.points:r,o=t.connectedType,s=n;return a.forEach((function(t){!1===t.defined&&"zero"!==o||s.add(t.x,t.y)})),s}},{key:"updateLineAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,a=void 0===r?e.segments:r,o=t.connectedType,s=n;return a.forEach((function(t){t.points.forEach((function(t){!1===t.defined&&"zero"!==o||s.add(t.x,t.y)}))})),s}},{key:"updateAreaAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;this.updatePathProxyAABBBounds(n,i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,n,i):this.updateAreaAABBBoundsByPoints(t,e,n,i));var r=this.tempAABBBounds1,a=this.tempAABBBounds2;r.setValue(n.x1,n.y1,n.x2,n.y2),a.setValue(n.x1,n.y1,n.x2,n.y2);var o=t.lineJoin,s=void 0===o?e.lineJoin:o;return this.transformAABBBounds(t,n,e,"miter"===s,i),n}},{key:"updateAreaAABBBoundsByPoints",value:function(t,e,n,i){var r=t.points,a=void 0===r?e.points:r,o=n;return a.forEach((function(t){var e,n;o.add(t.x,t.y),o.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)})),o}},{key:"updateAreaAABBBoundsBySegments",value:function(t,e,n,i){var r=t.segments,a=void 0===r?e.segments:r,o=n;return a.forEach((function(t){t.points.forEach((function(t){var e,n;o.add(t.x,t.y),o.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(n=t.y1)&&void 0!==n?n:t.y)}))})),o}},{key:"updateCircleAABBBounds",value:function(t,e,n,i,r){if(!this._validCheck(t,e,n,r))return n;this.updatePathProxyAABBBounds(n,r)||(i?this.updateCircleAABBBoundsImprecise(t,e,n,r):this.updateCircleAABBBoundsAccurate(t,e,n,r));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;return a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._circleBoundsContribitions.length&&this._circleBoundsContribitions.forEach((function(i){i.updateBounds(t,e,a,r),n.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2)})),this.transformAABBBounds(t,n,e,!1,r),n}},{key:"updateCircleAABBBoundsImprecise",value:function(t,e,n,i){var r=t.radius,a=void 0===r?e.radius:r;return n.set(-a,-a,a,a),n}},{key:"updateCircleAABBBoundsAccurate",value:function(t,e,n,i){var r=t.startAngle,a=void 0===r?e.startAngle:r,o=t.endAngle,s=void 0===o?e.endAngle:o,u=t.radius,l=void 0===u?e.radius:u;return s-a>Kt-Vt?n.set(-l,-l,l,l):Aa(a,s,l,n),n}},{key:"updateArcAABBBounds",value:function(t,e,n,i,r){if(!this._validCheck(t,e,n,r))return n;this.updatePathProxyAABBBounds(n,r)||(i?this.updateArcAABBBoundsImprecise(t,e,n,r):this.updateArcAABBBoundsAccurate(t,e,n,r));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._arcBoundsContribitions.length&&this._arcBoundsContribitions.forEach((function(i){i.updateBounds(t,e,a,r),n.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2)}));var s=t.lineJoin,u=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,n,e,"miter"===u,r),n}},{key:"updateArcAABBBoundsImprecise",value:function(t,e,n,i){var r=t.outerRadius,a=void 0===r?e.outerRadius:r,o=t.innerRadius,s=void 0===o?e.innerRadius:o,u=t.outerPadding,l=void 0===u?e.outerPadding:u,c=t.innerPadding;return(a+=l)<(s-=void 0===c?e.innerPadding:c)&&(a=s),n.set(-a,-a,a,a),n}},{key:"updateArcAABBBoundsAccurate",value:function(t,e,n,i){var r=t.outerRadius,a=void 0===r?e.outerRadius:r,o=t.innerRadius,s=void 0===o?e.innerRadius:o,u=t.outerPadding,l=void 0===u?e.outerPadding:u,c=t.innerPadding;if((a+=l)<(s-=void 0===c?e.innerPadding:c)){var h=a;a=s,s=h}var d=t.endAngle,f=void 0===d?e.endAngle:d,v=t.startAngle,p=void 0===v?e.startAngle:v;if(p>f){var g=p;p=f,f=g}return a<=Vt?n.set(0,0,0,0):Math.abs(f-p)>Kt-Vt?n.set(-a,-a,a,a):(Aa(p,f,a,n),Aa(p,f,s,n)),n}},{key:"updateSymbolAABBBounds",value:function(t,e,n,i,r){if(!this._validCheck(t,e,n,r))return n;this.updatePathProxyAABBBounds(n,r)||(i?this.updateSymbolAABBBoundsImprecise(t,e,n,r):this.updateSymbolAABBBoundsAccurate(t,e,n,r));var a=this.tempAABBBounds1,o=this.tempAABBBounds2;a.setValue(n.x1,n.y1,n.x2,n.y2),o.setValue(n.x1,n.y1,n.x2,n.y2),this._symbolBoundsContribitions.length&&this._symbolBoundsContribitions.forEach((function(i){i.updateBounds(t,e,a,r),n.union(a),a.setValue(o.x1,o.y1,o.x2,o.y2)}));var s=t.lineJoin,u=void 0===s?e.lineJoin:s;return this.transformAABBBounds(t,n,e,"miter"===u,r),n}},{key:"updateSymbolAABBBoundsImprecise",value:function(t,e,n,i){var r=t.size,a=void 0===r?e.size:r;if(wt(a))n.set(-a[0]/2,-a[1]/2,a[0]/2,a[1]/2);else{var o=a/2;n.set(-o,-o,o,o)}return n}},{key:"updateSymbolAABBBoundsAccurate",value:function(t,e,n,i){if(!i)return n;var r=t.size,a=void 0===r?e.size:r;return i.getParsedPath().bounds(a,n),n}},{key:"updateImageAABBBounds",value:function(t,e,n,i){if(!this._validCheck(t,e,n,i))return n;if(!this.updatePathProxyAABBBounds(n,i)){var r=t.width,a=void 0===r?e.width:r,o=t.height,s=void 0===o?e.height:o;n.set(0,0,a,s)}var u=this.tempAABBBounds1,l=this.tempAABBBounds2;return u.setValue(n.x1,n.y1,n.x2,n.y2),l.setValue(n.x1,n.y1,n.x2,n.y2),this._imageBoundsContribitions.length&&this._imageBoundsContribitions.forEach((function(r){r.updateBounds(t,e,u,i),n.union(u),u.setValue(l.x1,l.y1,l.x2,l.y2)})),this.transformAABBBounds(t,n,e,!1,i),n}},{key:"combindShadowAABBBounds",value:function(t,e){if(e&&e.shadowRoot){var n=e.shadowRoot.AABBBounds;t.union(n)}}},{key:"transformAABBBounds",value:function(t,e,n,i,r){if(!e.empty()){var a=t.scaleX,o=void 0===a?n.scaleX:a,s=t.scaleY,u=void 0===s?n.scaleY:s,l=t.stroke,c=void 0===l?n.stroke:l,h=t.shadowBlur,d=void 0===h?n.shadowBlur:h,f=t.lineWidth,v=void 0===f?n.lineWidth:f,p=t.pickStrokeBuffer,g=void 0===p?n.pickStrokeBuffer:p,y=t.strokeBoundsBuffer,m=void 0===y?n.strokeBoundsBuffer:y,k=this.tempAABBBounds1,b=this.tempAABBBounds2;if(c&&v)Ss(k,(v+g)/Math.abs(o+u),i,m),e.union(k),k.setValue(b.x1,b.y1,b.x2,b.y2);if(d){var _=t.shadowOffsetX,x=void 0===_?n.shadowOffsetX:_,w=t.shadowOffsetY,S=void 0===w?n.shadowOffsetY:w;Ss(k,d/Math.abs(o+u)*2,!1,m+1),k.translate(x,S),e.union(k)}}if(this.combindShadowAABBBounds(e,r),!e.empty()){var A=!0,T=r.transMatrix;r&&r.isContainer&&(A=!(1===T.a&&0===T.b&&0===T.c&&1===T.d&&0===T.e&&0===T.f)),A&&ce(e,e,T)}}},{key:"_validCheck",value:function(t,e,n,i){if(!i)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!i.valid)return n.clear(),!1;var r=t.visible;return!!(void 0===r?e.visible:r)||(n.clear(),!1)}}])}(),t.DefaultGraphicService=Th([L(),Eh(0,O(Js)),Ch("design:paramtypes",[Object])],t.DefaultGraphicService);var Dh,jh,Fh=new(function(){return u((function t(){o(this,t),this.store=new Map}),[{key:"RegisterGraphicCreator",value:function(t,e){this.store.set(t,e),this[t]=e}},{key:"CreateGraphic",value:function(t,e){var n=this.store.get(t);return n?n(e):null}}])}());function Nh(t){return Dh||(Dh=Fh.CreateGraphic("text",{})),Dh.initAttributes(t),Dh.AABBBounds}var Gh={x:0,y:0,z:0,lastModelMatrix:null},zh=function(){return u((function t(){o(this,t)}),[{key:"init",value:function(e){var n=this;e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((function(t){return n._renderContribitions.push(t)})),this._renderContribitions.length&&(this._renderContribitions.sort((function(t,e){return e.order-t.order})),this._beforeRenderContribitions=this._renderContribitions.filter((function(e){return e.time===t.BaseRenderContributionTime.beforeFillStroke})),this._afterRenderContribitions=this._renderContribitions.filter((function(e){return e.time===t.BaseRenderContributionTime.afterFillStroke})))}},{key:"beforeRenderStep",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((function(f){f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,a,o,s,u,l,c,h,d)}))}},{key:"afterRenderStep",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((function(f){f.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(f.supportedAppName)?f.supportedAppName:[f.supportedAppName]).includes(t.stage.params.context.appName)||f.drawShape(t,e,n,i,r,a,o,s,u,l,c,h,d)}))}},{key:"valid",value:function(t,e,n,i){var r=t.attribute,a=r.fill,o=void 0===a?e.fill:a,s=r.background,u=r.stroke,l=void 0===u?e.stroke:u,c=r.opacity,h=void 0===c?e.opacity:c,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,m=r.visible,k=void 0===m?e.visible:m,b=yu(h,f,o),_=ku(h,y),x=pu(o,s),w=gu(l,p);return!(!t.valid||!k)&&!(!x&&!w)&&!!(b||_||n||i||s)&&{fVisible:b,sVisible:_,doFill:x,doStroke:w}}},{key:"transform",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t.attribute,a=r.x,o=void 0===a?e.x:a,s=r.y,u=void 0===s?e.y:s,l=r.z,c=void 0===l?e.z:l,h=r.scaleX,d=void 0===h?e.scaleX:h,f=r.scaleY,v=void 0===f?e.scaleY:f,p=r.angle,g=void 0===p?e.angle:p,y=r.postMatrix,m=n.modelMatrix,k=n.camera;Gh.x=o,Gh.y=u,Gh.z=c,Gh.lastModelMatrix=m;var b=k&&(i||Lh(t)),_=b?t.transMatrix.onlyTranslate()&&!y:1===d&&1===v&&0===g&&!y;if(b){var x=Ah.allocate(),w=Ah.allocate();Ih(w,t,e),Oh(x,m||x,w),Gh.x=0,Gh.y=0,Gh.z=0,n.modelMatrix=x,n.setTransform(1,0,0,1,0,0,!0),Ah.free(w)}if(_&&!m){var S=t.getOffsetXY(e);Gh.x+=S.x,Gh.y+=S.y,Gh.z=c,n.setTransformForCurrent()}else if(b)Gh.x=0,Gh.y=0,Gh.z=0,n.setTransform(1,0,0,1,0,0,!0);else if(k&&n.project){var A=t.getOffsetXY(e);Gh.x+=A.x,Gh.y+=A.y,this.transformWithoutTranslate(n,Gh.x,Gh.y,Gh.z,d,v,g)}else n.transformFromMatrix(t.transMatrix,!0),Gh.x=0,Gh.y=0,Gh.z=0;return Gh}},{key:"transformUseContext2d",value:function(t,e,n,i){var r=i.camera;if(this.camera=r,r){var a=t.AABBBounds,o=a.x2-a.x1,s=a.y2-a.y1,u=i.project(0,0,n),l=i.project(o,0,n),c=i.project(o,s,n),h={x:0,y:0},d={x:o,y:0},f={x:o,y:s};i.camera=null;var v=1/(h.x*(f.y-d.y)-d.x*f.y+f.x*d.y+(d.x-f.x)*h.y),p=-(h.y*(c.x-l.x)-d.y*c.x+f.y*l.x+(d.y-f.y)*u.x)*v,g=(d.y*c.y+h.y*(l.y-c.y)-f.y*l.y+(f.y-d.y)*u.y)*v,y=(h.x*(c.x-l.x)-d.x*c.x+f.x*l.x+(d.x-f.x)*u.x)*v,m=-(d.x*c.y+h.x*(l.y-c.y)-f.x*l.y+(f.x-d.x)*u.y)*v,k=(h.x*(f.y*l.x-d.y*c.x)+h.y*(d.x*c.x-f.x*l.x)+(f.x*d.y-d.x*f.y)*u.x)*v,b=(h.x*(f.y*l.y-d.y*c.y)+h.y*(d.x*c.y-f.x*l.y)+(f.x*d.y-d.x*f.y)*u.y)*v;i.setTransform(p,g,y,m,k,b,!0)}}},{key:"restoreTransformUseContext2d",value:function(t,e,n,i){this.camera&&(i.camera=this.camera)}},{key:"transformWithoutTranslate",value:function(t,e,n,i,r,a,o){var s=t.project(e,n,i);t.translate(s.x,s.y,!1),t.scale(r,a,!1),t.rotate(o,!1),t.translate(-s.x,-s.y,!1),t.setTransformForCurrent()}},{key:"_draw",value:function(t,e,n,i,r){var a=i.context;if(a&&!1!==t.attribute.renderable){a.highPerformanceSave();var o=this.transform(t,e,a,n),s=o.x,u=o.y,l=o.z,c=o.lastModelMatrix;this.z=l,_u(t,a,s,u,0,r)||(this.drawShape(t,a,s,u,i,r),this.z=0,a.modelMatrix!==c&&Ah.free(a.modelMatrix),a.modelMatrix=c),a.highPerformanceRestore()}}}])}(),Uh=function(){var t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){var n=new Error(e+": "+t);throw n.source=e,n}function i(){return r("linear",t.linearGradient,a)||r("radial",t.radialGradient,s)||r("conic",t.conicGradient,o)}function r(e,i,r){return function(i,a){var o,s=y(i);if(s){y(t.startCall)||n("Missing (");var u=((o=r())&&(y(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:d(f)});return y(t.endCall)||n("Missing )"),u}}(i)}function a(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function o(){return g("angular",t.fromAngleValue,1)}function s(){var n,i,r=u();return r&&((n=[]).push(r),i=e,y(t.comma)&&((r=u())?n.push(r):e=i)),n}function u(){var t,e=function(){var t=g("shape",/^(circle)/i,0);return t&&(t.style=p()||l()),t}()||((t=g("shape",/^(ellipse)/i,0))&&(t.style=v()||l()),t);if(e)e.at=c();else{var n=l();if(n){e=n;var i=c();i&&(e.at=i)}else{var r=h();r&&(e={type:"default-radial",at:r})}}return e}function l(){return g("extent-keyword",t.extentKeywords,1)}function c(){if(g("position",/^at/,0)){var t=h();return t||n("Missing positioning value"),t}}function h(){var t={x:v(),y:v()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var i=e(),r=[];if(i)for(r.push(i);y(t.comma);)(i=e())?r.push(i):n("One extra comma");return r}function f(){var e=g("hex",t.hexColor,1)||g("rgba",t.rgbaColor,1)||g("rgb",t.rgbColor,1)||g("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=v(),e}function v(){return g("%",t.percentageValue,1)||g("position-keyword",t.positionKeywords,1)||p()}function p(){return g("px",t.pixelValue,1)||g("em",t.emValue,1)}function g(t,e,n){var i=y(e);if(i)return{type:t,value:i[n]}}function y(t){var n=/^[\n\r\t\s]+/.exec(e);n&&m(n[0].length);var i=t.exec(e);return i&&m(i[0].length),i}function m(t){e=e.substr(t)}return function(t){return e=t.toString(),r=d(i),e.length>0&&n("Invalid input not EOF"),r;var r}}(),Wh=function(){function t(){o(this,t)}return u(t,null,[{key:"IsGradient",value:function(t){return!("string"==typeof t&&!t.includes("gradient"))}},{key:"IsGradientStr",value:function(t){return"string"==typeof t&&t.includes("gradient")}},{key:"Parse",value:function(e){if(t.IsGradientStr(e))try{var n=Uh(e)[0];if(n){if("linear"===n.type)return t.ParseLinear(n);if("radial"===n.type)return t.ParseRadial(n);if("conic"===n.type)return t.ParseConic(n)}}catch(t){return e}return e}},{key:"ParseConic",value:function(t){var e=t.orientation,n=t.colorStops,i=void 0===n?[]:n,r=Ht/2,a=parseFloat(e.value)/180*Ht-r;return{gradient:"conical",x:.5,y:.5,startAngle:a,endAngle:a+Kt,stops:i.map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}},{key:"ParseRadial",value:function(t){var e=t.colorStops;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:(void 0===e?[]:e).map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}},{key:"ParseLinear",value:function(t){for(var e=t.orientation,n=t.colorStops,i=void 0===n?[]:n,r=Ht/2,a="angular"===e.type?parseFloat(e.value)/180*Ht:0;a<0;)a+=Kt;for(;a>Kt;)a-=Kt;var o=0,s=0,u=0,l=0;return a<r?(o=0,s=1,u=Math.sin(a),l=Math.cos(a)):a<Ht?(o=0,s=0,u=Math.cos(a-r),l=Math.sin(a-r)):a<Ht+r?(s=0,u=(o=1)-Math.sin(a-Ht),l=Math.cos(a-Ht)):(u=(o=1)-Math.cos(a-r-Ht),l-=Math.sin(a-r-Ht)),{gradient:"linear",x0:o,y0:s,x1:u,y1:l,stops:i.map((function(t){return{color:t.value,offset:parseFloat(t.length.value)/100}}))}}}])}();function Vh(t,e,n){var i=e,r=t.currentMatrix,a=r.a,o=r.b,s=r.c,u=r.d,l=Math.sign(a)*Math.sqrt(a*a+o*o),c=Math.sign(u)*Math.sqrt(s*s+u*u);return l+c===0?0:i=i/Math.abs(l+c)*2*n}function Hh(t,e,n,i,r){if(!e||!0===e)return"black";var a,o;if(wt(e))for(var s=0;s<e.length&&!(o=e[s]);s++);else o=e;return"string"==typeof(o=Wh.Parse(o))?o:("linear"===o.gradient?a=function(t,e,n){var i,r,a,o,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=n.AABBBounds;if(!l)return;var c=l.x2-l.x1,h=l.y2-l.y1,d=l.x1-s,f=l.y1-u;if(n.attribute){var v=n.attribute,p=v.scaleX,g=void 0===p?1:p,y=v.scaleY,m=void 0===y?1:y;if(g*m==0)return;c/=g,h/=m,d/=g,f/=m}var k=t.createLinearGradient(d+(null!==(i=e.x0)&&void 0!==i?i:0)*c,f+(null!==(r=e.y0)&&void 0!==r?r:0)*h,d+(null!==(a=e.x1)&&void 0!==a?a:1)*c,f+(null!==(o=e.y1)&&void 0!==o?o:0)*h);return e.stops.forEach((function(t){k.addColorStop(t.offset,t.color)})),k}(t,o,n,i,r):"conical"===o.gradient?a=function(t,e,n){var i,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=n.AABBBounds;if(!s)return;var u=s.x2-s.x1,l=s.y2-s.y1,c=s.x1-a,h=s.y1-o;if(n.attribute){var d=n.attribute,f=d.scaleX,v=void 0===f?1:f,p=d.scaleY,g=void 0===p?1:p;if(v*g==0)return;u/=v,l/=g,c/=v,h/=g}var y=t.createConicGradient(c+(null!==(i=e.x)&&void 0!==i?i:0)*u,h+(null!==(r=e.y)&&void 0!==r?r:0)*l,e.startAngle,e.endAngle);return e.stops.forEach((function(t){y.addColorStop(t.offset,t.color)})),y.GetPattern(u+c,l+h,void 0)}(t,o,n,i,r):"radial"===o.gradient&&(a=function(t,e,n){var i,r,a,o,s,u,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,h=n.AABBBounds;if(!h)return;var d=h.x2-h.x1,f=h.y2-h.y1,v=h.x1-l,p=h.y1-c;if(n.attribute){var g=n.attribute,y=g.scaleX,m=void 0===y?1:y,k=g.scaleY,b=void 0===k?1:k;if(m*b==0)return;v/=m,p/=b,d/=m,f/=b}var _=t.createRadialGradient(v+(null!==(i=e.x0)&&void 0!==i?i:.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!==(o=e.x1)&&void 0!==o?o:.5)*d,p+(null!==(s=e.y1)&&void 0!==s?s:.5)*f,Math.max(d,f)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((function(t){_.addColorStop(t.offset,t.color)})),_}(t,o,n,i,r)),a||"orange")}var Yh=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Xh=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kh=function(t,e){return function(n,i){e(n,i,t)}},qh=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f,v=t.attribute,p=v.background,g=v.backgroundOpacity,y=void 0===g?null!==(f=t.attribute.fillOpacity)&&void 0!==f?f:u.backgroundOpacity:g,m=v.opacity,k=void 0===m?u.opacity:m,b=v.backgroundMode,_=void 0===b?u.backgroundMode:b,x=v.backgroundFit,w=void 0===x?u.backgroundFit:x;if(p)if(t.backgroundImg&&t.resources){var S=t.resources.get(p);if("success"!==S.state||!S.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var A=zr(t.parent).group,T=t.parent.attribute,C=T.scrollX,E=void 0===C?A.scrollX:C,R=T.scrollY,B=void 0===R?A.scrollY:R;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(E,B)}e.clip();var M=t.AABBBounds;e.setCommonStyle(t,t.attribute,n,i,u),e.globalAlpha=y*k,this.doDrawImage(e,S.data,M,_,w),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,u),e.globalAlpha=y*k,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}},{key:"doDrawImage",value:function(t,e,n,i,r){if("no-repeat"===i)t.drawImage(e,n.x1,n.y1,n.width(),n.height());else{var a=n.width(),o=n.height(),s=a,u=o;if(r&&"repeat"!==i&&(e.width||e.height)){var l=e.width,c=e.height;"repeat-x"===i?(s=l*(o/c),u=o):"repeat-y"===i&&(u=c*(a/l),s=a);var h=t.dpr,d=Sr.allocate({width:s,height:u,dpr:h}),f=d.getContext("2d");f&&(f.inuse=!0,f.clearMatrix(),f.setTransformForCurrent(!0),f.clearRect(0,0,s,u),f.drawImage(e,0,0,s,u),e=d.nativeCanvas),Sr.free(d)}var v=t.dpr,p=t.createPattern(e,i);p.setTransform&&p.setTransform(new DOMMatrix([1/v,0,0,1/v,0,0])),t.fillStyle=p,t.translate(n.x1,n.y1),t.fillRect(0,0,a,o),t.translate(-n.x1,-n.y1)}}}])}(),Zh=new qh;t.DefaultBaseInteractiveRenderContribution=function(){return u((function e(n){o(this,e),this.subRenderContribitions=n,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((function(f){f.render(t,e,n,i,r,a,o,s,u,l,c,h,d)}))}}])}(),t.DefaultBaseInteractiveRenderContribution=Yh([L(),Kh(0,O($)),Kh(0,D(zu)),Xh("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);var Jh=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}),[{key:"createCommonPattern",value:function(t,e,n,i,r){var a=(t-2*e)/2,o=i.dpr,s=Sr.allocate({width:t,height:t,dpr:o}),u=s.getContext("2d");if(!u)return null;u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,t,t),r(a,u);var l=i.createPattern(s.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),Sr.free(s),l}},{key:"createCirclePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,e){e.fillStyle=n,e.arc(t,t,t,0,Kt),e.fill()}))}},{key:"createDiamondPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){var r=t/2,a=r;i.fillStyle=n,i.moveTo(r,a-e),i.lineTo(e+r,a),i.lineTo(r,a+e),i.lineTo(r-e,a),i.closePath(),i.fill()}))}},{key:"createRectPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,a=r;i.fillStyle=n,i.fillRect(r,a,2*t,2*t)}))}},{key:"createVerticalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var a=e;r.fillStyle=n,r.fillRect(a,0,2*i,t)}))}},{key:"createHorizontalLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(i,r){var a=e;r.fillStyle=n,r.fillRect(0,a,t,2*i)}))}},{key:"createBiasLRLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(0,0),i.lineTo(t,t);var r=t/2,a=-r;i.moveTo(r,a),i.lineTo(r+t,a+t),i.moveTo(-r,-a),i.lineTo(-r+t,-a+t),i.stroke()}))}},{key:"createBiasRLLinePattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(e,i){i.strokeStyle=n,i.lineWidth=e,i.moveTo(t,0),i.lineTo(0,t);var r=t/2,a=r;i.moveTo(t+r,a),i.lineTo(r,a+t),i.moveTo(t-r,-a),i.lineTo(-r,-a+t),i.stroke()}))}},{key:"createGridPattern",value:function(t,e,n,i){return this.createCommonPattern(t,e,n,i,(function(t,i){var r=e,a=r;i.fillStyle=n,i.fillRect(r,a,t,t),i.fillRect(r+t,a+t,t,t)}))}},{key:"initTextureMap",value:function(t,e){this.textureMap=new Map}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){this.textureMap||this.initTextureMap(e,t.stage);var f=t.attribute,v=f.texture,p=void 0===v?u.texture:v,g=f.textureColor,y=void 0===g?u.textureColor:g,m=f.textureSize,k=void 0===m?u.textureSize:m,b=f.texturePadding,_=void 0===b?u.texturePadding:b;p&&this.drawTexture(p,t,e,n,i,u,y,k,_)}},{key:"drawTexture",value:function(t,e,n,i,r,a,o,s,u){var l=this.textureMap.get(t);if(!l)switch(t){case"circle":l=this.createCirclePattern(s,u,o,n);break;case"diamond":l=this.createDiamondPattern(s,u,o,n);break;case"rect":l=this.createRectPattern(s,u,o,n);break;case"vertical-line":l=this.createVerticalLinePattern(s,u,o,n);break;case"horizontal-line":l=this.createHorizontalLinePattern(s,u,o,n);break;case"bias-lr":l=this.createBiasLRLinePattern(s,u,o,n);break;case"bias-rl":l=this.createBiasRLLinePattern(s,u,o,n);break;case"grid":l=this.createGridPattern(s,u,o,n)}l&&(n.highPerformanceSave(),n.setCommonStyle(e,e.attribute,i,r,a),n.fillStyle=l,n.fill(),n.highPerformanceRestore())}}])}(),$h=new Jh,Qh=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){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,m=y.innerPadding,k=void 0===m?u.innerPadding:m,b=y.outerPadding,_=void 0===b?u.outerPadding:b,x=y.startAngle,w=void 0===x?u.startAngle:x,S=y.endAngle,A=void 0===S?u.endAngle:S,T=y.opacity,C=void 0===T?u.opacity:T,E=y.x,R=void 0===E?u.x:E,B=y.y,M=void 0===B?u.y:B,P=y.scaleX,O=void 0===P?u.scaleX:P,I=y.scaleY,L=void 0===I?u.scaleY:I,D=t.attribute,j=D.innerRadius,F=void 0===j?u.innerRadius:j,N=D.outerRadius,G=void 0===N?u.outerRadius:N;G+=_,F-=k;var z=!(!f||!f.stroke),U=!(!v||!v.stroke);if(p){var W=f.distance,V=void 0===W?u.outerBorder.distance:W,H=Vh(e,V,e.dpr),Y=V/G;if(t.setAttributes({outerRadius:G+H,innerRadius:F-H,startAngle:w-Y,endAngle:A+Y}),e.beginPath(),Su(t,e,n,i,G+H,F-H),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,f,u.outerBorder);else if(z){var X=u.outerBorder.opacity;u.outerBorder.opacity=C,e.setStrokeStyle(t,f,(R-n)/O,(M-i)/L,u.outerBorder),u.outerBorder.opacity=X,e.stroke()}}if(g){var K=v.distance,q=void 0===K?u.innerBorder.distance:K,Z=Vh(e,q,e.dpr),J=q/G;if(t.setAttributes({outerRadius:G-Z,innerRadius:F+Z,startAngle:w+J,endAngle:A-J}),e.beginPath(),Su(t,e,n,i,G-Z,F+Z),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.innerBorder);else if(U){var $=u.innerBorder.opacity;u.innerBorder.opacity=C,e.setStrokeStyle(t,v,(R-n)/O,(M-i)/L,u.innerBorder),u.innerBorder.opacity=$,e.stroke()}}t.setAttributes({outerRadius:G,innerRadius:F,startAngle:w,endAngle:A})}}}])}(),td=new Qh,ed=$h,nd=Zh,id=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){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,m=y.radius,k=void 0===m?u.radius:m,b=y.startAngle,_=void 0===b?u.startAngle:b,x=y.endAngle,w=void 0===x?u.endAngle:x,S=y.opacity,A=void 0===S?u.opacity:S,T=y.x,C=void 0===T?u.x:T,E=y.y,R=void 0===E?u.y:E,B=y.scaleX,M=void 0===B?u.scaleX:B,P=y.scaleY,O=void 0===P?u.scaleY:P,I=!(!f||!f.stroke),L=!(!v||!v.stroke);if(p){var D=f.distance,j=Vh(e,void 0===D?u.outerBorder.distance:D,e.dpr);if(e.beginPath(),e.arc(n,i,k+j,_,w),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,f,u.outerBorder);else if(I){var F=u.outerBorder.opacity;u.outerBorder.opacity=A,e.setStrokeStyle(t,f,(C-n)/M,(R-i)/O,u.outerBorder),u.outerBorder.opacity=F,e.stroke()}}if(g){var N=v.distance,G=Vh(e,void 0===N?u.innerBorder.distance:N,e.dpr);if(e.beginPath(),e.arc(n,i,k-G,_,w),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.innerBorder);else if(L){var z=u.innerBorder.opacity;u.innerBorder.opacity=A,e.setStrokeStyle(t,v,(C-n)/M,(R-i)/O,u.innerBorder),u.innerBorder.opacity=z,e.stroke()}}}}}])}(),rd=new id,ad=$h,od=Zh,sd=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.beforeFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.background,v=d.backgroundMode,p=void 0===v?u.backgroundMode:v,g=d.backgroundFit,y=void 0===g?u.backgroundFit:g;if(f)if(t.backgroundImg&&t.resources){var m=t.resources.get(f);if("success"!==m.state||!m.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);var k=t.AABBBounds;this.doDrawImage(e,m.data,k,p,y),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=f,e.fill(),e.highPerformanceRestore()}}])}(qh),ud=new sd,ld=Ht/2;function cd(t,e,n,i,r,a){var o;if(i<0&&(e+=i,i=-i),r<0&&(n+=r,r=-r),At(a,!0))o=[a=qt(a),a,a,a];else if(Array.isArray(a)){var s,u,l=a;switch(l.length){case 0:o=[0,0,0,0];break;case 1:o=[s=qt(l[0]),s,s,s];break;case 2:case 3:o=[s=qt(l[0]),u=qt(l[1]),s,u];break;default:(o=l)[0]=qt(o[0]),o[1]=qt(o[1]),o[2]=qt(o[2]),o[3]=qt(o[3])}}else o=[0,0,0,0];if(i<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,n,i,r);var c=[e,n],h=[e+i,n],d=[e+i,n+r],f=[e,n+r],v=Math.min(i/2,r/2),p=[Math.min(v,o[0]),Math.min(v,o[1]),Math.min(v,o[2]),Math.min(v,o[3])],g=[c[0]+p[0],c[1]],y=[c[0],c[1]+p[0]],m=[h[0]-p[1],h[1]],k=[h[0],h[1]+p[1]],b=[d[0]-p[2],d[1]],_=[d[0],d[1]-p[2]],x=[f[0]+p[3],f[1]],w=[f[0],f[1]-p[3]];if(t.moveTo(g[0],g[1]),t.lineTo(m[0],m[1]),!Lt(m,k)){var S=m[0],A=m[1]+p[1];t.arc(S,A,p[1],-ld,0,!1)}if(t.lineTo(_[0],_[1]),!Lt(b,_)){var T=_[0]-p[2],C=_[1];t.arc(T,C,p[2],0,ld,!1)}if(t.lineTo(x[0],x[1]),!Lt(x,w)){var E=x[0],R=x[1]-p[3];t.arc(E,R,p[3],ld,Ht,!1)}if(t.lineTo(y[0],y[1]),!Lt(g,y)){var B=g[0],M=g[1]+p[0];t.arc(B,M,p[0],Ht,Ht+ld,!1)}return t.closePath(),t}var hd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},dd=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){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,m=y.cornerRadius,k=void 0===m?u.cornerRadius:m,b=y.opacity,_=void 0===b?u.opacity:b,x=y.x,w=void 0===x?u.x:x,S=y.y,A=void 0===S?u.y:S,T=y.scaleX,C=void 0===T?u.scaleX:T,E=y.scaleY,R=void 0===E?u.scaleY:E,B=y.x1,M=y.y1,P=t.attribute,O=P.width,I=P.height;O=(null!=O?O:B-n)||0,I=(null!=I?I:M-i)||0;var L=!(!f||!f.stroke),D=!(!v||!v.stroke);if(p){var j=f.distance,F=Vh(e,void 0===j?u.outerBorder.distance:j,e.dpr),N=n-F,G=i-F,z=2*F;if(0===k||wt(k)&&k.every((function(t){return 0===t}))?(e.beginPath(),e.rect(N,G,O+z,I+z)):(e.beginPath(),cd(e,N,G,O+z,I+z,k)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,f,u.outerBorder);else if(L){var U=u.outerBorder.opacity;u.outerBorder.opacity=_,e.setStrokeStyle(t,f,(w-n)/C,(A-i)/R,u.outerBorder),u.outerBorder.opacity=U,e.stroke()}}if(g){var W=v.distance,V=Vh(e,void 0===W?u.innerBorder.distance:W,e.dpr),H=n+V,Y=i+V,X=2*V;if(0===k||wt(k)&&k.every((function(t){return 0===t}))?(e.beginPath(),e.rect(H,Y,O-X,I-X)):(e.beginPath(),cd(e,H,Y,O-X,I-X,k)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.innerBorder);else if(D){var K=u.innerBorder.opacity;u.innerBorder.opacity=_,e.setStrokeStyle(t,v,(w-n)/C,(A-i)/R,u.innerBorder),u.innerBorder.opacity=K,e.stroke()}}}}}])}();t.SplitRectBeforeRenderContribution=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f=t.attribute.stroke,v=void 0===f?u.stroke:f;Array.isArray(v)&&v.some((function(t){return!1===t}))&&(d.doStroke=!1)}}])}(),t.SplitRectBeforeRenderContribution=hd([L()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.x1,v=d.y1,p=d.x,g=void 0===p?u.x:p,y=d.y,m=void 0===y?u.y:y,k=d.stroke,b=void 0===k?u.stroke:k,_=t.attribute,x=_.width,w=_.height;if(x=(null!=x?x:f-g)||0,w=(null!=w?w:v-m)||0,Array.isArray(b)&&b.some((function(t){return!1===t}))){if(e.setStrokeStyle(t,t.attribute,n,i,u),e.beginPath(),e.moveTo(n,i),b[0]?e.lineTo(n+x,i):e.moveTo(n+x,i),b[1]?e.lineTo(n+x,i+w):e.moveTo(n+x,i+w),b[2]?e.lineTo(n,i+w):e.moveTo(n,i+w),b[3]){var S=b[0]?i-e.lineWidth/2:i;e.lineTo(n,S)}else e.moveTo(n,i);e.stroke()}}}])}(),t.SplitRectAfterRenderContribution=hd([L()],t.SplitRectAfterRenderContribution);var fd=new dd,vd=$h,pd=Zh,gd=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.beforeFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d=t.attribute,f=d.background,v=d.backgroundMode,p=void 0===v?u.backgroundMode:v,g=d.backgroundFit,y=void 0===g?u.backgroundFit:g;if(f)if(t.backgroundImg){var m=t.resources.get(f);if("success"!==m.state||!m.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){var k=zr(t.parent).group,b=t.parent.attribute,_=b.scrollX,x=void 0===_?k.scrollX:_,w=b.scrollY,S=void 0===w?k.scrollY:w;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(x,S)}var A=t.AABBBounds;this.doDrawImage(e,m.data,A,p,y),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(mt(f)){var T=f.stroke,C=f.fill,E=f.lineWidth,R=void 0===E?1:E,B=f.cornerRadius,M=void 0===B?0:B,P=f.expandX,O=void 0===P?0:P,I=f.expandY,L=void 0===I?0:I;if(!T&&!C)return;e.beginPath();var D=function(t){var e=xa(t.attribute.boundsPadding),n=t.AABBBounds,i=n.x1,r=n.y1,a=n.width(),o=n.height();return At(e)?(i+=e,r+=e,a-=2*e,o-=2*e):(i+=e[3],r+=e[0],a-=e[1]+e[3],o-=e[0]+e[2]),{x:i,y:r,width:a,height:o}}(t),j=D.x,F=D.y,N=D.width,G=D.height;M?cd(e,j-O,F-L,N+2*O,G+2*L,M):e.rect(j-O,F-L,N+2*O,G+2*L),e.globalAlpha=1,C&&(e.fillStyle=C,e.fill()),T&&R>0&&(e.lineWidth=R,e.strokeStyle=T,e.stroke())}else{e.beginPath();var z=t.AABBBounds;e.rect(n,i,z.width(),z.height()),e.fillStyle=f,e.globalAlpha=1,e.fill()}}}])}(qh);var yd=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.afterFillStroke,n.useStyle=!0,n.order=0,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,r,a,o,s,u,l,c,d,f){return p(h(i.prototype),"drawShape",this).call(this,t,e,n,r,a,o,s,u,l,c,d,f)}}])}(dd),md=new yd,kd=new gd,bd=function(){return u((function e(){o(this,e),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){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 m=t.attribute,k=m.size,b=void 0===k?u.size:k,_=m.opacity,x=void 0===_?u.opacity:_,w=m.x,S=void 0===w?u.x:w,A=m.y,T=void 0===A?u.y:A,C=m.scaleX,E=void 0===C?u.scaleX:C,R=m.scaleY,B=void 0===R?u.scaleY:R,M=!(!v||!v.stroke),P=!(!p||!p.stroke);if(g){var O=v.distance,I=Vh(e,void 0===O?u.outerBorder.distance:O,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,b,n,i,I)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,v,u.outerBorder);else if(M){var L=u.outerBorder.opacity;u.outerBorder.opacity=x,e.setStrokeStyle(t,v,(S-n)/E,(T-i)/B,u.outerBorder),u.outerBorder.opacity=L,e.stroke()}}if(y){var D=p.distance,j=Vh(e,void 0===D?u.innerBorder.distance:D,e.dpr);if(e.beginPath(),!1===d.drawOffset(e,b,n,i,-j)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),h)h(e,p,u.innerBorder);else if(P){var F=u.innerBorder.opacity;u.innerBorder.opacity=x,e.setStrokeStyle(t,p,(S-n)/E,(T-i)/B,u.innerBorder),u.innerBorder.opacity=F,e.stroke()}}}}}}])}(),_d=new bd,xd=$h,wd=Zh,Sd=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.afterFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f,v,p,g;this.textureMap||this.initTextureMap(e,t.stage);var y=(d||{}).attribute,m=void 0===y?t.attribute:y,k=m.texture,b=void 0===k?null!==(f=t.attribute.texture)&&void 0!==f?f:Ma(u,"texture"):k,_=m.textureColor,x=void 0===_?null!==(v=t.attribute.textureColor)&&void 0!==v?v:Ma(u,"textureColor"):_,w=m.textureSize,S=void 0===w?null!==(p=t.attribute.textureSize)&&void 0!==p?p:Ma(u,"textureSize"):w,A=m.texturePadding,T=void 0===A?null!==(g=t.attribute.texturePadding)&&void 0!==g?g:Ma(u,"texturePadding"):A;b&&this.drawTexture(b,t,e,n,i,u,x,S,T)}}])}(Jh),Ad=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Td=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cd=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasArcRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).arcRenderContribitions=t,i.numberType=Is,i.builtinContributions=[td,nd,ed],i.init(t),i}return c(n,t),u(n,[{key:"drawArcTailCapPath",value:function(t,e,n,i,r,a,o,s){var u=s-o,l=t.getParsedAngle(),c=l.startAngle,h=l.endAngle,d=qt((h=s)-c),f=h>c,v=!1;if(r<a){var p=r;r=a,a=p}var g=t.getParsedCornerRadius(),y=wt(g),m=t.getParsePadAngle(c,h);m.outerDeltaAngle;var k,b,_,x,w=m.innerDeltaAngle,S=m.outerStartAngle,A=m.outerEndAngle,T=m.innerEndAngle,C=m.innerStartAngle,E=y?g[0]:g,R=y?g[1]:g,B=y?g[2]:g,M=y?g[3]:g,P=Math.max(R,E),O=Math.max(B,M),I=P,L=O,D=r*Jt(S),j=r*te(S),F=a*Jt(T),N=a*te(T);if((O>Vt||P>Vt)&&(k=r*Jt(A),b=r*te(A),_=a*Jt(C),x=a*te(C),d<Ht)){var G=xu(D,j,_,x,k,b,F,N);if(G){var z=D-G[0],U=j-G[1],W=k-G[0],V=b-G[1],H=1/te(ie((z*W+U*V)/(ee(z*z+U*U)*ee(W*W+V*V)))/2),Y=ee(G[0]*G[0]+G[1]*G[1]);L=Qt(O,(a-Y)/(H-1)),I=Qt(P,(r-Y)/(H+1))}}if(I>Vt){var X=Qt(E,I),K=Qt(R,I),q=wu(_,x,D,j,r,X,Number(f)),Z=wu(k,b,F,N,r,K,Number(f));if(I<P&&X===K)e.moveTo(n+q.cx+q.x01,i+q.cy+q.y01),e.arc(n+q.cx,i+q.cy,I,Zt(q.y01,q.x01),Zt(Z.y01,Z.x01),!f);else{var J=h-u-.03,$=Zt(Z.y11,Z.x11);e.arc(n,i,r,J,$,!f),K>0&&e.arc(n+Z.cx,i+Z.cy,K,Zt(Z.y11,Z.x11),Zt(Z.y01,Z.x01),!f)}}else e.moveTo(n+D,i+j);if(!(a>Vt)||w<.001)e.lineTo(n+F,i+N),v=!0;else if(L>Vt){var Q=Qt(M,L),tt=Qt(B,L),et=wu(F,N,k,b,a,-tt,Number(f)),nt=wu(D,j,_,x,a,-Q,Number(f));if(e.lineTo(n+et.cx+et.x01,i+et.cy+et.y01),L<O&&Q===tt){var it=Zt(nt.y01,nt.x01);e.arc(n+et.cx,i+et.cy,L,Zt(et.y01,et.x01),it,!f)}else{tt>0&&e.arc(n+et.cx,i+et.cy,tt,Zt(et.y01,et.x01),Zt(et.y11,et.x11),!f);var rt=Zt(et.cy+et.y11,et.cx+et.x11),at=h-u-.03;e.arc(n,i,a,rt,at,f)}}else e.lineTo(n+a*Jt(C),i+a*te(C));return v}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=zr(t,null==a?void 0:a.theme).arc,l=t.attribute,c=l.fill,h=void 0===c?u.fill:c,d=l.stroke,f=void 0===d?u.stroke:d,v=l.x,p=void 0===v?u.x:v,g=l.y,y=void 0===g?u.y:g,m=this.valid(t,u,o,s);if(m){var k=m.fVisible,b=m.sVisible,_=m.doFill,x=m.doStroke,w=t.attribute,S=w.outerPadding,A=void 0===S?u.outerPadding:S,T=w.innerPadding,C=void 0===T?u.innerPadding:T,E=w.cap,R=void 0===E?u.cap:E,B=w.forceShowCap,M=void 0===B?u.forceShowCap:B,P=t.attribute,O=P.outerRadius,I=void 0===O?u.outerRadius:O,L=P.innerRadius,D=void 0===L?u.innerRadius:L;I+=A,D-=C;var j=0,F=(vt(R)&&R||R[0])&&"conical"===h.gradient;if(F){var N=t.getParsedAngle(),G=N.sc,z=N.startAngle,U=N.endAngle;qt(U-z)<Kt-Vt&&(j=G||0,h.startAngle-=j,h.endAngle-=j)}var W=!1,V=ba(f),H=V.isFullStroke,Y=V.stroke;if((_||H)&&(e.beginPath(),Su(t,e,n,i,I,D),W=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,_,x,k,b,u,r,o,s),_&&(o?o(e,t.attribute,u):k&&(e.setCommonStyle(t,t.attribute,p-n,y-i,u),e.fill())),x&&H&&(s?s(e,t.attribute,u):b&&(e.setStrokeStyle(t,t.attribute,p-n,y-i,u),e.stroke()))),!H&&x&&(e.beginPath(),Su(t,e,n,i,I,D,Y),W||this.beforeRenderStep(t,e,n,i,_,x,k,b,u,r,o,s),s?s(e,t.attribute,u):b&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.stroke())),(vt(R)&&R||R[1])&&M){var X=t.getParsedAngle(),K=X.startAngle,q=X.endAngle;if(qt(q-K)>=Kt-Vt){e.beginPath();var Z=Math.abs(I-D)/2/I,J=t.attribute,$=J.endAngle,Q=void 0===$?u.endAngle:$,tt=J.fill,et=void 0===tt?u.fill:tt,nt=Q;if(this.drawArcTailCapPath(t,e,n,i,I,D,nt,nt+Z),W||this.beforeRenderStep(t,e,n,i,_,x,k,b,u,r,o,s),_){var it=et;if("conical"===it.gradient){var rt=Eu(0,0,Q,it);o||yu&&(e.setCommonStyle(t,t.attribute,n,i,u),e.fillStyle=rt,e.fill())}}x&&(s||b&&(e.setStrokeStyle(t,t.attribute,n,i,u),e.stroke()))}}this.afterRenderStep(t,e,n,i,_,x,k,b,u,r,o,s),F&&(h.startAngle+=j,h.endAngle+=j)}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).arc;this._draw(t,r,!1,n,i)}}])}(zh),t.DefaultCanvasArcRender=Ad([L(),Cd(0,O($)),Cd(0,D(Bu)),Td("design:paramtypes",[Object])],t.DefaultCanvasArcRender);var Ed=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Rd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bd=function(t,e){return function(n,i){e(n,i,t)}};function Md(t,e,n,i){if(e.p1){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,c=void 0===l?0:l;if(1===n)e.p2&&e.p3?t.bezierCurveTo(o+e.p1.x,u+e.p1.y,o+e.p2.x,u+e.p2.y,o+e.p3.x,u+e.p3.y,c):t.lineTo(o+e.p1.x,u+e.p1.y,c);else if(e.p2&&e.p3){var h=g(gn(e,n),1)[0];t.bezierCurveTo(o+h.p1.x,u+h.p1.y,o+h.p2.x,u+h.p2.y,o+h.p3.x,u+h.p3.y,c)}else{var d=e.getPointAt(n);t.lineTo(o+d.x,u+d.y,c)}}}function Pd(e,n,i,r,a){var o,s=a||{},u=s.offsetX,l=void 0===u?0:u,c=s.offsetY,h=void 0===c?0:c,d=s.offsetZ,f=void 0===d?0:d,v=s.mode,p=void 0===v?"none":v,g=s.drawConnect,y=void 0!==g&&g;if(s.zeroX,s.zeroY,(!y||"none"!==p)&&n){var m=!0,k=n.curves;if(i>=1)if(y){var b,_=!0;k.forEach((function(t,n){var i,r=t.p0;if(t.originP1!==t.originP2){if(b&&b.originP1===b.originP2&&(r=b.p0),t.defined)_||(e.lineTo(r.x+l,r.y+h,f),_=!_);else{var a,o=t.originP1,s=t.originP2;if(o&&!1!==o.defined?a=r:o&&!1!==s.defined&&(a=null!==(i=t.p3)&&void 0!==i?i:t.p1),_){_=!_;var u=a?a.x:t.p0.x,c=a?a.y:t.p0.y;e.moveTo(u+l,c+h,f)}else a&&(_=!_,e.lineTo(a.x+l,a.y+h,f))}b=t}else b=t}))}else k.forEach((function(t){t.defined?(m&&e.moveTo(t.p0.x+l,t.p0.y+h,f),Md(e,t,1,a),m=!1):m=!0}));else if(!(i<=0)){var x;"x"===r?x=t.Direction.ROW:"y"===r?x=t.Direction.COLUMN:"auto"===r&&(x=n.direction);for(var w=i*n.tryUpdateLength(x),S=0,A=!0,T=null,C=0,E=k.length;C<E;C++){var R=k[C],B=R.getLength(x),M=(w-S)/B;if(S+=B,M<0)break;if(y){var P=R.p0;if(R.originP1===R.originP2){T=R;continue}if(T&&T.originP1===T.originP2&&(P=T.p0),R.defined)A||(e.lineTo(P.x+l,P.y+h,f),A=!A);else{var O=R.originP1,I=R.originP2,L=void 0;if(O&&!1!==O.defined?L=P:O&&!1!==I.defined&&(L=null!==(o=R.p3)&&void 0!==o?o:R.p1),A){A=!A;var D=L?L.x:R.p0.x,j=L?L.y:R.p0.y;e.moveTo(D+l,j+h,f)}else L&&(A=!A,e.lineTo(L.x+l,L.y+h,f))}T=R}else{if(!R.defined){m=!0;continue}m&&e.moveTo(R.p0.x+l,R.p0.y+h,f),Md(e,R,Qt(M,1),a),m=!1}}}}}function Od(t,e,n,i){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=e?e.points[e.points.length-1]:n.points[0];t.moveTo(l.x+o,l.y+u),n.points.forEach((function(e){!1!==e.defined?t.lineTo(e.x+o,e.y+u):t.moveTo(e.x+o,e.y+u)}))}function Id(t,e,n,i){for(var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=n.points,c=[],h=0;h<l.length;h++)l[h].defined;c.push(l),c.forEach((function(n,i){var r,a,s,l,c=e&&0===i?e.points[e.points.length-1]:n[0];t.moveTo(c.x+o,c.y+u),n.forEach((function(e){!1!==e.defined?t.lineTo(e.x+o,e.y+u):t.moveTo(e.x+o,e.y+u)}));for(var h=n.length-1;h>=0;h--){var d=n[h];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!==(s=c.x1)&&void 0!==s?s:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}t.DefaultCanvasCircleRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).circleRenderContribitions=t,i.numberType=js,i.builtinContributions=[rd,od,ad],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=zr(t,null==a?void 0:a.theme).circle,l=t.attribute,c=l.radius,h=void 0===c?u.radius:c,d=l.startAngle,f=void 0===d?u.startAngle:d,v=l.endAngle,p=void 0===v?u.endAngle:v,g=l.x,y=void 0===g?u.x:g,m=l.y,k=void 0===m?u.y:m,b=this.valid(t,u,o,s);if(b){var _=b.fVisible,x=b.sVisible,w=b.doFill,S=b.doStroke;e.beginPath(),e.arc(n,i,h,f,p),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,w,S,_,x,u,r,o,s),w&&(o?o(e,t.attribute,u):_&&(e.setCommonStyle(t,t.attribute,y-n,k-i,u),e.fill())),S&&(s?s(e,t.attribute,u):x&&(e.setStrokeStyle(t,t.attribute,y-n,k-i,u),e.stroke())),this.afterRenderStep(t,e,n,i,w,S,_,x,u,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).circle;this._draw(t,r,!1,n,i)}}])}(zh),t.DefaultCanvasCircleRender=Ed([L(),Bd(0,O($)),Bd(0,D(Pu)),Rd("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);var Ld=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};function Dd(e,n,i,r){var a,o=r||{},s=o.drawConnect,u=void 0!==s&&s,l=o.mode;if(!u||"none"!==(void 0===l?"none":l)){var c=n.top,h=n.bottom;if(c.curves.length===h.curves.length)if(i>=1){var d=[],f=[],v=!0;if(u){var p,g,y=!0,m=c.curves.length;c.curves.forEach((function(t,n){var i=h.curves[m-n-1],a=t,o=i;if(t.originP1===t.originP2)return p=t,void(g=i);if(p&&p.originP1===p.originP2&&(a=p,o=g),t.defined)y||(d.push(a),f.push(o),jd(e,d,f,r),d.length=0,f.length=0,y=!y);else{var s,u,l=t.originP1,c=t.originP2;l&&!1!==l.defined?(s=a,u=o):l&&!1!==c.defined&&(s=t,u=i),y?(y=!y,d.push(s||t),f.push(u||i)):s&&(y=!y,d.push(s||t),f.push(u||i),jd(e,d,f,r),d.length=0,f.length=0)}p=t})),jd(e,d,f,r)}else{for(var k=0,b=c.curves.length;k<b;k++){var _=c.curves[k];v!==_.defined?(v?(Fd(e,d,f,r),d.length=0,f.length=0):(d.push(_),f.push(h.curves[b-k-1])),v=!v):v&&(d.push(_),f.push(h.curves[b-k-1]))}Fd(e,d,f,r)}}else if(!(i<=0)){var x=(r||{}).direction,w=c.curves,S=null!==(a=w[w.length-1].p3)&&void 0!==a?a:w[w.length-1].p1,A=qt(S.x-w[0].p0.x),T=qt(S.y-w[0].p0.y);x=null!=x?x:A>T?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(A)||(x=t.Direction.COLUMN),Number.isFinite(T)||(x=t.Direction.ROW);for(var C,E,R=i*(x===t.Direction.ROW?A:T),B=0,M=!0,P=[],O=[],I=!0,L=0,D=c.curves.length;L<D;L++){var j=c.curves[L],F=j.getLength(x),N=(R-B)/F;if(N<0)break;if(B+=F,u){var G=h.curves[D-L-1],z=j,U=G;if(j.originP1===j.originP2){C=j,E=G;continue}if(C&&C.originP1===C.originP2&&(z=C,U=E),j.defined)I||(P.push(z),O.push(U),jd(e,P,O,r),P.length=0,O.length=0,I=!I);else{var W=j.originP1,V=j.originP2,H=void 0,Y=void 0;W&&!1!==W.defined?(H=z,Y=U):W&&!1!==V.defined&&(H=j,Y=G),I?(I=!I,P.push(H||j),O.push(Y||G)):H&&(I=!I,P.push(H||j),O.push(Y||G),jd(e,P,O,r),P.length=0,O.length=0)}C=j}else{var X=null,K=null;M!==j.defined?(M?(Fd(e,P,O,r),P.length=0,O.length=0):(X=j,K=h.curves[D-L-1]),M=!M):M&&(X=j,K=h.curves[D-L-1]),X&&K&&(N<1&&(X=X.p2&&X.p3?gn(X,N)[0]:mn(X,N)[0],K=K.p2&&K.p3?gn(K,1-N)[1]:mn(K,1-N)[1]),X.defined=M,K.defined=M,P.push(X),O.push(K)),X=null,K=null}}u?jd(e,P,O,r):Fd(e,P,O,r)}}}function jd(t,e,n,i){if(!(e.length<2)){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,c=void 0===l?0:l;r.mode;var h=e[0];t.moveTo(h.p0.x+o,h.p0.y+u,c);var d=(h=e[e.length-1]).p3||h.p1;t.lineTo(d.x+o,d.y+u,c),h=n[n.length-1],t.lineTo(h.p0.x+o,h.p0.y+u,c),d=(h=n[0]).p3||h.p1,t.lineTo(d.x+o,d.y+u,c),t.closePath()}}function Fd(t,e,n,i){var r=i||{},a=r.offsetX,o=void 0===a?0:a,s=r.offsetY,u=void 0===s?0:s,l=r.offsetZ,c=void 0===l?0:l,h=!0;e.forEach((function(e){e.defined?(h&&t.moveTo(e.p0.x+o,e.p0.y+u,c),Md(t,e,1,i),h=!1):h=!0})),h=!0;for(var d=n.length-1;d>=0;d--){var f=n[d];f.defined?(h&&t.lineTo(f.p0.x+o,f.p0.y+u,c),Md(t,f,1,i),h=!1):h=!0}t.closePath()}t.DefaultCanvasLineRender=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).numberType=zs,t}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).line;this._draw(t,r,!1,n,i)}},{key:"drawSegmentItem",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d,f,v){var p,g,y,m,k;if(e){t.beginPath();var b=null!==(p=this.z)&&void 0!==p?p:0;Pd(t.camera?t:t.nativeContext,e,u,l,{offsetX:c,offsetY:h,offsetZ:b}),d.cache&&!wt(d.cache)&&d.cache.curves.every((function(t){return t.defined}))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,o,s);var _=o.x,x=void 0===_?0:_,w=o.x,S=void 0===w?0:w;!1!==n&&(f?f(t,o,s):r&&(t.setCommonStyle(d,o,x-c,S-h,s),t.fill())),!1!==i&&(v?v(t,o,s):a&&(t.setStrokeStyle(d,o,x-c,S-h,s),t.stroke()));var A=o.connectedType,T=o.connectedX,C=o.connectedY,E=o.connectedStyle;if(wt(s)?(A=null!==(g=null!=A?A:s[0].connectedType)&&void 0!==g?g:s[1].connectedType,T=null!==(y=null!=T?T:s[0].connectedX)&&void 0!==y?y:s[1].connectedX,C=null!==(m=null!=C?C:s[0].connectedY)&&void 0!==m?m:s[1].connectedY,E=null!==(k=null!=E?E:s[0].connectedStyle)&&void 0!==k?k:s[1].connectedStyle):(A=null!=A?A:s.connectedType,T=null!=T?T:s.connectedX,C=null!=C?C:s.connectedY,E=null!=E?E:s.connectedStyle),"connect"!==A&&"zero"!==A&&(A="none"),"none"!==A){t.beginPath(),Pd(t.camera?t:t.nativeContext,e,u,l,{offsetX:c,offsetY:h,offsetZ:b,drawConnect:!0,mode:A,zeroX:T,zeroY:C});var R=[];wt(s)?s.forEach((function(t){return R.push(t)})):R.push(s),R.push(o),!1!==n&&(f?f(t,o,s):r&&(t.setCommonStyle(d,E,x-c,S-h,R),t.fill())),!1!==i&&(v?v(t,o,s):a&&(t.setStrokeStyle(d,E,x-c,S-h,R),t.stroke()))}return!1}}},{key:"drawLinearLineHighPerformance",value:function(t,e,n,i,r,a,o,s,u,l,c,h,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+o,g.y+s,v);for(var y=1;y<p.length;y++){var m=p[y];e.lineTo(m.x+o,m.y+s,v)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u);var k=t.attribute,b=k.x,_=void 0===b?0:b,x=k.x,w=void 0===x?0:x;!1!==n&&(h?h(e,t.attribute,u):r&&(e.setCommonStyle(t,t.attribute,_-o,w-s,u),e.fill())),!1!==i&&(d?d(e,t.attribute,u):a&&(e.setStrokeStyle(t,t.attribute,_-o,w-s,u),e.stroke()))}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=this,l=zr(t,null==a?void 0:a.theme).line,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.stroke,v=void 0===f?l.stroke:f,p=c.fillOpacity,g=void 0===p?l.fillOpacity:p,y=c.strokeOpacity,m=void 0===y?l.strokeOpacity:y,k=c.segments,b=c.points,_=c.closePath,x=c.curveTension,w=void 0===x?l.curveTension:x;if(this.valid(t,l,o,s)){var S=t.attribute.curveType,A=void 0===S?l.curveType:S;_&&"linear"===A&&(A="linearClosed");var T=t.attribute,C=T.clipRange,E=void 0===C?l.clipRange:C,R=T.clipRangeByDimension,B=void 0===R?l.clipRangeByDimension:R;if(1===E&&!k&&!b.some((function(t){return!1===t.defined}))&&"linear"===A)return this.drawLinearLineHighPerformance(t,e,!!d,!!v,g,m,n,i,l,r,a,o,s);if(t.shouldUpdateShape()){var M=t.attribute,P=M.points,O=M.segments,I=P;if(O&&O.length){var L,D;if(t.cache=O.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(D={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===e?L={x:D.endX,y:D.endY,defined:D.curves[D.curves.length-1].defined}:e>1&&(L.x=D.endX,L.y=D.endY,L.defined=D.curves[D.curves.length-1].defined);var n=ti(t.points,A,{startPoint:L,curveTension:w});return D=n,n})).filter((function(t){return!!t})),"linearClosed"===A){for(var j,F=0;F<t.cache.length;F++){for(var N=t.cache[F],G=0;G<N.curves.length;G++)if(N.curves[G].defined){j=N.curves[G].p0;break}if(j)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(j.x,j.y,!0)}}else{if(!P||!P.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=ti(I,A,{curveTension:w})}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===E){var U=!1;t.cache.forEach((function(r,a){U||(U=u.drawSegmentItem(e,r,!!d,!!v,g,m,z[a],[l,t.attribute],E,B,n,i,t,o,s))}))}else{var W=t.cache.reduce((function(t,e){return t+e.getLength()}),0),V=E*W,H=0,Y=!1;t.cache.forEach((function(r,a){if(!Y){var c=r.getLength(),h=(V-H)/c;H+=c,h>0&&(Y=u.drawSegmentItem(e,r,!!d,!!v,g,m,z[a],[l,t.attribute],Qt(h,1),B,n,i,t,o,s))}}))}}else this.drawSegmentItem(e,t.cache,!!d,!!v,g,m,t.attribute,l,E,B,n,i,t,o,s)}}}])}(zh),t.DefaultCanvasLineRender=Ld([L()],t.DefaultCanvasLineRender);var Nd=new Sd,Gd=Zh,zd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ud=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wd=function(t,e){return function(n,i){e(n,i,t)}};function Vd(t,e,n){var i,r;switch(e){case"linear":default:return An(t,n);case"basis":return Bn(t,n);case"monotoneX":return Fn(t,n);case"monotoneY":return Gn(t,n);case"step":return Un(t,.5,n);case"stepBefore":return Un(t,0,n);case"stepAfter":return Un(t,1,n);case"catmullRom":return Zn(t,null!==(i=null==n?void 0:n.curveTension)&&void 0!==i?i:.5,n);case"catmullRomClosed":return $n(t,null!==(r=null==n?void 0:n.curveTension)&&void 0!==r?r:.5,n);case"linearClosed":return Hn(t,n)}}t.DefaultCanvasAreaRender=function(n){function i(t){var n;return o(this,i),(n=e(this,i)).areaRenderContribitions=t,n.numberType=Ds,n.builtinContributions=[Nd,Gd],n.init(t),n}return c(i,n),u(i,[{key:"drawLinearAreaHighPerformance",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d){var f,v,p,g,y,m=t.attribute.points;if(!(m.length<2)){e.beginPath();var k=null!==(f=this.z)&&void 0!==f?f:0,b=m[0];e.moveTo(b.x+o,b.y+s,k);for(var _=1;_<m.length;_++){var x=m[_];e.lineTo(x.x+o,x.y+s,k)}for(var w=m.length-1;w>=0;w--){var S=m[w];e.lineTo((null!==(v=S.x1)&&void 0!==v?v:S.x)+o,(null!==(p=S.y1)&&void 0!==p?p:S.y)+s,k)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,o,s,!!r,!1,n,!1,u,l,h,null,{attribute:t.attribute});var A=t.attribute,T=A.x,C=void 0===T?0:T,E=A.x,R=void 0===E?0:E;if(!1!==n&&(h?h(e,t.attribute,u):r&&(e.setCommonStyle(t,t.attribute,C-o,R-s,u),e.fill())),this.afterRenderStep(t,e,o,s,!!r,!1,n,!1,u,l,h,null,{attribute:t.attribute}),i){var B=t.attribute.stroke,M=void 0===B?u&&u.stroke:B;if(wt(M)&&(M[0]||M[2])&&!1===M[1])if(e.beginPath(),M[0]){e.moveTo(b.x+o,b.y+s,k);for(var P=1;P<m.length;P++){var O=m[P];e.lineTo(O.x+o,O.y+s,k)}}else if(M[2]){var I=m[m.length-1];e.moveTo(I.x+o,I.y+s,k);for(var L=m.length-2;L>=0;L--){var D=m[L];e.lineTo((null!==(g=D.x1)&&void 0!==g?g:D.x)+o,(null!==(y=D.y1)&&void 0!==y?y:D.y)+s,k)}}d?d(e,t.attribute,u):(e.setStrokeStyle(t,t.attribute,C-o,R-s,u),e.stroke())}}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l,c,h,d,f,v=this,p=zr(t,null==a?void 0:a.theme).area,g=t.attribute,y=g.fill,m=void 0===y?p.fill:y,k=g.stroke;void 0===k&&p.stroke;var b=g.fillOpacity,_=void 0===b?p.fillOpacity:b,x=g.z,w=void 0===x?p.z:x,S=g.strokeOpacity,A=void 0===S?p.strokeOpacity:S,T=g.curveTension,C=void 0===T?p.curveTension:T,E=this.valid(t,p,o,s);if(E){var R=E.doFill,B=E.doStroke,M=t.attribute,P=M.clipRange,O=void 0===P?p.clipRange:P,I=M.closePath,L=M.points,D=M.segments,j=t.attribute.curveType,F=void 0===j?p.curveType:j;if(I&&"linear"===F&&(F="linearClosed"),1===O&&!D&&!L.some((function(t){return!1===t.defined}))&&"linear"===F)return this.drawLinearAreaHighPerformance(t,e,!!m,B,_,A,n,i,p,r,a,o,s);if(t.shouldUpdateShape()){if(D&&D.length){for(var N,G,z,U=D.map((function(t,e){if(t.points.length<=1&&0===e)return t.points[0]&&(G={endX:t.points[0].x,endY:t.points[0].y}),null;1===e?N={x:G.endX,y:G.endY}:e>1&&(N.x=G.endX,N.y=G.endY);var n=Vd(t.points,F,{startPoint:N,curveTension:C});return G=n,n})).filter((function(t){return!!t})),W=[],V=D.length-1;V>=0;V--){for(var H=D[V].points,Y=[],X=H.length-1;X>=0;X--)Y.push({x:null!==(u=H[X].x1)&&void 0!==u?u:H[X].x,y:null!==(l=H[X].y1)&&void 0!==l?l:H[X].y});if(0!==V){var K=D[V-1].points,q=K[K.length-1];q&&Y.push({x:null!==(c=q.x1)&&void 0!==c?c:q.x,y:null!==(h=q.y1)&&void 0!==h?h:q.y})}Y.length>1&&(z=Vd(Y,"stepBefore"===F?"stepAfter":"stepAfter"===F?"stepBefore":F,{curveTension:C}),W.unshift(z))}t.cacheArea=W.map((function(t,e){return{top:U[e],bottom:t}}))}else{if(!L||!L.length)return t.cacheArea=null,void t.clearUpdateShapeTag();for(var Z=L,J=[],$=L.length-1;$>=0;$--)J.push({x:null!==(d=L[$].x1)&&void 0!==d?d:L[$].x,y:null!==(f=L[$].y1)&&void 0!==f?f:L[$].y});var Q=Vd(Z,F,{curveTension:C}),tt=Vd(J,"stepBefore"===F?"stepAfter":"stepAfter"===F?"stepBefore":F,{curveTension:C});t.cacheArea={top:Q,bottom:tt}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){var et=t.attribute.segments.filter((function(t){return t.points.length}));if(1===et[0].points.length&&et.shift(),1===O){var nt=!1;t.cacheArea.forEach((function(a,u){nt||(nt=v.drawSegmentItem(e,a,R,_,B,A,et[u],[p,t.attribute],O,n,i,w,t,r,o,s))}))}else{var it=t.cacheArea.reduce((function(t,e){return t+e.top.getLength()}),0),rt=O*it,at=0,ot=!1;t.cacheArea.forEach((function(a,u){if(!ot){var l=a.top.getLength(),c=(rt-at)/l;at+=l,c>0&&(ot=v.drawSegmentItem(e,a,R,_,B,A,et[u],[p,t.attribute],Qt(c,1),n,i,w,t,r,o,s))}}))}}else this.drawSegmentItem(e,t.cacheArea,R,_,B,A,t.attribute,p,O,n,i,w,t,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).area;this._draw(t,r,!1,n,i)}},{key:"drawSegmentItem",value:function(t,e,n,i,r,a,o,s,u,l,c,h,d,f,v,p){var g=!1;return g=(g=g||this._drawSegmentItem(t,e,n,i,r,a,o,s,u,l,c,h,d,f,!1,v,p))||this._drawSegmentItem(t,e,n,i,r,a,o,s,u,l,c,h,d,f,!0,v,p)}},{key:"_drawSegmentItem",value:function(e,n,i,r,a,o,s,u,l,c,h,d,f,v,p,g,y){var m,k,b,_;if(n&&n.top&&n.bottom&&n.top.curves&&n.top.curves.length&&n.bottom.curves&&n.bottom.curves.length){var x=s.connectedType,w=s.connectedX,S=s.connectedY,A=s.connectedStyle,T=[];if(p&&(wt(u)?(x=null!==(m=null!=x?x:u[0].connectedType)&&void 0!==m?m:u[1].connectedType,w=null!==(k=null!=w?w:u[0].connectedX)&&void 0!==k?k:u[1].connectedX,S=null!==(b=null!=S?S:u[0].connectedY)&&void 0!==b?b:u[1].connectedY,A=null!==(_=null!=A?A:u[0].connectedStyle)&&void 0!==_?_:u[1].connectedStyle):(x=null!=x?x:u.connectedType,w=null!=w?w:u.connectedX,S=null!=S?S:u.connectedY,A=null!=A?A:u.connectedStyle),"connect"!==x&&"zero"!==x&&(x="none"),wt(u)?u.forEach((function(t){return T.push(t)})):T.push(u),T.push(s)),p&&"none"===x)return!1;e.beginPath();var C,E,R=f.attribute,B=R.points,M=R.segments,P=t.Direction.ROW;if(M){var O=M[M.length-1];E=M[0].points[0],C=O.points[O.points.length-1]}else E=B[0],C=B[B.length-1];var I=qt(C.x-E.x),L=qt(C.y-E.y);P=null==C.x1?t.Direction.ROW:null==C.y1?t.Direction.COLUMN:Number.isFinite(I+L)?I>L?t.Direction.ROW:t.Direction.COLUMN:t.Direction.ROW,Dd(e.camera?e:e.nativeContext,n,l,{offsetX:c,offsetY:h,offsetZ:d,direction:P,drawConnect:p,mode:x,zeroX:w,zeroY:S}),this.beforeRenderStep(f,e,c,h,!!r,!1,i,!1,u,v,g,null,{attribute:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(f,s,u);var D=s.x,j=void 0===D?0:D,F=s.x,N=void 0===F?0:F;if(!1!==i&&(g?g(e,s,u):r&&(e.setCommonStyle(f,p?A:s,j-c,N-h,p?T:u),e.fill())),this.afterRenderStep(f,e,c,h,!!r,!1,i,!1,u,v,g,null,{attribute:s}),!1!==a)if(y)y(e,s,u);else{var G=s.stroke,z=void 0===G?u&&u[1]&&u[1].stroke:G;wt(z)&&(z[0]||z[2])&&!1===z[1]&&(e.beginPath(),Pd(e.camera?e:e.nativeContext,z[0]?n.top:n.bottom,l,P===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:h,offsetZ:d,drawConnect:p,mode:x,zeroX:w,zeroY:S})),e.setStrokeStyle(f,p?A:s,j-c,N-h,p?T:u),e.stroke()}return!1}}}])}(zh),t.DefaultCanvasAreaRender=zd([L(),Wd(0,O($)),Wd(0,D(Mu)),Ud("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);var Hd=$h,Yd=Zh,Xd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Kd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qd=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasPathRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).pathRenderContribitions=t,i.numberType=Us,i.builtinContributions=[Yd,Hd],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l,c,h=null!==(u=this.tempTheme)&&void 0!==u?u:zr(t,null==a?void 0:a.theme).path,d=t.attribute,f=d.x,v=void 0===f?h.x:f,p=d.y,g=void 0===p?h.y:p,y=null!==(l=this.z)&&void 0!==l?l:0,m=this.valid(t,h,o,s);if(m){var k=m.fVisible,b=m.sVisible,_=m.doFill,x=m.doStroke;if(e.beginPath(),t.pathShape)cn(t.pathShape.commandList,e,n,i,1,1,y);else cn((null!==(c=t.attribute.path)&&void 0!==c?c:h.path).commandList,e,n,i,1,1,y);e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,n,i,_,x,k,b,h,r,o,s),x&&(s?s(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,v-n,g-i,h),e.stroke())),_&&(o?o(e,t.attribute,h):k&&(e.setCommonStyle(t,t.attribute,v-n,g-i,h),e.fill())),this.afterRenderStep(t,e,n,i,_,x,k,b,h,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).path;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}}])}(zh),t.DefaultCanvasPathRender=Xd([L(),qd(0,O($)),qd(0,D(Lu)),Kd("design:paramtypes",[Object])],t.DefaultCanvasPathRender);var Zd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Jd=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$d=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasRectRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).rectRenderContribitions=t,i.type="rect",i.numberType=Hs,i.builtinContributions=[fd,pd,vd],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=null!==(u=this.tempTheme)&&void 0!==u?u:zr(t,null==a?void 0:a.theme).rect,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.background,v=c.stroke,p=void 0===v?l.stroke:v,g=c.cornerRadius,y=void 0===g?l.cornerRadius:g,m=c.opacity,k=void 0===m?l.opacity:m,b=c.fillOpacity,_=void 0===b?l.fillOpacity:b,x=c.lineWidth,w=void 0===x?l.lineWidth:x,S=c.strokeOpacity,A=void 0===S?l.strokeOpacity:S,T=c.visible,C=void 0===T?l.visible:T,E=c.x1,R=c.y1,B=c.x,M=void 0===B?l.x:B,P=c.y,O=void 0===P?l.y:P,I=t.attribute,L=I.width,D=I.height,j=mu(k,_,L=(null!=L?L:E-M)||0,D=(null!=D?D:R-O)||0,d),F=bu(k,A,L,D),N=pu(d,f),G=gu(p,w);if(t.valid&&C&&(N||G)&&(j||F||o||s||f)){0===y||wt(y)&&y.every((function(t){return 0===t}))?(e.beginPath(),e.rect(n,i,L,D)):(e.beginPath(),cd(e,n,i,L,D,y));var z={doFill:N,doStroke:G};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,N,G,j,F,l,r,o,s,z),z.doFill&&(o?o(e,t.attribute,l):j&&(e.setCommonStyle(t,t.attribute,M-n,O-i,l),e.fill())),z.doStroke&&(s?s(e,t.attribute,l):F&&(e.setStrokeStyle(t,t.attribute,M-n,O-i,l),e.stroke())),this.afterRenderStep(t,e,n,i,N,G,j,F,l,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).rect;this.tempTheme=r,this._draw(t,r,!1,n,i),this.tempTheme=null}}])}(zh),t.DefaultCanvasRectRender=Zd([L(),$d(0,O($)),$d(0,D(ju)),Jd("design:paramtypes",[Object])],t.DefaultCanvasRectRender);var Qd=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},tf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ef=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasSymbolRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).symbolRenderContribitions=t,i.numberType=Ks,i.builtinContributions=[_d,wd,xd],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=zr(t,null==a?void 0:a.theme).symbol,c=t.attribute,h=c.size,d=void 0===h?l.size:h,f=c.x,v=void 0===f?l.x:f,p=c.y,g=void 0===p?l.y:p,y=c.scaleX,m=void 0===y?l.scaleX:y,k=c.scaleY,b=void 0===k?l.scaleY:k,_=this.valid(t,l,o,s);if(_){var x=_.fVisible,w=_.sVisible,S=_.doFill,A=_.doStroke,T=t.getParsedPath();if(T){var C=t.attribute.keepDirIn3d,E=void 0===C?l.keepDirIn3d:C,R=null!==(u=this.z)&&void 0!==u?u:0;if(e.beginPath(),E&&e.camera&&e.project){var B=e.project(n,i,R),M=e.camera;e.camera=null,!1===T.draw(e,wt(d)?[d[0]*m,d[1]*b]:d*m,B.x,B.y,void 0,(function(r,a){var u,c,h;if(t._parsedPath.svgCache){var d=Object.assign({},a);d.fill=null!==(u=a.fill)&&void 0!==u?u:t.attribute.fill,d.opacity=null!==(c=a.fill)&&void 0!==c?c:t.attribute.opacity,d.fillOpacity=t.attribute.fillOpacity,d.stroke=null!==(h=a.stroke)&&void 0!==h?h:t.attribute.stroke,a=d}a.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,a,v-n,g-i,l),e.fill())),a.stroke&&(s?s(e,t.attribute,l):(e.setStrokeStyle(t,a,(v-n)/m,(g-i)/b,l),e.stroke()))}))&&e.closePath(),e.camera=M}else!1===T.draw(e,d,n,i,R,(function(r,a){var u,c,h;if(t._parsedPath.svgCache){var d=Object.assign({},a);d.fill=null!==(u=a.fill)&&void 0!==u?u:t.attribute.fill,d.opacity=null!==(c=a.opacity)&&void 0!==c?c:t.attribute.opacity,d.fillOpacity=t.attribute.fillOpacity,d.stroke=null!==(h=a.stroke)&&void 0!==h?h:t.attribute.stroke,a=d}a.fill&&(o?o(e,t.attribute,l):(e.setCommonStyle(t,a,v-n,g-i,l),e.fill())),a.stroke&&(s?s(e,t.attribute,l):(e.setStrokeStyle(t,a,(v-n)/m,(g-i)/b,l),e.stroke()))}))&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,n,i,S,A,x,w,l,r,o,s),S&&!T.isSvg&&(o?o(e,t.attribute,l):x&&(e.setCommonStyle(t,t.attribute,v-n,g-i,l),e.fill())),A&&!T.isSvg&&(s?s(e,t.attribute,l):w&&(e.setStrokeStyle(t,t.attribute,(v-n)/m,(g-i)/b,l),e.stroke())),this.afterRenderStep(t,e,n,i,S,A,x,w,l,r,o,s)}}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).symbol;this._draw(t,r,!1,n,i)}}])}(zh),t.DefaultCanvasSymbolRender=Qd([L(),ef(0,O($)),ef(0,D(Fu)),tf("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);var nf=function(){return u((function t(){o(this,t),this.pools=[];for(var e=0;e<10;e++)this.pools.push(new de)}),[{key:"allocate",value:function(t,e,n,i){if(!this.pools.length)return(new de).setValue(t,e,n,i);var r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=n,r.y2=i,r}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return new de(t);var e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}},{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),rf=new nf,af=function(n){function i(){var n;return o(this,i),(n=e(this,i,arguments)).time=t.BaseRenderContributionTime.beforeFillStroke,n}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s,u,l,c,h){var d,f,v,p,g,y,m,k,b,_,x,w=t.attribute,S=w.backgroundMode,A=void 0===S?u.backgroundMode:S,T=w.backgroundFit,C=void 0===T?u.backgroundFit:T,E=t.attribute.background;if(E){var R,B=function(){"richtext"===t.type&&(e.restore(),e.save(),x&&e.setTransformFromMatrix(x,!0,1))};"richtext"===t.type&&(x=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());var M=mt(E)&&E.background,P=t.transMatrix.onlyTranslate();if(M){var O=t.AABBBounds,I=(null!==(d=E.x)&&void 0!==d?d:O.x1)+(null!==(f=E.dx)&&void 0!==f?f:0),L=(null!==(v=E.y)&&void 0!==v?v:O.y1)+(null!==(p=E.dy)&&void 0!==p?p:0),D=null!==(g=E.width)&&void 0!==g?g:O.width(),j=null!==(y=E.height)&&void 0!==y?y:O.height();if(R=rf.allocate(I,L,I+D,L+j),E=E.background,!P){var F=R.width(),N=R.height();R.set((null!==(m=E.x)&&void 0!==m?m:0)+(null!==(k=E.dx)&&void 0!==k?k:0),(null!==(b=E.y)&&void 0!==b?b:0)+(null!==(_=E.dy)&&void 0!==_?_:0),F,N)}}else R=t.AABBBounds,P||(R=Nh(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){var G=t.resources.get(E);if("success"!==G.state||!G.data)return void B();e.highPerformanceSave(),P&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,n,i,u),this.doDrawImage(e,G.data,R,A,C),e.highPerformanceRestore(),e.setTransformForCurrent()}else{var z=t.attribute.backgroundCornerRadius;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,n,i,u),e.fillStyle=E,z?(cd(e,R.x1,R.y1,R.width(),R.height(),z),e.fill()):e.fillRect(R.x1,R.y1,R.width(),R.height()),e.highPerformanceRestore()}M&&rf.free(R),B()}}}])}(qh),of=new af,sf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},uf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lf=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasTextRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).textRenderContribitions=t,i.numberType=qs,i.builtinContributions=[of],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l,c,h=this,d=zr(t,null==a?void 0:a.theme).text,f=t.attribute;f.text;var v=f.underline,p=void 0===v?d.underline:v,g=f.lineThrough,y=void 0===g?d.lineThrough:g,m=f.keepDirIn3d,k=void 0===m?d.keepDirIn3d:m,b=f.direction,_=void 0===b?d.direction:b,x=f.whiteSpace;void 0===x&&d.whiteSpace;var w=f.fontSize,S=void 0===w?d.fontSize:w,A=f.verticalMode,T=void 0===A?d.verticalMode:A,C=f.x,E=void 0===C?d.x:C,R=f.y,B=void 0===R?d.y:R,M=t.attribute,P=M.textAlign,O=void 0===P?d.textAlign:P,I=M.textBaseline,L=void 0===I?d.textBaseline:I;if(!T&&"vertical"===_){var D=O;O=null!==(u=t.getBaselineMapAlign()[L])&&void 0!==u?u:"left",L=null!==(l=t.getAlignMapBaseline()[D])&&void 0!==l?l:"top"}var j=null!==(c=La(t.attribute.lineHeight,S))&&void 0!==c?c:S,F=this.valid(t,d,o,s);if(F){var N=F.fVisible,G=F.sVisible,z=F.doFill,U=F.doStroke,W=!k,V=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,d),this.beforeRenderStep(t,e,n,i,z,U,N,G,d,r,o,s),W&&this.transformUseContext2d(t,d,V,e);var H=function(r,a,u,l){var c=n+a,f=i+u;if(l){e.highPerformanceSave(),c+=S;var v=Sh.allocate(1,0,0,1,0,0);v.rotateByCenter(Math.PI/2,c,f),e.transformFromMatrix(v,!0),Sh.free(v)}U&&(s?s(e,t.attribute,d):G&&(e.setStrokeStyle(t,t.attribute,E-n,B-i,d),e.strokeText(r,c,f,V))),z&&(o?o(e,t.attribute,d):N&&(e.setCommonStyle(t,t.attribute,E-n,B-i,d),e.fillText(r,c,f,V),h.drawUnderLine(p,y,t,c,f,V,d,e))),l&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,d,V),"horizontal"===_){var Y=t.multilineLayout;if(!Y)return void e.highPerformanceRestore();var X=Y.bbox,K=X.xOffset,q=X.yOffset;U&&(s?s(e,t.attribute,d):G&&(e.setStrokeStyle(t,t.attribute,E-n,B-i,d),Y.lines.forEach((function(t){e.strokeText(t.str,(t.leftOffset||0)+K+n,(t.topOffset||0)+q+i,V)})))),z&&(o?o(e,t.attribute,d):N&&(e.setCommonStyle(t,t.attribute,E-n,B-i,d),Y.lines.forEach((function(r){e.fillText(r.str,(r.leftOffset||0)+K+n,(r.topOffset||0)+q+i,V),h.drawMultiUnderLine(p,y,t,(r.leftOffset||0)+K+n,(r.topOffset||0)+q+i-Yu("bottom",S)-.05*S,V,r.width,d,e)}))))}else{t.tryUpdateAABBBounds();var Z=t.cache.verticalList;e.textAlign="left",e.textBaseline="top";var J=j*Z.length,$=0;Z.forEach((function(t){var e=t.reduce((function(t,e){return t+(e.width||0)}),0);$=$t(e,$)}));var Q=0,tt=0;"bottom"===L?tt=-J:"middle"===L&&(tt=-J/2),"center"===O?Q-=$/2:"right"===O&&(Q-=$),Z.forEach((function(t,e){var n=t.reduce((function(t,e){return t+(e.width||0)}),0),i=$-n,r=Q;"center"===O?r+=i/2:"right"===O&&(r+=i),t.forEach((function(t){var n=t.text,i=t.width,a=t.direction;H(n,J-(e+1)*j+tt,r,a),r+=i}))}))}else if("horizontal"===_){e.setTextStyle(t.attribute,d,V);var et=t.clipedText,nt=0;j!==S&&("top"===L?nt=(j-S)/2:"middle"===L||"bottom"===L&&(nt=-(j-S)/2)),H(et,0,nt,0)}else{t.tryUpdateAABBBounds();var it=t.cache;if(it){e.setTextStyleWithoutAlignBaseline(t.attribute,d,V);var rt=it.verticalList,at=0,ot=rt[0].reduce((function(t,e){return t+(e.width||0)}),0),st=0;"bottom"===L?st=-j:"middle"===L&&(st=-j/2),"center"===O?at-=ot/2:"right"===O&&(at-=ot),e.textAlign="left",e.textBaseline="top",rt[0].forEach((function(t){var e=t.text,n=t.width,i=t.direction;H(e,st,at,i),at+=n}))}}W&&this.restoreTransformUseContext2d(t,d,V,e),this.afterRenderStep(t,e,n,i,z,U,N,G,d,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).text,a=t.attribute.keepDirIn3d,o=!(void 0===a?r.keepDirIn3d:a);this._draw(t,r,o,n,i)}},{key:"drawUnderLine",value:function(t,e,n,i,r,a,o,s){if(!(e+t<=0)){var u=n.attribute,l=u.textAlign,c=void 0===l?o.textAlign:l,h=u.textBaseline,d=void 0===h?o.textBaseline:h,f=u.fontSize,v=void 0===f?o.fontSize:f,p=u.fill,g=void 0===p?o.fill:p,y=u.opacity,m=void 0===y?o.opacity:y,k=u.underlineOffset,b=void 0===k?o.underlineOffset:k,_=u.underlineDash,x=void 0===_?o.underlineDash:_,w=u.fillOpacity,S=void 0===w?o.fillOpacity:w,A=n.clipedWidth,T=Xu(c,A),C=Ku(d,v,v),E={lineWidth:0,stroke:g,opacity:m,strokeOpacity:S};if(t){E.lineWidth=t,s.setStrokeStyle(n,E,i,r,o),x&&s.setLineDash(x),s.beginPath();var R=r+C+v+b;s.moveTo(i+T,R,a),s.lineTo(i+T+A,R,a),s.stroke()}if(e){E.lineWidth=e,s.setStrokeStyle(n,E,i,r,o),s.beginPath();var B=r+C+v/2;s.moveTo(i+T,B,a),s.lineTo(i+T+A,B,a),s.stroke()}}}},{key:"drawMultiUnderLine",value:function(t,e,n,i,r,a,o,s,u){if(!(e+t<=0)){var l=n.attribute,c=l.fontSize,h=void 0===c?s.fontSize:c,d=l.fill,f=void 0===d?s.fill:d,v=l.opacity,p=void 0===v?s.opacity:v,g=l.underlineOffset,y=void 0===g?s.underlineOffset:g,m=l.underlineDash,k=void 0===m?s.underlineDash:m,b=l.fillOpacity,_=void 0===b?s.fillOpacity:b,x=Ku("alphabetic",h,h),w={lineWidth:0,stroke:f,opacity:p,strokeOpacity:_},S=-3;if(t){w.lineWidth=t,u.setStrokeStyle(n,w,i,r,s),k&&u.setLineDash(k),u.beginPath();var A=r+x+h+S+y;u.moveTo(i+0,A,a),u.lineTo(i+0+o,A,a),u.stroke()}if(S=-1,e){w.lineWidth=e,u.setStrokeStyle(n,w,i,r,s),u.beginPath();var T=r+x+h/2+S;u.moveTo(i+0,T,a),u.lineTo(i+0+o,T,a),u.stroke()}}}}])}(zh),t.DefaultCanvasTextRender=sf([L(),lf(0,O($)),lf(0,D(Nu)),uf("design:paramtypes",[Object])],t.DefaultCanvasTextRender);var cf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};function hf(t,e,n,i){t.moveTo(e[0].x+n,e[0].y+i);for(var r=1;r<e.length;r++)t.lineTo(e[r].x+n,e[r].y+i)}function df(t,e){return Math.sqrt(t*t+e*e)}function ff(t,e,n,i,r){var a=e/n;return{x:t.x-i*a,y:t.y-r*a}}t.AbstractGraphicRender=u((function t(){o(this,t)})),t.AbstractGraphicRender=cf([L()],t.AbstractGraphicRender);var vf=$h,pf=Zh,gf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},yf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mf=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasPolygonRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).polygonRenderContribitions=t,i.numberType=Ws,i.builtinContributions=[pf,vf],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=zr(t,null==a?void 0:a.theme).polygon,l=t.attribute,c=l.points,h=void 0===c?u.points:c,d=l.cornerRadius,f=void 0===d?u.cornerRadius:d,v=l.x,p=void 0===v?u.x:v,g=l.y,y=void 0===g?u.y:g,m=l.closePath,k=void 0===m?u.closePath:m,b=this.valid(t,u,o,s);if(b){var _=b.fVisible,x=b.sVisible,w=b.doFill,S=b.doStroke;e.beginPath(),f<=0||wt(f)&&f.every((function(t){return 0===t}))?hf(e.camera?e:e.nativeContext,h,n,i):function(t,e,n,i,r){var a,o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];if(e.length<3)hf(t,e,n,i);else{var s=0,u=e.length-1;o||(s+=1,u-=1,t.moveTo(e[0].x+n,e[0].y+i));for(var l=s;l<=u;l++){var c=e[0===l?u:(l-1)%e.length],h=e[l%e.length],d=e[(l+1)%e.length],f=h.x-c.x,v=h.y-c.y,p=h.x-d.x,g=h.y-d.y,y=(Math.atan2(v,f)-Math.atan2(g,p))/2,m=Math.abs(Math.tan(y)),k=Array.isArray(r)?null!==(a=r[l%e.length])&&void 0!==a?a:0:r,b=k/m,_=df(f,v),x=df(p,g),w=Math.min(_,x);b>w&&(b=w,k=w*m);var S=ff(h,b,_,f,v),A=ff(h,b,x,p,g),T=2*h.x-S.x-A.x,C=2*h.y-S.y-A.y,E=df(T,C),R=ff(h,df(b,k),E,T,C),B=Math.atan2(S.y-R.y,S.x-R.x),M=Math.atan2(A.y-R.y,A.x-R.x),P=M-B;P<0&&(B=M,P=-P),P>Math.PI&&(P-=Math.PI),0===l?t.moveTo(S.x+n,S.y+i):t.lineTo(S.x+n,S.y+i),P&&t.arcTo(h.x+n,h.y+i,A.x+n,A.y+i,k),t.lineTo(A.x+n,A.y+i)}o||t.lineTo(e[u+1].x+n,e[u+1].y+i)}}(e.camera?e:e.nativeContext,h,n,i,f,k),k&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,n,i,w,S,_,x,u,r,o,s),w&&(o?o(e,t.attribute,u):_&&(e.setCommonStyle(t,t.attribute,p-n,y-i,u),e.fill())),S&&(s?s(e,t.attribute,u):x&&(e.setStrokeStyle(t,t.attribute,p-n,y-i,u),e.stroke())),this.afterRenderStep(t,e,n,i,w,S,_,x,u,r,o,s)}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).polygon;this._draw(t,r,!1,n,i)}}])}(zh),t.DefaultCanvasPolygonRender=gf([L(),mf(0,O($)),mf(0,D(Du)),yf("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);var kf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},bf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_f=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultCanvasGroupRender=function(){return u((function t(e){o(this,t),this.groupRenderContribitions=e,this.numberType=Ns}),[{key:"drawShape",value:function(e,n,i,r,a,o,s,u){var l=zr(e,null==o?void 0:o.theme).group,c=e.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.background,v=c.stroke,p=void 0===v?l.stroke:v,g=c.opacity,y=void 0===g?l.opacity:g,m=c.width,k=void 0===m?l.width:m,b=c.height,_=void 0===b?l.height:b,x=c.clip,w=void 0===x?l.clip:x,S=c.fillOpacity,A=void 0===S?l.fillOpacity:S,T=c.strokeOpacity,C=void 0===T?l.strokeOpacity:T,E=c.cornerRadius,R=void 0===E?l.cornerRadius:E,B=c.path,M=void 0===B?l.path:B,P=c.lineWidth,O=void 0===P?l.lineWidth:P,I=c.visible,L=void 0===I?l.visible:I,D=mu(y,A,k,_,d),j=bu(y,C,k,_),F=pu(d,f),N=gu(p,O);if(e.valid&&L){if(!w){if(!F&&!N)return;if(!(D||j||s||u||f))return}if(M&&M.length&&a.drawContribution){var G=n.disableFill,z=n.disableStroke,U=n.disableBeginPath;n.disableFill=!0,n.disableStroke=!0,n.disableBeginPath=!0,M.forEach((function(t){a.drawContribution.getRenderContribution(t).draw(t,a.renderService,a,o)})),n.disableFill=G,n.disableStroke=z,n.disableBeginPath=U}else 0===R||wt(R)&&R.every((function(t){return 0===t}))?(n.beginPath(),n.rect(i,r,k,_)):(n.beginPath(),cd(n,i,r,k,_,R));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(ud));var W={doFill:F,doStroke:N};this._groupRenderContribitions.forEach((function(o){o.time===t.BaseRenderContributionTime.beforeFillStroke&&o.drawShape(e,n,i,r,F,N,D,j,l,a,s,u,W)})),w&&n.clip(),n.setShadowBlendStyle&&n.setShadowBlendStyle(e,e.attribute,l),W.doFill&&(s?s(n,e.attribute,l):D&&(n.setCommonStyle(e,e.attribute,i,r,l),n.fill())),W.doStroke&&(u?u(n,e.attribute,l):j&&(n.setStrokeStyle(e,e.attribute,i,r,l),n.stroke())),this._groupRenderContribitions.forEach((function(o){o.time===t.BaseRenderContributionTime.afterFillStroke&&o.drawShape(e,n,i,r,F,N,D,j,l,a,s,u)}))}}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=t.attribute,o=a.clip,s=a.baseOpacity,u=void 0===s?1:s;o?r.save():r.highPerformanceSave(),r.baseGlobalAlpha*=u;var l=zr(t,null==i?void 0:i.theme).group,c=r.modelMatrix;if(r.camera){var h=Ah.allocate(),d=Ah.allocate();Ih(d,t,l),Oh(h,c||h,d),r.modelMatrix=h,Ah.free(d),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),i.skipDraw?this.drawShape(t,r,0,0,n,i,(function(){return!1}),(function(){return!1})):this.drawShape(t,r,0,0,n);var f,v=t.attribute,p=v.scrollX,g=void 0===p?l.scrollX:p,y=v.scrollY,m=void 0===y?l.scrollY:y;(g||m)&&r.translate(g,m),i&&i.drawingCb&&(f=i.drawingCb()),r.modelMatrix!==c&&Ah.free(r.modelMatrix),r.modelMatrix=c,r.baseGlobalAlpha/=u,f&&f.then?f.then((function(){o?r.restore():r.highPerformanceRestore()})):o?r.restore():r.highPerformanceRestore()}}}])}(),t.DefaultCanvasGroupRender=kf([L(),_f(0,O($)),_f(0,D(Ou)),bf("design:paramtypes",[Object])],t.DefaultCanvasGroupRender);var xf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},wf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sf=function(t,e){return function(n,i){e(n,i,t)}},Af=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).imageRenderContribitions=t,i.numberType=Gs,i.builtinContributions=[md,kd],i.init(t),i}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u=zr(t).image,l=t.attribute,c=l.width,h=void 0===c?u.width:c,d=l.height,f=void 0===d?u.height:d,v=l.repeatX,p=void 0===v?u.repeatX:v,g=l.repeatY,y=void 0===g?u.repeatY:g,m=l.x,k=void 0===m?u.x:m,b=l.y,_=void 0===b?u.y:b,x=l.cornerRadius,w=void 0===x?u.cornerRadius:x,S=l.image,A=this.valid(t,u,o);if(A){var T=A.fVisible,C=A.sVisible,E=A.doFill,R=A.doStroke;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,u),this.beforeRenderStep(t,e,n,i,E,!1,T,!1,u,r,o),E)if(o)o(e,t.attribute,u);else if(T){if(!S||!t.resources)return;var B=t.resources.get(S);if("success"!==B.state)return;var M=!1;0===w||wt(w)&&w.every((function(t){return 0===t}))||(e.beginPath(),cd(e,n,i,h,f,w),e.save(),e.clip(),M=!0),e.setCommonStyle(t,t.attribute,n,i,u);var P=0;if("repeat"===p&&(P|=1),"repeat"===y&&(P|=2),P){var O=e.createPattern(B.data,Af[P]);e.fillStyle=O,e.translate(n,i,!0),e.fillRect(0,0,h,f),e.translate(-n,-i,!0)}else e.drawImage(B.data,n,i,h,f);M&&e.restore()}R&&(s?s(e,t.attribute,u):C&&(e.setStrokeStyle(t,t.attribute,k-n,_-i,u),e.stroke())),this.afterRenderStep(t,e,n,i,E,!1,T,!1,u,r,o)}}},{key:"draw",value:function(t,e,n){var i=t.attribute.image;if(i&&t.resources){var r=t.resources.get(i);if("loading"===r.state&&xt(i))Qo.improveImageLoading(i);else if("success"===r.state)if(e.drawParams.context){var a=zr(t).image;this._draw(t,a,!1,n)}}}}])}(zh),t.DefaultCanvasImageRender=xf([L(),Sf(0,O($)),Sf(0,D(Iu)),wf("design:paramtypes",[Object])],t.DefaultCanvasImageRender);var Tf=Symbol.for("IncrementalDrawContribution"),Cf=Symbol.for("ArcRender"),Ef=Symbol.for("Arc3dRender"),Rf=Symbol.for("AreaRender"),Bf=Symbol.for("CircleRender"),Mf=Symbol.for("GraphicRender"),Pf=Symbol.for("GroupRender"),Of=Symbol.for("LineRender"),If=Symbol.for("PathRender"),Lf=Symbol.for("PolygonRender"),Df=Symbol.for("RectRender"),jf=Symbol.for("Rect3DRender"),Ff=Symbol.for("SymbolRender"),Nf=Symbol.for("TextRender"),Gf=Symbol.for("RichTextRender"),zf=Symbol.for("Pyramid3dRender"),Uf=Symbol.for("GlyphRender"),Wf=Symbol.for("ImageRender"),Vf=Symbol.for("RenderSelector"),Hf=Symbol.for("DrawContribution"),Yf=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Xf=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kf=Symbol.for("DrawItemInterceptor"),qf=new de,Zf=new de,Jf=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterDrawItem",value:function(t,e,n,i,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,n,i,r),!1}},{key:"beforeDrawItem",value:function(t,e,n,i,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,n,i,r),!1}},{key:"drawItem",value:function(t,e,n,i,r){if(!t.shadowRoot)return!1;var a=n.context;if(a.highPerformanceSave(),a.transformFromMatrix(t.transMatrix,!0),i.dirtyBounds&&i.backupDirtyBounds){qf.copy(i.dirtyBounds),Zf.copy(i.backupDirtyBounds);var o=t.globalTransMatrix.getInverse();i.dirtyBounds.copy(i.backupDirtyBounds).transformWithMatrix(o),i.backupDirtyBounds.copy(i.dirtyBounds)}return i.renderGroup(t.shadowRoot,n,t.parent.globalTransMatrix),a.highPerformanceRestore(),i.dirtyBounds&&i.backupDirtyBounds&&(i.dirtyBounds.copy(qf),i.backupDirtyBounds.copy(Zf)),!0}}])}(),$f=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterDrawItem",value:function(t,e,n,i,r){return t.attribute._debug_bounds&&this.drawItem(t,e,n,i,r),!1}},{key:"drawItem",value:function(t,e,n,i,r){if(!t.attribute._debug_bounds)return!1;var a=n.context;a.highPerformanceSave(),t.parent&&a.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&a.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);var o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(a,t),a.strokeRect(o.x1,o.y1,o.width(),o.height()),a.highPerformanceRestore(),!0}}])}();t.CommonDrawItemInterceptorContribution=function(){return u((function t(){o(this,t),this.order=1,this.interceptors=[new Jf,new tv,new Qf,new $f]}),[{key:"afterDrawItem",value:function(t,e,n,i,r){for(var a=0;a<this.interceptors.length;a++)if(this.interceptors[a].afterDrawItem&&this.interceptors[a].afterDrawItem(t,e,n,i,r))return!0;return!1}},{key:"beforeDrawItem",value:function(t,e,n,i,r){if((!t.in3dMode||n.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,n,i,r))return!0;return!1}}])}(),t.CommonDrawItemInterceptorContribution=Yf([L(),Xf("design:paramtypes",[])],t.CommonDrawItemInterceptorContribution);var Qf=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforeDrawItem",value:function(t,e,n,i,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,n,i,r):this.beforeSetInteractive(t,e,n,i,r))}},{key:"beforeSetInteractive",value:function(t,e,n,i,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}),n.stage.tryInitInteractiveLayer();var o=n.stage.getLayer("_builtin_interactive");return o&&this.getShadowRoot(o).add(a),!0}if(a){n.stage.tryInitInteractiveLayer();var s=n.stage.getLayer("_builtin_interactive");s&&this.getShadowRoot(s).removeChild(a),t.interactiveGraphic=null,a.baseGraphic=null}return!1}},{key:"beforeDrawInteractive",value:function(t,e,n,i,r){var a=t.baseGraphic;if(!a.stage){var o=n.stage.getLayer("_builtin_interactive");return o&&this.getShadowRoot(o).removeChild(t),!0}if(a){this.processing=!0;var s=n.context;return s.highPerformanceSave(),s.setTransformFromMatrix(a.parent.globalTransMatrix,!0),a.isContainer?i.renderGroup(a,n,a.parent.globalTransMatrix):i.renderItem(a,n),s.highPerformanceRestore(),this.processing=!1,!0}return!1}},{key:"getShadowRoot",value:function(t){var e,n=t.getElementById("_interactive_group");return n||((n=Fh.CreateGraphic("group",{})).id="_interactive_group",t.add(n)),null!==(e=n.shadowRoot)&&void 0!==e?e:n.attachShadow()}}])}(),tv=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforeDrawItem",value:function(t,e,n,i,r){if(!t.in3dMode||n.in3dInterceptor)return!1;n.in3dInterceptor=!0;var a=e.drawParams,o=a.context,s=a.stage;o.canvas,o.save(),this.initCanvasCtx(o),o.camera=s.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 l=Ah.allocate();Ph(l,u);var c=o.modelMatrix;if(c){if(l){var h=Ah.allocate();o.modelMatrix=Oh(h,c,l)}}else o.modelMatrix=l;if(o.setTransform(1,0,0,1,0,0,!0),t.isContainer){var d=!1,f=!1;if(t.forEachChildren((function(t){return!(d=t.numberType===Ls)})),t.forEachChildren((function(t){return!(f=!!t.findFace)})),d){var v=t.getChildren(),p=y(v);p.sort((function(t,e){for(var n,i,r,a,o=((null!==(n=t.attribute.startAngle)&&void 0!==n?n:0)+(null!==(i=t.attribute.endAngle)&&void 0!==i?i:0))/2,s=((null!==(r=e.attribute.startAngle)&&void 0!==r?r:0)+(null!==(a=e.attribute.endAngle)&&void 0!==a?a:0))/2;o<0;)o+=Kt;for(;s<0;)s+=Kt;return s-o})),p.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),p.forEach((function(e){t.appendChild(e)}));var g=t.parent.globalTransMatrix;n.hack_pieFace="outside",i.renderGroup(t,n,g),n.hack_pieFace="inside",i.renderGroup(t,n,g),n.hack_pieFace="top",i.renderGroup(t,n,g),t.removeAllChild(),v.forEach((function(t){t._next=null,t._prev=null})),v.forEach((function(e){t.appendChild(e)}))}else if(f){var m=t.getChildren(),k=m.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return o.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));k.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),k.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),k.forEach((function(e){t.add(e.g)})),i.renderGroup(t,n,t.parent.globalTransMatrix,!0),t.removeAllChild(),m.forEach((function(t){t._next=null,t._prev=null})),t.update(),m.forEach((function(e){t.add(e)}))}else i.renderGroup(t,n,t.parent.globalTransMatrix)}else i.renderItem(t,n);return o.camera=null,o.restore(),o.modelMatrix!==c&&Ah.free(o.modelMatrix),o.modelMatrix=c,n.in3dInterceptor=!1,!0}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}])}(),ev=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},nv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iv=function(t,e){return function(n,i){e(n,i,t)}},rv=Symbol.for("RenderService"),av=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=function(){return u((function t(e){o(this,t),this.drawContribution=e}),[{key:"prepare",value:function(t){var e=this;t&&this.renderTreeRoots.forEach((function(n){e._prepare(n,t)}))}},{key:"_prepare",value:function(t,e){var n=this;t.forEachChildren((function(t){n._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 n=e.updateBounds;this.prepare(n),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}}])}(),t.DefaultRenderService=ev([L(),iv(0,O(Hf)),nv("design:paramtypes",[Object])],t.DefaultRenderService);var ov=new x((function(e){e(rv).to(t.DefaultRenderService)})),sv=Symbol.for("GraphicPicker"),uv=Symbol.for("PickerService"),lv=Symbol.for("BoundsPicker"),cv=Symbol.for("GlobalPickerService"),hv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},dv=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=function(){return u((function t(){o(this,t),this.order=1}),[{key:"afterPickItem",value:function(t,e,n,i,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,n,i,r):null}},{key:"beforePickItem",value:function(t,e,n,i,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,n,i,r):null}},{key:"_pickItem",value:function(t,e,n,i,r){var a;if(!t.shadowRoot)return null;var o=(r||{}).parentMatrix;if(!o)return null;var s=e.pickContext;s.highPerformanceSave();var u=null===(a=zr(t))||void 0===a?void 0:a[t.type],l=t.attribute.shadowPickMode,c=void 0===l?null==u?void 0:u.shadowPickMode:l,h=t.shadowRoot,d=Sh.allocateByObj(o),f=new ue(d.a*n.x+d.c*n.y+d.e,d.b*n.x+d.d*n.y+d.f),v=e.pickGroup(h,f,d,i);return s.highPerformanceRestore(),!v.graphic&&v.group&&"full"===c&&(v.graphic=v.group),v}}])}(),t.ShadowRootPickItemInterceptorContribution=hv([L()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforePickItem",value:function(t,e,n,i,r){var a=t.baseGraphic;if(a&&a.parent){var o=new ue(n.x,n.y),s=e.pickContext;s.highPerformanceSave();var u=a.parent.globalTransMatrix;u.transformPoint(o,o);var l=a.isContainer?e.pickGroup(a,o.clone(),u,i):e.pickItem(a,o.clone(),u,i);return s.highPerformanceRestore(),l}return null}}])}(),t.InteractivePickItemInterceptorContribution=hv([L()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=function(){return u((function t(){o(this,t),this.order=1}),[{key:"beforePickItem",value:function(t,e,n,i,r){if(!t.in3dMode||i.in3dInterceptor)return null;var a=e.pickContext,o=t.stage;if(!a||!o)return null;if(i.in3dInterceptor=!0,a.save(),this.initCanvasCtx(a),a.camera=o.camera,t.isContainer){var s,u=!1,l=!1;if(t.forEachChildren((function(t){return!(u=t.numberType===Ls)})),t.forEachChildren((function(t){return!(l=!!t.findFace)})),u){var c=t.getChildren(),h=y(c);h.sort((function(t,e){for(var n,i,r,a,o=(null!==(i=null!==(n=t.attribute.startAngle)&&void 0!==n?n:0+t.attribute.endAngle)&&void 0!==i?i:0)/2,s=(null!==(a=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==a?a:0)/2;o<0;)o+=Kt;for(;s<0;)s+=Kt;return s-o})),h.forEach((function(t){t._next=null,t._prev=null})),t.removeAllChild(),t.update(),h.forEach((function(e){t.appendChild(e)})),i.hack_pieFace="outside",(s=e.pickGroup(t,n,r.parentMatrix,i)).graphic||(i.hack_pieFace="inside",s=e.pickGroup(t,n,r.parentMatrix,i)),s.graphic||(i.hack_pieFace="top",s=e.pickGroup(t,n,r.parentMatrix,i)),t.removeAllChild(),c.forEach((function(t){t._next=null,t._prev=null})),c.forEach((function(e){t.appendChild(e)}))}else if(l){var d=t.getChildren(),f=d.map((function(t){return{ave_z:t.findFace().vertices.map((function(e){var n;return a.view(e[0],e[1],null!==(n=e[2]+t.attribute.z)&&void 0!==n?n:0)[2]})).reduce((function(t,e){return t+e}),0),g:t}}));f.sort((function(t,e){return e.ave_z-t.ave_z})),t.removeAllChild(),f.forEach((function(t){t.g._next=null,t.g._prev=null})),t.update(),f.forEach((function(e){t.add(e.g)})),s=e.pickGroup(t,n,r.parentMatrix,i),t.removeAllChild(),d.forEach((function(t){t._next=null,t._prev=null})),t.update(),d.forEach((function(e){t.add(e)}))}else s=e.pickGroup(t,n,r.parentMatrix,i);return a.camera=null,i.in3dInterceptor=!1,a.restore(),s}return a.restore(),null}},{key:"initCanvasCtx",value:function(t){t.setTransformForCurrent()}}])}(),t.Canvas3DPickItemInterceptor=hv([L()],t.Canvas3DPickItemInterceptor);var fv=new x((function(e,n,i){i(uv)||(e(cv).toSelf(),e(uv).toService(cv)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(dv).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(dv).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(dv).toService(t.InteractivePickItemInterceptorContribution),et(e,dv)})),vv=new x((function(e){e(Zs).to(t.DefaultGraphicService).inSingletonScope(),e(Js).toConstantValue(Fh)})),pv=Symbol.for("AutoEnablePlugins"),gv=Symbol.for("PluginService"),yv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},mv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kv=function(t,e){return function(n,i){e(n,i,t)}},bv=function(){return u((function t(e){o(this,t),this.autoEnablePlugins=e,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}),[{key:"active",value:function(t,e){var n=this;this.stage=t,this.actived=!0;var i=e.pluginList;i&&Hi.isBound(pv)&&this.autoEnablePlugins.getContributions().forEach((function(t){i.includes(t.name)&&n.register(t)}))}},{key:"findPluginsByName",value:function(t){var e=[];return this.onStartupFinishedPlugin.forEach((function(n){n.name===t&&e.push(n)})),this.onRegisterPlugin.forEach((function(n){n.name===t&&e.push(n)})),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=[]}}])}();bv=yv([L(),kv(0,O($)),kv(0,D(pv)),mv("design:paramtypes",[Object])],bv);var _v=new x((function(t){t(gv).to(bv),nt(t,pv)})),xv=new x((function(t){et(t,at)})),wv=new x((function(e){e(Vi).to(t.DefaultTextMeasureContribution).inSingletonScope(),et(e,Vi)})),Sv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Av=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tv=function(){return u((function t(){o(this,t),this.type="static",this.offscreen=!1,this.global=Mi.global}),[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,n){if(this.layer=t,this.window=e,n.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{var i;this.main=!1,n.canvasId&&(i=this.global.getElementById(n.canvasId)),i||(i=this.global.createCanvas({width:e.width,height:e.height})),i.style&&(i.style["pointer-events"]="none");var r=e.getContext().getCanvas().nativeCanvas,a=Ki({nativeCanvas:i,width:e.width,height:e.height,dpr:e.dpr,id:n.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,n){var i;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!==(i=e.background)&&void 0!==i?i:"#ffffff"},e),n))}},{key:"merge",value:function(t){var e=this;t.forEach((function(t){var n=t.getContext().canvas.nativeCanvas;e.context.drawImage(n,0,0)}))}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,n){var i,r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}},{key:"getContext",value:function(){return this.context}},{key:"release",value:function(){this.canvas.release()}}])}();Tv=Sv([L(),Av("design:paramtypes",[])],Tv);var Cv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ev=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rv=function(){return u((function t(){o(this,t),this.offscreen=!1,this.type="virtual",this.global=Mi.global}),[{key:"setDpr",value:function(t){}},{key:"init",value:function(t,e,n){if(this.layer=t,this.window=e,n.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,n){this.mainHandler.render(t,e,Object.assign(Object.assign({},n),{clear:!1}))}},{key:"merge",value:function(t){}},{key:"prepare",value:function(t,e){}},{key:"drawTo",value:function(t,e,n){var i,r=t.getContext();n.renderService.render(e,Object.assign(Object.assign({context:r},n),{clear:n.clear?null!==(i=n.background)&&void 0!==i?i:"#fff":void 0}))}},{key:"getContext",value:function(){return null}},{key:"release",value:function(){}}])}();Rv=Cv([L(),Ev("design:paramtypes",[])],Rv);var Bv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Mv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pv=function(){return u((function t(){o(this,t),this.offscreen=!0,this.type="dynamic",this.global=Mi.global}),[{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"init",value:function(t,e,n){this.layer=t;var i=Ki({nativeCanvas:this.global.createOffscreenCanvas({width:n.width,height:n.height,dpr:e.dpr}),width:n.width,height:n.height,dpr:e.dpr,canvasControled:!0});this.canvas=i,this.context=i.getContext()}},{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 n;e.renderService.render(t,Object.assign(Object.assign({context:this.context,viewBox:e.stage.window.getViewBox(),transMatrix:e.stage.window.getViewBoxTransform()},e),{clear:null!==(n=e.background)&&void 0!==n?n:"#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,n){var i=t.getContext(),r=t.dpr,a=n.viewBox,o=a.x1,s=a.y1,u=a.width(),l=a.height();i.nativeContext.save(),i.nativeContext.setTransform(r,0,0,r,0,0),n.clear&&i.clearRect(o,s,u,l),i.drawImage(this.canvas.nativeCanvas,0,0,this.canvas.width,this.canvas.height,o,s,u,l),i.nativeContext.restore()}},{key:"merge",value:function(t){}}])}();Pv=Bv([L(),Mv("design:paramtypes",[])],Pv);var Ov=new x((function(t){t(Tv).toSelf(),t(Pv).toSelf(),t(Rv).toSelf(),t(lu).toService(Tv),t(cu).toService(Pv),t(hu).toService(Rv)}));var Iv=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};function Lv(t,e,n){var i,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={},s=[],u=!1;a?u=!0:t.forEachChildren((function(t,n){var r=t.attribute.zIndex,a=void 0===r?e:r;if(0===n)i=a;else if(i!==a)return u=!0,!0;return!1}),r);if(u){t.forEachChildren((function(t){var n=t.attribute.zIndex,i=void 0===n?e:n;o[i]?o[i].push(t):(o[i]=[t],s.push(i))}),r),s.sort((function(t,e){return r?e-t:t-e}));for(var l=!1,c=0;c<s.length&&!l;c++){var h=s[c],d=o[h];a&&d.sort((function(t,e){var n,i;return(r?-1:1)*((null!==(n=e.attribute.z)&&void 0!==n?n:0)-(null!==(i=t.attribute.z)&&void 0!==i?i:0))}));for(var f=0;f<d.length;f++)if(n(d[f],f)){l=!0;break}}}else t.forEachChildren(n,r)}function Dv(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Iv(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.forEachChildrenAsync(n,r);case 2:case"end":return e.stop()}}),e)})))}function jv(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r={},a=[],o=!1;t.forEachChildren((function(t,e){var i=t.attribute.zIndex;if(0===e);else if(void 0!==(void 0===i?n:i))return o=!0,!0;return!1}),i);var s=null,u=!1;if(o){t.forEachChildren((function(t){var e=t.attribute.zIndex,i=void 0===e?n:e;r[i]?r[i].push(t):(r[i]=[t],a.push(i))}),i),a.sort((function(t,e){return i?e-t:t-e}));for(var l=!1,c=0;c<a.length&&!l;c++)for(var h=a[c],d=r[h],f=0;f<d.length;f++){if(u){l=!0,s=d[f];break}d[f]._uid!==e||(u=!0)}}else t.forEachChildren((function(t){return u?(s=t,!0):(t._uid===e&&(u=!0),!1)}),i);return s}var Fv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Nv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gv=function(t,e){return function(n,i){e(n,i,t)}},zv=function(){return u((function t(e,n){o(this,t),this.contributions=e,this.drawItemInterceptorContributions=n,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new he,this.backupDirtyBounds=new he,this.global=Mi.global,this.layerService=Mi.layerService,this.init()}),[{key:"init",value:function(){var t=this;this.contributions.forEach((function(e){if(e.style){var n=t.styleRenderMap.get(e.style)||new Map;n.set(e.numberType,e),t.styleRenderMap.set(e.style,n)}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,e){var n=this;this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;var i=e.context,r=e.stage,a=e.viewBox,o=e.transMatrix;if(i){var s=this.dirtyBounds.setValue(0,0,a.width(),a.height());if(r.dirtyBounds&&!r.dirtyBounds.empty()){var u=function(t,e,n){if(null===t)return e;if(null===e)return t;var i=Pe(t,e,n),r=i.x11,a=i.x12,o=i.y11,s=i.y12,u=i.x21,l=i.x22,c=i.y21,h=i.y22;return r>=l||a<=u||o>=h||s<=c?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,u),y1:Math.max(o,c),x2:Math.min(a,l),y2:Math.min(s,h)}}(s,r.dirtyBounds,!1);s.x1=Math.floor(u.x1),s.y1=Math.floor(u.y1),s.x2=Math.ceil(u.x2),s.y2=Math.ceil(u.y2)}var l=i.dpr%1;(l||.5!==l)&&(s.x1=Math.floor(s.x1*i.dpr)/i.dpr,s.y1=Math.floor(s.y1*i.dpr)/i.dpr,s.x2=Math.ceil(s.x2*i.dpr)/i.dpr,s.y2=Math.ceil(s.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(s),i.inuse=!0,i.setClearMatrix(o.a,o.b,o.c,o.d,o.e,o.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(a.x1,a.y1,!0),i.beginPath(),i.rect(s.x1,s.y1,s.width(),s.height()),i.clip(),r.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,i,e),i.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:vi.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:vi.zIndex)})).forEach((function(t){t.isContainer?n.renderGroup(t,e,Sh.allocate(1,0,0,1,0,0)):n.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}}},{key:"doRegister",value:function(){throw new Error("暂不支持")}},{key:"_findNextGraphic",value:function(t){for(var e=t.parent,n=t._uid;e;){var i=jv(e,n,vi.zIndex);if(i)return i;n=e._uid,e=e.parent}return null}},{key:"renderGroup",value:function(t,e,n,i){var r=this;if(!e.break&&!1!==t.attribute.visibleAll){if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(!this.useDirtyBounds||Oe(t.AABBBounds,this.dirtyBounds,!1)){var a,o=n;if(this.useDirtyBounds){a=rf.allocateByObj(this.dirtyBounds);var s=t.transMatrix;o=Sh.allocateByObj(n).multiply(s.a,s.b,s.c,s.d,s.e,s.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o.getInverse())}this.renderItem(t,e,{drawingCb:function(){var n;i?t.forEachChildren((function(t){e.break||(t.isContainer?r.renderGroup(t,e,o):r.renderItem(t,e))})):Lv(t,vi.zIndex,(function(t){e.break||(t.isContainer?r.renderGroup(t,e,o):r.renderItem(t,e))}),!1,!!(null===(n=e.context)||void 0===n?void 0:n.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(a),rf.free(a),Sh.free(o))}}}},{key:"_increaseRender",value:function(t,e){var n=e.layer,i=e.stage,r=n.subLayers,a=r.get(t._uid);a||(a={layer:this.layerService.createLayer(i),zIndex:r.size,group:t},r.set(t._uid,a));var o=a.layer.getNativeHandler().getContext(),s=a.drawContribution||Hi.get(Tf);s.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),s.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:a.layer,context:o,startAtId:t._uid,break:!1})),a.drawContribution=s;var u=this._findNextGraphic(t);if(u)if(u.isContainer&&u.incremental)this._increaseRender(u,e);else{var l=r.get(u._uid);l||(l={layer:this.layerService.createLayer(i),zIndex:r.size},r.set(u._uid,l));var c=l.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:s,clear:"transparent",layer:l.layer,context:c,startAtId:u._uid,break:!1}))}}},{key:"getRenderContribution",value:function(t){var e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}},{key:"renderItem",value:function(t,e,n){if(this.InterceptorContributions.length)for(var i=0;i<this.InterceptorContributions.length;i++){var r=this.InterceptorContributions[i];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,n))return}var a=this.getRenderContribution(t);if(a){var o,s=!1;if(t.parent){var u=t.parent.attribute,l=u.scrollX,c=void 0===l?0:l,h=u.scrollY,d=void 0===h?0:h;if(s=!(!c&&!d)){o=this.dirtyBounds.clone();var f=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(f),this.dirtyBounds.translate(-c,-d)}}if(!this.useDirtyBounds||t.isContainer||Oe(t.AABBBounds,this.dirtyBounds,!1)){var v=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),n&&(n.skipDraw=v),v?t.isContainer&&a.draw(t,this.currentRenderService,e,n):a.draw(t,this.currentRenderService,e,n),s&&this.dirtyBounds.copy(o),this.InterceptorContributions.length)for(var p=0;p<this.InterceptorContributions.length;p++){var g=this.InterceptorContributions[p];if(g.afterDrawItem&&g.afterDrawItem(t,this.currentRenderService,e,this))return}}else s&&this.dirtyBounds.copy(o)}}},{key:"selectRenderByType",value:function(t){return Nt.getInstance().warn("未知错误,不应该走到这里"),null}},{key:"selectRenderByNumberType",value:function(t,e){var n;if(e.attribute.renderStyle){var i=this.styleRenderMap.get(e.attribute.renderStyle);n=i&&i.get(t)}return n||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}},{key:"clearScreen",value:function(t,e,n){var i,r,a=n.clear,o=n.viewBox,s=o.width(),u=o.height();if(a){e.clearRect(0,0,s,u);var l=null===(i=t.drawParams)||void 0===i?void 0:i.stage;if(l&&(e.globalAlpha=null!==(r=l.attribute.opacity)&&void 0!==r?r:1),l&&l.backgroundImg&&l.resources){var c=l.resources.get(a);c&&"success"===c.state&&c.data&&e.drawImage(c.data,0,0,s,u)}else e.fillStyle=Hh(e,a,{AABBBounds:{x1:0,y1:0,x2:0+s,y2:0+u}},0,0),e.fillRect(0,0,s,u)}}},{key:"afterDraw",value:function(t,e){}}])}();zv=Fv([L(),Gv(0,I(Mf)),Gv(1,O($)),Gv(1,D(Kf)),Nv("design:paramtypes",[Array,Object])],zv);var Uv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Wv=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).numberType=zs,t}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,i,r,a,o,s,u){if(t.incremental&&a.multiGraphicOptions){var l=a.multiGraphicOptions,c=l.startAtIdx,d=l.length,f=t.attribute.segments,v=void 0===f?[]:f;if(c>v.length)return;var g=zr(t).line,y=t.attribute,m=y.fill,k=void 0===m?g.fill:m,b=y.stroke,_=void 0===b?g.stroke:b,x=y.opacity,w=void 0===x?g.opacity:x,S=y.fillOpacity,A=void 0===S?g.fillOpacity:S,T=y.strokeOpacity,C=void 0===T?g.strokeOpacity:T,E=y.lineWidth,R=void 0===E?g.lineWidth:E,B=y.visible,M=void 0===B?g.visible:B,P=yu(w,A,k),O=ku(w,C),I=pu(k),L=gu(_,R);if(!t.valid||!M)return;if(!I&&!L)return;if(!(P||O||s||u))return;for(var D=a.context,j=c;j<c+d;j++)this.drawIncreaseSegment(t,D,v[j-1],v[j],t.attribute.segments[j],[g,t.attribute],i,r)}else p(h(n.prototype),"drawShape",this).call(this,t,e,i,r,a,o,s,u)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,a,o,s){i&&(e.beginPath(),Od(e.nativeContext,n,i,{offsetX:o,offsetY:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setStrokeStyle(t,r,o,s,a),e.stroke())}}])}(t.DefaultCanvasLineRender);Wv=Uv([L()],Wv);var Vv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Hv=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).numberType=Ds,t}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,i,r,a,o,s){if(t.incremental&&a.multiGraphicOptions){var u=a.multiGraphicOptions,l=u.startAtIdx,c=u.length,d=t.attribute.segments,f=void 0===d?[]:d;if(l>f.length)return;var v=zr(t).area,g=t.attribute,y=g.fill,m=void 0===y?v.fill:y,k=g.fillOpacity,b=void 0===k?v.fillOpacity:k,_=g.opacity,x=void 0===_?v.opacity:_,w=g.visible,S=void 0===w?v.visible:w,A=yu(x,b,m),T=pu(m);if(!t.valid||!S)return;if(!T)return;if(!A&&!s)return;for(var C=l;C<l+c;C++)this.drawIncreaseSegment(t,e,f[C-1],f[C],t.attribute.segments[C],[v,t.attribute],i,r)}else p(h(n.prototype),"drawShape",this).call(this,t,e,i,r,a,o,s)}},{key:"drawIncreaseSegment",value:function(t,e,n,i,r,a,o,s){i&&(e.beginPath(),Id(e.camera?e:e.nativeContext,n,i,{offsetX:o,offsetY:s}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,a),e.setCommonStyle(t,r,o,s,a),e.fill())}}])}(t.DefaultCanvasAreaRender);Hv=Vv([L()],Hv);var Yv,Xv=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Kv=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qv=function(t,e){return function(n,i){e(n,i,t)}},Zv=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Yv||(Yv={}));var Jv=function(t){function n(t,i,r,a){var s;return o(this,n),(s=e(this,n,[t,a])).contributions=t,s.lineRender=i,s.areaRender=r,s.drawItemInterceptorContributions=a,s.rendering=!1,s.currFrameStartAt=0,s.currentIdx=0,s.status=Yv.NORMAL,s.checkingForDrawPromise=null,s.hooks={completeDraw:new rt([])},s.defaultRenderMap.set(s.lineRender.numberType,s.lineRender),s.defaultRenderMap.set(s.areaRender.numberType,s.areaRender),s}return c(n,t),u(n,[{key:"draw",value:function(t,e){return Zv(this,void 0,void 0,i().mark((function n(){var r,a,o,s=this;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.checkingForDrawPromise){n.next=2;break}return n.abrupt("return");case 2:return this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e),n.next=5,this.checkingForDrawPromise;case 5:if(r=n.sent,this.checkingForDrawPromise=null,!r){n.next=8;break}return n.abrupt("return");case 8:this.currentRenderService=t,a=e.context,o=e.viewBox,a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,a,e),a.translate(o.x1,o.y1,!0),a.save(),t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:vi.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:vi.zIndex)})).forEach((function(t){s.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(function(){a.restore(),a.restore(),a.draw(),a.inuse=!1,s.rendering=!1})));case 11:case"end":return n.stop()}}),n,this)})))}},{key:"_increaseRender",value:function(t,e){return Zv(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.rendering=!0,n.next=3,this._renderIncrementalGroup(t,e);case 3:case"end":return n.stop()}}),n,this)})))}},{key:"_renderIncrementalGroup",value:function(t,e){return Zv(this,void 0,void 0,i().mark((function n(){var r=this;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.count=t.count,n.next=3,new Promise((function(n){r.renderItem(t,e,{drawingCb:function(){return Zv(r,void 0,void 0,i().mark((function r(){var a,o=this;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(2===t.count){i.next=6;break}return i.next=3,Dv(t,vi.zIndex,(function(n,i){if(o.status===Yv.STOP)return!0;if(n.isContainer)return!1;if(i<o.currentIdx)return!1;var r=o.currFrameStartAt+t.incremental;return i<r&&(o.currentIdx=i+1,o.renderItem(n,e)),i===r-1&&(o.currFrameStartAt=o.currentIdx,o.waitToNextFrame())}));case 3:n(!1),i.next=21;break;case 6:if(!(a=t.getChildAt(0)).incremental||!a.attribute.segments){i.next=19;break}a.incrementalAt||(a.incrementalAt=0);case 9:if(!(a.incrementalAt<a.attribute.segments.length)){i.next=17;break}return e.multiGraphicOptions={startAtIdx:a.incrementalAt,length:a.incremental},this.renderItem(a,e),a.incrementalAt+=a.incremental,i.next=15,this.waitToNextFrame();case 15:i.next=9;break;case 17:i.next=20;break;case 19:this.renderItem(a,e);case 20:n(!1);case 21:case"end":return i.stop()}}),r,this)})))}})}));case 3:this.hooks.completeDraw.call();case 4:case"end":return n.stop()}}),n,this)})))}},{key:"waitToNextFrame",value:function(){return Zv(this,void 0,void 0,i().mark((function t(){var e=this;return i().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 Zv(this,void 0,void 0,i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.rendering,e.t0=t.restartIncremental,!e.t0){e.next=7;break}return n=!1,e.next=6,this.forceStop();case 6:this.resetToInit();case 7:return e.abrupt("return",n);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"forceStop",value:function(){return Zv(this,void 0,void 0,i().mark((function t(){var e=this;return i().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=Yv.STOP,t.next=5,new Promise((function(t){e.hooks.completeDraw.tap("stopCb",(function(){e.status=Yv.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 Zv(this,void 0,void 0,i().mark((function n(){var r=this;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.break||!1===t.attribute.visibleAll){n.next=11;break}if(!t.incremental||e.startAtId!==t._uid){n.next=7;break}return n.next=4,this._increaseRender(t,e);case 4:n.t0=void(e.break=!0),n.next=10;break;case 7:return n.next=9,new Promise((function(n){r.renderItem(t,e,{drawingCb:function(){return Zv(r,void 0,void 0,i().mark((function r(){var a=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,Dv(t,vi.zIndex,(function(t){return Zv(a,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=e.break,n.t0){n.next=6;break}if(n.t1=t.isContainer,!n.t1){n.next=6;break}return n.next=6,this.renderGroup(t,e);case 6:case"end":return n.stop()}}),n,this)})))}));case 2:n(!1);case 3:case"end":return r.stop()}}),r)})))}})}));case 9:n.t0=void n.sent;case 10:return n.abrupt("return",n.t0);case 11:case"end":return n.stop()}}),n,this)})))}}])}(zv);Jv=Xv([L(),qv(0,I(Mf)),qv(1,O(Wv)),qv(2,O(Hv)),qv(3,O($)),qv(3,D(Kf)),Kv("design:paramtypes",[Array,Object,Object,Object])],Jv);var $v=new x((function(e){e(qh).toSelf().inSingletonScope(),e(Jh).toSelf().inSingletonScope(),e(Hf).to(zv),e(Tf).to(Jv),e(Pf).to(t.DefaultCanvasGroupRender).inSingletonScope(),e(Mf).toService(Pf),et(e,Ou),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),et(e,zu),et(e,Mf),e(t.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(),e(Kf).toService(t.CommonDrawItemInterceptorContribution),et(e,Kf)}));function Qv(){Qv.__loaded||(Qv.__loaded=!0,Hi.load(vu),Hi.load(vv),Hi.load(ov),Hi.load(fv),Hi.load(_v),function(t){t.load(xv),t.load(wv),t.load(Ov)}(Hi),function(t){t.load($v)}(Hi))}Qv.__loaded=!1,Qv();var tp=Hi.get(ot);Mi.global=tp;var ep=Hi.get(su);Mi.graphicUtil=ep;var np=Hi.get(ou);Mi.transformUtil=np;var ip=Hi.get(Zs);Mi.graphicService=ip;var rp=Hi.get(uu);Mi.layerService=rp;var ap=function(){return u((function t(){o(this,t),this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=_.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){this.pluginService=t,Mi.graphicService.hooks.onAttributeUpdate.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()})),Mi.graphicService.hooks.onSetStage.tap(this.key,(function(e){e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&e.stage.renderNextFrame()}))}},{key:"deactivate",value:function(t){var e=this;Mi.graphicService.hooks.onAttributeUpdate.taps=Mi.graphicService.hooks.onAttributeUpdate.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.onSetStage.taps=Mi.graphicService.hooks.onSetStage.taps.filter((function(t){return t.name!==e.key}))}}])}(),op=function(){return u((function t(){var e=this;o(this,t),this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=_.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!0,e.pageX=t.page.x,e.pageY=t.page.y)},this.onMouseUp=function(t){e.option3d||(e.option3d=e.pluginService.stage.option3d),e.option3d&&(e.mousedown=!1)},this.onMouseMove=function(t){var n,i,r=e.pluginService.stage;if(e.option3d||(e.option3d=r.option3d),e.option3d&&e.mousedown)if(e.pageX&&e.pageY){var a=t.page.x-e.pageX,o=t.page.y-e.pageY;e.pageX=t.page.x,e.pageY=t.page.y;var s=a/100,u=o/100;e.option3d.alpha=(null!==(n=e.option3d.alpha)&&void 0!==n?n:0)+s,e.option3d.beta=(null!==(i=e.option3d.beta)&&void 0!==i?i:0)+u,r.set3dOptions(e.option3d),r.renderNextFrame()}else e.pageX=t.page.x,e.pageY=t.page.y}}),[{key:"activate",value:function(t){this.pluginService=t;var e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}},{key:"deactivate",value:function(t){var e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}])}(),sp=function(){return u((function t(){o(this,t),this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=_.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,Mi.graphicService.hooks.onAddIncremental.tap(this.key,(function(n,i,r){n.glyphHost&&(n=n.glyphHost),n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=i._uid,e.renderNextFrame(i))})),Mi.graphicService.hooks.onClearIncremental.tap(this.key,(function(n,i){n.stage===t.stage&&null!=n.stage&&(e.nextUserParams.startAtId=n._uid,e.nextUserParams.restartIncremental=!0,e.renderNextFrame(n))}))}},{key:"deactivate",value:function(t){var e=this;Mi.graphicService.hooks.onAddIncremental.taps=Mi.graphicService.hooks.onAddIncremental.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.onClearIncremental.taps=Mi.graphicService.hooks.onClearIncremental.taps.filter((function(t){return t.name!==e.key}))}},{key:"renderNextFrame",value:function(t){var e=this;this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,Mi.global.getRequestAnimationFrame()((function(){e._doRenderInThisFrame(),e.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){var t=this,e=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((function(n){var i=n.layer;if(i&&n.layer.subLayers){var r=n.layer.subLayers.get(n._uid);r&&r.drawContribution&&r.drawContribution.draw(e.renderService,Object.assign({stage:e,layer:i,viewBox:e.window.getViewBox(),transMatrix:e.window.getViewBoxTransform(),clear:"transparent",renderService:e.renderService,updateBounds:!1,startAtId:n._uid,context:r.layer.getNativeHandler().getContext()},t.nextUserParams))}})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}])}(),up=function(){return u((function t(){o(this,t),this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=_.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(n){n&&n===e.pluginService.stage&&e.drawHTML(t.stage.renderService)}))}},{key:"deactivate",value:function(t){var e=this;t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.onRemove.unTap(this.key),Mi.graphicService.hooks.onRelease.unTap(this.key),this.release()}},{key:"getWrapContainer",value:function(t,e,n){var i;return i=e?"string"==typeof e?Mi.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:Mi.global.createDom(Object.assign({tagName:"div",parent:i},n)),nativeContainer:i}}},{key:"parseDefaultStyleFromGraphic",value:function(t){return qu("text"===t.type&&t.attribute?t.attribute:zr(t).text)}},{key:"getTransformOfText",value:function(t){var e=zr(t).text,n=t.attribute,i=n.textAlign,r=void 0===i?e.textAlign:i,a=n.textBaseline,o=void 0===a?e.textBaseline:a,s=t.globalTransMatrix.toTransformAttrs(),u=s.rotateDeg,l=s.scaleX,c=s.scaleY,h={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},d={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:r,transform:"translate(".concat(h[r],",").concat(h[o],") rotate(").concat(u,"deg) scaleX(").concat(l,") scaleY(").concat(c,")"),transformOrigin:"".concat(d[r]," ").concat(d[o])}}},{key:"updateStyleOfWrapContainer",value:function(t,e,n,i,r){var a=r.pointerEvents,o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===a?"all":a||"none",n.style.position||(n.style.position="absolute",i.style.position="relative");var s=0,u=0,l=t.globalAABBBounds,c=r.anchorType;if(gt(c)&&(c="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===c&&(c="top-left"),"position"===c||l.empty()){var h=t.globalTransMatrix;s=h.e,u=h.f}else{var d=function(t,e){var n=t.x1,i=t.x2,r=t.y1,a=t.y2,o=Math.abs(i-n),s=Math.abs(a-r),u=(n+i)/2,l=(r+a)/2,c=0,h=0;switch(e){case"top":case"inside-top":h=-.5;break;case"bottom":case"inside-bottom":h=.5;break;case"left":case"inside-left":c=-.5;break;case"right":case"inside-right":c=.5;break;case"top-right":c=.5,h=-.5;break;case"top-left":c=-.5,h=-.5;break;case"bottom-right":c=.5,h=.5;break;case"bottom-left":c=-.5,h=.5}return{x:u+=c*o,y:l+=h*s}}(l,c);s=d.x,u=d.y}var f=Mi.global.getElementTopLeft(i,!1),v=e.window.getTopLeft(!1),p=e.viewBox,g=s+v.left-f.left+p.x1,y=u+v.top-f.top+p.y1;if(o.left="".concat(g,"px"),o.top="".concat(y,"px"),"text"===t.type&&"position"===c&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),pt(r.style)){var m=r.style({top:y,left:g,width:l.width(),height:l.height()},t,n);m&&(o=Object.assign(Object.assign({},o),m))}else mt(r.style)?o=Object.assign(Object.assign({},o),r.style):xt(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){var t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((function(e){if(e){var n=e.split(":");if(2===n.length){var i=n[0].trim(),r=n[1].trim();i&&r&&(t[i]=r)}}})),t}(r.style)));Mi.global.updateDom(n,{width:r.width,height:r.width,style:o})}},{key:"clearCacheContainer",value:function(){var t=this;this.htmlMap&&Object.keys(this.htmlMap).forEach((function(e){t.htmlMap[e]&&t.htmlMap[e].renderId!==t.renderId&&t.removeElement(e)})),this.renderId+=1}},{key:"drawHTML",value:function(t){var e=this;"browser"===Mi.global.env&&(t.renderTreeRoots.sort((function(t,e){var n,i;return(null!==(n=t.attribute.zIndex)&&void 0!==n?n:vi.zIndex)-(null!==(i=e.attribute.zIndex)&&void 0!==i?i:vi.zIndex)})).forEach((function(t){e.renderGroupHTML(t)})),this.clearCacheContainer())}},{key:"renderGroupHTML",value:function(t){var e=this;this.renderGraphicHTML(t),t.forEachChildren((function(t){t.isContainer?e.renderGroupHTML(t):e.renderGraphicHTML(t)}))}},{key:"removeElement",value:function(t){if(this.htmlMap&&this.htmlMap[t]){var e=this.htmlMap[t].wrapContainer;e&&Mi.global.removeDom(e),this.htmlMap[t]=null}}},{key:"renderGraphicHTML",value:function(t){var e,n=t.attribute.html;if(n){var i=t.stage;if(i){var r=n.dom,a=n.container;if(r){var o=gt(n.id)?"".concat(null!==(e=t.id)&&void 0!==e?e:t._uid,"_react"):n.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])"string"==typeof r?this.htmlMap[o].wrapContainer.innerHTML=r:r!==this.htmlMap[o].wrapContainer.firstChild&&(this.htmlMap[o].wrapContainer.removeChild(this.htmlMap[o].wrapContainer.firstChild),this.htmlMap[o].wrapContainer.appendChild(r));else{var s=this.getWrapContainer(i,a),u=s.wrapContainer,l=s.nativeContainer;u&&("string"==typeof r?u.innerHTML=r:u.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[o]={wrapContainer:u,nativeContainer:l,container:a,renderId:this.renderId})}if(this.htmlMap&&this.htmlMap[o]){var c=this.htmlMap[o],h=c.wrapContainer,d=c.nativeContainer;this.updateStyleOfWrapContainer(t,i,h,d,n),this.htmlMap[o].renderId=this.renderId}}}}}},{key:"release",value:function(){"browser"===Mi.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}},{key:"removeAllDom",value:function(t){var e=this;this.htmlMap&&(Object.keys(this.htmlMap).forEach((function(t){e.removeElement(t)})),this.htmlMap=null)}}])}(),lp=new de,cp=function(){return u((function t(){o(this,t),this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=_.GenAutoIncrementId(),this.key=this.name+this._uid}),[{key:"activate",value:function(t){var e=this;this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(function(t){t&&t===e.pluginService.stage&&t.dirtyBounds.clear()})),Mi.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,n,i,r){t.glyphHost&&(t=t.glyphHost),n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(lp.setValue(r.x1,r.y1,r.x2,r.y2),n.dirty(lp,t.parent&&t.parent.globalTransMatrix)))})),Mi.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,n,i,r,a){n&&n===e.pluginService.stage&&n.renderCount&&(t.isContainer&&!a||n.dirty(r.globalAABBBounds))})),Mi.graphicService.hooks.onRemove.tap(this.key,(function(t){var n=t.stage;n&&n===e.pluginService.stage&&n.renderCount&&n&&n.dirty(t.globalAABBBounds)}))}},{key:"deactivate",value:function(t){var e=this;Mi.graphicService.hooks.beforeUpdateAABBBounds.taps=Mi.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.afterUpdateAABBBounds.taps=Mi.graphicService.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.onRemove.taps=Mi.graphicService.hooks.onRemove.taps.filter((function(t){return t.name!==e.key}))}}])}(),hp=new de,dp=function(){return u((function t(){o(this,t),this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=_.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new de}),[{key:"pauseLayout",value:function(t){this.pause=t}},{key:"tryLayoutChildren",value:function(t){t.firstChild&&this.tryLayout(t.firstChild)}},{key:"tryLayout",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.pause){var i=t.parent;if(n||i&&t.needUpdateLayout()){var r=zr(i).group,a=i.attribute.display;if("flex"===(void 0===a?r.display:a)){var o=i.attribute,s=o.flexDirection,u=void 0===s?r.flexDirection:s,l=o.flexWrap,c=void 0===l?r.flexWrap:l,h=o.alignItems,d=void 0===h?r.alignItems:h,f=o.clip,v=void 0===f?r.clip:f,p=i.attribute.alignContent,g=void 0===p?null!=d?d:r.alignContent:p,y=i.attribute,m=y.width,k=y.height,b=y.justifyContent,_=void 0===b?r.justifyContent:b,x=i.getChildren();if(null==m||null==k){var w=0,S=0,A=0;if(x.forEach((function(t){var n=e.getAABBBounds(t);n.empty()||("column"===u||"column-reverse"===u?(S+=n.height(),w=Math.max(w,n.width())):(w+=n.width(),S=Math.max(S,n.height())),A+=n.x1,A+=n.y1,A+=n.x2,A+=n.y2)})),!isFinite(A))return;m=w,k=S}null==i.attribute.width?i.attribute.width=m:m=i.attribute.width,null==i.attribute.height?i.attribute.height=k:k=i.attribute.height,this.tempBounds.copy(i._AABBBounds);var T={main:{len:m,field:"x"},cross:{len:k,field:"y"}},C=T.main,E=T.cross;"column"!==u&&"column-reverse"!==u||(C.len=k,E.len=m,C.field="y",E.field="x"),"row-reverse"!==u&&"column-reverse"!==u||("flex-start"===_?_="flex-end":"flex-end"===_?_="flex-start":x.reverse());var R=0,B=0,M=[];x.forEach((function(t){var n=e.getAABBBounds(t);if(!n.empty()){var i="x"===C.field?n.width():n.height(),r="x"===E.field?n.width():n.height();M.push({mainLen:i,crossLen:r}),R+=i,B=Math.max(B,r)}}));var P=[];if(R>C.len&&"wrap"===c){var O=0,I=0;M.forEach((function(t,e){var n=t.mainLen,i=t.crossLen;O+n>C.len?0===O?(P.push({idx:e,mainLen:O+n,crossLen:i}),O=0,I=0):(P.push({idx:e-1,mainLen:O,crossLen:I}),O=n,I=i):(O+=n,I=Math.max(I,i))})),P.push({idx:M.length-1,mainLen:O,crossLen:I})}else P.push({idx:M.length-1,mainLen:R,crossLen:B});var L=0;if(P.forEach((function(t){e.layoutMain(i,x,_,C,M,L,t),L=t.idx+1})),B=P.reduce((function(t,e){return t+e.crossLen}),0),1===P.length){var D={"flex-start":0,"flex-end":E.len,center:E.len/2};this.layoutCross(x,d,E,D,M,P[0],0)}else if("flex-start"===g){L=0;var j=0;P.forEach((function(t,n){var i={"flex-start":j,"flex-end":j+t.crossLen,center:j+t.crossLen/2};e.layoutCross(x,"flex-start",E,i,M,P[n],L),L=t.idx+1,j+=t.crossLen}))}else if("center"===g){L=0;var F=Math.max(0,(E.len-B)/2);P.forEach((function(t,n){var i={"flex-start":F,"flex-end":F+t.crossLen,center:F+t.crossLen/2};e.layoutCross(x,"center",E,i,M,P[n],L),L=t.idx+1,F+=t.crossLen}))}else if("space-around"===g){L=0;var N=Math.max(0,(E.len-B)/P.length/2),G=N;P.forEach((function(t,n){var i={"flex-start":G,"flex-end":G+t.crossLen,center:G+t.crossLen/2};e.layoutCross(x,"flex-start",E,i,M,P[n],L),L=t.idx+1,G+=t.crossLen+2*N}))}else if("space-between"===g){L=0;var z=Math.max(0,(E.len-B)/(2*P.length-2)),U=0;P.forEach((function(t,n){var i={"flex-start":U,"flex-end":U+t.crossLen,center:U+t.crossLen/2};e.layoutCross(x,"flex-start",E,i,M,P[n],L),L=t.idx+1,U+=t.crossLen+2*z}))}x.forEach((function(t,e){t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();var W=this.getAABBBounds(i);v||this.tempBounds.equals(W)||this.tryLayout(i,!1)}}}}},{key:"getAABBBounds",value:function(t){this.skipBoundsTrigger=!0;var e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}},{key:"updateChildPos",value:function(t,e,n){return t+(null!=e?e:0)-n}},{key:"layoutMain",value:function(t,e,n,i,r,a,o){if("flex-start"===n)for(var s=0,u=a;u<=o.idx;u++){var l=s+(e[u],i.field,0),c=this.getAABBBounds(e[u]);!c.empty()&&(e[u].attribute[i.field]=this.updateChildPos(l,e[u].attribute[i.field],c["".concat(i.field,"1")])),s+=r[u].mainLen}else if("flex-end"===n)for(var h=i.len,d=o.idx;d>=a;d--){var f=(h-=r[d].mainLen)+(e[d],i.field,0),v=this.getAABBBounds(e[d]);!v.empty()&&(e[d].attribute[i.field]=this.updateChildPos(f,e[d].attribute[i.field],v["".concat(i.field,"1")]))}else if("space-around"===n)if(o.mainLen>=i.len)for(var p=0,g=a;g<=o.idx;g++){var y=p+(e[g],i.field,0),m=this.getAABBBounds(e[g]);!m.empty()&&(e[g].attribute[i.field]=this.updateChildPos(y,e[g].attribute[i.field],m["".concat(i.field,"1")])),p+=r[g].mainLen}else for(var k=o.idx-a+1,b=(i.len-o.mainLen)/k/2,_=b,x=a;x<=o.idx;x++){var w=_+(e[x],i.field,0),S=this.getAABBBounds(e[x]);!S.empty()&&(e[x].attribute[i.field]=this.updateChildPos(w,e[x].attribute[i.field],S["".concat(i.field,"1")])),_+=r[x].mainLen+2*b}else if("space-between"===n)if(o.mainLen>=i.len)for(var A=0,T=a;T<=o.idx;T++){var C=A+(e[T],i.field,0),E=this.getAABBBounds(e[T]);!E.empty()&&(e[T].attribute[i.field]=this.updateChildPos(C,e[T].attribute[i.field],E["".concat(i.field,"1")])),A+=r[T].mainLen}else for(var R=o.idx-a+1,B=(i.len-o.mainLen)/(2*R-2),M=0,P=a;P<=o.idx;P++){var O=M+(e[P],i.field,0),I=this.getAABBBounds(e[P]);!I.empty()&&(e[P].attribute[i.field]=this.updateChildPos(O,e[P].attribute[i.field],I["".concat(i.field,"1")])),M+=r[P].mainLen+2*B}else if("center"===n)for(var L=(i.len-o.mainLen)/2,D=a;D<=o.idx;D++){var j=L+(e[D],i.field,0),F=this.getAABBBounds(e[D]);!F.empty()&&(e[D].attribute[i.field]=this.updateChildPos(j,e[D].attribute[i.field],F["".concat(i.field,"1")])),L+=r[D].mainLen}}},{key:"layoutCross",value:function(t,e,n,i,r,a,o){for(var s,u=o;u<=a.idx;u++){var l=t[u],c=l.attribute.alignSelf;c&&"auto"!==c||(c=e);var h=this.getAABBBounds(l),d=null!==(s=i[c])&&void 0!==s?s:i["flex-start"];"flex-end"===c?!h.empty()&&(l.attribute[n.field]=this.updateChildPos(d-r[u].crossLen+(n.field,0),l.attribute[n.field],h["".concat(n.field,"1")])):"center"===c?!h.empty()&&(l.attribute[n.field]=this.updateChildPos(d-r[u].crossLen/2+(n.field,0),l.attribute[n.field],h["".concat(n.field,"1")])):!h.empty()&&(l.attribute[n.field]=this.updateChildPos(d+(n.field,0),l.attribute[n.field],h["".concat(n.field,"1")]))}}},{key:"activate",value:function(t){var e=this;this.pluginService=t,Mi.graphicService.hooks.onAttributeUpdate.tap(this.key,(function(t){t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===e.pluginService.stage&&e.tryLayout(t,!1)})),Mi.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,(function(t,n,i,r){t.glyphHost&&(t=t.glyphHost),n&&n===e.pluginService.stage&&t.isContainer&&!e.skipBoundsTrigger&&hp.copy(r)})),Mi.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,(function(t,n,i,r,a){n&&n===e.pluginService.stage&&t.isContainer&&!e.skipBoundsTrigger&&(hp.equals(i)||e.tryLayout(t,!1))})),Mi.graphicService.hooks.onSetStage.tap(this.key,(function(t){t.glyphHost&&(t=t.glyphHost),e.tryLayout(t,!1)}))}},{key:"deactivate",value:function(t){var e=this;Mi.graphicService.hooks.onAttributeUpdate.taps=Mi.graphicService.hooks.onAttributeUpdate.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.beforeUpdateAABBBounds.taps=Mi.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.afterUpdateAABBBounds.taps=Mi.graphicService.hooks.afterUpdateAABBBounds.taps.filter((function(t){return t.name!==e.key})),Mi.graphicService.hooks.onSetStage.taps=Mi.graphicService.hooks.onSetStage.taps.filter((function(t){return t.name!==e.key}))}}])}();var fp=new oa;fp.addTimeline(ca),fp.setFPS(60);var vp=function(){return u((function e(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;o(this,e),this.dir=n,this.color=i,this.colorRgb=Eo.Get(i,t.ColorType.Color1),this.ambient=r;var a=ee(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);this.formatedDir=[n[0]/a,n[1]/a,n[2]/a]}),[{key:"computeColor",value:function(e,n){var i,r=this.formatedDir,a=Qt($t((e[0]*r[0]+e[1]*r[1]+e[2]*r[2])*(1-this.ambient/2),0)+this.ambient,1);i=xt(n)?Eo.Get(n,t.ColorType.Color1):n;var o=this.colorRgb;return"rgb(".concat(o[0]*i[0]*a,", ").concat(o[1]*i[1]*a,", ").concat(o[2]*i[2]*a,")")}}])}();function pp(t,e,n,i){var r,a,o,s,u,l,c,h,d,f,v=e[0],p=e[1],g=e[2],y=i[0],m=i[1],k=i[2],b=n[0],_=n[1],x=n[2];return Math.abs(v-b)<Vt&&Math.abs(p-_)<Vt&&Math.abs(g-x)<Vt?wh.identity(t):(c=v-b,h=p-_,d=g-x,r=m*(d*=f=1/Math.hypot(c,h,d))-k*(h*=f),a=k*(c*=f)-y*d,o=y*h-m*c,(f=Math.hypot(r,a,o))?(r*=f=1/f,a*=f,o*=f):(r=0,a=0,o=0),s=h*o-d*a,u=d*r-c*o,l=c*a-h*r,(f=Math.hypot(s,u,l))?(s*=f=1/f,u*=f,l*=f):(s=0,u=0,l=0),t[0]=r,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*v+a*p+o*g),t[13]=-(s*v+u*p+l*g),t[14]=-(c*v+h*p+d*g),t[15]=1,t)}function gp(t,e,n,i,r,a,o){var s=1/(e-n),u=1/(i-r),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*u,t[14]=(o+a)*l,t[15]=1,t}function yp(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],p=e[12],g=e[13],y=e[14],m=e[15],k=n[0],b=n[1],_=n[2],x=n[3];return t[0]=k*i+b*s+_*h+x*p,t[1]=k*r+b*u+_*d+x*g,t[2]=k*a+b*l+_*f+x*y,t[3]=k*o+b*c+_*v+x*m,k=n[4],b=n[5],_=n[6],x=n[7],t[4]=k*i+b*s+_*h+x*p,t[5]=k*r+b*u+_*d+x*g,t[6]=k*a+b*l+_*f+x*y,t[7]=k*o+b*c+_*v+x*m,k=n[8],b=n[9],_=n[10],x=n[11],t[8]=k*i+b*s+_*h+x*p,t[9]=k*r+b*u+_*d+x*g,t[10]=k*a+b*l+_*f+x*y,t[11]=k*o+b*c+_*v+x*m,k=n[12],b=n[13],_=n[14],x=n[15],t[12]=k*i+b*s+_*h+x*p,t[13]=k*r+b*u+_*d+x*g,t[14]=k*a+b*l+_*f+x*y,t[15]=k*o+b*c+_*v+x*m,t}function mp(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,t}var kp,bp=function(){return u((function t(e){o(this,t),this.params=e}),[{key:"params",get:function(){return Object.assign({},this._params)},set:function(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}},{key:"getViewMatrix",value:function(){return this._viewMatrixCached||(this._viewMatrixCached=Ah.allocate()),this._viewMatrixCached}},{key:"forceGetViewMatrix",value:function(){this._viewMatrixCached||(this._viewMatrixCached=Ah.allocate());var t=this.params.viewParams,e=t.pos,n=t.center,i=t.up;return pp(this._viewMatrixCached,e,n,i),this._vp||(this._vp=Ah.allocate()),this._vp=yp(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}},{key:"getProjectionMatrix",value:function(){return this._projectionMatrixCached||(this._projectionMatrixCached=Ah.allocate()),this._projectionMatrixCached}},{key:"forceGetProjectionMatrix",value:function(){this._projectionMatrixCached||(this._projectionMatrixCached=Ah.allocate());var t=this._params,e=t.left,n=t.top,i=t.right,r=t.bottom;return gp(this._projectionMatrixCached,e,i,r,n,0,-2e6),this._vp||(this._vp=Ah.allocate()),this._vp=yp(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}},{key:"getField",value:function(){var t=this._params,e=t.fieldRatio,n=void 0===e?.8:e,i=t.fieldDepth,r=t.left,a=t.right;return(null!=i?i:a-r)*n}},{key:"getProjectionScale",value:function(t){var e=this.getField();return e/(e+t)}},{key:"view",value:function(t,e,n){var i=[0,0,0];return mp(i,[t,e,n],this._viewMatrixCached),i}},{key:"vp",value:function(t,e,n){var i=[0,0,0],r=this._params.viewParams.pos;mp(i,[t,e,n],this._viewMatrixCached),t=i[0],e=i[1],n=i[2];var a=this.getProjectionScale(n);return{x:t*a+r[0],y:e*a+r[1]}}}])}();function _p(){if(null==kp)try{var t=document.createElement("canvas"),e=t.getContext("2d");(kp=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke))&&(kp=!!document.createElement)}catch(t){kp=!1}}function xp(){_p();var t=Mi.global&&Mi.global.env;return t?"browser"===t:kp}function wp(){_p();var t=Mi.global&&Mi.global.env;return t?"node"===t:!kp}var Sp=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).name="ReactAttributePlugin",t.activeEvent="onRegister",t._uid=_.GenAutoIncrementId(),t.key=t.name+t._uid,t.htmlMap={},t}return c(n,t),u(n,[{key:"removeElement",value:function(t){if(this.htmlMap&&this.htmlMap[t]){var e=this.htmlMap[t],n=e.root,i=e.wrapContainer,r=e.unmount;n?Mi.global.getRequestAnimationFrame()((function(){n.unmount()})):r&&r(),i&&Mi.global.removeDom(i),this.htmlMap[t]=null}}},{key:"renderGraphicHTML",value:function(t){var e,n=t.attribute.react;if(n){var i=t.stage;if(i){var r=i.params.ReactDOM,a=n.element,o=n.container;if(a&&r&&(r.createRoot||r.render)){var s=gt(n.id)?"".concat(null!==(e=t.id)&&void 0!==e?e:t._uid,"_react"):n.id;if(this.htmlMap&&this.htmlMap[s]&&o&&o!==this.htmlMap[s].container&&this.removeElement(s),this.htmlMap&&this.htmlMap[s])r.createRoot?this.htmlMap[s].root.render(a):r.render(a,this.htmlMap[s].wrapContainer);else{var u=this.getWrapContainer(i,o),l=u.wrapContainer,c=u.nativeContainer;if(l)if(this.htmlMap||(this.htmlMap={}),r.createRoot){var h=r.createRoot(l);h.render(a),this.htmlMap[s]={root:h,wrapContainer:l,nativeContainer:c,container:o,renderId:this.renderId}}else r.render(a,l),this.htmlMap[s]={wrapContainer:l,nativeContainer:c,container:o,renderId:this.renderId,unmount:function(){r.unmountComponentAtNode(l)}}}if(this.htmlMap&&this.htmlMap[s]){var d=this.htmlMap[s],f=d.wrapContainer,v=d.nativeContainer;this.updateStyleOfWrapContainer(t,i,f,v,n),this.htmlMap[s].renderId=this.renderId}}}}}}])}(up),Ap="white",Tp=function(t){function n(){var t,i,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(t=e(this,n,[{}]))._onVisibleChange=function(e){if(!(t._skipRender<0))if(e){if(t.dirtyBounds){var n=t.window.getViewBox();t.dirtyBounds.setValue(n.x1,n.y1,n.width(),n.height())}t._skipRender>1&&t.renderNextFrame(),t._skipRender=0}else t._skipRender=1},t.beforeRender=function(e){t._beforeRender&&t._beforeRender(e)},t.afterRender=function(e){t.renderCount++,t._afterRender&&t._afterRender(e),t._afterNextRenderCbs&&t._afterNextRenderCbs.forEach((function(t){return t(e)})),t._afterNextRenderCbs=null},t.params=r,t.theme=new Nr,t.hooks={beforeRender:new rt(["stage"]),afterRender:new rt(["stage"])},t.global=Mi.global,!t.global.env&&xp()&&t.global.setEnv("browser"),t.window=Hi.get(Cr),t.renderService=Hi.get(rv),t.pluginService=Hi.get(gv),t.layerService=Hi.get(uu),t.pluginService.active(f(t),r),t.window.create({width:r.width,height:r.height,viewBox:r.viewBox,container:r.container,dpr:r.dpr||t.global.devicePixelRatio,canvasControled:!1!==r.canvasControled,title:r.title||"",canvas:r.canvas}),t.state="normal",t.renderCount=0,t.tryInitEventSystem(),t._background=null!==(i=r.background)&&void 0!==i?i:Ap,t.appendChild(t.layerService.createLayer(f(t),{main:!0})),t.nextFrameRenderLayerSet=new Set,t.willNextFrameRender=!1,t.stage=f(t),t.renderStyle=r.renderStyle,r.autoRender&&t.enableAutoRender(),!1===r.disableDirtyBounds&&t.enableDirtyBounds(),r.enableHtmlAttribute&&t.enableHtmlAttribute(r.enableHtmlAttribute),r.ReactDOM&&t.enableReactAttribute(r.ReactDOM),r.enableLayout&&t.enableLayout(),t.hooks.beforeRender.tap("constructor",t.beforeRender),t.hooks.afterRender.tap("constructor",t.afterRender),t._beforeRender=r.beforeRender,t._afterRender=r.afterRender,t.ticker=r.ticker||fp,t.supportInteractiveLayer=!1!==r.interactiveLayer,t.timeline=new la,t.ticker.addTimeline(t.timeline),t.timeline.pause(),r.optimize||(r.optimize={}),t.optmize(r.optimize),r.background&&xt(t._background)&&t._background.includes("/")&&t.setAttributes({background:t._background}),t}return c(n,t),u(n,[{key:"viewBox",get:function(){return this.window.getViewBox()},set:function(t){this.window.setViewBox(t)}},{key:"x",get:function(){return this.window.getViewBox().x1},set:function(t){var e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}},{key:"y",get:function(){return this.window.getViewBox().y1},set:function(t){var e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}},{key:"width",get:function(){return this.window.width},set:function(t){this.resize(t,this.height)}},{key:"viewWidth",get:function(){return this.window.getViewBox().width()},set:function(t){this.resizeView(t,this.viewHeight)}},{key:"viewHeight",get:function(){return this.window.getViewBox().height()},set:function(t){this.resizeView(this.viewWidth,t)}},{key:"height",get:function(){return this.window.height},set:function(t){this.resize(this.width,t)}},{key:"dpr",get:function(){return this.window.dpr},set:function(t){this.setDpr(t)}},{key:"background",get:function(){var t;return null!==(t=this._background)&&void 0!==t?t:Ap},set:function(t){this._background=t}},{key:"defaultLayer",get:function(){return this.at(0)}},{key:"eventSystem",get:function(){return this._eventSystem}},{key:"pauseRender",value:function(){this._skipRender=-1}},{key:"resumeRender",value:function(){this._skipRender=0}},{key:"tryInitEventSystem",value:function(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new na(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}},{key:"preventRender",value:function(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}},{key:"optmize",value:function(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}},{key:"optmizeRender",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}},{key:"getTimeline",value:function(){return this.timeline}},{key:"get3dOptions",value:function(t){var e=t.center,n=void 0===e?{x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0}:e,i=t.light,r=void 0===i?{}:i,a=t.alpha,o=void 0===a?0:a,s=t.beta,u=void 0===s?0:s,l=t.camera,c=t.fieldRatio,h=void 0===c?1:c,d=t.fieldDepth;return Object.assign(Object.assign({},t),{center:n,light:r,alpha:o,beta:u,camera:l,fieldRatio:h,fieldDepth:d})}},{key:"set3dOptions",value:function(t){var e,n,i,r,a,o;this.option3d=t;var s=this.get3dOptions(t),u=s.light,l=s.center,c=s.camera,h=s.alpha,d=s.beta,f=s.fieldRatio,v=s.fieldDepth,p=u.dir,g=void 0===p?[1,1,-1]:p,y=u.color,m=void 0===y?"white":y,k=u.ambient,b=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(n=l.dx)&&void 0!==n?n:0),_=(null!==(i=l.y)&&void 0!==i?i:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[b,_,(null!==(a=l.z)&&void 0!==a?a:0)+(null!==(o=l.dz)&&void 0!==o?o:0)],w=0,S=0,A=0;c||(w=Math.sin(h)+b,S=Math.sin(d)+_,A=Math.cos(h)*Math.cos(d)*1),this.light=new vp(g,m,k);var T={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:f,fieldDepth:v,viewParams:{pos:[w,S,A],center:x,up:[0,1,0]}};this.camera?this.camera.params=T:this.camera=new bp(T),t.enableView3dTransform&&this.enableView3dTransform()}},{key:"setBeforeRender",value:function(t){this._beforeRender=t}},{key:"setAfterRender",value:function(t){this._afterRender=t}},{key:"afterNextRender",value:function(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}},{key:"enableView3dTransform",value:function(){this.view3dTranform||(this.view3dTranform=!0,this.pluginService.register(new op))}},{key:"disableView3dTranform",value:function(){var t=this;this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableAutoRender",value:function(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new ap))}},{key:"disableAutoRender",value:function(){var t=this;this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableIncrementalAutoRender",value:function(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new sp))}},{key:"disableIncrementalAutoRender",value:function(){var t=this;this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableDirtyBounds",value:function(){if(!this.dirtyBounds){this.dirtyBounds=new he;var t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new cp,this.pluginService.register(t))}}},{key:"disableDirtyBounds",value:function(){var t=this;this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableLayout",value:function(){this._enableLayout||(this._enableLayout=!0,this.pluginService.register(new dp))}},{key:"disableLayout",value:function(){var t=this;this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableHtmlAttribute",value:function(t){this.htmlAttribute||(this.htmlAttribute=t,this.pluginService.register(new up))}},{key:"disableHtmlAttribute",value:function(){var t=this;this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"enableReactAttribute",value:function(t){this.reactAttribute||(this.reactAttribute=t,this.pluginService.register(new Sp))}},{key:"disableReactAttribute",value:function(){var t=this;this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((function(e){t.pluginService.unRegister(e)})))}},{key:"getPluginsByName",value:function(t){return this.pluginService.findPluginsByName(t)}},{key:"tryUpdateAABBBounds",value:function(){var t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}},{key:"combineLayer",value:function(t,e){throw new Error("暂不支持")}},{key:"createLayer",value:function(t,e){if("released"!==this.releaseStatus){var n=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(n),n}}},{key:"sortLayer",value:function(t){var e=this,n=this.children;n.sort(t),this.removeAllChild(),n.forEach((function(t){e.appendChild(t)}))}},{key:"removeLayer",value:function(t){return this.removeChild(this.findChildByUid(t))}},{key:"tryInitInteractiveLayer",value:function(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}},{key:"clearViewBox",value:function(t){this.window.clearViewBox(t)}},{key:"render",value:function(t,e){if("released"!==this.releaseStatus){this.ticker.start(),this.timeline.resume();var n=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=n,this._skipRender&&this._skipRender++}}},{key:"combineLayersToWindow",value:function(){if("harmony"===this.global.env){var t=this.window.getContext().nativeContext;this.forEachChildren((function(e,n){if(n>0){var i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}},{key:"renderNextFrame",value:function(t,e){var n=this;this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((function(t){n.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((function(){n._doRenderInThisFrame(),n.willNextFrameRender=!1})))}},{key:"_doRenderInThisFrame",value:function(){if("released"!==this.releaseStatus){this.timeline.resume(),this.ticker.start();var t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}}},{key:"renderLayerList",value:function(t,e){for(var n=this,i=[],r=0;r<t.length;r++){var a=t[r];"virtual"===a.layerMode&&(a=a.getNativeHandler().mainHandler.layer),i.includes(a)||i.push(a)}i.forEach((function(t){t.renderCount>n.renderCount||(t.renderCount=n.renderCount+1,t.render({renderService:n.renderService,background:t===n.defaultLayer?n.background:void 0,updateBounds:!(!n.dirtyBounds||n.dirtyBounds.empty()),viewBox:n.window.getViewBox(),transMatrix:n.window.getViewBoxTransform()},Object.assign({renderStyle:n.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}},{key:"resizeWindow",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),n&&this.render()}},{key:"resize",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((function(n){n.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),n&&this.render())}},{key:"resizeView",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((function(n){n.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),n&&this.render())}},{key:"setViewBox",value:function(t,e,n,i,r){var o=this,s=!0;"object"==a(t)?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+n,e+i),!1===r&&(s=!1)),this.forEachChildren((function(t){t.resizeView(o.viewBox.width(),o.viewBox.height())})),s&&this.render()}},{key:"setDpr",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((function(e){e.setDpr(t)})),e&&this.render()}},{key:"setOrigin",value:function(t,e){throw new Error("暂不支持")}},{key:"export",value:function(t){throw new Error("暂不支持")}},{key:"pick",value:function(t,e){if("released"!==this.releaseStatus){this.pickerService||(this.pickerService=Hi.get(uv));var n=this.pickerService.pick(this.children,new ue(t,e),{bounds:this.AABBBounds});return!(!(null==n?void 0:n.graphic)&&!(null==n?void 0:n.group))&&n}}},{key:"startAnimate",value:function(t){throw new Error("暂不支持")}},{key:"setToFrame",value:function(t){throw new Error("暂不支持")}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((function(t){t.release()})),this.interactiveLayer&&this.interactiveLayer.release(),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}},{key:"setStage",value:function(t){}},{key:"dirty",value:function(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}},{key:"getLayer",value:function(t){return this.children.filter((function(e){return e.name===t}))[0]}},{key:"renderTo",value:function(t){var e=this;"released"!==this.releaseStatus&&this.forEachChildren((function(n,i){n.drawTo(t,{renderService:e.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:n===e.defaultLayer?e.background:void 0,clear:0===i,updateBounds:!(!e.dirtyBounds||e.dirtyBounds.empty())})}))}},{key:"renderToNewWindow",value:function(){var t=arguments.length>1?arguments[1]:void 0;if("released"!==this.releaseStatus){var e=Hi.get(Cr),n=t?-t.x1:0,i=t?-t.y1:0,r=t?t.x2:this.viewWidth,a=t?t.y2:this.viewHeight,o=t?t.width():this.viewWidth,s=t?t.height():this.viewHeight;return e.create({viewBox:{x1:n,y1:i,x2:r,y2:a},width:o,height:s,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}}},{key:"toCanvas",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"!==this.releaseStatus){var n=this.renderToNewWindow(t,e).getNativeHandler();return n.nativeCanvas?n.nativeCanvas:null}}},{key:"setCursor",value:function(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}},{key:"getCursor",value:function(){return this._cursor}},{key:"eventPointTransform",value:function(t){var e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}},{key:"pauseTriggerEvent",value:function(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}},{key:"resumeTriggerEvent",value:function(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}])}(nu);function Cp(t){return new Tp(t)}var Ep=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Rp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bp=new pe(1,0,0,1,0,0),Mp={x:0,y:0};t.EmptyContext2d=function(){return u((function t(e,n){o(this,t),this.matrix=new pe(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new pe(1,0,0,1,0,0),this.path=new ei,this._clearMatrix=new pe(1,0,0,1,0,0)}),[{key:"nativeContext",get:function(){return this.path}},{key:"getCanvas",value:function(){throw new Error("不支持getCanvas")}},{key:"getContext",value:function(){throw new Error("不支持getContext")}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return Sh.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.restore()}},{key:"restore",value:function(){this.stack.length>0&&(Sh.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(Sh.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*a),o&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,a),o&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.path.clear()}},{key:"clip",value:function(t,e){}},{key:"arc",value:function(t,e,n,i,r,a){this.path.arc(t,e,n,i,r,a)}},{key:"arcTo",value:function(t,e,n,i,r){this.path.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a){this.path.bezierCurveTo(t,e,n,i,r,a)}},{key:"closePath",value:function(){this.path.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){}},{key:"lineTo",value:function(t,e){this.path.lineTo(t,e)}},{key:"moveTo",value:function(t,e){this.path.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i){this.path.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"createImageData",value:function(t,e){return null}},{key:"createLinearGradient",value:function(t,e,n,i){throw new Error("不支持createLinearGradient")}},{key:"createPattern",value:function(t,e){throw new Error("不支持createPattern")}},{key:"createRadialGradient",value:function(t,e,n,i,r,a){throw new Error("不支持createRadialGradient")}},{key:"createConicGradient",value:function(t,e,n,i){return null}},{key:"fill",value:function(t,e){}},{key:"fillRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){}},{key:"fillText",value:function(t,e,n){}},{key:"getImageData",value:function(t,e,n,i){return null}},{key:"getLineDash",value:function(){return[]}},{key:"isPointInPath",value:function(t,e){return this.matrix.transformPoint({x:t,y:e},Mp),function(t,e,n){return xr(t,0,!1,e,n)}(this.path.commandList,Mp.x,Mp.y)}},{key:"isPointInStroke",value:function(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},Mp);var n=Vh(this,this.lineWidth,this.dpr);return function(t,e,n,i){return xr(t,e,!0,n,i)}(this.path.commandList,n,Mp.x,Mp.y)}},{key:"measureText",value:function(t){throw new Error("不支持measureText")}},{key:"putImageData",value:function(t,e,n){throw new Error("不支持measureText")}},{key:"setLineDash",value:function(t){}},{key:"stroke",value:function(t){}},{key:"strokeRect",value:function(t,e,n,i){this.path.rect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n){}},{key:"drawImage",value:function(){}},{key:"setCommonStyle",value:function(t,e,n,i,r){}},{key:"_setCommonStyle",value:function(t,e,n,i){}},{key:"setStrokeStyle",value:function(t,e,n,i,r){}},{key:"_setStrokeStyle",value:function(t,e,n,i){}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){}},{key:"setTextStyle",value:function(t,e){}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(Bp,t,e)}},{key:"setClearMatrix",value:function(t,e,n,i,r,a){this._clearMatrix.setValue(t,e,n,i,r,a)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return Sh.free(t)})),this.stack.length=0}}])}(),t.EmptyContext2d=Ep([L(),Rp("design:paramtypes",[Object,Number])],t.EmptyContext2d);var Pp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Op=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ip=500,Lp=500,Dp=1;t.BaseCanvas=function(){return u((function t(e){var n;o(this,t);var i=e.nativeCanvas,r=e.width,a=void 0===r?Ip:r,s=e.height,u=void 0===s?Lp:s,l=e.dpr,c=void 0===l?Dp:l,h=e.x,d=e.y,f=e.id,v=e.canvasControled,p=void 0===v||v;this._x=null!=h?h:0,this._y=null!=d?d:0,this._pixelWidth=a*c,this._pixelHeight=u*c,this._visiable=!1!==e.visiable,this.controled=p,this._displayWidth=a,this._displayHeight=u,this._dpr=c,this._nativeCanvas=i,this._id=null!==(n=i.id)&&void 0!==n?n:f,f&&(i.id=f),this.init(e)}),[{key:"displayWidth",get:function(){return this._pixelWidth/this._dpr}},{key:"displayHeight",get:function(){return this._pixelHeight/this._dpr}},{key:"id",get:function(){return this._id}},{key:"x",get:function(){return this._x},set:function(t){this._x=t}},{key:"y",get:function(){return this._y},set:function(t){this._y=t}},{key:"nativeCanvas",get:function(){return this._nativeCanvas}},{key:"width",get:function(){return this._pixelWidth},set:function(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}},{key:"height",get:function(){return this._pixelHeight},set:function(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}},{key:"getContext",value:function(t){return this._context}},{key:"visiable",get:function(){return this._visiable},set:function(t){this._visiable=t,t?this.show():this.hide()}},{key:"dpr",get:function(){return this._dpr},set:function(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}},{key:"getNativeCanvas",value:function(){return this._nativeCanvas}},{key:"hide",value:function(){}},{key:"show",value:function(){}},{key:"applyPosition",value:function(){}},{key:"resetStyle",value:function(t){}},{key:"resize",value:function(t,e){}},{key:"toDataURL",value:function(t,e){return""}},{key:"readPixels",value:function(t,e,n,i){return this._context.getImageData(t,e,n,i)}},{key:"convertToBlob",value:function(t){throw new Error("暂未实现")}},{key:"transferToImageBitmap",value:function(){throw new Error("暂未实现")}},{key:"release",value:function(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}])}(),t.BaseCanvas.env="browser",t.BaseCanvas=Pp([L(),Op("design:paramtypes",[Object])],t.BaseCanvas);var jp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};t.BaseEnvContribution=function(){return u((function t(){o(this,t)}),[{key:"configure",value:function(t){t.env===this.type&&t.setActiveEnvContribution(this)}},{key:"getNativeAABBBounds",value:function(t){return new de}},{key:"removeDom",value:function(t){return!1}},{key:"createDom",value:function(t){return null}},{key:"updateDom",value:function(t,e){return!1}},{key:"getDynamicCanvasCount",value:function(){return 999}},{key:"getStaticCanvasCount",value:function(){return 999}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadBlob",value:function(t){return fetch(t).then((function(t){return t.blob()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"getElementTop",value:function(t,e){return 0}},{key:"getElementLeft",value:function(t,e){return 0}},{key:"getElementTopLeft",value:function(t,e){return{top:0,left:0}}}])}(),t.BaseEnvContribution=jp([L()],t.BaseEnvContribution);var Fp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Np=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.BaseWindowHandlerContribution=function(){return u((function t(){o(this,t),this._uid=_.GenAutoIncrementId(),this.viewBox=new de,this.modelMatrix=new pe(1,0,0,1,0,0)}),[{key:"onChange",value:function(t){this._onChangeCb=t}},{key:"configure",value:function(t,e){e.env===this.type&&t.setWindowHandler(this)}},{key:"release",value:function(){this.releaseWindow()}},{key:"isVisible",value:function(t){return!0}},{key:"onVisibleChange",value:function(t){}},{key:"getTopLeft",value:function(t){return{top:0,left:0}}},{key:"setViewBox",value:function(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}},{key:"getViewBox",value:function(){return this.viewBox}},{key:"setViewBoxTransform",value:function(t,e,n,i,r,a){this.modelMatrix.setValue(t,e,n,i,r,a)}},{key:"getViewBoxTransform",value:function(){return this.modelMatrix}}])}(),t.BaseWindowHandlerContribution=Fp([L(),Np("design:paramtypes",[])],t.BaseWindowHandlerContribution);var Gp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},zp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Up=function(t,e){return function(n,i){e(n,i,t)}};t.DefaultPickService=function(){return u((function t(e){o(this,t),this.pickItemInterceptorContributions=e,this.type="default",this.global=Mi.global}),[{key:"_init",value:function(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort((function(t,e){return t.order-e.order}))}},{key:"pick",value:function(t,e,n){var i={graphic:null,group:null};n.pickerService=this;var r=n.bounds.width(),a=n.bounds.height();if(!(new de).setValue(0,0,r,a).containsPoint(e))return i;this.pickContext&&(this.pickContext.inuse=!0),n.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);for(var o,s=new pe(1,0,0,1,0,0),u=t.length-1;u>=0&&!(i=t[u].isContainer?this.pickGroup(t[u],e,s,n):this.pickItem(t[u],e,s,n)).graphic;u--)o||(o=i.group);if(i.graphic||(i.group=o),this.pickContext&&(this.pickContext.inuse=!1),i.graphic){for(var l=i.graphic;l.parent;)l=l.parent;l.shadowHost&&(i.params={shadowTarget:i.graphic},i.graphic=l.shadowHost)}return i}},{key:"containsPoint",value:function(t,e,n){var i;return!!(null===(i=this.pickItem(t,e,null,null!=n?n:{pickContext:this.pickContext,pickerService:this}))||void 0===i?void 0:i.graphic)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,a={group:null,graphic:null};if(!1===t.attribute.visibleAll)return a;var o=i.pickContext,s=o.modelMatrix;if(o.camera){var u=t.transMatrix,l=Ah.allocate();if(Ph(l,u),s){if(l){var c=Ah.allocate();o.modelMatrix=Oh(c,s,l),Ah.free(l)}}else Ph(l,t.globalTransMatrix),o.modelMatrix=l}if(this.InterceptorContributions.length)for(var h=0;h<this.InterceptorContributions.length;h++){var d=this.InterceptorContributions[h];if(d.beforePickItem){var f=d.beforePickItem(t,this,e,i,{parentMatrix:n});if(f)return o.modelMatrix!==s&&Ah.free(o.modelMatrix),o.modelMatrix=s,f}}var v=t.transMatrix,p=Sh.allocateByObj(n),g=new ue(e.x,e.y);p.transformPoint(g,g);var y=t.AABBBounds.containsPoint(g);if(!y&&!t.stage.camera)return a;var m=this.pickItem(t,g.clone(),n,i);m&&m.graphic&&(a.graphic=m.graphic,a.params=m.params);var k=!1!==t.attribute.pickable&&y;return p.multiply(v.a,v.b,v.c,v.d,v.e,v.f),!1===t.attribute.childrenPickable||m&&m.graphic||Lv(t,vi.zIndex,(function(o){if(o.isContainer){var s=new ue(e.x,e.y),u=zr(t).group,l=t.attribute,c=l.scrollX,h=void 0===c?u.scrollX:c,d=l.scrollY,f=void 0===d?u.scrollY:d;s.x-=h,s.y-=f,a=r.pickGroup(o,s,p,i)}else{var v=new ue(e.x,e.y);p.transformPoint(v,v);var g=zr(t).group,y=t.attribute,m=y.scrollX,k=void 0===m?g.scrollX:m,b=y.scrollY,_=void 0===b?g.scrollY:b;v.x-=k,v.y-=_;var x=r.pickItem(o,v,n,i);x&&x.graphic&&(a.graphic=x.graphic,a.params=x.params)}return!!a.graphic||!!a.group}),!0,!!o.camera),o.modelMatrix!==s&&Ah.free(o.modelMatrix),o.modelMatrix=s,a.graphic||a.group||!k||t.stage.camera||(a.group=t),Sh.free(p),a}},{key:"selectPicker",value:function(t){return this.pickerMap.get(t.numberType)||null}}])}(),t.DefaultPickService=Gp([L(),Up(0,O($)),Up(0,D(dv)),zp("design:paramtypes",[Object])],t.DefaultPickService);var Wp=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Vp=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function Hp(t,e,n,i,r){for(var a,o,s=i,u=e,l=t[e].x,c=t[e].y,h=t[n].x-l,d=t[n].y-c,f=h*h+d*d,v=e+1,p=n-1;v<p;v++)(o=(a=(t[v].x-l)*d-h*(t[v].y-c))*a/f)>s&&(s=o,u=v);s>i&&(u-e>2&&Hp(t,e,u,i,r),r.push(t[u],t[u+1]),n-u>2&&Hp(t,u,n,i,r))}function Yp(t,e){var n=t.length-1,i=[t[0]];return Hp(t,0,n,e,i),i.push(t[n]),i}function Xp(t,e){var n=0;for(n=0;n<t.length;n++){var i=t[n];if(i.text&&"\n"===i.text||e--,e<0)break}return n}t.DefaultGlobalPickerService=function(){return u((function t(){var e=this;o(this,t),this.global=Mi.global,this.global.hooks.onSetEnv.tap("global-picker-service",(function(t,n,i){e.configure(i,n)})),this.configure(this.global,this.global.env)}),[{key:"configure",value:function(t,e){}},{key:"pick",value:function(t,e,n){for(var i,r={graphic:null,group:null},a=new pe(1,0,0,1,0,0),o=0;o<t.length;o++){if(t[o].isContainer)r=this.pickGroup(t[o],e,a,n);else{var s=this.pickItem(t[o],e,a,n);s&&(r.graphic=s.graphic,r.params=s.params)}if(r.graphic)break;i||(i=r.group)}if(r.graphic||(r.group=i),r.graphic){for(var u=r.graphic;u.parent;)u=u.parent;u.shadowHost&&(r.params={shadowTarget:r.graphic},r.graphic=u.shadowHost)}return r}},{key:"containsPoint",value:function(t,e,n){return!!this.pickItem(t,e,null,n)}},{key:"pickGroup",value:function(t,e,n,i){var r=this,a={group:null,graphic:null};if(!1===t.attribute.visibleAll)return a;var o=t.transMatrix,s=new ue(e.x,e.y);n.transformPoint(s,s);var u=t.AABBBounds.containsPoint(s);if(!u)return a;var l=!1!==t.attribute.pickable&&u;return n.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((function(t){if(t.isContainer)a=r.pickGroup(t,e,n,i);else{var o=new ue(e.x,e.y);n.transformPoint(o,o);var s=r.pickItem(t,o,n,i);s&&(a.graphic=s.graphic,a.params=s.params)}return!!a.graphic||!!a.group})),a.graphic||a.group||!l||(a.group=t),a}},{key:"pickItem",value:function(t,e,n,i){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}}])}(),t.DefaultGlobalPickerService=Wp([L(),Vp("design:paramtypes",[])],t.DefaultGlobalPickerService);var Kp=function(){return u((function t(e){var n=this;o(this,t),this.handleKeyDown=function(t){"Delete"!==t.key&&"Backspace"!==t.key||n.handleInput({data:null,type:"Backspace"})},this.handleCompositionStart=function(){var t=n.currRt.attribute.textConfig,e=void 0===t?[]:t,i=Xp(e,n.cursorIndex),r=e[i];e.splice(i+1,0,Object.assign(Object.assign({},r),{text:""})),n.isComposing=!0},this.handleCompositionEnd=function(){n.isComposing=!1;var t=n.currRt.attribute.textConfig,e=void 0===t?[]:t,i=Xp(e,n.cursorIndex+1),r=e[i];e.splice(i,1);for(var a=r.text,o=Array.from(a.toString()),s=0;s<o.length;s++)e.splice(s+i,0,Object.assign(Object.assign({},r),{text:o[s]}));n.currRt.setAttributes({textConfig:e}),n.onChangeCbList.forEach((function(t){t(a,n.isComposing,n.cursorIndex+o.length,n.currRt,"right")}))},this.handleInput=function(t){var e;if(n.currRt){var i=t.data;"Backspace"===t.type||i||(i="\n");var r=n.currRt.attribute.textConfig,a=void 0===r?[]:r,o=n.selectionStartCursorIdx,s=n.cursorIndex;o>s&&(o=(e=[s,o])[0],s=e[1]),n.selectionStartCursorIdx=o,n.cursorIndex=o,o=Xp(a,o);var u=n.selectionStartCursorIdx-o;s=Xp(a,s);var l=a[o+(n.isComposing?1:0)],c=l;"Backspace"!==t.type||n.isComposing?(o!==s&&a.splice(o+1,s-o),n.isComposing||(c=Object.assign(Object.assign({},l),{text:""}),o+=1,a.splice(o,0,c)),c.text=i):o!==s?a.splice(o+1,s-o):(a.splice(o,1),o-=1),n.currRt.setAttributes({textConfig:a}),n.isComposing?n.onInputCbList.forEach((function(t){t(i,n.isComposing,o+u,n.currRt,"\n"===i?"left":"right")})):n.onChangeCbList.forEach((function(t){t(i,n.isComposing,o+u,n.currRt,"\n"===i?"left":"right")}))}},this.container=null!=e?e:document.body;var i=document.createElement("textarea");i.autocomplete="off",i.innerText="",this.applyStyle(i),this.container.append(i),this.textAreaDom=i,this.isComposing=!1,this.onInputCbList=[],this.onChangeCbList=[]}),[{key:"onInput",value:function(t){this.onInputCbList.push(t)}},{key:"onChange",value:function(t){this.onChangeCbList.push(t)}},{key:"applyStyle",value:function(t){t.setAttribute("style","width: 100px; height: 30px; left: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;"),t.addEventListener("input",this.handleInput),t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd),window.addEventListener("keydown",this.handleKeyDown)}},{key:"moveTo",value:function(t,e,n,i,r){var a=this;this.textAreaDom.style.left="".concat(t,"px"),this.textAreaDom.style.top="".concat(e,"px"),setTimeout((function(){a.textAreaDom.focus(),a.textAreaDom.setSelectionRange(0,0)})),this.currRt=n,this.cursorIndex=i,this.selectionStartCursorIdx=r}},{key:"release",value:function(){this.textAreaDom.removeEventListener("input",this.handleInput),this.textAreaDom.removeEventListener("compositionstart",this.handleCompositionStart),this.textAreaDom.removeEventListener("compositionend",this.handleCompositionEnd),window.removeEventListener("keydown",this.handleKeyDown)}}])}(),qp=function(){return u((function t(e,n,i,r,a){o(this,t),this.curCursorIdx=r,this.selectionStartCursorIdx=i,this.cacheCurCursorIdx=n,this.cacheSelectionStartCursorIdx=e,this.rt=a}),[{key:"hasFormat",value:function(t){return null!=this.getFormat(t)}},{key:"getFormat",value:function(t){if(!this.rt)return null;var e=this.rt.attribute.textConfig,n=e[this.selectionStartCursorIdx+1][t];if(null==n)return null;for(var i=this.selectionStartCursorIdx+2;i<=this.curCursorIdx;i++)if(n!==e[i][t])return null;return n}},{key:"getAllFormat",value:function(t){if(!this.rt)return[];var e=this.rt.attribute.textConfig,n=e[this.selectionStartCursorIdx+1][t],i=new Set;i.add(n);for(var r=this.selectionStartCursorIdx+2;r<=this.curCursorIdx;r++){var a=e[r];i.add(a[t])}return Array.from(i.values())}}])}(),Zp="FORMAT_TEXT_COMMAND",Jp=function(){return u((function t(){var e=this;o(this,t),this.name="RichTextEditPlugin",this.activeEvent="onRegister",this._uid=_.GenAutoIncrementId(),this.key=this.name+this._uid,this.editing=!1,this.pointerDown=!1,this.handleInput=function(t,n,i,r,a){var o=e.getPointByColumnIdx(i,r,a);e.hideSelection(),e.setCursor(o.x,o.y1,o.y2),e.updateCbs.forEach((function(t){return t("input",e)}))},this.handleChange=function(t,n,i,r,a){var o=e.getPointByColumnIdx(i,r,a);e.curCursorIdx=i,e.selectionStartCursorIdx=i,e.setCursorAndTextArea(o.x,o.y1,o.y2,r),e.hideSelection(),e.updateCbs.forEach((function(t){return t("change",e)}))},this.handleMove=function(t){e.isRichtext(t)&&(e.currRt=t.target,e.handleEnter(t),t.target.once("pointerleave",e.handleLeave),e.showSelection(t))},this.handlePointerDown=function(t){e.editing?e.onFocus(t):e.deFocus(t),e.applyUpdate(),e.pointerDown=!0,e.updateCbs.forEach((function(t){return t(e.editing?"onfocus":"defocus",e)}))},this.handlePointerUp=function(t){e.pointerDown=!1},this.handleEnter=function(t){e.editing=!0,e.pluginService.stage.setCursor("text")},this.handleLeave=function(t){e.editing=!1,e.pluginService.stage.setCursor("default")},this.commandCbs=new Map,this.commandCbs.set(Zp,[this.formatTextCommandCb]),this.updateCbs=[]}),[{key:"getSelection",value:function(){return this.selectionStartCursorIdx&&this.curCursorIdx&&this.selectionStartCursorIdx!==this.curCursorIdx&&this.currRt?new qp(this.selectionStartCursorIdx,this.curCursorIdx,Xp(this.currRt.attribute.textConfig,this.selectionStartCursorIdx),Xp(this.currRt.attribute.textConfig,this.curCursorIdx),this.currRt):null}},{key:"formatTextCommandCb",value:function(t,e){var n=e.currRt;if(n){var i=e.getSelection();if(i){var r=i.selectionStartCursorIdx,a=i.curCursorIdx,o=n.attribute.textConfig.slice(r+1,a+1);"bold"===t?o.forEach((function(t){return t.fontWeight="bold"})):"italic"===t?o.forEach((function(t){return t.fontStyle="italic"})):"underline"===t?o.forEach((function(t){return t.underline=!0})):"lineThrough"===t?o.forEach((function(t){return t.lineThrough=!0})):mt(t)&&o.forEach((function(e){return It(e,t)})),n.setAttributes(n.attribute)}}}},{key:"dispatchCommand",value:function(t,e){var n=this,i=this.commandCbs.get(t);i&&i.forEach((function(t){return t(e,n)})),this.updateCbs.forEach((function(t){return t("dispatch",n)}))}},{key:"registerCommand",value:function(t,e){(this.commandCbs.get(t)||[]).push(e)}},{key:"registerUpdateListener",value:function(t){(this.updateCbs||[]).push(t)}},{key:"activate",value:function(t){this.pluginService=t,this.editModule=new Kp,t.stage.on("pointermove",this.handleMove),t.stage.on("pointerdown",this.handlePointerDown),t.stage.on("pointerup",this.handlePointerUp),t.stage.on("pointerleave",this.handlePointerUp),this.editModule.onInput(this.handleInput),this.editModule.onChange(this.handleChange)}},{key:"showSelection",value:function(t){var e=this,n=t.target.getFrameCache();if(n&&this.editBg&&this.pointerDown){var i,r,a=this.lastPoint,o=this.getEventPosition(t),s=this.getLineByPoint(n,o),u=this.getColumnByLinePoint(s,o),l=s.top,c=s.top+s.height,h=u.left+u.width,d=this.getColumnIndex(n,u);o.x<u.left+u.width/2&&(h=u.left,d-=1),o.x=h,o.y=(l+c)/2;var f=this.getLineByPoint(n,a);if((a.y>o.y||a.y===o.y&&a.x>o.x)&&(a=(i=[o,a])[0],o=i[1],s=(r=[f,s])[0],f=r[1]),this.editBg.removeAllChild(),f===s){var v=this.getColumnByLinePoint(f,a);this.editBg.setAttributes({x:a.x,y:f.top,width:o.x-a.x,height:v.height,fill:"#336df4",fillOpacity:.2})}else{this.editBg.setAttributes({x:0,y:f.top,width:0,height:0});for(var p=n.lines.findIndex((function(t){return t===f})),g=n.lines.findIndex((function(t){return t===s})),y=0,m=p;m<=g;m++){var k=n.lines[m];if(m===p){var b=k.paragraphs[k.paragraphs.length-1];this.editBg.add(Dc({x:a.x,y:y,width:b.left+b.width-a.x,height:k.height,fill:"#336df4",fillOpacity:.2}))}else if(m===g){var _=k.paragraphs[0];this.editBg.add(Dc({x:_.left,y:y,width:o.x-_.left,height:k.height,fill:"#336df4",fillOpacity:.2}))}else{var x=k.paragraphs[0],w=k.paragraphs[k.paragraphs.length-1];this.editBg.add(Dc({x:x.left,y:y,width:w.left+w.width-x.left,height:k.height,fill:"#336df4",fillOpacity:.2}))}y+=k.height}}this.curCursorIdx=d,this.setCursorAndTextArea(h,l+2,c-2,t.target),this.applyUpdate(),this.updateCbs.forEach((function(t){return t("selection",e)}))}}},{key:"hideSelection",value:function(){this.editBg&&(this.editBg.removeAllChild(),this.editBg.setAttributes({fill:"transparent"}))}},{key:"isRichtext",value:function(t){return!(!t.target||"richtext"!==t.target.type||!t.target.attribute.editable)}},{key:"getEventPosition",value:function(t){var e=this.pluginService.stage.eventPointTransform(t),n={x:0,y:0};return t.target.globalTransMatrix.transformPoint(e,n),n}},{key:"getLineByPoint",value:function(t,e){for(var n=t.lines[0],i=0;i<t.lines.length&&!(n.top<=e.y&&n.top+n.height>=e.y);i++)n=t.lines[i+1];return n}},{key:"getColumnByLinePoint",value:function(t,e){for(var n=t.paragraphs[0],i=0;i<t.paragraphs.length&&!(n.left<=e.x&&n.left+n.width>=e.x);i++)n=t.paragraphs[i];return n}},{key:"onFocus",value:function(t){this.deFocus(t);var e=t.target;this.tryUpdateRichtext(e);var n=e.attachShadow();n.setAttributes({shadowRootIdx:-1});var i=e.getFrameCache();if(i){if(!this.editLine){var r=Oc({x:0,y:0,lineWidth:1,stroke:"black"});r.animate().to({opacity:1},10,"linear").wait(700).to({opacity:0},10,"linear").wait(700).loop(1/0),this.editLine=r;var a=iu({x:0,y:0,width:0,height:0});this.editBg=a,n.add(this.editLine),n.add(this.editBg)}var o=this.getEventPosition(t),s=this.getLineByPoint(i,o);if(s){var u=this.getColumnByLinePoint(s,o);if(!u)return;var l=s.top,c=s.top+s.height,h=u.left+u.width;l+=2,c-=2;var d=this.getColumnIndex(i,u);o.x<u.left+u.width/2&&(h=u.left,d-=1),this.lastPoint={x:h,y:(l+c)/2},this.curCursorIdx=d,this.selectionStartCursorIdx=d,this.setCursorAndTextArea(h,l,c,e)}}}},{key:"getPointByColumnIdx",value:function(t,e,n){var i=e.getFrameCache(),r=this.getColumnByIndex(i,t),a=r.lineInfo,o=r.columnInfo,s=a.top,u=a.top+a.height;return s+=2,u-=2,{x:o.left+("left"===n?0:o.width),y1:s,y2:u}}},{key:"getColumnIndex",value:function(t,e){for(var n=-1,i=0;i<t.lines.length;i++)for(var r=t.lines[i],a=0;a<r.paragraphs.length;a++)if(n++,e===r.paragraphs[a])return n;return-1}},{key:"getColumnByIndex",value:function(t,e){for(var n=-1,i=0;i<t.lines.length;i++)for(var r=t.lines[i],a=0;a<r.paragraphs.length;a++){var o=r.paragraphs[a];if(++n===e)return{lineInfo:r,columnInfo:o}}return null}},{key:"setCursorAndTextArea",value:function(t,e,n,i){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:n}]});var r={x:0,y:0};i.globalTransMatrix.getInverse().transformPoint({x:t,y:e},r);var a=this.pluginService.stage.window.getBoundingClientRect(),o=a.left,s=a.top;r.x+=o,r.y+=s,this.editModule.moveTo(r.x,r.y,i,this.curCursorIdx,this.selectionStartCursorIdx)}},{key:"setCursor",value:function(t,e,n){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:n}]})}},{key:"applyUpdate",value:function(){this.pluginService.stage.renderNextFrame()}},{key:"deFocus",value:function(t){t.target.detachShadow(),this.currRt=null,this.editLine&&(this.editLine.parent.removeChild(this.editLine),this.editLine.release(),this.editLine=null,this.editBg.parent.removeChild(this.editBg),this.editBg.release(),this.editBg=null)}},{key:"splitText",value:function(t){return Array.from(t)}},{key:"tryUpdateRichtext",value:function(t){var e=this;if(!t.getFrameCache().lines.every((function(t){return t.paragraphs.every((function(t){return!(t.text&&xt(t.text)&&e.splitText(t.text).length>1)}))}))){var n=[];t.attribute.textConfig.forEach((function(t){var i=e.splitText(t.text.toString());if(xt(t.text)&&i.length>1)for(var r=0;r<i.length;r++){var a=i[r];n.push(Object.assign(Object.assign({},t),{text:a}))}else n.push(t)})),t.setAttributes({textConfig:n}),t.doUpdateFrameCache(n)}}},{key:"onSelect",value:function(){}},{key:"deactivate",value:function(t){t.stage.off("pointermove",this.handleMove),t.stage.off("pointerdown",this.handlePointerDown),t.stage.off("pointerup",this.handlePointerUp),t.stage.off("pointerleave",this.handlePointerUp)}},{key:"release",value:function(){this.editModule.release()}}])}(),$p=function(){return u((function t(){o(this,t),this.pools=[]}),[{key:"free",value:function(t){this.pools.push(t)}},{key:"length",get:function(){return this.pools.length}},{key:"release",value:function(){this.pools=[]}}])}(),Qp=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.rect(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.rect(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),tg=new Qp,eg=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.arc(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.arc(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),ng=new eg,ig=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.area(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.area(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),rg=new ig,ag=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.circle(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.circle(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),og=new ag,sg=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.line(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.line(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),ug=new sg,lg=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.path(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.path(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),cg=new lg,hg=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.symbol(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.symbol(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),dg=new hg,fg=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"allocate",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.text(t);var e=this.pools.pop();return e.initAttributes(t),e}},{key:"allocateByObj",value:function(t){if(!this.pools.length)return Mi.graphicService.creator.text(t.attribute);var e=this.pools.pop();return e.initAttributes(t.attribute),e}}])}($p),vg=new fg,pg=function(){return u((function t(){o(this,t),this.map={text:vg,symbol:dg}}),[{key:"gc",value:function(t){var e=this;t.isContainer?t.forEachChildren((function(t){return e.gc(t)})):this.gcItem(t)}},{key:"gcItem",value:function(t){var e=this.map[t.type];e&&e.free(t)}}])}(),gg=new pg,yg=!1,mg=new x((function(e){yg||(yg=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(Cf).to(t.DefaultCanvasArcRender).inSingletonScope(),e(Mf).toService(Cf),e(Bu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Bu))})),kg=!1,bg=new x((function(e){kg||(kg=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(Df).to(t.DefaultCanvasRectRender).inSingletonScope(),e(Mf).toService(Df),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(ju).toService(t.SplitRectAfterRenderContribution),e(ju).toService(t.SplitRectBeforeRenderContribution),e(ju).toService(t.DefaultBaseInteractiveRenderContribution),et(e,ju))})),_g=!1,xg=new x((function(e){_g||(_g=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Wv).toSelf().inSingletonScope(),e(Of).to(t.DefaultCanvasLineRender).inSingletonScope(),e(Mf).toService(Of))})),wg=!1,Sg=new x((function(e){wg||(wg=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(Rf).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(Mf).toService(Rf),e(Mu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Mu),e(Hv).toSelf().inSingletonScope())})),Ag=!1,Tg=new x((function(e){Ag||(Ag=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(Ff).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(Mf).toService(Ff),e(Fu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Fu))})),Cg=!1,Eg=new x((function(e){Cg||(Cg=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(Bf).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(Mf).toService(Bf),e(Pu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Pu))})),Rg=!1,Bg=new x((function(e){Rg||(Rg=!0,e(Nf).to(t.DefaultCanvasTextRender).inSingletonScope(),e(Mf).toService(Nf),e(Nu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Nu))})),Mg=!1,Pg=new x((function(e){Mg||(Mg=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(If).to(t.DefaultCanvasPathRender).inSingletonScope(),e(Mf).toService(If),e(Lu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Lu))})),Og=!1,Ig=new x((function(e){Og||(Og=!0,e(Lf).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(Mf).toService(Lf),e(Du).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Du))})),Lg=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Dg=function(){return u((function t(){o(this,t),this.numberType=Fs}),[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){r.drawContribution&&t.getSubGraphic().forEach((function(t){var u=r.drawContribution.getRenderContribution(t);u&&u.drawShape&&u.drawShape(t,e,n,i,r,a,o,s)}))}},{key:"draw",value:function(t,e,n,i){var r=n.context;if(r&&(r.highPerformanceSave(),n.drawContribution)){var a=zr(t),o=t.getSubGraphic();o.length&&o.forEach((function(t){n.drawContribution.renderItem(t,n,{theme:a})})),r.highPerformanceRestore()}}}])}();Dg=Lg([L()],Dg);var jg=!1,Fg=new x((function(t){jg||(jg=!0,t(Uf).to(Dg).inSingletonScope(),t(Mf).toService(Uf))})),Ng=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Gg=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zg=function(t){function n(){var t;return o(this,n),(t=e(this,n)).numberType=Xs,t.builtinContributions=[of],t.init(),t}return c(n,t),u(n,[{key:"drawShape",value:function(t,e,n,i,r){var a=zr(t).richtext,o=t.attribute,s=o.strokeOpacity,u=void 0===s?a.strokeOpacity:s,l=o.opacity,c=void 0===l?a.opacity:l,h=o.fillOpacity,d=void 0===h?a.fillOpacity:h,f=o.visible,v=void 0===f?a.visible:f;if(t.valid&&v){var p=yu(c,d,!0),g=yu(c,u,!0);p&&(e.translate(n,i),this.beforeRenderStep(t,e,n,i,p,g,p,g,a,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,n,i,p,g,p,g,a,r))}}},{key:"drawIcon",value:function(t,e,n,i,r){var a,o=zr(t).richtextIcon,s=t.attribute,u=s.width,l=void 0===u?o.width:u,c=s.height,h=void 0===c?o.height:c,d=s.opacity,f=void 0===d?o.opacity:d,v=s.image,p=s.backgroundFill,g=void 0===p?o.backgroundFill:p,y=s.backgroundFillOpacity,m=void 0===y?o.backgroundFillOpacity:y,k=s.backgroundStroke,b=void 0===k?o.backgroundStroke:k,_=s.backgroundStrokeOpacity,x=void 0===_?o.backgroundStrokeOpacity:_,w=s.backgroundRadius,S=void 0===w?o.backgroundRadius:w,A=s.margin,T=t.attribute,C=T.backgroundWidth,E=void 0===C?l:C,R=T.backgroundHeight,B=void 0===R?h:R;if(A&&(n+=t._marginArray[3],i+=t._marginArray[0]),t._hovered){var M=(E-l)/2,P=(B-h)/2;0===S?(e.beginPath(),e.rect(n-M,i-P,E,B)):(e.beginPath(),cd(e,n-M,i-P,E,B,S)),g&&(e.globalAlpha=m,e.fillStyle=g,e.fill()),b&&(e.globalAlpha=x,e.strokeStyle=b,e.stroke())}var O=v&&(null===(a=null==t?void 0:t.resources)||void 0===a?void 0:a.get(v));O&&"success"===O.state&&(e.globalAlpha=f,e.drawImage(O.data,n,i,l,h))}},{key:"draw",value:function(t,e,n){var i=zr(t).richtext;this._draw(t,i,!1,n)}}])}(zh);zg=Ng([L(),Gg("design:paramtypes",[])],zg);var Ug=!1,Wg=new x((function(t){Ug||(Ug=!0,t(Gf).to(zg).inSingletonScope(),t(Mf).toService(Gf))})),Vg=!1,Hg=new x((function(e){Vg||(Vg=!0,e(Wf).to(t.DefaultCanvasImageRender).inSingletonScope(),e(Mf).toService(Wf),e(Iu).toService(t.DefaultBaseInteractiveRenderContribution),et(e,Iu))})),Yg=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Xg=function(n){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="rect3d",t.numberType=Ys,t}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=zr(t,null==a?void 0:a.theme).rect,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.stroke,v=void 0===f?l.stroke:f,p=c.x1,g=c.y1,y=c.x,m=c.y,k=c.opacity,b=void 0===k?l.opacity:k,_=c.fillOpacity,x=void 0===_?l.fillOpacity:_,w=c.lineWidth,S=void 0===w?l.lineWidth:w,A=c.strokeOpacity,T=void 0===A?l.strokeOpacity:A,C=c.visible,E=void 0===C?l.visible:C,R=t.attribute,B=R.width,M=R.height;B=(null!=B?B:p-y)||0,M=(null!=M?M:g-m)||0;var P=null!==(u=this.z)&&void 0!==u?u:0,O=mu(b,x,B,M,d),I=bu(b,T,B,M),L=pu(d),D=gu(v,S);if(t.valid&&E&&(L||D)&&(O||I||o||s)){var j=r.stage||{},F=j.light;j.camera;var N=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,l);var G=d;"string"!=typeof G&&(G="black"),this.fill(n,i,P,N,G,e,F,o)}!1!==v&&(e.setStrokeStyle(t,t.attribute,n,i,l),this.stroke(n,i,P,N,e))}}},{key:"stroke",value:function(t,e,n,i,r){var a=i.vertices;i.edges.forEach((function(i){var o=a[i[0]],s={x:t+o[0],y:e+o[1],z:n+o[2]},u=a[i[1]],l={x:t+u[0],y:e+u[1],z:n+u[2]};r.beginPath(),r.moveTo(s.x,s.y,s.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}},{key:"fill",value:function(e,n,i,r,a,o,s,u){var l=Eo.Get(a,t.ColorType.Color255),c=r.vertices,h=c.map((function(t){return o.view(t[0],t[1],t[2])[2]})),d=[];r.polygons.forEach((function(t,e){d.push({faceIdx:e,polygon:t});var n=t.polygon;t.normal;var i=h[n[0]],r=h[n[1]],a=h[n[2]],o=h[n[3]];t.ave_z=i+r+a+o})),d.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),d.forEach((function(t){var r=t.polygon,h=r.polygon,d=r.normal,f=c[h[0]],v=c[h[1]],p=c[h[2]],g=c[h[3]],y={x:e+f[0],y:n+f[1],z:i+f[2]},m={x:e+v[0],y:n+v[1],z:i+v[2]},k={x:e+p[0],y:n+p[1],z:i+p[2]},b={x:e+g[0],y:n+g[1],z:i+g[2]};o.beginPath(),o.moveTo(y.x,y.y,y.z),o.lineTo(m.x,m.y,m.z),o.lineTo(k.x,k.y,k.z),o.lineTo(b.x,b.y,b.z),o.closePath(),u?u(o,null,null):(o.fillStyle=s?s.computeColor(d,l):a,o.fill())}))}},{key:"draw",value:function(t,e,n){var i=zr(t).rect;this._draw(t,i,!1,n)}}])}(zh);Xg=Yg([L()],Xg);var Kg=!1,qg=new x((function(t){Kg||(Kg=!0,t(jf).to(Xg).inSingletonScope(),t(Mf).toService(jf))})),Zg=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};var Jg=function(n){function i(){var t;return o(this,i),(t=e(this,i,arguments)).numberType=Ls,t}return c(i,n),u(i,[{key:"drawShape",value:function(e,n,i,r,a,o,s,u){var l,c=zr(e,null==o?void 0:o.theme).arc,h=e.attribute.fill,d=void 0===h?c.fill:h,f=this.valid(e,c,s,u);if(f){var v=f.fVisible,p=f.sVisible,g=f.doFill,y=f.doStroke,m=null!==(l=this.z)&&void 0!==l?l:0,k=e.attribute,b=k.outerPadding,_=void 0===b?c.outerPadding:b,x=k.innerPadding,w=void 0===x?c.innerPadding:x,S=k.height,A=void 0===S?10:S,T=e.attribute,C=T.outerRadius,E=void 0===C?c.outerRadius:C,R=T.innerRadius,B=void 0===R?c.innerRadius:R;E+=_,B-=w;var M=Eo.Get(d,t.ColorType.Color255),P=(a.stage||{}).light,O=a.hack_pieFace,I={top:m,bottom:m+A},L={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===O||"top"===O?(n.beginPath(),function(t,e,n,i,r,a,o){var s=t.getParsedAngle(),u=s.startAngle,l=s.endAngle,c=qt(l-u),h=l>u,d=!1;if(a<o){var f=a;a=o,o=f}if(a<=Vt)e.moveTo(n,i,r);else if(c>=Kt-Vt)e.moveTo(n+a*Jt(u),i+a*te(u),r),e.arc(n,i,a,u,l,!h,r),o>Vt&&(e.moveTo(n+o*Jt(l),i+o*te(l),r),e.arc(n,i,o,l,u,h,r));else{var v=t.getParsePadAngle(u,l),p=v.outerDeltaAngle,g=v.innerDeltaAngle,y=v.outerStartAngle,m=v.outerEndAngle,k=v.innerEndAngle,b=v.innerStartAngle,_=a*Jt(y),x=a*te(y),w=o*Jt(k),S=o*te(k);p<.001?d=!0:(e.moveTo(n+_,i+x,r),e.arc(n,i,a,y,m,!h,r)),!(o>Vt)||g<.001?(e.lineTo(n+w,i+S,r),d=!0):(e.lineTo(n+w,i+S,r),e.arc(n,i,o,k,b,h,r))}e.closePath()}(e,n,i,r,I[O],E,B),n.setShadowBlendStyle&&n.setShadowBlendStyle(e,e.attribute,c),g&&(s?s(n,e.attribute,c):v&&(n.setCommonStyle(e,e.attribute,i,r,c),n.fillStyle=P?P.computeColor(L[O],M):d,n.fill())),y&&(u?u(n,e.attribute,c):p&&(n.setStrokeStyle(e,e.attribute,i,r,c),n.stroke()))):"outside"!==O&&"inside"!==O||("inside"===O&&(n.save(),n.beginPath(),n.arc(i,r,B,0,Kt,!0,I.top),n.clip()),n.beginPath(),function(t,e,n,i,r,a,o,s){var u=t.getParsedAngle(),l=u.startAngle,c=u.endAngle,h=qt(c-l),d=c>l,f=!1;if(o<=Vt)e.moveTo(n,i,r);else if(h>=Kt-Vt)e.moveTo(n+o*Jt(l),i+o*te(l),r),e.arc(n,i,o,l,c,!d,r),e.lineTo(n+o*Jt(c),i+o*te(c),a),e.arc(n,i,o,c,l,d,a);else{var v=s(l,c),p=v.innerouterDeltaAngle,g=v.innerouterStartAngle,y=v.innerouterEndAngle,m=o*Jt(g),k=o*te(g),b=o*Jt(y),_=o*te(y);p<.001?f=!0:(e.moveTo(n+m,i+k,r),e.arc(n,i,o,g,y,!d,r),e.lineTo(n+b,i+_,a),e.arc(n,i,o,y,g,d,a))}e.closePath()}(e,n,i,r,I.top,I.bottom,"outside"===O?E:B,(function(t,n){var i=e.getParsePadAngle(t,n),r=i.outerDeltaAngle,a=i.innerDeltaAngle,o=i.outerStartAngle,s=i.outerEndAngle,u=i.innerEndAngle,l=i.innerStartAngle;return"outside"===O?{innerouterDeltaAngle:r,innerouterEndAngle:s,innerouterStartAngle:o}:{innerouterDeltaAngle:a,innerouterEndAngle:u,innerouterStartAngle:l}})),n.setShadowBlendStyle&&n.setShadowBlendStyle(e,e.attribute,c),g&&(s?s(n,e.attribute,c):v&&(n.setCommonStyle(e,e.attribute,i,r,c),n.fillStyle=P?P.computeColor(L[O],M):d,n.fill())),y&&(u?u(n,e.attribute,c):p&&(n.setStrokeStyle(e,e.attribute,i,r,c),n.stroke())),"inside"===O&&n.restore())}}},{key:"draw",value:function(t,e,n,i){var r=zr(t,null==i?void 0:i.theme).arc;this._draw(t,r,!1,n,i)}}])}(zh);Jg=Zg([L()],Jg);var $g=!1,Qg=new x((function(t){$g||($g=!0,t(Ef).to(Jg).inSingletonScope(),t(Mf).toService(Ef))})),ty=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ey=function(n){function i(){var t;return o(this,i),(t=e(this,i,arguments)).type="pyramid3d",t.numberType=Vs,t}return c(i,n),u(i,[{key:"drawShape",value:function(t,e,n,i,r,a,o,s){var u,l=zr(t,null==a?void 0:a.theme).polygon,c=t.attribute,h=c.fill,d=void 0===h?l.fill:h,f=c.stroke,v=void 0===f?l.stroke:f,p=c.face,g=void 0===p?[!0,!0,!0,!0,!0,!0]:p,y=null!==(u=this.z)&&void 0!==u?u:0;if(this.valid(t,l,o,s)){var m=r.stage||{},k=m.light,b=m.camera,_=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,n,i,l);var x=d;"string"!=typeof x&&(x="black"),this.fill(n,i,y,_,g,x,e,k,b,t,l,o)}!1!==v&&(e.setStrokeStyle(t,t.attribute,n,i,l),this.stroke(n,i,y,_,e))}}},{key:"stroke",value:function(t,e,n,i,r){var a=i.vertices;i.edges.forEach((function(i){var o=a[i[0]],s=a[i[1]],u={x:t+o[0],y:e+o[1],z:n+o[2]},l={x:t+s[0],y:e+s[1],z:n+s[2]};r.beginPath(),r.moveTo(u.x,u.y,u.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}},{key:"fill",value:function(e,n,i,r,a,o,s,u,l,c,h,d){var f=Eo.Get(o,t.ColorType.Color255),v=r.vertices,p=v.map((function(t){return s.view(t[0],t[1],t[2])[2]})),g=[];r.polygons.forEach((function(t,e){if(a[e]){g.push({faceIdx:e,polygon:t});var n=t.polygon;t.normal;var i=p[n[0]],r=p[n[1]],o=p[n[2]],s=p[n[3]];t.ave_z=i+r+o+s}})),g.sort((function(t,e){return e.polygon.ave_z-t.polygon.ave_z})),g.forEach((function(t){var r=t.polygon,a=r.polygon,l=r.normal,p=v[a[0]],g=v[a[1]],y=v[a[2]],m=v[a[3]],k={x:e+p[0],y:n+p[1],z:i+p[2]},b={x:e+g[0],y:n+g[1],z:i+g[2]},_={x:e+y[0],y:n+y[1],z:i+y[2]},x={x:e+m[0],y:n+m[1],z:i+m[2]};s.beginPath(),s.moveTo(k.x,k.y,k.z),s.lineTo(b.x,b.y,b.z),s.lineTo(_.x,_.y,_.z),s.lineTo(x.x,x.y,x.z),s.closePath(),d?d(s,c.attribute,h):(s.fillStyle=u?u.computeColor(l,f):o,s.fill())}))}},{key:"draw",value:function(t,e,n){var i=zr(t).polygon;this._draw(t,i,!1,n)}}])}(zh);ey=ty([L()],ey);var ny=!1,iy=new x((function(t){ny||(ny=!0,t(zf).to(ey).inSingletonScope(),t(Mf).toService(zf))}));function ry(){Fh.RegisterGraphicCreator("arc",sh)}function ay(){Fh.RegisterGraphicCreator("arc3d",lh)}function oy(){Fh.RegisterGraphicCreator("area",rh)}function sy(){Fh.RegisterGraphicCreator("circle",Vu)}function uy(){Fh.RegisterGraphicCreator("glyph",zc)}function ly(){Fh.RegisterGraphicCreator("group",iu)}function cy(){Fh.RegisterGraphicCreator("image",Yc)}function hy(){Fh.RegisterGraphicCreator("line",Oc)}function dy(){Fh.RegisterGraphicCreator("path",eh)}function fy(){Fh.RegisterGraphicCreator("polygon",dh)}function vy(){Fh.RegisterGraphicCreator("pyramid3d",vh)}function py(){Fh.RegisterGraphicCreator("rect",Dc)}function gy(){Fh.RegisterGraphicCreator("rect3d",Nc)}function yy(){Fh.RegisterGraphicCreator("richtext",$c)}function my(){Fh.RegisterGraphicCreator("symbol",Bc)}function ky(){Fh.RegisterGraphicCreator("text",Qu)}function by(){Fh.RegisterGraphicCreator("shadowRoot",gh)}function _y(){Fh.RegisterGraphicCreator("wrapText",nl)}function xy(t,e,n){if(t&&t.length){var i=g(e,2),r=i[0],a=i[1],o=Math.PI/180*n,s=Math.cos(o),u=Math.sin(o);t.forEach((function(t){var e=g(t,2),n=e[0],i=e[1];t[0]=(n-r)*s-(i-a)*u+r,t[1]=(n-r)*u+(i-a)*s+a}))}}function wy(t){var e=t[0],n=t[1];return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}function Sy(t,e){var n=e.hachureAngle+90,i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);var r=[0,0];if(n){var a,o=b(t);try{for(o.s();!(a=o.n()).done;){xy(a.value,r,n)}}catch(t){o.e(t)}finally{o.f()}}var s=function(t,e){var n,i=[],r=b(t);try{for(r.s();!(n=r.n()).done;){var a=y(n.value);a[0].join(",")!==a[a.length-1].join(",")&&a.push([a[0][0],a[0][1]]),a.length>2&&i.push(a)}}catch(t){r.e(t)}finally{r.f()}var o=[];e=Math.max(e,.1);for(var s=[],u=0,l=i;u<l.length;u++)for(var c=l[u],h=0;h<c.length-1;h++){var d=c[h],f=c[h+1];if(d[1]!==f[1]){var v=Math.min(d[1],f[1]);s.push({ymin:v,ymax:Math.max(d[1],f[1]),x:v===d[1]?d[0]:f[0],islope:(f[0]-d[0])/(f[1]-d[1])})}}if(s.sort((function(t,e){return t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax)})),!s.length)return o;for(var p=[],g=s[0].ymin;p.length||s.length;){if(s.length){for(var m=-1,k=0;k<s.length&&!(s[k].ymin>g);k++)m=k;s.splice(0,m+1).forEach((function(t){p.push({s:g,edge:t})}))}if(p=p.filter((function(t){return!(t.edge.ymax<=g)})),p.sort((function(t,e){return t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x)})),p.length>1)for(var _=0;_<p.length;_+=2){var x=_+1;if(x>=p.length)break;var w=p[_].edge,S=p[x].edge;o.push([[Math.round(w.x),g],[Math.round(S.x),g]])}g+=e,p.forEach((function(t){t.edge.x=t.edge.x+e*t.edge.islope}))}return o}(t,i);if(n){var u,l=b(t);try{for(l.s();!(u=l.n()).done;){xy(u.value,r,-n)}}catch(t){l.e(t)}finally{l.f()}!function(t,e,n){var i=[];t.forEach((function(t){return i.push.apply(i,y(t))})),xy(i,e,n)}(s,r,-n)}return s}var Ay=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){return this._fillPolygons(t,e)}},{key:"_fillPolygons",value:function(t,e){var n=Sy(t,e);return{type:"fillSketch",ops:this.renderLines(n,e)}}},{key:"renderLines",value:function(t,e){var n,i=[],r=b(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;i.push.apply(i,y(this.helper.doubleLineOps(a[0][0],a[0][1],a[1][0],a[1][1],e)))}}catch(t){r.e(t)}finally{r.f()}return i}}])}(),Ty=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"fillPolygons",value:function(t,e){var n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);var i,r=Sy(t,Object.assign({},e,{hachureGap:n})),a=Math.PI/180*e.hachureAngle,o=[],s=.5*n*Math.cos(a),u=.5*n*Math.sin(a),l=b(r);try{for(l.s();!(i=l.n()).done;){var c=g(i.value,2),h=c[0],d=c[1];wy([h,d])&&o.push([[h[0]-s,h[1]+u],y(d)],[[h[0]+s,h[1]-u],y(d)])}}catch(t){l.e(t)}finally{l.f()}return{type:"fillSketch",ops:this.renderLines(o,e)}}}])}(Ay),Cy=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"fillPolygons",value:function(t,e){var n=this._fillPolygons(t,e),i=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,i);return n.ops=n.ops.concat(r.ops),n}}])}(Ay),Ey=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){var n=Sy(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(n,e)}},{key:"dotsOnLines",value:function(t,e){var n=[],i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);var r=e.fillWeight;r<0&&(r=e.strokeWidth/2);var a,o=i/4,s=b(t);try{for(s.s();!(a=s.n()).done;)for(var u=a.value,l=wy(u),c=l/i,h=Math.ceil(c)-1,d=l-h*i,f=(u[0][0]+u[1][0])/2-i/4,v=Math.min(u[0][1],u[1][1]),p=0;p<h;p++){var g=v+d+p*i,m=f-o+2*Math.random()*o,k=g-o+2*Math.random()*o,_=this.helper.ellipse(m,k,r,r,e);n.push.apply(n,y(_.ops))}}catch(t){s.e(t)}finally{s.f()}return{type:"fillSketch",ops:n}}}])}(),Ry=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){var n=Sy(t,e);return{type:"fillSketch",ops:this.dashedLine(n,e)}}},{key:"dashedLine",value:function(t,e){var n=this,i=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,r=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,a=[];return t.forEach((function(t){var o=wy(t),s=Math.floor(o/(i+r)),u=(o+r-s*(i+r))/2,l=t[0],c=t[1];l[0]>c[0]&&(l=t[1],c=t[0]);for(var h=Math.atan((c[1]-l[1])/(c[0]-l[0])),d=0;d<s;d++){var f=d*(i+r),v=f+i,p=[l[0]+f*Math.cos(h)+u*Math.cos(h),l[1]+f*Math.sin(h)+u*Math.sin(h)],g=[l[0]+v*Math.cos(h)+u*Math.cos(h),l[1]+v*Math.sin(h)+u*Math.sin(h)];a.push.apply(a,y(n.helper.doubleLineOps(p[0],p[1],g[0],g[1],e)))}})),a}}])}(),By=function(){return u((function t(e){o(this,t),this.helper=e}),[{key:"fillPolygons",value:function(t,e){var n=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,i=e.zigzagOffset<0?n:e.zigzagOffset,r=Sy(t,e=Object.assign({},e,{hachureGap:n+i}));return{type:"fillSketch",ops:this.zigzagLines(r,i,e)}}},{key:"zigzagLines",value:function(t,e,n){var i=this,r=[];return t.forEach((function(t){var a=wy(t),o=Math.round(a/(2*e)),s=t[0],u=t[1];s[0]>u[0]&&(s=t[1],u=t[0]);for(var l=Math.atan((u[1]-s[1])/(u[0]-s[0])),c=0;c<o;c++){var h=2*c*e,d=2*(c+1)*e,f=Math.sqrt(2*Math.pow(e,2)),v=[s[0]+h*Math.cos(l),s[1]+h*Math.sin(l)],p=[s[0]+d*Math.cos(l),s[1]+d*Math.sin(l)],g=[v[0]+f*Math.cos(l+Math.PI/4),v[1]+f*Math.sin(l+Math.PI/4)];r.push.apply(r,y(i.helper.doubleLineOps(v[0],v[1],g[0],g[1],n)).concat(y(i.helper.doubleLineOps(g[0],g[1],p[0],p[1],n))))}})),r}}])}(),My={},Py=function(){return u((function t(e){o(this,t),this.seed=e}),[{key:"next",value:function(){return this.seed?(Math.pow(2,31)-1&(this.seed=Math.imul(48271,this.seed)))/Math.pow(2,31):Math.random()}}])}(),Oy={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Iy(t,e){return t.type===e}function Ly(t){for(var e=[],n=function(t){for(var e=new Array;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:"".concat(parseFloat(RegExp.$1))},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t),i="BOD",r=0,a=n[r];!Iy(a,2);){var o=0,s=[];if("BOD"===i){if("M"!==a.text&&"m"!==a.text)return Ly("M0,0"+t);r++,o=Oy[a.text],i=a.text}else Iy(a,1)?o=Oy[i]:(r++,o=Oy[a.text],i=a.text);if(!(r+o<n.length))throw new Error("Path data ended short");for(var u=r;u<r+o;u++){var l=n[u];if(!Iy(l,1))throw new Error("Param not a number: "+i+","+l.text);s[s.length]=+l.text}if("number"!=typeof Oy[i])throw new Error("Bad segment: "+i);var c={key:i,data:s};e.push(c),a=n[r+=o],"M"===i&&(i="L"),"m"===i&&(i="l")}return e}function Dy(t){var e,n,i,r,a=0,o=0,s=0,u=0,l=[],c=b(t);try{for(c.s();!(r=c.n()).done;){var h=r.value,d=h.key,f=h.data;switch(d){case"M":l.push({key:"M",data:y(f)}),e=g(f,2),a=e[0],o=e[1],s=(n=g(f,2))[0],u=n[1];break;case"m":a+=f[0],o+=f[1],l.push({key:"M",data:[a,o]}),s=a,u=o;break;case"L":l.push({key:"L",data:y(f)}),i=g(f,2),a=i[0],o=i[1];break;case"l":a+=f[0],o+=f[1],l.push({key:"L",data:[a,o]});break;case"C":l.push({key:"C",data:y(f)}),a=f[4],o=f[5];break;case"c":var v=f.map((function(t,e){return e%2?t+o:t+a}));l.push({key:"C",data:v}),a=v[4],o=v[5];break;case"Q":l.push({key:"Q",data:y(f)}),a=f[2],o=f[3];break;case"q":var p=f.map((function(t,e){return e%2?t+o:t+a}));l.push({key:"Q",data:p}),a=p[2],o=p[3];break;case"A":l.push({key:"A",data:y(f)}),a=f[5],o=f[6];break;case"a":a+=f[5],o+=f[6],l.push({key:"A",data:[f[0],f[1],f[2],f[3],f[4],a,o]});break;case"H":l.push({key:"H",data:y(f)}),a=f[0];break;case"h":a+=f[0],l.push({key:"H",data:[a]});break;case"V":l.push({key:"V",data:y(f)}),o=f[0];break;case"v":o+=f[0],l.push({key:"V",data:[o]});break;case"S":l.push({key:"S",data:y(f)}),a=f[2],o=f[3];break;case"s":var m=f.map((function(t,e){return e%2?t+o:t+a}));l.push({key:"S",data:m}),a=m[2],o=m[3];break;case"T":l.push({key:"T",data:y(f)}),a=f[0],o=f[1];break;case"t":a+=f[0],o+=f[1],l.push({key:"T",data:[a,o]});break;case"Z":case"z":l.push({key:"Z",data:[]}),a=s,o=u}}}catch(t){c.e(t)}finally{c.f()}return l}function jy(t){var e,n,i,r,a=[],o="",s=0,u=0,l=0,c=0,h=0,d=0,f=b(t);try{for(f.s();!(r=f.n()).done;){var v=r.value,p=v.key,m=v.data;switch(p){case"M":a.push({key:"M",data:y(m)}),s=(e=g(m,2))[0],u=e[1],l=(n=g(m,2))[0],c=n[1];break;case"C":a.push({key:"C",data:y(m)}),s=m[4],u=m[5],h=m[2],d=m[3];break;case"L":a.push({key:"L",data:y(m)}),s=(i=g(m,2))[0],u=i[1];break;case"H":s=m[0],a.push({key:"L",data:[s,u]});break;case"V":u=m[0],a.push({key:"L",data:[s,u]});break;case"S":var k=0,_=0;"C"===o||"S"===o?(k=s+(s-h),_=u+(u-d)):(k=s,_=u),a.push({key:"C",data:[k,_].concat(y(m))}),h=m[0],d=m[1],s=m[2],u=m[3];break;case"T":var x=g(m,2),w=x[0],S=x[1],A=0,T=0;"Q"===o||"T"===o?(A=s+(s-h),T=u+(u-d)):(A=s,T=u);var C=s+2*(A-s)/3,E=u+2*(T-u)/3,R=w+2*(A-w)/3,B=S+2*(T-S)/3;a.push({key:"C",data:[C,E,R,B,w,S]}),h=A,d=T,s=w,u=S;break;case"Q":var M=g(m,4),P=M[0],O=M[1],I=M[2],L=M[3],D=s+2*(P-s)/3,j=u+2*(O-u)/3,F=I+2*(P-I)/3,N=L+2*(O-L)/3;a.push({key:"C",data:[D,j,F,N,I,L]}),h=P,d=O,s=I,u=L;break;case"A":var G=Math.abs(m[0]),z=Math.abs(m[1]),U=m[2],W=m[3],V=m[4],H=m[5],Y=m[6];0===G||0===z?(a.push({key:"C",data:[s,u,H,Y,H,Y]}),s=H,u=Y):s===H&&u===Y||(Ny(s,u,H,Y,G,z,U,W,V).forEach((function(t){a.push({key:"C",data:t})})),s=H,u=Y);break;case"Z":a.push({key:"Z",data:[]}),s=l,u=c}o=p}}catch(t){f.e(t)}finally{f.f()}return a}function Fy(t,e,n){return[t*Math.cos(n)-e*Math.sin(n),t*Math.sin(n)+e*Math.cos(n)]}function Ny(t,e,n,i,r,a,o,s,u,l){var c,h=(c=o,Math.PI*c/180),d=[],f=0,v=0,p=0,y=0;if(l){var m=g(l,4);f=m[0],v=m[1],p=m[2],y=m[3]}else{var k,b;t=(k=g(Fy(t,e,-h),2))[0],e=k[1];var _=(t-(n=(b=g(Fy(n,i,-h),2))[0]))/2,x=(e-(i=b[1]))/2,w=_*_/(r*r)+x*x/(a*a);w>1&&(r*=w=Math.sqrt(w),a*=w);var S=r*r,A=a*a,T=S*A-S*x*x-A*_*_,C=S*x*x+A*_*_,E=(s===u?-1:1)*Math.sqrt(Math.abs(T/C));p=E*r*x/a+(t+n)/2,y=E*-a*_/r+(e+i)/2,f=Math.asin(parseFloat(((e-y)/a).toFixed(9))),v=Math.asin(parseFloat(((i-y)/a).toFixed(9))),t<p&&(f=Math.PI-f),n<p&&(v=Math.PI-v),f<0&&(f=2*Math.PI+f),v<0&&(v=2*Math.PI+v),u&&f>v&&(f-=2*Math.PI),!u&&v>f&&(v-=2*Math.PI)}var R=v-f;if(Math.abs(R)>120*Math.PI/180){var B=v,M=n,P=i;v=u&&v>f?f+120*Math.PI/180*1:f+120*Math.PI/180*-1,d=Ny(n=p+r*Math.cos(v),i=y+a*Math.sin(v),M,P,r,a,o,0,u,[v,B,p,y])}R=v-f;var O=Math.cos(f),I=Math.sin(f),L=Math.cos(v),D=Math.sin(v),j=Math.tan(R/4),F=4/3*r*j,N=4/3*a*j,G=[t,e],z=[t+F*I,e-N*O],U=[n+F*D,i-N*L],W=[n,i];if(z[0]=2*G[0]-z[0],z[1]=2*G[1]-z[1],l)return[z,U,W].concat(d);d=[z,U,W].concat(d);for(var V=[],H=0;H<d.length;H+=3){var Y=Fy(d[H][0],d[H][1],h),X=Fy(d[H+1][0],d[H+1][1],h),K=Fy(d[H+2][0],d[H+2][1],h);V.push([Y[0],Y[1],X[0],X[1],K[0],K[1]])}return V}var Gy={randOffset:function(t,e){return Zy(t,e)},randOffsetWithRange:function(t,e,n){return qy(t,e,n)},ellipse:function(t,e,n,i,r){return Vy(t,e,r,Wy(n,i,r)).opset},doubleLineOps:function(t,e,n,i,r){return Jy(t,e,n,i,r,!0)}};function zy(t,e,n,i,r){return{type:"path",ops:Jy(t,e,n,i,r)}}function Uy(t,e,n){var i=(t||[]).length;if(i>2){for(var r=[],a=0;a<i-1;a++)r.push.apply(r,y(Jy(t[a][0],t[a][1],t[a+1][0],t[a+1][1],n)));return e&&r.push.apply(r,y(Jy(t[i-1][0],t[i-1][1],t[0][0],t[0][1],n))),{type:"path",ops:r}}return 2===i?zy(t[0][0],t[0][1],t[1][0],t[1][1],n):{type:"path",ops:[]}}function Wy(t,e,n){var i=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=Math.ceil(Math.max(n.curveStepCount,n.curveStepCount/Math.sqrt(200)*i)),a=2*Math.PI/r,o=Math.abs(t/2),s=Math.abs(e/2),u=1-n.curveFitting;return{increment:a,rx:o+=Zy(o*u,n),ry:s+=Zy(s*u,n)}}function Vy(t,e,n,i){var r=g(em(i.increment,t,e,i.rx,i.ry,1,i.increment*qy(.1,qy(.4,1,n),n),n),2),a=r[0],o=r[1],s=tm(a,null,n);if(!n.disableMultiStroke&&0!==n.roughness){var u=tm(g(em(i.increment,t,e,i.rx,i.ry,1.5,0,n),1)[0],null,n);s=s.concat(u)}return{estimatedPoints:o,opset:{type:"path",ops:s}}}function Hy(t,e,n,i,r,a,o,s,u){var l=t,c=e,h=Math.abs(n/2),d=Math.abs(i/2);h+=Zy(.01*h,u),d+=Zy(.01*d,u);for(var f=r,v=a;f<0;)f+=2*Math.PI,v+=2*Math.PI;v-f>2*Math.PI&&(f=0,v=2*Math.PI);var p=2*Math.PI/u.curveStepCount,g=Math.min(p/2,(v-f)/2),m=nm(g,l,c,h,d,f,v,1,u);if(!u.disableMultiStroke){var k=nm(g,l,c,h,d,f,v,1.5,u);m.push.apply(m,y(k))}return o&&(s?m.push.apply(m,y(Jy(l,c,l+h*Math.cos(f),c+d*Math.sin(f),u)).concat(y(Jy(l,c,l+h*Math.cos(v),c+d*Math.sin(v),u)))):m.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+h*Math.cos(f),c+d*Math.sin(f)]})),{type:"path",ops:m}}function Yy(t,e){var n,i=[],r=b(t);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(a.length){var o=e.maxRandomnessOffset||0,s=a.length;if(s>2){i.push({op:"move",data:[a[0][0]+Zy(o,e),a[0][1]+Zy(o,e)]});for(var u=1;u<s;u++)i.push({op:"lineTo",data:[a[u][0]+Zy(o,e),a[u][1]+Zy(o,e)]})}}}}catch(t){r.e(t)}finally{r.f()}return{type:"fillPath",ops:i}}function Xy(t,e){return function(t,e){var n=t.fillStyle||"hachure";if(!My[n])switch(n){case"zigzag":My[n]||(My[n]=new Ty(e));break;case"cross-hatch":My[n]||(My[n]=new Cy(e));break;case"dots":My[n]||(My[n]=new Ey(e));break;case"dashed":My[n]||(My[n]=new Ry(e));break;case"zigzag-line":My[n]||(My[n]=new By(e));break;default:My[n="hachure"]||(My[n]=new Ay(e))}return My[n]}(e,Gy).fillPolygons(t,e)}function Ky(t){return t.randomizer||(t.randomizer=new Py(t.seed||0)),t.randomizer.next()}function qy(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return n.roughness*i*(Ky(n)*(e-t)+t)}function Zy(t,e){return qy(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function Jy(t,e,n,i,r){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?r.disableMultiStrokeFill:r.disableMultiStroke,o=$y(t,e,n,i,r,!0,!1);if(a)return o;var s=$y(t,e,n,i,r,!0,!0);return o.concat(s)}function $y(t,e,n,i,r,a,o){var s,u=Math.pow(t-n,2)+Math.pow(e-i,2),l=Math.sqrt(u);s=l<200?1:l>500?.4:-.0016668*l+1.233334;var c=r.maxRandomnessOffset||0;c*c*100>u&&(c=l/10);var h=c/2,d=.2+.2*Ky(r),f=r.bowing*r.maxRandomnessOffset*(i-e)/200,v=r.bowing*r.maxRandomnessOffset*(t-n)/200;f=Zy(f,r,s),v=Zy(v,r,s);var p=[],g=function(){return Zy(h,r,s)},y=function(){return Zy(c,r,s)},m=r.preserveVertices;return a&&(o?p.push({op:"move",data:[t+(m?0:g()),e+(m?0:g())]}):p.push({op:"move",data:[t+(m?0:Zy(c,r,s)),e+(m?0:Zy(c,r,s))]})),o?p.push({op:"bcurveTo",data:[f+t+(n-t)*d+g(),v+e+(i-e)*d+g(),f+t+2*(n-t)*d+g(),v+e+2*(i-e)*d+g(),n+(m?0:g()),i+(m?0:g())]}):p.push({op:"bcurveTo",data:[f+t+(n-t)*d+y(),v+e+(i-e)*d+y(),f+t+2*(n-t)*d+y(),v+e+2*(i-e)*d+y(),n+(m?0:y()),i+(m?0:y())]}),p}function Qy(t,e,n){var i=[];i.push([t[0][0]+Zy(e,n),t[0][1]+Zy(e,n)]),i.push([t[0][0]+Zy(e,n),t[0][1]+Zy(e,n)]);for(var r=1;r<t.length;r++)i.push([t[r][0]+Zy(e,n),t[r][1]+Zy(e,n)]),r===t.length-1&&i.push([t[r][0]+Zy(e,n),t[r][1]+Zy(e,n)]);return tm(i,null,n)}function tm(t,e,n){var i=t.length,r=[];if(i>3){var a=[],o=1-n.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(var s=1;s+2<i;s++){var u=t[s];a[0]=[u[0],u[1]],a[1]=[u[0]+(o*t[s+1][0]-o*t[s-1][0])/6,u[1]+(o*t[s+1][1]-o*t[s-1][1])/6],a[2]=[t[s+1][0]+(o*t[s][0]-o*t[s+2][0])/6,t[s+1][1]+(o*t[s][1]-o*t[s+2][1])/6],a[3]=[t[s+1][0],t[s+1][1]],r.push({op:"bcurveTo",data:[a[1][0],a[1][1],a[2][0],a[2][1],a[3][0],a[3][1]]})}if(e&&2===e.length){var l=n.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+Zy(l,n),e[1]+Zy(l,n)]})}}else 3===i?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===i&&r.push.apply(r,y(Jy(t[0][0],t[0][1],t[1][0],t[1][1],n)));return r}function em(t,e,n,i,r,a,o,s){var u=[],l=[];if(0===s.roughness){t/=4,l.push([e+i*Math.cos(-t),n+r*Math.sin(-t)]);for(var c=0;c<=2*Math.PI;c+=t){var h=[e+i*Math.cos(c),n+r*Math.sin(c)];u.push(h),l.push(h)}l.push([e+i*Math.cos(0),n+r*Math.sin(0)]),l.push([e+i*Math.cos(t),n+r*Math.sin(t)])}else{var d=Zy(.5,s)-Math.PI/2;l.push([Zy(a,s)+e+.9*i*Math.cos(d-t),Zy(a,s)+n+.9*r*Math.sin(d-t)]);for(var f=2*Math.PI+d-.01,v=d;v<f;v+=t){var p=[Zy(a,s)+e+i*Math.cos(v),Zy(a,s)+n+r*Math.sin(v)];u.push(p),l.push(p)}l.push([Zy(a,s)+e+i*Math.cos(d+2*Math.PI+.5*o),Zy(a,s)+n+r*Math.sin(d+2*Math.PI+.5*o)]),l.push([Zy(a,s)+e+.98*i*Math.cos(d+o),Zy(a,s)+n+.98*r*Math.sin(d+o)]),l.push([Zy(a,s)+e+.9*i*Math.cos(d+.5*o),Zy(a,s)+n+.9*r*Math.sin(d+.5*o)])}return[l,u]}function nm(t,e,n,i,r,a,o,s,u){var l=a+Zy(.1,u),c=[];c.push([Zy(s,u)+e+.9*i*Math.cos(l-t),Zy(s,u)+n+.9*r*Math.sin(l-t)]);for(var h=l;h<=o;h+=t)c.push([Zy(s,u)+e+i*Math.cos(h),Zy(s,u)+n+r*Math.sin(h)]);return c.push([e+i*Math.cos(o),n+r*Math.sin(o)]),c.push([e+i*Math.cos(o),n+r*Math.sin(o)]),tm(c,null,u)}function im(t){return y(t)}function rm(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function am(t,e,n){var i=rm(e,n);if(0===i)return rm(t,e);var r=((t[0]-e[0])*(n[0]-e[0])+(t[1]-e[1])*(n[1]-e[1]))/i;return rm(t,om(e,n,r=Math.max(0,Math.min(1,r))))}function om(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n]}function sm(t,e,n,i){var r,a,o=i||[];if(function(t,e){var n=t[e+0],i=t[e+1],r=t[e+2],a=t[e+3],o=3*i[0]-2*n[0]-a[0];o*=o;var s=3*i[1]-2*n[1]-a[1];s*=s;var u=3*r[0]-2*a[0]-n[0];u*=u;var l=3*r[1]-2*a[1]-n[1];return o<u&&(o=u),s<(l*=l)&&(s=l),o+s}(t,e)<n){var s=t[e+0];o.length?(r=o[o.length-1],a=s,Math.sqrt(rm(r,a))>1&&o.push(s)):o.push(s),o.push(t[e+3])}else{var u=.5,l=t[e+0],c=t[e+1],h=t[e+2],d=t[e+3],f=om(l,c,u),v=om(c,h,u),p=om(h,d,u),g=om(f,v,u),y=om(v,p,u),m=om(g,y,u);sm([l,f,g,m],0,n,o),sm([m,y,p,d],0,n,o)}return o}function um(t,e){return lm(t,0,t.length,e)}function lm(t,e,n,i,r){for(var a=r||[],o=t[e],s=t[n-1],u=0,l=1,c=e+1;c<n-1;++c){var h=am(t[c],o,s);h>u&&(u=h,l=c)}return Math.sqrt(u)>i?(lm(t,e,l+1,i,a),lm(t,l,n,i,a)):(a.length||a.push(o),a.push(s)),a}function cm(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,n=arguments.length>2?arguments[2]:void 0,i=[],r=(t.length-1)/3,a=0;a<r;a++)sm(t,3*a,e,i);return n&&n>0?lm(i,0,i.length,n):i}var hm="none",dm=function(){return u((function t(e){o(this,t),this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=e||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}),[{key:"_o",value:function(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}},{key:"_d",value:function(t,e,n){return{shape:t,sets:e||[],options:n||this.defaultOptions}}},{key:"line",value:function(t,e,n,i,r){var a=this._o(r);return this._d("line",[zy(t,e,n,i,a)],a)}},{key:"rectangle",value:function(t,e,n,i,r){var a=this._o(r),o=[],s=function(t,e,n,i,r){return function(t,e){return Uy(t,!0,e)}([[t,e],[t+n,e],[t+n,e+i],[t,e+i]],r)}(t,e,n,i,a);if(a.fill){var u=[[t,e],[t+n,e],[t+n,e+i],[t,e+i]];"solid"===a.fillStyle?o.push(Yy([u],a)):o.push(Xy([u],a))}return a.stroke!==hm&&o.push(s),this._d("rectangle",o,a)}},{key:"ellipse",value:function(t,e,n,i,r){var a=this._o(r),o=[],s=Wy(n,i,a),u=Vy(t,e,a,s);if(a.fill)if("solid"===a.fillStyle){var l=Vy(t,e,a,s).opset;l.type="fillPath",o.push(l)}else o.push(Xy([u.estimatedPoints],a));return a.stroke!==hm&&o.push(u.opset),this._d("ellipse",o,a)}},{key:"circle",value:function(t,e,n,i){var r=this.ellipse(t,e,n,n,i);return r.shape="circle",r}},{key:"linearPath",value:function(t,e){var n=this._o(e);return this._d("linearPath",[Uy(t,!1,n)],n)}},{key:"arc",value:function(t,e,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7?arguments[7]:void 0,u=this._o(s),l=[],c=Hy(t,e,n,i,r,a,o,!0,u);if(o&&u.fill)if("solid"===u.fillStyle){var h=Object.assign({},u);h.disableMultiStroke=!0;var d=Hy(t,e,n,i,r,a,!0,!1,h);d.type="fillPath",l.push(d)}else l.push(function(t,e,n,i,r,a,o){var s=t,u=e,l=Math.abs(n/2),c=Math.abs(i/2);l+=Zy(.01*l,o),c+=Zy(.01*c,o);for(var h=r,d=a;h<0;)h+=2*Math.PI,d+=2*Math.PI;d-h>2*Math.PI&&(h=0,d=2*Math.PI);for(var f=(d-h)/o.curveStepCount,v=[],p=h;p<=d;p+=f)v.push([s+l*Math.cos(p),u+c*Math.sin(p)]);return v.push([s+l*Math.cos(d),u+c*Math.sin(d)]),v.push([s,u]),Xy([v],o)}(t,e,n,i,r,a,u));return u.stroke!==hm&&l.push(c),this._d("arc",l,u)}},{key:"curve",value:function(t,e){var n=this._o(e),i=[],r=function(t,e){var n=Qy(t,1*(1+.2*e.roughness),e);if(!e.disableMultiStroke){var i=Qy(t,1.5*(1+.22*e.roughness),function(t){var e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}(e));n=n.concat(i)}return{type:"path",ops:n}}(t,n);if(n.fill&&n.fill!==hm&&t.length>=3){var a=cm(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=t.length;if(n<3)throw new Error("A curve must have at least three points.");var i=[];if(3===n)i.push(im(t[0]),im(t[1]),im(t[2]),im(t[2]));else{var r=[];r.push(t[0],t[0]);for(var a=1;a<t.length;a++)r.push(t[a]),a===t.length-1&&r.push(t[a]);var o=[],s=1-e;i.push(im(r[0]));for(var u=1;u+2<r.length;u++){var l=r[u];o[0]=[l[0],l[1]],o[1]=[l[0]+(s*r[u+1][0]-s*r[u-1][0])/6,l[1]+(s*r[u+1][1]-s*r[u-1][1])/6],o[2]=[r[u+1][0]+(s*r[u][0]-s*r[u+2][0])/6,r[u+1][1]+(s*r[u][1]-s*r[u+2][1])/6],o[3]=[r[u+1][0],r[u+1][1]],i.push(o[1],o[2],o[3])}}return i}(t),10,(1+n.roughness)/2);"solid"===n.fillStyle?i.push(Yy([a],n)):i.push(Xy([a],n))}return n.stroke!==hm&&i.push(r),this._d("curve",i,n)}},{key:"polygon",value:function(t,e){var n=this._o(e),i=[],r=Uy(t,!0,n);return n.fill&&("solid"===n.fillStyle?i.push(Yy([t],n)):i.push(Xy([t],n))),n.stroke!==hm&&i.push(r),this._d("polygon",i,n)}},{key:"path",value:function(t,e){var n=this._o(e),i=[];if(!t)return this._d("path",i,n);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");var r=n.fill&&"transparent"!==n.fill&&n.fill!==hm,a=n.stroke!==hm,o=!!(n.simplification&&n.simplification<1),s=function(t,e,n){var i,r=jy(Dy(Ly(t))),a=[],o=[],s=[0,0],u=[],l=function(){var t;u.length>=4&&(t=o).push.apply(t,y(cm(u,1))),u=[]},c=function(){l(),o.length&&(a.push(o),o=[])},h=b(r);try{for(h.s();!(i=h.n()).done;){var d=i.value,f=d.key,v=d.data;switch(f){case"M":c(),s=[v[0],v[1]],o.push(s);break;case"L":l(),o.push([v[0],v[1]]);break;case"C":if(!u.length){var p=o.length?o[o.length-1]:s;u.push([p[0],p[1]])}u.push([v[0],v[1]]),u.push([v[2],v[3]]),u.push([v[4],v[5]]);break;case"Z":l(),o.push([s[0],s[1]])}}}catch(t){h.e(t)}finally{h.f()}if(c(),!n)return a;for(var g=[],m=0,k=a;m<k.length;m++){var _=um(k[m],n);_.length&&g.push(_)}return g}(t,0,o?4-4*n.simplification:(1+n.roughness)/2);return r&&("solid"===n.fillStyle?i.push(Yy(s,n)):i.push(Xy(s,n))),a&&(o?s.forEach((function(t){i.push(Uy(t,!1,n))})):i.push(function(t,e){var n,i=jy(Dy(Ly(t))),r=[],a=[0,0],o=[0,0],s=b(i);try{var u=function(){var t=n.value,i=t.key,s=t.data;switch(i){case"M":var u=1*(e.maxRandomnessOffset||0),l=e.preserveVertices;r.push({op:"move",data:s.map((function(t){return t+(l?0:Zy(u,e))}))}),o=[s[0],s[1]],a=[s[0],s[1]];break;case"L":r.push.apply(r,y(Jy(o[0],o[1],s[0],s[1],e))),o=[s[0],s[1]];break;case"C":var c=g(s,6),h=c[0],d=c[1],f=c[2],v=c[3],p=c[4],m=c[5];r.push.apply(r,y(function(t,e,n,i,r,a,o,s){for(var u=[],l=[s.maxRandomnessOffset||1,(s.maxRandomnessOffset||1)+.3],c=[0,0],h=s.disableMultiStroke?1:2,d=s.preserveVertices,f=0;f<h;f++)0===f?u.push({op:"move",data:[o[0],o[1]]}):u.push({op:"move",data:[o[0]+(d?0:Zy(l[0],s)),o[1]+(d?0:Zy(l[0],s))]}),c=d?[r,a]:[r+Zy(l[f],s),a+Zy(l[f],s)],u.push({op:"bcurveTo",data:[t+Zy(l[f],s),e+Zy(l[f],s),n+Zy(l[f],s),i+Zy(l[f],s),c[0],c[1]]});return u}(h,d,f,v,p,m,o,e))),o=[p,m];break;case"Z":r.push.apply(r,y(Jy(o[0],o[1],a[0],a[1],e))),o=[a[0],a[1]]}};for(s.s();!(n=s.n()).done;)u()}catch(t){s.e(t)}finally{s.f()}return{type:"path",ops:r}}(t,n))),this._d("path",i,n)}},{key:"opsToPath",value:function(t,e){var n,i="",r=b(t.ops);try{for(r.s();!(n=r.n()).done;){var a=n.value,o="number"==typeof e&&e>=0?a.data.map((function(t){return+t.toFixed(e)})):a.data;switch(a.op){case"move":i+="M".concat(o[0]," ").concat(o[1]," ");break;case"bcurveTo":i+="C".concat(o[0]," ").concat(o[1],", ").concat(o[2]," ").concat(o[3],", ").concat(o[4]," ").concat(o[5]," ");break;case"lineTo":i+="L".concat(o[0]," ").concat(o[1]," ")}}}catch(t){r.e(t)}finally{r.f()}return i.trim()}},{key:"toPaths",value:function(t){var e,n=t.sets||[],i=t.options||this.defaultOptions,r=[],a=b(n);try{for(a.s();!(e=a.n()).done;){var o=e.value,s=null;switch(o.type){case"path":s={d:this.opsToPath(o),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:hm};break;case"fillPath":s={d:this.opsToPath(o),stroke:hm,strokeWidth:0,fill:i.fill||hm};break;case"fillSketch":s=this.fillSketch(o,i)}s&&r.push(s)}}catch(t){a.e(t)}finally{a.f()}return r}},{key:"fillSketch",value:function(t,e){var n=e.fillWeight;return n<0&&(n=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||hm,strokeWidth:n,fill:hm}}}],[{key:"newSeed",value:function(){return Math.floor(Math.random()*Math.pow(2,31))}}])}(),fm=function(){return u((function t(e,n){o(this,t),this.canvas=e,this.ctx=this.canvas.getContext("2d"),this.gen=new dm(n)}),[{key:"draw",value:function(t){var e,n=t.sets||[],i=t.options||this.getDefaultOptions(),r=this.ctx,a=t.options.fixedDecimalPlaceDigits,o=b(n);try{for(o.s();!(e=o.n()).done;){var s=e.value;switch(s.type){case"path":r.save(),r.strokeStyle="none"===i.stroke?"transparent":i.stroke,r.lineWidth=i.strokeWidth,i.strokeLineDash&&r.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(r.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(r,s,a),r.restore();break;case"fillPath":r.save(),r.fillStyle=i.fill||"";var u="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(r,s,a,u),r.restore();break;case"fillSketch":this.fillSketch(r,s,i)}}}catch(t){o.e(t)}finally{o.f()}}},{key:"fillSketch",value:function(t,e,n){var i=n.fillWeight;i<0&&(i=n.strokeWidth/2),t.save(),n.fillLineDash&&t.setLineDash(n.fillLineDash),n.fillLineDashOffset&&(t.lineDashOffset=n.fillLineDashOffset),t.strokeStyle=n.fill||"",t.lineWidth=i,this._drawToContext(t,e,n.fixedDecimalPlaceDigits),t.restore()}},{key:"_drawToContext",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();var r,a=b(e.ops);try{for(a.s();!(r=a.n()).done;){var o=r.value,s="number"==typeof n&&n>=0?o.data.map((function(t){return+t.toFixed(n)})):o.data;switch(o.op){case"move":t.moveTo(s[0],s[1]);break;case"bcurveTo":t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5]);break;case"lineTo":t.lineTo(s[0],s[1])}}}catch(t){a.e(t)}finally{a.f()}"fillPath"===e.type?t.fill(i):t.stroke()}},{key:"generator",get:function(){return this.gen}},{key:"getDefaultOptions",value:function(){return this.gen.defaultOptions}},{key:"line",value:function(t,e,n,i,r){var a=this.gen.line(t,e,n,i,r);return this.draw(a),a}},{key:"rectangle",value:function(t,e,n,i,r){var a=this.gen.rectangle(t,e,n,i,r);return this.draw(a),a}},{key:"ellipse",value:function(t,e,n,i,r){var a=this.gen.ellipse(t,e,n,i,r);return this.draw(a),a}},{key:"circle",value:function(t,e,n,i){var r=this.gen.circle(t,e,n,i);return this.draw(r),r}},{key:"linearPath",value:function(t,e){var n=this.gen.linearPath(t,e);return this.draw(n),n}},{key:"polygon",value:function(t,e){var n=this.gen.polygon(t,e);return this.draw(n),n}},{key:"arc",value:function(t,e,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],s=arguments.length>7?arguments[7]:void 0,u=this.gen.arc(t,e,n,i,r,a,o,s);return this.draw(u),u}},{key:"curve",value:function(t,e){var n=this.gen.curve(t,e);return this.draw(n),n}},{key:"path",value:function(t,e){var n=this.gen.path(t,e);return this.draw(n),n}}])}(),vm=function(t,e){return new fm(t,e)},pm=3,gm=1,ym=1,mm=.95,km=void 0,bm=9,_m="hachure",xm=void 0,wm=60,Sm=6,Am=0,Tm=void 0,Cm=void 0,Em=void 0,Rm=1,Bm=void 0,Mm=void 0,Pm=!1,Om=!1,Im=!0,Lm=void 0,Dm=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},jm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fm=function(t,e){return function(n,i){e(n,i,t)}},Nm=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="arc",this.numberType=Is}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=vm(a);r.highPerformanceSave();var s=zr(t).arc,u=t.attribute,l=u.x,c=void 0===l?s.x:l,h=u.y,d=void 0===h?s.y:h;if(t.transMatrix.onlyTranslate()){var f=t.attribute,v=f.dx,p=void 0===v?s.dx:v,g=f.dy;c+=p,d+=void 0===g?s.dy:g,r.setTransformForCurrent()}else c=0,d=0,r.transformFromMatrix(t.transMatrix,!0);var y=new ei,m=t.attribute,k=m.fill,b=void 0===k?s.fill:k,_=m.stroke,x=void 0===_?s.stroke:_,w=m.lineWidth,S=void 0===w?s.lineWidth:w,A=m.outerRadius,T=void 0===A?s.outerRadius:A,C=m.innerRadius,E=void 0===C?s.innerRadius:C,R=m.maxRandomnessOffset,B=void 0===R?pm:R,M=m.roughness,P=void 0===M?gm:M,O=m.bowing,I=void 0===O?ym:O,L=m.curveFitting,D=void 0===L?mm:L,j=m.curveTightness,F=void 0===j?km:j,N=m.curveStepCount,G=void 0===N?bm:N,z=m.fillStyle,U=void 0===z?_m:z,W=m.fillWeight,V=void 0===W?xm:W,H=m.hachureAngle,Y=void 0===H?wm:H,X=m.hachureGap,K=void 0===X?Sm:X,q=m.simplification,Z=void 0===q?Am:q,J=m.dashOffset,$=void 0===J?Tm:J,Q=m.dashGap,tt=void 0===Q?Cm:Q,et=m.zigzagOffset,nt=void 0===et?Em:et,it=m.seed,rt=void 0===it?Rm:it,at=m.fillLineDash,ot=void 0===at?Bm:at,st=m.fillLineDashOffset,ut=void 0===st?Mm:st,lt=m.disableMultiStroke,ct=void 0===lt?Pm:lt,ht=m.disableMultiStrokeFill,dt=void 0===ht?Om:ht,ft=m.preserveVertices,vt=void 0===ft?Im:ft,pt=m.fixedDecimalPlaceDigits,gt=void 0===pt?Lm:pt;Su(t,y,c,d,T,E),o.path(y.toString(),{fill:b||void 0,stroke:x||void 0,strokeWidth:S,maxRandomnessOffset:B,roughness:P,bowing:I,curveFitting:D,curveTightness:F,curveStepCount:G,fillStyle:U,fillWeight:V,hachureAngle:Y,hachureGap:K,simplification:Z,dashOffset:$,dashGap:tt,zigzagOffset:nt,seed:rt,fillLineDash:ot,fillLineDashOffset:ut,disableMultiStroke:ct,disableMultiStrokeFill:dt,preserveVertices:vt,fixedDecimalPlaceDigits:gt}),r.highPerformanceRestore()}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();Nm=Dm([L(),Fm(0,O(t.DefaultCanvasArcRender)),jm("design:paramtypes",[Object])],Nm);var Gm=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},zm=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).style="rough",t}return c(n,t),u(n,[{key:"drawSegmentItem",value:function(t,e,i,r,a,o,s,u,l,c,d,f,v,g,y){if(y)return p(h(n.prototype),"drawSegmentItem",this).call(this,t,e,i,r,a,o,s,u,l,c,d,f,v,g,y);t.highPerformanceSave();var m=t.canvas.nativeCanvas,k=vm(m,{}),b=new ei;Dd(b,e,l,{offsetX:c,offsetY:d});var _=s.maxRandomnessOffset,x=void 0===_?pm:_,w=s.roughness,S=void 0===w?gm:w,A=s.bowing,T=void 0===A?ym:A,C=s.curveFitting,E=void 0===C?mm:C,R=s.curveTightness,B=void 0===R?km:R,M=s.curveStepCount,P=void 0===M?bm:M,O=s.fillStyle,I=void 0===O?_m:O,L=s.fillWeight,D=void 0===L?xm:L,j=s.hachureAngle,F=void 0===j?wm:j,N=s.hachureGap,G=void 0===N?Sm:N,z=s.simplification,U=void 0===z?Am:z,W=s.dashOffset,V=void 0===W?Tm:W,H=s.dashGap,Y=void 0===H?Cm:H,X=s.zigzagOffset,K=void 0===X?Em:X,q=s.seed,Z=void 0===q?Rm:q,J=s.fillLineDash,$=void 0===J?Bm:J,Q=s.fillLineDashOffset,tt=void 0===Q?Mm:Q,et=s.disableMultiStroke,nt=void 0===et?Pm:et,it=s.disableMultiStrokeFill,rt=void 0===it?Om:it,at=s.preserveVertices,ot=void 0===at?Im:at,st=s.fixedDecimalPlaceDigits,ut=void 0===st?Lm:st,lt=s.fill,ct=s.stroke,ht=s.lineWidth;return Array.isArray(u)?u.forEach((function(t){lt=null!=lt?lt:t.fill,ct=null!=ct?ct:t.stroke,ht=null!=ht?ht:t.lineWidth})):(lt=null!=lt?lt:u.fill,ct=null!=ct?ct:u.stroke,ht=null!=ht?ht:u.lineWidth),k.path(b.toString(),{fill:i?lt:void 0,strokeWidth:ht,maxRandomnessOffset:x,roughness:S,bowing:T,curveFitting:E,curveTightness:B,curveStepCount:P,fillStyle:I,fillWeight:D,hachureAngle:F,hachureGap:G,simplification:U,dashOffset:V,dashGap:Y,zigzagOffset:K,seed:Z,fillLineDash:$,fillLineDashOffset:tt,disableMultiStroke:nt,disableMultiStrokeFill:rt,preserveVertices:ot,fixedDecimalPlaceDigits:ut}),t.highPerformanceRestore(),!1}}])}(t.DefaultCanvasAreaRender);zm=Gm([L()],zm);var Um=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Wm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vm=function(t,e){return function(n,i){e(n,i,t)}},Hm=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="circle",this.numberType=js}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=vm(a,{}),s=zr(t).circle,u=t.attribute,l=u.x,c=void 0===l?s.x:l,h=u.y,d=void 0===h?s.y:h;t.transMatrix.onlyTranslate()?r.onlyTranslate()||r.clearMatrix():(c=0,d=0,r.transformFromMatrix(t.transMatrix,!0));var f=t.attribute,v=f.radius,p=void 0===v?s.radius:v,g=f.fill,y=void 0===g?s.fill:g,m=f.stroke,k=void 0===m?s.stroke:m,b=f.lineWidth,_=void 0===b?s.lineWidth:b;o.circle(c,d,p,{fill:y||void 0,stroke:k||void 0,strokeWidth:_,fillStyle:"zigzag",roughness:.5})}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();Hm=Um([L(),Vm(0,O(t.DefaultCanvasCircleRender)),Wm("design:paramtypes",[Object])],Hm);var Ym=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Xm=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).style="rough",t}return c(n,t),u(n,[{key:"drawSegmentItem",value:function(t,e,i,r,a,o,s,u,l,c,d,f,v,g,y){if(g||y)return p(h(n.prototype),"drawSegmentItem",this).call(this,t,e,i,r,a,o,s,u,l,c,d,f,v,g,y);t.highPerformanceSave();var m=t.canvas.nativeCanvas,k=vm(m,{}),b=new ei;Pd(t.camera?t:t.nativeContext,e,l,c,{offsetX:d,offsetY:f});var _=s.maxRandomnessOffset,x=void 0===_?pm:_,w=s.roughness,S=void 0===w?gm:w,A=s.bowing,T=void 0===A?ym:A,C=s.curveFitting,E=void 0===C?mm:C,R=s.curveTightness,B=void 0===R?km:R,M=s.curveStepCount,P=void 0===M?bm:M,O=s.fillStyle,I=void 0===O?_m:O,L=s.fillWeight,D=void 0===L?xm:L,j=s.hachureAngle,F=void 0===j?wm:j,N=s.hachureGap,G=void 0===N?Sm:N,z=s.simplification,U=void 0===z?Am:z,W=s.dashOffset,V=void 0===W?Tm:W,H=s.dashGap,Y=void 0===H?Cm:H,X=s.zigzagOffset,K=void 0===X?Em:X,q=s.seed,Z=void 0===q?Rm:q,J=s.fillLineDash,$=void 0===J?Bm:J,Q=s.fillLineDashOffset,tt=void 0===Q?Mm:Q,et=s.disableMultiStroke,nt=void 0===et?Pm:et,it=s.disableMultiStrokeFill,rt=void 0===it?Om:it,at=s.preserveVertices,ot=void 0===at?Im:at,st=s.fixedDecimalPlaceDigits,ut=void 0===st?Lm:st,lt=s.fill,ct=s.stroke,ht=s.lineWidth;return Array.isArray(u)?u.forEach((function(t){lt=null!=lt?lt:t.fill,ct=null!=ct?ct:t.stroke,ht=null!=ht?ht:t.lineWidth})):(lt=null!=lt?lt:u.fill,ct=null!=ct?ct:u.stroke,ht=null!=ht?ht:u.lineWidth),k.path(b.toString(),{fill:i?lt:void 0,stroke:r?ct:void 0,strokeWidth:ht,maxRandomnessOffset:x,roughness:S,bowing:T,curveFitting:E,curveTightness:B,curveStepCount:P,fillStyle:I,fillWeight:D,hachureAngle:F,hachureGap:G,simplification:U,dashOffset:V,dashGap:Y,zigzagOffset:K,seed:Z,fillLineDash:$,fillLineDashOffset:tt,disableMultiStroke:nt,disableMultiStrokeFill:rt,preserveVertices:ot,fixedDecimalPlaceDigits:ut}),t.highPerformanceRestore(),!1}}])}(t.DefaultCanvasLineRender);Xm=Ym([L()],Xm);var Km=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},qm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zm=function(t,e){return function(n,i){e(n,i,t)}},Jm=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="path",this.numberType=Us}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=vm(a,{});r.highPerformanceSave();var s=zr(t).path;r.transformFromMatrix(t.transMatrix,!0);var u=t.attribute,l=u.fill,c=void 0===l?s.fill:l,h=u.stroke,d=void 0===h?s.stroke:h,f=u.lineWidth,v=void 0===f?s.lineWidth:f,p=u.path,g=void 0===p?s.path:p,y=u.maxRandomnessOffset,m=void 0===y?pm:y,k=u.roughness,b=void 0===k?gm:k,_=u.bowing,x=void 0===_?ym:_,w=u.curveFitting,S=void 0===w?mm:w,A=u.curveTightness,T=void 0===A?km:A,C=u.curveStepCount,E=void 0===C?bm:C,R=u.fillStyle,B=void 0===R?_m:R,M=u.fillWeight,P=void 0===M?xm:M,O=u.hachureAngle,I=void 0===O?wm:O,L=u.hachureGap,D=void 0===L?Sm:L,j=u.simplification,F=void 0===j?Am:j,N=u.dashOffset,G=void 0===N?Tm:N,z=u.dashGap,U=void 0===z?Cm:z,W=u.zigzagOffset,V=void 0===W?Em:W,H=u.seed,Y=void 0===H?Rm:H,X=u.fillLineDash,K=void 0===X?Bm:X,q=u.fillLineDashOffset,Z=void 0===q?Mm:q,J=u.disableMultiStroke,$=void 0===J?Pm:J,Q=u.disableMultiStrokeFill,tt=void 0===Q?Om:Q,et=u.preserveVertices,nt=void 0===et?Im:et,it=u.fixedDecimalPlaceDigits,rt=void 0===it?Lm:it;"string"==typeof g&&o.path(g,{fill:c||void 0,stroke:d||void 0,strokeWidth:v,maxRandomnessOffset:m,roughness:b,bowing:x,curveFitting:S,curveTightness:T,curveStepCount:E,fillStyle:B,fillWeight:P,hachureAngle:I,hachureGap:D,simplification:F,dashOffset:G,dashGap:U,zigzagOffset:V,seed:Y,fillLineDash:K,fillLineDashOffset:Z,disableMultiStroke:$,disableMultiStrokeFill:tt,preserveVertices:nt,fixedDecimalPlaceDigits:rt}),r.highPerformanceRestore()}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();Jm=Km([L(),Zm(0,O(t.DefaultCanvasPathRender)),qm("design:paramtypes",[Object])],Jm);var $m=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Qm=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tk=function(t,e){return function(n,i){e(n,i,t)}},ek=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.style="rough",this.type="rect",this.numberType=Hs}),[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=vm(a);r.highPerformanceSave();var s=zr(t).rect,u=t.attribute,l=u.x,c=void 0===l?s.x:l,h=u.y,d=void 0===h?s.y:h;if(t.transMatrix.onlyTranslate()){var f=t.attribute,v=f.dx,p=void 0===v?s.dx:v,g=f.dy;c+=p,d+=void 0===g?s.dy:g,r.setTransformForCurrent()}else c=0,d=0,r.transformFromMatrix(t.transMatrix,!0);var y=t.attribute,m=y.fill,k=void 0===m?s.fill:m,b=y.stroke,_=void 0===b?s.stroke:b,x=y.fillColor,w=void 0===x?s.fill:x,S=y.strokeColor,A=void 0===S?s.stroke:S,T=y.x1,C=y.y1,E=y.lineWidth,R=void 0===E?s.lineWidth:E,B=y.maxRandomnessOffset,M=void 0===B?pm:B,P=y.roughness,O=void 0===P?gm:P,I=y.bowing,L=void 0===I?ym:I,D=y.curveFitting,j=void 0===D?mm:D,F=y.curveTightness,N=void 0===F?km:F,G=y.curveStepCount,z=void 0===G?bm:G,U=y.fillStyle,W=void 0===U?_m:U,V=y.fillWeight,H=void 0===V?xm:V,Y=y.hachureAngle,X=void 0===Y?wm:Y,K=y.hachureGap,q=void 0===K?Sm:K,Z=y.simplification,J=void 0===Z?Am:Z,$=y.dashOffset,Q=void 0===$?Tm:$,tt=y.dashGap,et=void 0===tt?Cm:tt,nt=y.zigzagOffset,it=void 0===nt?Em:nt,rt=y.seed,at=void 0===rt?Rm:rt,ot=y.fillLineDash,st=void 0===ot?Bm:ot,ut=y.fillLineDashOffset,lt=void 0===ut?Mm:ut,ct=y.disableMultiStroke,ht=void 0===ct?Pm:ct,dt=y.disableMultiStrokeFill,ft=void 0===dt?Om:dt,vt=y.preserveVertices,pt=void 0===vt?Im:vt,gt=y.fixedDecimalPlaceDigits,yt=void 0===gt?Lm:gt,mt=t.attribute,kt=mt.width,bt=void 0===kt?s.width:kt,_t=mt.height,xt=void 0===_t?s.height:_t;bt=(null!=bt?bt:T-c)||0,xt=(null!=xt?xt:C-d)||0,o.rectangle(c,d,bt,xt,{fill:k?w:void 0,stroke:_?A:void 0,strokeWidth:R,maxRandomnessOffset:M,roughness:O,bowing:L,curveFitting:j,curveTightness:N,curveStepCount:z,fillStyle:W,fillWeight:H,hachureAngle:X,hachureGap:q,simplification:J,dashOffset:Q,dashGap:et,zigzagOffset:it,seed:at,fillLineDash:st,fillLineDashOffset:lt,disableMultiStroke:ht,disableMultiStrokeFill:ft,preserveVertices:pt,fixedDecimalPlaceDigits:yt}),r.highPerformanceRestore()}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}();ek=$m([L(),tk(0,O(t.DefaultCanvasRectRender)),Qm("design:paramtypes",[Object])],ek);var nk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ik=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},rk=function(t,e){return function(n,i){e(n,i,t)}},ak=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="symbol",i.numberType=Ks,i.style="rough",i}return c(n,t),u(n,[{key:"draw",value:function(t,e,n,i){var r=n.context;if(r){var a=r.canvas.nativeCanvas,o=vm(a);r.highPerformanceSave();var s=zr(t).symbol,u=this.transform(t,s,r),l=u.x,c=u.y;u.z,u.lastModelMatrix;var h=t.getParsedPath();if(h){var d=t.attribute,f=d.fill,v=void 0===f?s.fill:f,p=d.stroke,g=void 0===p?s.stroke:p,y=d.fillColor,m=void 0===y?s.fill:y,k=d.strokeColor,b=void 0===k?s.stroke:k,_=d.size,x=void 0===_?s.size:_,w=d.lineWidth,S=void 0===w?s.lineWidth:w,A=d.maxRandomnessOffset,T=void 0===A?pm:A,C=d.roughness,E=void 0===C?gm:C,R=d.bowing,B=void 0===R?ym:R,M=d.curveFitting,P=void 0===M?mm:M,O=d.curveTightness,I=void 0===O?km:O,L=d.curveStepCount,D=void 0===L?bm:L,j=d.fillStyle,F=void 0===j?_m:j,N=d.fillWeight,G=void 0===N?xm:N,z=d.hachureAngle,U=void 0===z?wm:z,W=d.hachureGap,V=void 0===W?Sm:W,H=d.simplification,Y=void 0===H?Am:H,X=d.dashOffset,K=void 0===X?Tm:X,q=d.dashGap,Z=void 0===q?Cm:q,J=d.zigzagOffset,$=void 0===J?Em:J,Q=d.seed,tt=void 0===Q?Rm:Q,et=d.fillLineDash,nt=void 0===et?Bm:et,it=d.fillLineDashOffset,rt=void 0===it?Mm:it,at=d.disableMultiStroke,ot=void 0===at?Pm:at,st=d.disableMultiStrokeFill,ut=void 0===st?Om:st,lt=d.preserveVertices,ct=void 0===lt?Im:lt,ht=d.fixedDecimalPlaceDigits,dt=void 0===ht?Lm:ht,ft="";if(h.drawToSvgPath)ft=h.drawToSvgPath(x,l,c);else{var vt=new ei;h.draw(vt,x,l,c)&&vt.closePath(),ft=vt.toString()}o.path(ft,{fill:v?m:void 0,stroke:g?b:void 0,strokeWidth:S,maxRandomnessOffset:T,roughness:E,bowing:B,curveFitting:P,curveTightness:I,curveStepCount:D,fillStyle:F,fillWeight:G,hachureAngle:U,hachureGap:V,simplification:Y,dashOffset:K,dashGap:Z,zigzagOffset:$,seed:tt,fillLineDash:nt,fillLineDashOffset:rt,disableMultiStroke:ot,disableMultiStrokeFill:ut,preserveVertices:ct,fixedDecimalPlaceDigits:dt}),r.highPerformanceRestore()}}}},{key:"drawShape",value:function(t,e,n,i,r,a,o,s){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,n,i,r,a,o,s)}}])}(zh);ak=nk([L(),rk(0,O(t.DefaultCanvasSymbolRender)),ik("design:paramtypes",[Object])],ak);var ok=new x((function(t){t(Hm).toSelf().inSingletonScope(),t(Mf).to(Hm),t(ek).toSelf().inSingletonScope(),t(Mf).to(ek),t(Jm).toSelf().inSingletonScope(),t(Mf).to(Jm),t(ak).toSelf().inSingletonScope(),t(Mf).to(ak),t(Xm).toSelf().inSingletonScope(),t(Mf).to(Xm),t(zm).toSelf().inSingletonScope(),t(Mf).to(zm),t(Nm).toSelf().inSingletonScope(),t(Mf).to(Nm)})),sk=Symbol.for("MathPickerContribution"),uk=Symbol.for("MathArcPicker"),lk=Symbol.for("MathAreaPicker"),ck=Symbol.for("MathCirclePicker"),hk=Symbol.for("MathImagePicker"),dk=Symbol.for("MathLinePicker"),fk=Symbol.for("MathPathPicker"),vk=Symbol.for("MathRectPicker"),pk=Symbol.for("MathSymbolPicker"),gk=Symbol.for("MathTextPicker"),yk=Symbol.for("MathPolygonPicker"),mk=Symbol.for("MathGlyphPicker"),kk=Symbol.for("CanvasArcPicker"),bk=Symbol.for("CanvasArc3dPicker"),_k=Symbol.for("CanvasAreaPicker"),xk=Symbol.for("CanvasCirclePicker"),wk=Symbol.for("CanvasImagePicker"),Sk=Symbol.for("CanvasLinePicker"),Ak=Symbol.for("CanvasPathPicker"),Tk=Symbol.for("CanvasRectPicker"),Ck=Symbol.for("CanvasRect3dPicker"),Ek=Symbol.for("CanvasSymbolPicker"),Rk=Symbol.for("CanvasTextPicker"),Bk=Symbol.for("CanvasPolygonPicker"),Mk=Symbol.for("CanvasPyramid3dPicker"),Pk=Symbol.for("CanvasRichTextPicker"),Ok=Symbol.for("CanvasGlyphPicker"),Ik=Symbol.for("CanvasGroupPicker"),Lk=Symbol.for("CanvasPickerContribution"),Dk={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},jk=Object.keys(Dk);function Fk(t){return Fh.richtext(t?t.attribute:{})}Fk.Text=function(t){return Object.assign({type:"rich/text"},t)},Fk.Image=function(t){return Object.assign({type:"rich/image"},t)};var Nk=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};function Gk(t,e){if(wt(t))return t.forEach((function(t){return Gk(t,e)}));e.push(t)}var zk=nu;function Uk(t){if(!t||!t.$$typeof)return t;var e=t.type,n=t.props,i=n.attribute,r=n.children,a=n.stateProxy,o=n.id,s=n.name,u=e({attribute:i}),l=function(t,e,n){var i,r=!1;switch(t.type){case"richtext":break;case"rich/text":i=t.attribute||{},n&&(i.text=n),t.attribute=i;break;case"rich/image":i=t.attribute||{};break;default:r=!0}return r?Object.keys(e).forEach((function(n){var i=Dk[n];i&&t.on(i,e[n])})):"richtext"===t.type&&(t.attribute.textConfig=n.map((function(t){return Uk(t)})).filter((function(t){return t}))),i}(u,t.props,r);return l||(a&&(u.stateProxy=a),u.id=o,u.name=s,Wk(r,u),u)}function Wk(t,e){wt(t)?t.forEach((function(t){if(wt(t))Wk(t,e);else{var n=Uk(t);n&&n.type&&e.add(n)}})):t&&e.add(Uk(t))}var Vk=function(){return u((function t(e){var n=this;o(this,t),this.onPointerDown=function(t){var e=t.target,i=n.rootNode,r=e===i;if(e&&!r){var a,o=function(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!r){e.attribute.pickable=!1;var n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.attribute.pickable=!0,a!==n&&(a&&(t.type="dragleave",t.target=a,a.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),(a=n)&&(t.type="dragover",t.target=a,a.dispatchEvent(t)))}},s=!1;null==i||i.addEventListener("pointermove",o);var u=function(){s&&(a&&(t.type="drop",t.target=a,a.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",o)};e.addEventListener("pointerup",u,{once:!0}),e.addEventListener("pointerupoutside",u,{once:!0})}},this.rootNode=e,this.initEvents()}),[{key:"initEvents",value:function(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}},{key:"removeEvents",value:function(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}},{key:"release",value:function(){this.removeEvents(),this.rootNode=null}}])}(),Hk=function(t,e){var n=e.x-t.x,i=e.y-t.y;return Math.abs(n)>Math.abs(i)?n>0?"right":"left":i>0?"down":"up"},Yk=function(t,e){var n=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y);return Math.sqrt(n*n+i*i)},Xk=function(t){function n(t){var i,r,a,s,u,l,c,h,d,v,p,g=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,n),(i=e(this,n)).cachedEvents=[],i.startPoints=[],i.processEvent={},i.throttleTimer=0,i.emitThrottles=[],i.lastTapTarget=null,i.onStart=function(t){i.reset(),i.startTime=Zr.now();var e=f(i),n=e.cachedEvents,r=e.startPoints;t&&n.push(t.clone()),r.length=n.length;for(var a=0;a<n.length;a++){var o=n[a],s={x:o.x,y:o.y};r[a]=s}if(1!==r.length)i.startDistance=Yk(r[0],r[1]),i.center=function(t){var e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};for(var n=0,i=0,r=0;r<e;)n+=t[r].x,i+=t[r].y,r++;return{x:Math.round(n/e),y:Math.round(i/e)}}([r[0],r[1]]);else{var u=n[0];i.pressTimeout=setTimeout((function(){u.direction="none",u.deltaX=0,u.deltaY=0,u.points=r,i.triggerStartEvent("press",u),i.triggerEvent("press",u),i.eventType="press",i.direction="none"}),i.config.press.time)}},i.onMove=function(t){i.clearPressTimeout();var e=f(i),n=e.startPoints,r=e.cachedEvents;if(n.length){for(var a=t.clone(),o=a.x,s=a.y,u=a.pointerId,l=0,c=r.length;l<c;l++)if(u===r[l].pointerId){r[l]=a;break}var h={x:o,y:s},d=r.map((function(t){return{x:t.x,y:t.y}})),v=Zr.now();if(i.prevMoveTime=i.lastMoveTime,i.prevMovePoint=i.lastMovePoint,i.lastMoveTime=v,i.lastMovePoint=h,1===n.length){var p=n[0],g=o-p.x,y=s-p.y,m=i.direction||Hk(p,h);i.direction=m;var k=i.getEventType(h);return a.direction=m,a.deltaX=g,a.deltaY=y,a.points=d,i.triggerStartEvent(k,a),void i.triggerEvent(k,a)}var b=f(i).startDistance,_=Yk(d[0],d[1]);a.scale=_/b,a.center=i.center,a.points=d,i.triggerStartEvent("pinch",a),i.triggerEvent("pinch",a)}},i.onEnd=function(t){var e=t.clone(),n=f(i),r=n.cachedEvents,a=n.startPoints,o=r.map((function(t){return{x:t.x,y:t.y}}));if(e.points=o,i.triggerEndEvent(e),1===r.length){var s=Zr.now(),u=i.lastMoveTime;if(s-u<100){var l=u-(i.prevMoveTime||i.startTime);if(l>0){var c=i.prevMovePoint||a[0],h=i.lastMovePoint||a[0],d=Yk(c,h),v=d/l;v>i.config.swipe.velocity&&d>i.config.swipe.threshold&&(e.velocity=v,e.direction=Hk(c,h),i.triggerEvent("swipe",e))}}s-i.lastTapTime<i.config.tap.interval&&t.target===i.lastTapTarget?i.tapCount++:i.tapCount=1,i.lastTapTime=s,i.lastTapTarget=t.target,1===i.tapCount?i.triggerEvent("tap",e):2===i.tapCount&&(i.triggerEvent("doubletap",e),i.tapCount=0)}for(var p=0,g=r.length;p<g;p++)if(r[p].pointerId===e.pointerId){r.splice(p,1),a.splice(p,1);break}i.reset(),r.length>0&&i.onStart()},i.element=t,i.tapCount=0,i.lastTapTime=0,i.config={press:{time:null!==(a=null===(r=null==g?void 0:g.press)||void 0===r?void 0:r.time)&&void 0!==a?a:251,threshold:null!==(u=null===(s=null==g?void 0:g.press)||void 0===s?void 0:s.threshold)&&void 0!==u?u:9},swipe:{threshold:null!==(c=null===(l=null==g?void 0:g.swipe)||void 0===l?void 0:l.threshold)&&void 0!==c?c:10,velocity:null!==(d=null===(h=null==g?void 0:g.swipe)||void 0===h?void 0:h.velocity)&&void 0!==d?d:.3},tap:{interval:null!==(p=null===(v=null==g?void 0:g.tap)||void 0===v?void 0:v.interval)&&void 0!==p?p:300}},i.initEvents(),i}return c(n,t),u(n,[{key:"initEvents",value:function(){var t=this.element;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}},{key:"removeEvents",value:function(){var t=this.element;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}},{key:"release",value:function(){this.removeEvents(),this.element=null}},{key:"getEventType",value:function(t){var e,n=this.eventType,i=this.startTime,r=this.startPoints;return n||(e=Zr.now()-i>this.config.press.time&&Yk(r[0],t)<this.config.press.threshold?"press":"pan",this.eventType=e,e)}},{key:"enable",value:function(t){this.processEvent[t]=!0}},{key:"isProcess",value:function(t){return this.processEvent[t]}},{key:"pushEvent",value:function(t,e){for(var n=this.emitThrottles,i={type:t,ev:e},r=0,a=n.length;r<a;r++)if(n[r].type===t)return void n.splice(r,1,i);n.push(i)}},{key:"clearPressTimeout",value:function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}},{key:"reset",value:function(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}},{key:"triggerEvent",value:function(t,e){var n=this;this.pushEvent(t,e);var i=this.throttleTimer,r=this.emitThrottles;i||(this.throttleTimer=Mi.global.getRequestAnimationFrame()((function(){for(var t=0,e=r.length;t<e;t++){var i=r[t],a=i.type,o=i.ev;n.emitEvent(a,o)}n.throttleTimer=0,n.emitThrottles.length=0})))}},{key:"triggerStartEvent",value:function(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent("".concat(t,"start"),e))}},{key:"triggerEndEvent",value:function(t){var e=this,n=this.processEvent;Object.keys(n).forEach((function(i){e.triggerEvent("".concat(i,"end"),t),"press"===i&&e.triggerEvent("".concat(i,"up"),t),delete n[i]}))}},{key:"emitEvent",value:function(t,e){var n=this.element._events["*"];if(n)if("fn"in n)n.fn.call(n.context,e,t);else for(var i=0,r=n.length;i<r&&!e.propagationImmediatelyStopped;i++)n[i].fn.call(n[i].context,e,t);this.emit(t,e)}}])}(dt),Kk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},qk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zk=[0,0,0],Jk=function(){return u((function t(e,n){o(this,t),this.fillAttributes=Object.assign(Object.assign({},oi),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},ui),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},li),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;var i=e.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=e,this.matrix=new pe(1,0,0,1,0,0),this.stack=[],this.dpr=n,this.applyedMatrix=new pe(1,0,0,1,0,0),this._clearMatrix=new pe(1,0,0,1,0,0),this.baseGlobalAlpha=1}),[{key:"fillStyle",get:function(){return this.nativeContext.fillStyle},set:function(t){this.nativeContext.fillStyle=t}},{key:"font",get:function(){return this.nativeContext.font},set:function(t){this.nativeContext.font=t}},{key:"globalAlpha",get:function(){return this.nativeContext.globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}},{key:"lineCap",get:function(){return this.nativeContext.lineCap},set:function(t){this.nativeContext.lineCap=t}},{key:"lineDashOffset",get:function(){return this.nativeContext.lineDashOffset},set:function(t){this.nativeContext.lineDashOffset=t}},{key:"lineJoin",get:function(){return this.nativeContext.lineJoin},set:function(t){this.nativeContext.lineJoin=t}},{key:"lineWidth",get:function(){return this.nativeContext.lineWidth},set:function(t){this.nativeContext.lineWidth=t}},{key:"miterLimit",get:function(){return this.nativeContext.miterLimit},set:function(t){this.nativeContext.miterLimit=t}},{key:"shadowBlur",get:function(){return this.nativeContext.shadowBlur},set:function(t){this.nativeContext.shadowBlur=t}},{key:"shadowColor",get:function(){return this.nativeContext.shadowColor},set:function(t){this.nativeContext.shadowColor=t}},{key:"shadowOffsetX",get:function(){return this.nativeContext.shadowOffsetX},set:function(t){this.nativeContext.shadowOffsetX=t}},{key:"shadowOffsetY",get:function(){return this.nativeContext.shadowOffsetY},set:function(t){this.nativeContext.shadowOffsetY=t}},{key:"strokeStyle",get:function(){return this.nativeContext.strokeStyle},set:function(t){this.nativeContext.strokeStyle=t}},{key:"textAlign",get:function(){return this.nativeContext.textAlign},set:function(t){this.nativeContext.textAlign=t}},{key:"textBaseline",get:function(){return this.nativeContext.textBaseline},set:function(t){this.nativeContext.textBaseline=t}},{key:"inuse",get:function(){return!!this._inuse},set:function(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}},{key:"reset",value:function(){this.stack.length&&Nt.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new pe(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"getContext",value:function(){return this.nativeContext}},{key:"setTransformForCurrent",value:function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}},{key:"currentMatrix",get:function(){return this.matrix}},{key:"cloneMatrix",value:function(t){return Sh.allocateByObj(t)}},{key:"clear",value:function(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}},{key:"restore",value:function(){this.nativeContext.restore(),this.stack.length>0&&(Sh.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}},{key:"highPerformanceRestore",value:function(){this.stack.length>0&&(Sh.free(this.matrix),this.matrix=this.stack.pop())}},{key:"rotate",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}},{key:"save",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}},{key:"highPerformanceSave",value:function(){var t=this.cloneMatrix(this.matrix);this.stack.push(t)}},{key:"scale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),n&&this.setTransformForCurrent()}},{key:"setScale",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),n&&this.setTransformForCurrent()}},{key:"scalePoint",value:function(t,e,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(n,i,!1),this.scale(t,e,!1),this.translate(-n,-i,!1),r&&this.setTransformForCurrent()}},{key:"setTransform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(s*t,s*e,s*n,s*i,s*r,s*a),o&&this.setTransformForCurrent()}},{key:"setTransformFromMatrix",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*n,t.b*n,t.c*n,t.d*n,t.e*n,t.f*n),e&&this.setTransformForCurrent()}},{key:"resetTransform",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}},{key:"transform",value:function(t,e,n,i,r,a){var o=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,n,i,r,a),o&&this.setTransformForCurrent()}},{key:"transformFromMatrix",value:function(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}},{key:"translate",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),n&&this.setTransformForCurrent()}},{key:"rotateDegrees",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t*Math.PI/180;this.rotate(n,e)}},{key:"rotateAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotate(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"rotateDegreesAbout",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,n,!1),this.rotateDegrees(t,!1),this.translate(-e,-n,!1),i&&this.setTransformForCurrent()}},{key:"beginPath",value:function(){this.disableBeginPath||this.nativeContext.beginPath()}},{key:"clip",value:function(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}},{key:"arc",value:function(t,e,n,i,r,a,o){if(o=o||0,this.camera){var s=[];!function(t,e,n,i,r,a,o,s){if(s)for(;n>e;)n-=Kt;else for(;n<e;)n+=Kt;for(var u=Ht/3*(n>e?1:-1),l=e,c=l;c!==n;){c=u>0?Math.min(c+u,n):Math.max(c+u,n);var h=Math.abs(c-l),d=4*Math.tan(h/4)/3,f=c<l?-1:1,v=Math.cos(l),p=Math.sin(l),g=Math.cos(c),y=Math.sin(c),m=v*a+i,k=p*o+r,b=g*a+i,_=y*o+r,x=a*d*f,w=o*d*f;t.push([m-x*p,k+w*v,b+x*y,_-w*g,b,_]),l=c}}(s,i,r,t,e,n,n,a);for(var u=0;u<s.length;++u){var l=s[u];this.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5],o)}}else this.nativeContext.arc(t,e,n,i,r,a)}},{key:"arcTo",value:function(t,e,n,i,r){this.nativeContext.arcTo(t,e,n,i,r)}},{key:"bezierCurveTo",value:function(t,e,n,i,r,a,o){if(o=o||0,this.camera){var s=o,u=o;this.modelMatrix&&(mp(Zk,[t,e,o],this.modelMatrix),t=Zk[0],e=Zk[1],s=Zk[2],mp(Zk,[n,i,o],this.modelMatrix),n=Zk[0],i=Zk[1],u=Zk[2],mp(Zk,[r,a,o],this.modelMatrix),r=Zk[0],a=Zk[1],o=Zk[2]);var l=this.camera.vp(r,a,o);r=l.x,a=l.y,t=(l=this.camera.vp(t,e,s)).x,e=l.y,n=(l=this.camera.vp(n,i,u)).x,i=l.y}this.nativeContext.bezierCurveTo(t,e,n,i,r,a)}},{key:"closePath",value:function(){this.nativeContext.closePath()}},{key:"ellipse",value:function(t,e,n,i,r,a,o,s){null==s?this.nativeContext.ellipse(t,e,n,i,r,a,o):this.nativeContext.ellipse(t,e,n,i,r,a,o,s)}},{key:"lineTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(mp(Zk,[t,e,n],this.modelMatrix),t=Zk[0],e=Zk[1],n=Zk[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.lineTo(t,e)}},{key:"moveTo",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(mp(Zk,[t,e,n],this.modelMatrix),t=Zk[0],e=Zk[1],n=Zk[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}this.nativeContext.moveTo(t,e)}},{key:"quadraticCurveTo",value:function(t,e,n,i,r){if(r=r||0,this.camera){var a=r;this.modelMatrix&&(mp(Zk,[t,e,r],this.modelMatrix),t=Zk[0],e=Zk[1],a=Zk[2],mp(Zk,[n,i,r],this.modelMatrix),n=Zk[0],i=Zk[1],r=Zk[2]);var o=this.camera.vp(n,i,r);n=o.x,i=o.y,t=(o=this.camera.vp(t,e,a)).x,e=o.y}this.nativeContext.quadraticCurveTo(t,e,n,i)}},{key:"rect",value:function(t,e,n,i,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+n,e,r),this.lineTo(t+n,e+i,r),this.lineTo(t,e+i,r),this.closePath()):this.nativeContext.rect(t,e,n,i)}},{key:"createImageData",value:function(){var t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}},{key:"createLinearGradient",value:function(t,e,n,i){return this.nativeContext.createLinearGradient(t,e,n,i)}},{key:"createPattern",value:function(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}},{key:"createRadialGradient",value:function(t,e,n,i,r,a){return this.nativeContext.createRadialGradient(t,e,n,i,r,a)}},{key:"createConicGradient",value:function(t,e,n,i){var r,a=!1,o=this;return{stops:[],addColorStop:function(t,e){this.stops.push([t,e]),a=!0},GetPattern:function(s,u,l){return a&&(l||(l=i-n),r=Ru(o,this.stops,t,e,l,n,i,s,u),a=!1),r}}}},{key:"fill",value:function(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}},{key:"fillRect",value:function(t,e,n,i){this.nativeContext.fillRect(t,e,n,i)}},{key:"clearRect",value:function(t,e,n,i){this.nativeContext.clearRect(t,e,n,i)}},{key:"project",value:function(t,e,n){if(n=n||0,this.camera){this.modelMatrix&&(mp(Zk,[t,e,n],this.modelMatrix),t=Zk[0],e=Zk[1],n=Zk[2]);var i=this.camera.vp(t,e,n);t=i.x,e=i.y}return{x:t,y:e}}},{key:"view",value:function(t,e,n){return n=n||0,this.camera?(this.modelMatrix&&(mp(Zk,[t,e,n],this.modelMatrix),t=Zk[0],e=Zk[1],n=Zk[2]),this.camera.view(t,e,n)):[t,e,n]}},{key:"fillText",value:function(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(mp(Zk,[e,n,i],this.modelMatrix),e=Zk[0],n=Zk[1],i=Zk[2]);var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.fillText(t,e,n)}},{key:"getImageData",value:function(t,e,n,i){return this.nativeContext.getImageData(t,e,n,i)}},{key:"getLineDash",value:function(){return this.nativeContext.getLineDash()}},{key:"isPointInPath",value:function(t,e){return this.nativeContext.isPointInPath(t,e)}},{key:"isPointInStroke",value:function(t,e){return this.nativeContext.isPointInStroke(t,e)}},{key:"measureText",value:function(t){var e,n,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mi.global.measureTextMethod;if(!r||"native"===r)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=Mi.graphicUtil.createTextMeasureInstance({},{},(function(){return i.canvas.nativeCanvas})));var a=null!==(e=this.fontFamily)&&void 0!==e?e:li.fontFamily,o=null!==(n=this.fontSize)&&void 0!==n?n:li.fontSize;return this.mathTextMeasure.textSpec.fontFamily===a&&this.mathTextMeasure.textSpec.fontSize===o||(this.mathTextMeasure.textSpec.fontFamily=a,this.mathTextMeasure.textSpec.fontSize=o,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,r)}},{key:"putImageData",value:function(t,e,n){this.nativeContext.putImageData(t,e,n)}},{key:"setLineDash",value:function(t){var e=arguments,n=this.nativeContext;this.nativeContext.setLineDash?e[0]&&n.setLineDash(e[0]):"mozDash"in n?n.mozDash=e[0]:"webkitLineDash"in n&&(n.webkitLineDash=e[0])}},{key:"stroke",value:function(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}},{key:"strokeRect",value:function(t,e,n,i){this.nativeContext.strokeRect(t,e,n,i)}},{key:"strokeText",value:function(t,e,n,i){if(i=i||0,this.camera){this.modelMatrix&&(mp(Zk,[e,n,i],this.modelMatrix),e=Zk[0],n=Zk[1],i=Zk[2]);var r=this.camera.vp(e,n,i);e=r.x,n=r.y}this.nativeContext.strokeText(t,e,n)}},{key:"drawImage",value:function(){var t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}},{key:"setCommonStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,n,i,r[0]);var a=Object.create(r[0]);return r.forEach((function(t,e){0!==e&&Object.assign(a,t)})),this._setCommonStyle(t,e,n,i,a)}return this._setCommonStyle(t,e,n,i,r)}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.fillAttributes);var o=e.fillOpacity,s=void 0===o?r.fillOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u,c=e.fill,h=void 0===c?r.fill:c;s>1e-12&&l>1e-12?(a.globalAlpha=s*l*this.baseGlobalAlpha,a.fillStyle=Hh(this,h,t,n,i)):a.globalAlpha=s*l*this.baseGlobalAlpha}},{key:"setShadowBlendStyle",value:function(t,e,n){if(Array.isArray(n)){if(n.length<=1)return this._setShadowBlendStyle(t,n[0]);var i=Object.create(n[0]);return n.forEach((function(t,e){0!==e&&Object.assign(i,t)})),this._setShadowBlendStyle(t,e,i)}return this._setShadowBlendStyle(t,e,n)}},{key:"_setShadowBlendStyle",value:function(t,e,n){var i=this.nativeContext;n||(n=this.fillAttributes);var r=e.opacity,a=void 0===r?n.opacity:r,o=e.shadowBlur,s=void 0===o?n.shadowBlur:o,u=e.shadowColor,l=void 0===u?n.shadowColor:u,c=e.shadowOffsetX,h=void 0===c?n.shadowOffsetX:c,d=e.shadowOffsetY,f=void 0===d?n.shadowOffsetY:d,v=e.blur,p=void 0===v?n.blur:v,g=e.globalCompositeOperation,y=void 0===g?n.globalCompositeOperation:g;a<=1e-12||(s||h||f?(i.shadowBlur=s*this.dpr,i.shadowColor=l,i.shadowOffsetX=h*this.dpr,i.shadowOffsetY=f*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(i.shadowBlur=0,i.shadowOffsetX=0,i.shadowOffsetY=0),p?(i.filter="blur(".concat(p,"px)"),this._clearFilterStyle=!0):this._clearFilterStyle&&(i.filter="blur(0px)",this._clearFilterStyle=!1),y?(i.globalCompositeOperation=y,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(i.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}},{key:"setStrokeStyle",value:function(t,e,n,i,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,n,i,r[0]);var a=Object.create(r[0]);return r.forEach((function(t,e){0!==e&&Object.assign(a,t)})),this._setStrokeStyle(t,e,n,i,a)}return this._setStrokeStyle(t,e,n,i,r)}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(s>1e-12&&l>1e-12){var c=e.lineWidth,h=void 0===c?r.lineWidth:c,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,g=e.lineDash,y=void 0===g?r.lineDash:g,m=e.lineCap,k=void 0===m?r.lineCap:m,b=e.miterLimit,_=void 0===b?r.miterLimit:b;a.globalAlpha=s*l*this.baseGlobalAlpha,a.lineWidth=Vh(this,h,this.dpr),a.strokeStyle=Hh(this,f,t,n,i),a.lineJoin=p,y&&a.setLineDash(y),a.lineCap=k,a.miterLimit=_}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e,n){var i=this.nativeContext;e||(e=this.textAttributes);var r=t.scaleIn3d,a=void 0===r?e.scaleIn3d:r;t.font?i.font=t.font:i.font=Hu(t,e,a&&this.camera&&this.camera.getProjectionScale(n));var o=t.fontFamily,s=void 0===o?e.fontFamily:o,u=t.fontSize,l=void 0===u?e.fontSize:u;this.fontFamily=s,this.fontSize=l,i.textAlign="left",i.textBaseline="alphabetic"}},{key:"setTextStyle",value:function(t,e,n){var i,r,a=this.nativeContext;e||(e=this.textAttributes),t.font?a.font=t.font:a.font=Hu(t,e,this.camera&&this.camera.getProjectionScale(n));var o=t.fontFamily,s=void 0===o?e.fontFamily:o,u=t.fontSize,l=void 0===u?e.fontSize:u;this.fontFamily=s,this.fontSize=l,a.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,a.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}},{key:"draw",value:function(){}},{key:"clearMatrix",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}},{key:"setClearMatrix",value:function(t,e,n,i,r,a){this._clearMatrix.setValue(t,e,n,i,r,a)}},{key:"onlyTranslate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}},{key:"release",value:function(){this.stack.forEach((function(t){return Sh.free(t)})),this.stack.length=0}}])}();Jk.env="browser",Jk=Kk([L(),qk("design:paramtypes",[Object,Number])],Jk);var $k=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Qk=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tb=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(t){var e=t.container;if("string"==typeof e){var n=Mi.global.getElementById(e);n&&(this._container=n)}else this._container=e;this._context=new Jk(this,this._dpr),this.initStyle()}},{key:"initStyle",value:function(){if(this.controled){var t=this.nativeCanvas;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}}},{key:"hide",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}},{key:"show",value:function(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}},{key:"applyPosition",value:function(){var t=this._nativeCanvas;t.style.position="absolute",t.style.top="".concat(this._y,"px"),t.style.left="".concat(this._x,"px")}},{key:"resetStyle",value:function(t){if(this.controled){var e=t.width,n=void 0===e?this._displayWidth:e,i=t.height,r=void 0===i?this._displayHeight:i,a=t.dpr,o=void 0===a?this._dpr:a,s=t.x,u=void 0===s?this._x:s,l=t.y,c=void 0===l?this._y:l,h=this.nativeCanvas;h.width=n*o,h.height=r*o,!h.style||this.setCanvasStyle(h,u,c,n,r),t.id&&(h.id=t.id),this.visiable||this.hide()}}},{key:"setCanvasStyle",value:function(t,e,n,i,r){this.controled&&(t.style.width="".concat(i,"px"),t.style.height="".concat(r,"px"))}},{key:"toDataURL",value:function(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}},{key:"resize",value:function(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width="".concat(t,"px"),this._nativeCanvas.style.height="".concat(e,"px")),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}}])}(t.BaseCanvas);function eb(t,e){return new x((function(n){n(Yi).toDynamicValue((function(){return function(e){return new t(e)}})).whenTargetNamed(t.env),n(Xi).toDynamicValue((function(){return function(t,n){return new e(t,n)}})).whenTargetNamed(e.env)}))}tb.env="browser";var nb=eb(tb=$k([L(),Qk("design:paramtypes",[Object])],tb),Jk),ib=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},rb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ab=function(t,e){return function(n,i){e(n,i,t)}},ob=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[r])).contributions=t,a.drawContribution=i,a.pickItemInterceptorContributions=r,a.global.hooks.onSetEnv.tap("canvas-picker-service",(function(t,e,n){a.configure(n,e)})),a.configure(a.global,a.global.env),a.pickerMap=new Map,a.init(),a}return c(n,t),u(n,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),p(h(n.prototype),"_init",this).call(this)}},{key:"configure",value:function(t,e){this.pickCanvas=Sr.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}},{key:"pickItem",value:function(t,e,n,i){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(var r=0;r<this.InterceptorContributions.length;r++){var a=this.InterceptorContributions[r];if(a.beforePickItem){var o=a.beforePickItem(t,this,e,i,{parentMatrix:n});if(o)return o}}var s=this.pickerMap.get(t.numberType);if(!s)return null;var u=s.contains(t,e,i),l=u?t:null,c={graphic:l,params:u};if(l)return c;if(this.InterceptorContributions.length)for(var h=0;h<this.InterceptorContributions.length;h++){var d=this.InterceptorContributions[h];if(d.afterPickItem){var f=d.afterPickItem(t,this,e,i,{parentMatrix:n});if(f)return f}}return c}}])}(t.DefaultPickService);ob=ib([L(),ab(0,O($)),ab(0,D(Lk)),ab(1,O(Hf)),ab(2,O($)),ab(2,D(dv)),rb("design:paramtypes",[Object,Object,Object])],ob);var sb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},ub=function(){return u((function t(){o(this,t),this.type="group",this.numberType=Ns}),[{key:"contains",value:function(t,e,n){return!1}}])}();ub=sb([L()],ub);var lb=new x((function(t,e,n,i){lb.__vloaded||(lb.__vloaded=!0,t(Ik).to(ub).inSingletonScope(),t(Lk).toService(Ik),et(t,Lk))}));lb.__vloaded=!1;var cb=lb,hb=new x((function(t,e,n,i){n(ob)||t(ob).toSelf().inSingletonScope(),n(uv)?i(uv).toService(ob):t(uv).toService(ob)}));function db(t){t.load(cb),t.load(hb)}var fb,vb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},pb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},gb=fb=function(t){function n(){var t;return o(this,n),(t=e(this,n)).type="browser",t._canvasIsIntersecting=!0,t.global=Mi.global,t.viewBox=new de,t.modelMatrix=new pe(1,0,0,1,0,0),t}return c(n,t),u(n,[{key:"container",get:function(){return this.canvas.nativeCanvas.parentElement}},{key:"getTitle",value:function(){return this.canvas.id&&this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return this.canvas.nativeCanvas.getBoundingClientRect()}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}},{key:"postInit",value:function(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}},{key:"isElementVisible",value:function(t){var e=t.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>n||e.top>i)}},{key:"observerCanvas",value:function(){var t=this;this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);var e=new IntersectionObserver((function(e,n){e.forEach((function(e){t._canvasIsIntersecting!==e.isIntersecting?(t._canvasIsIntersecting=e.isIntersecting,t._onVisibleChangeCb&&t._onVisibleChangeCb(e.isIntersecting)):t._canvasIsIntersecting=e.isIntersecting}))}));e&&e.observe(this.canvas.nativeCanvas)}},{key:"createWindowByConfig",value:function(t){var e,n=this.global.createCanvas({width:t.width,height:t.height});if(!(e="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement()))throw new Error("发生错误,containerId可能传入有误");t.offscreen?e=null:e.appendChild(n);var i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:n,container:e,id:fb.GenerateCanvasId(),canvasControled:!0};this.canvas=new tb(i)}},{key:"createWindowByCanvas",value:function(t){var e,n;if("string"==typeof t.canvas){if(!(n=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else n=t.canvas;if(!n)throw new Error("发生错误,传入的canvas不正确");var i=t.width,r=t.height;if(null==i||null==r||!t.canvasControled){var a=n.getBoundingClientRect();i=a.width,r=a.height}var o=t.dpr;null==o&&(o=null!==(e=n.getContext("2d").pixelRatio)&&void 0!==e?e:n.width/i),this.canvas=new tb({width:i,height:r,dpr:o,nativeCanvas:n,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return this.canvas.nativeCanvas.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return this.canvas.nativeCanvas.dispatchEvent(t)}},{key:"getStyle",value:function(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}},{key:"setStyle",value:function(t){this.canvas.nativeCanvas.style=t}},{key:"getBoundingClientRect",value:function(){var t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}},{key:"isVisible",value:function(t){return this._canvasIsIntersecting}},{key:"onVisibleChange",value:function(t){this._onVisibleChangeCb=t}},{key:"getTopLeft",value:function(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}}],[{key:"GenerateCanvasId",value:function(){return"".concat(fb.idprefix,"_").concat(fb.prefix_count++)}}])}(t.BaseWindowHandlerContribution);gb.env="browser",gb.idprefix="visactor_window",gb.prefix_count=0,gb=fb=vb([L(),pb("design:paramtypes",[])],gb);var yb=new x((function(t){t(gb).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(gb)})).whenTargetNamed(gb.env)})),mb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},kb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bb=function(){return u((function t(e){o(this,t),this.dom=e}),[{key:"x1",get:function(){return this.dom.getBoundingClientRect().left}},{key:"x2",get:function(){return this.dom.getBoundingClientRect().right}},{key:"y1",get:function(){return this.dom.getBoundingClientRect().top}},{key:"y2",get:function(){return this.dom.getBoundingClientRect().bottom}},{key:"width",get:function(){return this.dom.getBoundingClientRect().width}},{key:"height",get:function(){return this.dom.getBoundingClientRect().height}}])}();function _b(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=document.createElement("img");if(n.crossOrigin="anonymous",e){var i=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(i)}return n.src=t,n.complete?Promise.resolve(n):new Promise((function(t,e){n.onload=function(){t(n)},n.onerror=function(){e(new Error("加载失败"))}}))}t.BrowserEnvContribution=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="browser",t.supportEvent=!0;try{t.supportsTouchEvents="ontouchstart"in globalThis,t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsTouchEvents=!1,t.supportsPointerEvents=!1,t.supportsPointerEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"mapToCanvasPoint",value:function(t,e){var n,i,r=0,a=0,o=0,s=0;if(t.changedTouches){var u=null!==(n=t.changedTouches[0])&&void 0!==n?n:{};o=r=u.clientX||0,s=a=u.clientY||0}else r=t.clientX||0,a=t.clientY||0,o=t.offsetX||0,s=t.offsetY||0;if(e){var l,c,h=r,d=a,f=e.getBoundingClientRect(),v=null===(i=e.getNativeHandler)||void 0===i?void 0:i.call(e).nativeCanvas;return v&&(l=f.width/v.offsetWidth,c=f.height/v.offsetHeight),{x:(h-f.left)/(Tt(l)?l:1),y:(d-f.top)/(Tt(c)?c:1)}}return{x:o,y:s}}},{key:"getNativeAABBBounds",value:function(t){var e=t;if("string"==typeof t&&((e=(new DOMParser).parseFromString(t,"text/html").firstChild).lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){var n=e.getBoundingClientRect();return new bb(n)}return new de}},{key:"removeDom",value:function(t){return t.parentElement.removeChild(t),!0}},{key:"updateDom",value:function(t,e){var n=e.width,i=e.height,r=e.style;return r&&(xt(r)?t.setAttribute("style",r):Object.keys(r).forEach((function(e){t.style[e]=r[e]}))),null!=n&&(t.style.width="".concat(n,"px")),null!=i&&(t.style.height="".concat(i,"px")),!0}},{key:"createDom",value:function(t){var e=t.tagName,n=void 0===e?"div":e,i=t.parent,r=document.createElement(n);if(this.updateDom(r,t),i){var a=xt(i)?this.getElementById(i):i;a&&a.appendChild&&a.appendChild(r)}return r}},{key:"loadImage",value:function(t){return _b(t,!1).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadSvg",value:function(t){return _b(t,!0).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"createCanvas",value:function(t){var e,n,i=document.createElement("canvas");t.id&&(i.id=null!==(e=t.id)&&void 0!==e?e:_.GenAutoIncrementId().toString());var r=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(i.style.width="".concat(t.width,"px"),i.style.height="".concat(t.height,"px"),i.width=t.width*r,i.height=t.height*r),i}},{key:"createOffscreenCanvas",value:function(t){var e,n=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*n,t.height*n)}},{key:"releaseCanvas",value:function(t){var e;(e="string"==typeof t?document.getElementById(t):t)&&e.parentElement&&e.parentElement.removeChild(e)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getRequestAnimationFrame",value:function(){return window.requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return window.cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return document.addEventListener(t,e,n)}},{key:"removeEventListener",value:function(t,e,n){return document.removeEventListener(t,e,n)}},{key:"dispatchEvent",value:function(t){return document.dispatchEvent(t)}},{key:"getElementById",value:function(t){return document.getElementById(t)}},{key:"getRootElement",value:function(){return document.body}},{key:"getDocument",value:function(){return document}},{key:"release",value:function(){}},{key:"getElementTop",value:function(t,e){for(var n=t.offsetTop,i=t.offsetParent;null!==i;)n+=i.offsetTop,i=i.offsetParent;return n}},{key:"getElementLeft",value:function(t,e){for(var n=t.offsetLeft,i=t.offsetParent;null!==i;)n+=i.offsetLeft,i=i.offsetParent;return n}},{key:"getElementTopLeft",value:function(t,e){for(var n=t.offsetTop,i=t.offsetLeft,r=t.offsetParent;null!==r;)n+=r.offsetTop,i+=r.offsetLeft,r=r.offsetParent;return{top:n,left:i}}}])}(t.BaseEnvContribution),t.BrowserEnvContribution=mb([L(),kb("design:paramtypes",[])],t.BrowserEnvContribution);var xb=new x((function(e){xb.isBrowserBound||(xb.isBrowserBound=!0,e(t.BrowserEnvContribution).toSelf().inSingletonScope(),e(at).toService(t.BrowserEnvContribution))}));function wb(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];wb.__loaded||(wb.__loaded=!0,t.load(xb),t.load(nb),t.load(yb),e&&db(t))}xb.isBrowserBound=!1,wb.__loaded=!1;var Sb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ab=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}},{key:"getImageData",value:function(t,e,n,i){var r=this;return new Promise((function(a,o){var s;try{tt.canvasGetImageData({canvasId:null!==(s=r.canvas.nativeCanvas.id)&&void 0!==s?s:r.canvas.id,x:t,y:e,width:n,height:i,success:function(t){a(t)}})}catch(t){o(t)}}))}},{key:"draw",value:function(){var t=this,e=this.nativeContext;e.draw&&(this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))})))}},{key:"createPattern",value:function(t,e){return null}}])}(Jk);Ab.env="feishu",Ab=Sb([L()],Ab);var Tb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Cb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Eb=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Ab(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);Eb.env="feishu";var Rb=eb(Eb=Tb([L(),Cb("design:paramtypes",[Object])],Eb),Ab),Bb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Mb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Pb=function(t,e){return function(n,i){e(n,i,t)}},Ob=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),Ib=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="feishu",i.eventManager=new Ob,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:_.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Eb(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new Eb({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);Ib.env="feishu",Ib=Bb([L(),Pb(0,O(ot)),Mb("design:paramtypes",[Object])],Ib);var Lb=new x((function(t){t(Ib).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(Ib)})).whenTargetNamed(Ib.env)})),Db=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},jb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fb=function(t,e){return function(n,i){e(n,i,t)}},Nb=function(n){function i(t,n){var r;return o(this,i),(r=e(this,i,[n])).contributions=t,r.pickItemInterceptorContributions=n,r.global.hooks.onSetEnv.tap("math-picker-service",(function(t,e,n){r.configure(n,e)})),r.configure(r.global,r.global.env),r.pickerMap=new Map,r.init(),r}return c(i,n),u(i,[{key:"init",value:function(){var t=this;this.contributions.getContributions().forEach((function(e){t.pickerMap.set(e.numberType,e)})),p(h(i.prototype),"_init",this).call(this)}},{key:"configure",value:function(e,n){this.pickContext=new t.EmptyContext2d(null,1)}},{key:"pickItem",value:function(t,e,n,i){if(!1===t.attribute.pickable)return null;var r=this.pickerMap.get(t.numberType);if(!r)return null;var a=r.contains(t,e,i),o=a?t:null;return o?{graphic:o,params:a}:null}}])}(t.DefaultPickService);Nb=Db([L(),Fb(0,O($)),Fb(0,D(sk)),Fb(1,O($)),Fb(1,D(dv)),jb("design:paramtypes",[Object,Object])],Nb);var Gb=new x((function(t){Gb.__vloaded||(Gb.__vloaded=!0,et(t,sk))}));Gb.__vloaded=!1;var zb=Gb,Ub=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Wb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vb=function(t,e){return function(n,i){e(n,i,t)}},Hb=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=Is}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).arc;i.highPerformanceSave();var a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();Hb=Ub([L(),Vb(0,O(Cf)),Wb("design:paramtypes",[Object])],Hb);var Yb=!1,Xb=new x((function(t,e,n,i){Yb||(Yb=!0,t(uk).to(Hb).inSingletonScope(),t(sk).toService(uk))})),Kb=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},qb=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zb=function(t,e){return function(n,i){e(n,i,t)}},Jb=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Ds}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).area,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t){return!!h||(h=t.isPointInPath(e.x,e.y))})),i.highPerformanceRestore(),h}}])}();Jb=Kb([L(),Zb(0,O(Rf)),qb("design:paramtypes",[Object])],Jb);var $b=!1,Qb=new x((function(t,e,n,i){$b||($b=!0,t(lk).to(Jb).inSingletonScope(),t(sk).toService(lk))})),t_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},e_=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},n_=function(t,e){return function(n,i){e(n,i,t)}},i_=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=js}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).circle,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();i_=t_([L(),n_(0,O(Bf)),e_("design:paramtypes",[Object])],i_);var r_=!1,a_=new x((function(t,e,n,i){r_||(r_=!0,t(ck).to(i_).inSingletonScope(),t(sk).toService(ck))})),o_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},s_=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},u_=function(t,e){return function(n,i){e(n,i,t)}},l_=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=Fs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){r||(r=!!i.pickItem(t,e,null,n))})),r}return!1}}])}();l_=o_([L(),u_(0,O(Uf)),s_("design:paramtypes",[Object])],l_);var c_=!1,h_=new x((function(t,e,n,i){c_||(c_=!0,t(mk).to(l_).inSingletonScope(),t(l_).toService(mk))})),d_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},f_=function(){return u((function t(){o(this,t),this.type="image",this.numberType=Gs}),[{key:"contains",value:function(t,e,n){return!!(null!=n?n:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}])}();f_=d_([L()],f_);var v_=!1,p_=new x((function(t,e,n,i){v_||(v_=!0,t(hk).to(f_).inSingletonScope(),t(f_).toService(hk))})),g_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},y_=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},m_=function(t,e){return function(n,i){e(n,i,t)}},k_=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="line",this.numberType=zs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).line,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();k_=g_([L(),m_(0,O(Of)),y_("design:paramtypes",[Object])],k_);var b_=!1,__=new x((function(t,e,n,i){b_||(b_=!0,t(dk).to(k_).inSingletonScope(),t(sk).toService(dk))})),x_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},w_=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},S_=function(t,e){return function(n,i){e(n,i,t)}},A_=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Ws}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).polygon,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();A_=x_([L(),S_(0,O(Lf)),w_("design:paramtypes",[Object])],A_);var T_=!1,C_=new x((function(t,e,n,i){T_||(T_=!0,t(yk).to(A_).inSingletonScope(),t(sk).toService(yk))})),E_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},R_=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},B_=function(t,e){return function(n,i){e(n,i,t)}},M_=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="path",this.numberType=Us}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).path,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();M_=E_([L(),B_(0,O(If)),R_("design:paramtypes",[Object])],M_);var P_=!1,O_=new x((function(t,e,n,i){P_||(P_=!0,t(fk).to(M_).inSingletonScope(),t(sk).toService(fk))})),I_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},L_=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},D_=function(t,e){return function(n,i){e(n,i,t)}},j_=new de,F_=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=Hs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).rect,a=t.attribute.cornerRadius,o=void 0===a?r.cornerRadius:a,s=t.attribute,u=s.x,l=void 0===u?r.x:u,c=s.y,h=void 0===c?r.y:c;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);l+=f.x,h+=f.y,i.setTransformForCurrent()}else l=0,h=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var v=!0;if(!d||At(o,!0)&&0!==o||wt(o)&&o.some((function(t){return 0!==t})))v=!1,this.canvasRenderer.drawShape(t,i,l,h,{},null,(function(t,n,i){return!!v||(v=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(v)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,v=t.isPointInStroke(e.x,e.y)}));else if(v){var p=t.attribute,g=p.fill,y=void 0===g?r.fill:g,m=p.stroke,k=void 0===m?r.stroke:m,b=p.lineWidth,_=void 0===b?r.lineWidth:b;if(y)v=!0;else if(k){var x=t.AABBBounds;j_.setValue(x.x1,x.y1,x.x2,x.y2),j_.expand(-_/2),v=!j_.containsPoint(e)}}return i.highPerformanceRestore(),v}}])}();F_=I_([L(),D_(0,O(Df)),L_("design:paramtypes",[Object])],F_);var N_=!1,G_=new x((function(t,e,n,i){N_||(N_=!0,t(vk).to(F_).inSingletonScope(),t(sk).toService(vk))})),z_=!1,U_=new x((function(t,e,n,i){z_||(z_=!0,t(hk).to(f_).inSingletonScope(),t(f_).toService(hk))})),W_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},V_=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},H_=function(t,e){return function(n,i){e(n,i,t)}},Y_=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="symbol",this.numberType=Ks}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).symbol,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=a+o,h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();Y_=W_([L(),H_(0,O(Ff)),V_("design:paramtypes",[Object])],Y_);var X_=!1,K_=new x((function(t,e,n,i){X_||(X_=!0,t(pk).to(Y_).inSingletonScope(),t(sk).toService(pk))})),q_=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Z_=function(){return u((function t(){o(this,t),this.type="text",this.numberType=qs}),[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}])}();Z_=q_([L()],Z_);var J_=!1,$_=new x((function(t,e,n,i){J_||(J_=!0,t(gk).to(Z_).inSingletonScope(),t(sk).toService(gk))})),Q_=new x((function(t,e,n,i){n(Nb)||t(Nb).toSelf().inSingletonScope(),n(uv)?i(uv).toService(Nb):t(uv).toService(Nb)}));function tx(t){t.load(zb),t.load(Q_),t.load(Xb),t.load(Qb),t.load(a_),t.load(h_),t.load(p_),t.load(__),t.load(C_),t.load(O_),t.load(G_),t.load(U_),t.load(K_),t.load($_)}var ex=function(){return u((function t(e,n,i,r,a,s){o(this,t),this.nativeCanvas=e,this.ctx=n,this._w=r,this._h=a,this.id=s,e.id=s,this.dpr=i}),[{key:"width",get:function(){return this._w*this.dpr},set:function(t){}},{key:"height",get:function(){return this._h*this.dpr},set:function(t){}},{key:"offsetWidth",get:function(){return this._w},set:function(t){}},{key:"offsetHeight",get:function(){return this._h},set:function(t){}},{key:"getContext",value:function(){return this.ctx}},{key:"getBoundingClientRect",value:function(){return{width:this._w,height:this._h}}}])}(),nx=function(){return u((function t(e,n,i,r,a,s){o(this,t),this.nativeCanvas=e,this.ctx=n,this._w=r,this._h=a,this.id=s,e.id=s,this.dpr=i}),[{key:"width",get:function(){return this._w*this.dpr},set:function(t){this._w=t/this.dpr,this.nativeCanvas.width=t}},{key:"height",get:function(){return this._h*this.dpr},set:function(t){this._h=t/this.dpr,this.nativeCanvas.height=t}},{key:"offsetWidth",get:function(){return this._w},set:function(t){this._w=t,this.nativeCanvas.width=t*this.dpr}},{key:"offsetHeight",get:function(){return this._h},set:function(t){this._h=t,this.nativeCanvas.height=t*this.dpr}},{key:"getContext",value:function(){return this.ctx}},{key:"getBoundingClientRect",value:function(){return{width:this._w,height:this._h}}}])}(),ix=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},rx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var ax=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="feishu",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"getDynamicCanvasCount",value:function(){return this.freeCanvasList.length}},{key:"getStaticCanvasCount",value:function(){return 9999}},{key:"configure",value:function(t,e){var n,i,r,a,o,s,u;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,a=e.freeCanvasIdx,o=this.freeCanvasList,s=e.pixelRatio,u=null!=s?s:tt.getSystemInfoSync().pixelRatio,i.forEach((function(t,e){var i=tt.createCanvasContext(t),s=new ex(i.canvas||{},i,u,n.width,n.height,t);i.canvas=s,r.set(t,s),e>=a&&o.push(s)})))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return tt.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ia.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ia.clear(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}}])}(t.BaseEnvContribution);ax=ix([L(),rx("design:paramtypes",[])],ax);var ox=new x((function(t){ox.isFeishuBound||(ox.isFeishuBound=!0,t(ax).toSelf().inSingletonScope(),t(at).toService(ax))}));function sx(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];sx.__loaded||(sx.__loaded=!0,t.load(ox),t.load(Rb),t.load(Lb),e&&tx(t))}ox.isFeishuBound=!1,sx.__loaded=!1;var ux=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},lx=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}},{key:"setLineDash",value:function(t){var e=arguments,n=this.nativeContext;if(this.nativeContext.setLineDash){var i=e[0];if(0===i[0]&&0===i[1])return;i&&n.setLineDash(i)}}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(s>1e-12&&l>1e-12){var c=e.lineWidth,h=void 0===c?r.lineWidth:c,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,g=e.lineDash,y=void 0===g?r.lineDash:g,m=e.lineCap,k=void 0===m?r.lineCap:m,b=e.miterLimit,_=void 0===b?r.miterLimit:b;a.globalAlpha=s*l*this.baseGlobalAlpha,a.lineWidth=Vh(this,h,this.dpr),a.strokeStyle=Hh(this,f,t,n,i),a.lineJoin=p,0===y[0]&&0===y[1]||y&&a.setLineDash(y),a.lineCap=k,a.miterLimit=_}}},{key:"measureText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mi.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,Mi.global.devicePixelRatio),p(h(n.prototype),"measureText",this).call(this,t,e)}},{key:"createPattern",value:function(t,e){return null}},{key:"draw",value:function(){var t=this,e=this.nativeContext;e.draw&&(this.drawPromise=new Promise((function(n){e.draw(!0,(function(){t.drawPromise=null,n(null)}))})))}}])}(Jk);lx.env="lynx",lx=ux([L()],lx);var cx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},hx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dx=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new lx(this,this._dpr)}},{key:"resize",value:function(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._nativeCanvas.nativeCanvas&&(this._nativeCanvas.nativeCanvas.width=this._pixelWidth,this._nativeCanvas.nativeCanvas.height=this._pixelHeight),this._context.dpr=this._dpr}},{key:"release",value:function(){}}])}(t.BaseCanvas);dx.env="lynx",dx=cx([L(),hx("design:paramtypes",[Object])],dx);var fx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},vx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},px=function(t,e){return function(n,i){e(n,i,t)}},gx=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),yx=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="lynx",i.eventManager=new gx,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id&&this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:_.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new dx(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new dx({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);yx.env="lynx",yx=fx([L(),px(0,O(ot)),vx("design:paramtypes",[Object])],yx);var mx=new x((function(t){t(yx).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(yx)})).whenTargetNamed(yx.env)})),kx=eb(dx,lx),bx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},_x=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xx=!1;try{xx=!!lynx.createCanvasNG}catch(t){}var Sx=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="lynx",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,n,i,r,a,o){var s=null!=o?o:SystemInfo.pixelRatio;if(e.forEach((function(e,o){var u;a?u=lynx.createOffscreenCanvas():(u=xx?lynx.createCanvasNG(e):lynx.createCanvas(e),xx&&u.attachToCanvasView(e)),u.width=t.width*s,u.height=t.height*s;var l=u.getContext("2d"),c=new nx(u,l,s,t.width,t.height,e);n.set(e,c),o>i&&r.push(c)})),!r.length&&lynx.createOffscreenCanvas){var u=lynx.createOffscreenCanvas();u.width=t.width*s,u.height=t.height*s;var l=u.getContext("2d"),c=Math.random().toString(),h=new nx(u,l,s,t.width,t.height,c);n.set(c,h),r.push(h)}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,!!e.offscreen,e.pixelRatio))}},{key:"getDynamicCanvasCount",value:function(){return this.freeCanvasList.length}},{key:"getStaticCanvasCount",value:function(){return 9999}},{key:"loadImage",value:function(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();var e=lynx.createImage(t);return new Promise((function(t,n){e.onload=function(){t(e)},e.onerror=function(){n(new Error("加载失败"))}}))}(t,!1).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return SystemInfo.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ia.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ia.clear(t)}}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}])}(t.BaseEnvContribution);Sx=bx([L(),_x("design:paramtypes",[])],Sx);var Ax=new x((function(t){Ax.isLynxBound||(Ax.isLynxBound=!0,t(Sx).toSelf().inSingletonScope(),t(at).toService(Sx))}));function Tx(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Tx.__loaded||(Tx.__loaded=!0,t.load(Ax),t.load(kx),t.load(mx),e&&tx(t))}Ax.isLynxBound=!1,Tx.__loaded=!1;var Cx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ex=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rx=function(t){function n(t,i){var r;o(this,n),r=e(this,n,[t,i]);var a=t.nativeCanvas.getContext("2d");if(!a)throw new Error("发生错误,获取2d上下文失败");return r.nativeContext=a,r.canvas=t,r.matrix=new pe(1,0,0,1,0,0),r.stack=[],r.dpr=null!=i?i:1,r}return c(n,t),u(n,[{key:"release",value:function(){}}])}(Jk);Rx.env="node",Rx=Cx([L(),Ex("design:paramtypes",[Object,Number])],Rx);var Bx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Mx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Px=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Rx(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}},{key:"release",value:function(){this._nativeCanvas.release&&pt(this._nativeCanvas.release)&&this._nativeCanvas.release()}}])}(t.BaseCanvas);Px.env="node";var Ox=eb(Px=Bx([L(),Mx("design:paramtypes",[Object])],Px),Rx),Ix=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Lx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Dx=function(t,e){return function(n,i){e(n,i,t)}},jx=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="node",i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return""}},{key:"getWH",value:function(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:_.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Px(n)}},{key:"createWindowByCanvas",value:function(t){var e=t.canvas,n=t.width,i=t.height;null!=n&&null!=i&&t.canvasControled||(n=e.width,i=e.height),this.canvas=new Px({width:n,height:i,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){this.canvas.release()}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"getImageBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}},{key:"addEventListener",value:function(t,e,n){}},{key:"dispatchEvent",value:function(t){return!0}},{key:"removeEventListener",value:function(t,e,n){}},{key:"getStyle",value:function(){}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){return null}},{key:"clearViewBox",value:function(t){}}])}(t.BaseWindowHandlerContribution);jx.env="node",jx=Ix([L(),Dx(0,O(ot)),Lx("design:paramtypes",[Object])],jx);var Fx=new x((function(t){t(jx).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(jx)})).whenTargetNamed(jx.env)})),Nx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Gx=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type="node",t._lastTime=0,t.supportEvent=!1,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}},{key:"getDynamicCanvasCount",value:function(){return 0}},{key:"getStaticCanvasCount",value:function(){return 999}},{key:"loadJson",value:function(t){var e=fetch(t).then((function(t){return t.json()}));return e.then((function(t){return{data:t,state:"success"}})).catch((function(){return{data:null,state:"fail"}})),e}},{key:"loadArrayBuffer",value:function(t){return fetch(t).then((function(t){return t.arrayBuffer()})).then((function(t){return{data:t,loadState:"success"}})).catch((function(){return{data:null,loadState:"fail"}}))}},{key:"loadImage",value:function(t){var e=this.pkg.loadImage;return e?e(t).then((function(t){return{loadState:t?"success":"fail",data:t}})).catch((function(){return{loadState:"fail",data:null}})):Promise.reject(new Error("node-canvas loadImage could not be found!"))}},{key:"loadSvg",value:function(t){var e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));var n=new e(t).render().asPng();return this.loadImage(n)}},{key:"createCanvas",value:function(t){return this.pkg.createCanvas(t.width,t.height)}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ia.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ia.clear(t)}}},{key:"addEventListener",value:function(t,e,n){}},{key:"removeEventListener",value:function(t,e,n){}},{key:"getElementById",value:function(t){return null}},{key:"getRootElement",value:function(){return null}},{key:"dispatchEvent",value:function(t){}},{key:"release",value:function(){}},{key:"createOffscreenCanvas",value:function(t){}}])}(t.BaseEnvContribution);Gx=Nx([L()],Gx);var zx=new x((function(t){zx.isNodeBound||(zx.isNodeBound=!0,t(Gx).toSelf().inSingletonScope(),t(at).toService(Gx))}));function Ux(t){Ux.__loaded||(Ux.__loaded=!0,t.load(zx),t.load(Ox),t.load(Fx))}zx.isNodeBound=!1,Ux.__loaded=!1;var Wx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Vx=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}},{key:"draw",value:function(){this.nativeContext.draw()}},{key:"strokeText",value:function(t,e,n){}},{key:"_setCommonStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.fillAttributes);var o=e.fillOpacity,s=void 0===o?r.fillOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u,c=e.fill,h=void 0===c?r.fill:c;s>1e-12&&l>1e-12&&(a.setGlobalAlpha(s*l),a.setFillStyle(Hh(this,h,t,n,i)))}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(s>1e-12&&l>1e-12){var c=e.lineWidth,h=void 0===c?r.lineWidth:c,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,g=e.lineDash,y=void 0===g?r.lineDash:g,m=e.lineCap,k=void 0===m?r.lineCap:m,b=e.miterLimit,_=void 0===b?r.miterLimit:b;a.setGlobalAlpha(s*l),a.setLineWidth(Vh(this,h,this.dpr)),a.setStrokeStyle(Hh(this,f,t,n,i)),a.setLineJoin(p),y&&a.setLineDash(y),a.setLineCap(k),a.setMiterLimit(_)}}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e){var n,i=this.nativeContext;e||(e=this.textAttributes),t.font?i.font=t.font:i.font=Hu(t,e),i.setFontSize(null!==(n=t.fontSize)&&void 0!==n?n:e.fontSize)}},{key:"setTextStyle",value:function(t,e){var n,i,r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Hu(t,e),r.setTextAlign(null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign),r.setTextBaseline(null!==(i=t.textBaseline)&&void 0!==i?i:e.textBaseline)}},{key:"createConicGradient",value:function(t,e,n,i){return null}},{key:"createPattern",value:function(t,e){return null}},{key:"getImageData",value:function(t,e,n,i){var r=this,a=this.nativeContext,o=a.taro;if(a&&o)return!a.getImageData&&o.canvasGetImageData?new Promise((function(a,s){try{o.canvasGetImageData({canvasId:r.canvas.nativeCanvas.id,sx:t,sy:e,sw:n,sh:i,success:function(t){a(t)}})}catch(t){s(t)}})):void 0}},{key:"createRadialGradient",value:function(t,e,n,i,r,a){return this.nativeContext.createCircularGradient&&this.nativeContext.createCircularGradient(t,e,n,i,r,a)}}])}(Jk);Vx.env="taro",Vx=Wx([L()],Vx);var Hx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Yx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xx=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Vx(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);Xx.env="taro";var Kx=eb(Xx=Hx([L(),Yx("design:paramtypes",[Object])],Xx),Vx),qx=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Zx=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jx=function(t,e){return function(n,i){e(n,i,t)}},$x=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),Qx=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="taro",i.eventManager=new $x,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:_.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Xx(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new Xx({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach((function(e,n){t.changedTouches[n]=Object.assign(Object.assign({},t.changedTouches[n]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach((function(e,n){t.touches[n]=Object.assign(Object.assign({},t.touches[n]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);Qx.env="taro",Qx=qx([L(),Jx(0,O(ot)),Zx("design:paramtypes",[Object])],Qx);var tw=new x((function(t){t(Qx).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(Qx)})).whenTargetNamed(Qx.env)})),ew=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},nw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var iw=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="taro",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"getDynamicCanvasCount",value:function(){return this.freeCanvasList.length}},{key:"getStaticCanvasCount",value:function(){return 9999}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}},{key:"configure",value:function(t,e){var n,i,r,a,o,s,u;t.env===this.type&&(t.setActiveEnvContribution(this),n=e.domref,i=e.canvasIdLists,r=this.canvasMap,a=e.freeCanvasIdx,o=this.freeCanvasList,s=e.taro,u=e.pixelRatio,i.forEach((function(t,e){var i=s.createCanvasContext(t),l=new ex(i.canvas||{},i,u,n.width,n.height,t);return i.canvas=l,r.set(t,l),e>=a&&o.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio)}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){var e=window||globalThis;if(e.DOMParser){var n=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],i=(new XMLSerializer).serializeToString(n),r="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(i));return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){var a=new e.Blob([t],{type:"image/svg+xml"}),o=e.URL.createObjectURL(a);return Promise.resolve({data:o,loadState:"success"})}return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return this.pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return requestAnimationFrame}},{key:"getCancelAnimationFrame",value:function(){return cancelAnimationFrame}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}])}(t.BaseEnvContribution);iw=ew([L(),nw("design:paramtypes",[])],iw);var rw=new x((function(t){rw.isTaroBound||(rw.isTaroBound=!0,t(iw).toSelf().inSingletonScope(),t(at).toService(iw))}));function aw(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];aw.__loaded||(aw.__loaded=!0,t.load(rw),t.load(Kx),t.load(tw),e&&tx(t))}rw.isTaroBound=!1,aw.__loaded=!1;var ow=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},sw=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"draw",value:function(){}},{key:"createPattern",value:function(t,e){return null}}])}(Jk);sw.env="wx",sw=ow([L()],sw);var uw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},lw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},cw=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new sw(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);cw.env="wx";var hw=eb(cw=uw([L(),lw("design:paramtypes",[Object])],cw),sw),dw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},fw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},vw=function(t,e){return function(n,i){e(n,i,t)}},pw=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),gw=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="wx",i.eventManager=new pw,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:_.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new cw(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new cw({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e,n,i,r,a=t.type;return!!this.eventManager.cache[a]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(n=t.changedTouches[0].x)&&void 0!==n?n:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(i=t.changedTouches[0].y)&&void 0!==i?i:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[a].listener&&this.eventManager.cache[a].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);gw.env="wx",gw=dw([L(),vw(0,O(ot)),fw("design:paramtypes",[Object])],gw);var yw=new x((function(t){t(gw).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(gw)})).whenTargetNamed(gw.env)})),mw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},kw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};var _w=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="wx",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,n,r,a,o){return bw(this,void 0,void 0,i().mark((function t(){var s,u,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=wx.getSystemInfoSync().pixelRatio,u=i().mark((function t(u){var l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l=e[u],t.next=3,new Promise((function(t){var e=wx.createSelectorQuery();o&&(e=e.in(o)),e.select("#".concat(l)).fields({node:!0,size:!0}).exec((function(e){if(e[0]){var i=e[0].node,o=e[0].width,c=e[0].height;i.width=o*s,i.height=c*s,n.set(l,i),u>=r&&a.push(i),t(null)}}))}));case 3:case"end":return t.stop()}}),t)})),l=0;case 3:if(!(l<e.length)){t.next=8;break}return t.delegateYield(u(l),"t0",5);case 5:l++,t.next=3;break;case 8:case"end":return t.stop()}}),t)})))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((function(){}))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return wx.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ia.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ia.clear(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}}])}(t.BaseEnvContribution);_w=mw([L(),kw("design:paramtypes",[])],_w);var xw=new x((function(t){xw._isWxBound||(xw._isWxBound=!0,t(_w).toSelf().inSingletonScope(),t(at).toService(_w))}));function ww(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];ww.__loaded||(ww.__loaded=!0,t.load(xw),t.load(hw),t.load(yw),e&&tx(t))}function Sw(t){Aw(t)}function Aw(t){Aw.__loaded||(Aw.__loaded=!0,wb(t,!1),sx(t,!1),Tx(t,!1),Ux(t),aw(t,!1),ww(t,!1),db(t),tp.hooks.onSetEnv.tap("loadMathPicker",(function(e,n){"browser"!==n&&tx(t)})))}xw._isWxBound=!1,ww.__loaded=!1,Aw.__loaded=!1;var Tw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Cw=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(Ab);Cw.env="tt",Cw=Tw([L()],Cw);var Ew=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Rw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bw=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Cw(this,this._dpr)}},{key:"release",value:function(){}}])}(t.BaseCanvas);Bw.env="tt";var Mw=eb(Bw=Ew([L(),Rw("design:paramtypes",[Object])],Bw),Cw),Pw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Ow=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Iw=function(t,e){return function(n,i){e(n,i,t)}},Lw=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),Dw=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="tt",i.eventManager=new Lw,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:_.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Bw(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}var a=t.dpr;null==a&&(a=e.width/n),this.canvas=new Bw({width:n,height:i,dpr:a,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);Dw.env="tt",Dw=Pw([L(),Iw(0,O(ot)),Ow("design:paramtypes",[Object])],Dw);var jw=new x((function(t){t(Dw).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(Dw)})).whenTargetNamed(Dw.env)})),Fw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Nw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};var zw=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="tt",t.supportEvent=!0,t.canvasMap=new Map,t.freeCanvasList=[],t.canvasIdx=0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t}return c(n,t),u(n,[{key:"configure",value:function(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,n,r,a,o){return Gw(this,void 0,void 0,i().mark((function t(){var s,u,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:s=tt.getSystemInfoSync().pixelRatio,u=i().mark((function t(u){var l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l=e[u],t.next=3,new Promise((function(t){var e=tt.createSelectorQuery();o&&(e=e.in(o)),e.select("#".concat(l)).node().exec((function(e){var i=e[0].node,o=i.width,c=i.height;i.width=o*s,i.height=c*s,n.set(l,i),u>=r&&a.push(i),t(null)}))}));case 3:case"end":return t.stop()}}),t)})),l=0;case 3:if(!(l<e.length)){t.next=8;break}return t.delegateYield(u(l),"t0",5);case 5:l++,t.next=3;break;case 8:case"end":return t.stop()}}),t)})))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((function(){}))}},{key:"loadImage",value:function(t){return Promise.resolve({data:t,loadState:"success"})}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){var e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return tt.getSystemInfoSync().pixelRatio}},{key:"getRequestAnimationFrame",value:function(){return function(t){return Ia.call(t)}}},{key:"getCancelAnimationFrame",value:function(){return function(t){Ia.clear(t)}}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return this.canvasMap.get(t)}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}}])}(t.BaseEnvContribution);zw=Fw([L(),Nw("design:paramtypes",[])],zw);var Uw=new x((function(t){Uw.isTTBound||(Uw.isTTBound=!0,t(zw).toSelf().inSingletonScope(),t(at).toService(zw))}));function Ww(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Ww.__loaded||(Ww.__loaded=!0,t.load(Uw),t.load(Mw),t.load(jw),e&&tx(t))}Uw.isTTBound=!1,Ww.__loaded=!1;var Vw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Hw=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"globalAlpha",get:function(){return this._globalAlpha},set:function(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}},{key:"setLineDash",value:function(t){var e=arguments,n=this.nativeContext;if(this.nativeContext.setLineDash){var i=e[0];if(0===i[0]&&0===i[1])return;i&&n.setLineDash(i)}}},{key:"_setStrokeStyle",value:function(t,e,n,i,r){var a=this.nativeContext;r||(r=this.strokeAttributes);var o=e.strokeOpacity,s=void 0===o?r.strokeOpacity:o,u=e.opacity,l=void 0===u?r.opacity:u;if(s>1e-12&&l>1e-12){var c=e.lineWidth,h=void 0===c?r.lineWidth:c,d=e.stroke,f=void 0===d?r.stroke:d,v=e.lineJoin,p=void 0===v?r.lineJoin:v,g=e.lineDash,y=void 0===g?r.lineDash:g,m=e.lineCap,k=void 0===m?r.lineCap:m,b=e.miterLimit,_=void 0===b?r.miterLimit:b;a.globalAlpha=s*l*this.baseGlobalAlpha,a.lineWidth=Vh(this,h,this.dpr),a.strokeStyle=Hh(this,f,t,n,i),a.lineJoin=p,0===y[0]&&0===y[1]||y&&a.setLineDash(y),a.lineCap=k,a.miterLimit=_}}},{key:"measureText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mi.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,Mi.global.devicePixelRatio),p(h(n.prototype),"measureText",this).call(this,t,e)}},{key:"setTextStyleWithoutAlignBaseline",value:function(t,e,n){var i=this.nativeContext;e||(e=this.textAttributes);var r,a=t.scaleIn3d,o=void 0===a?e.scaleIn3d:a;r=t.font?t.font:Hu(t,e,o&&this.camera&&this.camera.getProjectionScale(n)),i.font=(r||"").replace("px","vp");var s=t.fontFamily,u=void 0===s?e.fontFamily:s,l=t.fontSize,c=void 0===l?e.fontSize:l;this.fontFamily=u,this.fontSize=c,i.textAlign="left",i.textBaseline="alphabetic"}},{key:"setTextStyle",value:function(t,e,n){var i,r,a=this.nativeContext;e||(e=this.textAttributes);var o;o=t.font?t.font:Hu(t,e,this.camera&&this.camera.getProjectionScale(n)),a.font=(o||"").replace("px","vp");var s=t.fontFamily,u=void 0===s?e.fontFamily:s,l=t.fontSize,c=void 0===l?e.fontSize:l;this.fontFamily=u,this.fontSize=c,a.textAlign=null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign,a.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}},{key:"createPattern",value:function(t,e){return null}},{key:"drawImage",value:function(){var t=this.nativeContext,e=arguments;e[0].drawImage&&(e[0]=e[0].transferToImageBitmap()),3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}},{key:"draw",value:function(){}}])}(Jk);Hw.env="harmony",Hw=Vw([L()],Hw);var Yw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Xw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kw=function(t){function n(t){return o(this,n),e(this,n,[t])}return c(n,t),u(n,[{key:"init",value:function(){this._context=new Hw(this,this._dpr)}},{key:"resize",value:function(t,e){}},{key:"release",value:function(){}}])}(t.BaseCanvas);Kw.env="harmony",Kw=Yw([L(),Xw("design:paramtypes",[Object])],Kw);var qw=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},Zw=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jw=function(t,e){return function(n,i){e(n,i,t)}},$w=function(){return u((function t(){o(this,t),this.cache={}}),[{key:"addEventListener",value:function(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}},{key:"removeEventListener",value:function(t,e){if(t&&e&&this.cache[t]){var n=this.cache[t].listener.findIndex((function(t){return t===e}));n>=0&&this.cache[t].listener.splice(n,1)}}},{key:"cleanEvent",value:function(){this.cache={}}}])}(),Qw=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).global=t,i.type="harmony",i.eventManager=new $w,i}return c(n,t),u(n,[{key:"container",get:function(){return null}},{key:"getTitle",value:function(){return this.canvas.id&&this.canvas.id.toString()}},{key:"getWH",value:function(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}},{key:"getXY",value:function(){return{x:0,y:0}}},{key:"createWindow",value:function(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}},{key:"createWindowByConfig",value:function(t){var e=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:_.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Kw(n)}},{key:"createWindowByCanvas",value:function(t){var e;if("string"==typeof t.canvas){if(!(e=this.global.getElementById(t.canvas)))throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;var n=t.width,i=t.height;if(null==n||null==i||!t.canvasControled){var r=e.getBoundingClientRect();n=r.width,i=r.height}this.canvas=new Kw({width:n,height:i,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}},{key:"releaseWindow",value:function(){}},{key:"resizeWindow",value:function(t,e){this.canvas.resize(t,e)}},{key:"setDpr",value:function(t){this.canvas.dpr=t}},{key:"getContext",value:function(){return this.canvas.getContext()}},{key:"getNativeHandler",value:function(){return this.canvas}},{key:"getDpr",value:function(){return this.canvas.dpr}},{key:"addEventListener",value:function(t,e){this.eventManager.addEventListener(t,e)}},{key:"removeEventListener",value:function(t,e){this.eventManager.removeEventListener(t,e)}},{key:"dispatchEvent",value:function(t){var e=t.type;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=function(){},t.stopPropagation=function(){},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((function(e){e(t)})),!0)}},{key:"getStyle",value:function(){return{}}},{key:"setStyle",value:function(t){}},{key:"getBoundingClientRect",value:function(){var t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}},{key:"clearViewBox",value:function(t){var e=this.viewBox,n=this.getContext(),i=this.getDpr();n.nativeContext.save(),n.nativeContext.setTransform(i,0,0,i,0,0),n.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(n.fillStyle=t,n.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),n.nativeContext.restore()}}])}(t.BaseWindowHandlerContribution);Qw.env="harmony",Qw=qw([L(),Jw(0,O(ot)),Zw("design:paramtypes",[Object])],Qw);var tS=new x((function(t){t(Qw).toSelf(),t(Er).toDynamicValue((function(t){return t.container.get(Qw)})).whenTargetNamed(Qw.env)})),eS=eb(Kw,Hw),nS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},iS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};var rS=function(t){function n(){var t;o(this,n),(t=e(this,n)).type="harmony",t.supportEvent=!0,t.supportsTouchEvents=!0;try{t.supportsPointerEvents=!!globalThis.PointerEvent,t.supportsMouseEvents=!!globalThis.MouseEvent}catch(e){t.supportsPointerEvents=!1,t.supportsMouseEvents=!1}return t.applyStyles=!0,t.rafSTO=new Pa(0),t}return c(n,t),u(n,[{key:"configure",value:function(t,e){t.env===this.type&&t.setActiveEnvContribution(this)}},{key:"getDynamicCanvasCount",value:function(){return 9999}},{key:"getStaticCanvasCount",value:function(){return 9999}},{key:"loadImage",value:function(t){}},{key:"loadSvg",value:function(t){return Promise.reject()}},{key:"createCanvas",value:function(t){return e=t.width,n=t.height,i=t.id,r=new OffscreenCanvas(e,n),a=r.getContext("2d"),new ex({width:e,height:n,context:a,_c:r,getBoundingClientRect:function(){return{width:e,height:n}},getContext:function(){return a}},a,1,e,n,i);var e,n,i,r,a}},{key:"createOffscreenCanvas",value:function(t){}},{key:"releaseCanvas",value:function(t){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getRequestAnimationFrame",value:function(){var t=this;return function(e){return t.rafSTO.call(e)}}},{key:"getCancelAnimationFrame",value:function(){var t=this;return function(e){t.rafSTO.clear(e)}}},{key:"mapToCanvasPoint",value:function(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}},{key:"addEventListener",value:function(t,e,n){return null}},{key:"removeEventListener",value:function(t,e,n){return null}},{key:"dispatchEvent",value:function(t){return null}},{key:"getElementById",value:function(t){return null}},{key:"getRootElement",value:function(){return null}},{key:"getDocument",value:function(){return null}},{key:"release",value:function(){}}])}(t.BaseEnvContribution);rS=nS([L(),iS("design:paramtypes",[])],rS);var aS=new x((function(t){aS.isHarmonyBound||(aS.isHarmonyBound=!0,t(rS).toSelf().inSingletonScope(),t(at).toService(rS))}));function oS(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];oS.__loaded||(oS.__loaded=!0,t.load(aS),t.load(eS),t.load(tS),e&&tx(t))}aS.isHarmonyBound=!1,oS.__loaded=!1;var sS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},uS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lS=function(t,e){return function(n,i){e(n,i,t)}},cS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="arc",this.numberType=Is}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).arc;i.highPerformanceSave();var a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Vh(i,a+o,i.dpr),h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();cS=sS([L(),lS(0,O(Cf)),uS("design:paramtypes",[Object])],cS);var hS=!1,dS=new x((function(t,e,n,i){hS||(hS=!0,t(kk).to(cS).inSingletonScope(),t(Lk).toService(kk))})),fS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},vS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pS=function(t,e){return function(n,i){e(n,i,t)}},gS=new de,yS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="rect",this.numberType=Hs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).rect,a=t.attribute.cornerRadius,o=void 0===a?r.cornerRadius:a,s=t.attribute,u=s.x,l=void 0===u?r.x:u,c=s.y,h=void 0===c?r.y:c;i.highPerformanceSave();var d=!0;if(t.transMatrix.onlyTranslate()){var f=t.getOffsetXY(r);l+=f.x,h+=f.y,i.setTransformForCurrent()}else l=0,h=0,d=!1,i.transformFromMatrix(t.transMatrix,!0);var v=!0;if(!d||t.shadowRoot||At(o,!0)&&0!==o||wt(o)&&o.some((function(t){return 0!==t})))v=!1,this.canvasRenderer.drawShape(t,i,l,h,{},null,(function(t,n,i){return!!v||(v=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(v)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Vh(i,a+o,i.dpr),v=t.isPointInStroke(e.x,e.y)}));else{var p=t.attribute,g=p.fill,y=void 0===g?r.fill:g,m=p.stroke,k=void 0===m?r.stroke:m,b=p.lineWidth,_=void 0===b?r.lineWidth:b;if(y)v=!0;else if(k){var x=t.AABBBounds;gS.setValue(x.x1,x.y1,x.x2,x.y2),gS.expand(-_/2),v=!gS.containsPoint(e)}}return i.highPerformanceRestore(),v}}])}();yS=fS([L(),pS(0,O(Df)),vS("design:paramtypes",[Object])],yS);var mS=!1,kS=new x((function(t,e,n,i){mS||(mS=!0,t(Tk).to(yS).inSingletonScope(),t(Lk).toService(Tk))})),bS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},_S=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n)}(zh),xS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},wS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},SS=function(t,e){return function(n,i){e(n,i,t)}},AS=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="line",i.numberType=zs,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;i.highPerformanceSave();var r=zr(t).line,a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,{},null,(function(t){return!!d||(d=t.isPointInPath(c.x,c.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth,a=e.pickStrokeBuffer||n.pickStrokeBuffer;return i.lineWidth=Vh(i,r+a,i.dpr),d=t.isPointInStroke(c.x,c.y)})),this.canvasRenderer.z=0,i.modelMatrix!==l&&Ah.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(_S=bS([L()],_S));AS=xS([L(),SS(0,O(Of)),wS("design:paramtypes",[Object])],AS);var TS=!1,CS=new x((function(t,e,n,i){TS||(TS=!0,t(Sk).to(AS).inSingletonScope(),t(Lk).toService(Sk))})),ES=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},RS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},BS=function(t,e){return function(n,i){e(n,i,t)}},MS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="area",this.numberType=Ds}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).area,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u,c=t.attribute,h=c.fillPickable,d=void 0===h?r.fillPickable:h,f=c.strokePickable,v=void 0===f?r.strokePickable:f;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var p=t.getOffsetXY(r);s+=p.x,l+=p.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var g=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t){return!!g||!!d&&(g=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(g)return!0;if(!v)return!1;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Vh(i,a+o,i.dpr),g=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),g}}])}();MS=ES([L(),BS(0,O(Rf)),RS("design:paramtypes",[Object])],MS);var PS=!1,OS=new x((function(t,e,n,i){PS||(PS=!0,t(_k).to(MS).inSingletonScope(),t(Lk).toService(_k))})),IS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},LS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},DS=function(t,e){return function(n,i){e(n,i,t)}},jS=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="symbol",i.numberType=Ks,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=t.getParsedPath();if(!i.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}i.highPerformanceSave();var a=zr(t).symbol,o=this.transform(t,a,i),s=o.x,u=o.y,l=o.z,c=o.lastModelMatrix,h=e;if(i.camera){h=e.clone();var d=t.parent.globalTransMatrix;h.x=d.a*e.x+d.c*e.y+d.e,h.y=d.b*e.x+d.d*e.y+d.f}this.canvasRenderer.z=l;var f=!1;return this.canvasRenderer.drawShape(t,i,s,u,{},null,(function(t,e,n){return!!f||(f=t.isPointInPath(h.x,h.y))}),(function(t,e,n){if(f)return!0;var r=e.lineWidth||n.lineWidth,a=e.pickStrokeBuffer||n.pickStrokeBuffer;return i.lineWidth=Vh(i,r+a,i.dpr),f=t.isPointInStroke(h.x,h.y)})),this.canvasRenderer.z=0,i.modelMatrix!==c&&Ah.free(i.modelMatrix),i.modelMatrix=c,i.highPerformanceRestore(),f}}])}(_S);jS=IS([L(),DS(0,O(Ff)),LS("design:paramtypes",[Object])],jS);var FS=!1,NS=new x((function(t,e,n,i){FS||(FS=!0,t(Ek).to(jS).inSingletonScope(),t(Lk).toService(Ek))})),GS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},zS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},US=function(t,e){return function(n,i){e(n,i,t)}},WS=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="circle",this.numberType=js}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).circle,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Vh(i,a+o,i.dpr),h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();WS=GS([L(),US(0,O(Bf)),zS("design:paramtypes",[Object])],WS);var VS=!1,HS=new x((function(t,e,n,i){VS||(VS=!0,t(xk).to(WS).inSingletonScope(),t(Lk).toService(xk))})),YS=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},XS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},KS=function(t,e){return function(n,i){e(n,i,t)}},qS=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="text",i.numberType=qs,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=t.AABBBounds;if(!i.camera)return!!r.containsPoint(e);i.highPerformanceSave();var a=zr(t).text,o=t.attribute.keepDirIn3d,s=!(void 0===o?a.keepDirIn3d:o),u=this.transform(t,a,i,s),l=u.x,c=u.y,h=u.z,d=u.lastModelMatrix;this.canvasRenderer.z=h;var f=e;if(i.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,i,l,c,{},null,(function(e,n,i){if(p)return!0;var r=t.attribute,o=r.fontSize,s=void 0===o?a.fontSize:o,u=r.textBaseline,d=void 0===u?a.textBaseline:u,v=r.textAlign,g=void 0===v?a.textAlign:v,y=t.AABBBounds,m=y.height(),k=y.width(),b=Ku(d,m,s),_=Xu(g,k);return e.rect(_+l,b+c,k,m,h),p=e.isPointInPath(f.x,f.y)}),(function(t,e,n){return p})),this.canvasRenderer.z=0,i.modelMatrix!==d&&Ah.free(i.modelMatrix),i.modelMatrix=d,i.highPerformanceRestore(),p}}])}(_S);qS=YS([L(),KS(0,O(Nf)),XS("design:paramtypes",[Object])],qS);var ZS=!1,JS=new x((function(t,e,n,i){ZS||(ZS=!0,t(Rk).to(qS).inSingletonScope(),t(Lk).toService(Rk))})),$S=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},QS=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tA=function(t,e){return function(n,i){e(n,i,t)}},eA=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="path",i.numberType=Us,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).path;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))}),(function(t,e,n){if(d)return!0;var r=e.lineWidth||n.lineWidth,a=e.pickStrokeBuffer||n.pickStrokeBuffer;return i.lineWidth=Vh(i,r+a,i.dpr),d=t.isPointInStroke(c.x,c.y)})),this.canvasRenderer.z=0,i.modelMatrix!==l&&Ah.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(_S);eA=$S([L(),tA(0,O(If)),QS("design:paramtypes",[Object])],eA);var nA=!1,iA=new x((function(t,e,n,i){nA||(nA=!0,t(Ak).to(eA).inSingletonScope(),t(Lk).toService(Ak))})),rA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},aA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oA=function(t,e){return function(n,i){e(n,i,t)}},sA=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="polygon",this.numberType=Ws}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.contains(e.x,e.y))return!1;if("imprecise"===t.attribute.pickMode)return!0;var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).polygon,a=t.attribute,o=a.x,s=void 0===o?r.x:o,u=a.y,l=void 0===u?r.y:u;if(i.highPerformanceSave(),t.transMatrix.onlyTranslate()){var c=t.getOffsetXY(r);s+=c.x,l+=c.y,i.setTransformForCurrent()}else s=0,l=0,i.transformFromMatrix(t.transMatrix,!0);var h=!1;return this.canvasRenderer.drawShape(t,i,s,l,{},null,(function(t,n,i){return!!h||(h=t.isPointInPath(e.x,e.y))}),(function(t,n,r){if(h)return!0;var a=n.lineWidth||r.lineWidth,o=n.pickStrokeBuffer||r.pickStrokeBuffer;return i.lineWidth=Vh(i,a+o,i.dpr),h=t.isPointInStroke(e.x,e.y)})),i.highPerformanceRestore(),h}}])}();sA=rA([L(),oA(0,O(Lf)),aA("design:paramtypes",[Object])],sA);var uA=!1,lA=new x((function(t,e,n,i){uA||(uA=!0,t(Bk).to(sA).inSingletonScope(),t(Lk).toService(Bk))})),cA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},hA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dA=function(t,e){return function(n,i){e(n,i,t)}},fA=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="glyph",this.numberType=Fs}),[{key:"contains",value:function(t,e,n){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!(null!=n?n:{}).pickContext)return!1;var i=null==n?void 0:n.pickerService;if(i){var r=!1;return t.getSubGraphic().forEach((function(t){if(!r){var a=i.pickItem(t,e,null,n);r=!(!a||!a.graphic)}})),r}return!1}}])}();fA=cA([L(),dA(0,O(Uf)),hA("design:paramtypes",[Object])],fA);var vA=!1,pA=new x((function(t,e,n,i){vA||(vA=!0,t(Ok).to(fA).inSingletonScope(),t(Lk).toService(Ok))})),gA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},yA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mA=function(t,e){return function(n,i){e(n,i,t)}},kA=function(){return u((function t(e){o(this,t),this.canvasRenderer=e,this.type="richtext",this.numberType=Xs}),[{key:"contains",value:function(t,e,n){return!!t.AABBBounds.containsPoint(e)}}])}();kA=gA([L(),mA(0,O(Gf)),yA("design:paramtypes",[Object])],kA);var bA=!1,_A=new x((function(t,e,n,i){bA||(bA=!0,t(Pk).to(kA).inSingletonScope(),t(Lk).toService(Pk))})),xA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},wA=function(){return u((function t(){o(this,t),this.type="image",this.numberType=Gs}),[{key:"contains",value:function(t,e,n){return!!(null!=n?n:{}).pickContext&&!!t.AABBBounds.containsPoint(e)}}])}();wA=xA([L()],wA);var SA=!1,AA=new x((function(t,e,n,i){SA||(SA=!0,t(wk).to(wA).inSingletonScope(),t(Lk).toService(wk))})),TA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},CA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},EA=function(t,e){return function(n,i){e(n,i,t)}};new de;var RA=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="rect3d",i.numberType=Ys,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).rect;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))})),this.canvasRenderer.z=0,i.modelMatrix!==l&&Ah.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(_S);RA=TA([L(),EA(0,O(jf)),CA("design:paramtypes",[Object])],RA);var BA=!1,MA=new x((function(t,e,n,i){BA||(BA=!0,t(Ck).to(RA).inSingletonScope(),t(Lk).toService(Ck))})),PA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},OA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},IA=function(t,e){return function(n,i){e(n,i,t)}},LA=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="arc3d",i.numberType=Ls,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).arc;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,n,null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))})),this.canvasRenderer.z=0,i.modelMatrix!==l&&Ah.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(_S);LA=PA([L(),IA(0,O(Ef)),OA("design:paramtypes",[Object])],LA);var DA=!1,jA=new x((function(t,e,n,i){DA||(DA=!0,t(bk).to(LA).inSingletonScope(),t(Lk).toService(bk))})),FA=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},NA=function(t,e){if("object"==("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},GA=function(t,e){return function(n,i){e(n,i,t)}},zA=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).canvasRenderer=t,i.type="pyramid3d",i.numberType=Vs,i}return c(n,t),u(n,[{key:"contains",value:function(t,e,n){var i=(null!=n?n:{}).pickContext;if(!i)return!1;var r=zr(t).polygon;i.highPerformanceSave();var a=this.transform(t,r,i),o=a.x,s=a.y,u=a.z,l=a.lastModelMatrix,c=e;if(i.camera){c=e.clone();var h=t.parent.globalTransMatrix;c.x=h.a*e.x+h.c*e.y+h.e,c.y=h.b*e.x+h.d*e.y+h.f}this.canvasRenderer.z=u;var d=!1;return this.canvasRenderer.drawShape(t,i,o,s,{},null,(function(t,e,n){return!!d||(d=t.isPointInPath(c.x,c.y))}),(function(t,e,n){return!1})),this.canvasRenderer.z=0,i.modelMatrix!==l&&Ah.free(i.modelMatrix),i.modelMatrix=l,i.highPerformanceRestore(),d}}])}(_S);zA=FA([L(),GA(0,O(zf)),NA("design:paramtypes",[Object])],zA);var UA=!1,WA=new x((function(t,e,n,i){UA||(UA=!0,t(Mk).to(zA).inSingletonScope(),t(Lk).toService(Mk))})),VA=xp();function HA(){HA.__loaded||(HA.__loaded=!0,ry(),Hi.load(mg),Hi.load(VA?dS:Xb))}HA.__loaded=!1;var YA=HA;function XA(){XA.__loaded||(XA.__loaded=!0,ay(),Hi.load(Qg),Hi.load(jA))}XA.__loaded=!1;var KA=XA;function qA(){qA.__loaded||(qA.__loaded=!0,oy(),Hi.load(Sg),Hi.load(VA?OS:Qb))}qA.__loaded=!1;var ZA=qA;function JA(){JA.__loaded||(JA.__loaded=!0,sy(),Hi.load(Eg),Hi.load(VA?HS:a_))}JA.__loaded=!1;var $A=JA;function QA(){QA.__loaded||(QA.__loaded=!0,uy(),Hi.load(Fg),Hi.load(VA?pA:h_))}QA.__loaded=!1;var tT=QA;function eT(){eT.__loaded||(eT.__loaded=!0,ly())}eT.__loaded=!1;var nT=eT;function iT(){iT.__loaded||(iT.__loaded=!0,cy(),Hi.load(Hg),Hi.load(VA?AA:p_))}iT.__loaded=!1;var rT=iT;function aT(){aT.__loaded||(aT.__loaded=!0,hy(),Hi.load(xg),Hi.load(VA?CS:__))}aT.__loaded=!1;var oT=aT;function sT(){sT.__loaded||(sT.__loaded=!0,dy(),Hi.load(Pg),Hi.load(VA?iA:O_))}sT.__loaded=!1;var uT=sT;function lT(){lT.__loaded||(lT.__loaded=!0,fy(),Hi.load(Ig),Hi.load(VA?lA:C_))}lT.__loaded=!1;var cT=lT;function hT(){hT.__loaded||(hT.__loaded=!0,vy(),Hi.load(iy),Hi.load(WA))}hT.__loaded=!1;var dT=hT;function fT(){fT.__loaded||(fT.__loaded=!0,py(),Hi.load(bg),Hi.load(VA?kS:G_))}fT.__loaded=!1;var vT=fT;function pT(){pT.__loaded||(pT.__loaded=!0,gy(),Hi.load(qg),Hi.load(MA))}pT.__loaded=!1;var gT=pT;function yT(){yT.__loaded||(yT.__loaded=!0,yy(),Hi.load(Wg),Hi.load(VA?_A:U_))}yT.__loaded=!1;var mT=yT;function kT(){kT.__loaded||(kT.__loaded=!0,by())}kT.__loaded=!1;var bT=kT;function _T(){_T.__loaded||(_T.__loaded=!0,my(),Hi.load(Tg),Hi.load(VA?NS:K_))}_T.__loaded=!1;var xT=_T;function wT(){wT.__loaded||(wT.__loaded=!0,ky(),Hi.load(Bg),Hi.load(VA?JS:$_))}wT.__loaded=!1;var ST=wT;function AT(){AT.__loaded||(AT.__loaded=!0,_y())}AT.__loaded=!1;var TT=AT,CT=ok;Qv(),xp()?wb(Hi):wp()&&Ux(Hi),YA(),KA(),ZA(),$A(),tT(),nT(),rT(),oT(),uT(),cT(),dT(),vT(),gT(),mT(),bT(),xT(),ST(),TT();var ET=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},RT=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||ET(t,"Boolean")},BT=function(t){return"function"==typeof t},MT=function(t){return null!=t},PT=function(t){return"object"==a(t)&&null!==t},OT=function(t){if(!PT(t)||!ET(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},IT=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"string"===n:"string"===n||ET(t,"String")},LT=function(t){return Array.isArray?Array.isArray(t):ET(t,"Array")},DT=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},jT=function(t){return ET(t,"Date")},FT=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"number"===n:"number"===n||ET(t,"Number")};function NT(t){var e;if(!MT(t)||"object"!=a(t))return t;var n=LT(t),i=t.length;e=n?new Array(i):"object"==a(t)?{}:RT(t)||FT(t)||IT(t)?t:jT(t)?new Date(+t):void 0;var r=n?void 0:Object.keys(Object(t)),o=-1;if(e)for(;++o<(r||t).length;){var s=r?r[o]:o,u=t[s];e[s]=NT(u)}return e}function GT(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(MT(e)&&"object"==a(e)){var i=Object(e),r=[];for(var o in i)r.push(o);for(var s=r.length,u=-1;s--;){var l=r[++u];MT(i[l])&&"object"==a(i[l])?zT(t,e,l,n):UT(t,l,i[l])}}}}function zT(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t[n],o=e[n],s=e[n],u=!0;if(LT(o)){if(i)s=[];else if(LT(r))s=r;else if(DT(r)){s=new Array(r.length);for(var l=-1,c=r.length;++l<c;)s[l]=r[l]}}else OT(o)?(s=r,"function"!=typeof r&&"object"==a(r)||(s={})):u=!1;u&&GT(s,o,i),UT(t,n,s)}function UT(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function WT(t){for(var e=-1,n=arguments.length<=1?0:arguments.length-1;++e<n;)GT(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function VT(t){return{x:t.left,y:t.top,width:"width"in t?t.width:t.right-t.left,height:"height"in t?t.height:t.bottom-t.top}}class HT{get graphic(){return this._graphic}constructor(t,e){this.containsShapePoints=!1,this.type=t,this._character=e}getBounds(){return this._graphic.AABBBounds}release(){this._graphic&&(this._graphic.parent.removeChild(this._graphic),this._graphic=null)}getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,anchor:[60,40],lineWidth:2,stroke:"#000000",shapePoints:[]}}setAttributes(t){this._graphic&&this._graphic.setAttributes(t)}show(){this._graphic.setAttributes({visible:!0,visibleAll:!0})}hide(){this._graphic.setAttributes({visible:!1,visibleAll:!1})}getGraphicAttribute(){var t;return null===(t=this._graphic)||void 0===t?void 0:t.attribute}applyGraphicAttribute(t){this._graphic.setAttributes(this._transformAttributes(Object.assign({},t)))}getPositionData(){return{x:this._graphic.attribute.x,y:this._graphic.attribute.y,width:this._graphic.attribute.width,height:this._graphic.attribute.height,angle:this._graphic.attribute.angle,shapePoints:this._graphic.attribute.shapePoints}}applyLayoutData(t){this._graphic.setAttributes(this._transformAttributes(Object.assign(Object.assign({},VT(t)),{shapePoints:this._character.spec.options.shapePoints})))}getTextLayoutRatio(){return{left:0,right:1,top:0,bottom:1}}_transformAttributes(t){var e,n,i,r;const a=null!==(e=t.width)&&void 0!==e?e:null===(n=this._graphic)||void 0===n?void 0:n.attribute.width,o=null!==(i=t.height)&&void 0!==i?i:null===(r=this._graphic)||void 0===r?void 0:r.attribute.height,s=Object.assign({},t);return Object.keys(s).forEach((e=>{MT(t[e])||delete s[e]})),s.anchor=[a/2,o/2],s.scaleCenter=[a/2,o/2],s.x=0,s.y=0,s}}class YT extends HT{getInitialAttributes(){return{x:0,y:0,symbolType:"M649.6 812.8l-114.976 114.944a32 32 0 0 1-45.248 0L374.4 812.8H128a64 64 0 0 1-64-64V160a64 64 0 0 1 64-64h768a64 64 0 0 1 64 64v588.8a64 64 0 0 1-64 64h-246.4z",angle:0,size:40,lineWidth:2,stroke:"pink"}}init(){var t,e;this._graphic||(this._graphic=Bc(Object.assign({},this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{})))),this._graphic.name=`graphic-qipao-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}const XT=999999;class KT{constructor(t){this.updateAttribute=t=>{t&&(this._graphic.setAttributes(this._transformTextAttributes(t)),this._updateGraphicCharacterSize())},this._character=t}show(){this._graphic.setAttributes({visible:!0})}hide(){this._graphic.setAttributes({visible:!1})}init(){var t,e;this._graphic=Qu(this._transformTextAttributes(Object.assign(Object.assign({visible:!0,x:0,y:0,textAlign:"center",textBaseline:"middle",text:null,fontSize:16,whiteSpace:"normal",graphicAlign:"center",graphicBaseline:"middle",fill:"#000000",ignoreBuf:!0},null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.text)&&void 0!==e?e:{}),{maxLineWidth:XT,heightLimit:XT}))),this._character.getGraphicParent().add(this._graphic)}applyGraphicAttribute(t){this._graphic.setAttributes(Object.assign({},t))}getGraphicAttribute(){var t;return null===(t=this._graphic)||void 0===t?void 0:t.attribute}applyLayoutData(t){const e=VT(t),n=this._character.getTextLayoutRatio(),i=this._graphic.attribute.graphicAlign,r=this._graphic.attribute.graphicBaseline,a=e.width*n.left,o=e.width*n.right,s=(a+o)/2,u=e.height*n.top,l=e.height*n.bottom,c=(u+l)/2;let h=s,d="center",f=c,v="middle";switch(i){case"left":h=a,d="left";break;case"center":h=s,d="center";break;case"right":h=o,d="right"}switch(r){case"top":f=u,v="top";break;case"middle":f=c,v="middle";break;case"bottom":f=l,v="bottom"}this._graphic.setAttributes(this._transformTextAttributes({x:h,y:f,textAlign:d,textBaseline:v,angle:e.angle,anchor:[e.width/2,e.height/2],scaleCenter:[e.width/2,e.height/2],maxLineWidth:o-a,heightLimit:this._character.graphic.getGraphicAttribute().isResized?l-u:XT}))}_updateGraphicCharacterSize(){this._character.graphic.getGraphicAttribute().isResized||this.applyLayoutData(this._character.graphic.getPositionData())}_transformTextAttributes(t){return t}}class qT{get graphic(){return this._graphic}get spec(){return this._spec}get option(){return this._option}constructor(t,e){this.id=t.id,this._spec=t,this._option=e}updateSpec(t){var e;t.position&&(this._spec.position=t.position),MT(t.zIndex)&&(this._spec.zIndex=t.zIndex),t.options&&(this._spec.options=WT(null!==(e=this._spec.options)&&void 0!==e?e:{},t.options))}setAttributes(t){throw new Error("请重载setAttributes函数")}tickTo(t){throw new Error("Method not implemented.")}init(){this._initRuntime(),this._parserSpec(),this._initGraphics()}reset(){this.clearCharacter(),this.init()}getPositionData(){}}const ZT=Cs();class JT extends nu{constructor(){super(...arguments),this.type="vstory-component-group",this.numberType=ZT}}class $T extends qT{constructor(){super(...arguments),this.graphicType="rect"}get spec(){return this._spec}get text(){return this._text}get group(){return this._group}_parserSpec(){}_initGraphics(){this._group=new JT(Object.assign(Object.assign({},VT(this._spec.position)),{angle:this._spec.options.angle,zIndex:this._spec.zIndex})),this.option.graphicParent.add(this._group),this._graphic=this._createGraphic(),this._text=new KT(this),this._graphic.init(),this._text.init(),this._graphic.applyGraphicAttribute(this._spec.options.graphic),this._text.applyGraphicAttribute(this._spec.options.text),this._graphic.applyLayoutData(this._spec.position),this._text.applyLayoutData(this._spec.position),this.hide()}setAttributes(t){this.group.setAttributes(t),this._graphic.setAttributes(Object.assign(Object.assign({},t),{x:0,y:0,angle:0})),this._text.updateAttribute({})}_initRuntime(){}show(){this._group.setAttributes({visible:!0}),this._text.show(),this._graphic.show()}hide(){this._group.setAttributes({visible:!1}),this._text.hide(),this._graphic.hide()}getTextLayoutRatio(){return this._graphic.getTextLayoutRatio()}clearCharacter(){var t;null===(t=this._group)||void 0===t||t.parent.removeChild(this._group),this._group=null}getGraphicParent(){return this._group}checkEvent(t){var e;return!!(null!==(e=t.detailPath)&&void 0!==e?e:t.path).some((t=>t===this._group))&&{part:t.path[t.path.length-1]===this._graphic.graphic?"graphic":"text",graphicType:this.graphicType}}}class QT extends $T{constructor(){super(...arguments),this.graphicType="qipao"}_createGraphic(){return new YT("Qipao",this)}}class tC extends HT{getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,anchor:[60,40],lineWidth:2,stroke:"#000000",shapePoints:[]}}init(){var t,e;this._graphic||(this._graphic=Dc(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-rect-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}var eC,nC,iC;!function(t){t.VCHART="VChart"}(eC||(eC={})),function(t){t.RECT="Rect",t.SHAPE="Shape",t.LINE="Line",t.ARC="Arc",t.PATH="Path",t.TEXT="Text",t.RICH_TEXT="RichText",t.QIPAO="Qipao",t.IMAGE="Image",t.TIMELINE="Timeline"}(nC||(nC={})),function(t){t.MARK_POINT="markPoint",t.TITLE="title"}(iC||(iC={}));class rC extends $T{constructor(){super(...arguments),this.graphicType="rect"}_createGraphic(){return new tC(nC.RECT,this)}}class aC{static registerCharacter(t,e){aC.characterMap[t]=e}static createCharacter(t,e){const n=aC.characterMap[t.type];if(!n)return console.error("获取模板失败",t),null;const i=new n(t,e);return i.init(),i}static registerGraphic(t,e){aC.graphicMap[t]=e}static createGraphic(t,e){const n=aC.graphicMap[t];return n?new n(t,e):null}static registerDataParser(t,e){aC.dataParserMap[t]=e}static createDataParser(t,e){const n=aC.dataParserMap[t];return n?new n(t,e):null}static registerChartTemp(t,e){aC.chartTempMap[t]=e}static createChartTemp(t,e){const n=aC.chartTempMap[t];return n?new n(e):null}}function oC(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"===("undefined"==typeof Reflect?"undefined":a(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function sC(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))}aC.characterMap={},aC.graphicMap={},aC.dataParserMap={},aC.chartTempMap={};const uC=Cs();class lC extends nu{get vchart(){return this._vchart}get vProduct(){return this._vchart}constructor(t){var e;super(t),this.type="chart",this.drawTag=!1,this.numberType=uC,t.vchart?this._vchart=t.vchart:t.vchart=this._vchart=new t.ClassType(t.spec,Object.assign({renderCanvas:t.renderCanvas,mode:t.mode,modeParams:t.modeParams,canvasControled:!1,dpr:t.dpr,interactive:t.interactive,animation:!1,autoFit:!1,disableTriggerEvent:t.disableTriggerEvent,disableDirtyBounds:t.disableDirtyBounds,ticker:t.ticker,beforeRender:()=>{var t;if(!this.stage)return;const e=this._vchart.getStage();e._editor_needRender||(e.pauseRender(),null===(t=this.stage.dirtyBounds)||void 0===t||t.union(this.globalAABBBounds),this.stage.renderNextFrame())},afterRender:()=>{this._vchart&&this.stage&&(this._vchart.getStage()._editor_needRender=!1,this._vchart.getStage().stage.resumeRender())}},null!==(e=t.chartInitOptions)&&void 0!==e?e:{})),this._vchart.renderSync();const n=this._vchart.getStage();n&&(n.background=!1,n.pauseTriggerEvent()),t.viewBox&&this.updateViewBox(t.viewBox)}updateSpec(t,e=!1,n=!1){this._vchart.updateSpecSync(t,e,n)}updateViewBox(t){this._updateViewBox(t)}_updateViewBox(t){const e=Object.assign({},t);this.setAttributes({x:e.x1,y:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}),e.x2-=e.x1,e.y2-=e.y1,e.x1=0,e.y1=0,this._vchart.resize(e.x2-e.x1,e.y2-e.y1),this._vchart.updateViewBox(e)}}const cC=Symbol.for("ChartRender");let hC=class extends t.DefaultCanvasRectRender{constructor(){super(...arguments),this.numberType=uC}drawShape(t,e,n,i,r,a,o,s){var u;const{baseOpacity:l=1}=t.attribute;if(l<=0)return;e.baseGlobalAlpha*=l,super.drawShape(t,e,n,i,r,a,o,s),e.baseGlobalAlpha/=l;const c=t.vchart.getStage(),h=c.window.getContext();h.baseGlobalAlpha*=l,c._editor_needRender=!0;const d=t.globalTransMatrix.clone(),f=t.stage.window.getViewBoxTransform();d.multiply(f.a,f.b,f.c,f.d,f.e,f.f),c.window.setViewBoxTransform(d.a,d.b,d.c,d.d,d.e,d.f),null===(u=c.dirtyBounds)||void 0===u||u.clear(),c.render(),h.baseGlobalAlpha/=l}draw(t,e,n,i){this._draw(t,{},!1,n,i)}};hC=oC([L()],hC);class dC extends HT{getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,fontSize:16,textAlign:"center",textBaseline:"middle",fill:"#000000",lineWidth:2,ignoreBuf:!0,stroke:!1,shapePoints:[]}}init(){var t,e;this._graphic||(this._graphic=Qu(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-text-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}applyLayoutData(t){const{x:e,y:n,width:i,height:r,angle:a}=VT(t);this._graphic.setAttributes(this._transformAttributes({x:e,y:n,angle:a,width:i,height:r,maxLineWidth:i,heightLimit:r}))}}class fC extends $T{constructor(){super(...arguments),this.graphicType="text"}_createGraphic(){return new dC(nC.TEXT,this)}}class vC extends HT{getInitialAttributes(){return{x:0,y:0,width:120,height:80,maxWidth:120,maxHeight:80,angle:0,fontSize:16,textAlign:"center",textBaseline:"middle",fill:"#000000",lineWidth:2,ignoreBuf:!0,stroke:!1,ellipsis:!0,textConfig:[]}}init(){var t,e;this._graphic||(this._graphic=$c(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-richtext-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}applyLayoutData(t){const{x:e,y:n,width:i,height:r,angle:a}=VT(t);this._graphic.setAttributes(this._transformAttributes({x:e,y:n,angle:a,maxWidth:i,maxHeight:r}))}}class pC extends $T{constructor(){super(...arguments),this.graphicType="richtext"}_createGraphic(){return new vC(nC.RICH_TEXT,this)}}let gC=class{constructor(){this.type="chart",this.numberType=uC}contains(t,e,n){var i;const r=t.vchart.getStage();r._editor_needRender=!0;const a=t.globalTransMatrix.clone(),o=t.stage.window.getViewBoxTransform();a.multiply(o.a,o.b,o.c,o.d,o.e,o.f),r.window.setViewBoxTransform(a.a,a.b,a.c,a.d,a.e,a.f),null===(i=r.dirtyBounds)||void 0===i||i.clear();const s={x:0,y:0};a.transformPoint(e,s);return r.pick(s.x,s.y)}};gC=oC([L()],gC);class yC extends HT{getInitialAttributes(){return{x:0,y:0,points:[],angle:0,lineWidth:2,stroke:"#000000",shapePoints:[]}}init(){var t,e;this._graphic||(this._graphic=Oc(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-line-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}class mC extends $T{constructor(){super(...arguments),this.graphicType="line"}_createGraphic(){return new yC(nC.RECT,this)}}class kC extends HT{getInitialAttributes(){return{x:0,y:0,width:120,height:80,image:"",angle:0,anchor:[60,40],shapePoints:[]}}init(){var t,e;this._graphic||(this._graphic=Yc(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-image-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}class bC extends $T{constructor(){super(...arguments),this.graphicType="image"}_createGraphic(){return new kC(nC.IMAGE,this)}}class _C extends HT{getInitialAttributes(){return{x:0,y:0,width:120,height:80,angle:0,anchor:[60,40],lineWidth:2,stroke:"#000000",shapePoints:[],symbolType:"circle"}}init(){var t,e;this._graphic||(this._graphic=Bc(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`graphic-symbol-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}}class xC extends $T{constructor(){super(...arguments),this.graphicType="shape"}_createGraphic(){return new _C(nC.SHAPE,this)}}function wC(t,e,n){return!!n&&(MT(n.usrId)?t.id===n.usrId:!!MT(n.specIndex)&&("all"===n.specIndex||e===n.specIndex))}var SC,AC,TC=function(t){return t};!function(t){t["desktop-browser"]="desktop-browser",t["mobile-browser"]="mobile-browser",t.node="node",t.worker="worker",t.miniApp="miniApp",t.wx="wx",t.tt="tt",t.harmony="harmony",t["desktop-miniApp"]="desktop-miniApp",t.lynx="lynx"}(SC||(SC={})),function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.mapLabel="mapLabel",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(AC||(AC={}));var CC=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},EC=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||CC(t,"Boolean")},RC=function(t){return"function"==typeof t},BC=function(t){return null==t},MC=function(t){return null!=t},PC=function(t){var e=a(t);return null!==t&&"object"===e||"function"===e},OC=function(t){return"object"==a(t)&&null!==t},IC=function(t){if(!OC(t)||!CC(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},LC=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"string"===n:"string"===n||CC(t,"String")},DC=function(t){return Array.isArray?Array.isArray(t):CC(t,"Array")},jC=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},FC=function(t){return CC(t,"Date")},NC=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=a(t);return e?"number"===n:"number"===n||CC(t,"Number")},GC=function(t){return NC(t)&&Number.isFinite(t)},zC=function(t){return{}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")},UC=Object.prototype,WC=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||UC)},VC=Object.prototype.hasOwnProperty;function HC(t){if(BC(t))return!0;if(jC(t))return!t.length;var e=zC(t);if("Map"===e||"Set"===e)return!t.size;if(WC(t))return!Object.keys(t).length;for(var n in t)if(VC.call(t,n))return!1;return!0}var YC=function(t,e,n){for(var i=LC(e)?e.split("."):e,r=0;r<i.length;r++)t=t?t[i[r]]:void 0;return void 0===t?n:t},XC=Object.prototype.hasOwnProperty,KC=function(t,e){return null!=t&&XC.call(t,e)};function qC(t){var e;if(!MC(t)||"object"!=a(t))return t;var n=DC(t),i=t.length;e=n?new Array(i):"object"==a(t)?{}:EC(t)||NC(t)||LC(t)?t:FC(t)?new Date(+t):void 0;var r=n?void 0:Object.keys(Object(t)),o=-1;if(e)for(;++o<(r||t).length;){var s=r?r[o]:o,u=t[s];e[s]=qC(u)}return e}function ZC(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(MC(e)&&"object"==a(e)){var i=Object(e),r=[];for(var o in i)r.push(o);for(var s=r.length,u=-1;s--;){var l=r[++u];MC(i[l])&&"object"==a(i[l])?JC(t,e,l,n):$C(t,l,i[l])}}}}function JC(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t[n],o=e[n],s=e[n],u=!0;if(DC(o)){if(i)s=[];else if(DC(r))s=r;else if(jC(r)){s=new Array(r.length);for(var l=-1,c=r.length;++l<c;)s[l]=r[l]}}else IC(o)?(s=r,"function"!=typeof r&&"object"==a(r)||(s={})):u=!1;u&&ZC(s,o,i),$C(t,n,s)}function $C(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function QC(t){for(var e=-1,n=arguments.length<=1?0:arguments.length-1;++e<n;)ZC(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function tE(t){return Object.prototype.toString.call(t)}function eE(t){return Object.keys(t)}function nE(t,e,n){if(t===e)return!0;if(a(t)!=a(e))return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(tE(t)!==tE(e))return!1;if(RC(t))return!!(null==n?void 0:n.skipFunction);if("object"!=a(t))return!1;if(DC(t)){if(t.length!==e.length)return!1;for(var i=t.length-1;i>=0;i--)if(!nE(t[i],e[i],n))return!1;return!0}if(!IC(t))return!1;var r=eE(t),o=eE(e);if(r.length!==o.length)return!1;r.sort(),o.sort();for(var s=r.length-1;s>=0;s--)if(r[s]!=o[s])return!1;for(var u=r.length-1;u>=0;u--){var l=r[u];if(!nE(t[l],e[l],n))return!1}return!0}function iE(t,e,n){for(var i=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}(e),r=0;r<i.length;r++){var a=i[r];(n?null!=e[a]:null==t[a])&&(t[a]=e[a])}return t}function rE(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),r=0;r<i.length;r++){var a=i[r];"constructor"!==a&&(n?null!=e[a]:null==t[a])&&(t[a]=e[a])}else iE(t,e,n)}function aE(t){return MC(t)?DC(t)?t:[t]:[]}function oE(t){if(jC(t))return t[t.length-1]}function sE(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function uE(t){return Number(t)}var lE,cE="undefined"!=typeof console;function hE(t,e,n){var i=[e].concat([].slice.call(n));cE&&console[t].apply(console,i)}!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(lE||(lE={}));var dE=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:lE.None,n=arguments.length>1?arguments[1]:void 0;o(this,t),this._onErrorHandler=[],this._level=e,this._method=n}return u(t,[{key:"addErrorHandler",value:function(t){this._onErrorHandler.find((function(e){return e===t}))||this._onErrorHandler.push(t)}},{key:"removeErrorHandler",value:function(t){var e=this._onErrorHandler.findIndex((function(e){return e===t}));e<0||this._onErrorHandler.splice(e,1)}},{key:"callErrorHandler",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._onErrorHandler.forEach((function(t){return t.apply(void 0,e)}))}},{key:"canLogInfo",value:function(){return this._level>=lE.Info}},{key:"canLogDebug",value:function(){return this._level>=lE.Debug}},{key:"canLogError",value:function(){return this._level>=lE.Error}},{key:"canLogWarn",value:function(){return this._level>=lE.Warn}},{key:"level",value:function(t){return arguments.length?(this._level=+t,this):this._level}},{key:"error",value:function(){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return this._level>=lE.Error&&(this._onErrorHandler.length?this.callErrorHandler.apply(this,n):hE(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",n)),this}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=lE.Warn&&hE(this._method||"warn","WARN",e),this}},{key:"info",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=lE.Info&&hE(this._method||"log","INFO",e),this}},{key:"debug",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._level>=lE.Debug&&hE(this._method||"log","DEBUG",e),this}}],[{key:"getInstance",value:function(e,n){return t._instance&&NC(e)?t._instance.level(e):t._instance||(t._instance=new t(e,n)),t._instance}},{key:"setInstance",value:function(e){return t._instance=e}},{key:"setInstanceLevel",value:function(e){t._instance?t._instance.level(e):t._instance=new t(e)}},{key:"clearInstance",value:function(){t._instance=null}}])}();function fE(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;for(BC(i)&&(i=t.length);n<i;){var r=n+i>>>1;sE(t[r],e)>0?i=r:n=r+1}return n}dE._instance=null;var vE=1e-10,pE=1e-10;function gE(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vE,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:pE)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}function yE(t,e,n,i){return t>e&&!gE(t,e,n,i)}function mE(t,e,n,i){return t<e&&!gE(t,e,n,i)}var kE=function(t){var e=null,n=null;return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return e&&r.every((function(t,n){return t===e[n]}))||(e=r,n=t.apply(void 0,r)),n}},bE=function(t,e,n){return t<e?e:t>n?n:t};function _E(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}var xE=!1;try{xE="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){xE=!1}function wE(t,e,n){var i,r,a,o,s,u,l=0,c=!1,h=!1,d=!0,f=!e&&0!==e&&xE;if("function"!=typeof t)throw new TypeError("Expected a function");function v(e){var n=i,a=r;return i=r=void 0,l=e,o=t.apply(a,n)}function p(t,e){return f?(cancelAnimationFrame(s),requestAnimationFrame(t)):setTimeout(t,e)}function g(t){var n=t-u;return void 0===u||n>=e||n<0||h&&t-l>=a}function y(){var t=Date.now();if(g(t))return m(t);s=p(y,function(t){var n=t-l,i=e-(t-u);return h?Math.min(i,a-n):i}(t))}function m(t){return s=void 0,d&&i?v(t):(i=r=void 0,o)}function k(){for(var t=Date.now(),n=g(t),a=arguments.length,d=new Array(a),f=0;f<a;f++)d[f]=arguments[f];if(i=d,r=this,u=t,n){if(void 0===s)return function(t){return l=t,s=p(y,e),c?v(t):o}(u);if(h)return s=p(y,e),v(u)}return void 0===s&&(s=p(y,e)),o}return e=+e||0,PC(n)&&(c=!!n.leading,(h="maxWait"in n)&&(a=Math.max(GC(n.maxWait)?n.maxWait:0,e)),d="trailing"in n?!!n.trailing:d),k.cancel=function(){void 0!==s&&function(t){if(f)return cancelAnimationFrame(t);clearTimeout(t)}(s),l=0,i=u=r=s=void 0},k.flush=function(){return void 0===s?o:m(Date.now())},k.pending=function(){return void 0!==s},k}function SE(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return PC(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),wE(t,e,{leading:i,trailing:r,maxWait:e})}function AE(t,e){return function(n){return t*(1-n)+e*n}}function TE(t,e){return function(n){return Math.round(t*(1-n)+e*n)}}xE=!1;var CE=Math.sqrt,EE=Math.pow,RE=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n,this.x1=i,this.y1=r}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}},{key:"set",value:function(t,e){return this.x=t,this.y=e,this}},{key:"add",value:function(t){return NC(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return NC(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}},{key:"multi",value:function(t){throw new Error("暂不支持")}},{key:"div",value:function(t){throw new Error("暂不支持")}}])}(),BE=function(){return u((function t(){o(this,t)}),null,[{key:"distancePP",value:function(t,e){return CE(EE(t.x-e.x,2)+EE(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,n,i){return CE(EE(t-n,2)+EE(e-i,2))}},{key:"distancePN",value:function(t,e,n){return CE(EE(e-t.x,2)+EE(n-t.y,2))}},{key:"pointAtPP",value:function(t,e,n){return new RE((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y)}}])}();var ME=function(){function t(e){o(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return u(t,[{key:"clone",value:function(){return new t(this)}},{key:"clear",value:function(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}},{key:"empty",value:function(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}},{key:"equals",value:function(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}},{key:"setValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=n,this.y2=i,this}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),i<e?(this.y2=e,this.y1=i):(this.y1=e,this.y2=i),this}},{key:"add",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}},{key:"expand",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return DC(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}},{key:"round",value:function(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}},{key:"translate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}},{key:"rotate",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])}},{key:"scale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,n,i);return this.clear().add(r[0],r[1]).add(r[2],r[3])}},{key:"union",value:function(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}},{key:"intersect",value:function(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}},{key:"encloses",value:function(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}},{key:"alignsWith",value:function(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}},{key:"intersects",value:function(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}},{key:"contains",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}},{key:"containsPoint",value:function(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}},{key:"width",value:function(){return this.empty()?0:this.x2-this.x1}},{key:"height",value:function(){return this.empty()?0:this.y2-this.y1}},{key:"scaleX",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}},{key:"scaleY",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}},{key:"transformWithMatrix",value:function(t){return function(t,e,n){var i=e.x1,r=e.y1,a=e.x2,o=e.y2;n.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(n.e,n.f)):(t.clear(),t.add(n.a*i+n.c*r+n.e,n.b*i+n.d*r+n.f),t.add(n.a*a+n.c*r+n.e,n.b*a+n.d*r+n.f),t.add(n.a*a+n.c*o+n.e,n.b*a+n.d*o+n.f),t.add(n.a*i+n.c*o+n.e,n.b*i+n.d*o+n.f))}(this,this,t),this}},{key:"copy",value:function(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}},{key:"rotatedPoints",value:function(t,e,n){var i=this.x1,r=this.y1,a=this.x2,o=this.y2,s=Math.cos(t),u=Math.sin(t),l=e-e*s+n*u,c=n-e*u-n*s;return[s*i-u*r+l,u*i+s*r+c,s*i-u*o+l,u*i+s*o+c,s*a-u*r+l,u*a+s*r+c,s*a-u*o+l,u*a+s*o+c]}},{key:"scalePoints",value:function(t,e,n,i){return[t*this.x1+(1-t)*n,e*this.y1+(1-e)*i,t*this.x2+(1-t)*n,e*this.y2+(1-e)*i]}}])}();function PE(t){return t*(Math.PI/180)}function OE(t,e,n){e/=100,n/=100;var i=(1-Math.abs(2*n-1))*e,r=i*(1-Math.abs(t/60%2-1)),a=n-i/2,o=0,s=0,u=0;return 0<=t&&t<60?(o=i,s=r,u=0):60<=t&&t<120?(o=r,s=i,u=0):120<=t&&t<180?(o=0,s=i,u=r):180<=t&&t<240?(o=0,s=r,u=i):240<=t&&t<300?(o=r,s=0,u=i):300<=t&&t<360&&(o=i,s=0,u=r),{r:o=Math.round(255*(o+a)),g:s=Math.round(255*(s+a)),b:u=Math.round(255*(u+a))}}function IE(t,e,n){t/=255,e/=255,n/=255;var i=Math.min(t,e,n),r=Math.max(t,e,n),a=r-i,o=0,s=0;return o=0===a?0:r===t?(e-n)/a%6:r===e?(n-t)/a+2:(t-e)/a+4,(o=Math.round(60*o))<0&&(o+=360),s=(r+i)/2,{h:o,s:+(100*(0===a?0:a/(1-Math.abs(2*s-1)))).toFixed(1),l:s=+(100*s).toFixed(1)}}var LE=/^#([0-9a-f]{3,8})$/,DE={transparent:4294967040},jE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function FE(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function NE(t){return NC(t)?new WE(t>>16,t>>8&255,255&t,1):DC(t)?new WE(t[0],t[1],t[2]):new WE(255,255,255)}function GE(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function zE(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}var UE=function(){function t(e){o(this,t);var n=t.parseColorString(e);n?this.color=n:(console.warn("Warn: 传入".concat(e,"无法解析为Color")),this.color=new WE(255,255,255))}return u(t,[{key:"toRGBA",value:function(){return this.color.formatRgb()}},{key:"toString",value:function(){return this.color.formatRgb()}},{key:"toHex",value:function(){return this.color.formatHex()}},{key:"toHsl",value:function(){return this.color.formatHsl()}},{key:"brighter",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t))),this}},{key:"add",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r+=Math.min(255,n+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,r+t.color.b),this}},{key:"sub",value:function(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}},{key:"multiply",value:function(t){var e=this.color,n=e.r,i=e.g,r=e.b;return this.color.r=Math.max(0,Math.min(255,Math.floor(n*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(r*t.color.b))),this}},{key:"getHSVBrightness",value:function(){return Math.max(this.color.r,this.color.g,this.color.b)/255}},{key:"getHSLBrightness",value:function(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}},{key:"setHsl",value:function(t,e,n){var i=this.color.opacity,r=IE(this.color.r,this.color.g,this.color.b),a=OE(BC(t)?r.h:bE(t,0,360),BC(e)?r.s:e>=0&&e<=1?100*e:e,BC(n)?r.l:n<=1&&n>=0?100*n:n);return this.color=new WE(a.r,a.g,a.b,i),this}},{key:"setRGB",value:function(t,e,n){return!BC(t)&&(this.color.r=t),!BC(e)&&(this.color.g=e),!BC(n)&&(this.color.b=n),this}},{key:"setHex",value:function(t){var e="".concat(t).trim().toLowerCase(),n=LE.exec(e),i=parseInt(n[1],16),r=n[1].length;return 3===r?new WE((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===r?NE(i):8===r?new WE(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):this}},{key:"setColorName",value:function(t){var e=jE[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}},{key:"setScalar",value:function(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}},{key:"setOpacity",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}},{key:"getLuminance",value:function(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}},{key:"getLuminance2",value:function(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}},{key:"getLuminance3",value:function(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}},{key:"clone",value:function(){return new t(this.color.toString())}},{key:"copyGammaToLinear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}},{key:"copyLinearToGamma",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,n=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,n),this.color.g=Math.pow(t.color.g,n),this.color.b=Math.pow(t.color.b,n),this}},{key:"convertGammaToLinear",value:function(t){return this.copyGammaToLinear(this,t),this}},{key:"convertLinearToGamma",value:function(t){return this.copyLinearToGamma(this,t),this}},{key:"copySRGBToLinear",value:function(t){return this.color.r=GE(t.color.r),this.color.g=GE(t.color.g),this.color.b=GE(t.color.b),this}},{key:"copyLinearToSRGB",value:function(t){return this.color.r=zE(t.color.r),this.color.g=zE(t.color.g),this.color.b=zE(t.color.b),this}},{key:"convertSRGBToLinear",value:function(){return this.copySRGBToLinear(this),this}},{key:"convertLinearToSRGB",value:function(){return this.copyLinearToSRGB(this),this}}],[{key:"Brighter",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).brighter(n).toRGBA()}},{key:"SetOpacity",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===n?e:new t(e).setOpacity(n).toRGBA()}},{key:"getColorBrightness",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl",i=e instanceof t?e:new t(e);switch(n){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}},{key:"parseColorString",value:function(t){if(MC(DE[t]))return function(t){return NC(t)?new WE(t>>>24,t>>>16&255,t>>>8&255,255&t):DC(t)?new WE(t[0],t[1],t[2],t[3]):new WE(255,255,255,1)}(DE[t]);if(MC(jE[t]))return NE(jE[t]);var e="".concat(t).trim().toLowerCase(),n=LE.exec(e);if(n){var i=parseInt(n[1],16),r=n[1].length;return 3===r?new WE((i>>8&15)+((i>>8&15)<<4),(i>>4&15)+((i>>4&15)<<4),(15&i)+((15&i)<<4),1):6===r?NE(i):8===r?new WE(i>>24&255,i>>16&255,i>>8&255,(255&i)/255):void 0}if(/^(rgb|RGB|rgba|RGBA)/.test(e)){var a=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new WE(parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10),parseFloat(a[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){var o=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),s=OE(parseInt(o[0],10),parseInt(o[1],10),parseInt(o[2],10));return new WE(s.r,s.g,s.b,parseFloat(o[3]))}}}])}(),WE=function(){return u((function t(e,n,i,r){o(this,t),this.r=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.g=isNaN(+n)?255:Math.max(0,Math.min(255,+n)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),MC(r)?this.opacity=isNaN(+r)?1:Math.max(0,Math.min(1,+r)):this.opacity=1}),[{key:"formatHex",value:function(){return"#".concat(FE(this.r)+FE(this.g)+FE(this.b)+(1===this.opacity?"":FE(255*this.opacity)))}},{key:"formatRgb",value:function(){var t=this.opacity;return"".concat(1===t?"rgb(":"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b).concat(1===t?")":",".concat(t,")"))}},{key:"formatHsl",value:function(){var t=this.opacity,e=IE(this.r,this.g,this.b),n=e.h,i=e.s,r=e.l;return"".concat(1===t?"hsl(":"hsla(").concat(n,",").concat(i,"%,").concat(r,"%").concat(1===t?")":",".concat(t,")"))}},{key:"toString",value:function(){return this.formatHex()}}])}();function VE(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t)return{width:n,height:i};try{e=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){e=function(){return{}}}var r=e(t);if(/^(\d*\.?\d+)(px)$/.exec(r.width)){var a=parseFloat(r.width)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)||t.clientWidth-1,o=parseFloat(r.height)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)||t.clientHeight-1;return{width:a<=0?n:a,height:o<=0?i:o}}return{width:n,height:i}}var HE,YE=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return qE.apply(void 0,[qC(t)].concat(n))};function XE(t,e,n){var i=e[n];if(void 0===i)t[n]=null;else if(PC(i))for(var r in PC(t[n])||(t[n]={}),i)XE(t[n],i,r);else t[n]=i}function KE(t,e){if(PC(e)&&t!==e)for(var n in e)XE(t,e,n)}function qE(t){t||(t={});for(var e=-1,n=arguments.length<=1?0:arguments.length-1;++e<n;)KE(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1]);return t}!function(t){t.DSV="dsv",t.TREE="tree",t.GEO="geo",t.BYTE="bytejson",t.HEX="hex",t.GRAPH="graph",t.TABLE="table",t.GEO_GRATICULE="geo-graticule"}(HE||(HE={}));var ZE=function(t,e){var n,i;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;var r=e.fields,a=t[0],o={},s=[],u=function(e){if(Object.prototype.hasOwnProperty.call(r,e)){var u,l=r[e];if(!l.type){var c=a;e in a||(c=null!==(n=t.find((function(t){return e in t})))&&void 0!==n?n:a),l.type="number"==typeof c[e]?"linear":"ordinal"}if("number"==typeof l.sortIndex&&(u={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},s.push(u)),(null===(i=l.domain)||void 0===i?void 0:i.length)>0)if("ordinal"===l.type){l._domainCache={},o[e]=l;var h={};l.domain.forEach((function(t,e){h[t]=e,l._domainCache[t]=e})),u&&(u.sortIndex=h,u.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(o[e]=l)}};for(var l in r)u(l);return Object.keys(o).length>0&&(t=t.filter((function(t){for(var e in o){var n=o[e];if("ordinal"===n.type){if(!(t[e]in n._domainCache))return!1}else if(n.domain[0]>t[e]||n.domain[1]<t[e])return!1}return!0}))),s.sort((function(t,e){return t.index-e.index})),t.sort((function(t,e){return function(t,e,n){for(var i=0;i<n.length;i++){var r=n[i],a=0;if("ordinal"===r.type?(void 0===r.sortIndex[e[r.key]]&&(r.sortIndex[e[r.key]]=r.sortIndexCount++),void 0===r.sortIndex[t[r.key]]&&(r.sortIndex[t[r.key]]=r.sortIndexCount++),a=r.sortIndex[t[r.key]]-r.sortIndex[e[r.key]]):"linear"===r.type&&(a=t[r.key]-e[r.key]),r.sortReverse&&(a=-a),0!==a)return a}return 0}(t,e,s)})),t};var JE={},$E={};function QE(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function tR(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var i in t)i in e||n.push(e[i]=i)})),n}function eR(t,e){var n=t+"",i=n.length;return i<e?new Array(e-i+1).join(0)+n:n}function nR(t){var e,n=t.getUTCHours(),i=t.getUTCMinutes(),r=t.getUTCSeconds(),a=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((e=t.getUTCFullYear())<0?"-"+eR(-e,6):e>9999?"+"+eR(e,6):eR(e,4))+"-"+eR(t.getUTCMonth()+1,2)+"-"+eR(t.getUTCDate(),2)+(a?"T"+eR(n,2)+":"+eR(i,2)+":"+eR(r,2)+"."+eR(a,3)+"Z":r?"T"+eR(n,2)+":"+eR(i,2)+":"+eR(r,2)+"Z":i||n?"T"+eR(n,2)+":"+eR(i,2)+"Z":"")}function iR(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var i,r=[],a=t.length,o=0,s=0,u=a<=0,l=!1;function c(){if(u)return $E;if(l)return l=!1,JE;var e,i,r=o;if(34===t.charCodeAt(r)){for(;o++<a&&34!==t.charCodeAt(o)||34===t.charCodeAt(++o););return(e=o)>=a?u=!0:10===(i=t.charCodeAt(o++))?l=!0:13===i&&(l=!0,10===t.charCodeAt(o)&&++o),t.slice(r+1,e-1).replace(/""/g,'"')}for(;o<a;){if(10===(i=t.charCodeAt(e=o++)))l=!0;else if(13===i)l=!0,10===t.charCodeAt(o)&&++o;else if(i!==n)continue;return t.slice(r,e)}return u=!0,t.slice(r,a)}for(10===t.charCodeAt(a-1)&&--a,13===t.charCodeAt(a-1)&&--a;(i=c())!==$E;){for(var h=[];i!==JE&&i!==$E;)h.push(i),i=c();e&&null==(h=e(h,s++))||r.push(h)}return r}function r(e,n){return e.map((function(e){return n.map((function(t){return o(e[t])})).join(t)}))}function a(e){return e.map(o).join(t)}function o(t){return null==t?"":t instanceof Date?nR(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,r,a=i(t,(function(t,i){if(n)return n(t,i-1);r=t,n=e?function(t,e){var n=QE(t);return function(i,r){return e(n(i),r,t)}}(t,e):QE(t)}));return a.columns=r||[],a},parseRows:i,format:function(e,n){return null==n&&(n=tR(e)),[n.map(o).join(t)].concat(r(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=tR(t)),r(t,e).join("\n")},formatRows:function(t){return t.map(a).join("\n")},formatRow:a,formatValue:o}}var rR=iR(",").parse,aR=iR("\t").parse,oR={delimiter:","},sR=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(arguments.length>2?arguments[2]:void 0).type=HE.DSV;var n=YE(oR,e).delimiter;if(!LC(n))throw new TypeError("Invalid delimiter: must be a string!");return iR(n).parse(t)},uR=function(t){return(arguments.length>2?arguments[2]:void 0).type=HE.DSV,rR(t)},lR=function(t){return(arguments.length>2?arguments[2]:void 0).type=HE.DSV,aR(t)},cR=function(t,e,n){var i=!EC(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!DC(t))throw new TypeError("Invalid data: must be DataView array!");return DC(n.rawData)&&n.rawData.forEach((function(t){t.target&&(t.target.removeListener("change",n.reRunAllTransform),t.target.removeListener("markRunning",n.markRunning))})),i&&t.forEach((function(t){t.target.addListener("change",n.reRunAllTransform),t.target.addListener("markRunning",n.markRunning)})),t},hR=0;function dR(){return hR>1e8&&(hR=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+hR++}var fR=function(){return u((function t(e){var n,i;o(this,t),this.options=e,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new dt,i=(null==e?void 0:e.name)?e.name:dR("dataset"),this.name=i,this._logger=null!==(n=null==e?void 0:e.logger)&&void 0!==n?n:dE.getInstance()}),[{key:"setLogger",value:function(t){this._logger=t}},{key:"getDataView",value:function(t){return this.dataViewMap[t]}},{key:"setDataView",value:function(t,e){var n;this.dataViewMap[t]&&(null===(n=this._logger)||void 0===n||n.error("Error: dataView ".concat(t," 之前已存在,请重新命名"))),this.dataViewMap[t]=e}},{key:"removeDataView",value:function(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}},{key:"registerParser",value:function(t,e){var n;this.parserMap[t]&&(null===(n=this._logger)||void 0===n||n.warn("Warn: transform ".concat(t," 之前已注册,执行覆盖逻辑"))),this.parserMap[t]=e}},{key:"removeParser",value:function(t){this.parserMap[t]=null,delete this.parserMap[t]}},{key:"getParser",value:function(t){return this.parserMap[t]||this.parserMap.default}},{key:"registerTransform",value:function(t,e){var n;this.transformMap[t]&&(null===(n=this._logger)||void 0===n||n.warn("Warn: transform ".concat(t," 之前已注册,执行覆盖逻辑"))),this.transformMap[t]=e}},{key:"removeTransform",value:function(t){this.transformMap[t]=null,delete this.transformMap[t]}},{key:"getTransform",value:function(t){return this.transformMap[t]}},{key:"multipleDataViewAddListener",value:function(t,e,n){this._callMap||(this._callMap=new Map);var i=this._callMap.get(n);i||(i=function(){t.some((function(t){return t.isRunning}))||n()}),t.forEach((function(t){t.target.addListener(e,i)})),this._callMap.set(n,i)}},{key:"allDataViewAddListener",value:function(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}},{key:"multipleDataViewRemoveListener",value:function(t,e,n){if(this._callMap){var i=this._callMap.get(n);i&&t.forEach((function(t){t.target.removeListener(e,i)})),this._callMap.delete(n)}}},{key:"multipleDataViewUpdateInParse",value:function(t){var e=this;t.forEach((function(t){var n;return null===(n=e.getDataView(t.name))||void 0===n?void 0:n.markRunning()})),t.forEach((function(t){var n;return null===(n=e.getDataView(t.name))||void 0===n?void 0:n.parseNewData(t.data,t.options)}))}},{key:"multipleDataViewUpdateInRawData",value:function(t){var e=this;t.forEach((function(t){var n;return null===(n=e.getDataView(t.name))||void 0===n?void 0:n.markRunning()})),t.forEach((function(t){var n;return null===(n=e.getDataView(t.name))||void 0===n?void 0:n.updateRawData(t.data,t.options)}))}},{key:"destroy",value:function(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}])}(),vR="_data-view-diff-rank",pR=function(){function t(e,n){var i,r=this;o(this,t),this.dataSet=e,this.options=n,this.isDataView=!0,this.target=new dt,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return r.isRunning=!0,r.resetTransformData(),r.transformsArr.forEach((function(e){r.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),r.isLastTransform(e)&&r.diffLastData()})),r.isRunning=!1,!1!==t.emitMessage&&r.target.emit("change",[]),r},this.markRunning=function(){r.isRunning=!0,r.target.emit("markRunning",[])},i=(null==n?void 0:n.name)?n.name:dR("dataview"),this.name=i,(null==n?void 0:n.history)&&(this.history=n.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==n?void 0:n.fields)}return u(t,[{key:"parse",value:function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);var r=this.cloneParseData(t,e);if(null==e?void 0:e.type){var a=(null!==(n=this.dataSet.getParser(e.type))&&void 0!==n?n:this.dataSet.getParser("bytejson"))(r,e.options,this);this.rawData=r,this.parserData=a,this.history&&this.historyData.push(r,a),this.latestData=a}else this.parserData=r,this.rawData=r,this.history&&this.historyData.push(r),this.latestData=r;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}},{key:"transform",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){var n=!0;if("fields"===t.type){this._fields=t.options.fields;var i=this.transformsArr.findIndex((function(e){return e.type===t.type}));i>=0&&(n=!1,this.transformsArr[i].options.fields=this._fields)}if(n&&this.transformsArr.push(t),e){var r=this.isLastTransform(t);this.executeTransform(t),r&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}},{key:"isLastTransform",value:function(t){return this.transformsArr[this.transformsArr.length-1]===t}},{key:"sortTransform",value:function(){this.transformsArr.length>=2&&this.transformsArr.sort((function(t,e){var n,i;return(null!==(n=t.level)&&void 0!==n?n:0)-(null!==(i=e.level)&&void 0!==i?i:0)}))}},{key:"executeTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0},n=e.pushHistory,i=e.emitMessage,r=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==n&&this.historyData.push(r),this.latestData=r,!1!==i&&this.target.emit("change",[])}},{key:"resetTransformData",value:function(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}},{key:"enableDiff",value:function(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}},{key:"disableDiff",value:function(){this._diffData=!1,this._diffMap=null,this._diffRank=null}},{key:"resetDiff",value:function(){this._diffMap=new Map,this._diffRank=0}},{key:"diffLastData",value:function(){var t,e=this;if(this._diffData&&this.latestData.forEach&&(null===(t=this._diffKeys)||void 0===t?void 0:t.length)){var n,i=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((function(t){t[vR]=i,e._diffMap.set(e._diffKeys.reduce((function(e,n){return e+t[n]}),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((function(t){t[vR]=i,n=e._diffKeys.reduce((function(e,n){return e+t[n]}),""),e._diffMap.get(n)?e.latestDataAUD.update.push(t):e.latestDataAUD.add.push(t),e._diffMap.set(n,t)})),this._diffMap.forEach((function(t,n){t[vR]<i&&(e.latestDataAUD.del.push(t),e._diffMap.delete(n))}));this._diffRank=i}}},{key:"cloneParseData",value:function(e,n){var i=!1;return e instanceof t||!0!==(null==n?void 0:n.clone)||(i=!0),i?qC(e):e}},{key:"parseNewData",value:function(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}},{key:"updateRawData",value:function(t,e){var n=this.cloneParseData(t,e);this.rawData=n,this.parserData=n,this.latestData=n,this.reRunAllTransform()}},{key:"getFields",value:function(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}},{key:"setFields",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?QC({},this._fields,t):t;var n=this.transformsArr.find((function(t){return"fields"===t.type}));!BC(this._fields)&&BC(n)?(this.dataSet.registerTransform("fields",ZE),this.transform({type:"fields",options:{fields:this._fields}},!1)):n&&(n.options.fields=this._fields)}},{key:"destroy",value:function(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}])}(),gR=function(t,e){return RC(mR.warnHandler)&&mR.warnHandler.call(null,t,e),e?dE.getInstance().warn("[VChart warn]: ".concat(t),e):dE.getInstance().warn("[VChart warn]: ".concat(t))},yR=function(t,e,n){if(!RC(mR.errorHandler))throw new Error(t);mR.errorHandler.call(null,t,e)},mR={silent:!1,warnHandler:!1,errorHandler:!1},kR=xp();function bR(t){return("desktop-browser"===t||"mobile-browser"===t)&&kR}function _R(t){return xR(t)||"mobile-browser"===t}function xR(t){return t.includes("miniApp")||"lynx"===t||"wx"===t}var wR=0;function SR(){return wR>=9999999&&(wR=0),wR++}var AR=function(t,e,n){return t.fields=e||[],t.fname=n,t},TR=function(t){return function(e){return YC(e,t)}},CR=function(t){dE.getInstance().error(t)},ER=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(RC(t))return t;var i=function(t){var e,n,i,r=[],a=t.length,o=null,s=0,u="";t+="";var l=function(){r.push(u+t.substring(e,n)),u="",e=n+1};for(e=0,n=0;n<a;n+=1)if("\\"===(i=t[n]))u+=t.substring(e,n),u+=t.substring(++n,++n),e=n;else if(i===o)l(),o=null,s=-1;else{if(o)continue;e===s&&'"'===i||e===s&&"'"===i?(e=n+1,o=i):"."!==i||s?"["===i?(n>e&&l(),s=e=n+1):"]"===i&&(s||CR("Access path missing open bracket: "+t),s>0&&l(),s=0,e=n+1):n>e?l():e=n+1}return s&&CR("Access path missing closing bracket: "+t),o&&CR("Access path missing closing quote: "+t),n>e&&(n+=1,l()),r}(t),r=1===i.length?i[0]:t;return AR((n&&n.get||TR)(i),[r],e||r)},RR=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(DC(t)){var i=t.map((function(t){return ER(t,e,n)}));return function(t){return i.map((function(e){return e(t)}))}}return ER(t,e,n)};RR("id");var BR=AR((function(t){return t}),[],"identity");AR((function(){return 0}),[],"zero"),AR((function(){return 1}),[],"one"),AR((function(){return!0}),[],"true"),AR((function(){return!1}),[],"false"),AR((function(){return{}}),[],"emptyObject");var MR,PR=function t(e,n,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(n===i)return!0;if(BC(n)||BC(i))return BC(n)&&BC(i);if(!OC(n)&&!OC(i))return n===i;var a=DC(n)?n:n[e],o=DC(i)?i:i[e];return a===o||!1!==r&&(DC(o)?!(!DC(a)||o.length!==a.length||!o.every((function(t,e){return t===a[e]}))):!!PC(o)&&!(!PC(a)||Object.keys(o).length!==Object.keys(a).length||!Object.keys(o).every((function(e){return t(e,o,a)}))))},OR=function(t,e){return BC(t)?e:LC(t)?e*parseFloat(t)/100:t},IR=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"],LR=function(t){function n(t,i){var r;return o(this,n),r=e(this,n,[t]),(null==i?void 0:i.mode)&&(r.mode=i.mode,r.setMode(i.mode)),(null==i?void 0:i.skipDefault)&&(r.skipDefault=!0),r.setTheme({common:{strokeBoundsBuffer:0}}),r.attribute=t,r.onSetStage((function(){r.render(),r.bindEvents()})),r}return c(n,t),u(n,[{key:"setAttribute",value:function(t,e,n){bt(this.attribute[t])&&bt(e)&&!pt(this.attribute[t])&&!pt(e)?It(this.attribute[t],e):this.attribute[t]=e,IR.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!n&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"setAttributes",value:function(t,e){var n=Object.keys(t);this._mergeAttributes(t,n),n.every((function(t){return IR.includes(t)}))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}},{key:"_mergeAttributes",value:function(t,e){gt(e)&&(e=Object.keys(t));for(var n=0;n<e.length;n++){var i=e[n];!bt(this.attribute[i])||pt(this.attribute[i])||pt(t[i])?this.attribute[i]=t[i]:It(this.attribute[i],t[i])}}},{key:"bindEvents",value:function(){}},{key:"_getNodeId",value:function(t){var e;return"".concat(null!==(e=this.id)&&void 0!==e?e:this._uid,"-").concat(this.name,"-").concat(t)}},{key:"_dispatchEvent",value:function(t,e){var n,i=new qr(t,e);i.manager=null===(n=this.stage)||void 0===n?void 0:n.eventSystem.manager,this.dispatchEvent(i)}}])}(nu);!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(MR||(MR={})),l(l(l(l({},MR.selectedReverse,{}),MR.selected,{}),MR.hover,{}),MR.hoverReverse,{});var DR,jR={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}},FR={poptip:It({},jR)};!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(DR||(DR={}));var NR={};function GR(t){return!!NR[t]}function zR(t){switch(t){case DR.Ordinal:case DR.Point:case DR.Band:return!0;default:return!1}}function UR(t){return t}function WR(t,e){if(t=Number(t),e=Number(e),e-=t)return function(n){return(n-t)/e};var n=Number.isNaN(e)?NaN:.5;return function(){return n}}function VR(t,e,n){var i,r,a=t[0],o=t[1],s=e[0],u=e[1];return o<a?(i=WR(o,a),r=n(u,s)):(i=WR(a,o),r=n(s,u)),function(t){return r(i(t))}}function HR(t,e,n){var i;return i=1===t?t+2*n:t-e+2*n,t?i>0?i:1:0}function YR(t,e){var n=(t[1]-t[0])/(e[1]-e[0]),i=t[0]-n*e[0];return[i,n+i]}function XR(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<i;)r[o]=WR(t[o],t[o+1]),a[o]=n(e[o],e[o+1]);return function(e){var n=fE(t,e,1,i)-1;return a[n](r[n](e))}}Object.values(DR).forEach((function(t){NR[t]=!0}));var KR=function(){return u((function t(){o(this,t),this._rangeFactorStart=null,this._rangeFactorEnd=null}),[{key:"_calculateWholeRange",value:function(t){return this._wholeRange?this._wholeRange:MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=YR(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}},{key:"rangeFactor",value:function(t,e,n){return t?(2===t.length&&t.every((function(t){return t>=0&&t<=1}))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):n?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}},{key:"rangeFactorStart",value:function(t,e){var n;return BC(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!BC(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(n=this._rangeFactorEnd)&&void 0!==n?n:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}},{key:"rangeFactorEnd",value:function(t,e){var n;return BC(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!BC(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(n=this._rangeFactorStart)&&void 0!==n?n:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}},{key:"generateFishEyeTransform",value:function(){var t;if(this._fishEyeOptions){var e=this._fishEyeOptions,n=e.distortion,i=void 0===n?2:n,r=e.radiusRatio,a=void 0===r?.1:r,o=e.radius,s=this.range(),u=s[0],l=s[s.length-1],c=Math.min(u,l),h=Math.max(u,l),d=bE(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,c,h),f=BC(o)?(h-c)*a:o,v=Math.exp(i);v=v/(v-1)*f;var p=i/f;this._fishEyeTransform=function(t){var e=Math.abs(t-d);if(e>=f)return t;if(e<=1e-6)return d;var n=v*(1-Math.exp(-e*p))/e*.75+.25;return d+(t-d)*n}}else this._fishEyeTransform=null}},{key:"unknown",value:function(t){return arguments.length?(this._unknown=t,this):this._unknown}}])}(),qR=Symbol("implicit"),ZR=function(t){function n(){var t;return o(this,n),(t=e(this,n)).type=DR.Ordinal,t._index=new Map,t._domain=[],t._ordinalRange=[],t._unknown=qR,t}return c(n,t),u(n,[{key:"specified",value:function(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}},{key:"_getSpecifiedValue",value:function(t){if(this._specified)return this._specified[t]}},{key:"clone",value:function(){var t=(new n).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}},{key:"calculateVisibleDomain",value:function(t){return MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}},{key:"scale",value:function(t){var e="".concat(t),n=this._getSpecifiedValue(e);if(void 0!==n)return n;var i=this._index.get(e);if(!i){if(this._unknown!==qR)return this._unknown;i=this._domain.push(t),this._index.set(e,i)}var r=this._ordinalRange[(i-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(r):r}},{key:"invert",value:function(t){for(var e=0;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}},{key:"domain",value:function(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;var e,n=b(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,r="".concat(i);this._index.has(r)||this._index.set(r,this._domain.push(i))}}catch(t){n.e(t)}finally{n.f()}return this}},{key:"range",value:function(t){if(!t)return this._ordinalRange.slice();var e=Array.from(t);return this._ordinalRange=e,this}},{key:"index",value:function(t){var e;return this._index&&null!==(e=this._index.get("".concat(t)))&&void 0!==e?e:-1}}])}(KR);function JR(t,e,n,i){var r,a,o=[];if(e=Math.floor(+e),t=Math.floor(+t),!(n=Math.floor(+n)))return[];if(t===e)return[t];if(r=e<t){var s=t;t=e,e=s}var u=_E(1,e-t+1)(n);if(a=Math.floor((e-t+1)/u),!i)for(;Math.ceil((e-t+1)/a)>n&&u>1;)u-=1,a=Math.floor((e-t)/u);for(var l=t;l<=e;)o.push(l),l+=a;return r&&o.reverse(),o}var $R=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).type=DR.Band,i._range=[0,1],i._step=void 0,i._bandwidth=void 0,i._isFixed=!1,i._round=!1,i._paddingInner=0,i._paddingOuter=0,i._align=.5,i._unknown=void 0,delete i.unknown,i.rescale(t),i}return c(n,t),u(n,[{key:"rescale",value:function(t,e){if(t)return this;this._wholeRange=null;var i=this._calculateWholeRange(this._range,e),r=p(h(n.prototype),"domain",this).call(this).length,a=i[1]<i[0],o=i[Number(a)-0],s=i[1-Number(a)],u=HR(r,this._paddingInner,this._paddingOuter);return this._step=(s-o)/Math.max(1,u||1),this._round&&(this._step=Math.floor(this._step)),o+=(s-o-this._step*(r-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(o=Math.round(o),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:a,start:a?o+this._step*(r-1):o,count:r},this.generateFishEyeTransform(),this}},{key:"scale",value:function(t){if(this._bandRangeState){var e="".concat(t),n=this._getSpecifiedValue(e);if(void 0!==n)return n;var i=this._index.get(e);if(!i){if(this._unknown!==qR)return this._unknown;i=this._domain.push(t),this._index.set(e,i)}var r=this._bandRangeState,a=r.count,o=r.start+(i-1)%a*(r.reverse?-1:1)*this._step;return this._fishEyeTransform?this._fishEyeTransform(o):o}}},{key:"_calculateWholeRange",value:function(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){var i;if(MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)&&2===t.length){var r=YR(t,[this._rangeFactorStart,this._rangeFactorEnd]);i=Math.abs(r[1]-r[0])}else i=Math.abs(t[1]-t[0]);var a=function(t,e,n,i,r){var a=HR(t,n,i),o=e/Math.max(1,a||1);r&&(o=Math.floor(o));var s=o*(1-n);return r&&(s=Math.round(s)),s}(p(h(n.prototype),"domain",this).call(this).length,i,this._paddingInner,this._paddingOuter,this._round);a<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):a>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=a,this._isFixed=!1)}if(this.isBandwidthFixed()){var o=(g=p(h(n.prototype),"domain",this).call(this).length,y=this._bandwidth,m=this._paddingInner,k=this._paddingOuter,1===m&&(m=0),HR(g,m,k)*(y/(1-m))*Math.sign(t[1]-t[0])),s=Math.min((t[1]-t[0])/o,1);if(MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)){if(o>0){var u=t[0]-o*this._rangeFactorStart,l=u+o;this._wholeRange=[u,l]}else{var c=t[1]+o*(1-this._rangeFactorEnd),d=c-o;this._wholeRange=[d,c]}var f=this._rangeFactorStart+s<=1,v=this._rangeFactorEnd-s>=0;"rangeFactorStart"===e&&f?this._rangeFactorEnd=this._rangeFactorStart+s:"rangeFactorEnd"===e&&v?this._rangeFactorStart=this._rangeFactorEnd-s:t[0]<=t[1]?f?this._rangeFactorEnd=this._rangeFactorStart+s:v?this._rangeFactorStart=this._rangeFactorEnd-s:(this._rangeFactorStart=0,this._rangeFactorEnd=s):v?this._rangeFactorStart=this._rangeFactorEnd-s:f?this._rangeFactorEnd=this._rangeFactorStart+s:(this._rangeFactorStart=1-s,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=s,this._wholeRange=[t[0],t[0]+o];return this._wholeRange}var g,y,m,k;return p(h(n.prototype),"_calculateWholeRange",this).call(this,t)}},{key:"calculateWholeRangeSize",value:function(){var t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}},{key:"calculateVisibleDomain",value:function(t){var e=this._domain;if(MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)&&e.length){var n=this._getInvertIndex(t[0]),i=this._getInvertIndex(t[1]);return e.slice(Math.min(n,i),Math.max(n,i)+1)}return e}},{key:"domain",value:function(t,e){return t?(p(h(n.prototype),"domain",this).call(this,t),this.rescale(e)):p(h(n.prototype),"domain",this).call(this)}},{key:"range",value:function(t,e){return t?(this._range=[uE(t[0]),uE(t[1])],this.rescale(e)):this._range}},{key:"rangeRound",value:function(t,e){return this._range=[uE(t[0]),uE(t[1])],this._round=!0,this.rescale(e)}},{key:"ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return-1===t?e:JR(0,e.length-1,t,!1).map((function(t){return e[t]}))}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.ticks(e).map((function(e,n){return{index:n,tick:e,value:(t.scale(e)-t._range[0]+t._bandwidth/2)/(t._range[1]-t._range[0])}}))}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return JR(0,e.length-1,t,!0).filter((function(t){return t<e.length})).map((function(t){return e[t]}))}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return function(t,e,n){var i,r=[];if(n=_E(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+n)),i=e<t){var a=t;t=e,e=a}for(var o=t;o<=e;)r.push(o),o+=n;return i&&r.reverse(),r}(0,e.length-1,t).map((function(t){return e[t]}))}},{key:"_getInvertIndex",value:function(t){var e=0,n=this.step()/2,i=this.bandwidth()/2,r=this._domain.length,a=this.range(),o=a[0]>a[a.length-1];for(e=0;e<r;e++){var s=this.scale(this._domain[e])+i;if(0===e&&(!o&&!yE(t,s+n)||o&&!mE(t,s-n)))break;if(e===r-1)break;if(!mE(t,s-n)&&!yE(t,s+n))break}return e>=0&&e<=r-1?e:r-1}},{key:"invert",value:function(t){return this._domain[this._getInvertIndex(t)]}},{key:"padding",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}},{key:"paddingInner",value:function(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}},{key:"paddingOuter",value:function(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}},{key:"step",value:function(){return this._step}},{key:"round",value:function(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}},{key:"align",value:function(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}},{key:"rangeFactor",value:function(t,e){return t?(p(h(n.prototype),"rangeFactor",this).call(this,t),this.rescale(e)):p(h(n.prototype),"rangeFactor",this).call(this)}},{key:"rangeFactorStart",value:function(t,e){return BC(t)?p(h(n.prototype),"rangeFactorStart",this).call(this):(p(h(n.prototype),"rangeFactorStart",this).call(this,t),this.rescale(e,"rangeFactorStart"))}},{key:"rangeFactorEnd",value:function(t,e){return BC(t)?p(h(n.prototype),"rangeFactorEnd",this).call(this):(p(h(n.prototype),"rangeFactorEnd",this).call(this,t),this.rescale(e,"rangeFactorEnd"))}},{key:"bandwidth",value:function(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}},{key:"maxBandwidth",value:function(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}},{key:"minBandwidth",value:function(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}},{key:"fishEye",value:function(t,e,n){return t||n?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}},{key:"isBandwidthFixed",value:function(){return this._isFixed&&!!this._bandwidth}},{key:"_isBandwidthFixedByUser",value:function(){return this._isFixed&&this._userBandwidth&&NC(this._userBandwidth)}},{key:"clone",value:function(){var t,e,i;return new n(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}])}(ZR),QR=function(t,e){var n=t.r,i=e.r,r=t.g,a=e.g,o=t.b,s=e.b,u=t.opacity,l=e.opacity;return function(t){var e=Math.round(n*(1-t)+i*t),c=Math.round(r*(1-t)+a*t),h=Math.round(o*(1-t)+s*t);return new WE(e,c,h,u*(1-t)+l*t)}};function tB(t,e){var n,i=a(e);if(BC(e)||"boolean"===i)return function(){return e};if("number"===i)return AE(t,e);if("string"===i){if(n=UE.parseColorString(e)){var r=QR(UE.parseColorString(t),n);return function(t){return r(t).formatRgb()}}return AE(Number(t),Number(e))}return e instanceof WE?QR(t,e):e instanceof UE?QR(t.color,e.color):e instanceof Date?function(t,e){var n=t.valueOf(),i=e.valueOf(),r=new Date;return function(t){return r.setTime(n*(1-t)+i*t),r}}(t,e):AE(Number(t),Number(e))}var eB=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:UR,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:UR;return o(this,n),(t=e(this,n))._unknown=void 0,t.transformer=i,t.untransformer=r,t._forceAlign=!0,t._domain=[0,1],t._range=[0,1],t._clamp=UR,t._piecewise=VR,t._interpolate=tB,t}return c(n,t),u(n,[{key:"calculateVisibleDomain",value:function(t){var e;return MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}},{key:"fishEye",value:function(t,e,n){return t||n?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}},{key:"scale",value:function(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));var n=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(n):n}},{key:"invert",value:function(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),AE)),this._clamp(this.untransformer(this._input(t)))}},{key:"domain",value:function(t,e){var n;if(!t)return(null!==(n=this._niceDomain)&&void 0!==n?n:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;var i=Array.from(t,uE);return this._domain=i,this.rescale(e)}},{key:"range",value:function(t,e){if(!t)return this._range.slice();var n=Array.from(t);return this._range=n,this.rescale(e)}},{key:"rangeRound",value:function(t,e){var n=Array.from(t);return this._range=n,this._interpolate=TE,this.rescale(e)}},{key:"rescale",value:function(t){var e;if(t)return this;var n=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,i=n.length,r=this._range.length,a=Math.min(i,r);if(i&&i<r&&this._forceAlign){for(var o=r-i+1,s=n[i-1],u=i>=2?(s-n[i-2])/o:0,l=1;l<=o;l++)n[i-2+l]=s-u*(o-l);a=r}return this._autoClamp&&(this._clamp=_E(n[0],n[a-1])),this._piecewise=a>2?XR:VR,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}},{key:"clamp",value:function(t,e,n){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:UR),this.rescale(n)):this._clamp!==UR}},{key:"interpolate",value:function(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}},{key:"ticks",value:function(){return[]}},{key:"tickData",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=this.ticks(e);return(null!=n?n:[]).map((function(e,n){return{index:n,tick:e,value:(t.scale(e)-t._range[0])/(t._range[1]-t._range[0])}}))}},{key:"rangeFactor",value:function(t,e){return t?(p(h(n.prototype),"rangeFactor",this).call(this,t),this._output=this._input=null,this):p(h(n.prototype),"rangeFactor",this).call(this)}},{key:"rangeFactorStart",value:function(t,e){return BC(t)?p(h(n.prototype),"rangeFactorStart",this).call(this):(p(h(n.prototype),"rangeFactorStart",this).call(this,t),this._output=this._input=null,this)}},{key:"rangeFactorEnd",value:function(t,e){return BC(t)?p(h(n.prototype),"rangeFactorEnd",this).call(this):(p(h(n.prototype),"rangeFactorEnd",this).call(this,t),this._output=this._input=null,this)}},{key:"forceAlignDomainRange",value:function(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}])}(KR),nB=Math.sqrt(50),iB=Math.sqrt(10),rB=Math.sqrt(2),aB=[1,2,5,10],oB=function(t,e,n){var i=1,r=t,a=Math.floor((e-1)/2),o=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?r=0:t<0&&t>=-Number.MIN_VALUE?r=-(e-1):!n&&o<1?i=cB(o).step:(n||o>1)&&(r=Math.floor(t)-a*i),i>0?(t>0?r=Math.max(r,0):t<0&&(r=Math.min(r,-(e-1)*i)),function(t,e,n){MC(e)||(e=t,t=0),MC(n)||(n=1);for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(r);++i<r;)a[i]=t+i*n;return a}(0,e).map((function(t){return r+t*i}))):t>0?uB(0,-(e-1)/i,i):uB((e-1)/i,0,i)},sB=kE((function(t,e,n,i){var r,a,o,s,u=-1;if(n=+n,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return[t];if((r=e<t)&&(a=t,t=e,e=a),s=hB(t,e,n).step,!isFinite(s))return[];if(s>0){var l=Math.round(t/s),c=Math.round(e/s);for(l*s<t&&++l,c*s>e&&--c,o=new Array(a=c-l+1);++u<a;)o[u]=(l+u)*s}else if(s<0&&(null==i?void 0:i.noDecimals)){s=1;var h=Math.ceil(t),d=Math.floor(e);if(!(h<=d))return[];for(o=new Array(a=d-h+1);++u<a;)o[u]=h+u}else{s=-s;var f=Math.round(t*s),v=Math.round(e*s);for(f/s<t&&++f,v/s>e&&--v,o=new Array(a=v-f+1);++u<a;)o[u]=(f+u)/s}return r&&o.reverse(),o})),uB=function(t,e,n){var i,r,a=-1;if(n>0){var o=Math.floor(t/n),s=Math.ceil(e/n);for((o+1)*n<t&&++o,(s-1)*n>e&&--s,r=new Array(i=s-o+1);++a<i;)r[a]=(o+a)*n}else{n=-n;var u=Math.floor(t*n),l=Math.ceil(e*n);for((u+1)/n<t&&++u,(l-1)/n>e&&--l,r=new Array(i=l-u+1);++a<i;)r[a]=(u+a)/n}return r},lB=kE((function(t,e,n,i){var r,a,o;if(n=+n,(t=+t)==(e=+e))return oB(t,n,null==i?void 0:i.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&n>0)return oB(t,n,null==i?void 0:i.noDecimals);(r=e<t)&&(o=t,t=e,e=o);var s=hB(t,e,n),u=s.step;if(!isFinite(u))return[];if(u>0){for(var l=1,c=s.power,h=10===s.gap?2*Math.pow(10,c):1*Math.pow(10,c);l<=5&&(a=uB(t,e,u)).length>n+1&&n>2;)u+=h,l+=1;n>2&&a.length<n-1&&(a=function(t,e,n){var i,r=t[0],a=t[t.length-1],o=e-t.length;if(a<=0){var s=[];for(i=o;i>=1;i--)s.push(r-i*n);return s.concat(t)}if(r>=0){for(i=1;i<=o;i++)t.push(a+i*n);return t}var u=[],l=[];for(i=1;i<=o;i++)i%2==0?u=[r-Math.floor(i/2)*n].concat(u):l.push(a+Math.ceil(i/2)*n);return u.concat(t).concat(l)}(a,n,u))}else(null==i?void 0:i.noDecimals)&&u<0&&(u=1),a=uB(t,e,u);return r&&a.reverse(),a})),cB=function(t){var e=Math.floor(Math.log(t)/Math.LN10),n=t/Math.pow(10,e),i=aB[0];return n>=nB?i=aB[3]:n>=iB?i=aB[2]:n>=rB&&(i=aB[1]),e>=0?{step:i*Math.pow(10,e),gap:i,power:e}:{step:-Math.pow(10,-e)/i,gap:i,power:e}};function hB(t,e,n){var i=(e-t)/Math.max(0,n);return cB(i)}function dB(t,e,n){var i;if(n=+n,(t=+t)==(e=+e)&&n>0)return[t];if(n<=0||0===(i=function(t,e,n){return(e-t)/Math.max(1,n-1)}(t,e,n))||!isFinite(i))return[];for(var r=new Array(n),a=0;a<n;a++)r[a]=t+a*i;return r}function fB(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=0,a=t.length-1,o=t[r],s=t[a],u=10;for(s<o&&(n=o,o=s,s=n,n=r,r=a,a=n);u-- >0;){if((n=hB(o,s,i).step)===e)return t[r]=o,t[a]=s,t;if(n>0)o=Math.floor(o/n)*n,s=Math.ceil(s/n)*n;else{if(!(n<0))break;o=Math.ceil(o*n)/n,s=Math.floor(s*n)/n}e=n}}var vB=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type=DR.Linear,t}return c(n,t),u(n,[{key:"clone",value:function(){return(new n).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}},{key:"tickFormat",value:function(){return function(){}}},{key:"d3Ticks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0,n=this.calculateVisibleDomain(this._range);return sB(n[0],n[n.length-1],t,e)}},{key:"ticks",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=arguments.length>1?arguments[1]:void 0;if(MC(this._rangeFactorStart)&&MC(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(e,n);var i=null!==(t=this._niceDomain)&&void 0!==t?t:this._domain,r=this._domain,a=i[0],o=i[i.length-1],s=lB(r[0],r[r.length-1],e,n);if(!s.length)return s;if(this._domainValidator)s=s.filter(this._domainValidator);else if((s[0]!==a||s[s.length-1]!==o)&&this._niceType){var u=i.slice();if("all"===this._niceType?(u[0]=s[0],u[u.length-1]=s[s.length-1],this._niceDomain=u,this.rescale()):"min"===this._niceType&&s[0]!==a?(u[0]=s[0],this._niceDomain=u,this.rescale()):"max"===this._niceType&&s[s.length-1]!==o&&(u[u.length-1]=s[s.length-1],this._niceDomain=u,this.rescale()),"all"!==this._niceType){var l=Math.min(u[0],u[u.length-1]),c=Math.max(u[0],u[u.length-1]);s=s.filter((function(t){return t>=l&&t<=c}))}}return s}},{key:"forceTicks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=this.calculateVisibleDomain(this._range);return dB(e[0],e[e.length-1],t)}},{key:"stepTicks",value:function(t){var e=this.calculateVisibleDomain(this._range);return function(t,e,n){var i,r,a=-1;if(n=+n,(r=(e=+e)<(t=+t))&&(i=t,t=e,e=i),!isFinite(n)||e-t<=n)return[t];for(var o=Math.floor((e-t)/n+1),s=new Array(o);++a<o;)s[a]=t+a*n;return r&&s.reverse(),s}(e[0],e[e.length-1],t)}},{key:"nice",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1?arguments[1]:void 0,r=this._domain,a=[];if(i){var o=function(t,e){var n=NC(e.forceMin),i=NC(e.forceMax),r=null,a=[],o=null,s=n&&i?function(t){return t>=e.forceMin&&t<=e.forceMax}:n?function(t){return t>=e.forceMin}:i?function(t){return t<=e.forceMax}:null;return n?a[0]=e.forceMin:NC(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(a[0]=e.min),i?a[1]=e.forceMax:NC(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(a[1]=e.max),NC(a[0])&&NC(a[1])?((o=t.slice())[0]=a[0],o[o.length-1]=a[1]):r=NC(a[0])||NC(a[1])?NC(a[0])?"max":"min":"all",{niceType:r,niceDomain:o,niceMinMax:a,domainValidator:s}}(r,i);if(a=o.niceMinMax,this._domainValidator=o.domainValidator,this._niceType=o.niceType,o.niceDomain)return this._niceDomain=o.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){var s=fB(r.slice(),n);"min"===this._niceType?s[s.length-1]=null!==(t=a[1])&&void 0!==t?t:s[s.length-1]:"max"===this._niceType&&(s[0]=null!==(e=a[0])&&void 0!==e?e:s[0]),this._niceDomain=s,this.rescale()}return this}},{key:"niceMin",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="min";var e=this._domain[this._domain.length-1],n=fB(this.domain(),t);return n&&(n[n.length-1]=e,this._niceDomain=n,this.rescale()),this}},{key:"niceMax",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="max";var e=this._domain[0],n=fB(this._domain.slice(),t);return n&&(n[0]=e,this._niceDomain=n,this.rescale()),this}}])}(eB),pB=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[!1])).type=DR.Point,i._padding=0,i.paddingInner(1,t),i.padding=i.paddingOuter,i.paddingInner=void 0,i.paddingOuter=void 0,i}return c(n,t),u(n)}($R),gB=function(){function t(){o(this,t),this.type=DR.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}return u(t,[{key:"unknown",value:function(t){return arguments.length?(this._unknown=t,this):this._unknown}},{key:"scale",value:function(t){return!BC(t)&&GC(+t)?this._range[fE(this._domain,t,0,this.n)]:this._unknown}},{key:"invertExtent",value:function(t){var e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}},{key:"domain",value:function(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}},{key:"range",value:function(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}},{key:"clone",value:function(){return(new t).domain(this._domain).range(this._range).unknown(this._unknown)}}])}();nT(),ST(),xT(),oT();var yB=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[(null==i?void 0:i.skipDefault)?t:It({},n.defaultAttributes,t)])).name="timeline",r}return c(n,t),u(n,[{key:"render",value:function(){var t=this,e=this.attribute,n=e.width,i=e.lineStyle,r=e.activeLineStyle,a=e.symbolStyle,o=e.activeSymbolStyle,s=e.labelStyle,u=e.activeLabelStyle,l=e.times,c=e.pointLayoutMode,h=e.labelSpace,d=e.clipRange,f=e.animation;if(l&&l.length){var v=(wt(a.size)?a.size[1]:a.size)||0,p=(wt(o.size)?o.size[1]:o.size)||0,g=Math.max(i.lineWidth||0,r.lineWidth||0,v,p),y=g/2,m={y:y,points:[{x:0,y:0},{x:n,y:0}]};this._line=this.createOrUpdateChild("line-axes",Object.assign(Object.assign({},i),m),"line"),this._activeLine=this.createOrUpdateChild("active-line-axes",Object.assign(Object.assign(Object.assign({},r),m),{clipRange:d}),"line");var k=n*d,b=this.createOrUpdateChild("symbol-group",{y:y},"group"),_=1===l.length?n:"space-between"===c?n/(l.length-1):n/l.length,x="space-between"===c?0:_/2;this._timesPercent=l.map((function(t,e){return(x+_*e)/n})),l.forEach((function(e,i){var r=t._timesPercent[i]*n;b.createOrUpdateChild(e.label,Object.assign(Object.assign({},a),{x:r}),"symbol")})),this._symbolGroup=b;var w=g+h,S=this.createOrUpdateChild("label-group",{y:w},"group");l.forEach((function(e,i){var r=t._timesPercent[i]*n;S.createOrUpdateChild(e.label,Object.assign(Object.assign({},s),{x:r,text:e.label}),"text")})),this._labelGroup=S;var A=function(t,e){t.forEachChildren((function(t){if(t.currentStates){var n=t.currentStates;t.clearStates(),t.useStates(n,!1)}t.states={active:e},t.attribute.x<=k&&t.useStates(["active"],f)}))};A(S,u),A(b,o)}}},{key:"appearAnimate",value:function(t){var e=t.duration,n=void 0===e?1e3:e,i=t.easing,r=void 0===i?"quadOut":i,a=this.attribute,o=a.activeLabelStyle,s=a.activeSymbolStyle,u=n/1e3,l=500*u,c=200*u,h=100*u,d=90*u,f=100*u,v=600*u;if(this._line&&(this._line.setAttributes({clipRange:0}),this._line.animate().to({clipRange:1},l,r)),this._activeLine&&(this._activeLine.setAttributes({opacity:0}),this._activeLine.animate().wait(500).to({opacity:1},c,r)),this._symbolGroup){var p=this._symbolGroup.count-1,g=u*(1===p?0:400/(p-1)),y=u*(1===p?0:240/(p-1));this._symbolGroup.forEachChildren((function(t,e){var n={};Object.keys(s).forEach((function(e){n[e]=t.attribute[e]})),t.setAttributes({opacity:0}),t.animate().wait(f+g*e).to({opacity:1},h,r),t.animate().wait(v+y*e).to(Object.assign({scaleX:1.8,scaleY:1.8},s),d,r).to(Object.assign({scaleX:1,scaleY:1},n),d,r)}))}if(this._labelGroup){var m=this._labelGroup.count-1,k=u*(1===m?0:400/(m-1)),b=u*(1===m?0:240/(m-1));this._labelGroup.forEachChildren((function(t,e){var n={};Object.keys(o).forEach((function(e){n[e]=t.attribute[e]})),t.setAttributes({opacity:0}),t.animate().wait(f+k*e).to({opacity:1},h,r),t.animate().wait(v+b*e).to(Object.assign({dy:10},o),d,r).to(Object.assign({dy:0},n),d,r)}))}}},{key:"goto",value:function(t,e){var n,i=this.attribute.clipRange,r=this.attribute.animation;if(t>0){if(i>=1)return;i<0&&(i=0)}else{if(i<=0)return;i>1&&(i=1)}i!==this.attribute.clipRange&&this.setAttributes({clipRange:i});for(var a=0;a<this._timesPercent.length&&!(i<this._timesPercent[a]);a++);var o=t>0?this._timesPercent[a]:this._timesPercent[a-1]||0;if(r){var s=e.duration,u=void 0===s?1e3:s,l=e.easing,c=void 0===l?"quadOut":l,h=Math.abs(o-i)/(this._timesPercent[a]-(null!==(n=this._timesPercent[a-1])&&void 0!==n?n:0))*u;this.animate().to({clipRange:o},h,c)}else this.setAttributes({clipRange:o})}},{key:"forward",value:function(t){this.goto(1,t)}},{key:"backward",value:function(t){this.goto(-1,t)}}])}(LR);function mB(t,e){var n=kB(t),i=kB(e),r=Math.asin((t.x*e.y-e.x*t.y)/n/i),a=Math.acos((t.x*e.x+t.y*e.y)/n/i);return r<0?-a:a}function kB(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:0,y:0};return BE.distancePP(t,e)}yB.defaultAttributes={labelSpace:10,pointLayoutMode:"space-around",animation:!0,symbolStyle:{fill:"black",size:12,symbolType:"circle"},activeSymbolStyle:{fill:"orange"},lineStyle:{lineDash:[2,2],lineCap:"butt",stroke:"black",lineWidth:2},activeLineStyle:{stroke:"orange",lineWidth:4},labelStyle:{fontSize:12,fill:"black",textAlign:"center",textBaseline:"top"},activeLabelStyle:{fontSize:14,fill:"orange"},clipRange:0};var bB,_B,xB=function(t,e){for(var n=0;n<t.length;n++)for(var i=t[n].getSeries(),r=0;r<i.length;r++){var a=i[r];if(e&&a&&a.coordinate===e)return a;if(!e&&a)return a}return null};!function(t){t.area="area",t.line="line",t.bar="bar",t.bar3d="bar3d",t.rangeColumn="rangeColumn",t.rangeColumn3d="rangeColumn3d",t.rangeArea="rangeArea",t.dot="dot",t.geo="geo",t.link="link",t.map="map",t.pie="pie",t.pie3d="pie3d",t.radar="radar",t.rose="rose",t.scatter="scatter",t.circularProgress="circularProgress",t.wordCloud="wordCloud",t.wordCloud3d="wordCloud3d",t.funnel="funnel",t.funnel3d="funnel3d",t.linearProgress="linearProgress",t.boxPlot="boxPlot",t.sankey="sankey",t.gaugePointer="gaugePointer",t.gauge="gauge",t.treemap="treemap",t.sunburst="sunburst",t.circlePacking="circlePacking",t.waterfall="waterfall",t.heatmap="heatmap",t.correlation="correlation",t.liquid="liquid",t.venn="venn"}(bB||(bB={})),function(t){t.label="label",t.point="point",t.line="line",t.area="area",t.bar="bar",t.bar3d="bar3d",t.boxPlot="boxPlot",t.outlier="outlier",t.circlePacking="circlePacking",t.group="group",t.gridBackground="gridBackground",t.grid="grid",t.dot="dot",t.title="title",t.subTitle="subTitle",t.symbol="symbol",t.funnel="funnel",t.funnel3d="funnel3d",t.transform="transform",t.transform3d="transform3d",t.transformLabel="transformLabel",t.outerLabel="outerLabel",t.outerLabelLine="outerLabelLine",t.pin="pin",t.pinBackground="pinBackground",t.pointer="pointer",t.segment="segment",t.track="track",t.cell="cell",t.cellBackground="cellBackground",t.link="link",t.arrow="arrow",t.pie="pie",t.pie3d="pie3d",t.labelLine="labelLine",t.progress="progress",t.minLabel="minLabel",t.maxLabel="maxLabel",t.rose="rose",t.node="node",t.sunburst="sunburst",t.nonLeaf="nonLeaf",t.leaf="leaf",t.nonLeafLabel="nonLeafLabel",t.leaderLine="leaderLine",t.stackLabel="stackLabel",t.word="word",t.fillingWord="fillingWord",t.nodePoint="nodePoint",t.ripplePoint="ripplePoint",t.centerPoint="centerPoint",t.centerLabel="centerLabel",t.barBackground="barBackground",t.lineLabel="lineLabel",t.areaLabel="areaLabel",t.liquid="liquid",t.liquidBackground="liquidBackground",t.liquidOutline="liquidOutline",t.circle="circle",t.overlap="overlap",t.overlapLabel="overlapLabel"}(_B||(_B={}));var wB,SB,AB,TB,CB,EB,RB,BB,MB,PB,OB,IB,LB,DB,jB,FB="__VCHART";!function(t){t.enter="enter",t.update="update",t.exit="exit",t.group="group",t.connectNulls="connectNulls"}(wB||(wB={})),function(t){t.enter="enter",t.update="update",t.exit="exit",t.unChange="unChange"}(SB||(SB={})),function(t){t.arc="arc",t.arc3d="arc3d",t.area="area",t.image="image",t.line="line",t.path="path",t.rect="rect",t.rect3d="rect3d",t.rule="rule",t.shape="shape",t.symbol="symbol",t.text="text",t.richtext="richtext",t.polygon="polygon",t.pyramid3d="pyramid3d",t.circle="circle",t.cell="cell",t.interval="interval",t.group="group",t.glyph="glyph",t.component="component",t.largeRects="largeRects",t.largeSymbols="largeSymbols"}(AB||(AB={})),function(t){t.axis="axis",t.grid="grid",t.legend="legend",t.slider="slider",t.label="label",t.datazoom="datazoom",t.player="player",t.title="title",t.scrollbar="scrollbar"}(TB||(TB={})),function(t){t[t.player=1]="player",t[t.rollUp=2]="rollUp",t[t.drillDown=3]="drillDown",t[t.slider=4]="slider",t[t.datazoom=5]="datazoom",t[t.legend=6]="legend",t[t.scrollbar=7]="scrollbar",t[t.brush=8]="brush",t[t.normal=9]="normal"}(CB||(CB={})),function(t){t.lineAxis="lineAxis",t.circleAxis="circleAxis"}(EB||(EB={})),function(t){t.lineAxisGrid="lineAxisGrid",t.circleAxisGrid="circleAxisGrid"}(RB||(RB={})),function(t){t.discreteLegend="discreteLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend"}(BB||(BB={})),function(t){t.lineCrosshair="lineCrosshair",t.rectCrosshair="rectCrosshair",t.sectorCrosshair="sectorCrosshair",t.circleCrosshair="circleCrosshair",t.polygonCrosshair="polygonCrosshair",t.ringCrosshair="ringCrosshair"}(MB||(MB={})),function(t){t.symbolLabel="symbolLabel",t.rectLabel="rectLabel",t.lineLabel="lineLabel",t.dataLabel="dataLabel"}(PB||(PB={})),function(t){t.continuousPlayer="continuousPlayer",t.discretePlayer="discretePlayer"}(OB||(OB={})),function(t){t.before="before",t.layouting="layouting",t.reevaluate="reevaluate",t.after="after"}(IB||(IB={})),function(t){t.BEFORE_EVALUATE_DATA="beforeEvaluateData",t.AFTER_EVALUATE_DATA="afterEvaluateData",t.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",t.AFTER_EVALUATE_SCALE="afterEvaluateScale",t.BEFORE_PARSE_VIEW="beforeParseView",t.AFTER_PARSE_VIEW="afterParseView",t.BEFORE_TRANSFORM="beforeTransform",t.AFTER_TRANSFORM="afterTransform",t.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",t.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",t.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",t.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",t.BEFORE_STAGE_RESIZE="beforeStageResize",t.AFTER_STAGE_RESIZE="afterStageResize",t.BEFORE_VRENDER_DRAW="beforeVRenderDraw",t.AFTER_VRENDER_DRAW="afterVRenderDraw",t.BEFORE_MARK_JOIN="beforeMarkJoin",t.AFTER_MARK_JOIN="afterMarkJoin",t.BEFORE_MARK_UPDATE="beforeMarkUpdate",t.AFTER_MARK_UPDATE="afterMarkUpdate",t.BEFORE_MARK_STATE="beforeMarkState",t.AFTER_MARK_STATE="afterMarkState",t.BEFORE_MARK_ENCODE="beforeMarkEncode",t.AFTER_MARK_ENCODE="afterMarkEncode",t.BEFORE_DO_LAYOUT="beforeDoLayout",t.AFTER_DO_LAYOUT="afterDoLayout",t.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",t.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",t.BEFORE_DO_RENDER="beforeDoRender",t.AFTER_DO_RENDER="afterDoRender",t.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",t.AFTER_MARK_RENDER_END="afterMarkRenderEnd",t.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",t.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",t.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",t.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",t.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",t.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",t.AFTER_ELEMENT_UPDATE_DATA="afterElementUpdateData",t.BEFORE_ELEMENT_STATE="beforeElementState",t.AFTER_ELEMENT_STATE="afterElementState",t.BEFORE_ELEMENT_ENCODE="beforeElementEncode",t.AFTER_ELEMENT_ENCODE="afterElementEncode",t.ANIMATION_START="animationStart",t.ANIMATION_END="animationEnd",t.ELEMENT_ANIMATION_START="elementAnimationStart",t.ELEMENT_ANIMATION_END="elementAnimationEnd",t.ALL_ANIMATION_START="allAnimationStart",t.ALL_ANIMATION_END="allAnimationEnd"}(LB||(LB={})),function(t){t.signal="signal",t.data="data",t.scale="scale",t.coordinate="coordinate",t.mark="mark"}(DB||(DB={})),function(t){t.active="active",t.selected="selected",t.highlight="highlight",t.blur="blur"}(jB||(jB={}));var NB="__vgrammar_scene_item__",GB=[AB.line,AB.area],zB=[AB.arc3d,AB.rect3d,AB.pyramid3d],UB="key",WB=[{}],VB=["key"],HB="VGRAMMAR_IMMEDIATE_ANIMATION",YB=0,XB=1e3,KB=0,qB=0,ZB=!1,JB=!1,$B="quintInOut",QB={stopWhenStateChange:!1,immediatelyApply:!0};function tM(t,e){return aE(t).reduce((function(t,n){var i=LC(n)?e.getGrammarById(n):n;return i&&t.push(i),t}),[])}function eM(t,e){if(BC(t))return[];if(function(t){return!RC(t)&&!!(null==t?void 0:t.signal)}(t)){var n=t.signal;if(LC(n))return aE(e.getGrammarById(n));if("signal"===(null==n?void 0:n.grammarType))return[n]}else if(function(t){return!RC(t)&&!!(null==t?void 0:t.callback)}(t))return tM(t.dependency,e);return[]}function nM(t){return RC(t)||(null==t?void 0:t.signal)||!!(null==t?void 0:t.callback)}function iM(t,e,n,i){if(BC(t))return t;if(RC(t))return i?t.call(null,n,i,e):t.call(null,n,e);if(t.signal){var r=t.signal;return LC(r)?null==e?void 0:e[r]:r.output()}return t.callback?i?t.callback.call(null,n,i,e):t.callback.call(null,n,e):t}function rM(t,e){return aM(t)?t.output():e[t]}var aM=function(t){return t&&!BC(t.grammarType)},oM=function(t){return RC(t)?t:function(e){return e[t]}};function sM(t){return!!(null==t?void 0:t.scale)}function uM(t){return!!(null==t?void 0:t.field)}function lM(t,e){if(!t)return[];var n=[];return t.scale&&(n=aM(t.scale)?[t.scale]:aE(e.getScaleById(t.scale))),n.concat(eM(t,e))}function cM(t,e){switch(e){case"line":return t.some((function(t){return["x","y","defined"].includes(t)}));case"area":return t.some((function(t){return["x","y","x1","y1","defined"].includes(t)}));case"largeRects":return t.some((function(t){return["x","y","width","y1"].includes(t)}));case"largeSymbols":return t.some((function(t){return["x","y"].includes(t)}))}return!1}function hM(t,e,n,i,r){n&&(nM(n)?e.forEach((function(e){var r=iM(n,i,e.datum,t);Object.assign(e.nextAttrs,r)})):Object.keys(n).forEach((function(a){var o,s,u=n[a],l=r&&!function(t,e){if(["x","y","dx","dy"].includes(e))return!0;switch(t){case AB.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(e);case AB.group:case AB.rect:case AB.image:return["width","height","y1"].includes(e);case AB.path:case AB.shape:return["path","customPath"].includes(e);case AB.line:return"defined"===e;case AB.area:return["x1","y1","defined"].includes(e);case AB.rule:return["x1","y1"].includes(e);case AB.symbol:return"size"===e;case AB.polygon:return"points"===e;case AB.text:return"text"===e}return!1}(t.mark.markType,a)?[e[0]]:e;if(sM(u)){var c=rM(u.scale,i),h=null!==(o=null==u?void 0:u.offset)&&void 0!==o?o:0,d=!BC(u.band)&&c.bandwidth?c.bandwidth()*u.band:null,f=LC(null==u?void 0:u.field),v=f?RR(u.field):null,p=f?null:BC(null==u?void 0:u.value)?0:null===(s=c.scale)||void 0===s?void 0:s.call(c,u.value);l.forEach((function(t){var e;f&&(p=null===(e=c.scale)||void 0===e?void 0:e.call(c,v(t.datum))),t.nextAttrs[a]=NC(p)||NC(d)?p+h+d:p}))}else if(uM(u)){var g=RR(u.field);l.forEach((function(t){t.nextAttrs[a]=g(t.datum)}))}else l.forEach((function(e){e.nextAttrs[a]=iM(u,i,e.datum,t)}))})))}function dM(t,e,n,i){if(!t)return null;if(nM(t))return iM(t,i,e,n);var r={};return Object.keys(t).forEach((function(a){var o,s,u,l=t[a];if(sM(l)){var c=rM(l.scale,i),h=null!==(o=null==l?void 0:l.offset)&&void 0!==o?o:0,d=!BC(l.band)&&c.bandwidth?c.bandwidth()*l.band:null,f=LC(null==l?void 0:l.field),v=f?RR(l.field):null,p=f?null===(s=c.scale)||void 0===s?void 0:s.call(c,v(e)):BC(null==l?void 0:l.value)?0:null===(u=c.scale)||void 0===u?void 0:u.call(c,l.value);r[a]=NC(p)||NC(d)?p+h+d:p}else if(uM(l)){var g=RR(l.field);r[a]=g(e)}else r[a]=iM(l,i,e,n)})),r}var fM=function(){return u((function t(e,n,i,r){o(this,t),this.channelEncoder={},this.marks=e,n&&this.registerChannelEncoder(n),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(r)}),[{key:"getMarks",value:function(){return this.marks}},{key:"registerChannelEncoder",value:function(t,e){return LC(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}},{key:"registerFunctionEncoder",value:function(t){return this.functionEncoder=t,this}},{key:"registerDefaultEncoder",value:function(t){return this.defaultEncoder=t,this}},{key:"registerProgressiveChannels",value:function(t){return this.progressiveChannels=aE(t),this}},{key:"getChannelEncoder",value:function(){return this.channelEncoder}},{key:"getFunctionEncoder",value:function(){return this.functionEncoder}},{key:"getDefaultEncoder",value:function(){return this.defaultEncoder}},{key:"getProgressiveChannels",value:function(){return this.progressiveChannels}}])}(),vM=function(){function t(){o(this,t)}return u(t,null,[{key:"registerPlotMarks",value:function(e,n){t._plotMarks[e]=n}},{key:"createPlotMark",value:function(e,n){return t._plotMarks[e]?new t._plotMarks[e](n):null}},{key:"registerMark",value:function(e,n){t._marks[e]=n}},{key:"createMark",value:function(e,n,i){return t._marks[e]?new t._marks[e](n,e,i):null}},{key:"hasMark",value:function(e){return!!t._marks[e]}},{key:"registerComponent",value:function(e,n){t._components[e]=n}},{key:"createComponent",value:function(e,n,i,r){var a=t._components[e];return a?new a(n,i,r):null}},{key:"hasComponent",value:function(e){return!!t._components[e]}},{key:"registerGraphicComponent",value:function(e,n){t._graphicComponents[e]=n}},{key:"createGraphicComponent",value:function(e,n,i){var r=t._graphicComponents[e];return r?r(n,i):null}},{key:"registerTransform",value:function(e,n,i){t._transforms[e]=Object.assign(n,{type:e,isBuiltIn:!!i})}},{key:"getTransform",value:function(e){return t._transforms[e]}},{key:"unregisterRuntimeTransforms",value:function(){Object.keys(t._transforms).forEach((function(e){t._transforms[e]&&!t._transforms[e].isBuiltIn&&(t._transforms[e]=null)}))}},{key:"registerGrammar",value:function(e,n,i){t._grammars[e]={grammarClass:n,specKey:null!=i?i:e}}},{key:"createGrammar",value:function(e,n,i){var r,a=null===(r=t._grammars[e])||void 0===r?void 0:r.grammarClass;return a?new a(n,i):null}},{key:"getGrammars",value:function(){return this._grammars}},{key:"getGlyph",value:function(e){return t._glyphs[e]}},{key:"createInteraction",value:function(e,n,i){var r=t._interactions[e];return r?new r(n,i):null}},{key:"hasInteraction",value:function(e){return!!t._interactions[e]}}])}();vM._plotMarks={},vM._marks={},vM._components={},vM._graphicComponents={},vM._transforms={},vM._grammars={},vM._glyphs={},vM._animations={},vM._interactions={},vM._graphics={},vM.registerGlyph=function(t,e,n,i,r){return vM._glyphs[t]=new fM(e,n,i,r),vM._glyphs[t]},vM.registerAnimationType=function(t,e){vM._animations[t]=e},vM.getAnimationType=function(t){return vM._animations[t]},vM.registerInteraction=function(t,e){vM._interactions[t]=e},vM.registerGraphic=function(t,e){vM._graphics[t]=e},vM.getGraphicType=function(t){return vM._graphics[t]},vM.createGraphic=function(t,e){var n=vM._graphics[t];return n?n(e):null};var pM=function(t){return!!AB[t]};function gM(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=vM.getGraphicType(e)?vM.createGraphic(e,i):vM.createGraphicComponent(e,i,{skipDefault:null===(n=null==t?void 0:t.spec)||void 0===n?void 0:n.skipTheme});return r||dE.getInstance().error("create ".concat(e," graphic failed!")),r}var yM=function(t){t&&(t[NB]=null,t.release(),t.parent&&t.parent.removeChild(t))},mM=["fillOpacity"],kM=function(t,e,n){var i;return"fillOpacity"===e?(t.fillOpacity=null!==(i=n.fillOpacity)&&void 0!==i?i:1,["fillOpacity"]):[]};var bM=l(l(l({rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:function(t,e,n){var i,r,a,o,s,u,l,c,h,d,f,v;GC(e.width)||!GC(e.x1)&&GC(n.width)?(t.x=Math.min(null!==(i=n.x)&&void 0!==i?i:0,null!==(r=n.x1)&&void 0!==r?r:1/0),t.width=n.width):GC(e.x1)||!GC(e.width)&&GC(n.x1)?(t.x=Math.min(n.x,n.x1),t.width=Math.abs(n.x1-n.x)):(t.x=Math.min(null!==(a=n.x)&&void 0!==a?a:0,null!==(o=n.x1)&&void 0!==o?o:1/0),t.width=n.width),GC(e.height)||!GC(e.y1)&&GC(n.height)?(t.y=Math.min(null!==(s=n.y)&&void 0!==s?s:0,null!==(u=n.y1)&&void 0!==u?u:1/0),t.height=n.height):GC(e.y1)||!GC(e.height)&&GC(n.y1)?(t.y=Math.min(n.y,n.y1),t.height=Math.abs(n.y1-n.y)):(t.y=Math.min(null!==(l=n.y)&&void 0!==l?l:0,null!==(c=n.y1)&&void 0!==c?c:1/0),t.height=n.height),GC(e.length)||!GC(e.z1)&&GC(n.length)?(t.z=Math.min(null!==(h=n.z)&&void 0!==h?h:0,null!==(d=n.z1)&&void 0!==d?d:1/0),t.length=n.length):GC(e.z1)||!GC(e.length)&&GC(n.z1)?(t.z=Math.min(n.z,n.z1),t.length=Math.abs(n.z1-n.z)):(t.z=Math.min(null!==(f=n.z)&&void 0!==f?f:0,null!==(v=n.z1)&&void 0!==v?v:1/0),t.length=n.length)},storedAttrs:"sizeAttrs"}]},AB.text,[{channels:["text","limit","autoLimit","maxLineWidth","textType"],transform:function(t,e,n){var i,r,a=null!==(i=n.limit)&&void 0!==i?i:1/0,o=null!==(r=n.autoLimit)&&void 0!==r?r:1/0,s=Math.min(a,o),u=IC(n.text)&&!BC(n.text.text),l=u?n.text.text:n.text;t.maxLineWidth=s===1/0?n.maxLineWidth:s,!u&&!n.textType||"rich"!==n.text.type&&"rich"!==n.textType?t.text=l:t.textConfig=l},storedAttrs:"limitAttrs"}]),AB.rule,[{channels:["x","y","x1","y1"],transform:function(t,e,n){var i=function(t){var e=t.x,n=t.y,i=t.x1,r=t.y1;return GC(e)&&GC(n)&&GC(i)&&GC(r)?[{x:e,y:n},{x:i,y:r}]:[]}(n);t.points=i,t.x=0,t.y=0},storedAttrs:"pointAttrs"}]),AB.symbol,[{channels:["shape","symbolType"],transform:function(t,e,n){var i;t.symbolType=null!==(i=e.shape)&&void 0!==i?i:e.symbolType}},{channels:["image","fill","background"],transform:function(t,e,n){e.image?(t.background=e.image,t.fill=!1):n.image?(t.background=n.image,t.fill=!1):(t.fill=n.fill,t.background=n.background)},storedAttrs:"imageAttrs"}]);var _M=function(t,e,n,i){var r={},a=e?Object.keys(e):[],o=LC(t)?bM[t]:t;if(o&&o.length){var s=[];a.forEach((function(t){var a=!1;o.forEach((function(o,u){if(o.channels.includes(t)){if(!s[u])if(o.storedAttrs){var l=function(t,e,n,i,r,a){var o=r.getGraphicAttribute(t,!1,a);if(o)return e.forEach((function(t){t in i&&(o[t]=i[t])})),o;var s={};return e.forEach((function(t){s[t]=i[t]})),n[t]=s,s}(o.storedAttrs,o.channels,r,e,n,i);o.transform(r,e,l)}else o.transform(r,e,null);s[u]=!0,a=!0}})),a||(mM.includes(t)?kM(r,t,e):r[t]=e[t])}))}else a.forEach((function(t){mM.includes(t)?kM(r,t,e):r[t]=e[t]}));return r},xM=function(t,e,n){return!(!BC(t)||!BC(e))||!BC(t)&&!BC(e)&&("lineDash"===n?function(t,e){return t.length===e.length&&t.join("-")===e.join("-")}(t,e):"stroke"===n||"fill"===n?function(t,e){if(t===e)return!0;if(a(t)!=a(e))return!1;if(LC(t))return!1;if(t.gradient!==e.gradient)return!1;var n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every((function(n){return"stops"===n?function(t,e){var n,i;if(t===e)return!0;var r=null!==(n=t&&t.length)&&void 0!==n?n:0;return r===(null!==(i=e&&e.length)&&void 0!==i?i:0)&&0!==r&&t.every((function(t,n){return!t&&!e[n]||t&&e[n]&&t.color===e[n].color&&t.offset===e[n].offset}))}(t[n],e[n]):t[n]===e[n]}))}(t,e):t===e)},wM=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],SM=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"].concat(wM);function AM(t,e,n){var i;if(!t||t.length<=1)return null;var r="area"===(null===(i=null==n?void 0:n.mark)||void 0===i?void 0:i.markType)?SM:wM,a=[],o=null;return t.forEach((function(t,e){o&&r.every((function(e){return xM(o[e],t[e],e)}))||(a.length&&(a[a.length-1].endIndex=e),o=t,a.push({attrs:o,startIndex:e}))})),a.length>=2?a.map((function(t){var n=TM(t.attrs);return n.points=e.slice(t.startIndex,BC(t.endIndex)?e.length:t.endIndex),n})):null}function TM(t){var e={};return t?(Object.keys(t).forEach((function(n){"x"!==n&&"y"!==n&&"x1"!==n&&"y1"!==n&&"defined"!==n&&"size"!==n&&"width"!==n&&"height"!==n&&"context"!==n&&(e[n]=t[n])})),e):e}var CM=function(){return u((function t(e){var n=this;o(this,t),this.data=null,this.states=[],this.diffState=SB.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=function(t,e){var i,r,a,o,s=!BC(null===(i=n.runtimeStatesEncoder)||void 0===i?void 0:i[t]),u=s?Object.assign(Object.assign({},null===(r=n.mark.getSpec().encode)||void 0===r?void 0:r[t]),n.runtimeStatesEncoder[t]):null===(a=n.mark.getSpec().encode)||void 0===a?void 0:a[t];if(!u)return{};if(RC(u))return u(n.getDatum(),n,t,e);if(!s&&(null===(o=n.graphicItem.states)||void 0===o?void 0:o[t]))return n.graphicItem.states[t];var c=n.items.map((function(t){return Object.assign({},t,{nextAttrs:{}})}));hM(n,c,u,n.mark.parameters());var h=n.transformElementItems(c,n.mark.markType);return n.graphicItem.states?n.graphicItem.states[t]||(n.graphicItem.states[t]=h):n.graphicItem.states=l({},t,h),h},this.mark=e}),[{key:"initGraphicItem",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.graphicItem){var n=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(n?_M(n,e,this):e,this.groupKey),this.graphicItem&&(this.graphicItem[NB]=this,n&&(this.graphicItem.onBeforeAttributeUpdate=function(e){return t.mark?_M(n,e,t):e}),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(e),this.setFinalGraphicAttributes(e)))}}},{key:"updateGraphicItem",value:function(){if(this.graphicItem){this.diffState===SB.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;var t=this.mark.animate.getAnimationConfigs("state");0!==t.length&&(this.graphicItem.stateAnimateConfig=t[0].originConfig)}}},{key:"getGraphicItem",value:function(){return this.graphicItem}},{key:"removeGraphicItem",value:function(){var t,e;this.graphicItem&&(null===(e=null===(t=this.graphicItem.animates)||void 0===t?void 0:t.forEach)||void 0===e||e.call(t,(function(t){return t.stop()}))),this.graphicItem&&(yM(this.graphicItem),this.graphicItem[NB]=null,this.graphicItem=null)}},{key:"resetGraphicItem",value:function(){this.graphicItem&&(this.graphicItem=null)}},{key:"getBounds",value:function(){var t;return null===(t=this.graphicItem)||void 0===t?void 0:t.AABBBounds}},{key:"getStates",value:function(){return this.states}},{key:"updateData",value:function(t,e,n){var i,r=this;this.mark.emit(LB.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:n},this),this.data=e;var a=oM(n);return this.items=e.map((function(t){return{datum:t,key:a(t),view:r.mark.view,nextAttrs:{}}})),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:null===(i=this.items)||void 0===i?void 0:i[0].key,this.mark.emit(LB.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:n},this),this.items}},{key:"state",value:function(t,e){var n,i=this.mark.isCollectionMark(),r=this.states,a=aE(iM(t,e,this.getDatum(),this)),o=null===(n=this.mark.getSpec())||void 0===n?void 0:n.stateSort;o&&a.length&&a.sort(o);var s=a.length!==r.length||a.some((function(t,e){return t!==r[e]}));this.states=a,!i&&s&&this.diffState===SB.unChange&&(this.diffState=SB.update)}},{key:"encodeGraphic",value:function(t){this.coordinateTransformEncode(this.items);var e=this.transformElementItems(this.items,this.mark.markType);t&&(this.mark.isCollectionMark()&&delete t.defined,Object.assign(e,t)),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,this.applyGraphicAttributes(e)):this.initGraphicItem(e),this.diffState!==SB.enter&&this.diffState!==SB.update||!this.states.length||this.useStates(this.states),this.mark.markType===AB.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach((function(t){t.nextAttrs={}})),this._setCustomizedShape()}},{key:"_setCustomizedShape",value:function(){var t,e=this;if(this.graphicItem){var n=null===(t=this.mark.getSpec())||void 0===t?void 0:t.setCustomizedShape;n&&(this.graphicItem.pathProxy=function(t){return n(e.data,t,new ei)})}}},{key:"encodeItems",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,r=this.mark.isCollectionMark(),a=e[wB.update],o=e[wB.enter],s=e[wB.exit],u=this.mark.isLargeMode()||r&&!this.mark.getSpec().enableSegments;this.diffState===SB.enter?(o&&hM(this,t,o,i,u),a&&hM(this,t,a,i,u)):this.diffState===SB.update?((r&&o||n)&&hM(this,t,o,i,u),a&&hM(this,t,a,i,u)):this.diffState===SB.exit&&s&&(n&&hM(this,t,o,i,u),hM(this,t,s,i,u))}},{key:"coordinateTransformEncode",value:function(t){if(this.mark.coord&&"arc"!==this.mark.markType&&!0!==this.mark.disableCoordinateTransform){var e=this.mark.coord.output();t.forEach((function(t){var n=t.nextAttrs,i=e.convert(n);Object.assign(n,i)}))}}},{key:"clearStates",value:function(t){var e=EC(t)?t:0!==this.mark.animate.getAnimationConfigs("state").length;this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}},{key:"_updateRuntimeStates",value:function(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}},{key:"hasState",value:function(t){return this.states&&t&&this.states.includes(t)}},{key:"updateStates",value:function(t){var e=this;if(!this.graphicItem)return!1;var n=this.states.slice(),i=this.mark.getSpec().encode,r=!1,a=!1;return Object.keys(t).forEach((function(o){var s;if(o){var u=t[o];if(PC(u)&&!nE(u,null===(s=e.runtimeStatesEncoder)||void 0===s?void 0:s[o]))n.includes(o)?r=!0:n.push(o),e._updateRuntimeStates(o,u),a=!0;else if(u)!n.includes(o)&&(null==i?void 0:i[o])&&(n.push(o),a=!0);else if(n.length){var l=n.filter((function(t){return t!==o}));l.length!==n.length&&(a=!0,n=l),e.runtimeStatesEncoder&&e.runtimeStatesEncoder[o]&&(e.runtimeStatesEncoder[o]=null)}}})),r&&this.graphicItem.clearStates(),!!a&&(this.useStates(n),!0)}},{key:"addState",value:function(t,e){var n;if(!this.graphicItem)return!1;if(e&&LC(t)&&!nE(e,null===(n=this.runtimeStatesEncoder)||void 0===n?void 0:n[t])){var i=this.states.slice();return i.includes(t)?this.graphicItem.clearStates():i.push(t),this._updateRuntimeStates(t,e),this.useStates(i),!0}var r=this.mark.getSpec().encode,a=aE(t).reduce((function(t,e){return e&&!t.includes(e)&&(null==r?void 0:r[e])&&t.push(e),t}),this.states.slice());return a.length!==this.states.length&&(this.useStates(a),!0)}},{key:"removeState",value:function(t){var e=this;if(!this.graphicItem)return!1;var n=aE(t);if(!n.length)return!1;var i=this.states.filter((function(t){return!n.includes(t)}));return i.length!==this.states.length&&(this.runtimeStatesEncoder&&n.forEach((function(t){e.runtimeStatesEncoder[t]=null})),this.useStates(i),!0)}},{key:"useStates",value:function(t,e){var n;if(!this.graphicItem)return!1;this.mark.emit(LB.BEFORE_ELEMENT_STATE,{states:t},this);var i=null===(n=this.mark.getSpec())||void 0===n?void 0:n.stateSort;i&&t.sort(i),this.states=t;var r=EC(e)?e:0!==this.mark.animate.getAnimationConfigs("state").length;return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,r),this.mark.emit(LB.AFTER_ELEMENT_STATE,{states:t},this),!0}},{key:"diffAttributes",value:function(t){var e={},n=this.getFinalGraphicAttributes();for(var i in t)PR(i,n,t)&&KC(n,i)||(e[i]=t[i]);return e}},{key:"transformElementItems",value:function(t,e,n){var i,r,a,o,s,u=t[0];if(!u.nextAttrs||0===Object.keys(u.nextAttrs).length)return{};var l=u.nextAttrs;if(function(t){return[AB.line,AB.area,AB.largeRects,AB.largeSymbols].includes(t)}(e)&&t&&t.length&&BC(null===(i=u.nextAttrs)||void 0===i?void 0:i.points)&&(!0===n||cM(Object.keys(u.nextAttrs),this.mark.markType))){var c=this.mark.getSpec(),h=this.getGraphicAttribute("points",!1),d=this.getGraphicAttribute("segments",!1),f=c.enableSegments,v=null===(r=this.mark.getSpec().encode)||void 0===r?void 0:r[wB.connectNulls],p=t.map((function(t){return t.nextAttrs})),g=this.mark.isProgressive();if(l=TM(l),e===AB.line||e===AB.area){var y=function(t,e,n,i){return t&&t.length&&(1!==t.length||e)?t.some((function(t){return cM(Object.keys(t.nextAttrs),"line")}))?t.map((function(t,e){var r,a=t.nextAttrs,o=null!==(r=null==n?void 0:n[e])&&void 0!==r?r:{},s=o.x,u=o.y,l=o.x1,c=o.y1,h=o.defined;return BC(a.x)&&(a.x=s),BC(a.y)&&(a.y=u),BC(a.defined)&&!1===h&&(a.defined=!1),a.context=t.key,i&&(BC(a.x1)&&(a.x1=l),BC(a.y1)&&(a.y1=c)),a})):null!=n?n:[]:[]}(t,!0,h,e===AB.area);if(g)l.segments=(null!==(s=null===(o=null===(a=this.graphicItem)||void 0===a?void 0:a.attribute)||void 0===o?void 0:o.segments)&&void 0!==s?s:[]).concat([{points:y}]);else if(v){if(l.segments=function(t,e,n){if(!t||t.length<=1)return null;var i,r,a=!!n&&n.mark.getSpec().enableSegments,o=[],s=null;if(t.forEach((function(t,n){(s=e[n])&&!1!==s.defined?(i||(r={items:[],points:[]},o.push(r)),r.points.push(s),r.items.push(t),!1===i&&(r.isConnect=!0,r={items:[],points:[]},o.push(r)),i=!0):i=!1})),(o=o.filter((function(t){return t.points.length>0}))).length>=2){var u=[];return o.forEach((function(t){if(t.isConnect)u.push({points:t.points,isConnect:!0});else{if(a){var e=AM(t.items,t.points,n);if(e)return void e.forEach((function(t){u.push(t)}))}var i=TM(t.items[0]);i.points=t.points,u.push(i)}})),u}return a?AM(t,e,n):null}(p,y,this),l.segments&&l.segments.some((function(t){return t.isConnect}))){var m=dM(v,this.getDatum(),this,this.mark.parameters());m&&l.segments.forEach((function(t){t.isConnect&&Object.assign(t,m)}))}l.points=y}else if(f){var k=y&&0!==y.length?y:function(t){return t?t.reduce((function(t,e){return t.concat(e.points)}),[]):null}(d),b=AM(p,k,this);b?(l.segments=b,l.points=null):(l.segments=null,l.points=k)}else l.points=y,l.segments=null}else e===AB.largeRects?l.points=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t||!t.length||1===t.length&&!e)return[];var i=new Float32Array(4*t.length);return t.forEach((function(t,e){var r,a,o,s,u=t.nextAttrs,l=null!==(r=u.x)&&void 0!==r?r:n[4*e],c=null!==(a=u.y)&&void 0!==a?a:n[4*e+1],h=null!==(o=u.width)&&void 0!==o?o:n[4*e+2],d=null!==(s=u.y1)&&void 0!==s?s:n[4*e+3];i[4*e]=l,i[4*e+1]=c,i[4*e+2]=h,i[4*e+3]=d-c})),i}(t,!0,h):e===AB.largeSymbols&&(l.points=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!t||!t.length||1===t.length&&!e)return[];var i=new Float32Array(2*t.length);return t.forEach((function(t,e){var r,a,o=t.nextAttrs,s=null!==(r=o.x)&&void 0!==r?r:n[2*e],u=null!==(a=o.y)&&void 0!==a?a:n[2*e+1];i[2*e]=s,i[2*e+1]=u})),i}(t,!0,h))}return l}},{key:"applyGraphicAttributes",value:function(t){var e,n,i=this;if(!HC(t))if(this.mark.needAnimate()){var r=this.diffAttributes(t),a=null!==(e=this.getPrevGraphicAttributes())&&void 0!==e?e:{},o=null!==(n=this.getFinalGraphicAttributes())&&void 0!==n?n:{};Object.keys(r).forEach((function(t){a[t]=i.getGraphicAttribute(t),o[t]=r[t]})),this.setNextGraphicAttributes(r),this.setPrevGraphicAttributes(a),this.setFinalGraphicAttributes(o);var s=this.mark.animate.getElementAnimators(this).reduce((function(t,e){return Object.assign(t,e.getEndAttributes())}),{}),u=Object.assign({},s,o);this.graphicItem.setAttributes(u)}else this.graphicItem.setAttributes(t)}},{key:"getGraphicAttribute",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.graphicItem){if(n){var i,r=this.getPrevGraphicAttributes();if(!BC(i=YC(r,t)))return i}var a=this.mark.getAttributeTransforms(),o=[t];if(a&&a.length){var s=a.find((function(e){return e.storedAttrs&&e.channels.includes(t)}));s&&(o=[s.storedAttrs,t])}return YC(null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,o)}}},{key:"setGraphicAttribute",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.graphicItem){var i=this.getFinalGraphicAttributes(),r=this.getPrevGraphicAttributes();n&&i&&(i[t]=e),r&&!KC(r,t)&&(r[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}}},{key:"setGraphicAttributes",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.graphicItem){var i=this.getFinalGraphicAttributes(),r=this.getPrevGraphicAttributes();Object.keys(t).forEach((function(a){i&&n&&(i[a]=t[a]),r&&!KC(r,a)&&(r[a]=e.graphicItem.attribute[a])})),this.graphicItem.setAttributes(t)}}},{key:"getFinalGraphicAttributes",value:function(){return this.graphicItem.finalAttrs}},{key:"setFinalGraphicAttributes",value:function(t){this.graphicItem.finalAttrs=t}},{key:"getPrevGraphicAttributes",value:function(){return this.graphicItem.prevAttrs}},{key:"setPrevGraphicAttributes",value:function(t){this.graphicItem.prevAttrs=t}},{key:"getNextGraphicAttributes",value:function(){return this.graphicItem.nextAttrs}},{key:"setNextGraphicAttributes",value:function(t){this.graphicItem.nextAttrs=t}},{key:"clearChangedGraphicAttributes",value:function(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}},{key:"clearGraphicAttributes",value:function(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}},{key:"remove",value:function(){this.graphicItem&&(yM(this.graphicItem),this.graphicItem=null)}},{key:"release",value:function(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}},{key:"getItemAttribute",value:function(t){var e,n;if(null===(e=this.items)||void 0===e?void 0:e.length)return this.mark.isCollectionMark()?BC(t)?this.items.map((function(t){return t.nextAttrs})):this.items.map((function(e){var n;return null===(n=e.nextAttrs)||void 0===n?void 0:n[t]})):BC(t)?this.items[0].nextAttrs:null===(n=this.items[0].nextAttrs)||void 0===n?void 0:n[t]}},{key:"setItemAttributes",value:function(t){var e;(null===(e=this.items)||void 0===e?void 0:e.length)&&(this.mark.isCollectionMark()?DC(t)&&this.items.forEach((function(e,n){Object.assign(e.nextAttrs,t[n])})):Object.assign(this.items[0].nextAttrs,t))}},{key:"getItem",value:function(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.items)&&void 0!==t?t:[]:null===(e=this.items)||void 0===e?void 0:e[0]}},{key:"getDatum",value:function(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.data)&&void 0!==t?t:[]:null===(e=this.data)||void 0===e?void 0:e[0]}}])}(),EM=function(){return u((function t(e,n){o(this,t),this.references=new Map,this.view=e,this.depend(null==n?void 0:n.dependency)}),[{key:"getStartState",value:function(){return null}},{key:"depend",value:function(t){var e=this;this.references.clear(),aE(t).map((function(t){return LC(t)?e.view.getGrammarById(t):t})).filter((function(t){return!BC(t)})).forEach((function(t){var n;e.references.set(t,(null!==(n=e.references.get(t))&&void 0!==n?n:0)+1)}))}},{key:"parameters",value:function(){var t={};return this.references.forEach((function(e,n){MC(n.id())&&(t[n.id()]=n.output())})),t}},{key:"bind",value:function(){var t=this,e=this.getEvents();(null!=e?e:[]).forEach((function(e){e.type&&e.handler&&(DC(e.type)?e.type.forEach((function(n){n&&"none"!==n&&t.view.addEventListener(n,e.handler)})):"none"!==e.type&&t.view.addEventListener(e.type,e.handler))}))}},{key:"unbind",value:function(){var t=this,e=this.getEvents();(null!=e?e:[]).forEach((function(e){e.type&&e.handler&&(DC(e.type)?e.type.forEach((function(n){n&&"none"!==n&&t.view.removeEventListener(n,e.handler)})):"none"!==e.type&&t.view.removeEventListener(e.type,e.handler))}))}},{key:"start",value:function(t){}},{key:"reset",value:function(t){}},{key:"dispatchEvent",value:function(t,e){this.view.emit("".concat(this.type,":").concat(t),e),"start"===t&&this.options.onStart?this.options.onStart(e):"reset"===t&&this.options.onReset?this.options.onReset(e):"update"===t&&this.options.onUpdate?this.options.onUpdate(e):"end"===t&&this.options.onEnd&&this.options.onEnd(e)}}])}(),RM=function(t,e){if(!e||!t)return null;var n={};return t.forEach((function(t){var i=t&&t.getSpec(),r=i&&i.encode;r&&e.forEach((function(e){e&&r[e]&&(n[e]||(n[e]=[]),n[e].push(t))}))})),n},BM=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[t,i])).type=n.type,r._resetType=[],r.clearPrevElements=function(){var t=r.options,e=t.state,n=t.reverseState;r._statedElements&&r._statedElements.length&&(r.clearAllStates(e,n),r.dispatchEvent("reset",{elements:r._statedElements,options:r.options}),r._statedElements=[])},r.handleStart=function(t){r.start(t.element)},r.handleReset=function(t){r.reset(t.element)},r.options=Object.assign({},n.defaultOptions,i),r._marks=t.getMarksBySelector(r.options.selector),r._stateMarks=RM(r._marks,[r.options.state,r.options.reverseState]),r}return c(n,t),u(n,[{key:"getStartState",value:function(){return this.options.state}},{key:"getEvents",value:function(){var t=this,e=this.options.triggerOff,n=this.options.trigger,i=[{type:n,handler:this.handleStart}],r=function(t){var e=aE(t),n=[],i=[];return e.forEach((function(t){"empty"===t?n.push("view"):LC(t)&&"none"!==t?t.includes("view:")?(i.push(t.replace("view:","")),n.push("view")):(i.push(t),n.push("self")):NC(t)&&n.push("timeout")})),{eventNames:i,resetType:n}}(e),a=r.eventNames,o=r.resetType;return a.forEach((function(e){e&&(DC(n)?!n.includes(e):e!==n)&&i.push({type:e,handler:t.handleReset})})),this._resetType=o,i}},{key:"start",value:function(t){var e=this,n=this.options,i=n.state,r=n.reverseState,a=n.isMultiple;if(t&&this._marks&&this._marks.includes(t.mark))if(t.hasState(i)){if(this._resetType.includes("self")){var o=this._statedElements&&this._statedElements.filter((function(e){return e!==t}));o&&o.length?this._statedElements=this.updateStates(o,this._statedElements,i,r):this.clearPrevElements()}}else this._timer&&clearTimeout(this._timer),t.addState(i),this._statedElements=this.updateStates(a&&this._statedElements?[].concat(y(this._statedElements),[t]):[t],this._statedElements,i,r),this.dispatchEvent("start",{elements:this._statedElements,options:this.options}),this._resetType.includes("timeout")&&(this._timer=setTimeout((function(){e.clearPrevElements()}),this.options.triggerOff));else this._resetType.includes("view")&&this._statedElements&&this._statedElements.length&&this.clearPrevElements()}},{key:"reset",value:function(t){if(this._statedElements&&this._statedElements.length){var e=t&&this._marks&&this._marks.includes(t.mark);(this._resetType.includes("view")&&!e||this._resetType.includes("self")&&e)&&this.clearPrevElements()}}}])}(EM);BM.type="element-select",BM.defaultOptions={state:jB.selected,trigger:"click"};var MM=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[t,i])).type=n.type,r.handleStart=function(t){r.start(t.element)},r.handleReset=function(t){r.reset(t.element)},r.options=Object.assign({},n.defaultOptions,i),r._marks=t.getMarksBySelector(r.options.selector),r._stateMarks=RM(r._marks,[r.options.highlightState,r.options.blurState]),r}return c(n,t),u(n,[{key:"getStartState",value:function(){return this.options.highlightState}},{key:"getEvents",value:function(){var t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}],n=t;return LC(t)&&t.includes("view:")?(n=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:n,handler:this.handleReset}),e}},{key:"clearPrevElements",value:function(){var t=this.options,e=t.highlightState,n=t.blurState;this._lastElement&&(this.clearAllStates(e,n),this.dispatchEvent("reset",{elements:[this._lastElement],options:this.options}),this._lastElement=null,this._statedElements=null)}},{key:"start",value:function(t){if(t&&this._marks&&this._marks.includes(t.mark)){var e=this.options,n=e.highlightState,i=e.blurState;if(this._lastElement===t)return;this._statedElements=this.updateStates([t],this._statedElements,n,i),this._lastElement=t,this.dispatchEvent("start",{elements:[t],options:this.options})}else this._lastElement&&"view"===this._resetType&&this.clearPrevElements()}},{key:"reset",value:function(t){if(this._statedElements&&this._statedElements.length){var e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}}])}(EM);MM.type="element-highlight",MM.defaultOptions={highlightState:jB.highlight,blurState:jB.blur,trigger:"pointerover",triggerOff:"pointerout"};var PM=function(){return u((function t(){o(this,t)}),[{key:"updateStates",value:function(t,e,n,i){return t&&t.length?(n&&i?e&&e.length?(this.toggleReverseStateOfElements(t,e,i),this.toggleStateOfElements(t,e,n)):this.addBothStateOfElements(t,n,i):n&&(e&&e.length?this.toggleStateOfElements(t,e,n):this.addStateOfElements(t,n)),t):null}},{key:"toggleReverseStateOfElements",value:function(t,e,n){var i=this;e.forEach((function(t){n&&i._stateMarks[n]&&i._stateMarks[n].includes(t.mark)&&t.addState(n)})),t.forEach((function(t){n&&i._stateMarks[n]&&i._stateMarks[n].includes(t.mark)&&t.removeState(n)}))}},{key:"toggleStateOfElements",value:function(t,e,n){var i=this;e.forEach((function(t){n&&i._stateMarks[n]&&i._stateMarks[n].includes(t.mark)&&t.removeState(n)})),t.forEach((function(t){n&&i._stateMarks[n]&&i._stateMarks[n].includes(t.mark)&&t.addState(n)}))}},{key:"addBothStateOfElements",value:function(t,e,n){var i=this;this._marks.forEach((function(r){var a=n&&i._stateMarks[n]&&i._stateMarks[n].includes(r),o=e&&i._stateMarks[e]&&i._stateMarks[e].includes(r);(a||o)&&r.elements.forEach((function(i){t&&t.includes(i)?o&&i.addState(e):a&&i.addState(n)}))}))}},{key:"addStateOfElements",value:function(t,e){var n=this;this._marks.forEach((function(i){var r=e&&n._stateMarks[e]&&n._stateMarks[e].includes(i);r&&i.elements.forEach((function(n){t&&t.includes(n)&&r&&n.addState(e)}))}))}},{key:"clearAllStates",value:function(t,e){var n=this;this._statedElements&&this._statedElements.length&&this._marks.forEach((function(i){e&&n._stateMarks[e]&&n._stateMarks[e].includes(i)&&i.elements.forEach((function(t){t.removeState(e)})),t&&n._stateMarks[t]&&n._stateMarks[t].includes(i)&&i.elements.forEach((function(e){n._statedElements.includes(e)&&e.removeState(t)}))}))}}])}(),OM=function(t,e){return aM(t)?t.output():t&&PC(t)?RC(t.callback)?function(n){return t.callback(n,e)}:RC(t.value)?t.value(e):t:t},IM=function(t,e){return t?PC(t)?Object.keys(t).reduce((function(n,i){var r=t[i];return n[i]=OM(r,e),n}),{}):t.map((function(t){return OM(t,e)})):t},LM=-1,DM=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).spec={},i.references=new Map,i.targets=[],i.transforms=[],i.view=t,i.uid=++LM,i}return c(n,t),u(n,[{key:"parse",value:function(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}},{key:"depend",value:function(t){var e,n=this;if(null===(e=this.spec)||void 0===e?void 0:e.dependency){var i=aE(this.spec.dependency).map((function(t){return LC(t)?n.view.getGrammarById(t):t}));this.detach(i)}this.spec.dependency=t;var r=aE(t).map((function(t){return LC(t)?n.view.getGrammarById(t):t}));return this.attach(r),this.commit(),this}},{key:"addEventListener",value:function(t,e,n){var i=e;return n&&!1===n.trap||((i=e).raw=e),n&&n.target&&(i.target=n.target),this.on(t,i),this}},{key:"removeEventListener",value:function(t,e){return e?this.off(t,e):this.off(t),this}},{key:"emit",value:function(t){for(var e,i,r,a,o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return null===(a=null===(r=this.view)||void 0===r?void 0:r.emit)||void 0===a||(e=a).call.apply(e,[r,t].concat(s)),(i=p(h(n.prototype),"emit",this)).call.apply(i,[this,t].concat(s))}},{key:"emitGrammarEvent",value:function(t){for(var e,i=arguments.length,r=new Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];return(e=p(h(n.prototype),"emit",this)).call.apply(e,[this,t].concat(r))}},{key:"evaluateTransform",value:function(t,e,n){if(!t||!t.length)return e;for(var i=e,r=0,a=t.length;r<a;){var o=t[r];this.emit(LB.BEFORE_TRANSFORM,o.type),i=o.transform(o.isRawOptions?o.options:IM(o.options,n),i,n,this.view),r++,this.emit(LB.AFTER_TRANSFORM,o.type)}return i}},{key:"set",value:function(t){return!1}},{key:"id",value:function(t){return arguments.length?(this.view.grammars.unrecord(this),this._id=t,this.view.grammars.record(this),this):this._id}},{key:"name",value:function(t){return arguments.length?(this._name=t,this):this._name}},{key:"attach",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return aE(t).filter((function(t){return!BC(t)})).forEach((function(i){var r;BC(t)||(i.targets.includes(e)||i.targets.push(e),e.references.set(i,(null!==(r=e.references.get(i))&&void 0!==r?r:0)+n))})),this}},{key:"detach",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return aE(t).filter((function(t){return!BC(t)})).forEach((function(t){var i=e.references.get(t)-n;i>0?e.references.set(t,i-1):(e.references.delete(t),t.targets.includes(e)&&(t.targets=t.targets.filter((function(t){return t!==e}))))})),this}},{key:"detachAll",value:function(){var t=this;this.references.forEach((function(e,n){t.detach(n,e)}))}},{key:"link",value:function(t){this.grammarSource=t}},{key:"run",value:function(){var t,e=null===(t=this.grammarSource)||void 0===t?void 0:t.output(),n=this.parameters();return this.evaluate(e,n)}},{key:"commit",value:function(){this.view.commit(this)}},{key:"parameters",value:function(){var t={};return this.references.forEach((function(e,n){MC(n.id())&&(t[n.id()]=n.output())})),t}},{key:"getSpec",value:function(){return this.spec}},{key:"reuse",value:function(t){return this}},{key:"clear",value:function(){this.spec=null,this.view=null}},{key:"release",value:function(){this.clear()}},{key:"setFunctionSpec",value:function(t,e){return BC(this.spec[e])||this.detach(eM(this.spec[e],this.view)),this.spec[e]=t,this.attach(eM(t,this.view)),this.commit(),this}}])}(dt),jM=function(t,e,n){var i,r;if("callback"===t&&RC(e))return{references:[],value:{callback:e,dependency:[]}};if(!BC(e.data)){var a=n.getDataById(e.data);return{references:[a],value:a}}if(!BC(e.customized)){var o=n.getCustomizedById(e.customized);return{references:[o],value:o}}if(!BC(e.scale)){var s=n.getScaleById(e.scale);return{references:[s],value:s}}if((r=e)&&(r.signal||r.callback)){var u=eM(e,n);return{references:u,value:e.callback?{value:e.callback,dependency:u}:null!==(i=null==u?void 0:u[0])&&void 0!==i?i:e}}return{value:e}},FM=function(t,e){var n=vM.getTransform(t.type);if(n){var i={},r=[];return Object.keys(t).forEach((function(n){var a;if("type"!==n){var o=t[n];if("dependency"!==n){var s=function(t,e,n){if(BC(e))return{value:e};if(DC(e)){var i=e.map((function(e){return jM(t,e,n)}));return{references:i.reduce((function(t,e){return e.references&&t.concat(e.references),t}),[]),value:i.map((function(t){return t.value}))}}return jM(t,e,n)}(n,o,e);s&&((null===(a=s.references)||void 0===a?void 0:a.length)&&(r=r.concat(s.references)),i[n]=s.value)}else(null==o?void 0:o.length)&&(r=r.concat(tM(o,e)))}})),{markPhase:n.markPhase,transform:n.transform,canProgressive:n.canProgressive,type:n.type,options:i,references:r}}},NM=function(t,e){if(null==t?void 0:t.length){var n=[],i=[];return t.forEach((function(t){var r,a=FM(t,e);a&&((null===(r=a.references)||void 0===r?void 0:r.length)&&(i=i.concat(a.references)),n.push(a))})),{transforms:n,refs:i}}return null},GM={csv:uR,dsv:sR,tsv:lR,json:function(t){if(!LC(t))return aE(t);try{return aE(JSON.parse(t))}catch(t){return[]}}},zM=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[t])).grammarType="data",a.spec={},a._dataIDKey="VGRAMMAR_DATA_ID_KEY_".concat(a.uid),a._loadTasks=[],a._postFilters=[],a.ingest=function(t){var e=function(t,e){if(BC(t))return t;if(RC(t))return t.call(null,e);if(t.signal){var n=t.signal;return LC(n)?null==e?void 0:e[n]:n.output()}return t.callback?t.callback.call(null,e):t}(t.format,a.parameters());return a._input=function(t,e){if(!e||!GM[e.type])return aE(t);var n="dsv"===e.type?{delimiter:e.delimiter}:{};return GM[e.type](t,n,new pR(new fR))}(t.values,e),a._input},a.load=function(t){if(t.values)return a.ingest(t)},a.relay=function(t){return t[0]},a._loadTasks=[],BC(i)||a.values(i,r),a}return c(n,t),u(n,[{key:"parse",value:function(t){return p(h(n.prototype),"parse",this).call(this,t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}},{key:"parseDataSource",value:function(t){var e=this,n=[],i=[],r=t.format?eM(t.format,this.view)[0]:null;if(r&&n.push(r),t.values){var a=eM(t.values,this.view)[0];a&&n.push(a),i.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){var o=eM(t.url,this.view)[0];o&&n.push(o),i.push({type:"load",transform:this.load,options:{url:null!=o?o:t.url,format:null!=r?r:t.format}})}else if(t.source){var s=[];aE(t.source).forEach((function(t){var i=aM(t)?t:e.view.getDataById(t);i&&(n.push(i),s.push(i))})),s.length&&(i.push({type:"relay",transform:this.relay,options:s}),this.grammarSource=s[0])}return{transforms:i,refs:n}}},{key:"evaluate",value:function(t,e){this.view.emit(LB.BEFORE_EVALUATE_DATA);var n=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);var i=this.evaluateTransform(n,this._input,e),r=this._evaluateFilter(i,e);return this.setValues(r),this._isLoaded=!0,this.view.emit(LB.AFTER_EVALUATE_DATA),this}},{key:"output",value:function(){return this._values}},{key:"getDataIDKey",value:function(){return this._dataIDKey}},{key:"values",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Object.assign({},this.spec,{values:t,format:e});return BC(t)||(i.url=void 0,i.source=void 0),n?this.parseLoad(i):this}},{key:"url",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Object.assign({},this.spec,{url:t,format:e});return BC(t)||(i.values=void 0,i.source=void 0),n?this.parseLoad(i):this}},{key:"source",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Object.assign({},this.spec,{source:t,format:e});return BC(t)||(i.values=void 0,i.url=void 0),n?this.parseLoad(i):this}},{key:"parseLoad",value:function(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;var e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}},{key:"setValues",value:function(t){var e=this;this._values=aE(t).map((function(t,n){var i=t===Object(t)?t:{data:t};return i[e._dataIDKey]=n,i}))}},{key:"field",value:function(t){return this._values.map((function(e){return e[t]}))}},{key:"transform",value:function(t){var e=NM(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;var n=NM(this.spec.transform,this.view);return n&&(this.attach(n.refs),this.transforms=n.transforms),this.commit(),this}},{key:"getValue",value:function(){return this._values}},{key:"getInput",value:function(){return this._input}},{key:"addDataFilter",value:function(t){return this._postFilters=this._postFilters.concat(aE(t)),this._postFilters.sort((function(t,e){var n,i;return(null!==(n=t.rank)&&void 0!==n?n:0)-(null!==(i=e.rank)&&void 0!==i?i:0)})),this}},{key:"removeDataFilter",value:function(t){var e=aE(t);return this._postFilters=this._postFilters.filter((function(t){return!e.includes(t)})),this}},{key:"_evaluateFilter",value:function(t,e){return this._postFilters.reduce((function(t,n){return n.filter(t,e)}),t)}},{key:"reuse",value:function(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}},{key:"clear",value:function(){p(h(n.prototype),"clear",this).call(this),this._input=null,this._values=null}}])}(DM),UM="window",WM="view",VM={trap:!1},HM="width",YM="height",XM="viewWidth",KM="viewHeight",qM="padding",ZM="viewBox",JM="autoFit";function $M(t,e,n,i){for(var r,a,o=t[e];e>n&&(r=t[a=Math.floor((e-1)/2)],o&&r&&i(o,r)<0);)t[e]=r,e=a;return t[e]=o}function QM(t,e,n,i){for(var r,a=e,o=null!=n?n:t.length,s=t[e],u=2*e+1;u<o;)(r=u+1)<o&&i(t[u],t[r])>=0&&(u=r),t[e]=t[u],u=2*(e=u)+1;return t[e]=s,$M(t,e,a,i)}var tP=function(){return u((function t(e){o(this,t),this.compare=e,this.nodes=[]}),[{key:"size",value:function(){return this.nodes.length}},{key:"last",value:function(){return this.nodes[0]}},{key:"validate",value:function(){for(var t=this.nodes.length-1;t>0;t-=1){var e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}},{key:"push",value:function(t){if(this.nodes.includes(t)){var e=this.nodes.indexOf(t);return $M(this.nodes,e,0,this.compare),QM(this.nodes,e,null,this.compare)}return this.nodes.push(t),$M(this.nodes,this.nodes.length-1,0,this.compare)}},{key:"remove",value:function(t){if(this.nodes.includes(t)){var e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),$M(this.nodes,e,0,this.compare),QM(this.nodes,e,null,this.compare)}}},{key:"pop",value:function(){var t,e=this.nodes.pop();return this.nodes.length?(t=this.nodes[0],this.nodes[0]=e,QM(this.nodes,0,null,this.compare)):t=e,t}},{key:"clear",value:function(){this.nodes=[]}}])}(),eP=function(){return u((function t(e){o(this,t),this.list=[],this.ids={},this.idFunc=e||BR}),[{key:"add",value:function(t){var e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}},{key:"remove",value:function(t){var e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter((function(e){return e!==t}))),this}},{key:"forEach",value:function(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}},{key:"filter",value:function(t){return this.list.filter(t)}},{key:"length",get:function(){return this.list.length}},{key:"getElementByIndex",value:function(t){return this.list[t]}}])}(),nP=function(){return u((function t(){o(this,t),this.grammars=[],this.logger=dE.getInstance(),this._curRank=0,this._committed=new eP((function(t){return t.uid})),this._heap=new tP((function(t,e){return(null==t?void 0:t.qrank)-(null==e?void 0:e.qrank)})),this._beforeRunner=null,this._afterRunner=null,this._updateCounter=0,this._finishFirstRender=!1}),[{key:"add",value:function(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}},{key:"remove",value:function(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter((function(e){return e!==t})))}},{key:"_setRankOfGrammar",value:function(t){t&&(t.rank=++this._curRank)}},{key:"_reRank",value:function(t){for(var e=this,n=[t];n.length;){var i=n.pop();this._setRankOfGrammar(i);var r=i.targets;r&&r.forEach((function(i){n.push(i),i===t&&e.logger.error("Cycle detected in dataflow graph.")}))}}},{key:"_enqueue",value:function(t){t&&(t.qrank=t.rank,this._heap.push(t))}},{key:"_logGrammarRunInfo",value:function(t){if(this.logger.canLogError()){var e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce((function(t,e,n){return BC(e.value)?t:"".concat(t).concat(n?" , ":"").concat(e.key,": ").concat(e.value)}),"");this.logger.debug("Run Operator: ",t,e)}}},{key:"hasCommitted",value:function(){return!!this._committed.length}},{key:"commit",value:function(t){return this._committed.add(t),this}},{key:"_beforeEvaluate",value:function(){var t=this;this.grammars.forEach((function(e){e.targets.some((function(t){return(null==t?void 0:t.rank)<(null==e?void 0:e.rank)}))&&t._reRank(e)})),this._committed.forEach((function(e){return t._enqueue(e)})),this._committed=new eP((function(t){return t.uid}))}},{key:"_enqueueTargets",value:function(t){var e=this;t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach((function(t){return e._enqueue(t)}))}},{key:"evaluate",value:function(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._updateCounter+=1;var t,e,n=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug("-- START PROPAGATION (".concat(this._updateCounter,") -----"))),this._beforeEvaluate();this._heap.size()>0;)(t=this._heap.pop())&&(t.rank===t.qrank?(t.run(),this._logGrammarRunInfo(t),this._enqueueTargets(t),n+=1):this._enqueue(t));return this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info("> ".concat(n," grammars updated; ").concat(e," ms"))),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}},{key:"runBefore",value:function(t){this._beforeRunner=t}},{key:"runAfter",value:function(t){this._afterRunner=t}},{key:"release",value:function(){this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}])}(),iP=function(t,e,n,i,r){!function t(a){if(r||!a||i&&!i(a)||n.call(null,a),a.markType===AB.group){var o=a[e];o&&o.forEach((function(e){t(e)}))}r&&(!a||i&&!i(a)||n.call(null,a))}(t)},rP=function(){return u((function t(e){var n=this;o(this,t),this.handleAfterNextRender=function(){n._stage&&!n._viewOptions.disableDirtyBounds&&n._stage.enableDirtyBounds(),n._view.emit(LB.AFTER_VRENDER_DRAW),n._view.emit(LB.AFTER_VRENDER_NEXT_RENDER)},this._view=e}),[{key:"initialize",value:function(t,e,n,i){return this._width=t,this._height=e,this._viewOptions=n,this._eventConfig=i,this.initStage(),this}},{key:"stage",value:function(){var t;return null!==(t=this._stage)&&void 0!==t?t:null}},{key:"gestureController",value:function(){var t;return null!==(t=this._gestureController)&&void 0!==t?t:null}},{key:"canvas",value:function(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}},{key:"context",value:function(){return this._stage?this._stage.window.getContext().nativeContext:null}},{key:"combineIncrementalLayers",value:function(){var t=this;return this._stage&&ws(this._stage).then((function(){t._stage&&t._stage.defaultLayer.combineSubLayer()})),this}},{key:"background",value:function(t){if(this._stage)return this._stage.background=t,this}},{key:"setDpr",value:function(t,e){var n,i;return null===(i=null===(n=this._stage)||void 0===n?void 0:n.setDpr)||void 0===i||i.call(n,t),e&&this.renderNextFrame(),this}},{key:"shouldResize",value:function(t,e){return t!==this._width||e!==this._height}},{key:"resize",value:function(t,e){return this._view.emit(LB.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(LB.AFTER_STAGE_RESIZE),this}},{key:"setViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this._stage?(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e)),this):this}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._view.emit(LB.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(LB.AFTER_VRENDER_DRAW)),this}},{key:"renderNextFrame",value:function(){return this.initStage(),this._stage.renderNextFrame(),this}},{key:"toCanvas",value:function(){return this._stage?this._stage.toCanvas():null}},{key:"preventRender",value:function(t){this._stage&&this._stage.preventRender(t)}},{key:"release",value:function(){var t;this._view.traverseMarkTree((function(t){t.release()})),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==(null===(t=this._viewOptions)||void 0===t?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}},{key:"createStage",value:function(){var t,e,n,i,r;this._view.emit(LB.BEFORE_CREATE_VRENDER_STAGE);var a=this._viewOptions,o=null!==(t=a.stage)&&void 0!==t?t:Cp({width:this._width,height:this._height,renderStyle:a.renderStyle,viewBox:a.viewBox,dpr:a.dpr,canvas:a.renderCanvas,canvasControled:a.canvasControled,container:a.container,title:a.rendererTitle,beforeRender:a.beforeRender,afterRender:a.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:a.pluginList,enableHtmlAttribute:a.enableHtmlAttribute,optimize:a.optimize,ticker:a.ticker,supportsTouchEvents:a.supportsTouchEvents,supportsPointerEvents:a.supportsPointerEvents,ReactDOM:a.ReactDOM});(null===(e=a.options3d)||void 0===e?void 0:e.enable)&&o.set3dOptions(a.options3d),o.enableIncrementalAutoRender(),this._viewBox=a.viewBox,this._view.emit(LB.AFTER_CREATE_VRENDER_STAGE),this._view.emit(LB.BEFORE_CREATE_VRENDER_LAYER);var s=null!==(n=a.layer)&&void 0!==n?n:o.defaultLayer;if(this._view.emit(LB.AFTER_CREATE_VRENDER_LAYER),(null===(i=this._eventConfig)||void 0===i?void 0:i.drag)&&(this._dragController=new Vk(o)),null===(r=this._eventConfig)||void 0===r?void 0:r.gesture){var u=PC(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new Xk(o,u)}return{stage:o,layer:s}}},{key:"initStage",value:function(){if(!this._stage){var t=this.createStage(),e=t.stage,n=t.layer;this._stage=e,this._layer=n;var i=this._view.background();this.background(i)}}}])}();function aP(t){return BC(t.offsetX)?BC(t.x)?t.changedTouches&&t.changedTouches.length?function(t){return{canvasX:t.changedTouches[0].x,canvasY:t.changedTouches[0].y}}(t):{canvasX:0,canvasY:0}:function(t){return{canvasX:t.x,canvasY:t.y}}(t):function(t){return{canvasX:t.offsetX,canvasY:t.offsetY}}(t)}function oP(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return GC(e.canvasX)&&Object.defineProperty(t,"canvasX",{value:e.canvasX,writable:!0}),GC(e.canvasY)&&Object.defineProperty(t,"canvasY",{value:e.canvasY,writable:!0}),n&&GC(e.clientX)&&Object.defineProperty(t,"clientX",{value:e.clientX,writable:!0}),n&&GC(e.clientY)&&Object.defineProperty(t,"clientY",{value:e.clientY,writable:!0}),[e.canvasX,e.canvasY]}function sP(t,e,n,i,r){r===UM&&function(t){["touches","changedTouches","targetTouches"].forEach((function(e){t[e]&&t[e].length&&Array.from(t[e]).forEach((function(t){oP(t,aP(t),!1)}))}));var e=aP(t);oP(t,e)}(e.changedTouches?e.changedTouches[0]:e);return e.element=n,e}var uP=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).grammarType="signal",t.spec={value:null,update:null},t}return c(n,t),u(n,[{key:"parse",value:function(t){return p(h(n.prototype),"parse",this).call(this,t),this.value(t.value),this.update(t.update),this.commit(),this}},{key:"evaluate",value:function(t,e){return this._signal=this.spec.update?iM(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}},{key:"output",value:function(){return this._signal}},{key:"getValue",value:function(){return this.output()}},{key:"set",value:function(t){if(DC(t)&&DC(this.value)&&t.length===this.value.length){for(var e=0;e<t.length;e++)if(this.value[e]!==t[e])return this._signal=t,this.spec.value=t,!0;return!1}return this._signal!==t&&(this._signal=t,this.spec.value=t,!0)}},{key:"update",value:function(t){return BC(t)||this.value(void 0),this.setFunctionSpec(t,"update")}},{key:"value",value:function(t){return BC(t)||this.update(void 0),this.spec.value=t,this.commit(),this}},{key:"reuse",value:function(t){return t.grammarType!==this.grammarType||(this._signal=t.output()),this}},{key:"clear",value:function(){p(h(n.prototype),"clear",this).call(this),this._signal=null}}])}(DM),lP=-1,cP=[HM,YM,qM,XM,KM,ZM,JM],hP=function(t){var e,n,i,r;return NC(t)?{top:t,bottom:t,left:t,right:t}:{top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,bottom:null!==(n=null==t?void 0:t.bottom)&&void 0!==n?n:0,left:null!==(i=null==t?void 0:t.left)&&void 0!==i?i:0,right:null!==(r=null==t?void 0:t.right)&&void 0!==r?r:0}},dP=function(t){var e,n=function t(e,n){var i,r;e.group=n;var a=null!==(i=e.id)&&void 0!==i?i:"VGRAMMAR_MARK_"+ ++lP;e.id=a,(null!==(r=e.marks)&&void 0!==r?r:[]).forEach((function(e){return t(e,a)}))};return(null!==(e=t.marks)&&void 0!==e?e:[]).forEach((function(t){return n(t,"root")})),t},fP=function(t,e){return e&&e.debounce?wE(t,e.debounce):e&&e.throttle?SE(t,e.throttle):t};var vP=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t])).getStateAttrs=function(t,e){var n,r,a,o,s=!BC(null===(n=i.runtimeStatesEncoder)||void 0===n?void 0:n[t]),u=s?Object.assign(Object.assign({},null===(r=i.mark.getSpec().encode)||void 0===r?void 0:r[t]),i.runtimeStatesEncoder[t]):null===(a=i.mark.getSpec().encode)||void 0===a?void 0:a[t],c={};if(!u)return c;if(RC(u))return c.attributes=u(i.getDatum(),f(i),t,e),c;if(!s&&(null===(o=i.graphicItem.glyphStates)||void 0===o?void 0:o[t]))return i.graphicItem.glyphStates[t];if(u){var h=i.items[0],d=[Object.assign({},h,{nextAttrs:{}})];return hM(f(i),d,u,i.mark.parameters()),i.coordinateTransformEncode(d),c.attributes=d[0].nextAttrs,i.graphicItem.glyphStates?i.graphicItem.glyphStates[t]||(i.graphicItem.glyphStates[t]=c):i.graphicItem.glyphStates=l({},t,c),c}return c},i.glyphMeta=i.mark.getGlyphMeta(),i}return c(n,t),u(n,[{key:"getGlyphGraphicItems",value:function(){return this.glyphGraphicItems}},{key:"initGraphicItem",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.graphicItem){this.graphicItem=this.mark.addGraphicItem(e,this.groupKey),this.graphicItem[NB]=this,this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1);var n=this.glyphMeta.getMarks();this.glyphGraphicItems={},this.graphicItem.getSubGraphic().forEach((function(e){var i=n[e.name];t.glyphGraphicItems[e.name]=e,e.onBeforeAttributeUpdate=function(n){return t.mark?_M(i,n,t,e.name):n}})),this.clearGraphicAttributes()}}},{key:"useStates",value:function(t,e){if(!this.graphicItem)return!1;this.mark.emit(LB.BEFORE_ELEMENT_STATE,{states:t},this),this.states=t.slice();var n=EC(e)?e:0!==this.mark.animate.getAnimationConfigs("state").length;return this.graphicItem.glyphStateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,n),this.mark.emit(LB.AFTER_ELEMENT_STATE,{states:t},this),!0}},{key:"encodeGraphic",value:function(){this.coordinateTransformEncode(this.items);var t=this.transformElementItems(this.items,this.mark.markType);this.graphicItem||this.initGraphicItem(),this.diffState===SB.enter?(this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!0),this.applyGraphicAttributes(t),this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1)):this.applyGraphicAttributes(t),this.diffState!==SB.enter&&this.diffState!==SB.update||!this.states.length||(Object.values(this.glyphGraphicItems).forEach((function(t){t.states={}})),this.useStates(this.states)),this.items.map((function(t){t.nextAttrs={}}))}},{key:"encodeCustom",value:function(t){var e,n,i=this,r={},a=this.glyphMeta.getChannelEncoder(),o=this.glyphMeta.getFunctionEncoder();(o&&(r=o.call(null,Object.assign({},null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,t),this.getDatum(),this,this.mark.getGlyphConfig())),a)&&Object.keys(a).forEach((function(e){var o;if(!BC(t[e])){n||(n=Object.assign({},null===(o=i.graphicItem)||void 0===o?void 0:o.attribute,t));var s=a[e].call(null,e,t[e],n,i.getDatum(),i,i.mark.getGlyphConfig());Object.keys(null!=s?s:{}).forEach((function(t){var e;r[t]=Object.assign(null!==(e=r[t])&&void 0!==e?e:{},s[t])}))}}));return r}},{key:"encodeDefault",value:function(){var t={};if(this.diffState===SB.enter&&this.glyphMeta.getDefaultEncoder()){var e=this.glyphMeta.getDefaultEncoder().call(null,this.getDatum(),this,this.mark.getGlyphConfig());Object.assign(t,e)}return t}},{key:"_onGlyphAttributeUpdate",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(n){if(!t.mark)return n;var i=t.glyphMeta.getMarks(),r=_M(t.mark.getAttributeTransforms(),n,t),a=e?t.encodeDefault():null,o=t.encodeCustom(n);return Object.keys(i).forEach((function(r){var s=i[r],u=t.glyphGraphicItems[r],l=null==o?void 0:o[r],c=Object.assign({},l);if(e){var h=null==a?void 0:a[r];Object.keys(null!=h?h:{}).forEach((function(e){KC(t.items[0].nextAttrs,e)||KC(c,e)||(c[e]=h[e])}))}var d=Object.assign({},function(t,e){var n;return(null!==(n=bM[t])&&void 0!==n?n:[]).reduce((function(t,n){return n.channels.forEach((function(n){KC(e,n)&&(t[n]=e[n])})),t}),{})}(s,n),c),f=t._generateGlyphItems(s,t.items,d);t.coordinateTransformEncode(f);var v=t.transformElementItems(f,s);t.applyGlyphGraphicAttributes(v,r,u),s===AB.shape&&(u.datum=f[0].datum)})),r}}},{key:"_generateGlyphItems",value:function(t,e,n){var i=e.map((function(t){return Object.assign({},t,{nextAttrs:n})}));return GB.includes(t)&&this.mark.getSpec().enableSegments&&i.forEach((function(t,i){t.nextAttrs=Object.assign({},e[i].nextAttrs,n)})),i}},{key:"getGraphicAttribute",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;if(this.graphicItem){var i=this.getPrevGraphicAttributes(n);return e&&KC(i,t)?i[t]:(n?this.glyphGraphicItems[n]:this.graphicItem).attribute[t]}}},{key:"setGraphicAttribute",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3?arguments[3]:void 0;if(this.graphicItem){var r=i?this.glyphGraphicItems[i]:this.graphicItem,a=this.getFinalGraphicAttributes(i),o=this.getPrevGraphicAttributes(i);n&&(a[t]=e),KC(o,t)||(o[t]=r.attribute[t]),r.setAttribute(t,e)}}},{key:"setGraphicAttributes",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;if(this.graphicItem){var i=n?this.glyphGraphicItems[n]:this.graphicItem,r=this.getFinalGraphicAttributes(n),a=this.getPrevGraphicAttributes(n);Object.keys(t).forEach((function(n){e&&(r[n]=t[n]),KC(a,n)||(a[n]=i.attribute[n])})),i.setAttributes(t)}}},{key:"diffAttributes",value:function(t,e){var n={},i=this.getFinalGraphicAttributes(e);for(var r in t)PR(r,i,t)||(n[r]=t[r]);return n}},{key:"applyGlyphGraphicAttributes",value:function(t,e,n){var i,r;if(this.mark.needAnimate()){var a=this.diffAttributes(t,e),o=null!==(i=this.getPrevGraphicAttributes(e))&&void 0!==i?i:{},s=null!==(r=this.getFinalGraphicAttributes(e))&&void 0!==r?r:{};Object.keys(a).forEach((function(t){o[t]=n.attribute[t],s[t]=a[t]})),this.setNextGraphicAttributes(a,e),this.setPrevGraphicAttributes(o,e),this.setFinalGraphicAttributes(s,e),n.setAttributes(a)}else n.setAttributes(t)}},{key:"getFinalGraphicAttributes",value:function(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).finalAttrs}},{key:"setFinalGraphicAttributes",value:function(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).finalAttrs=t}},{key:"getPrevGraphicAttributes",value:function(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).prevAttrs}},{key:"setPrevGraphicAttributes",value:function(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).prevAttrs=t}},{key:"getNextGraphicAttributes",value:function(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).nextAttrs}},{key:"setNextGraphicAttributes",value:function(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).nextAttrs=t}},{key:"clearChangedGraphicAttributes",value:function(){var t=this;this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((function(e){t.setPrevGraphicAttributes(null,e),t.setNextGraphicAttributes(null,e)}))}},{key:"clearGraphicAttributes",value:function(){var t=this;this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),this.setFinalGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((function(e){t.setPrevGraphicAttributes(null,e),t.setNextGraphicAttributes(null,e),t.setFinalGraphicAttributes(null,e)}))}},{key:"remove",value:function(){this.glyphGraphicItems=null,p(h(n.prototype),"remove",this).call(this)}},{key:"release",value:function(){this.glyphGraphicItems&&(Object.values(this.glyphGraphicItems).forEach((function(t){t[NB]=null})),this.glyphGraphicItems=null),p(h(n.prototype),"release",this).call(this)}}])}(CM),pP=function(t){return t.markType===AB.glyph?new vP(t):new CM(t)};function gP(t,e,n){var i=new Map;if(!t||0===t.length)return{keys:[],data:i};if(!e)return i.set(UB,n?t.slice().sort(n):t.slice()),{keys:VB,data:i};var r=oM(e);if(1===t.length){var a=r(t[0]);return i.set(a,[t[0]]),{keys:[a],data:i}}var o=new Set;return t.forEach((function(t){var e,n=r(t),a=null!==(e=i.get(n))&&void 0!==e?e:[];a.push(t),i.set(n,a),o.add(n)})),n&&o.forEach((function(t){i.get(t).sort(n)})),{keys:Array.from(o),data:i}}var yP=function(){return u((function t(e,n,i){o(this,t),this.prevData=(null==e?void 0:e.length)?gP(e,null!=n?n:null,i):null}),[{key:"setCurrentData",value:function(t){this.currentData=t}},{key:"getCurrentData",value:function(){return this.currentData}},{key:"doDiff",value:function(){var t=this;if(this.callback)if(this.currentData&&this.prevData){var e=new Map(this.prevData.data);this.currentData.keys.forEach((function(n){t.callback(n,t.currentData.data.get(n),e.get(n)),e.delete(n)})),this.prevData.keys.forEach((function(n){e.has(n)&&t.callback(n,null,e.get(n))}))}else this.currentData?this.currentData.keys.forEach((function(e){t.callback(e,t.currentData.data.get(e),null)})):this.prevData&&this.prevData.keys.forEach((function(e){t.callback(e,null,t.prevData.data.get(e))}))}},{key:"setCallback",value:function(t){this.callback=t}},{key:"updateToCurrent",value:function(){this.prevData=this.currentData,this.currentData=null}},{key:"reset",value:function(){this.prevData=null}}])}();var mP=function(t,e){if(!t)return null;if(t.from){var n=t.from,i=Object.keys(n);i.forEach((function(t){BC(n[t])&&delete n[t]}));var r=cM(i,e.mark.markType)&&!MC(n.segments);if(r){var a=e.items.map((function(t){return Object.assign({},t,{nextAttrs:Object.assign({},n)})}));t.from=e.transformElementItems(a,e.mark.markType,r)}}if(t.to){var o=t.to,s=Object.keys(o);s.forEach((function(t){BC(o[t])&&delete o[t]}));var u=cM(s,e.mark.markType)&&!MC(o.segments);if(u){var l=e.items.map((function(t){return Object.assign({},t,{nextAttrs:Object.assign({},o)})}));t.to=e.transformElementItems(l,e.mark.markType,u)}}return t};var kP=function(t,e,n,i,r){return RC(n)?n(t.getDatum(),t,r):n};var bP=function(t){function n(t,i,r,a,s){var u;return o(this,n),(u=e(this,n,[t,i,r,a,s]))._interpolator=null==s?void 0:s.interpolator,u._element=null==s?void 0:s.element,u}return c(n,t),u(n,[{key:"onBind",value:function(){var t,e;this.from=null!==(t=this.from)&&void 0!==t?t:{},this.to=null!==(e=this.to)&&void 0!==e?e:{}}},{key:"getEndProps",value:function(){return this.to}},{key:"onUpdate",value:function(t,e,n){this._interpolator&&this._element&&this._interpolator.call(this,e,this.from,this.to,n,this._element.getDatum(),this._element,this.params.parameters)}}])}(ha),_P=function(n){function i(){return o(this,i),e(this,i,arguments)}return c(i,n),u(i,[{key:"getEndProps",value:function(){return this.to}},{key:"onBind",value:function(){var t,e=this,n=null!==(t=this.target.constructor.NOWORK_ANIMATE_ATTR)&&void 0!==t?t:us,i=Object.keys(n).filter((function(t){return 0!==n[t]}));this.subAnimate.animate.preventAttrs(i);var r=Object.assign({},this.from),a=Object.assign({},this.to),o=[];Object.keys(a).forEach((function(t){i.includes(t)?(r[t]=a[t],e.from[t]=a[t]):BC(r[t])?r[t]=e.target.getComputedAttribute(t):o.push(t)})),this.target.animates.forEach((function(t){t!==e.subAnimate.animate&&t.preventAttrs(o)})),this._fromAttribute=r,this._toAttribute=a}},{key:"onStart",value:function(){var e=this;if(this._fromAttribute){var n={};Object.keys(this._fromAttribute).forEach((function(t){e.subAnimate.animate.validAttr(t)&&(n[t]=e._fromAttribute[t])})),this.target.setAttributes(n,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:0,end:!1}})}}},{key:"onEnd",value:function(){var e=this;if(this._toAttribute){var n={};Object.keys(this._toAttribute).forEach((function(t){e.subAnimate.animate.validAttr(t)&&(n[t]=e._toAttribute[t])})),this.target.setAttributes(n,!1,{type:t.AttributeUpdateType.ANIMATE_END})}}},{key:"update",value:function(t,e,n){var i=this;0===this.updateCount&&this.onFirstRun(),this.updateCount+=1;var r=this.step.getLastProps();Object.keys(r).forEach((function(t){i.subAnimate.animate.validAttr(t)&&(n[t]=r[t])})),this.onUpdate(t,e,n),t&&this.onEnd()}},{key:"onUpdate",value:function(t,e,n){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,n,this.step,e,t,this._toAttribute,this._fromAttribute)}}])}(ha);fa.mode|=t.AnimateMode.SET_ATTR_IMMEDIATELY;var xP=0,wP=function(t){return!BC(t)&&(t.prototype instanceof ha||"onBind"in t.prototype&&"onStart"in t.prototype&&"onEnd"in t.prototype&&"onUpdate"in t.prototype)},SP=function(){return u((function t(e,n,i){o(this,t),this.id=xP++,this.isAnimating=!1,this.runnings=[],this.element=e,this.animationOptions=i,this.unit=n}),[{key:"callback",value:function(t){return this.callbackFunction=t,this}},{key:"animate",value:function(t,e){return this.isAnimating=!0,this.animateElement(t,e),0===this.runnings.length&&this.animationEnd(),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end",e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.runnings.forEach((function(e){return e.stop(t)})),this.animationEnd(e),this}},{key:"pause",value:function(){return this.runnings.forEach((function(t){return t.pause()})),this}},{key:"resume",value:function(){return this.runnings.forEach((function(t){return t.resume()})),this}},{key:"startAt",value:function(t){var e=this;return this.runnings.forEach((function(n){var i=e.unit.initialDelay;n.startAt(i+t)})),this}},{key:"getTotalAnimationTime",value:function(){var t,e=this.unit.initialDelay+this.unit.loopDuration*this.unit.loopCount;return null!==(t=this.unit.totalTime)&&void 0!==t?t:e}},{key:"getEndAttributes",value:function(){return this.runnings.reduce((function(t,e){return Object.assign(t,e.getEndProps())}),{})}},{key:"animationEnd",value:function(){var t,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isAnimating=!1,this.runnings=null,e&&(null===(t=this.callbackFunction)||void 0===t||t.call(null))}},{key:"animateElement",value:function(t,e){var n=this,i=this.element.getGraphicItem();if(i){var r=i.animate();this.runnings.push(r),r.startAt(this.unit.initialDelay),r.wait(this.unit.loopDelay),this.unit.timeSlices.forEach((function(i){n.animateTimeSlice(r,i,t,e)})),r.wait(this.unit.loopDelayAfter),r.loop(this.unit.loopCount-1),GC(this.unit.totalTime)&&setTimeout((function(){r&&r.stop("end")}),this.unit.totalTime),r.onEnd((function(){n.runnings=n.runnings.filter((function(t){return t!==r})),0===n.runnings.length&&n.animationEnd()}))}}},{key:"animateTimeSlice",value:function(t,e,n,i){var r=this,a=e.delay,o=e.delayAfter,s=e.duration,u=e.effects;if(a>0&&t.wait(a),u.length<0)t.wait(s);else{var l=u.map((function(t,e){var a,o=null!==(a=t.type?function(t,e,n,i){var r=RC(e.options)?e.options.call(null,t.getDatum(),t,i):e.options;if(!e.type||!vM.getAnimationType(e.type))return null;var a=vM.getAnimationType(e.type)(t,r,n);return mP(a,t)}(r.element,t,n,i):t.channel?function(t,e,n,i){var r=e.channel,a=null;return DC(r)?a=r.reduce((function(e,n){return e.from[n]=t.getGraphicAttribute(n,!0),e.to[n]=t.getGraphicAttribute(n,!1),e}),{from:{},to:{}}):PC(r)&&(a=Object.keys(r).reduce((function(e,n){var a,o,s=!BC(null===(a=r[n])||void 0===a?void 0:a.from),u=!BC(null===(o=r[n])||void 0===o?void 0:o.to);return(s||u)&&(e.from[n]=s?kP(t,0,r[n].from,0,i):void 0,e.to[n]=u?kP(t,0,r[n].to,0,i):t.getGraphicAttribute(n,!1)),e}),{from:{},to:{}})),mP(a,t)}(r.element,t,0,i):void 0)&&void 0!==a?a:{},u=o.custom||(null==t?void 0:t.custom),l=(null==o?void 0:o.customParameters)||(null==t?void 0:t.customParameters);o.from&&Object.keys(o.from).length&&r.unit&&r.animationOptions.timeline.controlOptions.immediatelyApply&&"component"!==r.element.mark.markType&&r.element.getGraphicItem().setAttributes(o.from);var c=wP(u);return BC(u)||wP(u)?c?new u(o.from,o.to,s,t.easing,l):o.to?new _P(o.from,o.to,s,t.easing):void 0:new bP(o.from,o.to,s,t.easing,{interpolator:u,element:r.element,parameters:l})})).filter((function(t){return!BC(t)}));1===l.length?t.play(l[0]):l.length>1&&t.play(new $a(s,l))}o>0&&t.wait(o)}}])}();function AP(t){var e=[];return Object.keys(t).forEach((function(n){e=e.concat(TP(n,t[n]))})),e}function TP(t,e){var n=[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return aE(e).forEach((function(e){var r,a=function(t){var e,n,i,r,a,o,s,u,l,c,h,d;if(BC(t.timeSlices)){var f=t;return{startTime:null!==(e=f.startTime)&&void 0!==e?e:YB,totalTime:f.totalTime,oneByOne:null!==(n=f.oneByOne)&&void 0!==n?n:JB,loop:null!==(i=f.loop)&&void 0!==i?i:ZB,controlOptions:QC({},QB,null!==(r=f.controlOptions)&&void 0!==r?r:{}),timeSlices:[{duration:null!==(a=f.duration)&&void 0!==a?a:XB,delay:null!==(o=f.delay)&&void 0!==o?o:KB,delayAfter:null!==(s=f.delayAfter)&&void 0!==s?s:qB,effects:[{type:f.type,channel:f.channel,custom:f.custom,easing:null!==(u=f.easing)&&void 0!==u?u:$B,customParameters:f.customParameters,options:f.options}]}]}}var v=aE(t.timeSlices).filter((function(t){return t.effects&&aE(t.effects).filter((function(t){return t.channel||t.type})).length}));if(v.length)return{startTime:null!==(l=t.startTime)&&void 0!==l?l:YB,totalTime:t.totalTime,oneByOne:null!==(c=t.oneByOne)&&void 0!==c?c:JB,loop:null!==(h=t.loop)&&void 0!==h?h:ZB,controlOptions:QC({},QB,null!==(d=t.controlOptions)&&void 0!==d?d:{}),timeSlices:v.map((function(t){var e,n;return{duration:t.duration,delay:null!==(e=t.delay)&&void 0!==e?e:KB,delayAfter:null!==(n=t.delayAfter)&&void 0!==n?n:qB,effects:aE(t.effects).filter((function(t){return t.channel||t.type})).map((function(t){var e;return{type:t.type,channel:t.channel,custom:t.custom,easing:null!==(e=t.easing)&&void 0!==e?e:$B,customParameters:t.customParameters,options:t.options}}))}})),partitioner:t.partitioner,sort:t.sort}}(e);a&&(n.push({state:t,id:null!==(r=a.id)&&void 0!==r?r:"".concat(t,"-").concat(i),timeline:a,originConfig:e}),i+=1)})),n}function CP(t,e,n){return RC(t)?t.call(null,e.getDatum(),e,n):t}var EP=function(){return u((function t(e){o(this,t),this.parallelArrangers=[this],this.totalTime=0,this.startTime=0,this.endTime=0,this.animators=e.filter((function(t){return!BC(t)})),this.totalTime=this.animators.reduce((function(t,e){return Math.max(t,e.getTotalAnimationTime())}),0)}),[{key:"parallel",value:function(t){var e=Array.from(new Set(this.parallelArrangers.concat(t.parallelArrangers)));return e.forEach((function(t){t.parallelArrangers=e})),this.arrangeTime(),this}},{key:"after",value:function(t){return this.afterArranger=t,this.arrangeTime(),this}},{key:"arrangeTime",value:function(){var t=this.parallelArrangers.reduce((function(t,e){return Math.max(t,e.totalTime)}),this.totalTime),e=this.parallelArrangers.reduce((function(t,e){var n,i;return Math.max(t,null!==(i=null===(n=e.afterArranger)||void 0===n?void 0:n.endTime)&&void 0!==i?i:0)}),0);this.parallelArrangers.forEach((function(n){n.startTime=e,n.endTime=e+t,n.animators.forEach((function(t){t.startAt(e)}))}))}}])}(),RP=function(){return u((function t(e,n){o(this,t),this.state=null,this.immediateConfigs=[],this.isEnabled=!0,this.disabledStates=[],this.animators=new Map,this.elementRecorder=new WeakMap,this.timelineCount={},this.mark=e,this.configs=AP(null!=n?n:{})}),[{key:"getAnimationConfigs",value:function(t){var e;return this.isEnabled?(null!==(e=this.configs)&&void 0!==e?e:[]).filter((function(e){return e.state===t})):[]}},{key:"updateConfig",value:function(t){this.configs=AP(null!=t?t:{})}},{key:"updateState",value:function(t){this.state=t}},{key:"animate",value:function(){var t=this;if(this.isEnabled&&this.configs&&this.configs.length){var e=this.mark.getAllElements(),n=this.mark.parameters();return e.forEach((function(e){var n;e.isReserved&&e.diffState!==SB.exit&&(e.isReserved=!1);var i=null===(n=t.elementRecorder.get(e))||void 0===n?void 0:n.prevState;t.configs.some((function(t){return i!==e.diffState&&t.state===i&&t.timeline.controlOptions.stopWhenStateChange}))&&t.clearElementAnimation(e,!1)})),this.configs.forEach((function(i){t.animateByTimeline(i,e,n)})),this.mark.cleanExitElements(),this}}},{key:"runAnimationByState",value:function(t){var e=this;if(this.isEnabled){var n=this.configs.filter((function(e){return e.state===t})),i=this.mark.getAllElements(),r=this.mark.parameters(),a=n.reduce((function(t,n){return t.concat(e.animateByTimeline(n,i,r,!0))}),[]);return new EP(a)}}},{key:"stopAnimationByState",value:function(t){var e=this.animators.get(t);return e&&e.forEach((function(t){return t.stop()})),this}},{key:"pauseAnimationByState",value:function(t){var e=this.animators.get(t);return e&&e.forEach((function(t){return t.pause()})),this}},{key:"resumeAnimationByState",value:function(t){var e=this.animators.get(t);return e&&e.forEach((function(t){return t.resume()})),this}},{key:"run",value:function(t){var e=this;if(this.isEnabled){var n=TP(HB,t,this.immediateConfigs.length);this.immediateConfigs=this.immediateConfigs.concat(n);var i=this.mark.getAllElements(),r=this.mark.parameters(),a=n.reduce((function(t,n){return t.concat(e.animateByTimeline(n,i,r,!0))}),[]);return new EP(a)}}},{key:"stop",value:function(){return this.animators.forEach((function(t){t.forEach((function(t){return t.stop()}))})),this}},{key:"pause",value:function(){return this.animators.forEach((function(t){return t.forEach((function(t){return t.pause()}))})),this}},{key:"resume",value:function(){return this.animators.forEach((function(t){return t.forEach((function(t){return t.resume()}))})),this}},{key:"reverse",value:function(){return this}},{key:"restart",value:function(){return this}},{key:"record",value:function(){return this}},{key:"recordEnd",value:function(){return this}},{key:"isAnimating",value:function(){var t=!1;return this.animators.forEach((function(e){t=t||e.some((function(t){return t.isAnimating}))})),t}},{key:"isElementAnimating",value:function(t){var e,n=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.count;return BC(n)||Object.values(n).every((function(t){return 0===t}))}},{key:"getAnimatorCount",value:function(){var t=0;return this.animators.forEach((function(e){return t+=e.length})),t}},{key:"getAllAnimators",value:function(){var t=[];return this.animators.forEach((function(e){t.push.apply(t,y(e))})),t}},{key:"getElementAnimators",value:function(t,e){var n,i=aE(t),r=[];return e?r=null!==(n=this.animators.get(e))&&void 0!==n?n:[]:this.animators.forEach((function(t){r=r.concat(t)})),r.filter((function(t){return i.includes(t.element)}))}},{key:"enable",value:function(){return this.isEnabled=!0,this}},{key:"disable",value:function(){return this.isEnabled=!1,this.stop(),this.animators.clear(),this}},{key:"enableAnimationState",value:function(t){var e=aE(t);return this.disabledStates=this.disabledStates.filter((function(t){return!e.includes(t)})),this}},{key:"disableAnimationState",value:function(t){var e=aE(t);return this.disabledStates=this.disabledStates.concat(e),this}},{key:"release",value:function(){this.stop(),this.animators.clear(),this.configs=null,this.animators=null,this.elementRecorder=null,this.timelineCount=null}},{key:"animateByTimeline",value:function(t,e,n){var i,r=this,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=[],s=e.filter((function(e){var i=!(e.isReserved&&e.diffState===SB.exit),o=r.getAnimationState(e),s=!r.disabledStates.includes(o),u=a||o===t.state,l=!t.timeline.partitioner||t.timeline.partitioner(e.getDatum(),e,n);return i&&s&&u&&l}));if(s.length){BC(this.timelineCount[t.id])&&(this.timelineCount[t.id]=0),t.timeline.sort&&s.sort((function(e,i){return t.timeline.sort(e.getDatum(),i.getDatum(),e,i,n)}));var u={width:this.mark.view.width(),height:this.mark.view.height(),group:null!==(i=this.mark.group)&&void 0!==i?i:null,mark:this.mark,view:this.mark.view,elementCount:s.length,elementIndex:0};s.forEach((function(e,i){u.elementIndex=i;var a=Object.assign(l({},"VGRAMMAR_ANIMATION_PARAMETERS",u),n),c=r.getAnimationUnit(t.timeline,e,i,s.length,a);o.push(r.animateElement(t,c,e,u,a))}))}return o}},{key:"animateElement",value:function(t,e,n,i,r){var a,o,s=this,u=new SP(n,e,t);if(u.animate(i,r),u.isAnimating){n.diffState===SB.exit&&(n.isReserved=!0);var l=0===this.timelineCount[t.id];this.timelineCount[t.id]+=1;var c=null!==(a=this.elementRecorder.get(n))&&void 0!==a?a:{prevState:t.state,count:{}};c.prevState=t.state,c.count[t.state]=(null!==(o=c.count[t.state])&&void 0!==o?o:0)+1,this.elementRecorder.set(n,c);var h=this.animators.get(t.state);h?h.push(u):this.animators.set(t.state,[u]),u.callback((function(){s.handleAnimatorEnd(u)}));var d={mark:this.mark,animationState:t.state,animationConfig:t.originConfig};return l&&this.mark.emit(LB.ANIMATION_START,d),this.mark.emit(LB.ELEMENT_ANIMATION_START,d,n),u}}},{key:"getAnimationState",value:function(t){var e=iM(this.state,this.mark.parameters(),t.getDatum(),t);return null!=e?e:t.diffState}},{key:"getAnimationUnit",value:function(t,e,n,i,r){var a=[],o=CP(t.startTime,e,r),s=CP(t.totalTime,e,r),u=CP(t.oneByOne,e,r),l=CP(t.loop,e,r),c=0;t.timeSlices.forEach((function(t){var n,o=CP(t.delay,e,r),u=CP(t.delayAfter,e,r),l=null!==(n=CP(t.duration,e,r))&&void 0!==n?n:s/i,h=aE(t.effects).map((function(t){return Object.assign({},t,{customParameters:CP(t.customParameters,e,r)})}));a.push({effects:h,duration:l,delay:o,delayAfter:u}),c+=o+l+u}));var h=NC(u)?u:!0===u?c:0;return{initialDelay:o,loopCount:NC(l)?l:!0===l?1/0:1,loopDelay:h*n,loopDelayAfter:h*(i-n-1),loopAnimateDuration:c,loopDuration:c+h*(i-1),totalTime:s,timeSlices:a}}},{key:"clearElementAnimation",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.animators.forEach((function(i){i.forEach((function(i){i.element===t&&(i.animationOptions.state===SB.exit?i.stop("start",!1):i.stop("end",!1),e.handleAnimatorEnd(i,n))}))})),this.elementRecorder.delete(t)}},{key:"clearAllElements",value:function(){var t=this,e=this.mark.getAllElements();e&&e.forEach((function(n,i){t.clearElement(n,i===e.length-1)}))}},{key:"clearElement",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.clearElementAnimation(t),t.getGraphicItem()&&(t.clearGraphicAttributes(),t.diffState===SB.exit&&(t.isReserved=!1),e&&this.mark.cleanExitElements())}},{key:"handleAnimatorEnd",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t.element,i=t.animationOptions,r=i.state,a=r===HB,o=this.elementRecorder.get(n).count;o[r]-=1,this.animators.set(r,this.animators.get(r).filter((function(e){return e!==t}))),0===this.animators.get(r).length&&this.animators.delete(r),this.timelineCount[i.id]-=1;var s=0===this.timelineCount[i.id],u=a?this.immediateConfigs.find((function(t){return t.id===i.id})).originConfig:this.configs.find((function(t){return t.id===i.id})).originConfig;s&&(delete this.timelineCount[i.id],a&&(this.immediateConfigs=this.immediateConfigs.filter((function(t){return t.id!==i.id})))),e&&(0===Object.keys(this.timelineCount).length?this.clearAllElements():r===SB.exit&&0===o[SB.exit]&&this.clearElement(n));var l={mark:this.mark,animationState:r,animationConfig:u};s&&this.mark.emit(LB.ANIMATION_END,l),this.mark.emit(LB.ELEMENT_ANIMATION_END,l,n)}}])}(),BP=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[t])).grammarType="mark",a.elements=[],a.elementMap=new Map,a.isUpdated=!0,a._isReentered=!1,a.animate=new RP(f(a),{}),a.differ=new yP([]),a.markType=i,a.spec.type=i,a.spec.encode={update:{}},a.spec.group=r,r&&(a.group=r,a.attach(r),r.appendChild(f(a))),a}return c(n,t),u(n,[{key:"parse",value:function(t){var e,i,r,a=this;if(p(h(n.prototype),"parse",this).call(this,t),this.spec.group){var o=LC(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(o)}var s=LC(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(s),this.join(null===(e=t.from)||void 0===e?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys(null!==(i=this.spec.encode)&&void 0!==i?i:{}).forEach((function(t){a.encodeState(t,{},!0)})),Object.keys(null!==(r=t.encode)&&void 0!==r?r:{}).forEach((function(e){a.encodeState(e,t.encode[e])})),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}},{key:"parameters",value:function(){var t;return null!==(t=this._finalParameters)&&void 0!==t?t:p(h(n.prototype),"parameters",this).call(this)}},{key:"parseAddition",value:function(t){return this}},{key:"reuse",value:function(t){var e=this;if(t.grammarType!==this.grammarType)return this;var n=t;return this.markType=n.markType,this.coord=n.coord,this.elementMap=n.elementMap,this.elements=n.elements,this.elementMap.forEach((function(t){return t.mark=e})),this.differ=n.differ,this.animate=n.animate,this.animate.mark=this,this._context=n._context,this.graphicItem=n.graphicItem,this.graphicIndex=n.graphicIndex,this.graphicParent=n.graphicParent,this.needClear=n.needClear,this.isUpdated=n.isUpdated,this}},{key:"needLayout",value:function(){return!BC(this.spec.layout)}},{key:"handleLayoutEnd",value:function(){}},{key:"handleRenderEnd",value:function(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach((function(t){t.diffState===SB.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()})),this.differ.updateToCurrent(),this.needClear=!1)}},{key:"evaluateMainTasks",value:function(t,e){var n;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===IB.before)return this;var i=null===(n=this.view.renderer)||void 0===n?void 0:n.stage();this.init(i,e);var r=this.evaluateTransform(this._getTransformsBeforeJoin(),null!=t?t:WB,e),a=(null==r?void 0:r.progressive)?t:r;return this.evaluateGroup(a),this.renderContext=this.parseRenderContext(a,e),this.renderContext.progressive?(this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive()):((null==r?void 0:r.progressive)&&(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=r.progressive,a=r.progressive.output()),this.emit(LB.BEFORE_MARK_JOIN),this.evaluateJoin(a),this.emit(LB.AFTER_MARK_JOIN),this.emit(LB.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(LB.AFTER_MARK_STATE),this.emit(LB.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(LB.AFTER_MARK_ENCODE)),this.emit(LB.BEFORE_MARK_UPDATE),this.update(this.spec),this.emit(LB.AFTER_MARK_UPDATE),this}},{key:"evaluateGroup",value:function(t){if(this.markType!==AB.group){var e=gP(null!=t?t:WB,this.spec.groupBy,this.spec.groupSort),n=e.keys;this._groupKeys=n,this._groupEncodeResult=null,this.differ.setCurrentData(e)}}},{key:"_getTransformsAfterEncodeItems",value:function(){return this.transforms&&this.transforms.filter((function(t){return"afterEncodeItems"===t.markPhase}))}},{key:"_getTransformsAfterEncode",value:function(){return this.transforms&&this.transforms.filter((function(t){return BC(t.markPhase)||"afterEncode"===t.markPhase}))}},{key:"_getTransformsBeforeJoin",value:function(){return this.transforms?this.transforms.filter((function(t){return"beforeJoin"===t.markPhase})):[]}},{key:"evaluate",value:function(t,e){var n;return this.evaluateMainTasks(t,e),(null===(n=this.renderContext)||void 0===n?void 0:n.progressive)||this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e),this}},{key:"output",value:function(){return this}},{key:"join",value:function(t,e,n,i,r){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,BC(t)||(LC(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=n,this.spec.groupBy=i,this.spec.groupSort=r,this.commit(),this}},{key:"coordinate",value:function(t){return LC(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}},{key:"state",value:function(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}},{key:"encode",value:function(t,e,n){return this.encodeState(SB.update,t,e,n)}},{key:"encodeState",value:function(t,e,n,i){var r=this;if(t===SB.enter&&(this._isReentered=!0),this.spec.encode[t]){var a=this.spec.encode[t];if(nM(a))this.detach(lM(a,this.view));else{var o=LC(e);o&&i||!o&&n?(Object.keys(a).forEach((function(t){r.detach(lM(a[t],r.view))})),this.spec.encode[t]={}):o?this.detach(lM(a[e],this.view)):Object.keys(e).forEach((function(t){r.detach(lM(a[t],r.view))}))}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),LC(e)?(this.spec.encode[t][e]=n,this.attach(lM(n,this.view))):nM(e)?(this.spec.encode[t]=e,this.attach(lM(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach((function(t){r.attach(lM(t,r.view))})))),this.commit(),this}},{key:"_getEncoders",value:function(){var t;return null!==(t=this.spec.encode)&&void 0!==t?t:{}}},{key:"animation",value:function(t){return this.spec.animation=t,this}},{key:"animationState",value:function(t){return this.setFunctionSpec(t,"animationState")}},{key:"layout",value:function(t){return this.spec.layout=t,this.commit(),this}},{key:"morph",value:function(t,e,n){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=n,this}},{key:"transform",value:function(t){var e=NM(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);var n=NM(t,this.view);return n&&(this.attach(n.refs),this.transforms=n.transforms),this.spec.transform=t,this.commit(),this}},{key:"configure",value:function(t){var e=this,n=["clip","clipPath","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments","stateSort"];return null===t?(n.forEach((function(t){BC(e.spec[t])||(e.spec[t]=void 0)})),this):(n.forEach((function(n){BC(t[n])||(e.spec[n]=t[n])})),this)}},{key:"context",value:function(t){return this.spec.context=t,this._context=t,this}},{key:"isCollectionMark",value:function(){return GB.includes(this.markType)}},{key:"needAnimate",value:function(){var t;return!(null===(t=this.renderContext)||void 0===t?void 0:t.progressive)&&!BC(this.spec.animation)}},{key:"getAllElements",value:function(){var t=this,e=this.elements.slice();return this.elementMap.forEach((function(t){t.diffState!==SB.exit||e.includes(t)||e.push(t)})),this.spec.sort&&e.sort((function(e,n){return t.spec.sort(e.getDatum(),n.getDatum())})),e}},{key:"getScales",value:function(){var t={};return this.references.forEach((function(e,n){n.grammarType===DB.scale&&(t[n.id()]=n.output())})),t}},{key:"getScalesByChannel",value:function(){var t=this.spec.encode;if(!t)return{};var e={},n=this.parameters();return Object.keys(t).forEach((function(i){var r=t[i];r&&!nM(r)&&Object.keys(r).forEach((function(t){sM(r[t])&&(e[t]=rM(r[t].scale,n))}))})),e}},{key:"getFieldsByChannel",value:function(){var t=this.spec.encode;if(!t)return{};var e={};return Object.keys(t).forEach((function(n){var i=t[n];nM(i)||Object.keys(i).forEach((function(t){uM(i[t])&&(e[t]=i[t].field)}))})),e}},{key:"init",value:function(t,e){var n,i,r,a,o=this;if(this._delegateEvent||(this._delegateEvent=function(t,e){var n,i=null===(n=t.target)||void 0===n?void 0:n[NB];if((null==i?void 0:i.mark)===o){var r=sP(o.view,t,i,0,WM);o.emitGrammarEvent(e,r,i)}},this.initEvent()),this.animate||(this.animate=new RP(this,this.spec.animation),this.needAnimate()&&this.animate.updateState(this.spec.animationState)),!this.group){var s=rM(this.spec.group,e);this.group=s,s&&s.appendChild(this)}var u=this.group?this.group.getGroupGraphicItem():t.defaultLayer,l=null!==(r=null===(i=null===(n=this.group)||void 0===n?void 0:n.children)||void 0===i?void 0:i.indexOf(this))&&void 0!==r?r:0;if(this.markType!==AB.group){if(!this.graphicItem){var c=gM(this,AB.group,{pickable:!1,zIndex:null!==(a=this.spec.zIndex)&&void 0!==a?a:0});(this.spec.support3d||zB.includes(this.markType))&&c.setMode("3d"),c.name="".concat(this.id()||this.markType),this.graphicItem=c}this.graphicParent=this.graphicItem,!u||this.graphicIndex===l&&this.graphicItem.parent===u||u.insertIntoKeepIdx(this.graphicItem,l)}else this.graphicParent=u;this.graphicIndex=l}},{key:"update",value:function(t){if(this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||(t.animation&&this.animate.updateConfig(t.animation),this.animate.updateState(t.animationState)),this.markType!==AB.group){if(BC(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),BC(t.clip)||this.graphicItem.setAttribute("clip",t.clip),!BC(t.clipPath)){var e=DC(t.clipPath)?t.clipPath:t.clipPath(this.elements);e&&e.length?this.graphicItem.setAttribute("path",e):this.graphicItem.setAttributes({path:e,clip:!1})}this.elementMap.forEach((function(t){t.updateGraphicItem()}))}else this.elementMap.forEach((function(t){t.updateGraphicItem()}))}},{key:"evaluateJoin",value:function(t){var e,n,i,r,a=this;this.needClear=!0;var o=oM(null!==(i=null!==(e=this.spec.key)&&void 0!==e?e:null===(n=this.grammarSource)||void 0===n?void 0:n.getDataIDKey())&&void 0!==i?i:function(){return UB}),s=oM(null!==(r=this.spec.groupBy)&&void 0!==r?r:function(){return UB}),u=this.spec.sort,l=this.isCollectionMark(),c=new Set(this.elements.filter((function(t){return t.diffState===SB.enter}))),h=[];this.differ.setCallback((function(t,e,n){var i,r=t;if(BC(e))(i=a.elementMap.get(r))&&(i.diffState=SB.exit);else if(BC(n)){(i=a.elementMap.has(r)?a.elementMap.get(r):pP(a)).diffState===SB.exit&&(i.diffState=SB.enter,a.animate.getElementAnimators(i,SB.exit).forEach((function(t){return t.stop("start")}))),i.diffState=SB.enter;var u=l?t:s(e[0]);i.updateData(u,e,o,a.view),a.elementMap.set(r,i),h.push(i)}else if(i=a.elementMap.get(r)){i.diffState=SB.update;var d=l?t:s(e[0]);i.updateData(d,e,o,a.view),h.push(i)}c.delete(i)}));var d=null!=t?t:WB;l||this.differ.setCurrentData(gP(d,(function(t){return"".concat(s(t),"-").concat(o(t))}),void 0)),this.differ.doDiff(),c.forEach((function(t){a.elementMap.delete(l?t.groupKey:"".concat(t.groupKey,"-").concat(t.key)),t.remove(),t.release()})),this.elements=h,u&&this.elements.length>=2&&this.elements.sort((function(t,e){return u(t.getDatum(),e.getDatum())}))}},{key:"evaluateState",value:function(t,e,n){e&&t.forEach((function(t){t.state(e,n)}))}},{key:"evaluateGroupEncode",value:function(t,e,n){if(this._groupKeys&&e){var i={};return this._groupKeys.forEach((function(r){var a=t.find((function(t){return t.groupKey===r}));a&&(i[r]=dM(e,a.items&&a.items[0]&&a.items[0].datum,a,n))})),this._groupEncodeResult=i,i}}},{key:"getChannelsFromConfig",value:function(t){var e=this.spec;return BC(e.interactive)?null:{pickable:e.interactive}}},{key:"evaluateEncode",value:function(t,e,n,i){var r=this,a=this.getChannelsFromConfig();if(e){this.emit(LB.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:n},this);var o=i?null:this.evaluateGroupEncode(t,e[wB.group],n);t.forEach((function(t){r.markType===AB.glyph&&r._groupEncodeResult?t.items.forEach((function(e){e.nextAttrs=Object.assign(e.nextAttrs,a,r._groupEncodeResult[t.groupKey])})):(null==o?void 0:o[t.groupKey])&&!r.isCollectionMark()?t.items.forEach((function(e){e.nextAttrs=Object.assign(e.nextAttrs,a,o[t.groupKey])})):a&&t.items.forEach((function(t){t.nextAttrs=Object.assign(t.nextAttrs,a)})),t.encodeItems(t.items,e,r._isReentered,n)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,n),t.forEach((function(t){t.encodeGraphic(r.isCollectionMark()?null==o?void 0:o[t.groupKey]:null)})),this.emit(LB.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:n},this)}else t.forEach((function(t){t.initGraphicItem(a)}))}},{key:"addGraphicItem",value:function(t,e,n){var i,r=null!=n?n:gM(this,this.markType,t);if(r){if(null===(i=this.renderContext)||void 0===i?void 0:i.progressive){var a;if(this._groupKeys){var o=this._groupKeys.indexOf(e);o>=0&&(a=this.graphicParent.getChildAt(o))}else a=this.graphicParent.at(0);this.isCollectionMark()?(r.incremental=1,a.appendChild(r)):a.incrementalAppendChild(r)}else this.graphicParent.appendChild(r);return r}}},{key:"parseRenderContext",value:function(t,e){var n=this,i=this.markType!==AB.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep<this.spec.progressiveThreshold,r=this.spec.large&&this.spec.largeThreshold>0&&t.length>=this.spec.largeThreshold;if(i){var a=this.differ.getCurrentData();return a&&a.keys&&a.keys.some((function(t){return a.data.get(t).length>n.spec.progressiveThreshold}))?{large:r,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:a.keys.reduce((function(t,e){return Math.max(Math.ceil(a.data.get(e).length/n.spec.progressiveStep),t)}),1),groupedData:a.data}}:{large:r}}return{large:r}}},{key:"isProgressive",value:function(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}},{key:"isDoingProgressive",value:function(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex<this.renderContext.progressive.totalStep||this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.unfinished())}},{key:"clearProgressive",value:function(){this.renderContext&&this.renderContext.progressive&&(this.elements=[],this.graphicParent.children.forEach((function(t){t.incrementalClearChild()})),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}},{key:"restartProgressive",value:function(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}},{key:"evaluateJoinProgressive",value:function(){var t,e,n,i=this,r=this.renderContext.progressive.currentIndex,a=oM(null!==(n=null!==(t=this.spec.key)&&void 0!==t?t:null===(e=this.grammarSource)||void 0===e?void 0:e.getDataIDKey())&&void 0!==n?n:function(){return UB}),o=[];if(this.isCollectionMark())return this._groupKeys.forEach((function(t,e){var n=i.renderContext.progressive.groupedData.get(t),s=i.renderContext.progressive.step,u=n.slice(r*s,(r+1)*s);if(0===r){var l=pP(i);l.diffState=SB.enter,l.updateData(t,u,a,i.view),o.push(l)}else{var c=i.elements[e];c.updateData(t,u,a,i.view),o.push(c)}})),o;var s={};return this._groupKeys.forEach((function(t){var e=i.renderContext.progressive.groupedData.get(t),n=i.renderContext.progressive.step,u=e.slice(r*n,(r+1)*n),l=[];u.forEach((function(e){var n=pP(i);n.diffState=SB.enter,n.updateData(t,[e],a,i.view),l.push(n),o.push(n)})),s[t]=l})),{groupElements:s,elements:o}}},{key:"evaluateEncodeProgressive",value:function(t,e,n){var i=this.renderContext.progressive.currentIndex;if(0===i){if(this.evaluateEncode(t,e,n),0===i&&this._groupEncodeResult&&!this.isCollectionMark()&&this.markType!==AB.glyph){var r=t[0],a=r.getGraphicItem(),o=null==a?void 0:a.parent;o&&this._groupEncodeResult[r.groupKey]&&o.setTheme({common:this._groupEncodeResult[r.groupKey]})}}else this.evaluateEncode(t,e,n,!0)}},{key:"evaluateProgressive",value:function(){var t,e,n,i=this;if(null===(t=this.renderContext)||void 0===t?void 0:t.beforeTransformProgressive){this.renderContext.beforeTransformProgressive.progressiveRun();var r=this.renderContext.beforeTransformProgressive.output();return this.emit(LB.BEFORE_MARK_JOIN),this.evaluateJoin(r),this.emit(LB.AFTER_MARK_JOIN),this.emit(LB.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(LB.AFTER_MARK_STATE),this.emit(LB.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(LB.AFTER_MARK_ENCODE)}if(null===(e=this.renderContext)||void 0===e?void 0:e.progressive){var a=this.renderContext.parameters;this.emit(LB.BEFORE_MARK_JOIN);var o=this.evaluateJoinProgressive(),s=Array.isArray(o)?o:o.elements;if(this.emit(LB.AFTER_MARK_JOIN),0===this.renderContext.progressive.currentIndex?(this.graphicParent.removeAllChild(),this._groupKeys.forEach((function(t){var e=gM(i,AB.group,{pickable:!1,zIndex:i.spec.zIndex});e.incremental=i.renderContext.progressive.step,i.graphicParent.appendChild(e)})),this.elements=s):this.elements=this.elements.concat(s),this.emit(LB.BEFORE_MARK_STATE),this.evaluateState(s,this.spec.state,a),this.emit(LB.AFTER_MARK_STATE),this.emit(LB.BEFORE_MARK_ENCODE),Array.isArray(o))this.evaluateEncodeProgressive(s,this._getEncoders(),a);else{var u=o.groupElements;Object.keys(u).forEach((function(t){i.evaluateEncodeProgressive(u[t],i._getEncoders(),a)}))}this.emit(LB.AFTER_MARK_ENCODE);var l=null===(n=this._getTransformsAfterEncode())||void 0===n?void 0:n.filter((function(t){return!0===t.canProgressive}));(null==l?void 0:l.length)&&this.evaluateTransform(l,this.elements,a),this.renderContext.progressive.currentIndex+=1}}},{key:"isLargeMode",value:function(){return this.renderContext&&this.renderContext.large}},{key:"cleanExitElements",value:function(){var t=this;this.elementMap.forEach((function(e,n){e.diffState!==SB.exit||e.isReserved||(t.elementMap.delete(n),e.remove(),e.release())}))}},{key:"getGroupGraphicItem",value:function(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}},{key:"getBounds",value:function(){var t;return this.graphicItem?this.graphicItem.AABBBounds:null===(t=this.getGroupGraphicItem())||void 0===t?void 0:t.AABBBounds}},{key:"getMorphConfig",value:function(){var t;return{morph:null!==(t=this.spec.morph)&&void 0!==t&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}},{key:"getAttributeTransforms",value:function(){var t;return null!==(t=this.spec.attributeTransforms)&&void 0!==t?t:bM[this.markType]}},{key:"getContext",value:function(){return this._context}},{key:"needSkipBeforeLayout",value:function(){var t,e;if(!0===(null===(t=this.spec.layout)||void 0===t?void 0:t.skipBeforeLayouted))return!0;for(var n=this.group;n;){if(!0===(null===(e=n.getSpec().layout)||void 0===e?void 0:e.skipBeforeLayouted))return!0;n=n.group}return!1}},{key:"initEvent",value:function(){if(this._delegateEvent){var t=this.view.renderer.stage();t&&t.on("*",this._delegateEvent)}}},{key:"releaseEvent",value:function(){if(this._delegateEvent){var t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}},{key:"clear",value:function(){var t;this.releaseEvent(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,null===(t=this.group)||void 0===t||t.removeChild(this),this.group=null,p(h(n.prototype),"clear",this).call(this)}},{key:"prepareRelease",value:function(){this.animate.stop(),this.elementMap.forEach((function(t){return t.diffState=SB.exit})),this._finalParameters=this.parameters()}},{key:"release",value:function(){this.releaseEvent(),this.elements.forEach((function(t){return t.release()})),this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&yM(this.graphicItem),this.detachAll(),p(h(n.prototype),"release",this).call(this)}}])}(DM),MP=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[t,AB.group,i])).children=[],r}return c(n,t),u(n,[{key:"parseRenderContext",value:function(){return{large:!1}}},{key:"appendChild",value:function(t){return this.children.push(t),this}},{key:"removeChild",value:function(t){return this.children=this.children.filter((function(e){return e!==t})),this}},{key:"includesChild",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!!this.children.includes(t)||!!e&&this.children.some((function(e){return e.markType===AB.group&&e.includesChild(t,!0)}))}},{key:"updateLayoutChildren",value:function(){return this.children.length?(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter((function(t){return t.needLayout()})),this):this}},{key:"getAttributeTransforms",value:function(){return bM.rect}},{key:"evaluateJoin",value:function(t){if(!this.elements.length){var e=pP(this);e.updateData(UB,WB,(function(){return""}),this.view),this.elements=[e],this.elementMap.set(UB,e)}}},{key:"getChannelsFromConfig",value:function(t){var e=this.spec,n={};if(BC(e.clip)||(n.clip=e.clip),BC(e.zIndex)||(n.zIndex=e.zIndex),!BC(e.clipPath)){var i=RC(e.clipPath)?e.clipPath([t]):e.clipPath;i&&i.length?n.path=i:(n.path=null,n.clip=!1)}return BC(e.interactive)||(n.pickable=e.interactive),n}},{key:"evaluateGroupEncode",value:function(t,e,n){var i,r=this.elements[0],a={};return hM(r,[Object.assign({},null===(i=r.items)||void 0===i?void 0:i[0],{nextAttrs:a})],e,n),this._groupEncodeResult=a,a}},{key:"evaluateEncode",value:function(t,e,n,i){var r=this,a=this.getChannelsFromConfig();if(e){this.emit(LB.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:n},this);var o=i?null:this.evaluateGroupEncode(t,e[wB.group],n);t.forEach((function(t){t.items.forEach((function(t){t.nextAttrs=Object.assign(t.nextAttrs,a,o)})),t.encodeItems(t.items,e,r._isReentered,n)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,n),t.forEach((function(t){t.encodeGraphic()})),this.emit(LB.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:n},this)}else t.forEach((function(t){t.initGraphicItem(a)}))}},{key:"addGraphicItem",value:function(t,e,n){var i=null!=n?n:gM(this,this.markType,t);if(i)return this.emit(LB.BEFORE_ADD_VRENDER_MARK,{graphicItem:i}),i.name="".concat(this.id()||this.markType),this.graphicParent.insertIntoKeepIdx(i,this.graphicIndex),this.emit(LB.AFTER_ADD_VRENDER_MARK,{graphicItem:i}),i}}])}(BP);function PP(t,e){if(GC(t))return t;var n=t.trim();if("auto"===n)return 0;if(n.endsWith("%")){var i=parseFloat(n.substring(0,n.length-1));return GC(i)?i*e:0}return 0}function OP(t,e){return Math.min(t<0?t+e:t-1,e)}function IP(t,e,n){var i=OP(t,n),r=OP(e,n);if(GC(t)||GC(e)?GC(t)?GC(e)||(i=OP(Math.max(0,r-1),n)):r=OP(i+1,n):(i=1,r=2),i>r){var a=r;r=i,i=a}return{start:i,end:r}}var LP=function(t,e,n,i){var r=function(t,e,n){var i,r,a,o,s=null!==(i=t.gridTemplateRows)&&void 0!==i?i:[n],u=null!==(r=t.gridTemplateColumns)&&void 0!==r?r:[e],l=null!==(a=t.gridRowGap)&&void 0!==a?a:0,c=null!==(o=t.gridColumnGap)&&void 0!==o?o:0,h=s.map((function(t){return PP(t,n)})),d=u.map((function(t){return PP(t,e)})),f=Math.max(0,h.reduce((function(t,e){return t-e}),n)-h.length*l)/s.filter((function(t){return"auto"===t})).length,v=Math.max(0,d.reduce((function(t,e){return t-e}),e)-d.length*c)/u.filter((function(t){return"auto"===t})).length,p=0,g=h.map((function(t,e){var n="auto"===s[e]?f:t,i=p;return p+=n+l,i}));g.push(p);var y=0,m=d.map((function(t,e){var n="auto"===u[e]?v:t,i=y;return y+=n+c,i}));return m.push(y),{rows:g,columns:m,rowGap:l,columnGap:c}}(t.getSpec().layout,n.width(),n.height());e&&e.forEach((function(t){var e=t.getSpec().layout;t.layoutBounds=function(t,e,n,i,r){var a=t.rows.length,o=t.columns.length,s=IP(e,n,a),u=s.start,l=s.end,c=IP(i,r,o),h=c.start,d=c.end,f=t.columns[u],v=t.columns[l]-(d===o?0:t.columnGap),p=t.rows[h],g=t.rows[d]-(l===a?0:t.rowGap);return(new ME).set(f,p,v,g)}(r,e.gridRowStart,e.gridRowEnd,e.gridColumnStart,e.gridColumnEnd),t.commit()}))},DP=l(l(l(l(l({},TB.axis,0),TB.legend,1),TB.slider,2),TB.player,3),TB.datazoom,4),jP=function(t){var e,n,i;return null!==(n=null===(e=t.getSpec().layout)||void 0===e?void 0:e.order)&&void 0!==n?n:"component"===t.markType&&null!==(i=DP[t.componentType])&&void 0!==i?i:1/0},FP=function(t,e,n,i){var r=n.clone(),a=t.getSpec().layout,o=OR(a.maxChildWidth,r.width()),s=OR(a.maxChildHeight,r.width()),u=0,l=0,c=0,h=0;e.forEach((function(t){var e=t.getSpec().layout,a=hP(e.padding),d=i.parseMarkBounds?i.parseMarkBounds(t.getBounds(),t):t.getBounds();if("top"===e.position||"bottom"===e.position){var f=Math.min(d.height()+a.top+a.bottom,s);"top"===e.position?r.y1+=f:r.y2-=f,d.x1<n.x1&&(u=Math.max(u,n.x1-d.x1)),d.x2>n.x2&&(l=Math.max(l,d.x2-n.x2))}if("left"===e.position||"right"===e.position){var v=Math.min(d.width()+a.left+a.right,o);"left"===e.position?r.x1+=v:r.x2-=v,d.y1<n.y1&&(c=Math.max(c,n.y1-d.y1)),d.y2>n.y2&&(h=Math.max(h,d.y2-n.y2))}"outside"===e.position&&(r.x1+=Math.max(n.x1-d.x1,0)+a.left,r.x2-=Math.max(d.x2-n.x2,0)+a.right,r.y1+=Math.max(n.y1-d.y1,0)+a.top,r.y2-=Math.max(d.y2-n.y2)+a.bottom)})),u>r.x1-n.x1&&u<n.width()&&(r.x1=n.x1+u),l>n.x2-r.x2&&l<n.width()&&(r.x2=n.x2-l),c>r.y1-n.y1&&c<n.height()&&(r.y1=n.y1+c),h>n.y2-r.y2&&h<n.height()&&(r.y2=n.y2-h);for(var d=r.y1,f=r.y2,v=r.x1,p=r.x2,g=e.slice().sort((function(t,e){return jP(t)-jP(e)})),y=0,m=g.length;y<m;y++){var k=g[y],b=k.getSpec().layout,_=hP(b.padding),x=i.parseMarkBounds?i.parseMarkBounds(k.getBounds(),k):k.getBounds();if("top"===b.position||"bottom"===b.position){var w=Math.min(x.height()+_.top+_.bottom,s);if("top"===b.position?(k.layoutBounds=(new ME).set(r.x1,d-w,r.x2,d),d-=w):(k.layoutBounds=(new ME).set(r.x1,f,r.x2,f+w),f+=w),k.relativePosition={top:k.layoutBounds.y1-r.y1,bottom:k.layoutBounds.y1-r.y2},b.align){var S=x.width()+_.left+_.right;S<r.width()&&("center"===b.align?(k.layoutBounds.x1=(r.x1+r.x2)/2-S/2,k.layoutBounds.x2=k.layoutBounds.x1+S,k.relativePosition.left=k.relativePosition.right=(r.width()-S)/2):"right"===b.align?(k.layoutBounds.x1=r.x2-S,k.layoutBounds.x2=r.x2,k.relativePosition.right=0,k.relativePosition.left=r.width()-S):"left"===b.align&&(k.layoutBounds.x1=r.x1,k.layoutBounds.x2=r.x1+S,k.relativePosition.left=0,k.relativePosition.right=r.width()-S))}}else if("left"===b.position||"right"===b.position){var A=Math.min(x.width()+_.left+_.right,o);if("left"===b.position?(k.layoutBounds=(new ME).set(v-A,r.y1,v,r.y2),v-=A):(k.layoutBounds=(new ME).set(p,r.y1,p+A,r.y2),p+=A),k.relativePosition={left:k.layoutBounds.x1-r.x1,right:k.layoutBounds.x1-r.x2},b.align){var T=x.height()+_.top+_.bottom;A<r.width()&&("middle"===b.align?(k.layoutBounds.y1=(r.y1+r.y2)/2-T/2,k.layoutBounds.y2=k.layoutBounds.y1+T,k.relativePosition.top=k.relativePosition.bottom=(r.height()-T)/2):"bottom"===b.align?(k.layoutBounds.y1=r.y2-T,k.layoutBounds.y2=r.y2,k.relativePosition.top=r.height()-T,k.relativePosition.bottom=0):"top"===b.align&&(k.layoutBounds.y1=r.y1,k.layoutBounds.y2=r.y1+T,k.relativePosition.bottom=r.height()-T,k.relativePosition.top=0))}}else"outside"===b.position?(v-=Math.max(n.x1-x.x1,0)+_.left,p-=Math.max(x.x2-n.x2,0)+_.right,d-=Math.max(n.y1-x.y1,0)+_.top,f+=Math.max(x.y2-n.y2)+_.bottom):k.layoutBounds=r}return r},NP=function t(e,n,i){null==e||e.forEach((function(e){var r;if(e.markType===AB.group){var a=e.layoutChildren,o=e.getSpec().layout,s=null!==(r=e.layoutBounds)&&void 0!==r?r:e.getBounds();if(s){if(RC(o))o.call(null,e,a,s,n);else if(RC(o.callback))o.callback.call(null,e,a,s,n);else if("relative"===o.display)if(o.updateViewSignals){var u=i.getViewBox();u&&s.intersect(u);var l=FP(e,a,s,n),c=l.width(),h=l.height(),d={top:l.y1,right:i.width()-l.x2,left:l.x1,bottom:i.height()-l.y2};i.updateSignal(XM,c),i.updateSignal(KM,h),i.updateSignal(qM,d)}else FP(e,a,s,n);else"grid"===o.display&&LP(e,a,s);t(a,n,i)}}}))},GP=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[t,AB.glyph,r])).glyphType=i,a.glyphMeta=vM.getGlyph(i),a}return c(n,t),u(n,[{key:"configureGlyph",value:function(t){return this.spec.glyphConfig=t,this.commit(),this}},{key:"getGlyphMeta",value:function(){return this.glyphMeta}},{key:"getGlyphConfig",value:function(){return this.spec.glyphConfig}},{key:"addGraphicItem",value:function(t,e){var i=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(vM.getGraphicType(AB.glyph)){var i=vM.createGraphic(AB.glyph,n),r=e.getMarks(),a=Object.keys(r).map((function(t){if(vM.getGraphicType(r[t])){var e=vM.createGraphic(r[t]);if(e)return e.name=t,e}}));return i.setSubGraphic(a),i}}(this,this.glyphMeta,t);return p(h(n.prototype),"addGraphicItem",this).call(this,t,e,i)}}])}(BP),zP=Symbol.for("key"),UP=function(){return u((function t(){o(this,t)}),[{key:"diffGrammar",value:function(t,e){return function(t,e,n){var i={enter:[],exit:[],update:[]},r=new yP(t,n);return r.setCallback((function(t,e,n){BC(e)?i.exit.push({prev:n[0]}):BC(n)?i.enter.push({next:e[0]}):i.update.push({next:e[0],prev:n[0]})})),r.setCurrentData(gP(e,n)),r.doDiff(),i}(t,e,(function(t){var e;return null!==(e=t.id())&&void 0!==e?e:Symbol()}))}},{key:"diffMark",value:function(t,e,n){var i={enter:[],exit:[],update:[]},r=[],a=[];t.forEach((function(t){t.markType!==AB.group&&(n.morph&&t.getMorphConfig().morph||n.morphAll||n.reuse)?r.push(t):i.exit.push({prev:[t]})})),e.forEach((function(t){t.markType!==AB.group&&(n.morph&&t.getMorphConfig().morph||n.morphAll||n.reuse)?a.push(t):i.enter.push({next:[t]})}));var o=this.diffUpdateByGroup(r,a,(function(t){return t.getMorphConfig().morphKey}),(function(t){return t.getMorphConfig().morphKey}));r=o.prev,a=o.next,i.update=i.update.concat(o.update);var s=this.diffUpdateByGroup(r,a,(function(t){return t.id()}),(function(t){return t.id()}));r=s.prev,a=s.next,i.update=i.update.concat(s.update);var u=gP(r,(function(t){var e,n;return null===(n=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===n?void 0:n.call(e)})),l=gP(a,(function(t){var e,n;return null===(n=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===n?void 0:n.call(e)}));return Object.keys(l).forEach((function(t){var e=u.data.get(t),n=l.data.get(t);if(e&&n){for(var o=0;o<Math.max(e.length,n.length);o+=1){var s=e[o],c=n[o];s&&c?i.update.push({prev:[s],next:[c]}):s?i.exit.push({prev:[s]}):c&&i.enter.push({next:[c]})}r=r.filter((function(t){return!e.includes(t)})),a=a.filter((function(t){return!n.includes(t)}))}})),r.forEach((function(t){return i.exit.push({prev:[t]})})),a.forEach((function(t){return i.enter.push({next:[t]})})),i}},{key:"_appendMorphKeyToElements",value:function(t){var e=t.getMorphConfig();if(!BC(e.morphElementKey)){var n=oM(e.morphElementKey);t.elements&&t.elements.forEach((function(t){t.morphKey=n(t.getDatum())}))}}},{key:"morph",value:function(t,e,n){var i=this,r=function(t,e,n){var i={enter:[],exit:[],update:[]},r=new yP(t,n);return r.setCallback((function(t,e,n){BC(e)?i.exit.push({prev:n}):BC(n)?i.enter.push({next:e}):i.update.push({next:e,prev:n})})),r.setCurrentData(gP(e,n)),r.doDiff(),i}(t.reduce((function(t,e){return i._appendMorphKeyToElements(e),t.concat(e.elements)}),[]),e.reduce((function(t,e){return i._appendMorphKeyToElements(e),t.concat(e.elements)}),[]),(function(t){var e;return null!==(e=t.morphKey)&&void 0!==e?e:t.key}));t.forEach((function(t){var e,n;return null===(n=null===(e=t.animate)||void 0===e?void 0:e.disable)||void 0===n?void 0:n.call(e)})),e.forEach((function(t){var e,n;return null===(n=null===(e=t.animate)||void 0===e?void 0:e.disable)||void 0===n?void 0:n.call(e)}));var a=t.concat(e).reduce((function(t,e){return Object.assign(t,e.parameters()),t}),{}),o=0,s=function(){0===(o-=1)&&e.forEach((function(t){var e,n;null===(n=null===(e=t.animate)||void 0===e?void 0:e.enable)||void 0===n||n.call(e)}))};r.enter.forEach((function(t){t.next.forEach((function(t){i.doMorph([],[t],n,s,a)})),o+=1})),r.update.forEach((function(t){for(var e=Math.min(t.prev.length,t.next.length),r=i.divideElements(t.prev,e),u=i.divideElements(t.next,e),l=0;l<e;l++)i.doMorph(r[l],u[l],n,s,a),o+=1}))}},{key:"diffUpdateByGroup",value:function(t,e,n,i){var r=gP(t,(function(t){var e;return null!==(e=n(t))&&void 0!==e?e:zP})),a=gP(e,(function(t){var e;return null!==(e=i(t))&&void 0!==e?e:zP})),o=t,s=e,u=[];return a.keys.forEach((function(t){if(t!==zP){var e=r.data.get(t),n=a.data.get(t);e&&n&&(u.push({prev:e,next:n}),o=o.filter((function(t){return!e.includes(t)})),s=s.filter((function(t){return!n.includes(t)})))}})),{prev:o,next:s,update:u}}},{key:"doMorph",value:function(t,e,n,i,r){var a,o,s={prev:t.map((function(t){return t.getDatum()})),next:e.map((function(t){return t.getDatum()}))},u={prev:t.slice(),next:e.slice()},l=n.animation.easing,c=iM(n.animation.delay,r,s,u),h=iM(n.animation.duration,r,s,u),d=iM(n.animation.oneByOne,r,s,u),f=iM(n.animation.splitPath,r,s,u),v=GC(d)&&d>0?function(t){return NC(d)?t*d:!0===d?t*h:0}:void 0;1!==t.length&&0!==t.length||1!==e.length?1===t.length&&e.length>1?Yo(t[0].getGraphicItem(),e.map((function(t){return t.getGraphicItem()})),{delay:c,duration:h,easing:l,onEnd:i,individualDelay:v,splitPath:f}):t.length>1&&1===e.length&&$o(t.map((function(t){return t.getGraphicItem()})),e[0].getGraphicItem(),{delay:c,duration:h,easing:l,onEnd:i,individualDelay:v,splitPath:f}):Ho(null===(o=null===(a=t[0])||void 0===a?void 0:a.getGraphicItem)||void 0===o?void 0:o.call(a),e[0].getGraphicItem(),{delay:c,duration:h,easing:l,onEnd:i})}},{key:"divideElements",value:function(t,e){var n=Math.floor(t.length/e);return new Array(e).fill(0).map((function(i,r){return t.slice(n*r,r===e-1?t.length:n*(r+1))}))}}])}(),WP=function(){return u((function t(e,n){o(this,t),this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=LC(e)?function(t){return t[e]}:e,this._warning=n}),[{key:"record",value:function(t){var e,n,i=t.grammarType,r=this._mapKey(t);return this._grammarMap[i]?(this._grammars[i].push(t),BC(r)||(this._grammarMap[i][r]?null===(e=this._warning)||void 0===e||e.call(this,r,t):this._grammarMap[i][r]=t)):(this._grammars.customized.push(t),BC(r)||(this._grammarMap.customized[r]?null===(n=this._warning)||void 0===n||n.call(this,r,t):this._grammarMap.customized[r]=t)),this._size+=1,this}},{key:"unrecord",value:function(t){var e=t.grammarType,n=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter((function(e){return e!==t})),BC(n)||this._grammarMap[e][n]!==t||delete this._grammarMap[e][n]):(this._grammars.customized=this._grammars.customized.filter((function(e){return e!==t})),BC(n)||this._grammarMap.customized[n]!==t||delete this._grammarMap.customized[n]),this._size-=1,this}},{key:"size",value:function(){return this._size}},{key:"getSignal",value:function(t){var e;return null!==(e=this._grammarMap.signal[t])&&void 0!==e?e:null}},{key:"getData",value:function(t){var e;return null!==(e=this._grammarMap.data[t])&&void 0!==e?e:null}},{key:"getScale",value:function(t){var e;return null!==(e=this._grammarMap.scale[t])&&void 0!==e?e:null}},{key:"getCoordinate",value:function(t){var e;return null!==(e=this._grammarMap.coordinate[t])&&void 0!==e?e:null}},{key:"getMark",value:function(t){var e;return null!==(e=this._grammarMap.mark[t])&&void 0!==e?e:null}},{key:"getCustomized",value:function(t){var e;return null!==(e=this._grammarMap.customized[t])&&void 0!==e?e:null}},{key:"getGrammar",value:function(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}},{key:"getAllSignals",value:function(){return this._grammars.signal}},{key:"getAllData",value:function(){return this._grammars.data}},{key:"getAllScales",value:function(){return this._grammars.scale}},{key:"getAllCoordinates",value:function(){return this._grammars.coordinate}},{key:"getAllMarks",value:function(){return this._grammars.mark}},{key:"getAllCustomized",value:function(){return this._grammars.customized}},{key:"traverse",value:function(t){var e;Object.values(null!==(e=this._grammars)&&void 0!==e?e:{}).forEach((function(e){return(null!=e?e:[]).forEach((function(e){t.call(null,e)}))}))}},{key:"find",value:function(t){var e=null;return this.traverse((function(n){return!0===t.call(null,n)&&(e=n,!0)})),e}},{key:"filter",value:function(t){var e=[];return this.traverse((function(n){!0===t.call(null,n)&&e.push(n)})),e}},{key:"clear",value:function(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}},{key:"release",value:function(){this._size=0,this._grammars=null,this._grammarMap=null}}])}(),VP=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments))._markNodes=[],t}return c(n,t),u(n,[{key:"record",value:function(t){if(p(h(n.prototype),"record",this).call(this,t),"mark"===t.grammarType){var e=t,i={mark:e,parent:null,children:[]};this._markNodes.forEach((function(t){var n=t.mark;n.markType===AB.group&&n.includesChild(e,!1)?(t.children.push(i),i.parent=t):e.markType===AB.group&&e.includesChild(n,!1)&&(i.children.push(t),t.parent=i)})),this._markNodes.push(i)}return this}},{key:"unrecord",value:function(t){if(p(h(n.prototype),"unrecord",this).call(this,t),"mark"===t.grammarType){var e=t,i=this._markNodes.find((function(t){return t.mark===e}));this._markNodes.forEach((function(t){var n=t.mark;n.markType===AB.group&&n.includesChild(e,!1)?(t.children=t.children.filter((function(t){return t!==i})),i.parent=null):e.markType===AB.group&&e.includesChild(n,!1)&&(i.children=i.children.filter((function(e){return e!==t})),t.parent=null)})),this._markNodes=this._markNodes.filter((function(t){return t!==i}))}return this}},{key:"getAllMarkNodes",value:function(){return this._markNodes}},{key:"clear",value:function(){p(h(n.prototype),"clear",this).call(this),this._markNodes=[]}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this),this._markNodes=null}}])}(WP),HP=function(){return u((function t(e){var n=this;o(this,t),this._animations=[],this._additionalAnimateMarks=[],this.isEnabled=!0,this._onAnimationStart=function(t){n._additionalAnimateMarks=n._additionalAnimateMarks.filter((function(t){var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),0===n._animations.length&&0===n._additionalAnimateMarks.length&&n._view.emit(LB.ALL_ANIMATION_START,{}),n._animations=n._animations.concat({config:t.animationConfig,mark:t.mark})},this._onAnimationEnd=function(t){n._additionalAnimateMarks=n._additionalAnimateMarks.filter((function(t){var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),n._animations=n._animations.filter((function(e){return e.config!==t.animationConfig||e.mark!==t.mark})),0===n._animations.length&&0===n._additionalAnimateMarks.length&&n._view.emit(LB.ALL_ANIMATION_END,{})},this._view=e,this._view.addEventListener(LB.ANIMATION_START,this._onAnimationStart),this._view.addEventListener(LB.ANIMATION_END,this._onAnimationEnd)}),[{key:"stop",value:function(){return this._view.traverseMarkTree((function(t){var e,n;t.animate&&(null===(n=(e=t.animate).stop)||void 0===n||n.call(e))})),this._additionalAnimateMarks.forEach((function(t){var e,n;t.view&&t.animate&&(null===(n=(e=t.animate).stop)||void 0===n||n.call(e))})),this._additionalAnimateMarks=[],this}},{key:"pause",value:function(){return this._view.traverseMarkTree((function(t){var e,n;t.animate&&(null===(n=(e=t.animate).pause)||void 0===n||n.call(e))})),this._additionalAnimateMarks.forEach((function(t){var e,n;t.view&&t.animate&&(null===(n=(e=t.animate).pause)||void 0===n||n.call(e))})),this}},{key:"resume",value:function(){return this._view.traverseMarkTree((function(t){var e,n;t.animate&&(null===(n=(e=t.animate).resume)||void 0===n||n.call(e))})),this._additionalAnimateMarks.forEach((function(t){var e,n;t.view&&t.animate&&(null===(n=(e=t.animate).resume)||void 0===n||n.call(e))})),this}},{key:"enable",value:function(){return this.isEnabled=!0,this._view.traverseMarkTree((function(t){var e,n;t.animate&&(null===(n=(e=t.animate).enable)||void 0===n||n.call(e))})),this}},{key:"disable",value:function(){return this.isEnabled=!1,this._view.traverseMarkTree((function(t){var e,n;t.animate&&(null===(n=(e=t.animate).disable)||void 0===n||n.call(e))})),this._additionalAnimateMarks.forEach((function(t){var e,n;t.view&&t.animate&&(null===(n=(e=t.animate).stop)||void 0===n||n.call(e))})),this._additionalAnimateMarks=[],this}},{key:"enableAnimationState",value:function(t){return this._view.traverseMarkTree((function(e){var n,i;e.animate&&(null===(i=(n=e.animate).enableAnimationState)||void 0===i||i.call(n,t))})),this}},{key:"disableAnimationState",value:function(t){return this._view.traverseMarkTree((function(e){var n,i;e.animate&&(null===(i=(n=e.animate).disableAnimationState)||void 0===i||i.call(n,t))})),this}},{key:"isAnimating",value:function(){return 0!==this._animations.length||this._additionalAnimateMarks.some((function(t){var e;return(null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating())||!1}))}},{key:"animate",value:function(){return this.isEnabled?(this._view.traverseMarkTree((function(t){t.isUpdated&&t.animate&&t.animate.animate(),t.cleanExitElements(),t.isUpdated=!1}),null,!0),this):this}},{key:"animateAddition",value:function(t){var e=t.animate.animate();return e&&e.isAnimating()&&this._additionalAnimateMarks.push(t),this}},{key:"release",value:function(){this._additionalAnimateMarks=[],this._animations=[],this._view.removeEventListener(LB.ALL_ANIMATION_START,this._onAnimationStart),this._view.removeEventListener(LB.ALL_ANIMATION_END,this._onAnimationEnd),this._view=null}}])}(),YP=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"addGraphicItem",value:function(t,e){var i=t&&t.limitAttrs,r=gM(this,i&&("rich"===i.textType||i.text&&"rich"===i.text.type)?AB.richtext:AB.text,t);return p(h(n.prototype),"addGraphicItem",this).call(this,t,e,r)}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this)}}])}(BP);YP.markType=AB.text;var XP={axis:{label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},circleAxis:{title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},grid:{style:{stroke:"#f1f2f5"}},circleGrid:{style:{stroke:"#f1f2f5"}},discreteLegend:{layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},colorLegend:{title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},sizeLegend:{title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},lineCrosshair:{start:{x:0,y:0},end:{x:0,y:0}},rectCrosshair:{start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},sectorCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},circleCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},polygonCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},slider:{layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},dataLabel:{size:{width:400,height:400},dataLabels:[]},pointLabel:{data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},lineLabel:{type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},areaLabel:{type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},rectLabel:{type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},symbolLabel:{type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},arcLabel:{type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},lineDataLabel:{type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},datazoom:{orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},continuousPlayer:{},discretePlayer:{},tooltip:{},title:{textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},scrollbar:{width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}}},KP={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},qP=Object.assign({},XP);qP.axis=Object.assign({},qP.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),qP.circleAxis=Object.assign({},qP.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),qP.grid=Object.assign({},qP.grid,{style:{stroke:"#404349"}}),qP.circleGrid=Object.assign({},qP.circleGrid,{style:{stroke:"#404349"}}),qP.rectLabel=Object.assign({},qP.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),qP.lineLabel=Object.assign({},qP.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),qP.symbolLabel=Object.assign({},qP.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),qP.title=Object.assign({},qP.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});var ZP={name:"dark",padding:5,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:KP,components:qP},JP={name:"default",padding:5,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:KP,components:XP},$P=function(){function t(){o(this,t)}return u(t,null,[{key:"registerTheme",value:function(e,n){e&&t._themes.set(e,n)}},{key:"unregisterTheme",value:function(e){t._themes.delete(e)}},{key:"getTheme",value:function(e){return t._themes.get(e)}},{key:"getDefaultTheme",value:function(){return t.getTheme("default")}}])}();$P._themes=new Map,$P.registerTheme("default",JP),$P.registerTheme("dark",ZP);var QP,tO,eO,nO,iO,rO,aO=function(t){function n(t,i,r,a){var s;return o(this,n),(s=e(this,n,[t,AB.component,r]))._componentDatum=l({},UB,0),s.componentType=i,s.spec.type="component",s.spec.componentType=i,s.mode=a,s._updateComponentEncoders(),s}return c(n,t),u(n,[{key:"configureComponent",value:function(t){return this.spec.componentConfig=t,this.commit(),this}},{key:"addGraphicItem",value:function(t,e,n){var i=null!=n?n:vM.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return i&&(this.emit(LB.BEFORE_ADD_VRENDER_MARK,{graphicItem:i}),this.graphicParent.appendChild(i),this.emit(LB.AFTER_ADD_VRENDER_MARK,{graphicItem:i})),i}},{key:"join",value:function(t){return p(h(n.prototype),"join",this).call(this,t,UB)}},{key:"encodeState",value:function(t,e,i){return p(h(n.prototype),"encodeState",this).call(this,t,e,i),this._updateComponentEncoders(),this}},{key:"parseRenderContext",value:function(){return{large:!1}}},{key:"_prepareRejoin",value:function(){this._componentDatum[UB]+=1}},{key:"evaluateJoin",value:function(t){return this.spec.key=UB,t?(t[UB]=this._componentDatum[UB],this._componentDatum=t):this._componentDatum=l({},UB,this._componentDatum[UB]),p(h(n.prototype),"evaluateJoin",this).call(this,[this._componentDatum])}},{key:"_updateComponentEncoders",value:function(){this._encoders=this.spec.encode}},{key:"_getEncoders",value:function(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}}])}(BP),oO=function(t){function n(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o(this,n),(t=e(this,n))._observer=null,t._onResize=wE((function(){var e=t._getContainerSize();e&&t.resize(e.width,e.height)}),100),t.delegateEvent=function(e,n){var i,r=null===(i=e.target)||void 0===i?void 0:i[NB],a=sP(f(t),e,r,0,WM);t.emit(n,a,r)},t.handleProgressiveFrame=function(){t._progressiveMarks.length&&t._progressiveMarks.forEach((function(t){t.isDoingProgressive()&&t.evaluateProgressive()})),t.doPreProgressive()},t._config=r,t._options=Object.assign({mode:"browser"},i),t.initialize(),t}return c(n,t),u(n,[{key:"getGrammarById",value:function(t){return this.grammars.getGrammar(t)}},{key:"getSignalById",value:function(t){return this.grammars.getSignal(t)}},{key:"getDataById",value:function(t){return this.grammars.getData(t)}},{key:"getScaleById",value:function(t){return this.grammars.getScale(t)}},{key:"getCoordinateById",value:function(t){return this.grammars.getCoordinate(t)}},{key:"getMarkById",value:function(t){return this.grammars.getMark(t)}},{key:"getCustomizedById",value:function(t){return this.grammars.getCustomized(t)}},{key:"getGrammarsByName",value:function(t){return this.grammars.filter((function(e){return e.name()===t}))}},{key:"getGrammarsByType",value:function(t){return this.grammars.filter((function(e){return e.grammarType===t}))}},{key:"getMarksByType",value:function(t){return this.grammars.getAllMarks().filter((function(e){return e.markType===t}))}},{key:"getMarksByName",value:function(t){return this.grammars.getAllMarks().filter((function(e){return e.name()===t}))}},{key:"getMarksBySelector",value:function(t){var e=this;if(!t)return null;var n=aE(t),i=[];return n.forEach((function(t){if(aM(t))i.push(t);else if("#"!==t[0]){var n="@"===t[0]?e.getMarksByName(t.slice(1)):pM(t)?e.getMarksByType(t):null;n&&n.length&&n.forEach((function(t){i.push(t)}))}else{var r=e.getMarkById(t.slice(1));r&&i.push(r)}})),i}},{key:"updateSignal",value:function(t,e){LC(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}},{key:"signal",value:function(t,e){var n=new uP(this);return arguments.length>=1&&n.value(t),arguments.length>=2&&n.update(e),this.grammars.record(n),this._dataflow.add(n),n}},{key:"data",value:function(t){var e=new zM(this,t);return this.grammars.record(e),this._dataflow.add(e),e}},{key:"scale",value:function(t){var e=vM.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}},{key:"coordinate",value:function(t){var e=vM.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}},{key:"mark",value:function(t,e,n){var i,r=LC(e)?this.getMarkById(e):e;switch(t){case AB.group:i=new MP(this,r);break;case AB.glyph:i=new GP(this,null==n?void 0:n.glyphType,r);break;case AB.component:i=vM.hasComponent(null==n?void 0:n.componentType)?vM.createComponent(null==n?void 0:n.componentType,this,r,null==n?void 0:n.mode):new aO(this,null==n?void 0:n.componentType,r,null==n?void 0:n.mode);break;case AB.text:i=new YP(this,t,r);break;default:i=vM.hasMark(t)?vM.createMark(t,this,r):new BP(this,t,r)}return this.grammars.record(i),this._dataflow.add(i),i}},{key:"group",value:function(t){return this.mark(AB.group,t)}},{key:"glyph",value:function(t,e){return this.mark(AB.glyph,e,{glyphType:t})}},{key:"component",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"2d";return this.mark(AB.component,e,{componentType:t,mode:n})}},{key:"axis",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2d";return this.mark(AB.component,t,{componentType:TB.axis,mode:e})}},{key:"grid",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"2d";return this.mark(AB.component,t,{componentType:TB.grid,mode:e})}},{key:"legend",value:function(t){return this.mark(AB.component,t,{componentType:TB.legend})}},{key:"slider",value:function(t){return this.mark(AB.component,t,{componentType:TB.slider})}},{key:"label",value:function(t){return this.mark(AB.component,t,{componentType:TB.label})}},{key:"datazoom",value:function(t){return this.mark(AB.component,t,{componentType:TB.datazoom})}},{key:"player",value:function(t){return this.mark(AB.component,t,{componentType:TB.player})}},{key:"title",value:function(t){return this.mark(AB.component,t,{componentType:TB.title})}},{key:"scrollbar",value:function(t){return this.mark(AB.component,t,{componentType:TB.scrollbar})}},{key:"customized",value:function(t,e){var n=vM.createGrammar(t,this,null==e?void 0:e.type);if(n)return n.parse(e),this.grammars.record(n),this._dataflow.add(n),n}},{key:"addGrammar",value:function(t){return this.grammars.find((function(e){return e.uid===t.uid}))||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}},{key:"removeGrammar",value:function(t){var e=LC(t)?this.getGrammarById(t):t;return e&&this.grammars.find((function(t){return t.uid===e.uid}))?("mark"===e.grammarType&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0,this):this}},{key:"removeAllGrammars",value:function(){var t=this;return this.grammars.traverse((function(e){"signal"===e.grammarType&&cP.includes(e.id())||"mark"===e.grammarType&&"root"===e.id()||t.removeGrammar(e)})),this}},{key:"removeAllGraphicItems",value:function(){return this.traverseMarkTree((function(t){t.graphicItem&&(yM(t.graphicItem),t.elementMap.forEach((function(t){t.resetGraphicItem()})),t.graphicItem=null)})),this}},{key:"parseSpec",value:function(t){var e,n,i,r,a,o,s=this;if(this.emit(LB.BEFORE_PARSE_VIEW),this._spec=t,dP(t),t.theme?this.theme(t.theme):this.theme($P.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding(null!==(n=null!==(e=t.padding)&&void 0!==e?e:this._options.padding)&&void 0!==n?n:this._theme.padding),!this.width()||!this.height()){var u=this._getContainerSize();u&&(this.updateSignal(HM,u.width),this.updateSignal(YM,u.height))}(null===(i=t.signals)||void 0===i?void 0:i.length)&&t.signals.forEach((function(t){s.signal().parse(t)})),(null===(r=t.data)||void 0===r?void 0:r.length)&&t.data.forEach((function(t){s.data(null).parse(t)})),(null===(a=t.coordinates)||void 0===a?void 0:a.length)&&t.coordinates.forEach((function(t){var e;null===(e=s.coordinate(t.type))||void 0===e||e.parse(t)})),(null===(o=t.scales)||void 0===o?void 0:o.length)&&t.scales.forEach((function(t){var e;null===(e=s.scale(t.type))||void 0===e||e.parse(t)}));var l=vM.getGrammars();return Object.keys(l).forEach((function(e){var n=l[e].specKey;t[n]&&t[n].length&&t[n].forEach((function(t){s.customized(e,t)}))})),t.marks&&t.marks.length&&t.marks.forEach((function(t){s.parseMarkSpec(t)})),t.events&&t.events.length&&t.events.forEach((function(t){s.event(t)})),t.interactions&&t.interactions.length&&t.interactions.forEach((function(t){s.interaction(t.type,t)})),!1===t.animation?this.animate.disable():this.animate.enable(),this.emit(LB.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=IB.before,this}},{key:"updateSpec",value:function(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}},{key:"parseBuiltIn",value:function(){var t=this;(function(t,e,n){var i,r,a,o,s;return[{id:HM,value:null!==(i=t[HM])&&void 0!==i?i:0},{id:YM,value:null!==(r=t[YM])&&void 0!==r?r:0},{id:qM,value:hP(null!==(o=null!==(a=t[qM])&&void 0!==a?a:e[qM])&&void 0!==o?o:null==n?void 0:n.padding)},{id:XM,update:{callback:function(t,e){var n=hP(e[qM]);return e[HM]-n.left-n.right},dependency:[HM,qM]}},{id:KM,update:{callback:function(t,e){var n=hP(e[qM]);return e[YM]-n.top-n.bottom},dependency:[YM,qM]}},{id:ZM,update:{callback:function(t,e){var n=hP(e[qM]);return(t||new ME).setValue(n.left,n.top,n.left+e[XM],n.top+e[KM])},dependency:[XM,KM,qM]}},{id:JM,value:null!==(s=t[JM])&&void 0!==s?s:e[JM]}]})(this._options,this._config,this.getCurrentTheme()).forEach((function(e){var n=t.signal().parse(e);e.value&&n.set(e.value)})),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}},{key:"parseMarkSpec",value:function(t){var e,n=this,i=t.type===AB.glyph?{glyphType:t.glyphType}:t.type===AB.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,i).parse(t),null===(e=t.marks)||void 0===e||e.forEach((function(t){n.parseMarkSpec(t)}))}},{key:"theme",value:function(t){var e,n,i,r,a,o;LC(t)?this._theme=null!==(e=$P.getTheme(t))&&void 0!==e?e:$P.getDefaultTheme():this._theme=t;var s=null!==(n=this._spec)&&void 0!==n?n:{},u=s.background,l=s.padding;return this._theme?(this.background(null!==(i=null!=u?u:this._options.background)&&void 0!==i?i:this._theme.background),this.padding(null!==(r=null!=l?l:this._options.padding)&&void 0!==r?r:this._theme.padding),null===(o=null===(a=this.renderer.stage())||void 0===a?void 0:a.setTheme)||void 0===o||o.call(a,Object.assign({},this._theme.marks))):(this.background(null!=u?u:this._options.background),this.padding(null!=l?l:this._options.padding)),this}},{key:"getCurrentTheme",value:function(){return this._theme}},{key:"setCurrentTheme",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.theme(t),this.grammars.getAllMarks().forEach((function(t){t.commit()})),e?(this.evaluate(),this.renderer.render(!0)):this._dataflow.evaluate(),this}},{key:"background",value:function(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}},{key:"width",value:function(t){var e=this.getSignalById(HM);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}},{key:"height",value:function(t){var e=this.getSignalById(YM);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}},{key:"viewWidth",value:function(t){var e=this.getSignalById(XM);if(arguments.length){var n=this.padding();return this.width(t+n.left+n.right),t}return e.output()}},{key:"viewHeight",value:function(t){var e=this.getSignalById(KM);if(arguments.length){var n=this.padding();return this.height(t+n.top+n.bottom),t}return e.output()}},{key:"padding",value:function(t){var e=this.getSignalById(qM);if(arguments.length){var n=hP(t);return this.updateSignal(e,n),n}return hP(e.output())}},{key:"autoFit",value:function(t){var e=this.getSignalById(JM);return arguments.length?(this.updateSignal(e,t),t):e.output()}},{key:"getViewBox",value:function(){var t=this.getSignalById(ZM);return null==t?void 0:t.output()}},{key:"updateLayoutTag",value:function(){return this._layoutState=IB.before,this}},{key:"getLayoutState",value:function(){return this._layoutState}},{key:"buildLayoutTree",value:function(){var t={},e=[];this.traverseMarkTree((function(n){t[n.id()]=!0,n.group&&t[n.group.id()]||e.push(n),n.markType===AB.group&&n.updateLayoutChildren()}),(function(t){return t.needLayout()})),this._layoutMarks=e}},{key:"doLayout",value:function(){var t,e=this._options.doLayout||NP;e&&(null===(t=this._layoutMarks)||void 0===t?void 0:t.length)&&(this.emit(LB.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(LB.AFTER_DO_LAYOUT))}},{key:"handleLayoutEnd",value:function(){this.emit(LB.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach((function(t){iP(t,"layoutChildren",(function(t){t.handleLayoutEnd()}),(function(e){return e!==t}))})),this.emit(LB.AFTER_MARK_LAYOUT_END)}},{key:"handleRenderEnd",value:function(){this.emit(LB.BEFORE_MARK_RENDER_END),iP(this.rootMark,"children",(function(t){t.handleRenderEnd()})),this.emit(LB.AFTER_MARK_RENDER_END)}},{key:"commit",value:function(t){return this._dataflow.commit(t),this}},{key:"run",value:function(t){return this.evaluate(t),this}},{key:"doRender",value:function(t){this.emit(LB.BEFORE_DO_RENDER),this.renderer&&(this._progressiveMarks||this.animate.animate(),this.renderer.render(t),this.handleRenderEnd()),this.emit(LB.AFTER_DO_RENDER)}},{key:"evaluate",value:function(t){var e,n,i=this,r=function(t){var e,n,i,r,a,o=null!=t?t:{},s=o.reuse,u=void 0===s||s,l=o.morph,c=void 0===l||l,h=o.morphAll,d=void 0!==h&&h,f=o.animation,v=void 0===f?{}:f,p=o.enableExitAnimation,g=void 0===p||p;return{reuse:u,morph:c,morphAll:d,animation:{easing:null!==(e=v.easing)&&void 0!==e?e:$B,delay:null!==(n=v.delay)&&void 0!==n?n:KB,duration:null!==(i=v.duration)&&void 0!==i?i:XB,oneByOne:null!==(r=v.oneByOne)&&void 0!==r?r:JB,splitPath:null!==(a=v.splitPath)&&void 0!==a?a:null},enableExitAnimation:g}}(t),a=this._cachedGrammars.size()>0;a&&(this.reuseCachedGrammars(r),this.detachCachedGrammar());var o=this._resizeRenderer(),s=this._dataflow.hasCommitted();return a||s||this._layoutState||o?(this.clearProgressive(),this._dataflow.evaluate(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=IB.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=IB.reevaluate,this._dataflow.evaluate()),this._layoutState=IB.after,(null===(e=this._layoutMarks)||void 0===e?void 0:e.length)&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),null===(n=this._willMorphMarks)||void 0===n||n.forEach((function(t){i._morph.morph(t.prev,t.next,r)})),this._willMorphMarks=null,this.releaseCachedGrammars(r),this.doRender(!0),this.doPreProgressive(),this):this}},{key:"reuseCachedGrammars",value:function(t){var e=this;if(this._willMorphMarks||(this._willMorphMarks=[]),t.reuse){var n=function(t){t.next.reuse(t.prev),t.prev.detachAll(),t.prev.clear(),e._cachedGrammars.unrecord(t.prev)};this._morph.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter((function(t){return!cP.includes(t.id())}))).update.forEach(n),this._morph.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(n),this._morph.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(n),this._morph.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(n)}this._morph.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter((function(t){return"root"!==t.id()})),t).update.forEach((function(n){var i=1===n.prev.length&&1===n.next.length&&n.prev[0].markType===n.next[0].markType,r=n.prev.every((function(t){return t.getMorphConfig().morph}))&&n.next.every((function(t){return t.getMorphConfig().morph}));i&&t.reuse?(n.next[0].reuse(n.prev[0]),n.prev[0].detachAll(),n.prev[0].clear(),e._cachedGrammars.unrecord(n.prev[0])):(t.morph&&r||t.morphAll)&&e._willMorphMarks.push({prev:n.prev,next:n.next})}))}},{key:"detachCachedGrammar",value:function(){this._cachedGrammars.traverse((function(t){var e,n;if(t.detachAll(),"mark"===t.grammarType){var i=t;null===(n=null===(e=i.group)||void 0===e?void 0:e.removeChild)||void 0===n||n.call(e,i)}}))}},{key:"releaseCachedGrammars",value:function(t){var e=this;this._cachedGrammars.traverse((function(t){"mark"!==t.grammarType&&t.release()}));var n=this._cachedGrammars.getAllMarkNodes();n.forEach((function(n){n.mark.animate.stop(),t.enableExitAnimation&&e.animate.animateAddition(n.mark)}));var i=function t(e){if(e.mark.view&&0===e.mark.animate.getAnimatorCount()&&(!e.children||0===e.children.length)){e.mark.release();var n=e.parent;n&&(e.parent.children=e.parent.children.filter((function(t){return t!==e})),e.parent=null,t(n))}};n.forEach((function(t){var e=t.mark;0===e.animate.getAnimatorCount()?i(t):e.addEventListener("animationEnd",(function(){0===e.animate.getAnimatorCount()&&i(t)}))})),this._cachedGrammars.clear()}},{key:"runAfter",value:function(t){var e=this;return this._dataflow.runAfter((function(){t.call(null,e)})),this}},{key:"runBefore",value:function(t){var e=this;return this._dataflow.runBefore((function(){t.call(null,e)})),this}},{key:"getImageBuffer",value:function(){var t,e;if("node"===this._options.mode){var n=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t);return n?(n.render(),n.window.getImageBuffer()):(this.logger.error(new ReferenceError("render is not defined")),null)}this.logger.error(new TypeError("getImageBuffer() now only support node environment."))}},{key:"traverseMarkTree",value:function(t,e,n){return iP(this.rootMark,"children",t,e,n),this}},{key:"_bindResizeEvent",value:function(){var t,e,n,i,r,a;if(this.autoFit()){var o=null===(r=null===(i=null===(n=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===n?void 0:n.window)||void 0===i?void 0:i.getContainer)||void 0===r?void 0:r.call(i);if(o){var s=window.ResizeObserver;this._observer=new s(this._onResize),null===(a=this._observer)||void 0===a||a.observe(o)}window.addEventListener("resize",this._onResize)}}},{key:"_unBindResizeEvent",value:function(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}},{key:"_getContainerSize",value:function(){var t,e,n,i,r,a,o,s,u,l,c,h=null===(r=null===(i=null===(n=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===n?void 0:n.window)||void 0===i?void 0:i.getContainer)||void 0===r?void 0:r.call(i);if(h){var d=VE(h),f=d.width,v=d.height;return{width:null!==(s=null!==(o=null===(a=this._spec)||void 0===a?void 0:a.width)&&void 0!==o?o:this._options.width)&&void 0!==s?s:f,height:null!==(c=null!==(l=null===(u=this._spec)||void 0===u?void 0:u.height)&&void 0!==l?l:this._options.height)&&void 0!==c?c:v}}return null}},{key:"resize",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!1;return t!==this.width()&&(i=!0,this.updateSignal(HM,t)),e!==this.height()&&(i=!0,this.updateSignal(YM,e)),i&&(n?this.evaluate():this._dataflow.evaluate()),this}},{key:"_resizeRenderer",value:function(){var t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}},{key:"bindEvents",value:function(t){var e=this;if(!this._eventConfig.disable){var n=t.type,i=t.filter,r=t.callback,a=t.throttle,o=t.debounce,s=t.consume,u=t.target,l=t.dependency,c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:WM,n={},i=t.split(":");if(2===i.length){var r=g(i,2),a=r[0],o=r[1];"#"===a[0]?(n.markId=a.slice(1),n.source=e):"@"===a[0]?(n.markName=a.slice(1),n.source=e):pM(a)?(n.markType=a,n.source=e):n.source=a===UM?UM:e,n.type=o}else 1===i.length&&(n.type=t,n.source=e);return n}(n);if(c){var h,d=c.source,f=c.type,v=BC((h=c).markId)?function(t){return t&&t.mark.id()===h.markId}:BC(h.markName)?function(t){return t&&t.mark.name()===h.markName}:BC(h.type)?function(t){return t&&t.mark.markType===h.type}:function(){return!0},p=(Array.isArray(u)&&u.length?u.map((function(t){return{signal:e.getSignalById(t.target),callback:t.callback}})):[{signal:LC(u)?this.getSignalById(u):null,callback:r}]).filter((function(t){return t.signal||t.callback})),y=tM(l,this),m=fP((function(t,n){var r=d===WM&&function(t,e){var n=t.defaults,i=n.prevent,r=n.allow;return!1!==i&&!0!==r&&(!0===i||!1===r||(i?i[e]:!!r&&!r[e]))}(e._eventConfig,f)||s&&(void 0===t.cancelable||t.cancelable);d===UM&&(t=sP(0,t,n,0,UM));var a=!1;if((!i||i(t))&&(!v||v(n))&&p.length){var o=y.reduce((function(t,e){return t[e.id()]=e.output(),t}),{});p.forEach((function(n){n.callback&&n.signal?n.signal.set(n.callback(t,o))&&(e.commit(n.signal),a=!0):n.callback?n.callback(t,o):(e.commit(n.signal),a=!0)}))}r&&t.preventDefault(),s&&t.stopPropagation(),a&&e.run()}),{throttle:a,debounce:o});if(d===WM){if(function(t,e,n){var i=null==t?void 0:t[e];return!(!1===i||PC(i)&&!i[n])}(this._eventConfig,WM,f))return this.addEventListener(f,m,VM),function(){e.removeEventListener(f,m)}}else if(d===UM)return tp.addEventListener(f,m),this._eventListeners.push({type:f,source:tp,handler:m}),function(){tp.removeEventListener(f,m);var t=e._eventListeners.findIndex((function(t){return t.type===f&&t.source===tp&&t.handler===m}));t>=0&&e._eventListeners.splice(t,1)}}}}},{key:"event",value:function(t){var e=this;if("between"in t){var n,i=g(t.between,2),r=i[0],a=i[1],o="".concat(r.type,"-").concat(t.type,"-").concat(a.type);this.bindEvents(Object.assign({},r,{callback:function(){if(e._eventCache||(e._eventCache={}),!e._eventCache[o]){var i=e.bindEvents(t);e._eventCache[o]=i}n||(n=e.bindEvents(Object.assign({},a,{callback:function(){e._eventCache[o]&&(e._eventCache[o](),e._eventCache[o]=null)}})))}}))}else"merge"in t?t.merge.forEach((function(n){var i=Object.assign({},t);LC(n)?i.type=n:PC(n)&&Object.assign(i,n),i.debounce=50,e.bindEvents(i)})):this.bindEvents(t)}},{key:"interaction",value:function(t,e){var n=vM.createInteraction(t,this,e);return n&&(n.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(n)),n}},{key:"removeInteraction",value:function(t,e){if(this._boundInteractions){var n=this._boundInteractions.filter((function(n){var i;return BC(e)?LC(t)?n.type===t:t?n===t:void 0:(null===(i=n.options)||void 0===i?void 0:i.id)===e}));n.length&&n.forEach((function(t){t.unbind()}))}return this}},{key:"removeAllInteractions",value:function(){return this._boundInteractions&&(this._boundInteractions.forEach((function(t){t.unbind()})),this._boundInteractions=null),this}},{key:"initEvent",value:function(){var t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}},{key:"releaseStageEvent",value:function(){var t=this.renderer.stage();t&&t.off("*",this.delegateEvent)}},{key:"addEventListener",value:function(t,e,n){var i=e;return n&&!1===n.trap||((i=e).raw=e),n&&n.target&&(i.target=n.target),this.on(t,i),this}},{key:"removeEventListener",value:function(t,e){return e?this.off(t,e):this.off(t),this}},{key:"initializeRenderer",value:function(){var t=this._options.width,e=this._options.height;this.renderer=new rP(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}},{key:"initialize",value:function(){var t,e,n=this;this.grammars=new WP((function(t){return t.id()}),(function(t,e){return n.logger.warn("Grammar id '".concat(t,"' has been occupied"),e)})),this._cachedGrammars=new VP((function(t){return t.id()})),this._options.logger&&dE.setInstance(this._options.logger),this.logger=dE.getInstance(null!==(t=this._options.logLevel)&&void 0!==t?t:0),this._dataflow=new nP,this.animate=new HP(this),this._morph=new UP,this._options.hooks&&(Object.keys(this._options.hooks).forEach((function(t){n.on(t,n._options.hooks[t])})),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=function(t){var e=Object.assign({defaults:{}},t),n=function(t,e){e.forEach((function(e){DC(t[e])&&(t[e]=t[e].reduce((function(t,e){return t[e]=!0,t}),{}))}))};return n(e.defaults,["prevent","allow"]),n(e,[WM,UM]),e}(this._options.eventConfig),this._theme=this._options.disableTheme?null:$P.getDefaultTheme(),this.parseBuiltIn(),(e=this._options).mode&&tp.setEnv(e.mode,e.modeParams||{}),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._needBuildLayoutTree=!0,this._layoutState=IB.before,this.theme(this._theme)}},{key:"pauseProgressive",value:function(){return!1}},{key:"resumeProgressive",value:function(){return!1}},{key:"restartProgressive",value:function(){return!1}},{key:"findProgressiveMarks",value:function(){var t=[];return this.traverseMarkTree((function(e){t.push(e)}),(function(t){return t.markType!==AB.group&&t.isProgressive()})),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}},{key:"doPreProgressive",value:function(){if(this._progressiveMarks&&this._progressiveMarks.some((function(t){return t.isDoingProgressive()}))){var t=tp.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}}},{key:"clearProgressive",value:function(){this._progressiveRafId&&tp.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach((function(t){t.clearProgressive()})),this._progressiveMarks=null)}},{key:"release",value:function(){var t,e,n;this.removeAllInteractions(),this.releaseStageEvent(),this._unBindResizeEvent(),this.clearProgressive(),vM.unregisterRuntimeTransforms(),dE.setInstance(null),this.animate.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,null===(e=null===(t=this.renderer)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),null===(n=this._eventListeners)||void 0===n||n.forEach((function(t){t.source.removeEventListener(t.type,t.handler)})),this._eventListeners=null}}],[{key:"useRegisters",value:function(t){t.forEach((function(t){t()}))}}])}(dt),sO=function(t,e,n){return e.filter((function(e){return t.callback(e,n)}))},uO=function(t,e,n){var i=t.callback,r=t.as;if(!t.all)return e.forEach((function(t){var e=i(t,n);if(!BC(r)){if(BC(t))return;t[r]=e}return e})),e;var a=i(e,n);return BC(r)||BC(e)?a:(e[r]=a,e)},lO=function(t,e,n){var i,r,a,o,s=null!==(i=t.getFinalGraphicAttributes())&&void 0!==i?i:{};return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(r=s.opacity)&&void 0!==r?r:1,fillOpacity:null!==(a=s.fillOpacity)&&void 0!==a?a:1,strokeOpacity:null!==(o=s.strokeOpacity)&&void 0!==o?o:1}}},cO=function(t,e,n){var i,r,a;return{from:{opacity:null!==(i=t.getGraphicAttribute("opacity",!0))&&void 0!==i?i:1,fillOpacity:null!==(r=t.getGraphicAttribute("fillOpacity",!0))&&void 0!==r?r:1,strokeOpacity:null!==(a=t.getGraphicAttribute("strokeOpacity",!0))&&void 0!==a?a:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},hO=function(t,e,n){var i,r,a=null!=e?e:{},o=a.offset,s=void 0===o?0:o,u=a.orient,l=a.direction,c=a.point,h=0,d=0;"negative"===u&&(n.group?(h=null!==(i=n.groupWidth)&&void 0!==i?i:n.group.getBounds().width(),d=null!==(r=n.groupHeight)&&void 0!==r?r:n.group.getBounds().height(),n.groupWidth=h,n.groupHeight=d):(h=n.width,d=n.height)),h+=s,d+=s;var f=RC(c)?c.call(null,t.getDatum(),t,n):c,v=f&&GC(f.x)?f.x:h,p=f&&GC(f.y)?f.y:d,g=t.getFinalGraphicAttributes();switch(l){case"x":return{from:{x:v},to:{x:null==g?void 0:g.x}};case"y":return{from:{y:p},to:{y:null==g?void 0:g.y}};default:return{from:{x:v,y:p},to:{x:null==g?void 0:g.x,y:null==g?void 0:g.y}}}},dO=function(t,e,n){var i,r,a=null!=e?e:{},o=a.offset,s=void 0===o?0:o,u=a.orient,l=a.direction,c=a.point,h=n.group?n.group.getBounds():null,d=null!==(i=null==h?void 0:h.width())&&void 0!==i?i:n.width,f=null!==(r=null==h?void 0:h.height())&&void 0!==r?r:n.height,v=("negative"===u?d:0)+s,p=("negative"===u?f:0)+s,g=RC(c)?c.call(null,t.getDatum(),t,n):c,y=g&&GC(g.x)?g.x:v,m=g&&GC(g.y)?g.y:p;switch(l){case"x":return{from:{x:t.getGraphicAttribute("x",!0)},to:{x:y}};case"y":return{from:{y:t.getGraphicAttribute("y",!0)},to:{y:m}};default:return{from:{x:t.getGraphicAttribute("x",!0),y:t.getGraphicAttribute("y",!0)},to:{x:y,y:m}}}},fO=function(t,e,n){var i,r,a,o,s=t.getFinalGraphicAttributes();switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:0},to:{scaleX:null!==(i=null==s?void 0:s.scaleX)&&void 0!==i?i:1}};case"y":return{from:{scaleY:0},to:{scaleY:null!==(r=null==s?void 0:s.scaleY)&&void 0!==r?r:1}};default:return{from:{scaleX:0,scaleY:0},to:{scaleX:null!==(a=null==s?void 0:s.scaleX)&&void 0!==a?a:1,scaleY:null!==(o=null==s?void 0:s.scaleY)&&void 0!==o?o:1}}}},vO=function(t,e,n){var i,r,a,o;switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:null!==(i=t.getGraphicAttribute("scaleX",!0))&&void 0!==i?i:1},to:{scaleX:0}};case"y":return{from:{scaleY:null!==(r=t.getGraphicAttribute("scaleY",!0))&&void 0!==r?r:1},to:{scaleY:0}};default:return{from:{scaleX:null!==(a=t.getGraphicAttribute("scaleX",!0))&&void 0!==a?a:1,scaleY:null!==(o=t.getGraphicAttribute("scaleY",!0))&&void 0!==o?o:1},to:{scaleX:0,scaleY:0}}}},pO={symbol:["_mo_hide_","visible"]},gO=function(t,e,n){var i,r=Object.assign({},t.getPrevGraphicAttributes()),a=Object.assign({},t.getNextGraphicAttributes());e&&aE(e.excludeChannels).forEach((function(t){delete r[t],delete a[t]})),t.mark&&t.mark.markType&&(i=pO[t.mark.markType])&&i.forEach((function(t){delete r[t],delete a[t]})),Object.keys(a).forEach((function(t){PR(t,r,a)&&(delete r[t],delete a[t])}));var o=t.getFinalGraphicAttributes();return Object.keys(r).forEach((function(t){BC(a[t])&&(BC(o[t])||nE(r[t],o[t])?delete r[t]:a[t]=o[t])})),{from:r,to:a}},yO=function(t,e,n){var i,r,a=null!==(r=null===(i=t.getFinalGraphicAttributes())||void 0===i?void 0:i.angle)&&void 0!==r?r:0;return{from:{angle:gE(a/(2*Math.PI),0)?Math.round(a/(2*Math.PI))*Math.PI*2:GC(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(a/(2*Math.PI))*Math.PI*2:Math.floor(a/(2*Math.PI))*Math.PI*2},to:{angle:a}}},mO=function(t,e,n){var i,r=null!==(i=t.getGraphicAttribute("angle",!0))&&void 0!==i?i:0;return{from:{angle:r},to:{angle:gE(r/(2*Math.PI),0)?Math.round(r/(2*Math.PI))*Math.PI*2:GC(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(r/(2*Math.PI))*Math.PI*2:Math.floor(r/(2*Math.PI))*Math.PI*2}}},kO=function(){vM.registerAnimationType("fadeIn",lO)},bO=function(){vM.registerAnimationType("fadeOut",cO)},_O=function(){vM.registerAnimationType("moveIn",hO)},xO=function(){vM.registerAnimationType("moveOut",dO)},wO=function(){vM.registerAnimationType("scaleIn",fO)},SO=function(){vM.registerAnimationType("scaleOut",vO)},AO=function(){vM.registerAnimationType("rotateIn",yO)},TO=function(){vM.registerAnimationType("rotateOut",mO)},CO=function(){vM.registerAnimationType("update",gO)},EO=["pointerdown","pointerup","pointerupoutside","pointertap","pointerover","pointermove","pointerenter","pointerleave","pointerout","mousedown","mouseup","mouseupoutside","rightdown","rightup","rightupoutside","click","dblclick","mousemove","mouseover","mouseout","mouseenter","mouseleave","wheel","touchstart","touchend","touchendoutside","touchmove","touchcancel","tap","dragstart","drag","dragenter","dragleave","dragover","dragend","drop","pan","panstart","panend","press","pressup","pressend","pinch","pinchstart","pinchend","swipe"];!function(t){t.initialized="initialized",t.rendered="rendered",t.renderFinished="renderFinished",t.animationFinished="animationFinished",t.regionSeriesDataFilterOver="regionSeriesDataFilterOver",t.afterInitData="afterInitData",t.afterInitEvent="afterInitEvent",t.afterInitMark="afterInitMark",t.rawDataUpdate="rawDataUpdate",t.viewDataFilterOver="viewDataFilterOver",t.viewDataUpdate="viewDataUpdate",t.viewDataStatisticsUpdate="viewDataStatisticsUpdate",t.markDeltaYUpdate="markDeltaYUpdate",t.viewDataLabelUpdate="viewDataLabelUpdate",t.scaleDomainUpdate="scaleDomainUpdate",t.scaleUpdate="scaleUpdate",t.dataZoomChange="dataZoomChange",t.drill="drill",t.layoutStart="layoutStart",t.layoutEnd="layoutEnd",t.layoutRectUpdate="layoutRectUpdate",t.playerPlay="playerPlay",t.playerPause="playerPause",t.playerEnd="playerEnd",t.playerChange="playerChange",t.playerForward="playerForward",t.playerBackward="playerBackward",t.scrollBarChange="scrollBarChange",t.brushStart="brushStart",t.brushChange="brushChange",t.brushEnd="brushEnd",t.brushClear="brushClear",t.legendSelectedDataChange="legendSelectedDataChange",t.legendFilter="legendFilter",t.legendItemClick="legendItemClick",t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.tooltipShow="tooltipShow",t.tooltipHide="tooltipHide",t.tooltipRelease="tooltipRelease",t.afterResize="afterResize",t.afterRender="afterRender",t.afterLayout="afterLayout"}(QP||(QP={})),function(t){t.chart="chart",t.window="window",t.canvas="canvas"}(tO||(tO={})),function(t){t.vchart="vchart",t.chart="chart",t.model="model",t.mark="mark"}(eO||(eO={})),function(t){t[t.Default=0]="Default",t[t.Theme=1]="Theme",t[t.Chart=2]="Chart",t[t.Base_Series=3]="Base_Series",t[t.Series=4]="Series",t[t.Mark=5]="Mark",t[t.User_Chart=6]="User_Chart",t[t.User_Series=7]="User_Series",t[t.User_Mark=8]="User_Mark",t[t.Built_In=99]="Built_In"}(nO||(nO={})),function(t){t[t.Axis_Grid=50]="Axis_Grid",t[t.CrossHair_Grid=100]="CrossHair_Grid",t[t.Region=450]="Region",t[t.Mark=300]="Mark",t[t.Node=400]="Node",t[t.Axis=100]="Axis",t[t.MarkLine=500]="MarkLine",t[t.MarkArea=100]="MarkArea",t[t.MarkPoint=500]="MarkPoint",t[t.DataZoom=500]="DataZoom",t[t.ScrollBar=500]="ScrollBar",t[t.Player=500]="Player",t[t.Legend=500]="Legend",t[t.CrossHair=500]="CrossHair",t[t.Indicator=500]="Indicator",t[t.Title=500]="Title",t[t.Label=500]="Label",t[t.Brush=500]="Brush",t[t.CustomMark=500]="CustomMark",t[t.Interaction=700]="Interaction"}(iO||(iO={})),function(t){t[t.Indicator=10]="Indicator",t[t.Region=20]="Region",t[t.Axis=30]="Axis",t[t.DataZoom=40]="DataZoom",t[t.Player=40]="Player",t[t.ScrollBar=40]="ScrollBar",t[t.Legend=50]="Legend",t[t.Title=70]="Title",t[t.CustomMark=70]="CustomMark"}(rO||(rO={}));var RO,BO,MO=["linear","radial","conical"],PO={linear:{x0:0,y0:0,x1:1,y1:1},radial:{x0:0,y0:0,x1:1,y1:1,r0:0,r1:1},conical:{x:.5,y:.5,startAngle:0,endAngle:2*Math.PI}},OO={label:{name:"label",type:"text"}},IO=Object.assign(Object.assign({},OO),{bar:{name:"bar",type:"rect"},barBackground:{name:"barBackground",type:"rect"}}),LO=Object.assign(Object.assign({},OO),{bar3d:{name:"bar3d",type:"rect3d"}}),DO={point:{name:"point",type:"symbol"},line:{name:"line",type:"line"}},jO=Object.assign(Object.assign({},OO),DO),FO=Object.assign(Object.assign({},OO),{point:{name:"point",type:"symbol"}}),NO=Object.assign(Object.assign(Object.assign({},OO),DO),{area:{name:"area",type:"area"}}),GO=Object.assign(Object.assign(Object.assign({},OO),DO),{area:{name:"area",type:"area"}}),zO=Object.assign(Object.assign({},OO),{pie:{name:"pie",type:"arc"},labelLine:{name:"labelLine",type:"path"}}),UO=Object.assign(Object.assign({},OO),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}}),WO=Object.assign(Object.assign({},OO),{rose:{name:"rose",type:"arc"}}),VO=Object.assign(Object.assign({},OO),{area:{name:"area",type:"path"}}),HO=Object.assign(Object.assign({},OO),{group:{name:"group",type:"group"}}),YO=Object.assign(Object.assign({},HO),{track:{name:"track",type:"arc"},progress:{name:"progress",type:"arc"}}),XO=Object.assign(Object.assign({},OO),{group:{name:"group",type:"group"},link:{name:"link",type:"rule"},arrow:{name:"arrow",type:"symbol"}}),KO=Object.assign(Object.assign({},OO),{group:{name:"group",type:"group"},grid:{name:"grid",type:"rule"},gridBackground:{name:"gridBackground",type:"rect"},dot:{name:"dot",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},symbol:{name:"symbol",type:"symbol"}}),qO=Object.assign(Object.assign({},OO),{word:{name:"word",type:"text"},fillingWord:{name:"fillingWord",type:"text"}}),ZO=Object.assign(Object.assign({},OO),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),JO=Object.assign(Object.assign({},OO),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),$O=Object.assign(Object.assign({},OO),{track:{name:"track",type:"rect"},progress:{name:"progress",type:"rect"},group:{name:"group",type:"group"}}),QO=Object.assign(Object.assign({},IO),{leaderLine:{name:"leaderLine",type:"rule"},stackLabel:{name:"stackLabel",type:"text"}}),tI=Object.assign(Object.assign({},OO),{boxPlot:{name:"boxPlot",type:"boxPlot"},outlier:{name:"outlier",type:"symbol"}}),eI=Object.assign(Object.assign({},OO),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),nI=Object.assign(Object.assign({},OO),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}}),iI=Object.assign(Object.assign({},HO),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),rI=Object.assign(Object.assign({},OO),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),aI=Object.assign(Object.assign({},OO),{sunburst:{name:"sunburst",type:"arc"}}),oI=Object.assign(Object.assign({},IO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),sI=Object.assign(Object.assign({},LO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),uI=Object.assign(Object.assign({},OO),{circlePacking:{name:"circlePacking",type:"arc"}}),lI=Object.assign(Object.assign({},OO),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}}),cI=Object.assign(Object.assign({},OO),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),hI=Object.assign({},NO),dI=Object.assign(Object.assign({},OO),{liquid:{name:"liquid",type:"liquid"},liquidBackground:{name:"liquidBackground",type:"group"},liquidOutline:{name:"liquidOutline",type:"symbol"}}),fI=Object.assign(Object.assign({},OO),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}});!function(t){t.area_horizontal="area_horizontal",t.area_vertical="area_vertical",t.area_stack="area_stack",t.line_horizontal="line_horizontal",t.line_vertical="line_vertical",t.line_stack="line_stack",t.bar_horizontal="bar_horizontal",t.bar_vertical="bar_vertical",t.bar_stack="bar_stack",t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn_horizontal="rangeColumn_horizontal",t.rangeColumn_vertical="rangeColumn_vertical",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical",t.rangeArea_horizontal="rangeArea_horizontal",t.rangeArea_vertical="rangeArea_vertical",t.linearProgress_horizontal="linearProgress_horizontal",t.linearProgress_vertical="linearProgress_vertical",t.linearProgress_stack="linearProgress_stack",t.boxPlot_horizontal="boxPlot_horizontal",t.boxPlot_vertical="boxPlot_vertical",t.sankey_horizontal="sankey_horizontal",t.sankey_vertical="sankey_vertical",t.waterfall_horizontal="waterfall_horizontal",t.waterfall_vertical="waterfall_vertical",t.circularProgress_stack="circularProgress_stack",t.radar_stack="radar_stack",t.rose_stack="rose_stack"}(BO||(BO={}));var vI=(l(l(l(l(l(l(l(l(l(l(RO={},bB.bar,IO),bB.bar3d,LO),bB.line,jO),bB.scatter,FO),bB.area,NO),bB.radar,GO),bB.pie,zO),bB.pie3d,UO),bB.rose,WO),bB.geo,OO),l(l(l(l(l(l(l(l(l(l(RO,bB.map,VO),bB.circularProgress,YO),bB.link,XO),bB.dot,KO),bB.wordCloud,qO),bB.wordCloud3d,qO),bB.funnel,ZO),bB.funnel3d,JO),bB.linearProgress,$O),bB.waterfall,QO),l(l(l(l(l(l(l(l(l(l(RO,bB.boxPlot,tI),bB.treemap,eI),bB.sankey,nI),bB.gauge,iI),bB.gaugePointer,rI),bB.sunburst,aI),bB.rangeColumn,oI),bB.rangeColumn3d,sI),bB.circlePacking,uI),bB.heatmap,lI),l(l(l(l(RO,bB.correlation,cI),bB.rangeArea,hI),bB.liquid,dI),bB.venn,fI));var pI={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},gI={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function yI(t,e){var n;if(!t)return[];var i=xI(t,e);if(!i||DC(i))return null!==(n=i)&&void 0!==n?n:[];if(PC(i)){var r=i.dataScheme;return r?_I(r)?r.map((function(n){return Object.assign(Object.assign({},n),{scheme:n.scheme.map((function(n){return bI(n)?kI(t,n,e):n})).filter(MC)})})):r.map((function(n){return bI(n)?kI(t,n,e):n})).filter(MC):[]}return[]}function mI(t,e){var n,i;return _I(t)?null!==(i=null===(n=t.find((function(t){return MC(t.isAvailable)?RC(t.isAvailable)?t.isAvailable(e):!!t.isAvailable:!MC(t.maxDomainLength)||(null==e?void 0:e.length)<=t.maxDomainLength})))||void 0===n?void 0:n.scheme)&&void 0!==i?i:t[t.length-1].scheme:t}function kI(t,e,n){var i,r=xI(t,n);if(r){var a,o=r.palette;if(PC(o)&&(a=null!==(i=function(t,e){var n=pI[e];if(n&&t[n])return t[n];if(t[e])return t[e];var i=gI[e];return i?t[i]:void 0}(o,e.key))&&void 0!==i?i:e.default),a){if(BC(e.a)&&BC(e.l)||!LC(a))return a;var s=new UE(a);if(MC(e.l)){var u=s.color,l=IE(u.r,u.g,u.b),c=OE(l.h,l.s,e.l),h=new UE("rgb(".concat(c.r,", ").concat(c.g,", ").concat(c.b,")"));h.setOpacity(s.color.opacity),s=h}return MC(e.a)&&s.setOpacity(e.a),s.toRGBA()}}}function bI(t){return t&&"palette"===t.type&&!!t.key}function _I(t){return!(!DC(t)||0===t.length)&&t.every((function(t){return MC(t.scheme)}))}function xI(t,e){var n,i,r,a=(null!=e?e:{}).type;if(!e||BC(a))r=null==t?void 0:t.default;else{var o=function(t){var e,n;return t.type===bB.sankey?null!==(e=t.direction)&&void 0!==e?e:"horizontal":null!==(n=t.direction)&&void 0!==n?n:"vertical"}(e);r=null!==(i=null!==(n=null==t?void 0:t["".concat(a,"_").concat(o)])&&void 0!==n?n:null==t?void 0:t[a])&&void 0!==i?i:null==t?void 0:t.default}return r}var wI=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"range",value:function(t){return t?(this._range=t,this._resetRange(),this):p(h(n.prototype),"range",this).call(this)}},{key:"domain",value:function(t){return t?(p(h(n.prototype),"domain",this).call(this,t),this._resetRange(),this):p(h(n.prototype),"domain",this).call(this)}},{key:"_resetRange",value:function(){if(_I(this._range)){var t=mI(this._range,this._domain);p(h(n.prototype),"range",this).call(this,t)}else p(h(n.prototype),"range",this).call(this,this._range)}}])}(ZR),SI={linear:vB,band:$R,point:pB,ordinal:ZR,threshold:gB,colorOrdinal:wI};function AI(t,e){if("scale"in t&&t.scale)return LC(t.scale)&&(null==e?void 0:e.globalScale)?e.globalScale.registerMarkAttributeScale(t,e.seriesId):t.scale;var n,i,r=(n=t.type,(i=SI[n])?new i:null);return r&&function(t,e){t&&e&&(e.domain&&t.domain(e.domain),e.range&&t.range(e.range),e.specified&&t.specified&&t.specified(e.specified))}(r,t),r}function TI(t){return!!LC(t)&&!!t.endsWith("%")&&function(t){return null!=t&&""!==t&&(!!NC(t)||+t==+t)}(t.substring(0,t.length-1))}function CI(t,e,n){var i,r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return NC(t)?t:TI(t)?Number(t.substring(0,t.length-1))*e/100:RC(t)?t(n):PC(t)?e*(null!==(i=t.percent)&&void 0!==i?i:0)+(null!==(r=t.offset)&&void 0!==r?r:0):a}function EI(t){var e={};return DC(t)?(BC(t[0])||(e.top=e.left=e.bottom=e.right=t[0]),BC(t[1])||(e.left=e.right=t[1]),BC(t[2])||(e.bottom=t[2]),BC(t[3])||(e.left=t[3]),e):NC(t)||TI(t)||RC(t)||function(t){return!!PC(t)&&("percent"in t||"offset"in t)}(t)?(e.top=e.left=e.bottom=e.right=t,e):PC(t)?e=Object.assign({},t):e}function RI(t,e,n){return n?{x:t.x+e.x,y:t.y+e.y}:t}var BI=[{maxDomainLength:10,scheme:["#1664FF","#1AC6FF","#FF8A00","#3CC780","#7442D4","#FFC400","#304D77","#B48DEB","#009488","#FF7DDA"]},{scheme:["#1664FF","#B2CFFF","#1AC6FF","#94EFFF","#FF8A00","#FFCE7A","#3CC780","#B9EDCD","#7442D4","#DDC5FA","#FFC400","#FAE878","#304D77","#8B959E","#B48DEB","#EFE3FF","#009488","#59BAA8","#FF7DDA","#FFCFEE"]}],MI={default:{dataScheme:BI,palette:{backgroundColor:"#ffffff",borderColor:"#e3e5e8",shadowColor:"rgba(33,37,44,0.1)",hoverBackgroundColor:"#f1f2f5",sliderRailColor:"#f1f3f4",sliderHandleColor:"#ffffff",sliderTrackColor:"#0040ff",popupBackgroundColor:"#ffffff",primaryFontColor:"#21252c",secondaryFontColor:"#606773",tertiaryFontColor:"#89909d",axisLabelFontColor:"#89909d",disableFontColor:"#bcc1cb",axisMarkerFontColor:"#ffffff",axisGridColor:"#f1f2f5",axisDomainColor:"#d9dde4",dataZoomHandleStrokeColor:"#aeb5be",dataZoomChartColor:"#c9ced8",playerControllerColor:"#0040ff",scrollBarSliderColor:"rgba(0,0,0,0.3)",axisMarkerBackgroundColor:"#21252c",markLabelBackgroundColor:"#f1f2f5",markLineStrokeColor:"#606773",dangerColor:"#e33232",warningColor:"#ffc528",successColor:"#07a35a",infoColor:"#3073f2",discreteLegendPagerTextColor:"rgb(51, 51, 51)",discreteLegendPagerHandlerColor:"rgb(47, 69, 84)",discreteLegendPagerHandlerDisableColor:"rgb(170, 170, 170)"}}},PI="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",OI={scatter:{point:{style:{size:8,symbolType:"circle",lineWidth:0,fillOpacity:.8}},label:{visible:!1,offset:5,position:"top",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},line:{label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},area:{label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}},seriesMark:"area"},bar:{label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}},pie:{outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}},innerLabel:{style:{lineWidth:2}}},pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,position:"outside"}},map:{defaultFillColor:"#f3f3f3",area:{style:{lineWidth:.5,strokeOpacity:1,stroke:"black",fillOpacity:1}},label:{interactive:!1,style:{fontSize:{type:"token",key:"l6FontSize"},lineHeight:{type:"token",key:"l6LineHeight"},textBaseline:"middle",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},stroke:{type:"palette",key:"backgroundColor"}}}},radar:{label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},dot:{dot:{style:{size:10,fillOpacity:1}},symbol:{style:{size:10}},title:{style:{textAlign:"left",textBaseline:"middle",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},subTitle:{style:{textAlign:"left",textBaseline:"top",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},link:{arrow:{style:{size:10}}},wordCloud:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},funnel:{transform:{style:{fill:{type:"palette",key:"axisGridColor"}}},label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"}},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle"}}},funnel3d:{transform3d:{style:{fill:"#f5f5f5"}},label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:"#707070"},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:"#707070",textBaseline:"middle"}}},linearProgress:{bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:"#E7EBED",fillOpacity:1}}},circularProgress:{outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},waterfall:{seriesFieldName:{total:"total",increase:"increase",decrease:"decrease"},leaderLine:{style:{stroke:"black",lineWidth:1,lineDash:[4,4]}},stackLabel:{visible:!0,offset:12,position:"withChange",style:{fill:"black",fontSize:{type:"token",key:"l4FontSize"}}},label:{visible:!1,offset:12,position:"inside",style:{lineWidth:2}}},gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},gaugePointer:{pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:PI,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:PI,fill:"#ddd"}}},treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}},sunburst:{innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},rangeColumn:{label:{visible:!1,offset:5,position:"inside",style:{lineWidth:2,fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}},circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}},sankey:{link:{style:{fillOpacity:.15,round:!0}}},rose:{rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}},boxPlot:{boxPlot:{style:{lineWidth:1}},label:{style:{lineWidth:2}}},correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}},liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}},venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}}},II={label:{space:8},title:{space:8},maxHeight:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},LI=Object.assign(Object.assign({},II),{label:{space:0}}),DI="M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",jI={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},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}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:{area:{style:{visible:!1,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:!1,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}},startHandler:{style:{symbolType:DI,fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:DI,fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:{area:{style:{stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}},FI={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},NI={style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}},GI={horizontal:Object.assign(Object.assign({},FI),{rail:{width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:NI}),vertical:Object.assign(Object.assign({},FI),{rail:{width:8,height:200,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:NI})},zI={style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}},UI={horizontal:Object.assign(Object.assign({},FI),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:{width:200,height:4,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:zI}),vertical:Object.assign(Object.assign({},FI),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:{width:4,height:200,style:{fill:{type:"palette",key:"sliderRailColor"}}},handler:zI})},WI={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},VI={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:{visible:!1,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{visible:!0,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},label:{refY:5,style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},HI={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}};var YI={fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14,l1FontSize:32,l1LineHeight:"150%",l2FontSize:20,l2LineHeight:"140%",l3FontSize:16,l3LineHeight:"150%",l4FontSize:14,l4LineHeight:"150%",l5FontSize:12,l5LineHeight:"130%",l6FontSize:10,l6LineHeight:"120%"},XI={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:{type:"token",key:"fontFamily"},colorScheme:MI,token:YI,mark:{text:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1}}},markByName:{label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1,lineJoin:"bevel"}},area:{style:{fillOpacity:.2}},line:{style:{lineWidth:2,lineCap:"round",lineJoin:"round"}},point:{style:{size:8,stroke:{type:"palette",key:"backgroundColor"},lineWidth:1,fillOpacity:1}},word:{style:{fontSize:null}},fillingWord:{style:{fontSize:null}},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},circlePacking:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},funnel3d:{style:{stroke:!1}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06},stroke:"transparent"}}},series:OI,component:{discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1},colorLegend:GI,sizeLegend:UI,axis:{domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,inside:!1,tickSize:4,alignWithLabel:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},subTick:{visible:!1,tickSize:2,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},label:{visible:!0,inside:!1,space:10,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}},title:{space:10,padding:0,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor"},fontWeight:"normal",fillOpacity:1}}},axisBand:{domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},axisLinear:{domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}},axisX:II,axisY:{label:{space:12,autoLimit:!0},title:{space:12,autoRotate:!0},maxWidth:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},axisZ:LI,axisAngle:{grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}},axisRadius:{grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},markLine:VI,markArea:WI,markPoint:HI,polarMarkLine:VI,polarMarkArea:WI,polarMarkPoint:HI,geoMarkPoint:HI,tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},dataZoom:jI,crosshair:{trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:0,style:{size:25,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:0,style:{size:25,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"end",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0},indicator:{title:{visible:!0,autoLimit:!1,autoFit:!1,style:{fontSize:{type:"token",key:"l1FontSize"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{visible:!0,style:{fontSize:{type:"token",key:"l2FontSize"},fill:{type:"palette",key:"tertiaryFontColor"},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}},title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}},mapLabel:{visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"red"}}},poptip:{visible:!0,position:"auto",padding:8,titleStyle:{fontSize:{type:"token",key:"l5FontSize"},fontWeight:"bold",fill:{type:"palette",key:"primaryFontColor"}},contentStyle:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"primaryFontColor"}},panel:{visible:!0,fill:{type:"palette",key:"popupBackgroundColor"},cornerRadius:3,lineWidth:0,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"},size:0,space:12}},totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}},scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},animationThreshold:2e3},KI={name:"dark",colorScheme:{default:{dataScheme:BI,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroundColor:"#404349",sliderRailColor:"#404349",sliderHandleColor:"#202226",sliderTrackColor:"#4284FF",popupBackgroundColor:"#404349",primaryFontColor:"#fdfdfd",secondaryFontColor:"#bbbdc3",tertiaryFontColor:"#888c93",axisLabelFontColor:"#888c93",disableFontColor:"#55595f",axisMarkerFontColor:"#202226",axisGridColor:"#404349",axisDomainColor:"#4b4f54",dataZoomHandleStrokeColor:"#bbbdc3",dataZoomChartColor:"#55595F",playerControllerColor:"#4284FF",scrollBarSliderColor:"rgba(255,255,255,0.3)",axisMarkerBackgroundColor:"#fdfdfd",markLabelBackgroundColor:"#404349",markLineStrokeColor:"#bbbdc3",dangerColor:"#eb4b4b",warningColor:"#f0bd30",successColor:"#14b267",infoColor:"#4284ff",discreteLegendPagerTextColor:"#BBBDC3",discreteLegendPagerHandlerColor:"#BBBDC3",discreteLegendPagerHandlerDisableColor:"#55595F"}}},component:{dataZoom:{selectedBackground:{style:{fillOpacity:.4,outerBorder:{strokeOpacity:.4}}}}}};function qI(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){if(t===e)return;if(MC(e)&&"object"==a(e)){var i=Object(e),r=[];for(var o in i)r.push(o);for(var s=r.length,u=-1;s--;){var l=r[++u];MC(i[l])&&"object"==a(i[l])&&!DC(t[l])?ZI(t,e,l,n):JI(t,l,i[l])}}}}function ZI(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=t[n],o=e[n],s=e[n],u=!0;if(DC(o)){if(i)s=[];else if(DC(r))s=r;else if(jC(r)){s=new Array(r.length);for(var l=-1,c=r.length;++l<c;)s[l]=r[l]}}else IC(o)?(s=null!=r?r:{},"function"!=typeof r&&"object"==a(r)||(s={})):u=!1;u&&qI(s,o,i),JI(t,n,s)}function JI(t,e,n){(void 0!==n&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],n)||void 0===n&&!(e in t))&&(t[e]=n)}function $I(t){for(var e=-1,n=arguments.length<=1?0:arguments.length-1;++e<n;)qI(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function QI(t,e,n,i){Object.keys(t).forEach((function(r){if(PC(e))e.type===r&&(DC(t[r])?t[r].length>=e.index&&(t[r][e.index]=i?$I({},t[r][e.index],n):n):t[r]=i?$I({},t[r],n):n);else if(DC(t[r])){var a=t[r].findIndex((function(t){return t.id===e}));a>=0&&(t[r][a]=i?$I({},t[r][a],n):n)}else t.id===e&&(t[r]=i?$I({},t[r],n):n)}))}function tL(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return $I.apply(void 0,[eL(t)].concat(y(n.map(eL))))}function eL(t){var e;if(!t)return t;var n,i=function(t){return t&&(t=Object.keys(t).reduce((function(e,n){var i=t[n];return e[n]=function(t){return DC(t)?{dataScheme:t}:t}(i),e}),{})),t}(t.colorScheme),r=t.series,a=t.mark,o=t.markByName;return(a||o)&&(n=Object.keys(vI).reduce((function(t,e){var n,i=null!==(n=null==r?void 0:r[e])&&void 0!==n?n:{};return t[e]=function(t,e,n,i){if(!vI[e])return t;var r={};return Object.values(vI[e]).forEach((function(e){var a=e.type,o=e.name;r[o]=$I({},null==n?void 0:n[aE(a)[0]],null==i?void 0:i[o],null==t?void 0:t[o])})),Object.assign(Object.assign({},t),r)}(i,e,a,o),t}),{})),Object.assign({},t,{colorScheme:i,token:null!==(e=t.token)&&void 0!==e?e:{},series:Object.assign({},t.series,n)})}var nL=["animationThreshold","colorScheme","name","padding"];function iL(t,e,n,i){if(!t)return t;e||(e=t.colorScheme),n||(n=t.token);var r={};return Object.keys(t).forEach((function(a){var o=t[a];nL.includes(a)?r[a]=o:IC(o)?bI(o)?r[a]=function(t,e,n){if(e&&bI(t)){var i=kI(e,t,n);if(i)return i}return t}(o,e,i):function(t){return t&&"token"===t.type&&!!t.key}(o)?r[a]=function(t,e){return t&&e.key in t?t[e.key]:e.default}(n,o):r[a]=iL(o,e,n,i):r[a]=o})),r}var rL=l({},XI.name,XI),aL=XI.name,oL=new Map(Object.keys(rL).map((function(t){return[t,rL[t]]}))),sL=new Map(Object.keys(rL).map((function(t){return[t,iL(rL[t])]}))),uL=new Map(Object.keys(rL).map((function(t){return[t,t===aL]}))),lL=function(t,e){if(t){var n=hL(e);oL.set(t,n),sL.set(t,iL(n)),uL.set(t,!0)}},cL=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:aL,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return uL.has(t)&&!uL.get(t)&&lL(t,oL.get(t)),e?sL.get(t):oL.get(t)},hL=function(t){var e,n=null!==(e=t.type)&&void 0!==e?e:aL;return tL({},cL(n),t)},dL=function(){function t(){o(this,t)}return u(t,null,[{key:"registerInstance",value:function(e){t.instances.set(e.id,e)}},{key:"unregisterInstance",value:function(e){t.instances.delete(e.id)}},{key:"getInstance",value:function(e){return t.instances.get(e)}},{key:"instanceExist",value:function(e){return t.instances.has(e)}},{key:"forEach",value:function(e){var n=arguments.length>2?arguments[2]:void 0,i=aE(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]);return t.instances.forEach((function(t,n,r){i.includes(n)||e(t,n,r)}),n)}}])}();dL.instances=new Map;var fL=function(){function t(){o(this,t)}return u(t,null,[{key:"registerTheme",value:function(t,e){lL(t,e)}},{key:"getTheme",value:function(t){return cL(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1])}},{key:"removeTheme",value:function(t){return function(t){return oL.delete(t)&&sL.delete(t)&&uL.delete(t)}(t)}},{key:"themeExist",value:function(t){return function(t){return!!LC(t)&&oL.has(t)}(t)}},{key:"getDefaultTheme",value:function(){return t.themes.get(aL)}},{key:"setCurrentTheme",value:function(e){t.themeExist(e)&&(t._currentThemeName=e,dL.forEach((function(t){return null==t?void 0:t.setCurrentTheme(e)})))}},{key:"getCurrentTheme",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t.getTheme(t._currentThemeName,e)}},{key:"getCurrentThemeName",value:function(){return t._currentThemeName}}])}();function vL(t,e){return LC(t)?fL.themeExist(t)?fL.getTheme(t,e):{}:PC(t)?t:{}}function pL(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{data:function(t){return t}};if(!t)return t;if(t.constructor===Object){var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(e[i]){n[i]=e[i](t[i]);continue}n[i]=pL(t[i],e)}return n}return DC(t)?t.map((function(t){return pL(t,e)})):t}function gL(t,e){if(!t)return t;if(IC(t)){var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(LC(t[i])&&e.getFunction(t[i])){n[i]=e.getFunction(t[i]);continue}n[i]=gL(t[i],e)}return n}return DC(t)?t.map((function(t){return gL(t,e)})):t}fL.themes=oL,fL._currentThemeName=aL;var yL=function(t,e,n){return function(t,e,n,i){return new Le(Object.assign({defaultFontParams:Object.assign({fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14},i),getTextBounds:n?void 0:Nh,specialCharSet:"-/: .,@%'\"~"+Le.ALPHABET_CHAR_SET+Le.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}(t,e,n,{fontFamily:YI.fontFamily,fontSize:YI.fontSize})},mL=function(){function t(){o(this,t)}return u(t,null,[{key:"registerChart",value:function(e,n){t._charts[e]=n}},{key:"registerSeries",value:function(e,n){t._series[e]=n}},{key:"registerComponent",value:function(e,n,i){t._components[e]={cmp:n,alwaysCheck:i}}},{key:"registerMark",value:function(e,n){t._marks[e]=n}},{key:"registerRegion",value:function(e,n){t._regions[e]=n}},{key:"registerTransform",value:function(e,n){t.transforms[e]=n}},{key:"registerLayout",value:function(e,n){t._layout[e]=n}},{key:"registerAnimation",value:function(e,n){t._animations[e]=n}},{key:"registerImplement",value:function(e,n){t._implements[e]=n}},{key:"registerChartPlugin",value:function(e,n){t._chartPlugin[e]=n}},{key:"registerComponentPlugin",value:function(e,n){t._componentPlugin[e]=n}},{key:"createChart",value:function(e,n,i){return t._charts[e]?new t._charts[e](n,i):null}},{key:"createChartSpecTransformer",value:function(e,n){if(!t._charts[e])return null;var i=t._charts[e];return new i.transformerConstructor(Object.assign({seriesType:i.seriesType},n))}},{key:"createRegion",value:function(e,n,i){return t._regions[e]?new t._regions[e](n,i):null}},{key:"createRegionSpecTransformer",value:function(e,n){return t._regions[e]?new t._regions[e].transformerConstructor(n):null}},{key:"createSeries",value:function(e,n,i){return t._series[e]?new t._series[e](n,i):null}},{key:"createSeriesSpecTransformer",value:function(e,n){return t._series[e]?new t._series[e].transformerConstructor(n):null}},{key:"createMark",value:function(e,n,i){if(!t._marks[e])return null;var r=new t._marks[e](n,i);return"group"===r.type&&r.setInteractive(!1),r}},{key:"getComponents",value:function(){return Object.values(t._components)}},{key:"getComponentInKey",value:function(e){return t._components[e].cmp}},{key:"getLayout",value:function(){return Object.values(t._layout)}},{key:"getLayoutInKey",value:function(e){return t._layout[e]}},{key:"getSeries",value:function(){return Object.values(t._series)}},{key:"getSeriesInType",value:function(e){return t._series[e]}},{key:"getRegionInType",value:function(e){return t._regions[e]}},{key:"getAnimationInKey",value:function(e){return t._animations[e]}},{key:"getImplementInKey",value:function(e){return t._implements[e]}},{key:"getSeriesMarkMap",value:function(e){return t._series[e]?t._series[e].mark:{}}},{key:"getChartPlugins",value:function(){return Object.values(t._chartPlugin)}},{key:"getComponentPlugins",value:function(){return Object.values(t._componentPlugin)}},{key:"getComponentPluginInType",value:function(e){return t._componentPlugin[e]}},{key:"registerFormatter",value:function(t){this._formatter=t}},{key:"getFormatter",value:function(){return this._formatter}}])}();mL._charts={},mL._series={},mL._components={},mL._marks={},mL._regions={},mL._animations={},mL._implements={},mL._chartPlugin={},mL._componentPlugin={},mL.transforms={fields:ZE,filter:function(t,e){var n=e.callback;return n&&(t=t.filter(n)),t},fold:function(t,e){for(var n=e.fields,i=e.key,r=e.value,a=e.retains,o=[],s=function(e){n.forEach((function(s){var u={};if(u[i]=s,u[r]=t[e][s],a)a.forEach((function(n){u[n]=t[e][n]}));else for(var l in t[e])-1===n.indexOf(l)&&(u[l]=t[e][l]);o.push(u)}))},u=0;u<t.length;u++)s(u);return o}},mL.dataParser={csv:uR,dsv:sR,tsv:lR},mL._layout={};var kL=function(t,e,n,i){var r,a,o=zR(e.getScale().type),s=[],u=b(e.getOption().getChart().getSeriesInIndex(e.getSpecInfo().seriesIndexes));try{var l=function(){var u=a.value;if(u.coordinate===n){var l=aE(i(u)),c=null===(r=u.getViewData())||void 0===r?void 0:r.latestData;if(l&&c)if(o){var h=[],d=[];c.forEach((function(e,n){var i;(null===(i=e[l[0]])||void 0===i?void 0:i.toString())===(null==t?void 0:t.toString())&&(h.push(e),d.push(n))})),s.push({series:u,datum:h,key:bL(u,d)})}else if(MC(l[1])){var f=[],v=[];c.forEach((function(e,n){var i;((null===(i=e[l[0]])||void 0===i?void 0:i.toString())===(null==t?void 0:t.toString())||MC(e[l[0]])&&MC(e[l[1]])&&t>=e[l[0]]&&t<e[l[1]])&&(f.push(e),v.push(n))})),s.push({series:u,datum:f,key:bL(u,v)})}else{var p=e.getSpec().tooltipFilterRange,g=GC(p)?[-p,p]:p,y=[],m=[];if(g)c.forEach((function(e,n){if(MC(e[l[0]])){var i=e[l[0]]-t;i>=g[0]&&i<=g[1]&&(y.push(e),m.push(n))}}));else{var k=1/0,b=0;c.forEach((function(e,n){if(MC(e[l[0]])){var i=Math.abs(e[l[0]]-t),r=Math.sign(e[l[0]]-t);i<k?(k=i,y=[e],m=[n],b=r):i===k&&r===b&&(y.push(e),m.push(n))}}))}s.push({series:u,datum:y,key:bL(u,m)})}}};for(u.s();!(a=u.n()).done;)l()}catch(t){u.e(t)}finally{u.f()}return s},bL=function(t,e){return"".concat(t.id,"_").concat(e.join("_"))},_L=function(t,e,n){var i=t.getAllComponents().filter((function(i){return"axes"===i.specKey&&e(i)&&function(t,e,n){var i=t.getRegionsInIds(aE(e.layout.layoutBindRegionID));return null==i?void 0:i.some((function(t){var e=t.getLayoutRect(),i=t.getLayoutStartPoint();return function(t,e,n){return t.x>=e.x&&t.x<=n.x&&t.y>=e.y&&t.y<=n.y}(n,{x:i.x,y:i.y},{x:e.width+i.x,y:e.height+i.y})}))}(t,i,n)}));return i.length?i:null},xL=function(t,e){if(!t)return null;if(!xB(t.getRegionsInIndex(),"polar"))return null;var n=e.x,i=e.y,r=_L(t,(function(t){return"angle"===t.getOrient()}),e),a=_L(t,(function(t){return"radius"===t.getOrient()}),e),o=[],s=function(t){return t.getDimensionField()[0]};return r&&r.forEach((function(t){var e,r=t.getScale();if(r&&zR(r.type)){var u=r.domain(),l=r.range(),c=t.getCenter(),h={x:n-t.getLayoutStartPoint().x-c.x,y:i-t.getLayoutStartPoint().y-c.y},d=mB({x:1,y:0},h);d=function(t,e){var n=2*Math.PI,i=function(t,e){var n;if(0!==t.length){for(var i=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(n=null==e?void 0:e(a,i))&&void 0!==n?n:a-i<0)&&(i=a)}return i}}(e),r=function(t,e){var n;if(0!==t.length){for(var i=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(n=null==e?void 0:e(a,i))&&void 0!==n?n:a-i>0)&&(i=a)}return i}}(e);return t<i?t+=Math.ceil((i-t)/n)*n:t>r&&(t-=Math.ceil((t-r)/n)*n),t}(d,l);var f=kB(h),v=null===(e=a[0])||void 0===e?void 0:e.getScale(),p=null==v?void 0:v.range();if((d-(null==l?void 0:l[0]))*(d-(null==l?void 0:l[1]))>0||(f-(null==p?void 0:p[0]))*(f-(null==p?void 0:p[1]))>0)return;var g=t.invert(d);if(BC(g))return;var y=u.findIndex((function(t){return(null==t?void 0:t.toString())===g.toString()}));y<0&&(y=void 0);var m=kL(g,t,"polar",s);o.push({index:y,value:g,position:r.scale(g),axis:t,data:m})}})),a&&a.forEach((function(t){var e,a=t.getScale(),u=null==a?void 0:a.range();if(a&&zR(a.type)){var l=t.getCenter(),c={x:n-t.getLayoutStartPoint().x-l.x,y:i-t.getLayoutStartPoint().y-l.y},h=mB({x:1,y:0},c);h<-Math.PI/2&&(h=2*Math.PI+h);var d=kB(c),f=null===(e=r[0])||void 0===e?void 0:e.getScale(),v=null==f?void 0:f.range();if((h-(null==v?void 0:v[0]))*(h-(null==v?void 0:v[1]))>0||(d-(null==u?void 0:u[0]))*(d-(null==u?void 0:u[1]))>0)return;var p=a.invert(d);if(BC(p))return;var g=a.domain().findIndex((function(t){return(null==t?void 0:t.toString())===p.toString()}));g<0&&(g=void 0);var y=kL(p,t,"polar",s);o.push({index:g,value:p,position:a.scale(p),axis:t,data:y})}})),o.length?o:null};function wL(t){return"bottom"===t||"top"===t}var SL,AL=function(t){return t.fieldX[0]},TL=function(t){return t.fieldY[0]},CL=function(t){var e;return[t.fieldX[0],null!==(e=t.fieldX2)&&void 0!==e?e:t.fieldX[1]]},EL=function(t){var e;return[t.fieldY[0],null!==(e=t.fieldY2)&&void 0!==e?e:t.fieldY[1]]},RL=function(t,e){return t?e?AL:CL:e?TL:EL},BL=function(t,e,n,i){var r=t.getScale(),a=e-t.getLayoutStartPoint()[n];if((a-r.range()[0])*(a-r.range()[1])>0)return null;var o=r.invert(a);return ML(t,o,i)},ML=function(t,e,n){var i=t.getScale();if(BC(e))return null;var r=i.domain().findIndex((function(t){return(null==t?void 0:t.toString())===e.toString()}));r<0&&(r=void 0);var a=kL(e,t,"cartesian",null!=n?n:wL(t.getOrient())?AL:TL);return{index:r,value:e,position:i.scale(e),axis:t,data:a}},PL=function(){return u((function t(e,n){o(this,t),this._eventDispatcher=e,this._mode=n}),[{key:"chart",get:function(){var t,e;return this._chart||(this._chart=null===(e=(t=this._eventDispatcher.globalInstance).getChart)||void 0===e?void 0:e.call(t)),this._chart}},{key:"register",value:function(t,e){var n,i;(null!==(i=null===(n=this.chart)||void 0===n?void 0:n.getOption().onError)&&void 0!==i?i:yR)("Method not implemented.")}},{key:"unregister",value:function(){var t,e;(null!==(e=null===(t=this.chart)||void 0===t?void 0:t.getOption().onError)&&void 0!==e?e:yR)("Method not implemented.")}},{key:"getTargetDimensionInfo",value:function(t,e){var n,i,r=null!==(n=function(t,e,n){var i,r;if(!t)return null;if(!xB(t.getRegionsInIndex(),"cartesian"))return null;var a=e.x,o=e.y,s=null!==(i=_L(t,(function(t){return wL(t.getOrient())}),e))&&void 0!==i?i:[],u=null!==(r=_L(t,(function(t){return"left"===(e=t.getOrient())||"right"===e;var e}),e))&&void 0!==r?r:[],l=new Set,c=new Set,h=new Set;[s,u].forEach((function(t){return t.forEach((function(t){zR(t.getScale().type)?l.add(t):c.add(t),n&&t.getSpec().hasDimensionTooltip&&h.add(t)}))}));var d=[],f=function(t){var e="x"===t,n=e?a:o;(e?s:u).forEach((function(i){if(h.size>0){if(h.has(i)){var r=BL(i,n,t,RL(e,zR(i.getScale().type)));r&&d.push(r)}}else{var a=l.size>0;if((a?l:c).has(i)){var o=BL(i,n,t,RL(e,a));o&&d.push(o)}}}))};return"horizontal"===t.getSpec().direction?(f("y"),0===d.length&&f("x")):(f("x"),0===d.length&&f("y")),d.length?d:null}(this.chart,{x:t,y:e}))&&void 0!==n?n:[],a=null!==(i=xL(this.chart,{x:t,y:e}))&&void 0!==i?i:[],o=[].concat(r,a);return 0===o.length?null:o}},{key:"dispatch",value:function(t,e){var n,i=null===(n=this.chart)||void 0===n?void 0:n.getAllComponents().filter((function(t){return"axes"===t.specKey&&(!(null==e?void 0:e.filter)||e.filter(t))})),r=i.filter((function(t){return zR(t.getScale().type)})),a=r.length?r:i.filter((function(t){var e=t.getOrient();return wL(e)||"angle"===e})),o=[];return a.forEach((function(e){var n=ML(e,t);n&&o.push(n)})),this._callback.call(null,{action:"enter",dimensionInfo:o}),o}}])}(),OL=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).onClick=function(e){if(e){var n=e.event.viewX,i=e.event.viewY,r=t.getTargetDimensionInfo(n,i);r&&t._callback.call(null,Object.assign(Object.assign({},e),{action:"click",dimensionInfo:r.slice()}))}},t}return c(n,t),u(n,[{key:"register",value:function(t,e){this._callback=e.callback,this._eventDispatcher.register("pointertap",{query:Object.assign(Object.assign({},e.query),{source:tO.chart}),callback:this.onClick})}},{key:"unregister",value:function(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}])}(PL),IL=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments))._cacheDimensionInfo=null,t.onMouseMove=function(e){if(e){var n=e.event.viewX,i=e.event.viewY,r=t.getTargetDimensionInfo(n,i);null===r&&null!==t._cacheDimensionInfo?(t._callback.call(null,Object.assign(Object.assign({},e),{action:"leave",dimensionInfo:t._cacheDimensionInfo.slice()})),t._cacheDimensionInfo=r):null===r||null!==t._cacheDimensionInfo&&r.length===t._cacheDimensionInfo.length&&!r.some((function(e,n){return!function(t,e){var n,i;return t===e||!BC(t)&&!BC(e)&&t.value===e.value&&(null===(n=t.axis)||void 0===n?void 0:n.id)===(null===(i=e.axis)||void 0===i?void 0:i.id)}(e,t._cacheDimensionInfo[n])}))?null!==r&&t._callback.call(null,Object.assign(Object.assign({},e),{action:"move",dimensionInfo:r.slice()})):(t._callback.call(null,Object.assign(Object.assign({},e),{action:"enter",dimensionInfo:r.slice()})),t._cacheDimensionInfo=r)}},t.onMouseOut=function(e){e&&(t._callback.call(null,Object.assign(Object.assign({},e),{action:"leave",dimensionInfo:t._cacheDimensionInfo?t._cacheDimensionInfo.slice():[]})),t._cacheDimensionInfo=null)},t}return c(n,t),u(n,[{key:"register",value:function(t,e){this._callback=e.callback,this._eventDispatcher.register("pointermove",{query:Object.assign(Object.assign({},e.query),{source:tO.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:tO.canvas}),callback:this.onMouseOut}),_R(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:tO.chart}),callback:this.onMouseMove})}},{key:"unregister",value:function(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),_R(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}}])}(PL);!function(t){t.dimensionHover="dimensionHover",t.dimensionClick="dimensionClick"}(SL||(SL={}));var LL=l(l({},SL.dimensionHover,IL),SL.dimensionClick,OL),DL=function(){return u((function t(e,n){o(this,t),this._composedEventMap=new Map,this._eventDispatcher=e,this._mode=n}),[{key:"getComposedEventMap",value:function(){return this._composedEventMap}},{key:"on",value:function(t,e,n){var i="function"==typeof e?{query:null,callback:e}:{query:e,callback:n};if(LL[t]){var r=new LL[t](this._eventDispatcher,this._mode);r.register(t,i),this._composedEventMap.set(n,{eventType:t,event:r})}else this._eventDispatcher.register(t,i);return this}},{key:"off",value:function(t,e,n){var i,r,a=null!=n?n:e;if(LL[t])if(a)null===(i=this._composedEventMap.get(a))||void 0===i||i.event.unregister(),this._composedEventMap.delete(a);else{var o,s=b(this._composedEventMap.entries());try{for(s.s();!(o=s.n()).done;){var u=o.value;u[1].eventType===t&&(null===(r=this._composedEventMap.get(u[0]))||void 0===r||r.event.unregister(),this._composedEventMap.delete(u[0]))}}catch(t){s.e(t)}finally{s.f()}}else if(a){var l={callback:a,query:null,filter:{nodeName:null,type:t,level:null,source:e.source,markName:null,filter:null,userId:null}};this._eventDispatcher.unregister(t,l)}else this._eventDispatcher.unregister(t);return this}},{key:"emit",value:function(t,e,n){return this._eventDispatcher.dispatch(t,e,n),this}},{key:"release",value:function(){this._eventDispatcher.clear(),this._composedEventMap.clear()}}])}(),jL=function(){return u((function t(){o(this,t),this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(eO.vchart,[]),this._levelNodes.set(eO.chart,[]),this._levelNodes.set(eO.model,[]),this._levelNodes.set(eO.mark,[])}),[{key:"addHandler",value:function(t,e){var n,i={level:e,handler:t};return null===(n=this._levelNodes.get(e))||void 0===n||n.push(i),this._map.set(t.callback,i),this}},{key:"removeHandler",value:function(t){var e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);var n=this._levelNodes.get(e.level),i=null==n?void 0:n.findIndex((function(e){return e.handler.callback===t.callback}));return void 0!==i&&i>=0&&(null==n||n.splice(i,1)),this}},{key:"getHandlers",value:function(t){var e;return(null===(e=this._levelNodes.get(t))||void 0===e?void 0:e.map((function(t){return t.handler})))||[]}},{key:"getCount",value:function(){return this._map.size}},{key:"release",value:function(){this._map.clear(),this._levelNodes.clear()}}])}(),FL={cartesianAxis:"axis","cartesianAxis-band":"axis","cartesianAxis-linear":"axis","cartesianAxis-time":"axis",polarAxis:"axis","polarAxis-band":"axis","polarAxis-linear":"axis",discreteLegend:"legend",continuousLegend:"legend",colorLegend:"legend",sizeLegend:"legend",label:"label",markLine:"markLine",markArea:"markArea",markPoint:"markPoint",polarMarkLine:"polarMarkLine",polarMarkArea:"polarMarkArea",polarMarkPoint:"polarMarkPoint",geoMarkPoint:"geoMarkPoint"},NL=function(){return u((function t(e,n){var i=this;o(this,t),this._viewBubbles=new Map,this._windowBubbles=new Map,this._canvasBubbles=new Map,this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this._onDelegate=function(t){var e,n=i.globalInstance.getChart(),r=MC(t.modelId)&&(null==n?void 0:n.getModelById(t.modelId))||void 0,a=MC(t.markId)&&(null==n?void 0:n.getMarkById(t.markId))||null,o=new Map,s=null===(e=t.item)||void 0===e?void 0:e.mark;for(s&&MC(s.id())&&o.set(s.id(),t.item);null==s?void 0:s.elements;){var u=s.id();MC(u)&&!o.has(u)&&o.set(u,s.elements[0]),s=s.group}var l={event:t.event,item:t.item,datum:t.datum,source:t.source,itemMap:o,chart:n,model:r,mark:null!=a?a:void 0,node:YC(t.event,"target")};i.dispatch(t.type,l)},this._onDelegateInteractionEvent=function(t){var e=i.globalInstance.getChart(),n=t.event,r=null;n.elements&&(r=n.elements);var a={event:t.event,chart:e,items:r,datums:r&&r.map((function(t){return t.getDatum()}))};i.dispatch(t.type,a)},this.globalInstance=e,this._compiler=n}),[{key:"register",value:function(t,e){var n,i,r,a,o;this._parseQuery(e);var s=this.getEventBubble((null===(n=e.filter)||void 0===n?void 0:n.source)||tO.chart),u=this.getEventListeners((null===(i=e.filter)||void 0===i?void 0:i.source)||tO.chart);if(s.get(t)||s.set(t,new jL),s.get(t).addHandler(e,null===(r=e.filter)||void 0===r?void 0:r.level),this._isValidEvent(t)&&!u.has(t)){var l=this._onDelegate.bind(this);this._compiler.addEventListener(null===(a=e.filter)||void 0===a?void 0:a.source,t,l),u.set(t,l)}else if(this._isInteractionEvent(t)&&!u.has(t)){var c=this._onDelegateInteractionEvent.bind(this);this._compiler.addEventListener(null===(o=e.filter)||void 0===o?void 0:o.source,t,c),u.set(t,c)}return this}},{key:"unregister",value:function(t,e){var n,i,r,a,o=!1,s=this.getEventBubble((null===(n=null==e?void 0:e.filter)||void 0===n?void 0:n.source)||tO.chart),u=this.getEventListeners((null===(i=null==e?void 0:e.filter)||void 0===i?void 0:i.source)||tO.chart);if(e){var l=s.get(t);null==l||l.removeHandler(e),0===(null==l?void 0:l.getCount())&&(null==l||l.release(),s.delete(t),o=!0),(null===(r=null==e?void 0:e.wrappedCallback)||void 0===r?void 0:r.cancel)&&e.wrappedCallback.cancel()}else{var c=s.get(t);null==c||c.release(),s.delete(t),o=!0}if(o&&this._isValidEvent(t)){var h=u.get(t);this._compiler.removeEventListener((null===(a=null==e?void 0:e.filter)||void 0===a?void 0:a.source)||tO.chart,t,h),u.delete(t)}return this}},{key:"dispatch",value:function(t,e,n){var i=this.getEventBubble(e.source||tO.chart).get(t);if(!i)return this;var r=!1;if(n){var a=i.getHandlers(n);r=this._invoke(a,t,e)}else{var o=i.getHandlers(eO.mark);if(!(r=this._invoke(o,t,e))){var s=i.getHandlers(eO.model);r=this._invoke(s,t,e)}if(!r){var u=i.getHandlers(eO.chart);r=this._invoke(u,t,e)}if(!r){var l=i.getHandlers(eO.vchart);r=this._invoke(l,t,e)}}return this}},{key:"clear",value:function(){var t,e=b(this._viewListeners.entries());try{for(e.s();!(t=e.n()).done;){var n=t.value;this._compiler.removeEventListener(tO.chart,n[0],n[1])}}catch(t){e.e(t)}finally{e.f()}this._viewListeners.clear();var i,r=b(this._windowListeners.entries());try{for(r.s();!(i=r.n()).done;){var a=i.value;this._compiler.removeEventListener(tO.window,a[0],a[1])}}catch(t){r.e(t)}finally{r.f()}this._windowListeners.clear();var o,s=b(this._canvasListeners.entries());try{for(s.s();!(o=s.n()).done;){var u=o.value;this._compiler.removeEventListener(tO.canvas,u[0],u[1])}}catch(t){s.e(t)}finally{s.f()}this._canvasListeners.clear();var l,c=b(this._viewBubbles.values());try{for(c.s();!(l=c.n()).done;){l.value.release()}}catch(t){c.e(t)}finally{c.f()}this._viewBubbles.clear();var h,d=b(this._windowBubbles.values());try{for(d.s();!(h=d.n()).done;){h.value.release()}}catch(t){d.e(t)}finally{d.f()}this._windowBubbles.clear();var f,v=b(this._canvasBubbles.values());try{for(v.s();!(f=v.n()).done;){f.value.release()}}catch(t){v.e(t)}finally{v.f()}this._canvasBubbles.clear()}},{key:"release",value:function(){this.clear(),this.globalInstance=null,this._compiler=null}},{key:"_filter",value:function(t,e,n){var i,r,a;if(RC(t.filter)&&!t.filter(n))return!1;if(t.nodeName&&YC(n,"node.name")!==t.nodeName)return!1;if(t.markName&&(null===(i=null==n?void 0:n.mark)||void 0===i?void 0:i.name)!==t.markName)return!1;var o=null===(r=n.model)||void 0===r?void 0:r.type;return FL[o]&&(o=FL[o]),!(t.type&&o!==t.type||"mark"===t.level&&!t.type&&!(null==n?void 0:n.mark)||"model"===t.level&&!t.type&&!(null==n?void 0:n.model)||MC(t.userId)&&(null===(a=n.model)||void 0===a?void 0:a.userId)!==t.userId)}},{key:"_prepareParams",value:function(t,e){if(t.markName&&e.mark&&e.itemMap){var n=e.mark.getProductId(),i=e.itemMap.get(n),r=null==i?void 0:i.getDatum();return Object.assign(Object.assign({},e),{item:i,datum:r})}return Object.assign({},e)}},{key:"_invoke",value:function(t,e,n){var i=this;return t.map((function(t){var r,a,o,s=t.filter;if(!t.query||i._filter(s,e,n)){var u=(t.wrappedCallback||t.callback).call(null,i._prepareParams(s,n)),l=null!=u?u:null===(r=t.query)||void 0===r?void 0:r.consume;return l&&(null===(a=n.event)||void 0===a||a.stopPropagation(),null===(o=n.event)||void 0===o||o.preventDefault()),!!l}})).some((function(t){return!0===t}))}},{key:"_getQueryLevel",value:function(t){return t?t.level?t.level:MC(t.id)?eO.model:eO.vchart:eO.vchart}},{key:"_parseQuery",value:function(t){var e,n=t.query;(null==n?void 0:n.throttle)?t.wrappedCallback=SE(t.callback,n.throttle):(null==n?void 0:n.debounce)&&(t.wrappedCallback=wE(t.callback,n.debounce));var i=this._getQueryLevel(n),r=null,a=tO.chart,o=null,s=null,u=null;return(null==n?void 0:n.nodeName)&&(o=n.nodeName),(null==n?void 0:n.markName)&&(s=n.markName),!(null==n?void 0:n.type)||i!==eO.model&&i!==eO.mark||(r=n.type),(null==n?void 0:n.source)&&(a=n.source),MC(null==n?void 0:n.id)&&(u=null==n?void 0:n.id,i=eO.model),t.filter={level:i,markName:s,type:r,source:a,nodeName:o,userId:u,filter:null!==(e=null==n?void 0:n.filter)&&void 0!==e?e:null},t}},{key:"getEventBubble",value:function(t){switch(t){case tO.chart:return this._viewBubbles;case tO.window:return this._windowBubbles;case tO.canvas:return this._canvasBubbles;default:return this._viewBubbles}}},{key:"getEventListeners",value:function(t){switch(t){case tO.chart:return this._viewListeners;case tO.window:return this._windowListeners;case tO.canvas:return this._canvasListeners;default:return this._viewListeners}}},{key:"_isValidEvent",value:function(t){return EO.includes(t)||Object.values(LB).includes(t)}},{key:"_isInteractionEvent",value:function(t){var e;return t&&(e=t.split(":")[0])&&vM.hasInteraction(e)}}])}();function GL(t,e,n){t.getTransform(e)||t.registerTransform(e,n)}function zL(t,e,n){t.getParser(e)||t.registerParser(e,n)}var UL=new Map;function WL(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.latestData instanceof pR&&(e=!1),e?qC(t.latestData):t.latestData.slice()}var VL,HL=function(t,e){return 0===t.length?[]:1===t.length?WL(t[0],null==e?void 0:e.deep):t.map((function(t){return WL(t,null==e?void 0:e.deep)}))};!function(t){t[t.copyDataView=-10]="copyDataView",t[t.treemapFilter=-8]="treemapFilter",t[t.treemapFlatten=-7]="treemapFlatten",t[t.dotObjFlat=-7]="dotObjFlat",t[t.linkDotInfo=-7]="linkDotInfo",t[t.sankeyLayout=-7]="sankeyLayout",t[t.dataZoomFilter=-6]="dataZoomFilter",t[t.legendFilter=-5]="legendFilter"}(VL||(VL={}));var YL,XL,KL=function(t,e){var n={nodes:{}},i=e.fields;if(!(null==i?void 0:i.length))return n;var r,a=i.length-1,o=n;return t.forEach((function(t){t.latestData.forEach((function(t){o=n;for(var e=0;e<i.length;e++){var s=t[i[e]];if(BC(s))break;o.nodes[s]||(e===a?o.nodes[s]={values:[]}:(r={nodes:{}},o.nodes[s]=r)),e===a?o.nodes[s].values.push(t):o=o.nodes[s]}}))})),n};function qL(t){switch(t){case SC["desktop-browser"]:case SC["mobile-browser"]:return"browser";case SC.node:case SC.worker:return"node";case SC.miniApp:case SC["desktop-miniApp"]:return"feishu";case SC.lynx:return"lynx";case SC.wx:return"wx";case SC.tt:return"tt";case SC.harmony:return"harmony"}return"browser"}!function(t){t.appear="appear",t.disappear="disappear",t.enter="enter",t.update="update",t.state="state",t.exit="exit",t.normal="normal",t.none="none"}(YL||(YL={})),function(t){t.data="data",t.signal="signal",t.mark="mark"}(XL||(XL={}));var ZL,JL,$L=function(){return u((function t(e,n){var i=this;o(this,t),this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this._isRunning=!1,this._released=!1,this._model=l(l(l({},XL.signal,{}),XL.data,{}),XL.mark,{}),this._compileChart=null,this.handleStageRender=function(){var t,e;null===(e=null===(t=i._compileChart)||void 0===t?void 0:t.getEvent())||void 0===e||e.emit(QP.afterRender,{chart:i._compileChart})},this._container=e,this._option=n}),[{key:"getVGrammarView",value:function(){return this._view}},{key:"getModel",value:function(){return this._model}},{key:"getRenderer",value:function(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer}},{key:"getCanvas",value:function(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.canvas()}},{key:"getStage",value:function(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.stage()}},{key:"initView",value:function(){var t,e,n,i,r=this;if(!this._released&&(this.isInited=!0,!this._view)){var a=new dE(null!==(t=this._option.logLevel)&&void 0!==t?t:lE.Error);(null===(e=this._option)||void 0===e?void 0:e.onError)&&a.addErrorHandler((function(){for(var t,e,n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];null===(n=null===(e=r._option)||void 0===e?void 0:e.onError)||void 0===n||(t=n).call.apply(t,[e].concat(a))})),this._view=new oO(Object.assign(Object.assign({width:this._width,height:this._height,container:null!==(n=this._container.dom)&&void 0!==n?n:null,renderCanvas:null!==(i=this._container.canvas)&&void 0!==i?i:null,hooks:this._option.performanceHook},this._option),{mode:qL(this._option.mode),autoFit:!1,eventConfig:{gesture:_R(this._option.mode),disable:!1===this._option.interactive},doLayout:function(){var t;null===(t=r._compileChart)||void 0===t||t.onLayout(r._view)},logger:a,logLevel:a.level()})),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",this.handleStageRender),!1!==this._option.interactive&&this._viewListeners.forEach((function(t){var e;null===(e=r._view)||void 0===e||e.addEventListener(t.type,t.callback)}))}}},{key:"_setCanvasStyle",value:function(){if(this._view&&this._container.dom&&!LC(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";var t=this.getCanvas();t&&(t.style.display="block")}}},{key:"compileInteractions",value:function(){var t,e=this;if(this._view.removeAllInteractions(),null===(t=this._interactions)||void 0===t?void 0:t.length){var n={};this._interactions.forEach((function(t){var i;if(t.regionId){var r="".concat(t.regionId,"-").concat(t.type,"-").concat(null!==(i=t.id)&&void 0!==i?i:""),a=n[r];n[r]=a?Object.assign(Object.assign(Object.assign({},a),t),{selector:[].concat(y(a.selector),y(t.selector))}):t}else e._view.interaction(t.type,t)})),Object.keys(n).forEach((function(t){var i=e._view.interaction(n[t].type,n[t]);if(e._compileChart){var r=e._compileChart.getRegionsInIds([n[t].regionId])[0];r&&r.interaction.addVgrammarInteraction(i.getStartState(),i)}}))}}},{key:"compile",value:function(t,e){if(!this._released){var n=t.chart;this._compileChart=n,this.initView(),this._view&&(n.compile(),n.afterCompile(),this.updateDepend(),this.compileInteractions())}}},{key:"clear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.chart.clear(),this.releaseGrammar(e)}},{key:"renderNextTick",value:function(t){var e=this;this._released||this._nextRafId||(this._nextRafId=tp.getRequestAnimationFrame()((function(){e._nextRafId=null,e.render(t)})))}},{key:"render",value:function(t){var e,n;this._released||(this._nextRafId&&(tp.getCancelAnimationFrame()(this._nextRafId),this._nextRafId=null),this._isRunning||(this.initView(),this._view&&(this._isRunning=!0,null===(e=this._view)||void 0===e||e.run(t),this._isRunning=!1,this._nextRafId&&(tp.getCancelAnimationFrame()(this._nextRafId),this._nextRafId=null,this._isRunning=!0,null===(n=this._view)||void 0===n||n.run(t),this._isRunning=!1))))}},{key:"updateViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._view&&this._view.renderer.setViewBox(t,e)}},{key:"resize",value:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._view&&(this._width=t,this._height=e,this._view.resize(t,e),n&&this.render({morph:!1}))}},{key:"setBackground",value:function(t){var e;null===(e=this._view)||void 0===e||e.background(t)}},{key:"setSize",value:function(t,e){this._width=t,this._height=e,this._view&&(this._view.width(t),this._view.height(e))}},{key:"setViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._view&&this._view.renderer.setViewBox(t,e)}},{key:"addEventListener",value:function(t,e,n){var i,r;if(!1!==this._option.interactive)if(t===tO.chart){var a=function(i,r){var a,o,s,u=null!==(o=null===(a=null==r?void 0:r.mark)||void 0===a?void 0:a.getContext())&&void 0!==o?o:{},l=MC(u.modelId)?u.modelId:null,c=MC(u.markId)?u.markId:null,h=MC(u.modelUserId)?u.modelUserId:null,d=MC(u.markUserId)?u.markUserId:null,f={event:i,type:e,source:t,item:r,datum:(null===(s=null==r?void 0:r.getDatum)||void 0===s?void 0:s.call(r))||null,markId:c,modelId:l,markUserId:d,modelUserId:h};n.call(null,f)}.bind(this);this._viewListeners.set(n,{type:e,callback:a}),null===(i=this._view)||void 0===i||i.addEventListener(e,a)}else if(t===tO.window){var o=function(i){var r={event:i,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};n.call(null,r)}.bind(this);this._windowListeners.set(n,{type:e,callback:o});var s=this._getGlobalThis();null==s||s.addEventListener(e,o)}else if(t===tO.canvas){var u=function(i){var r={event:i,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};n.call(null,r)}.bind(this);this._canvasListeners.set(n,{type:e,callback:u});var l=null===(r=this.getStage())||void 0===r?void 0:r.window;null==l||l.addEventListener(e,u)}}},{key:"removeEventListener",value:function(t,e,n){var i,r,a,o,s;if(!1!==this._option.interactive)if(t===tO.chart){var u=null===(i=this._viewListeners.get(n))||void 0===i?void 0:i.callback;u&&(null===(r=this._view)||void 0===r||r.removeEventListener(e,u)),this._viewListeners.delete(n)}else if(t===tO.window){var l=this._getGlobalThis(),c=null===(a=this._windowListeners.get(n))||void 0===a?void 0:a.callback;c&&(null==l||l.removeEventListener(e,c)),this._windowListeners.delete(n)}else if(t===tO.canvas){var h=null===(o=this.getStage())||void 0===o?void 0:o.window,d=null===(s=this._canvasListeners.get(n))||void 0===s?void 0:s.callback;h&&d&&(null==h||h.removeEventListener(e,d)),this._canvasListeners.delete(n)}}},{key:"releaseEvent",value:function(){var t=this.getStage();t&&t.hooks.afterRender.unTap("chart-event",this.handleStageRender),this._viewListeners.clear(),this._windowListeners.clear(),this._canvasListeners.clear()}},{key:"release",value:function(){var t;this.releaseEvent(),this._option=this._container=null,this._releaseModel(),null===(t=this._view)||void 0===t||t.release(),this._view=null,this.isInited=!1,this._compileChart=null,this._released=!0}},{key:"releaseGrammar",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._releaseModel(),n&&(null===(t=this._view)||void 0===t||t.removeAllGraphicItems()),null===(e=this._view)||void 0===e||e.removeAllGrammars()}},{key:"_releaseModel",value:function(){var t=this;Object.keys(this._model).forEach((function(e){Object.values(t._model[e]).forEach((function(t){Object.values(t).forEach((function(t){t.removeProduct(!0)}))})),t._model[e]={}}))}},{key:"addGrammarItem",value:function(t){var e=t.getProduct();if(!BC(e)){var n=e.id(),i=t.grammarType;BC(this._model[i][n])&&(this._model[i][n]={}),this._model[i][n][t.id]=t}}},{key:"removeGrammarItem",value:function(t,e){var n,i=t.getProduct();if(!BC(i)){var r=i.id(),a=t.grammarType,o=this._model[a][r];MC(o)&&(delete o[t.id],0===Object.keys(o).length&&delete this._model[a][r]),e||null===(n=this._view)||void 0===n||n.removeGrammar(i)}}},{key:"addInteraction",value:function(t){this._interactions||(this._interactions=[]),this._interactions.push(t)}},{key:"removeInteraction",value:function(t){this._interactions&&(this._interactions=this._interactions.filter((function(e){return e.seriesId!==t})))}},{key:"updateDepend",value:function(t){return MC(t)&&t.length>0?t.every((function(t){return t.updateDepend()})):(Object.values(this._model).forEach((function(t){Object.values(t).forEach((function(t){var e=Object.values(t),n=e[0].getProduct(),i=e.reduce((function(t,e){return e.getDepend().length>0?t.concat(e.getDepend()):t}),[]).filter((function(t){return!!t})).map((function(t){return t.getProduct()}));n.depend(i)}))})),!0)}},{key:"_getGlobalThis",value:function(){var t;return bR(this._option.mode)?globalThis:null===(t=this.getStage())||void 0===t?void 0:t.window}}])}(),QL=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))};function tD(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"vchart",e=arguments.length>1?arguments[1]:void 0,n=document.createElement("a");n.setAttribute("href",e),n.setAttribute("target","_blank"),n.setAttribute("download","".concat(t,".png")),n.dispatchEvent(new MouseEvent("click"))}function eD(t){return new Promise((function(e){t.convertToBlob().then((function(t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e(n.result)}}))}))}function nD(t,e){var n;return QL(this,void 0,void 0,i().mark((function r(){return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t){i.next=2;break}return i.abrupt("return","");case 2:if(i.prev=2,!(void 0!==OffscreenCanvas&&t instanceof OffscreenCanvas)){i.next=5;break}return i.abrupt("return",eD(t));case 5:i.next=10;break;case 7:i.prev=7,i.t0=i.catch(2),(null!==(n=null==e?void 0:e.onError)&&void 0!==n?n:yR)("getCanvasDataURL error : ".concat(i.t0.toString()));case 10:return i.abrupt("return",t.toDataURL());case 11:case"end":return i.stop()}}),r,null,[[2,7]])})))}!function(t){t.STATE_NORMAL="normal",t.STATE_HOVER="hover",t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER="dimension_hover",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED="selected",t.STATE_SELECTED_REVERSE="selected_reverse",t.STATE_SANKEY_EMPHASIS="selected",t.STATE_SANKEY_EMPHASIS_REVERSE="blur"}(ZL||(ZL={})),function(t){t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED_REVERSE="selected_reverse"}(JL||(JL={}));var iD=function(){function t(){o(this,t),this._children=[],this._markNameMap={},this._infoMap=new Map}return u(t,[{key:"getMarkNameMap",value:function(){return this._markNameMap}},{key:"addMark",value:function(e,n){BC(e)||(this._children.push(e),this._markNameMap[e.name]=e,this._infoMap.set(e,QC({},t.defaultMarkInfo,n)))}},{key:"removeMark",value:function(t){var e=this._children.findIndex((function(e){return e.name===t}));e>=0&&(this._infoMap.delete(this._children[e]),delete this._markNameMap[t],this._children.splice(e,1))}},{key:"clear",value:function(){this._children=[],this._markNameMap={},this._infoMap.clear()}},{key:"forEach",value:function(t){this._children.forEach(t)}},{key:"includes",value:function(t,e){return this._children.includes(t,e)}},{key:"get",value:function(t){return isNaN(Number(t))?this._markNameMap[t]:this._children[t]}},{key:"getMarks",value:function(){return this._children.slice()}},{key:"getMarksInType",value:function(t){var e=aE(t);return this._children.filter((function(t){return e.includes(t.type)}))}},{key:"getMarkInId",value:function(t){return this._children.find((function(e){return e.id===t}))}},{key:"getMarkWithInfo",value:function(t){var e=this;return this._children.find((function(n){return Object.keys(t).every((function(i){return t[i]===e._infoMap.get(n)[i]}))}))}}])}();iD.defaultMarkInfo={};var rD=function(){return u((function t(e){var n=this;o(this,t),this._marks=new iD,this._markReverse=new iD,this.onHover=function(t){switch(t.action){case"enter":n.interaction.getEventElement(ZL.STATE_DIMENSION_HOVER).forEach((function(t){return n.interaction.addEventElement(ZL.STATE_DIMENSION_HOVER_REVERSE,t)})),n.interaction.clearEventElement(ZL.STATE_DIMENSION_HOVER,!1),n.getEventElement(t).forEach((function(t){return n.interaction.addEventElement(ZL.STATE_DIMENSION_HOVER,t)})),n.interaction.reverseEventElement(ZL.STATE_DIMENSION_HOVER);break;case"leave":n.interaction.clearEventElement(ZL.STATE_DIMENSION_HOVER,!0),t=null}},this._option=e,this.event=this._option.model.getOption().getChart().getEvent(),this.interaction=e.interaction,this.initConfig(e.mode)}),[{key:"hover",get:function(){return this._hover}},{key:"select",get:function(){return this._select}},{key:"setStateKeys",value:function(t){}},{key:"registerMark",value:function(t){HC(t.stateStyle[ZL.STATE_DIMENSION_HOVER])||this._marks.addMark(t),HC(t.stateStyle[ZL.STATE_DIMENSION_HOVER_REVERSE])||this._markReverse.addMark(t)}},{key:"init",value:function(){this.initEvent()}},{key:"release",value:function(){this.releaseEvent()}},{key:"initEvent",value:function(){this.event.on(SL.dimensionHover,this.onHover)}},{key:"releaseEvent",value:function(){this.event.release()}},{key:"initConfig",value:function(t){}},{key:"getEventElement",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return t.dimensionInfo.forEach((function(t){t.data.forEach((function(t){(n?e._markReverse:e._marks).getMarks().filter((function(e){return e.model===t.series&&e.getVisible()})).forEach((function(e){var r=e.getProduct();if(r&&r.elements){var a=r.elements.filter((function(e){var i,r=e.getDatum();return i=DC(r)?r.every((function(e,n){return e===t.datum[n]})):t.datum.some((function(t){return t===r})),n?!i:i}));i.push.apply(i,y(a))}}))}))})),i}}])}();var aD={};Object.values(ZL).forEach((function(t){aD[t]=!0}));var oD=l(l(l({},ZL.STATE_HOVER,ZL.STATE_HOVER_REVERSE),ZL.STATE_SELECTED,ZL.STATE_SELECTED_REVERSE),ZL.STATE_DIMENSION_HOVER,ZL.STATE_DIMENSION_HOVER_REVERSE);function sD(t){return oD[t]}var uD=function(){return u((function t(){o(this,t),this._stateMarks=new Map,this._stateElements=new Map,this._vgrammarInteractions=new Map,this._disableTriggerEvent=!1}),[{key:"addVgrammarInteraction",value:function(t,e){t&&(this._vgrammarInteractions.get(t)?this._vgrammarInteractions.get(t).push(e):this._vgrammarInteractions.set(t,[e]))}},{key:"setDisableActiveEffect",value:function(t){this._disableTriggerEvent=t}},{key:"registerMark",value:function(t,e){var n;this._stateMarks.has(t)||this._stateMarks.set(t,[]),null===(n=this._stateMarks.get(t))||void 0===n||n.push(e)}},{key:"getStateMark",value:function(t){return this._stateMarks.get(t)}},{key:"filterEventMark",value:function(t,e){var n;return!(!t.mark||!(null===(n=this._stateMarks.get(e))||void 0===n?void 0:n.includes(t.mark)))}},{key:"getEventElement",value:function(t){var e;return null!==(e=this._stateElements.get(t))&&void 0!==e?e:[]}},{key:"getEventElementData",value:function(t){return this.getEventElement(t).map((function(t){return t.getDatum()}))}},{key:"exchangeEventElement",value:function(t,e){var n,i=this;if(!this._disableTriggerEvent){var r=sD(t);null===(n=this._stateElements.get(t))||void 0===n||n.forEach((function(e){e.removeState(t),r&&i.addEventElement(r,e)})),e.getStates().includes(t)||(e.addState(t),r&&e.removeState(r)),this._stateElements.set(t,[e])}}},{key:"removeEventElement",value:function(t,e){var n,i;if(!this._disableTriggerEvent){e.removeState(t);var r=null!==(i=null===(n=this._stateElements.get(t))||void 0===n?void 0:n.filter((function(t){return t!==e})))&&void 0!==i?i:[];this._stateElements.set(t,r);var a=sD(t);a&&(0===r.length?this.clearEventElement(a,!1):this.addEventElement(a,e))}}},{key:"addEventElement",value:function(t,e){var n;if(!this._disableTriggerEvent){e.getStates().includes(t)||e.addState(t);var i=null!==(n=this._stateElements.get(t))&&void 0!==n?n:[];i.push(e),this._stateElements.set(t,i)}}},{key:"clearEventElement",value:function(t,e){var n;if(!this._disableTriggerEvent&&(null===(n=this._stateElements.get(t))||void 0===n||n.forEach((function(e){e.removeState(t)})),this._stateElements.set(t,[]),e)){var i=sD(t);i&&this.clearEventElement(i,!1)}}},{key:"reverseEventElement",value:function(t){var e=this;if(!this._disableTriggerEvent){var n=sD(t);if(n){var i=this.getStateMark(n);if(i){var r=this.getEventElement(t);r.length&&(this.getEventElement(n).length||(1===r.length?i.forEach((function(t){t.getProduct().elements.filter((function(t){return t!==r[0]})).forEach((function(t){e.addEventElement(n,t)}))})):i.forEach((function(t){t.getProduct().elements.filter((function(t){return!r.includes(t)})).forEach((function(t){e.addEventElement(n,t)}))}))))}}}}},{key:"startInteraction",value:function(t,e){var n=this._vgrammarInteractions.get(t);n&&n.forEach((function(t){t.start(e)}))}},{key:"resetInteraction",value:function(t,e){var n=this._vgrammarInteractions.get(t);n&&n.forEach((function(t){t.reset(e)}))}}],[{key:"markStateEnable",value:function(t,e){return!HC(t.stateStyle[e])}}])}(),lD=function(){return u((function t(e){o(this,t),this._option=e,this.getCompiler=this._option.getCompiler}),[{key:"getOption",value:function(){return this._option}},{key:"getVGrammarView",value:function(){var t;return null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView()}},{key:"release",value:function(){this._option=null,this.getCompiler=null}}])}(),cD=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).id=SR(),t._compiledProductId=null,t._depend=[],t}return c(n,t),u(n,[{key:"getProduct",value:function(){if(MC(this._product))return this._product;var t=this.getVGrammarView(),e=this.getProductId();return MC(e)&&MC(t)&&(this._product=this._lookupGrammar(e)),this._product}},{key:"getProductId",value:function(){var t;return null!==(t=this._compiledProductId)&&void 0!==t?t:this.generateProductId()}},{key:"getDepend",value:function(){return this._depend}},{key:"setDepend",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._depend=e}},{key:"compile",value:function(t){this._compileProduct(t),this._afterCompile(t)}},{key:"_afterCompile",value:function(t){var e;MC(this._product)&&(null===(e=this.getCompiler())||void 0===e||e.addGrammarItem(this))}},{key:"updateDepend",value:function(){if(MC(this._product)){var t=this.getDepend().map((function(t){return t.getProduct()})).filter(MC);return this._product.depend(t),t.length===this.getDepend().length}return!1}},{key:"release",value:function(){this.removeProduct(),p(h(n.prototype),"release",this).call(this),this._depend=[]}},{key:"removeProduct",value:function(t){this.getCompiler().removeGrammarItem(this,t),this._product=null,this._compiledProductId=null}}])}(lD),hD=function(t){function n(t,i,r,a){var s;return o(this,n),(s=e(this,n,[t])).grammarType=XL.signal,s.name=i,s._value=r,s._updateFunc=a,s}return c(n,t),u(n,[{key:"getValue",value:function(){return this._value}},{key:"getUpdateFunc",value:function(){return this._updateFunc}},{key:"updateSignal",value:function(t,e){this._value=t,this._updateFunc=e,this.compile()}},{key:"_compileProduct",value:function(){var t=this.getVGrammarView();if(t){if(!this.getProduct()){var e=this.getProductId();this._product=t.signal().id(e),this._compiledProductId=e}MC(this._value)&&this._product.value(this._value),MC(this._updateFunc)&&this._product.update(this._updateFunc)}}},{key:"generateProductId",value:function(){return this.name}},{key:"_lookupGrammar",value:function(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getSignalById(t)}}])}(cD),dD=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments))._signalMap={},t}return c(n,t),u(n,[{key:"getSignalMap",value:function(){return this._signalMap}},{key:"getSignal",value:function(t){return this._signalMap[t]}},{key:"updateSignal",value:function(t,e,n){this._signalMap[t]?this._signalMap[t].updateSignal(e,n):(this._signalMap[t]=new hD(this._option,t,e,n),this._signalMap[t].compile())}},{key:"compile",value:function(){Object.values(this._signalMap).forEach((function(t){t.compile()}))}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this),Object.values(this._signalMap).forEach((function(t){t.release()})),this._signalMap={}}}])}(lD),fD=function(t){function n(t){var i;return o(this,n),i=e(this,n,[t]),t.stateKeyToSignalName?i.stateKeyToSignalName=t.stateKeyToSignalName:i.stateKeyToSignalName=function(){return"state_signal"},i.initStateMap(),i}return c(n,t),u(n,[{key:"getStateMap",value:function(){return this._stateMap}},{key:"_getDefaultStateMap",value:function(){return{}}},{key:"initStateMap",value:function(t){this._stateMap=null!=t?t:this._getDefaultStateMap()}},{key:"compile",value:function(t){var e=this,n=null!=t?t:this._stateMap;Object.keys(n).forEach((function(t){var i=e.stateKeyToSignalName(t),r=n[t];e.updateSignal(i,r)}))}},{key:"updateState",value:function(t,e){if(t&&(QC(this._stateMap,t),this.compile(t),!e))return this.getCompiler().renderNextTick()}}])}(dD),vD=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).id=SR(),t.stateKeyToSignalName=function(e){return"".concat(FB,"_animate_").concat(t.id,"_").concat(e)},t}return c(n,t),u(n,[{key:"getAnimationStateSignalName",value:function(){return this.stateKeyToSignalName("animationState")}},{key:"updateAnimateState",value:function(t,e){t===YL.update?this.updateState({animationState:{callback:function(t,e){return e.diffState}}},e):t===YL.appear?this.updateState({animationState:{callback:function(t,e){return"exit"===e.diffState?YL.none:YL.appear}}},e):this.updateState({animationState:{callback:function(e,n){return t}}},e)}},{key:"_getDefaultStateMap",value:function(){return{animationState:{callback:function(t,e){return"exit"===e.diffState?YL.exit:YL.appear}}}}}])}(fD),pD=function(){return u((function t(e){o(this,t),this._option=e,this.type=e.type}),[{key:"_initTheme",value:function(t,e){return this._theme=this.getTheme(t,e),this._mergeThemeToSpec(t,e)}},{key:"getTheme",value:function(t,e){}},{key:"transformSpec",value:function(t,e,n){this._transformSpecBeforeMergingTheme(t,e,n);var i=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(i.spec,e,n),i}},{key:"_transformSpecBeforeMergingTheme",value:function(t,e,n){}},{key:"_transformSpecAfterMergingTheme",value:function(t,e,n){}},{key:"_mergeThemeToSpec",value:function(t,e){var n=this._theme;if(this._shouldMergeThemeToSpec()){var i=this._getDefaultSpecFromChart(e),r=function(t){return $I({},n,i,t)};return DC(t)?{spec:t.map((function(t){return r(t)})),theme:n}:{spec:r(t),theme:n}}return{spec:t,theme:n}}},{key:"_shouldMergeThemeToSpec",value:function(){return!0}},{key:"_getDefaultSpecFromChart",value:function(t){}}])}(),gD=function(t){function n(t,i){var r,a;return o(this,n),(r=e(this,n,[i])).transformerConstructor=pD,r.type="null",r.modelType="null",r.userId=void 0,r._data=null,r._layout=null,r.specKey="",r._marks=new iD,r._lastLayoutRect=null,r.id=SR(),r.userId=t.id,r._spec=t,r.effect={},r.event=new DL(i.eventDispatcher,i.mode),null===(a=i.map)||void 0===a||a.set(r.id,f(r)),r}return c(n,t),u(n,[{key:"getSpec",value:function(){return this._spec||{}}},{key:"getSpecPath",value:function(){var t;return null===(t=this._option)||void 0===t?void 0:t.specPath}},{key:"getSpecInfoPath",value:function(){var t,e,n;return null!==(e=null===(t=this._option)||void 0===t?void 0:t.specInfoPath)&&void 0!==e?e:null===(n=this._option)||void 0===n?void 0:n.specPath}},{key:"getData",value:function(){return this._data}},{key:"layout",get:function(){return this._layout}},{key:"getOption",value:function(){return this._option}},{key:"getMarks",value:function(){var t,e;return null!==(e=null===(t=this._marks)||void 0===t?void 0:t.getMarks())&&void 0!==e?e:[]}},{key:"getMarkNameMap",value:function(){var t;return null===(t=this._marks)||void 0===t?void 0:t.getMarkNameMap()}},{key:"getMarkSet",value:function(){return this._marks}},{key:"getMarkInfoList",value:function(){return this.getMarks().map((function(t){return{type:t.type,name:t.name}}))}},{key:"getChart",value:function(){return this._option.getChart()}},{key:"_theme",get:function(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.theme}},{key:"_releaseEvent",value:function(){this.event.release()}},{key:"created",value:function(){this.setAttrFromSpec()}},{key:"init",value:function(t){}},{key:"afterInit",value:function(){}},{key:"getVisible",value:function(){var t;return!1!==(null===(t=this._spec)||void 0===t?void 0:t.visible)}},{key:"onLayoutStart",value:function(t,e,n){var i;null===(i=this._layout)||void 0===i||i.onLayoutStart(t,e,n)}},{key:"onLayoutEnd",value:function(t){var e;null===(e=this._layout)||void 0===e||e.onLayoutEnd(t),this.getMarks().forEach((function(t){return t.updateLayoutState(!0,!0)}))}},{key:"onEvaluateEnd",value:function(t){}},{key:"onDataUpdate",value:function(){}},{key:"beforeRelease",value:function(){}},{key:"release",value:function(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach((function(t){return t.release()})),null===(t=this._data)||void 0===t||t.release(),this._data=null,this._marks.clear(),p(h(n.prototype),"release",this).call(this)}},{key:"updateSpec",value:function(t){var e=this._compareSpec(t,this._spec);return this._spec=t,e}},{key:"_compareSpec",value:function(t,e){return{change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1}}},{key:"reInit",value:function(t){t&&(this._spec=t),this.setAttrFromSpec()}},{key:"updateLayoutAttribute",value:function(){}},{key:"setAttrFromSpec",value:function(){var t;null===(t=this._layout)||void 0===t||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}},{key:"_convertMarkStyle",value:function(t){return Object.assign({},t)}},{key:"setMarkStyle",value:function(t,e,n,i){MC(t)&&MC(e)&&t.setStyle(this._convertMarkStyle(e),n,i)}},{key:"initMarkStyleWithSpec",value:function(t,e,n){var i=this;if(MC(t)&&MC(e)){var r=e.style,a=e.state,o=Object.assign({},e);r&&(o.style=this._convertMarkStyle(r)),a&&(o.state={},Object.keys(a).forEach((function(t){o.state[t]=i._convertMarkStyle(a[t])}))),t.initStyleWithSpec(o,n)}}},{key:"stateKeyToSignalName",value:function(t,e){var n="".concat(FB,"_").concat(this.modelType,"_").concat(this.type,"_").concat(this.id,"_").concat(t);return e&&(n+="_".concat(e)),n}},{key:"compileData",value:function(){var t;null===(t=this._data)||void 0===t||t.compile()}},{key:"compileMarks",value:function(t){this.getMarks().forEach((function(e){e.compile({group:t})}))}},{key:"_createMark",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.type,i=t.name,r=mL.createMark(n,i,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},e));return null==r||r.created(),r}},{key:"_getDataIdKey",value:function(){}},{key:"getColorScheme",value:function(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}},{key:"getSpecInfo",value:function(){var t,e,n;return function(t,e,n){if(!BC(e))return YC(t,e,n)}(null!==(n=null===(e=(t=this._option).getSpecInfo)||void 0===e?void 0:e.call(t))&&void 0!==n?n:{},this.getSpecInfoPath())}},{key:"getSpecIndex",value:function(){var t=this.getSpecPath();if(!(null==t?void 0:t.length))return 0;var e=Number(t[t.length-1]);return isNaN(e)?0:e}}])}(lD),yD=function(){return u((function t(e,n){var i,r=this;o(this,t),this.layoutClip=!1,this.autoIndent=!1,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:0,height:0},this._layoutRectLevelMap={width:0,height:0},this._minWidth=null,this._maxWidth=null,this._minHeight=null,this._maxHeight=null,this._lastComputeRect=null,this._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0},this.getLayoutRect=function(){return r._layoutRect},this.layoutType="normal",this._layoutOrient="left",this.layoutPaddingLeft=0,this.layoutPaddingTop=0,this.layoutPaddingRight=0,this.layoutPaddingBottom=0,this.layoutOffsetX=0,this.layoutOffsetY=0,this.layoutLevel=rO.Region,this._model=e,this._option=n,this.layoutLevel=n.layoutLevel,this.layoutType=n.layoutType,n.layoutOrient&&(this.layoutOrient=n.layoutOrient),this._spec=null===(i=null==e?void 0:e.getSpec)||void 0===i?void 0:i.call(e)}),[{key:"getSpec",value:function(){return this._spec||{}}},{key:"getLayoutStartPoint",value:function(){return this._layoutStartPoint}},{key:"layoutRectLevelMap",get:function(){return this._layoutRectLevelMap}},{key:"minWidth",get:function(){return this._minWidth},set:function(t){this._minWidth=t}},{key:"maxWidth",get:function(){return this._maxWidth},set:function(t){this._maxWidth=t}},{key:"minHeight",get:function(){return this._minHeight},set:function(t){this._minHeight=t}},{key:"maxHeight",get:function(){return this._maxHeight},set:function(t){this._maxHeight=t}},{key:"getLastComputeOutBounds",value:function(){return this._lastComputeOutBounds}},{key:"layoutOrient",get:function(){return this._layoutOrient},set:function(t){this._layoutOrient=t}},{key:"model",get:function(){return this._model}},{key:"type",get:function(){return this._model.type}},{key:"_setLayoutAttributeFromSpec",value:function(t,e){var n,i,r,a;if(this._spec&&!1!==this._spec.visible){var o=function(t,e,n){var i,r,a,o,s={top:0,bottom:0,left:0,right:0};return Object.values(t).every((function(t){return NC(t)}))?(s.top=null!==(i=t.top)&&void 0!==i?i:0,s.right=null!==(r=t.right)&&void 0!==r?r:0,s.bottom=null!==(a=t.bottom)&&void 0!==a?a:0,s.left=null!==(o=t.left)&&void 0!==o?o:0,s):([{orients:["left","right"],size:e.width},{orients:["top","bottom"],size:e.height}].forEach((function(e){e.orients.forEach((function(i){s[i]=CI(t[i],e.size,n)}))})),s)}(EI(t.padding),e,e);this.layoutPaddingLeft=o.left,this.layoutPaddingRight=o.right,this.layoutPaddingTop=o.top,this.layoutPaddingBottom=o.bottom,this._minHeight=BC(t.minHeight)?null!==(n=this._minHeight)&&void 0!==n?n:null:CI(t.minHeight,e.height,e),this._maxHeight=BC(t.maxHeight)?null!==(i=this._maxHeight)&&void 0!==i?i:null:CI(t.maxHeight,e.height,e),this._minWidth=BC(t.minWidth)?null!==(r=this._minWidth)&&void 0!==r?r:null:CI(t.minWidth,e.width,e),this._maxWidth=BC(t.maxWidth)?null!==(a=this._maxWidth)&&void 0!==a?a:null:CI(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:CI(t.width,e.width,e)},{width:9}),t.height&&this.setLayoutRect({height:CI(t.height,e.height,e)},{height:9}),BC(t.offsetX)||(this.layoutOffsetX=CI(t.offsetX,e.width,e)),BC(t.offsetY)||(this.layoutOffsetY=CI(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}},{key:"setAttrFromSpec",value:function(t,e){var n,i,r,a;this._spec=t,this.layoutType=null!==(n=t.layoutType)&&void 0!==n?n:this.layoutType,this.layoutLevel=null!==(i=t.layoutLevel)&&void 0!==i?i:this.layoutLevel,this.layoutOrient=null!==(r=t.orient)&&void 0!==r?r:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=null!==(a=t.clip)&&void 0!==a?a:this.layoutClip}},{key:"onLayoutStart",value:function(t,e,n){this._setLayoutAttributeFromSpec(this._spec,e)}},{key:"onLayoutEnd",value:function(t){}},{key:"_getAbsoluteSpecValue",value:function(t){var e=this,n={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach((function(i){BC(e._spec[i])||(n[i]=CI(e._spec[i],"top"===i||"bottom"===i?t.height:t.width,t))})),n}},{key:"absoluteLayoutInRect",value:function(t){var e=this._getAbsoluteSpecValue(t),n=e.top,i=e.bottom,r=e.left,a=e.right,o={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};BC(r)||(o.width-=r),BC(a)||(o.width-=a),BC(n)||(o.height-=n),BC(i)||(o.height-=i),this.setLayoutRect(o);var s=this.computeBoundsInRect(this.getLayoutRect()),u=s.width,l=s.height;this.setLayoutRect({width:u,height:l});var c={x:t.x,y:t.y};!0===this._spec.center?(c.x=t.x+.5*t.width-.5*u,c.y=t.y+.5*t.height-.5*l):(BC(r)?BC(a)||(c.x=t.x+t.width-this.layoutPaddingRight-a-u):c.x=t.x+r+this.layoutPaddingLeft,BC(n)?BC(i)||(c.y=t.y+t.height-this.layoutPaddingBottom-i-l):c.y=t.y+n+this.layoutPaddingTop),this.setLayoutStartPosition(c)}},{key:"setLayoutStartPosition",value:function(t){var e,n;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),GC(t.x)&&(this._layoutStartPoint.x=t.x),GC(t.y)&&(this._layoutStartPoint.y=t.y),null===(n=(e=this._model).afterSetLayoutStartPoint)||void 0===n||n.call(e,this._layoutStartPoint)}},{key:"setLayoutRect",value:function(t,e){var n,i,r,a,o=t.width,s=t.height;GC(o)&&(null!==(n=null==e?void 0:e.width)&&void 0!==n?n:0)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=o,this._layoutRectLevelMap.width=null!==(i=null==e?void 0:e.width)&&void 0!==i?i:0),GC(s)&&(null!==(r=null==e?void 0:e.height)&&void 0!==r?r:0)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=s,this._layoutRectLevelMap.height=null!==(a=null==e?void 0:e.height)&&void 0!==a?a:0),this.setRectInSpec(this._layoutRect)}},{key:"getLayout",value:function(){return{x:this._layoutStartPoint.x,y:this._layoutStartPoint.y,width:this._layoutRect.width,height:this._layoutRect.height}}},{key:"mergeLayoutRect",value:function(t){var e={width:t.width,height:t.height};return this._layoutRectLevelMap.width>0&&(e.width=this._layoutRect.width),this._layoutRectLevelMap.height>0&&(e.height=this._layoutRect.height),e}},{key:"getOrientPosAttribute",value:function(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"x":"y"}},{key:"getOrientSizeAttribute",value:function(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"width":"height"}},{key:"changeBoundsBySetting",value:function(t){return this._layoutRectLevelMap.width>0&&(t.x2=t.x1+this._layoutRect.width),this._layoutRectLevelMap.height>0&&(t.y2=t.y1+this._layoutRect.height),t.x1-=this._layoutStartPoint.x,t.x2-=this._layoutStartPoint.x,t.y1-=this._layoutStartPoint.y,t.y2-=this._layoutStartPoint.y,t}},{key:"setRectInSpec",value:function(t){var e=Object.assign({},t);return this._layoutRectLevelMap.width<9?(BC(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),BC(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<9?(BC(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),BC(this._maxHeight)||(e.height=Math.min(e.height,this._maxHeight))):e.height=this._layoutRect.height,e}},{key:"computeBoundsInRect",value:function(t){if(this._lastComputeRect=t,!("region-relative"!==this.layoutType&&"region-relative-overlap"!==this.layoutType||(9!==this._layoutRectLevelMap.width||"left"!==this.layoutOrient&&"right"!==this.layoutOrient)&&(9!==this._layoutRectLevelMap.height||"bottom"!==this.layoutOrient&&"top"!==this.layoutOrient)))return this._layoutRect;var e=Object.assign({},this._model.getBoundsInRect(this.setRectInSpec(t),t));this.changeBoundsBySetting(e),this.autoIndent&&e.x2-e.x1>0&&e.y2-e.y1>0&&(this._lastComputeOutBounds.x1=Math.ceil(-e.x1),this._lastComputeOutBounds.x2=Math.ceil(e.x2-t.width),this._lastComputeOutBounds.y1=Math.ceil(-e.y1),this._lastComputeOutBounds.y2=Math.ceil(e.y2-t.height));var n=this.setRectInSpec(function(t,e){return t?{width:Math.ceil(Math.min(t.x2-t.x1,e.width)),height:Math.ceil(Math.min(t.y2-t.y1,e.height))}:{width:0,height:0}}(e,t));return this._option.transformLayoutRect&&(n=this._option.transformLayoutRect(n)),n}},{key:"getModelId",value:function(){return this._model.id}},{key:"getModelVisible",value:function(){return this._model.getVisible()}}])}(),mD=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).layoutType="normal",t.layoutLevel=0,t.layoutZIndex=0,t._forceLayoutTag=!1,t._layout=null,t._orient=null,t._layoutRect={width:0,height:0},t._layoutStartPos={x:0,y:0},t._isLayout=!0,t.getGraphicBounds=function(){return t._layout?{x1:t._layout.getLayoutStartPoint().x,y1:t._layout.getLayoutStartPoint().y,x2:t._layout.getLayoutStartPoint().x+t._layout.getLayoutRect().width,y2:t._layout.getLayoutStartPoint().y+t._layout.getLayoutRect().height}:{x1:0,x2:0,y1:0,y2:0}},t._transformLayoutRect=null,t._transformLayoutPosition=null,t}return c(n,t),u(n,[{key:"layoutOrient",get:function(){return this._orient},set:function(t){this._orient=t,this._layout&&(this._layout.layoutOrient=t)}},{key:"initLayout",value:function(){"none"!==this.layoutType&&(this._layout=new yD(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition}),this._orient&&"radius"!==this._orient&&"angle"!==this._orient&&this._layout&&(this._layout.layoutOrient=this._orient))}},{key:"onLayoutStart",value:function(t,e,i){this._isLayout=!0,p(h(n.prototype),"onLayoutStart",this).call(this,t,e,i)}},{key:"onLayoutEnd",value:function(t){p(h(n.prototype),"onLayoutEnd",this).call(this,t),this.updateLayoutAttribute();var e=this.getLayoutRect();!this._forceLayoutTag&&nE(this._lastLayoutRect,e)||(this._lastLayoutRect=Object.assign({},e)),this._forceLayoutTag=!1,this._isLayout=!1}},{key:"afterSetLayoutStartPoint",value:function(t){}},{key:"_forceLayout",value:function(){var t;this._isLayout||(this._forceLayoutTag=!0,null===(t=this._option.globalInstance.getChart())||void 0===t||t.setLayoutTag(!0))}},{key:"getLayoutStartPoint",value:function(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}},{key:"setLayoutStartPosition",value:function(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=QC(this._layoutStartPos,t)}},{key:"getLayoutRect",value:function(){return this._layout?this._layout.getLayoutRect():this._layoutRect}},{key:"setLayoutRect",value:function(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=QC(this._layoutRect,t)}},{key:"getLastComputeOutBounds",value:function(){var t;return null===(t=this._layout)||void 0===t?void 0:t.getLastComputeOutBounds()}},{key:"setAttrFromSpec",value:function(){var t,e,i,r,a;p(h(n.prototype),"setAttrFromSpec",this).call(this),this.layoutClip=null!==(t=this._spec.clip)&&void 0!==t?t:this.layoutClip,this.layoutZIndex=null!==(e=this._spec.zIndex)&&void 0!==e?e:this.layoutZIndex,this.layoutType=null!==(i=this._spec.layoutType)&&void 0!==i?i:this.layoutType,this._orient=null!==(r=this._spec.orient)&&void 0!==r?r:this._orient,this.layoutLevel=null!==(a=this._spec.layoutLevel)&&void 0!==a?a:this.layoutLevel}}])}(gD),kD=function(t){function n(){return o(this,n),e(this,n,arguments)}return c(n,t),u(n,[{key:"_initTheme",value:function(t,e){return{spec:t,theme:this._theme}}}])}(pD),bD=function(t){function n(t,i){var r,a;return o(this,n),(r=e(this,n,[t,i])).transformerConstructor=kD,r.modelType="region",r.specKey="region",r.type=n.type,r._series=[],r.layoutType="region",r.layoutZIndex=iO.Region,r.interaction=new uD,r.seriesDataFilterOver=function(){r.event.emit(QP.regionSeriesDataFilterOver,{model:f(r),chart:r.getChart()}),r._series.forEach((function(t){t.getViewDataFilter()&&t.reTransformViewData()}))},r.getBoundsInRect=function(){return{x1:r._layout.getLayoutStartPoint().x,y1:r._layout.getLayoutStartPoint().y,x2:r._layout.getLayoutStartPoint().x+r._layout.getLayoutRect().width,y2:r._layout.getLayoutStartPoint().y+r._layout.getLayoutRect().height}},r.userId=t.id,r.coordinate=null!==(a=t.coordinate)&&void 0!==a?a:"cartesian",r._option.animation&&(r.animate=new vD({getCompiler:i.getCompiler})),r.interaction.setDisableActiveEffect(r._option.disableTriggerEvent),r}return c(n,t),u(n,[{key:"getMaxWidth",value:function(){return this._layout.maxWidth}},{key:"setMaxWidth",value:function(t){this._layout.maxWidth=t}},{key:"getMaxHeight",value:function(){return this._layout.maxHeight}},{key:"setMaxHeight",value:function(t){this._layout.maxHeight=t}},{key:"getGroupMark",value:function(){return this._groupMark}},{key:"getInteractionMark",value:function(){return this._interactionMark}},{key:"getStackInverse",value:function(){return!0===this._spec.stackInverse}},{key:"getStackSort",value:function(){return!0===this._spec.stackSort}},{key:"_getClipDefaultValue",value:function(){var t,e,n,i,r=this._option.getChart().getSpec(),a=null===(e=null===(t=r.dataZoom)||void 0===t?void 0:t.some)||void 0===e?void 0:e.call(t,(function(t){var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"filter")})),o=null===(i=null===(n=r.scrollBar)||void 0===n?void 0:n.some)||void 0===i?void 0:i.call(n,(function(t){var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"axis")}));return!(!a&&!o)||this._layout.layoutClip}},{key:"created",value:function(){var t,e=this;this.initLayout(),p(h(n.prototype),"created",this).call(this);var i=null!==(t=this._spec.clip)&&void 0!==t?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._interactionMark=this._createGroupMark("regionInteractionGroup",this.userId+"_interaction",iO.Interaction),HC(this._spec.style)||(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"}),i&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"})),[this._backgroundMark,this._foregroundMark].forEach((function(t){t&&(t.created(),e.setMarkStyle(t,{width:function(){return e.getLayoutRect().width},height:function(){return e.getLayoutRect().height}},"normal",nO.Built_In),e._groupMark.addMark(t))})),this._backgroundMark&&this._backgroundMark.setZIndex(0),this._foregroundMark&&this._foregroundMark.setZIndex(iO.Mark+1)),this.createTrigger()}},{key:"_createGroupMark",value:function(t,e,n){var i,r,a=this,o=this._createMark({type:"group",name:t});o.setUserId(e),o.setZIndex(n);var s=null!==(i=this._spec.clip)&&void 0!==i?i:this._getClipDefaultValue();return this.setMarkStyle(o,{x:function(){return a.getLayoutStartPoint().x},y:function(){return a.getLayoutStartPoint().y},width:function(){return a.getLayoutRect().width},height:function(){return a.getLayoutRect().height},clip:s},"normal",nO.Built_In),this.setMarkStyle(o,{cornerRadius:null===(r=this._spec.style)||void 0===r?void 0:r.cornerRadius},"normal",nO.User_Mark),this._marks.addMark(o),o}},{key:"init",value:function(t){p(h(n.prototype),"init",this).call(this,t),this.initMark(),this.initSeriesDataflow(),this.initInteraction(),this.initTrigger()}},{key:"initMark",value:function(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}},{key:"_initBackgroundMarkStyle",value:function(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:(null===(t=this._spec.style)||void 0===t?void 0:t.fill)?1:0},this._spec.style),"normal",nO.User_Mark),(null!==(e=this._spec.clip)&&void 0!==e?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",nO.Built_In))}},{key:"_initForegroundMarkStyle",value:function(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0}),"normal",nO.User_Mark)}},{key:"_compareSpec",value:function(t,e){var i=p(h(n.prototype),"_compareSpec",this).call(this,t,e);return nE(null==e?void 0:e.style,null==t?void 0:t.style)||(i.reMake=!0),i}},{key:"reInit",value:function(t){p(h(n.prototype),"reInit",this).call(this,t),this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}},{key:"addSeries",value:function(t){t&&(this._series.includes(t)||this._series.push(t))}},{key:"removeSeries",value:function(t){if(t){var e=this._series.findIndex((function(e){return e===t}));e>=0&&this._series.splice(e,1)}}},{key:"getSeries",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._series.filter((function(e){var n,i;return(!t.name||(null==e?void 0:e.name)===t.name)&&(!t.userId||aE(t.userId).includes(e.userId))&&(!MC(t.specIndex)||aE(t.specIndex).includes(e.getSpecIndex()))&&(!t.id||e.id===t.id)&&(!t.type||e.type===t.type)&&(!t.coordinateType||e.coordinate===t.coordinateType)&&(!t.dataName||(null===(i=null===(n=e.getRawData)||void 0===n?void 0:n.call(e))||void 0===i?void 0:i.name)===t.dataName)}))}},{key:"getSeriesInName",value:function(t){return this.getSeries({name:t})[0]}},{key:"getSeriesInUserId",value:function(t){return this.getSeries({userId:t})[0]}},{key:"getSeriesInId",value:function(t){return this.getSeries({id:t})[0]}},{key:"getSeriesInType",value:function(t){return this.getSeries({type:t})}},{key:"getSeriesInCoordinateType",value:function(t){return this.getSeries({coordinateType:t})}},{key:"getSeriesInDataName",value:function(t){return this.getSeries({dataName:t})}},{key:"onRender",value:function(t){}},{key:"initSeriesDataflow",value:function(){var t=this._series.map((function(t){var e;return null!==(e=t.getViewDataFilter())&&void 0!==e?e:t.getViewData()})).filter((function(t){return!!t}));this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this),this._series=[]}},{key:"createTrigger",value:function(){var t=Object.assign(Object.assign({},this._option),{model:this,interaction:this.interaction});this._trigger=new rD(t)}},{key:"initTrigger",value:function(){var t=this;this._series.forEach((function(e){e.getMarksWithoutRoot().forEach((function(e){t._trigger.registerMark(e)}))})),this._trigger.init()}},{key:"initInteraction",value:function(){var t=this;this._option.disableTriggerEvent||this._series.forEach((function(e){e.getMarksWithoutRoot().forEach((function(e){for(var n in JL)HC(e.stateStyle[JL[n]])||t.interaction.registerMark(JL[n],e)}))}))}},{key:"compileMarks",value:function(t){var e=this;this.getMarks().forEach((function(n){var i;n.compile({group:t}),null===(i=n.getProduct())||void 0===i||i.configure({context:{model:e}}).layout((function(t,e,n,i){}))}))}},{key:"compile",value:function(){var t;null===(t=this.animate)||void 0===t||t.compile(),this.compileMarks()}},{key:"onLayoutEnd",value:function(t){this._series.forEach((function(e){return e.onLayoutEnd(t)})),p(h(n.prototype),"onLayoutEnd",this).call(this,t)}}])}(mD);function _D(t){var e=[],n=[],i=[];return t.forEach((function(t){BC(t.getSpec().position)||"start"===t.getSpec().position?e.push(t):"middle"===t.getSpec().position?n.push(t):"end"===t.getSpec().position&&i.push(t)})),{startItems:e,endItems:i,middleItems:n}}function xD(t,e,n){e?t.forEach((function(t){var e=oE(t),i=e.getLayoutStartPoint().y+e.getLayoutRect().height-t[0].getLayoutStartPoint().y,r=(n-i)/2;t.forEach((function(t){t.setLayoutStartPosition({x:t.getLayoutStartPoint().x,y:t.getLayoutStartPoint().y+r})}))})):t.forEach((function(t){var e=oE(t),i=e.getLayoutStartPoint().x+e.getLayoutRect().width-t[0].getLayoutStartPoint().x,r=(n-i)/2;t.forEach((function(t){t.setLayoutStartPosition({x:t.getLayoutStartPoint().x+r,y:t.getLayoutStartPoint().y})}))}))}function wD(t,e,n,i){var r;t.forEach((function(t,a){t.length>1&&(r=n[a],t.forEach((function(t){if(t.alignSelf&&"start"!==t.alignSelf){var n=t.getLayoutStartPoint(),a="middle"===t.alignSelf?.5:1,o=e?r-(t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight):r-(t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom);e?t.setLayoutStartPosition({x:n.x+i*o*a,y:n.y}):t.setLayoutStartPosition({x:n.x,y:n.y+i*o*a})}})))}))}function SD(t,e,n,i,r){if(t.length){var a=0,o="right"===r,s=o?-1:1,u=o?e.rightCurrent:e.leftCurrent,l=e.topCurrent,c=[],h=[],d=[];t.forEach((function(t){var i=e.getItemComputeLayoutRect(t),r=t.computeBoundsInRect(i);t.setLayoutRect(r);var f=r.height+t.layoutPaddingTop+t.layoutPaddingBottom,v=r.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=o?-r.width-t.layoutPaddingRight:t.layoutPaddingLeft;t.setLayoutStartPosition({x:u+t.layoutOffsetX+p,y:l+t.layoutOffsetY+t.layoutPaddingTop}),(l+=f)>n&&h.length?(d.push(a),u+=s*a,a=v,l=e.topCurrent+f,t.setLayoutStartPosition({x:u+t.layoutOffsetX+p,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),c.push(h),h=[t]):(a=Math.max(a,v),h.push(t))})),d.push(a),c.push(h),wD(c,!0,d,s),i&&xD(c,!0,n),o?e.rightCurrent=u+s*a:e.leftCurrent=u+s*a}}function AD(t,e,n,i){if(t.length){var r=0,a="right"===i,o=a?-1:1,s=a?e.rightCurrent:e.leftCurrent,u=e.bottomCurrent,l=[],c=[],h=[];t.forEach((function(t){var n=e.getItemComputeLayoutRect(t),i=t.computeBoundsInRect(n);t.setLayoutRect(i);var d=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,f=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,v=a?-i.width-t.layoutPaddingRight:t.layoutPaddingLeft;u<d&&c.length?(h.push(r),s+=o*r,r=f,u=e.bottomCurrent,t.setLayoutStartPosition({x:s+t.layoutOffsetX+v,y:u+t.layoutOffsetY-i.height-t.layoutPaddingBottom}),l.push(c),c=[t]):(t.setLayoutStartPosition({x:s+t.layoutOffsetX+v,y:u+t.layoutOffsetY-i.height-t.layoutPaddingBottom}),r=Math.max(r,f),u-=d,c.push(t))})),h.push(r),l.push(c),wD(l,!0,h,o),a?e.rightCurrent=s+o*r:e.leftCurrent=s+o*r}}function TD(t,e,n,i,r){if(t.length){var a="top"===r,o=a?1:-1,s=0,u=e.leftCurrent,l=a?e.topCurrent:e.bottomCurrent,c=[],h=[],d=[];t.forEach((function(t){var i=e.getItemComputeLayoutRect(t),r=t.computeBoundsInRect(i);t.setLayoutRect(r);var f=r.height+t.layoutPaddingTop+t.layoutPaddingBottom,v=r.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=a?t.layoutPaddingTop:-r.height-t.layoutPaddingBottom;t.setLayoutStartPosition({x:u+t.layoutOffsetX+t.layoutPaddingLeft,y:l+t.layoutOffsetY+p}),(u+=v)>n&&h.length?(d.push(s),u=e.leftCurrent+v,l+=o*s,s=f,t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:l+t.layoutOffsetY+p}),c.push(h),h=[t]):(s=Math.max(s,f),h.push(t))})),d.push(s),c.push(h),wD(c,!1,d,o),i&&xD(c,!1,n),a?e.topCurrent=l+o*s:e.bottomCurrent=l+o*s}}function CD(t,e,n,i){if(t.length){var r="top"===i,a=r?1:-1,o=0,s=e.rightCurrent,u=r?e.topCurrent:e.bottomCurrent,l=[],c=[],h=[];t.forEach((function(t){var n=e.getItemComputeLayoutRect(t),i=t.computeBoundsInRect(n);t.setLayoutRect(i);var h=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,d=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,f=r?t.layoutPaddingTop:-i.height-t.layoutPaddingBottom;s<d&&c.length?(s=e.rightCurrent,u+=a*o,o=h,t.setLayoutStartPosition({x:e.rightCurrent+t.layoutOffsetX-i.width-t.layoutPaddingRight,y:u+t.layoutOffsetY+f}),l.push(c),c=[t]):(c.push(t),t.setLayoutStartPosition({x:s+t.layoutOffsetX-i.width-t.layoutPaddingRight,y:u+t.layoutOffsetY+f}),o=Math.max(o,h),s-=d)})),h.push(o),l.push(c),wD(l,!1,h,a),r?e.topCurrent=u+a*o:e.bottomCurrent=u+a*o}}bD.type="region",bD.transformerConstructor=kD,bD.specKey="region";var ED=function(){return u((function t(e,n){o(this,t),this.leftCurrent=0,this.topCurrent=0,this.rightCurrent=0,this.bottomCurrent=0,this._onError=null==n?void 0:n.onError}),[{key:"_layoutInit",value:function(t,e,n,i){this._chartLayoutRect=n,this._chartViewBox=i,this.leftCurrent=n.x,this.topCurrent=n.y,this.rightCurrent=n.x+n.width,this.bottomCurrent=n.height+n.y,e.sort((function(t,e){return e.layoutLevel-t.layoutLevel}))}},{key:"_layoutNormalItems",value:function(t){this.layoutNormalInlineItems(t.filter((function(t){return"normal-inline"===t.layoutType}))),this.layoutNormalItems(t.filter((function(t){return"normal"===t.layoutType})))}},{key:"_groupItems",value:function(t){var e=t.filter((function(t){return"region"===t.layoutType})),n=t.filter((function(t){return"region-relative"===t.layoutType})),i=t.filter((function(t){return"region-relative-overlap"===t.layoutType})),r=n.concat(i),a={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}};return i.forEach((function(t){a[t.layoutOrient].items.push(t)})),{regionItems:e,relativeItems:n,relativeOverlapItems:i,allRelatives:r,overlapItems:a}}},{key:"layoutItems",value:function(t,e,n,i){this._layoutInit(t,e,n,i),this._layoutNormalItems(e);var r={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},a=this._groupItems(e),o=a.regionItems,s=a.relativeItems,u=a.relativeOverlapItems,l=a.allRelatives,c=a.overlapItems;this.layoutRegionItems(o,s,u,c),this._processAutoIndent(o,s,u,c,l,r),this.layoutAbsoluteItems(e.filter((function(t){return"absolute"===t.layoutType})))}},{key:"_processAutoIndent",value:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0;if(r.some((function(t){return t.autoIndent}))){var o=this._checkAutoIndent(r,a),s=o.top,u=o.bottom,l=o.left,c=o.right;(s||u||l||c)&&(this.topCurrent=a.top+s,this.bottomCurrent=a.bottom-u,this.leftCurrent=a.left+l,this.rightCurrent=a.right-c,this.layoutRegionItems(t,e,n,i))}}},{key:"layoutNormalItems",value:function(t){var e=this;t.forEach((function(t){var n=e.getItemComputeLayoutRect(t),i=t.computeBoundsInRect(n);t.setLayoutRect(i),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),e.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"top"===t.layoutOrient?(t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),e.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"right"===t.layoutOrient?(t.setLayoutStartPosition({x:e.rightCurrent+t.layoutOffsetX-i.width-t.layoutPaddingRight,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),e.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"bottom"===t.layoutOrient&&(t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingRight,y:e.bottomCurrent+t.layoutOffsetY-i.height-t.layoutPaddingBottom}),e.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom)}))}},{key:"layoutNormalInlineItems",value:function(t){var e=t.filter((function(t){return"left"===t.layoutOrient})),n=t.filter((function(t){return"right"===t.layoutOrient})),i=t.filter((function(t){return"top"===t.layoutOrient})),r=t.filter((function(t){return"bottom"===t.layoutOrient})),a=this._chartLayoutRect.width+this._chartLayoutRect.x,o=this._chartLayoutRect.height+this._chartLayoutRect.y;e.length&&function(t,e,n){var i=_D(t),r=i.startItems,a=i.middleItems,o=i.endItems;r.length&&SD(r,e,n,!1,"left"),a.length&&SD(a,e,n,!0,"left"),o.length&&AD(o,e,0,"left")}(e,this,o),i.length&&function(t,e,n){var i=_D(t),r=i.startItems,a=i.middleItems,o=i.endItems;r.length&&TD(r,e,n,!1,"top"),a.length&&TD(a,e,n,!0,"top"),o.length&&CD(o,e,0,"top")}(i,this,a),n.length&&function(t,e,n){var i=_D(t),r=i.startItems,a=i.middleItems,o=i.endItems;r.length&&SD(r,e,n,!1,"right"),a.length&&SD(a,e,n,!0,"right"),o.length&&AD(o,e,0,"right")}(n,this,o),r.length&&function(t,e,n){var i=_D(t),r=i.startItems,a=i.middleItems,o=i.endItems;r.length&&TD(r,e,n,!1,"bottom"),a.length&&TD(a,e,n,!0,"bottom"),o.length&&CD(o,e,0,"bottom")}(r,this,a)}},{key:"_layoutRelativeOverlap",value:function(t,e){var n=this;e.items.forEach((function(t){var i=n.getItemComputeLayoutRect(t),r=t.computeBoundsInRect(i);e.rect.width=Math.max(r.width+t.layoutPaddingLeft+t.layoutPaddingRight,e.rect.width),e.rect.height=Math.max(r.height+t.layoutPaddingTop+t.layoutPaddingBottom,e.rect.height)})),e.items.forEach((function(i){i.setLayoutRect(e.rect),"left"===t?i.setLayoutStartPosition({x:n.leftCurrent+i.layoutOffsetX}):"right"===t?i.setLayoutStartPosition({x:n.rightCurrent-e.rect.width+i.layoutOffsetX}):"top"===t?i.setLayoutStartPosition({x:n.topCurrent+i.layoutOffsetY}):i.setLayoutStartPosition({x:n.bottomCurrent-e.rect.height+i.layoutOffsetY})})),"left"===t?this.leftCurrent+=e.rect.width:"right"===t?this.rightCurrent-=e.rect.width:"top"===t?this.topCurrent+=e.rect.height:this.bottomCurrent-=e.rect.height}},{key:"_layoutRelativeItem",value:function(t,e){var n=t.computeBoundsInRect(e);"left"===t.layoutOrient||"right"===t.layoutOrient?t.setLayoutRect({width:n.width}):t.setLayoutRect({height:n.height}),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft}),this.leftCurrent+=n.width+t.layoutPaddingLeft+t.layoutPaddingRight):"right"===t.layoutOrient?(this.rightCurrent-=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX+t.layoutPaddingLeft})):"top"===t.layoutOrient?(t.setLayoutStartPosition({y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=n.height+t.layoutPaddingTop+t.layoutPaddingBottom):"bottom"===t.layoutOrient&&(this.bottomCurrent-=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,t.setLayoutStartPosition({y:this.bottomCurrent+t.layoutOffsetY+t.layoutPaddingTop}))}},{key:"_layoutRegionItem",value:function(t,e,n){var i=this,r=Math.max(Math.min.apply(Math,[e].concat(y(t.map((function(t){var e;return null!==(e=t.maxWidth)&&void 0!==e?e:Number.MAX_VALUE}))))),0),a=Math.max(Math.min.apply(Math,[n].concat(y(t.map((function(t){var e;return null!==(e=t.maxHeight)&&void 0!==e?e:Number.MAX_VALUE}))))),0);return t.forEach((function(t){t.setLayoutRect({width:r,height:a}),t.setLayoutStartPosition({x:i.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:i.topCurrent+t.layoutOffsetY+t.layoutPaddingTop})})),{regionHeight:a,regionWidth:r}}},{key:"layoutRegionItems",value:function(t,e,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},a=(this.rightCurrent,this.leftCurrent),o=(this.bottomCurrent,this.topCurrent);e.filter((function(t){return"left"===t.layoutOrient||"right"===t.layoutOrient})).forEach((function(t){i._layoutRelativeItem(t,i.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("left",r.left),this._layoutRelativeOverlap("right",r.right),a=this.rightCurrent-this.leftCurrent,e.filter((function(t){return"top"===t.layoutOrient||"bottom"===t.layoutOrient})).forEach((function(t){i._layoutRelativeItem(t,i.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("top",r.top),this._layoutRelativeOverlap("bottom",r.bottom),o=this.bottomCurrent-this.topCurrent;var s=this._layoutRegionItem(t,a,o),u=s.regionWidth,l=s.regionHeight;e.concat(n).forEach((function(e){if(["left","right"].includes(e.layoutOrient)){var n=i.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({height:n.getLayoutRect().height}),e.setLayoutStartPosition({y:n.getLayoutStartPoint().y+e.layoutOffsetY+e.layoutPaddingTop}),"right"===e.layoutOrient&&e.setLayoutStartPosition({x:e.getLayoutStartPoint().x+u-a})}else if(["top","bottom"].includes(e.layoutOrient)){var r=i.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({width:r.getLayoutRect().width}),e.setLayoutStartPosition({x:r.getLayoutStartPoint().x+e.layoutOffsetX+e.layoutPaddingLeft}),"bottom"===e.layoutOrient&&e.setLayoutStartPosition({y:e.getLayoutStartPoint().y+l-o})}}))}},{key:"layoutAbsoluteItems",value:function(t){var e=this;t.forEach((function(t){t.absoluteLayoutInRect(e._chartLayoutRect)}))}},{key:"filterRegionsWithID",value:function(t,e){var n,i=t.find((function(t){return t.getModelId()===e}));return i||(null!==(n=this._onError)&&void 0!==n?n:yR)("can not find target region item, invalid id"),i}},{key:"getItemComputeLayoutRect",value:function(t){return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight,height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom}}},{key:"_checkAutoIndent",value:function(t,e){var n=this,i={top:0,left:0,bottom:0,right:0};return t.forEach((function(t){if(t.getModelVisible()&&t.autoIndent){var r="left"===t.layoutOrient||"right"===t.layoutOrient,a=t.getLastComputeOutBounds(),o=n._getOutInLayout(a,t,e);r?(i.top=Math.max(i.top,o.top),i.bottom=Math.max(i.bottom,o.bottom)):(i.left=Math.max(i.left,o.left),i.right=Math.max(i.right,o.right))}})),i}},{key:"_getOutInLayout",value:function(t,e,n){var i=e.getLayoutStartPoint(),r=i.x,a=i.y,o=e.getLayoutRect(),s=o.width,u=o.height;return{left:n.left-(r-t.x1),right:r+s+t.x2-n.right,top:n.top-(a-t.y1),bottom:a+u+t.y2-n.bottom}}}])}();ED.type="base";var RD=["line","area","trail"];function BD(t){return RD.includes(t)}var MD=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[t]))._stateInfoList=[],r._mark=i,r}return c(n,t),u(n,[{key:"getStateInfoList",value:function(){return this._stateInfoList}},{key:"_getDefaultStateMap",value:function(){return{markUpdateRank:1}}},{key:"getStateInfo",value:function(t){return this._stateInfoList.find((function(e){return e.stateValue===t}))}},{key:"addStateInfo",value:function(t){if(!this.getStateInfo(t.stateValue)){t.level=t.level||0;for(var e=!0,n=0;n<this._stateInfoList.length;n++){var i=this._stateInfoList[n].level;if(i&&i>t.level){this._stateInfoList.splice(n,0,t),e=!1;break}}e&&this._stateInfoList.push(t)}}},{key:"_clearStateBeforeSet",value:function(t){t.datums=null,t.items=null,t.fields=null,t.filter=null}},{key:"changeStateInfo",value:function(t){var e=this.getStateInfo(t.stateValue);if(e){if(void 0!==t.datums&&(this._clearStateBeforeSet(e),e.datums=t.datums,e.datumKeys=t.datumKeys),void 0!==t.items&&(this._clearStateBeforeSet(e),e.items=t.items),void 0!==t.fields)if(this._clearStateBeforeSet(e),null===t.fields)e.fields=t.fields;else for(var n in e.fields=e.fields||{},t.fields){var i=t.fields[n];e.fields[n]=e.fields[n]||{};var r=e.fields[n];MC(i.domain)&&(r.domain=i.domain),MC(i.type)&&(r.type=i.type)}t.filter&&(this._clearStateBeforeSet(e),e.filter=t.filter)}else this.addStateInfo(t)}},{key:"clearStateInfo",value:function(t){var e=this;t.forEach((function(t){e.getStateInfo(t)&&e.changeStateInfo({stateValue:t,datumKeys:null,datums:null,fields:null,items:null,filter:null,cache:{}})}))}},{key:"checkOneState",value:function(t,e,n,i){var r;i=EC(BD)?i:!t.mark||BD(t.mark.markType);var a=!1,o=!1;if(MC(n.datums)&&n.datums.length>0)a=this.checkDatumState(n,e,i),o=!0;else if(n.items)a=null!==(r=this.checkItemsState(n,t))&&void 0!==r&&r,o=!0;else if(n.fields)a=this.checkFieldsState(n,e,t,i),o=!0;else if(!a&&n.filter){var s={mark:this._mark,renderNode:t,type:t.mark.markType};a=n.filter(e,s),o=!0}return o?a?"in":"out":"skip"}},{key:"checkState",value:function(t,e){for(var n=t.getStates().filter((function(t){return function(t){return!!aD[t]}(t)})).map((function(t){return[t,10]})),i=!t.mark||BD(t.mark.markType),r=0;r<this._stateInfoList.length;r++){var a=this._stateInfoList[r],o=this.checkOneState(t,e,a,i);"skip"!==o&&"in"===o&&n.push([a.stateValue,a.level])}return n.map((function(t){return t[0]}))}},{key:"checkDatumState",value:function(t,e,n){var i=!1,r=n?e[0]:e;if(DC(t.datums)){var a=t.datumKeys||Object.keys(t.datums[0]).filter((function(t){return!t.startsWith(FB)}));i=t.datums.some((function(t){return n&&DC(null==t?void 0:t.items)?a.every((function(e){var n,i;return(null===(i=null===(n=null==t?void 0:t.items)||void 0===n?void 0:n[0])||void 0===i?void 0:i[e])===(null==r?void 0:r[e])})):a.every((function(e){return(null==t?void 0:t[e])===(null==r?void 0:r[e])}))}))}else i=PC(t.datums)?(t.datumKeys||Object.keys(t.datums).filter((function(t){return!t.startsWith(FB)}))).every((function(e){var i,a;return n?(null===(i=t.datums.items)||void 0===i?void 0:i[0][e])===r[e]:(null===(a=t.datums)||void 0===a?void 0:a[e])===r[e]})):e===t.datums;return i}},{key:"checkItemsState",value:function(t,e){var n;return null===(n=t.items)||void 0===n?void 0:n.includes(e)}},{key:"checkFieldsState",value:function(t,e,n,i){var r,a=this,o=!0,s=function(){var s=t.fields[u],l=s.type,c=s.domain,h=i?null===(r=e[0])||void 0===r?void 0:r[u]:e[u];if(function(t){switch(t){case DR.Linear:case DR.Log:case DR.Pow:case DR.Sqrt:case DR.Symlog:case DR.Time:return!0;default:return!1}}(l)&&c.length>1){if(a.checkLinearFieldState(c,u,e,n,i))return o=!1,0;o=!0}else{if(!c.some((function(t){return t===h})))return o=!1,0;o=!0}};for(var u in t.fields)if(0===s())break;return o}},{key:"checkLinearFieldState",value:function(t,e,n,i,r){var a,o=r?null===(a=n[0])||void 0===a?void 0:a[e]:n[e];return o<t[0]||o>t[t.length-1]}},{key:"updateLayoutState",value:function(t){return this._stateMap.markUpdateRank++,this.updateState({markUpdateRank:this._stateMap.markUpdateRank},t)}},{key:"compileState",value:function(t,e){var n=this;t.state({callback:function(t,e){return n.checkState(e,t)}},e)}}])}(fD),PD=function(t){function n(t,i){var r;return o(this,n),(r=e(this,n,[t])).grammarType=XL.data,r._data=null,r._data=i,r}return c(n,t),u(n,[{key:"getDataView",value:function(){return this._data}},{key:"setDataView",value:function(t){this._data=t}},{key:"getLatestData",value:function(){var t;return null===(t=this._data)||void 0===t?void 0:t.latestData}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this),this._data=null}},{key:"updateData",value:function(t){var e=this.getProduct(),n=this.getLatestData();if(e&&n&&(e.values(n),!t))return this.getCompiler().renderNextTick()}},{key:"_compileProduct",value:function(){var t=this.getLatestData();BC(t)||(BC(this.getProduct())?this._initProduct(t):this._product.values(t))}},{key:"_initProduct",value:function(t){var e,n,i=this.getVGrammarView();if(i&&t){var r=this.getProductId();this._product=null===(n=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.call(i,t))||void 0===n?void 0:n.id(r),this._compiledProductId=r}}},{key:"generateProductId",value:function(){var t;return"".concat(null===(t=this.getDataView())||void 0===t?void 0:t.name)}},{key:"_lookupGrammar",value:function(t){var e,n;return null===(n=null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getDataById)||void 0===n?void 0:n.call(e,t)}}])}(cD),OD=function(t){function n(t){var i;return o(this,n),(i=e(this,n,[t]))._mark=t.mark,i}return c(n,t),u(n,[{key:"setCompiledProductId",value:function(t){this._compiledProductId=t}},{key:"generateProductId",value:function(){var t=p(h(n.prototype),"generateProductId",this).call(this);return MC(t)?t:"".concat(FB,"_markData_").concat(this._mark.id)}},{key:"_compileProduct",value:function(){var t,e=null===(t=this._data)||void 0===t?void 0:t.latestData;BC(e)||MC(this.getProduct())||this._initProduct(e)}}])}(PD),ID=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},LD=function(t){function n(t,i,r){var a;return o(this,n),(a=e(this,n,[t])).grammarType=XL.mark,a.type=void 0,a.name="mark",a._interactive=!0,a._zIndex=iO.Mark,a._visible=!0,a.stateStyle={},a._unCompileChannel={},a._skipBeforeLayouted=!1,a._morph=!1,a.name=i,a.model=r,a.key=t.key,a.state=new MD(Object.assign(Object.assign({},t),{stateKeyToSignalName:a.stateKeyToSignalName.bind(f(a))}),f(a)),a._option.support3d&&a.setSupport3d(!0),a._option.skipTheme&&a.setSkipTheme(!0),a._event=new DL(r.getOption().eventDispatcher,r.getOption().mode),a}return c(n,t),u(n,[{key:"getSkipTheme",value:function(){return this._skipTheme}},{key:"setSkipTheme",value:function(t){this._skipTheme=t}},{key:"getSupport3d",value:function(){return this._support3d}},{key:"setSupport3d",value:function(t){this._support3d=t}},{key:"getFacet",value:function(){return this._facet}},{key:"setFacet",value:function(t){this._facet=t}},{key:"getInteractive",value:function(){return this._interactive}},{key:"setInteractive",value:function(t){this._interactive=t}},{key:"getZIndex",value:function(){return this._zIndex}},{key:"setZIndex",value:function(t){this._zIndex=t}},{key:"getVisible",value:function(){return this._visible}},{key:"setVisible",value:function(t){this._visible=t}},{key:"getUserId",value:function(){return this._userId}},{key:"setUserId",value:function(t){MC(t)&&(this._userId=t)}},{key:"getDataView",value:function(){var t;return null===(t=this._data)||void 0===t?void 0:t.getDataView()}},{key:"setDataView",value:function(t,e){BC(this._data)&&this.initMarkData(Object.assign(Object.assign({},this._option),{mark:this})),MC(e)&&this._data.setCompiledProductId(e),this._data.setDataView(t)}},{key:"getData",value:function(){return this._data}},{key:"setData",value:function(t){this._data=t}},{key:"hasState",value:function(t){return t in this.state.getStateMap()}},{key:"getState",value:function(t){return this.state.getStateMap()[t]}},{key:"getAnimationConfig",value:function(){return this._animationConfig}},{key:"setAnimationConfig",value:function(t){this._animationConfig=t}},{key:"setSkipBeforeLayouted",value:function(t){this._skipBeforeLayouted=t}},{key:"getSkipBeforeLayouted",value:function(){return this._skipBeforeLayouted}},{key:"getMorph",value:function(){return this._morph}},{key:"setMorph",value:function(t){this._morph=t}},{key:"getMorphKey",value:function(){return this._morphKey}},{key:"setMorphKey",value:function(t){this._morphKey=t}},{key:"getMorphElementKey",value:function(){return this._morphElementKey}},{key:"setMorphElementKey",value:function(t){this._morphElementKey=t}},{key:"getGroupKey",value:function(){return this._groupKey}},{key:"setGroupKey",value:function(t){this._groupKey=t}},{key:"getProgressiveConfig",value:function(){return this._progressiveConfig}},{key:"setProgressiveConfig",value:function(t){this._progressiveConfig=t}},{key:"setCustomizedShapeCallback",value:function(t){this._setCustomizedShape=t}},{key:"setEnableSegments",value:function(t){this._enableSegments=t}},{key:"getClip",value:function(){return this._clip}},{key:"setClip",value:function(t){this._clip=t}},{key:"setStateSortCallback",value:function(t){this._stateSort=t}},{key:"setTransform",value:function(t){this._transform=t}},{key:"initMarkData",value:function(t){this._data=new OD(t)}},{key:"stateKeyToSignalName",value:function(t){return"".concat(FB,"_").concat(this.type,"_").concat(this.id,"_").concat(t)}},{key:"getAttribute",value:function(t,e,n,i){}},{key:"_compileProduct",value:function(t){var e=this.getProduct();this.getVisible()?MC(e)||this.getCompiler().isInited&&(this._initProduct(null==t?void 0:t.group),BC(this._product)||(this.compileSignal(),this.compileData(),this.compileState(),this.compileEncode(),this.compileAnimation(),this.compileContext(),this.compileTransform())):MC(e)&&this.removeProduct()}},{key:"_initProduct",value:function(t){var e=this.getVGrammarView(),n=this.getProductId();this._product=e.mark(this.type,null!=t?t:e.rootMark).id(n),this._compiledProductId=n}},{key:"generateProductId",value:function(){return this._userId?"".concat(this._userId):"".concat(this.name,"_").concat(this.id)}},{key:"compileData",value:function(){var t;if(!BC(this._data)){this._data.compile();var e=this._data.getProduct();MC(this._product)&&MC(e)&&this._product.join(e,this.key,void 0,null!==(t=this._groupKey)&&void 0!==t?t:this._facet)}}},{key:"updateStaticEncode",value:function(){if(this._product){var t=this._separateStyle(),e=t.enterStyles,n=t.updateStyles;this._product.encodeState("group",e,!0),this._product.encode(n,!0)}}},{key:"_separateStyle",value:function(){var t=this,e=this.stateStyle,n=ZL.STATE_NORMAL,i=e[n],r=(ID(e,["symbol"==a(n)?n:n+""]),this._option.noSeparateStyle?null:{}),o={};return Object.keys(i).forEach((function(e){t._unCompileChannel[e]||(t._option.noSeparateStyle||function(t,e,n){var i,r=null===(i=e[t])||void 0===i?void 0:i.style;return!!function(t,e){return("fill"===t||"stroke"===t)&&(null==e?void 0:e.gradient)&&(null==e?void 0:e.stops)}(t,r)||!!RC(r)||!(!(null==r?void 0:r.scale)||r.field===n)}(e,i,t.getFacet())?o[e]={callback:t.compileCommonAttributeCallback(e,"normal"),dependency:[t.stateKeyToSignalName("markUpdateRank")]}:r[e]=t.compileCommonAttributeCallback(e,"normal"))})),{enterStyles:r,updateStyles:o}}},{key:"compileEncode",value:function(){var t=this,e=this.stateStyle,n=ZL.STATE_NORMAL,i=(e[n],ID(e,["symbol"==a(n)?n:n+""])),r=this._separateStyle(),o=r.enterStyles,s=r.updateStyles;this._product.encode(s,!0),this._product.encodeState("group",o,!0),Object.keys(i).forEach((function(e){var n={};Object.keys(i[e]).forEach((function(i){t._unCompileChannel[i]||(n[i]={callback:t.compileCommonAttributeCallback(i,e),dependency:[t.stateKeyToSignalName("markUpdateRank")]})})),t._product.encodeState(e,n,!0)})),this._skipBeforeLayouted&&this._product.layout({skipBeforeLayouted:this._skipBeforeLayouted})}},{key:"compileState",value:function(){this.state.compileState(this._product,this._stateSort)}},{key:"compileAnimation",value:function(){var t,e,n,i,r=this;if(this._animationConfig){var a;if("component"===this.type)a=null===(t=this.model.animate)||void 0===t?void 0:t.getAnimationStateSignalName();else{var o=null===(n=(e=this.model).getRegion)||void 0===n?void 0:n.call(e);a=null===(i=null==o?void 0:o.animate)||void 0===i?void 0:i.getAnimationStateSignalName()}this._product.animation(this._animationConfig),this._product.animationState({callback:function(t,e,n){var i;return null===(i=n[a])||void 0===i?void 0:i.callback(t,e)},dependency:a}),this._animationConfig.normal&&(this._animationConfig.appear?this._event.on(LB.ANIMATION_END,(function(t){var e=t.event;e.mark===r.getProduct()&&e.animationState===YL.appear&&r.runAnimationByState(YL.normal)})):this._event.on(LB.AFTER_DO_RENDER,(function(){r.runAnimationByState(YL.normal)})))}}},{key:"compileContext",value:function(){var t={interactive:this.getInteractive(),zIndex:this.getZIndex(),context:{markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},skipTheme:this.getSkipTheme(),support3d:this.getSupport3d(),enableSegments:!!this._enableSegments,clip:!!this._clip||!1!==this._clip&&void 0,clipPath:this._clip||void 0};this._progressiveConfig&&(t.progressiveStep=this._progressiveConfig.progressiveStep,t.progressiveThreshold=this._progressiveConfig.progressiveThreshold,t.large=this._progressiveConfig.large,t.largeThreshold=this._progressiveConfig.largeThreshold),this._morph&&this._morphKey&&(t.morph=this._morph,t.morphKey=this._morphKey,t.morphElementKey=this._morphElementKey),this._setCustomizedShape&&(t.setCustomizedShape=this._setCustomizedShape),this._product.configure(t)}},{key:"compileSignal",value:function(){this.state.compile()}},{key:"_computeAttribute",value:function(t,e){return function(t,e){}}},{key:"compileCommonAttributeCallback",value:function(t,e){var n=this._computeAttribute(t,e),i={mark:null,parent:null,element:null};return function(t,e){return i.mark=e.mark,i.parent=e.mark.group,i.element=e,n(t,i)}}},{key:"compileTransform",value:function(){var t;(null===(t=this._transform)||void 0===t?void 0:t.length)&&this.getProduct().transform(this._transform)}},{key:"_lookupGrammar",value:function(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getMarkById(t)}},{key:"updateState",value:function(t,e){return this.state.updateState(t,e)}},{key:"updateLayoutState",value:function(t,e){return e&&this.getMarks().length>0&&this.getMarks().forEach((function(t){return t.state.updateLayoutState(!0)})),this.state.updateLayoutState(t)}},{key:"updateMarkState",value:function(t){var e=this;if(this._product){var n=this.state.getStateInfo(t);this._product.elements.forEach((function(i){"in"===e.state.checkOneState(i,i.getDatum(),n)?i.addState(t):i.removeState(t)}))}}},{key:"getMarks",value:function(){return[]}},{key:"runAnimationByState",value:function(t){var e,n;return null===(n=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===n?void 0:n.runAnimationByState(t)}},{key:"stopAnimationByState",value:function(t){var e,n;return null===(n=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===n?void 0:n.stopAnimationByState(t)}},{key:"pauseAnimationByState",value:function(t){var e,n;return null===(n=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===n?void 0:n.pauseAnimationByState(t)}},{key:"resumeAnimationByState",value:function(t){var e,n;return null===(n=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===n?void 0:n.resumeAnimationByState(t)}},{key:"getProductElements",value:function(){var t=this.getProduct();if(t)return t.elements}},{key:"release",value:function(){p(h(n.prototype),"release",this).call(this),this.state.release()}}])}(cD),DD=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},jD=function(t){function n(t,i){var r,a;return o(this,n),(r=e(this,n,[i,t,i.model]))._extensionChannel={},r._computeExChannel={},r._attributeContext=i.attributeContext,null===(a=i.map)||void 0===a||a.set(r.id,f(r)),r}return c(n,t),u(n,[{key:"created",value:function(){this._initStyle()}},{key:"initStyleWithSpec",value:function(t,e){t&&(MC(t.id)&&(this._userId=t.id),EC(t.interactive)&&(this._interactive=t.interactive),MC(t.zIndex)&&this.setZIndex(t.zIndex),EC(t.visible)&&this.setVisible(t.visible),this._initSpecStyle(t,this.stateStyle,e))}},{key:"_transformStyleValue",value:function(t,e){if(t.scale){var n=t.scale,i=n.range();return n.range(i.map(e)),t}return"function"==typeof t?function(){return e(t.apply(void 0,arguments))}:e(t)}},{key:"convertAngleToRadian",value:function(t){return this._transformStyleValue(t,PE)}},{key:"isUserLevel",value:function(t){return[nO.User_Mark,nO.User_Series,nO.User_Chart].includes(t)}},{key:"setStyle",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.stateStyle;if(!BC(t)){void 0===r[n]&&(r[n]={});var a=this.isUserLevel(i);Object.keys(t).forEach((function(o){var s=t[o];BC(s)||(s=e._filterAttribute(o,s,n,i,a,r),e.setAttribute(o,s,n,i,r))}))}}},{key:"getStyle",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"normal";return null===(e=this.stateStyle[n][t])||void 0===e?void 0:e.style}},{key:"_filterAttribute",value:function(t,e,n,i,r){arguments.length>5&&void 0!==arguments[5]||this.stateStyle;var a=this._styleConvert(e);if(r)switch(t){case"angle":a=this.convertAngleToRadian(a);break;case"innerPadding":case"outerPadding":a=this._transformStyleValue(a,(function(t){return-t}))}return a}},{key:"setReferer",value:function(t,e,n){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.stateStyle;if(t)if(e&&n){var a=null!==(i=r[n])&&void 0!==i?i:l({},e,{});r[n][e]=Object.assign(Object.assign({},a[e]),{referer:t})}else Object.entries(r).forEach((function(e){var n=g(e,2),i=n[0],a=n[1];Object.entries(a).forEach((function(e){var n=g(e,2),a=n[0];n[1],r[i][a].referer=t}))}))}},{key:"setPostProcess",value:function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal";(null===(n=this.stateStyle[i])||void 0===n?void 0:n[t])&&(this.stateStyle[i][t].postProcess=e)}},{key:"getAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",i=arguments.length>3?arguments[3]:void 0;return this._computeAttribute(t,n)(e,i)}},{key:"setAttribute",value:function(t,e){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"normal",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.stateStyle;void 0===a[i]&&(a[i]={}),void 0===a[i][t]&&(a[i][t]={level:r,style:e,referer:void 0});var o=null===(n=a[i][t])||void 0===n?void 0:n.level;MC(o)&&o<=r&&$I(a[i][t],{style:e,level:r}),"normal"!==i&&t in this._extensionChannel&&this._extensionChannel[t].forEach((function(t){void 0===a[i][t]&&(a[i][t]=a.normal[t])}))}},{key:"_getDefaultStyle",value:function(){return{visible:!0,x:0,y:0}}},{key:"_styleConvert",value:function(t){if(!t)return t;if(GR(t.type)||t.scale){var e=AI(t,{globalScale:this._option.globalScale,seriesId:this._option.seriesId});if(e)return{scale:e,field:t.field,changeDomain:t.changeDomain}}return t}},{key:"_computeAttribute",value:function(t,e){var n,i=this,r=null===(n=this.stateStyle[e])||void 0===n?void 0:n[t];r||(r=this.stateStyle.normal[t]);var a=this._computeStateAttribute(r,t,e),o=RC(null==r?void 0:r.postProcess),s=t in this._computeExChannel;if(o&&s){var u=this._computeExChannel[t];return function(n,o){var s=a(n,o);return s=r.postProcess(s,n,i._attributeContext,o,i.getDataView()),u(t,n,e,o,s)}}if(o)return function(t,e){return r.postProcess(a(t,e),t,i._attributeContext,e,i.getDataView())};if(s){var l=this._computeExChannel[t];return function(n,i){return l(t,n,e,i,a(n,i))}}return a}},{key:"_computeStateAttribute",value:function(t,e,n){var i,r=this;return t?t.referer?t.referer._computeAttribute(e,n):t.style?"function"==typeof t.style?function(e,n){return t.style(e,r._attributeContext,n,r.getDataView())}:MO.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):GR(null===(i=t.style.scale)||void 0===i?void 0:i.type)?function(e,n){return t.style.scale.scale(e[t.style.field])}:function(e,n){return t.style}:function(e,n){return t.style}:function(t,e){}}},{key:"_initStyle",value:function(){var t=this._getDefaultStyle();this.setStyle(t,"normal",0)}},{key:"_initSpecStyle",value:function(t,e,n){var i=this;t.style&&this.setStyle(t.style,"normal",nO.User_Mark,e);var r=t.state;r&&Object.keys(r).forEach((function(t){var n=r[t];if("style"in n){var a=n.style,o={stateValue:t};"level"in n&&(o.level=n.level),"filter"in n&&(o=RC(n.filter)?Object.assign({filter:n.filter},o):Object.assign(Object.assign({},n.filter),o)),i.state.addStateInfo(o),i.setStyle(a,t,nO.User_Mark,e)}else i.setStyle(n,t,nO.User_Mark,e)}))}},{key:"_computeGradientAttr",value:function(t){var e,n,i=this,r=t.gradient,a=t.scale,o=t.field,s=DD(t,["gradient","scale","field"]),u=a,l=o;if(!(a&&o||"series"!==this.model.modelType)){var c=this.model.getColorAttribute(),h=c.scale,d=c.field;a||(u=h),l||(l=d)}var f=mI(yI(this.model.getColorScheme(),"series"===this.model.modelType?null===(n=(e=this.model).getSpec)||void 0===n?void 0:n.call(e):void 0),this.model.getDefaultColorDomain()),v=Object.assign(Object.assign({},PO[r]),s);return function(t,e){var n={},a=i.getDataView();return Object.keys(v).forEach((function(r){var o=v[r];"stops"===r?n.stops=o.map((function(n){var r=n.opacity,o=n.color,s=n.offset,c=null!=o?o:null==u?void 0:u.scale(t[l]);return RC(o)&&(c=o(t,i._attributeContext,e,a)),MC(r)&&(c=UE.SetOpacity(c,r)),{offset:RC(s)?s(t,i._attributeContext,e,a):s,color:c||f[0]}})):RC(o)?n[r]=o(t,i._attributeContext,e,a):n[r]=o})),n.gradient=r,n}}},{key:"_computeBorderAttr",value:function(t){var e=this,n=t.scale,i=t.field,r=DD(t,["scale","field"]);return function(t,a){var o,s,u,l={};if(Object.keys(r).forEach((function(n){var i=r[n];RC(i)?l[n]=i(t,e._attributeContext,a,e.getDataView()):l[n]=i})),"stroke"in l)MO.includes(null===(u=r.stroke)||void 0===u?void 0:u.gradient)&&(l.stroke=e._computeGradientAttr(r.stroke)(t,a));else{var c=mI(yI(e.model.getColorScheme(),"series"===e.model.modelType?null===(s=(o=e.model).getSpec)||void 0===s?void 0:s.call(o):void 0),e.model.getDefaultColorDomain()),h=n,d=i;if(!(n&&i||"series"!==e.model.modelType)){var f=e.model.getColorAttribute(),v=f.scale,p=f.field;n||(h=v),d||(d=p),l.stroke=(null==h?void 0:h.scale(t[d]))||c[0]}}return l}}}])}(LD),FD=function(t){function n(){var t;return o(this,n),(t=e(this,n,arguments)).type=n.type,t._marks=[],t}return c(n,t),u(n,[{key:"getMarks",value:function(){return this._marks}},{key:"_getDefaultStyle",value:function(){return Object.assign({},p(h(n.prototype),"_getDefaultStyle",this).call(this))}},{key:"isMarkExist",value:function(t){return void 0!==this._marks.find((function(e){return e.id===t.id||e.name===t.name}))}},{key:"addMark",value:function(t){return this.isMarkExist(t)?(gR("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}},{key:"removeMark",value:function(t){var e=this._marks.findIndex((function(e){return e.id===t.id||e.name===t.name}));return-1===e?(gR("Mark does not exists, removeMark failed."),!1):(this._marks.splice(e,1),!0)}},{key:"getMarkInType",value:function(t){return this._marks.filter((function(e){return e.type===t}))}},{key:"getMarkInId",value:function(t){return this._marks.find((function(e){return e.id===t}))}},{key:"getMarkInName",value:function(t){return this._marks.find((function(e){return e.name===t}))}},{key:"_compileProduct",value:function(t){var e=this;p(h(n.prototype),"_compileProduct",this).call(this,t),this._product.configure({zIndex:this.getZIndex()}),(null==t?void 0:t.ignoreChildren)||this.getMarks().forEach((function(t){t.getProduct()&&t.removeProduct(),t.compile({group:e._product})}))}}])}(jD);FD.type="group";var ND={measureText:function(t,e,n,i){return yL(e,n,i).measure(t)}},GD=function(){function t(){o(this,t),this.functions={}}return u(t,[{key:"registerFunction",value:function(t,e){t&&e&&(this.functions[t]=e)}},{key:"unregisterFunction",value:function(t){t&&delete this.functions[t]}},{key:"getFunction",value:function(t){return this.functions[t]||null}},{key:"getFunctionNameList",value:function(){return Object.keys(this.functions)}}],[{key:"instance",value:function(){return t.instance_||(t.instance_=new t),t.instance_}}])}(),zD=function(){return u((function t(){o(this,t),this.id=SR(),this._plugins=[]}),[{key:"add",value:function(t){var e=this;if(!t||0===t.length)return null;var n=[];return t.forEach((function(t){e._plugins.find((function(e){return e.id===t.id}))?gR("不要重复添加相同的plugin"):(e._plugins.push(t),n.push(t),t.onAdd&&t.onAdd(e))})),n}},{key:"load",value:function(t){var e=this.add(t);e&&e.length&&this.activate(t)}},{key:"activate",value:function(t){t.length&&t.forEach((function(t){t.init&&t.init()}))}},{key:"get",value:function(t){return this._plugins.find((function(e){return e.id===t}))}},{key:"getAll",value:function(){return this._plugins.slice()}},{key:"release",value:function(t){var e=this.get(t);e&&(e.release(this),this._plugins=this._plugins.filter((function(t){return t!==e})))}},{key:"releaseAll",value:function(){var t=this;this._plugins.forEach((function(e){e.release(t)})),this._plugins=[]}},{key:"clear",value:function(t){var e=this.get(t);e&&e.clear(this)}},{key:"clearAll",value:function(){var t=this;this._plugins.forEach((function(e){var n;null===(n=e.clear)||void 0===n||n.call(e,t)}))}}])}(),UD=function(t){function n(t){var i;return o(this,n),(i=e(this,n)).globalInstance=t,i}return c(n,t),u(n,[{key:"onInit",value:function(t){var e=this;this._plugins.forEach((function(n){n.onInit&&n.onInit(e,t)}))}},{key:"onBeforeResize",value:function(t,e){var n=this;this._plugins.forEach((function(i){i.onBeforeResize&&i.onBeforeResize(n,t,e)}))}},{key:"onAfterChartSpecTransform",value:function(t,e){var n=this;this._plugins.forEach((function(i){i.onAfterChartSpecTransform&&i.onAfterChartSpecTransform(n,t,e)}))}},{key:"onBeforeInitChart",value:function(t,e){var n=this;this._plugins.forEach((function(i){i.onBeforeInitChart&&i.onBeforeInitChart(n,t,e)}))}},{key:"releaseAll",value:function(){p(h(n.prototype),"releaseAll",this).call(this),this.globalInstance=null}}])}(zD),WD=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{u(i.next(t))}catch(t){a(t)}}function s(t){try{u(i.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}u((i=i.apply(t,e||[])).next())}))},VD=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n},HD=function(){function t(e,n){var i,r,a,s,u,l,c,h=this;o(this,t),this.id=SR(),this._userEvents=[],this._autoSize=!0,this._option={mode:SC["desktop-browser"],onError:function(t){throw new Error(t)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._onResize=wE((function(){h._doResize()}),100),this._option=QC(this._option,{animation:!1!==e.animation},n),this._onError=null===(i=this._option)||void 0===i?void 0:i.onError;var d=this._option,f=d.dom,v=d.renderCanvas,p=d.mode,g=d.stage,y=d.poptip,m=VD(d,["dom","renderCanvas","mode","stage","poptip"]),k=bR(p);k&&f&&(this._container=LC(f)?null===document||void 0===document?void 0:document.getElementById(f):f),v&&(this._canvas=v),g&&(this._stage=g),"node"===p||this._container||this._canvas||this._stage?(k?wb(Hi):"node"===p&&Ux(Hi),this._viewBox=this._option.viewBox,this._currentThemeName=fL.getCurrentThemeName(),this._setNewSpec(e),this._updateCurrentTheme(),this._currentSize=this.getCurrentSize(),this._compiler=new $L({dom:null!==(a=this._container)&&void 0!==a?a:"none",canvas:v},Object.assign(Object.assign({mode:this._option.mode,stage:g,pluginList:!1!==y?["poptipForText"]:[]},m),{background:this._getBackground(),onError:this._onError})),this._compiler.setSize(this._currentSize.width,this._currentSize.height),this._eventDispatcher=new NL(this,this._compiler),this._event=new DL(this._eventDispatcher,p),this._compiler.initView(),null===(s=this.getStage())||void 0===s||s.setTheme({text:{fontFamily:null===(u=this._currentTheme)||void 0===u?void 0:u.fontFamily}}),this._initDataSet(this._option.dataSet),this._autoSize=!!k&&(null===(c=null!==(l=e.autoFit)&&void 0!==l?l:this._option.autoFit)||void 0===c||c),this._bindResizeEvent(),this._bindVGrammarViewEvent(),this._initChartPlugin(),dL.registerInstance(this)):null===(r=this._option)||void 0===r||r.onError("please specify container or renderCanvas!")}return u(t,[{key:"getSpec",value:function(){return this._spec}},{key:"getSpecInfo",value:function(){return this._specInfo}},{key:"getDataSet",value:function(){return this._dataSet}},{key:"_setNewSpec",value:function(t,e){return!!t&&(LC(t)&&(t=JSON.parse(t)),e&&this._originalSpec&&(t=$I({},this._originalSpec,t)),this._originalSpec=t,this._spec=this._getSpecFromOriginalSpec(),!0)}},{key:"_getSpecFromOriginalSpec",value:function(){var t,e=pL(this._originalSpec);return e.data=null!==(t=e.data)&&void 0!==t?t:[],e}},{key:"_initChartSpec",value:function(e,n){var i,r;t.getFunctionList()&&t.getFunctionList().length&&(e=gL(e,t)),this._spec=e,this._chartSpecTransformer||(this._chartSpecTransformer=mL.createChartSpecTransformer(this._spec.type,this._getChartOption(this._spec.type))),null===(i=this._chartSpecTransformer)||void 0===i||i.transformSpec(this._spec),this._chartPluginApply("onAfterChartSpecTransform",this._spec,n),this._specInfo=null===(r=this._chartSpecTransformer)||void 0===r?void 0:r.transformModelSpec(this._spec),this._chartPluginApply("onAfterModelSpecTransform",this._spec,this._specInfo,n)}},{key:"_updateSpecInfo",value:function(){var t;this._chartSpecTransformer||(this._chartSpecTransformer=mL.createChartSpecTransformer(this._spec.type,this._getChartOption(this._spec.type))),this._specInfo=null===(t=this._chartSpecTransformer)||void 0===t?void 0:t.createSpecInfo(this._spec)}},{key:"_initChart",value:function(t){var e,n,i;if(this._compiler)if(this._chart)null===(n=this._option)||void 0===n||n.onError("chart is already initialized");else{var r=mL.createChart(t.type,t,this._getChartOption(t.type));r?(this._chart=r,this._chart.setCanvasRect(this._currentSize.width,this._currentSize.height),this._chart.created(),this._chart.init(),this._event.emit(QP.initialized,{chart:r,vchart:this})):null===(i=this._option)||void 0===i||i.onError("init chart fail")}else null===(e=this._option)||void 0===e||e.onError("compiler is not initialized")}},{key:"_releaseData",value:function(){this._dataSet&&(this._dataSet.dataViewMap={},this._dataSet=null)}},{key:"_bindVGrammarViewEvent",value:function(){var t=this;this._compiler&&(this._compiler.getVGrammarView().addEventListener(LB.ALL_ANIMATION_END,(function(){t._event.emit(QP.animationFinished,{chart:t._chart,vchart:t})})),this._compiler.getVGrammarView().addEventListener(LB.AFTER_VRENDER_NEXT_RENDER,(function(){t._event.emit(QP.renderFinished,{chart:t._chart,vchart:t})})))}},{key:"_bindResizeEvent",value:function(){var t;if(this._autoSize){if(this._container){var e=window.ResizeObserver;e&&(this._observer=new e(this._onResize),null===(t=this._observer)||void 0===t||t.observe(this._container))}window.addEventListener("resize",this._onResize)}}},{key:"_unBindResizeEvent",value:function(){this._autoSize&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}},{key:"getCurrentSize",value:function(){var t,e,n,i;return function(t,e,n){var i,r=t.width,a=t.height;if(MC(r)&&MC(a))return{width:r,height:a};var o=n.width,s=n.height,u=e.container,l=e.canvas;if(u){var c=VE(u,n.width,n.height);o=c.width,s=c.height}else if(l&&bR(e.mode)){var h=VE(LC(l)?null===document||void 0===document?void 0:document.getElementById(l):l,n.width,n.height);o=h.width,s=h.height}else if(xR(e.mode)&&(null===(i=e.modeParams)||void 0===i?void 0:i.domref)){var d=e.modeParams.domref;o=d.width,s=d.height}return{width:o=null!=r?r:o,height:s=null!=a?a:s}}(this._spec,{container:this._container,canvas:this._canvas,mode:this._getMode(),modeParams:this._option.modeParams},{width:null!==(e=null===(t=this._currentSize)||void 0===t?void 0:t.width)&&void 0!==e?e:500,height:null!==(i=null===(n=this._currentSize)||void 0===n?void 0:n.height)&&void 0!==i?i:500})}},{key:"_doResize",value:function(){var t=this.getCurrentSize(),e=t.width,n=t.height;this._currentSize.width===e&&this._currentSize.height===n||(this._currentSize={width:e,height:n},this.resizeSync(e,n))}},{key:"_initDataSet",value:function(t){for(var e in this._dataSet=t instanceof fR?t:new fR,zL(this._dataSet,"dataview",cR),zL(this._dataSet,"array",TC),GL(this._dataSet,"stackSplit",KL),GL(this._dataSet,"copyDataView",HL),mL.transforms)GL(this._dataSet,e,mL.transforms[e]);for(var n in mL.dataParser)zL(this._dataSet,n,mL.dataParser[n])}},{key:"updateCustomConfigAndRerender",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this._isReleased&&t)return RC(t)&&(t=t()),this._reCompile(t),e?this._renderSync(n):this._renderAsync(n)}},{key:"_updateCustomConfigAndRecompile",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!t&&(this._reCompile(t),this._beforeRender(e))}},{key:"_reCompile",value:function(t,e){var n,i,r,a,o,s,u=this;if(t.reMake)this._releaseData(),this._initDataSet(),this._chartSpecTransformer=null,null===(n=this._chart)||void 0===n||n.release(),this._chart=null,null===(i=this._compiler)||void 0===i||i.releaseGrammar(!1===(null===(r=this._option)||void 0===r?void 0:r.animation)||!1===(null===(a=this._spec)||void 0===a?void 0:a.animation)),this._userEvents.forEach((function(t){var e;return null===(e=u._event)||void 0===e?void 0:e.on(t.eType,t.query,t.handler)})),t.reSize&&this._doResize();else if(t.reCompile&&(null===(o=this._compiler)||void 0===o||o.clear({chart:this._chart,vChart:this},!this._option.animation||!this._spec.animation),null===(s=this._compiler)||void 0===s||s.compile({chart:this._chart,vChart:this},{})),t.reSize){var l=this.getCurrentSize(),c=l.width,h=l.height;this._chart.onResize(c,h,!1),this._compiler.resize(c,h,!1)}}},{key:"_beforeRender",value:function(){var t,e,n,i,r,a,o,s,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._isReleased)return!1;if(this._chart)return!0;var l=u.transformSpec,c=u.actionSource;return l&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,c),null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeInitializeChart)||void 0===e||e.call(t),this._initChart(this._spec),null===(i=null===(n=this._option.performanceHook)||void 0===n?void 0:n.afterInitializeChart)||void 0===i||i.call(n),!(!this._chart||!this._compiler||(null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.beforeCompileToVGrammar)||void 0===a||a.call(r),this._compiler.compile({chart:this._chart,vChart:this},{performanceHook:this._option.performanceHook}),null===(s=null===(o=this._option.performanceHook)||void 0===o?void 0:o.afterCompileToVGrammar)||void 0===s||s.call(o),0))}},{key:"_afterRender",value:function(){return!this._isReleased&&(this._updateAnimateState(),this._event.emit(QP.rendered,{chart:this._chart,vchart:this}),!0)}},{key:"renderSync",value:function(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}},{key:"renderAsync",value:function(t){return WD(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"}));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_renderSync",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._beforeRender(e)?(null===(t=this._compiler)||void 0===t||t.render(e.morphConfig),this._afterRender(),this):this}},{key:"_renderAsync",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return WD(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._renderSync(t));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"_updateAnimateState",value:function(){var t,e;this._option.animation&&(null===(t=this._chart)||void 0===t||t.getAllRegions().forEach((function(t){var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(YL.update,!0)})),null===(e=this._chart)||void 0===e||e.getAllComponents().forEach((function(t){var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(YL.update,!0)})))}},{key:"release",value:function(){var t,e,n,i;(null===(t=this._onResize)||void 0===t?void 0:t.cancel)&&this._onResize.cancel(),this._chartPluginApply("releaseAll"),this._chartPlugin=null,this._chartSpecTransformer=null,null===(e=this._chart)||void 0===e||e.release(),null===(n=this._eventDispatcher)||void 0===n||n.release(),null===(i=this._compiler)||void 0===i||i.release(),this._unBindResizeEvent(),this._releaseData(),this._onError=null,this._onResize=null,this._container=null,this._currentTheme=null,this._option=null,this._chart=null,this._compiler=null,this._spec=null,this._specInfo=null,this._originalSpec=null,this._userEvents=null,this._event=null,this._eventDispatcher=null,this._isReleased=!0,dL.unregisterInstance(this)}},{key:"updateData",value:function(t,e,n){return WD(this,void 0,void 0,i().mark((function r(){return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",this.updateDataSync(t,e,n));case 1:case"end":return i.stop()}}),r,this)})))}},{key:"_updateDataById",value:function(t,e,n){var i=this._spec.data.find((function(e){return e.name===t||e.id===t}));i?i.id===t?i.values=e:i.name===t&&i.parse(e,n):DC(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e)}},{key:"updateDataInBatches",value:function(t){return WD(this,void 0,void 0,i().mark((function e(){var n=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._chart?(this._chart.updateFullData(t.map((function(t){return{id:t.id,values:t.data,parser:t.options}}))),this._chart.updateGlobalScaleDomain(),this._compiler.render(),this):(this._spec.data=aE(this._spec.data),t.forEach((function(t){var e=t.id,i=t.data,r=t.options;n._updateDataById(e,i,r)})),this));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"updateDataSync",value:function(t,e,n){return BC(this._dataSet)?this:this._chart?(this._chart.updateData(t,e,!0,n),this._compiler.render(),this):(this._spec.data=aE(this._spec.data),this._updateDataById(t,e,n),this)}},{key:"updateFullDataSync",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._chart)return this._chart.updateFullData(t),n&&this._compiler.render(),this;var i=aE(this._spec.data);return aE(t).forEach((function(t){var n,r=t.id,a=t.values,o=t.parser,s=t.fields,u=i.find((function(t){return t.name===r}));if(u)u instanceof pR?(u.setFields(qC(s)),u.parse(a,qC(o))):(u.values=a,MC(o)&&(u.parser=o),MC(s)&&(u.fields=s));else{var l=function(t,e){var n,i,r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t instanceof pR)return t;var s,u=t.id,l=t.values,c=void 0===l?[]:l,h=t.fromDataIndex,d=t.fromDataId,f=t.transforms,v=void 0===f?[]:f,p=t.parser?qC(t.parser):{clone:!0},g=qC(t.fields);p.clone=!(!1===p.clone);var y=a.find((function(t){return t.name===u}));if(y)s=y;else{var m={name:u};if(g&&(m.fields=g),s=new pR(e,m),"string"==typeof d){var k=a.find((function(t){return t.name===d}));if(!k)return(null!==(n=o.onError)&&void 0!==n?n:yR)("no data matches fromDataId ".concat(d)),null;s.parse([k],{type:"dataview"}),s.transform({type:"copyDataView"})}else if("number"==typeof h){var b=a[h];if(!b)return(null!==(i=o.onError)&&void 0!==i?i:yR)("no data matches fromDataIndex ".concat(h)),null;s.parse([b],{type:"dataview"}),s.transform({type:"copyDataView"})}else Array.isArray(c)?s.parse(c,p):!LC(c)||p&&!["csv","dsv","tsv"].includes(p.type)?(s.parse([]),gR("values should be array")):s.parse(c,null!==(r=p)&&void 0!==r?r:{type:"csv"});v&&v.length&&v.forEach((function(t){e.getTransform(t.type)&&s.transform(t)}))}return s}(t,e._dataSet,i,{onError:null===(n=e._option)||void 0===n?void 0:n.onError});DC(e._spec.data)&&e._spec.data.push(l)}})),this}},{key:"updateFullData",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return WD(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.updateFullDataSync(t,e));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"updateSpec",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return WD(this,void 0,void 0,i().mark((function r(){var a;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!(a=this._updateSpec(t,e))){i.next=7;break}return i.next=4,this.updateCustomConfigAndRerender(a,!1,{morphConfig:n,transformSpec:a.reTransformSpec,actionSource:"updateSpec"});case 4:i.t0=this,i.next=8;break;case 7:i.t0=this;case 8:return i.abrupt("return",i.t0);case 9:case"end":return i.stop()}}),r,this)})))}},{key:"updateSpecSync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=this._updateSpec(t,e);return i?(this.updateCustomConfigAndRerender(i,!0,{morphConfig:n,transformSpec:i.reTransformSpec,actionSource:"updateSpec"}),this):this}},{key:"updateSpecAndRecompile",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(i,Object.assign({actionSource:"updateSpecAndRecompile"},n))}},{key:"_updateSpec",value:function(t){var e,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this._spec;if(this._setNewSpec(t,i)){nE(r.theme,this._spec.theme)||this._setCurrentTheme();var a=this._shouldChartResize(r);return null===(n=null===(e=this._compiler)||void 0===e?void 0:e.getVGrammarView())||void 0===n||n.updateLayoutTag(),this._spec.type!==r.type?{reTransformSpec:!0,change:!0,reMake:!0,reCompile:!1,reSize:a}:(this._initChartSpec(this._spec,"render"),function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=function(e){return n.reduce((function(t,n){return t||(null==n?void 0:n[e])}),t[e])};return Object.assign(t,{change:r("change"),reCompile:r("reCompile"),reMake:r("reMake"),reRender:r("reRender"),reSize:r("reSize"),reTransformSpec:r("reTransformSpec")}),t}(this._chart.updateSpec(this._spec),{reTransformSpec:!1,change:a,reMake:!1,reCompile:!1,reSize:a}))}}},{key:"updateModelSpec",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;return WD(this,void 0,void 0,i().mark((function a(){var o;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(e&&this._spec){i.next=2;break}return i.abrupt("return",this);case 2:if(LC(e)&&(e=JSON.parse(e)),RC(t)||QI(this._spec,t,e,n),!this._chart){i.next=6;break}if(!(o=this._chart.getModelInFilter(t))){i.next=6;break}return i.abrupt("return",this._updateModelSpec(o,e,!1,n,r));case 6:return i.abrupt("return",this);case 7:case"end":return i.stop()}}),a,this)})))}},{key:"updateModelSpecSync",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;if(!e||!this._spec)return this;if(LC(e)&&(e=JSON.parse(e)),RC(t)||QI(this._spec,t,e,n),this._chart){var r=this._chart.getModelInFilter(t);if(r)return this._updateModelSpec(r,e,!0,n,i)}return this}},{key:"_updateModelSpec",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>4?arguments[4]:void 0;arguments.length>3&&void 0!==arguments[3]&&arguments[3]&&(e=$I({},t.getSpec(),e));var r=t.updateSpec(e);return t.reInit(e),(r.change||r.reCompile||r.reMake||r.reSize||r.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(r,n,{morphConfig:i,transformSpec:!1,actionSource:"updateModelSpec"})}},{key:"resize",value:function(t,e){return WD(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.resizeSync(t,e));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"resizeSync",value:function(t,e){var n,i;return this._beforeResize(t,e)?(null===(i=(n=this._compiler).resize)||void 0===i||i.call(n,t,e),this._afterResize()):this}},{key:"_beforeResize",value:function(t,e){var n,i,r,a;if(!this._chart||!this._compiler)return!1;var o=this._chart.getCanvasRect();return!(o&&o.width===t&&o.height===e||(this._chartPluginApply("onBeforeResize",t,e),null===(i=null===(n=this._option.performanceHook)||void 0===n?void 0:n.beforeResizeWithUpdate)||void 0===i||i.call(n),this._chart.onResize(t,e,!1),null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.afterResizeWithUpdate)||void 0===a||a.call(r),0))}},{key:"_afterResize",value:function(){return this._isReleased||this._event.emit(QP.afterResize,{chart:this._chart}),this}},{key:"updateViewBox",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return this._chart&&this._compiler?(this._viewBox=t,this._chart.updateViewBox(t,n),n&&(this._compiler.render(),this._chart.onEvaluateEnd()),this._compiler.updateViewBox(t,e),this):this}},{key:"on",value:function(t,e,n){var i;this._userEvents&&(this._userEvents.push({eType:t,query:"function"==typeof e?null:e,handler:"function"==typeof e?e:n}),null===(i=this._event)||void 0===i||i.on(t,e,n))}},{key:"off",value:function(t,e){var n,i=this;if(this._userEvents&&0!==this._userEvents.length)if(e){var r=this._userEvents.findIndex((function(n){return n.eType===t&&n.handler===e}));r>=0&&(this._userEvents.splice(r,1),null===(n=this._event)||void 0===n||n.off(t,e))}else this._userEvents.forEach((function(e){var n;e.eType===t&&(null===(n=i._event)||void 0===n||n.off(t,e.handler))})),this._userEvents=this._userEvents.filter((function(e){return e.eType!==t}))}},{key:"updateState",value:function(t,e){this._chart&&this._chart.updateState(t,e)}},{key:"setSelected",value:function(t,e,n){this._chart&&this._chart.setSelected(t,e,n)}},{key:"setHovered",value:function(t,e,n){this._chart&&this._chart.setHovered(t,e,n)}},{key:"clearState",value:function(t){this._chart&&this._chart.clearState(t)}},{key:"clearSelected",value:function(){this._chart&&this._chart.clearSelected()}},{key:"clearHovered",value:function(){this._chart&&this._chart.clearHovered()}},{key:"_updateCurrentTheme",value:function(t){var e,n,i,r=this._option.theme,a=null===(e=this._spec)||void 0===e?void 0:e.theme;if(t&&(this._currentThemeName=t),HC(r)&&HC(a))this._currentTheme=vL(this._currentThemeName,!0);else if(LC(r)&&(!a||LC(a))||LC(a)&&(!r||LC(r))){var o=tL({},vL(this._currentThemeName,!0),vL(r,!0),vL(a,!0));this._currentTheme=o}else{var s=tL({},vL(this._currentThemeName),vL(r),vL(a));this._currentTheme=iL(s)}i=YC(this._currentTheme,"component.poptip"),It(FR.poptip,jR,i),null===(n=this._compiler)||void 0===n||n.setBackground(this._getBackground())}},{key:"_shouldChartResize",value:function(t){var e,n,i=!1;BC(this._spec.width)?!BC(t.width)&&(this._spec.width=t.width):this._spec.width!==t.width&&(i=!0),BC(this._spec.height)?!BC(t.height)&&(this._spec.height=t.height):this._spec.height!==t.height&&(i=!0);var r=this._autoSize;return this._autoSize=!!bR(this._option.mode)&&(null===(n=null!==(e=this._spec.autoFit)&&void 0!==e?e:this._option.autoFit)||void 0===n||n),this._autoSize!==r&&(i=!0),i}},{key:"_getBackground",value:function(){return("string"==typeof this._spec.background?this._spec.background:null)||this._currentTheme.background||this._option.background}},{key:"getCurrentTheme",value:function(){return vL(this._currentThemeName)}},{key:"getCurrentThemeName",value:function(){return this._currentThemeName}},{key:"setCurrentTheme",value:function(t){return WD(this,void 0,void 0,i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(fL.themeExist(t)){e.next=2;break}return e.abrupt("return",this);case 2:return n=this._setCurrentTheme(t),e.next=5,this.updateCustomConfigAndRerender(n,!1,{transformSpec:!1,actionSource:"setCurrentTheme"});case 5:return e.abrupt("return",this);case 6:case"end":return e.stop()}}),e,this)})))}},{key:"setCurrentThemeSync",value:function(t){if(!fL.themeExist(t))return this;var e=this._setCurrentTheme(t);return this.updateCustomConfigAndRerender(e,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}},{key:"_setCurrentTheme",value:function(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),null===(e=this._chart)||void 0===e||e.setCurrentTheme(),{change:!0,reMake:!1}}},{key:"_getTooltipComponent",value:function(){var t;return null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(AC.tooltip)[0]}},{key:"setTooltipHandler",value:function(t){var e,n;this._context.tooltipHandler=t;var i=this._getTooltipComponent();i&&(null===(n=null===(e=i.tooltipHandler)||void 0===e?void 0:e.release)||void 0===n||n.call(e),i.tooltipHandler=t)}},{key:"getTooltipHandlerByUser",value:function(){var t;return null===(t=this._context)||void 0===t?void 0:t.tooltipHandler}},{key:"getTooltipHandler",value:function(){var t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}},{key:"showTooltip",value:function(t,e){var n,i=this._getTooltipComponent();return null!==(n=MC(t)&&"none"!==(null==i?void 0:i.showTooltip(t,e)))&&void 0!==n&&n}},{key:"hideTooltip",value:function(){var t,e=this._getTooltipComponent();return null!==(t=null==e?void 0:e.hideTooltip())&&void 0!==t&&t}},{key:"getLegendDataById",value:function(t){var e,n=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return n?n.getLegendData():[]}},{key:"getLegendDataByIndex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(AC.discreteLegend);return n&&n[e]?n[e].getLegendData():[]}},{key:"getLegendSelectedDataById",value:function(t){var e,n=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return n?n.getSelectedData():[]}},{key:"getLegendSelectedDataByIndex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(AC.discreteLegend);return n&&n[e]?n[e].getSelectedData():[]}},{key:"setLegendSelectedDataById",value:function(t,e){var n,i=null===(n=this._chart)||void 0===n?void 0:n.getComponentByUserId(t);i&&i.setSelectedData(e)}},{key:"setLegendSelectedDataByIndex",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0,i=null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(AC.discreteLegend);i&&i[e]&&i[e].setSelectedData(n)}},{key:"getDataURL",value:function(){var t;return WD(this,void 0,void 0,i().mark((function e(){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.getStage(),!this._chart||!n){e.next=7;break}return n.render(),r=this._chart.getCanvas(),e.next=6,nD(r,{onError:this._onError});case 6:return e.abrupt("return",e.sent);case 7:return e.abrupt("return",(null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined")),null));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"exportImg",value:function(t){var e,n;return WD(this,void 0,void 0,i().mark((function r(){var a;return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(bR(this._option.mode)){i.next=2;break}return i.abrupt("return",void(null===(e=this._option)||void 0===e||e.onError(new TypeError("non-browser environment can not export img"))));case 2:return i.next=4,this.getDataURL();case 4:(a=i.sent)?tD(t,a):null===(n=this._option)||void 0===n||n.onError(new ReferenceError("render is not defined"));case 6:case"end":return i.stop()}}),r,this)})))}},{key:"exportCanvas",value:function(){var t,e=this.getStage();if(this._chart&&e)return e.toCanvas();null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined"))}},{key:"getImageBuffer",value:function(){var t,e;if("node"===this._option.mode){var n=this.getStage();return n?(n.render(),n.window.getImageBuffer()):(null===(e=this._option)||void 0===e||e.onError(new ReferenceError("render is not defined")),null)}null===(t=this._option)||void 0===t||t.onError(new TypeError("getImageBuffer() now only support node environment."))}},{key:"setLayout",value:function(t){var e;this._option.layout=t,null===(e=this._chart)||void 0===e||e.setLayout(t)}},{key:"reLayout",value:function(){var t;null===(t=this._chart)||void 0===t||t.setLayoutTag(!0)}},{key:"getCompiler",value:function(){return this._compiler}},{key:"getChart",value:function(){return this._chart}},{key:"getStage",value:function(){return this._compiler.getStage()}},{key:"getCanvas",value:function(){var t;return null===(t=this._compiler)||void 0===t?void 0:t.getCanvas()}},{key:"getContainer",value:function(){var t,e;return MC(this._container)?this._container:(e=LC(this._canvas)?null===document||void 0===document?void 0:document.getElementById(this._canvas):this._canvas,MC(e)?e.parentElement:null===(t=this.getCanvas())||void 0===t?void 0:t.parentElement)}},{key:"getComponents",value:function(){return this._chart.getAllComponents()}},{key:"getScale",value:function(t){var e,n=null===(e=this._chart)||void 0===e?void 0:e.getGlobalScale();return null==n?void 0:n.getScale(t)}},{key:"setDimensionIndex",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return null===(e=this._chart)||void 0===e?void 0:e.setDimensionIndex(t,n)}},{key:"stopAnimation",value:function(){var t,e,n;null===(n=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===n||n.stop()}},{key:"pauseAnimation",value:function(){var t,e,n;null===(n=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===n||n.pause()}},{key:"resumeAnimation",value:function(){var t,e,n;null===(n=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===n||n.resume()}},{key:"convertDatumToPosition",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;if(!this._chart)return null;if(HC(t))return null;var a,o=n.seriesId,s=n.seriesIndex,u=void 0===s?0:s;if(MC(o)?a=this._chart.getSeriesInUserId(o):MC(u)&&(a=null===(e=this._chart.getSeriesInIndex([u]))||void 0===e?void 0:e[0]),a){var l,c=Object.keys(t),h=a.getViewData().latestData.find((function(e){return c.every((function(n){return e[n]==t[n]}))})),d=a.getRegion().getLayoutStartPoint();return(l=h?a.dataToPosition(h,r):a.dataToPosition(t,r))?RI(l,d,i):null}return null}},{key:"convertValueToPosition",value:function(t,e){var n,i,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this._chart||BC(t)||HC(e))return null;if(!DC(t)){var a,o=e.axisId,s=e.axisIndex;if(MC(o)?a=this._chart.getComponentsByKey("axes").find((function(t){return t.userId===o})):MC(s)&&(a=null===(n=this._chart.getComponentsByKey("axes"))||void 0===n?void 0:n[s]),!a)return gR("Please check whether the `axisId` or `axisIndex` is set!"),null;var u=null==a?void 0:a.valueToPosition(t);if(r){var l=a.getLayoutStartPoint(),c=a.getOrient();return u+("bottom"===c||"top"===c?l.x:l.y)}return u}var h,d=e.seriesId,f=e.seriesIndex;return MC(d)?h=this._chart.getSeriesInUserId(d):MC(f)&&(h=null===(i=this._chart.getSeriesInIndex([f]))||void 0===i?void 0:i[0]),h?RI(h.valueToPosition(t[0],t[1]),h.getRegion().getLayoutStartPoint(),r):(gR("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}},{key:"getFunction",value:function(t){return GD.instance().getFunction(t)}},{key:"registerFunction",value:function(t,e){t&&e&&GD.instance().registerFunction(t,e)}},{key:"unregisterFunction",value:function(t){t&&GD.instance().unregisterFunction(t)}},{key:"getFunctionList",value:function(){return GD.instance().getFunctionNameList()}},{key:"setRuntimeSpec",value:function(t){this._spec=t,this._updateSpecInfo()}},{key:"_initChartPlugin",value:function(){var t=mL.getChartPlugins();t.length>0&&(this._chartPlugin=new UD(this),this._chartPlugin.load(t.map((function(t){return new t}))),this._chartPluginApply("onInit",this._spec))}},{key:"_chartPluginApply",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,n)}},{key:"_getMode",value:function(){return this._option.mode||SC["desktop-browser"]}},{key:"_getChartOption",value:function(t){var e=this;return{type:t,globalInstance:this,eventDispatcher:this._eventDispatcher,dataSet:this._dataSet,container:this._container,canvas:this._canvas,map:new Map,mode:this._getMode(),modeParams:this._option.modeParams,getCompiler:function(){return e._compiler},performanceHook:this._option.performanceHook,viewBox:this._viewBox,animation:this._option.animation,getTheme:function(){var t;return null!==(t=e._currentTheme)&&void 0!==t?t:{}},getSpecInfo:function(){var t;return null!==(t=e._specInfo)&&void 0!==t?t:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:!0===this._option.disableTriggerEvent}}}],[{key:"useRegisters",value:function(t){t.forEach((function(t){"function"==typeof t?t():console.error("Invalid function:",t)}))}},{key:"useChart",value:function(t){t.forEach((function(t){return mL.registerChart(t.type,t)}))}},{key:"useSeries",value:function(t){t.forEach((function(t){return mL.registerSeries(t.type,t)}))}},{key:"useComponent",value:function(t){t.forEach((function(t){return mL.registerComponent(t.type,t)}))}},{key:"useMark",value:function(t){t.forEach((function(t){var e;return mL.registerMark(null!==(e=t.constructorType)&&void 0!==e?e:t.type,t)}))}},{key:"useLayout",value:function(t){t.forEach((function(t){return mL.registerLayout(t.type,t)}))}},{key:"registerDataSetTransform",value:function(t,e){mL.registerTransform(t,e)}},{key:"registerFunction",value:function(t,e){t&&e&&GD.instance().registerFunction(t,e)}},{key:"unregisterFunction",value:function(t){t&&GD.instance().unregisterFunction(t)}},{key:"getFunction",value:function(t){return t?GD.instance().getFunction(t):null}},{key:"getFunctionList",value:function(){return GD.instance().getFunctionNameList()}},{key:"registerMap",value:function(t,e,n){var i=mL.getImplementInKey("registerMap");i&&i(t,e,n)}},{key:"unregisterMap",value:function(t){var e=mL.getImplementInKey("unregisterMap");e&&e(t)}},{key:"getMap",value:function(t){return e=t,UL.get(e);var e}},{key:"hideTooltip",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];dL.forEach((function(t){var e;return null===(e=null==t?void 0:t.hideTooltip)||void 0===e?void 0:e.call(t)}),t)}},{key:"getLogger",value:function(){return dE.getInstance()}}])}();HD.InstanceManager=dL,HD.ThemeManager=fL,HD.globalConfig={uniqueTooltip:!0},HD.Utils=ND,HD.vglobal=tp,mL.registerRegion("region",bD),mL.registerLayout("base",ED),bT(),nT(),vM.registerGraphic(AB.group,iu),mL.registerMark(FD.type,FD),oO.useRegisters([function(){vM.registerTransform("filter",{transform:sO,markPhase:"beforeJoin"},!0)},function(){vM.registerTransform("map",{transform:uO,markPhase:"beforeJoin"},!0)}]),oO.useRegisters([wO,SO,kO,bO,_O,xO,AO,TO,CO]),rE(MM,PM),vM.registerInteraction(MM.type,MM),rE(BM,PM),vM.registerInteraction(BM.type,BM),lL(KI.name,KI),dE.getInstance(lE.Error);class YD extends qT{get specProcess(){return this._specProcess}get dataTempTransform(){return this._specProcess.dataTempTransform}get chartType(){var t;return null===(t=this._specProcess.dataTempTransform.specTemp)||void 0===t?void 0:t.getChartType()}get tempType(){var t;return null===(t=this._specProcess.dataTempTransform.specTemp)||void 0===t?void 0:t.type}constructor(t,e){super(t,e),this._runtime=[],this.onSpecReady=()=>{var t;console.log("onSpecReady !"),this._runtime.forEach((t=>{var e;return null===(e=t.onSpecReady)||void 0===e?void 0:e.call(t)})),null===(t=this._specProcess.dataTempTransform.specTemp)||void 0===t||t.standardizedSpec(this._specProcess.getVisSpec(),{character:this}),this._updateVisactorSpec(),this._afterRender()},this._initSpecProcess()}_initRuntime(){}clearConfig(t){}show(){this._graphic.setAttribute("visibleAll",!0)}hide(){this._graphic.setAttribute("visibleAll",!1)}getGraphicParent(){return this._graphic}tickTo(t){}release(){var t,e;this._specProcess.release(),null===(e=null===(t=this._graphic)||void 0===t?void 0:t.parent)||void 0===e||e.removeChild(this._graphic),this._specProcess=this._graphic=null}}class XD{get dataTempTransform(){return this._dataTempTransform}constructor(t,e,n){this._onSpecReadyCall=null,this._character=null,this.emitter=new dt,this._dataUpdateSuccess=t=>{this.emitter.emit("beforeTempChange"),this._characterSpec.options.data=this._dataTempTransform.dataParser.getSave(),this.emitter.emit("afterDataChange")},this._tempUpdateSuccess=(t,e)=>{const n=!1!==(null==t?void 0:t.triggerHistory);this.emitter.emit("beforeTempChange",n,e),this._characterSpec.type=this._dataTempTransform.specTemp.type,this.emitter.emit("afterTempChange",e)},this._dataTempUpdateSuccess=(t,e)=>{const n=!1!==(null==t?void 0:t.triggerHistory);this.emitter.emit("beforeTempChange",n,e),this._characterSpec.options.data=this._dataTempTransform.dataParser.getSave(),this._characterSpec.type=this._dataTempTransform.specTemp.type,this.emitter.emit("afterTempChange",e)},this.transformSpec=()=>{this._visSpec=this._dataTempTransform.getBaseSpec(),this._mergeConfig(),this._onSpecReadyCall()},this._character=t,this._dataTempTransform=new e({character:t,specProcess:this}),this._onSpecReadyCall=n,this._dataTempTransform.emitter.on("specReady",this.transformSpec),this._dataTempTransform.emitter.on("tempUpdate",this._tempUpdateSuccess),this._dataTempTransform.emitter.on("dataUpdate",this._dataUpdateSuccess)}getVisSpec(){return this._visSpec}getCharacterSpec(){return this._characterSpec}release(){this._onSpecReadyCall=null,this._dataTempTransform.release(),this._dataTempTransform=null,this._characterSpec=null,this._visSpec=null,this._character=null}getCharacterType(){return this._characterSpec.type}}const KD={type:null,zIndex:0,id:"",position:void 0,options:{data:null,theme:null,color:null,layout:{viewBox:{x:0,y:0,width:0,height:0},data:[]},marker:{markLine:[],markArea:[]},markStyle:null}};class qD extends XD{constructor(){super(...arguments),this._characterSpec=NT(KD)}updateConfig(t){this._characterSpec=t,this._dataTempTransform.updateChartTemp(this._characterSpec.type)}_mergeConfig(){}}class ZD{get specTemp(){return this._specTemp}get nextTemp(){return this._nextTemp}constructor({specProcess:t,character:e}){this._state="alive",this._specTemp=null,this._nextTemp=null,this._changeType="none",this._updateOption={},this.emitter=new dt,this._character=e,this._specProcess=t}_setNoHistoryState(){this._updateOption=this._updateOption||{},this._updateOption.triggerHistory&&(this._updateOption.saveData=!0,this._updateOption.triggerHistory=!1)}updateChartTemp(t){if(this._createNextTemp(t)){if(this._changeType="temp",this._checkEnable(this._nextTemp)){const t=this._specTemp;this._setTempToNext(),this.emitter.emit("tempUpdate",this._updateOption,{currentTemp:t,nextTemp:this._specTemp}),this.emitter.emit("specReady")}this._changeType="none"}}_setTempToNext(){var t;null===(t=this._specTemp)||void 0===t||t.clear(),this._specTemp=this._nextTemp,this._nextTemp=null}_createNextTemp(t){var e,n;return t===(null===(e=this._specTemp)||void 0===e?void 0:e.type)?(console.warn("same temp type:",t),!1):(null===(n=this._nextTemp)||void 0===n||n.clear(),this._nextTemp=aC.createChartTemp(t,this._specProcess.getCharacterSpec()),!!this._nextTemp)}_checkEnable(t){return!!t&&!!t.checkDataEnable(this._specProcess.getCharacterSpec().options.data)}getBaseSpec(){return this._specTemp.getSpec(this._specProcess.getCharacterSpec().options.data,{character:this._character})}release(){var t,e;this._state="release",null===(t=this._specTemp)||void 0===t||t.clear(),null===(e=this._nextTemp)||void 0===e||e.clear(),this.emitter.removeAllListeners(),this.emitter=this._specTemp=null}}class JD extends ZD{get specTemp(){return this._specTemp}get nextTemp(){return this._nextTemp}}class $D extends YD{get spec(){return this._spec}_initSpecProcess(){this._specProcess=new qD(this,JD,this.onSpecReady)}_initRuntime(){$D.RunTime.forEach((t=>{this._runtime.push(new t(this))}))}_parserSpec(){this._specProcess.updateConfig(this._spec)}_initGraphics(){var t;const e=VT(this._spec.position),n={x1:e.x,x2:e.x+e.width,y1:e.y,y2:e.y+e.height},i=NT(this._specProcess.getVisSpec());i.width=e.width,i.height=e.height,this._graphic=new lC(Object.assign(Object.assign({renderCanvas:this._option.canvas.getCanvas(),spec:i,ClassType:HD,vchart:null,zIndex:this._spec.zIndex,mode:"desktop-browser",dpr:window.devicePixelRatio,interactive:!1,autoRender:!1,disableDirtyBounds:!0,viewBox:n,ticker:this._option.canvas.getStage().ticker,visibleAll:!1},null!==(t=this._spec.options.panel)&&void 0!==t?t:{}),{chartInitOptions:{animation:!0,disableTriggerEvent:!0,performanceHook:{afterInitializeChart:()=>{var t,e;null===(e=null===(t=this.specProcess.dataTempTransform)||void 0===t?void 0:t.specTemp)||void 0===e||e.afterInitializeChart({character:this}),this._runtime.forEach((t=>{var e;return null===(e=t.afterInitializeChart)||void 0===e?void 0:e.call(t)}))},afterVRenderDraw:()=>{this._runtime.forEach((t=>{var e;return null===(e=t.afterVRenderDraw)||void 0===e?void 0:e.call(t)}))}}}})),this.option.graphicParent.add(this._graphic)}_afterRender(){}_updateVisactorSpec(){var t;null===(t=this._graphic)||void 0===t||t.updateSpec(this._specProcess.getVisSpec())}clearCharacter(){this._graphic.vProduct.release(),this._graphic.parent.removeChild(this._graphic)}tickTo(t){this._ticker.tickAt(t)}checkEvent(t){return!1}}$D.type="CharacterChart",$D.RunTime=[class{constructor(t){this.type="ComponentSpec",this._character=t}onSpecReady(){const t=this._character.specProcess.getVisSpec(),e=this._character.specProcess.getCharacterSpec().options;if(!e)return;const n=e.componentSpec;null==n||n.forEach((e=>{"axes"===e.specKey&&this._mergeAxesSpec(t,e)}))}_mergeAxesSpec(t,e){if(t.axes){const n=t.axes.find(((t,n)=>!!wC(t,n,e.matchInfo)||t.orient===e.matchInfo.orient));n?WT(n,e.spec):t.axes.push(e.spec)}else t.axes=[Object.assign({},e)]}afterInitializeChart(){}afterVRenderDraw(){}},class{constructor(t){this.type="CommonSpec",this._character=t}onSpecReady(){const t=this._character.specProcess.getVisSpec(),e=this._character.specProcess.getCharacterSpec().options;e&&WT(t,{color:e.color,theme:e.theme,padding:e.padding,title:e.title})}afterInitializeChart(){}afterVRenderDraw(){}},class{constructor(t){this.type="SeriesSpec",this._character=t}onSpecReady(){var t,e;const n=this._character.specProcess.getVisSpec(),i=this._character.specProcess.getCharacterSpec().options;i&&(n.series||1!==(null===(t=i.seriesSpec)||void 0===t?void 0:t.length)?null===(e=i.seriesSpec)||void 0===e||e.forEach((t=>{if(!n.series)return void(n.series=[Object.assign({},t.spec)]);const e=n.series.find(((e,n)=>wC(e,n,t.matchInfo)));e?WT(e,t.spec):n.series.push(Object.assign({},t.spec))})):WT(n,i.seriesSpec[0].spec))}afterInitializeChart(){}afterVRenderDraw(){}}];class QD{clear(){}getChartType(){return this.type}afterInitializeChart(){}standardizedSpec(t,e){}}class tj extends QD{constructor(){super(...arguments),this.type=tj.type}checkDataEnable(t,e){return!0}getSpec(t,e){return e.character.spec.options.spec}}tj.type="VChart",aC.registerChartTemp(tj.type,tj);class ej extends $D{}var nj;ej.type="VChart",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"}(nj||(nj={}));let ij=class extends t.DefaultCanvasGroupRender{constructor(){super(...arguments),this.type="vstory-component-group",this.numberType=ZT}draw(t,e,n,i){const{context:r}=n;if(!r)return;const{wipeDirection:a,wipeRatio:o,wipeColor:s,wipeBlur:u}=t.attribute,l=isFinite(o);let c,h,d,f;if(l){const e=t.AABBBounds;a===nj.LEFT_TO_RIGHT?(c=e.x1,h=e.y1,d=c+e.width()*o,f=e.height()+h):a===nj.RIGHT_TO_LEFT?(d=e.x1,h=e.y1,c=d-e.width()*o,f=e.height()+h):a===nj.TOP_TO_BOTTOM?(c=e.x1,h=e.y1,d=c+e.width(),f=e.height()*o+h):a===nj.BOTTOM_TO_TOP&&(c=e.x1,f=e.y1,d=c+e.width(),h=f-e.height()*o),r.save(),r.setTransformForCurrent(),r.beginPath(),r.rect(c,h,d-c,f-h),r.clip()}super.draw(t,e,n,i),l&&r.restore()}};ij=oC([L()],ij);class rj extends HT{getInitialAttributes(){return{x:0,y:0,clipRange:0}}init(){var t,e;this._graphic||(this._graphic=new yB(this._transformAttributes(Object.assign(Object.assign({},this.getInitialAttributes()),null!==(e=null===(t=this._character.spec.options)||void 0===t?void 0:t.graphic)&&void 0!==e?e:{}))),this._graphic.name=`timeline-${this._character.id}`,this._character.getGraphicParent().add(this._graphic))}applyLayoutData(t){const{x:e,y:n,width:i,height:r,angle:a}=VT(t);this._graphic.setAttributes(this._transformAttributes({x:e,y:n,angle:a,width:i,height:r}))}}class aj extends $T{constructor(){super(...arguments),this.graphicType="timeline"}_createGraphic(){return new rj(nC.TIMELINE,this)}}Qv(),wb(Hi),tp.setEnv("browser");class oj{getStage(){return this._stage}getCanvas(){return this._canvas}get container(){return this._container}constructor(t,e){this._story=t,this._container=e,this._initCanvas()}_initCanvas(){const t=document.createElement("canvas");t.width=this._container.clientWidth*window.devicePixelRatio,t.height=this._container.clientHeight*window.devicePixelRatio,t.style.width=this._container.clientWidth+"px",t.style.height=this._container.clientHeight+"px",t.style.position="absolute",t.id=`_visactor_story_canvas_${this._story.id}`,this._container.appendChild(t),this._canvas=t;const e=Cp({canvas:this._canvas,width:this._canvas.clientWidth,height:this._canvas.clientHeight,canvasControled:!0,autoRender:!1,disableDirtyBounds:!0,ticker:new sa([]),dpr:window.devicePixelRatio,event:{clickInterval:300}});this._stage=e,e.on("*",((t,e)=>{"click"===e&&console.log("canvas",t)}))}getEventDetail(t){const e=this._story.getCharacters();let n,i;return Object.keys(this._story.getCharacters()).find((r=>{const a=e[r],o=a.checkEvent(t);return!!o&&(n=o,i=a,!0)})),{character:i,characterInfo:n}}release(){this._stage.release()}}class sj{constructor(t){this._characters={},this._story=t}getCharacters(){return this._characters}getCharactersById(t){return this._characters[t]||null}addCharacter(t){const e={story:this._story,canvas:this._story.canvas,graphicParent:this._story.canvas.getStage().defaultLayer};return t.id?(this._characters[t.id]||(this._characters[t.id]=aC.createCharacter(t,e)),this._characters[t.id]):null}initCharacters(t){const e={story:this._story,canvas:this._story.canvas,graphicParent:this._story.canvas.getStage().defaultLayer};t.forEach((t=>{t.id&&(this._characters[t.id]||(this._characters[t.id]=aC.createCharacter(t,e)))}))}}const uj={warn:"color: orange;",error:"color: red;",info:"color: blue;"};function lj(t,...e){console.log(`%c[${t.toUpperCase()}] ${e}`,uj[t])}class cj{constructor(t,e){return cj._instance||(this.init(t,e),cj._instance=this),cj._instance}init(t,e){if(this._processorMap=new Map,e)for(const t in e)lj("info",`register ${t} processor.`),this.registerProcessor(t,e[t]);this._story=t}getActInfo(t,e){const n=this._story.getCharactersById(t);if(!n)return lj("error",`获取character失败,请检查 ${t} 是否绑定到一个合法的character`),null;const i=this.getProcessor(n.spec.type,e.action);return i||lj("error",`获取processor失败,请检查 ${n.spec.type} 是否支持 ${e.action}`),i.getStartTimeAndDuration(e)}registerProcessor(t,e){return!!this._processorMap&&(this._processorMap.set(t,e),!0)}getProcessorList(t){return this._processorMap&&this._processorMap.get(t)}getProcessor(t,e){var n;return this._processorMap&&(null===(n=this._processorMap.get(t))||void 0===n?void 0:n[e])}doAction(t,e,n,i){const r=this.getProcessor(t,e);if(r){lj("info",`Execute action => ${e}, character => ${t}`);const a=r.run(n,i);return lj("info","Action Executed:",a),a}lj("error",`Action not found: character => ${t}, action => ${e} `)}release(){cj._instance=null,this._processorMap&&(this._processorMap.clear(),this._processorMap=null)}}cj._instance=null;const hj="appear",dj="disappear";class fj{getStartTime(t){return this.getStartTimeAndDuration(t).startTime}getDuration(t){return this.getStartTimeAndDuration(t).duration}getStartTimeAndDuration(t){return{startTime:0,duration:0}}run(t,e){}}const vj=(t,e)=>t&&e.duration&&e.duration>0;function pj(t,e,n){!function(t,e){var n,i,r,a;if(!vj(t,e))return!1;const{fade:o={}}=e,s=null!==(i=null!==(n=o.opacity)&&void 0!==n?n:e.opacity)&&void 0!==i?i:1,u=null!==(r=o.duration)&&void 0!==r?r:e.duration,l=null!==(a=o.easing)&&void 0!==a?a:e.easing;t.setAttributes({baseOpacity:.001}),t.animate().to({baseOpacity:s},u,l)}(bj(t),e)}function gj(t,e,n){const i=function(t,e){if("chart"===t._graphic.type)return[bj(t)];return"move"===e?[bj(t)]:function(t){return t.getGraphicParent().getChildren()}(t)}(t,n);i.forEach((t=>function(t,e){var n,i,r,a;if(!vj(t,e))return!1;const{scale:o={}}=e,s=null!==(i=null!==(n=o.ratio)&&void 0!==n?n:e.ratio)&&void 0!==i?i:1,u=null!==(r=o.duration)&&void 0!==r?r:e.duration,l=null!==(a=o.easing)&&void 0!==a?a:e.easing;return t.setAttributes({scaleX:0,scaleY:0}),t.animate().to({scaleX:s,scaleY:s},u,l),!0}(t,e)))}const yj={right:0,left:1,top:2,bottom:3};function mj(t,e,n){!function(t,e){var n,i,r,a;if(!vj(t,e))return!1;const{wipe:o={}}=e,s=null!==(i=null!==(n=o.from)&&void 0!==n?n:e.from)&&void 0!==i?i:"right",u=null!==(r=o.duration)&&void 0!==r?r:e.duration,l=null!==(a=o.easing)&&void 0!==a?a:e.easing;t.setAttributes({wipeDirection:yj[s],wipeRatio:0}),t.animate().to({wipeRatio:1},u,l).onEnd((()=>{t.setAttributes({wipeRatio:1})}))}(bj(t),e)}class kj extends fj{constructor(){super()}getStartTimeAndDuration(t){var e,n;const{startTime:i=0,duration:r}=t,{startTime:a=0,duration:o=0}=null!==(n=null===(e=t.payload)||void 0===e?void 0:e.animation)&&void 0!==n?n:{};return{startTime:i+a,duration:null!=r?r:o}}run(t,e){var n;const{animation:i}=null!==(n=e.payload)&&void 0!==n?n:{},{effect:r="fadeIn"}=null!=i?i:{};this.getEffectFunc(r)(t,i,r)}getEffectFunc(t){switch(t){case"scaleIn":return gj;case"wipeIn":return mj;case"fadeIn":return pj}return pj}}function bj(t){return t.getGraphicParent()}const _j=(t,e,n)=>{const{duration:i,easing:r}=e,{disappear:a,orient:o="width"}=n,s=(t=t.getChildAt(0)).AABBBounds.width(),u=t.AABBBounds.height();if("width"===o){const e=a?{from:s,to:0}:{from:0,to:s};t.setAttributes({width:e.from,height:u,clip:!0}),t.animate().to({width:e.to},i,r)}else{const e=a?{from:u,to:0}:{from:0,to:u};t.setAttributes({width:2*s,height:e.from,clip:!0}),t.animate().to({height:e.to},i,r)}},xj=(t,e,n)=>{const{duration:i,easing:r}=e,{disappear:a}=n,o=a?{from:1,to:0}:{from:0,to:1};t.setAttributes({baseOpacity:o.from}),t.animate().to({baseOpacity:o.to},i,r)};const wj=(t,e,n)=>{const{duration:i,easing:r}=e,{disappear:a}=n,o=a?{from:1,to:0}:{from:0,to:1};t.getElementsByType("text").forEach((t=>{t.setAttributes({scaleX:o.from,scaleY:o.from}),t.animate().to({scaleX:o.to,scaleY:o.to},i,r)})),t.getElementsByType("richtext").forEach((t=>{t.setAttributes({scaleX:o.from,scaleY:o.from}),t.animate().to({scaleX:o.to,scaleY:o.to},i,r)}))},Sj=(t,e,n)=>{const{duration:i,easing:r}=e,{disappear:a}=n,o=a?{from:1,to:0}:{from:0,to:1};t.getElementsByType("text").forEach((t=>{t.setAttributes({opacity:o.from}),t.animate().to({opacity:1},i,r)})),t.getElementsByType("richtext").forEach((t=>{t.setAttributes({opacity:o.from}),t.animate().to({opacity:o.to},i,r)}))},Aj=(t,e,n)=>{const{duration:i,easing:r}=e,{disappear:a}=n,o=a?{from:1,to:0}:{from:1,to:1};t.setAttributes({baseOpacity:o.from}),t.animate().to({baseOpacity:o.to},i,r)},Tj=(t,e,n)=>{const{duration:i,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=n;return{type:s?"growRadiusOut":"growRadiusIn",duration:i,loop:r,oneByOne:a,easing:o}},Cj=(t,e,n)=>{const{duration:i,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=n;return{type:s?"growAngleOut":"growAngleIn",duration:i,loop:r,oneByOne:a,easing:o,options:{overall:!0}}},Ej=(t,e,n)=>{const{duration:i,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=n;return{type:s?"fadeOut":"fadeIn",duration:i,loop:r,oneByOne:a,easing:o}},Rj=(t,e,n,i)=>{const{duration:r,loop:a,oneByOne:o,easing:s}=e,{disappear:u}=i;return{type:u?n[1]:n[0],duration:r,loop:a,oneByOne:o,easing:s}},Bj=(t,e,n)=>{const{duration:i,loop:r,oneByOne:a,easing:o}=e,{disappear:s}=n;return{type:s?"fadeOut":"fadeIn",duration:i,loop:r,oneByOne:a,easing:o}},Mj=(t,e,n={center:!1,disappear:!1})=>{var i;const{duration:r,loop:a,oneByOne:o,easing:s}=e,{center:u,disappear:l}=n,c=null!==(i=t.getChart().getSpec().direction)&&void 0!==i?i:"vertical",h=t.getChart().getSpec().xField,d=t.getChart().getSpec().yField,[f,v]=Pj(t);return{type:l?u?"growCenterOut":"growHeightOut":u?"growCenterIn":"growHeightIn",duration:r,loop:a,oneByOne:o,easing:s,options:(t,e,n)=>{const i=null==t?void 0:t["vertical"===c?d:h];return"vertical"===c?{overall:null==v?void 0:v.getScale(0).scale(0),orient:i>0?"negative":"positive"}:{overall:null==f?void 0:f.getScale(0).scale(0),orient:i>0?"negative":"positive"}}}};const Pj=t=>{const e=t.getChart().getComponentsByKey("axes"),n=e.find((t=>{if(function(t){return"bottom"===t||"top"===t}(t.getOrient()))return!0})),i=e.find((t=>{if(function(t){return"left"===t||"right"===t}(t.getOrient()))return!0}));return[n,i]},Oj={appear:{rect:(t,e,n)=>{const{duration:i}=e;if(!(i<=0))switch(e.effect){case"grow":return Mj(t,e,Object.assign(Object.assign({},n),{center:!1}));case"centerGrow":return Mj(t,e,Object.assign(Object.assign({},n),{center:!0}));case"fade":return Bj(0,e,Object.assign({},n))}},line:(t,e,n)=>{const{duration:i}=e;if(!(i<=0))return"grow"===e.effect?Rj(0,e,["clipIn","clipOut"],n):Bj(0,e,n)},symbol:(t,e,n)=>{const{duration:i}=e;if(!(i<=0))return"grow"===e.effect?Rj(0,e,["scaleIn","scaleOut"],n):Bj(0,e,n)},text:(t,e,n)=>{const{duration:i}=e;if(!(i<=0))return"grow"===e.effect?Rj(0,e,["scaleIn","scaleOut"],n):Bj(0,e,n)},arc:(t,e,n)=>{const{duration:i}=e;if(!(i<=0))switch(e.effect){case"grow":case"growRadius":return Tj(t,e,n);case"growAngle":return Cj(t,e,n);default:return Ej(t,e,n)}},legends:(t,e,n)=>"grow"===e.effect?_j(t,e,n):xj(t,e,n),label:(t,e,n)=>{switch(e.effect){case"grow":return wj(t,e,n);case"followGraphic":return Aj(t,e,n);default:return Sj(t,e,n)}},axis:(t,e,n)=>"grow"===e.effect?function(t,e,n){var i;const r=null===(i=t.name)||void 0===i?void 0:i.includes("grid");r?function(t,e,n){t&&_j(t,e,n)}(t,e,n):function(t,e,n){const{duration:i,easing:r}=e,{disappear:a,direction:o="positive",orient:s}=n,u=t.getElementsByName("axis-line")[0],l=t.getElementsByName("axis-tick-container")[0],c=t.getElementsByName("axis-label-container")[0];if(u&&u.childrenCount>0){const t="height"===s&&("positive"===o||a),e=u.getElementsByType("line")[0];if(e){t&&e.setAttributes({points:e.attribute.points.reverse()});const n=a?{from:{clipRange:1},to:{clipRange:0}}:{from:{clipRange:0},to:{clipRange:1}};e.setAttributes(n.from),e.animate().to(n.to,i,r).onEnd((()=>{t&&e.setAttributes({points:e.attribute.points.reverse()})}))}}const h=a?{from:{opacity:1},to:{opacity:0}}:{from:{opacity:0},to:{opacity:1}};if(l&&l.childrenCount>0){const t=a,e=l.getElementsByType("line");t&&e.reverse(),e.forEach(((n,a)=>{n.setAttributes(h.from),n.animate().wait(i/e.length*a).to(h.to,i/e.length,r).onEnd((()=>{t&&e.reverse()}))}))}if(c&&c.childrenCount>0){const t=a,e=c.getElementsByType("text");t&&e.reverse(),e.forEach(((n,a)=>{n.setAttributes(h.from),n.animate().wait(i/e.length*a).to(h.to,i/e.length,r).onEnd((()=>{t&&e.reverse()}))}))}}(t,e,n)}(t,e,n):xj(t,e,n),title:(t,e,n)=>"grow"===e.effect?_j(t,e,n):xj(t,e,n)}};class Ij extends fj{constructor(){super()}getStartTimeAndDuration(t){var e,n;const{startTime:i=0,duration:r}=t,{startTime:a=0,duration:o=0}=null!==(n=null===(e=t.payload)||void 0===e?void 0:e.animation)&&void 0!==n?n:{};return{startTime:i+a,duration:null!=r?r:o}}run(t,e){}componentAppear(t,e,n){"label"===e.specKey?this.labelComponentAppear(t,e,n):"legends"===e.specKey?this.legendsComponentAppear(t,e,n):"axes"===e.specKey?this.axisComponentAppear(t,e,n):"title"===e.specKey&&this.titleComponentAppear(t,e,n)}labelComponentAppear(t,e,n){const i=e.getVRenderComponents(),r=Oj.appear.label,a=Ij.defaultPayload;i.forEach((t=>{this.runTransformFunc(t,r,n,a)}))}legendsComponentAppear(t,e,n){const i=e.getVRenderComponents(),r=Oj.appear.legends,a=Ij.defaultPayload;i.forEach((t=>{this.runTransformFunc(t,r,n,a)}))}axisComponentAppear(t,e,n){var i;const r=e.getVRenderComponents(),a=r[0],o=r[1],s=a.attribute.orient,u="left"===s||"right"===s?"height":"width",l="left"===s||"right"===s?"width":"height",c=function(t,e){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-10,i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-10)*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,i)}((null!==(i=a.attribute.items)&&void 0!==i?i:[[]])[0][0].value,1)?"positive":"negative",h=Oj.appear.axis,d=Ij.defaultPayload;a&&this.runTransformFunc(a,h,n,d,{orient:u,direction:c}),o&&this.runTransformFunc(o,h,n,d,{orient:l,direction:c})}titleComponentAppear(t,e,n){const i=e.getVRenderComponents(),r=Oj.appear.title,a=Ij.defaultPayload;i.forEach((t=>{this.runTransformFunc(t,r,n,a)}))}runTransformFunc(t,e,n,i={},r={}){if(e){const{payload:a}=n;e(t,WT({},i,a).animation,Object.assign({disappear:"disappear"===n.action},r))}}commonSeriesAppear(t,e,n){const i=e.getMarksWithoutRoot();if(!i.length)return;const{payload:r}=n;i.forEach(((i,a)=>{const o=Ij[`${i.type}Payload`],s=WT({},BT(o)?o(e.type):o||{},r),u=i.getProduct(),l=Oj.appear[i.type],c=l&&l(t,s.animation,{index:a,disappear:"disappear"===n.action});u&&c&&u.animate.run(c||{})}))}}Ij.rectPayload=t=>({animation:{effect:"treemap"===t?"centerGrow":"grow",duration:2e3,easing:"cubicOut",oneByOne:!1,loop:!1}}),Ij.defaultPayload={animation:{effect:"grow",duration:2e3,easing:"cubicOut",oneByOne:!1,loop:!1}},Ij.arcPayload={animation:{effect:"growAngle",duration:2e3,easing:"cubicOut",oneByOne:!1,loop:!1}},Ij.linePayload=Ij.defaultPayload,Ij.symbolPayload=Ij.defaultPayload,Ij.textPayload=Ij.defaultPayload;by();class Lj extends ha{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,n,i;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(i=null===(n=this.to)||void 0===n?void 0:n.text)&&void 0!==i?i:"",!this.toText||LT(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=this.target.getComputedAttribute("fontSize"),n=Oc({x:0,y:0,dy:-e/2,points:[{x:0,y:0},{x:0,y:e}],stroke:"black"});t.add(n)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,n){var i;if(!1===this.valid)return;const r=this.fromText.length,a=this.toText.length,o=Math.ceil(r+(a-r)*e);n.text=this.toText.substr(0,o);const s=null===(i=this.target.shadowRoot)||void 0===i?void 0:i.at(0),u=Object.assign(Object.assign({},this.target.attribute),n),l=Nh(u).width(),{textAlign:c}=u;let h=l;"center"===c?h=l/2:"right"===c&&(h=0),s.setAttribute("x",h)}}function Dj(t){return t.getGraphicParent()}function jj(t,e){return"chart"===t._graphic.type||"move"===e?[Dj(t)]:function(t){return t.getGraphicParent().getChildren()}(t)}function Fj(t,e,n){jj(t,n).forEach((t=>function(t,e){if(t&&"text"===t.type){const{duration:n,easing:i}=e,{text:r}=t.attribute;IT(r)&&t.animate().play(new Lj({text:""},{text:r},n,i))}}(t,e)))}function Nj(t,e,n){jj(t,n).forEach((t=>function(t,e){if(t&&"text"!==t.type){const{duration:n,easing:i}=e;t.appearAnimate({duration:n,easing:i})}}(t,e)))}const Gj={VChart:{[hj]:new Ij,[dj]:new Ij}},zj={[nC.RECT]:{[hj]:new class extends kj{constructor(){super()}}},[nC.LINE]:{[hj]:new class extends kj{constructor(){super()}}},[nC.SHAPE]:{[hj]:new class extends kj{constructor(){super()}}},[nC.IMAGE]:{[hj]:new class extends kj{constructor(){super()}}},[nC.TEXT]:{[hj]:new class extends kj{constructor(){super()}getEffectFunc(t){return"typewriter"===t?Fj:super.getEffectFunc(t)}}},[nC.TIMELINE]:{[hj]:new class extends kj{constructor(){super()}getEffectFunc(t="default"){return"default"===t?Nj:super.getEffectFunc(t)}}}},Uj=Object.assign(Object.assign({},Gj),zj);class Wj{constructor(t,e,n,i){this.startTime=t,this.duration=e,this.actionSpec=n,this.characterId=i}}class Vj{constructor(t){this._actionProcessor=t,this._runnedAct=new Set}clearState(){this._runnedAct.clear()}getTotalTime(){return this._actsInfo.reduce(((t,e)=>Math.max(t,e.startTime+e.duration)),0)}findActByTime(t){if(this.getTotalTime()<=0)return{actInfo:this._actsInfo[0],t:0};for(let e=0;e<this._actsInfo.length;e++){const n=this._actsInfo[e];if(n.startTime<=t&&n.startTime+n.duration>t)return{actInfo:n,t:t-n.startTime}}return{actInfo:this._actsInfo[this._actsInfo.length-1],t:t-this._actsInfo[this._actsInfo.length-1].startTime}}getActionsInRange(t,e){this.findActByTime(t);const{actInfo:n,t:i}=this.findActByTime(e),r=[];return n.sceneInfoList.forEach((t=>{const{startTime:e}=t;t.actionList.forEach((t=>{e+t.startTime<=i&&(this._runnedAct.has(t)||(this._runnedAct.add(t),r.push(t)))}))})),r}initActs(t){let e=0;this._actsInfo=t.map((t=>{const n=this._getActInfo(t,e);return e+=n.duration,n}))}_getActInfo(t,e){let n=0;const i=t.scenes.map((t=>{var e;const i=this._getSceneInfo(t,n);return n=i.startTime+(null!==(e=t.delay)&&void 0!==e?e:0)+i.duration,i})),r=i.reduce(((t,e)=>Math.min(e.startTime,t)),0);return{startTime:e,duration:r+i.reduce(((t,e)=>Math.max(e.startTime+e.duration,t)),0)-r,id:t.id,sceneInfoList:i}}_getSceneInfo(t,e){let n=0,i=0;const r=[];t.actions.forEach(((t,e)=>{let a=1/0,o=-1/0;t.characterActions.forEach((e=>{const n=this._actionProcessor.getActInfo(t.characterId,e);if(!n)return;const i=new Wj(n.startTime,n.duration,e,t.characterId);a=Math.max(Math.min(i.startTime,a),0),o=Math.max(i.startTime+i.duration,o),r.push(i)})),n=e?Math.max(Math.min(a,n),0):a,i=e?Math.max(o,i):o}));return{startTime:e+n,duration:e+i-n,id:t.id,actionList:r}}}class Hj{constructor(){this.rafIdx=0,this._tick=t=>{const e=Date.now();this.cb&&this.cb(0===t?0:e-t),this.rafIdx=requestAnimationFrame((()=>this._tick(e)))}}start(t){this.stop(),this.cb=t,this._tick(0)}stop(){this.rafIdx&&cancelAnimationFrame(this.rafIdx),this.rafIdx=0}}class Yj{constructor(t,e){var n,i;this._story=t,this._ticker=new Hj,this._currTime=0,this._story.canvas.getStage().defaultLayer.setAttributes({scaleX:null!==(n=null==e?void 0:e.scaleX)&&void 0!==n?n:1,scaleY:null!==(i=null==e?void 0:e.scaleY)&&void 0!==i?i:1}),this._actionProcessor=new cj(t,Uj),this._scheduler=new Vj(this._actionProcessor)}initActs(t){this._scheduler.initActs(t)}reset(){this._scheduler.clearState(),this._story.canvas.getStage().getTimeline().clear()}tickTo(t){const e=this._currTime,n=this._scheduler.getTotalTime();for(0===n&&(t=0);t>n;)t-=n;e>t&&(e<n?t=n+.01:(this.reset(),this._currTime=0,this.tickTo(0)));const i=this._scheduler.getActionsInRange(e,t),r=new Set;i.forEach((t=>{const e=this._story.getCharactersById(t.characterId);r.add(e),this._actionProcessor.doAction(e.spec.type,t.actionSpec.action,e,t.actionSpec)})),r.forEach((t=>{t.show()})),this._currTime=t,this._story.canvas.getStage().ticker.tickAt(t),this._story.canvas.getStage().render()}play(t=!0){this._ticker.stop(),this._currTime=0,this.reset(),this._ticker.start((e=>{const n=this._scheduler.getTotalTime();let i=this._currTime+e;!t&&i>n&&(i=n,this._ticker.stop()),this.tickTo(i)}))}encodeToVideo(t,e){return sC(this,void 0,void 0,(function*(){return null}))}pause(){this._ticker.stop()}resume(){this._ticker._tick(this._currTime)}release(){}}fp.remTimeline(ca);class Xj{get canvas(){return this._canvas}constructor(t,e){this.id="test-mvp_"+Xj._id_++,this._canvas=new oj(this,IT(e.dom)?document.getElementById(e.dom):e.dom),this._player=new Yj(this,e.playerOption),this._characterTree=new sj(this),t&&this.load(t)}load(t){this._characterTree.initCharacters(t.characters),this._player.initActs(t.acts)}getCharacters(){return this._characterTree.getCharacters()}getCharactersById(t){return this._characterTree.getCharactersById(t)}play(t=!0){this._player.play(t)}tickTo(t){this._player.tickTo(t)}pause(){this._player.pause()}encodeToVideo(t,e,n){return sC(this,void 0,void 0,(function*(){return this._player.encodeToVideo(e,n)}))}getPlayer(){return this._player}release(){this._player.release(),this._canvas.release()}}Xj._id_=0;const Kj=new x((t=>{t(hC).toSelf().inSingletonScope(),t(cC).toService(hC),t(Mf).toService(cC),t(gC).to(gC).inSingletonScope(),t(Lk).toService(gC),t(ij).toSelf().inSingletonScope(),t(Mf).toService(ij)}));let qj=!1;function Zj(){qj||(qj=!0,aC.registerCharacter(ej.type,ej),aC.registerCharacter(nC.RECT,rC),aC.registerCharacter(nC.TEXT,fC),aC.registerCharacter(nC.RICH_TEXT,pC),aC.registerCharacter(nC.QIPAO,QT),aC.registerCharacter(nC.LINE,mC),aC.registerCharacter(nC.IMAGE,bC),aC.registerCharacter(nC.SHAPE,xC),aC.registerCharacter(nC.TIMELINE,aj),Hi.load(Kj))}Zj();const Jj={pointerup:!0,click:!0,dblclick:!0};var $j;t.EditActionEnum=void 0,($j=t.EditActionEnum||(t.EditActionEnum={})).singleSelection="singleSelect",$j.multipleSelection="multipleSelect";class Qj{get actionInProgress(){return this._actionInProgress}constructor(t){this.story=t,this.emitter=new dt,this._actionInProgress=null}onStoryEvent(e,n){if(e.detailPath&&e.path[e.path.length-1]!==e.detailPath[e.path.length-1]&&delete e.detailPath,!Jj[n])return this.dispatchAction({type:n,event:e});const{characterInfo:i,character:r}=this.story.canvas.getEventDetail(e);return this.dispatchAction({type:"click"===n&&r?t.EditActionEnum.singleSelection:n,characterId:null==r?void 0:r.id,character:r,event:e,detail:i})}dispatchAction(t){this.emitter.emit("dispatchAction",t)}}class tF{static registerEditComponent(t,e){tF.componentConstructorMap[t]=e}constructor(t){this.story=t,this._componentMap={},this.emitter=new dt,this.editAction=new Qj(t),this.editAction.emitter.on("dispatchAction",this.onAction.bind(this)),this.story.canvas.getStage().addEventListener("*",this.onStoryEvent.bind(this)),this._initEditGroup(),this._initComponent()}_initEditGroup(){this._editGroup=iu({});this.story.canvas.getStage().createLayer().add(this._editGroup)}getEditGroup(){return this._editGroup}_initComponent(){this._componentMap={},Object.keys(tF.componentConstructorMap).forEach((t=>{this._componentMap[t]=new tF.componentConstructorMap[t](this)})),this._componentList=Object.values(this._componentMap).sort(((t,e)=>t.level-e.level)).reverse()}onStoryEvent(t,e){this.editAction.onStoryEvent(t,e)}onAction(t){if(!this._currentComponent||!this._currentComponent.checkAction(t))for(let e=0;e<this._componentList.length;e++){const n=this._componentList[e];if(n.checkAction(t))return this.stopEdit(),void(this._currentComponent=n)}}startEdit(t){this.emitter.emit("startEdit",t)}triggerEditWithEvent(t){}triggerEditWithComponent(t,e){}stopEdit(){var t;null===(t=this._currentComponent)||void 0===t||t.editEnd(),this._currentComponent=null}release(){var t,e;null===(e=null===(t=this.story.canvas)||void 0===t?void 0:t.getStage)||void 0===e||e.call(t).removeEventListener("*",this.onStoryEvent)}}tF.componentConstructorMap={},Zj(),t.ACustomAnimate=ha,t.ARC3D_NUMBER_TYPE=Ls,t.ARC_NUMBER_TYPE=Is,t.AREA_NUMBER_TYPE=Ds,t.Animate=fa,t.AnimateGroup=$a,t.AnimateGroup1=Qa,t.Application=Bi,t.Arc=oh,t.Arc3d=uh,t.Arc3dRender=Ef,t.ArcRender=Cf,t.ArcRenderContribution=Bu,t.Area=ih,t.AreaRender=Rf,t.AreaRenderContribution=Mu,t.AttributeAnimate=Ja,t.AutoEnablePlugins=pv,t.BaseRender=zh,t.Basis=En,t.BeforeRenderConstribution=av,t.BoundsContext=$e,t.BoundsPicker=lv,t.CIRCLE_NUMBER_TYPE=js,t.Canvas3DDrawItemInterceptor=tv,t.CanvasArc3dPicker=bk,t.CanvasArcPicker=kk,t.CanvasAreaPicker=_k,t.CanvasCirclePicker=xk,t.CanvasFactory=Yi,t.CanvasGlyphPicker=Ok,t.CanvasGroupPicker=Ik,t.CanvasImagePicker=wk,t.CanvasLinePicker=Sk,t.CanvasPathPicker=Ak,t.CanvasPickerContribution=Lk,t.CanvasPolygonPicker=Bk,t.CanvasPyramid3dPicker=Mk,t.CanvasRect3dPicker=Ck,t.CanvasRectPicker=Tk,t.CanvasRichTextPicker=Pk,t.CanvasSymbolPicker=Ek,t.CanvasTextLayout=Zu,t.CanvasTextPicker=Rk,t.CbAnimate=da,t.Circle=Wu,t.CircleRender=Bf,t.CircleRenderContribution=Pu,t.ClipAngleAnimate=Ha,t.ClipDirectionAnimate=Xa,t.ClipGraphicAnimate=Va,t.ClipRadiusAnimate=Ya,t.ColorInterpolate=Tu,t.ColorStore=Eo,t.CommonRenderContribution=Gu,t.Container=J,t.ContainerModule=x,t.Context2dFactory=Xi,t.ContributionProvider=$,t.CurveContext=Qn,t.CustomEvent=qr,t.CustomPath2D=ei,t.CustomSymbolClass=wc,t.DebugDrawItemInterceptorContribution=$f,t.DefaultArcAllocate=eg,t.DefaultArcAttribute=pi,t.DefaultArcRenderContribution=Qh,t.DefaultAreaAllocate=ig,t.DefaultAreaAttribute=gi,t.DefaultAreaTextureRenderContribution=Sd,t.DefaultAttribute=vi,t.DefaultBaseBackgroundRenderContribution=qh,t.DefaultBaseTextureRenderContribution=Jh,t.DefaultCanvasAllocate=wr,t.DefaultCircleAllocate=ag,t.DefaultCircleAttribute=yi,t.DefaultCircleRenderContribution=id,t.DefaultConnectAttribute=di,t.DefaultDebugAttribute=fi,t.DefaultFillStyle=oi,t.DefaultGlyphAttribute=ki,t.DefaultGraphicAllocate=$p,t.DefaultGraphicMemoryManager=pg,t.DefaultGroupAttribute=mi,t.DefaultGroupBackgroundRenderContribution=sd,t.DefaultImageAttribute=Ei,t.DefaultImageBackgroundRenderContribution=gd,t.DefaultImageRenderContribution=yd,t.DefaultLayout=ri,t.DefaultLineAllocate=sg,t.DefaultLineAttribute=bi,t.DefaultMat4Allocate=wh,t.DefaultMatrixAllocate=xh,t.DefaultMorphingAnimateConfig=ma,t.DefaultPathAllocate=lg,t.DefaultPathAttribute=_i,t.DefaultPickStyle=ci,t.DefaultPolygonAttribute=xi,t.DefaultRect3dAttribute=Si,t.DefaultRectAllocate=Qp,t.DefaultRectAttribute=wi,t.DefaultRectRenderContribution=dd,t.DefaultRichTextAttribute=Ci,t.DefaultRichTextIconAttribute=Ri,t.DefaultStateAnimateConfig=ya,t.DefaultStrokeStyle=ui,t.DefaultStyle=hi,t.DefaultSymbolAllocate=hg,t.DefaultSymbolAttribute=Ai,t.DefaultSymbolRenderContribution=bd,t.DefaultTextAllocate=fg,t.DefaultTextAttribute=Ti,t.DefaultTextStyle=li,t.DefaultTicker=oa,t.DefaultTimeline=la,t.DefaultTransform=ai,t.DragNDrop=Vk,t.DrawContribution=Hf,t.DrawItemInterceptor=Kf,t.DynamicLayerHandlerContribution=cu,t.Edit=tF,t.EnvContribution=at,t.EventManager=Qr,t.EventSystem=na,t.EventTarget=ta,t.FORMAT_ELEMENT_COMMAND="FORMAT_ELEMENT_COMMAND",t.FORMAT_TEXT_COMMAND=Zp,t.FadeInPlus=ja,t.FederatedEvent=Hr,t.FederatedMouseEvent=Yr,t.FederatedPointerEvent=Xr,t.FederatedWheelEvent=Kr,t.Fragment=zk,t.GLYPH_NUMBER_TYPE=Fs,t.GRAPHIC_UPDATE_TAG_KEY=is,t.GROUP_NUMBER_TYPE=Ns,t.Generator=_,t.Gesture=Xk,t.GlobalPickerService=cv,t.Glyph=Gc,t.GlyphRender=Uf,t.Graphic=ls,t.GraphicAnimate=Wa,t.GraphicCreator=Js,t.GraphicPicker=sv,t.GraphicRender=Mf,t.GraphicService=Zs,t.GraphicUtil=su,t.Group=nu,t.GroupFadeIn=qa,t.GroupFadeOut=Za,t.GroupRender=Pf,t.GroupRenderContribution=Ou,t.HtmlAttributePlugin=up,t.IMAGE_NUMBER_TYPE=Gs,t.Image=Hc,t.ImageRender=Wf,t.ImageRenderContribution=Iu,t.IncreaseCount=Da,t.IncrementalDrawContribution=Tf,t.InputText=Fa,t.InteractiveDrawItemInterceptorContribution=Qf,t.InteractiveSubRenderContribution=zu,t.LINE_NUMBER_TYPE=zs,t.Layer=au,t.LayerService=uu,t.Line=Pc,t.LineRender=Of,t.Linear=Sn,t.LinearClosed=Vn,t.ManualTickHandler=ia,t.ManualTicker=sa,t.Mat4Allocate=bh,t.MathArcPicker=uk,t.MathAreaPicker=lk,t.MathCirclePicker=ck,t.MathGlyphPicker=mk,t.MathImagePicker=hk,t.MathLinePicker=dk,t.MathPathPicker=fk,t.MathPickerContribution=sk,t.MathPolygonPicker=yk,t.MathRectPicker=vk,t.MathSymbolPicker=pk,t.MathTextPicker=gk,t.MatrixAllocate=kh,t.Meteor=Ga,t.MonotoneX=Ln,t.MonotoneY=Dn,t.MorphingPath=Vo,t.MotionPath=za,t.MultiToOneMorphingPath=Xo,t.NOWORK_ANIMATE_ATTR=us,t.Node=Vr,t.PATH_NUMBER_TYPE=Us,t.POLYGON_NUMBER_TYPE=Ws,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=Vs,t.Path=th,t.PathRender=If,t.PathRenderContribution=Lu,t.PickItemInterceptor=dv,t.PickerService=uv,t.PluginService=gv,t.Polygon=hh,t.PolygonRender=Lf,t.PolygonRenderContribution=Du,t.Pyramid3d=fh,t.Pyramid3dRender=zf,t.RAFTickHandler=aa,t.REACT_TO_CANOPUS_EVENTS=Dk,t.REACT_TO_CANOPUS_EVENTS_LIST=jk,t.RECT3D_NUMBER_TYPE=Ys,t.RECT_NUMBER_TYPE=Hs,t.RICHTEXT_NUMBER_TYPE=Xs,t.RafBasedSTO=Pa,t.ReactAttributePlugin=Sp,t.Rect=Lc,t.Rect3DRender=jf,t.Rect3d=Fc,t.RectRender=Df,t.RectRenderContribution=ju,t.ReflectSegContext=_n,t.RenderSelector=Vf,t.RenderService=rv,t.ResourceLoader=Qo,t.RichText=Jc,t.RichTextEditPlugin=Jp,t.RichTextRender=Gf,t.RotateBySphereAnimate=Ka,t.SVG_ATTRIBUTE_MAP=$s,t.SVG_ATTRIBUTE_MAP_KEYS=Qs,t.SVG_PARSE_ATTRIBUTE_MAP=tu,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=eu,t.SYMBOL_NUMBER_TYPE=Ks,t.SegContext=bn,t.ShadowRoot=ph,t.ShadowRootDrawItemInterceptorContribution=Jf,t.Stage=Tp,t.StaticLayerHandlerContribution=lu,t.Step=zn,t.Story=Xj,t.StreamLight=Na,t.SubAnimate=pa,t.Symbol=Rc,t.SymbolRender=Ff,t.SymbolRenderContribution=Fu,t.TEXT_NUMBER_TYPE=qs,t.TagPointsUpdate=Ua,t.Text=$u,t.TextMeasureContribution=Vi,t.TextRender=Nf,t.TextRenderContribution=Nu,t.Theme=Nr,t.TimeOutTickHandler=ra,t.TransformUtil=ou,t.VArc=function(t){return Fh.arc(t?t.attribute:{})},t.VArc3d=function(t){return Fh.arc3d(t?t.attribute:{})},t.VArea=function(t){return Fh.area(t?t.attribute:{})},t.VCircle=function(t){return Fh.circle(t?t.attribute:{})},t.VGlobal=ot,t.VGlyph=function(t){return Fh.glyph(t?t.attribute:{})},t.VGroup=function(t){return Fh.group(t?t.attribute:{})},t.VImage=function(t){return Fh.image(t?t.attribute:{})},t.VLine=function(t){return Fh.line(t?t.attribute:{})},t.VPath=function(t){return Fh.path(t?t.attribute:{})},t.VPolygon=function(t){return Fh.polygon(t?t.attribute:{})},t.VPyramid3d=function(t){return Fh.pyramid3d(t?t.attribute:{})},t.VRect=function(t){return Fh.rect(t?t.attribute:{})},t.VRect3d=function(t){return Fh.rect3d(t?t.attribute:{})},t.VRichText=Fk,t.VSymbol=function(t){return Fh.symbol(t?t.attribute:{})},t.VText=function(t){return Fh.text(t?t.attribute:{})},t.VWindow=Cr,t.VirtualLayerHandlerContribution=hu,t.WILDCARD="*",t.WindowHandlerContribution=Er,t.WrapText=el,t.XMLParser=ks,t._interpolateColor=Mo,t._registerArc=HA,t.addArcToBezierPath=un,t.addAttributeToPrototype=function(t,e,n){n.forEach((function(n){e.prototype[n]=t[n]}))},t.alignBezierCurves=so,t.alignSubpath=eo,t.application=Mi,t.applyTransformOnBezierCurves=co,t.arc3dCanvasPickModule=jA,t.arc3dModule=Qg,t.arcCanvasPickModule=dS,t.arcMathPickModule=Xb,t.arcModule=mg,t.areaCanvasPickModule=OS,t.areaMathPickModule=Qb,t.areaModule=Sg,t.bezier=on,t.bezierCurversToPath=ho,t.binarySplitPolygon=So,t.bindContributionProvider=et,t.bindContributionProviderNoSingletonScope=nt,t.boundStroke=Ss,t.browserEnvModule=xb,t.builtInSymbolStrMap=Tc,t.builtinSymbols=Sc,t.builtinSymbolsMap=Ac,t.calcLineCache=ti,t.calculateLineHeight=La,t.canvasAllocate=Sr,t.centroidOfSubpath=ro,t.circleBounds=Aa,t.circleCanvasPickModule=HS,t.circleMathPickModule=a_,t.circleModule=Eg,t.clock=Zr,t.cloneGraphic=Zo,t.colorEqual=function(t,e){var n=Ee.parseColorString(t),i=Ee.parseColorString(e);return!(!n||!i)&&n.r===i.r&&n.g===i.g&&n.b===i.b&&n.opacity===i.opacity},t.colorStringInterpolationToStr=Fo,t.container=Hi,t.cornerTangents=wu,t.createArc=sh,t.createArc3d=lh,t.createArea=rh,t.createCircle=Vu,t.createColor=Hh,t.createConicalGradient=Ru,t.createGlyph=zc,t.createGroup=iu,t.createImage=Yc,t.createImageElement=_b,t.createLine=Oc,t.createMat4=_h,t.createPath=eh,t.createPolygon=dh,t.createPyramid3d=vh,t.createRect=Dc,t.createRect3d=Nc,t.createRectPath=cd,t.createRichText=$c,t.createShadowRoot=gh,t.createStage=Cp,t.createSymbol=Bc,t.createText=Qu,t.createWrapText=nl,t.cubicCalc=vn,t.cubicLength=fn,t.cubicPointAt=pn,t.cubicSubdivide=to,t.decodeReactDom=Uk,t.defaultArcAllocate=ng,t.defaultArcBackgroundRenderContribution=nd,t.defaultArcRenderContribution=td,t.defaultArcTextureRenderContribution=ed,t.defaultAreaAllocate=rg,t.defaultBaseBackgroundRenderContribution=Zh,t.defaultBaseTextureRenderContribution=$h,t.defaultCircleAllocate=og,t.defaultCircleBackgroundRenderContribution=od,t.defaultCircleRenderContribution=rd,t.defaultCircleTextureRenderContribution=ad,t.defaultGraphicMemoryManager=gg,t.defaultGroupBackgroundRenderContribution=ud,t.defaultImageBackgroundRenderContribution=kd,t.defaultImageRenderContribution=md,t.defaultLineAllocate=ug,t.defaultPathAllocate=cg,t.defaultRectAllocate=tg,t.defaultRectBackgroundRenderContribution=pd,t.defaultRectRenderContribution=fd,t.defaultRectTextureRenderContribution=vd,t.defaultSymbolAllocate=dg,t.defaultSymbolBackgroundRenderContribution=wd,t.defaultSymbolRenderContribution=_d,t.defaultSymbolTextureRenderContribution=xd,t.defaultTextAllocate=vg,t.defaultTicker=fp,t.defaultTimeline=ca,t.drawArc=sn,t.drawArcPath=Su,t.drawAreaSegments=Dd,t.drawIncrementalAreaSegments=Id,t.drawIncrementalSegments=Od,t.drawPathProxy=_u,t.drawSegments=Pd,t.enumCommandMap=nn,t.feishuEnvModule=ox,t.fillVisible=yu,t.findBestMorphingRotation=oo,t.findNextGraphic=jv,t.flatten_simplify=function(t,e,n){if(t.length<=10)return t;var i=void 0!==e?e*e:1;return Yp(t=n?t:function(t,e){for(var n,i,r=t[0].x,a=t[0].y,o=[t[0]],s=1,u=t.length;s<u;s++)(n=t[s].x-r)*n+(i=t[s].y-a)*i>e&&(r=t[s].x,a=t[s].y,o.push(t[s]));return t[t.length-1].x===r&&t[t.length-1].y===a||o.push(t[t.length-1]),o}(t,i),i)},t.foreach=Lv,t.foreachAsync=Dv,t.genBasisSegments=Bn,t.genBasisTypeSegments=Rn,t.genLinearClosedSegments=Hn,t.genLinearClosedTypeSegments=Yn,t.genLinearSegments=An,t.genLinearTypeSegments=Tn,t.genMonotoneXSegments=Fn,t.genMonotoneXTypeSegments=jn,t.genMonotoneYSegments=Gn,t.genMonotoneYTypeSegments=Nn,t.genNumberType=Cs,t.genStepSegments=Un,t.genStepTypeSegments=Wn,t.getAttributeFromDefaultAttrList=Ma,t.getConicGradientAt=Eu,t.getContextFont=Hu,t.getCurrentEnv=function(){return xp()?"browser":"node"},t.getExtraModelMatrix=function(t,e,n){var i=n.attribute,r=i.alpha,a=i.beta;if(!r&&!a)return null;var o=n.attribute.anchor3d,s=void 0===o?n.attribute.anchor:o,u=[0,0];if(s){if("string"==typeof s[0]){var l=parseFloat(s[0])/100,c=n.AABBBounds;u[0]=c.x1+(c.x2-c.x1)*l}else u[0]=s[0];if("string"==typeof s[1]){var h=parseFloat(s[1])/100,d=n.AABBBounds;u[1]=d.x1+(d.x2-d.x1)*h}else u[1]=s[1]}if("text"===n.type){var f=n.attribute.textAlign;u[0]+=Xu(f,n.clipedWidth)}u[0]+=t,u[1]+=e;var v=Ah.allocate();return Mh(v,v,[u[0],u[1],0]),a&&Rh(v,v,a),r&&Bh(v,v,r),Mh(v,v,[-u[0],-u[1],0]),v},t.getModelMatrix=Ih,t.getRichTextBounds=function(t){return jh||(jh=Fh.CreateGraphic("richtext",{})),jh.setAttributes(t),jh.AABBBounds},t.getScaledStroke=Vh,t.getTextBounds=Nh,t.getTheme=zr,t.getThemeFromGroup=Ur,t.globalTheme=Gr,t.glyphCanvasPickModule=pA,t.glyphMathPickModule=h_,t.glyphModule=Fg,t.graphicCreator=Fh,t.graphicService=ip,t.graphicUtil=ep,t.harmonyEnvModule=aS,t.imageCanvasPickModule=AA,t.imageMathPickModule=p_,t.imageModule=Hg,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.initAllEnv=function(){Sw(Hi)},t.initBrowserEnv=function(){wb(Hi)},t.initFeishuEnv=function(){sx(Hi)},t.initHarmonyEnv=function(){oS(Hi)},t.initLynxEnv=function(){Tx(Hi)},t.initNodeEnv=function(){Ux(Hi)},t.initTTEnv=function(){Ww(Hi)},t.initTaroEnv=function(){aw(Hi)},t.initWxEnv=function(){ww(Hi)},t.inject=O,t.injectable=L,t.interpolateColor=Bo,t.interpolateGradientConicalColor=Io,t.interpolateGradientLinearColor=Po,t.interpolateGradientRadialColor=Oo,t.interpolatePureColorArray=Lo,t.intersect=xu,t.isBrowserEnv=xp,t.isNodeEnv=wp,t.isSvg=bs,t.isTransformKey=Ba,t.isXML=_s,t.jsx=function(t,e){var n=e||{};n.key,n.name,n.id;var i=n.attribute,r=n.stateProxy,a=Nk(n,["key","name","id","attribute","stateProxy"]),o=t;xt(t)&&(o=Fh[t]);for(var s=[],u=arguments.length,l=new Array(u>2?u-2:0),c=2;c<u;c++)l[c-2]=arguments[c];l.length&&Gk(1===l.length?l[0]:l,s);var h="Group"===o.name?new o(i):o(e);return function(t,e,n){var i,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":i=t.attribute||{},e[0]&&(i.text=e[0]);break;default:r=!0}r?(e.forEach((function(e){e&&t.add(e)})),Object.keys(n).forEach((function(e){var i=Dk[e];i&&t.on(i,n[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((function(t){return t.attribute})).filter((function(t){return t})))}(h,s,a),r&&(h.stateProxy=r),h},t.layerService=rp,t.lineCanvasPickModule=CS,t.lineMathPickModule=__,t.lineModule=xg,t.loadAllEnv=Sw,t.loadAllModule=Aw,t.loadBrowserEnv=wb,t.loadFeishuEnv=sx,t.loadHarmonyEnv=oS,t.loadLynxEnv=Tx,t.loadNodeEnv=Ux,t.loadTTEnv=Ww,t.loadTaroEnv=aw,t.loadWxEnv=ww,t.lookAt=pp,t.lynxEnvModule=Ax,t.mat3Tomat4=Ph,t.mat4Allocate=Ah,t.matrixAllocate=Sh,t.morphPath=Ho,t.multiInject=I,t.multiToOneMorph=$o,t.multiply=yp,t.multiplyMat4Mat3=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],d=e[9],f=e[10],v=e[11],p=e[12],g=e[13],y=e[14],m=e[15],k=n.a,b=n.b,_=0,x=0;return t[0]=k*i+b*s+_*h+x*p,t[1]=k*r+b*u+_*d+x*g,t[2]=k*a+b*l+_*f+x*y,t[3]=k*o+b*c+_*v+x*m,k=n.c,b=n.d,_=0,x=0,t[4]=k*i+b*s+_*h+x*p,t[5]=k*r+b*u+_*d+x*g,t[6]=k*a+b*l+_*f+x*y,t[7]=k*o+b*c+_*v+x*m,k=0,b=0,_=1,x=0,t[8]=k*i+b*s+_*h+x*p,t[9]=k*r+b*u+_*d+x*g,t[10]=k*a+b*l+_*f+x*y,t[11]=k*o+b*c+_*v+x*m,k=n.e,b=n.f,_=0,x=1,t[12]=k*i+b*s+_*h+x*p,t[13]=k*r+b*u+_*d+x*g,t[14]=k*a+b*l+_*f+x*y,t[15]=k*o+b*c+_*v+x*m,t},t.multiplyMat4Mat4=Oh,t.named=D,t.newThemeObj=Dr,t.nodeEnvModule=zx,t.oneToMultiMorph=Yo,t.ortho=gp,t.parsePadding=xa,t.parseStroke=ba,t.parseSvgPath=rn,t.pathCanvasPickModule=iA,t.pathMathPickModule=O_,t.pathModule=Pg,t.pathToBezierCurves=lo,t.point=Cn,t.pointEqual=Ta,t.pointInterpolation=Ca,t.pointInterpolationHighPerformance=function(t,e,n,i){var r=ae(t.x,t.y,e.x,e.y,n),a=r.x,o=r.y,s=ae(t.x1,t.y1,e.x1,e.y1,n),u=s.x,l=s.y;return i.x=a,i.y=o,i.x1=u,i.y1=l,i.defined=e.defined,i},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((function(t,n){return Ta(t,e[n])})):!Number.isNaN(t.x+t.y)&&Ta(t,e))},t.pointsInterpolation=Ea,t.polygonCanvasPickModule=lA,t.polygonMathPickModule=C_,t.polygonModule=Ig,t.preLoadAllModule=Qv,t.pyramid3dCanvasPickModule=WA,t.pyramid3dModule=iy,t.rafBasedSto=Ia,t.rect3dCanvasPickModule=MA,t.rect3dModule=qg,t.rectCanvasPickModule=kS,t.rectFillVisible=mu,t.rectMathPickModule=G_,t.rectModule=bg,t.rectStrokeVisible=bu,t.recursiveCallBinarySplit=Ao,t.registerArc=YA,t.registerArc3d=KA,t.registerArc3dGraphic=ay,t.registerArcGraphic=ry,t.registerArea=ZA,t.registerAreaGraphic=oy,t.registerCharacter=Zj,t.registerCircle=$A,t.registerCircleGraphic=sy,t.registerGlyph=tT,t.registerGlyphGraphic=uy,t.registerGroup=nT,t.registerGroupGraphic=ly,t.registerImage=rT,t.registerImageGraphic=cy,t.registerLine=oT,t.registerLineGraphic=hy,t.registerPath=uT,t.registerPathGraphic=dy,t.registerPolygon=cT,t.registerPolygonGraphic=fy,t.registerPyramid3d=dT,t.registerPyramid3dGraphic=vy,t.registerRect=vT,t.registerRect3d=gT,t.registerRect3dGraphic=gy,t.registerRectGraphic=py,t.registerRichtext=mT,t.registerRichtextGraphic=yy,t.registerShadowRoot=bT,t.registerShadowRootGraphic=by,t.registerSymbol=xT,t.registerSymbolGraphic=my,t.registerText=ST,t.registerTextGraphic=ky,t.registerWrapText=TT,t.registerWrapTextGraphic=_y,t.renderCommandList=cn,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richTextMathPickModule=U_,t.richtextCanvasPickModule=_A,t.richtextModule=Wg,t.rotateX=Rh,t.rotateY=Bh,t.roughModule=CT,t.runFill=pu,t.runStroke=gu,t.segments=an,t.shouldUseMat4=Lh,t.snapLength=dn,t.splitArc=go,t.splitArea=ko,t.splitCircle=yo,t.splitGraphic=Jo,t.splitLine=bo,t.splitPath=Co,t.splitPolygon=To,t.splitRect=po,t.splitToGrids=vo,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=ku,t.symbolCanvasPickModule=NS,t.symbolMathPickModule=K_,t.symbolModule=Tg,t.taroEnvModule=rw,t.textAttributesToStyle=qu,t.textCanvasPickModule=JS,t.textDrawOffsetX=Xu,t.textDrawOffsetY=Yu,t.textLayoutOffsetY=Ku,t.textMathPickModule=$_,t.textModule=Bg,t.transformKeys=Ra,t.transformMat4=mp,t.transformUtil=np,t.translate=Mh,t.ttEnvModule=Uw,t.version="0.19.24-alpha.1",t.verticalLayout=Es,t.vglobal=tp,t.waitForAllSubLayers=ws,t.wrapCanvas=Ki,t.wrapContext=function(t,e){return Hi.getNamed(Xi,Mi.global.env)(t,e)},t.wxEnvModule=xw,t.xul=function(t){var e=wt(t)?t[0]:t,n=[];if(!e)return n;if(!0===_s(e)){var i=(new ks).parse(e);i.tc&&Object.keys(i.tc).forEach((function(t){"text"===t?n.push(function(t){var e={text:""};Ps(t,e);var n=t["#text"];return n&&(e.text=n),e}(i.tc[t])):n.push(function(t){var e={image:"",width:0,height:0};Ps(t,e);var n=e.image;return n&&(e.image=n.replaceAll("&quot",'"').replaceAll("&lt","<").replaceAll("&gt",">")),e}(i.tc[t]))}))}return n}}));