UNPKG

@visactor/lark-vchart

Version:

VChart 飞书小程序组件

16 lines (14 loc) 2.24 MB
!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function i(t,e,i){return e=u(e),f(t,h()?Reflect.construct(e,i||[],u(t).constructor):e.apply(t,i))}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k(n.key),n)}}function a(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function o(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=x(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},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(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==i.return||i.return()}finally{if(s)throw a}}}}function s(t,e,i){return(e=k(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(){return l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}},l.apply(null,arguments)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(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&&g(t,e)}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(h=function(){return!!t})()}function d(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function v(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?d(Object(i),!0).forEach((function(e){s(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function f(t,i){if(i&&("object"==typeof i||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return e(t)}function p(){p=function(){return e};var t,e={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,i){return t[e]=i}}function c(t,e,i,n){var a=e&&e.prototype instanceof m?e:m,o=Object.create(a.prototype),s=new P(n||[]);return r(o,"_invoke",{value:T(t,i,s)}),o}function h(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var d="suspendedStart",v="suspendedYield",f="executing",g="completed",y={};function m(){}function _(){}function k(){}var b={};u(b,o,(function(){return this}));var x=Object.getPrototypeOf,S=x&&x(x(R([])));S&&S!==i&&n.call(S,o)&&(b=S);var A=k.prototype=m.prototype=Object.create(b);function w(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function M(t,e){function i(r,a,o,s){var l=h(t[r],t,a);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(c).then((function(t){u.value=t,o(u)}),(function(t){return i("throw",t,o,s)}))}s(l.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function T(e,i,n){var r=d;return function(a,o){if(r===f)throw Error("Generator is already running");if(r===g){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var l=C(s,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=h(e,i,n);if("normal"===u.type){if(r=n.done?g:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=g,n.method="throw",n.arg=u.arg)}}}function C(e,i){var n=i.method,r=e.iterator[n];if(r===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,C(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=h(r,e.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,y;var o=a.arg;return o?o.done?(i[e.resultName]=o.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function R(e){if(e||""===e){var i=e[o];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function i(){for(;++r<e.length;)if(n.call(e,r))return i.value=e[r],i.done=!1,i;return i.value=t,i.done=!0,i};return a.next=a}}throw new TypeError(typeof e+" is not iterable")}return _.prototype=k,r(A,"constructor",{value:k,configurable:!0}),r(k,"constructor",{value:_,configurable:!0}),_.displayName=u(k,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,u(t,l,"GeneratorFunction")),t.prototype=Object.create(A),t},e.awrap=function(t){return{__await:t}},w(M.prototype),u(M.prototype,s,(function(){return this})),e.AsyncIterator=M,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var o=new M(c(t,i,n,r),a);return e.isGeneratorFunction(i)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},w(A),u(A,l,"Generator"),u(A,o,(function(){return this})),u(A,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=R,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(B),!e)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function r(n,r){return s.type="throw",s.arg=e,i.next=n,r&&(i.method="next",i.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 r("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;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 i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),B(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;B(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:R(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function g(t,e){return g=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},g(t,e)}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,a,o,s=[],l=!0,u=!1;try{if(a=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=a.call(i)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){u=!0,r=t}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(u)throw r}}return s}}(t,e)||x(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e,i,n){var r=l(u(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof r?function(t){return r.apply(i,t)}:r}function _(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||x(e)||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 k(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function b(t){return b="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},b(t)}function x(e,i){if(e){if("string"==typeof e)return t(e,i);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,i):void 0}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function S(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var A={exports:{}};(function(t){ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ function r(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i}function l(t,e,i,n){return new(i||(i=Promise))((function(r,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,s)}l((n=n.apply(t,e||[])).next())}))}var u,d,v=function(t){return t};function k(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}t.RenderModeEnum=void 0,(u=t.RenderModeEnum||(t.RenderModeEnum={}))["desktop-browser"]="desktop-browser",u["mobile-browser"]="mobile-browser",u.node="node",u.worker="worker",u.miniApp="miniApp",u.wx="wx",u.tt="tt",u.harmony="harmony",u["desktop-miniApp"]="desktop-miniApp",u.lynx="lynx",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"}(d||(d={}));var x={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new r(n,a||t,o),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],s]:t._events[l].push(s):(t._events[l]=s,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),s.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,a=n.length,o=new Array(a);r<a;r++)o[r]=n[r].fn;return o},s.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},s.prototype.emit=function(t,e,n,r,a,o){var s=i?i+t:t;if(!this._events[s])return!1;var l,u,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,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,a),!0;case 6:return c.fn.call(c.context,e,n,r,a,o),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];c.fn.apply(c.context,l)}else{var d,v=c.length;for(u=0;u<v;u++)switch(c[u].once&&this.removeListener(t,c[u].fn,void 0,!0),h){case 1:c[u].fn.call(c[u].context);break;case 2:c[u].fn.call(c[u].context,e);break;case 3:c[u].fn.call(c[u].context,e,n);break;case 4:c[u].fn.call(c[u].context,e,n,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];c[u].fn.apply(c[u].context,l)}}return!0},s.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},s.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},s.prototype.removeListener=function(t,e,n,r){var a=i?i+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||n&&s.context!==n||o(this,a);else{for(var l=0,u=[],c=s.length;l<c;l++)(s[l].fn!==e||r&&!s[l].once||n&&s[l].context!==n)&&u.push(s[l]);u.length?this._events[a]=1===u.length?u[0]:u:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=i,s.EventEmitter=s,t.exports=s}(x);var S=k(x.exports),A=function(t,e){return Object.prototype.toString.call(t)==="[object ".concat(e,"]")},w=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||A(t,"Boolean")},M=function(t){return"function"==typeof t},T=function(t){return null==t},C=function(t){return null!=t},E=function(t){var e=b(t);return null!==t&&"object"===e||"function"===e},B=function(t){return"object"==b(t)&&null!==t},P=function(t){if(!B(t)||!A(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},R=function(t){return void 0===t},I=function(t){var e=b(t);return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||A(t,"String")},O=function(t){return Array.isArray?Array.isArray(t):A(t,"Array")},L=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},D=function(t){return A(t,"Date")},F=function(t){var e=b(t);return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||A(t,"Number")},j=function(t){return"string"==typeof t&&!isNaN(Number(t))&&!isNaN(parseFloat(t))},z=function(t){return F(t)&&Number.isFinite(t)},H=function(t){return new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t)},N=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)},V=function(t){return{}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")},G=Object.prototype,W=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||G)},U=Object.prototype.hasOwnProperty;function Y(t){if(T(t))return!0;if(L(t))return!t.length;var e=V(t);if("Map"===e||"Set"===e)return!t.size;if(W(t))return!Object.keys(t).length;for(var i in t)if(U.call(t,i))return!1;return!0}var X=function(t,e,i){for(var n=I(e)?e.split("."):e,r=0;r<n.length;r++)t=t?t[n[r]]:void 0;return void 0===t?i:t},K=Object.prototype.hasOwnProperty,q=function(t,e){return null!=t&&K.call(t,e)};function Z(t,e,i){var n;if(!C(t)||"object"!=b(t)||e&&e(t))return t;var r=O(t),a=t.length;n=r?new Array(a):"object"==b(t)?{}:w(t)||F(t)||I(t)?t:D(t)?new Date(+t):void 0;var o=r?void 0:Object.keys(Object(t)),s=-1;if(n)for(;++s<(o||t).length;){var l=o?o[s]:s,u=t[l];i&&i.includes(l.toString())?n[l]=u:n[l]=Z(u,e,i)}return n}function J(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(C(e)&&"object"==b(e)){var r=Object(e),a=[];for(var o in r)a.push(o);for(var s=a.length,l=-1;s--;){var u=a[++l];!C(r[u])||"object"!=b(r[u])||n&&O(t[u])?$(t,u,r[u]):Q(t,e,u,i,n)}}}}function Q(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=t[i],o=e[i],s=e[i],l=!0;if(O(o)){if(n)s=[];else if(O(a))s=a;else if(L(a)){s=new Array(a.length);for(var u=-1,c=a.length;++u<c;)s[u]=a[u]}}else P(o)?(s=null!=a?a:{},"function"!=typeof a&&"object"==b(a)||(s={})):l=!1;l&&J(s,o,n,r),$(t,i,s)}function $(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function et(t){for(var e=-1,i=arguments.length<=1?0:arguments.length-1;++e<i;)J(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function it(t,e){if(!t||!P(t))return t;var i={};return Object.keys(t).forEach((function(n){var r=t[n],a=!1;e.forEach((function(t){(I(t)&&t===n||t instanceof RegExp&&n.match(t))&&(a=!0)})),a||(i[n]=r)})),i}function nt(t){return Object.prototype.toString.call(t)}function rt(t){return Object.keys(t)}function at(t,e,i){if(t===e)return!0;if(b(t)!=b(e))return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(nt(t)!==nt(e))return!1;if(M(t))return!!(null==i?void 0:i.skipFunction);if("object"!=b(t))return!1;if(O(t)){if(t.length!==e.length)return!1;for(var n=t.length-1;n>=0;n--)if(!at(t[n],e[n],i))return!1;return!0}if(!P(t))return!1;var r=rt(t),a=rt(e);if(r.length!==a.length)return!1;r.sort(),a.sort();for(var o=r.length-1;o>=0;o--)if(r[o]!=a[o])return!1;for(var s=r.length-1;s>=0;s--){var l=r[s];if(!at(t[l],e[l],i))return!1}return!0}function ot(t,e,i){for(var n=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e),r=0;r<n.length;r++){var a=n[r];(i?null!=e[a]:null==t[a])&&(t[a]=e[a])}return t}function st(t,e){var i=!(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 n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var a=n[r];"constructor"!==a&&(i?null!=e[a]:null==t[a])&&(t[a]=e[a])}else ot(t,e,i)}function lt(t){return C(t)?O(t)?t:[t]:[]}function ut(t){if(L(t))return t[t.length-1]}var ct=function(t,e){var i;if(0!==t.length){for(var n=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(i=null==e?void 0:e(a,n))&&void 0!==i?i:a-n)>0&&(n=a)}return n}},ht=function(t,e){var i;if(0!==t.length){for(var n=t[0],r=1;r<t.length;r++){var a=t[r];(null!==(i=null==e?void 0:e(a,n))&&void 0!==i?i:a-n)<0&&(n=a)}return n}};function dt(t,e){if(!O(t)||!O(e))return!1;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}function vt(t){for(var e,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Math.random,r=t.length;r;)e=Math.floor(n()*r),i=t[--r],t[r]=t[e],t[e]=i;return t}function ft(t){if(!O(t))return[t];var e,i=[],n=o(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;i.push.apply(i,_(ft(r)))}}catch(t){n.e(t)}finally{n.f()}return i}function pt(t,e,i){C(e)||(e=t,t=0),C(i)||(i=1);for(var n=-1,r=0|Math.max(0,Math.ceil((e-t)/i)),a=new Array(r);++n<r;)a[n]=t+n*i;return a}function gt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function yt(t){return Number(t)}var mt,_t="undefined"!=typeof console;function kt(t,e,i){var n=[e].concat([].slice.call(i));_t&&console[t].apply(console,n)}!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"}(mt||(mt={}));var bt=function(){function t(){n(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:mt.None,i=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=e,this._method=i}return a(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),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((function(t){return t.apply(void 0,e)}))}},{key:"canLogInfo",value:function(){return this._level>=mt.Info}},{key:"canLogDebug",value:function(){return this._level>=mt.Debug}},{key:"canLogError",value:function(){return this._level>=mt.Error}},{key:"canLogWarn",value:function(){return this._level>=mt.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,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=mt.Error&&(this._onErrorHandler.length?this.callErrorHandler.apply(this,i):kt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}},{key:"warn",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Warn&&kt(this._method||"warn","WARN",e),this}},{key:"info",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Info&&kt(this._method||"log","INFO",e),this}},{key:"debug",value:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=mt.Debug&&kt(this._method||"log","DEBUG",e),this}}],[{key:"getInstance",value:function(e,i){return t._instance&&F(e)?t._instance.level(e):t._instance||(t._instance=new t(e,i)),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 xt(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;for(T(n)&&(n=t.length);i<n;){var r=i+n>>>1;gt(t[r],e)>0?n=r:i=r+1}return i}bt._instance=null;var St=function(t,e){return At(0,t.length,(function(i){return e(t[i])}))},At=function(t,e,i){for(var n=t,r=e;n<r;){var a=Math.floor((n+r)/2);i(a)>=0?r=a:n=a+1}return n},wt=function(t,e){var i=t;return!0!==e&&(i=t.sort(gt)),function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:yt,n=t.length;if(n){if(e<=0||n<2)return i(t[0],0,t);if(e>=1)return i(t[n-1],n-1,t);var r=(n-1)*e,a=Math.floor(r),o=i(t[a],a,t);return o+(i(t[a+1],a+1,t)-o)*(r-a)}}(i,.5)},Mt=1e-10,Tt=1e-10;function Ct(t,e){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mt,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Tt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}function Et(t,e,i,n){return t>e&&!Ct(t,e,i,n)}function Bt(t,e,i,n){return t<e&&!Ct(t,e,i,n)}var Pt=function(t){var e=null,i=null;return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e&&r.every((function(t,i){return t===e[i]}))||(e=r,i=t.apply(void 0,r)),i}},Rt=function(t,e,i){return t<e?e:t>i?i:t},It=function(t,e,i){var n=y(t,2),r=n[0],a=n[1];a<r&&(r=t[1],a=t[0]);var o=a-r;return o>=i-e?[e,i]:[r=Math.min(Math.max(r,e),i-o),r+o]};function Ot(t,e){var i;return t>e&&(i=t,t=e,e=i),function(i){return Math.max(t,Math.min(e,i))}}var Lt=!1;try{Lt="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){Lt=!1}function Dt(t,e,i){var n,r,a,o,s,l,u=0,c=!1,h=!1,d=!0,v=!e&&0!==e&&Lt;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var i=n,a=r;return n=r=void 0,u=e,o=t.apply(a,i)}function p(t,e){return v?(cancelAnimationFrame(s),requestAnimationFrame(t)):setTimeout(t,e)}function g(t){var i=t-l;return void 0===l||i>=e||i<0||h&&t-u>=a}function y(){var t=Date.now();if(g(t))return m(t);s=p(y,function(t){var i=t-u,n=e-(t-l);return h?Math.min(n,a-i):n}(t))}function m(t){return s=void 0,d&&n?f(t):(n=r=void 0,o)}function _(){for(var t=Date.now(),i=g(t),a=arguments.length,d=new Array(a),v=0;v<a;v++)d[v]=arguments[v];if(n=d,r=this,l=t,i){if(void 0===s)return function(t){return u=t,s=p(y,e),c?f(t):o}(l);if(h)return s=p(y,e),f(l)}return void 0===s&&(s=p(y,e)),o}return e=+e||0,E(i)&&(c=!!i.leading,(h="maxWait"in i)&&(a=Math.max(z(i.maxWait)?i.maxWait:0,e)),d="trailing"in i?!!i.trailing:d),_.cancel=function(){void 0!==s&&function(t){if(v)return cancelAnimationFrame(t);clearTimeout(t)}(s),u=0,n=l=r=s=void 0},_.flush=function(){return void 0===s?o:m(Date.now())},_.pending=function(){return void 0!==s},_}function Ft(t,e,i){var n=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return E(i)&&(n="leading"in i?!!i.leading:n,r="trailing"in i?!!i.trailing:r),Dt(t,e,{leading:n,trailing:r,maxWait:e})}function jt(t,e){return function(i){return t*(1-i)+e*i}}function zt(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}Lt=!1;var Ht=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nt=new RegExp(Ht.source,"g");function Vt(t){if(z(t))return t;var e=+t;return z(e)?e:0}var Gt=1e-12,Wt=Math.PI,Ut=Wt/2,Yt=2*Wt,Xt=2*Math.PI,Kt=Math.abs,qt=Math.atan2,Zt=Math.cos,Jt=Math.max,Qt=Math.min,$t=Math.sin,te=Math.sqrt,ee=Math.pow;function ie(t){return t>=1?Ut:t<=-1?-Ut:Math.asin(t)}function ne(t,e,i,n,r){var a=i,o=n;return"number"==typeof t&&"number"==typeof i&&(a=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(o=(1-r)*e+r*n),{x:a,y:o}}function re(t,e){return t[0]*e[1]-t[1]*e[0]}function ae(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return Math.round(t*e)/e}function oe(t){var e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}function se(t,e){return ae(t+e,Math.pow(10,Math.max(oe(t),oe(e))))}function le(t,e){return ae(t-e,Math.pow(10,Math.max(oe(t),oe(e))))}var ue=function(){function t(){n(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=e,this.y=i,this.x1=r,this.y1=a}return a(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 F(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}},{key:"sub",value:function(t){return F(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("暂不支持")}}])}(),ce=function(){function t(){n(this,t)}return a(t,null,[{key:"distancePP",value:function(t,e){return te(ee(t.x-e.x,2)+ee(t.y-e.y,2))}},{key:"distanceNN",value:function(t,e,i,n){return te(ee(t-i,2)+ee(e-n,2))}},{key:"distancePN",value:function(t,e,i){return te(ee(e-t.x,2)+ee(i-t.y,2))}},{key:"pointAtPP",value:function(t,e,i){return new ue((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}])}();function he(t){return t*(Math.PI/180)}function de(t){return 180*t/Math.PI}var ve,fe=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Yt;)t+=Yt;else if(t>0)for(;t>Yt;)t-=Yt;return t};function pe(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function ge(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:0,y:0},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2*Math.PI,r=t.x,a=t.y,o=r-e.x,s=a-e.y,l=Math.sqrt(o*o+s*s);if(0===l)return{radius:0,angle:0};o/=l,s/=l;var u=Math.atan2(s,o);if(u<i)for(;u<=i;)u+=2*Math.PI;if(u>n)for(;u>=n;)u-=2*Math.PI;return{radius:l,angle:u}}function ye(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function me(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function _e(t,e,i,n){var r=e.x,a=e.y,o=function(t,e){var i=Math.abs(e-t);if(i>=2*Math.PI||2*Math.PI-i<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];for(var n=me(Math.min(t,e)),r=n+i,a=[n,r],o=Math.floor(n/Math.PI)*Math.PI/2;o<r;)o>n&&a.push(o),o+=Math.PI/2;return a}(i,n),s=t.width,l=t.height,u=[];return o.forEach((function(t){var e=Math.sin(t),i=Math.cos(t);1===e?u.push(l-a):-1===e?u.push(a):1===i?u.push(s-r):-1===i?u.push(r):(e>0?u.push(Math.abs((l-a)/e)):u.push(Math.abs(a/e)),i>0?u.push(Math.abs((s-r)/i)):u.push(Math.abs(r/i)))})),Math.min.apply(null,u)}function ke(t){return(t=me(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}function be(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function xe(t,e,i,n){var r,a,o,s,l=t[0],u=e[0],c=i[0],h=n[0];return u<l&&(l=(r=[u,l])[0],u=r[1]),h<c&&(h=(a=[c,h])[0],c=a[1]),!(u<c||h<l||(l=t[1],u=e[1],c=i[1],h=n[1],u<l&&(o=[u,l],l=o[0],u=o[1]),h<c&&(s=[c,h],h=s[0],c=s[1]),u<c||h<l))}function Se(t,e,i,n){if(!xe(t,e,i,n))return!1;var r=[0,0],a=[0,0],o=[0,0];if(be(r,e,t),be(a,n,i),function(t,e){return Kt(t[0]-e[0])+Kt(t[1]-e[1])<1e-12}(r,a))return!0;be(o,i,t);var s=re(o,a)/re(r,a);return s>=0&&s<=1&&[t[0]+r[0]*s,t[1]+r[1]*s]}function Ae(t,e,i){if(null===t)return e;if(null===e)return t;var n=Ee(t,e,i),r=n.x11,a=n.x12,o=n.y11,s=n.y12,l=n.x21,u=n.x22,c=n.y21,h=n.y22;return r>=u||a<=l||o>=h||s<=c?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(r,l),y1:Math.max(o,c),x2:Math.min(a,u),y2:Math.min(s,h)}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(ve||(ve={}));var we,Me,Te,Ce,Ee=function(t,e,i){var n,r,a,o,s=t.x1,l=t.x2,u=t.y1,c=t.y2,h=e.x1,d=e.x2,v=e.y1,f=e.y2;return i&&(s>l&&(s=(n=[l,s])[0],l=n[1]),u>c&&(u=(r=[c,u])[0],c=r[1]),h>d&&(h=(a=[d,h])[0],d=a[1]),v>f&&(v=(o=[f,v])[0],f=o[1])),{x11:s,x12:l,y11:u,y12:c,x21:h,x22:d,y21:v,y22:f}};function Be(t,e,i){if(!t||!e)return ve.NONE;var n=Ee(t,e,i),r=n.x11,a=n.x12,o=n.y11,s=n.y12,l=n.x21,u=n.x22,c=n.y21,h=n.y22;return r>l&&a<u&&o>c&&s<h?ve.BBOX1:l>r&&u<a&&c>o&&h<s?ve.BBOX2:ve.NONE}function Pe(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);var n=Ee(t,e,!0),r=n.x11,a=n.x12,o=n.y11,s=n.y12,l=n.x21,u=n.x22,c=n.y21,h=n.y22;return!(r>u||a<l||o>h||s<c)}return!0}function Re(t,e,i){var n,r;if(!e)return!0;if(!i)return t.x>=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;var a=e.x1,o=e.x2,s=e.y1,l=e.y2;return a>o&&(a=(n=[o,a])[0],o=n[1]),s>l&&(s=(r=[l,s])[0],l=r[1]),t.x>=a&&t.x<=o&&t.y>=s&&t.y<=l}function Ie(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Oe(t,e){var i=t.x,n=t.y,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-r.x)*Math.cos(e)-(n-r.y)*Math.sin(e)+r.x,y:(i-r.x)*Math.sin(e)+(n-r.y)*Math.cos(e)+r.y}}function Le(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function De(t,e){var i=e?he(t.angle):t.angle,n=Le(t);return[Oe({x:t.x1,y:t.y1},i,n),Oe({x:t.x2,y:t.y1},i,n),Oe({x:t.x2,y:t.y2},i,n),Oe({x:t.x1,y:t.y2},i,n)]}function Fe(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=De(t,i),r=De(e,i),a=function(t,e){return[e.x-t.x,e.y-t.y]},o=a(Le(t),Le(e)),s=a(n[0],n[1]),l=a(n[1],n[2]),u=a(r[0],r[1]),c=a(r[1],r[2]),h=i?he(t.angle):t.angle,d=i?he(90-t.angle):t.angle+Ut,v=i?he(e.angle):e.angle,f=i?he(90-e.angle):e.angle+Ut;d>Xt&&(d-=Xt),f>Xt&&(f-=Xt);var p=function(t,e,i,n){var r=[Math.cos(e),Math.sin(e)];return t+(Ie(r,i)+Ie(r,n))/2>Ie(r,o)};return p((t.x2-t.x1)/2,h,u,c)&&p((t.y2-t.y1)/2,d,u,c)&&p((e.x2-e.x1)/2,v,s,l)&&p((e.y2-e.y1)/2,f,s,l)}function je(t){return we=1/0,Me=1/0,Te=-1/0,Ce=-1/0,t.forEach((function(t){we>t.x&&(we=t.x),Te<t.x&&(Te=t.x),Me>t.y&&(Me=t.y),Ce<t.y&&(Ce=t.y)})),{x1:we,y1:Me,x2:Te,y2:Ce}}var ze=1e-8;function He(t,e,i,n,r){for(var a=0,o=r[r.length-1];a<r.length;a++){var s=r[a];if(xe([t,e],[i,n],[s.x,s.y],[o.x,o.y]))return!0;o=s}return!1}function Ne(t,e,i){var n=0,r=t[0];if(!r)return!1;for(var a=1;a<t.length;a++){var o=t[a];n+=Ve(r.x,r.y,o.x,o.y,e,i),r=o}var s=t[0];return Ge(r.x,s.x)&&Ge(r.y,s.y)||(n+=Ve(r.x,r.y,s.x,s.y,e,i)),0!==n}function Ve(t,e,i,n,r,a){if(a>e&&a>n||a<e&&a<n)return 0;if(n===e)return 0;var o=(a-e)/(n-e),s=n<e?1:-1;1!==o&&0!==o||(s=n<e?.5:-.5);var l=o*(i-t)+t;return l===r?1/0:l>r?s:0}function Ge(t,e){return Math.abs(t-e)<ze}function We(t,e){for(var i=0;i<e.length;i++){if(Ne(t,e[i].x,e[i].y))return!0;if(i>0&&He(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}var Ue=function(t){var e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(n=(e&=1023)<<10|(i&=1023),n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function Ye(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);var n=t.fontStyle,r=void 0===n?e.fontStyle:n,a=t.fontVariant,o=void 0===a?e.fontVariant:a,s=t.fontWeight,l=void 0===s?e.fontWeight:s,u=t.fontSize,c=void 0===u?e.fontSize:u,h=t.fontFamily;return(r?r+" ":"")+(o?o+" ":"")+(l?l+" ":"")+c*i+"px "+((void 0===h?e.fontFamily:h)||"sans-serif")}var Xe=function(){function t(e,i){n(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!=i?i:{},this.textSpec=this._initSpec(),C(e.specialCharSet)&&(this.specialCharSet=e.specialCharSet),this._standardMethod=C(e.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}return a(t,[{key:"initContext",value:function(){if(this._notSupportCanvas)return!1;if(T(this._canvas)&&(C(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),T(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&C(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),T(this._context)&&C(this._canvas)){var t=this._canvas.getContext("2d");C(t)&&(t.save(),t.font=Ye(this.textSpec),this._contextSaved=!0,this._context=t)}return!T(this._context)||(this._notSupportCanvas=!0,!1)}},{key:"_initSpec",value:function(){var t,e,i,n=this._option.defaultFontParams,r=void 0===n?{}:n,a=this._userSpec,o=a.fontStyle,s=void 0===o?r.fontStyle:o,l=a.fontVariant,u=void 0===l?r.fontVariant:l,c=a.fontWeight,h=void 0===c?null!==(t=r.fontWeight)&&void 0!==t?t:"normal":c,d=a.fontSize,v=void 0===d?null!==(e=r.fontSize)&&void 0!==e?e:12:d,f=a.fontFamily,p=void 0===f?null!==(i=r.fontFamily)&&void 0!==i?i:"sans-serif":f,g=a.align,y=a.textAlign,m=void 0===y?null!=g?g:"center":y,_=a.baseline,k=a.textBaseline,b=void 0===k?null!=_?_:"middle":k,x=a.ellipsis,S=a.limit,A=this._userSpec.lineHeight,w=void 0===A?v:A;if(I(w)&&"%"===w[w.length-1]){var M=Number.parseFloat(w.substring(0,w.length-1))/100;w=v*M}return{fontStyle:s,fontVariant:u,fontFamily:p,fontSize:v,fontWeight:h,textAlign:m,textBaseline:b,ellipsis:x,limit:S,lineHeight:w}}},{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(T(t))return{width:0,height:0};if(T(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);var e,i=this.textSpec,n=i.fontFamily,r=i.fontSize,a=i.fontWeight,o=i.textAlign,s=i.textBaseline,l=i.ellipsis,u=i.limit,c=i.lineHeight;try{var h=this._option.getTextBounds({text:t,fontFamily:n,fontSize:r,fontWeight:a,textAlign:o,textBaseline:s,ellipsis:!!l,maxLineWidth:u||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 i=this._context.measureText(t),n=this.textSpec,r=n.fontSize,a=n.lineHeight;return{width:i.width,height:null!==(e=a)&&void 0!==e?e:r,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}},{key:"quickMeasure",value:function(t){return this._measureReduce(t,this._quickMeasure.bind(this))}},{key:"_quickMeasure",value:function(e){for(var i={width:0,height:0},n=0;n<e.length;n++){var r=e[n],a=this._measureSpecialChar(r);T(a)&&t.NUMBERS_CHAR_SET.includes(r)&&(a=this._measureNumberChar()),T(a)&&["F","W"].includes(Ue(r))&&(a=this._measureFullSizeChar()),T(a)&&(a=this._measureLetterChar()),i.width+=a.width,i.height=Math.max(i.height,a.height),!T(a.fontBoundingBoxAscent)&&(i.fontBoundingBoxAscent=a.fontBoundingBoxAscent),!T(a.fontBoundingBoxDescent)&&(i.fontBoundingBoxDescent=a.fontBoundingBoxDescent)}return i}},{key:"quickMeasureWithoutCanvas",value:function(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}},{key:"_quickMeasureWithoutCanvas",value:function(t){for(var e,i={width:0,height:0},n=this.textSpec,r=n.fontSize,a=n.lineHeight,o=0;o<t.length;o++){var s=t[o],l=["F","W"].includes(Ue(s))?1:.53;i.width+=l*r}return i.height=null!==(e=a)&&void 0!==e?e:r,i}},{key:"_measureReduce",value:function(t,e){var i,n=this.textSpec,r=n.fontSize,a=n.lineHeight,o={width:0,height:0};if(T(t))return o;if(O(t)){var s=t.filter(C).map((function(t){return t.toString()}));return 0===s.length?o:1===s.length?e(s[0]):{width:s.reduce((function(t,i){return Math.max(t,e(i).width)}),0),height:s.length*((null!==(i=a)&&void 0!==i?i:r)+1)+1}}return e(t.toString())}},{key:"_measureNumberChar",value:function(){if(T(this._numberCharSize)){var e=this._standardMethod(t.NUMBERS_CHAR_SET);this._numberCharSize={width:e.width/t.NUMBERS_CHAR_SET.length,height:e.height,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent}}return this._numberCharSize}},{key:"_measureFullSizeChar",value:function(){return T(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(t.FULL_SIZE_CHAR)),this._fullCharSize}},{key:"_measureLetterChar",value:function(){if(T(this._letterCharSize)){var e=this._standardMethod(t.ALPHABET_CHAR_SET);this._letterCharSize={width:e.width/t.ALPHABET_CHAR_SET.length,height:e.height,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent}}return this._letterCharSize}},{key:"_measureSpecialChar",value:function(t){return C(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}},{key:"release",value:function(){C(this._canvas)&&(this._canvas=null),C(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}])}();function Ke(t,e,i){var n=e.x1,r=e.y1,a=e.x2,o=e.y2;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*a+i.c*r+i.e,i.b*a+i.d*r+i.f),t.add(i.a*a+i.c*o+i.e,i.b*a+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}Xe.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Xe.NUMBERS_CHAR_SET="0123456789",Xe.FULL_SIZE_CHAR="字";var qe=function(){function t(e){n(this,t),e?this.setValue(e.x1,e.y1,e.x2,e.y2):this.clear()}return a(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,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,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,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),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 O(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,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[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,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=this.scalePoints(t,e,i,n);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