diff --git a/ci.py b/ci.py index ddd3ed1..42680b3 100644 --- a/ci.py +++ b/ci.py @@ -1,8 +1,11 @@ +import asyncio from configparser import RawConfigParser +from logging import getLogger from os import mkdir, sep from os.path import exists from pyrogram import Client + from httpx import AsyncClient, get from sqlitedict import SqliteDict @@ -39,3 +42,5 @@ client = AsyncClient(timeout=10.0, headers=headers) me = get(f"https://api.telegram.org/bot{bot_token}/getme").json() # 初始化客户端 app = Client("bot", bot_token=bot_token, api_id=api_id, api_hash=api_hash, plugins={"root": "plugins"}) +logger = getLogger("enka") +lock = asyncio.Lock() diff --git a/data/font/HYWH-65W.ttf b/data/font/HYWH-65W.ttf new file mode 100644 index 0000000..e3cfe72 Binary files /dev/null and b/data/font/HYWH-65W.ttf differ diff --git a/data/font/tttgbnumber.ttf b/data/font/tttgbnumber.ttf new file mode 100644 index 0000000..89a392f Binary files /dev/null and b/data/font/tttgbnumber.ttf differ diff --git a/data/g2plot.min.js b/data/g2plot.min.js new file mode 100644 index 0000000..01e521f --- /dev/null +++ b/data/g2plot.min.js @@ -0,0 +1,16 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.G2Plot=e():t.G2Plot=e()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=160)}([function(t,e,n){"use strict";n.r(e),n.d(e,"contains",(function(){return r})),n.d(e,"includes",(function(){return r})),n.d(e,"difference",(function(){return a})),n.d(e,"find",(function(){return b})),n.d(e,"findIndex",(function(){return _})),n.d(e,"firstValue",(function(){return O})),n.d(e,"flatten",(function(){return w})),n.d(e,"flattenDeep",(function(){return j})),n.d(e,"getRange",(function(){return A})),n.d(e,"pull",(function(){return P})),n.d(e,"pullAt",(function(){return T})),n.d(e,"reduce",(function(){return L})),n.d(e,"remove",(function(){return D})),n.d(e,"sortBy",(function(){return B})),n.d(e,"union",(function(){return R})),n.d(e,"uniq",(function(){return N})),n.d(e,"valuesOfKey",(function(){return V})),n.d(e,"head",(function(){return z})),n.d(e,"last",(function(){return G})),n.d(e,"startsWith",(function(){return Y})),n.d(e,"endsWith",(function(){return X})),n.d(e,"filter",(function(){return o})),n.d(e,"every",(function(){return W})),n.d(e,"some",(function(){return H})),n.d(e,"group",(function(){return $})),n.d(e,"groupBy",(function(){return q})),n.d(e,"groupToMap",(function(){return Z})),n.d(e,"getWrapBehavior",(function(){return K})),n.d(e,"wrapBehavior",(function(){return Q})),n.d(e,"number2color",(function(){return tt})),n.d(e,"parseRadius",(function(){return et})),n.d(e,"clamp",(function(){return nt})),n.d(e,"fixedBase",(function(){return it})),n.d(e,"isDecimal",(function(){return ot})),n.d(e,"isEven",(function(){return at})),n.d(e,"isInteger",(function(){return st})),n.d(e,"isNegative",(function(){return lt})),n.d(e,"isNumberEqual",(function(){return ct})),n.d(e,"isOdd",(function(){return ut})),n.d(e,"isPositive",(function(){return ht})),n.d(e,"max",(function(){return S})),n.d(e,"maxBy",(function(){return ft})),n.d(e,"min",(function(){return M})),n.d(e,"minBy",(function(){return pt})),n.d(e,"mod",(function(){return dt})),n.d(e,"toDegree",(function(){return yt})),n.d(e,"toInteger",(function(){return vt})),n.d(e,"toRadian",(function(){return xt})),n.d(e,"forIn",(function(){return bt})),n.d(e,"has",(function(){return _t})),n.d(e,"hasKey",(function(){return Ot})),n.d(e,"hasValue",(function(){return jt})),n.d(e,"keys",(function(){return g})),n.d(e,"isMatch",(function(){return y})),n.d(e,"values",(function(){return wt})),n.d(e,"lowerCase",(function(){return Mt})),n.d(e,"lowerFirst",(function(){return At})),n.d(e,"substitute",(function(){return Ct})),n.d(e,"upperCase",(function(){return Et})),n.d(e,"upperFirst",(function(){return It})),n.d(e,"getType",(function(){return Ft})),n.d(e,"isArguments",(function(){return Tt})),n.d(e,"isArray",(function(){return h})),n.d(e,"isArrayLike",(function(){return i})),n.d(e,"isBoolean",(function(){return Lt})),n.d(e,"isDate",(function(){return Dt})),n.d(e,"isError",(function(){return kt})),n.d(e,"isFunction",(function(){return c})),n.d(e,"isFinite",(function(){return Bt})),n.d(e,"isNil",(function(){return u})),n.d(e,"isNull",(function(){return Nt})),n.d(e,"isNumber",(function(){return rt})),n.d(e,"isObject",(function(){return p})),n.d(e,"isObjectLike",(function(){return m})),n.d(e,"isPlainObject",(function(){return x})),n.d(e,"isPrototype",(function(){return Vt})),n.d(e,"isRegExp",(function(){return zt})),n.d(e,"isString",(function(){return k})),n.d(e,"isType",(function(){return l})),n.d(e,"isUndefined",(function(){return Gt})),n.d(e,"isElement",(function(){return Yt})),n.d(e,"requestAnimationFrame",(function(){return Xt})),n.d(e,"clearAnimationFrame",(function(){return Wt})),n.d(e,"augment",(function(){return qt})),n.d(e,"clone",(function(){return $t})),n.d(e,"debounce",(function(){return Kt})),n.d(e,"memoize",(function(){return Qt})),n.d(e,"deepMix",(function(){return te})),n.d(e,"each",(function(){return d})),n.d(e,"extend",(function(){return ee})),n.d(e,"indexOf",(function(){return ne})),n.d(e,"isEmpty",(function(){return re})),n.d(e,"isEqual",(function(){return oe})),n.d(e,"isEqualWith",(function(){return ae})),n.d(e,"map",(function(){return se})),n.d(e,"mapValues",(function(){return ce})),n.d(e,"mix",(function(){return Ut})),n.d(e,"assign",(function(){return Ut})),n.d(e,"get",(function(){return ue})),n.d(e,"set",(function(){return he})),n.d(e,"pick",(function(){return pe})),n.d(e,"omit",(function(){return de})),n.d(e,"throttle",(function(){return ge})),n.d(e,"toArray",(function(){return ye})),n.d(e,"toString",(function(){return St})),n.d(e,"uniqueId",(function(){return me})),n.d(e,"noop",(function(){return xe})),n.d(e,"identity",(function(){return be})),n.d(e,"size",(function(){return _e})),n.d(e,"measureTextWidth",(function(){return je})),n.d(e,"getEllipsisText",(function(){return Se})),n.d(e,"Cache",(function(){return Me}));var i=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},r=function(t,e){return!!i(t)&&t.indexOf(e)>-1},o=function(t,e){if(!i(t))return t;for(var n=[],r=0;r-1;)E.call(t,o,1);return t},F=Array.prototype.splice,T=function(t,e){if(!i(t))return[];for(var n=t?e.length:0,r=n-1;n--;){var o=void 0,a=e[n];n!==r&&a===o||(o=a,F.call(t,a,1))}return t},L=function(t,e,n){if(!h(t)&&!x(t))return t;var i=n;return d(t,(function(t,n){i=e(i,t,n)})),i},D=function(t,e){var n=[];if(!i(t))return n;for(var r=-1,o=[],a=t.length;++re[r])return 1;if(t[r]n?n:t},it=function(t,e){var n=e.toString(),i=n.indexOf(".");if(-1===i)return Math.round(t);var r=n.substr(i+1).length;return r>20&&(r=20),parseFloat(t.toFixed(r))},rt=function(t){return l(t,"Number")},ot=function(t){return rt(t)&&t%1!=0},at=function(t){return rt(t)&&t%2==0},st=Number.isInteger?Number.isInteger:function(t){return rt(t)&&t%1==0},lt=function(t){return rt(t)&&t<0};function ct(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)0},ft=function(t,e){if(h(t)){for(var n,i=-1/0,r=0;ri&&(n=o,i=a)}return n}},pt=function(t,e){if(h(t)){for(var n,i=1/0,r=0;re?(i&&(clearTimeout(i),i=null),s=c,a=t.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(i),s=0,i=r=o=null},c},ye=function(t){return i(t)?Array.prototype.slice.call(t):[]},ve={},me=function(t){return ve[t=t||"g"]?ve[t]+=1:ve[t]=1,t+ve[t]},xe=function(){},be=function(t){return t};function _e(t){return u(t)?0:i(t)?t.length:Object.keys(t).length}var Oe,we=n(1),je=Qt((function(t,e){void 0===e&&(e={});var n=e.fontSize,i=e.fontFamily,r=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Oe||(Oe=document.createElement("canvas").getContext("2d")),Oe.font=[o,a,r,n+"px",i].join(" "),Oe.measureText(k(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),Object(we.__spreadArrays)([t],wt(e)).join("")})),Se=function(t,e,n,i){void 0===i&&(i="...");var r,o,a=je(i,n),s=k(t)?t:St(t),l=e,c=[];if(je(t,n)<=e)return t;for(;r=s.substr(0,16),!((o=je(r,n))+a>l&&o>l);)if(c.push(r),l-=o,!(s=s.substr(16)))return c.join("");for(;r=s.substr(0,1),!((o=je(r,n))+a>l);)if(c.push(r),l-=o,!(s=s.substr(1)))return c.join("");return""+c.join("")+i},Me=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},function(t,e,n){"use strict";function i(t){return(i="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})(t)}n.r(e),n.d(e,"__extends",(function(){return o})),n.d(e,"__assign",(function(){return a})),n.d(e,"__rest",(function(){return s})),n.d(e,"__decorate",(function(){return l})),n.d(e,"__param",(function(){return c})),n.d(e,"__metadata",(function(){return u})),n.d(e,"__awaiter",(function(){return h})),n.d(e,"__generator",(function(){return f})),n.d(e,"__createBinding",(function(){return p})),n.d(e,"__exportStar",(function(){return d})),n.d(e,"__values",(function(){return g})),n.d(e,"__read",(function(){return y})),n.d(e,"__spread",(function(){return v})),n.d(e,"__spreadArrays",(function(){return m})),n.d(e,"__spreadArray",(function(){return x})),n.d(e,"__await",(function(){return b})),n.d(e,"__asyncGenerator",(function(){return _})),n.d(e,"__asyncDelegator",(function(){return O})),n.d(e,"__asyncValues",(function(){return w})),n.d(e,"__makeTemplateObject",(function(){return j})),n.d(e,"__importStar",(function(){return M})),n.d(e,"__importDefault",(function(){return A})),n.d(e,"__classPrivateFieldGet",(function(){return C})),n.d(e,"__classPrivateFieldSet",(function(){return E})),n.d(e,"__classPrivateFieldIn",(function(){return I}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(e,n,s):o(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,i){e(n,i,t)}}function u(t,e){if("object"===("undefined"==typeof Reflect?"undefined":i(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))}function f(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function v(){for(var t=[],e=0;e1||s(t,e)}))})}function s(t,e){try{(n=r[t](e)).value instanceof b?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(t){u(o[0][3],t)}var n}function l(t){s("next",t)}function c(t){s("throw",t)}function u(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function O(t){var e,n;return e={},i("next"),i("throw",(function(t){throw t})),i("return"),e[Symbol.iterator]=function(){return this},e;function i(i,r){e[i]=t[i]?function(e){return(n=!n)?{value:b(t[i](e)),done:"return"===i}:r?r(e):e}:r}}function w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=g(t),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise((function(i,r){(function(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)})(i,r,(e=t[n](e)).done,e.value)}))}}}function j(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var S=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function M(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&p(e,t,n);return S(e,t),e}function A(t){return t&&t.__esModule?t:{default:t}}function C(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function E(t,e,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,n):r?r.value=n:e.set(t,n),n}function I(t,e){if(null===e||"object"!==i(e)&&"function"!=typeof e)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof t?e===t:t.has(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(169);Object.defineProperty(e,"flow",{enumerable:!0,get:function(){return r.flow}});var o=n(75);Object.defineProperty(e,"pick",{enumerable:!0,get:function(){return o.pick}});var a=n(170);Object.defineProperty(e,"template",{enumerable:!0,get:function(){return a.template}});var s=n(76);Object.defineProperty(e,"log",{enumerable:!0,get:function(){return s.log}}),Object.defineProperty(e,"invariant",{enumerable:!0,get:function(){return s.invariant}}),Object.defineProperty(e,"LEVEL",{enumerable:!0,get:function(){return s.LEVEL}});var l=n(171);Object.defineProperty(e,"getContainerSize",{enumerable:!0,get:function(){return l.getContainerSize}}),i.__exportStar(n(172),e);var c=n(40);Object.defineProperty(e,"findViewById",{enumerable:!0,get:function(){return c.findViewById}}),Object.defineProperty(e,"getViews",{enumerable:!0,get:function(){return c.getViews}}),Object.defineProperty(e,"getSiblingViews",{enumerable:!0,get:function(){return c.getSiblingViews}});var u=n(173);Object.defineProperty(e,"transformLabel",{enumerable:!0,get:function(){return u.transformLabel}});var h=n(174);Object.defineProperty(e,"getSplinePath",{enumerable:!0,get:function(){return h.getSplinePath}});var f=n(77);Object.defineProperty(e,"deepAssign",{enumerable:!0,get:function(){return f.deepAssign}});var p=n(175);Object.defineProperty(e,"kebabCase",{enumerable:!0,get:function(){return p.kebabCase}});var d=n(78);Object.defineProperty(e,"renderStatistic",{enumerable:!0,get:function(){return d.renderStatistic}}),Object.defineProperty(e,"renderGaugeStatistic",{enumerable:!0,get:function(){return d.renderGaugeStatistic}});var g=n(176);Object.defineProperty(e,"measureTextWidth",{enumerable:!0,get:function(){return g.measureTextWidth}});var y=n(56);Object.defineProperty(e,"isBetween",{enumerable:!0,get:function(){return y.isBetween}}),Object.defineProperty(e,"isRealNumber",{enumerable:!0,get:function(){return y.isRealNumber}});var v=n(40);Object.defineProperty(e,"addViewAnimation",{enumerable:!0,get:function(){return v.addViewAnimation}}),i.__exportStar(n(48),e),i.__exportStar(n(32),e)},function(t,e,n){"use strict";n.r(e),n.d(e,"mat3",(function(){return r.a})),n.d(e,"vec2",(function(){return r.b})),n.d(e,"vec3",(function(){return r.c})),n.d(e,"ext",(function(){return i}));var i={};n.r(i),n.d(i,"leftTranslate",(function(){return o})),n.d(i,"leftRotate",(function(){return a})),n.d(i,"leftScale",(function(){return s})),n.d(i,"transform",(function(){return l})),n.d(i,"direction",(function(){return c})),n.d(i,"angleTo",(function(){return u})),n.d(i,"vertical",(function(){return h}));var r=n(16);function o(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.a.fromTranslation(i,n),r.a.multiply(t,i,e)}function a(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.a.fromRotation(i,n),r.a.multiply(t,i,e)}function s(t,e,n){var i=[0,0,0,0,0,0,0,0,0];return r.a.fromScaling(i,n),r.a.multiply(t,i,e)}function l(t,e){for(var n,i,l,c=t?[].concat(t):[1,0,0,0,1,0,0,0,1],u=0,h=e.length;u=0;return n?o?2*Math.PI-i:i:o?i:2*Math.PI-i}function h(t,e,n){return n?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}},function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"k",(function(){return s})),n.d(e,"j",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"g",(function(){return u})),n.d(e,"e",(function(){return h})),n.d(e,"i",(function(){return f})),n.d(e,"d",(function(){return p})),n.d(e,"m",(function(){return d})),n.d(e,"l",(function(){return g})),n.d(e,"f",(function(){return y}));var i=n(0);function r(t){var e=0,n=0,r=0,o=0;return Object(i.isNumber)(t)?e=n=r=o=t:Object(i.isArray)(t)&&(e=t[0],r=Object(i.isNil)(t[1])?t[0]:t[1],o=Object(i.isNil)(t[2])?t[0]:t[2],n=Object(i.isNil)(t[3])?r:t[3]),[e,r,o,n]}function o(t){for(var e=t.childNodes,n=e.length-1;n>=0;n--)t.removeChild(e[n])}function a(t,e){return!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}function s(t){var e=t.start,n=t.end,i=Math.min(e.x,n.x),r=Math.min(e.y,n.y),o=Math.max(e.x,n.x),a=Math.max(e.y,n.y);return{x:i,y:r,minX:i,minY:r,maxX:o,maxY:a,width:o-i,height:a-r}}function l(t){var e=t.map((function(t){return t.x})),n=t.map((function(t){return t.y})),i=Math.min.apply(Math,e),r=Math.min.apply(Math,n),o=Math.max.apply(Math,e),a=Math.max.apply(Math,n);return{x:i,y:r,minX:i,minY:r,maxX:o,maxY:a,width:o-i,height:a-r}}function c(t,e,n,i){var r=t+n,o=e+i;return{x:t,y:e,width:n,height:i,minX:t,minY:e,maxX:isNaN(r)?0:r,maxY:isNaN(o)?0:o}}function u(t,e,n){return(1-n)*t+e*n}function h(t,e,n){return{x:t.x+Math.cos(n)*e,y:t.y+Math.sin(n)*e}}var f=function(t,e,n){return void 0===n&&(n=Math.pow(Number.EPSILON,.5)),[t,e].includes(1/0)?Math.abs(t)===Math.abs(e):Math.abs(t-e)0?Object(i.each)(g,(function(t){if(t.get("visible")){if(t.isGroup()&&0===t.get("children").length)return!0;var e=p(t),n=t.applyToMatrix([e.minX,e.minY,1]),i=t.applyToMatrix([e.minX,e.maxY,1]),r=t.applyToMatrix([e.maxX,e.minY,1]),o=t.applyToMatrix([e.maxX,e.maxY,1]),a=Math.min(n[0],i[0],r[0],o[0]),s=Math.max(n[0],i[0],r[0],o[0]),l=Math.min(n[1],i[1],r[1],o[1]),c=Math.max(n[1],i[1],r[1],o[1]);ah&&(h=s),ld&&(d=c)}})):(u=0,h=0,f=0,d=0),e=c(u,f,h-u,d-f)}else e=t.getBBox();return l?(n=e,r=l,o=Math.max(n.minX,r.minX),a=Math.max(n.minY,r.minY),c(o,a,Math.min(n.maxX,r.maxX)-o,Math.min(n.maxY,r.maxY)-a)):e}function d(t,e){if(t.getClip()||e.getClip()){var n=e.getClip();if(n){var i={type:n.get("type"),attrs:n.attr()};t.setClip(i)}else t.setClip(null)}}function g(t){return t+"px"}function y(t,e,n,i){var r,o,a,s,l=i/(r=t,a=(o=e).x-r.x,s=o.y-r.y,Math.sqrt(a*a+s*s)),c=0;return"start"===n?c=0-l:"end"===n&&(c=1+l),{x:u(t.x,e.x,c),y:u(t.y,e.y,c)}}},function(t,e,n){"use strict";e.a={fontFamily:'\n BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue",\n Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",\n SimSun, "sans-serif"',textColor:"#2C3542",activeTextColor:"#333333",uncheckedColor:"#D8D8D8",lineColor:"#416180",regionColor:"#CCD7EB",verticalAxisRotate:-Math.PI/4,horizontalAxisRotate:Math.PI/4,descriptionIconStroke:"#fff",descriptionIconFill:"rgba(58, 73, 101, .25)"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Plot=e.PLOT_CONTAINER_OPTIONS=void 0;var i=n(1),r=n(7),o=n(0),a=i.__importDefault(n(45)),s=n(180),l=n(2);e.PLOT_CONTAINER_OPTIONS=["padding","appendPadding","renderer","pixelRatio","syncViewPadding","supportCSSTransform","limitInPlot"];var c=function(t){function n(e,n){var i=t.call(this)||this;return i.container="string"==typeof e?document.getElementById(e):e,i.options=l.deepAssign({},i.getDefaultOptions(),n),i.createG2(),i.bindEvents(),i}return i.__extends(n,t),n.getDefaultOptions=function(){return{renderer:"canvas",xAxis:{nice:!0,label:{autoRotate:!1,autoHide:{type:"equidistance",cfg:{minGap:6}}}},yAxis:{nice:!0,label:{autoHide:!0,autoRotate:!1}},animation:!0}},n.prototype.createG2=function(){var t=this.options,n=t.width,o=t.height,a=t.defaultInteractions;this.chart=new r.Chart(i.__assign(i.__assign(i.__assign(i.__assign({container:this.container,autoFit:!1},this.getChartSize(n,o)),{localRefresh:!1}),l.pick(this.options,e.PLOT_CONTAINER_OPTIONS)),{defaultInteractions:a})),this.container.setAttribute("data-chart-source-type","G2Plot")},n.prototype.getChartSize=function(t,e){var n=l.getContainerSize(this.container);return{width:t||n.width||400,height:e||n.height||400}},n.prototype.bindEvents=function(){var t=this;this.chart&&this.chart.on("*",(function(e){(null==e?void 0:e.type)&&t.emit(e.type,e)}))},n.prototype.getDefaultOptions=function(){return n.getDefaultOptions()},n.prototype.render=function(){this.chart.clear(),this.chart.options={data:[],animate:!0},this.chart.views=[],this.execAdaptor(),this.chart.render(),this.bindSizeSensor()},n.prototype.update=function(t){this.updateOption(t),this.render()},n.prototype.updateOption=function(t){this.options=l.deepAssign({},this.options,t)},n.prototype.setState=function(t,e,n){void 0===n&&(n=!0);var i=l.getAllElementsRecursively(this.chart);o.each(i,(function(i){e(i.getData())&&i.setState(t,n)}))},n.prototype.getStates=function(){var t=l.getAllElementsRecursively(this.chart),e=[];return o.each(t,(function(t){var n=t.getData(),i=t.getStates();o.each(i,(function(i){e.push({data:n,state:i,geometry:t.geometry,element:t})}))})),e},n.prototype.changeData=function(t){this.update({data:t})},n.prototype.changeSize=function(t,e){this.chart.changeSize(t,e)},n.prototype.addAnnotations=function(t,e){e=e||this.chart;var n=i.__spreadArrays(t),r=e.getController("annotation"),o=r.getComponents().map((function(t){return t.extra}));r.clear(!0);for(var a=function(t){var e=o[t],i=n.findIndex((function(t){return t.id&&t.id===e.id}));-1!==i&&(e=l.deepAssign({},e,n[i]),n.splice(i,1)),r.annotation(e)},s=0;s=0&&this.radius<=1&&(n*=this.radius),this.d=Math.floor(n*(1-this.innerRadius)/e),this.a=this.d/(2*Math.PI),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*n,end:this.innerRadius*n+.99*this.d}},e.prototype.convertPoint=function(t){var e,n=t.x,i=t.y;this.isTransposed&&(n=(e=[i,n])[0],i=e[1]);var r=this.convertDim(n,"x"),o=this.a*r,a=this.convertDim(i,"y");return{x:this.center.x+Math.cos(r)*(o+a),y:this.center.y+Math.sin(r)*(o+a)}},e.prototype.invertPoint=function(t){var e,n=this.d+this.y.start,i=G.vec2.subtract([0,0],[t.x,t.y],[this.center.x,this.center.y]),r=G.ext.angleTo(i,[1,0],!0),o=r*this.a;G.vec2.length(i)this.width/i?(e=this.width/i,this.circleCenter={x:this.center.x-(.5-o)*this.width,y:this.center.y-(.5-a)*e*r}):(e=this.height/r,this.circleCenter={x:this.center.x-(.5-o)*e*i,y:this.center.y-(.5-a)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=e*this.radius:(this.radius<=0||this.radius>e)&&(this.polarRadius=e):this.polarRadius=e,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var e,n=this.getCenter(),i=t.x,r=t.y;return this.isTransposed&&(i=(e=[r,i])[0],r=e[1]),i=this.convertDim(i,"x"),r=this.convertDim(r,"y"),{x:n.x+Math.cos(i)*r,y:n.y+Math.sin(i)*r}},e.prototype.invertPoint=function(t){var e,n=this.getCenter(),i=[t.x-n.x,t.y-n.y],r=this.startAngle,o=this.endAngle;this.isReflect("x")&&(r=(e=[o,r])[0],o=e[1]);var a=[1,0,0,0,1,0,0,0,1];G.ext.leftRotate(a,a,r);var s=[1,0,0];G.vec3.transformMat3(s,s,a);var l=[s[0],s[1]],c=G.ext.angleTo(l,i,o0?f:-f;var p=this.invertDim(u,"y"),d={x:0,y:0};return d.x=this.isTransposed?p:f,d.y=this.isTransposed?f:p,d},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,e=this.endAngle;if(Math.abs(e-t)>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var n=[0,Math.cos(t),Math.cos(e)],i=[0,Math.sin(t),Math.sin(e)],r=Math.min(t,e);rt.x?t.x:e,n=nt.y?t.y:i,r=r=i&&t<=r}function ft(t,e){return"object"===ut(t)&&e.forEach((function(e){delete t[e]})),t}function pt(t,e,n){var i,r;void 0===e&&(e=[]),void 0===n&&(n=new Map);try{for(var o=Object(u.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;n.has(s)||(e.push(s),n.set(s,!0))}}catch(t){i={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return e}var dt=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=t,this.y=e,this.height=i,this.width=n}return t.fromRange=function(e,n,i,r){return new t(e,n,i-e,r-n)},t.fromObject=function(e){return new t(e.minX,e.minY,e.width,e.height)},Object.defineProperty(t.prototype,"minX",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tl",{get:function(){return{x:this.x,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tr",{get:function(){return{x:this.maxX,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bl",{get:function(){return{x:this.x,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"br",{get:function(){return{x:this.maxX,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return{x:this.x+this.width/2,y:this.minY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return{x:this.maxX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return{x:this.x+this.width/2,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return{x:this.minX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},t.prototype.contains=function(t){return t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.add=function(){for(var t=[],e=0;et.minX&&this.minYt.minY},t.prototype.size=function(){return this.width*this.height},t.prototype.isPointIn=function(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY},t}();function gt(t){if(t.isPolar&&!t.isTransposed)return(t.endAngle-t.startAngle)*t.getRadius();var e=t.convert({x:0,y:0}),n=t.convert({x:1,y:0});return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function yt(t,e){var n=t.getCenter();return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function vt(t,e){var n=t.getCenter();return Math.atan2(e.y-n.y,e.x-n.x)}function mt(t,e){void 0===e&&(e=0);var n,i=t.start,r=t.end,o=t.getWidth(),a=t.getHeight();if(t.isPolar){var s=t.startAngle,l=t.endAngle,c=t.getCenter(),u=t.getRadius();return{type:"path",startState:{path:at(c.x,c.y,u+e,s,s)},endState:function(t){var n=(l-s)*t+s;return{path:at(c.x,c.y,u+e,s,n)}},attrs:{path:at(c.x,c.y,u+e,s,l)}}}return n=t.isTransposed?{height:a+2*e}:{width:o+2*e},{type:"rect",startState:{x:i.x-e,y:r.y-e,width:t.isTransposed?o+2*e:0,height:t.isTransposed?0:a+2*e},endState:n,attrs:{x:i.x-e,y:r.y-e,width:o+2*e,height:a+2*e}}}var xt=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function bt(t,e,n,i){return void 0===e&&(e={}),e.type?e.type:"identity"!==t.type&&x.includes(n)&&["interval"].includes(i)||t.isCategory?"cat":t.type}function _t(t,e,n){var i=e||[];if(Object(h.isNumber)(t)||Object(h.isNil)(Object(h.firstValue)(i,t))&&Object(h.isEmpty)(n))return new(Object(N.d)("identity"))({field:t.toString(),values:[t]});var r=Object(h.valuesOfKey)(i,t),o=Object(h.get)(n,"type",function(t){var e="linear";return xt.test(t)?e="timeCat":Object(h.isString)(t)&&(e="cat"),e}(r[0]));return new(Object(N.d)(o))(Object(u.__assign)({field:t,values:r},n))}function Ot(t){return t.alias||t.field}function wt(t,e,n){var i,r=t.values.length;if(1===r)i=[.5,1];else{var o=0;i=function(t){if(t.isPolar){var e=t.startAngle;return t.endAngle-e==2*Math.PI}return!1}(e)?e.isTransposed?[(o=1/r*Object(h.get)(n,"widthRatio.multiplePie",1/1.3))/2,1-o/2]:[0,1-1/r]:[o=1/r/2,1-o]}return i}function jt(t,e){var n={start:{x:0,y:0},end:{x:0,y:0}};t.isRect?n=function(t){var e,n;switch(t){case l.TOP:e={x:0,y:1},n={x:1,y:1};break;case l.RIGHT:e={x:1,y:0},n={x:1,y:1};break;case l.BOTTOM:e={x:0,y:0},n={x:1,y:0};break;case l.LEFT:e={x:0,y:0},n={x:0,y:1};break;default:e=n={x:0,y:0}}return{start:e,end:n}}(e):t.isPolar&&(n=function(t){var e,n;return t.isTransposed?(e={x:0,y:0},n={x:1,y:0}):(e={x:0,y:0},n={x:0,y:1}),{start:e,end:n}}(t));var i=n.start,r=n.end;return{start:t.convert(i),end:t.convert(r)}}function St(t){var e=t.start,n=t.end;return e.x===n.x}function Mt(t,e){var n=t.start,i=t.end;return St(t)?(n.y-i.y)*(e.x-n.x)>0?1:-1:(i.x-n.x)*(n.y-e.y)>0?-1:1}function At(t,e){var n=Object(h.get)(t,["components","axis"],{});return Object(h.deepMix)({},Object(h.get)(n,["common"],{}),Object(h.deepMix)({},Object(h.get)(n,[e],{})))}function Ct(t,e,n){var i=Object(h.get)(t,["components","axis"],{});return Object(h.deepMix)({},Object(h.get)(i,["common","title"],{}),Object(h.deepMix)({},Object(h.get)(i,[e,"title"],{})),n)}function Et(t){var e=t.x,n=t.y,i=t.circleCenter,r=n.start>n.end,o=t.isTransposed?t.convert({x:r?0:1,y:0}):t.convert({x:0,y:r?0:1}),a=[o.x-i.x,o.y-i.y],s=[1,0],l=o.y>i.y?G.vec2.angle(a,s):-1*G.vec2.angle(a,s),c=l+(e.end-e.start);return{center:i,radius:Math.sqrt(Math.pow(o.x-i.x,2)+Math.pow(o.y-i.y,2)),startAngle:l,endAngle:c}}function It(t,e){return Object(h.isBoolean)(t)?!1!==t&&{}:Object(h.get)(t,[e])}function Pt(t,e){return Object(h.get)(t,"position",e)}function Ft(t,e){return Object(h.get)(e,["title","text"],Ot(t))}var Tt=function(){function t(t,e){this.destroyed=!1,this.facets=[],this.view=t,this.cfg=Object(h.deepMix)({},this.getDefaultCfg(),e)}return t.prototype.init=function(){this.container||(this.container=this.createContainer());var t=this.view.getData();this.facets=this.generateFacets(t)},t.prototype.render=function(){this.renderViews()},t.prototype.update=function(){},t.prototype.clear=function(){this.clearFacetViews()},t.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},t.prototype.facetToView=function(t){var e=t.region,n=t.data,i=t.padding,r=void 0===i?this.cfg.padding:i,o=this.view.createView({region:e,padding:r});o.data(n||[]),t.view=o,this.beforeEachView(o,t);var a=this.cfg.eachView;return a&&a(o,t),this.afterEachView(o,t),o},t.prototype.createContainer=function(){return this.view.getLayer(s.FORE).addGroup()},t.prototype.renderViews=function(){this.createFacetViews()},t.prototype.createFacetViews=function(){var t=this;return this.facets.map((function(e){return t.facetToView(e)}))},t.prototype.clearFacetViews=function(){var t=this;Object(h.each)(this.facets,(function(e){e.view&&(t.view.removeView(e.view),e.view=void 0)}))},t.prototype.parseSpacing=function(){var t=this.view.viewBBox,e=t.width,n=t.height;return this.cfg.spacing.map((function(t,i){return Object(h.isNumber)(t)?t/(0===i?e:n):parseFloat(t)/100}))},t.prototype.getFieldValues=function(t,e){var n=[],i={};return Object(h.each)(t,(function(t){var r=t[e];Object(h.isNil)(r)||i[r]||(n.push(r),i[r]=!0)})),n},t.prototype.getRegion=function(t,e,n,i){var r=Object(u.__read)(this.parseSpacing(),2),o=r[0],a=r[1],s=(1+o)/(0===e?1:e)-o,l=(1+a)/(0===t?1:t)-a,c={x:(s+o)*n,y:(l+a)*i};return{start:c,end:{x:c.x+s,y:c.y+l}}},t.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},t.prototype.getDefaultTitleCfg=function(){return{style:{fontSize:14,fill:"#666",fontFamily:this.view.getTheme().fontFamily}}},t.prototype.processAxis=function(t,e){var n=t.getOptions(),i=n.coordinate,r=t.geometries;if("rect"===Object(h.get)(i,"type","rect")&&r.length){Object(h.isNil)(n.axes)&&(n.axes={});var o=n.axes,a=Object(u.__read)(r[0].getXYFields(),2),s=a[0],l=a[1],c=It(o,s),f=It(o,l);!1!==c&&(n.axes[s]=this.getXAxisOption(s,o,c,e)),!1!==f&&(n.axes[l]=this.getYAxisOption(l,o,f,e))}},t.prototype.getFacetDataFilter=function(t){return function(e){return Object(h.every)(t,(function(t){var n=t.field,i=t.value;return!(!Object(h.isNil)(i)&&n)||e[n]===i}))}},t}(),Lt={},Dt=function(t){return Lt[Object(h.lowerCase)(t)]},kt=function(t,e){Lt[Object(h.lowerCase)(t)]=e},Bt=function(){function t(t,e){this.context=t,this.cfg=e,t.addAction(this)}return t.prototype.applyCfg=function(t){Object(h.assign)(this,t)},t.prototype.init=function(){this.applyCfg(this.cfg)},t.prototype.destroy=function(){this.context.removeAction(this),this.context=null},t}(),Nt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.callback=null},e}(Bt),Rt={};function Vt(t){var e=Rt[t];return Object(h.get)(e,"ActionClass")}function zt(t,e,n){Rt[t]={ActionClass:e,cfg:n}}function Gt(t,e){var n=new Nt(e);return n.callback=t,n.name="callback",n}function Yt(t,e){for(var n=[t[0]],i=1,r=t.length;i=a[c]?1:0,f=u>Math.PI?1:0,p=n.convert(s),d=yt(n,p);if(d>=.5)if(u===2*Math.PI){var g={x:(s.x+a.x)/2,y:(s.y+a.y)/2},y=n.convert(g);l.push(["A",d,d,0,f,h,y.x,y.y]),l.push(["A",d,d,0,f,h,p.x,p.y])}else l.push(["A",d,d,0,f,h,p.x,p.y]);return l}(n,i,t)):o.push(Yt(a,t));break;case"a":o.push(Xt(a,t));break;case"z":default:o.push(a)}})),function(t){Object(h.each)(t,(function(e,n){if("a"===e[0].toLowerCase()){var i=t[n-1],r=t[n+1];r&&"a"===r[0].toLowerCase()?i&&"l"===i[0].toLowerCase()&&(i[0]="M"):i&&"a"===i[0].toLowerCase()&&r&&"l"===r[0].toLowerCase()&&(r[0]="M")}}))}(o),o}var Zt=n(21);function $t(t,e){var n=t.event.target.getCanvasBBox();return n.width>=e||n.height>=e?n:null}function Kt(t){var e,n=t.event.target;return n&&(e=n.get("element")),e}function Qt(t){var e,n=t.event.target;return n&&(e=n.get("delegateObject")),e}function Jt(t){var e=t.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function te(t){return t&&t.component&&t.component.isList()}function ee(t){return t&&t.component&&t.component.isSlider()}function ne(t){var e=t.event.target;return e&&"mask"===e.get("name")}function ie(t,e){var n,i,r,o;if("path"===t.event.target.get("type")){var a=function(t,e){var n=t.event.target,i=n.getCanvasBBox();return i.width>=e||i.height>=e?n.attr("path"):null}(t,e);if(!a)return;return n=t.view,i=a,r=oe(n),o=ce(i),r.filter((function(t){var e,n,i=t.shape;if("path"===i.get("type"))e=ce(i.attr("path"));else{var r=i.getCanvasBBox();e=[[(n=r).minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]}return Object(Zt.isPolygonsIntersect)(o,e)}))}var s=$t(t,e);return s?le(t.view,s):null}function re(t,e,n){var i=$t(t,n);if(!i)return null;var r=t.view,o=de(r,e,{x:i.x,y:i.y}),a=de(r,e,{x:i.maxX,y:i.maxY});return le(e,{minX:o.x,minY:o.y,maxX:a.x,maxY:a.y})}function oe(t){var e=t.geometries,n=[];return Object(h.each)(e,(function(t){var e=t.elements;n=n.concat(e)})),t.views&&t.views.length&&Object(h.each)(t.views,(function(t){n=n.concat(oe(t))})),n}function ae(t,e){var n=t.geometries,i=[];return Object(h.each)(n,(function(t){var n=t.getElementsBy((function(t){return t.hasState(e)}));i=i.concat(n)})),i}function se(t,e){var n=t.getModel().data;return Object(h.isArray)(n)?n[0][e]:n[e]}function le(t,e){var n=oe(t),i=[];return Object(h.each)(n,(function(t){var n,r,o=t.shape.getCanvasBBox();n=e,(r=o).minX>n.maxX||r.maxXn.maxY||r.maxY=e.x&&t.y<=e.y&&t.maxY>e.y}function pe(t){var e=t.parent,n=null;return e&&(n=e.views.filter((function(e){return e!==t}))),n}function de(t,e,n){var i=function(t,e){return t.getCoordinate().invert(e)}(t,n);return e.getCoordinate().convert(i)}function ge(t,e,n,i){var r=!1;return Object(h.each)(t,(function(t){if(t[n]===e[n]&&t[i]===e[i])return r=!0,!1})),r}function ye(t,e){var n=t.getScaleByField(e);return!n&&t.views&&Object(h.each)(t.views,(function(t){if(n=ye(t,e))return!1})),n}var ve=function(){function t(t){this.actions=[],this.event=null,this.cacheMap={},this.view=t}return t.prototype.cache=function(){for(var t=[],e=0;e=0&&e.splice(n,1)},t.prototype.getCurrentPoint=function(){var t=this.event;return t?t.target instanceof HTMLElement?this.view.getCanvas().getPointByClient(t.clientX,t.clientY):{x:t.x,y:t.y}:null},t.prototype.getCurrentShape=function(){return Object(h.get)(this.event,["gEvent","shape"])},t.prototype.isInPlot=function(){var t=this.getCurrentPoint();return!!t&&this.view.isPointInPlot(t)},t.prototype.isInShape=function(t){var e=this.getCurrentShape();return!!e&&e.get("name")===t},t.prototype.isInComponent=function(t){var e=ue(this.view),n=this.getCurrentPoint();return!!n&&!!e.find((function(e){var i=e.getBBox();return t?e.get("name")===t&&fe(i,n):fe(i,n)}))},t.prototype.destroy=function(){Object(h.each)(this.actions.slice(),(function(t){t.destroy()})),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},t}(),me=function(){function t(t,e){this.view=t,this.cfg=e}return t.prototype.init=function(){this.initEvents()},t.prototype.initEvents=function(){},t.prototype.clearEvents=function(){},t.prototype.destroy=function(){this.clearEvents()},t}();function xe(t,e,n){var i=t.split(":"),r=i[0],o=e.getAction(r)||function(t,e){var n=Rt[t],i=null;return n&&((i=new(0,n.ActionClass)(e,n.cfg)).name=t,i.init()),i}(r,e);if(!o)throw new Error("There is no action named ".concat(r));return{action:o,methodName:i[1],arg:n}}function be(t){var e=t.action,n=t.methodName,i=t.arg;if(!e[n])throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(n));e[n](i)}var _e="start",Oe="showEnable",we="end",je="rollback",Se="processing",Me=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.callbackCaches={},i.emitCaches={},i.steps=n,i}return Object(u.__extends)(e,t),e.prototype.init=function(){this.initContext(),t.prototype.init.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;Object(h.each)(this.steps,(function(e,n){Object(h.each)(e,(function(e){var i=t.getActionCallback(n,e);i&&t.bindEvent(e.trigger,i)}))}))},e.prototype.clearEvents=function(){var t=this;Object(h.each)(this.steps,(function(e,n){Object(h.each)(e,(function(e){var i=t.getActionCallback(n,e);i&&t.offEvent(e.trigger,i)}))}))},e.prototype.initContext=function(){var t=this.view,e=new ve(t);this.context=e;var n=this.steps;Object(h.each)(n,(function(t){Object(h.each)(t,(function(t){if(Object(h.isFunction)(t.action))t.actionObject={action:Gt(t.action,e),methodName:"execute"};else if(Object(h.isString)(t.action))t.actionObject=xe(t.action,e,t.arg);else if(Object(h.isArray)(t.action)){var n=t.action,i=Object(h.isArray)(t.arg)?t.arg:[t.arg];t.actionObject=[],Object(h.each)(n,(function(n,r){t.actionObject.push(xe(n,e,i[r]))}))}}))}))},e.prototype.isAllowStep=function(t){var e=this.currentStepName,n=this.steps;if(e===t)return!0;if(t===Oe)return!0;if(t===Se)return e===_e;if(t===_e)return e!==Se;if(t===we)return e===Se||e===_e;if(t===je){if(n[we])return e===we;if(e===_e)return!0}return!1},e.prototype.isAllowExecute=function(t,e){if(this.isAllowStep(t)){var n=this.getKey(t,e);return(!e.once||!this.emitCaches[n])&&(!e.isEnable||e.isEnable(this.context))}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,e){t!==Oe&&this.currentStepName!==t&&this.enterStep(t);var n=this.getKey(t,e);this.emitCaches[n]=!0},e.prototype.getKey=function(t,e){return t+e.trigger+e.action},e.prototype.getActionCallback=function(t,e){var n=this,i=this.context,r=this.callbackCaches,o=e.actionObject;if(e.action&&o){var a=this.getKey(t,e);if(!r[a]){var s=function(r){i.event=r,n.isAllowExecute(t,e)?(Object(h.isArray)(o)?Object(h.each)(o,(function(t){i.event=r,be(t)})):(i.event=r,be(o)),n.afterExecute(t,e),e.callback&&(i.event=r,e.callback(i))):i.event=null};e.debounce?r[a]=Object(h.debounce)(s,e.debounce.wait,e.debounce.immediate):e.throttle?r[a]=Object(h.throttle)(s,e.throttle.wait,{leading:e.throttle.leading,trailing:e.throttle.trailing}):r[a]=s}return r[a]}return null},e.prototype.bindEvent=function(t,e){var n=t.split(":");"window"===n[0]?window.addEventListener(n[1],e):"document"===n[0]?document.addEventListener(n[1],e):this.view.on(t,e)},e.prototype.offEvent=function(t,e){var n=t.split(":");"window"===n[0]?window.removeEventListener(n[1],e):"document"===n[0]?document.removeEventListener(n[1],e):this.view.off(t,e)},e}(me),Ae={};function Ce(t){return Ae[Object(h.lowerCase)(t)]}function Ee(t,e){Ae[Object(h.lowerCase)(t)]=e}function Ie(t){var e,n={point:{default:{fill:t.pointFillColor,r:t.pointSize,stroke:t.pointBorderColor,lineWidth:t.pointBorder,fillOpacity:t.pointFillOpacity},active:{stroke:t.pointActiveBorderColor,lineWidth:t.pointActiveBorder},selected:{stroke:t.pointSelectedBorderColor,lineWidth:t.pointSelectedBorder},inactive:{fillOpacity:t.pointInactiveFillOpacity,strokeOpacity:t.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:t.hollowPointFillColor,lineWidth:t.hollowPointBorder,stroke:t.hollowPointBorderColor,strokeOpacity:t.hollowPointBorderOpacity,r:t.hollowPointSize},active:{stroke:t.hollowPointActiveBorderColor,strokeOpacity:t.hollowPointActiveBorderOpacity},selected:{lineWidth:t.hollowPointSelectedBorder,stroke:t.hollowPointSelectedBorderColor,strokeOpacity:t.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:t.hollowPointInactiveBorderOpacity}},area:{default:{fill:t.areaFillColor,fillOpacity:t.areaFillOpacity,stroke:null},active:{fillOpacity:t.areaActiveFillOpacity},selected:{fillOpacity:t.areaSelectedFillOpacity},inactive:{fillOpacity:t.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:t.hollowAreaBorderColor,lineWidth:t.hollowAreaBorder,strokeOpacity:t.hollowAreaBorderOpacity},active:{fill:null,lineWidth:t.hollowAreaActiveBorder},selected:{fill:null,lineWidth:t.hollowAreaSelectedBorder},inactive:{strokeOpacity:t.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:t.intervalFillColor,fillOpacity:t.intervalFillOpacity},active:{stroke:t.intervalActiveBorderColor,lineWidth:t.intervalActiveBorder},selected:{stroke:t.intervalSelectedBorderColor,lineWidth:t.intervalSelectedBorder},inactive:{fillOpacity:t.intervalInactiveFillOpacity,strokeOpacity:t.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:t.hollowIntervalFillColor,stroke:t.hollowIntervalBorderColor,lineWidth:t.hollowIntervalBorder,strokeOpacity:t.hollowIntervalBorderOpacity},active:{stroke:t.hollowIntervalActiveBorderColor,lineWidth:t.hollowIntervalActiveBorder,strokeOpacity:t.hollowIntervalActiveBorderOpacity},selected:{stroke:t.hollowIntervalSelectedBorderColor,lineWidth:t.hollowIntervalSelectedBorder,strokeOpacity:t.hollowIntervalSelectedBorderOpacity},inactive:{stroke:t.hollowIntervalInactiveBorderColor,lineWidth:t.hollowIntervalInactiveBorder,strokeOpacity:t.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:t.lineBorderColor,lineWidth:t.lineBorder,strokeOpacity:t.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:t.lineActiveBorder},selected:{lineWidth:t.lineSelectedBorder},inactive:{strokeOpacity:t.lineInactiveBorderOpacity}}},i=function(t){return{title:{autoRotate:!0,position:"center",spacing:t.axisTitleSpacing,style:{fill:t.axisTitleTextFillColor,fontSize:t.axisTitleTextFontSize,lineHeight:t.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily},iconStyle:{fill:t.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:t.axisLabelOffset,style:{fill:t.axisLabelFillColor,fontSize:t.axisLabelFontSize,lineHeight:t.axisLabelLineHeight,fontFamily:t.fontFamily}},line:{style:{lineWidth:t.axisLineBorder,stroke:t.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:t.axisGridBorderColor,lineWidth:t.axisGridBorder,lineDash:t.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:t.axisTickLineBorder,stroke:t.axisTickLineBorderColor},alignTick:!0,length:t.axisTickLineLength},subTickLine:null,animate:!0}}(t),r=function(t){return{title:null,marker:{symbol:"circle",spacing:t.legendMarkerSpacing,style:{r:t.legendCircleMarkerSize,fill:t.legendMarkerColor}},itemName:{spacing:5,style:{fill:t.legendItemNameFillColor,fontFamily:t.fontFamily,fontSize:t.legendItemNameFontSize,lineHeight:t.legendItemNameLineHeight,fontWeight:t.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:t.legendPageNavigatorMarkerSize,inactiveFill:t.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:t.legendPageNavigatorMarkerInactiveFillOpacity,fill:t.legendPageNavigatorMarkerFillColor,opacity:t.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:t.legendPageNavigatorTextFillColor,fontSize:t.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:t.legendItemSpacing,itemMarginBottom:t.legendItemMarginBottom,padding:t.legendPadding}}(t);return{background:t.backgroundColor,defaultColor:t.brandColor,subColor:t.subColor,semanticRed:t.paletteSemanticRed,semanticGreen:t.paletteSemanticGreen,padding:"auto",fontFamily:t.fontFamily,columnWidthRatio:.5,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:t.paletteQualitative10,colors20:t.paletteQualitative20,sequenceColors:t.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:n.interval.default},active:{style:n.interval.active},inactive:{style:n.interval.inactive},selected:{style:function(t){var e=t.geometry.coordinate;if(e.isPolar&&e.isTransposed){var i=lt(t.getModel(),e),r=(i.startAngle+i.endAngle)/2,o=7.5*Math.cos(r),a=7.5*Math.sin(r);return{matrix:G.ext.transform(null,[["t",o,a]])}}return n.interval.selected}}},"hollow-rect":{default:{style:n.hollowInterval.default},active:{style:n.hollowInterval.active},inactive:{style:n.hollowInterval.inactive},selected:{style:n.hollowInterval.selected}},line:{default:{style:n.hollowInterval.default},active:{style:n.hollowInterval.active},inactive:{style:n.hollowInterval.inactive},selected:{style:n.hollowInterval.selected}},tick:{default:{style:n.hollowInterval.default},active:{style:n.hollowInterval.active},inactive:{style:n.hollowInterval.inactive},selected:{style:n.hollowInterval.selected}},funnel:{default:{style:n.interval.default},active:{style:n.interval.active},inactive:{style:n.interval.inactive},selected:{style:n.interval.selected}},pyramid:{default:{style:n.interval.default},active:{style:n.interval.active},inactive:{style:n.interval.inactive},selected:{style:n.interval.selected}}},line:{line:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},dot:{default:{style:Object(u.__assign)(Object(u.__assign)({},n.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:Object(u.__assign)(Object(u.__assign)({},n.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:Object(u.__assign)(Object(u.__assign)({},n.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:Object(u.__assign)(Object(u.__assign)({},n.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:Object(u.__assign)(Object(u.__assign)({},n.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:Object(u.__assign)(Object(u.__assign)({},n.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:Object(u.__assign)(Object(u.__assign)({},n.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:Object(u.__assign)(Object(u.__assign)({},n.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},hv:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},vh:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},hvh:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},vhv:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}}},polygon:{polygon:{default:{style:n.interval.default},active:{style:n.interval.active},inactive:{style:n.interval.inactive},selected:{style:n.interval.selected}}},point:{circle:{default:{style:n.point.default},active:{style:n.point.active},inactive:{style:n.point.inactive},selected:{style:n.point.selected}},square:{default:{style:n.point.default},active:{style:n.point.active},inactive:{style:n.point.inactive},selected:{style:n.point.selected}},bowtie:{default:{style:n.point.default},active:{style:n.point.active},inactive:{style:n.point.inactive},selected:{style:n.point.selected}},diamond:{default:{style:n.point.default},active:{style:n.point.active},inactive:{style:n.point.inactive},selected:{style:n.point.selected}},hexagon:{default:{style:n.point.default},active:{style:n.point.active},inactive:{style:n.point.inactive},selected:{style:n.point.selected}},triangle:{default:{style:n.point.default},active:{style:n.point.active},inactive:{style:n.point.inactive},selected:{style:n.point.selected}},"triangle-down":{default:{style:n.point.default},active:{style:n.point.active},inactive:{style:n.point.inactive},selected:{style:n.point.selected}},"hollow-circle":{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},"hollow-square":{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},"hollow-bowtie":{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},"hollow-diamond":{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},"hollow-hexagon":{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},"hollow-triangle":{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},"hollow-triangle-down":{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},cross:{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},tick:{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},plus:{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},hyphen:{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}},line:{default:{style:n.hollowPoint.default},active:{style:n.hollowPoint.active},inactive:{style:n.hollowPoint.inactive},selected:{style:n.hollowPoint.selected}}},area:{area:{default:{style:n.area.default},active:{style:n.area.active},inactive:{style:n.area.inactive},selected:{style:n.area.selected}},smooth:{default:{style:n.area.default},active:{style:n.area.active},inactive:{style:n.area.inactive},selected:{style:n.area.selected}},line:{default:{style:n.hollowArea.default},active:{style:n.hollowArea.active},inactive:{style:n.hollowArea.inactive},selected:{style:n.hollowArea.selected}},"smooth-line":{default:{style:n.hollowArea.default},active:{style:n.hollowArea.active},inactive:{style:n.hollowArea.inactive},selected:{style:n.hollowArea.selected}}},schema:{candle:{default:{style:n.hollowInterval.default},active:{style:n.hollowInterval.active},inactive:{style:n.hollowInterval.inactive},selected:{style:n.hollowInterval.selected}},box:{default:{style:n.hollowInterval.default},active:{style:n.hollowInterval.active},inactive:{style:n.hollowInterval.inactive},selected:{style:n.hollowInterval.selected}}},edge:{line:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},vhv:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},smooth:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},arc:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}}},violin:{violin:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},smooth:{default:{style:n.line.default},active:{style:n.line.active},inactive:{style:n.line.inactive},selected:{style:n.line.selected}},hollow:{default:{style:n.hollowArea.default},active:{style:n.hollowArea.active},inactive:{style:n.hollowArea.inactive},selected:{style:n.hollowArea.selected}},"hollow-smooth":{default:{style:n.hollowArea.default},active:{style:n.hollowArea.active},inactive:{style:n.hollowArea.inactive},selected:{style:n.hollowArea.selected}}}},components:{axis:{common:i,top:{position:"top",grid:null,title:null,verticalLimitLength:.5},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:.5},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:Object(h.deepMix)({},i.grid,{line:{type:"line"}})},radius:{title:null,grid:Object(h.deepMix)({},i.grid,{line:{type:"circle"}})}},legend:{common:r,right:{layout:"vertical",padding:t.legendVerticalPadding},left:{layout:"vertical",padding:t.legendVerticalPadding},top:{layout:"horizontal",padding:t.legendHorizontalPadding},bottom:{layout:"horizontal",padding:t.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:t.sliderRailHeight,defaultLength:t.sliderRailWidth,style:{fill:t.sliderRailFillColor,stroke:t.sliderRailBorderColor,lineWidth:t.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:t.sliderLabelTextFillColor,fontSize:t.sliderLabelTextFontSize,lineHeight:t.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily}},handler:{size:t.sliderHandlerWidth,style:{fill:t.sliderHandlerFillColor,stroke:t.sliderHandlerBorderColor}},slidable:!0,padding:r.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:t.tooltipCrosshairsBorderColor,lineWidth:t.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(Z.TOOLTIP_CSS_CONST.CONTAINER_CLASS)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:t.tooltipContainerFillColor,opacity:t.tooltipContainerFillOpacity,boxShadow:t.tooltipContainerShadow,borderRadius:"".concat(t.tooltipContainerBorderRadius,"px"),color:t.tooltipTextFillColor,fontSize:"".concat(t.tooltipTextFontSize,"px"),fontFamily:t.fontFamily,lineHeight:"".concat(t.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(Z.TOOLTIP_CSS_CONST.TITLE_CLASS)]={marginBottom:"12px",marginTop:"12px"},e["".concat(Z.TOOLTIP_CSS_CONST.LIST_CLASS)]={margin:0,listStyleType:"none",padding:0},e["".concat(Z.TOOLTIP_CSS_CONST.LIST_ITEM_CLASS)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(Z.TOOLTIP_CSS_CONST.MARKER_CLASS)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(Z.TOOLTIP_CSS_CONST.VALUE_CLASS)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:t.annotationArcBorderColor,lineWidth:t.annotationArcBorder},animate:!0},line:{style:{stroke:t.annotationLineBorderColor,lineDash:t.annotationLineDash,lineWidth:t.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textAlign:"start",fontFamily:t.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:t.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:t.annotationRegionBorder,stroke:t.annotationRegionBorderColor,fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:t.brandColor,lineWidth:2}},line:{style:{stroke:t.annotationLineBorderColor,lineWidth:t.annotationLineBorder},length:t.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:t.cSliderBackgroundFillColor,opacity:t.cSliderBackgroundFillOpacity},foregroundStyle:{fill:t.cSliderForegroundFillColor,opacity:t.cSliderForegroundFillOpacity},handlerStyle:{width:t.cSliderHandlerWidth,height:t.cSliderHandlerHeight,fill:t.cSliderHandlerFillColor,opacity:t.cSliderHandlerFillOpacity,stroke:t.cSliderHandlerBorderColor,lineWidth:t.cSliderHandlerBorder,radius:t.cSliderHandlerBorderRadius,highLightFill:t.cSliderHandlerHighlightFillColor},textStyle:{fill:t.cSliderTextFillColor,opacity:t.cSliderTextFillOpacity,fontSize:t.cSliderTextFontSize,lineHeight:t.cSliderTextLineHeight,fontWeight:t.cSliderTextFontWeight,stroke:t.cSliderTextBorderColor,lineWidth:t.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:t.scrollbarTrackFillColor,thumbColor:t.scrollbarThumbFillColor}},hover:{style:{thumbColor:t.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:t.labelFillColor,fontSize:t.labelFontSize,fontFamily:t.fontFamily,stroke:t.labelBorderColor,lineWidth:t.labelBorder},fillColorDark:t.labelFillColorDark,fillColorLight:t.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:t.innerLabelFillColor,fontSize:t.innerLabelFontSize,fontFamily:t.fontFamily,stroke:t.innerLabelBorderColor,lineWidth:t.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:t.overflowLabelFillColor,fontSize:t.overflowLabelFontSize,fontFamily:t.fontFamily,stroke:t.overflowLabelBorderColor,lineWidth:t.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:t.labelLineBorder}},autoRotate:!0}}}var Pe="#000",Fe="#595959",Te="#8C8C8C",Le="#BFBFBF",De="#D9D9D9",ke="#F0F0F0",Be="#FFFFFF",Ne="#D9D9D9",Re=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],Ve=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],ze=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],Ge=function(t){void 0===t&&(t={});var e=t.paletteQualitative10,n=void 0===e?Re:e,i=t.paletteQualitative20,r=void 0===i?Ve:i,o=t.brandColor,a=void 0===o?n[0]:o,s={backgroundColor:"transparent",brandColor:a,subColor:"rgba(0,0,0,0.05)",paletteQualitative10:n,paletteQualitative20:r,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:ze,fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial,\n "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",\n "Noto Color Emoji"',axisLineBorderColor:Le,axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:Fe,axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:Ne,axisTickLineBorderColor:Le,axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:De,axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:Te,axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:De,axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:Te,legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:a,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:Fe,legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:Pe,legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:Pe,legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:Te,legendPageNavigatorTextFontSize:12,sliderRailFillColor:De,sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:Te,sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:ke,sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:Le,annotationArcBorderColor:De,annotationArcBorder:1,annotationLineBorderColor:Le,annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:Fe,annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:Pe,annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:Le,tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:Fe,tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:Fe,labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:Be,innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:Fe,overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:Be,overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:Le,cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:a,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:Be,pointBorderOpacity:1,pointActiveBorderColor:Pe,pointSelectedBorder:2,pointSelectedBorderColor:Pe,pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:a,hollowPointBorderOpacity:.95,hollowPointFillColor:Be,hollowPointActiveBorder:1,hollowPointActiveBorderColor:Pe,hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:Pe,hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:a,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:a,areaFillOpacity:.25,areaActiveFillColor:a,areaActiveFillOpacity:.5,areaSelectedFillColor:a,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:a,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:Pe,hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:Pe,hollowAreaInactiveBorderOpacity:.3,intervalFillColor:a,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:Pe,intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:Pe,intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:a,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:Be,hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:Pe,hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:Pe,hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return Object(u.__assign)(Object(u.__assign)({},s),t)};Ge();function Ye(t){var e=t.styleSheet,n=void 0===e?{}:e,i=Object(u.__rest)(t,["styleSheet"]),r=Ge(n);return Object(h.deepMix)({},Ie(r),i)}var Xe={default:Ye({})};function We(t){return Object(h.get)(Xe,Object(h.lowerCase)(t),Xe.default)}function He(t,e){Xe[Object(h.lowerCase)(t)]=Ye(e)}function Ue(t,e,n){var i=n.translate(t),r=n.translate(e);return Object(h.isNumberEqual)(i,r)}function qe(t,e,n){var i=n.coordinate,r=n.getYScale(),o=r.field,a=i.invert(e),s=r.invert(a.y);return Object(h.find)(t,(function(t){var e=t._origin;return e[o][0]<=s&&e[o][1]>=s}))||t[t.length-1]}var Ze=Object(h.memoize)((function(t){if(t.isCategory)return 1;for(var e=t.values,n=e.length,i=t.translate(e[0]),r=i,o=0;or&&(r=s)}return(r-i)/(n-1)}));function $e(t){var e,n,i,r=function(t){var e=Object(h.values)(t.attributes);return Object(h.filter)(e,(function(t){return Object(h.contains)(x,t.type)}))}(t);try{for(var o=Object(u.__values)(r),a=o.next();!a.done;a=o.next()){var s=a.value,l=s.getScale(s.type);if(l&&l.isLinear)if("cat"!==bt(l,Object(h.get)(t.scaleDefs,l.field),s.type,t.type)){i=l;break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}var c=t.getXScale(),f=t.getYScale();return i||f||c}function Ke(t,e,n){if(0===e.length)return null;var i=n.type,r=n.getXScale(),o=n.getYScale(),a=r.field,s=o.field,l=null;if("heatmap"===i||"point"===i){for(var c=n.coordinate.invert(t),u=r.invert(c.x),f=o.invert(c.y),p=1/0,d=0;d(1+o)/2&&(s=a),i.translate(i.invert(s))}(t,n),_=m._origin[a],O=m._origin[s],w=x._origin[a],j=o.isLinear&&Object(h.isArray)(O);if(Object(h.isArray)(_)){for(d=0;d=b){if(!j){l=I;break}Object(h.isArray)(l)||(l=[]),l.push(I)}}Object(h.isArray)(l)&&(l=qe(l,t,n))}else{var S=void 0;if(r.isLinear||"timeCat"===r.type){if((b>r.translate(w)||br.max||bMath.abs(r.translate(S._origin[a])-b)&&(x=S)}var P=Ze(n.getXScale());return!l&&Math.abs(r.translate(x._origin[a])-b)<=P/2&&(l=x),l}function Qe(t,e,n,i){var r,o;void 0===n&&(n=""),void 0===i&&(i=!1);var a,s=t._origin,l=function(t,e,n){var i=e.getAttribute("position").getFields(),r=e.scales,o=Object(h.isFunction)(n)||!n?i[0]:n,a=r[o],s=a?a.getText(t[o]):t[o]||o;return Object(h.isFunction)(n)?n(s,t):s}(s,e,n),c=e.tooltipOption,f=e.theme.defaultColor,p=[];function d(e,n){if(i||!Object(h.isNil)(n)&&""!==n){var r={title:l,data:s,mappingData:t,name:e,value:n,color:t.color||f,marker:!0};p.push(r)}}if(Object(h.isObject)(c)){var g=c.fields,y=c.callback;if(y){var v=g.map((function(e){return t._origin[e]})),m=y.apply(void 0,Object(u.__spreadArray)([],Object(u.__read)(v),!1)),x=Object(u.__assign)({data:t._origin,mappingData:t,title:l,color:t.color||f,marker:!0},m);p.push(x)}else{var b=e.scales;try{for(var _=Object(u.__values)(g),O=_.next();!O.done;O=_.next()){var w=O.value;if(!Object(h.isNil)(s[w])){var j=b[w];d(Ot(j),a=j.getText(s[w]))}}}catch(t){r={error:t}}finally{try{O&&!O.done&&(o=_.return)&&o.call(_)}finally{if(r)throw r.error}}}}else{var S=$e(e);a=function(t,e){var n=t[e.field];return Object(h.isArray)(n)?n.map((function(t){return e.getText(t)})).join("-"):e.getText(n)}(s,S),d(function(t,e){var n,i=e.getGroupScales();if(i.length&&(n=i[0]),n){var r=n.field;return n.getText(t[r])}return Ot($e(e))}(s,e),a)}return p}function Je(t,e,n,i){var r,o,a=i.showNil,s=[],l=t.dataArray;if(!Object(h.isEmpty)(l)){t.sort(l);try{for(var c=Object(u.__values)(l),f=c.next();!f.done;f=c.next()){var p=Ke(e,f.value,t);if(p){var d=t.getElementId(p),g=t.elementsMap[d];if("heatmap"===t.type||g.visible){var y=Qe(p,t,n,a);y.length&&s.push(y)}}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}return s}function tn(t,e,n,i){var r=i.showNil,o=[],a=t.container.getShape(e.x,e.y);if(a&&a.get("visible")&&a.get("origin")){var s=Qe(a.get("origin").mappingData,t,n,r);s.length&&o.push(s)}return o}function en(t,e,n){var i,r,o=[],a=t.geometries,s=n.shared,l=n.title,c=n.reversed;try{for(var h=Object(u.__values)(a),f=h.next();!f.done;f=h.next()){var p=f.value;if(p.visible&&!1!==p.tooltipOption){var d=p.type,g=void 0;(g=["point","edge","polygon"].includes(d)?tn(p,e,l,n):["area","line","path","heatmap"].includes(d)||!1!==s?Je(p,e,l,n):tn(p,e,l,n)).length&&(c&&g.reverse(),o.push(g))}}}catch(t){i={error:t}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}return o}function nn(t){void 0===t&&(t=0);var e=Object(h.isArray)(t)?t:[t];switch(e.length){case 0:e=[0,0,0,0];break;case 1:e=new Array(4).fill(e[0]);break;case 2:e=Object(u.__spreadArray)(Object(u.__spreadArray)([],Object(u.__read)(e),!1),Object(u.__read)(e),!1);break;case 3:e=Object(u.__spreadArray)(Object(u.__spreadArray)([],Object(u.__read)(e),!1),[e[1]],!1);break;default:e=e.slice(0,4)}return e}var rn={};function on(t,e){rn[t]=e}var an=function(){function t(t){this.option=this.wrapperOption(t)}return t.prototype.update=function(t){return this.option=this.wrapperOption(t),this},t.prototype.hasAction=function(t){var e=this.option.actions;return Object(h.some)(e,(function(e){return e[0]===t}))},t.prototype.create=function(t,e){var n=this.option,i=n.type,r=n.cfg,o="theta"===i,a=Object(u.__assign)({start:t,end:e},r),s=function(t){return U[t.toLowerCase()]}(o?"polar":i);return this.coordinate=new s(a),this.coordinate.type=i,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},t.prototype.adjust=function(t,e){return this.coordinate.update({start:t,end:e}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},t.prototype.rotate=function(t){return this.option.actions.push(["rotate",t]),this},t.prototype.reflect=function(t){return this.option.actions.push(["reflect",t]),this},t.prototype.scale=function(t,e){return this.option.actions.push(["scale",t,e]),this},t.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},t.prototype.getOption=function(){return this.option},t.prototype.getCoordinate=function(){return this.coordinate},t.prototype.wrapperOption=function(t){return Object(u.__assign)({type:"rect",actions:[],cfg:{}},t)},t.prototype.execActions=function(t){var e=this,n=this.option.actions;Object(h.each)(n,(function(n){var i,r=Object(u.__read)(n),o=r[0],a=r.slice(1);(!!Object(h.isNil)(t)||t.includes(o))&&(i=e.coordinate)[o].apply(i,Object(u.__spreadArray)([],Object(u.__read)(a),!1))}))},t}(),sn=function(){function t(t,e,n){this.view=t,this.gEvent=e,this.data=n,this.type=e.type}return t.fromData=function(e,n,i){return new t(e,new A.e(n,{}),i)},Object.defineProperty(t.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},t.prototype.clone=function(){return new t(this.view,this.gEvent,this.data)},t}();function ln(t){var e=t.getController("axis"),n=t.getController("legend"),i=t.getController("annotation");[e,t.getController("slider"),t.getController("scrollbar"),n,i].forEach((function(t){t&&t.layout()}))}var cn=function(){function t(){this.scales=new Map,this.syncScales=new Map}return t.prototype.createScale=function(t,e,n,i){var r=n,o=this.getScaleMeta(i);if(0===e.length&&o){var a=o.scale,s={type:a.type};a.isCategory&&(s.values=a.values),r=Object(h.deepMix)(s,o.scaleDef,n)}var l=_t(t,e,r);return this.cacheScale(l,n,i),l},t.prototype.sync=function(t,e){var n=this;this.syncScales.forEach((function(i,r){var o=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=[];Object(h.each)(i,(function(t){var e=n.getScale(t);a=Object(h.isNumber)(e.max)?Math.max(a,e.max):a,o=Object(h.isNumber)(e.min)?Math.min(o,e.min):o,Object(h.each)(e.values,(function(t){s.includes(t)||s.push(t)}))})),Object(h.each)(i,(function(i){var r=n.getScale(i);if(r.isContinuous)r.change({min:o,max:a,values:s});else if(r.isCategory){var l=r.range,c=n.getScaleMeta(i);s&&!Object(h.get)(c,["scaleDef","range"])&&(l=wt(Object(h.deepMix)({},r,{values:s}),t,e)),r.change({values:s,range:l})}}))}))},t.prototype.cacheScale=function(t,e,n){var i=this.getScaleMeta(n);i&&i.scale.type===t.type?(!function(t,e){if("identity"!==t.type&&"identity"!==e.type){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);t.change(n)}}(i.scale,t),i.scaleDef=e):(i={key:n,scale:t,scaleDef:e},this.scales.set(n,i));var r=this.getSyncKey(i);if(i.syncKey=r,this.removeFromSyncScales(n),r){var o=this.syncScales.get(r);o||(o=[],this.syncScales.set(r,o)),o.push(n)}},t.prototype.getScale=function(t){var e=this.getScaleMeta(t);if(!e){var n=Object(h.last)(t.split("-")),i=this.syncScales.get(n);i&&i.length&&(e=this.getScaleMeta(i[0]))}return e&&e.scale},t.prototype.deleteScale=function(t){var e=this.getScaleMeta(t);if(e){var n=e.syncKey,i=this.syncScales.get(n);if(i&&i.length){var r=i.indexOf(t);-1!==r&&i.splice(r,1)}}this.scales.delete(t)},t.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},t.prototype.removeFromSyncScales=function(t){var e=this;this.syncScales.forEach((function(n,i){var r=n.indexOf(t);if(-1!==r)return n.splice(r,1),0===n.length&&e.syncScales.delete(i),!1}))},t.prototype.getSyncKey=function(t){var e=t.scale,n=t.scaleDef,i=e.field,r=Object(h.get)(n,["sync"]);return!0===r?i:!1===r?void 0:r},t.prototype.getScaleMeta=function(t){return this.scales.get(t)},t}(),un=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.top=t,this.right=e,this.bottom=n,this.left=i}return t.instance=function(e,n,i,r){return void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===r&&(r=0),new t(e,n,i,r)},t.prototype.max=function(t){var e=Object(u.__read)(t,4),n=e[0],i=e[1],r=e[2],o=e[3];return this.top=Math.max(this.top,n),this.right=Math.max(this.right,i),this.bottom=Math.max(this.bottom,r),this.left=Math.max(this.left,o),this},t.prototype.shrink=function(t){var e=Object(u.__read)(t,4),n=e[0],i=e[1],r=e[2],o=e[3];return this.top+=n,this.right+=i,this.bottom+=r,this.left+=o,this},t.prototype.inc=function(t,e){var n=t.width,i=t.height;switch(e){case l.TOP:case l.TOP_LEFT:case l.TOP_RIGHT:this.top+=i;break;case l.RIGHT:case l.RIGHT_TOP:case l.RIGHT_BOTTOM:this.right+=n;break;case l.BOTTOM:case l.BOTTOM_LEFT:case l.BOTTOM_RIGHT:this.bottom+=i;break;case l.LEFT:case l.LEFT_TOP:case l.LEFT_BOTTOM:this.left+=n}return this},t.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},t.prototype.clone=function(){return new(t.bind.apply(t,Object(u.__spreadArray)([void 0],Object(u.__read)(this.getPadding()),!1)))},t}();function hn(t){var e=t.padding;if(!function(t){return!Object(h.isNumber)(t)&&!Object(h.isArray)(t)}(e))return new(un.bind.apply(un,Object(u.__spreadArray)([void 0],Object(u.__read)(nn(e)),!1)));var n=t.viewBBox,i=new un,r=[],o=[],a=[];return Object(h.each)(t.getComponents(),(function(t){var e=t.type;e===c.AXIS?r.push(t):[c.LEGEND,c.SLIDER,c.SCROLLBAR].includes(e)?o.push(t):e!==c.GRID&&e!==c.TOOLTIP&&a.push(t)})),Object(h.each)(r,(function(t){var e=t.component.getLayoutBBox(),r=new dt(e.x,e.y,e.width,e.height).exceed(n);i.max(r)})),Object(h.each)(o,(function(t){var e=t.component,n=t.direction,r=e.getLayoutBBox(),o=e.get("padding"),a=new dt(r.x,r.y,r.width,r.height).expand(o);i.inc(a,n)})),Object(h.each)(a,(function(t){var e=t.component,n=t.direction,r=e.getLayoutBBox(),o=new dt(r.x,r.y,r.width,r.height);i.inc(o,n)})),i}function fn(t,e,n){var i=n.instance();e.forEach((function(t){t.autoPadding=i.max(t.autoPadding.getPadding())}))}var pn=function(t){function e(e){var n=t.call(this,{visible:e.visible})||this;n.views=[],n.geometries=[],n.controllers=[],n.interactions={},n.limitInPlot=!1,n.options={data:[],animate:!0},n.usedControllers=Object.keys(rn),n.scalePool=new cn,n.layoutFunc=ln,n.isPreMouseInPlot=!1,n.isDataChanged=!1,n.isCoordinateChanged=!1,n.createdScaleKeys=new Map,n.onCanvasEvent=function(t){var e=t.name;if(!e.includes(":")){var i=n.createViewEvent(t);n.doPlotEvent(i),n.emit(e,i)}},n.onDelegateEvents=function(t){var e=t.name;if(e.includes(":")){var i=n.createViewEvent(t);n.emit(e,i)}};var i=e.id,r=void 0===i?Object(h.uniqueId)("view"):i,o=e.parent,a=e.canvas,s=e.backgroundGroup,l=e.middleGroup,c=e.foregroundGroup,f=e.region,p=void 0===f?{start:{x:0,y:0},end:{x:1,y:1}}:f,d=e.padding,g=e.appendPadding,y=e.theme,v=e.options,m=e.limitInPlot,x=e.syncViewPadding;return n.parent=o,n.canvas=a,n.backgroundGroup=s,n.middleGroup=l,n.foregroundGroup=c,n.region=p,n.padding=d,n.appendPadding=g,n.options=Object(u.__assign)(Object(u.__assign)({},n.options),v),n.limitInPlot=m,n.id=r,n.syncViewPadding=x,n.themeObject=Object(h.isObject)(y)?Object(h.deepMix)({},We("default"),Ye(y)):We(y),n.init(),n}return Object(u.__extends)(e,t),e.prototype.setLayout=function(t){this.layoutFunc=t},e.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},e.prototype.render=function(t,e){void 0===t&&(t=!1),this.emit(f.BEFORE_RENDER,sn.fromData(this,f.BEFORE_RENDER,e)),this.paint(t),this.emit(f.AFTER_RENDER,sn.fromData(this,f.AFTER_RENDER,e)),!1===this.visible&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(f.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var e=this.geometries,n=0;n');T.appendChild(L);var D=S(T,s,r,o),k=new(_(p).Canvas)(Object(u.__assign)({container:L,pixelRatio:d,localRefresh:x,supportCSSTransform:M},D));return(n=t.call(this,{parent:null,canvas:k,backgroundGroup:k.addGroup({zIndex:m}),middleGroup:k.addGroup({zIndex:v}),foregroundGroup:k.addGroup({zIndex:y}),padding:l,appendPadding:c,visible:O,options:E,limitInPlot:I,theme:P,syncViewPadding:F})||this).onResize=Object(h.debounce)((function(){n.forceFit()}),300),n.ele=T,n.canvas=k,n.width=D.width,n.height=D.height,n.autoFit=s,n.localRefresh=x,n.renderer=p,n.wrapperElement=L,n.updateCanvasStyle(),n.bindAutoFit(),n.initDefaultInteractions(C),n}return Object(u.__extends)(e,t),e.prototype.initDefaultInteractions=function(t){var e=this;Object(h.each)(t,(function(t){e.interaction(t)}))},e.prototype.aria=function(t){!1===t?this.ele.removeAttribute("aria-label"):this.ele.setAttribute("aria-label",t.label)},e.prototype.changeSize=function(t,e){return this.width===t&&this.height===e||(this.emit(f.BEFORE_CHANGE_SIZE),this.width=t,this.height=e,this.canvas.changeSize(t,e),this.render(!0),this.emit(f.AFTER_CHANGE_SIZE)),this},e.prototype.clear=function(){t.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){var e,n;t.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),e=this.wrapperElement,(n=e.parentNode)&&n.removeChild(e),this.wrapperElement=null},e.prototype.changeVisible=function(e){return t.prototype.changeVisible.call(this,e),this.wrapperElement.style.display=e?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=S(this.ele,!0,this.width,this.height),e=t.width,n=t.height;this.changeSize(e,n)}},e.prototype.updateCanvasStyle=function(){Object(w.e)(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(gn),vn=function(){function t(t){this.visible=!0,this.components=[],this.view=t}return t.prototype.clear=function(t){Object(h.each)(this.components,(function(t){t.component.destroy()})),this.components=[]},t.prototype.destroy=function(){this.clear()},t.prototype.getComponents=function(){return this.components},t.prototype.changeVisible=function(t){this.visible!==t&&(this.components.forEach((function(e){t?e.component.show():e.component.hide()})),this.visible=t)},t}();var mn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLocked=!1,e}return Object(u.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"tooltip"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.isVisible=function(){return!1!==this.view.getOptions().tooltip},e.prototype.render=function(){},e.prototype.showTooltip=function(t){if(this.point=t,this.isVisible()){var e=this.view,n=this.getTooltipItems(t);if(n.length){var i=this.getTitle(n),r={x:n[0].x,y:n[0].y};e.emit("tooltip:show",sn.fromData(e,"tooltip:show",Object(u.__assign)({items:n,title:i},t)));var o=this.getTooltipCfg(),a=o.follow,s=o.showMarkers,l=o.showCrosshairs,c=o.showContent,f=o.marker,p=this.items,d=this.title;if(Object(h.isEqual)(d,i)&&Object(h.isEqual)(p,n)?(this.tooltip&&a&&(this.tooltip.update(t),this.tooltip.show()),this.tooltipMarkersGroup&&this.tooltipMarkersGroup.show()):(e.emit("tooltip:change",sn.fromData(e,"tooltip:change",Object(u.__assign)({items:n,title:i},t))),(Object(h.isFunction)(c)?c(n):c)&&(this.tooltip||this.renderTooltip(),this.tooltip.update(Object(h.mix)({},o,{items:this.getItemsAfterProcess(n),title:i},a?t:{})),this.tooltip.show()),s&&this.renderTooltipMarkers(n,f)),this.items=n,this.title=i,l){var g=Object(h.get)(o,["crosshairs","follow"],!1);this.renderCrosshairs(g?t:r,o)}}else this.hideTooltip()}},e.prototype.hideTooltip=function(){if(this.getTooltipCfg().follow){var t=this.tooltipMarkersGroup;t&&t.hide();var e=this.xCrosshair,n=this.yCrosshair;e&&e.hide(),n&&n.hide();var i=this.tooltip;i&&i.hide(),this.view.emit("tooltip:hide",sn.fromData(this.view,"tooltip:hide",{})),this.point=null}else this.point=null},e.prototype.lockTooltip=function(){this.isLocked=!0,this.tooltip&&this.tooltip.setCapture(!0)},e.prototype.unlockTooltip=function(){this.isLocked=!1;var t=this.getTooltipCfg();this.tooltip&&this.tooltip.setCapture(t.capture)},e.prototype.isTooltipLocked=function(){return this.isLocked},e.prototype.clear=function(){var t=this.tooltip,e=this.xCrosshair,n=this.yCrosshair,i=this.tooltipMarkersGroup;t&&(t.hide(),t.clear()),e&&e.clear(),n&&n.clear(),i&&i.clear(),(null==t?void 0:t.get("customContent"))&&(this.tooltip.destroy(),this.tooltip=null),this.title=null,this.items=null},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),this.xCrosshair&&this.xCrosshair.destroy(),this.yCrosshair&&this.yCrosshair.destroy(),this.guideGroup&&this.guideGroup.remove(!0),this.reset()},e.prototype.reset=function(){this.items=null,this.title=null,this.tooltipMarkersGroup=null,this.tooltipCrosshairsGroup=null,this.xCrosshair=null,this.yCrosshair=null,this.tooltip=null,this.guideGroup=null,this.isLocked=!1,this.point=null},e.prototype.changeVisible=function(t){if(this.visible!==t){var e=this.tooltip,n=this.tooltipMarkersGroup,i=this.xCrosshair,r=this.yCrosshair;t?(e&&e.show(),n&&n.show(),i&&i.show(),r&&r.show()):(e&&e.hide(),n&&n.hide(),i&&i.hide(),r&&r.hide()),this.visible=t}},e.prototype.getTooltipItems=function(t){var e,n,i,r,o,a,s=this.findItemsFromView(this.view,t);if(s.length){s=Object(h.flatten)(s);try{for(var l=Object(u.__values)(s),c=l.next();!c.done;c=l.next()){var f=c.value;try{for(var p=(i=void 0,Object(u.__values)(f)),d=p.next();!d.done;d=p.next()){var g=d.value,y=g.mappingData,v=y.x,m=y.y;g.x=Object(h.isArray)(v)?v[v.length-1]:v,g.y=Object(h.isArray)(m)?m[m.length-1]:m}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=p.return)&&r.call(p)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}if(!1===this.getTooltipCfg().shared&&s.length>1){var x=s[0],b=Math.abs(t.y-x[0].y);try{for(var _=Object(u.__values)(s),O=_.next();!O.done;O=_.next()){var w=O.value,j=Math.abs(t.y-w[0].y);j<=b&&(x=w,b=j)}}catch(t){o={error:t}}finally{try{O&&!O.done&&(a=_.return)&&a.call(_)}finally{if(o)throw o.error}}s=[x]}return function(t){for(var e=[],n=function(n){var i=t[n];Object(h.find)(e,(function(t){return t.color===i.color&&t.name===i.name&&t.value===i.value&&t.title===i.title}))||e.push(i)},i=0;i'+i+"":i}})},e.prototype.getTitle=function(t){var e=t[0].title||t[0].name;return this.title=e,e},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),e={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},n=this.getTooltipCfg(),i=new nt(Object(u.__assign)(Object(u.__assign)({parent:t.get("el").parentNode,region:e},n),{visible:!1,crosshairs:null}));i.init(),this.tooltip=i},e.prototype.renderTooltipMarkers=function(t,e){var n,i,r=this.getTooltipMarkersGroup(),o=this.view.getRootView(),a=o.limitInPlot;try{for(var s=Object(u.__values)(t),l=s.next();!l.done;l=s.next()){var c=l.value,f=c.x,p=c.y;if(a||(null==r?void 0:r.getClip())){var d=mt(o.getCoordinate()),g=d.type,y=d.attrs;null==r||r.setClip({type:g,attrs:y})}else null==r||r.setClip(void 0);var v=this.view.getTheme(),m=Object(h.get)(v,["components","tooltip","marker"],{}),x=Object(u.__assign)(Object(u.__assign)({fill:c.color,symbol:"circle",shadowColor:c.color},Object(h.isFunction)(e)?Object(u.__assign)(Object(u.__assign)({},m),e(c)):e),{x:f,y:p});r.addShape("marker",{attrs:x})}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}},e.prototype.renderCrosshairs=function(t,e){var n=Object(h.get)(e,["crosshairs","type"],"x");"x"===n?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,e)):"y"===n?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,e)):"xy"===n&&(this.renderXCrosshairs(t,e),this.renderYCrosshairs(t,e))},e.prototype.renderXCrosshairs=function(t,e){var n,i,r=this.getViewWithGeometry(this.view).getCoordinate();if(r.isRect)r.isTransposed?(n={x:r.start.x,y:t.y},i={x:r.end.x,y:t.y}):(n={x:t.x,y:r.end.y},i={x:t.x,y:r.start.y});else{var o=vt(r,t),a=r.getCenter(),s=r.getRadius();i=ot(a.x,a.y,s,o),n=a}var l=Object(h.deepMix)({start:n,end:i,container:this.getTooltipCrosshairsGroup()},Object(h.get)(e,"crosshairs",{}),this.getCrosshairsText("x",t,e));delete l.type;var c=this.xCrosshair;c?c.update(l):(c=new Z.Crosshair.Line(l)).init(),c.render(),c.show(),this.xCrosshair=c},e.prototype.renderYCrosshairs=function(t,e){var n,i,r=this.getViewWithGeometry(this.view).getCoordinate();if(r.isRect){var o=void 0,a=void 0;r.isTransposed?(o={x:t.x,y:r.end.y},a={x:t.x,y:r.start.y}):(o={x:r.start.x,y:t.y},a={x:r.end.x,y:t.y}),n={start:o,end:a},i="Line"}else n={center:r.getCenter(),radius:yt(r,t),startAngle:r.startAngle,endAngle:r.endAngle},i="Circle";delete(n=Object(h.deepMix)({container:this.getTooltipCrosshairsGroup()},n,Object(h.get)(e,"crosshairs",{}),this.getCrosshairsText("y",t,e))).type;var s=this.yCrosshair;s?r.isRect&&"circle"===s.get("type")||!r.isRect&&"line"===s.get("type")?(s=new Z.Crosshair[i](n)).init():s.update(n):(s=new Z.Crosshair[i](n)).init(),s.render(),s.show(),this.yCrosshair=s},e.prototype.getCrosshairsText=function(t,e,n){var i=Object(h.get)(n,["crosshairs","text"]),r=Object(h.get)(n,["crosshairs","follow"]),o=this.items;if(i){var a=this.getViewWithGeometry(this.view),s=o[0],l=a.getXScale(),c=a.getYScales()[0],u=void 0,f=void 0;if(r){var p=this.view.getCoordinate().invert(e);u=l.invert(p.x),f=c.invert(p.y)}else u=s.data[l.field],f=s.data[c.field];var d="x"===t?u:f;return Object(h.isFunction)(i)?i=i(t,d,o,e):i.content=d,{text:i}}},e.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},e.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):((t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"})).toFront(),this.tooltipMarkersGroup=t),t},e.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||((t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1})).toBack(),this.tooltipCrosshairsGroup=t),t},e.prototype.findItemsFromView=function(t,e){var n,i;if(!1===t.getOptions().tooltip)return[];var r=en(t,e,this.getTooltipCfg());try{for(var o=Object(u.__values)(t.views),a=o.next();!a.done;a=o.next()){var s=a.value;r=r.concat(this.findItemsFromView(s,e))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r},e.prototype.getViewWithGeometry=function(t){var e=this;return t.geometries.length?t:Object(h.find)(t.views,(function(t){return e.getViewWithGeometry(t)}))},e.prototype.getItemsAfterProcess=function(t){var e=this.getTooltipCfg().customItems;return(e||function(t){return t})(t)},e}(vn),xn={};function bn(t){return xn[t.toLowerCase()]}function _n(t,e){xn[t.toLowerCase()]=e}var On={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},wn={interval:function(t){return{enter:{animation:t.isRect?t.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:t.isPolar&&t.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},jn={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(t){var e;return t.isRect?e=t.isTransposed?"grow-in-x":"grow-in-y":(e="grow-in-xy",t.isPolar&&t.isTransposed&&(e="wave-in")),{animation:e}},schema:function(t){return{animation:t.isRect?t.isTransposed?"grow-in-x":"grow-in-y":"grow-in-xy"}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function Sn(t,e,n){var i=wn[t];return i&&(Object(h.isFunction)(i)&&(i=i(e)),i=Object(h.deepMix)({},On,i),n)?i[n]:i}function Mn(t,e,n){var i=Object(h.get)(t.get("origin"),"data","_origin"),r=e.animation,o=function(t,e){return{delay:Object(h.isFunction)(t.delay)?t.delay(e):t.delay,easing:Object(h.isFunction)(t.easing)?t.easing(e):t.easing,duration:Object(h.isFunction)(t.duration)?t.duration(e):t.duration,callback:t.callback,repeat:t.repeat}}(e,i);if(r){var a=bn(r);a&&a(t,o,n)}else t.animate(n.toAttrs,o)}var An=function(t){function e(e){var n=t.call(this,e)||this;n.labelShape=[],n.states=[];var i=e.shapeFactory,r=e.container,o=e.offscreenGroup,a=e.elementIndex,s=e.visible,l=void 0===s||s;return n.shapeFactory=i,n.container=r,n.offscreenGroup=o,n.visible=l,n.elementIndex=a,n}return Object(u.__extends)(e,t),e.prototype.draw=function(t,e){void 0===e&&(e=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,e),!1===this.visible&&this.changeVisible(!1)},e.prototype.update=function(t){var e=this.shapeFactory,n=this.shape;if(n){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(n,t);var i=this.getOffscreenGroup(),r=e.drawShape(this.shapeType,t,i);r.cfg.data=this.data,r.cfg.origin=t,r.cfg.element=this,this.syncShapeStyle(n,r,this.getStates(),this.getAnimateCfg("update"))}},e.prototype.destroy=function(){var e=this.shapeFactory,n=this.shape;if(n){var i=this.getAnimateCfg("leave");i?Mn(n,i,{coordinate:e.coordinate,toAttrs:Object(u.__assign)({},n.attr())}):n.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=[],this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,t.prototype.destroy.call(this)},e.prototype.changeVisible=function(e){t.prototype.changeVisible.call(this,e),e?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach((function(t){t.show()}))):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach((function(t){t.hide()})))},e.prototype.setState=function(t,e){var n=this,i=n.states,r=n.shapeFactory,o=n.model,a=n.shape,s=n.shapeType,l=i.indexOf(t);if(e){if(l>-1)return;i.push(t),"active"!==t&&"selected"!==t||null==a||a.toFront()}else{if(-1===l)return;if(i.splice(l,1),"active"===t||"selected"===t){var c=this.geometry,u=c.sortZIndex,h=c.zIndexReversed?this.geometry.elements.length-this.elementIndex:this.elementIndex;u?a.setZIndex(h):a.set("zIndex",h)}}var f=r.drawShape(s,o,this.getOffscreenGroup());i.length?this.syncShapeStyle(a,f,i,null):this.syncShapeStyle(a,f,["reset"],null),f.remove(!0);var p={state:t,stateStatus:e,element:this,target:this.container};this.container.emit("statechange",p),Object(Z.propagationDelegate)(this.shape,"statechange",p)},e.prototype.clearStates=function(){var t=this,e=this.states;Object(h.each)(e,(function(e){t.setState(e,!1)})),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this.shape,e=this.labelShape,n={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return t&&(n=t.getCanvasBBox()),e&&e.forEach((function(t){var e=t.getCanvasBBox();n.x=Math.min(e.x,n.x),n.y=Math.min(e.y,n.y),n.minX=Math.min(e.minX,n.minX),n.minY=Math.min(e.minY,n.minY),n.maxX=Math.max(e.maxX,n.maxX),n.maxY=Math.max(e.maxY,n.maxY)})),n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this.shapeType,e=this.geometry,n=this.shapeFactory,i=e.stateOption,r=n.defaultShapeType,o=n.theme[t]||n.theme[r];this.statesStyle=Object(h.deepMix)({},o,i)}return this.statesStyle},e.prototype.getStateStyle=function(t,e){var n=this.getStatesStyle(),i=Object(h.get)(n,[t,"style"],{}),r=i[e]||i;return Object(h.isFunction)(r)?r(this):r},e.prototype.getAnimateCfg=function(t){var e=this,n=this.animate;if(n){var i=n[t];return i?Object(u.__assign)(Object(u.__assign)({},i),{callback:function(){var t;Object(h.isFunction)(i.callback)&&i.callback(),null===(t=e.geometry)||void 0===t||t.emit(p.AFTER_DRAW_ANIMATE)}}):i}return null},e.prototype.drawShape=function(t,e){var n;void 0===e&&(e=!1);var i=this.shapeFactory,r=this.container,o=this.shapeType;if(this.shape=i.drawShape(o,t,r),this.shape){this.setShapeInfo(this.shape,t);var a=this.shape.cfg.name;a?Object(h.isString)(a)&&(this.shape.cfg.name=["element",a]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var s=e?"enter":"appear",l=this.getAnimateCfg(s);l&&(null===(n=this.geometry)||void 0===n||n.emit(p.BEFORE_DRAW_ANIMATE),Mn(this.shape,l,{coordinate:i.coordinate,toAttrs:Object(u.__assign)({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,e){var n=this;(t.cfg.origin=e,t.cfg.element=this,t.isGroup())&&t.get("children").forEach((function(t){n.setShapeInfo(t,e)}))},e.prototype.syncShapeStyle=function(t,e,n,i,r){var o,a=this;if(void 0===n&&(n=[]),void 0===r&&(r=0),t&&e){var s=t.get("clipShape"),l=e.get("clipShape");if(this.syncShapeStyle(s,l,n,i),t.isGroup())for(var c=t.get("children"),u=e.get("children"),f=0;f=0?e:n<=0?n:0},e.prototype.createAttrOption=function(t,e,n){if(Object(h.isNil)(e)||Object(h.isObject)(e))Object(h.isObject)(e)&&Object(h.isEqual)(Object.keys(e),["values"])?Object(h.set)(this.attributeOption,t,{fields:e.values}):Object(h.set)(this.attributeOption,t,e);else{var i={};Object(h.isNumber)(e)?i.values=[e]:i.fields=zn(e),n&&(Object(h.isFunction)(n)?i.callback=n:i.values=n),Object(h.set)(this.attributeOption,t,i)}},e.prototype.initAttributes=function(){var t=this,e=this.attributes,n=this.attributeOption,i=this.theme,r=this.shapeType;this.groupScales=[];var o={},a=function(a){if(n.hasOwnProperty(a)){var s=n[a];if(!s)return{value:void 0};var l=Object(u.__assign)({},s),c=l.callback,f=l.values,p=l.fields,d=(void 0===p?[]:p).map((function(e){var n=t.scales[e];!o[e]&&x.includes(a)&&("cat"===bt(n,Object(h.get)(t.scaleDefs,e),a,t.type)&&(t.groupScales.push(n),o[e]=!0));return n}));l.scales=d,"position"!==a&&1===d.length&&"identity"===d[0].type?l.values=d[0].values:c||f||("size"===a?l.values=i.sizes:"shape"===a?l.values=i.shapes[r]||[]:"color"===a&&(d.length?l.values=d[0].values.length<=10?i.colors10:i.colors20:l.values=i.colors10));var g=V(a);e[a]=new g(l)}};for(var s in n){var l=a(s);if("object"===Yn(l))return l.value}},e.prototype.processData=function(t){var e,n;this.hasSorted=!1;for(var i=this.getAttribute("position").scales.filter((function(t){return t.isCategory})),r=this.groupData(t),o=[],a=0,s=r.length;ao&&(o=c)}var u=this.scaleDefs,f={};rt.max&&!Object(h.get)(u,[i,"max"])&&(f.max=o),t.change(f)},e.prototype.beforeMapping=function(t){var e=t;if(this.sortable&&this.sort(e),this.generatePoints)for(var n=0,i=e.length;n1)for(var u=0;u0}))}var Kn=function(){function t(t){this.shapesMap={};var e=t.layout,n=t.container;this.layout=e,this.container=n}return t.prototype.render=function(t,e,n){return void 0===n&&(n=!1),Object(u.__awaiter)(this,void 0,void 0,(function(){var i,r,o,a,s,l,c,f,p=this;return Object(u.__generator)(this,(function(d){switch(d.label){case 0:if(i={},r=this.createOffscreenGroup(),!t.length)return[3,2];try{for(o=Object(u.__values)(t),a=o.next();!a.done;a=o.next())(s=a.value)&&(i[s.id]=this.renderLabel(s,r))}catch(t){c={error:t}}finally{try{a&&!a.done&&(f=o.return)&&f.call(o)}finally{if(c)throw c.error}}return[4,this.doLayout(t,e,i)];case 1:d.sent(),this.renderLabelLine(t,i),this.renderLabelBackground(t,i),this.adjustLabel(t,i),d.label=2;case 2:return l=this.shapesMap,Object(h.each)(i,(function(t,e){if(t.destroyed)delete i[e];else{if(l[e]){var r=t.get("data"),o=t.get("origin"),a=t.get("coordinate"),s=t.get("animateCfg"),c=l[e];!function t(e,n,i){var r=i.data,o=i.origin,a=i.animateCfg,s=i.coordinate,l=Object(h.get)(a,"update");e.set("data",r),e.set("origin",o),e.set("animateCfg",a),e.set("coordinate",s),e.set("visible",n.get("visible")),(e.getChildren()||[]).forEach((function(c,u){var h=n.getChildByIndex(u);if(h){c.set("data",r),c.set("origin",o),c.set("animateCfg",a),c.set("coordinate",s);var f=ct(c,h);l?Mn(c,l,{toAttrs:f,coordinate:s}):c.attr(f),h.isGroup()&&t(c,h,i)}else e.removeChild(c),c.remove(!0)})),Object(h.each)(n.getChildren(),(function(t,n){n>=e.getCount()&&(t.destroyed||e.add(t))}))}(c,i[e],{data:r,origin:o,animateCfg:s,coordinate:a}),i[e]=c}else{if(p.container.destroyed)return;p.container.add(t);var f=Object(h.get)(t.get("animateCfg"),n?"enter":"appear");f&&Mn(t,f,{toAttrs:Object(u.__assign)({},t.attr()),coordinate:t.get("coordinate")})}delete l[e]}})),Object(h.each)(l,(function(t){var e=Object(h.get)(t.get("animateCfg"),"leave");e?Mn(t,e,{toAttrs:null,coordinate:t.get("coordinate")}):t.remove(!0)})),this.shapesMap=i,r.destroy(),[2]}}))}))},t.prototype.clear=function(){this.container.clear(),this.shapesMap={}},t.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},t.prototype.renderLabel=function(t,e){var n,i=t.id,r=t.elementId,o=t.data,a=t.mappingData,s=t.coordinate,l=t.animate,c=t.content,f={id:i,elementId:r,capture:t.capture,data:o,origin:Object(u.__assign)(Object(u.__assign)({},a),{data:a._origin}),coordinate:s},p=e.addGroup(Object(u.__assign)({name:"label",animateCfg:!1!==this.animate&&null!==l&&!1!==l&&Object(h.deepMix)({},this.animate,l)},f));if(c.isGroup&&c.isGroup()||c.isShape&&c.isShape()){var d=c.getCanvasBBox(),g=d.width,y=d.height,v=Object(h.get)(t,"textAlign","left"),m=t.x;"center"===v?m-=g/2:"right"!==v&&"end"!==v||(m-=g),Hn(c,m,t.y-y/2),n=c,p.add(c)}else{var x=Object(h.get)(t,["style","fill"]);n=p.addShape("text",Object(u.__assign)({attrs:Object(u.__assign)(Object(u.__assign)({x:t.x,y:t.y,textAlign:t.textAlign,textBaseline:Object(h.get)(t,"textBaseline","middle"),text:t.content},t.style),{fill:Object(h.isNull)(x)?t.color:x})},f))}return t.rotate&&Un(n,t.rotate),p},t.prototype.doLayout=function(t,e,n){return Object(u.__awaiter)(this,void 0,void 0,(function(){var i,r=this;return Object(u.__generator)(this,(function(o){switch(o.label){case 0:return this.layout?(i=Object(h.isArray)(this.layout)?this.layout:[this.layout],[4,Promise.all(i.map((function(i){var o=Fn(Object(h.get)(i,"type",""));if(o){var a=[],s=[];return Object(h.each)(n,(function(t,n){a.push(t),s.push(e[t.get("elementId")])})),o(t,a,s,r.region,i.cfg)}})))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}}))}))},t.prototype.renderLabelLine=function(t,e){Object(h.each)(t,(function(t){var n=Object(h.get)(t,"coordinate");if(t&&n){var i=n.getCenter(),r=n.getRadius();if(t.labelLine){var o=Object(h.get)(t,"labelLine",{}),a=t.id,s=o.path;if(!s){var l=ot(i.x,i.y,r,t.angle);s=[["M",l.x,l.y],["L",t.x,t.y]]}var c=e[a];c.destroyed||c.addShape("path",{capture:!1,attrs:Object(u.__assign)({path:s,stroke:t.color?t.color:Object(h.get)(t,["style","fill"],"#000"),fill:null},o.style),id:a,origin:t.mappingData,data:t.data,coordinate:t.coordinate})}}}))},t.prototype.renderLabelBackground=function(t,e){Object(h.each)(t,(function(t){var n=Object(h.get)(t,"coordinate"),i=Object(h.get)(t,"background");if(i&&n){var r=t.id,o=e[r];if(!o.destroyed){var a=o.getChildren()[0];if(a){var s=Zn(o,t,i.padding),l=s.rotation,c=Object(u.__rest)(s,["rotation"]),f=o.addShape("rect",{attrs:Object(u.__assign)(Object(u.__assign)({},c),i.style||{}),id:r,origin:t.mappingData,data:t.data,coordinate:t.coordinate});if(f.setZIndex(-1),l){var p=a.getMatrix();f.setMatrix(p)}}}}}))},t.prototype.createOffscreenGroup=function(){return new(this.container.getGroupBase())({})},t.prototype.adjustLabel=function(t,e){Object(h.each)(t,(function(t){if(t){var n=t.id,i=e[n];if(!i.destroyed){var r=i.findAll((function(t){return"path"!==t.get("type")}));Object(h.each)(r,(function(e){e&&(t.offsetX&&e.attr("x",e.attr("x")+t.offsetX),t.offsetY&&e.attr("y",e.attr("y")+t.offsetY))}))}}}))},t}();function Qn(t){var e=0;return Object(h.each)(t,(function(t){e+=t})),e/t.length}var Jn=function(){function t(t){this.geometry=t}return t.prototype.getLabelItems=function(t){var e=this,n=[],i=this.getLabelCfgs(t);return Object(h.each)(t,(function(t,r){var o=i[r];if(!o||Object(h.isNil)(t.x)||Object(h.isNil)(t.y))n.push(null);else{var a=Object(h.isArray)(o.content)?o.content:[o.content];o.content=a;var s=a.length;Object(h.each)(a,(function(i,r){if(Object(h.isNil)(i)||""===i)n.push(null);else{var a=Object(u.__assign)(Object(u.__assign)({},o),e.getLabelPoint(o,t,r));a.textAlign||(a.textAlign=e.getLabelAlign(a,r,s)),a.offset<=0&&(a.labelLine=null),n.push(a)}}))}})),n},t.prototype.render=function(t,e){return void 0===e&&(e=!1),Object(u.__awaiter)(this,void 0,void 0,(function(){var n,i,r;return Object(u.__generator)(this,(function(o){switch(o.label){case 0:return n=this.getLabelItems(t),i=this.getLabelsRenderer(),r=this.getGeometryShapes(),[4,i.render(n,r,e)];case 1:return o.sent(),[2]}}))}))},t.prototype.clear=function(){var t=this.labelsRenderer;t&&t.clear()},t.prototype.destroy=function(){var t=this.labelsRenderer;t&&t.destroy(),this.labelsRenderer=null},t.prototype.getCoordinate=function(){return this.geometry.coordinate},t.prototype.getDefaultLabelCfg=function(t,e){var n=this.geometry,i=n.type,r=n.theme;return"polygon"===i||"interval"===i&&"middle"===e||t<0&&!["line","point","path"].includes(i)?Object(h.get)(r,"innerLabels",{}):Object(h.get)(r,"labels",{})},t.prototype.getThemedLabelCfg=function(t){var e=this.geometry,n=this.getDefaultLabelCfg(),i=e.type,r=e.theme;return"polygon"===i||t.offset<0&&!["line","point","path"].includes(i)?Object(h.deepMix)({},n,r.innerLabels,t):Object(h.deepMix)({},n,r.labels,t)},t.prototype.setLabelPosition=function(t,e,n,i){},t.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),n=this.getOffsetVector(t);return e.isTransposed?n[0]:n[1]},t.prototype.getLabelOffsetPoint=function(t,e,n){var i=t.offset,r=this.getCoordinate().isTransposed,o=r?"x":"y",a=r?1:-1,s={x:0,y:0};return s[o]=e>0||1===n?i*a:i*a*-1,s},t.prototype.getLabelPoint=function(t,e,n){var i=this.getCoordinate(),r=t.content.length;function o(e,n,i){void 0===i&&(i=!1);var r=e;return Object(h.isArray)(r)&&(r=1===t.content.length?i?Qn(r):r.length<=2?r[e.length-1]:Qn(r):r[n]),r}var a={content:t.content[n],x:0,y:0,start:{x:0,y:0},color:"#fff"},s=Object(h.isArray)(e.shape)?e.shape[0]:e.shape,l="funnel"===s||"pyramid"===s;if("polygon"===this.geometry.type){var c=function(t,e){if(Object(h.isNumber)(t)&&Object(h.isNumber)(e))return[t,e];if(e=e,it(t=t)||it(e))return[rt(t),rt(e)];for(var n,i,r=-1,o=0,a=0,s=t.length-1,l=0;++r1&&0===e&&("right"===i?i="left":"left"===i&&(i="right"))}return i},t.prototype.getLabelId=function(t){var e=this.geometry,n=e.type,i=e.getXScale(),r=e.getYScale(),o=t._origin,a=e.getElementId(t);return"line"===n||"area"===n?a+=" ".concat(o[i.field]):"path"===n&&(a+=" ".concat(o[i.field],"-").concat(o[r.field])),a},t.prototype.getLabelsRenderer=function(){var t=this.geometry,e=t.labelsContainer,n=t.labelOption,i=t.canvasRegion,r=t.animateOption,o=this.geometry.coordinate,a=this.labelsRenderer;return a||(a=new Kn({container:e,layout:Object(h.get)(n,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=a),a.region=i,a.animate=!!r&&Sn("label",o),a},t.prototype.getLabelCfgs=function(t){var e=this,n=this.geometry,i=n.labelOption,r=n.scales,o=n.coordinate,a=i,s=a.fields,l=a.callback,c=a.cfg,f=s.map((function(t){return r[t]})),p=[];return Object(h.each)(t,(function(t,n){var i,r=t._origin,a=e.getLabelText(r,f);if(l){var d=s.map((function(t){return r[t]}));if(i=l.apply(void 0,Object(u.__spreadArray)([],Object(u.__read)(d),!1)),Object(h.isNil)(i))return void p.push(null)}var g=Object(u.__assign)(Object(u.__assign)({id:e.getLabelId(t),elementId:e.geometry.getElementId(t),data:r,mappingData:t,coordinate:o},c),i);Object(h.isFunction)(g.position)&&(g.position=g.position(r,t,n));var y=e.getLabelOffset(g.offset||0),v=e.getDefaultLabelCfg(y,g.position);(g=Object(h.deepMix)({},v,g)).offset=e.getLabelOffset(g.offset||0);var m=g.content;Object(h.isFunction)(m)?g.content=m(r,t,n):Object(h.isUndefined)(m)&&(g.content=a[0]),p.push(g)})),p},t.prototype.getLabelText=function(t,e){var n=[];return Object(h.each)(e,(function(e){var i=t[e.field];i=Object(h.isArray)(i)?i.map((function(t){return e.getText(t)})):e.getText(i),Object(h.isNil)(i)||""===i?n.push(null):n.push(i)})),n},t.prototype.getOffsetVector=function(t){void 0===t&&(t=0);var e=this.getCoordinate(),n=0;return Object(h.isNumber)(t)&&(n=t),e.isTransposed?e.applyMatrix(n,0):e.applyMatrix(0,n)},t.prototype.getGeometryShapes=function(){var t=this.geometry,e={};return Object(h.each)(t.elementsMap,(function(t,n){e[n]=t.shape})),Object(h.each)(t.getOffscreenGroup().getChildren(),(function(n){var i=t.getElementId(n.get("origin").mappingData);e[i]=n})),e},t}();function ti(t,e,n){if(!t)return n;var i;if(t.callback&&t.callback.length>1){var r=Array(t.callback.length-1).fill("");i=t.mapping.apply(t,Object(u.__spreadArray)([e],Object(u.__read)(r),!1)).join("")}else i=t.mapping(e).join("");return i||n}var ei={hexagon:function(t,e,n){var i=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+i,e-n/2],["L",t+i,e+n/2],["L",t,e+n],["L",t-i,e+n/2],["L",t-i,e-n/2],["Z"]]},bowtie:function(t,e,n){var i=n-1.5;return[["M",t-n,e-i],["L",t+n,e+i],["L",t+n,e-i],["L",t-n,e+i],["Z"]]},cross:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]},tick:function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]},plus:function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]},hyphen:function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},line:function(t,e,n){return[["M",t,e-n],["L",t,e+n]]}},ni=["line","cross","tick","plus","hyphen"];function ii(t){var e=t.symbol;Object(h.isString)(e)&&ei[e]&&(t.symbol=ei[e])}function ri(t){return t.startsWith(l.LEFT)||t.startsWith(l.RIGHT)?"vertical":"horizontal"}function oi(t,e,n,i,r){var o=n.getScale(n.type);if(o.isCategory){var a=o.field,s=e.getAttribute("color"),l=e.getAttribute("shape"),c=t.getTheme().defaultColor,f=e.coordinate.isPolar;return o.getTicks().map((function(n,p){var d,g=n.text,y=n.value,v=g,m=o.invert(y),x=0===t.filterFieldData(a,[(d={},d[a]=m,d)]).length;Object(h.each)(t.views,(function(t){var e;t.filterFieldData(a,[(e={},e[a]=m,e)]).length||(x=!0)}));var b,_,O=ti(s,m,c),w=ti(l,m,"point"),j=e.getShapeMarker(w,{color:O,isInPolar:f}),S=r;return Object(h.isFunction)(S)&&(S=S(v,p,Object(u.__assign)({name:v,value:m},Object(h.deepMix)({},i,j)))),function(t,e){var n=t.symbol;if(Object(h.isString)(n)&&-1!==ni.indexOf(n)){var i=Object(h.get)(t,"style",{}),r=Object(h.get)(i,"lineWidth",1),o=i.stroke||i.fill||e;t.style=Object(h.deepMix)({},t.style,{lineWidth:r,stroke:o,fill:null})}}(j=Object(h.deepMix)({},i,j,ft(Object(u.__assign)({},S),["style"])),O),S&&S.style&&(j.style=(b=j.style,_=S.style,Object(h.isFunction)(_)?_(b):Object(h.deepMix)({},b,_))),ii(j),{id:m,name:v,value:m,marker:j,unchecked:x}}))}return[]}function ai(t,e){var n=Object(h.get)(t,["components","legend"],{});return Object(h.deepMix)({},Object(h.get)(n,["common"],{}),Object(h.deepMix)({},Object(h.get)(n,[e],{})))}function si(t){return!t&&(null==t||isNaN(t))}function li(t){if(Object(h.isArray)(t))return si(t[1].y);var e=t.y;return Object(h.isArray)(e)?si(e[0]):si(e)}function ci(t,e,n){if(void 0===e&&(e=!1),void 0===n&&(n=!0),!t.length||1===t.length&&!n)return[];if(e){for(var i=[],r=0,o=t.length;r=t&&r<=t+n&&o>=e&&o<=e+i}function ki(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY=0&&a<.5*Math.PI?(i={x:l.minX,y:l.minY},r={x:l.maxX,y:l.maxY}):.5*Math.PI<=a&&a1&&(n*=Math.sqrt(d),i*=Math.sqrt(d));var g=n*n*(p*p)+i*i*(f*f),y=g?Math.sqrt((n*n*(i*i)-g)/g):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=i?y*n*p/i:0,m=n?y*-i*f/n:0,x=(s+c)/2+Math.cos(r)*v-Math.sin(r)*m,b=(l+u)/2+Math.sin(r)*v+Math.cos(r)*m,_=[(f-v)/n,(p-m)/i],O=[(-1*f-v)/n,(-1*p-m)/i],w=Hi([1,0],_),j=Hi(_,O);return Wi(_,O)<=-1&&(j=Math.PI),Wi(_,O)>=1&&(j=0),0===a&&j>0&&(j-=2*Math.PI),1===a&&j<0&&(j+=2*Math.PI),{cx:x,cy:b,rx:Bi(t,[c,u])?0:n,ry:Bi(t,[c,u])?0:i,startAngle:w,endAngle:w+j,xRotation:r,arcFlag:o,sweepFlag:a}}function qi(t){return(qi="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})(t)}var Zi=Math.sin,$i=Math.cos,Ki=Math.atan2,Qi=Math.PI;function Ji(t,e,n,i,r,o,a){var s=e.stroke,l=e.lineWidth,c=Ki(i-o,n-r),u=new Lr({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*$i(Qi/6)+","+10*Zi(Qi/6)+" L0,0 L"+10*$i(Qi/6)+",-"+10*Zi(Qi/6),stroke:s,lineWidth:l}});u.translate(r,o),u.rotateAtPoint(r,o,c),t.set(a?"startArrowShape":"endArrowShape",u)}function tr(t,e,n,i,r,o,a){var s=e.startArrow,l=e.endArrow,c=e.stroke,h=e.lineWidth,f=a?s:l,p=f.d,d=f.fill,g=f.stroke,y=f.lineWidth,v=Object(u.__rest)(f,["d","fill","stroke","lineWidth"]),m=Ki(i-o,n-r);p&&(r-=$i(m)*p,o-=Zi(m)*p);var x=new Lr({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:Object(u.__assign)(Object(u.__assign)({},v),{stroke:g||c,lineWidth:y||h,fill:d})});x.translate(r,o),x.rotateAtPoint(r,o,m),t.set(a?"startArrowShape":"endArrowShape",x)}function er(t,e,n,i,r){var o=Ki(i-e,n-t);return{dx:$i(o)*r,dy:Zi(o)*r}}function nr(t,e,n,i,r,o){"object"===qi(e.startArrow)?tr(t,e,n,i,r,o,!0):e.startArrow?Ji(t,e,n,i,r,o,!0):t.set("startArrowShape",null)}function ir(t,e,n,i,r,o){"object"===qi(e.endArrow)?tr(t,e,n,i,r,o,!1):e.endArrow?Ji(t,e,n,i,r,o,!1):t.set("startArrowShape",null)}var rr={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function or(t,e){var n=e.attr();for(var i in n){var r=n[i],o=rr[i]?rr[i]:i;"matrix"===o&&r?t.transform(r[0],r[1],r[3],r[4],r[6],r[7]):"lineDash"===o&&t.setLineDash?Object(h.isArray)(r)&&t.setLineDash(r):("strokeStyle"===o||"fillStyle"===o?r=Yi(t,e,r):"globalAlpha"===o&&(r*=t.globalAlpha),t[o]=r)}}function ar(t,e,n){for(var i=0;ib?x:b,M=x>b?1:x/b,A=x>b?b/x:1;e.translate(v,m),e.rotate(w),e.scale(M,A),e.arc(0,0,S,_,O,1-j),e.scale(1/M,1/A),e.rotate(-w),e.translate(-v,-m)}break;case"Z":e.closePath()}if("Z"===f)s=l;else{var C=h.length;s=[h[C-2],h[C-1]]}}}}function hr(t,e){var n=t.get("canvas");n&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(n.refreshElement(t,e,n),n.get("autoDraw")&&n.draw())))}function fr(t){var e,n,i;if(t.destroyed)e=t._cacheCanvasBBox;else{var r=t.get("cacheCanvasBBox"),o=r&&!(!r.width||!r.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(i=a,e=(n=r)&&i?{minX:Math.min(n.minX,i.minX),minY:Math.min(n.minY,i.minY),maxX:Math.max(n.maxX,i.maxX),maxY:Math.max(n.maxY,i.maxY)}:n||i):o?e=r:s&&(e=a)}return e}var pr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.onCanvasChange=function(t){hr(this,t)},e.prototype.getShapeBase=function(){return i},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),or(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];Object(h.each)(t,(function(t){var i=t.cfg.cacheCanvasBBox;i&&t.cfg.isInView&&(e.push(i.minX,i.maxX),n.push(i.minY,i.maxY))}));var i=null;if(e.length){var r=Object(h.min)(e),o=Object(h.max)(e),a=Object(h.min)(n),s=Object(h.max)(n);i={minX:r,minY:a,x:r,y:a,maxX:o,maxY:s,width:o-r,height:s-a};var l=this.cfg.canvas;if(l){var c=l.getViewRange();this.set("isInView",ki(i,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",i)},e.prototype.draw=function(t,e){var n=this.cfg.children,i=!e||this.cfg.refresh;n.length&&i&&(t.save(),or(t,this),this._applyClip(t,this.getClip()),ar(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(A.b),dr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return i},e.prototype.getGroupBase=function(){return pr},e.prototype.onCanvasChange=function(t){hr(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=Object(A.h)(t)(this),i=e/2,r=n.x-i,o=n.y-i,a=n.x+n.width+i,s=n.y+n.height+i;return{x:r,minX:r,y:o,minY:o,width:n.width+e,height:n.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),or(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!ki(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),or(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=ki(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,i=e.opacity,r=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&(Object(h.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=i)),this.isStroke()&&n>0&&(Object(h.isNil)(r)||1===r||(t.globalAlpha=r),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var n=this.isStroke(),i=this.isFill(),r=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,i,r)},e.prototype.isInStrokeOrPath=function(t,e,n,i,r){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(A.c),gr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,n,i,r){var o=this.attr(),a=o.x,s=o.y,l=o.r,c=r/2,u=Li(a,s,t,e);return i&&n?u<=l+c:i?u<=l:!!n&&(u>=l-c&&u<=l+c)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,i=e.y,r=e.r;t.beginPath(),t.arc(n,i,r,0,2*Math.PI,!1),t.closePath()},e}(dr);function yr(t,e,n,i){return t/(n*n)+e/(i*i)}var vr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,n,i,r){var o=this.attr(),a=r/2,s=o.x,l=o.y,c=o.rx,u=o.ry,h=(t-s)*(t-s),f=(e-l)*(e-l);return i&&n?yr(h,f,c+a,u+a)<=1:i?yr(h,f,c,u)<=1:!!n&&(yr(h,f,c-a,u-a)>=1&&yr(h,f,c+a,u+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,i=e.y,r=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,i,r,o,0,0,2*Math.PI,!1);else{var a=r>o?r:o,s=r>o?1:r/o,l=r>o?o/r:1;t.save(),t.translate(n,i),t.scale(s,l),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(dr);function mr(t){return t instanceof HTMLElement&&Object(h.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var xr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,n=this.attrs;if(Object(h.isString)(t)){var i=new Image;i.onload=function(){if(e.destroyed)return!1;e.attr("img",i),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},i.crossOrigin="Anonymous",i.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):mr(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,n,i){t.prototype.onAttrChange.call(this,e,n,i),"img"===e&&this._setImage(n)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),n=e.x,i=e.y,r=e.width,o=e.height,a=e.sx,s=e.sy,l=e.swidth,c=e.sheight,u=e.img;(u instanceof Image||mr(u))&&(Object(h.isNil)(a)||Object(h.isNil)(s)||Object(h.isNil)(l)||Object(h.isNil)(c)?t.drawImage(u,n,i,r,o):t.drawImage(u,a,s,l,c,n,i,r,o))},e}(dr),br=n(13);function _r(t,e,n,i,r,o,a){var s=Math.min(t,n),l=Math.max(t,n),c=Math.min(e,i),u=Math.max(e,i),h=r/2;return o>=s-h&&o<=l+h&&a>=c-h&&a<=u+h&&br.c.pointToLine(t,e,n,i,o,a)<=r/2}var Or=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,n,i){t.prototype.onAttrChange.call(this,e,n,i),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,i=t.x2,r=t.y2,o=t.startArrow,a=t.endArrow;o&&nr(this,t,i,r,e,n),a&&ir(this,t,e,n,i,r)},e.prototype.isInStrokeOrPath=function(t,e,n,i,r){if(!n||!r)return!1;var o=this.attr();return _r(o.x1,o.y1,o.x2,o.y2,r,t,e)},e.prototype.createPath=function(t){var e=this.attr(),n=e.x1,i=e.y1,r=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,l={dx:0,dy:0},c={dx:0,dy:0};a&&a.d&&(l=er(n,i,r,o,e.startArrow.d)),s&&s.d&&(c=er(n,i,r,o,e.endArrow.d)),t.beginPath(),t.moveTo(n+l.dx,i+l.dy),t.lineTo(r-c.dx,o-c.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,i=t.x2,r=t.y2;return br.c.length(e,n,i,r)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,i=e.y1,r=e.x2,o=e.y2;return br.c.pointAt(n,i,r,o,t)},e}(dr),wr={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+i],["L",t,e-i],["L",t+n,e+i],["Z"]]},"triangle-down":function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-i],["L",t+n,e-i],["L",t,e+i],["Z"]]}},jr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,n,i){t.prototype.onAttrChange.call(this,e,n,i),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return Object(h.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,n,i=this.attr(),r=i.x,o=i.y,a=i.symbol||"circle",s=this._getR(i);if(Object(h.isFunction)(a))n=(t=a)(r,o,s),n=Object(Zt.path2Absolute)(n);else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;n=t(r,o,s)}return n},e.prototype.createPath=function(t){ur(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=wr,e}(dr);function Sr(t,e,n){var i=Object(A.i)();return t.createPath(i),i.isPointInPath(e,n)}function Mr(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function Ar(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function Cr(t,e,n){var i=!1,r=t.length;if(r<=2)return!1;for(var o=0;o0!=Mr(s[1]-n)>0&&Mr(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(i=!i)}return i}var Er=n(53);function Ir(t,e,n,i,r,o,a,s){var l=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(lr)return!1;var c={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return Li(c.x,c.y,a,s)<=o/2}var Pr=G.ext.transform;var Fr=Object(u.__assign)({hasArc:function(t){for(var e=!1,n=t.length,i=0;i0&&i.push(r),{polygons:n,polylines:i}},isPointInStroke:function(t,e,n,i,r){for(var o=!1,a=e/2,s=0;sv?y:v,w=Pr(null,[["t",-d,-g],["r",-b],["s",1/(y>v?1:y/v),1/(y>v?v/y:1)]]);Er.transformMat3(_,_,w),o=Ir(0,0,O,m,x,e,_[0],_[1])}if(o)break}}return o}},A.f);function Tr(t,e,n){for(var i=!1,r=0;r=i[0]&&t<=i[1]&&(e=(t-i[0])/(i[1]-i[0]),n=r)}));var o=r[n];if(Object(h.isNil)(o)||Object(h.isNil)(n))return null;var a=o.length,s=r[n+1];return br.b.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",Fr.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,n,i,r=0,o=0,a=[],s=this.get("curve");s&&(Object(h.each)(s,(function(t,e){n=s[e+1],i=t.length,n&&(r+=br.b.length(t[i-2],t[i-1],n[1],n[2],n[3],n[4],n[5],n[6])||0)})),this.set("totalLength",r),0!==r?(Object(h.each)(s,(function(l,c){n=s[c+1],i=l.length,n&&((t=[])[0]=o/r,e=br.b.length(l[i-2],l[i-1],n[1],n[2],n[3],n[4],n[5],n[6]),o+=e||0,t[1]=o/r,a.push(t))})),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var n=e[0].currentPoint,i=e[1].currentPoint,r=e[1].startTangent;t=[],r?(t.push([n[0]-r[0],n[1]-r[1]]),t.push([n[0],n[1]])):(t.push([i[0],i[1]]),t.push([n[0],n[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),n=e.length;if(n>1){var i=e[n-2].currentPoint,r=e[n-1].currentPoint,o=e[n-1].endTangent;t=[],o?(t.push([r[0]-o[0],r[1]-o[1]]),t.push([r[0],r[1]])):(t.push([i[0],i[1]]),t.push([r[0],r[1]]))}return t},e}(dr);function Dr(t,e,n,i,r){var o=t.length;if(o<2)return!1;for(var a=0;a=i[0]&&t<=i[1]&&(e=(t-i[0])/(i[1]-i[0]),n=r)})),br.c.pointAt(i[n][0],i[n][1],i[n+1][0],i[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,i,r=0,o=[];Object(h.each)(t,(function(a,s){t[s+1]&&((n=[])[0]=r/e,i=br.c.length(a[0],a[1],t[s+1][0],t[s+1][1]),r+=i,n[1]=r/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(dr);var Nr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,n,i,r){var o=this.attr(),a=o.x,s=o.y,l=o.width,c=o.height,u=o.radius;if(u){var h=!1;return n&&(h=function(t,e,n,i,r,o,a,s){return _r(t+r,e,t+n-r,e,o,a,s)||_r(t+n,e+r,t+n,e+i-r,o,a,s)||_r(t+n-r,e+i,t+r,e+i,o,a,s)||_r(t,e+i-r,t,e+r,o,a,s)||Ir(t+n-r,e+r,r,1.5*Math.PI,2*Math.PI,o,a,s)||Ir(t+n-r,e+i-r,r,0,.5*Math.PI,o,a,s)||Ir(t+r,e+i-r,r,.5*Math.PI,Math.PI,o,a,s)||Ir(t+r,e+r,r,Math.PI,1.5*Math.PI,o,a,s)}(a,s,l,c,u,r,t,e)),!h&&i&&(h=Sr(this,t,e)),h}var f=r/2;return i&&n?Di(a-f,s-f,l+f,c+f,t,e):i?Di(a,s,l,c,t,e):n?function(t,e,n,i,r,o,a){var s=r/2;return Di(t-s,e-s,n,r,o,a)||Di(t+n-s,e-s,r,i,o,a)||Di(t+s,e+i-s,n,r,o,a)||Di(t-s,e+s,r,i,o,a)}(a,s,l,c,r,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),n=e.x,i=e.y,r=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(n,i,r,o);else{var s=function(t){var e=0,n=0,i=0,r=0;return Object(h.isArray)(t)?1===t.length?e=n=i=r=t[0]:2===t.length?(e=i=t[0],n=r=t[1]):3===t.length?(e=t[0],n=r=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],r=t[3]):e=n=i=r=t,[e,n,i,r]}(a),l=s[0],c=s[1],u=s[2],f=s[3];t.moveTo(n+l,i),t.lineTo(n+r-c,i),0!==c&&t.arc(n+r-c,i+c,c,-Math.PI/2,0),t.lineTo(n+r,i+o-u),0!==u&&t.arc(n+r-u,i+o-u,u,0,Math.PI/2),t.lineTo(n+f,i+o),0!==f&&t.arc(n+f,i+o-f,f,Math.PI/2,Math.PI),t.lineTo(n,i+l),0!==l&&t.arc(n+l,i+l,l,Math.PI,1.5*Math.PI),t.closePath()}},e}(dr),Rr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Object(A.g)(t)},e.prototype._setText=function(t){var e=null;Object(h.isString)(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,n,i){t.prototype.onAttrChange.call(this,e,n,i),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(n)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},e.prototype._drawTextArr=function(t,e,n){var i,r=this.attrs,o=r.textBaseline,a=r.x,s=r.y,l=1*r.fontSize,c=this._getSpaceingY(),u=Object(A.j)(r.text,r.fontSize,r.lineHeight);Object(h.each)(e,(function(e,r){i=s+r*(c+l)-u+l,"middle"===o&&(i+=u-l-(u-l)/2),"top"===o&&(i+=u-l),Object(h.isNil)(e)||(n?t.fillText(e,a,i):t.strokeText(e,a,i))}))},e.prototype._drawText=function(t,e){var n=this.attr(),i=n.x,r=n.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=n.text;Object(h.isNil)(a)||(e?t.fillText(a,i,r):t.strokeText(a,i,r))}},e.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,i=e.opacity,r=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&n>0&&(Object(h.isNil)(r)||1===r||(t.globalAlpha=i),this.stroke(t)),this.isFill()&&(Object(h.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=i)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(dr);function Vr(t,e,n){var i=t.getTotalMatrix();if(i){var r=function(t,e){if(e){var n=Object(A.k)(e);return Object(A.m)(n,t)}return t}([e,n,1],i);return[r[0],r[1]]}return[e,n]}function zr(t,e,n){if(t.isCanvas&&t.isCanvas())return!0;if(!Object(A.l)(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var i=Vr(t,e,n),r=i[0],o=i[1];if(t.isClipped(r,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&n>=a.minY&&n<=a.maxY}var Gr=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return i},e.prototype.getGroupBase=function(){return pr},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||(window?window.devicePixelRatio:1);return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var i=this.get("context"),r=this.get("el"),o=this.getPixelRatio();r.width=o*e,r.height=o*n,o>1&&i.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,i){if(!zr(e,n,i))return null;for(var r=null,o=e.getChildren(),a=o.length-1;a>=0;a--){var s=o[a];if(s.isGroup())r=t(s,n,i);else if(zr(s,n,i)){var l=s,c=Vr(s,n,i),u=c[0],h=c[1];l.isInShape(u,h)&&(r=s)}if(r)break}return r}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=function(t){if(!t.length)return null;var e=[],n=[],i=[],r=[];return Object(h.each)(t,(function(t){var o=fr(t);o&&(e.push(o.minX),n.push(o.minY),i.push(o.maxX),r.push(o.maxY))})),{minX:Object(h.min)(e),minY:Object(h.min)(n),maxX:Object(h.max)(i),maxY:Object(h.max)(r)}}(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&ki(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,n)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(h.clearAnimationFrame)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),or(t,this),ar(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),i=this._getRefreshRegion();i?(t.clearRect(i.minX,i.minY,i.maxX-i.minX,i.maxY-i.minY),t.save(),t.beginPath(),t.rect(i.minX,i.minY,i.maxX-i.minX,i.maxY-i.minY),t.clip(),or(t,this),sr(this,n,i),ar(t,n,i),t.restore()):e.length&&function t(e){for(var n=0;ne)n.insertBefore(t,r);else if(o0&&(e?"stroke"in n?this._setColor(t,"stroke",o):"strokeStyle"in n&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),l&&u.setAttribute(Wr.strokeOpacity,l),c&&u.setAttribute(Wr.lineWidth,c))},e.prototype._setColor=function(t,e,n){var i=this.get("el");if(n)if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n))(r=t.find("gradient",n))||(r=t.addGradient(n)),i.setAttribute(Wr[e],"url(#"+r+")");else if(/^[p,P]{1}[\s]*\(/.test(n)){var r;(r=t.find("pattern",n))||(r=t.addPattern(n)),i.setAttribute(Wr[e],"url(#"+r+")")}else i.setAttribute(Wr[e],n);else i.setAttribute(Wr[e],"none")},e.prototype.shadow=function(t,e){var n=this.attr(),i=e||n,r=i.shadowOffsetX,o=i.shadowOffsetY,a=i.shadowBlur,s=i.shadowColor;(r||o||a||s)&&function(t,e){var n=t.cfg.el,i=t.attr(),r={dx:i.shadowOffsetX,dy:i.shadowOffsetY,blur:i.shadowBlur,color:i.shadowColor};if(r.dx||r.dy||r.blur||r.color){var o=e.find("filter",r);o||(o=e.addShadow(r)),n.setAttribute("filter","url(#"+o+")")}else n.removeAttribute("filter")}(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&Zr(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var n=this.get("el"),i=this.get("canvas").get("el").getBoundingClientRect(),r=t+i.left,o=e+i.top,a=document.elementFromPoint(r,o);return!(!a||!a.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?e+n:0},e}(A.c),eo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var n=this.attr(),i=this.get("el");Object(h.each)(e||n,(function(t,e){"x"===e||"y"===e?i.setAttribute("c"+e,t):Wr[e]&&i.setAttribute(Wr[e],t)}))},e}(to),no=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return Object(u.__extends)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),i=this.get("el");if(Object(h.each)(e||n,(function(t,e){Wr[e]&&i.setAttribute(Wr[e],t)})),"function"==typeof n.html){var r=n.html.call(this,n);if(r instanceof Element||r instanceof HTMLDocument){for(var o=i.childNodes,a=o.length-1;a>=0;a--)i.removeChild(o[a]);i.appendChild(r)}else i.innerHTML=r}else i.innerHTML=n.html},e}(to),io=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var n=this.attr(),i=this.get("el");Object(h.each)(e||n,(function(t,e){"x"===e||"y"===e?i.setAttribute("c"+e,t):Wr[e]&&i.setAttribute(Wr[e],t)}))},e}(to),ro=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var n=this,i=this.attr(),r=this.get("el");Object(h.each)(e||i,(function(t,e){"img"===e?n._setImage(i.img):Wr[e]&&r.setAttribute(Wr[e],t)}))},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),n=this.get("el");if(Object(h.isString)(t))n.setAttribute("href",t);else if(t instanceof window.Image)e.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&Object(h.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var i=document.createElement("canvas");i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.getContext("2d").putImageData(t,0,0),e.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",i.toDataURL())}},e}(to),oo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this.attr(),i=this.get("el");Object(h.each)(e||n,(function(e,r){if("startArrow"===r||"endArrow"===r)if(e){var o=Object(h.isObject)(e)?t.addArrow(n,Wr[r]):t.getDefaultArrow(n,Wr[r]);i.setAttribute(Wr[r],"url(#"+o+")")}else i.removeAttribute(Wr[r]);else Wr[r]&&i.setAttribute(Wr[r],e)}))},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,i=t.x2,r=t.y2;return br.c.length(e,n,i,r)},e.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,i=e.y1,r=e.x2,o=e.y2;return br.c.pointAt(n,i,r,o,t)},e}(to),ao={circle:function(t,e,n){return[["M",t,e],["m",-n,0],["a",n,n,0,1,0,2*n,0],["a",n,n,0,1,0,2*-n,0]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},diamond:function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]},triangle:function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+i],["L",t,e-i],["L",t+n,e+i],["z"]]},triangleDown:function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-i],["L",t+n,e-i],["L",t,e+i],["Z"]]}},so={get:function(t){return ao[t]},register:function(t,e){ao[t]=e},remove:function(t){delete ao[t]},getAll:function(){return ao}},lo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return Object(h.isArray)(t)?t.map((function(t){return t.join(" ")})).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),n=e.x,i=e.y,r=e.r||e.radius,o=e.symbol||"circle";return(t=Object(h.isFunction)(o)?o:so.get(o))?t(n,i,r):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=so,e}(to),co=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var n=this,i=this.attr(),r=this.get("el");Object(h.each)(e||i,(function(e,o){if("path"===o&&Object(h.isArray)(e))r.setAttribute("d",n._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=Object(h.isObject)(e)?t.addArrow(i,Wr[o]):t.getDefaultArrow(i,Wr[o]);r.setAttribute(Wr[o],"url(#"+a+")")}else r.removeAttribute(Wr[o]);else Wr[o]&&r.setAttribute(Wr[o],e)}))},e.prototype._formatPath=function(t){var e=t.map((function(t){return t.join(" ")})).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),n=this.getTotalLength();if(0===n)return null;var i=e?e.getPointAtLength(t*n):null;return i?{x:i.x,y:i.y}:null},e}(to),uo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.createPath=function(t,e){var n=this.attr(),i=this.get("el");Object(h.each)(e||n,(function(t,e){"points"===e&&Object(h.isArray)(t)&&t.length>=2?i.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):Wr[e]&&i.setAttribute(Wr[e],t)}))},e}(to),ho=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,n,i){t.prototype.onAttrChange.call(this,e,n,i),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var n=this.attr(),i=this.get("el");Object(h.each)(e||n,(function(t,e){"points"===e&&Object(h.isArray)(t)&&t.length>=2?i.setAttribute("points",t.map((function(t){return t[0]+","+t[1]})).join(" ")):Wr[e]&&i.setAttribute(Wr[e],t)}))},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return Object(h.isNil)(e)?(this.set("totalLength",br.d.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,n,i=this.attr().points,r=this.get("tCache");return r||(this._setTcache(),r=this.get("tCache")),Object(h.each)(r,(function(i,r){t>=i[0]&&t<=i[1]&&(e=(t-i[0])/(i[1]-i[0]),n=r)})),br.c.pointAt(i[n][0],i[n][1],i[n+1][0],i[n+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var n,i,r=0,o=[];Object(h.each)(t,(function(a,s){t[s+1]&&((n=[])[0]=r/e,i=br.c.length(a[0],a[1],t[s+1][0],t[s+1][1]),r+=i,n[1]=r/e,o.push(n))})),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(to);var fo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var n=this,i=this.attr(),r=this.get("el"),o=!1,a=["x","y","width","height","radius"];Object(h.each)(e||i,(function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&Wr[e]&&r.setAttribute(Wr[e],t):(r.setAttribute("d",n._assembleRect(i)),o=!0)}))},e.prototype._assembleRect=function(t){var e=t.x,n=t.y,i=t.width,r=t.height,o=t.radius;if(!o)return"M "+e+","+n+" l "+i+",0 l 0,"+r+" l"+-i+" 0 z";var a=function(t){var e=0,n=0,i=0,r=0;return Object(h.isArray)(t)?1===t.length?e=n=i=r=t[0]:2===t.length?(e=i=t[0],n=r=t[1]):3===t.length?(e=t[0],n=r=t[1],i=t[2]):(e=t[0],n=t[1],i=t[2],r=t[3]):e=n=i=r=t,{r1:e,r2:n,r3:i,r4:r}}(o);return Object(h.isArray)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+n],["l "+(i-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(r-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-i)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-r)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(to),po=n(55),go={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},yo={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},vo={left:"left",start:"left",center:"middle",right:"end",end:"end"},mo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return Object(u.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return Object(u.__assign)(Object(u.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var n=this,i=this.attr(),r=this.get("el");this._setFont(),Object(h.each)(e||i,(function(t,e){"text"===e?n._setText(""+t):"matrix"===e&&t?Zr(n):Wr[e]&&r.setAttribute(Wr[e],t)})),r.setAttribute("paint-order","stroke"),r.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),n=e.textBaseline,i=e.textAlign,r=Object(po.a)();r&&"firefox"===r.name?t.setAttribute("dominant-baseline",yo[n]||"alphabetic"):t.setAttribute("alignment-baseline",go[n]||"baseline"),t.setAttribute("text-anchor",vo[i]||"left")},e.prototype._setText=function(t){var e=this.get("el"),n=this.attr(),i=n.x,r=n.textBaseline,o=void 0===r?"bottom":r;if(t)if(~t.indexOf("\n")){var a=t.split("\n"),s=a.length-1,l="";Object(h.each)(a,(function(t,e){0===e?"alphabetic"===o?l+=''+t+"":"top"===o?l+=''+t+"":"middle"===o?l+=''+t+"":"bottom"===o?l+=''+t+"":"hanging"===o&&(l+=''+t+""):l+=''+t+""})),e.innerHTML=l}else e.innerHTML=t;else e.innerHTML=""},e}(to),xo=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,bo=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,_o=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Oo(t){var e=t.match(_o);if(!e)return"";var n="";return e.sort((function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])})),Object(h.each)(e,(function(t){t=t.split(":"),n+=''})),n}var wo=function(){function t(t){this.cfg={};var e=null,n=Object(h.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,i,r=xo.exec(t),o=Object(h.mod)(Object(h.toRadian)(parseFloat(r[1])),2*Math.PI),a=r[2];o>=0&&o<.5*Math.PI?(n={x:0,y:0},i={x:1,y:1}):.5*Math.PI<=o&&o';e.innerHTML=n},t}(),Ao=function(){function t(t,e){this.cfg={};var n=Hr("marker"),i=Object(h.uniqueId)("marker_");n.setAttribute("id",i);var r=Hr("path");r.setAttribute("stroke",t.stroke||"none"),r.setAttribute("fill",t.fill||"none"),n.appendChild(r),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=r,this.id=i;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,r):(this.cfg=o,this._setMarker(t.lineWidth,r)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var n=this.el,i=this.cfg.path,r=this.cfg.d;Object(h.isArray)(i)&&(i=i.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",i),n.appendChild(e),r&&n.setAttribute("refX",""+r/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),Co=function(){function t(t){this.type="clip",this.cfg={};var e=Hr("clipPath");this.el=e,this.id=Object(h.uniqueId)("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),Eo=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Io=function(){function t(t){this.cfg={};var e=Hr("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=Hr("image");e.appendChild(n);var i=Object(h.uniqueId)("pattern_");e.id=i,this.el=e,this.id=i,this.cfg=t;var r=Eo.exec(t)[2];n.setAttribute("href",r);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return r.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=r,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),Po=function(){function t(t){var e=Hr("defs"),n=Object(h.uniqueId)("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var n=this.children,i=null,r=0;r0&&(c[0][0]="L")),o=o.concat(c)})),o.push(["Z"])}return o}function ko(t,e,n,i,r){for(var o=fi(t,e,!e,"lineWidth"),a=t.connectNulls,s=t.isInCircle,l=ci(t.points,a,t.showSinglePoint),c=[],u=0,h=l.length;ui&&(i=r),r=e[0]})));var d=this.scales[f];try{for(var g=Object(u.__values)(t),y=g.next();!y.done;y=g.next()){var v=y.value,m=this.getDrawCfg(v),x=m.x,b=m.y,_=d.scale(v._origin[f]);this.drawGrayScaleBlurredCircle(x-s.x,b-l.y,n+i,_,p)}}catch(t){r={error:t}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}var O=p.getImageData(0,0,c,h);this.clearShadowCanvasCtx(),this.colorize(O),p.putImageData(O,0,0);var w=this.getImageShape();w.attr("x",s.x),w.attr("y",l.y),w.attr("width",c),w.attr("height",h),w.attr("img",p.canvas),w.set("origin",this.getShapeInfo(t))},e.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),e=this.coordinate;return Math.min(e.getWidth()/(4*t.scales[0].ticks.length),e.getHeight()/(4*t.scales[1].ticks.length))},e.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},e.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},e.prototype.drawGrayScaleBlurredCircle=function(t,e,n,i,r){var o=this.getGrayScaleBlurredCanvas();r.globalAlpha=i,r.drawImage(o,t-n,e-n)},e.prototype.colorize=function(t){for(var e=this.getAttribute("color"),n=t.data,i=this.paletteCache,r=3;re&&(i=e-(n=n?e/(1+i/n):0)),r+o>e&&(o=e-(r=r?e/(1+o/r):0)),[n||0,i||0,r||0,o||0]}function Xo(t,e,n){var i=[];if(n.isRect){var r=n.isTransposed?{x:n.start.x,y:e[0].y}:{x:e[0].x,y:n.start.y},o=n.isTransposed?{x:n.end.x,y:e[2].y}:{x:e[3].x,y:n.end.y},a=Object(h.get)(t,["background","style","radius"]);if(a){var s=n.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,l=n.isTransposed?n.getWidth():n.getHeight(),c=Object(u.__read)(Yo(a,Math.min(s,l)),4),f=c[0],p=c[1],d=c[2],g=c[3],y=n.isTransposed&&n.isReflect("y"),v=y?0:1,m=function(t){return y?-t:t};i.push(["M",r.x,o.y+m(f)]),0!==f&&i.push(["A",f,f,0,0,v,r.x+f,o.y]),i.push(["L",o.x-p,o.y]),0!==p&&i.push(["A",p,p,0,0,v,o.x,o.y+m(p)]),i.push(["L",o.x,r.y-m(d)]),0!==d&&i.push(["A",d,d,0,0,v,o.x-d,r.y]),i.push(["L",r.x+g,r.y]),0!==g&&i.push(["A",g,g,0,0,v,r.x,r.y-m(g)])}else i.push(["M",r.x,r.y]),i.push(["L",o.x,r.y]),i.push(["L",o.x,o.y]),i.push(["L",r.x,o.y]),i.push(["L",r.x,r.y]);i.push(["z"])}if(n.isPolar){var x=n.getCenter(),b=lt(t,n),_=b.startAngle,O=b.endAngle;if("theta"===n.type||n.isTransposed){var w=function(t){return Math.pow(t,2)};f=Math.sqrt(w(x.x-e[0].x)+w(x.y-e[0].y)),p=Math.sqrt(w(x.x-e[2].x)+w(x.y-e[2].y));i=at(x.x,x.y,f,n.startAngle,n.endAngle,p)}else i=at(x.x,x.y,n.getRadius(),_,O)}return i}function Wo(t,e,n){var i=[];return Object(h.isNil)(e)?n?i.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",(t[2].x+t[3].x)/2,(t[2].y+t[3].y)/2],["Z"]):i.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",t[2].x,t[2].y],["L",t[3].x,t[3].y],["Z"]):i.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),i}function Ho(t,e){return[e,t]}Bn("interval",{defaultShapeType:"rect",getDefaultPoints:function(t){return zo(t)}});Nn("interval","rect",{draw:function(t,e){var n,i=fi(t,!1,!0),r=e,o=null==t?void 0:t.background;if(o){r=e.addGroup({name:"interval-group"});var a=pi(t),s=Xo(t,this.parsePoints(t.points),this.coordinate);r.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},a),{path:s}),zIndex:-1,name:"element-background"})}n=i.radius&&this.coordinate.isRect?function(t,e,n){var i,r,o,a,s,l,c,h=Object(u.__read)(Object(u.__spreadArray)([],Object(u.__read)(t),!1),4),f=h[0],p=h[1],d=h[2],g=h[3],y=Object(u.__read)("number"==typeof n?Array(4).fill(n):n,4),v=y[0],m=y[1],x=y[2],b=y[3];e.isTransposed&&(p=(i=Object(u.__read)(Ho(p,g),2))[0],g=i[1]),e.isReflect("y")&&(f=(r=Object(u.__read)(Ho(f,p),2))[0],p=r[1],d=(o=Object(u.__read)(Ho(d,g),2))[0],g=o[1]),e.isReflect("x")&&(f=(a=Object(u.__read)(Ho(f,g),2))[0],g=a[1],p=(s=Object(u.__read)(Ho(p,d),2))[0],d=s[1]);var _=[],O=function(t){return Math.abs(t)};return v=(l=Object(u.__read)(Yo([v,m,x,b],Math.min(O(g.x-f.x),O(p.y-f.y))).map((function(t){return O(t)})),4))[0],m=l[1],x=l[2],b=l[3],e.isTransposed&&(v=(c=Object(u.__read)([b,v,m,x],4))[0],m=c[1],x=c[2],b=c[3]),f.y1){r.sort();var y=function(t,e){var n=t.length,i=t;Object(h.isString)(i[0])&&(i=t.map((function(t){return e.translate(t)})));for(var r=i[1]-i[0],o=2;oa&&(r=a)}return r}(r,i);a=(i.max-i.min)/y,r.length>a&&(a=r.length)}var v=i.range,m=1/a,x=1;(n.isPolar?x=n.isTransposed&&a>1?d:g:(i.isLinear&&(m*=v[1]-v[0]),x=p),!Object(h.isNil)(l)&&l>=0)?m=(1-(a-1)*(l/s))/a:m*=x;if(t.getAdjust("dodge")){var b=function(t,e){if(e){var n=Object(h.flatten)(t);return Object(h.valuesOfKey)(n,e).length}return t.length}(o,t.getAdjust("dodge").dodgeBy);if(!Object(h.isNil)(c)&&c>=0)m=(m-c/s*(b-1))/b;else!Object(h.isNil)(l)&&l>=0?(m*=x,m/=b):m/=b;m=m>=0?m:0}if(!Object(h.isNil)(u)&&u>=0){var _=u/s;m>_&&(m=_)}if(!Object(h.isNil)(f)&&f>=0){var O=f/s;m0&&!Object(h.get)(r,[o,"min"])&&i.change({min:0}),s<=0&&!Object(h.get)(r,[o,"max"])&&i.change({max:0}))}},e.prototype.getDrawCfg=function(e){var n=t.prototype.getDrawCfg.call(this,e);return n.background=this.background,n},e}(Xn),Zo=function(t){function e(e){var n=t.call(this,e)||this;n.type="line";var i=e.sortable,r=void 0!==i&&i;return n.sortable=r,n}return Object(u.__extends)(e,t),e}(Lo),$o=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"];function Ko(t,e,n,i,r){var o,a,s=fi(e,r,!r,"r"),l=t.parsePoints(e.points),c=l[0];if(e.isStack)c=l[1];else if(l.length>1){var h=n.addGroup();try{for(var f=Object(u.__values)(l),p=f.next();!p.done;p=f.next()){var d=p.value;h.addShape({type:"marker",attrs:Object(u.__assign)(Object(u.__assign)(Object(u.__assign)({},s),{symbol:ei[i]||i}),d)})}}catch(t){o={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return h}return n.addShape({type:"marker",attrs:Object(u.__assign)(Object(u.__assign)(Object(u.__assign)({},s),{symbol:ei[i]||i}),c)})}Bn("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(t){return di(t)}});Object(h.each)($o,(function(t){Nn("point","hollow-".concat(t),{draw:function(e,n){return Ko(this,e,n,t,!0)},getMarker:function(e){var n=e.color;return{symbol:ei[t]||t,style:{r:4.5,stroke:n,fill:null}}}})}));var Qo=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="point",e.shapeType="point",e.generatePoints=!0,e}return Object(u.__extends)(e,t),e.prototype.getDrawCfg=function(e){var n=t.prototype.getDrawCfg.call(this,e);return Object(u.__assign)(Object(u.__assign)({},n),{isStack:!!this.getAdjust("stack")})},e}(Xn);Bn("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(t){var e=[];return Object(h.each)(t.x,(function(n,i){var r=t.y[i];e.push({x:n,y:r})})),e}});Nn("polygon","polygon",{draw:function(t,e){if(!Object(h.isEmpty)(t.points)){var n=fi(t,!0,!0),i=this.parsePath(function(t){for(var e=t[0],n=1,i=[["M",e.x,e.y]];n2?"weight":"normal";if(t.isInCircle){var a={x:0,y:1};return"normal"===o?n=function(t,e,n){var i=ia(e,n),r=[["M",t.x,t.y]];return r.push(i),r}(r[0],r[1],a):(i.fill=i.stroke,n=function(t,e){var n=ia(t[1],e),i=ia(t[3],e),r=[["M",t[0].x,t[0].y]];return r.push(i),r.push(["L",t[3].x,t[3].y]),r.push(["L",t[2].x,t[2].y]),r.push(n),r.push(["L",t[1].x,t[1].y]),r.push(["L",t[0].x,t[0].y]),r.push(["Z"]),r}(r,a)),n=this.parsePath(n),e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},i),{path:n})})}if("normal"===o)return n=st(((r=this.parsePoints(r))[1].x+r[0].x)/2,r[0].y,Math.abs(r[1].x-r[0].x)/2,Math.PI,2*Math.PI),e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},i),{path:n})});var s=na(r[1],r[3]),l=na(r[2],r[0]);return n=[["M",r[0].x,r[0].y],["L",r[1].x,r[1].y],s,["L",r[3].x,r[3].y],["L",r[2].x,r[2].y],l,["Z"]],n=this.parsePath(n),i.fill=i.stroke,e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},i),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),Nn("edge","smooth",{draw:function(t,e){var n=fi(t,!0,!1,"lineWidth"),i=t.points,r=this.parsePath(function(t,e){var n=na(t,e),i=[["M",t.x,t.y]];return i.push(n),i}(i[0],i[1]));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:r})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}});Nn("edge","vhv",{draw:function(t,e){var n=fi(t,!0,!1,"lineWidth"),i=t.points,r=this.parsePath(function(t,e){var n=[];n.push({x:t.x,y:t.y*(1-1/3)+e.y*(1/3)}),n.push({x:e.x,y:t.y*(1-1/3)+e.y*(1/3)}),n.push(e);var i=[["M",t.x,t.y]];return Object(h.each)(n,(function(t){i.push(["L",t.x,t.y])})),i}(i[0],i[1]));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:r})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),Nn("interval","funnel",{getPoints:function(t){return t.size=2*t.size,zo(t)},draw:function(t,e){var n=fi(t,!1,!0),i=this.parsePath(Wo(t.points,t.nextPoints,!1));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),Nn("interval","hollow-rect",{draw:function(t,e){var n=fi(t,!0,!1),i=e,r=null==t?void 0:t.background;if(r){i=e.addGroup();var o=pi(t),a=Xo(t,this.parsePoints(t.points),this.coordinate);i.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},o),{path:a}),zIndex:-1,name:"element-background"})}var s=this.parsePath(Go(t.points)),l=i.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:s}),name:"interval"});return r?i:l},getMarker:function(t){var e=t.color;return t.isInPolar?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}}),Nn("interval","line",{getPoints:function(t){return n=(e=t).x,i=e.y,r=e.y0,Object(h.isArray)(i)?i.map((function(t,e){return{x:Object(h.isArray)(n)?n[e]:n,y:t}})):[{x:n,y:r},{x:n,y:i}];var e,n,i,r},draw:function(t,e){var n=fi(t,!0,!1,"lineWidth"),i=ft(Object(u.__assign)({},n),["fill"]),r=this.parsePath(Go(t.points,!1));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},i),{path:r}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,n){return[["M",t,e-n],["L",t,e+n]]},style:{r:5,stroke:t.color}}}}),Nn("interval","pyramid",{getPoints:function(t){return t.size=2*t.size,zo(t)},draw:function(t,e){var n=fi(t,!1,!0),i=this.parsePath(Wo(t.points,t.nextPoints,!0));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),Nn("interval","tick",{getPoints:function(t){return function(t){var e,n,i,r=t.x,o=t.y,a=t.y0,s=t.size;Object(h.isArray)(o)?(n=(e=Object(u.__read)(o,2))[0],i=e[1]):(n=a,i=o);var l=r+s/2,c=r-s/2;return[{x:r,y:n},{x:r,y:i},{x:c,y:n},{x:l,y:n},{x:c,y:i},{x:l,y:i}]}(t)},draw:function(t,e){var n,i=fi(t,!0,!1),r=this.parsePath([["M",(n=t.points)[0].x,n[0].y],["L",n[1].x,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["M",n[4].x,n[4].y],["L",n[5].x,n[5].y]]);return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},i),{path:r}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]},style:{r:5,stroke:t.color}}}});function ra(t,e){var n=ci(t.points,t.connectNulls,t.showSinglePoint),i=[];return Object(h.each)(n,(function(t){var n=function(t,e){var n=[];return Object(h.each)(t,(function(i,r){var o=t[r+1];if(n.push(i),o){var a=function(t,e,n){var i,r=t.x,o=t.y,a=e.x,s=e.y;switch(n){case"hv":i=[{x:a,y:o}];break;case"vh":i=[{x:r,y:s}];break;case"hvh":var l=(a+r)/2;i=[{x:l,y:o},{x:l,y:s}];break;case"vhv":var c=(o+s)/2;i=[{x:r,y:c},{x:a,y:c}]}return i}(i,o,e);n=n.concat(a)}})),n}(t,e);i=i.concat(function(t){return t.map((function(t,e){return 0===e?["M",t.x,t.y]:["L",t.x,t.y]}))}(n))})),Object(u.__assign)(Object(u.__assign)({},fi(t,!0,!1,"lineWidth")),{path:i})}function oa(t){var e=Object(h.isArray)(t)?t:[t],n=e[0],i=e[e.length-1],r=e.length>1?e[1]:n;return{min:n,max:i,min1:r,max1:e.length>3?e[3]:i,median:e.length>2?e[2]:r}}function aa(t,e,n){var i,r=n/2;if(Object(h.isArray)(e)){var o=oa(e),a=o.min,s=o.max,l=o.median,c=o.min1,u=t-r,f=t+r;i=[[u,s],[f,s],[t,s],[t,p=o.max1],[u,c],[u,p],[f,p],[f,c],[t,c],[t,a],[u,a],[f,a],[u,l],[f,l]]}else{e=Object(h.isNil)(e)?.5:e;var p,d=oa(t),g=(a=d.min,s=d.max,l=d.median,e-r),y=e+r;i=[[a,g],[a,y],[a,e],[c=d.min1,e],[c,g],[c,y],[p=d.max1,y],[p,g],[p,e],[s,e],[s,g],[s,y],[l,g],[l,y]]}return i.map((function(t){return{x:t[0],y:t[1]}}))}function sa(t){var e=(Object(h.isArray)(t)?t:[t]).sort((function(t,e){return e-t}));return function(t,e,n){if(Object(h.isString)(t))return t.padEnd(e,n);if(Object(h.isArray)(t)){var i=t.length;if(i1){var s=e.addGroup();try{for(var l=Object(u.__values)(o),c=l.next();!c.done;c=l.next()){var h=c.value;s.addShape("image",{attrs:{x:h.x-r/2,y:h.y-r,width:r,height:r,img:t.shape[1]}})}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return s}return e.addShape("image",{attrs:{x:a.x-r/2,y:a.y-r,width:r,height:r,img:t.shape[1]}})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),Object(h.each)($o,(function(t){Nn("point",t,{draw:function(e,n){return Ko(this,e,n,t,!1)},getMarker:function(e){var n=e.color;return{symbol:ei[t]||t,style:{r:4.5,fill:n}}}})})),Nn("schema","box",{getPoints:function(t){return aa(t.x,t.y,t.size)},draw:function(t,e){var n,i=fi(t,!0,!1),r=this.parsePath([["M",(n=t.points)[0].x,n[0].y],["L",n[1].x,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["M",n[4].x,n[4].y],["L",n[5].x,n[5].y],["L",n[6].x,n[6].y],["L",n[7].x,n[7].y],["L",n[4].x,n[4].y],["Z"],["M",n[8].x,n[8].y],["L",n[9].x,n[9].y],["M",n[10].x,n[10].y],["L",n[11].x,n[11].y],["M",n[12].x,n[12].y],["L",n[13].x,n[13].y]]);return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},i),{path:r,name:"schema"})})},getMarker:function(t){return{symbol:function(t,e,n){var i=aa(t,[e-6,e-3,e,e+3,e+6],n);return[["M",i[0].x+1,i[0].y],["L",i[1].x-1,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["M",i[4].x,i[4].y],["L",i[5].x,i[5].y],["L",i[6].x,i[6].y],["L",i[7].x,i[7].y],["L",i[4].x,i[4].y],["Z"],["M",i[8].x,i[8].y],["L",i[9].x,i[9].y],["M",i[10].x+1,i[10].y],["L",i[11].x-1,i[11].y],["M",i[12].x,i[12].y],["L",i[13].x,i[13].y]]},style:{r:6,lineWidth:1,stroke:t.color}}}}),Nn("schema","candle",{getPoints:function(t){return la(t.x,t.y,t.size)},draw:function(t,e){var n,i=fi(t,!0,!0),r=this.parsePath([["M",(n=t.points)[0].x,n[0].y],["L",n[1].x,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["L",n[4].x,n[4].y],["L",n[5].x,n[5].y],["Z"],["M",n[6].x,n[6].y],["L",n[7].x,n[7].y]]);return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},i),{path:r,name:"schema"})})},getMarker:function(t){var e=t.color;return{symbol:function(t,e,n){var i=la(t,[e+7.5,e+3,e-3,e-7.5],n);return[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["L",i[4].x,i[4].y],["L",i[5].x,i[5].y],["Z"],["M",i[6].x,i[6].y],["L",i[7].x,i[7].y]]},style:{lineWidth:1,stroke:e,fill:e,r:6}}}}),Nn("polygon","square",{draw:function(t,e){if(!Object(h.isEmpty)(t.points)){var n=fi(t,!0,!0),i=this.parsePoints(t.points);return e.addShape("rect",{attrs:Object(u.__assign)(Object(u.__assign)({},n),ca(i,t.size)),name:"polygon"})}},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),Nn("violin","smooth",{draw:function(t,e){var n=fi(t,!0,!0),i=this.parsePath(hi(t.points));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{stroke:null,r:4,fill:t.color}}}}),Nn("violin","hollow",{draw:function(t,e){var n=fi(t,!0,!1),i=this.parsePath(ui(t.points));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}}),Nn("violin","hollow-smooth",{draw:function(t,e){var n=fi(t,!0,!1),i=this.parsePath(hi(t.points));return e.addShape("path",{attrs:Object(u.__assign)(Object(u.__assign)({},n),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}});var ua=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getLabelValueDir=function(t){var e=t.points;return e[0].y<=e[2].y?1:-1},e.prototype.getLabelOffsetPoint=function(e,n,i,r){var o,a=t.prototype.getLabelOffsetPoint.call(this,e,n,i),s=this.getCoordinate(),l=s.isTransposed?"x":"y",c=this.getLabelValueDir(e.mappingData);return a=Object(u.__assign)(Object(u.__assign)({},a),((o={})[l]=a[l]*c,o)),s.isReflect("x")&&(a=Object(u.__assign)(Object(u.__assign)({},a),{x:-1*a.x})),s.isReflect("y")&&(a=Object(u.__assign)(Object(u.__assign)({},a),{y:-1*a.y})),a},e.prototype.getThemedLabelCfg=function(t){var e=this.geometry,n=this.getDefaultLabelCfg(),i=e.theme;return Object(h.deepMix)({},n,i.labels,"middle"===t.position?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,e,n,i){var r,o,a,s,l=this.getCoordinate(),c=l.isTransposed,u=e.points,f=l.convert(u[0]),p=l.convert(u[2]),d=this.getLabelValueDir(e),g=Object(h.isArray)(e.shape)?e.shape[0]:e.shape;if("funnel"===g||"pyramid"===g){var y=Object(h.get)(e,"nextPoints"),v=Object(h.get)(e,"points");if(y){var m=l.convert(v[0]),x=l.convert(v[1]),b=l.convert(y[0]),_=l.convert(y[1]);c?(r=Math.min(b.y,m.y),a=Math.max(b.y,m.y),o=(x.x+_.x)/2,s=(m.x+b.x)/2):(r=Math.min((x.y+_.y)/2,(m.y+b.y)/2),a=Math.max((x.y+_.y)/2,(m.y+b.y)/2),o=_.x,s=m.x)}else r=Math.min(p.y,f.y),a=Math.max(p.y,f.y),o=p.x,s=f.x}else r=Math.min(p.y,f.y),a=Math.max(p.y,f.y),o=p.x,s=f.x;switch(i){case"right":t.x=o,t.y=(r+a)/2,t.textAlign=Object(h.get)(t,"textAlign",d>0?"left":"right");break;case"left":t.x=s,t.y=(r+a)/2,t.textAlign=Object(h.get)(t,"textAlign",d>0?"left":"right");break;case"bottom":c&&(t.x=(o+s)/2),t.y=a,t.textAlign=Object(h.get)(t,"textAlign","center"),t.textBaseline=Object(h.get)(t,"textBaseline",d>0?"bottom":"top");break;case"middle":c&&(t.x=(o+s)/2),t.y=(r+a)/2,t.textAlign=Object(h.get)(t,"textAlign","center"),t.textBaseline=Object(h.get)(t,"textBaseline","middle");break;case"top":c&&(t.x=(o+s)/2),t.y=r,t.textAlign=Object(h.get)(t,"textAlign","center"),t.textBaseline=Object(h.get)(t,"textBaseline",d>0?"bottom":"top")}},e}(Jn),ha=Math.PI/2,fa=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),n=0;if(Object(h.isNumber)(t))n=t;else if(Object(h.isString)(t)&&-1!==t.indexOf("%")){var i=e.getRadius();e.innerRadius>0&&(i*=1-e.innerRadius),n=.01*parseFloat(t)*i}return n},e.prototype.getLabelItems=function(e){var n=t.prototype.getLabelItems.call(this,e),i=this.geometry.getYScale();return Object(h.map)(n,(function(t){if(t&&i){var e=i.scale(Object(h.get)(t.data,i.field));return Object(u.__assign)(Object(u.__assign)({},t),{percent:e})}return t}))},e.prototype.getLabelAlign=function(t){var e,n=this.getCoordinate();if(t.labelEmit)e=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(n.isTransposed){var i=n.getCenter(),r=t.offset;e=Math.abs(t.x-i.x)<1?"center":t.angle>Math.PI||t.angle<=0?r>0?"left":"right":r>0?"right":"left"}else e="center";return e},e.prototype.getLabelPoint=function(t,e,n){var i,r=1,o=t.content[n];this.isToMiddle(e)?i=this.getMiddlePoint(e.points):(1===t.content.length&&0===n?n=1:0===n&&(r=-1),i=this.getArcPoint(e,n));var a=t.offset*r,s=this.getPointAngle(i),l=t.labelEmit,c=this.getCirclePoint(s,a,i,l);return 0===c.r?c.content="":(c.content=o,c.angle=s,c.color=e.color),c.rotate=t.autoRotate?this.getLabelRotate(s,a,l):t.rotate,c.start={x:i.x,y:i.y},c},e.prototype.getArcPoint=function(t,e){return void 0===e&&(e=0),Object(h.isArray)(t.x)||Object(h.isArray)(t.y)?{x:Object(h.isArray)(t.x)?t.x[e]:t.x,y:Object(h.isArray)(t.y)?t.y[e]:t.y}:{x:t.x,y:t.y}},e.prototype.getPointAngle=function(t){return vt(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,e,n,i){var r=this.getCoordinate(),o=r.getCenter(),a=yt(r,n);if(0===a)return Object(u.__assign)(Object(u.__assign)({},o),{r:a});var s=t;r.isTransposed&&a>e&&!i?s=t+2*Math.asin(e/(2*a)):a+=e;return{x:o.x+a*Math.cos(s),y:o.y+a*Math.sin(s),r:a}},e.prototype.getLabelRotate=function(t,e,n){var i=t+ha;return n&&(i-=ha),i&&(i>ha?i-=Math.PI:i<-ha&&(i+=Math.PI)),i},e.prototype.getMiddlePoint=function(t){var e=this.getCoordinate(),n=t.length,i={x:0,y:0};return Object(h.each)(t,(function(t){i.x+=t.x,i.y+=t.y})),i.x/=n,i.y/=n,i=e.convert(i)},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(Jn),pa=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.defaultLayout="distribute",e}return Object(u.__extends)(e,t),e.prototype.getDefaultLabelCfg=function(e,n){var i=t.prototype.getDefaultLabelCfg.call(this,e,n);return Object(h.deepMix)({},i,Object(h.get)(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(e){return t.prototype.getLabelOffset.call(this,e)||0},e.prototype.getLabelRotate=function(t,e,n){var i;return e<0&&((i=t)>Math.PI/2&&(i-=Math.PI),i<-Math.PI/2&&(i+=Math.PI)),i},e.prototype.getLabelAlign=function(t){var e,n=this.getCoordinate().getCenter();return e=t.angle<=Math.PI/2&&t.x>=n.x?"left":"right",t.offset<=0&&(e="right"===e?"left":"right"),e},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var e,n=this.getCoordinate(),i={x:Object(h.isArray)(t.x)?t.x[0]:t.x,y:t.y[0]},r={x:Object(h.isArray)(t.x)?t.x[1]:t.x,y:t.y[1]},o=vt(n,i);if(t.points&&t.points[0].y===t.points[1].y)e=o;else{var a=vt(n,r);o>=a&&(a+=2*Math.PI),e=o+(a-o)/2}return e},e.prototype.getCirclePoint=function(t,e){var n=this.getCoordinate(),i=n.getCenter(),r=n.getRadius()+e;return Object(u.__assign)(Object(u.__assign)({},ot(i.x,i.y,r,t)),{angle:t,r:r})},e}(fa);function da(t,e,n){var i=t.filter((function(t){return!t.invisible}));i.sort((function(t,e){return t.y-e.y}));var r,o=!0,a=n.minY,s=n.maxY,l=Math.abs(a-s),c=0,u=Number.MIN_VALUE,h=i.map((function(t){return t.y>c&&(c=t.y),t.yl&&(l=c-a);o;)for(h.forEach((function(t){var e=(Math.min.apply(u,t.targets)+Math.max.apply(u,t.targets))/2;t.pos=Math.min(Math.max(u,e-t.size/2),l-t.size),t.pos=Math.max(0,t.pos)})),o=!1,r=h.length;r--;)if(r>0){var f=h[r-1],p=h[r];f.pos+f.size>p.pos&&(f.size+=p.size,f.targets=f.targets.concat(p.targets),f.pos+f.size>l&&(f.pos=l-f.size),h.splice(r,1),o=!0)}r=0,h.forEach((function(t){var n=a+e/2;t.targets.forEach((function(){i[r].y=t.pos+n,n+=e,r++}))}))}var ga=function(){function t(t){void 0===t&&(t={}),this.bitmap={};var e=t.xGap,n=void 0===e?1:e,i=t.yGap,r=void 0===i?8:i;this.xGap=n,this.yGap=r}return t.prototype.hasGap=function(t){for(var e=!0,n=this.bitmap,i=Math.round(t.minX),r=Math.round(t.maxX),o=Math.round(t.minY),a=Math.round(t.maxY),s=i;s<=r;s+=1)if(n[s]){if(s===i||s===r){for(var l=o;l<=a;l++)if(n[s][l]){e=!1;break}}else if(n[s][o]||n[s][a]){e=!1;break}}else n[s]={};return e},t.prototype.fillGap=function(t){for(var e=this.bitmap,n=Math.round(t.minX),i=Math.round(t.maxX),r=Math.round(t.minY),o=Math.round(t.maxY),a=n;a<=i;a+=1)e[a]||(e[a]={});for(a=n;a<=i;a+=this.xGap){for(var s=r;s<=o;s+=this.yGap)e[a][s]=!0;e[a][o]=!0}if(1!==this.yGap)for(a=r;a<=o;a+=1)e[n][a]=!0,e[i][a]=!0;if(1!==this.xGap)for(a=n;a<=i;a+=1)e[a][r]=!0,e[a][o]=!0},t.prototype.destroy=function(){this.bitmap={}},t}();function ya(t,e,n,i){var r=t.getCanvasBBox(),o=r.width,a=r.height,s={x:e,y:n,textAlign:"center"};switch(i){case 0:s.y-=a+1,s.x+=1,s.textAlign="left";break;case 1:s.y-=a+1,s.x-=1,s.textAlign="right";break;case 2:s.y+=a+1,s.x-=1,s.textAlign="right";break;case 3:s.y+=a+1,s.x+=1,s.textAlign="left";break;case 5:s.y-=2*a+2;break;case 6:s.y+=2*a+2;break;case 7:s.x+=o+1,s.textAlign="left";break;case 8:s.x-=o+1,s.textAlign="right"}return t.attr(s),t.getCanvasBBox()}function va(t){if(t.length>4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function ma(t,e,n){void 0===e&&(e=0),void 0===n&&(n={x:0,y:0});var i=t.x,r=t.y;return{x:(i-n.x)*Math.cos(-e)+(r-n.y)*Math.sin(-e)+n.x,y:(n.x-i)*Math.sin(-e)+(r-n.y)*Math.cos(-e)+n.y}}function xa(t){var e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],n=t.rotation;return n?[ma(e[0],n,e[0]),ma(e[1],n,e[0]),ma(e[2],n,e[0]),ma(e[3],n,e[0])]:e}function ba(t,e){if(t.length>4)return{min:0,max:0};var n=[];return t.forEach((function(t){var i,r;n.push((i=[t.x,t.y],r=e,(i[0]||0)*(r[0]||0)+(i[1]||0)*(r[1]||0)+(i[2]||0)*(r[2]||0)))})),{min:Math.min.apply(Math,Object(u.__spreadArray)([],Object(u.__read)(n),!1)),max:Math.max.apply(Math,Object(u.__spreadArray)([],Object(u.__read)(n),!1))}}function _a(t,e){return t.max>e.min&&t.mint.x+t.width+n||e.x+e.widtht.y+t.height+n||e.y+e.height4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function e(t,e,n){void 0===e&&(e=0),void 0===n&&(n={x:0,y:0});var i=t.x,r=t.y;return{x:(i-n.x)*Math.cos(-e)+(r-n.y)*Math.sin(-e)+n.x,y:(n.x-i)*Math.sin(-e)+(r-n.y)*Math.cos(-e)+n.y}}function n(t){var n=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i=t.rotation;return i?[e(n[0],i,n[0]),e(n[1],i,n[0]),e(n[2],i,n[0]),e(n[3],i,n[0])]:n}function i(t,e){if(t.length>4)return{min:0,max:0};var n=[];return t.forEach((function(t){var i,r;n.push((i=[t.x,t.y],r=e,(i[0]||0)*(r[0]||0)+(i[1]||0)*(r[1]||0)+(i[2]||0)*(r[2]||0)))})),{min:Math.min.apply(null,n),max:Math.max.apply(null,n)}}function r(t,e){return t.max>e.min&&t.mint.x+t.width+n||e.x+e.widtht.y+t.height+n||e.y+e.height=o.height:a.width>=o.width}(t,e,r)}))}function Fa(t,e,n){return t.some((function(t){return n(t,e)}))}function Ta(t,e){return Fa(t,e,(function(t,e){var n,i,r,o=qn(t),a=qn(e);return n=o.getCanvasBBox(),i=a.getCanvasBBox(),void 0===(r=2)&&(r=0),Math.max(0,Math.min(n.x+n.width+r,i.x+i.width+r)-Math.max(n.x-r,i.x-r))*Math.max(0,Math.min(n.y+n.height+r,i.y+i.height+r)-Math.max(n.y-r,i.y-r))>0}))}function La(t,e,n){return t.some((function(t){return n(t,e)}))}function Da(t,e){return La(t,e,(function(t,e){var n,i,r,o=qn(t),a=qn(e);return n=o.getCanvasBBox(),i=a.getCanvasBBox(),void 0===(r=2)&&(r=0),Math.max(0,Math.min(n.x+n.width+r,i.x+i.width+r)-Math.max(n.x-r,i.x-r))*Math.max(0,Math.min(n.y+n.height+r,i.y+i.height+r)-Math.max(n.y-r,i.y-r))>0}))}var ka=Object(h.memoize)((function(t,e){void 0===e&&(e={});var n=e.fontSize,i=e.fontFamily,r=e.fontWeight,o=e.fontStyle,a=e.fontVariant,s=(Ea||(Ea=document.createElement("canvas").getContext("2d")),Ea);return s.font=[o,a,r,"".concat(n,"px"),i].join(" "),s.measureText(Object(h.isString)(t)?t:"").width}),(function(t,e){return void 0===e&&(e={}),Object(u.__spreadArray)([t],Object(u.__read)(Object(h.values)(e)),!1).join("")}));function Ba(t,e,n,i,r){var o,a,s=n.start,l=n.end,c=n.getWidth(),h=n.getHeight();"y"===r?(o=s.x+c/2,a=i.ys.x?i.x:s.x,a=s.y+h/2):"xy"===r&&(n.isPolar?(o=n.getCenter().x,a=n.getCenter().y):(o=(s.x+l.x)/2,a=(s.y+l.y)/2));var f=function(t,e,n){var i,r=Object(u.__read)(e,2),o=r[0],a=r[1];return t.applyToMatrix([o,a,1]),"x"===n?(t.setMatrix(G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]])),i=G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])):"y"===n?(t.setMatrix(G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",1,.01],["t",o,a]])),i=G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",1,100],["t",o,a]])):"xy"===n&&(t.setMatrix(G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",.01,.01],["t",o,a]])),i=G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",100,100],["t",o,a]])),i}(t,[o,a],r);t.animate({matrix:f},e)}function Na(t,e){var n,i=Ui(t,e),r=i.startAngle,o=i.endAngle;return!Object(h.isNumberEqual)(r,.5*-Math.PI)&&r<.5*-Math.PI&&(r+=2*Math.PI),!Object(h.isNumberEqual)(o,.5*-Math.PI)&&o<.5*-Math.PI&&(o+=2*Math.PI),0===e[5]&&(r=(n=Object(u.__read)([o,r],2))[0],o=n[1]),Object(h.isNumberEqual)(r,1.5*Math.PI)&&(r=-.5*Math.PI),Object(h.isNumberEqual)(o,-.5*Math.PI)&&!Object(h.isNumberEqual)(r,o)&&(o=1.5*Math.PI),{startAngle:r,endAngle:o}}function Ra(t){var e;return"M"===t[0]||"L"===t[0]?e=[t[1],t[2]]:"a"!==t[0]&&"A"!==t[0]&&"C"!==t[0]||(e=[t[t.length-2],t[t.length-1]]),e}function Va(t){var e,n,i,r=t.filter((function(t){return"A"===t[0]||"a"===t[0]}));if(0===r.length)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var o=r[0],a=r.length>1?r[1]:r[0],s=t.indexOf(o),l=t.indexOf(a),c=Ra(t[s-1]),f=Ra(t[l-1]),p=Na(c,o),d=p.startAngle,g=p.endAngle,y=Na(f,a),v=y.startAngle,m=y.endAngle;Object(h.isNumberEqual)(d,v)&&Object(h.isNumberEqual)(g,m)?(n=d,i=g):(n=Math.min(d,v),i=Math.max(g,m));var x=o[1],b=r[r.length-1][1];return x=0;a--){var s=this.getFacetsByLevel(t,a);try{for(var l=(e=void 0,Object(u.__values)(s)),c=l.next();!c.done;c=l.next()){var h=c.value;this.isLeaf(h)||(h.originColIndex=h.columnIndex,h.columnIndex=this.getRegionIndex(h.children),h.columnValuesLength=r.length)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}}},e.prototype.getFacetsByLevel=function(t,e){var n=[];return t.forEach((function(t){t.rowIndex===e&&n.push(t)})),n},e.prototype.getRegionIndex=function(t){var e=t[0];return(t[t.length-1].columnIndex-e.columnIndex)/2+e.columnIndex},e.prototype.isLeaf=function(t){return!t.children||!t.children.length},e.prototype.getRows=function(){return this.cfg.fields.length+1},e.prototype.getChildFacets=function(t,e,n){var i=this,r=this.cfg.fields;if(!(r.length=n){var r=i.parsePosition([t[s],t[a.field]]);r&&f.push(r)}if(t[s]===u)return!1})),f},e.prototype.parsePercentPosition=function(t){var e=parseFloat(t[0])/100,n=parseFloat(t[1])/100,i=this.view.getCoordinate(),r=i.start,o=i.end,a=Math.min(r.x,o.x),s=Math.min(r.y,o.y);return{x:i.getWidth()*e+a,y:i.getHeight()*n+s}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),e=t.start,n=t.end,i=t.getWidth(),r=t.getHeight(),o={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y)};return{x:o.x,y:o.y,minX:o.x,minY:o.y,maxX:o.x+i,maxY:o.y+r,width:i,height:r}},e.prototype.getAnnotationCfg=function(t,e,n){var i=this,r=this.view.getCoordinate(),o=this.view.getCanvas(),a={};if(Object(h.isNil)(e))return null;var s=e.start,l=e.end,c=e.position,f=this.parsePosition(s),p=this.parsePosition(l),d=this.parsePosition(c);if(!(!["arc","image","line","region","regionFilter"].includes(t)||f&&p))return null;if(["text","dataMarker","html"].includes(t)&&!d)return null;if("arc"===t){var g=e,y=(g.start,g.end,Object(u.__rest)(g,["start","end"])),v=vt(r,f),m=vt(r,p);v>m&&(m=2*Math.PI+m),a=Object(u.__assign)(Object(u.__assign)({},y),{center:r.getCenter(),radius:yt(r,f),startAngle:v,endAngle:m})}else if("image"===t){var x=e;x.start,x.end,y=Object(u.__rest)(x,["start","end"]);a=Object(u.__assign)(Object(u.__assign)({},y),{start:f,end:p,src:e.src})}else if("line"===t){var b=e;b.start,b.end,y=Object(u.__rest)(b,["start","end"]);a=Object(u.__assign)(Object(u.__assign)({},y),{start:f,end:p,text:Object(h.get)(e,"text",null)})}else if("region"===t){var _=e;_.start,_.end,y=Object(u.__rest)(_,["start","end"]);a=Object(u.__assign)(Object(u.__assign)({},y),{start:f,end:p})}else if("text"===t){var O=this.view.getData(),w=e,j=(w.position,w.content),S=(y=Object(u.__rest)(w,["position","content"]),j);Object(h.isFunction)(j)&&(S=j(O)),a=Object(u.__assign)(Object(u.__assign)(Object(u.__assign)({},d),y),{content:S})}else if("dataMarker"===t){var M=e,A=(M.position,M.point),C=M.line,E=M.text,I=M.autoAdjust,P=M.direction;y=Object(u.__rest)(M,["position","point","line","text","autoAdjust","direction"]);a=Object(u.__assign)(Object(u.__assign)(Object(u.__assign)({},y),d),{coordinateBBox:this.getCoordinateBBox(),point:A,line:C,text:E,autoAdjust:I,direction:P})}else if("dataRegion"===t){var F=e,T=F.start,L=F.end,D=F.region,k=(E=F.text,F.lineLength);y=Object(u.__rest)(F,["start","end","region","text","lineLength"]);a=Object(u.__assign)(Object(u.__assign)({},y),{points:this.getRegionPoints(T,L),region:D,text:E,lineLength:k})}else if("regionFilter"===t){var B=e,N=(B.start,B.end,B.apply),R=B.color,V=(y=Object(u.__rest)(B,["start","end","apply","color"]),this.view.geometries),z=[],G=function t(e){e&&(e.isGroup()?e.getChildren().forEach((function(e){return t(e)})):z.push(e))};Object(h.each)(V,(function(t){N?Object(h.contains)(N,t.type)&&Object(h.each)(t.elements,(function(t){G(t.shape)})):Object(h.each)(t.elements,(function(t){G(t.shape)}))})),a=Object(u.__assign)(Object(u.__assign)({},y),{color:R,shapes:z,start:f,end:p})}else if("shape"===t){var Y=e,X=Y.render,W=Object(u.__rest)(Y,["render"]);a=Object(u.__assign)(Object(u.__assign)({},W),{render:function(t){if(Object(h.isFunction)(e.render))return X(t,i.view,{parsePosition:i.parsePosition.bind(i)})}})}else if("html"===t){var H=e,U=H.html;H.position,W=Object(u.__rest)(H,["html","position"]);a=Object(u.__assign)(Object(u.__assign)(Object(u.__assign)({},W),d),{parent:o.get("el").parentNode,html:function(t){return Object(h.isFunction)(U)?U(t,i.view):U}})}var q=Object(h.deepMix)({},n,Object(u.__assign)(Object(u.__assign)({},a),{top:e.top,style:e.style,offsetX:e.offsetX,offsetY:e.offsetY}));return"html"!==t&&(q.container=this.getComponentContainer(q)),q.animate=this.view.getOptions().animate&&q.animate&&Object(h.get)(e,"animate",q.animate),q.animateOption=Object(h.deepMix)({},On,q.animateOption,e.animateOption),q},e.prototype.isTop=function(t){return Object(h.get)(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return Object(h.get)(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var e=this.cache.get(this.getCacheKey(t));if(e){var n=t.type,i=this.getAnnotationTheme(n),r=this.getAnnotationCfg(n,t,i);r&&ft(r,["container"]),e.component.update(Object(u.__assign)(Object(u.__assign)({},r||{}),{visible:!!r})),Object(h.includes)(Qa,t.type)&&e.component.render()}else(e=this.createAnnotation(t))&&(e.component.init(),Object(h.includes)(Qa,t.type)&&e.component.render());return e},e.prototype.syncCache=function(t){var e=this,n=new Map(this.cache);return t.forEach((function(t,e){n.set(e,t)})),n.forEach((function(t,i){Object(h.find)(e.option,(function(t){return i===e.getCacheKey(t)}))||(t.component.destroy(),n.delete(i))})),n},e.prototype.getCacheKey=function(t){return t},e}(vn);function ts(t,e){var n=Object(h.deepMix)({},Object(h.get)(t,["components","axis","common"]),Object(h.get)(t,["components","axis",e]));return Object(h.get)(n,["grid"],{})}function es(t,e,n,i){var r=[],o=e.getTicks();return t.isPolar&&o.push({value:1,text:"",tickValue:""}),o.reduce((function(e,o,a){var s=o.value;if(i)r.push({points:[t.convert("y"===n?{x:0,y:s}:{x:s,y:0}),t.convert("y"===n?{x:1,y:s}:{x:s,y:1})]});else if(a){var l=(e.value+s)/2;r.push({points:[t.convert("y"===n?{x:0,y:l}:{x:l,y:0}),t.convert("y"===n?{x:1,y:l}:{x:l,y:1})]})}return o}),o[0]),r}function ns(t,e,n,i,r){var o=e.values.length,a=[],s=n.getTicks();return s.reduce((function(e,n){var s=e?e.value:n.value,l=n.value,c=(s+l)/2;return"x"===r?a.push({points:[t.convert({x:i?l:c,y:0}),t.convert({x:i?l:c,y:1})]}):a.push({points:Object(h.map)(Array(o+1),(function(e,n){return t.convert({x:n/o,y:i?l:c})}))}),n}),s[0]),a}function is(t,e){var n=Object(h.get)(e,"grid");if(null===n)return!1;var i=Object(h.get)(t,"grid");return!(void 0===n&&null===i)}var rs=["container"],os=Object(u.__assign)(Object(u.__assign)({},On),{appear:null}),as=function(t){function e(e){var n=t.call(this,e)||this;return n.cache=new Map,n.gridContainer=n.view.getLayer(s.BG).addGroup(),n.gridForeContainer=n.view.getLayer(s.FORE).addGroup(),n.axisContainer=n.view.getLayer(s.BG).addGroup(),n.axisForeContainer=n.view.getLayer(s.FORE).addGroup(),n}return Object(u.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,e=this.view.getCoordinate();Object(h.each)(this.getComponents(),(function(n){var i,r=n.component,o=n.direction,a=n.type,s=n.extra,l=s.dim,u=s.scale,h=s.alignTick;if(a===c.AXIS)e.isPolar?"x"===l?i=e.isTransposed?jt(e,o):Et(e):"y"===l&&(i=e.isTransposed?Et(e):jt(e,o)):i=jt(e,o);else if(a===c.GRID)if(e.isPolar){i={items:e.isTransposed?"x"===l?ns(e,t.view.getYScales()[0],u,h,l):es(e,u,l,h):"x"===l?es(e,u,l,h):ns(e,t.view.getXScale(),u,h,l),center:t.view.getCoordinate().getCenter()}}else i={items:es(e,u,l,h)};r.update(i)}))},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var e=new Map;this.cache.forEach((function(n,i){t.has(i)?e.set(i,n):n.component.destroy()})),this.cache=e},e.prototype.clear=function(){t.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach((function(e){t.push(e)})),t},e.prototype.updateXAxes=function(t){var e=this.view.getXScale();if(e&&!e.isIdentity){var n=It(this.option,e.field);if(!1!==n){var i=Pt(n,l.BOTTOM),r=s.BG,o=this.view.getCoordinate(),a=this.getId("axis",e.field),c=this.getId("grid",e.field);if(o.isRect){if(u=this.cache.get(a))ft(p=this.getLineAxisCfg(e,n,i),rs),u.component.update(p),t.set(a,u);else u=this.createLineAxis(e,n,r,i,"x"),this.cache.set(a,u),t.set(a,u);if(f=this.cache.get(c))ft(p=this.getLineGridCfg(e,n,i,"x"),rs),f.component.update(p),t.set(c,f);else(f=this.createLineGrid(e,n,r,i,"x"))&&(this.cache.set(c,f),t.set(c,f))}else if(o.isPolar){var u,f;if(u=this.cache.get(a)){ft(p=o.isTransposed?this.getLineAxisCfg(e,n,l.RADIUS):this.getCircleAxisCfg(e,n,i),rs),u.component.update(p),t.set(a,u)}else{if(o.isTransposed){if(Object(h.isUndefined)(n))return;u=this.createLineAxis(e,n,r,l.RADIUS,"x")}else u=this.createCircleAxis(e,n,r,i,"x");this.cache.set(a,u),t.set(a,u)}if(f=this.cache.get(c)){var p;ft(p=o.isTransposed?this.getCircleGridCfg(e,n,l.RADIUS,"x"):this.getLineGridCfg(e,n,l.CIRCLE,"x"),rs),f.component.update(p),t.set(c,f)}else{if(o.isTransposed){if(Object(h.isUndefined)(n))return;f=this.createCircleGrid(e,n,r,l.RADIUS,"x")}else f=this.createLineGrid(e,n,r,l.CIRCLE,"x");f&&(this.cache.set(c,f),t.set(c,f))}}}}},e.prototype.updateYAxes=function(t){var e=this,n=this.view.getYScales();Object(h.each)(n,(function(n,i){if(n&&!n.isIdentity){var r=n.field,o=It(e.option,r);if(!1!==o){var a=s.BG,c=e.getId("axis",r),u=e.getId("grid",r),f=e.view.getCoordinate();if(f.isRect){var p=Pt(o,0===i?l.LEFT:l.RIGHT);if(d=e.cache.get(c))ft(y=e.getLineAxisCfg(n,o,p),rs),d.component.update(y),t.set(c,d);else d=e.createLineAxis(n,o,a,p,"y"),e.cache.set(c,d),t.set(c,d);if(g=e.cache.get(u))ft(y=e.getLineGridCfg(n,o,p,"y"),rs),g.component.update(y),t.set(u,g);else(g=e.createLineGrid(n,o,a,p,"y"))&&(e.cache.set(u,g),t.set(u,g))}else if(f.isPolar){var d,g;if(d=e.cache.get(c)){ft(y=f.isTransposed?e.getCircleAxisCfg(n,o,l.CIRCLE):e.getLineAxisCfg(n,o,l.RADIUS),rs),d.component.update(y),t.set(c,d)}else{if(f.isTransposed){if(Object(h.isUndefined)(o))return;d=e.createCircleAxis(n,o,a,l.CIRCLE,"y")}else d=e.createLineAxis(n,o,a,l.RADIUS,"y");e.cache.set(c,d),t.set(c,d)}if(g=e.cache.get(u)){var y;ft(y=f.isTransposed?e.getLineGridCfg(n,o,l.CIRCLE,"y"):e.getCircleGridCfg(n,o,l.RADIUS,"y"),rs),g.component.update(y),t.set(u,g)}else{if(f.isTransposed){if(Object(h.isUndefined)(o))return;g=e.createLineGrid(n,o,a,l.CIRCLE,"y")}else g=e.createCircleGrid(n,o,a,l.RADIUS,"y");g&&(e.cache.set(u,g),t.set(u,g))}}}}}))},e.prototype.createLineAxis=function(t,e,n,i,r){var o={component:new $(this.getLineAxisCfg(t,e,i)),layer:n,direction:i===l.RADIUS?l.NONE:i,type:c.AXIS,extra:{dim:r,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createLineGrid=function(t,e,n,i,r){var o=this.getLineGridCfg(t,e,i,r);if(o){var a={component:new Q(o),layer:n,direction:l.NONE,type:c.GRID,extra:{dim:r,scale:t,alignTick:Object(h.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.createCircleAxis=function(t,e,n,i,r){var o={component:new K(this.getCircleAxisCfg(t,e,i)),layer:n,direction:i,type:c.AXIS,extra:{dim:r,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createCircleGrid=function(t,e,n,i,r){var o=this.getCircleGridCfg(t,e,i,r);if(o){var a={component:new J(o),layer:n,direction:l.NONE,type:c.GRID,extra:{dim:r,scale:t,alignTick:Object(h.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.getLineAxisCfg=function(t,e,n){var i=Object(h.get)(e,["top"])?this.axisForeContainer:this.axisContainer,r=this.view.getCoordinate(),o=jt(r,n),a=Ft(t,e),s=At(this.view.getTheme(),n),l=Object(h.get)(e,["title"])?Object(h.deepMix)({title:{style:{text:a}}},{title:Ct(this.view.getTheme(),n,e.title)},e):e,c=Object(h.deepMix)(Object(u.__assign)(Object(u.__assign)({container:i},o),{ticks:t.getTicks().map((function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}})),verticalFactor:r.isPolar?-1*Mt(o,r.getCenter()):Mt(o,r.getCenter()),theme:s}),s,l),f=this.getAnimateCfg(c),p=f.animate,d=f.animateOption;c.animateOption=d,c.animate=p;var g=St(o),y=Object(h.get)(c,"verticalLimitLength",g?1/3:.5);if(y<=1){var v=this.view.getCanvas().get("width"),m=this.view.getCanvas().get("height");c.verticalLimitLength=y*(g?v:m)}return c},e.prototype.getLineGridCfg=function(t,e,n,i){if(is(At(this.view.getTheme(),n),e)){var r=ts(this.view.getTheme(),n),o=Object(h.deepMix)({container:Object(h.get)(e,["top"])?this.gridForeContainer:this.gridContainer},r,Object(h.get)(e,"grid"),this.getAnimateCfg(e));return o.items=es(this.view.getCoordinate(),t,i,Object(h.get)(o,"alignTick",!0)),o}},e.prototype.getCircleAxisCfg=function(t,e,n){var i=Object(h.get)(e,["top"])?this.axisForeContainer:this.axisContainer,r=this.view.getCoordinate(),o=t.getTicks().map((function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}}));t.isCategory||Math.abs(r.endAngle-r.startAngle)!==2*Math.PI||o.pop();var a=Ft(t,e),s=At(this.view.getTheme(),l.CIRCLE),c=Object(h.get)(e,["title"])?Object(h.deepMix)({title:{style:{text:a}}},{title:Ct(this.view.getTheme(),n,e.title)},e):e,f=Object(h.deepMix)(Object(u.__assign)(Object(u.__assign)({container:i},Et(this.view.getCoordinate())),{ticks:o,verticalFactor:1,theme:s}),s,c),p=this.getAnimateCfg(f),d=p.animate,g=p.animateOption;return f.animate=d,f.animateOption=g,f},e.prototype.getCircleGridCfg=function(t,e,n,i){if(is(At(this.view.getTheme(),n),e)){var r=ts(this.view.getTheme(),l.RADIUS),o=Object(h.deepMix)({container:Object(h.get)(e,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},r,Object(h.get)(e,"grid"),this.getAnimateCfg(e)),a=Object(h.get)(o,"alignTick",!0),s="x"===i?this.view.getYScales()[0]:this.view.getXScale();return o.items=ns(this.view.getCoordinate(),s,t,a,i),o}},e.prototype.getId=function(t,e){var n=this.view.getCoordinate();return"".concat(t,"-").concat(e,"-").concat(n.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&Object(h.get)(t,"animate"),animateOption:t&&t.animateOption?Object(h.deepMix)({},os,t.animateOption):os}},e}(vn);function ss(t,e,n){return n===l.TOP?[t.minX+t.width/2-e.width/2,t.minY]:n===l.BOTTOM?[t.minX+t.width/2-e.width/2,t.maxY-e.height]:n===l.LEFT?[t.minX,t.minY+t.height/2-e.height/2]:n===l.RIGHT?[t.maxX-e.width,t.minY+t.height/2-e.height/2]:n===l.TOP_LEFT||n===l.LEFT_TOP?[t.tl.x,t.tl.y]:n===l.TOP_RIGHT||n===l.RIGHT_TOP?[t.tr.x-e.width,t.tr.y]:n===l.BOTTOM_LEFT||n===l.LEFT_BOTTOM?[t.bl.x,t.bl.y-e.height]:n===l.BOTTOM_RIGHT||n===l.RIGHT_BOTTOM?[t.br.x-e.width,t.br.y-e.height]:[0,0]}function ls(t,e){return Object(h.isBoolean)(t)?!1!==t&&{}:Object(h.get)(t,[e],t)}function cs(t){return Object(h.get)(t,"position",l.BOTTOM)}var us=function(t){function e(e){var n=t.call(this,e)||this;return n.container=n.view.getLayer(s.FORE).addGroup(),n}return Object(u.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,Object(h.each)(this.components,(function(e){var n=e.component,i=e.direction,r=ri(i),o=n.get("maxWidthRatio"),a=n.get("maxHeightRatio"),s=t.getCategoryLegendSizeCfg(r,o,a),l=n.get("maxWidth"),c=n.get("maxHeight");n.update({maxWidth:Math.min(s.maxWidth,l||0),maxHeight:Math.min(s.maxHeight,c||0)});var h=n.get("padding"),f=n.getLayoutBBox(),p=new dt(f.x,f.y,f.width,f.height).expand(h),d=Object(u.__read)(ss(t.view.viewBBox,p,i),2),g=d[0],y=d[1],v=Object(u.__read)(ss(t.layoutBBox,p,i),2),m=v[0],x=v[1],b=0,_=0;i.startsWith("top")||i.startsWith("bottom")?(b=g,_=x):(b=m,_=y),n.setLocation({x:b+h[3],y:_+h[0]}),t.layoutBBox=t.layoutBBox.cut(p,i)}))},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var e={};if(Object(h.get)(this.option,"custom")){var n="global-custom",i=this.getComponentById(n);if(i){var r=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);ft(r,["container"]),i.component.update(r),e[n]=!0}else{var o=this.createCustomLegend(void 0,void 0,void 0,this.option);if(o){o.init();var a=s.FORE,l=cs(this.option);this.components.push({id:n,component:o,layer:a,direction:l,type:c.LEGEND,extra:void 0}),e[n]=!0}}}else this.loopLegends((function(n,i,r){var o=t.getId(r.field),a=t.getComponentById(o);if(a){var s=void 0,l=ls(t.option,r.field);!1!==l&&(Object(h.get)(l,"custom")?s=t.getCategoryCfg(n,i,r,l,!0):r.isLinear?s=t.getContinuousCfg(n,i,r,l):r.isCategory&&(s=t.getCategoryCfg(n,i,r,l))),s&&(ft(s,["container"]),a.direction=cs(l),a.component.update(s),e[o]=!0)}else{var c=t.createFieldLegend(n,i,r);c&&(c.component.init(),t.components.push(c),e[o]=!0)}}));var u=[];Object(h.each)(this.getComponents(),(function(t){e[t.id]?u.push(t):t.component.destroy()})),this.components=u},e.prototype.clear=function(){t.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var e=this,n=t.geometries;return Object(h.each)(t.views,(function(t){n=n.concat(e.getGeometries(t))})),n},e.prototype.loopLegends=function(t){if(this.view.getRootView()===this.view){var e=this.getGeometries(this.view),n={};Object(h.each)(e,(function(e){var i=e.getGroupAttributes();Object(h.each)(i,(function(i){var r=i.getScale(i.type);r&&"identity"!==r.type&&!n[r.field]&&(t(e,i,r),n[r.field]=!0)}))}))}},e.prototype.createFieldLegend=function(t,e,n){var i,r=ls(this.option,n.field),o=s.FORE,a=cs(r);if(!1!==r&&(Object(h.get)(r,"custom")?i=this.createCustomLegend(t,e,n,r):n.isLinear?i=this.createContinuousLegend(t,e,n,r):n.isCategory&&(i=this.createCategoryLegend(t,e,n,r))),i)return i.set("field",n.field),{id:this.getId(n.field),component:i,layer:o,direction:a,type:c.LEGEND,extra:{scale:n}}},e.prototype.createCustomLegend=function(t,e,n,i){var r=this.getCategoryCfg(t,e,n,i,!0);return new tt(r)},e.prototype.createContinuousLegend=function(t,e,n,i){var r=this.getContinuousCfg(t,e,n,ft(i,["value"]));return new et(r)},e.prototype.createCategoryLegend=function(t,e,n,i){var r=this.getCategoryCfg(t,e,n,i);return new tt(r)},e.prototype.getContinuousCfg=function(t,e,n,i){var r=n.getTicks(),o=Object(h.find)(r,(function(t){return 0===t.value})),a=Object(h.find)(r,(function(t){return 1===t.value})),s=r.map((function(t){var i=t.value,r=t.tickValue,o=e.mapping(n.invert(i)).join("");return{value:r,attrValue:o,color:o,scaleValue:i}}));o||s.push({value:n.min,attrValue:e.mapping(n.invert(0)).join(""),color:e.mapping(n.invert(0)).join(""),scaleValue:0}),a||s.push({value:n.max,attrValue:e.mapping(n.invert(1)).join(""),color:e.mapping(n.invert(1)).join(""),scaleValue:1}),s.sort((function(t,e){return t.value-e.value}));var l={min:Object(h.head)(s).value,max:Object(h.last)(s).value,colors:[],rail:{type:e.type},track:{}};"size"===e.type&&(l.track={style:{fill:"size"===e.type?this.view.getTheme().defaultColor:void 0}}),"color"===e.type&&(l.colors=s.map((function(t){return t.attrValue})));var c=this.container,u=ri(cs(i)),f=Object(h.get)(i,"title");return f&&(f=Object(h.deepMix)({text:Ot(n)},f)),l.container=c,l.layout=u,l.title=f,l.animateOption=On,this.mergeLegendCfg(l,i,"continuous")},e.prototype.getCategoryCfg=function(t,e,n,i,r){var o=this.container,a=Object(h.get)(i,"position",l.BOTTOM),s=ai(this.view.getTheme(),a),c=Object(h.get)(s,["marker"]),u=Object(h.get)(i,"marker"),f=ri(a),p=Object(h.get)(s,["pageNavigator"]),d=Object(h.get)(i,"pageNavigator"),g=r?function(t,e,n){return n.map((function(n,i){var r=e;Object(h.isFunction)(r)&&(r=r(n.name,i,Object(h.deepMix)({},t,n)));var o=Object(h.isFunction)(n.marker)?n.marker(n.name,i,Object(h.deepMix)({},t,n)):n.marker,a=Object(h.deepMix)({},t,r,o);return ii(a),n.marker=a,n}))}(c,u,i.items):oi(this.view,t,e,c,u),y=Object(h.get)(i,"title");y&&(y=Object(h.deepMix)({text:n?Ot(n):""},y));var v=Object(h.get)(i,"maxWidthRatio"),m=Object(h.get)(i,"maxHeightRatio"),x=this.getCategoryLegendSizeCfg(f,v,m);x.container=o,x.layout=f,x.items=g,x.title=y,x.animateOption=On,x.pageNavigator=Object(h.deepMix)({},p,d);var b=this.mergeLegendCfg(x,i,a);b.reversed&&b.items.reverse();var _=Object(h.get)(b,"maxItemWidth");return _&&_<=1&&(b.maxItemWidth=this.view.viewBBox.width*_),b},e.prototype.mergeLegendCfg=function(t,e,n){var i=n.split("-")[0],r=ai(this.view.getTheme(),i);return Object(h.deepMix)({},r,t,e)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return Object(h.find)(this.components,(function(e){return e.id===t}))},e.prototype.getCategoryLegendSizeCfg=function(t,e,n){void 0===e&&(e=.25),void 0===n&&(n=.25);var i=this.view.viewBBox,r=i.width,o=i.height;return"vertical"===t?{maxWidth:r*e,maxHeight:o}:{maxWidth:r,maxHeight:o*n}},e}(vn),hs=function(t){function e(e){var n=t.call(this,e)||this;return n.onChangeFn=h.noop,n.resetMeasure=function(){n.clear()},n.onValueChange=function(t){var e=Object(u.__read)(t,2),i=e[0],r=e[1];n.start=i,n.end=r,n.changeViewData(i,r)},n.container=n.view.getLayer(s.FORE).addGroup(),n.onChangeFn=Object(h.throttle)(n.onValueChange,20,{leading:!0}),n.width=0,n.view.on(f.BEFORE_CHANGE_DATA,n.resetMeasure),n.view.on(f.BEFORE_CHANGE_SIZE,n.resetMeasure),n}return Object(u.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(f.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(f.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),e=t.start,n=t.end;Object(h.isNil)(this.start)&&(this.start=e,this.end=n);var i=this.view.getOptions().data;this.option&&!Object(h.isEmpty)(i)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout((function(){t.view.destroyed||t.changeViewData(t.start,t.end)}),0)),this.slider){var e=this.view.coordinateBBox.width,n=this.slider.component.get("padding"),i=Object(u.__read)(n,4),r=i[0],o=(i[1],i[2],i[3]),a=this.slider.component.getLayoutBBox(),s=new dt(a.x,a.y,Math.min(a.width,e),a.height).expand(n),c=this.getMinMaxText(this.start,this.end),h=c.minText,f=c.maxText,p=Object(u.__read)(ss(this.view.viewBBox,s,l.BOTTOM),2),d=(p[0],p[1]),g=Object(u.__read)(ss(this.view.coordinateBBox,s,l.BOTTOM),2),y=g[0];g[1];this.slider.component.update(Object(u.__assign)(Object(u.__assign)({},this.getSliderCfg()),{x:y+o,y:d+r,width:this.width,start:this.start,end:this.end,minText:h,maxText:f})),this.view.viewBBox=this.view.viewBBox.cut(s,l.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),e=new Z.Slider(Object(u.__assign)({container:this.container},t));return e.init(),{component:e,layer:s.FORE,direction:l.BOTTOM,type:c.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var e=this.getMinMaxText(this.start,this.end),n=e.minText,i=e.maxText;t=Object(u.__assign)(Object(u.__assign)({},t),{width:this.width,start:this.start,end:this.end,minText:n,maxText:i})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if(Object(h.isObject)(this.option)){var e=Object(u.__assign)({data:this.getData()},Object(h.get)(this.option,"trendCfg",{}));t=Object(h.deepMix)({},t,this.getThemeOptions(),this.option),t=Object(u.__assign)(Object(u.__assign)({},t),{trendCfg:e})}return t.start=Object(h.clamp)(Math.min(Object(h.isNil)(t.start)?0:t.start,Object(h.isNil)(t.end)?1:t.end),0,1),t.end=Object(h.clamp)(Math.max(Object(h.isNil)(t.start)?0:t.start,Object(h.isNil)(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,e=Object(u.__read)(this.view.getYScales(),1)[0],n=this.view.getGroupScales();if(n.length){var i=n[0],r=i.field,o=i.ticks;return t.reduce((function(t,n){return n[r]===o[0]&&t.push(n[e.field]),t}),[])}return t.map((function(t){return t[e.field]||0}))},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return Object(h.get)(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,e){var n=this.view.getOptions().data,i=this.view.getXScale(),r=Object(h.valuesOfKey)(n,i.field);i.isLinear&&(r=r.sort());var o=r,a=Object(h.size)(n);if(!i||!a)return{};var s=Object(h.size)(o),l=Math.round(t*(s-1)),c=Math.round(e*(s-1)),u=Object(h.get)(o,[l]),f=Object(h.get)(o,[c]),p=this.getSliderCfg().formatter;return p&&(u=p(u,n[l],l),f=p(f,n[c],c)),{minText:u,maxText:f}},e.prototype.changeViewData=function(t,e){var n=this.view.getOptions().data,i=this.view.getXScale(),r=Object(h.size)(n);if(i&&r){var o=Object(h.valuesOfKey)(n,i.field),a=this.view.getXScale().isLinear?o.sort((function(t,e){return Number(t)-Number(e)})):o,s=a,l=Object(h.size)(s),c=Math.round(t*(l-1)),u=Math.round(e*(l-1));this.view.filter(i.field,(function(t,e){var n=s.indexOf(t);return!(n>-1)||ht(n,c,u)})),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(vn),fs=function(t){function e(e){var n=t.call(this,e)||this;return n.onChangeFn=h.noop,n.resetMeasure=function(){n.clear()},n.onValueChange=function(t){var e=t.ratio,i=n.getValidScrollbarCfg().animate;n.ratio=Object(h.clamp)(e,0,1);var r=n.view.getOptions().animate;i||n.view.animate(!1),n.changeViewData(n.getScrollRange(),!0),n.view.animate(r)},n.container=n.view.getLayer(s.FORE).addGroup(),n.onChangeFn=Object(h.throttle)(n.onValueChange,20,{leading:!0}),n.trackLen=0,n.thumbLen=0,n.ratio=0,n.view.on(f.BEFORE_CHANGE_DATA,n.resetMeasure),n.view.on(f.BEFORE_CHANGE_SIZE,n.resetMeasure),n}return Object(u.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(f.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(f.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout((function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)}))),this.scrollbar){var e=this.view.coordinateBBox.width,n=this.scrollbar.component.get("padding"),i=this.scrollbar.component.getLayoutBBox(),r=new dt(i.x,i.y,Math.min(i.width,e),i.height).expand(n),o=this.getScrollbarComponentCfg(),a=void 0,s=void 0;if(o.isHorizontal){var c=Object(u.__read)(ss(this.view.viewBBox,r,l.BOTTOM),2),h=(c[0],c[1]),f=Object(u.__read)(ss(this.view.coordinateBBox,r,l.BOTTOM),2),p=f[0];f[1];a=p,s=h}else{var d=Object(u.__read)(ss(this.view.viewBBox,r,l.RIGHT),2),g=(d[0],h=d[1],Object(u.__read)(ss(this.view.viewBBox,r,l.RIGHT),2));p=g[0],g[1];a=p,s=h}a+=n[3],s+=n[0],this.trackLen?this.scrollbar.component.update(Object(u.__assign)(Object(u.__assign)({},o),{x:a,y:s,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(Object(u.__assign)(Object(u.__assign)({},o),{x:a,y:s})),this.view.viewBBox=this.view.viewBBox.cut(r,o.isHorizontal?l.BOTTOM:l.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return Object(h.get)(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var e=Object(h.get)(this.view.getTheme(),["components","scrollbar"]),n=t||{},i=n.thumbHighlightColor,r=Object(u.__rest)(n,["thumbHighlightColor"]);return{default:Object(h.deepMix)({},Object(h.get)(e,["default","style"],{}),r),hover:Object(h.deepMix)({},Object(h.get)(e,["hover","style"],{}),{thumbColor:i})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),e=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var n=this.getScrollbarComponentCfg(),i=n.trackLen,r=n.thumbLen;this.trackLen=i,this.thumbLen=r,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=e},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*Object(h.clamp)(this.ratio,0,1));return[t,Math.min(t+this.step-1,this.cnt-1)]},e.prototype.changeViewData=function(t,e){var n=this,i=Object(u.__read)(t,2),r=i[0],o=i[1],a="vertical"!==this.getValidScrollbarCfg().type,s=Object(h.valuesOfKey)(this.data,this.xScaleCfg.field),l=this.view.getXScale().isLinear?s.sort((function(t,e){return Number(t)-Number(e)})):s,c=a?l:l.reverse();this.yScalesCfg.forEach((function(t){n.view.scale(t.field,{formatter:t.formatter,type:t.type,min:t.min,max:t.max,tickMethod:t.tickMethod})})),this.view.filter(this.xScaleCfg.field,(function(t){var e=c.indexOf(t);return!(e>-1)||ht(e,r,o)})),this.view.render(!0)},e.prototype.createScrollbar=function(){var t="vertical"!==this.getValidScrollbarCfg().type,e=new Z.Scrollbar(Object(u.__assign)(Object(u.__assign)({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return e.init(),{component:e,layer:s.FORE,direction:t?l.BOTTOM:l.RIGHT,type:c.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),e=this.trackLen?Object(u.__assign)(Object(u.__assign)({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):Object(u.__assign)({},t);return this.scrollbar.component.update(e),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,e=this.getValidScrollbarCfg(),n=e.type,i=e.categorySize,r="vertical"!==n;return Math.floor((r?t.width:t.height)/i)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),e=this.getScrollbarData(),n=Object(h.valuesOfKey)(e,t.field);return Object(h.size)(n)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,e=t.coordinateBBox,n=t.viewBBox,i=this.getValidScrollbarCfg(),r=i.type,o=i.padding,a=i.width,s=i.height,l=i.style,c="vertical"!==r,f=Object(u.__read)(o,4),p=f[0],d=f[1],g=f[2],y=f[3],v=c?{x:e.minX+y,y:n.maxY-s-g}:{x:n.maxX-a-d,y:e.minY+p},m=this.getStep(),x=this.getCnt(),b=c?e.width-y-d:e.height-p-g,_=Math.max(b*Object(h.clamp)(m/x,0,1),20);return Object(u.__assign)(Object(u.__assign)({},this.getThemeOptions()),{x:v.x,y:v.y,size:c?s:a,isHorizontal:c,trackLen:b,thumbLen:_,thumbOffset:0,theme:this.getScrollbarTheme(l)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:32,width:8,height:8,padding:[0,0,0,0],animate:!0,style:{}};return Object(h.isObject)(this.option)&&(t=Object(u.__assign)(Object(u.__assign)({},t),this.option)),Object(h.isObject)(this.option)&&this.option.padding||(t.padding=(t.type,[0,0,0,0])),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),e=this.getValidScrollbarCfg(),n=this.view.getOptions().data||[];return t.isReflect("y")&&"vertical"===e.type&&(n=Object(u.__spreadArray)([],Object(u.__read)(n),!1).reverse()),n},e}(vn),ps={fill:"#CCD6EC",opacity:.3};function ds(t,e,n){var i,r,o,a,s,l,c=function(t,e,n){var i,r,o=en(t,e,n);try{for(var a=Object(u.__values)(t.views),s=a.next();!s.done;s=a.next()){var l=s.value;o=o.concat(en(l,e,n))}}catch(t){i={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}(t,e,n);if(c.length){c=Object(h.flatten)(c);try{for(var f=Object(u.__values)(c),p=f.next();!p.done;p=f.next()){var d=p.value;try{for(var g=(o=void 0,Object(u.__values)(d)),y=g.next();!y.done;y=g.next()){var v=y.value,m=v.mappingData,x=m.x,b=m.y;v.x=Object(h.isArray)(x)?x[x.length-1]:x,v.y=Object(h.isArray)(b)?b[b.length-1]:b}}catch(t){o={error:t}}finally{try{y&&!y.done&&(a=g.return)&&a.call(g)}finally{if(o)throw o.error}}}}catch(t){i={error:t}}finally{try{p&&!p.done&&(r=f.return)&&r.call(f)}finally{if(i)throw i.error}}if(!1===n.shared&&c.length>1){var _=c[0],O=Math.abs(e.y-_[0].y);try{for(var w=Object(u.__values)(c),j=w.next();!j.done;j=w.next()){var S=j.value,M=Math.abs(e.y-S[0].y);M<=O&&(_=S,O=M)}}catch(t){s={error:t}}finally{try{j&&!j.done&&(l=w.return)&&l.call(w)}finally{if(s)throw s.error}}c=[_]}return Object(h.uniq)(Object(h.flatten)(c))}return[]}var gs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.show=function(t){var e=this.context.view,n=this.context.event,i=e.getController("tooltip").getTooltipCfg(),r=ds(e,{x:n.x,y:n.y},i);if(!Object(h.isEqual)(r,this.items)&&(this.items=r,r.length)){var o=e.getXScale().field,a=r[0].data[o],s=[],l=e.geometries;if(Object(h.each)(l,(function(t){if("interval"===t.type||"schema"===t.type){var e=t.getElementsBy((function(t){return t.getData()[o]===a}));s=s.concat(e)}})),s.length){var c=e.getCoordinate(),f=s[0].shape.getCanvasBBox(),p=s[0].shape.getCanvasBBox(),d=f;Object(h.each)(s,(function(t){var e=t.shape.getCanvasBBox();c.isTransposed?(e.minYp.maxY&&(p=e)):(e.minXp.maxX&&(p=e)),d.x=Math.min(e.minX,d.minX),d.y=Math.min(e.minY,d.minY),d.width=Math.max(e.maxX,d.maxX)-d.x,d.height=Math.max(e.maxY,d.maxY)-d.y}));var g=e.backgroundGroup,y=e.coordinateBBox,v=void 0;if(c.isRect){var m=e.getXScale(),x=t||{},b=x.appendRatio,_=x.appendWidth;Object(h.isNil)(_)&&(b=Object(h.isNil)(b)?m.isLinear?0:.25:b,_=c.isTransposed?b*p.height:b*f.width);var O=void 0,w=void 0,j=void 0,S=void 0;c.isTransposed?(O=y.minX,w=Math.min(p.minY,f.minY)-_,j=y.width,S=d.height+2*_):(O=Math.min(f.minX,p.minX)-_,w=y.minY,j=d.width+2*_,S=y.height),v=[["M",O,w],["L",O+j,w],["L",O+j,w+S],["L",O,w+S],["Z"]]}else{var M=Object(h.head)(s),A=Object(h.last)(s),C=lt(M.getModel(),c).startAngle,E=lt(A.getModel(),c).endAngle,I=c.getCenter(),P=c.getRadius(),F=c.innerRadius*P;v=at(I.x,I.y,P,C,E,F)}if(this.regionPath)this.regionPath.attr("path",v),this.regionPath.show();else{var T=Object(h.get)(t,"style",ps);this.regionPath=g.addShape({type:"path",name:"active-region",capture:!1,attrs:Object(u.__assign)(Object(u.__assign)({},T),{path:v})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),t.prototype.destroy.call(this)},e}(Bt),ys=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return Object(u.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=t.event,n=t.view;if(!n.isTooltipLocked()){var i=this.timeStamp,r=+new Date;if(r-i>Object(h.get)(t.view.getOptions(),"tooltip.showDelay",16)){var o=this.location,a={x:e.x,y:e.y};o&&Object(h.isEqual)(o,a)||this.showTooltip(n,a),this.timeStamp=r,this.location=a}}},e.prototype.hide=function(){var t=this.context.view,e=t.getController("tooltip"),n=this.context.event,i=n.clientX,r=n.clientY;e.isCursorEntered({x:i,y:r})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,e){t.showTooltip(e)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(Bt),vs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.showTooltip=function(t,e){var n=pe(t);Object(h.each)(n,(function(n){var i=de(t,n,e);n.showTooltip(i)}))},e.prototype.hideTooltip=function(t){var e=pe(t);Object(h.each)(e,(function(t){t.hideTooltip()}))},e}(ys),ms=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return Object(u.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context.event,e=this.timeStamp,n=+new Date;if(n-e>16){var i=this.location,r={x:t.x,y:t.y};i&&Object(h.isEqual)(i,r)||this.showTooltip(r),this.timeStamp=n,this.location=r}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context.event.target;if(e&&e.get("tip")){this.tooltip||this.renderTooltip();var n=e.get("tip");this.tooltip.update(Object(u.__assign)({title:n},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view,n=e.canvas,i={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},r=e.getTheme(),o=Object(h.get)(r,["components","tooltip","domStyles"],{}),a=new nt({parent:n.get("el").parentNode,region:i,visible:!1,crosshairs:null,domStyles:Object(u.__assign)({},Object(h.deepMix)({},o,(t={},t[Z.TOOLTIP_CSS_CONST.CONTAINER_CLASS]={"max-width":"50%"},t[Z.TOOLTIP_CSS_CONST.TITLE_CLASS]={"word-break":"break-all"},t)))});a.init(),a.setCapture(!1),this.tooltip=a},e}(Bt),xs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e}return Object(u.__extends)(e,t),e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,e){t.setState(this.stateName,e)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var e=this,n=ae(t,this.stateName);Object(h.each)(n,(function(t){e.setElementState(t,!1)}))},e}(Bt);function bs(t){return Object(h.get)(t.get("delegateObject"),"item")}var _s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreListItemStates=["unchecked"],e}return Object(u.__extends)(e,t),e.prototype.isItemIgnore=function(t,e){return!!this.ignoreListItemStates.filter((function(n){return e.hasState(t,n)})).length},e.prototype.setStateByComponent=function(t,e,n){var i=this.context.view,r=t.get("field"),o=oe(i);this.setElementsStateByItem(o,r,e,n)},e.prototype.setStateByElement=function(t,e){this.setElementState(t,e)},e.prototype.isMathItem=function(t,e,n){var i=ye(this.context.view,e),r=se(t,e);return!Object(h.isNil)(r)&&n.name===i.getText(r)},e.prototype.setElementsStateByItem=function(t,e,n,i){var r=this;Object(h.each)(t,(function(t){r.isMathItem(t,e,n)&&t.setState(r.stateName,i)}))},e.prototype.setStateEnable=function(t){var e=Kt(this.context);if(e)Jt(this.context)&&this.setStateByElement(e,t);else{var n=Qt(this.context);if(te(n)){var i=n.item,r=n.component;if(i&&r&&!this.isItemIgnore(i,r)){var o=this.context.event.gEvent;if(o&&o.fromShape&&o.toShape&&bs(o.fromShape)===bs(o.toShape))return;this.setStateByComponent(r,i,t)}}}},e.prototype.toggle=function(){var t=Kt(this.context);if(t){var e=t.hasState(this.stateName);this.setElementState(t,!e)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(xs),Os=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return Object(u.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(_s),ws=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cache={},e}return Object(u.__extends)(e,t),e.prototype.getColorScale=function(t,e){var n=e.geometry.getAttribute("color");return n?t.getScaleByField(n.getFields()[0]):null},e.prototype.getLinkPath=function(t,e){var n=this.context.view.getCoordinate().isTransposed,i=t.shape.getCanvasBBox(),r=e.shape.getCanvasBBox();return n?[["M",i.minX,i.minY],["L",r.minX,r.maxY],["L",r.maxX,r.maxY],["L",i.maxX,i.minY],["Z"]]:[["M",i.maxX,i.minY],["L",r.minX,r.minY],["L",r.minX,r.maxY],["L",i.maxX,i.maxY],["Z"]]},e.prototype.addLinkShape=function(t,e,n,i){var r={opacity:.4,fill:e.shape.attr("fill")};t.addShape({type:"path",attrs:Object(u.__assign)(Object(u.__assign)({},Object(h.deepMix)({},r,Object(h.isFunction)(i)?i(r,e):i)),{path:this.getLinkPath(e,n)})})},e.prototype.linkByElement=function(t,e){var n=this,i=this.context.view,r=this.getColorScale(i,t);if(r){var o=se(t,r.field);if(!this.cache[o]){var a=function(t,e,n){return oe(t).filter((function(t){return se(t,e)===n}))}(i,r.field,o),s=this.linkGroup.addGroup();this.cache[o]=s;var l=a.length;Object(h.each)(a,(function(t,i){if(i=0}),e)},e}(js),Bs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return Object(u.__extends)(e,t),e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,e){Es(oe(this.context.view),(function(e){return t===e}),e)},e.prototype.clear=function(){Cs(this.context.view)},e}(Ms),Ns=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return Object(u.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(js),Rs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return Object(u.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(_s),Vs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return Object(u.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(Ms),zs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e.ignoreItemStates=[],e}return Object(u.__extends)(e,t),e.prototype.getTriggerListInfo=function(){var t=Qt(this.context),e=null;return te(t)&&(e={item:t.item,list:t.component}),e},e.prototype.getAllowComponents=function(){var t=this,e=ue(this.context.view),n=[];return Object(h.each)(e,(function(e){e.isList()&&t.allowSetStateByElement(e)&&n.push(e)})),n},e.prototype.hasState=function(t,e){return t.hasState(e,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,e=this.getAllowComponents();Object(h.each)(e,(function(e){e.clearItemsState(t.stateName)}))},e.prototype.allowSetStateByElement=function(t){var e=t.get("field");if(!e)return!1;if(this.cfg&&this.cfg.componentNames){var n=t.get("name");if(-1===this.cfg.componentNames.indexOf(n))return!1}var i=ye(this.context.view,e);return i&&i.isCategory},e.prototype.allowSetStateByItem=function(t,e){var n=this.ignoreItemStates;return!n.length||0===n.filter((function(n){return e.hasState(t,n)})).length},e.prototype.setStateByElement=function(t,e,n){var i=t.get("field"),r=ye(this.context.view,i),o=se(e,i),a=r.getText(o);this.setItemsState(t,a,n)},e.prototype.setStateEnable=function(t){var e=this,n=Kt(this.context);if(n){var i=this.getAllowComponents();Object(h.each)(i,(function(i){e.setStateByElement(i,n,t)}))}else{var r=Qt(this.context);if(te(r)){var o=r.item,a=r.component;this.allowSetStateByElement(a)&&this.allowSetStateByItem(o,a)&&this.setItemState(a,o,t)}}},e.prototype.setItemsState=function(t,e,n){var i=this,r=t.getItems();Object(h.each)(r,(function(r){r.name===e&&i.setItemState(t,r,n)}))},e.prototype.setItemState=function(t,e,n){t.setItemState(e,this.stateName,n)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,n=t.item,i=this.hasState(e,n);this.setItemState(e,n,!i)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(Bt),Gs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return Object(u.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(zs);var Ys=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e.ignoreItemStates=["unchecked"],e}return Object(u.__extends)(e,t),e.prototype.setItemsState=function(t,e,n){this.setHighlightBy(t,(function(t){return t.name===e}),n)},e.prototype.setItemState=function(t,e,n){t.getItems();this.setHighlightBy(t,(function(t){return t===e}),n)},e.prototype.setHighlightBy=function(t,e,n){var i=t.getItems();if(n)Object(h.each)(i,(function(n){e(n)?(t.hasState(n,"inactive")&&t.setItemState(n,"inactive",!1),t.setItemState(n,"active",!0)):t.hasState(n,"active")||t.setItemState(n,"inactive",!0)}));else{var r=t.getItemsByState("active"),o=!0;Object(h.each)(r,(function(t){if(!e(t))return o=!1,!1})),o?this.clear():Object(h.each)(i,(function(n){e(n)&&(t.hasState(n,"active")&&t.setItemState(n,"active",!1),t.setItemState(n,"inactive",!0))}))}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t,e,n=this.getTriggerListInfo();if(n)t=n.list,e=t.getItems(),Object(h.each)(e,(function(e){t.hasState(e,"active")&&t.setItemState(e,"active",!1),t.hasState(e,"inactive")&&t.setItemState(e,"inactive",!1)}));else{var i=this.getAllowComponents();Object(h.each)(i,(function(t){t.clearItemsState("active"),t.clearItemsState("inactive")}))}},e}(zs),Xs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return Object(u.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(zs),Ws=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="unchecked",e}return Object(u.__extends)(e,t),e.prototype.unchecked=function(){this.setState()},e}(zs),Hs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="checked",e}return Object(u.__extends)(e,t),e.prototype.setItemState=function(t,e,n){this.setCheckedBy(t,(function(t){return t===e}),n)},e.prototype.setCheckedBy=function(t,e,n){var i=t.getItems();n&&Object(h.each)(i,(function(n){e(n)?(t.hasState(n,"unchecked")&&t.setItemState(n,"unchecked",!1),t.setItemState(n,"checked",!0)):t.hasState(n,"checked")||t.setItemState(n,"unchecked",!0)}))},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,n=t.item;!Object(h.some)(e.getItems(),(function(t){return e.hasState(t,"unchecked")}))||e.hasState(n,"unchecked")?this.setItemState(e,n,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();Object(h.each)(t,(function(t){t.clearItemsState("checked"),t.clearItemsState("unchecked")}))},e}(zs),Us=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.toggle=function(){var t,e,n,i,r,o,a,s,l=this.getTriggerListInfo();if(null==l?void 0:l.item){var c=l.list,h=l.item,f=c.getItems(),p=f.filter((function(t){return!c.hasState(t,"unchecked")})),d=f.filter((function(t){return c.hasState(t,"unchecked")})),g=p[0];if(f.length===p.length)try{for(var y=Object(u.__values)(f),v=y.next();!v.done;v=y.next()){var m=v.value;c.setItemState(m,"unchecked",m.id!==h.id)}}catch(e){t={error:e}}finally{try{v&&!v.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}else if(f.length-d.length==1)if(g.id===h.id)try{for(var x=Object(u.__values)(f),b=x.next();!b.done;b=x.next()){m=b.value;c.setItemState(m,"unchecked",!1)}}catch(t){n={error:t}}finally{try{b&&!b.done&&(i=x.return)&&i.call(x)}finally{if(n)throw n.error}}else try{for(var _=Object(u.__values)(f),O=_.next();!O.done;O=_.next()){m=O.value;c.setItemState(m,"unchecked",m.id!==h.id)}}catch(t){r={error:t}}finally{try{O&&!O.done&&(o=_.return)&&o.call(_)}finally{if(r)throw r.error}}else try{for(var w=Object(u.__values)(f),j=w.next();!j.done;j=w.next()){m=j.value;c.setItemState(m,"unchecked",m.id!==h.id)}}catch(t){a={error:t}}finally{try{j&&!j.done&&(s=w.return)&&s.call(w)}finally{if(a)throw a.error}}}},e}(zs),qs="legend-radio-tip",Zs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return Object(u.__extends)(e,t),e.prototype.show=function(){var t=this.getTriggerListInfo();if(null==t?void 0:t.item){var e=t.list,n=t.item;e.setItemState(n,"showRadio",!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(null==t?void 0:t.item){var e=t.list,n=t.item;e.setItemState(n,"showRadio",!1)}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.showTip=function(){var t=this.context.event,e=this.timeStamp,n=+new Date,i=this.context.event.target;if(n-e>16&&"legend-item-radio"===i.get("name")){var r=this.location,o={x:t.x,y:t.y};this.timeStamp=n,this.location=o,r&&Object(h.isEqual)(r,o)||this.showTooltip(o)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context,n=e.event.target;if(n&&n.get("tip")){this.tooltip||this.renderTooltip();var i=e.view.getCanvas().get("el").getBoundingClientRect(),r=i.x,o=i.y;this.tooltip.update(Object(u.__assign)(Object(u.__assign)({title:n.get("tip")},t),{x:t.x+r,y:t.y+o})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=((t={})[Z.TOOLTIP_CSS_CONST.CONTAINER_CLASS]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[Z.TOOLTIP_CSS_CONST.TITLE_CLASS]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(qs)&&document.body.removeChild(document.getElementById(qs));var n=new nt({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:e,containerId:qs});n.init(),n.setCapture(!1),this.tooltip=n},e}(zs),$s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.maskShape=null,e.points=[],e.starting=!1,e.moving=!1,e.preMovePoint=null,e.shapeType="path",e}return Object(u.__extends)(e,t),e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var e="mask:".concat(t),n=this.context.view,i=this.context.event;n.emit(e,{target:this.maskShape,shape:this.maskShape,points:this.points,x:i.x,y:i.y})},e.prototype.createMask=function(){var t=this.context.view,e=this.getMaskAttrs();return t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:Object(u.__assign)({fill:"#C5D4EB",opacity:.3},e)})},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(null==t?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(this.moving&&this.maskShape){var t=this.getCurrentPoint(),e=this.preMovePoint,n=t.x-e.x,i=t.y-e.y,r=this.points;Object(h.each)(r,(function(t){t.x+=n,t.y+=i})),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var e=Object(h.deepMix)({},this.getMaskAttrs(),t);this.maskShape.attr(e)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,t.prototype.destroy.call(this)},e}(Bt),Ks=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="circle",e}return Object(u.__extends)(e,t),e.prototype.getMaskAttrs=function(){var t=this.points,e=Object(h.last)(this.points),n=0,i=0,r=0;if(t.length){var o=t[0];n=he(o,e)/2,i=(e.x+o.x)/2,r=(e.y+o.y)/2}return{x:i,y:r,r:n}},e}($s),Qs=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="rect",e}return Object(u.__extends)(e,t),e.prototype.getRegion=function(){var t=this.points;return{start:Object(h.head)(t),end:Object(h.last)(t)}},e.prototype.getMaskAttrs=function(){var t=this.getRegion(),e=t.start,n=t.end;return{x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),width:Math.abs(n.x-e.x),height:Math.abs(n.y-e.y)}},e}($s);function Js(t){t.x=Object(h.clamp)(t.x,0,1),t.y=Object(h.clamp)(t.y,0,1)}var tl,el=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dim="x",e.inPlot=!0,e}return Object(u.__extends)(e,t),e.prototype.getRegion=function(){var t=null,e=null,n=this.points,i=this.dim,r=this.context.view.getCoordinate(),o=r.invert(Object(h.head)(n)),a=r.invert(Object(h.last)(n));return this.inPlot&&(Js(o),Js(a)),"x"===i?(t=r.convert({x:o.x,y:0}),e=r.convert({x:a.x,y:1})):(t=r.convert({x:0,y:o.y}),e=r.convert({x:1,y:a.y})),{start:t,end:e}},e}(Qs),nl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getMaskPath=function(){var t=this.points,e=[];return t.length&&(Object(h.each)(t,(function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e.push(["L",t[0].x,t[0].y])),e},e.prototype.getMaskAttrs=function(){return{path:this.getMaskPath()}},e.prototype.addPoint=function(){this.resize()},e}($s),il=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.getMaskPath=function(){return function(t,e){if(t.length<=2)return Ht(t,!1);var n=t[0],i=[];Object(h.each)(t,(function(t){i.push(t.x),i.push(t.y)}));var r=Wt(i,e,null);return r.unshift(["M",n.x,n.y]),r}(this.points,!0)},e}(nl),rl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.setCursor=function(t){this.context.view.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e.prototype.zoomIn=function(){this.setCursor("zoom-in")},e.prototype.zoomOut=function(){this.setCursor("zoom-out")},e}(Bt),ol=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.filterView=function(t,e,n){var i=this;t.getScaleByField(e)&&t.filter(e,n),t.views&&t.views.length&&Object(h.each)(t.views,(function(t){i.filterView(t,e,n)}))},e.prototype.filter=function(){var t=Qt(this.context);if(t){var e=this.context.view,n=t.component,i=n.get("field");if(te(t)){if(i){var r=n.getItemsByState("unchecked"),o=ye(e,i),a=r.map((function(t){return t.name}));a.length?this.filterView(e,i,(function(t){var e=o.getText(t);return!a.includes(e)})):this.filterView(e,i,null),e.render(!0)}}else if(ee(t)){var s=n.getValue(),l=Object(u.__read)(s,2),c=l[0],h=l[1];this.filterView(e,i,(function(t){return t>=c&&t<=h})),e.render(!0)}}},e}(Bt);function al(t,e,n,i){var r=Math.min(n[e],i[e]),o=Math.max(n[e],i[e]),a=Object(u.__read)(t.range,2),s=a[0],l=a[1];if(rl&&(o=l),r===l&&o===l)return null;var c=t.invert(r),h=t.invert(o);if(t.isCategory){var f=t.values.indexOf(c),p=t.values.indexOf(h),d=t.values.slice(f,p+1);return function(t){return d.includes(t)}}return function(t){return t>=c&&t<=h}}!function(t){t.FILTER="brush-filter-processing",t.RESET="brush-filter-reset",t.BEFORE_FILTER="brush-filter:beforefilter",t.AFTER_FILTER="brush-filter:afterfilter",t.BEFORE_RESET="brush-filter:beforereset",t.AFTER_RESET="brush-filter:afterreset"}(tl||(tl={}));var sl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=["x","y"],e.startPoint=null,e.isStarted=!1,e}return Object(u.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,e;if(ne(this.context)){var n=this.context.event.target.getCanvasBBox();t={x:n.x,y:n.y},e={x:n.maxX,y:n.maxY}}else{if(!this.isStarted)return;t=this.startPoint,e=this.context.getCurrentPoint()}if(!(Math.abs(t.x-e.x)<5||Math.abs(t.x-e.y)<5)){var i=this.context,r=i.view,o={view:r,event:i.event,dims:this.dims};r.emit(tl.BEFORE_FILTER,sn.fromData(r,tl.BEFORE_FILTER,o));var a=r.getCoordinate(),s=a.invert(e),l=a.invert(t);if(this.hasDim("x")){var c=r.getXScale(),u=al(c,"x",s,l);this.filterView(r,c.field,u)}if(this.hasDim("y")){var h=r.getYScales()[0];u=al(h,"y",s,l);this.filterView(r,h.field,u)}this.reRender(r,{source:tl.FILTER}),r.emit(tl.AFTER_FILTER,sn.fromData(r,tl.AFTER_FILTER,o))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(tl.BEFORE_RESET,sn.fromData(t,tl.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var e=t.getXScale();this.filterView(t,e.field,null)}if(this.hasDim("y")){var n=t.getYScales()[0];this.filterView(t,n.field,null)}this.reRender(t,{source:tl.RESET}),t.emit(tl.AFTER_RESET,sn.fromData(t,tl.AFTER_RESET,{}))},e.prototype.filterView=function(t,e,n){t.filter(e,n)},e.prototype.reRender=function(t,e){t.render(!0,e)},e}(Bt),ll=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.filterView=function(t,e,n){var i=pe(t);Object(h.each)(i,(function(t){t.filter(e,n)}))},e.prototype.reRender=function(t){var e=pe(t);Object(h.each)(e,(function(t){t.render(!0)}))},e}(sl),cl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.filter=function(){var t=Qt(this.context),e=this.context.view,n=oe(e);if(ne(this.context)){var i=ie(this.context,10);i&&Object(h.each)(n,(function(t){i.includes(t)?t.show():t.hide()}))}else if(t){var r=t.component,o=r.get("field");if(te(t)){if(o){var a=r.getItemsByState("unchecked"),s=ye(e,o),l=a.map((function(t){return t.name}));Object(h.each)(n,(function(t){var e=se(t,o),n=s.getText(e);l.indexOf(n)>=0?t.hide():t.show()}))}}else if(ee(t)){var c=r.getValue(),f=Object(u.__read)(c,2),p=f[0],d=f[1];Object(h.each)(n,(function(t){var e=se(t,o);e>=p&&e<=d?t.show():t.hide()}))}}},e.prototype.clear=function(){var t=oe(this.context.view);Object(h.each)(t,(function(t){t.show()}))},e.prototype.reset=function(){this.clear()},e}(Bt),ul=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.byRecord=!1,e}return Object(u.__extends)(e,t),e.prototype.filter=function(){ne(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,e=ie(this.context,10);if(e){var n=t.getXScale().field,i=t.getYScales()[0].field,r=e.map((function(t){return t.getModel().data})),o=pe(t);Object(h.each)(o,(function(t){var e=oe(t);Object(h.each)(e,(function(t){var e=t.getModel().data;ge(r,e,n,i)?t.show():t.hide()}))}))}},e.prototype.filterByBBox=function(){var t=this,e=pe(this.context.view);Object(h.each)(e,(function(e){var n=re(t.context,e,10),i=oe(e);n&&Object(h.each)(i,(function(t){n.includes(t)?t.show():t.hide()}))}))},e.prototype.reset=function(){var t=pe(this.context.view);Object(h.each)(t,(function(t){var e=oe(t);Object(h.each)(e,(function(t){t.show()}))}))},e}(Bt),hl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.buttonGroup=null,e.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},e}return Object(u.__extends)(e,t),e.prototype.getButtonCfg=function(){return Object(h.deepMix)(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),e=this.context.view.foregroundGroup.addGroup({name:t.name}),n=e.addShape({type:"text",name:"button-text",attrs:Object(u.__assign)({text:t.text},t.textStyle)}).getBBox(),i=nn(t.padding),r=e.addShape({type:"rect",name:"button-rect",attrs:Object(u.__assign)({x:n.x-i[3],y:n.y-i[0],width:n.width+i[1]+i[3],height:n.height+i[0]+i[2]},t.style)});r.toBack(),e.on("mouseenter",(function(){r.attr(t.activeStyle)})),e.on("mouseleave",(function(){r.attr(t.style)})),this.buttonGroup=e},e.prototype.resetPosition=function(){var t=this.context.view.getCoordinate().convert({x:1,y:1}),e=this.buttonGroup,n=e.getBBox(),i=G.ext.transform(null,[["t",t.x-n.width-10,t.y+n.height+5]]);e.setMatrix(i)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var e=this.buttonGroup;e&&e.remove(),t.prototype.destroy.call(this)},e}(Bt),fl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.dragStart=!1,e}return Object(u.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(this.startPoint){var t=this.context.getCurrentPoint(),e=this.context.view,n=this.context.event;this.dragStart?e.emit("drag",{target:n.target,x:n.x,y:n.y}):he(t,this.startPoint)>4&&(e.emit("dragstart",{target:n.target,x:n.x,y:n.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,e=this.context.event;t.emit("dragend",{target:e.target,x:e.x,y:e.y})}this.starting=!1,this.dragStart=!1},e}(Bt),pl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.isMoving=!1,e.startPoint=null,e.startMatrix=null,e}return Object(u.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(this.starting){var t=this.startPoint,e=this.context.getCurrentPoint();if(he(t,e)>5&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var n=this.context.view,i=G.ext.transform(this.startMatrix,[["t",e.x-t.x,e.y-t.y]]);n.backgroundGroup.setMatrix(i),n.foregroundGroup.setMatrix(i),n.middleGroup.setMatrix(i)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},e}(Bt),dl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=["x","y"],e.cfgFields=["dims"],e.cacheScaleDefs={},e}return Object(u.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var e=this.context.view;return"x"===t?e.getXScale():e.getYScales()[0]},e.prototype.resetDim=function(t){var e=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var n=this.getScale(t);e.scale(n.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim("x"),this.resetDim("y"),this.context.view.render(!0)},e}(Bt),gl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.startPoint=null,e.starting=!1,e.startCache={},e}return Object(u.__extends)(e,t),e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var e=this.dims;Object(h.each)(e,(function(e){var n=t.getScale(e),i=n.min,r=n.max,o=n.values;t.startCache[e]={min:i,max:r,values:o}}))},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(this.starting){var e=this.startPoint,n=this.context.view.getCoordinate(),i=this.context.getCurrentPoint(),r=n.invert(e),o=n.invert(i),a=o.x-r.x,s=o.y-r.y,l=this.context.view,c=this.dims;Object(h.each)(c,(function(e){t.translateDim(e,{x:-1*a,y:-1*s})})),l.render(!0)}},e.prototype.translateDim=function(t,e){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.translateLinear(t,n,e)}},e.prototype.translateLinear=function(t,e,n){var i=this.context.view,r=this.startCache[t],o=r.min,a=r.max,s=a-o,l=n[t]*s;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:o,max:a}),i.scale(e.field,{nice:!1,min:o+l,max:a+l})},e.prototype.reset=function(){t.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(dl),yl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.zoomRatio=.05,e}return Object(u.__extends)(e,t),e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var e=this,n=this.dims;Object(h.each)(n,(function(n){e.zoomDim(n,t)})),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,e){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.zoomLinear(t,n,e)}},e.prototype.zoomLinear=function(t,e,n){var i=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:e.min,max:e.max});var r=this.cacheScaleDefs[t],o=r.max-r.min,a=e.min,s=e.max,l=n*o,c=a-l,u=s+l,h=(u-c)/o;u>c&&h<100&&h>.01&&i.scale(e.field,{nice:!1,min:a-l,max:s+l})},e}(dl);var vl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.scroll=function(t){var e=this.context,n=e.view,i=e.event;if(n.getOptions().scrollbar){var r=(null==t?void 0:t.wheelDelta)||1,o=n.getController("scrollbar"),a=n.getXScale(),s=n.getOptions().data,l=Object(h.size)(Object(h.valuesOfKey)(s,a.field)),c=Object(h.size)(a.values),u=o.getValue(),f=Math.floor((l-c)*u)+(function(t){return t.gEvent.originalEvent.deltaY>0}(i)?r:-r),p=r/(l-c)/1e4,d=Object(h.clamp)(f/(l-c)+p,0,1);o.setValue(d)}},e}(Bt),ml=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(u.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=Qt(t).axis.cfg.title,n=e.description,i=e.text,r=e.descriptionTooltipStyle,o=t.event,a=o.x,s=o.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:i||"",customContent:function(){return'\n
\n
\n 字段说明:').concat(n,"\n
\n
\n ")},x:a,y:s}),this.tooltip.show()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view.canvas,n={start:{x:0,y:0},end:{x:e.get("width"),y:e.get("height")}},i=new nt({parent:e.get("el").parentNode,region:n,visible:!1,containerId:"aixs-description-tooltip",domStyles:Object(u.__assign)({},Object(h.deepMix)({},(t={},t[Z.TOOLTIP_CSS_CONST.CONTAINER_CLASS]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[Z.TOOLTIP_CSS_CONST.TITLE_CLASS]={"word-break":"break-all","margin-bottom":"3px"},t)))});i.init(),i.setCapture(!1),this.tooltip=i},e}(Bt);function xl(t){return t.isInPlot()}function bl(t){return t.gEvent.preventDefault(),t.gEvent.originalEvent.deltaY>0}He("dark",Ie(Ti)),O("canvas",r),O("svg",a),dn("Polygon",Jo),dn("Interval",qo),dn("Schema",ta),dn("Path",Lo),dn("Point",Qo),dn("Line",Zo),dn("Area",No),dn("Edge",Ro),dn("Heatmap",Vo),dn("Violin",ea),Pn("base",Jn),Pn("interval",ua),Pn("pie",pa),Pn("polar",fa),Tn("overlap",(function(t,e,n,i){var r=new ga;Object(h.each)(e,(function(t){for(var e=t.find((function(t){return"text"===t.get("type")})),n=e.attr(),i=n.x,o=n.y,a=!1,s=0;s<=8;s++){var l=ya(e,i,o,s);if(r.hasGap(l)){r.fillGap(l),a=!0;break}}a||t.remove(!0)})),r.destroy()})),Tn("distribute",(function(t,e,n,i){if(t.length&&e.length){var r=t[0]?t[0].offset:0,o=e[0].get("coordinate"),a=o.getRadius(),s=o.getCenter();if(r>0){var l=2*(a+r)+28,c={start:o.start,end:o.end},f=[[],[]];t.forEach((function(t){t&&("right"===t.textAlign?f[0].push(t):f[1].push(t))})),f.forEach((function(t,n){var i=l/14;t.length>i&&(t.sort((function(t,e){return e["..percent"]-t["..percent"]})),t.splice(i,t.length-i)),t.sort((function(t,e){return t.y-e.y})),function(t,e,n,i,r,o){var a,s,l,c=!0,f=i.start,p=i.end,d=Math.min(f.y,p.y),g=Math.abs(f.y-p.y),y=0,v=Number.MIN_VALUE,m=e.map((function(t){return t.y>y&&(y=t.y),t.yg&&(g=y-d);c;)for(m.forEach((function(t){var e=(Math.min.apply(v,t.targets)+Math.max.apply(v,t.targets))/2;t.pos=Math.min(Math.max(v,e-t.size/2),g-t.size)})),c=!1,l=m.length;l--;)if(l>0){var x=m[l-1],b=m[l];x.pos+x.size>b.pos&&(x.size+=b.size,x.targets=x.targets.concat(b.targets),x.pos+x.size>g&&(x.pos=g-x.size),m.splice(l,1),c=!0)}l=0,m.forEach((function(t){var i=d+n/2;t.targets.forEach((function(){e[l].y=t.pos+i,i+=n,l++}))}));var _={};try{for(var O=Object(u.__values)(t),w=O.next();!w.done;w=O.next()){var j=w.value;_[j.get("id")]=j}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=O.return)&&s.call(O)}finally{if(a)throw a.error}}e.forEach((function(t){var e=t.r*t.r,n=Math.pow(Math.abs(t.y-r.y),2);if(er.maxX||i.maxY>r.maxY)&&t.remove(!0)}))})),Tn("limit-in-canvas",(function(t,e,n,i){Object(h.each)(e,(function(t){var e=i.minX,n=i.minY,r=i.maxX,o=i.maxY,a=t.getCanvasBBox(),s=a.minX,l=a.minY,c=a.maxX,u=a.maxY,h=a.x,f=a.y,p=a.width,d=a.height,g=h,y=f;(sr?g=r-p:c>r&&(g-=c-r),l>o?y=o-d:u>o&&(y-=u-o),g===h&&y===f||Hn(t,g-h,y-f)}))})),Tn("limit-in-plot",(function(t,e,n,i,r){if(!(e.length<=0)){var o=(null==r?void 0:r.direction)||["top","right","bottom","left"],a=(null==r?void 0:r.action)||"translate",s=(null==r?void 0:r.margin)||0,l=e[0].get("coordinate");if(l){var c=function(t,e){void 0===e&&(e=0);var n=t.start,i=t.end,r=t.getWidth(),o=t.getHeight(),a=Math.min(n.x,i.x),s=Math.min(n.y,i.y);return dt.fromRange(a-e,s-e,a+r+e,s+o+e)}(l,s),u=c.minX,f=c.minY,p=c.maxX,d=c.maxY;Object(h.each)(e,(function(t){var e=t.getCanvasBBox(),n=e.minX,i=e.minY,r=e.maxX,s=e.maxY,l=e.x,c=e.y,g=e.width,y=e.height,v=l,m=c;if(o.indexOf("left")>=0&&(n=0&&(i=0&&(n>p?v=p-g:r>p&&(v-=r-p)),o.indexOf("bottom")>=0&&(i>d?m=d-y:s>d&&(m-=s-d)),v!==l||m!==c){var x=v-l;if("translate"===a)Hn(t,x,m-c);else if("ellipsis"===a){t.findAll((function(t){return"text"===t.get("type")})).forEach((function(t){var e=Object(h.pick)(t.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),n=t.getCanvasBBox(),i=function(t,e,n){var i,r=ka("...",n);i=Object(h.isString)(t)?t:Object(h.toString)(t);var o,a,s=e,l=[];if(ka(t,n)<=e)return t;for(;o=i.substr(0,16),!((a=ka(o,n))+r>s&&a>s);)if(l.push(o),s-=a,!(i=i.substr(16)))return l.join("");for(;o=i.substr(0,1),!((a=ka(o,n))+r>s);)if(l.push(o),s-=a,!(i=i.substr(1)))return l.join("");return"".concat(l.join(""),"...")}(t.attr("text"),n.width-Math.abs(x),e);t.attr("text",i)}))}else t.hide()}}))}}})),Tn("pie-outer",(function(t,e,n,i){var r,o,a=Object(h.filter)(t,(function(t){return!Object(h.isNil)(t)})),s=e[0]&&e[0].get("coordinate");if(s){var l=s.getCenter(),c=s.getRadius(),f={};try{for(var p=Object(u.__values)(e),d=p.next();!d.done;d=p.next()){var g=d.value;f[g.get("id")]=g}}catch(t){r={error:t}}finally{try{d&&!d.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}var y=Object(h.get)(a[0],"labelHeight",14),v=Object(h.get)(a[0],"offset",0);if(!(v<=0)){var m=Object(h.groupBy)(a,(function(t){return t.xn&&(t.sort((function(t,e){return e.percent-t.percent})),Object(h.each)(t,(function(t,e){e+1>n&&(f[t.id].set("visible",!1),t.invisible=!0)}))),da(t,y,w)})),Object(h.each)(m,(function(t,e){Object(h.each)(t,(function(t){var n="right"===e,i=f[t.id].getChildByIndex(0);if(i){var r=c+v,o=t.y-l.y,a=Math.pow(r,2),u=Math.pow(o,2),p=a-u>0?a-u:0,d=Math.sqrt(p),g=Math.abs(Math.cos(t.angle)*r);t.x=n?l.x+Math.max(d,g):l.x-Math.max(d,g)}i&&(i.attr("y",t.y),i.attr("x",t.x)),function(t,e){var n=e.getCenter(),i=e.getRadius();if(t&&t.labelLine){var r=t.angle,o=t.offset,a=ot(n.x,n.y,i,r),s=t.x+Object(h.get)(t,"offsetX",0)*(Math.cos(r)>0?1:-1),l=t.y+Object(h.get)(t,"offsetY",0)*(Math.sin(r)>0?1:-1),c={x:s-4*Math.cos(r),y:l-4*Math.sin(r)},u=t.labelLine.smooth,f=[],p=c.x-n.x,d=c.y-n.y,g=Math.atan(d/p);if(p<0&&(g+=Math.PI),!1===u){Object(h.isObject)(t.labelLine)||(t.labelLine={});var y=0;(r<0&&r>-Math.PI/2||r>1.5*Math.PI)&&c.y>a.y&&(y=1),r>=0&&ra.y&&(y=1),r>=Math.PI/2&&rc.y&&(y=1),(r<-Math.PI/2||r>=Math.PI&&r<1.5*Math.PI)&&a.y>c.y&&(y=1);var v=o/2>4?4:Math.max(o/2-1,0),m=ot(n.x,n.y,i+v,r),x=ot(n.x,n.y,i+o/2,g);f.push("M ".concat(a.x," ").concat(a.y)),f.push("L ".concat(m.x," ").concat(m.y)),f.push("A ".concat(n.x," ").concat(n.y," 0 ").concat(0," ").concat(y," ").concat(x.x," ").concat(x.y)),f.push("L ".concat(c.x," ").concat(c.y))}else{m=ot(n.x,n.y,i+(o/2>4?4:Math.max(o/2-1,0)),r);var b=a.xMath.pow(Math.E,-16)&&f.push.apply(f,["C",c.x+4*b,c.y,2*m.x-a.x,2*m.y-a.y,a.x,a.y]),f.push("L ".concat(a.x," ").concat(a.y))}t.labelLine.path=f.join(" ")}}(t,s)}))}))}}})),Tn("adjust-color",(function(t,e,n){if(0!==n.length){var i=n[0].get("element").geometry.theme,r=i.labels||{},o=r.fillColorLight,a=r.fillColorDark;n.forEach((function(t,n){var r=e[n].find((function(t){return"text"===t.get("type")})),s=dt.fromObject(t.getBBox()),l=dt.fromObject(r.getCanvasBBox()),c=!s.contains(l),h=function(t){var e=F.default.toRGB(t).toUpperCase();if(Ia[e])return Ia[e];var n=Object(u.__read)(F.default.rgb2arr(e),3);return(299*n[0]+587*n[1]+114*n[2])/1e3<128}(t.attr("fill"));c?r.attr(i.overflowLabels.style):h?o&&r.attr("fill",o):a&&r.attr("fill",a)}))}})),Tn("interval-adjust-position",(function(t,e,n){var i;if(0!==n.length){var r=null===(i=n[0])||void 0===i?void 0:i.get("element"),o=null==r?void 0:r.geometry;if(o&&"interval"===o.type)Pa(o,e,n)&&n.forEach((function(t,n){var i=e[n];!function(t,e,n){var i=t.coordinate,r=dt.fromObject(n.getBBox()),o=qn(e);i.isTransposed?o.attr({x:r.minX+r.width/2,textAlign:"center"}):o.attr({y:r.minY+r.height/2,textBaseline:"middle"})}(o,i,t)}))}})),Tn("interval-hide-overlap",(function(t,e,n){var i;if(0!==n.length){var r=null===(i=n[0])||void 0===i?void 0:i.get("element"),o=null==r?void 0:r.geometry;if(o&&"interval"===o.type){var a,s=function(t){var e=[],n=Math.max(Math.floor(t.length/500),1);return Object(h.each)(t,(function(t,i){i%n==0?e.push(t):t.set("visible",!1)})),e}(e),l=Object(u.__read)(o.getXYFields(),1)[0],c=[],f=[],p=Object(h.groupBy)(s,(function(t){return t.get("data")[l]})),d=Object(h.uniq)(Object(h.map)(s,(function(t){return t.get("data")[l]})));s.forEach((function(t){t.set("visible",!0)}));var g=function(t){t&&(t.length&&f.push(t.pop()),f.push.apply(f,Object(u.__spreadArray)([],Object(u.__read)(t),!1)))};for(Object(h.size)(d)>0&&(a=d.shift(),g(p[a])),Object(h.size)(d)>0&&(a=d.pop(),g(p[a])),Object(h.each)(d.reverse(),(function(t){g(p[t])}));f.length>0;){var y=f.shift();y.get("visible")&&($n(y,c)?y.set("visible",!1):c.push(y))}}}})),Tn("point-adjust-position",(function(t,e,n,i,r){var o,a;if(0!==n.length){var s=null===(o=n[0])||void 0===o?void 0:o.get("element"),l=null==s?void 0:s.geometry;if(l&&"point"===l.type){var c=Object(u.__read)(l.getXYFields(),2),f=c[0],p=c[1],d=Object(h.groupBy)(e,(function(t){return t.get("data")[f]})),g=[],y=r&&r.offset||(null===(a=t[0])||void 0===a?void 0:a.offset)||12;Object(h.map)(Object(h.keys)(d).reverse(),(function(t){for(var e=function(t,e){var n=t.getXYFields()[1],i=[],r=e.sort((function(t,e){return t.get("data")[n]-t.get("data")[n]}));return r.length>0&&i.push(r.shift()),r.length>0&&i.push(r.pop()),i.push.apply(i,Object(u.__spreadArray)([],Object(u.__read)(r),!1)),i}(l,d[t]);e.length;){var n=e.shift(),i=qn(n);if(Fa(g,n,(function(t,e){return t.get("data")[f]===e.get("data")[f]&&t.get("data")[p]===e.get("data")[p]})))i.set("visible",!1);else{var r=!1;Ta(g,n)&&(i.attr("y",i.attr("y")+2*y),r=Ta(g,n)),r?i.set("visible",!1):g.push(n)}}}))}}})),Tn("pie-spider",(function(t,e,n,i){var r,o,a=e[0]&&e[0].get("coordinate");if(a){var s=a.getCenter(),l=a.getRadius(),c={};try{for(var f=Object(u.__values)(e),p=f.next();!p.done;p=f.next()){var d=p.value;c[d.get("id")]=d}}catch(t){r={error:t}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}var g=Object(h.get)(t[0],"labelHeight",14),y=Math.max(Object(h.get)(t[0],"offset",0),4);Object(h.each)(t,(function(t){if(t&&Object(h.get)(c,[t.id])){var e=t.x>s.x||t.x===s.x&&t.y>s.y,n=Object(h.isNil)(t.offsetX)?4:t.offsetX,i=ot(s.x,s.y,l+4,t.angle),r=y+n;t.x=s.x+(e?1:-1)*(l+r),t.y=i.y}}));var v=a.start,m=a.end,x=Object(h.groupBy)(t,(function(t){return t.xb&&(b=Math.min(e,Math.abs(v.y-m.y)))}));var _={minX:v.x,maxX:m.x,minY:s.y-b/2,maxY:s.y+b/2};Object(h.each)(x,(function(t,e){var n=b/g;t.length>n&&(t.sort((function(t,e){return e.percent-t.percent})),Object(h.each)(t,(function(t,e){e>n&&(c[t.id].set("visible",!1),t.invisible=!0)}))),da(t,g,_)}));var O=_.minY,w=_.maxY;Object(h.each)(x,(function(t,e){var n="right"===e;Object(h.each)(t,(function(t){var e=Object(h.get)(c,t&&[t.id]);if(e)if(t.yw)e.set("visible",!1);else{var i=e.getChildByIndex(0),r=i.getCanvasBBox(),o=n?r.x:r.maxX,s=r.y+r.height/2;Hn(i,t.x-o,t.y-s),t.labelLine&&function(t,e,n){var i,r=e.getCenter(),o=e.getRadius(),a={x:t.x-(n?4:-4),y:t.y},s=ot(r.x,r.y,o+4,t.angle),l={x:a.x,y:a.y},c={x:s.x,y:s.y},u=ot(r.x,r.y,o,t.angle);if(a.y!==s.y){var f=n?4:-4;l.y=a.y,t.angle<0&&t.angle>=-Math.PI/2&&(l.x=Math.max(s.x,a.x-f),a.y0&&t.angles.y?c.y=l.y:(c.y=s.y,c.x=Math.max(c.x,l.x-f))),t.angle>Math.PI/2&&(l.x=Math.min(s.x,a.x-f),a.y>s.y?c.y=l.y:(c.y=s.y,c.x=Math.min(c.x,l.x-f))),t.angle<-Math.PI/2&&(l.x=Math.min(s.x,a.x-f),a.y0&&i.push(r.shift()),r.length>0&&i.push(r.pop()),i.push.apply(i,Object(u.__spreadArray)([],Object(u.__read)(r),!1)),i}(l,d[t]);e.length;){var n=e.shift(),i=qn(n);if(La(g,n,(function(t,e){return t.get("data")[f]===e.get("data")[f]&&t.get("data")[p]===e.get("data")[p]})))i.set("visible",!1);else{var r=!1;Da(g,n)&&(i.attr("y",i.attr("y")+2*y),r=Da(g,n)),r?i.set("visible",!1):g.push(n)}}}))}}})),_n("fade-in",(function(t,e,n){var i={fillOpacity:Object(h.isNil)(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),strokeOpacity:Object(h.isNil)(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity"),opacity:Object(h.isNil)(t.attr("opacity"))?1:t.attr("opacity")};t.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),t.animate(i,e)})),_n("fade-out",(function(t,e,n){var i=e.easing,r=e.duration,o=e.delay;t.animate({fillOpacity:0,strokeOpacity:0,opacity:0},r,i,(function(){t.remove(!0)}),o)})),_n("grow-in-x",(function(t,e,n){Ba(t,e,n.coordinate,n.minYPoint,"x")})),_n("grow-in-xy",(function(t,e,n){Ba(t,e,n.coordinate,n.minYPoint,"xy")})),_n("grow-in-y",(function(t,e,n){Ba(t,e,n.coordinate,n.minYPoint,"y")})),_n("scale-in-x",(function(t,e,n){var i=t.getBBox(),r=t.get("origin").mappingData.points,o=r[0].y-r[1].y>0?i.maxX:i.minX,a=(i.minY+i.maxY)/2;t.applyToMatrix([o,a,1]);var s=G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]]);t.setMatrix(s),t.animate({matrix:G.ext.transform(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])},e)})),_n("scale-in-y",(function(t,e,n){var i=t.getBBox(),r=t.get("origin").mappingData,o=(i.minX+i.maxX)/2,a=r.points,s=a[0].y-a[1].y<=0?i.maxY:i.minY;t.applyToMatrix([o,s,1]);var l=G.ext.transform(t.getMatrix(),[["t",-o,-s],["s",1,.01],["t",o,s]]);t.setMatrix(l),t.animate({matrix:G.ext.transform(t.getMatrix(),[["t",-o,-s],["s",1,100],["t",o,s]])},e)})),_n("wave-in",(function(t,e,n){var i=mt(n.coordinate,20),r=i.type,o=i.startState,a=i.endState,s=t.setClip({type:r,attrs:o});n.toAttrs&&t.attr(n.toAttrs),s.animate(a,Object(u.__assign)(Object(u.__assign)({},e),{callback:function(){t&&!t.get("destroyed")&&t.set("clipShape",null),s.remove(!0)}}))})),_n("zoom-in",(function(t,e,n){za(t,e,"zoomIn")})),_n("zoom-out",(function(t,e,n){za(t,e,"zoomOut")})),_n("position-update",(function(t,e,n){var i=n.toAttrs,r=i.x,o=i.y;delete i.x,delete i.y,t.attr(i),t.animate({x:r,y:o},e)})),_n("sector-path-update",(function(t,e,n){var i=n.toAttrs,r=n.coordinate,o=i.path||[],a=o.map((function(t){return t[0]}));if(!(o.length<1)){var s=Va(o),l=s.startAngle,c=s.endAngle,f=s.radius,p=s.innerRadius,d=Va(t.attr("path")),g=d.startAngle,y=d.endAngle,v=r.getCenter(),m=l-g,x=c-y;0!==m||0!==x?t.animate((function(t){var e=g+t*m,n=y+t*x;return Object(u.__assign)(Object(u.__assign)({},i),{path:Object(h.isEqual)(a,["M","A","A","Z"])?st(v.x,v.y,f,e,n):at(v.x,v.y,f,e,n,p)})}),Object(u.__assign)(Object(u.__assign)({},e),{callback:function(){t.attr("path",o)}})):t.attr("path",o)}})),_n("path-in",(function(t,e,n){var i=t.getTotalLength();t.attr("lineDash",[i]),t.animate((function(t){return{lineDashOffset:(1-t)*i}}),e)})),kt("rect",qa),kt("mirror",Ua),kt("list",Wa),kt("matrix",Ha),kt("circle",Xa),kt("tree",Za),on("axis",as),on("legend",us),on("tooltip",mn),on("annotation",Ja),on("slider",hs),on("scrollbar",fs),zt("tooltip",ys),zt("sibling-tooltip",vs),zt("ellipsis-text",ms),zt("element-active",Os),zt("element-single-active",As),zt("element-range-active",Ss),zt("element-highlight",Ts),zt("element-highlight-by-x",Ds),zt("element-highlight-by-color",Ls),zt("element-single-highlight",Bs),zt("element-range-highlight",ks),zt("element-sibling-highlight",ks,{effectSiblings:!0,effectByRecord:!0}),zt("element-selected",Rs),zt("element-single-selected",Vs),zt("element-range-selected",Ns),zt("element-link-by-color",ws),zt("active-region",gs),zt("list-active",Gs),zt("list-selected",Xs),zt("list-highlight",Ys),zt("list-unchecked",Ws),zt("list-checked",Hs),zt("list-focus",Us),zt("list-radio",Zs),zt("legend-item-highlight",Ys,{componentNames:["legend"]}),zt("axis-label-highlight",Ys,{componentNames:["axis"]}),zt("axis-description",ml),zt("rect-mask",Qs),zt("x-rect-mask",el,{dim:"x"}),zt("y-rect-mask",el,{dim:"y"}),zt("circle-mask",Ks),zt("path-mask",nl),zt("smooth-path-mask",il),zt("cursor",rl),zt("data-filter",ol),zt("brush",sl),zt("brush-x",sl,{dims:["x"]}),zt("brush-y",sl,{dims:["y"]}),zt("sibling-filter",ll),zt("sibling-x-filter",ll),zt("sibling-y-filter",ll),zt("element-filter",cl),zt("element-sibling-filter",ul),zt("element-sibling-filter-record",ul,{byRecord:!0}),zt("view-drag",fl),zt("view-move",pl),zt("scale-translate",gl),zt("scale-zoom",yl),zt("reset-button",hl,{name:"reset-button",text:"reset"}),zt("mousewheel-scroll",vl),Ee("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]}),Ee("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseout",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]}),Ee("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]}),Ee("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]}),Ee("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]}),Ee("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]}),Ee("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]}),Ee("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]}),Ee("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]}),Ee("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]}),Ee("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]}),Ee("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(t){return!t.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(t){return!t.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]}),Ee("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:xl,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:xl,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:xl,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]}),Ee("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]}),Ee("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:xl,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:xl,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:xl,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]}),Ee("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:xl,action:"path-mask:start"},{trigger:"mousedown",isEnable:xl,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]}),Ee("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]}),Ee("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(t){return!t.isInShape("legend-item-radio")},action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]}),Ee("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]}),Ee("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]}),Ee("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","element-filter:filter"]}]}),Ee("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]}),Ee("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]}),Ee("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(t){return bl(t.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(t){return!bl(t.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]}),Ee("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]}),Ee("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]})},function(t,e,n){"use strict";n.d(e,"e",(function(){return R})),n.d(e,"d",(function(){return H})),n.d(e,"a",(function(){return cn})),n.d(e,"b",(function(){return un})),n.d(e,"c",(function(){return hn})),n.d(e,"f",(function(){return i})),n.d(e,"h",(function(){return dn})),n.d(e,"n",(function(){return pn})),n.d(e,"j",(function(){return On})),n.d(e,"g",(function(){return wn})),n.d(e,"l",(function(){return W})),n.d(e,"m",(function(){return Z})),n.d(e,"k",(function(){return $})),n.d(e,"i",(function(){return _n})),n.d(e,"o",(function(){return Qe}));var i={};n.r(i),n.d(i,"catmullRomToBezier",(function(){return u})),n.d(i,"fillPath",(function(){return F})),n.d(i,"fillPathByDiff",(function(){return D})),n.d(i,"formatPath",(function(){return N})),n.d(i,"intersection",(function(){return E})),n.d(i,"parsePathArray",(function(){return m})),n.d(i,"parsePathString",(function(){return c})),n.d(i,"pathToAbsolute",(function(){return f})),n.d(i,"pathToCurve",(function(){return y})),n.d(i,"rectPath",(function(){return j}));var r={};n.r(r),n.d(r,"easeLinear",(function(){return me})),n.d(r,"easeQuad",(function(){return _e})),n.d(r,"easeQuadIn",(function(){return xe})),n.d(r,"easeQuadOut",(function(){return be})),n.d(r,"easeQuadInOut",(function(){return _e})),n.d(r,"easeCubic",(function(){return je})),n.d(r,"easeCubicIn",(function(){return Oe})),n.d(r,"easeCubicOut",(function(){return we})),n.d(r,"easeCubicInOut",(function(){return je})),n.d(r,"easePoly",(function(){return Ae})),n.d(r,"easePolyIn",(function(){return Se})),n.d(r,"easePolyOut",(function(){return Me})),n.d(r,"easePolyInOut",(function(){return Ae})),n.d(r,"easeSin",(function(){return Fe})),n.d(r,"easeSinIn",(function(){return Ie})),n.d(r,"easeSinOut",(function(){return Pe})),n.d(r,"easeSinInOut",(function(){return Fe})),n.d(r,"easeExp",(function(){return ke})),n.d(r,"easeExpIn",(function(){return Le})),n.d(r,"easeExpOut",(function(){return De})),n.d(r,"easeExpInOut",(function(){return ke})),n.d(r,"easeCircle",(function(){return Re})),n.d(r,"easeCircleIn",(function(){return Be})),n.d(r,"easeCircleOut",(function(){return Ne})),n.d(r,"easeCircleInOut",(function(){return Re})),n.d(r,"easeBounce",(function(){return Ge})),n.d(r,"easeBounceIn",(function(){return ze})),n.d(r,"easeBounceOut",(function(){return Ge})),n.d(r,"easeBounceInOut",(function(){return Ye})),n.d(r,"easeBack",(function(){return He})),n.d(r,"easeBackIn",(function(){return Xe})),n.d(r,"easeBackOut",(function(){return We})),n.d(r,"easeBackInOut",(function(){return He})),n.d(r,"easeElastic",(function(){return Ze})),n.d(r,"easeElasticIn",(function(){return qe})),n.d(r,"easeElasticOut",(function(){return Ze})),n.d(r,"easeElasticInOut",(function(){return $e}));var o=n(0),a="\t\n\v\f\r   ᠎              \u2028\u2029",s=new RegExp("([a-z])["+a+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+a+"]*,?["+a+"]*)+)","ig"),l=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+a+"]*,?["+a+"]*","ig"),c=function(t){if(!t)return null;if(Object(o.isArray)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(s,(function(i,r,o){var a=[],s=r.toLowerCase();if(o.replace(l,(function(t,e){e&&a.push(+e)})),"m"===s&&a.length>2&&(n.push([r].concat(a.splice(0,2))),s="l",r="m"===r?"l":"L"),"o"===s&&1===a.length&&n.push([r,a[0]]),"r"===s)n.push([r].concat(a));else for(;a.length>=e[s]&&(n.push([r].concat(a.splice(0,e[s]))),e[s]););return t})),n},u=function(t,e){for(var n=[],i=0,r=t.length;r-2*!e>i;i+=2){var o=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?r-4===i?o[3]={x:+t[0],y:+t[1]}:r-2===i&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[r-2],y:+t[r-1]}:r-4===i?o[3]=o[2]:i||(o[0]={x:+t[i],y:+t[i+1]}),n.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return n},h=function(t,e,n,i,r){var o=[];if(null===r&&null===i&&(i=n),t=+t,e=+e,n=+n,i=+i,null!==r){var a=Math.PI/180,s=t+n*Math.cos(-i*a),l=t+n*Math.cos(-r*a);o=[["M",s,e+n*Math.sin(-i*a)],["A",n,n,0,+(r-i>180),0,l,e+n*Math.sin(-r*a)]]}else o=[["M",t,e],["m",0,-i],["a",n,i,0,1,1,0,2*i],["a",n,i,0,1,1,0,-2*i],["z"]];return o},f=function(t){if(!(t=c(t))||!t.length)return[["M",0,0]];var e,n,i=[],r=0,o=0,a=0,s=0,l=0;"M"===t[0][0]&&(a=r=+t[0][1],s=o=+t[0][2],l++,i[0]=["M",r,o]);for(var f=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=void 0,d=void 0,g=l,y=t.length;g1&&(i*=O=Math.sqrt(O),r*=O);var w=i*i,j=r*r,S=(a===s?-1:1)*Math.sqrt(Math.abs((w*j-w*_*_-j*b*b)/(w*_*_+j*b*b)));d=S*i*_/r+(e+l)/2,g=S*-r*b/i+(n+c)/2,f=Math.asin(((n-g)/r).toFixed(9)),p=Math.asin(((c-g)/r).toFixed(9)),f=ep&&(f-=2*Math.PI),!s&&p>f&&(p-=2*Math.PI)}var M=p-f;if(Math.abs(M)>y){var A=p,C=l,E=c;p=f+y*(s&&p>f?1:-1),m=t(l=d+i*Math.cos(p),c=g+r*Math.sin(p),i,r,o,0,s,C,E,[p,A,d,g])}M=p-f;var I=Math.cos(f),P=Math.sin(f),F=Math.cos(p),T=Math.sin(p),L=Math.tan(M/4),D=4/3*i*L,k=4/3*r*L,B=[e,n],N=[e+D*P,n-k*I],R=[l+D*T,c-k*F],V=[l,c];if(N[0]=2*B[0]-N[0],N[1]=2*B[1]-N[1],u)return[N,R,V].concat(m);for(var z=[],G=0,Y=(m=[N,R,V].concat(m).join().split(",")).length;G7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",r&&(l[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),n=Math.max(i.length,r&&r.length||0)}},v=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],n=Math.max(i.length,r&&r.length||0))};n=Math.max(i.length,r&&r.length||0);for(var m=0;m1?1:l<0?0:l)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,p=0;p<12;p++){var d=c*u[p]+c,g=x(d,t,n,r,a),y=x(d,e,i,o,s),v=g*g+y*y;f+=h[p]*Math.sqrt(v)}return c*f},_=function(t,e,n,i,r,o,a,s){for(var l,c,u,h,f=[],p=[[],[]],d=0;d<2;++d)if(0===d?(c=6*t-12*n+6*r,l=-3*t+9*n-9*r+3*a,u=3*n-3*t):(c=6*e-12*i+6*o,l=-3*e+9*i-9*o+3*s,u=3*i-3*e),Math.abs(l)<1e-12){if(Math.abs(c)<1e-12)continue;(h=-u/c)>0&&h<1&&f.push(h)}else{var g=c*c-4*u*l,y=Math.sqrt(g);if(!(g<0)){var v=(-c+y)/(2*l);v>0&&v<1&&f.push(v);var m=(-c-y)/(2*l);m>0&&m<1&&f.push(m)}}for(var x,b=f.length,_=b;b--;)x=1-(h=f[b]),p[0][b]=x*x*x*t+3*x*x*h*n+3*x*h*h*r+h*h*h*a,p[1][b]=x*x*x*e+3*x*x*h*i+3*x*h*h*o+h*h*h*s;return p[0][_]=t,p[1][_]=e,p[0][_+1]=a,p[1][_+1]=s,p[0].length=p[1].length=_+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}},O=function(t,e,n,i,r,o,a,s){if(!(Math.max(t,n)Math.max(r,a)||Math.max(e,i)Math.max(o,s))){var l=(t-n)*(o-s)-(e-i)*(r-a);if(l){var c=((t*i-e*n)*(r-a)-(t-n)*(r*s-o*a))/l,u=((t*i-e*n)*(o-s)-(e-i)*(r*s-o*a))/l,h=+c.toFixed(2),f=+u.toFixed(2);if(!(h<+Math.min(t,n).toFixed(2)||h>+Math.max(t,n).toFixed(2)||h<+Math.min(r,a).toFixed(2)||h>+Math.max(r,a).toFixed(2)||f<+Math.min(e,i).toFixed(2)||f>+Math.max(e,i).toFixed(2)||f<+Math.min(o,s).toFixed(2)||f>+Math.max(o,s).toFixed(2)))return{x:c,y:u}}}},w=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},j=function(t,e,n,i,r){if(r)return[["M",+t+ +r,e],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,i-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-i],["a",r,r,0,0,1,r,-r],["z"]];var o=[["M",t,e],["l",n,0],["l",0,i],["l",-n,0],["z"]];return o.parsePathArray=m,o},S=function(t,e,n,i){return null===t&&(t=e=n=i=0),null===e&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:i,h:i,x2:t+n,y2:e+i,cx:t+n/2,cy:e+i/2,r1:Math.min(n,i)/2,r2:Math.max(n,i)/2,r0:Math.sqrt(n*n+i*i)/2,path:j(t,e,n,i),vb:[t,e,n,i].join(" ")}},M=function(t,e,n,i,r,a,s,l){Object(o.isArray)(t)||(t=[t,e,n,i,r,a,s,l]);var c=_.apply(null,t);return S(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},A=function(t,e,n,i,r,o,a,s,l){var c=1-l,u=Math.pow(c,3),h=Math.pow(c,2),f=l*l,p=f*l,d=t+2*l*(n-t)+f*(r-2*n+t),g=e+2*l*(i-e)+f*(o-2*i+e),y=n+2*l*(r-n)+f*(a-2*r+n),v=i+2*l*(o-i)+f*(s-2*o+i);return{x:u*t+3*h*l*n+3*c*l*l*r+p*a,y:u*e+3*h*l*i+3*c*l*l*o+p*s,m:{x:d,y:g},n:{x:y,y:v},start:{x:c*t+l*n,y:c*e+l*i},end:{x:c*r+l*a,y:c*o+l*s},alpha:90-180*Math.atan2(d-y,g-v)/Math.PI}},C=function(t,e,n){if(!function(t,e){return t=S(t),e=S(e),w(e,t.x,t.y)||w(e,t.x2,t.y)||w(e,t.x,t.y2)||w(e,t.x2,t.y2)||w(t,e.x,e.y)||w(t,e.x2,e.y)||w(t,e.x,e.y2)||w(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(M(t),M(e)))return n?0:[];for(var i=~~(b.apply(0,t)/8),r=~~(b.apply(0,e)/8),o=[],a=[],s={},l=n?0:[],c=0;c=0&&x<=1&&_>=0&&_<=1&&(n?l+=1:l.push({x:m.x,y:m.y,t1:x,t2:_}))}}return l},E=function(t,e){return function(t,e,n){var i,r,o,a,s,l,c,u,h,f;t=y(t),e=y(e);for(var p=n?0:[],d=0,g=t.length;d=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])}))}(t,e,n));else{var r=[].concat(t);"M"===r[0]&&(r[0]="L");for(var o=0;o<=n-1;o++)i.push(r)}return i},F=function(t,e){if(1===t.length)return t;var n=t.length-1,i=e.length-1,r=n/i,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;l--)a=o[l].index,"add"===o[l].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var h=r-(i=t.length);if(i0)){t[i]=e[i];break}n=k(n,t[i-1],1)}t[i]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[i]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(i>0)){t[i]=e[i];break}n=k(n,t[i-1],2)}t[i]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(i>0)){t[i]=e[i];break}n=k(n,t[i-1],1)}t[i]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[i]=e[i]}return t},R=function(){function t(t,e){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=t,this.name=t,this.originalEvent=e,this.timeStamp=e.timeStamp}return t.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.toString=function(){return"[Event (type="+this.type+")]"},t.prototype.save=function(){},t.prototype.restore=function(){},t}(),V=n(1),z=n(45);function G(t,e){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}var Y="undefined"!=typeof window&&void 0!==window.document;function X(t,e){if(t.isCanvas())return!0;for(var n=e.getParent(),i=!1;n;){if(n===t){i=!0;break}n=n.getParent()}return i}function W(t){return t.cfg.visible&&t.cfg.capture}var H=function(t){function e(e){var n=t.call(this)||this;n.destroyed=!1;var i=n.getDefaultCfg();return n.cfg=Object(o.mix)(i,e),n}return Object(V.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,e){this.cfg[t]=e},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(z.default),U=n(55);function q(t,e){var n=[],i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],f=e[0],p=e[1],d=e[2],g=e[3],y=e[4],v=e[5],m=e[6],x=e[7],b=e[8];return n[0]=f*i+p*a+d*c,n[1]=f*r+p*s+d*u,n[2]=f*o+p*l+d*h,n[3]=g*i+y*a+v*c,n[4]=g*r+y*s+v*u,n[5]=g*o+y*l+v*h,n[6]=m*i+x*a+b*c,n[7]=m*r+x*s+b*u,n[8]=m*o+x*l+b*h,n}function Z(t,e){var n=[],i=e[0],r=e[1];return n[0]=t[0]*i+t[3]*r+t[6],n[1]=t[1]*i+t[4]*r+t[7],n}function $(t){var e=[],n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=u*a-s*c,f=-u*o+s*l,p=c*o-a*l,d=n*h+i*f+r*p;return d?(d=1/d,e[0]=h*d,e[1]=(-u*i+r*c)*d,e[2]=(s*i-r*a)*d,e[3]=f*d,e[4]=(u*n-r*l)*d,e[5]=(-s*n+r*o)*d,e[6]=p*d,e[7]=(-c*n+i*l)*d,e[8]=(a*n-i*o)*d,e):null}var K=n(3).ext.transform,Q=["zIndex","capture","visible","type"],J=["repeat"];function tt(t,e){var n={},i=e.attrs;for(var r in t)n[r]=i[r];return n}function et(t,e){var n={},i=e.attr();return Object(o.each)(t,(function(t,e){-1!==J.indexOf(e)||Object(o.isEqual)(i[e],t)||(n[e]=t)})),n}function nt(t,e){if(e.onFrame)return t;var n=e.startTime,i=e.delay,r=e.duration,a=Object.prototype.hasOwnProperty;return Object(o.each)(t,(function(t){n+it.delay&&Object(o.each)(e.toAttrs,(function(e,n){a.call(t.toAttrs,n)&&(delete t.toAttrs[n],delete t.fromAttrs[n])}))})),t}var it=function(t){function e(e){var n=t.call(this,e)||this;n.attrs={};var i=n.getDefaultAttrs();return Object(o.mix)(i,e.attrs),n.attrs=i,n.initAttrs(i),n.initAnimate(),n}return Object(V.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],n=0;n0?i=nt(i,x):n.addAnimator(this),i.push(x),this.set("animations",i),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var n=this.get("animations");Object(o.each)(n,(function(n){t&&(n.onFrame?e.attr(n.onFrame(1)):e.attr(n.toAttrs)),n.callback&&n.callback()})),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return Object(o.each)(e,(function(t){t._paused=!0,t._pauseTime=n,t.pauseCallback&&t.pauseCallback()})),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),n=this.get("_pause").pauseTime;return Object(o.each)(e,(function(e){e.startTime=e.startTime+(t-n),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()})),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var n,i=this,r=e.propagationPath;this.getEvents();"mouseenter"===t?n=e.fromShape:"mouseleave"===t&&(n=e.toShape);for(var a=function(t){var a=r[t],l=a.get("name");if(l){if((a.isGroup()||a.isCanvas&&a.isCanvas())&&n&&X(a,n))return"break";Object(o.isArray)(l)?Object(o.each)(l,(function(t){i.emitDelegateEvent(a,t,e)})):s.emitDelegateEvent(a,l,e)}},s=this,l=0;l0)}));return s.length>0?(Object(o.each)(s,(function(t){var e=t.getBBox();r.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Object(o.min)(r),e=Object(o.max)(r),n=Object(o.min)(a),i=Object(o.max)(a)):(t=0,e=0,n=0,i=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:i,width:e-t,height:i-n}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,i=-1/0,r=[],a=[],s=this.getChildren().filter((function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)}));return s.length>0?(Object(o.each)(s,(function(t){var e=t.getCanvasBBox();r.push(e.minX,e.maxX),a.push(e.minY,e.maxY)})),t=Object(o.min)(r),e=Object(o.max)(r),n=Object(o.min)(a),i=Object(o.max)(a)):(t=0,e=0,n=0,i=0),{x:t,y:n,minX:t,minY:n,maxX:e,maxY:i,width:e-t,height:i-n}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,n,i){if(t.prototype.onAttrChange.call(this,e,n,i),"matrix"===e){var r=this.getTotalMatrix();this._applyChildrenMarix(r)}},e.prototype.applyMatrix=function(e){var n=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var i=this.getTotalMatrix();i!==n&&this._applyChildrenMarix(i)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();Object(o.each)(e,(function(e){e.applyMatrix(t)}))},e.prototype.addShape=function(){for(var t=[],e=0;e=0;o--){var a=t[o];if(W(a)&&(a.isGroup()?r=a.getShape(e,n,i):a.isHit(e,n)&&(r=a)),r)break}return r},e.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),i=this.get("timeline"),r=t.getParent();r&&function(t,e,n){void 0===n&&(n=!0),n?e.destroy():(e.set("parent",null),e.set("canvas",null)),G(t.getChildren(),e)}(r,t,!1),t.set("parent",this),e&&function t(e,n){if(e.set("canvas",n),e.isGroup()){var i=e.get("children");i.length&&i.forEach((function(e){t(e,n)}))}}(t,e),i&&function t(e,n){if(e.set("timeline",n),e.isGroup()){var i=e.get("children");i.length&&i.forEach((function(e){t(e,n)}))}}(t,i),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t,e=this.getChildren();Object(o.each)(e,(function(t,e){return t._INDEX=e,t})),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,n){var i=t(e,n);return 0===i?e._INDEX-n._INDEX:i})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],n=this.getChildren();return Object(o.each)(n,(function(n){t(n)&&e.push(n),n.isGroup()&&(e=e.concat(n.findAll(t)))})),e},e.prototype.find=function(t){var e=null,n=this.getChildren();return Object(o.each)(n,(function(n){if(t(n)?e=n:n.isGroup()&&(e=n.find(t)),e)return!1})),e},e.prototype.findById=function(t){return this.find((function(e){return e.get("id")===t}))},e.prototype.findByClassName=function(t){return this.find((function(e){return e.get("className")===t}))},e.prototype.findAllByName=function(t){return this.findAll((function(e){return e.get("name")===t}))},e}(it);function at(t){return(at="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})(t)}var st,lt,ct=0,ut=0,ht=0,ft=0,pt=0,dt=0,gt="object"===("undefined"==typeof performance?"undefined":at(performance))&&performance.now?performance:Date,yt="object"===("undefined"==typeof window?"undefined":at(window))&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function vt(){return pt||(yt(mt),pt=gt.now()+dt)}function mt(){pt=0}function xt(){this._call=this._time=this._next=null}function bt(t,e,n){var i=new xt;return i.restart(t,e,n),i}function _t(){pt=(ft=gt.now())+dt,ct=ut=0;try{!function(){vt(),++ct;for(var t,e=st;e;)(t=pt-e._time)>=0&&e._call.call(null,t),e=e._next;--ct}()}finally{ct=0,function(){var t,e,n=st,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:st=e);lt=t,wt(i)}(),pt=0}}function Ot(){var t=gt.now(),e=t-ft;e>1e3&&(dt-=e,ft=t)}function wt(t){ct||(ut&&(ut=clearTimeout(ut)),t-pt>24?(t<1/0&&(ut=setTimeout(_t,t-gt.now()-dt)),ht&&(ht=clearInterval(ht))):(ht||(ft=gt.now(),ht=setInterval(Ot,1e3)),ct=1,yt(_t)))}xt.prototype=bt.prototype={constructor:xt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?vt():+n)+(null==e?0:+e),this._next||lt===this||(lt?lt._next=this:st=this,lt=this),this._call=t,this._time=n,wt()},stop:function(){this._call&&(this._call=null,this._time=1/0,wt())}};var jt=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function St(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Mt(){}var At="\\s*([+-]?\\d+)\\s*",Ct="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Et="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",It=/^#([0-9a-f]{3,8})$/,Pt=new RegExp("^rgb\\("+[At,At,At]+"\\)$"),Ft=new RegExp("^rgb\\("+[Et,Et,Et]+"\\)$"),Tt=new RegExp("^rgba\\("+[At,At,At,Ct]+"\\)$"),Lt=new RegExp("^rgba\\("+[Et,Et,Et,Ct]+"\\)$"),Dt=new RegExp("^hsl\\("+[Ct,Et,Et]+"\\)$"),kt=new RegExp("^hsla\\("+[Ct,Et,Et,Ct]+"\\)$"),Bt={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 Nt(){return this.rgb().formatHex()}function Rt(){return this.rgb().formatRgb()}function Vt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=It.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?zt(e):3===n?new Wt(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Gt(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Gt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Pt.exec(t))?new Wt(e[1],e[2],e[3],1):(e=Ft.exec(t))?new Wt(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Tt.exec(t))?Gt(e[1],e[2],e[3],e[4]):(e=Lt.exec(t))?Gt(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Dt.exec(t))?Zt(e[1],e[2]/100,e[3]/100,1):(e=kt.exec(t))?Zt(e[1],e[2]/100,e[3]/100,e[4]):Bt.hasOwnProperty(t)?zt(Bt[t]):"transparent"===t?new Wt(NaN,NaN,NaN,0):null}function zt(t){return new Wt(t>>16&255,t>>8&255,255&t,1)}function Gt(t,e,n,i){return i<=0&&(t=e=n=NaN),new Wt(t,e,n,i)}function Yt(t){return t instanceof Mt||(t=Vt(t)),t?new Wt((t=t.rgb()).r,t.g,t.b,t.opacity):new Wt}function Xt(t,e,n,i){return 1===arguments.length?Yt(t):new Wt(t,e,n,null==i?1:i)}function Wt(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ht(){return"#"+qt(this.r)+qt(this.g)+qt(this.b)}function Ut(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function qt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Zt(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Kt(t,e,n,i)}function $t(t){if(t instanceof Kt)return new Kt(t.h,t.s,t.l,t.opacity);if(t instanceof Mt||(t=Vt(t)),!t)return new Kt;if(t instanceof Kt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n0&&l<1?0:a,new Kt(a,s,l,t.opacity)}function Kt(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Qt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Jt(t,e,n,i,r){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*i+a*r)/6}jt(Mt,Vt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Nt,formatHex:Nt,formatHsl:function(){return $t(this).formatHsl()},formatRgb:Rt,toString:Rt}),jt(Wt,Xt,St(Mt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Wt(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Wt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ht,formatHex:Ht,formatRgb:Ut,toString:Ut})),jt(Kt,(function(t,e,n,i){return 1===arguments.length?$t(t):new Kt(t,e,n,null==i?1:i)}),St(Mt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Kt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Kt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Wt(Qt(t>=240?t-240:t+120,r,i),Qt(t,r,i),Qt(t<120?t+240:t-120,r,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var te=function(t){return function(){return t}};function ee(t,e){return function(n){return t+n*e}}function ne(t){return 1==(t=+t)?ie:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):te(isNaN(e)?n:e)}}function ie(t,e){var n=e-t;return n?ee(t,n):te(isNaN(t)?e:t)}var re=function t(e){var n=ne(e);function i(t,e){var i=n((t=Xt(t)).r,(e=Xt(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=ie(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function oe(t){return function(e){var n,i,r=e.length,o=new Array(r),a=new Array(r),s=new Array(r);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),r=t[i],o=t[i+1],a=i>0?t[i-1]:2*r-o,s=io&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:ue(n,i)})),o=de.lastIndex;return od.length?(p=c(a[f]),d=c(r[f]),d=D(d,p),d=N(d,p),e.fromAttrs.path=d,e.toAttrs.path=p):e.pathFormatted||(p=c(a[f]),d=c(r[f]),d=N(d,p),e.fromAttrs.path=d,e.toAttrs.path=p,e.pathFormatted=!0),i[f]=[];for(var g=0;g0){for(var o=i.animators.length-1;o>=0;o--)if((t=i.animators[o]).destroyed)i.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],tn(t,n,r)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&i.removeAnimator(o)}i.canvas.get("autoDraw")||i.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),nn=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function rn(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function on(t,e,n){if(n.bubbles){var i=void 0,r=!1;if("mouseenter"===e?(i=n.fromShape,r=!0):"mouseleave"===e&&(r=!0,i=n.toShape),t.isCanvas()&&r)return;if(i&&X(t,i))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var an=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(o.each)(nn,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(o.each)(nn,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,i,r,o){var a=new R(t,e);return a.fromShape=r,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(i),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),i=e.getPointByEvent(t);return{x:i.x,y:i.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),i=this._getShape(n,e),r=this["_on"+t],o=!1;if(r)r.call(this,n,i,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,i),i&&this._emitEvent(t,e,n,i,null,i),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,i,null,null)}if(o||(this.currentShape=i),i&&!i.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=i.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,i){var r=this.canvas.get("el");n!==i&&(n&&(this._emitEvent("mouseout",t,e,n,n,i),this._emitEvent("mouseleave",t,e,n,n,i),i&&!i.get("destroyed")||(r.style.cursor=this.canvas.get("cursor"))),i&&(this._emitEvent("mouseover",t,e,i,n,i),this._emitEvent("mouseenter",t,e,i,n,i)))},t.prototype._emitDragoverEvents=function(t,e,n,i,r){i?(i!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,i),this._emitEvent("dragenter",t,e,i,n,i)),r||this._emitEvent("dragover",t,e,i)):n&&this._emitEvent("dragleave",t,e,n,n,i),r&&this._emitEvent("dragover",t,e,i)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var i=this._getShape(e,n);i!==t&&this._emitMouseoverEvents(n,e,t,i),this.currentShape=i},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var i=this.draggingShape;this.dragging?(i&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,i),this._afterDrag(i,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var i=this.currentShape;this._emitDragoverEvents(n,t,i,e,!0)},t.prototype._onmousemove=function(t,e,n){var i=this.canvas,r=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,r,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,l=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,u=a.clientY-t.clientY;l>120||c*c+u*u>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&i.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,r,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,r,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,r,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,i,r,o){var a=this._getEventObj(t,e,n,i,r,o);if(i){a.shape=i,rn(i,t,a);for(var s=i.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||on(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{rn(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),sn=Object(U.a)(),ln=sn&&"firefox"===sn.name,cn=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return Object(V.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(o.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new an({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new en(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");Y&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");Y&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(ln&&!Object(o.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(o.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,i=e.y;return this.getPointByClient(n,i)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(ot),un=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(V.__extends)(e,t),e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var e=t.prototype.clone.call(this),n=this.getChildren(),i=0;i=t&&n.minY<=e&&n.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,i=t.minY,r=t.maxX,o=t.maxY;if(e){var a=Z(e,[t.minX,t.minY]),s=Z(e,[t.maxX,t.minY]),l=Z(e,[t.minX,t.maxY]),c=Z(e,[t.maxX,t.maxY]);n=Math.min(a[0],s[0],l[0],c[0]),r=Math.max(a[0],s[0],l[0],c[0]),i=Math.min(a[1],s[1],l[1],c[1]),o=Math.max(a[1],s[1],l[1],c[1])}var u=this.attrs;if(u.shadowColor){var h=u.shadowBlur,f=void 0===h?0:h,p=u.shadowOffsetX,d=void 0===p?0:p,g=u.shadowOffsetY,y=void 0===g?0:g,v=n-f+d,m=r+f+d,x=i-f+y,b=o+f+y;n=Math.min(n,v),r=Math.max(r,m),i=Math.min(i,x),o=Math.max(o,b)}return{x:n,y:i,minX:n,minY:i,maxX:r,maxY:o,width:r-n,height:o-i}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),i=this.get("endArrowShape"),r=[t,e,1],o=(r=this.invertFromMatrix(r))[0],a=r[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(n&&n.isHit(o,a))return!0;if(i&&i.isHit(o,a))return!0}return!1},e}(it),fn=new Map;function pn(t,e){fn.set(t,e)}function dn(t){return fn.get(t)}var gn=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},yn=function(t){var e=t.attr(),n=e.x,i=e.y,r=e.r;return{x:n-r,y:i-r,width:2*r,height:2*r}},vn=n(13);function mn(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function xn(t,e){var n=t.get("startArrowShape"),i=t.get("endArrowShape");return n&&(e=mn(e,n.getCanvasBBox())),i&&(e=mn(e,i.getCanvasBBox())),e}var bn=null;function _n(){if(!bn){var t=document.createElement("canvas");t.width=1,t.height=1,bn=t.getContext("2d")}return bn}function On(t,e,n){var i=1;return Object(o.isString)(t)&&(i=t.split("\n").length),i>1?e*i+function(t,e){return e?e-t:.14*t}(e,n)*(i-1):e}function wn(t){var e=t.fontSize,n=t.fontFamily,i=t.fontWeight;return[t.fontStyle,t.fontVariant,i,e+"px",n].join(" ").trim()}var jn=n(21);function Sn(t,e){var n=t.prePoint,i=t.currentPoint,r=t.nextPoint,a=Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2),s=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),l=Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2),c=Math.acos((a+s-l)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!c||0===Math.sin(c)||Object(o.isNumberEqual)(c,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(r[1]-i[1],r[0]-i[0])),h=Math.abs(Math.atan2(r[0]-i[0],r[1]-i[1]));return u=u>Math.PI/2?Math.PI-u:u,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(c/2-u)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(h-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}pn("rect",gn),pn("image",gn),pn("circle",yn),pn("marker",yn),pn("polyline",(function(t){for(var e=t.attr().points,n=[],i=[],r=0;r]*>/,s={tr:document.createElement("tbody"),tbody:r,thead:r,tfoot:r,td:o,th:o,"*":document.createElement("div")});var e=a.test(t)&&RegExp.$1;e&&e in s||(e="*");var n=s[e];t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,n.innerHTML=""+t;var i=n.childNodes[0];return i&&n.contains(i)&&n.removeChild(i),i}function c(t,e,n){var i;try{i=window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.style[e]}catch(t){}finally{i=void 0===i?n:i}return i}function u(t,e){var n=function(t,e){var n=c(t,"height",e);return"auto"===n&&(n=t.offsetHeight),parseFloat(n)}(t,e),i=parseFloat(c(t,"borderTopWidth"))||0,r=parseFloat(c(t,"paddingTop"))||0,o=parseFloat(c(t,"paddingBottom"))||0;return n+i+(parseFloat(c(t,"borderBottomWidth"))||0)+r+o+(parseFloat(c(t,"marginTop"))||0)+(parseFloat(c(t,"marginBottom"))||0)}function h(t,e){var n=function(t,e){var n=c(t,"width",e);return"auto"===n&&(n=t.offsetWidth),parseFloat(n)}(t,e),i=parseFloat(c(t,"borderLeftWidth"))||0,r=parseFloat(c(t,"paddingLeft"))||0,o=parseFloat(c(t,"paddingRight"))||0,a=parseFloat(c(t,"borderRightWidth"))||0,s=parseFloat(c(t,"marginRight"))||0;return n+i+a+r+o+(parseFloat(c(t,"marginLeft"))||0)+s}function f(t,e){if(t)for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t}n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return h})),n.d(e,"e",(function(){return f}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformations=e.limitInPlot=e.annotation=e.scale=e.scrollbar=e.slider=e.state=e.theme=e.animation=e.interaction=e.tooltip=e.legend=void 0;var i=n(1),r=n(0),o=n(27),a=n(2);e.legend=function(t){var e=t.chart,n=t.options,i=n.legend,r=n.colorField,o=n.seriesField;return!1===i?e.legend(!1):(r||o)&&e.legend(r||o,i),t},e.tooltip=function(t){var e=t.chart,n=t.options.tooltip;return void 0!==n&&e.tooltip(n),t},e.interaction=function(t){var e=t.chart,n=t.options.interactions;return r.each(n,(function(t){!1===t.enable?e.removeInteraction(t.type):e.interaction(t.type,t.cfg||{})})),t},e.animation=function(t){var e=t.chart,n=t.options.animation;return a.addViewAnimation(e,n),t},e.theme=function(t){var e=t.chart,n=t.options.theme;return n&&e.theme(n),t},e.state=function(t){var e=t.chart,n=t.options.state;return n&&r.each(e.geometries,(function(t){t.state(n)})),t},e.slider=function(t){var e=t.chart,n=t.options.slider;return e.option("slider",n),t},e.scrollbar=function(t){var e=t.chart,n=t.options.scrollbar;return e.option("scrollbar",n),t},e.scale=function(t,e){return function(n){var i=n.chart,s=n.options,l={};return r.each(t,(function(t,e){l[e]=a.pick(t,o.AXIS_META_CONFIG_KEYS)})),l=a.deepAssign({},e,s.meta,l),i.scale(l),n}},e.annotation=function(t){return function(e){var n=e.chart,o=e.options,a=n.getController("annotation");return r.each(i.__spreadArrays(o.annotations||[],t||[]),(function(t){a.annotation(t)})),e}},e.limitInPlot=function(t){var e=t.chart,n=t.options,i=n.yAxis,o=n.limitInPlot,s=o;return r.isObject(i)&&r.isNil(o)&&(s=!!Object.values(a.pick(i,["min","max","minLimit","maxLimit"])).some((function(t){return!r.isNil(t)}))),e.limitInPlot=s,t},e.transformations=function(t){return void 0===t&&(t="rect"),function(e){var n=e.chart,i=e.options.coordinate,r=Array.from(i||[]).map((function(t){return"reflectX"===t.type?["reflect","x"]:"reflectY"===t.type?["reflect","y"]:"transpose"===t.type?["transpose"]:null})).filter((function(t){return!!t}));return 0!==r.length&&n.coordinate({type:t,actions:r}),e}};var s=n(33);Object.defineProperty(e,"pattern",{enumerable:!0,get:function(){return s.pattern}})},function(t,e,n){"use strict";var i=n(1),r=n(0),o=n(54),a=n(18),s=n(4),l=n(38),c=["visible","tip","delegateObject"],u=["container","group","shapesMap","isRegister","isUpdating","destroyed"],h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear(),this.get("group").remove()},e.prototype.clear=function(){this.get("group").clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var e=this.getElementById(t);return e&&e.get("component")},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var e=this.getElementId(t);return this.getElementById(e)},e.prototype.getElementsByName=function(t){var e=[];return Object(r.each)(this.get("shapesMap"),(function(n){n.get("name")===t&&e.push(n)})),e},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var e=this.get("group");this.updateElements(t,e),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){this.get("group").show(),this.set("visible",!0)},e.prototype.hide=function(){this.get("group").hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){this.get("group").set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),t.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),e=this.getInnerLayoutBBox(),n=t.getTotalMatrix();return n&&(e=Object(a.a)(n,e)),e},e.prototype.on=function(t,e,n){return this.get("group").on(t,e,n),this},e.prototype.off=function(t,e){var n=this.get("group");return n&&n.off(t,e),this},e.prototype.emit=function(t,e){this.get("group").emit(t,e)},e.prototype.init=function(){t.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,e){var n=this.get("group");e.target=n,n.emit(t,e),Object(o.a)(n,t,e)},e.prototype.createOffScreenGroup=function(){return new(this.get("group").getGroupBase())({delegateObject:this.getDelegateObject()})},e.prototype.applyOffset=function(){var t=this.get("offsetX"),e=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:e})},e.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",Object(s.d)(t)),t},e.prototype.addGroup=function(t,e){this.appendDelegateObject(t,e);var n=t.addGroup(e);return this.get("isRegister")&&this.registerElement(n),n},e.prototype.addShape=function(t,e){this.appendDelegateObject(t,e);var n=t.addShape(e);return this.get("isRegister")&&this.registerElement(n),n},e.prototype.addComponent=function(t,e){var n=e.id,r=e.component,o=Object(i.__rest)(e,["id","component"]),a=new r(Object(i.__assign)(Object(i.__assign)({},o),{id:n,container:t,updateAutoRender:this.get("updateAutoRender")}));return a.init(),a.render(),this.get("isRegister")&&this.registerElement(a.get("group")),a},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){this.get("group").off()},e.prototype.getElementId=function(t){return this.get("id")+"-"+this.get("name")+"-"+t},e.prototype.registerElement=function(t){var e=t.get("id");this.get("shapesMap")[e]=t},e.prototype.unregisterElement=function(t){var e=t.get("id");delete this.get("shapesMap")[e]},e.prototype.moveElementTo=function(t,e){var n=Object(a.f)(e);t.attr("matrix",n)},e.prototype.addAnimation=function(t,e,n){var i=e.attr("opacity");Object(r.isNil)(i)&&(i=1),e.attr("opacity",0),e.animate({opacity:i},n)},e.prototype.removeAnimation=function(t,e,n){e.animate({opacity:0},n)},e.prototype.updateAnimation=function(t,e,n,i){e.animate(n,i)},e.prototype.updateElements=function(t,e){var n,i=this,o=this.get("animate"),a=this.get("animateOption"),l=t.getChildren().slice(0);Object(r.each)(l,(function(t){var l=t.get("id"),h=i.getElementById(l),f=t.get("name");if(h)if(t.get("isComponent")){var p=t.get("component"),d=h.get("component"),g=Object(r.pick)(p.cfg,Object(r.difference)(Object(r.keys)(p.cfg),u));d.update(g),h.set("update_status","update")}else{var y=i.getReplaceAttrs(h,t);o&&a.update?i.updateAnimation(f,h,y,a.update):h.attr(y),t.isGroup()&&i.updateElements(t,h),Object(r.each)(c,(function(e){h.set(e,t.get(e))})),Object(s.m)(h,t),n=h,h.set("update_status","update")}else{e.add(t);var v=e.getChildren();if(v.splice(v.length-1,1),n){var m=v.indexOf(n);v.splice(m+1,0,t)}else v.unshift(t);if(i.registerElement(t),t.set("update_status","add"),t.get("isComponent"))(p=t.get("component")).set("container",e);else t.isGroup()&&i.registerNewGroup(t);if(n=t,o){var x=i.get("isInit")?a.appear:a.enter;x&&i.addAnimation(f,t,x)}}}))},e.prototype.clearUpdateStatus=function(t){var e=t.getChildren();Object(r.each)(e,(function(t){t.set("update_status",null)}))},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t;return(t={})[this.get("name")]=this,t.component=this,t},e.prototype.appendDelegateObject=function(t,e){var n=t.get("delegateObject");e.delegateObject||(e.delegateObject={}),Object(r.mix)(e.delegateObject,n)},e.prototype.getReplaceAttrs=function(t,e){var n=t.attr(),i=e.attr();return Object(r.each)(n,(function(t,e){void 0===i[e]&&(i[e]=void 0)})),i},e.prototype.registerNewGroup=function(t){var e=this,n=t.getChildren();Object(r.each)(n,(function(t){e.registerElement(t),t.set("update_status","add"),t.isGroup()&&e.registerNewGroup(t)}))},e.prototype.deleteElements=function(){var t=this,e=this.get("shapesMap"),n=[];Object(r.each)(e,(function(t,e){!t.get("update_status")||t.destroyed?n.push([e,t]):t.set("update_status",null)}));var i=this.get("animate"),o=this.get("animateOption");Object(r.each)(n,(function(n){var a=n[0],s=n[1];if(!s.destroyed){var l=s.get("name");if(i&&o.leave){var c=Object(r.mix)({callback:function(){t.removeElement(s)}},o.leave);t.removeAnimation(l,s,c)}else t.removeElement(s)}delete e[a]}))},e.prototype.removeElement=function(t){if(t.get("isGroup")){var e=t.get("component");e&&e.destroy()}t.remove()},e}(l.a);e.a=h},function(t,e,n){"use strict";var i=n(148);n.d(e,"Annotation",(function(){return i}));var r=n(149);n.d(e,"Axis",(function(){return r}));var o=n(150);n.d(e,"Crosshair",(function(){return o}));var a=n(152);n.d(e,"Grid",(function(){return a}));var s=n(153);n.d(e,"Legend",(function(){return s}));var l=n(154);n.d(e,"Tooltip",(function(){return l}));n(38),n(11),n(28);var c=n(151);n.d(e,"Slider",(function(){return c.a}));var u=n(155);n.d(e,"Scrollbar",(function(){return u.a}));n(73),n(74);var h=n(54);n.d(e,"propagationDelegate",(function(){return h.a}));var f=n(19);n.d(e,"TOOLTIP_CSS_CONST",(function(){return f}))},function(t,e,n){"use strict";n.d(e,"e",(function(){return m})),n.d(e,"b",(function(){return j})),n.d(e,"a",(function(){return P})),n.d(e,"c",(function(){return f})),n.d(e,"d",(function(){return B})),n.d(e,"f",(function(){return i}));var i={};function r(t){return Math.min.apply(null,t)}function o(t){return Math.max.apply(null,t)}function a(t,e,n,i){var r=t-n,o=e-i;return Math.sqrt(r*r+o*o)}function s(t,e){return Math.abs(t-e)<.001}function l(t,e){var n=r(t),i=r(e);return{x:n,y:i,width:o(t)-n,height:o(e)-i}}function c(t,e,n,i){return{minX:r([t,n]),maxX:o([t,n]),minY:r([e,i]),maxY:o([e,i])}}function u(t){return(t+2*Math.PI)%(2*Math.PI)}n.r(i),n.d(i,"distance",(function(){return a})),n.d(i,"isNumberEqual",(function(){return s})),n.d(i,"getBBoxByArray",(function(){return l})),n.d(i,"getBBoxRange",(function(){return c})),n.d(i,"piMod",(function(){return u}));var h=n(39),f={box:function(t,e,n,i){return l([t,n],[e,i])},length:function(t,e,n,i){return a(t,e,n,i)},pointAt:function(t,e,n,i,r){return{x:(1-r)*t+r*n,y:(1-r)*e+r*i}},pointDistance:function(t,e,n,i,r,o){var s=(n-t)*(r-t)+(i-e)*(o-e);return s<0?a(t,e,r,o):s>(n-t)*(n-t)+(i-e)*(i-e)?a(n,i,r,o):this.pointToLine(t,e,n,i,r,o)},pointToLine:function(t,e,n,i,r,o){var a=[n-t,i-e];if(h.exactEquals(a,[0,0]))return Math.sqrt((r-t)*(r-t)+(o-e)*(o-e));var s=[-a[1],a[0]];h.normalize(s,s);var l=[r-t,o-e];return Math.abs(h.dot(l,s))},tangentAngle:function(t,e,n,i){return Math.atan2(i-e,n-t)}};function p(t,e,n,i,r,o){var s,l=1/0,c=[n,i],u=20;o&&o>200&&(u=o/10);for(var h=1/u,f=h/10,p=0;p<=u;p++){var d=p*h,g=[r.apply(null,t.concat([d])),r.apply(null,e.concat([d]))];(x=a(c[0],c[1],g[0],g[1]))=0&&x=0?[r]:[]}function y(t,e,n,i){return 2*(1-i)*(e-t)+2*i*(n-e)}function v(t,e,n,i,r,o,a){var s=d(t,n,r,a),l=d(e,i,o,a),c=f.pointAt(t,e,n,i,a),u=f.pointAt(n,i,r,o,a);return[[t,e,c.x,c.y,s,l],[s,l,u.x,u.y,r,o]]}var m={box:function(t,e,n,i,r,o){var a=g(t,n,r)[0],s=g(e,i,o)[0],c=[t,r],u=[e,o];return void 0!==a&&c.push(d(t,n,r,a)),void 0!==s&&u.push(d(e,i,o,s)),l(c,u)},length:function(t,e,n,i,r,o){return function t(e,n,i,r,o,s,l){if(0===l)return(a(e,n,i,r)+a(i,r,o,s)+a(e,n,o,s))/2;var c=v(e,n,i,r,o,s,.5),u=c[0],h=c[1];return u.push(l-1),h.push(l-1),t.apply(null,u)+t.apply(null,h)}(t,e,n,i,r,o,3)},nearestPoint:function(t,e,n,i,r,o,a,s){return p([t,n,r],[e,i,o],a,s,d)},pointDistance:function(t,e,n,i,r,o,s,l){var c=this.nearestPoint(t,e,n,i,r,o,s,l);return a(c.x,c.y,s,l)},interpolationAt:d,pointAt:function(t,e,n,i,r,o,a){return{x:d(t,n,r,a),y:d(e,i,o,a)}},divide:function(t,e,n,i,r,o,a){return v(t,e,n,i,r,o,a)},tangentAngle:function(t,e,n,i,r,o,a){var s=y(t,n,r,a),l=y(e,i,o,a);return u(Math.atan2(l,s))}};function x(t,e,n,i,r){var o=1-r;return o*o*o*t+3*e*r*o*o+3*n*r*r*o+i*r*r*r}function b(t,e,n,i,r){var o=1-r;return 3*(o*o*(e-t)+2*o*r*(n-e)+r*r*(i-n))}function _(t,e,n,i){var r,o,a,l=-3*t+9*e-9*n+3*i,c=6*t-12*e+6*n,u=3*e-3*t,h=[];if(s(l,0))s(c,0)||(r=-u/c)>=0&&r<=1&&h.push(r);else{var f=c*c-4*l*u;s(f,0)?h.push(-c/(2*l)):f>0&&(o=(-c-(a=Math.sqrt(f)))/(2*l),(r=(-c+a)/(2*l))>=0&&r<=1&&h.push(r),o>=0&&o<=1&&h.push(o))}return h}function O(t,e,n,i,r,o,a,s,l){var c=x(t,n,r,a,l),u=x(e,i,o,s,l),h=f.pointAt(t,e,n,i,l),p=f.pointAt(n,i,r,o,l),d=f.pointAt(r,o,a,s,l),g=f.pointAt(h.x,h.y,p.x,p.y,l),y=f.pointAt(p.x,p.y,d.x,d.y,l);return[[t,e,h.x,h.y,g.x,g.y,c,u],[c,u,y.x,y.y,d.x,d.y,a,s]]}function w(t,e,n,i,r,o,s,l,c){if(0===c)return function(t,e){for(var n=0,i=t.length,r=0;r0?n:-1*n}var M=function(t,e,n,i,r,o){var a=n,s=i;if(0===a||0===s)return{x:t,y:e};for(var l,c,u=r-t,h=o-e,f=Math.abs(u),p=Math.abs(h),d=a*a,g=s*s,y=Math.PI/4,v=0;v<4;v++){l=a*Math.cos(y),c=s*Math.sin(y);var m=(d-g)*Math.pow(Math.cos(y),3)/a,x=(g-d)*Math.pow(Math.sin(y),3)/s,b=l-m,_=c-x,O=f-m,w=p-x,j=Math.hypot(_,b),M=Math.hypot(w,O);y+=j*Math.asin((b*w-_*O)/(j*M))/Math.sqrt(d+g-l*l-c*c),y=Math.min(Math.PI/2,Math.max(0,y))}return{x:t+S(l,u),y:e+S(c,h)}};function A(t,e,n,i,r,o){return n*Math.cos(r)*Math.cos(o)-i*Math.sin(r)*Math.sin(o)+t}function C(t,e,n,i,r,o){return n*Math.sin(r)*Math.cos(o)+i*Math.cos(r)*Math.sin(o)+e}function E(t,e,n){return{x:t*Math.cos(n),y:e*Math.sin(n)}}function I(t,e,n){var i=Math.cos(n),r=Math.sin(n);return[t*i-e*r,t*r+e*i]}var P={box:function(t,e,n,i,r,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,i,r),l=1/0,c=-1/0,u=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;oc&&(c=p)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,i,r),g=1/0,y=-1/0,v=[o,a];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var m=d+h;oy&&(y=x)}return{x:l,y:g,width:c-l,height:y-g}},length:function(t,e,n,i,r,o,a){},nearestPoint:function(t,e,n,i,r,o,a,s,l){var c=I(s-t,l-e,-r),u=c[0],h=c[1],f=M(0,0,n,i,u,h),p=function(t,e,n,i){return(Math.atan2(i*t,n*e)+2*Math.PI)%(2*Math.PI)}(n,i,f.x,f.y);pa&&(f=E(n,i,a));var d=I(f.x,f.y,r);return{x:d[0]+t,y:d[1]+e}},pointDistance:function(t,e,n,i,r,o,s,l,c){var u=this.nearestPoint(t,e,n,i,l,c);return a(u.x,u.y,l,c)},pointAt:function(t,e,n,i,r,o,a,s){var l=(a-o)*s+o;return{x:A(t,0,n,i,r,l),y:C(0,e,n,i,r,l)}},tangentAngle:function(t,e,n,i,r,o,a,s){var l=(a-o)*s+o,c=function(t,e,n,i,r,o,a,s){return-1*n*Math.cos(r)*Math.sin(s)-i*Math.sin(r)*Math.cos(s)}(0,0,n,i,r,0,0,l),h=function(t,e,n,i,r,o,a,s){return-1*n*Math.sin(r)*Math.sin(s)+i*Math.cos(r)*Math.cos(s)}(0,0,n,i,r,0,0,l);return u(Math.atan2(h,c))}};function F(t){for(var e=0,n=[],i=0;i1||e<0||t.length<2)return null;var n=F(t),i=n.segments,r=n.totalLength;if(0===r)return{x:t[0][0],y:t[0][1]};for(var o=0,a=null,s=0;s=o&&e<=o+h){var p=(e-o)/h;a=f.pointAt(c[0],c[1],u[0],u[1],p);break}o+=h}return a}function D(t,e){if(e>1||e<0||t.length<2)return 0;for(var n=F(t),i=n.segments,r=n.totalLength,o=0,a=0,s=0;s=o&&e<=o+h){a=Math.atan2(u[1]-c[1],u[0]-c[0]);break}o+=h}return a}function k(t,e,n){for(var i=1/0,r=0;r1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}Object(i.each)(t,(function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0},s=n(16);var l=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var i=!!e,r=[],o=0,a=t.length;o=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])}))}(t,e,n));else{var r=[].concat(t);"M"===r[0]&&(r[0]="L");for(var o=0;o<=n-1;o++)i.push(r)}return i}function h(t,e){if(1===t.length)return t;var n=t.length-1,i=e.length-1,r=n/i,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;c--)s=a[c].index,"add"===a[c].type?t.splice(s,0,[].concat(t[s])):t.splice(s,1)}if((r=t.length)0)){t[i]=e[i];break}n=g(n,t[i-1],1)}t[i]=["Q"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"T":t[i]=["T"].concat(n[0]);break;case"C":if(n.length<3){if(!(i>0)){t[i]=e[i];break}n=g(n,t[i-1],2)}t[i]=["C"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;case"S":if(n.length<2){if(!(i>0)){t[i]=e[i];break}n=g(n,t[i-1],1)}t[i]=["S"].concat(n.reduce((function(t,e){return t.concat(e)}),[]));break;default:t[i]=e[i]}return t}function v(t,e,n,i,r){return r?[["M",+t+ +r,e],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,i-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-i],["a",r,r,0,0,1,r,-r],["z"]]:[["M",t,e],["l",n,0],["l",0,i],["l",-n,0],["z"]]}var m="\t\n\v\f\r   ᠎              \u2028\u2029",x=new RegExp("([a-z])["+m+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+m+"]*,?["+m+"]*)+)","ig"),b=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+m+"]*,?["+m+"]*","ig");function _(t){if(!t)return null;if(Object(i.isArray)(t))return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(x,(function(t,i,r){var o=[],a=i.toLowerCase();if(r.replace(b,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([i].concat(o.splice(0,2))),a="l",i="m"===i?"l":"L"),"o"===a&&1===o.length&&n.push([i,o[0]]),"r"===a)n.push([i].concat(o));else for(;o.length>=e[a]&&(n.push([i].concat(o.splice(0,e[a]))),e[a]););return""})),n}var O=/[a-z]/;function w(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function j(t){var e=_(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,i=0;i=0){n=!0;break}}if(!n)return e;var o=[],a=0,s=0,l=0,c=0,u=0,h=e[0];"M"!==h[0]&&"m"!==h[0]||(l=a=+h[1],c=s=+h[2],u++,o[0]=["M",a,s]);i=u;for(var f=e.length;i1&&(r=1),r<-1&&(r=-1),(t*i-e*n<0?-1:1)*Math.acos(r)},E=function(t){var e=t.px,n=t.py,i=t.cx,r=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,l=void 0===s?0:s,c=t.largeArcFlag,u=void 0===c?0:c,h=t.sweepFlag,f=void 0===h?0:h,p=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:i,y:r}];var d=Math.sin(l*S/360),g=Math.cos(l*S/360),y=g*(e-i)/2+d*(n-r)/2,v=-d*(e-i)/2+g*(n-r)/2;if(0===y&&0===v)return[{x1:0,y1:0,x2:0,y2:0,x:i,y:r}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(y,2)/Math.pow(o,2)+Math.pow(v,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var x=function(t,e,n,i,r,o,a,s,l,c,u,h){var f=Math.pow(r,2),p=Math.pow(o,2),d=Math.pow(u,2),g=Math.pow(h,2),y=f*p-f*g-p*d;y<0&&(y=0),y/=f*g+p*d;var v=(y=Math.sqrt(y)*(a===s?-1:1))*r/o*h,m=y*-o/r*u,x=c*v-l*m+(t+n)/2,b=l*v+c*m+(e+i)/2,_=(u-v)/r,O=(h-m)/o,w=(-u-v)/r,j=(-h-m)/o,M=C(1,0,_,O),A=C(_,O,w,j);return 0===s&&A>0&&(A-=S),1===s&&A<0&&(A+=S),[x,b,M,A]}(e,n,i,r,o,a,u,f,d,g,y,v),b=x[0],_=x[1],O=x[2],w=x[3],j=Math.abs(w)/(S/4);Math.abs(1-j)<1e-7&&(j=1);var E=Math.max(Math.ceil(j),1);w/=E;for(var I=0;I7){t[n].shift();for(var i=t[n],r=n;i.length;)e[n]="A",t.splice(r+=1,0,["C"].concat(i.splice(0,6)));t.splice(n,1)}}var k=function(t,e,n,i,r){return t*(t*(-3*e+9*n-9*i+3*r)+6*e-12*n+6*i)-3*e+3*n},B=function(t,e,n,i,r,o,a,s,l){null===l&&(l=1);for(var c=(l=l>1?1:l<0?0:l)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,p=0;p<12;p++){var d=c*u[p]+c,g=k(d,t,n,r,a),y=k(d,e,i,o,s),v=g*g+y*y;f+=h[p]*Math.sqrt(v)}return c*f},N=function(t,e,n,i,r,o,a,s){for(var l,c,u,h,f=[],p=[[],[]],d=0;d<2;++d)if(0===d?(c=6*t-12*n+6*r,l=-3*t+9*n-9*r+3*a,u=3*n-3*t):(c=6*e-12*i+6*o,l=-3*e+9*i-9*o+3*s,u=3*i-3*e),Math.abs(l)<1e-12){if(Math.abs(c)<1e-12)continue;(h=-u/c)>0&&h<1&&f.push(h)}else{var g=c*c-4*u*l,y=Math.sqrt(g);if(!(g<0)){var v=(-c+y)/(2*l);v>0&&v<1&&f.push(v);var m=(-c-y)/(2*l);m>0&&m<1&&f.push(m)}}for(var x,b=f.length,_=b;b--;)x=1-(h=f[b]),p[0][b]=x*x*x*t+3*x*x*h*n+3*x*h*h*r+h*h*h*a,p[1][b]=x*x*x*e+3*x*x*h*i+3*x*h*h*o+h*h*h*s;return p[0][_]=t,p[1][_]=e,p[0][_+1]=a,p[1][_+1]=s,p[0].length=p[1].length=_+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}},R=function(t,e,n,i,r,o,a,s){if(!(Math.max(t,n)Math.max(r,a)||Math.max(e,i)Math.max(o,s))){var l=(t-n)*(o-s)-(e-i)*(r-a);if(l){var c=((t*i-e*n)*(r-a)-(t-n)*(r*s-o*a))/l,u=((t*i-e*n)*(o-s)-(e-i)*(r*s-o*a))/l,h=+c.toFixed(2),f=+u.toFixed(2);if(!(h<+Math.min(t,n).toFixed(2)||h>+Math.max(t,n).toFixed(2)||h<+Math.min(r,a).toFixed(2)||h>+Math.max(r,a).toFixed(2)||f<+Math.min(e,i).toFixed(2)||f>+Math.max(e,i).toFixed(2)||f<+Math.min(o,s).toFixed(2)||f>+Math.max(o,s).toFixed(2)))return{x:c,y:u}}}},V=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},z=function(t,e,n,i){return null===t&&(t=e=n=i=0),null===e&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:i,h:i,x2:t+n,y2:e+i,cx:t+n/2,cy:e+i/2,r1:Math.min(n,i)/2,r2:Math.max(n,i)/2,r0:Math.sqrt(n*n+i*i)/2,path:v(t,e,n,i),vb:[t,e,n,i].join(" ")}},G=function(t,e,n,r,o,a,s,l){Object(i.isArray)(t)||(t=[t,e,n,r,o,a,s,l]);var c=N.apply(null,t);return z(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},Y=function(t,e,n,i,r,o,a,s,l){var c=1-l,u=Math.pow(c,3),h=Math.pow(c,2),f=l*l,p=f*l,d=t+2*l*(n-t)+f*(r-2*n+t),g=e+2*l*(i-e)+f*(o-2*i+e),y=n+2*l*(r-n)+f*(a-2*r+n),v=i+2*l*(o-i)+f*(s-2*o+i);return{x:u*t+3*h*l*n+3*c*l*l*r+p*a,y:u*e+3*h*l*i+3*c*l*l*o+p*s,m:{x:d,y:g},n:{x:y,y:v},start:{x:c*t+l*n,y:c*e+l*i},end:{x:c*r+l*a,y:c*o+l*s},alpha:90-180*Math.atan2(d-y,g-v)/Math.PI}},X=function(t,e,n){if(!function(t,e){return t=z(t),e=z(e),V(e,t.x,t.y)||V(e,t.x2,t.y)||V(e,t.x,t.y2)||V(e,t.x2,t.y2)||V(t,e.x,e.y)||V(t,e.x2,e.y)||V(t,e.x,e.y2)||V(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(G(t),G(e)))return n?0:[];for(var i=~~(B.apply(0,t)/8),r=~~(B.apply(0,e)/8),o=[],a=[],s={},l=n?0:[],c=0;c=0&&x<=1&&b>=0&&b<=1&&(n?l++:l.push({x:m.x,y:m.y,t1:x,t2:b}))}}return l};function W(t,e){return function(t,e,n){var i,r,o,a,s,l,c,u,h,f;t=L(t),e=L(e);for(var p=n?0:[],d=0,g=t.length;d1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var g=n*n*(p*p)+r*r*(f*f),y=g?Math.sqrt((n*n*(r*r)-g)/g):1;a===s&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*n*p/r:0,m=n?y*-r*f/n:0,x=(l+u)/2+Math.cos(o)*v-Math.sin(o)*m,b=(c+h)/2+Math.sin(o)*v+Math.cos(o)*m,_=[(f-v)/n,(p-m)/r],O=[(-1*f-v)/n,(-1*p-m)/r],w=$([1,0],_),j=$(_,O);return Z(_,O)<=-1&&(j=Math.PI),Z(_,O)>=1&&(j=0),0===s&&j>0&&(j-=2*Math.PI),1===s&&j<0&&(j+=2*Math.PI),{cx:x,cy:b,rx:K(t,[u,h])?0:n,ry:K(t,[u,h])?0:r,startAngle:w,endAngle:w+j,xRotation:o,arcFlag:a,sweepFlag:s}}function J(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function tt(t){for(var e=[],n=null,i=null,r=null,o=0,s=(t=a(t)).length,l=0;l=e&&t<=n};function nt(t,e,n,i){var r=n.x-t.x,o=n.y-t.y,a=e.x-t.x,s=e.y-t.y,l=i.x-n.x,c=i.y-n.y,u=a*c-s*l,h=null;if(u*u>.001*(a*a+s*s)*(l*l+c*c)){var f=(r*c-o*l)/u,p=(r*s-o*a)/u;et(f,0,1)&&et(p,0,1)&&(h={x:t.x+f*a,y:t.y+f*s})}return h}function it(t){return Math.abs(t)<1e-6?0:t<0?-1:1}function rt(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function ot(t,e,n){var i=!1,r=t.length;if(r<=2)return!1;for(var o=0;o0!=it(s[1]-n)>0&&it(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(i=!i)}return i}function at(t){for(var e=[],n=t.length,i=0;i1){var a=t[0],s=t[n-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function st(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]}));return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,n),maxY:Math.max.apply(null,n)}}function lt(t,e){if(t.length<2||e.length<2)return!1;var n,r,o=st(t),a=st(e);if(n=o,(r=a).minX>n.maxX||r.maxXn.maxY||r.maxY0&&t.charCodeAt(e)<128?1:2}function o(t){if(t.length>400)return function(t){for(var e=t.map((function(t){var e=t.attr("text");return Object(i.isNil)(e)?"":""+e})),n=0,r=0,o=0;o=19968&&l<=40869?2:1}a>n&&(n=a,r=o)}return t[r].getBBox().width}(t);var e=0;return Object(i.each)(t,(function(t){var n=t.getBBox().width;e=0?function(t,e,n){void 0===n&&(n="tail");var i=t.length,o="";if("tail"===n){for(var a=0,s=0;a=0},t.prototype.getAdjustRange=function(t,e,n){var i,r,o=this.yField,a=n.indexOf(e),s=n.length;return!o&&this.isAdjust("y")?(i=0,r=1):s>1?(i=n[0===a?0:a-1],r=n[a===s-1?s-1:a+1],0!==a?i+=(e-i)/2:i-=(r-e)/2,a!==s-1?r-=(r-e)/2:r+=(e-n[s-2])/2):(i=0===e?0:e-.5,r=0===e?1:e+.5),{pre:i,next:r}},t.prototype.adjustData=function(t,e){var n=this,r=this.getDimValues(e);i.each(t,(function(t,e){i.each(r,(function(i,r){n.adjustDim(r,i,t,e)}))}))},t.prototype.groupData=function(t,e){return i.each(t,(function(t){void 0===t[e]&&(t[e]=r.a)})),i.groupBy(t,e)},t.prototype.adjustDim=function(t,e,n,i){},t.prototype.getDimValues=function(t){var e=this.xField,n=this.yField,o=i.assign({},this.dimValuesMap),a=[];if(e&&this.isAdjust("x")&&a.push(e),n&&this.isAdjust("y")&&a.push(n),a.forEach((function(e){o&&o[e]||(o[e]=i.valuesOfKey(t,e).sort((function(t,e){return t-e})))})),!n&&this.isAdjust("y")){o.y=[r.a,1]}return o},t}();e.a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return W})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return et}));var i={};n.r(i),n.d(i,"default",(function(){return D})),n.d(i,"assign",(function(){return g})),n.d(i,"format",(function(){return T})),n.d(i,"parse",(function(){return L})),n.d(i,"defaultI18n",(function(){return x})),n.d(i,"setGlobalDateI18n",(function(){return _})),n.d(i,"setGlobalDateMasks",(function(){return F}));var r=n(0),o={};function a(t,e){o[t]=e}var s=function(){function t(t){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=t,this.initCfg(),this.init()}return t.prototype.translate=function(t){return t},t.prototype.change=function(t){Object(r.assign)(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return Object(r.map)(this.ticks,(function(e,n){return Object(r.isObject)(e)?e:{text:t.getText(e,n),tickValue:e,value:t.scale(e)}}))},t.prototype.getText=function(t,e){var n=this.formatter,i=n?n(t,e):t;return Object(r.isNil)(i)||!Object(r.isFunction)(i.toString)?"":i.toString()},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){Object(r.assign)(this,this.__cfg__),this.setDomain(),Object(r.isEmpty)(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},t.prototype.initCfg=function(){},t.prototype.setDomain=function(){},t.prototype.calculateTicks=function(){var t=this.tickMethod,e=[];if(Object(r.isString)(t)){var n=o[t];if(!n)throw new Error("There is no method to to calculate ticks!");e=n(this)}else Object(r.isFunction)(t)&&(e=t(this));return e},t.prototype.rangeMin=function(){return this.range[0]},t.prototype.rangeMax=function(){return this.range[1]},t.prototype.calcPercent=function(t,e,n){return Object(r.isNumber)(t)?(t-e)/(n-e):NaN},t.prototype.calcValue=function(t,e,n){return e+t*(n-e)},t}(),l=n(1),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return Object(l.__extends)(e,t),e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;tthis.max?NaN:this.values[i]},e.prototype.getText=function(e){for(var n=[],i=1;i1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(s),u=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,h="[^\\s]+",f=/\[([^]*?)\]/gm;function p(t,e){for(var n=[],i=0,r=t.length;i-1?i:null}};function g(t){for(var e=[],n=1;n3?0:(t-t%10!=10?1:0)*t%10]}},b=g({},x),_=function(t){return b=g(b,t)},O=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},w=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+w(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+w(Math.floor(Math.abs(e)/60),2)+":"+w(Math.abs(e)%60,2)}},S=function(t){return+t-1},M=[null,"\\d\\d?"],A=[null,h],C=["isPm",h,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],E=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var n=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?n:-n}return 0}],I={D:["day","\\d\\d?"],DD:["day","\\d\\d"],Do:["day","\\d\\d?"+h,function(t){return parseInt(t,10)}],M:["month","\\d\\d?",S],MM:["month","\\d\\d",S],YY:["year","\\d\\d",function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour","\\d\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","\\d\\d?"],HH:["hour","\\d\\d"],m:["minute","\\d\\d?"],mm:["minute","\\d\\d"],s:["second","\\d\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond","\\d\\d",function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:M,dd:M,ddd:A,dddd:A,MMM:["month",h,d("monthNamesShort")],MMMM:["month",h,d("monthNames")],a:C,A:C,ZZ:E,Z:E},P={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},F=function(t){return g(P,t)},T=function(t,e,n){if(void 0===e&&(e=P.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var i=[];e=(e=P[e]||e).replace(f,(function(t,e){return i.push(e),"@@@"}));var r=g(g({},b),n);return(e=e.replace(u,(function(e){return j[e](t,r)}))).replace(/@@@/g,(function(){return i.shift()}))};function L(t,e,n){if(void 0===n&&(n={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=P[e]||e,t.length>1e3)return null;var i={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},r=[],o=[],a=e.replace(f,(function(t,e){return o.push(O(e)),"@@@"})),s={},l={};a=O(a).replace(u,(function(t){var e=I[t],n=e[0],i=e[1],o=e[3];if(s[n])throw new Error("Invalid format. "+n+" specified twice in format");return s[n]=!0,o&&(l[o]=!0),r.push(e),"("+i+")"})),Object.keys(l).forEach((function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")})),a=a.replace(/@@@/g,(function(){return o.shift()}));var c=t.match(new RegExp(a,"i"));if(!c)return null;for(var h,p=g(g({},b),n),d=1;d11||i.month<0||i.day>31||i.day<1||i.hour>23||i.hour<0||i.minute>59||i.minute<0||i.second>59||i.second<0)return null;return h}var D={format:T,parse:L,defaultI18n:x,setGlobalDateI18n:_,setGlobalDateMasks:F};function k(t,e){return(i.format||D.format)(t,e)}function B(t){return Object(r.isString)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),Object(r.isDate)(t)&&(t=t.getTime()),t}var N=36e5,R=24*N,V=31*R,z=[["HH:mm:ss",1e3],["HH:mm:ss",1e4],["HH:mm:ss",3e4],["HH:mm",6e4],["HH:mm",6e5],["HH:mm",18e5],["HH",N],["HH",6*N],["HH",12*N],["YYYY-MM-DD",R],["YYYY-MM-DD",4*R],["YYYY-WW",7*R],["YYYY-MM",V],["YYYY-MM",4*V],["YYYY-MM",6*V],["YYYY",380*R]];function G(t,e,n){var i,o=(i=function(t){return t[1]},function(t,e,n,o){for(var a=Object(r.isNil)(n)?0:n,s=Object(r.isNil)(o)?t.length:o;a>>1;i(t[l])>e?s=l:a=l+1}return a})(z,(e-t)/n)-1,a=z[o];return o<0?a=z[0]:o>=z.length&&(a=Object(r.last)(z)),a}var Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return Object(l.__extends)(e,t),e.prototype.translate=function(t){t=B(t);var e=this.values.indexOf(t);return-1===e&&(e=Object(r.isNumber)(t)&&t-1){var i=this.values[n],r=this.formatter;return i=r?r(i,e):k(i,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;Object(r.each)(e,(function(t,n){e[n]=B(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(c),X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return Object(l.__extends)(e,t),e.prototype.scale=function(t){if(Object(r.isNil)(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=Object(r.head)(e),i=Object(r.last)(e);nthis.max&&(this.max=i),Object(r.isNil)(this.minLimit)||(this.min=n),Object(r.isNil)(this.maxLimit)||(this.max=i)},e.prototype.setDomain=function(){var t=Object(r.getRange)(this.values),e=t.min,n=t.max;Object(r.isNil)(this.min)&&(this.min=e),Object(r.isNil)(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=Object(r.filter)(n,(function(t){return t>=e.min&&t<=e.max}))),n},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;return(t-n)/(e-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(s),W=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return Object(l.__extends)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(X);function H(t,e){var n=Math.E;return e>=0?Math.pow(n,Math.log(e)/t):-1*Math.pow(n,Math.log(-e)/t)}function U(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function q(t,e,n){Object(r.isNil)(n)&&(n=Math.max.apply(null,t));var i=n;return Object(r.each)(t,(function(t){t>0&&t1&&(i=1),i}var Z=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return Object(l.__extends)(e,t),e.prototype.invert=function(t){var e,n=this.base,i=U(n,this.max),r=this.rangeMin(),o=this.rangeMax()-r,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(i-(e=U(n,a/n)))*o;if(t=0?1:-1;return Math.pow(o,n)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var i=this.exponent;return(H(i,t)-H(i,n))/(H(i,e)-H(i,n))},e}(X),K=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return Object(l.__extends)(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),i=this.formatter;return i?i(n,e):k(n,this.mask)},e.prototype.scale=function(e){var n=e;return(Object(r.isString)(n)||Object(r.isDate)(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return B(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if(Object(r.isNil)(e)&&Object(r.isNumber)(e)||(this.min=this.translate(this.min)),Object(r.isNil)(n)&&Object(r.isNumber)(n)||(this.max=this.translate(this.max)),t&&t.length){var i=[],o=1/0,a=o,s=0;Object(r.each)(t,(function(t){var e=B(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");o>e?(a=o,o=e):a>e&&(a=e),s1&&(this.minTickInterval=a-o),Object(r.isNil)(e)&&(this.min=o),Object(r.isNil)(n)&&(this.max=s)}},e}(W),Q=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return Object(l.__extends)(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,i=this.getInvertPercent(t),o=Math.floor(i*(n-1));if(o>=n-1)return Object(r.last)(e);if(o<0)return Object(r.head)(e);var a=e[o],s=o/(n-1);return a+(i-s)/((o+1)/(n-1)-s)*(e[o+1]-a)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||(Object(r.last)(e)!==this.max&&e.push(this.max),Object(r.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(tObject(r.last)(e))return 1;var n=0;return Object(r.each)(e,(function(e,i){if(!(t>=e))return!1;n=i})),n/(e.length-1)},e}(X),J=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return Object(l.__extends)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Q),tt={};function et(t){return tt[t]}function nt(t,e){if(et(t))throw new Error("type '"+t+"' existed.");tt[t]=e}var it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return Object(l.__extends)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&Object(r.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},e}(s);function rt(t){var e=t.values,n=t.tickInterval,i=t.tickCount,o=t.showLast;if(Object(r.isNumber)(n)){var a=Object(r.filter)(e,(function(t,e){return e%n==0})),s=Object(r.last)(e);return o&&Object(r.last)(a)!==s&&a.push(s),a}var l=e.length,c=t.min,u=t.max;if(Object(r.isNil)(c)&&(c=0),Object(r.isNil)(u)&&(u=e.length-1),!Object(r.isNumber)(i)||i>=l)return e.slice(c,u+1);if(i<=0||u<=0)return[];for(var h=1===i?l:Math.floor(l/(i-1)),f=[],p=c,d=0;d=u);d++)p=Math.min(c+d*h,u),d===i-1&&o?f.push(e[u]):f.push(e[p]);return f}var ot=Math.sqrt(50),at=Math.sqrt(10),st=Math.sqrt(2),lt=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,n;void 0===t&&(t=5);var i,r=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],l=this._domain[a];return l0?i=ct(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,t):i<0&&(i=ct(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,t)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(l/i)*i,this.domain(r)):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(l*i)/i,this.domain(r)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,n){var i,r,o,a,s=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];(i=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(r=Math.ceil(e-t+1));++s=0?(o>=ot?10:o>=at?5:o>=st?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(o>=ot?10:o>=at?5:o>=st?2:1)}function ut(t,e,n){return("ceil"===n?Math.ceil(t/e):"floor"===n?Math.floor(t/e):Math.round(t/e))*e}function ht(t,e,n){var i=ut(t,n,"floor"),o=ut(e,n,"ceil");i=Object(r.fixedBase)(i,n),o=Object(r.fixedBase)(o,n);for(var a=[],s=Math.max((o-i)/(Math.pow(2,12)-1),n),l=i;l<=o;l+=s){var c=Object(r.fixedBase)(l,s);a.push(c)}return{min:i,max:o,ticks:a}}function ft(t,e,n){var i,o=t.minLimit,a=t.maxLimit,s=t.min,l=t.max,c=t.tickCount,u=void 0===c?5:c,h=Object(r.isNil)(o)?Object(r.isNil)(e)?s:e:o,f=Object(r.isNil)(a)?Object(r.isNil)(n)?l:n:a;if(h>f&&(f=(i=[h,f])[0],h=i[1]),u<=2)return[h,f];for(var p=(f-h)/(u-1),d=[],g=0;g=0&&(c=1),1-l/(s-1)-n+c}function vt(t,e,n){var i=Object(r.size)(e);return 1-Object(r.indexOf)(e,t)/(i-1)-n+1}function mt(t,e,n,i,r,o){var a=(t-1)/(o-r),s=(e-1)/(Math.max(o,i)-Math.min(n,r));return 2-Math.max(a/s,s/a)}function xt(t,e){return t>=e?2-(t-1)/(e-1):1}function bt(t,e,n,i){var r=e-t;return 1-.5*(Math.pow(e-i,2)+Math.pow(t-n,2))/Math.pow(.1*r,2)}function _t(t,e,n){var i=e-t;if(n>i){var r=(n-i)/2;return 1-Math.pow(r,2)/Math.pow(.1*i,2)}return 1}function Ot(t,e,n,i,o,a){void 0===n&&(n=5),void 0===i&&(i=!0),void 0===o&&(o=dt),void 0===a&&(a=[.25,.2,.5,.05]);var s=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!s)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===s)return{min:t,max:e,ticks:[t]};if(e-t>1e148){var l=(e-t)/(O=n||5);return{min:t,max:e,ticks:Array(O).fill(null).map((function(e,n){return pt(t+l*n)}))}}for(var c={score:-2,lmin:0,lmax:0,lstep:0},u=1;u<1/0;){for(var h=0;hc.score&&(!i||j<=t&&S>=e)&&(c.lmin=j,c.lmax=S,c.lstep=M,c.score=I)}v+=1}d+=1}}u+=1}var P=pt(c.lmax),F=pt(c.lmin),T=pt(c.lstep),L=Math.floor(function(t){return Math.round(1e12*t)/1e12}((P-F)/T))+1,D=new Array(L);D[0]=pt(F);for(h=1;h1&&(r*=Math.ceil(a)),i&&r31536e6)for(var l=St(n),c=Math.ceil(o/31536e6),u=s;u<=l+c;u+=c)a.push(Mt(u));else if(o>V){var h=Math.ceil(o/V),f=At(e),p=function(t,e){var n=St(t),i=St(e),r=At(t);return 12*(i-n)+(At(e)-r)%12}(e,n);for(u=0;u<=p+h;u+=h)a.push(Ct(s,u+f))}else if(o>R){var d=(x=new Date(e)).getFullYear(),g=x.getMonth(),y=x.getDate(),v=Math.ceil(o/R),m=function(t,e){return Math.ceil((e-t)/R)}(e,n);for(u=0;uN){d=(x=new Date(e)).getFullYear(),g=x.getMonth(),v=x.getDate();var x,b=x.getHours(),_=Math.ceil(o/N),O=function(t,e){return Math.ceil((e-t)/N)}(e,n);for(u=0;u<=O+_;u+=_)a.push(new Date(d,g,v,b+u).getTime())}else if(o>6e4){var w=function(t,e){return Math.ceil((e-t)/6e4)}(e,n),j=Math.ceil(o/6e4);for(u=0;u<=w+j;u+=j)a.push(e+6e4*u)}else{var S=o;S<1e3&&(S=1e3);var M=1e3*Math.floor(e/1e3),A=Math.ceil((n-e)/1e3),C=Math.ceil(S/1e3);for(u=0;u=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a})),a("log",(function(t){var e,n=t.base,i=t.tickCount,r=t.min,o=t.max,a=t.values,s=U(n,o);if(r>0)e=Math.floor(U(n,r));else{var l=q(a,n,o);e=Math.floor(U(n,l))}for(var c=s-e,u=Math.ceil(c/i),h=[],f=e;f=0?1:-1;return Math.pow(t,e)*n}))})),a("quantile",(function(t){var e=t.tickCount,n=t.values;if(!n||!n.length)return[];for(var i=n.slice().sort((function(t,e){return t-e})),r=[],o=0;o1?1:Number(e),i=t.length-1,r=Math.floor(i*n),o=i*n-r,a=t[r],s=r===i?a:t[r+1];return c([l(a,s,o,0),l(a,s,o,1),l(a,s,o,2)])}(n,t)}},toRGB:Object(i.memoize)(p),toCSSGradient:function(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,n=void 0;if("l"===t[0]){var r=+(l=o.exec(t))[1]+90;n=l[2],e="linear-gradient("+r+"deg, "}else if("r"===t[0]){var l;e="radial-gradient(",n=(l=a.exec(t))[4]}var c=n.match(s);return Object(i.each)(c,(function(t,n){var i=t.split(":");e+=i[1]+" "+100*i[0]+"%",n!==c.length-1&&(e+=", ")})),e+=")"}return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AXIS_META_CONFIG_KEYS=void 0,e.AXIS_META_CONFIG_KEYS=["type","alias","tickCount","tickInterval","min","max","nice","minLimit","maxLimit","range","tickMethod","base","exponent","mask","sync"]},function(t,e,n){"use strict";var i=n(1),r=n(9),o=n(0),a=n(4),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{container:null,containerTpl:"
",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){this.get("container").style.display="",this.set("visible",!0)},e.prototype.hide=function(){this.get("container").style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var e=t?"auto":"none";this.getContainer().style.pointerEvents=e,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer(),e=parseFloat(t.style.left)||0,n=parseFloat(t.style.top)||0;return Object(a.b)(e,n,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){var t=this.get("container");Object(a.a)(t)},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),t.prototype.destroy.call(this)},e.prototype.init=function(){t.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if(Object(o.isNil)(t)){t=this.createDom();var e=this.get("parent");Object(o.isString)(e)&&(e=document.getElementById(e),this.set("parent",e)),e.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else Object(o.isString)(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),e=this.get("defaultStyles");t=t?Object(o.deepMix)({},e,t):e,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(t){var e=this.getContainer();this.applyChildrenStyles(e,t);var n=this.get("containerClassName");if(n&&Object(a.h)(e,n)){var i=t[n];Object(r.e)(e,i)}}},e.prototype.applyChildrenStyles=function(t,e){Object(o.each)(e,(function(e,n){var i=t.getElementsByClassName(n);Object(o.each)(i,(function(t){Object(r.e)(t,e)}))}))},e.prototype.applyStyle=function(t,e){var n=this.get("domStyles");Object(r.e)(e,n[t])},e.prototype.createDom=function(){var t=this.get("containerTpl");return Object(r.b)(t)},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){Object(o.hasKey)(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(n(38).a);e.a=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a}));var i=0,r=.5,o=.5,a=.05},function(t,e,n){"use strict";n.d(e,"getAdjust",(function(){return r})),n.d(e,"registerAdjust",(function(){return o}));n(24),n(46);var i={},r=function(t){return i[t.toLowerCase()]},o=function(t,e){if(r(t))throw new Error("Adjust type '"+t+"' existed.");i[t.toLowerCase()]=e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(0);function r(t,e,n){var r=e+"Style",o=null;return Object(i.each)(n,(function(e,n){t[n]&&e[r]&&(o||(o={}),Object(i.mix)(o,e[r]))})),o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolveAllPadding=e.getAdjustAppendPadding=e.normalPadding=void 0;var i=n(0);function r(t){if(i.isNumber(t))return[t,t,t,t];if(i.isArray(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}e.normalPadding=r,e.getAdjustAppendPadding=function(t,e,n){void 0===e&&(e="bottom"),void 0===n&&(n=25);var i=r(t),o=[e.startsWith("top")?n:0,e.startsWith("right")?n:0,e.startsWith("bottom")?n:0,e.startsWith("left")?n:0];return[i[0]+o[0],i[1]+o[1],i[2]+o[2],i[3]+o[3]]},e.resolveAllPadding=function(t){var e=t.map((function(t){return r(t)})),n=[0,0,0,0];return e.length>0&&(n=n.map((function(t,n){return e.forEach((function(i,r){t+=e[r][n]})),t}))),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pattern=void 0;var i=n(1),r=n(7),o=n(0),a=n(84),s=n(2);e.pattern=function(t){var e=this;return function(n){var l,c=n.options,u=n.chart,h=c.pattern;if(!h)return n;return s.deepAssign({},n,{options:(l={},l[t]=function(n){for(var l,f,p,d=[],g=1;g0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]}function C(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t}function E(t,e,n,i){var r=e[0],o=e[1];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t}function I(t,e){e=e||1;var n=2*i.c()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function P(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t}function F(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t}function T(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t}function L(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t}function D(t,e,n,i){var r=e[0]-n[0],o=e[1]-n[1],a=Math.sin(i),s=Math.cos(i);return t[0]=r*s-o*a+n[0],t[1]=r*a+o*s+n[1],t}function k(t,e){var n=t[0],i=t[1],r=e[0],o=e[1],a=Math.sqrt(n*n+i*i)*Math.sqrt(r*r+o*o),s=a&&(n*r+i*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function B(t){return t[0]=0,t[1]=0,t}function N(t){return"vec2("+t[0]+", "+t[1]+")"}function R(t,e){return t[0]===e[0]&&t[1]===e[1]}function V(t,e){var n=t[0],r=t[1],o=e[0],a=e[1];return Math.abs(n-o)<=i.b*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=i.b*Math.max(1,Math.abs(r),Math.abs(a))}var z,G=O,Y=u,X=h,W=f,H=b,U=_,q=w,Z=(z=r(),function(t,e,n,i,r,o){var a,s;for(e||(e=2),n||(n=0),s=i?Math.min(i*e+n,t.length):t.length,a=n;a
',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}},showCrosshairs:!0,crosshairs:{type:"x"}},e.DEFAULT_OPTIONS={appendPadding:2,tooltip:i.__assign({},e.DEFAULT_TOOLTIP_OPTIONS),animation:{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.PATH_FIELD=e.ID_FIELD=void 0,e.ID_FIELD="id",e.PATH_FIELD="path",e.DEFAULT_OPTIONS={appendPadding:[10,0,20,0],blendMode:"multiply",tooltip:{showTitle:!1,showMarkers:!1,fields:["id","size"],formatter:function(t){return{name:t.id,value:t.size}}},legend:{position:"top-left"},label:{style:{textAlign:"center",fill:"#fff"}},interactions:[{type:"legend-filter",enable:!1}],state:{active:{style:{stroke:"#000"}},selected:{style:{stroke:"#000",lineWidth:2}},inactive:{style:{fillOpacity:.3,strokeOpacity:.3}}},defaultInteractions:["tooltip","venn-legend-active"]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAllNodes=e.getField=e.NODE_ANCESTORS_FIELD=e.CHILD_NODE_COUNT=e.NODE_INDEX_FIELD=void 0;var i=n(0);e.NODE_INDEX_FIELD="nodeIndex",e.CHILD_NODE_COUNT="childNodeCount",e.NODE_ANCESTORS_FIELD="nodeAncestor";e.getField=function(t,e){var n=t.field,r=t.fields;if(i.isString(n))return n;if(i.isArray(n))return console.warn("Invalid field: it must be a string!"),n[0];if(console.warn("Invalid field: it must be a string! will try to get fields instead."),i.isString(r))return r;if(i.isArray(r)&&r.length)return r[0];if(e)return e;throw new TypeError("Invalid field: it must be a string!")},e.getAllNodes=function(t){var n,r,o=[];return t&&t.each?t.each((function(t){var a,s;t.parent!==n?(n=t.parent,r=0):r+=1;var l=i.filter(((null===(a=t.ancestors)||void 0===a?void 0:a.call(t))||[]).map((function(t){return o.find((function(e){return e.name===t.name}))||t})),(function(e){var n=e.depth;return n>0&&n=0})),o=n.every((function(t){return r.get(t,[e])<=0}));return i?{min:0}:o?{max:0}:{}},e.transformDataToNodeLinkData=function(t,e,n,r,o){if(void 0===o&&(o=[]),!Array.isArray(t))return{nodes:[],links:[]};var s=[],l={},c=-1;return t.forEach((function(t){var u=t[e],h=t[n],f=t[r],p=a.pick(t,o);l[u]||(l[u]=i.__assign({id:++c,name:u},p)),l[h]||(l[h]=i.__assign({id:++c,name:h},p)),s.push(i.__assign({source:l[u].id,target:l[h].id,value:f},p))})),{nodes:Object.values(l).sort((function(t,e){return t.id-e.id})),links:s}},e.processIllegalData=function(t,e){var n=r.filter(t,(function(t){var n=t[e];return null===n||"number"==typeof n&&!isNaN(n)}));return o.log(o.LEVEL.WARN,n.length===t.length,"illegal data existed in chart data."),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.meta=void 0;var i=n(10),r=n(2),o=n(15),a=n(42),s=n(35),l=n(48);function c(t){var e=t.chart,n=t.options,i=n.data,l=n.color,c=n.areaStyle,u=n.point,h=n.line,f=null==u?void 0:u.state,p=s.getTinyData(i);e.data(p);var d=r.deepAssign({},t,{options:{xField:a.X_FIELD,yField:a.Y_FIELD,area:{color:l,style:c},line:h,point:u}}),g=r.deepAssign({},d,{options:{tooltip:!1}}),y=r.deepAssign({},d,{options:{tooltip:!1,state:f}});return o.area(d),o.line(g),o.point(y),e.axis(!1),e.legend(!1),t}function u(t){var e,n,o=t.options,c=o.xAxis,u=o.yAxis,h=o.data,f=s.getTinyData(h);return r.flow(i.scale(((e={})[a.X_FIELD]=c,e[a.Y_FIELD]=u,e),((n={})[a.X_FIELD]={type:"cat"},n[a.Y_FIELD]=l.adjustYMetaByZero(f,a.Y_FIELD),n)))(t)}e.meta=u,e.adaptor=function(t){return r.flow(i.pattern("areaStyle"),c,u,i.tooltip,i.theme,i.animation,i.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.conversionTagComponent=e.transformData=e.CONVERSION_TAG_NAME=void 0;var i=n(1),r=n(0),o=n(36);e.CONVERSION_TAG_NAME="CONVERSION_TAG_NAME",e.transformData=function(t,e,n){var i=n.yField,a=n.maxSize,s=n.minSize,l=r.get(r.maxBy(e,i),[i]),c=r.isNumber(a)?a:1,u=r.isNumber(s)?s:0;return r.map(t,(function(e,n){var a=(e[i]||0)/l;return e[o.FUNNEL_PERCENT]=a,e[o.FUNNEL_MAPPING_VALUE]=(c-u)*a+u,e[o.FUNNEL_CONVERSATION]=[r.get(t,[n-1,i]),e[i]],e}))},e.conversionTagComponent=function(t){return function(n){var a=n.chart,s=n.options,l=s.conversionTag,c=s.filteredData||a.getOptions().data;if(l){var u=l.formatter;c.forEach((function(n,s){if(!(s<=0||Number.isNaN(n[o.FUNNEL_MAPPING_VALUE]))){var h=t(n,s,c,{top:!0,name:e.CONVERSION_TAG_NAME,text:{content:r.isFunction(u)?u(n,c):u,offsetX:l.offsetX,offsetY:l.offsetY,position:"end",autoRotate:!1,style:i.__assign({textAlign:"start",textBaseline:"middle"},l.style)}});a.annotation().line(h)}}))}return n}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DrillDownAction=e.HIERARCHY_DATA_TRANSFORM_PARAMS=e.DEFAULT_BREAD_CRUMB_CONFIG=e.BREAD_CRUMB_NAME=e.PADDING_TOP=void 0;var i=n(1),r=n(7),o=n(0),a=n(77);e.PADDING_TOP=5,e.BREAD_CRUMB_NAME="drilldown-bread-crumb",e.DEFAULT_BREAD_CRUMB_CONFIG={position:"top-left",dividerText:"/",textStyle:{fontSize:12,fill:"rgba(0, 0, 0, 0.65)",cursor:"pointer"},activeTextStyle:{fill:"#87B5FF"}},e.HIERARCHY_DATA_TRANSFORM_PARAMS="hierarchy-data-transform-params";var s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.name="drill-down",n.historyCache=[],n.breadCrumbGroup=null,n.breadCrumbCfg=e.DEFAULT_BREAD_CRUMB_CONFIG,n}return i.__extends(n,t),n.prototype.click=function(){var t=o.get(this.context,["event","data","data"]);if(!t)return!1;this.drill(t),this.drawBreadCrumb()},n.prototype.resetPosition=function(){if(this.breadCrumbGroup){var t=this.context.view.getCoordinate(),n=this.breadCrumbGroup,i=n.getBBox(),o=this.getButtonCfg().position,a={x:t.start.x,y:t.end.y-(i.height+2*e.PADDING_TOP)};t.isPolar&&(a={x:0,y:0}),"bottom-left"===o&&(a={x:t.start.x,y:t.start.y});var s=r.Util.transform(null,[["t",a.x+0,a.y+i.height+e.PADDING_TOP]]);n.setMatrix(s)}},n.prototype.back=function(){o.size(this.historyCache)&&this.backTo(this.historyCache.slice(0,-1))},n.prototype.reset=function(){this.historyCache[0]&&this.backTo(this.historyCache.slice(0,1)),this.historyCache=[],this.hideCrumbGroup()},n.prototype.drill=function(t){var n=this.context.view,r=o.get(n,["interactions","drill-down","cfg","transformData"],(function(t){return t})),a=r(i.__assign({data:t.data},t[e.HIERARCHY_DATA_TRANSFORM_PARAMS]));n.changeData(a);for(var s=[],l=t;l;){var c=l.data;s.unshift({id:c.name+"_"+l.height+"_"+l.depth,name:c.name,children:r(i.__assign({data:c},t[e.HIERARCHY_DATA_TRANSFORM_PARAMS]))}),l=l.parent}this.historyCache=(this.historyCache||[]).slice(0,-1).concat(s)},n.prototype.backTo=function(t){if(t&&!(t.length<=0)){var e=this.context.view,n=o.last(t).children;e.changeData(n),t.length>1?(this.historyCache=t,this.drawBreadCrumb()):(this.historyCache=[],this.hideCrumbGroup())}},n.prototype.getButtonCfg=function(){var t=this.context.view,e=o.get(t,["interactions","drill-down","cfg","drillDownConfig"]);return a.deepAssign(this.breadCrumbCfg,null==e?void 0:e.breadCrumb,this.cfg)},n.prototype.drawBreadCrumb=function(){this.drawBreadCrumbGroup(),this.resetPosition(),this.breadCrumbGroup.show()},n.prototype.drawBreadCrumbGroup=function(){var t=this,n=this.getButtonCfg(),r=this.historyCache;this.breadCrumbGroup?this.breadCrumbGroup.clear():this.breadCrumbGroup=this.context.view.foregroundGroup.addGroup({name:e.BREAD_CRUMB_NAME});var a=0;r.forEach((function(s,l){var c=t.breadCrumbGroup.addShape({type:"text",id:s.id,name:e.BREAD_CRUMB_NAME+"_"+s.name+"_text",attrs:i.__assign(i.__assign({text:0!==l||o.isNil(n.rootText)?s.name:n.rootText},n.textStyle),{x:a,y:0})}),u=c.getBBox();if(a+=u.width+4,c.on("click",(function(e){var n,i=e.target.get("id");if(i!==(null===(n=o.last(r))||void 0===n?void 0:n.id)){var a=r.slice(0,r.findIndex((function(t){return t.id===i}))+1);t.backTo(a)}})),c.on("mouseenter",(function(t){var e;t.target.get("id")!==(null===(e=o.last(r))||void 0===e?void 0:e.id)?c.attr(n.activeTextStyle):c.attr({cursor:"default"})})),c.on("mouseleave",(function(){c.attr(n.textStyle)})),l0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function A(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function C(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],l=n[2];return t[0]=r*l-o*s,t[1]=o*a-i*l,t[2]=i*s-r*a,t}function E(t,e,n,i){var r=e[0],o=e[1],a=e[2];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=a+i*(n[2]-a),t}function I(t,e,n,i,r,o){var a=o*o,s=a*(2*o-3)+1,l=a*(o-2)+o,c=a*(o-1),u=a*(3-2*o);return t[0]=e[0]*s+n[0]*l+i[0]*c+r[0]*u,t[1]=e[1]*s+n[1]*l+i[1]*c+r[1]*u,t[2]=e[2]*s+n[2]*l+i[2]*c+r[2]*u,t}function P(t,e,n,i,r,o){var a=1-o,s=a*a,l=o*o,c=s*a,u=3*o*s,h=3*l*a,f=l*o;return t[0]=e[0]*c+n[0]*u+i[0]*h+r[0]*f,t[1]=e[1]*c+n[1]*u+i[1]*h+r[1]*f,t[2]=e[2]*c+n[2]*u+i[2]*h+r[2]*f,t}function F(t,e){e=e||1;var n=2*i.c()*Math.PI,r=2*i.c()-1,o=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=r*e,t}function T(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/a,t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,t}function L(t,e,n){var i=e[0],r=e[1],o=e[2];return t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8],t}function D(t,e,n){var i=n[0],r=n[1],o=n[2],a=n[3],s=e[0],l=e[1],c=e[2],u=r*c-o*l,h=o*s-i*c,f=i*l-r*s,p=r*f-o*h,d=o*u-i*f,g=i*h-r*u,y=2*a;return u*=y,h*=y,f*=y,p*=2,d*=2,g*=2,t[0]=s+u+p,t[1]=l+h+d,t[2]=c+f+g,t}function k(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0],o[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),o[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function B(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),o[1]=r[1],o[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function N(t,e,n,i){var r=[],o=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],o[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),o[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),o[2]=r[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function R(t,e){var n=t[0],i=t[1],r=t[2],o=e[0],a=e[1],s=e[2],l=Math.sqrt(n*n+i*i+r*r)*Math.sqrt(o*o+a*a+s*s),c=l&&A(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}function V(t){return t[0]=0,t[1]=0,t[2]=0,t}function z(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function G(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function Y(t,e){var n=t[0],r=t[1],o=t[2],a=e[0],s=e[1],l=e[2];return Math.abs(n-a)<=i.b*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-s)<=i.b*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(o-l)<=i.b*Math.max(1,Math.abs(o),Math.abs(l))}var X,W=h,H=f,U=p,q=_,Z=O,$=a,K=w,Q=(X=r(),function(t,e,n,i,r,o){var a,s;for(e||(e=3),n||(n=0),s=i?Math.min(i*e+n,t.length):t.length,a=n;a=i&&t<=r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.adjust=e.legend=e.axis=e.meta=void 0;var i=n(1),r=n(0),o=n(10),a=n(2),s=n(15),l=n(2),c=n(48);function u(t){var e=t.chart,n=t.options,r=n.data,o=n.color,l=n.lineStyle,c=n.lineShape,u=n.point,h=n.area,f=n.seriesField,p=null==u?void 0:u.state,d=null==h?void 0:h.state;e.data(r);var g=a.deepAssign({},t,{options:{shapeField:f,line:{color:o,style:l,shape:c},point:u&&i.__assign({color:o,shape:"circle"},u),area:h&&i.__assign({color:o},h),label:void 0}}),y=a.deepAssign({},g,{options:{tooltip:!1,state:p}}),v=a.deepAssign({},g,{options:{tooltip:!1,state:d}});return s.line(g),s.point(y),s.area(v),t}function h(t){var e,n,i=t.options,r=i.xAxis,a=i.yAxis,s=i.xField,u=i.yField,h=i.data;return l.flow(o.scale(((e={})[s]=r,e[u]=a,e),((n={})[s]={type:"cat"},n[u]=c.adjustYMetaByZero(h,u),n)))(t)}function f(t){var e=t.chart,n=t.options.reflect;if(n){var i=n;r.isArray(i)||(i=[i]);var o=i.map((function(t){return["reflect",t]}));e.coordinate({type:"rect",actions:o})}return t}function p(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField,a=n.yField;return!1===i?e.axis(o,!1):e.axis(o,i),!1===r?e.axis(a,!1):e.axis(a,r),t}function d(t){var e=t.chart,n=t.options,i=n.legend,r=n.seriesField;return i&&r?e.legend(r,i):!1===i&&e.legend(!1),t}function g(t){var e=t.chart,n=t.options,r=n.label,o=n.yField,s=a.findGeometry(e,"line");if(r){var l=r.callback,c=i.__rest(r,["callback"]);s.label({fields:[o],callback:l,cfg:i.__assign({layout:[{type:"limit-in-plot"},{type:"path-adjust-position"},{type:"point-adjust-position"},{type:"limit-in-plot",cfg:{action:"hide"}}]},a.transformLabel(c))})}else s.label(!1);return t}function y(t){var e=t.chart;return t.options.isStack&&r.each(e.geometries,(function(t){t.adjust("stack")})),t}e.meta=h,e.axis=p,e.legend=d,e.adjust=y,e.adaptor=function(t){return l.flow(u,h,y,o.theme,f,p,d,o.tooltip,g,o.slider,o.scrollbar,o.interaction,o.animation,o.annotation(),o.limitInPlot)(t)}},function(t,e,n){"use strict";function i(t){return(i="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})(t)}function r(){return"object"===("undefined"==typeof window?"undefined":i(window))?null===window||void 0===window?void 0:window.devicePixelRatio:2}Object.defineProperty(e,"__esModule",{value:!0}),e.transformMatrix=e.getSymbolsPosition=e.getUnitPatternSize=e.drawBackground=e.initCanvas=e.getPixelRatio=void 0,e.getPixelRatio=r,e.initCanvas=function(t,e){void 0===e&&(e=t);var n=document.createElement("canvas"),i=r();return n.width=t*i,n.height=e*i,n.style.width=t+"px",n.style.height=e+"px",n.getContext("2d").scale(i,i),n},e.drawBackground=function(t,e,n,i){void 0===i&&(i=n);var r=e.backgroundColor,o=e.opacity;t.globalAlpha=o,t.fillStyle=r,t.beginPath(),t.fillRect(0,0,n,i),t.closePath()},e.getUnitPatternSize=function(t,e,n){var i=t+e;return n?2*i:i},e.getSymbolsPosition=function(t,e){return e?[[t*(1/4),t*(1/4)],[t*(3/4),t*(3/4)]]:[[.5*t,.5*t]]},e.transformMatrix=function(t,e){var n=e*Math.PI/180;return{a:Math.cos(n)*(1/t),b:Math.sin(n)*(1/t),c:-Math.sin(n)*(1/t),d:Math.cos(n)*(1/t),e:0,f:0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DualAxesGeometry=e.AxisType=void 0,function(t){t.Left="Left",t.Right="Right"}(e.AxisType||(e.AxisType={})),function(t){t.Line="line",t.Column="column"}(e.DualAxesGeometry||(e.DualAxesGeometry={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getYAxisWithDefault=e.transformObjectToArray=e.getGeometryOption=e.isColumn=e.isLine=void 0;var i=n(1),r=n(0),o=n(2),a=n(59),s=n(106);function l(t){return r.get(t,"geometry")===a.DualAxesGeometry.Column}e.isLine=function(t){return r.get(t,"geometry")===a.DualAxesGeometry.Line},e.isColumn=l,e.getGeometryOption=function(t,e,n){return l(n)?o.deepAssign({},{geometry:a.DualAxesGeometry.Column,label:n.label&&n.isRange?{content:function(t){var n;return null===(n=t[e])||void 0===n?void 0:n.join("-")}}:void 0},n):i.__assign({geometry:a.DualAxesGeometry.Line},n)},e.transformObjectToArray=function(t,e){var n=t[0],i=t[1];return r.isArray(e)?[e[0],e[1]]:[r.get(e,n),r.get(e,i)]},e.getYAxisWithDefault=function(t,e){return e===a.AxisType.Left?!1!==t&&o.deepAssign({},s.DEFAULT_LEFT_YAXIS_CONFIG,t):e===a.AxisType.Right?!1!==t&&o.deepAssign({},s.DEFAULT_RIGHT_YAXIS_CONFIG,t):t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.geometry=void 0;var i=n(0),r=n(2),o=n(10),a=n(15),s=n(117),l=n(62);function c(t){var e=t.chart,n=t.options,o=n.percent,c=n.progressStyle,u=n.color,h=n.barWidthRatio;e.data(l.getProgressData(o));var f=r.deepAssign({},t,{options:{xField:"current",yField:"percent",seriesField:"type",widthRatio:h,interval:{style:c,color:i.isString(u)?[u,s.DEFAULT_COLOR[1]]:u},args:{zIndexReversed:!0,sortZIndex:!0}}});return a.interval(f),e.tooltip(!1),e.axis(!1),e.legend(!1),t}function u(t){return t.chart.coordinate("rect").transpose(),t}e.geometry=c,e.adaptor=function(t){return r.flow(c,o.scale({}),u,o.animation,o.theme,o.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getProgressData=void 0;var i=n(0),r=n(56);e.getProgressData=function(t){var e=i.clamp(r.isRealNumber(t)?t:0,0,1);return[{current:""+e,type:"current",percent:e},{current:""+e,type:"target",percent:1}]}},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.OUTLIERS_VIEW_ID=e.BOX_SYNC_NAME=e.BOX_RANGE_ALIAS=e.BOX_RANGE=void 0;var r=n(6),o=n(2);e.BOX_RANGE="$$range$$",e.BOX_RANGE_ALIAS="low-q1-median-q3-high",e.BOX_SYNC_NAME="$$y_outliers$$",e.OUTLIERS_VIEW_ID="outliers_view",e.DEFAULT_OPTIONS=o.deepAssign({},r.Plot.getDefaultOptions(),{meta:(i={},i[e.BOX_RANGE]={min:0,alias:e.BOX_RANGE_ALIAS},i),interactions:[{type:"active-region"}],tooltip:{showMarkers:!1,shared:!0},boxStyle:{lineWidth:1}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.placeElementsOrdered=void 0,e.placeElementsOrdered=function(t){t&&t.geometries[0].elements.forEach((function(t){t.shape.toFront()}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.DEFAULT_TOOLTIP_OPTIONS=e.TREND_DOWN=e.TREND_UP=e.TREND_FIELD=e.Y_FIELD=void 0;var i=n(6),r=n(2);e.Y_FIELD="$$stock-range$$",e.TREND_FIELD="trend",e.TREND_UP="up",e.TREND_DOWN="down",e.DEFAULT_TOOLTIP_OPTIONS={showMarkers:!1,showCrosshairs:!0,shared:!0,crosshairs:{type:"xy",follow:!0,text:function(t,e,n){var i;if("x"===t){var r=n[0];i=r?r.title:e}else i=e;return{position:"y"===t?"start":"end",content:i,style:{fill:"#dfdfdf"}}},textBackground:{padding:[2,4],style:{fill:"#666"}}}},e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{tooltip:e.DEFAULT_TOOLTIP_OPTIONS,interactions:[{type:"tooltip"}],legend:{position:"top-left"},risingFill:"#ef5350",fallingFill:"#26a69a"})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.basicFunnel=e.conversionTag=void 0;var i=n(1),r=n(0),o=n(2),a=n(23),s=n(20),l=n(36),c=n(50);function u(t){var e=t.chart,n=t.options,i=n.data,r=void 0===i?[]:i,o=n.yField,a=n.maxSize,s=n.minSize,l=c.transformData(r,r,{yField:o,maxSize:a,minSize:s});return e.data(l),t}function h(t){var e=t.chart,n=t.options,i=n.xField,c=n.yField,u=n.color,h=n.tooltip,f=n.label,p=n.shape,d=void 0===p?"funnel":p,g=n.funnelStyle,y=n.state,v=a.getTooltipMapping(h,[i,c]),m=v.fields,x=v.formatter;return s.geometry({chart:e,options:{type:"interval",xField:i,yField:l.FUNNEL_MAPPING_VALUE,colorField:i,tooltipFields:r.isArray(m)&&m.concat([l.FUNNEL_PERCENT,l.FUNNEL_CONVERSATION]),mapping:{shape:d,tooltip:x,color:u,style:g},label:f,state:y}}),o.findGeometry(t.chart,"interval").adjust("symmetric"),t}function f(t){var e=t.chart,n=t.options.isTransposed;return e.coordinate({type:"rect",actions:n?[]:[["transpose"],["scale",1,-1]]}),t}function p(t){var e=t.options,n=t.chart,o=e.maxSize,a=r.get(n,["geometries","0","dataArray"],[]),s=r.get(n,["options","data","length"]),u=r.map(a,(function(t){return r.get(t,["0","nextPoints","0","x"])*s-.5}));return c.conversionTagComponent((function(t,e,n,r){var a=o-(o-t[l.FUNNEL_MAPPING_VALUE])/2;return i.__assign(i.__assign({},r),{start:[u[e-1]||e-.5,a],end:[u[e-1]||e-.5,a+.05]})}))(t),t}e.conversionTag=p,e.basicFunnel=function(t){return o.flow(u,h,f,p)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.RAW_FIELDS=e.SUNBURST_PATH_FIELD=e.SUNBURST_Y_FIELD=e.SUNBURST_ANCESTOR_FIELD=void 0;var i=n(6),r=n(2),o=n(44);e.SUNBURST_ANCESTOR_FIELD="ancestor-node",e.SUNBURST_Y_FIELD="value",e.SUNBURST_PATH_FIELD="path",e.RAW_FIELDS=[e.SUNBURST_PATH_FIELD,o.NODE_INDEX_FIELD,o.NODE_ANCESTORS_FIELD,o.CHILD_NODE_COUNT,"name","depth","height"],e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{innerRadius:0,radius:.85,hierarchyConfig:{field:"value"},tooltip:{shared:!0,showMarkers:!1,offset:20,showTitle:!1},legend:!1,sunburstStyle:{lineWidth:.5,stroke:"#FFF"},drilldown:{enabled:!0}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isParentNode=void 0;var i=n(7),r=n(0),o=n(51);function a(t){var e=r.get(t,["event","data","data"],{});return r.isArray(e.children)&&e.children.length>0}function s(t){var e=t.view.getCoordinate(),n=e.innerRadius;if(n){var i=t.event,r=i.x,o=i.y,a=e.center,s=a.x,l=a.y,c=e.getRadius()*n;return Math.sqrt(Math.pow(s-r,2)+Math.pow(l-o,2))=0;)e+=n[i].value;else e=1;t.value=e}function l(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(t,e)}(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 o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=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 o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),h}},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;M(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:C(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}var d=p().mark(g);function g(){var t,e,n,i,r,o;return p().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n=[t=this];case 1:e=n.reverse(),n=[];case 2:if(!(t=e.pop())){a.next=8;break}return a.next=5,t;case 5:if(i=t.children)for(r=0,o=i.length;r=0;--o)l.push(i=r[o]=new _(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(b)}function v(t){return t.children}function m(t){return Array.isArray(t)?t[1]:null}function x(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function b(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function _(t){this.data=t,this.depth=this.height=0,this.parent=null}function O(t){return(O="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})(t)}_.prototype=y.prototype=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({constructor:_,count:function(){return this.eachAfter(s)},each:function(t,e){var n,i=-1,r=l(this);try{for(r.s();!(n=r.n()).done;){var o=n.value;t.call(e,o,++i,this)}}catch(t){r.e(t)}finally{r.f()}return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i=0;--i)o.push(n[i]);return this},find:function(t,e){var n,i=-1,r=u(this);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(t.call(e,o,++i,this))return o}}catch(t){r.e(t)}finally{r.f()}},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return y(this).eachBefore(x)}},Symbol.iterator,g);var w=function(t){for(var e,n,i=0,r=(t=function(t){for(var e,n,i=t.length;i;)n=Math.random()*i--|0,e=t[i],t[i]=t[n],t[n]=e;return t}(Array.from(t))).length,o=[];i0&&n*n>i*i+r*r}function A(t,e){for(var n=0;n(a*=a)?(i=(c+a-r)/(2*c),o=Math.sqrt(Math.max(0,a/c-i*i)),n.x=t.x-i*s-o*l,n.y=t.y-i*l+o*s):(i=(c+r-a)/(2*c),o=Math.sqrt(Math.max(0,r/c-i*i)),n.x=e.x+i*s-o*l,n.y=e.y+i*l+o*s)):(n.x=e.x+n.r,n.y=e.y)}function F(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function T(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,o=(e.y*n.r+n.y*e.r)/i;return r*r+o*o}function L(t){this._=t,this.next=null,this.previous=null}function D(t){if(!(o=(e=t,t="object"===O(e)&&"length"in e?e:Array.from(e)).length))return 0;var e,n,i,r,o,a,s,l,c,u,h,f;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(i=t[1],n.x=-i.r,i.x=n.r,i.y=0,!(o>2))return n.r+i.r;P(i,n,r=t[2]),n=new L(n),i=new L(i),r=new L(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;t:for(l=3;l0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=N(e),n):t},n.parentId=function(t){return arguments.length?(e=N(t),n):e},n};function tt(t,e){return t.parent===e.parent?1:2}function et(t){var e=t.children;return e?e[0]:t.t}function nt(t){var e=t.children;return e?e[e.length-1]:t.t}function it(t,e,n){var i=n/(e.i-t.i);e.c-=i,e.s+=n,t.c+=i,e.z+=n,e.m+=n}function rt(t,e,n){return t.a.parent===e.parent?t.a:n}function ot(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}ot.prototype=Object.create(_.prototype);var at=function(){var t=tt,e=1,n=1,i=null;function r(r){var l=function(t){for(var e,n,i,r,o,a=new ot(t,0),s=[a];e=s.pop();)if(i=e._.children)for(e.children=new Array(o=i.length),r=o-1;r>=0;--r)s.push(n=e.children[r]=new ot(i[r],r)),n.parent=e;return(a.parent=new ot(null,0)).children=[a],a}(r);if(l.eachAfter(o),l.parent.m=-l.z,l.eachBefore(a),i)r.eachBefore(s);else{var c=r,u=r,h=r;r.eachBefore((function(t){t.xu.x&&(u=t),t.depth>h.depth&&(h=t)}));var f=c===u?1:t(c,u)/2,p=f-c.x,d=e/(u.x+f+p),g=n/(h.depth||1);r.eachBefore((function(t){t.x=(t.x+p)*d,t.y=t.depth*g}))}return r}function o(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){!function(t){for(var e,n=0,i=0,r=t.children,o=r.length;--o>=0;)(e=r[o]).z+=n,e.m+=n,n+=e.s+(i+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;r?(e.z=r.z+t(e._,r._),e.m=e.z-o):e.z=o}else r&&(e.z=r.z+t(e._,r._));e.parent.A=function(e,n,i){if(n){for(var r,o=e,a=e,s=n,l=o.parent.children[0],c=o.m,u=a.m,h=s.m,f=l.m;s=nt(s),o=et(o),s&&o;)l=et(l),(a=nt(a)).a=e,(r=s.z+h-o.z-c+t(s._,o._))>0&&(it(rt(s,e,i),e,r),c+=r,u+=r),h+=s.m,c+=o.m,f+=l.m,u+=a.m;s&&!nt(a)&&(a.t=s,a.m+=h-u),o&&!et(l)&&(l.t=o,l.m+=c-f,i=e)}return i}(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(t){return arguments.length?(i=!1,e=+t[0],n=+t[1],r):i?null:[e,n]},r.nodeSize=function(t){return arguments.length?(i=!0,e=+t[0],n=+t[1],r):i?[e,n]:null},r},st=function(t,e,n,i,r){for(var o,a=t.children,s=-1,l=a.length,c=t.value&&(r-n)/t.value;++sf&&(f=s),y=u*u*g,(p=Math.max(f/y,y/h))>d){u-=s;break}d=p}v.push(a={value:u,dice:l1?e:1)},n}(lt),ht=function(){var t=ut,e=!1,n=1,i=1,r=[0],o=R,a=R,s=R,l=R,c=R;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=i,t.eachBefore(h),r=[0],e&&t.eachBefore(H),t}function h(e){var n=r[e.depth],i=e.x0+n,u=e.y0+n,h=e.x1-n,f=e.y1-n;h=n-1){var u=s[e];return u.x0=r,u.y0=o,u.x1=a,void(u.y1=l)}var h=c[e],f=i/2+h,p=e+1,d=n-1;for(;p>>1;c[g]l-o){var m=i?(r*v+a*y)/i:a;t(e,p,y,r,o,m,l),t(p,n,v,m,o,a,l)}else{var x=i?(o*v+l*y)/i:l;t(e,p,y,r,o,a,x),t(p,n,v,r,x,a,l)}}(0,l,t.value,e,n,i,r)},pt=function(t,e,n,i,r){(1&t.depth?st:U)(t,e,n,i,r)},dt=function t(e){function n(t,n,i,r,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,l,c,u,h=-1,f=a.length,p=t.value;++h1?e:1)},n}(lt)},function(t,e){},function(t,e){},function(t,e,n){"use strict";function i(t){return(i="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.pick=void 0,e.pick=function(t,e){var n={};return null!==t&&"object"===i(t)&&e.forEach((function(e){var i=t[e];void 0!==i&&(n[e]=i)})),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.log=e.invariant=e.LEVEL=void 0;var i=n(1);!function(t){t.ERROR="error",t.WARN="warn",t.INFO="log"}(e.LEVEL||(e.LEVEL={}));var r="AntV/G2Plot";function o(t){for(var e=[],n=1;n"},key:(0===l?"top":"bottom")+"-statistic"},o.pick(e,["offsetX","offsetY","rotate","style","formatter"])))}}))},e.renderGaugeStatistic=function(t,e,n){var l=e.statistic;[l.title,l.content].forEach((function(e){if(e){var l=r.isFunction(e.style)?e.style(n):e.style;t.annotation().html(i.__assign({position:["50%","100%"],html:function(t,o){var c=o.getCoordinate(),u=o.views[0].getCoordinate(),h=u.getCenter(),f=u.getRadius(),p=Math.max(Math.sin(u.startAngle),Math.sin(u.endAngle))*f,d=h.y+p-c.y.start-parseFloat(r.get(l,"fontSize",0)),g=c.getRadius()*c.innerRadius*2;s(t,i.__assign({width:g+"px",transform:"translate(-50%, "+d+"px)"},a(l)));var y=o.getData();if(e.customHtml)return e.customHtml(t,o,n,y);var v=e.content;return e.formatter&&(v=e.formatter(n,y)),v?r.isString(v)?v:""+v:"
"}},o.pick(e,["offsetX","offsetY","rotate","style","formatter"])))}}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setGlobal=e.GLOBAL=void 0;var i=n(0);e.GLOBAL={locale:"en-US"},e.setGlobal=function(t){i.each(t,(function(t,n){return e.GLOBAL[n]=t}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,n=null;return function(){for(var i=this,r=arguments.length,o=new Array(r),a=0;a0?n:e:e<0?e:n;case"outer":return n=12,i.isString(e)&&e.endsWith("%")?.01*parseFloat(e)<0?n:e:e>0?e:n;default:return e}},e.isAllZero=function(t,e){return i.every(r.processIllegalData(t,e),(function(t){return 0===t[e]}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PIE_STATISTIC=void 0;var i=n(7),r=n(219),o=n(220);e.PIE_STATISTIC="pie-statistic",i.registerAction(e.PIE_STATISTIC,o.StatisticAction),i.registerInteraction("pie-statistic-active",{start:[{trigger:"element:mouseenter",action:"pie-statistic:change"}],end:[{trigger:"element:mouseleave",action:"pie-statistic:reset"}]}),i.registerAction("pie-legend",r.PieLegendAction),i.registerInteraction("pie-legend-active",{start:[{trigger:"legend-item:mouseenter",action:"pie-legend:active"}],end:[{trigger:"legend-item:mouseleave",action:"pie-legend:reset"}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transform=void 0;var i=n(1),r=n(7),o=[1,0,0,0,1,0,0,0,1];e.transform=function(t,e){var n=e?i.__spreadArrays(e):i.__spreadArrays(o);return r.Util.transform(n,t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSingleKeyValues=e.getFontSizeMapping=e.processImageMask=e.getSize=e.transform=void 0;var i=n(1),r=n(0),o=n(32),a=n(2),s=n(230);function l(t){var e=t.width,n=t.height,i=t.container,r=t.autoFit,s=t.padding,l=t.appendPadding;if(r){var c=a.getContainerSize(i);e=c.width,n=c.height}e=e||400,n=n||400;var u=function(t){var e=o.normalPadding(t.padding),n=o.normalPadding(t.appendPadding),i=e[0]+n[0],r=e[1]+n[1],a=e[2]+n[2],s=e[3]+n[3];return[i,r,a,s]}({padding:s,appendPadding:l}),h=u[0],f=u[1],p=u[2];return[e-(u[3]+f),n-(h+p)]}function c(t,e){if(r.isFunction(t))return t;if(r.isArray(t)){var n=t[0],i=t[1];if(!e)return function(){return(i+n)/2};var o=e[0],a=e[1];return a===o?function(){return(i+n)/2}:function(t){var e=t.value;return(i-n)/(a-o)*(e-o)+n}}return function(){return t}}function u(t,e){return t.map((function(t){return t[e]})).filter((function(t){return"number"==typeof t&&!isNaN(t)}))}function h(t){var e=function(t){var e=t.wordStyle.rotationSteps;e<1&&(a.log(a.LEVEL.WARN,!1,"The rotationSteps option must be greater than or equal to 1."),e=1);return{rotation:t.wordStyle.rotation,rotationSteps:e}}(t),n=e.rotation,i=e.rotationSteps;if(!r.isArray(n))return n;var o=n[0],s=n[1],l=1===i?0:(s-o)/(i-1);return function(){return s===o?s:Math.floor(Math.random()*i)*l}}function f(t){return Math.max.apply(Math,t)}e.transform=function(t){var e=t.options,n=t.chart,o=n,a=o.width,p=o.height,d=o.padding,g=o.appendPadding,y=o.ele,v=e.data,m=e.imageMask,x=e.wordField,b=e.weightField,_=e.colorField,O=e.wordStyle,w=e.timeInterval,j=e.random,S=e.spiral,M=e.autoFit,A=void 0===M||M,C=e.placementStrategy;if(!v||!v.length)return[];var E,I=O.fontFamily,P=O.fontWeight,F=O.padding,T=O.fontSize,L=u(v,b),D=[(E=L,Math.min.apply(Math,E)),f(L)],k=v.map((function(t){return{text:t[x],value:t[b],color:t[_],datum:t}})),B={imageMask:m,font:I,fontSize:c(T,D),fontWeight:P,size:l({width:a,height:p,padding:d,appendPadding:g,autoFit:A,container:y}),padding:F,timeInterval:w,random:j,spiral:S,rotate:h(e)};if(r.isFunction(C)){var N=k.map((function(t,e,r){return i.__assign(i.__assign(i.__assign({},t),{hasText:!!t.text,font:s.functor(B.font)(t,e,r),weight:s.functor(B.fontWeight)(t,e,r),rotate:s.functor(B.rotate)(t,e,r),size:s.functor(B.fontSize)(t,e,r),style:"normal"}),C.call(n,t,e,r))}));return N.push({text:"",value:0,x:0,y:0,opacity:0}),N.push({text:"",value:0,x:B.size[0],y:B.size[1],opacity:0}),N}return s.wordCloud(k,B)},e.getSize=l,e.processImageMask=function(t){return new Promise((function(e,n){if(t instanceof HTMLImageElement)e(t);else{if(r.isString(t)){var i=new Image;return i.crossOrigin="anonymous",i.src=t,i.onload=function(){e(i)},void(i.onerror=function(){a.log(a.LEVEL.ERROR,!1,"image %s load failed !!!",t),n()})}a.log(a.LEVEL.WARN,void 0===t,"The type of imageMask option must be String or HTMLImageElement."),n()}}))},e.getFontSizeMapping=c,e.getSingleKeyValues=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.WORD_CLOUD_COLOR_FIELD=void 0;var i=n(6),r=n(2);e.WORD_CLOUD_COLOR_FIELD="color",e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{timeInterval:2e3,legend:!1,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!1,fields:["text","value",e.WORD_CLOUD_COLOR_FIELD],formatter:function(t){return{name:t.text,value:t.value}}},wordStyle:{fontFamily:"Verdana",fontWeight:"normal",padding:1,fontSize:[12,60],rotation:[0,90],rotationSteps:2,rotateRatio:.5}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Scatter=void 0;var i=n(1),r=n(7),o=n(6),a=n(2),s=(n(232),n(104)),l=n(235);n(236);var c=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.type="scatter",o.on(r.VIEW_LIFE_CIRCLE.BEFORE_RENDER,(function(t){var e,n,a=o,l=a.options,c=a.chart;if((null===(e=t.data)||void 0===e?void 0:e.source)===r.BRUSH_FILTER_EVENTS.FILTER){var u=o.chart.filterData(o.chart.getData());s.meta({chart:c,options:i.__assign(i.__assign({},l),{data:u})})}(null===(n=t.data)||void 0===n?void 0:n.source)===r.BRUSH_FILTER_EVENTS.RESET&&s.meta({chart:c,options:l})})),o}return i.__extends(e,t),e.getDefaultOptions=function(){return l.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.updateOption(s.transformOptions(a.deepAssign({},this.options,{data:t})));var e=this.options,n=this.chart;s.meta({chart:n,options:e}),this.chart.changeData(t)},e.prototype.getSchemaAdaptor=function(){return s.adaptor},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(o.Plot);e.Scatter=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.tooltip=e.meta=e.transformOptions=void 0;var i=n(1),r=n(0),o=n(2),a=n(15),s=n(91),l=n(10),c=n(2),u=n(233);function h(t){var e=t.data,n=void 0===e?[]:e,i=t.xField,r=t.yField;if(n.length){for(var a=!0,s=!0,l=n[0],c=void 0,h=1;h1?u/(o-1):c.max),!n&&!o){var f=function(t){return Math.ceil(Math.log(t.length)/Math.LN2)+1}(l);h=u/f}var p={},d=i.groupBy(s,a);i.isEmpty(d)?i.each(s,(function(t){var n=r(t[e],h,o),a=n[0]+"-"+n[1];i.hasKey(p,a)||(p[a]={range:n,count:0}),p[a].count+=1})):Object.keys(d).forEach((function(t){i.each(d[t],(function(n){var s=r(n[e],h,o),l=s[0]+"-"+s[1]+"-"+t;i.hasKey(p,l)||(p[l]={range:s,count:0},p[l][a]=t),p[l].count+=1}))}));var g=[];return i.each(p,(function(t){g.push(t)})),g}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=void 0;var i=n(1),r=n(10),o=n(33),a=n(2),s=n(2),l=n(15),c=n(113),u=n(115);function h(t){var e=t.chart,n=t.options,i=n.data,r=n.binField,o=n.binNumber,s=n.binWidth,h=n.color,f=n.stackField,p=n.legend,d=n.columnStyle,g=c.binHistogram(i,r,s,o,f);e.data(g);var y=a.deepAssign({},t,{options:{xField:u.HISTOGRAM_X_FIELD,yField:u.HISTOGRAM_Y_FIELD,seriesField:f,isStack:!0,interval:{color:h,style:d}}});return l.interval(y),p&&f?e.legend(f,p):e.legend(!1),t}function f(t){var e,n=t.options,i=n.xAxis,o=n.yAxis;return s.flow(r.scale(((e={})[u.HISTOGRAM_X_FIELD]=i,e[u.HISTOGRAM_Y_FIELD]=o,e)))(t)}function p(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis;return!1===i?e.axis(u.HISTOGRAM_X_FIELD,!1):e.axis(u.HISTOGRAM_X_FIELD,i),!1===r?e.axis(u.HISTOGRAM_Y_FIELD,!1):e.axis(u.HISTOGRAM_Y_FIELD,r),t}function d(t){var e=t.chart,n=t.options.label,r=a.findGeometry(e,"interval");if(n){var o=n.callback,l=i.__rest(n,["callback"]);r.label({fields:[u.HISTOGRAM_Y_FIELD],callback:o,cfg:s.transformLabel(l)})}else r.label(!1);return t}e.adaptor=function(t){return s.flow(r.theme,o.pattern("columnStyle"),h,f,p,r.state,d,r.tooltip,r.interaction,r.animation)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.HISTOGRAM_Y_FIELD=e.HISTOGRAM_X_FIELD=void 0;var i=n(6),r=n(2);e.HISTOGRAM_X_FIELD="range",e.HISTOGRAM_Y_FIELD="count",e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{columnStyle:{stroke:"#FFFFFF"},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Progress=void 0;var i=n(1),r=n(6),o=(n(253),n(61)),a=n(117),s=n(62),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="process",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.updateOption({percent:t}),this.chart.changeData(s.getProgressData(t))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e}(r.Plot);e.Progress=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.DEFAULT_COLOR=void 0,e.DEFAULT_COLOR=["#FAAD14","#E8EDF3"],e.DEFAULT_OPTIONS={percent:.2,color:e.DEFAULT_COLOR,animation:{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RingProgress=void 0;var i=n(1),r=n(7),o=n(6),a=n(62),s=(n(254),n(119)),l=n(255),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ring-process",e}return i.__extends(e,t),e.getDefaultOptions=function(){return l.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.chart.emit(r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(a.getProgressData(t)),s.statistic({chart:this.chart,options:this.options},!0),this.chart.emit(r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return s.adaptor},e}(o.Plot);e.RingProgress=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.statistic=void 0;var i=n(1),r=n(0),o=n(2),a=n(10),s=n(61);function l(t){var e=t.chart,n=t.options,i=n.innerRadius,r=n.radius;return e.coordinate("theta",{innerRadius:i,radius:r}),t}function c(t,e){var n=t.chart,a=t.options,s=a.innerRadius,l=a.statistic,c=a.percent,u=a.meta;if(n.getController("annotation").clear(!0),s&&l){var h=r.get(u,["percent","formatter"])||function(t){return(100*t).toFixed(2)+"%"},f=l.content;f&&(f=o.deepAssign({},f,{content:r.isNil(f.content)?h(c):f.content})),o.renderStatistic(n,{statistic:i.__assign(i.__assign({},l),{content:f}),plotType:"ring-progress"},{percent:c})}return e&&n.render(!0),t}e.statistic=c,e.adaptor=function(t){return o.flow(s.geometry,a.scale({}),l,c,a.animation,a.theme,a.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformData=void 0;var i=n(0),r=n(63);e.transformData=function(t,e){var n=t;if(Array.isArray(e)){var o=e[0],a=e[1],s=e[2],l=e[3],c=e[4];n=i.map(t,(function(t){return t[r.BOX_RANGE]=[t[o],t[a],t[s],t[l],t[c]],t}))}return n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformViolinData=e.toViolinValue=e.toBoxValue=void 0;var i=n(1),r=n(0),o=i.__importDefault(n(268)),a=n(270);e.toBoxValue=function(t){return{low:r.min(t),high:r.max(t),q1:a.quantile(t,.25),q3:a.quantile(t,.75),median:a.quantile(t,[.5]),minMax:[r.min(t),r.max(t)],quantile:[a.quantile(t,.25),a.quantile(t,.75)]}},e.toViolinValue=function(t,e){var n=o.default.create(t,e);return{violinSize:n.map((function(t){return t.y})),violinY:n.map((function(t){return t.x}))}},e.transformViolinData=function(t){var n=t.xField,o=t.yField,a=t.seriesField,s=t.data,l=t.kde,c={min:l.min,max:l.max,size:l.sampleSize,width:l.width};if(!a){var u=r.groupBy(s,n);return Object.keys(u).map((function(t){var n=u[t].map((function(t){return t[o]}));return i.__assign(i.__assign({x:t},e.toViolinValue(n,c)),e.toBoxValue(n))}))}var h=[],f=r.groupBy(s,a);return Object.keys(f).forEach((function(t){var s=r.groupBy(f[t],n);return Object.keys(s).forEach((function(n){var r,l=s[n].map((function(t){return t[o]}));h.push(i.__assign(i.__assign(((r={x:n})[a]=t,r),e.toViolinValue(l,c)),e.toBoxValue(l)))}))})),h}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.MEDIAN_VIEW_ID=e.QUANTILE_VIEW_ID=e.MIN_MAX_VIEW_ID=e.VIOLIN_VIEW_ID=e.MEDIAN_FIELD=e.QUANTILE_FIELD=e.MIN_MAX_FIELD=e.VIOLIN_SIZE_FIELD=e.VIOLIN_Y_FIELD=e.X_FIELD=void 0;var i=n(6),r=n(2);e.X_FIELD="x",e.VIOLIN_Y_FIELD="violinY",e.VIOLIN_SIZE_FIELD="violinSize",e.MIN_MAX_FIELD="minMax",e.QUANTILE_FIELD="quantile",e.MEDIAN_FIELD="median",e.VIOLIN_VIEW_ID="violin_view",e.MIN_MAX_VIEW_ID="min_max_view",e.QUANTILE_VIEW_ID="quantile_view",e.MEDIAN_VIEW_ID="median_view",e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{syncViewPadding:!0,kde:{type:"triangular",sampleSize:32,width:3},violinStyle:{lineWidth:1,fillOpacity:.3,strokeOpacity:.75},xAxis:{grid:{line:null},tickLine:{alignTick:!1}},yAxis:{grid:{line:{style:{lineWidth:.5,lineDash:[4,4]}}}},legend:{position:"top-left"},tooltip:{showMarkers:!1}})},function(t,e,n){var i,r,o,a;function s(t){return(s="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})(t)}a=function(t){"use strict";function e(t){for(var e=new Array(t),n=0;nc+s*a*u||h>=g)d=a;else{if(Math.abs(p)<=-l*u)return a;p*(d-f)>=0&&(d=f),f=a,g=h}return 0}a=a||1,s=s||1e-6,l=l||.1;for(var y=0;y<10;++y){if(o(r.x,1,i.x,a,e),h=r.fx=t(r.x,r.fxprime),p=n(r.fxprime,e),h>c+s*a*u||y&&h>=f)return g(d,a,f);if(Math.abs(p)<=-l*u)return a;if(p>=0)return g(a,d,h);f=h,d=a,a*=2}return a}t.bisect=function(t,e,n,i){var r=(i=i||{}).maxIterations||100,o=i.tolerance||1e-10,a=t(e),s=t(n),l=n-e;if(a*s>0)throw"Initial bisect points must have opposite signs";if(0===a)return e;if(0===s)return n;for(var c=0;c=0&&(e=u),Math.abs(l)=g[d-1].fx){var C=!1;if(_.fx>A.fx?(o(O,1+f,b,-f,A),O.fx=t(O),O.fx=1)break;for(y=1;ye[n].radius+1e-10)return!1;return!0}function r(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function o(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function a(t,e){var n=o(t,e),i=t.radius,r=e.radius;if(n>=i+r||n<=Math.abs(i-r))return[];var a=(i*i-r*r+n*n)/(2*n),s=Math.sqrt(i*i-a*a),l=t.x+a*(e.x-t.x)/n,c=t.y+a*(e.y-t.y)/n,u=-(e.y-t.y)*(s/n),h=-(e.x-t.x)*(s/n);return[{x:l+u,y:c-h},{x:l-u,y:c+h}]}function s(t){for(var e={x:0,y:0},n=0;n1){var p=s(c);for(n=0;n-1){var b=t[y.parentIndex[x]],_=Math.atan2(y.x-b.x,y.y-b.y),O=Math.atan2(g.x-b.x,g.y-b.y),w=O-_;w<0&&(w+=2*Math.PI);var j=O-w/2,S=o(v,{x:b.x+b.radius*Math.sin(j),y:b.y+b.radius*Math.cos(j)});S>2*b.radius&&(S=2*b.radius),(null===m||m.width>S)&&(m={circle:b,width:S,p1:y,p2:g})}null!==m&&(f.push(m),u+=r(m.circle.radius,m.width),g=y)}}else{var M=t[0];for(n=1;nMath.abs(M.radius-t[n].radius)){A=!0;break}A?u=h=0:(u=M.radius*M.radius*Math.PI,f.push({circle:M,p1:{x:M.x,y:M.y+M.radius},p2:{x:M.x-1e-10,y:M.y+M.radius},width:2*M.radius}))}return h/=2,e&&(e.area=u+h,e.arcArea=u,e.polygonArea=h,e.arcs=f,e.innerPoints=c,e.intersectionPoints=l),u+h},e.containedInCircles=i,e.circleArea=r,e.distance=o,e.circleOverlap=function(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);var i=e-(n*n-t*t+e*e)/(2*n);return r(t,t-(n*n-e*e+t*t)/(2*n))+r(e,i)},e.circleCircleIntersection=a,e.getCenter=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Stock=void 0;var i=n(1),r=n(6),o=(n(284),n(126)),a=n(127),s=n(65),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="stock",e}return i.__extends(e,t),e.getDefaultOptions=function(){return s.DEFAULT_OPTIONS},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e.prototype.changeData=function(t){this.updateOption({data:t});var e=this.options.yField;this.chart.changeData(a.getStockData(t,e))},e}(r.Plot);e.Stock=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.legend=e.tooltip=e.axis=e.meta=void 0;var i=n(10),r=n(15),o=n(2),a=n(27),s=n(65),l=n(127);function c(t){var e=t.chart,n=t.options,i=n.yField,a=n.data,c=n.risingFill,u=n.fallingFill,h=n.tooltip,f=n.stockStyle;e.data(l.getStockData(a,i));var p=h;return!1!==p&&(p=o.deepAssign({},{fields:i},p)),r.schema(o.deepAssign({},t,{options:{schema:{shape:"candle",color:[c,u],style:f},yField:s.Y_FIELD,seriesField:s.TREND_FIELD,rawFields:i,tooltip:p}})),t}function u(t){var e,n,i=t.chart,r=t.options,l=r.meta,c=r.xAxis,u=r.yAxis,h=r.xField,f=((e={})[h]={type:"timeCat",tickCount:6},e[s.TREND_FIELD]={values:[s.TREND_UP,s.TREND_DOWN]},e),p=o.deepAssign(f,l,((n={})[h]=o.pick(c,a.AXIS_META_CONFIG_KEYS),n[s.Y_FIELD]=o.pick(u,a.AXIS_META_CONFIG_KEYS),n));return i.scale(p),t}function h(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField;return!1===i?e.axis(o,!1):e.axis(o,i),!1===r?e.axis(s.Y_FIELD,!1):e.axis(s.Y_FIELD,r),t}function f(t){var e=t.chart,n=t.options.tooltip;return!1!==n?e.tooltip(n):e.tooltip(!1),t}function p(t){var e=t.chart,n=t.options.legend;return n?e.legend(s.TREND_FIELD,n):!1===n&&e.legend(!1),t}e.meta=u,e.axis=h,e.tooltip=f,e.legend=p,e.adaptor=function(t){o.flow(i.theme,c,u,h,f,p,i.interaction,i.animation,i.annotation(),i.slider)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getStockData=void 0;var i=n(1),r=n(0),o=n(65);e.getStockData=function(t,e){return r.map(t,(function(t){var n=t&&i.__assign({},t);if(r.isArray(e)&&n){var a=e[0],s=e[1],l=e[2],c=e[3];n[o.TREND_FIELD]=n[a]<=n[s]?o.TREND_UP:o.TREND_DOWN,n[o.Y_FIELD]=[n[a],n[s],n[l],n[c]]}return n}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Funnel=e.FUNNEL_CONVERSATION_FIELD=void 0;var i=n(1),r=n(0),o=n(6),a=n(2),s=(n(285),n(129)),l=n(36);Object.defineProperty(e,"FUNNEL_CONVERSATION_FIELD",{enumerable:!0,get:function(){return l.FUNNEL_CONVERSATION}}),n(131);var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="funnel",e}return i.__extends(e,t),e.getDefaultOptions=function(){return l.DEFAULT_OPTIONS},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return s.adaptor},e.prototype.setState=function(t,e,n){void 0===n&&(n=!0);var i=a.getAllElementsRecursively(this.chart);r.each(i,(function(i){e(i.getData())&&i.setState(t,n)}))},e.prototype.getStates=function(){var t=a.getAllElementsRecursively(this.chart),e=[];return r.each(t,(function(t){var n=t.getData(),i=t.getStates();r.each(i,(function(i){e.push({data:n,state:i,geometry:t.geometry,element:t})}))})),e},e.CONVERSATION_FIELD=l.FUNNEL_CONVERSATION,e.PERCENT_FIELD=l.FUNNEL_PERCENT,e.TOTAL_PERCENT_FIELD=l.FUNNEL_TOTAL_PERCENT,e}(o.Plot);e.Funnel=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.interaction=e.meta=void 0;var i=n(1),r=n(0),o=n(10),a=n(47),s=n(2),l=n(90),c=n(66),u=n(130),h=n(286),f=n(287),p=n(36),d=n(131);function g(t){var e,n=t.options,i=n.compareField,o=n.xField,c=n.yField,u=n.locale,h=n.funnelStyle,f=n.data,d=a.getLocale(u),g={label:i?{fields:[o,c,i,p.FUNNEL_PERCENT,p.FUNNEL_CONVERSATION],formatter:function(t){return""+t[c]}}:{fields:[o,c,p.FUNNEL_PERCENT,p.FUNNEL_CONVERSATION],offset:0,position:"middle",formatter:function(t){return t[o]+" "+t[c]}},tooltip:{title:o,formatter:function(t){return{name:t[o],value:t[c]}}},conversionTag:{formatter:function(t){return d.get(["conversionTag","label"])+": "+l.conversionTagFormatter.apply(void 0,t[p.FUNNEL_CONVERSATION])}}};return(i||h)&&(e=function(t){return s.deepAssign({},i&&{lineWidth:1,stroke:"#fff"},r.isFunction(h)?h(t):h)}),s.deepAssign({options:g},t,{options:{funnelStyle:e,data:r.clone(f)}})}function y(t){var e=t.options,n=e.compareField,i=e.dynamicHeight;return e.seriesField?h.facetFunnel(t):n?u.compareFunnel(t):i?f.dynamicHeightFunnel(t):c.basicFunnel(t)}function v(t){var e,n=t.options,i=n.xAxis,r=n.yAxis,a=n.xField,l=n.yField;return s.flow(o.scale(((e={})[a]=i,e[l]=r,e)))(t)}function m(t){return t.chart.axis(!1),t}function x(t){var e=t.chart,n=t.options.legend;return!1===n?e.legend(!1):e.legend(n),t}function b(t){var e=t.chart,n=t.options,o=n.interactions,a=n.dynamicHeight;return r.each(o,(function(t){!1===t.enable?e.removeInteraction(t.type):e.interaction(t.type,t.cfg||{})})),a?e.removeInteraction(d.FUNNEL_LEGEND_FILTER):e.interaction(d.FUNNEL_LEGEND_FILTER,{start:[i.__assign(i.__assign({},d.interactionStart),{arg:n})]}),t}e.meta=v,e.interaction=b,e.adaptor=function(t){return s.flow(g,y,v,m,o.tooltip,b,x,o.animation,o.theme,o.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.compareFunnel=e.compareConversionTag=void 0;var i=n(0),r=n(2),o=n(23),a=n(20),s=n(36),l=n(50);function c(t){var e,n=t.chart,i=t.options,r=i.data,o=void 0===r?[]:r,a=i.yField;return n.data(o),n.scale(((e={})[a]={sync:!0},e)),t}function u(t){var e=t.chart,n=t.options,c=n.data,u=n.xField,h=n.yField,f=n.color,p=n.compareField,d=n.isTransposed,g=n.tooltip,y=n.maxSize,v=n.minSize,m=n.label,x=n.funnelStyle,b=n.state,_=n.showFacetTitle;return e.facet("mirror",{fields:[p],transpose:!d,padding:d?0:[32,0,0,0],showTitle:_,eachView:function(t,e){var n=d?e.rowIndex:e.columnIndex;d||t.coordinate({type:"rect",actions:[["transpose"],["scale",0===n?-1:1,-1]]});var _=l.transformData(e.data,c,{yField:h,maxSize:y,minSize:v});t.data(_);var O=o.getTooltipMapping(g,[u,h,p]),w=O.fields,j=O.formatter,S=d?{offset:0===n?10:-23,position:0===n?"bottom":"top"}:{offset:10,position:"left",style:{textAlign:0===n?"end":"start"}};a.geometry({chart:t,options:{type:"interval",xField:u,yField:s.FUNNEL_MAPPING_VALUE,colorField:u,tooltipFields:i.isArray(w)&&w.concat([s.FUNNEL_PERCENT,s.FUNNEL_CONVERSATION]),mapping:{shape:"funnel",tooltip:j,color:f,style:x},label:!1!==m&&r.deepAssign({},S,m),state:b}})}}),t}function h(t){var e=t.chart,n=t.index,o=t.options,a=o.conversionTag,c=o.isTransposed;(i.isNumber(n)?[e]:e.views).forEach((function(t,e){var u=i.get(t,["geometries","0","dataArray"],[]),h=i.get(t,["options","data","length"]),f=i.map(u,(function(t){return i.get(t,["0","nextPoints","0","x"])*h-.5}));l.conversionTagComponent((function(t,i,o,l){var u=0===(n||e)?-1:1;return r.deepAssign({},l,{start:[f[i-1]||i-.5,t[s.FUNNEL_MAPPING_VALUE]],end:[f[i-1]||i-.5,t[s.FUNNEL_MAPPING_VALUE]+.05],text:c?{style:{textAlign:"start"}}:{offsetX:!1!==a?u*a.offsetX:0,style:{textAlign:0===(n||e)?"end":"start"}}})}))(r.deepAssign({},{chart:t,options:o}))}))}function f(t){return t.chart.once("beforepaint",(function(){return h(t)})),t}e.compareConversionTag=h,e.compareFunnel=function(t){return r.flow(c,u,f)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.interactionStart=e.FUNNEL_LEGEND_FILTER=void 0;var i=n(7),r=n(288);e.FUNNEL_LEGEND_FILTER="funnel-afterrender",e.interactionStart={trigger:"afterrender",action:"funnel-conversion-tag:change"},i.registerAction("funnel-conversion-tag",r.ConversionTagAction),i.registerInteraction(e.FUNNEL_LEGEND_FILTER,{start:[e.interactionStart]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getLiquidData=void 0;e.getLiquidData=function(t){return[{percent:t,type:"liquid"}]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addWaterWave=void 0;var i=n(1),r=n(7),o=n(0),a=n(100);function s(t,e,n){return t+(e-t)*n}function l(t,e,n,i){return 0===e?[[t+.5*n/Math.PI/2,i/2],[t+.5*n/Math.PI,i],[t+n/4,i]]:1===e?[[t+.5*n/Math.PI/2*(Math.PI-2),i],[t+.5*n/Math.PI/2*(Math.PI-1),i/2],[t+n/4,0]]:2===e?[[t+.5*n/Math.PI/2,-i/2],[t+.5*n/Math.PI,-i],[t+n/4,-i]]:[[t+.5*n/Math.PI/2*(Math.PI-2),-i],[t+.5*n/Math.PI/2*(Math.PI-1),-i/2],[t+n/4,0]]}function c(t,e,n,i,r,o,a){for(var s=4*Math.ceil(2*t/n*4),c=[],u=i;u<2*-Math.PI;)u+=2*Math.PI;for(;u>0;)u-=2*Math.PI;var h=o-t+(u=u/Math.PI/2*n)-2*t;c.push(["M",h,e]);for(var f=0,p=0;p1?e+"_"+n:""+e}Object.defineProperty(e,"__esModule",{value:!0}),e.transformData=void 0,e.transformData=function(t){var e=t.data,n=t.xField,r=t.measureField,o=t.rangeField,a=t.targetField,s=t.layout,l=[],c=[];e.forEach((function(t,e){var s=[t[o]].flat();s.sort((function(t,e){return t-e})),s.forEach((function(i,r){var a,c=0===r?i:s[r]-s[r-1];l.push(((a={rKey:o+"_"+r})[n]=n?t[n]:String(e),a[o]=c,a))}));var u=[t[r]].flat();u.forEach((function(o,a){var s;l.push(((s={mKey:i(u,r,a)})[n]=n?t[n]:String(e),s[r]=o,s))}));var h=[t[a]].flat();h.forEach((function(r,o){var s;l.push(((s={tKey:i(h,a,o)})[n]=n?t[n]:String(e),s[a]=r,s))})),c.push(t[o],t[r],t[a])}));var u=Math.min.apply(Math,c.flat(1/0)),h=Math.max.apply(Math,c.flat(1/0));return u=u>0?0:u,"vertical"===s&&l.reverse(),{min:u,max:h,ds:l}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.treemap=e.getTileMethod=void 0;var i=n(1).__importStar(n(72)),r=n(0),o=n(44),a={field:"value",tile:"treemapSquarify",size:[1,1],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,as:["x","y"],sort:function(t,e){return e.value-t.value},ratio:.5*(1+Math.sqrt(5))};function s(t,e){return"treemapSquarify"===t?i[t].ratio(e):i[t]}e.getTileMethod=s,e.treemap=function(t,e){var n,l=(e=r.assign({},a,e)).as;if(!r.isArray(l)||2!==l.length)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');try{n=o.getField(e)}catch(t){console.warn(t)}var c=s(e.tile,e.ratio),u=function(t){return i.treemap().tile(c).size(e.size).round(e.round).padding(e.padding).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(i.hierarchy(t).sum((function(t){return e.ignoreParentValue&&t.children?0:t[n]})).sort(e.sort))}(t),h=l[0],f=l[1];return u.each((function(t){t[h]=[t.x0,t.x1,t.x1,t.x0],t[f]=[t.y1,t.y1,t.y0,t.y0],["x0","x1","y0","y1"].forEach((function(e){-1===l.indexOf(e)&&delete t[e]}))})),o.getAllNodes(u)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gauge=void 0;var i=n(1),r=n(7),o=n(6),a=(n(303),n(137)),s=n(52),l=n(138);n(304),n(305);var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="gauge",e}return i.__extends(e,t),e.getDefaultOptions=function(){return s.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.chart.emit(r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t});var e=this.chart.views.find((function(t){return t.id===s.INDICATEOR_VIEW_ID}));e&&e.data(l.getIndicatorData(t));var n=this.chart.views.find((function(t){return t.id===s.RANGE_VIEW_ID}));n&&n.data(l.getRangeData(t,this.options.range)),a.statistic({chart:this.chart,options:this.options},!0),this.chart.emit(r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return a.adaptor},e}(o.Plot);e.Gauge=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.statistic=void 0;var i=n(1),r=n(0),o=n(10),a=n(15),s=n(27),l=n(2),c=n(52),u=n(138);function h(t){var e=t.chart,n=t.options,i=n.percent,o=n.range,h=n.radius,f=n.innerRadius,p=n.startAngle,d=n.endAngle,g=n.axis,y=n.indicator,v=n.gaugeStyle,m=n.type,x=n.meter,b=o.color,_=o.width;if(y){var O=u.getIndicatorData(i),w=e.createView({id:c.INDICATEOR_VIEW_ID});w.data(O),w.point().position(c.PERCENT+"*1").shape(y.shape||"gauge-indicator").customInfo({defaultColor:e.getTheme().defaultColor,indicator:y}),w.coordinate("polar",{startAngle:p,endAngle:d,radius:f*h}),w.axis(c.PERCENT,g),w.scale(c.PERCENT,l.pick(g,s.AXIS_META_CONFIG_KEYS))}var j=u.getRangeData(i,n.range),S=e.createView({id:c.RANGE_VIEW_ID});S.data(j);var M=r.isString(b)?[b,c.DEFAULT_COLOR]:b;return a.interval({chart:S,options:{xField:"1",yField:c.RANGE_VALUE,seriesField:c.RANGE_TYPE,rawFields:[c.PERCENT],isStack:!0,interval:{color:M,style:v,shape:"meter"===m?"meter-gauge":null},args:{zIndexReversed:!0,sortZIndex:!0},minColumnWidth:_,maxColumnWidth:_}}).ext.geometry.customInfo({meter:x}),S.coordinate("polar",{innerRadius:f,radius:h,startAngle:p,endAngle:d}).transpose(),t}function f(t){var e;return l.flow(o.scale(((e={range:{min:0,max:1,maxLimit:1,minLimit:0}})[c.PERCENT]={},e)))(t)}function p(t,e){var n=t.chart,r=t.options,o=r.statistic,a=r.percent;if(n.getController("annotation").clear(!0),o){var s=o.content,c=void 0;s&&(c=l.deepAssign({},{content:(100*a).toFixed(2)+"%",style:{opacity:.75,fontSize:"30px",lineHeight:1,textAlign:"center",color:"rgba(44,53,66,0.85)"}},s)),l.renderGaugeStatistic(n,{statistic:i.__assign(i.__assign({},o),{content:c})},{percent:a})}return e&&n.render(!0),t}function d(t){var e=t.chart,n=t.options.tooltip;return n?e.tooltip(l.deepAssign({showTitle:!1,showMarkers:!1,containerTpl:'
',domStyles:{"g2-tooltip":{padding:"4px 8px",fontSize:"10px"}},customContent:function(t,e){return(100*r.get(e,[0,"data",c.PERCENT],0)).toFixed(2)+"%"}},n)):e.tooltip(!1),t}function g(t){return t.chart.legend(!1),t}e.statistic=p,e.adaptor=function(t){return l.flow(o.theme,o.animation,h,f,d,p,o.interaction,o.annotation(),g)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getRangeData=e.getIndicatorData=e.processRangeData=void 0;var i=n(0),r=n(52);function o(t,e){return t.map((function(n,i){var o;return(o={})[r.RANGE_VALUE]=n-(t[i-1]||0),o[r.RANGE_TYPE]=""+i,o[r.PERCENT]=e,o}))}e.processRangeData=o,e.getIndicatorData=function(t){var e;return[(e={},e[r.PERCENT]=i.clamp(t,0,1),e)]},e.getRangeData=function(t,e){var n=i.get(e,["ticks"],[]),r=i.size(n)?i.uniq(n):[0,i.clamp(t,0,1),1];return r[0]||r.shift(),o(r,t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformData=e.processData=void 0;var i=n(1),r=n(0),o=n(2),a=n(69);function s(t,e,n,a,s){var l,c=[];if(r.reduce(t,(function(t,e){var s;o.log(o.LEVEL.WARN,r.isNumber(e[n]),e[n]+" is not a valid number");var l=r.isUndefined(e[n])?null:e[n];return c.push(i.__assign(i.__assign({},e),((s={})[a]=[t,t+l],s))),t+l}),0),c.length&&s){var u=r.get(c,[[t.length-1],a,[1]]);c.push(((l={})[e]=s.label,l[n]=u,l[a]=[0,u],l))}return c}e.processData=s,e.transformData=function(t,e,n,o){return s(t,e,n,a.Y_FIELD,o).map((function(e,n){var o;return r.isObject(e)?i.__assign(i.__assign({},e),((o={})[a.ABSOLUTE_FIELD]=e[a.Y_FIELD][1],o[a.DIFF_FIELD]=e[a.Y_FIELD][1]-e[a.Y_FIELD][0],o[a.IS_TOTAL]=n===t.length,o)):e}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SERIES_FIELD_KEY=e.SECOND_AXES_VIEW=e.FIRST_AXES_VIEW=void 0,e.FIRST_AXES_VIEW="first-axes-view",e.SECOND_AXES_VIEW="second-axes-view",e.SERIES_FIELD_KEY="series-field-key"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.syncViewPadding=e.isHorizontal=e.transformData=void 0;var i=n(0);function r(t){return"vertical"!==t}e.transformData=function(t,e,n,r,o){var a=[];e.forEach((function(e){r.forEach((function(i){var r,o=((r={})[t]=i[t],r[n]=e,r[e]=i[e],r);a.push(o)}))}));var s=Object.values(i.groupBy(a,n)),l=s[0],c=void 0===l?[]:l,u=s[1],h=void 0===u?[]:u;return o?[c.reverse(),h.reverse()]:[c,h]},e.isHorizontal=r,e.syncViewPadding=function(t,e,n){var i=e[0],o=e[1],a=i.autoPadding,s=o.autoPadding,l=t.__axisPosition,c=l.layout,u=l.position;if(r(c)&&"top"===u&&(i.autoPadding=n.instance(a.top,0,a.bottom,a.left),o.autoPadding=n.instance(s.top,a.left,s.bottom,0)),r(c)&&"bottom"===u&&(i.autoPadding=n.instance(a.top,a.right/2+5,a.bottom,a.left),o.autoPadding=n.instance(s.top,s.right,s.bottom,a.right/2+5)),!r(c)&&"bottom"===u){var h=a.left>=s.left?a.left:s.left;i.autoPadding=n.instance(a.top,a.right,a.bottom/2+5,h),o.autoPadding=n.instance(a.bottom/2+5,s.right,s.bottom,h)}if(!r(c)&&"top"===u){h=a.left>=s.left?a.left:s.left;i.autoPadding=n.instance(a.top,a.right,0,h),o.autoPadding=n.instance(0,s.right,a.top,h)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformData=e.resetDrillDown=e.enableDrillInteraction=e.enableInteraction=e.findInteraction=void 0;var i=n(1),r=n(0),o=n(51),a=n(135);function s(t,e){if(r.isArray(t))return t.find((function(t){return t.type===e}))}function l(t,e){var n=s(t,e);return n&&!1!==n.enable}e.findInteraction=s,e.enableInteraction=l,e.enableDrillInteraction=function(t){var e=t.interactions,n=t.drilldown;return r.get(n,"enabled")||l(e,"treemap-drill-down")},e.resetDrillDown=function(t){var e=t.interactions["drill-down"];e&&e.context.actions.find((function(t){return"drill-down-action"===t.name})).reset()},e.transformData=function(t){var e=t.data,n=t.colorField,s=t.enableDrillDown,l=t.hierarchyConfig,c=a.treemap(e,i.__assign(i.__assign({},l),{type:"hierarchy.treemap",field:"value",as:["x","y"]})),u=[];return c.forEach((function(t){if(0===t.depth)return null;if(s&&1!==t.depth)return null;if(!s&&t.children)return null;var a=t.ancestors().map((function(t){return{data:t.data,height:t.height,value:t.value}})),c=s&&r.isArray(e.path)?a.concat(e.path.slice(1)):a,h=Object.assign({},t.data,i.__assign({x:t.x,y:t.y,depth:t.depth,value:t.value,path:c},t));if(!t.data[n]&&t.parent){var f=t.ancestors().find((function(t){return t.data[n]}));h[n]=null==f?void 0:f.data[n]}else h[n]=t.data[n];h[o.HIERARCHY_DATA_TRANSFORM_PARAMS]={hierarchyConfig:l,colorField:n,enableDrillDown:s},u.push(h)})),u}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformToViewsData=e.getNodePaddingRatio=e.getNodeWidthRatio=void 0;var i=n(1),r=n(2),o=n(48),a=n(326),s=n(330);function l(t,e,n){return r.isRealNumber(t)?t/n:e}function c(t,e,n){return r.isRealNumber(t)?t/n:e}e.getNodeWidthRatio=l,e.getNodePaddingRatio=c,e.transformToViewsData=function(t,e,n){var u,h=t.dataType,f=t.data,p=t.sourceField,d=t.targetField,g=t.weightField,y=t.nodeAlign,v=t.nodeSort,m=t.nodePadding,x=t.nodePaddingRatio,b=t.nodeWidth,_=t.nodeWidthRatio,O=t.nodeDepth,w=t.rawFields,j=void 0===w?[]:w;u=function(t){return"node-link"===t}(h)?f:o.transformDataToNodeLinkData(s.cutoffCircle(f,p,d),p,d,g,j);var S=a.sankeyLayout({nodeAlign:y,nodePadding:c(m,x,n),nodeWidth:l(b,_,e),nodeSort:v,nodeDepth:O},u),M=S.nodes,A=S.links;return{nodes:M.map((function(t){return i.__assign(i.__assign({},r.pick(t,i.__spreadArrays(["x","y","name"],j))),{isNode:!0})})),edges:A.map((function(t){return i.__assign(i.__assign({source:t.source.name,target:t.target.name,name:t.source.name||t.target.name},r.pick(t,i.__spreadArrays(["x","y","value"],j))),{isNode:!1})}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.center=e.justify=e.right=e.left=void 0;var i=n(0);function r(t){return t.target.depth}e.left=function(t){return t.depth},e.right=function(t,e){return e-1-t.height},e.justify=function(t,e){return t.sourceLinks.length?t.depth:e-1},e.center=function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?i.minBy(t.sourceLinks,r)-1:0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.EDGE_COLOR_FIELD=e.NODE_COLOR_FIELD=e.Y_FIELD=e.X_FIELD=void 0;var i=n(0);e.X_FIELD="x",e.Y_FIELD="y",e.NODE_COLOR_FIELD="name",e.EDGE_COLOR_FIELD="source",e.DEFAULT_OPTIONS={nodeStyle:{opacity:1,fillOpacity:1,lineWidth:1},edgeStyle:{opacity:.5,lineWidth:2},label:{fields:["x","name"],callback:function(t,e){return{offsetX:(t[0]+t[1])/2>.5?-4:4,content:e}},labelEmit:!0,style:{fill:"#8c8c8c"}},tooltip:{showTitle:!1,showMarkers:!1,fields:["source","target","value","isNode"],showContent:function(t){return!i.get(t,[0,"data","isNode"])},formatter:function(t){return{name:t.source+" -> "+t.target,value:t.value}}},interactions:[{type:"element-active"}],weight:!0,nodePaddingRatio:.1,nodeWidthRatio:.05}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.RAW_FIELDS=void 0,e.RAW_FIELDS=["x","y","r","name","value","path","depth"],e.DEFAULT_OPTIONS={colorField:"name",autoFit:!0,pointStyle:{lineWidth:0,stroke:"#fff"},legend:!1,hierarchyConfig:{size:[1,1],padding:0},label:{fields:["name"],layout:{type:"limit-in-shape"}},tooltip:{showMarkers:!1,showTitle:!1},drilldown:{enabled:!1}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.execPlotAdaptor=void 0;var i=n(0),r=n(2),o=n(57),a=n(96),s=n(41),l=n(94),c=n(88),u=n(137),h=n(108),f=n(110),p=n(49),d=n(119),g=n(61),y=n(104),v=n(114),m=n(129),x=n(126),b=n(83),_=n(95),O=n(93),w=n(89),j=n(87),S=n(136),M=n(107),A=n(111),C=n(109),E=n(118),I=n(116),P=n(103),F=n(112),T=n(128),L=n(125),D={line:o.adaptor,pie:a.adaptor,column:s.adaptor,bar:l.adaptor,area:c.adaptor,gauge:u.adaptor,"tiny-line":h.adaptor,"tiny-column":f.adaptor,"tiny-area":p.adaptor,"ring-progress":d.adaptor,progress:g.adaptor,scatter:y.adaptor,histogram:v.adaptor,funnel:m.adaptor,stock:x.adaptor},k={line:b.Line,pie:_.Pie,column:w.Column,bar:O.Bar,area:j.Area,gauge:S.Gauge,"tiny-line":M.TinyLine,"tiny-column":C.TinyColumn,"tiny-area":A.TinyArea,"ring-progress":E.RingProgress,progress:I.Progress,scatter:P.Scatter,histogram:F.Histogram,funnel:T.Funnel,stock:L.Stock},B={pie:{label:!1},column:{tooltip:{showMarkers:!1}},bar:{tooltip:{showMarkers:!1}}};e.execPlotAdaptor=function(t,e,n){var o=k[t];o?(0,D[t])({chart:e,options:r.deepAssign({},o.getDefaultOptions(),i.get(B,t,{}),n)}):console.error("could not find "+t+" plot")}},function(t,e,n){"use strict";n.r(e),n.d(e,"Line",(function(){return h})),n.d(e,"Text",(function(){return f})),n.d(e,"Arc",(function(){return p})),n.d(e,"Region",(function(){return d})),n.d(e,"Image",(function(){return g})),n.d(e,"DataMarker",(function(){return y})),n.d(e,"DataRegion",(function(){return v})),n.d(e,"RegionFilter",(function(){return m})),n.d(e,"Shape",(function(){return x})),n.d(e,"Html",(function(){return _}));var i=n(1),r=n(0),o=n(11),a=n(22),s=n(18),l=n(4);function c(t,e){var n=e.x,o=e.y,c=e.content,u=e.style,h=e.id,f=e.name,p=e.rotate,d=e.maxLength,g=e.autoEllipsis,y=e.isVertical,v=e.ellipsisPosition,m=e.background,x=t.addGroup({id:h+"-group",name:f+"-group",attrs:{x:n,y:o}}),b=x.addShape({type:"text",id:h,name:f,attrs:Object(i.__assign)({x:0,y:0,text:c},u)}),_=Object(l.c)(Object(r.get)(m,"padding",0));if(d&&g){var O=d-(_[1]+_[3]);Object(a.a)(!y,b,O,v)}if(m){var w=Object(r.get)(m,"style",{}),j=b.getCanvasBBox(),S=j.minX,M=j.minY,A=j.width,C=j.height;x.addShape("rect",{id:h+"-bg",name:h+"-bg",attrs:Object(i.__assign)({x:S-_[3],y:M-_[0],width:A+_[1]+_[3],height:C+_[0]+_[2]},w)}).toBack()}Object(s.c)(x,n,o),Object(s.b)(x,p,n,o)}var u=n(5),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:u.a.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:u.a.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:u.a.lineColor,lineWidth:1}}}})},e.prototype.renderInner=function(t){this.renderLine(t),this.get("text")&&this.renderLabel(t)},e.prototype.renderLine=function(t){var e=this.get("start"),n=this.get("end"),r=this.get("style");this.addShape(t,{type:"line",id:this.getElementId("line"),name:"annotation-line",attrs:Object(i.__assign)({x1:e.x,y1:e.y,x2:n.x,y2:n.y},r)})},e.prototype.getLabelPoint=function(t,e,n){var i;return((i="start"===n?0:"center"===n?.5:Object(r.isString)(n)&&-1!==n.indexOf("%")?parseInt(n,10)/100:Object(r.isNumber)(n)?n:1)>1||i<0)&&(i=1),{x:Object(l.g)(t.x,e.x,i),y:Object(l.g)(t.y,e.y,i)}},e.prototype.renderLabel=function(t){var e=this.get("text"),n=this.get("start"),i=this.get("end"),r=e.position,o=e.content,a=e.style,s=e.offsetX,l=e.offsetY,u=e.autoRotate,h=e.maxLength,f=e.autoEllipsis,p=e.ellipsisPosition,d=e.background,g=e.isVertical,y=void 0!==g&&g,v=this.getLabelPoint(n,i,r),m=v.x+s,x=v.y+l,b={id:this.getElementId("line-text"),name:"annotation-line-text",x:m,y:x,content:o,style:a,maxLength:h,autoEllipsis:f,ellipsisPosition:p,background:d,isVertical:y};if(u){var _=[i.x-n.x,i.y-n.y];b.rotate=Math.atan2(_[1],_[0])}c(t,b)},e}(o.a),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:u.a.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:u.a.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var e=this.getLocation(),n=e.x,i=e.y,r=this.get("content"),o=this.get("style");c(t,{id:this.getElementId("text"),name:this.get("name")+"-text",x:n,y:i,content:r,style:o,maxLength:this.get("maxLength"),autoEllipsis:this.get("autoEllipsis"),isVertical:this.get("isVertical"),ellipsisPosition:this.get("ellipsisPosition"),background:this.get("background"),rotate:this.get("rotate")})},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var e=this.getLocation(),n=e.x,i=e.y,r=this.get("rotate");Object(s.c)(t,n,i),Object(s.b)(t,r,n,i)}},e}(o.a),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2,style:{stroke:"#999",lineWidth:1}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),e=t.center,n=t.radius,i=t.startAngle,r=t.endAngle,o=Object(l.e)(e,n,i),a=Object(l.e)(e,n,r),s=r-i>Math.PI?1:0,c=[["M",o.x,o.y]];if(r-i==2*Math.PI){var u=Object(l.e)(e,n,i+Math.PI);c.push(["A",n,n,0,s,1,u.x,u.y]),c.push(["A",n,n,0,s,1,a.x,a.y])}else c.push(["A",n,n,0,s,1,a.x,a.y]);return c},e.prototype.renderArc=function(t){var e=this.getArcPath(),n=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:Object(i.__assign)({path:e},n)})},e}(o.a),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:u.a.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var e=this.get("start"),n=this.get("end"),r=this.get("style"),o=Object(l.k)({start:e,end:n});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:Object(i.__assign)({x:o.x,y:o.y,width:o.width,height:o.height},r)})},e}(o.a),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),e=this.get("end"),n=this.get("style"),r=Object(l.k)({start:t,end:e}),o=this.get("src");return Object(i.__assign)({x:r.x,y:r.y,img:o,width:r.width,height:r.height},n)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(o.a),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:u.a.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:u.a.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:u.a.fontFamily}}}})},e.prototype.renderInner=function(t){Object(r.get)(this.get("line"),"display")&&this.renderLine(t),Object(r.get)(this.get("text"),"display")&&this.renderText(t),Object(r.get)(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var e=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:e})},e.prototype.renderLine=function(t){var e=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:e})},e.prototype.renderText=function(t){var e=this.getShapeAttrs().text,n=e.x,r=e.y,o=e.text,a=Object(i.__rest)(e,["x","y","text"]),s=this.get("text"),l=s.background,u=s.maxLength,h=s.autoEllipsis,f=s.isVertival,p=s.ellipsisPosition;c(t,{x:n,y:r,id:this.getElementId("text"),name:"annotation-text",content:o,style:a,background:l,maxLength:u,autoEllipsis:h,isVertival:f,ellipsisPosition:p})},e.prototype.autoAdjust=function(t){var e=this.get("direction"),n=this.get("x"),i=this.get("y"),o=Object(r.get)(this.get("line"),"length",0),a=this.get("coordinateBBox"),l=t.getBBox(),c=l.minX,u=l.maxX,h=l.minY,f=l.maxY,p=t.findById(this.getElementId("text-group")),d=t.findById(this.getElementId("text")),g=t.findById(this.getElementId("line"));if(a){if(p){if(n+c<=a.minX){var y=a.minX-(n+c);Object(s.c)(p,p.attr("x")+y,p.attr("y"))}if(n+u>=a.maxX){y=n+u-a.maxX;Object(s.c)(p,p.attr("x")-y,p.attr("y"))}}if("upward"===e&&i+h<=a.minY||"upward"!==e&&i+f>=a.maxY){var v=void 0,m=void 0;"upward"===e&&i+h<=a.minY?(v="top",m=1):(v="bottom",m=-1),d.attr("textBaseline",v),g&&g.attr("path",[["M",0,0],["L",0,o*m]]),Object(s.c)(p,p.attr("x"),(o+2)*m)}}},e.prototype.getShapeAttrs=function(){var t=Object(r.get)(this.get("line"),"display"),e=Object(r.get)(this.get("point"),"style",{}),n=Object(r.get)(this.get("line"),"style",{}),o=Object(r.get)(this.get("text"),"style",{}),a=this.get("direction"),s=t?Object(r.get)(this.get("line"),"length",0):0,l="upward"===a?-1:1;return{point:Object(i.__assign)({x:0,y:0},e),line:Object(i.__assign)({path:[["M",0,0],["L",0,s*l]]},n),text:Object(i.__assign)({x:0,y:(s+2)*l,text:Object(r.get)(this.get("text"),"content",""),textBaseline:"upward"===a?"bottom":"top"},o)}},e}(o.a),v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:u.a.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:u.a.textColor,fontFamily:u.a.fontFamily}}}})},e.prototype.renderInner=function(t){var e=Object(r.get)(this.get("region"),"style",{}),n=(Object(r.get)(this.get("text"),"style",{}),this.get("lineLength")||0),o=this.get("points");if(o.length){var a=Object(l.j)(o),s=[];s.push(["M",o[0].x,a.minY-n]),o.forEach((function(t){s.push(["L",t.x,t.y])})),s.push(["L",o[o.length-1].x,o[o.length-1].y-n]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:Object(i.__assign)({path:s},e)}),c(t,Object(i.__assign)({id:this.getElementId("text"),name:"annotation-text",x:(a.minX+a.maxX)/2,y:a.minY-n},this.get("text")))}},e}(o.a),m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var e=this,n=this.get("start"),i=this.get("end"),o=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});Object(r.each)(this.get("shapes"),(function(t,n){var i=t.get("type"),a=Object(r.clone)(t.attr());e.adjustShapeAttrs(a),e.addShape(o,{id:e.getElementId("shape-"+i+"-"+n),capture:!1,type:i,attrs:a})}));var a=Object(l.k)({start:n,end:i});o.setClip({type:"rect",attrs:{x:a.minX,y:a.minY,width:a.width,height:a.height}})},e.prototype.adjustShapeAttrs=function(t){var e=this.get("color");t.fill&&(t.fill=t.fillStyle=e),t.stroke=t.strokeStyle=e},e}(o.a),x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"shape",draw:r.noop})},e.prototype.renderInner=function(t){var e=this.get("render");Object(r.isFunction)(e)&&e(t)},e}(o.a),b=n(9),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),e=this.get("html");Object(l.a)(t);var n=Object(r.isFunction)(e)?e(t):e;if(Object(r.isElement)(n))t.appendChild(n);else if(Object(r.isString)(n)||Object(r.isNumber)(n)){var i=Object(b.b)(""+n);i&&t.appendChild(i)}this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),e=this.getLocation(),n=e.x,i=e.y,r=this.get("alignX"),o=this.get("alignY"),a=this.get("offsetX"),s=this.get("offsetY"),l=Object(b.d)(t),c=Object(b.c)(t),u={x:n,y:i};"middle"===r?u.x-=Math.round(l/2):"right"===r&&(u.x-=Math.round(l)),"middle"===o?u.y-=Math.round(c/2):"bottom"===o&&(u.y-=Math.round(c)),a&&(u.x+=a),s&&(u.y+=s),Object(b.e)(t,{position:"absolute",left:u.x+"px",top:u.y+"px",zIndex:this.get("zIndex")})},e}(n(28).a)},function(t,e,n){"use strict";n.r(e),n.d(e,"Line",(function(){return k})),n.d(e,"Circle",(function(){return B})),n.d(e,"Base",(function(){return d}));var i={};n.r(i),n.d(i,"getDefault",(function(){return v})),n.d(i,"ellipsisHead",(function(){return m})),n.d(i,"ellipsisTail",(function(){return x})),n.d(i,"ellipsisMiddle",(function(){return b}));var r={};n.r(r),n.d(r,"getDefault",(function(){return M})),n.d(r,"reserveFirst",(function(){return A})),n.d(r,"reserveLast",(function(){return C})),n.d(r,"reserveBoth",(function(){return E})),n.d(r,"equidistance",(function(){return I})),n.d(r,"equidistanceWithReverseBoth",(function(){return P}));var o={};n.r(o),n.d(o,"getDefault",(function(){return T})),n.d(o,"fixedAngle",(function(){return L})),n.d(o,"unfixedAngle",(function(){return D}));var a={};n.r(a),n.d(a,"autoHide",(function(){return r})),n.d(a,"autoRotate",(function(){return o})),n.d(a,"autoEllipsis",(function(){return i}));var s=n(1),l=n(3),c=n(0),u=n(11),h=n(18),f=n(31),p=n(5),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(s.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(s.__assign)(Object(s.__assign)({},e),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:p.a.lineColor}},tickLine:{style:{lineWidth:1,stroke:p.a.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:p.a.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:p.a.textColor,fontFamily:p.a.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:p.a.textColor,textBaseline:"middle",fontFamily:p.a.fontFamily,textAlign:"center"},iconStyle:{fill:p.a.descriptionIconFill,stroke:p.a.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:p.a.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,e){Object(c.mix)(t,e),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,e,n){t[e]=n,this.updateTickStates(t)},e.prototype.hasState=function(t,e){return!!t[e]},e.prototype.getItemStates=function(t){var e=this.get("tickStates"),n=[];return Object(c.each)(e,(function(e,i){t[i]&&n.push(i)})),n},e.prototype.clearItemsState=function(t){var e=this,n=this.getItemsByState(t);Object(c.each)(n,(function(n){e.setItemState(n,t,!1)}))},e.prototype.getItemsByState=function(t){var e=this,n=this.getItems();return Object(c.filter)(n,(function(n){return e.hasState(n,t)}))},e.prototype.getSidePoint=function(t,e){var n=this.getSideVector(e,t);return{x:t.x+n[0],y:t.y+n[1]}},e.prototype.getTextAnchor=function(t){var e;return Object(c.isNumberEqual)(t[0],0)?e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e},e.prototype.getTextBaseline=function(t){var e;return Object(c.isNumberEqual)(t[1],0)?e="middle":t[1]>0?e="top":t[1]<0&&(e="bottom"),e},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var e=this.getLinePath(),n=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:Object(c.mix)({path:e},n.style)})},e.prototype.getTickLineItems=function(t){var e=this,n=[],i=this.get("tickLine"),r=i.alignTick,o=i.length,a=1;return t.length>=2&&(a=t[1].value-t[0].value),Object(c.each)(t,(function(t){var i=t.point;r||(i=e.getTickPoint(t.value-a/2));var s=e.getSidePoint(i,o);n.push({startPoint:i,tickValue:t.value,endPoint:s,tickId:t.id,id:"tickline-"+t.id})})),n},e.prototype.getSubTickLineItems=function(t){var e=[],n=this.get("subTickLine"),i=n.count,r=t.length;if(r>=2)for(var o=0;o0){var n=Object(c.size)(e);if(n>t.threshold){var i=Math.ceil(n/t.threshold),r=e.filter((function(t,e){return e%i==0}));this.set("ticks",r),this.set("originalTicks",e)}}},e.prototype.getLabelAttrs=function(t,e,n){var i=this.get("label"),r=i.offset,o=i.offsetX,a=i.offsetY,s=i.rotate,l=i.formatter,u=this.getSidePoint(t.point,r),f=this.getSideVector(r,u),p=l?l(t.name,t,e):t.name,d=i.style;d=Object(c.isFunction)(d)?Object(c.get)(this.get("theme"),["label","style"],{}):d;var g=Object(c.mix)({x:u.x+o,y:u.y+a,text:p,textAlign:this.getTextAnchor(f),textBaseline:this.getTextBaseline(f)},d);return s&&(g.matrix=Object(h.e)(u,s)),g},e.prototype.drawLabels=function(t){var e=this,n=this.get("ticks"),i=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});Object(c.each)(n,(function(t,r){e.addShape(i,{type:"text",name:"axis-label",id:e.getElementId("label-"+t.id),attrs:e.getLabelAttrs(t,r,n),delegateObject:{tick:t,item:t,index:r}})})),this.processOverlap(i);var r=i.getChildren(),o=Object(c.get)(this.get("theme"),["label","style"],{}),a=this.get("label"),s=a.style,l=a.formatter;if(Object(c.isFunction)(s)){var u=r.map((function(t){return Object(c.get)(t.get("delegateObject"),"tick")}));Object(c.each)(r,(function(t,e){var n=t.get("delegateObject").tick,i=l?l(n.name,n,e):n.name,r=Object(c.mix)({},o,s(i,e,u));t.attr(r)}))}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),e=t.style,n=t.position,i=t.offset,r=t.spacing,o=void 0===r?0:r,a=t.autoRotate,s=e.fontSize,u=.5;"start"===n?u=0:"end"===n&&(u=1);var f=this.getTickPoint(u),p=this.getSidePoint(f,i||o+s/2),d=Object(c.mix)({x:p.x,y:p.y,text:t.text},e),g=t.rotate,y=g;if(Object(c.isNil)(g)&&a){var v=this.getAxisVector(f);y=l.ext.angleTo(v,[1,0],!0)}if(y){var m=Object(h.e)(p,y);d.matrix=m}return d},e.prototype.drawTitle=function(t){var e,n=this.getTitleAttrs(),i=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:n});(null===(e=this.get("title"))||void 0===e?void 0:e.description)&&this.drawDescriptionIcon(t,i,n.matrix)},e.prototype.drawDescriptionIcon=function(t,e,n){var i=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),r=e.getBBox(),o=r.maxX,a=r.maxY,l=r.height,c=this.get("title").iconStyle,u=l/2,h=u/6,f=o+4,p=a-l/2,d=[f+u,p-u],g=d[0],y=d[1],v=[g+u,y+u],m=v[0],x=v[1],b=[g,x+u],_=b[0],O=b[1],w=[f,y+u],j=w[0],S=w[1],M=[f+u,p-l/4],A=M[0],C=M[1],E=[A,C+h],I=E[0],P=E[1],F=[I,P+h],T=F[0],L=F[1],D=[T,L+3*u/4],k=D[0],B=D[1];this.addShape(i,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:Object(s.__assign)({path:[["M",g,y],["A",u,u,0,0,1,m,x],["A",u,u,0,0,1,_,O],["A",u,u,0,0,1,j,S],["A",u,u,0,0,1,g,y],["M",A,C],["L",I,P],["M",T,L],["L",k,B]],lineWidth:h,matrix:n},c)}),this.addShape(i,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:f,y:p-l/2,width:l,height:l,stroke:"#000",fill:"#000",opacity:0,matrix:n,cursor:"pointer"}})},e.prototype.applyTickStates=function(t,e){if(this.getItemStates(t).length){var n=this.get("tickStates"),i=this.getElementId("label-"+t.id),r=e.findById(i);if(r){var o=Object(f.a)(t,"label",n);o&&r.attr(o)}var a=this.getElementId("tickline-"+t.id),s=e.findById(a);if(s){var l=Object(f.a)(t,"tickLine",n);l&&s.attr(l)}}},e.prototype.updateTickStates=function(t){var e=this.getItemStates(t),n=this.get("tickStates"),i=this.get("label"),r=this.getElementByLocalId("label-"+t.id),o=this.get("tickLine"),a=this.getElementByLocalId("tickline-"+t.id);if(e.length){if(r){var s=Object(f.a)(t,"label",n);s&&r.attr(s)}if(a){var l=Object(f.a)(t,"tickLine",n);l&&a.attr(l)}}else r&&r.attr(i.style),a&&a.attr(o.style)},e}(u.a),g=n(22);function y(t,e,n,i){var r=e.getChildren(),o=!1;return Object(c.each)(r,(function(e){var r=Object(g.a)(t,e,n,i);o=o||r})),o}function v(){return x}function m(t,e,n){return y(t,e,n,"head")}function x(t,e,n){return y(t,e,n,"tail")}function b(t,e,n){return y(t,e,n,"middle")}var _=n(4);function O(t){return(function(t){var e=t.attr("matrix");return e&&1!==e[0]}(t)?Object(h.d)(t.attr("matrix")):0)%360}function w(t,e,n,i){var r=!1,o=O(e),a=t?Math.abs(n.attr("y")-e.attr("y")):Math.abs(n.attr("x")-e.attr("x")),s=(t?n.attr("y")>e.attr("y"):n.attr("x")>e.attr("x"))?e.getBBox():n.getBBox();if(t){var l=Math.abs(Math.cos(o));r=Object(_.i)(l,0,Math.PI/180)?s.width+i>a:s.height/l+i>a}else{l=Math.abs(Math.sin(o));r=Object(_.i)(l,0,Math.PI/180)?s.width+i>a:s.height/l+i>a}return r}function j(t,e,n,i){var r=(null==i?void 0:i.minGap)||0,o=e.getChildren().slice().filter((function(t){return t.get("visible")}));if(!o.length)return!1;var a=!1;n&&o.reverse();for(var s=o.length,l=o[0],c=1;c1){f=Math.ceil(f);for(var d=0;d2){var a=r[0],s=r[r.length-1];a.get("visible")||(a.show(),j(t,e,!1,i)&&(o=!0)),s.get("visible")||(s.show(),j(t,e,!0,i)&&(o=!0))}return o}function F(t,e,n,i){var r=e.getChildren();if(!r.length)return!1;if(!t&&r.length<2)return!1;var o=Object(g.b)(r),a=!1;t?a=!!n&&o>n:a=o>Math.abs(r[1].attr("x")-r[0].attr("x"));a&&function(t,e){Object(c.each)(t,(function(t){var n=t.attr("x"),i=t.attr("y"),r=Object(h.e)({x:n,y:i},e);t.attr("matrix",r)}))}(r,i(n,o));return a}function T(){return L}function L(t,e,n,i){return F(t,e,n,(function(){return Object(c.isNumber)(i)?i:t?p.a.verticalAxisRotate:p.a.horizontalAxisRotate}))}function D(t,e,n){return F(t,e,n,(function(e,n){if(!e)return t?p.a.verticalAxisRotate:p.a.horizontalAxisRotate;if(t)return-Math.acos(e/n);var i=0;return(e>n||(i=Math.asin(e/n))>Math.PI/4)&&(i=Math.PI/4),i}))}var k=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(s.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(s.__assign)(Object(s.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),e=this.get("end"),n=[];return n.push(["M",t.x,t.y]),n.push(["L",e.x,e.y]),n},e.prototype.getInnerLayoutBBox=function(){var e=this.get("start"),n=this.get("end"),i=t.prototype.getInnerLayoutBBox.call(this),r=Math.min(e.x,n.x,i.x),o=Math.min(e.y,n.y,i.y),a=Math.max(e.x,n.x,i.maxX),s=Math.max(e.y,n.y,i.maxY);return{x:r,y:o,minX:r,minY:o,maxX:a,maxY:s,width:a-r,height:s-o}},e.prototype.isVertical=function(){var t=this.get("start"),e=this.get("end");return Object(c.isNumberEqual)(t.x,e.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),e=this.get("end");return Object(c.isNumberEqual)(t.y,e.y)},e.prototype.getTickPoint=function(t){var e=this.get("start"),n=this.get("end"),i=n.x-e.x,r=n.y-e.y;return{x:e.x+i*t,y:e.y+r*t}},e.prototype.getSideVector=function(t){var e=this.getAxisVector(),n=l.vec2.normalize([0,0],e),i=this.get("verticalFactor"),r=[n[1],-1*n[0]];return l.vec2.scale([0,0],r,t*i)},e.prototype.getAxisVector=function(){var t=this.get("start"),e=this.get("end");return[e.x-t.x,e.y-t.y]},e.prototype.processOverlap=function(t){var e=this,n=this.isVertical(),i=this.isHorizontal();if(n||i){var r=this.get("label"),o=this.get("title"),a=this.get("verticalLimitLength"),s=r.offset,l=a,u=0,h=0;o&&(u=o.style.fontSize,h=o.spacing),l&&(l=l-s-h-u);var f=this.get("overlapOrder");if(Object(c.each)(f,(function(n){r[n]&&e.canProcessOverlap(n)&&e.autoProcessOverlap(n,r[n],t,l)})),o&&Object(c.isNil)(o.offset)){var p=t.getCanvasBBox(),d=n?p.width:p.height;o.offset=s+d+h+u/2}}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||Object(c.isNil)(e.rotate)},e.prototype.autoProcessOverlap=function(t,e,n,i){var r=this,o=this.isVertical(),s=!1,l=a[t];if(!0===e){this.get("label");s=l.getDefault()(o,n,i)}else if(Object(c.isFunction)(e))s=e(o,n,i);else if(Object(c.isObject)(e)){var u=e;l[u.type]&&(s=l[u.type](o,n,i,u.cfg))}else l[e]&&(s=l[e](o,n,i));if("autoRotate"===t){if(s){var h=n.getChildren(),f=this.get("verticalFactor");Object(c.each)(h,(function(t){if("center"===t.attr("textAlign")){var e=f>0?"end":"start";t.attr("textAlign",e)}}))}}else if("autoHide"===t){var p=n.getChildren().slice(0);Object(c.each)(p,(function(t){t.get("visible")||(r.get("isRegister")&&r.unregisterElement(t),t.remove())}))}},e}(d),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(s.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(s.__assign)(Object(s.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getLinePath=function(){var t=this.get("center"),e=t.x,n=t.y,i=this.get("radius"),r=i,o=this.get("startAngle"),a=this.get("endAngle"),s=[];if(Math.abs(a-o)===2*Math.PI)s=[["M",e,n-r],["A",i,r,0,1,1,e,n+r],["A",i,r,0,1,1,e,n-r],["Z"]];else{var l=this.getCirclePoint(o),c=this.getCirclePoint(a),u=Math.abs(a-o)>Math.PI?1:0,h=o>a?0:1;s=[["M",e,n],["L",l.x,l.y],["A",i,r,0,u,h,c.x,c.y],["L",e,n]]}return s},e.prototype.getTickPoint=function(t){var e=this.get("startAngle"),n=e+(this.get("endAngle")-e)*t;return this.getCirclePoint(n)},e.prototype.getSideVector=function(t,e){var n=this.get("center"),i=[e.x-n.x,e.y-n.y],r=this.get("verticalFactor"),o=l.vec2.length(i);return l.vec2.scale(i,i,r*t/o),i},e.prototype.getAxisVector=function(t){var e=this.get("center"),n=[t.x-e.x,t.y-e.y];return[n[1],-1*n[0]]},e.prototype.getCirclePoint=function(t,e){var n=this.get("center");return e=e||this.get("radius"),{x:n.x+Math.cos(t)*e,y:n.y+Math.sin(t)*e}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||Object(c.isNil)(e.rotate)},e.prototype.processOverlap=function(t){var e=this,n=this.get("label"),i=this.get("title"),r=this.get("verticalLimitLength"),o=n.offset,a=r,s=0,l=0;i&&(s=i.style.fontSize,l=i.spacing),a&&(a=a-o-l-s);var u=this.get("overlapOrder");if(Object(c.each)(u,(function(i){n[i]&&e.canProcessOverlap(i)&&e.autoProcessOverlap(i,n[i],t,a)})),i&&Object(c.isNil)(i.offset)){var h=t.getCanvasBBox().height;i.offset=o+h+l+s/2}},e.prototype.autoProcessOverlap=function(t,e,n,i){var r=this,o=!1,s=a[t];if(i>0)if(!0===e)o=s.getDefault()(!1,n,i);else if(Object(c.isFunction)(e))o=e(!1,n,i);else if(Object(c.isObject)(e)){var l=e;s[l.type]&&(o=s[l.type](!1,n,i,l.cfg))}else s[e]&&(o=s[e](!1,n,i));if("autoRotate"===t){if(o){var u=n.getChildren(),h=this.get("verticalFactor");Object(c.each)(u,(function(t){if("center"===t.attr("textAlign")){var e=h>0?"end":"start";t.attr("textAlign",e)}}))}}else if("autoHide"===t){var f=n.getChildren().slice(0);Object(c.each)(f,(function(t){t.get("visible")||(r.get("isRegister")&&r.unregisterElement(t),t.remove())}))}},e}(d)},function(t,e,n){"use strict";n.r(e),n.d(e,"Line",(function(){return h})),n.d(e,"Circle",(function(){return f})),n.d(e,"Base",(function(){return u})),n.d(e,"Html",(function(){return y}));var i,r=n(1),o=n(4),a=n(0),s=n(11),l=n(18),c=n(5),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(r.__assign)(Object(r.__assign)({},e),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:c.a.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:c.a.textColor,textAlign:"center",textBaseline:"middle",fontFamily:c.a.fontFamily}},textBackground:{padding:5,style:{stroke:c.a.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var e=this.get("text"),n=e.style,i=e.autoRotate,o=e.content;if(!Object(a.isNil)(o)){var s=this.getTextPoint(),c=null;if(i){var u=this.getRotateAngle();c=Object(l.e)(s,u)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:Object(r.__assign)(Object(r.__assign)(Object(r.__assign)({},s),{text:o,matrix:c}),n)})}},e.prototype.renderLine=function(t){var e=this.getLinePath(),n=this.get("line").style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:Object(r.__assign)({path:e},n)})},e.prototype.renderBackground=function(t){var e=this.getElementId("text"),n=t.findById(e),i=this.get("textBackground");if(i&&n){var a=n.getBBox(),s=Object(o.c)(i.padding),l=i.style;this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:Object(r.__assign)({x:a.x-s[3],y:a.y-s[0],width:a.width+s[1]+s[3],height:a.height+s[0]+s[2],matrix:n.attr("matrix")},l)}).toBack()}},e}(s.a),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(r.__assign)(Object(r.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.start,n=t.end,i=this.get("text").position,r=Math.atan2(n.y-e.y,n.x-e.x);return"start"===i?r-Math.PI/2:r+Math.PI/2},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,n=t.end,i=this.get("text"),r=i.position,a=i.offset;return Object(o.f)(e,n,r,a)},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.start,n=t.end;return[["M",e.x,e.y],["L",n.x,n.y]]},e}(u),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(r.__assign)(Object(r.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.startAngle,n=t.endAngle;return"start"===this.get("text").position?e+Math.PI/2:n-Math.PI/2},e.prototype.getTextPoint=function(){var t=this.get("text"),e=t.position,n=t.offset,i=this.getLocation(),r=i.center,a=i.radius,s=i.startAngle,l=i.endAngle,c="start"===e?s:l,u=this.getRotateAngle()-Math.PI,h=Object(o.e)(r,a,c),f=Math.cos(u)*n,p=Math.sin(u)*n;return{x:h.x+f,y:h.y+p}},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.center,n=t.radius,i=t.startAngle,r=t.endAngle,a=null;if(r-i==2*Math.PI){var s=e.x,l=e.y;a=[["M",s,l-n],["A",n,n,0,1,1,s,l+n],["A",n,n,0,1,1,s,l-n],["Z"]]}else{var c=Object(o.e)(e,n,i),u=Object(o.e)(e,n,r),h=Math.abs(r-i)>Math.PI?1:0,f=i>r?0:1;a=[["M",c.x,c.y],["A",n,n,0,h,f,u.x,u.y]]}return a},e}(u),p=n(9),d=n(28),g=((i={})["g2-crosshair"]={position:"relative"},i["g2-crosshair-line"]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},i["g2-crosshair-text"]={position:"absolute",color:c.a.textColor,fontFamily:c.a.fontFamily},i),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(r.__assign)(Object(r.__assign)({},e),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'
',crosshairTpl:'
',textTpl:'{content}',domStyles:null,containerClassName:"g2-crosshair",defaultStyles:g,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),e=this.get("crosshairTpl"),n=Object(p.b)(e);t.appendChild(n),this.applyStyle("g2-crosshair-line",n),this.set("crosshairEl",n)},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,n=t.end,i=this.get("text"),r=i.position,a=i.offset;return Object(o.f)(e,n,r,a)},e.prototype.resetText=function(){var t=this.get("text"),e=this.get("textEl");if(t){var n=t.content;if(!e){var i=this.getContainer(),r=Object(a.substitute)(this.get("textTpl"),t);e=Object(p.b)(r),i.appendChild(e),this.applyStyle("g2-crosshair-text",e),this.set("textEl",e)}e.innerHTML=n}else e&&e.remove()},e.prototype.isVertical=function(t,e){return t.x===e.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var e=this.get("start"),n=this.get("end"),i=Math.min(e.x,n.x),r=Math.min(e.y,n.y);this.isVertical(e,n)?Object(p.e)(t,{width:"1px",height:Object(o.l)(Math.abs(n.y-e.y))}):Object(p.e)(t,{height:"1px",width:Object(o.l)(Math.abs(n.x-e.x))}),Object(p.e)(t,{top:Object(o.l)(r),left:Object(o.l)(i)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var e=this.get("text").align,n=t.clientWidth,i=this.getTextPoint();switch(e){case"center":i.x=i.x-n/2;break;case"right":i.x=i.x-n}Object(p.e)(t,{top:Object(o.l)(i.y),left:Object(o.l)(i.x)})}},e.prototype.updateInner=function(e){Object(a.hasKey)(e,"text")&&this.resetText(),t.prototype.updateInner.call(this,e)},e}(d.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return _}));var i=n(1),r=n(0),o=n(11),a={opacity:0},s={stroke:"#C5C5C5",strokeOpacity:.85},l={fill:"#CACED4",opacity:.85},c=n(21),u=n(25);function h(t){return function(t){return Object(r.map)(t,(function(t,e){return[0===e?"M":"L",t[0],t[1]]}))}(t)}function f(t,e,n,i){void 0===i&&(i=!0);var o=new u.b({values:t}),a=new u.a({values:Object(r.map)(t,(function(t,e){return e}))}),s=Object(r.map)(t,(function(t,i){return[a.scale(i)*e,n-o.scale(t)*n]}));return i?function(t){if(t.length<=2)return h(t);var e=[];Object(r.each)(t,(function(t){Object(r.isEqual)(t,e.slice(e.length-2))||e.push(t[0],t[1])}));var n=Object(c.catmullRom2Bezier)(e,!1),i=Object(r.head)(t),o=i[0],a=i[1];return n.unshift(["M",o,a]),n}(s):h(s)}function p(t,e,n,r){var o=Object(i.__spreadArrays)(t),a=function(t,e){var n=new u.b({values:t}),i=n.max<0?n.max:Math.max(0,n.min);return e-n.scale(i)*e}(r,n);return o.push(["L",e,a]),o.push(["L",0,a]),o.push(["Z"]),o}var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:a,lineStyle:s,areaStyle:l})},e.prototype.renderInner=function(t){var e=this.cfg,n=e.width,r=e.height,o=e.data,a=e.smooth,s=e.isArea,l=e.backgroundStyle,c=e.lineStyle,u=e.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:Object(i.__assign)({x:0,y:0,width:n,height:r},l)});var h=f(o,n,r,a);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:Object(i.__assign)({path:h},c)}),s){var d=p(h,n,r,o);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:Object(i.__assign)({path:d},u)})}},e.prototype.applyOffset=function(){var t=this.cfg,e=t.x,n=t.y;this.moveElementTo(this.get("group"),{x:e,y:n})},e}(o.a),g={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"handler",x:0,y:0,width:10,height:24,style:g})},e.prototype.renderInner=function(t){var e=this.cfg,n=e.width,i=e.height,r=e.style,o=r.fill,a=r.stroke,s=r.radius,l=r.opacity,c=r.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:n,height:i,fill:o,stroke:a,radius:s,opacity:l,cursor:c}});var u=1/3*n,h=2/3*n,f=1/4*i,p=3/4*i;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:u,y1:f,x2:u,y2:p,stroke:a,cursor:c}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:h,y1:f,x2:h,y2:p,stroke:a,cursor:c}})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",(function(){var e=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",e),t.draw()})),this.get("group").on("mouseleave",(function(){var e=t.get("style").fill;t.getElementByLocalId("background").attr("fill",e),t.draw()}))},e.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},e}(o.a),v={fill:"#416180",opacity:.05},m={fill:"#5B8FF9",opacity:.15,cursor:"move"},x={width:10,height:24},b={textBaseline:"middle",fill:"#000",opacity:.45},_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){return function(n){e.currentTarget=t;var i=n.originalEvent;i.stopPropagation(),i.preventDefault(),e.prevX=Object(r.get)(i,"touches.0.pageX",i.pageX),e.prevY=Object(r.get)(i,"touches.0.pageY",i.pageY);var o=e.getContainerDOM();o.addEventListener("mousemove",e.onMouseMove),o.addEventListener("mouseup",e.onMouseUp),o.addEventListener("mouseleave",e.onMouseUp),o.addEventListener("touchmove",e.onMouseMove),o.addEventListener("touchend",e.onMouseUp),o.addEventListener("touchcancel",e.onMouseUp)}},e.onMouseMove=function(t){var n=e.cfg.width,i=[e.get("start"),e.get("end")];t.stopPropagation(),t.preventDefault();var o=Object(r.get)(t,"touches.0.pageX",t.pageX),a=Object(r.get)(t,"touches.0.pageY",t.pageY),s=o-e.prevX,l=e.adjustOffsetRange(s/n);e.updateStartEnd(l),e.updateUI(e.getElementByLocalId("foreground"),e.getElementByLocalId("minText"),e.getElementByLocalId("maxText")),e.prevX=o,e.prevY=a,e.draw(),e.emit("sliderchange",[e.get("start"),e.get("end")].sort()),e.delegateEmit("valuechanged",{originValue:i,value:[e.get("start"),e.get("end")]})},e.onMouseUp=function(){e.currentTarget&&(e.currentTarget=void 0);var t=e.getContainerDOM();t&&(t.removeEventListener("mousemove",e.onMouseMove),t.removeEventListener("mouseup",e.onMouseUp),t.removeEventListener("mouseleave",e.onMouseUp),t.removeEventListener("touchmove",e.onMouseMove),t.removeEventListener("touchend",e.onMouseUp),t.removeEventListener("touchcancel",e.onMouseUp))},e}return Object(i.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var n=this.get("start"),i=this.get("end"),o=Object(r.clamp)(n,t,e),a=Object(r.clamp)(i,t,e);this.get("isInit")||n===o&&i===a||this.setValue([o,a])},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange();if(Object(r.isArray)(t)&&2===t.length){var n=[this.get("start"),this.get("end")];this.update({start:Object(r.clamp)(t[0],e.min,e.max),end:Object(r.clamp)(t[1],e.min,e.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:n,value:t})}},e.prototype.getValue=function(){return[this.get("start"),this.get("end")]},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:v,foregroundStyle:m,handlerStyle:x,textStyle:b}})},e.prototype.update=function(e){var n=e.start,o=e.end,a=Object(i.__assign)({},e);Object(r.isNil)(n)||(a.start=Object(r.clamp)(n,0,1)),Object(r.isNil)(o)||(a.end=Object(r.clamp)(o,0,1)),t.prototype.update.call(this,a),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},e.prototype.init=function(){this.set("start",Object(r.clamp)(this.get("start"),0,1)),this.set("end",Object(r.clamp)(this.get("end"),0,1)),t.prototype.init.call(this)},e.prototype.render=function(){t.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},e.prototype.renderInner=function(t){var e=this.cfg,n=(e.start,e.end,e.width),o=e.height,a=e.trendCfg,s=void 0===a?{}:a,l=e.minText,c=e.maxText,u=e.backgroundStyle,h=void 0===u?{}:u,f=e.foregroundStyle,p=void 0===f?{}:f,v=e.textStyle,m=void 0===v?{}:v,x=Object(r.deepMix)({},g,this.cfg.handlerStyle);Object(r.size)(Object(r.get)(s,"data"))&&(this.trend=this.addComponent(t,Object(i.__assign)({component:d,id:this.getElementId("trend"),x:0,y:0,width:n,height:o},s))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:Object(i.__assign)({x:0,y:0,width:n,height:o},h)});this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:Object(i.__assign)({y:o/2,textAlign:"right",text:l,silent:!1},m)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:Object(i.__assign)({y:o/2,textAlign:"left",text:c,silent:!1},m)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:Object(i.__assign)({y:0,height:o},p)});var b=Object(r.get)(x,"width",10),_=Object(r.get)(x,"height",24);this.minHandler=this.addComponent(t,{component:y,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(o-_)/2,width:b,height:_,cursor:"ew-resize",style:x}),this.maxHandler=this.addComponent(t,{component:y,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(o-_)/2,width:b,height:_,cursor:"ew-resize",style:x})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.updateUI=function(t,e,n){var i=this.cfg,o=i.start,a=i.end,s=i.width,l=i.minText,c=i.maxText,u=i.handlerStyle,h=i.height,f=o*s,p=a*s;this.trend&&(this.trend.update({width:s,height:h}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",f),t.attr("width",p-f);var d=Object(r.get)(u,"width",10);e.attr("text",l),n.attr("text",c);var g=this._dodgeText([f,p],e,n),y=g[0],v=g[1];this.minHandler&&(this.minHandler.update({x:f-d/2}),this.get("updateAutoRender")||this.minHandler.render()),Object(r.each)(y,(function(t,n){return e.attr(n,t)})),this.maxHandler&&(this.maxHandler.update({x:p-d/2}),this.get("updateAutoRender")||this.maxHandler.render()),Object(r.each)(v,(function(t,e){return n.attr(e,t)}))},e.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var e=t.findById(this.getElementId("foreground"));e.on("mousedown",this.onMouseDown("foreground")),e.on("touchstart",this.onMouseDown("foreground"))},e.prototype.adjustOffsetRange=function(t){var e=this.cfg,n=e.start,i=e.end;switch(this.currentTarget){case"minHandler":var r=0-n,o=1-n;return Math.min(o,Math.max(r,t));case"maxHandler":r=0-i,o=1-i;return Math.min(o,Math.max(r,t));case"foreground":r=0-n,o=1-i;return Math.min(o,Math.max(r,t))}},e.prototype.updateStartEnd=function(t){var e=this.cfg,n=e.start,i=e.end;switch(this.currentTarget){case"minHandler":n+=t;break;case"maxHandler":i+=t;break;case"foreground":n+=t,i+=t}this.set("start",n),this.set("end",i)},e.prototype._dodgeText=function(t,e,n){var i,o,a=this.cfg,s=a.handlerStyle,l=a.width,c=Object(r.get)(s,"width",10),u=t[0],h=t[1],f=!1;u>h&&(u=(i=[h,u])[0],h=i[1],e=(o=[n,e])[0],n=o[1],f=!0);var p=e.getBBox(),d=n.getBBox(),g=p.width>u-2?{x:u+c/2+2,textAlign:"left"}:{x:u-c/2-2,textAlign:"right"},y=d.width>l-h-2?{x:h-c/2-2,textAlign:"right"}:{x:h+c/2+2,textAlign:"left"};return f?[y,g]:[g,y]},e.prototype.draw=function(){var t=this.get("container"),e=t&&t.get("canvas");e&&e.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e}(o.a)},function(t,e,n){"use strict";n.r(e),n.d(e,"Base",(function(){return s})),n.d(e,"Circle",(function(){return l})),n.d(e,"Line",(function(){return c}));var i=n(1),r=n(0),o=n(11),a=n(5),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:a.a.lineColor}}}})},e.prototype.getLineType=function(){return(this.get("line")||this.get("defaultCfg").line).type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,e){var n=this.getGridPath(t),i=e.slice(0).reverse(),r=this.getGridPath(i,!0);return this.get("closed")?n=n.concat(r):(r[0][0]="L",(n=n.concat(r)).push(["Z"])),n},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var e=this,n=this.get("line"),i=this.get("items"),o=this.get("alternateColor"),a=null;Object(r.each)(i,(function(s,l){var c=s.id||l;if(n){var u=e.getPathStyle();u=Object(r.isFunction)(u)?u(s,l,i):u;var h=e.getElementId("line-"+c),f=e.getGridPath(s.points);e.addShape(t,{type:"path",name:"grid-line",id:h,attrs:Object(r.mix)({path:f},u)})}if(o&&l>0){var p=e.getElementId("region-"+c),d=l%2==0;if(Object(r.isString)(o))d&&e.drawAlternateRegion(p,t,a.points,s.points,o);else{var g=d?o[1]:o[0];e.drawAlternateRegion(p,t,a.points,s.points,g)}}a=s}))},e.prototype.drawAlternateRegion=function(t,e,n,i,r){var o=this.getAlternatePath(n,i);this.addShape(e,{type:"path",id:t,name:"grid-region",attrs:{path:o,fill:r}})},e}(o.a);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,e){var n,i,o,a,s,l,c=this.getLineType(),u=this.get("closed"),h=[];if(t.length)if("circle"===c){var f=this.get("center"),p=t[0],d=(n=f.x,i=f.y,o=p.x,a=p.y,s=o-n,l=a-i,Math.sqrt(s*s+l*l)),g=e?0:1;u?(h.push(["M",f.x,f.y-d]),h.push(["A",d,d,0,0,g,f.x,f.y+d]),h.push(["A",d,d,0,0,g,f.x,f.y-d]),h.push(["Z"])):Object(r.each)(t,(function(t,e){0===e?h.push(["M",t.x,t.y]):h.push(["A",d,d,0,0,g,t.x,t.y])}))}else Object(r.each)(t,(function(t,e){0===e?h.push(["M",t.x,t.y]):h.push(["L",t.x,t.y])})),u&&h.push(["Z"]);return h},e}(s),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{type:"line"})},e.prototype.getGridPath=function(t){var e=[];return Object(r.each)(t,(function(t,n){0===n?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])})),e},e}(s)},function(t,e,n){"use strict";n.r(e),n.d(e,"Category",(function(){return g})),n.d(e,"Continuous",(function(){return y})),n.d(e,"Base",(function(){return h}));var i=n(1),r=n(0),o=n(22),a=n(18),s=n(31),l=n(5),c=n(11),u=n(4),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var e=t.prototype.getLayoutBBox.call(this),n=this.get("maxWidth"),i=this.get("maxHeight"),r=e.width,o=e.height;return n&&(r=Math.min(r,n)),i&&(o=Math.min(o,i)),Object(u.b)(e.minX,e.minY,r,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),e=this.get("y"),n=this.get("offsetX"),i=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+n,y:e+i})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var e=this.get("background"),n=t.getBBox(),r=Object(u.c)(e.padding),o=Object(i.__assign)({x:0,y:0,width:n.width+r[1]+r[3],height:n.height+r[0]+r[2]},e.style);this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:o}).toBack()},e.prototype.drawTitle=function(t){var e=this.get("currentPoint"),n=this.get("title"),r=n.spacing,o=n.style,a=n.text,s=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:Object(i.__assign)({text:a,x:e.x,y:e.y},o)}).getBBox();this.set("currentPoint",{x:e.x,y:s.maxY+r})},e.prototype.resetDraw=function(){var t=this.get("background"),e={x:0,y:0};if(t){var n=Object(u.c)(t.padding);e.x=n[3],e.y=n[0]}this.set("currentPoint",e)},e}(c.a),f={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},p={fill:l.a.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:l.a.fontFamily,fontWeight:"normal",lineHeight:12},d={right:90*Math.PI/180,left:270*Math.PI/180,up:0,down:180*Math.PI/180},g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.currentPageIndex=1,e.totalPagesCnt=1,e.pageWidth=0,e.pageHeight=0,e.startX=0,e.startY=0,e.onNavigationBack=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndex>1){e.currentPageIndex-=1,e.updateNavigation();var n=e.getCurrentNavigationMatrix();e.get("animate")?t.animate({matrix:n},100):t.attr({matrix:n})}},e.onNavigationAfter=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndexg&&(g=m),"horizontal"===f?(y&&yb&&(b=e.width)})),_=b,b+=h,l&&(b=Math.min(l,b),_=Math.min(l,_)),this.pageWidth=b,this.pageHeight=c-Math.max(y.height,p+O);var S=Math.floor(this.pageHeight/(p+O));Object(r.each)(s,(function(t,e){0!==e&&e%S==0&&(m+=1,v.x+=b,v.y=o),n.moveElementTo(t,v),t.getParent().setClip({type:"rect",attrs:{x:v.x,y:v.y,width:b,height:p}}),v.y+=p+O})),this.totalPagesCnt=m,this.moveElementTo(g,{x:i+_/2-y.width/2-y.minX,y:c-y.height-y.minY})}this.pageHeight&&this.pageWidth&&e.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),"horizontal"===a&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(m/this.get("maxRow")):this.totalPagesCnt=m,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(g),e.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,e,n,o){var a={x:0,y:0},s=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),l=Object(r.get)(o.marker,"style",{}),c=l.size,u=void 0===c?12:c,h=Object(i.__rest)(l,["size"]),f=this.drawArrow(s,a,"navigation-arrow-left","horizontal"===e?"up":"left",u,h);f.on("click",this.onNavigationBack);var p=f.getBBox();a.x+=p.width+2;var d=this.addShape(s,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:Object(i.__assign)({x:a.x,y:a.y+u/2,text:n,textBaseline:"middle"},Object(r.get)(o.text,"style"))}).getBBox();return a.x+=d.width+2,this.drawArrow(s,a,"navigation-arrow-right","horizontal"===e?"down":"right",u,h).on("click",this.onNavigationAfter),s},e.prototype.updateNavigation=function(t){var e=Object(r.deepMix)({},f,this.get("pageNavigator")).marker.style,n=e.fill,i=e.opacity,o=e.inactiveFill,a=e.inactiveOpacity,s=this.currentPageIndex+"/"+this.totalPagesCnt,l=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),c=t?t.findById(this.getElementId("navigation-arrow-left")):this.getElementByLocalId("navigation-arrow-left"),u=t?t.findById(this.getElementId("navigation-arrow-right")):this.getElementByLocalId("navigation-arrow-right");l.attr("text",s),c.attr("opacity",1===this.currentPageIndex?a:i),c.attr("fill",1===this.currentPageIndex?o:n),c.attr("cursor",1===this.currentPageIndex?"not-allowed":"pointer"),u.attr("opacity",this.currentPageIndex===this.totalPagesCnt?a:i),u.attr("fill",this.currentPageIndex===this.totalPagesCnt?o:n),u.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var h=c.getBBox().maxX+2;l.attr("x",h),h+=l.getBBox().width+2,this.updateArrowPath(u,{x:h,y:0})},e.prototype.drawArrow=function(t,e,n,r,o,s){var l=e.x,c=e.y,u=this.addShape(t,{type:"path",id:this.getElementId(n),name:n,attrs:Object(i.__assign)({size:o,direction:r,path:[["M",l+o/2,c],["L",l,c+o],["L",l+o,c+o],["Z"]],cursor:"pointer"},s)});return u.attr("matrix",Object(a.e)({x:l+o/2,y:c+o/2},d[r])),u},e.prototype.updateArrowPath=function(t,e){var n=e.x,i=e.y,r=t.attr(),o=r.size,s=r.direction,l=Object(a.e)({x:n+o/2,y:i+o/2},d[s]);t.attr("path",[["M",n+o/2,i],["L",n,i+o],["L",n+o,i+o],["Z"]]),t.attr("matrix",l)},e.prototype.getCurrentNavigationMatrix=function(){var t=this.currentPageIndex,e=this.pageWidth,n=this.pageHeight,i="horizontal"===this.get("layout")?{x:0,y:n*(1-t)}:{x:e*(1-t),y:0};return Object(a.f)(i)},e.prototype.applyItemStates=function(t,e){if(this.getItemStates(t).length>0){var n=e.getChildren(),i=this.get("itemStates");Object(r.each)(n,(function(e){var n=e.get("name").split("-")[2],r=Object(s.a)(t,n,i);r&&(e.attr(r),"marker"!==n||e.get("isStroke")&&e.get("isFill")||(e.get("isStroke")&&e.attr("fill",null),e.get("isFill")&&e.attr("stroke",null)))}))}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),e=this.get("maxItemWidth");return e?t&&(e=t<=e?t:e):t&&(e=t),e},e}(h),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:l.a.textColor,textBaseline:"middle",fontFamily:l.a.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:l.a.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,e){this.update({min:t,max:e})},e.prototype.setValue=function(t){var e=this.getValue();this.set("value",t);var n=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(n),this.delegateEmit("valuechanged",{originValue:e,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var e=this;t.on("legend-handler-min:drag",(function(t){var n=e.getValueByCanvasPoint(t.x,t.y),i=e.getCurrentValue()[1];in&&(i=n),e.setValue([i,n])}))},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var e=this,n=null;t.on("legend-track:dragstart",(function(t){n={x:t.x,y:t.y}})),t.on("legend-track:drag",(function(t){if(n){var i=e.getValueByCanvasPoint(n.x,n.y),r=e.getValueByCanvasPoint(t.x,t.y),o=e.getCurrentValue(),a=o[1]-o[0],s=e.getRange(),l=r-i;l<0?o[0]+l>s.min?e.setValue([o[0]+l,o[1]+l]):e.setValue([s.min,s.min+a]):l>0&&(l>0&&o[1]+lo&&(c=o),c0&&this.changeRailLength(i,o,n[o]-u)}},e.prototype.changeRailLength=function(t,e,n){var i,r=t.getBBox();i="height"===e?this.getRailPath(r.x,r.y,r.width,n):this.getRailPath(r.x,r.y,n,r.height),t.attr("path",i)},e.prototype.changeRailPosition=function(t,e,n){var i=t.getBBox(),r=this.getRailPath(e,n,i.width,i.height);t.attr("path",r)},e.prototype.fixedHorizontal=function(t,e,n,i){var r=this.get("label"),o=r.align,a=r.spacing,s=n.getBBox(),l=t.getBBox(),c=e.getBBox(),u=s.height;this.fitRailLength(l,c,s,n),s=n.getBBox(),"rail"===o?(t.attr({x:i.x,y:i.y+u/2}),this.changeRailPosition(n,i.x+l.width+a,i.y),e.attr({x:i.x+l.width+s.width+2*a,y:i.y+u/2})):"top"===o?(t.attr({x:i.x,y:i.y}),e.attr({x:i.x+s.width,y:i.y}),this.changeRailPosition(n,i.x,i.y+l.height+a)):(this.changeRailPosition(n,i.x,i.y),t.attr({x:i.x,y:i.y+s.height+a}),e.attr({x:i.x+s.width,y:i.y+s.height+a}))},e.prototype.fixedVertail=function(t,e,n,i){var r=this.get("label"),o=r.align,a=r.spacing,s=n.getBBox(),l=t.getBBox(),c=e.getBBox();if(this.fitRailLength(l,c,s,n),s=n.getBBox(),"rail"===o)t.attr({x:i.x,y:i.y}),this.changeRailPosition(n,i.x,i.y+l.height+a),e.attr({x:i.x,y:i.y+l.height+s.height+2*a});else if("right"===o)t.attr({x:i.x+s.width+a,y:i.y}),this.changeRailPosition(n,i.x,i.y),e.attr({x:i.x+s.width+a,y:i.y+s.height});else{var u=Math.max(l.width,c.width);t.attr({x:i.x,y:i.y}),this.changeRailPosition(n,i.x+u+a,i.y),e.attr({x:i.x,y:i.y+s.height})}},e}(h)},function(t,e,n){"use strict";n.r(e),n.d(e,"Html",(function(){return p}));var i,r=n(1),o=n(26),a=n(9),s=n(0),l=n(28),c=n(4),u=n(19),h=n(5),f=((i={})[""+u.CONTAINER_CLASS]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:h.a.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},i[""+u.TITLE_CLASS]={marginBottom:"4px"},i[""+u.LIST_CLASS]={margin:"0px",listStyleType:"none",padding:"0px"},i[""+u.LIST_ITEM_CLASS]={listStyleType:"none",marginBottom:"4px"},i[""+u.MARKER_CLASS]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},i[""+u.VALUE_CLASS]={display:"inline-block",float:"right",marginLeft:"30px"},i[""+u.CROSSHAIR_X]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},i[""+u.CROSSHAIR_Y]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},i);var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(r.__assign)(Object(r.__assign)({},e),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'
    ',itemTpl:'
  • \n \n {name}:\n {value}\n
  • ',xCrosshairTpl:'
    ',yCrosshairTpl:'
    ',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:u.CONTAINER_CLASS,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:f})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!0),Object(a.e)(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!1),Object(a.e)(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var e=t?"":"none",n=this.get("xCrosshairDom"),i=this.get("yCrosshairDom");n&&Object(a.e)(n,{display:e}),i&&Object(a.e)(i,{display:e})},e.prototype.initContainer=function(){if(t.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var e=this.getHtmlContentNode();this.get("parent").appendChild(e),this.set("container",e),this.resetStyles(),this.applyStyles()}},e.prototype.updateInner=function(e){var n,i,r;this.get("customContent")?this.renderCustomContent():(n=e,i=["title","showTitle"],r=!1,Object(s.each)(i,(function(t){if(Object(s.hasKey)(n,t))return r=!0,!1})),r&&this.resetTitle(),Object(s.hasKey)(e,"items")&&this.renderItems()),t.prototype.updateInner.call(this,e)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){t.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t,e=this.get("x"),n=this.get("y"),i=this.get("offset"),r=this.getOffset(),o=r.offsetX,s=r.offsetY,l=this.get("position"),u=this.get("region"),h=this.getContainer(),f=this.getBBox(),p=f.width,d=f.height;u&&(t=Object(c.k)(u));var g=function(t,e,n,i,r,o,a){var s=function(t,e,n,i,r,o){var a=t,s=e;switch(o){case"left":a=t-i-n,s=e-r/2;break;case"right":a=t+n,s=e-r/2;break;case"top":a=t-i/2,s=e-r-n;break;case"bottom":a=t-i/2,s=e+n;break;default:a=t+n,s=e-r-n}return{x:a,y:s}}(t,e,n,i,r,o);if(a){var l=function(t,e,n,i,r){return{left:tr.x+r.width,top:er.y+r.height}}(s.x,s.y,i,r,a);"auto"===o?(l.right&&(s.x=Math.max(0,t-i-n)),l.top&&(s.y=Math.max(0,e-r-n))):"top"===o||"bottom"===o?(l.left&&(s.x=a.x),l.right&&(s.x=a.x+a.width-i),"top"===o&&l.top&&(s.y=e+n),"bottom"===o&&l.bottom&&(s.y=e-r-n)):(l.top&&(s.y=a.y),l.bottom&&(s.y=a.y+a.height-r),"left"===o&&l.left&&(s.x=t+n),"right"===o&&l.right&&(s.x=t-i-n))}return s}(e,n,i,p,d,l,t);Object(a.e)(h,{left:Object(c.l)(g.x+o),top:Object(c.l)(g.y+s)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),e=this.get("parent"),n=this.get("container");n&&n.parentNode===e?e.replaceChild(t,n):e.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,e=this.get("customContent");if(e){var n=e(this.get("title"),this.get("items"));t=Object(s.isElement)(n)?n:Object(a.b)(n)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),e=t.getElementsByClassName(u.TITLE_CLASS)[0],n=t.getElementsByClassName(u.LIST_CLASS)[0];this.set("titleDom",e),this.set("listDom",n)},e.prototype.resetTitle=function(){var t=this.get("title");this.get("showTitle")&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var e=this.get("titleDom");e&&(e.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),e=this.get("crosshairs");if(t&&e){var n=Object(c.k)(t),i=this.get("xCrosshairDom"),r=this.get("yCrosshairDom");"x"===e?(this.resetCrosshair("x",n),r&&(r.remove(),this.set("yCrosshairDom",null))):"y"===e?(this.resetCrosshair("y",n),i&&(i.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",n),this.resetCrosshair("y",n)),this.setCrossHairsVisible(this.get("visible"))}else this.clearCrosshairs()},e.prototype.resetCrosshair=function(t,e){var n=this.checkCrosshair(t),i=this.get(t);"x"===t?Object(a.e)(n,{left:Object(c.l)(i),top:Object(c.l)(e.y),height:Object(c.l)(e.height)}):Object(a.e)(n,{top:Object(c.l)(i),left:Object(c.l)(e.x),width:Object(c.l)(e.width)})},e.prototype.checkCrosshair=function(t){var e=t+"CrosshairDom",n=t+"CrosshairTpl",i="CROSSHAIR_"+t.toUpperCase(),r=u[i],o=this.get(e),s=this.get("parent");return o||(o=Object(a.b)(this.get(n)),this.applyStyle(r,o),s.appendChild(o),this.set(e,o)),o},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),e=this.get("itemTpl"),n=this.get("listDom");n&&(Object(s.each)(t,(function(t){var i=o.default.toCSSGradient(t.color),l=Object(r.__assign)(Object(r.__assign)({},t),{color:i}),c=Object(s.substitute)(e,l),u=Object(a.b)(c);n.appendChild(u)})),this.applyChildrenStyles(n,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&Object(c.a)(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),e=this.get("yCrosshairDom");t&&t.remove(),e&&e.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(l.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(9),o=n(0),a=n(11),s={default:{trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},hover:{thumbColor:"rgba(0,0,0,0.2)"}},l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.clearEvents=o.noop,e.onStartEvent=function(t){return function(n){e.isMobile=t,n.originalEvent.preventDefault();var i=t?Object(o.get)(n.originalEvent,"touches.0.clientX"):n.clientX,r=t?Object(o.get)(n.originalEvent,"touches.0.clientY"):n.clientY;e.startPos=e.cfg.isHorizontal?i:r,e.bindLaterEvent()}},e.bindLaterEvent=function(){var t=e.getContainerDOM(),n=[];n=e.isMobile?[Object(r.a)(t,"touchmove",e.onMouseMove),Object(r.a)(t,"touchend",e.onMouseUp),Object(r.a)(t,"touchcancel",e.onMouseUp)]:[Object(r.a)(t,"mousemove",e.onMouseMove),Object(r.a)(t,"mouseup",e.onMouseUp),Object(r.a)(t,"mouseleave",e.onMouseUp)],e.clearEvents=function(){n.forEach((function(t){t.remove()}))}},e.onMouseMove=function(t){var n=e.cfg,i=n.isHorizontal,r=n.thumbOffset;t.preventDefault();var a=e.isMobile?Object(o.get)(t,"touches.0.clientX"):t.clientX,s=e.isMobile?Object(o.get)(t,"touches.0.clientY"):t.clientY,l=i?a:s,c=l-e.startPos;e.startPos=l,e.updateThumbOffset(r+c)},e.onMouseUp=function(t){t.preventDefault(),e.clearEvents()},e.onTrackClick=function(t){var n=e.cfg,i=n.isHorizontal,r=n.x,o=n.y,a=n.thumbLen,s=e.getContainerDOM().getBoundingClientRect(),l=t.clientX,c=t.clientY,u=i?l-s.left-r-a/2:c-s.top-o-a/2,h=e.validateRange(u);e.updateThumbOffset(h)},e.onThumbMouseOver=function(){var t=e.cfg.theme.hover.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e.onThumbMouseOut=function(){var t=e.cfg.theme.default.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e}return Object(i.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var n=this.getValue(),i=Object(o.clamp)(n,t,e);n===i||this.get("isInit")||this.setValue(i)},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange(),n=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*Object(o.clamp)(t,e.min,e.max)}),this.delegateEmit("valuechange",{originalValue:n,value:this.getValue()})},e.prototype.getValue=function(){return Object(o.clamp)(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return Object(i.__assign)(Object(i.__assign)({},e),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:s})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var e=this.cfg,n=e.trackLen,i=e.theme,r=void 0===i?{default:{}}:i,a=Object(o.deepMix)({},s,r).default,l=a.lineCap,c=a.trackColor,u=a.size,h=Object(o.get)(this.cfg,"size",u),f=this.get("isHorizontal")?{x1:0+h/2,y1:h/2,x2:n-h/2,y2:h/2,lineWidth:h,stroke:c,lineCap:l}:{x1:h/2,y1:0+h/2,x2:h/2,y2:n-h/2,lineWidth:h,stroke:c,lineCap:l};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:f})},e.prototype.renderThumbShape=function(t){var e=this.cfg,n=e.thumbOffset,i=e.thumbLen,r=e.theme,a=Object(o.deepMix)({},s,r).default,l=a.size,c=a.lineCap,u=a.thumbColor,h=Object(o.get)(this.cfg,"size",l),f=this.get("isHorizontal")?{x1:n+h/2,y1:h/2,x2:n+i-h/2,y2:h/2,lineWidth:h,stroke:u,lineCap:c,cursor:"default"}:{x1:h/2,y1:n+h/2,x2:h/2,y2:n+i-h/2,lineWidth:h,stroke:u,lineCap:c,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:f})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp),t.findById(this.getElementId("track")).on("click",this.onTrackClick);var e=t.findById(this.getElementId("thumb"));e.on("mouseover",this.onThumbMouseOver),e.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e.prototype.validateRange=function(t){var e=this.cfg,n=e.thumbLen,i=e.trackLen,r=t;return t+n>i?r=i-n:t+n=0)i=c+this.getIntervalOnlyOffset(n,e);else if(!r.isNil(l)&&r.isNil(s)&&l>=0){i=c+this.getDodgeOnlyOffset(n,e)}else if(!r.isNil(s)&&!r.isNil(l)&&s>=0&&l>=0){i=c+this.getIntervalAndDodgeOffset(n,e)}else{var f=h*o/n,p=a*f;i=(c+u)/2+(.5*(h-n*f-(n-1)*p)+((e+1)*f+e*p)-.5*f-.5*h)}return i},e.prototype.getIntervalOnlyOffset=function(t,e){var n=this,i=n.defaultSize,o=n.intervalPadding,a=n.xDimensionLegenth,s=n.groupNum,l=n.dodgeRatio,c=n.maxColumnWidth,u=n.minColumnWidth,h=n.columnWidthRatio,f=o/a,p=(1-(s-1)*f)/s*l/(t-1),d=((1-f*(s-1))/s-p*(t-1))/t;if(d=r.isNil(h)?d:1/s/t*h,!r.isNil(c)){var g=c/a;d=Math.min(d,g)}if(!r.isNil(u)){var y=u/a;d=Math.max(d,y)}return((.5+e)*(d=i?i/a:d)+e*(p=((1-(s-1)*f)/s-t*d)/(t-1))+.5*f)*s-f/2},e.prototype.getDodgeOnlyOffset=function(t,e){var n=this,i=n.defaultSize,o=n.dodgePadding,a=n.xDimensionLegenth,s=n.groupNum,l=n.marginRatio,c=n.maxColumnWidth,u=n.minColumnWidth,h=n.columnWidthRatio,f=o/a,p=1*l/(s-1),d=((1-p*(s-1))/s-f*(t-1))/t;if(d=h?1/s/t*h:d,!r.isNil(c)){var g=c/a;d=Math.min(d,g)}if(!r.isNil(u)){var y=u/a;d=Math.max(d,y)}return((.5+e)*(d=i?i/a:d)+e*f+.5*(p=(1-(d*t+f*(t-1))*s)/(s-1)))*s-p/2},e.prototype.getIntervalAndDodgeOffset=function(t,e){var n=this.intervalPadding,i=this.dodgePadding,r=this.xDimensionLegenth,o=this.groupNum,a=n/r,s=i/r;return((.5+e)*(((1-a*(o-1))/o-s*(t-1))/t)+e*s+.5*a)*o-a/2},e.prototype.getDistribution=function(t){var e=this.adjustDataArray,n=this.cacheMap,i=n[t];return i||(i={},r.each(e,(function(e,n){var o=r.valuesOfKey(e,t);o.length||o.push(0),r.each(o,(function(t){i[t]||(i[t]=[]),i[t].push(n)}))})),n[t]=i),i},e}(n(24).a);e.a=a},function(t,e,n){"use strict";var i=n(17),r=n(0),o=n(29);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.process=function(t){var e=r.clone(t),n=r.flatten(e);return this.adjustData(e,n),e},e.prototype.adjustDim=function(t,e,n){var i=this,o=this.groupData(n,t);return r.each(o,(function(n,r){return i.adjustGroup(n,t,parseFloat(r),e)}))},e.prototype.getAdjustOffset=function(t){var e,n=t.pre,i=t.next,r=(i-n)*o.c;return(i-r-(e=n+r))*Math.random()+e},e.prototype.adjustGroup=function(t,e,n,i){var o=this,a=this.getAdjustRange(e,n,i);return r.each(t,(function(t){t[e]=o.getAdjustOffset(a)})),t},e}(n(24).a);e.a=a},function(t,e,n){"use strict";var i=n(17),r=n(0),o=n(24),a=r.Cache,s=function(t){function e(e){var n=t.call(this,e)||this,i=e.adjustNames,r=void 0===i?["y"]:i,o=e.height,a=void 0===o?NaN:o,s=e.size,l=void 0===s?10:s,c=e.reverseOrder,u=void 0!==c&&c;return n.adjustNames=r,n.height=a,n.size=l,n.reverseOrder=u,n}return Object(i.b)(e,t),e.prototype.process=function(t){var e=this.yField,n=this.reverseOrder,i=e?this.processStack(t):this.processOneDimStack(t);return n?this.reverse(i):i},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var e=this.xField,n=this.yField,o=this.reverseOrder?this.reverse(t):t,s=new a,l=new a;return o.map((function(t){return t.map((function(t){var o,a=r.get(t,e,0),c=r.get(t,[n]),u=a.toString();if(c=r.isArray(c)?c[1]:c,!r.isNil(c)){var h=c>=0?s:l;h.has(u)||h.set(u,0);var f=h.get(u),p=c+f;return h.set(u,p),Object(i.a)(Object(i.a)({},t),((o={})[n]=[f,p],o))}return t}))}))},e.prototype.processOneDimStack=function(t){var e=this,n=this.xField,r=this.height,o=this.reverseOrder,s=o?this.reverse(t):t,l=new a;return s.map((function(t){return t.map((function(t){var o,a=e.size,s=t[n],c=2*a/r;l.has(s)||l.set(s,c/2);var u=l.get(s);return l.set(s,u+c),Object(i.a)(Object(i.a)({},t),((o={}).y=u,o))}))}))},e}(o.a);e.a=s},function(t,e,n){"use strict";var i=n(17),r=n(0),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.b)(e,t),e.prototype.process=function(t){var e=r.flatten(t),n=this.xField,o=this.yField,a=this.getXValuesMaxMap(e),s=Math.max.apply(Math,Object.keys(a).map((function(t){return a[t]})));return r.map(t,(function(t){return r.map(t,(function(t){var e,l,c=t[o],u=t[n];if(r.isArray(c)){var h=(s-a[u])/2;return Object(i.a)(Object(i.a)({},t),((e={})[o]=r.map(c,(function(t){return h+t})),e))}var f=(s-c)/2;return Object(i.a)(Object(i.a)({},t),((l={})[o]=[f,c+f],l))}))}))},e.prototype.getXValuesMaxMap=function(t){var e=this,n=this.xField,i=this.yField,o=r.groupBy(t,(function(t){return t[n]}));return r.mapValues(o,(function(t){return e.getDimMaxValue(t,i)}))},e.prototype.getDimMaxValue=function(t,e){var n=r.map(t,(function(t){return r.get(t,e,[])})),i=r.flatten(n);return Math.max.apply(Math,i)},e}(n(24).a);e.a=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptors=e.registerLocale=e.G2=e.version=void 0;var i=n(1);e.version="2.4.22";var r=i.__importStar(n(7));e.G2=r;var o=n(47);Object.defineProperty(e,"registerLocale",{enumerable:!0,get:function(){return o.registerLocale}});var a=n(178),s=n(179);o.registerLocale("en-US",a.EN_US_LOCALE),o.registerLocale("zh-CN",s.ZH_CN_LOCALE);var l=n(79);Object.defineProperty(e,"setGlobal",{enumerable:!0,get:function(){return l.setGlobal}});var c=n(6);Object.defineProperty(e,"Plot",{enumerable:!0,get:function(){return c.Plot}}),i.__exportStar(n(82),e);var u=n(83);Object.defineProperty(e,"Line",{enumerable:!0,get:function(){return u.Line}});var h=n(87);Object.defineProperty(e,"Area",{enumerable:!0,get:function(){return h.Area}});var f=n(89);Object.defineProperty(e,"Column",{enumerable:!0,get:function(){return f.Column}});var p=n(93);Object.defineProperty(e,"Bar",{enumerable:!0,get:function(){return p.Bar}});var d=n(95);Object.defineProperty(e,"Pie",{enumerable:!0,get:function(){return d.Pie}});var g=n(223);Object.defineProperty(e,"Rose",{enumerable:!0,get:function(){return g.Rose}});var y=n(227);Object.defineProperty(e,"WordCloud",{enumerable:!0,get:function(){return y.WordCloud}});var v=n(103);Object.defineProperty(e,"Scatter",{enumerable:!0,get:function(){return v.Scatter}});var m=n(237);Object.defineProperty(e,"Radar",{enumerable:!0,get:function(){return m.Radar}});var x=n(242);Object.defineProperty(e,"DualAxes",{enumerable:!0,get:function(){return x.DualAxes}});var b=n(107);Object.defineProperty(e,"TinyLine",{enumerable:!0,get:function(){return b.TinyLine}});var _=n(109);Object.defineProperty(e,"TinyColumn",{enumerable:!0,get:function(){return _.TinyColumn}});var O=n(111);Object.defineProperty(e,"TinyArea",{enumerable:!0,get:function(){return O.TinyArea}});var w=n(112);Object.defineProperty(e,"Histogram",{enumerable:!0,get:function(){return w.Histogram}});var j=n(116);Object.defineProperty(e,"Progress",{enumerable:!0,get:function(){return j.Progress}});var S=n(118);Object.defineProperty(e,"RingProgress",{enumerable:!0,get:function(){return S.RingProgress}});var M=n(256);Object.defineProperty(e,"Heatmap",{enumerable:!0,get:function(){return M.Heatmap}});var A=n(262);Object.defineProperty(e,"Box",{enumerable:!0,get:function(){return A.Box}});var C=n(265);Object.defineProperty(e,"Violin",{enumerable:!0,get:function(){return C.Violin}});var E=n(271);Object.defineProperty(e,"Venn",{enumerable:!0,get:function(){return E.Venn}});var I=n(125);Object.defineProperty(e,"Stock",{enumerable:!0,get:function(){return I.Stock}});var P=n(128);Object.defineProperty(e,"Funnel",{enumerable:!0,get:function(){return P.Funnel}}),Object.defineProperty(e,"FUNNEL_CONVERSATION_FIELD",{enumerable:!0,get:function(){return P.FUNNEL_CONVERSATION_FIELD}});var F=n(289);Object.defineProperty(e,"Liquid",{enumerable:!0,get:function(){return F.Liquid}}),Object.defineProperty(e,"addWaterWave",{enumerable:!0,get:function(){return F.addWaterWave}});var T=n(293);Object.defineProperty(e,"Bullet",{enumerable:!0,get:function(){return T.Bullet}});var L=n(297);Object.defineProperty(e,"Sunburst",{enumerable:!0,get:function(){return L.Sunburst}});var D=n(136);Object.defineProperty(e,"Gauge",{enumerable:!0,get:function(){return D.Gauge}});var k=n(306);Object.defineProperty(e,"Waterfall",{enumerable:!0,get:function(){return k.Waterfall}});var B=n(310);Object.defineProperty(e,"RadialBar",{enumerable:!0,get:function(){return B.RadialBar}});var N=n(315);Object.defineProperty(e,"BidirectionalBar",{enumerable:!0,get:function(){return N.BidirectionalBar}});var R=n(318);Object.defineProperty(e,"Treemap",{enumerable:!0,get:function(){return R.Treemap}});var V=n(323);Object.defineProperty(e,"Sankey",{enumerable:!0,get:function(){return V.Sankey}});var z=n(334);Object.defineProperty(e,"Chord",{enumerable:!0,get:function(){return z.Chord}});var G=n(338);Object.defineProperty(e,"CirclePacking",{enumerable:!0,get:function(){return G.CirclePacking}});var Y=n(344);Object.defineProperty(e,"P",{enumerable:!0,get:function(){return Y.P}});var X=n(84);Object.defineProperty(e,"getCanvasPattern",{enumerable:!0,get:function(){return X.getCanvasPattern}});var W=n(71);Object.defineProperty(e,"MultiView",{enumerable:!0,get:function(){return W.Mix}});var H=n(71);Object.defineProperty(e,"Mix",{enumerable:!0,get:function(){return H.Mix}});var U=n(350);Object.defineProperty(e,"Facet",{enumerable:!0,get:function(){return U.Facet}});var q=n(2);Object.defineProperty(e,"flow",{enumerable:!0,get:function(){return q.flow}}),Object.defineProperty(e,"measureTextWidth",{enumerable:!0,get:function(){return q.measureTextWidth}});var Z=n(15);Object.defineProperty(e,"line",{enumerable:!0,get:function(){return Z.line}}),Object.defineProperty(e,"interval",{enumerable:!0,get:function(){return Z.interval}}),Object.defineProperty(e,"area",{enumerable:!0,get:function(){return Z.area}}),Object.defineProperty(e,"point",{enumerable:!0,get:function(){return Z.point}}),Object.defineProperty(e,"polygon",{enumerable:!0,get:function(){return Z.polygon}}),Object.defineProperty(e,"schema",{enumerable:!0,get:function(){return Z.schema}});var $=n(10);e.adaptors={scale:$.scale,legend:$.legend,tooltip:$.tooltip,annotation:$.annotation,interaction:$.interaction,theme:$.theme,animation:$.animation};var K=n(355);Object.defineProperty(e,"Lab",{enumerable:!0,get:function(){return K.Lab}})},,,,,,,,function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var l,c=[],u=!1,h=-1;function f(){u&&l&&(u=!1,l.length?c=l.concat(c):h=-1,c.length&&p())}function p(){if(!u){var t=s(f);u=!0;for(var e=c.length;e;){for(l=c,c=[];++h1)for(var n=1;n_){var w=O/v.length,j=Math.max(1,Math.ceil(_/w)-1),S=v.slice(0,j)+"...";b.attr("text",S)}}}}(t,e,n)}e.conversionTag=function(t,e,n){return void 0===e&&(e=!0),void 0===n&&(n=!1),function(i){var s=i.options,c=i.chart,h=s.conversionTag,f=s.theme;return h&&!n&&(c.theme(a.deepAssign({},r.isObject(f)?f:o.getTheme(f),{columnWidthRatio:1/3})),c.annotation().shape({render:function(n,i){var o=n.addGroup({id:c.id+"-conversion-tag-group",name:"conversion-tag-group"}),a=r.find(c.geometries,(function(t){return"interval"===t.type})),s={view:i,geometry:a,group:o,field:t,horizontal:e,options:l(h,e)},f=a.elements;r.each(f,(function(t,e){e>0&&u(s,f[e-1],t)}))}})),i}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.connectedArea=void 0;var i=n(7),r={hover:"__interval-connected-area-hover__",click:"__interval-connected-area-click__"},o=function(t,e){return"hover"===t?[{trigger:"interval:mouseenter",action:["element-highlight-by-color:highlight","element-link-by-color:link"],arg:[null,{style:e}]}]:[{trigger:"interval:click",action:["element-highlight-by-color:clear","element-highlight-by-color:highlight","element-link-by-color:clear","element-link-by-color:unlink","element-link-by-color:link"],arg:[null,null,null,null,{style:e}]}]};i.registerInteraction(r.hover,{start:o(r.hover),end:[{trigger:"interval:mouseleave",action:["element-highlight-by-color:reset","element-link-by-color:unlink"]}]}),i.registerInteraction(r.click,{start:o(r.click),end:[{trigger:"document:mousedown",action:["element-highlight-by-color:clear","element-link-by-color:clear"]}]}),e.connectedArea=function(t){return void 0===t&&(t=!1),function(e){var n=e.chart,i=e.options.connectedArea,a=function(){n.removeInteraction(r.hover),n.removeInteraction(r.click)};if(!t&&i){var s=i.trigger||"hover";a(),n.interaction(r[s],{start:o(s,i.style)})}else a();return e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ButtonAction=e.BUTTON_ACTION_CONFIG=void 0;var i=n(1),r=n(7),o=n(0),a=n(2);e.BUTTON_ACTION_CONFIG={padding:[8,10],text:"reset",textStyle:{default:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"}},buttonStyle:{default:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},active:{fill:"#e6e6e6"}}};var s=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.buttonGroup=null,n.buttonCfg=i.__assign({name:"button"},e.BUTTON_ACTION_CONFIG),n}return i.__extends(n,t),n.prototype.getButtonCfg=function(){var t=this.context.view,e=o.get(t,["interactions","filter-action","cfg","buttonConfig"]);return a.deepAssign(this.buttonCfg,e,this.cfg)},n.prototype.drawButton=function(){var t=this.getButtonCfg(),e=this.context.view.foregroundGroup.addGroup({name:t.name}),n=this.drawText(e);this.drawBackground(e,n.getBBox()),this.buttonGroup=e},n.prototype.drawText=function(t){var e,n=this.getButtonCfg();return t.addShape({type:"text",name:"button-text",attrs:i.__assign({text:n.text},null===(e=n.textStyle)||void 0===e?void 0:e.default)})},n.prototype.drawBackground=function(t,e){var n,r=this.getButtonCfg(),o=a.normalPadding(r.padding),s=t.addShape({type:"rect",name:"button-rect",attrs:i.__assign({x:e.x-o[3],y:e.y-o[0],width:e.width+o[1]+o[3],height:e.height+o[0]+o[2]},null===(n=r.buttonStyle)||void 0===n?void 0:n.default)});return s.toBack(),t.on("mouseenter",(function(){var t;s.attr(null===(t=r.buttonStyle)||void 0===t?void 0:t.active)})),t.on("mouseleave",(function(){var t;s.attr(null===(t=r.buttonStyle)||void 0===t?void 0:t.default)})),s},n.prototype.resetPosition=function(){var t=this.context.view.getCoordinate().convert({x:1,y:1}),e=this.buttonGroup,n=e.getBBox(),i=r.Util.transform(null,[["t",t.x-n.width-10,t.y+n.height+5]]);e.setMatrix(i)},n.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},n.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},n.prototype.destroy=function(){var e=this.buttonGroup;e&&e.remove(),t.prototype.destroy.call(this)},n}(r.Action);e.ButtonAction=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(6),r=n(2);e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{columnWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(6),r=n(2);e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{barWidthRatio:.6,marginRatio:1/32,tooltip:{shared:!0,showMarkers:!1,offset:20},legend:{radio:{}},interactions:[{type:"active-region"}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PieLegendAction=void 0;var i=n(1),r=n(7),o=n(0),a=n(100),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.getActiveElements=function(){var t=r.Util.getDelegationObject(this.context);if(t){var e=this.context.view,n=t.component,i=t.item,o=n.get("field");if(o)return e.geometries[0].elements.filter((function(t){return t.getModel().data[o]===i.value}))}return[]},e.prototype.getActiveElementLabels=function(){var t=this.context.view,e=this.getActiveElements();return t.geometries[0].labelsContainer.getChildren().filter((function(t){return e.find((function(e){return o.isEqual(e.getData(),t.get("data"))}))}))},e.prototype.transfrom=function(t){void 0===t&&(t=7.5);var e=this.getActiveElements(),n=this.getActiveElementLabels();e.forEach((function(e,i){var o=n[i],s=e.geometry.coordinate;if(s.isPolar&&s.isTransposed){var l=r.Util.getAngle(e.getModel(),s),c=(l.startAngle+l.endAngle)/2,u=t,h=u*Math.cos(c),f=u*Math.sin(c);e.shape.setMatrix(a.transform([["t",h,f]])),o.setMatrix(a.transform([["t",h,f]]))}}))},e.prototype.active=function(){this.transfrom()},e.prototype.reset=function(){this.transfrom(0)},e}(r.Action);e.PieLegendAction=s},function(t,e,n){"use strict";function i(t){return(i="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.StatisticAction=void 0;var r=n(1),o=n(7),a=n(0),s=n(78),l=n(221),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.getAnnotations=function(t){return(t||this.context.view).getController("annotation").option},e.prototype.getInitialAnnotation=function(){return this.initialAnnotation},e.prototype.init=function(){var t=this,e=this.context.view;e.removeInteraction("tooltip"),e.on("afterchangesize",(function(){var n=t.getAnnotations(e);t.initialAnnotation=n}))},e.prototype.change=function(t){var e=this.context,n=e.view,r=e.event;this.initialAnnotation||(this.initialAnnotation=this.getAnnotations());var c=a.get(r,["data","data"]);if(r.type.match("legend-item")){var u=o.Util.getDelegationObject(this.context),h=n.getGroupedFields()[0];if(u&&h){var f=u.item;c=n.getData().find((function(t){return t[h]===f.value}))}}if(c){var p=a.get(t,"annotations",[]),d=a.get(t,"statistic",{});n.getController("annotation").clear(!0),a.each(p,(function(t){"object"===i(t)&&n.annotation()[t.type](t)})),s.renderStatistic(n,{statistic:d,plotType:"pie"},c),n.render(!0)}var g=l.getCurrentElement(this.context);g&&g.shape.toFront()},e.prototype.reset=function(){var t=this.context.view;t.getController("annotation").clear(!0);var e=this.getInitialAnnotation();a.each(e,(function(e){t.annotation()[e.type](e)})),t.render(!0)},e}(o.Action);e.StatisticAction=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCurrentElement=void 0,e.getCurrentElement=function(t){var e,n=t.event.target;return n&&(e=n.get("element")),e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Rose=void 0;var i=n(1),r=n(6),o=(n(224),n(225)),a=n(226),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rose",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e}(r.Plot);e.Rose=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.legend=void 0;var i=n(1),r=n(0),o=n(2),a=n(10),s=n(15);function l(t){var e=t.chart,n=t.options,i=n.data,r=n.sectorStyle,a=n.color;return e.data(i),o.flow(s.interval)(o.deepAssign({},t,{options:{marginRatio:1,interval:{style:r,color:a}}})),t}function c(t){var e=t.chart,n=t.options,a=n.label,s=n.xField,l=o.findGeometry(e,"interval");if(!1===a)l.label(!1);else if(r.isObject(a)){var c=a.callback,u=a.fields,h=i.__rest(a,["callback","fields"]),f=h.offset,p=h.layout;(void 0===f||f>=0)&&(p=p?r.isArray(p)?p:[p]:[],h.layout=r.filter(p,(function(t){return"limit-in-shape"!==t.type})),h.layout.length||delete h.layout),l.label({fields:u||[s],callback:c,cfg:o.transformLabel(h)})}else o.log(o.LEVEL.WARN,null===a,"the label option must be an Object."),l.label({fields:[s]});return t}function u(t){var e=t.chart,n=t.options,i=n.legend,r=n.seriesField;return!1===i?e.legend(!1):r&&e.legend(r,i),t}function h(t){var e=t.chart,n=t.options,i=n.radius,r=n.innerRadius,o=n.startAngle,a=n.endAngle;return e.coordinate({type:"polar",cfg:{radius:i,innerRadius:r,startAngle:o,endAngle:a}}),t}function f(t){var e,n=t.options,i=n.xAxis,r=n.yAxis,s=n.xField,l=n.yField;return o.flow(a.scale(((e={})[s]=i,e[l]=r,e)))(t)}function p(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField,a=n.yField;return i?e.axis(o,i):e.axis(o,!1),r?e.axis(a,r):e.axis(a,!1),t}e.legend=u,e.adaptor=function(t){o.flow(a.pattern("sectorStyle"),l,f,c,h,p,u,a.tooltip,a.interaction,a.animation,a.theme,a.annotation(),a.state)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(6),r=n(2);e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{xAxis:!1,yAxis:!1,legend:{position:"right",radio:{}},sectorStyle:{stroke:"#fff",lineWidth:1},label:{layout:{type:"limit-in-shape"}},tooltip:{shared:!0,showMarkers:!1},interactions:[{type:"active-region"}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WordCloud=void 0;var i=n(1),r=n(6),o=(n(228),n(229)),a=n(102),s=n(101);n(231);var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="word-cloud",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.updateOption({data:t}),this.options.imageMask?this.render():this.chart.changeData(s.transform({chart:this.chart,options:this.options}))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.render=function(){var e=this;return new Promise((function(n){var r=e.options.imageMask;if(!r)return t.prototype.render.call(e),void n();var o=function(r){e.options=i.__assign(i.__assign({},e.options),{imageMask:r||null}),t.prototype.render.call(e),n()};s.processImageMask(r).then(o).catch(o)}))},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e.prototype.triggerResize=function(){var e=this;this.chart.destroyed||(this.execAdaptor(),window.setTimeout((function(){t.prototype.triggerResize.call(e)})))},e}(r.Plot);e.WordCloud=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.legend=void 0;var i=n(1),r=n(0),o=n(10),a=n(2),s=n(15),l=n(101),c=n(102);function u(t){var e=t.chart,n=t.options,o=n.colorField,u=n.color,h=l.transform(t);e.data(h);var f=a.deepAssign({},t,{options:{xField:"x",yField:"y",seriesField:o&&c.WORD_CLOUD_COLOR_FIELD,rawFields:r.isFunction(u)&&i.__spreadArrays(r.get(n,"rawFields",[]),["datum"]),point:{color:u,shape:"word-cloud"}}});return s.point(f).ext.geometry.label(!1),e.coordinate().reflect("y"),e.axis(!1),t}function h(t){return a.flow(o.scale({x:{nice:!1},y:{nice:!1}}))(t)}function f(t){var e=t.chart,n=t.options,i=n.legend,r=n.colorField;return!1===i?e.legend(!1):r&&e.legend(c.WORD_CLOUD_COLOR_FIELD,i),t}e.legend=f,e.adaptor=function(t){a.flow(u,h,o.tooltip,f,o.interaction,o.animation,o.theme,o.state)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.functor=e.transform=e.wordCloud=void 0;var i=n(0),r={font:function(){return"serif"},padding:1,size:[500,500],spiral:"archimedean",timeInterval:3e3};function o(t,e){var n=function(){var t=[256,256],e=l,n=u,i=c,r=h,o=f,a=y,_=Math.random,O=[],w=1/0,j=s,S=c,M=m,A={};function C(e,n,i){for(var r,o,s,l,c,u=n.x,h=n.y,f=Math.sqrt(t[0]*t[0]+t[1]*t[1]),p=a(t),g=_()<.5?1:-1,y=-g;(r=p(y+=g))&&(o=~~r[0],s=~~r[1],!(Math.min(Math.abs(o),Math.abs(s))>=f));)if(n.x=u+o,n.y=h+s,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1]||i&&d(n,e,t[0])||i&&(c=i,!((l=n).x+l.x1>c[0].x&&l.x+l.x0c[0].y&&l.y+l.y0>5,x=t[0]>>5,b=n.x-(m<<4),O=127&b,w=32-O,j=n.y1-n.y0,S=void 0,M=(n.y+n.y0)*x+(b>>5),A=0;A>>O:0);M+=x}return delete n.sprite,!0}return!1}return A.start=function(){var a=t[0],s=t[1],l=function(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=2048/e;var n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",{context:n,ratio:e}}(M()),c=A.board?A.board:v((t[0]>>5)*t[1]),u=O.length,h=[],f=O.map((function(t,a,s){return t.text=j.call(this,t,a,s),t.font=e.call(this,t,a,s),t.style=S.call(this,t,a,s),t.weight=i.call(this,t,a,s),t.rotate=r.call(this,t,a,s),t.size=~~n.call(this,t,a,s),t.padding=o.call(this,t,a,s),t})).sort((function(t,e){return e.size-t.size})),d=-1,y=A.board?[{x:0,y:0},{x:a,y:s}]:null;return function(){var e=Date.now();for(;Date.now()-e>1,n.y=s*(_()+.5)>>1,p(l,n,f,d),n.hasText&&C(c,n,y)&&(h.push(n),y?A.hasImage||g(y,n):y=[{x:n.x+n.x0,y:n.y+n.y0},{x:n.x+n.x1,y:n.y+n.y1}],n.x-=t[0]>>1,n.y-=t[1]>>1)}A._tags=h,A._bounds=y}(),A},A.createMask=function(e){var n=document.createElement("canvas"),i=t[0],r=t[1];if(i&&r){var o=i>>5,a=v((i>>5)*r);n.width=i,n.height=r;var s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,i,r);for(var l=s.getImageData(0,0,i,r).data,c=0;c>5),f=c*i+u<<2,p=l[f]>=250&&l[f+1]>=250&&l[f+2]>=250?1<<31-u%32:0;a[h]|=p}A.board=a,A.hasImage=!0}},A.timeInterval=function(t){w=null==t?1/0:t},A.words=function(t){O=t},A.size=function(e){t=[+e[0],+e[1]]},A.font=function(t){e=x(t)},A.fontWeight=function(t){i=x(t)},A.rotate=function(t){r=x(t)},A.spiral=function(t){a=b[t]||t},A.fontSize=function(t){n=x(t)},A.padding=function(t){o=x(t)},A.random=function(t){_=x(t)},A}();["font","fontSize","fontWeight","padding","rotate","size","spiral","timeInterval","random"].forEach((function(t){i.isNil(e[t])||n[t](e[t])})),n.words(t),e.imageMask&&n.createMask(e.imageMask);var r=n.start()._tags;r.forEach((function(t){t.x+=e.size[0]/2,t.y+=e.size[1]/2}));var o=e.size,a=o[0],_=o[1];return r.push({text:"",value:0,x:0,y:0,opacity:0}),r.push({text:"",value:0,x:a,y:_,opacity:0}),r}e.wordCloud=function(t,e){return o(t,e=i.assign({},r,e))},e.transform=o;var a=Math.PI/180;function s(t){return t.text}function l(){return"serif"}function c(){return"normal"}function u(t){return t.value}function h(){return 90*~~(2*Math.random())}function f(){return 1}function p(t,e,n,i){if(!e.sprite){var r=t.context,o=t.ratio;r.clearRect(0,0,2048/o,2048/o);var s=0,l=0,c=0,u=n.length;for(--i;++i>5<<5,f=~~Math.max(Math.abs(y+v),Math.abs(y-v))}else h=h+31>>5<<5;if(f>c&&(c=f),s+h>=2048&&(s=0,l+=c,c=0),l+f>=2048)break;r.translate((s+(h>>1))/o,(l+(f>>1))/o),e.rotate&&r.rotate(e.rotate*a),r.fillText(e.text,0,0),e.padding&&(r.lineWidth=2*e.padding,r.strokeText(e.text,0,0)),r.restore(),e.width=h,e.height=f,e.xoff=s,e.yoff=l,e.x1=h>>1,e.y1=f>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,s+=h}for(var x=r.getImageData(0,0,2048/o,2048/o).data,b=[];--i>=0;)if((e=n[i]).hasText){for(var _=(h=e.width)>>5,O=(f=e.y1-e.y0,0);O>5),A=x[2048*(l+S)+(s+O)<<2]?1<<31-O%32:0;b[M]|=A,w|=A}w?j=S:(e.y0++,f--,S--,l++)}e.y1=e.y0+j,e.sprite=b.slice(0,(e.y1-e.y0)*_)}}}function d(t,e,n){n>>=5;for(var i,r=t.sprite,o=t.width>>5,a=t.x-(o<<4),s=127&a,l=32-s,c=t.y1-t.y0,u=(t.y+t.y0)*n+(a>>5),h=0;h>>s:0))&e[u+f])return!0;u+=n}return!1}function g(t,e){var n=t[0],i=t[1];e.x+e.x0i.x&&(i.x=e.x+e.x1),e.y+e.y1>i.y&&(i.y=e.y+e.y1)}function y(t){var e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function v(t){for(var e=[],n=-1;++n0,f=u>0;function p(t,e){var n=o.get(r,[t]);function i(t){return o.get(n,t)}var a={};return"x"===e?(o.isNumber(c)&&(o.isNumber(i("min"))||(a.min=h?0:2*c),o.isNumber(i("max"))||(a.max=h?2*c:0)),a):(o.isNumber(u)&&(o.isNumber(i("min"))||(a.min=f?0:2*u),o.isNumber(i("max"))||(a.max=f?2*u:0)),a)}return i.__assign(i.__assign({},r),((e={})[a]=i.__assign(i.__assign({},r[a]),p(a,"x")),e[s]=i.__assign(i.__assign({},r[s]),p(s,"y")),e))}},function(t,e,n){"use strict";function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(t,e,n,i){t=t.filter((function(t,i){var r=e(t,i),o=n(t,i);return null!=r&&isFinite(r)&&null!=o&&isFinite(o)})),i&&t.sort((function(t,n){return e(t)-e(n)}));for(var r,o,a,s=t.length,l=new Float64Array(s),c=new Float64Array(s),u=0,h=0,f=0;fr&&(t.splice(o+1,0,f),i=!0)}return i}}function c(t,e,n,i){var r=i-t*t,o=Math.abs(r)<1e-24?0:(n-t*e)/r;return[e-o*t,o]}function u(){var t,e=function(t){return t[0]},n=function(t){return t[1]};function r(r){var s=0,u=0,h=0,f=0,p=0,d=0,g=t?+t[0]:1/0,y=t?+t[1]:-1/0;o(r,e,n,(function(e,n){var i=Math.log(n),r=e*n;++s,u+=(n-u)/s,f+=(r-f)/s,d+=(e*r-d)/s,h+=(n*i-h)/s,p+=(r*i-p)/s,t||(ey&&(y=e))}));var v=i(c(f/u,h/u,p/u,d/u),2),m=v[0],x=v[1];m=Math.exp(m);var b=function(t){return m*Math.exp(x*t)},_=l(g,y,b);return _.a=m,_.b=x,_.predict=b,_.rSquared=a(r,e,n,u,b),_}return r.domain=function(e){return arguments.length?(t=e,r):t},r.x=function(t){return arguments.length?(e=t,r):e},r.y=function(t){return arguments.length?(n=t,r):n},r}function h(){var t,e=function(t){return t[0]},n=function(t){return t[1]};function r(r){var s=0,l=0,u=0,h=0,f=0,p=t?+t[0]:1/0,d=t?+t[1]:-1/0;o(r,e,n,(function(e,n){++s,l+=(e-l)/s,u+=(n-u)/s,h+=(e*n-h)/s,f+=(e*e-f)/s,t||(ed&&(d=e))}));var g=i(c(l,u,h,f),2),y=g[0],v=g[1],m=function(t){return v*t+y},x=[[p,m(p)],[d,m(d)]];return x.a=v,x.b=y,x.predict=m,x.rSquared=a(r,e,n,u,m),x}return r.domain=function(e){return arguments.length?(t=e,r):t},r.x=function(t){return arguments.length?(e=t,r):e},r.y=function(t){return arguments.length?(n=t,r):n},r}function f(t){t.sort((function(t,e){return t-e}));var e=t.length/2;return e%1==0?(t[e-1]+t[e])/2:t[Math.floor(e)]}n.r(e),n.d(e,"regressionExp",(function(){return u})),n.d(e,"regressionLinear",(function(){return h})),n.d(e,"regressionLoess",(function(){return p})),n.d(e,"regressionLog",(function(){return y})),n.d(e,"regressionPoly",(function(){return m})),n.d(e,"regressionPow",(function(){return x})),n.d(e,"regressionQuad",(function(){return v}));function p(){var t=function(t){return t[0]},e=function(t){return t[1]},n=.3;function o(o){for(var a=i(r(o,t,e,!0),4),s=a[0],l=a[1],u=a[2],h=a[3],p=s.length,y=Math.max(2,~~(n*p)),v=new Float64Array(p),m=new Float64Array(p),x=new Float64Array(p).fill(1),b=-1;++b<=2;){for(var _=[0,y-1],O=0;Os[S]-w?j:S,A=0,C=0,E=0,I=0,P=0,F=1/Math.abs(s[M]-w||1),T=j;T<=S;++T){var L=s[T],D=l[T],k=d(Math.abs(w-L)*F)*x[T],B=L*k;A+=k,C+=B,E+=D*k,I+=D*B,P+=L*B}var N=i(c(C/A,E/A,I/A,P/A),2),R=N[0],V=N[1];v[O]=R+V*w,m[O]=Math.abs(l[O]-v[O]),g(s,O+1,_)}if(2===b)break;var z=f(m);if(Math.abs(z)<1e-12)break;for(var G,Y,X=0;X=1?1e-12:(Y=1-G*G)*Y}return function(t,e,n,i){for(var r,o=t.length,a=[],s=0,l=0,c=[];s=t.length))for(;e>r&&t[o]-i<=i-t[r];)n[0]=++r,n[1]=o,++o}function y(){var t,e=function(t){return t[0]},n=function(t){return t[1]},r=Math.E;function s(s){var u=0,h=0,f=0,p=0,d=0,g=t?+t[0]:1/0,y=t?+t[1]:-1/0,v=Math.log(r);o(s,e,n,(function(e,n){var i=Math.log(e)/v;++u,h+=(i-h)/u,f+=(n-f)/u,p+=(i*n-p)/u,d+=(i*i-d)/u,t||(ey&&(y=e))}));var m=i(c(h,f,p,d),2),x=m[0],b=m[1],_=function(t){return b*Math.log(t)/v+x},O=l(g,y,_);return O.a=b,O.b=x,O.predict=_,O.rSquared=a(s,e,n,f,_),O}return s.domain=function(e){return arguments.length?(t=e,s):t},s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(n=t,s):n},s.base=function(t){return arguments.length?(r=t,s):r},s}function v(){var t,e=function(t){return t[0]},n=function(t){return t[1]};function s(s){var c,u,h,f,p=i(r(s,e,n),4),d=p[0],g=p[1],y=p[2],v=p[3],m=d.length,x=0,b=0,_=0,O=0,w=0;for(c=0;cA&&(A=e))}));var C=_-x*x,E=x*C-b*b,I=(w*x-O*b)/E,P=(O*C-w*b)/E,F=-I*x,T=function(t){return I*(t-=y)*t+P*t+F+v},L=l(M,A,T);return L.a=I,L.b=P-2*I*y,L.c=F-P*y+I*y*y+v,L.predict=T,L.rSquared=a(s,e,n,j,T),L}return s.domain=function(e){return arguments.length?(t=e,s):t},s.x=function(t){return arguments.length?(e=t,s):e},s.y=function(t){return arguments.length?(n=t,s):n},s}function m(){var t,e=function(t){return t[0]},n=function(t){return t[1]},s=3;function c(c){if(1===s){var u=h().x(e).y(n).domain(t)(c);return u.coefficients=[u.b,u.a],delete u.a,delete u.b,u}if(2===s){var f=v().x(e).y(n).domain(t)(c);return f.coefficients=[f.c,f.b,f.a],delete f.a,delete f.b,delete f.c,f}var p,d,g,y,m,x=i(r(c,e,n),4),b=x[0],_=x[1],O=x[2],w=x[3],j=b.length,S=[],M=[],A=s+1,C=0,E=0,I=t?+t[0]:1/0,P=t?+t[1]:-1/0;for(o(c,e,n,(function(e,n){++E,C+=(n-C)/E,t||(eP&&(P=e))})),p=0;pMath.abs(t[e][r])&&(r=n);for(i=e;i=e;i--)t[i][n]-=t[i][e]*t[e][n]/t[e][e]}for(n=a-1;n>=0;--n){for(o=0,i=n+1;i=0;--r)for(a=e[r],s=1,l[r]+=a,o=1;o<=r;++o)s*=(r+1-o)/o,l[r-o]+=a*Math.pow(n,o)*s;return l[0]+=i,l}(A,F,-O,w),L.predict=T,L.rSquared=a(c,e,n,C,T),L}return c.domain=function(e){return arguments.length?(t=e,c):t},c.x=function(t){return arguments.length?(e=t,c):e},c.y=function(t){return arguments.length?(n=t,c):n},c.order=function(t){return arguments.length?(s=t,c):s},c}function x(){var t,e=function(t){return t[0]},n=function(t){return t[1]};function r(r){var s=0,u=0,h=0,f=0,p=0,d=0,g=t?+t[0]:1/0,y=t?+t[1]:-1/0;o(r,e,n,(function(e,n){var i=Math.log(e),r=Math.log(n);++s,u+=(i-u)/s,h+=(r-h)/s,f+=(i*r-f)/s,p+=(i*i-p)/s,d+=(n-d)/s,t||(ey&&(y=e))}));var v=i(c(u,h,f,p),2),m=v[0],x=v[1];m=Math.exp(m);var b=function(t){return m*Math.pow(t,x)},_=l(g,y,b);return _.a=m,_.b=x,_.predict=b,_.rSquared=a(r,e,n,d,b),_}return r.domain=function(e){return arguments.length?(t=e,r):t},r.x=function(t){return arguments.length?(e=t,r):e},r.y=function(t){return arguments.length?(n=t,r):n},r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(6),r=n(2);e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{size:4,tooltip:{showTitle:!1,showMarkers:!1,showCrosshairs:!0,crosshairs:{type:"xy"}}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(105)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Radar=void 0;var i=n(1),r=n(6),o=n(2),a=(n(238),n(239));n(240);var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="radar",e}return i.__extends(e,t),e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(t)},e.prototype.getDefaultOptions=function(){return o.deepAssign({},t.prototype.getDefaultOptions.call(this),{xAxis:{label:{offset:15},grid:{line:{type:"line"}}},yAxis:{grid:{line:{type:"circle"}}},legend:{position:"top"},tooltip:{shared:!0,showCrosshairs:!0,showMarkers:!0,crosshairs:{type:"xy",line:{style:{stroke:"#565656",lineDash:[4]}},follow:!0}}})},e.prototype.getSchemaAdaptor=function(){return a.adaptor},e}(r.Plot);e.Radar=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=void 0;var i=n(1),r=n(10),o=n(15),a=n(2);function s(t){var e=t.chart,n=t.options,r=n.data,s=n.lineStyle,l=n.color,c=n.point,u=n.area;e.data(r);var h=a.deepAssign({},t,{options:{line:{style:s,color:l},point:c?i.__assign({color:l},c):c,area:u?i.__assign({color:l},u):u,label:void 0}}),f=a.deepAssign({},h,{options:{tooltip:!1}}),p=(null==c?void 0:c.state)||n.state,d=a.deepAssign({},h,{options:{tooltip:!1,state:p}});return o.line(h),o.point(d),o.area(f),t}function l(t){var e,n=t.options,i=n.xAxis,o=n.yAxis,s=n.xField,l=n.yField;return a.flow(r.scale(((e={})[s]=i,e[l]=o,e)))(t)}function c(t){var e=t.chart,n=t.options,i=n.radius,r=n.startAngle,o=n.endAngle;return e.coordinate("polar",{radius:i,startAngle:r,endAngle:o}),t}function u(t){var e=t.chart,n=t.options,i=n.xField,r=n.xAxis,o=n.yField,a=n.yAxis;return e.axis(i,r),e.axis(o,a),t}function h(t){var e=t.chart,n=t.options,r=n.label,o=n.yField,s=a.findGeometry(e,"line");if(r){var l=r.callback,c=i.__rest(r,["callback"]);s.label({fields:[o],callback:l,cfg:a.transformLabel(c)})}else s.label(!1);return t}e.adaptor=function(t){return a.flow(s,l,r.theme,c,u,r.legend,r.tooltip,h,r.interaction,r.animation,r.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),r=n(241);i.registerAction("radar-tooltip",r.RadarTooltipAction),i.registerInteraction("radar-tooltip",{start:[{trigger:"plot:mousemove",action:"radar-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"radar-tooltip:hide"}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RadarTooltipAction=e.RadarTooltipController=void 0;var i=n(1),r=n(7),o=n(0),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"radar-tooltip"},enumerable:!1,configurable:!0}),e.prototype.getTooltipItems=function(e){var n=this.getTooltipCfg(),a=n.shared,s=n.title,l=t.prototype.getTooltipItems.call(this,e);if(l.length>0){var c=this.view.geometries[0],u=c.dataArray,h=l[0].name,f=[];return u.forEach((function(t){t.forEach((function(t){var e=r.Util.getTooltipItems(t,c)[0];if(!a&&e&&e.name===h){var n=o.isNil(s)?h:s;f.push(i.__assign(i.__assign({},e),{name:e.title,title:n}))}else if(a&&e){n=o.isNil(s)?e.name||h:s;f.push(i.__assign(i.__assign({},e),{name:e.title,title:n}))}}))})),f}return[]},e}(r.TooltipController);e.RadarTooltipController=a,r.registerComponentController("radar-tooltip",a);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.init=function(){this.context.view.removeInteraction("tooltip")},e.prototype.show=function(){var t=this.context.event;this.getTooltipController().showTooltip({x:t.x,y:t.y})},e.prototype.hide=function(){this.getTooltipController().hideTooltip()},e.prototype.getTooltipController=function(){return this.context.view.getController("radar-tooltip")},e}(r.Action);e.RadarTooltipAction=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DualAxes=void 0;var i=n(1),r=n(6),o=n(2),a=(n(59),n(243)),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dual-axes",e}return i.__extends(e,t),e.prototype.getDefaultOptions=function(){return o.deepAssign({},t.prototype.getDefaultOptions.call(this),{yAxis:[],syncViewPadding:!0})},e.prototype.getSchemaAdaptor=function(){return a.adaptor},e}(r.Plot);e.DualAxes=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.slider=e.legend=e.limitInPlot=e.animation=e.theme=e.annotation=e.interaction=e.tooltip=e.axis=e.meta=e.color=e.transformOptions=void 0;var i=n(1),r=n(0),o=n(10),a=n(34),s=n(2),l=n(40),c=n(60),u=n(244),h=n(245),f=n(246),p=n(59),d=n(106);function g(t){var e,n=t.options,i=n.geometryOptions,o=void 0===i?[]:i,a=n.xField,l=n.yField,u=r.every(o,(function(t){var e=t.geometry;return e===p.DualAxesGeometry.Line||void 0===e}));return s.deepAssign({},{options:{geometryOptions:[],meta:(e={},e[a]={type:"cat",sync:!0,range:u?[0,1]:void 0},e),tooltip:{showMarkers:u,showCrosshairs:u,shared:!0,crosshairs:{type:"x"}},interactions:u?[{type:"legend-visible-filter"}]:[{type:"legend-visible-filter"},{type:"active-region"}],legend:{position:"top-left"}}},t,{options:{yAxis:c.transformObjectToArray(l,n.yAxis),geometryOptions:[c.getGeometryOption(a,l[0],o[0]),c.getGeometryOption(a,l[1],o[1])],annotations:c.transformObjectToArray(l,n.annotations)}})}function y(t){var e,n,i=t.chart,r=t.options.geometryOptions,o={line:0,column:1};return[{type:null===(e=r[0])||void 0===e?void 0:e.geometry,id:d.LEFT_AXES_VIEW},{type:null===(n=r[1])||void 0===n?void 0:n.geometry,id:d.RIGHT_AXES_VIEW}].sort((function(t,e){return-o[t.type]+o[e.type]})).forEach((function(t){return i.createView({id:t.id})})),t}function v(t){var e=t.chart,n=t.options,r=n.xField,o=n.yField,s=n.geometryOptions,u=n.data,f=n.tooltip;return[i.__assign(i.__assign({},s[0]),{id:d.LEFT_AXES_VIEW,data:u[0],yField:o[0]}),i.__assign(i.__assign({},s[1]),{id:d.RIGHT_AXES_VIEW,data:u[1],yField:o[1]})].forEach((function(t){var n=t.id,o=t.data,s=t.yField,u=c.isColumn(t)&&t.isPercent,p=u?a.percent(o,s,r,s):o,d=l.findViewById(e,n).data(p),g=u?i.__assign({formatter:function(e){return{name:e[t.seriesField]||s,value:(100*Number(e[s])).toFixed(2)+"%"}}},f):f;h.drawSingleGeometry({chart:d,options:{xField:r,yField:s,tooltip:g,geometryOption:t}})})),t}function m(t){var e,n=t.chart,i=t.options.geometryOptions,o=(null===(e=n.getTheme())||void 0===e?void 0:e.colors10)||[],a=0;return n.once("beforepaint",(function(){r.each(i,(function(t,e){var i=l.findViewById(n,0===e?d.LEFT_AXES_VIEW:d.RIGHT_AXES_VIEW);if(!t.color){var s=i.getGroupScales(),c=r.get(s,[0,"values","length"],1),u=o.slice(a,a+c).concat(0===e?[]:o);i.geometries.forEach((function(e){t.seriesField?e.color(t.seriesField,u):e.color(u[0])})),a+=c}})),n.render(!0)})),t}function x(t){var e,n,i=t.chart,r=t.options,a=r.xAxis,c=r.yAxis,u=r.xField,h=r.yField;return o.scale(((e={})[u]=a,e[h[0]]=c[0],e))(s.deepAssign({},t,{chart:l.findViewById(i,d.LEFT_AXES_VIEW)})),o.scale(((n={})[u]=a,n[h[1]]=c[1],n))(s.deepAssign({},t,{chart:l.findViewById(i,d.RIGHT_AXES_VIEW)})),t}function b(t){var e=t.chart,n=t.options,i=l.findViewById(e,d.LEFT_AXES_VIEW),r=l.findViewById(e,d.RIGHT_AXES_VIEW),o=n.xField,a=n.yField,s=n.xAxis,u=n.yAxis;return e.axis(o,!1),e.axis(a[0],!1),e.axis(a[1],!1),i.axis(o,s),i.axis(a[0],c.getYAxisWithDefault(u[0],p.AxisType.Left)),r.axis(o,!1),r.axis(a[1],c.getYAxisWithDefault(u[1],p.AxisType.Right)),t}function _(t){var e=t.chart,n=t.options.tooltip,i=l.findViewById(e,d.LEFT_AXES_VIEW),r=l.findViewById(e,d.RIGHT_AXES_VIEW);return e.tooltip(n),i.tooltip({shared:!0}),r.tooltip({shared:!0}),t}function O(t){var e=t.chart;return o.interaction(s.deepAssign({},t,{chart:l.findViewById(e,d.LEFT_AXES_VIEW)})),o.interaction(s.deepAssign({},t,{chart:l.findViewById(e,d.RIGHT_AXES_VIEW)})),t}function w(t){var e=t.chart,n=t.options.annotations,i=r.get(n,[0]),a=r.get(n,[1]);return o.annotation(i)(s.deepAssign({},t,{chart:l.findViewById(e,d.LEFT_AXES_VIEW),options:{annotations:i}})),o.annotation(a)(s.deepAssign({},t,{chart:l.findViewById(e,d.RIGHT_AXES_VIEW),options:{annotations:a}})),t}function j(t){var e=t.chart;return o.theme(s.deepAssign({},t,{chart:l.findViewById(e,d.LEFT_AXES_VIEW)})),o.theme(s.deepAssign({},t,{chart:l.findViewById(e,d.RIGHT_AXES_VIEW)})),o.theme(t),t}function S(t){var e=t.chart;return o.animation(s.deepAssign({},t,{chart:l.findViewById(e,d.LEFT_AXES_VIEW)})),o.animation(s.deepAssign({},t,{chart:l.findViewById(e,d.RIGHT_AXES_VIEW)})),t}function M(t){var e=t.chart,n=t.options.yAxis;return o.limitInPlot(s.deepAssign({},t,{chart:l.findViewById(e,d.LEFT_AXES_VIEW),options:{yAxis:n[0]}})),o.limitInPlot(s.deepAssign({},t,{chart:l.findViewById(e,d.RIGHT_AXES_VIEW),options:{yAxis:n[1]}})),t}function A(t){var e=t.chart,n=t.options,i=n.legend,o=n.geometryOptions,a=n.yField,c=n.data,h=l.findViewById(e,d.LEFT_AXES_VIEW),f=l.findViewById(e,d.RIGHT_AXES_VIEW);if(!1===i)e.legend(!1);else if(r.isObject(i)&&!0===i.custom)e.legend(i);else{var p=r.get(o,[0,"legend"],i),g=r.get(o,[1,"legend"],i);e.once("beforepaint",(function(){var t=c[0].length?u.getViewLegendItems({view:h,geometryOption:o[0],yField:a[0],legend:p}):[],n=c[1].length?u.getViewLegendItems({view:f,geometryOption:o[1],yField:a[1],legend:g}):[];e.legend(s.deepAssign({},i,{custom:!0,items:t.concat(n)}))})),o[0].seriesField&&h.legend(o[0].seriesField,p),o[1].seriesField&&f.legend(o[1].seriesField,g),e.on("legend-item:click",(function(t){var n=r.get(t,"gEvent.delegateObject",{});if(n&&n.item){var i=n.item,o=i.value,s=i.isGeometry,c=i.viewId;if(s){if(r.findIndex(a,(function(t){return t===o}))>-1){var u=r.get(l.findViewById(e,c),"geometries");r.each(u,(function(t){t.changeVisible(!n.item.unchecked)}))}}else{var h=r.get(e.getController("legend"),"option.items",[]);r.each(e.views,(function(t){var n=t.getGroupScales();r.each(n,(function(e){e.values&&e.values.indexOf(o)>-1&&t.filter(e.field,(function(t){return!r.find(h,(function(e){return e.value===t})).unchecked}))})),e.render(!0)}))}}}))}return t}function C(t){var e=t.chart,n=t.options.slider,i=l.findViewById(e,d.LEFT_AXES_VIEW),o=l.findViewById(e,d.RIGHT_AXES_VIEW);return n&&(i.option("slider",n),i.on("slider:valuechanged",(function(t){var e=t.event,n=e.value,i=e.originValue;r.isEqual(n,i)||f.doSliderFilter(o,n)})),e.once("afterpaint",(function(){if(!r.isBoolean(n)){var t=n.start,e=n.end;(t||e)&&f.doSliderFilter(o,[t,e])}}))),t}e.transformOptions=g,e.color=m,e.meta=x,e.axis=b,e.tooltip=_,e.interaction=O,e.annotation=w,e.theme=j,e.animation=S,e.limitInPlot=M,e.legend=A,e.slider=C,e.adaptor=function(t){return s.flow(g,y,j,v,x,b,M,_,O,w,S,m,A,C)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getViewLegendItems=void 0;var i=n(0),r=n(7),o=n(2),a=n(60);e.getViewLegendItems=function(t){var e=t.view,n=t.geometryOption,s=t.yField,l=t.legend,c=i.get(l,"marker"),u=o.findGeometry(e,a.isLine(n)?"line":"interval");if(!n.seriesField){var h=i.get(e,"options.scales."+s+".alias")||s,f=u.getAttribute("color"),p=e.getTheme().defaultColor;return f&&(p=r.Util.getMappingValue(f,h,i.get(f,["values",0],p))),[{value:s,name:h,marker:(i.isFunction(c)?c:!i.isEmpty(c)&&o.deepAssign({},{style:{stroke:p,fill:p}},c))||(a.isLine(n)?{symbol:function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},style:{lineWidth:2,r:6,stroke:p}}:{symbol:"square",style:{fill:p}}),isGeometry:!0,viewId:e.id}]}var d=u.getGroupAttributes();return i.reduce(d,(function(t,n){var i=r.Util.getLegendItems(e,u,n,e.getTheme(),c);return t.concat(i)}),[])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.drawSingleGeometry=void 0;var i=n(1),r=n(0),o=n(15),a=n(2),s=n(41),l=n(60);e.drawSingleGeometry=function(t){var e=t.options,n=t.chart,c=e.geometryOption,u=c.isStack,h=c.color,f=c.seriesField,p=c.groupField,d=c.isGroup,g=["xField","yField"];if(l.isLine(c)){o.line(a.deepAssign({},t,{options:i.__assign(i.__assign(i.__assign({},a.pick(e,g)),c),{line:{color:c.color,style:c.lineStyle}})})),o.point(a.deepAssign({},t,{options:i.__assign(i.__assign(i.__assign({},a.pick(e,g)),c),{point:c.point&&i.__assign({color:h,shape:"circle"},c.point)})}));var y=[];d&&y.push({type:"dodge",dodgeBy:p||f,customOffset:0}),u&&y.push({type:"stack"}),y.length&&r.each(n.geometries,(function(t){t.adjust(y)}))}return l.isColumn(c)&&s.adaptor(a.deepAssign({},t,{options:i.__assign(i.__assign(i.__assign({},a.pick(e,g)),c),{widthRatio:c.columnWidthRatio,interval:i.__assign(i.__assign({},a.pick(c,["color"])),{style:c.columnStyle})})})),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.doSliderFilter=void 0;var i=n(0),r=n(2);e.doSliderFilter=function(t,e){var n=e[0],o=e[1],a=t.getOptions().data,s=t.getXScale(),l=i.size(a);if(s&&l){var c=i.valuesOfKey(a,s.field),u=c,h=i.size(u),f=Math.floor(n*(h-1)),p=Math.floor(o*(h-1));t.filter(s.field,(function(t){var e=u.indexOf(t);return!(e>-1)||r.isBetween(e,f,p)})),t.getRootView().render(!0)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=e.DEFAULT_TOOLTIP_OPTIONS=void 0;var i=n(1),r=n(0);e.DEFAULT_TOOLTIP_OPTIONS={showTitle:!1,shared:!0,showMarkers:!1,customContent:function(t,e){return""+r.get(e,[0,"data","y"],0)},containerTpl:'
    ',itemTpl:"{value}",domStyles:{"g2-tooltip":{padding:"2px 4px",fontSize:"10px"}}},e.DEFAULT_OPTIONS={appendPadding:2,tooltip:i.__assign({},e.DEFAULT_TOOLTIP_OPTIONS),animation:{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(1),r=n(42);e.DEFAULT_OPTIONS={appendPadding:2,tooltip:i.__assign({},r.DEFAULT_TOOLTIP_OPTIONS),color:"l(90) 0:#E5EDFE 1:#ffffff",areaStyle:{fillOpacity:.6},line:{size:1,color:"#5B8FF9"},animation:{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0,e.DEFAULT_OPTIONS={percent:.2,innerRadius:.8,radius:.98,color:["#FAAD14","#E8EDF3"],statistic:{title:!1,content:{style:{fontSize:"14px",fontWeight:300,fill:"#4D4D4D",textAlign:"center",textBaseline:"middle"}}},animation:{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Heatmap=void 0;var i=n(1),r=n(6),o=(n(257),n(258)),a=n(259);n(260),n(261);var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="heatmap",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.DEFAULT_OPTIONS},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(r.Plot);e.Heatmap=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=void 0;var i=n(1),r=n(0),o=n(2),a=n(2),s=n(10),l=n(20),c=n(23);function u(t){var e=t.chart,n=t.options,i=n.data,a=n.type,s=n.xField,u=n.yField,h=n.colorField,f=n.sizeField,p=n.sizeRatio,d=n.shape,g=n.color,y=n.tooltip,v=n.heatmapStyle,m=n.meta;e.data(i);var x="polygon";"density"===a&&(x="heatmap");var b=c.getTooltipMapping(y,[s,u,h]),_=b.fields,O=b.formatter,w=1;return(p||0===p)&&(d||f?p<0||p>1?console.warn("sizeRatio is not in effect: It must be a number in [0,1]"):w=p:console.warn("sizeRatio is not in effect: Must define shape or sizeField first")),l.geometry(o.deepAssign({},t,{options:{type:x,colorField:h,tooltipFields:_,shapeField:f||"",label:void 0,mapping:{tooltip:O,shape:d&&(f?function(t){var e=i.map((function(t){return t[f]})),n=(null==m?void 0:m[f])||{},o=n.min,a=n.max;return o=r.isNumber(o)?o:Math.min.apply(Math,e),a=r.isNumber(a)?a:Math.max.apply(Math,e),[d,(r.get(t,f)-o)/(a-o),w]}:function(){return[d,1,w]}),color:g||h&&e.getTheme().sequenceColors.join("-"),style:v}}})),t}function h(t){var e,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField,l=n.yField;return a.flow(s.scale(((e={})[o]=i,e[l]=r,e)))(t)}function f(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField,a=n.yField;return!1===i?e.axis(o,!1):e.axis(o,i),!1===r?e.axis(a,!1):e.axis(a,r),t}function p(t){var e=t.chart,n=t.options,i=n.legend,r=n.colorField,o=n.sizeField,a=n.sizeLegend,s=!1!==i;return r&&e.legend(r,!!s&&i),o&&e.legend(o,void 0===a?i:a),s||a||e.legend(!1),t}function d(t){var e=t.chart,n=t.options,r=n.label,s=n.colorField,l=n.type,c=o.findGeometry(e,"density"===l?"heatmap":"polygon");if(r){if(s){var u=r.callback,h=i.__rest(r,["callback"]);c.label({fields:[s],callback:u,cfg:a.transformLabel(h)})}}else c.label(!1);return t}function g(t){var e,n,i=t.chart,r=t.options,a=r.coordinate,s=r.reflect,l=o.deepAssign({actions:[]},null!=a?a:{type:"rect"});return s&&(null===(n=null===(e=l.actions)||void 0===e?void 0:e.push)||void 0===n||n.call(e,["reflect",s])),i.coordinate(l),t}e.adaptor=function(t){return a.flow(s.theme,s.pattern("heatmapStyle"),h,g,u,f,p,s.tooltip,d,s.annotation(),s.interaction,s.animation,s.state)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(6),r=n(2);e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{type:"polygon",legend:!1,coordinate:{type:"rect"},xAxis:{tickLine:null,line:null,grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}},yAxis:{grid:{alignTick:!1,line:{style:{lineWidth:1,lineDash:null,stroke:"#f0f0f0"}}}}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1);n(7).registerShape("polygon","circle",{draw:function(t,e){var n,r,o=t.x,a=t.y,s=this.parsePoints(t.points),l=Math.abs(s[2].x-s[1].x),c=Math.abs(s[1].y-s[0].y),u=Math.min(l,c)/2,h=Number(t.shape[1]),f=Number(t.shape[2]),p=u*Math.sqrt(f)*Math.sqrt(h),d=(null===(n=t.style)||void 0===n?void 0:n.fill)||t.color||(null===(r=t.defaultStyle)||void 0===r?void 0:r.fill);return e.addShape("circle",{attrs:i.__assign(i.__assign(i.__assign({x:o,y:a,r:p},t.defaultStyle),t.style),{fill:d})})}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1);n(7).registerShape("polygon","square",{draw:function(t,e){var n,r,o=t.x,a=t.y,s=this.parsePoints(t.points),l=Math.abs(s[2].x-s[1].x),c=Math.abs(s[1].y-s[0].y),u=Math.min(l,c),h=Number(t.shape[1]),f=Number(t.shape[2]),p=u*Math.sqrt(f)*Math.sqrt(h),d=(null===(n=t.style)||void 0===n?void 0:n.fill)||t.color||(null===(r=t.defaultStyle)||void 0===r?void 0:r.fill);return e.addShape("rect",{attrs:i.__assign(i.__assign(i.__assign({x:o-p/2,y:a-p/2,width:p,height:p},t.defaultStyle),t.style),{fill:d})})}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Box=void 0;var i=n(1),r=n(6),o=(n(263),n(264)),a=n(120),s=n(63),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="box",e}return i.__extends(e,t),e.getDefaultOptions=function(){return s.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.updateOption({data:t});var e=this.options.yField,n=this.chart.views.find((function(t){return t.id===s.OUTLIERS_VIEW_ID}));n&&n.data(t),this.chart.changeData(a.transformData(t,e))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e}(r.Plot);e.Box=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.legend=void 0;var i=n(1),r=n(0),o=n(10),a=n(15),s=n(2),l=n(27),c=n(63),u=n(120);function h(t){var e=t.chart,n=t.options,i=n.xField,o=n.yField,l=n.groupField,h=n.color,f=n.tooltip,p=n.boxStyle;e.data(u.transformData(n.data,o));var d=r.isArray(o)?c.BOX_RANGE:o,g=o?r.isArray(o)?o:[o]:[],y=f;!1!==y&&(y=s.deepAssign({},{fields:r.isArray(o)?o:[]},y));var v=a.schema(s.deepAssign({},t,{options:{xField:i,yField:d,seriesField:l,tooltip:y,rawFields:g,label:!1,schema:{shape:"box",color:h,style:p}}})).ext;return l&&v.geometry.adjust("dodge"),t}function f(t){var e=t.chart,n=t.options,r=n.xField,o=n.data,s=n.outliersField,l=n.outliersStyle,u=n.padding,h=n.label;if(!s)return t;var f=e.createView({padding:u,id:c.OUTLIERS_VIEW_ID}),p=o.reduce((function(t,e){return e[s].forEach((function(n){var r;return t.push(i.__assign(i.__assign({},e),((r={})[s]=n,r)))})),t}),[]);return f.data(p),a.point({chart:f,options:{xField:r,yField:s,point:{shape:"circle",style:l},label:h}}),f.axis(!1),t}function p(t){var e,n,i=t.chart,r=t.options,o=r.meta,a=r.xAxis,u=r.yAxis,h=r.xField,f=r.yField,p=r.outliersField,d=Array.isArray(f)?c.BOX_RANGE:f,g={};if(p){var y=c.BOX_SYNC_NAME;(e={})[p]={sync:y,nice:!0},e[d]={sync:y,nice:!0},g=e}var v=s.deepAssign(g,o,((n={})[h]=s.pick(a,l.AXIS_META_CONFIG_KEYS),n[d]=s.pick(u,l.AXIS_META_CONFIG_KEYS),n));return i.scale(v),t}function d(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField,a=n.yField,s=Array.isArray(a)?c.BOX_RANGE:a;return!1===i?e.axis(o,!1):e.axis(o,i),!1===r?e.axis(c.BOX_RANGE,!1):e.axis(s,r),t}function g(t){var e=t.chart,n=t.options,i=n.legend,r=n.groupField;return r?i?e.legend(r,i):e.legend(r,{position:"bottom"}):e.legend(!1),t}e.legend=g,e.adaptor=function(t){return s.flow(h,f,p,d,g,o.tooltip,o.annotation(),o.interaction,o.animation,o.theme)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Violin=void 0;var i=n(1),r=n(6),o=(n(266),n(267)),a=n(122),s=n(121),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="violin",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.updateOption({data:t}),this.chart.changeData(s.transformViolinData(this.options))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e}(r.Plot);e.Violin=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";function i(t){return(i="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.animation=void 0;var r=n(1),o=n(0),a=n(10),s=n(15),l=n(2),c=n(40),u=n(27),h=n(121),f=n(122),p=["low","high","q1","q3","median"],d=[{type:"dodge",marginRatio:1/32}];function g(t){var e=t.chart,n=t.options;return e.data(h.transformViolinData(n)),t}function y(t){var e=t.chart,n=t.options,i=n.seriesField,o=n.color,a=n.shape,l=void 0===a?"violin":a,c=n.violinStyle,u=n.tooltip,h=n.state,g=e.createView({id:f.VIOLIN_VIEW_ID});return s.violin({chart:g,options:{xField:f.X_FIELD,yField:f.VIOLIN_Y_FIELD,seriesField:i||f.X_FIELD,sizeField:f.VIOLIN_SIZE_FIELD,tooltip:r.__assign({fields:p},u),violin:{style:c,color:o,shape:l},state:h}}),g.geometries[0].adjust(d),t}function v(t){var e=t.chart,n=t.options,o=n.seriesField,a=n.color,l=n.tooltip,c=n.box;if(!1===c)return t;var u=e.createView({id:f.MIN_MAX_VIEW_ID});s.interval({chart:u,options:{xField:f.X_FIELD,yField:f.MIN_MAX_FIELD,seriesField:o||f.X_FIELD,tooltip:r.__assign({fields:p},l),state:"object"===i(c)?c.state:{},interval:{color:a,size:1,style:{lineWidth:0}}}}),u.geometries[0].adjust(d);var h=e.createView({id:f.QUANTILE_VIEW_ID});s.interval({chart:h,options:{xField:f.X_FIELD,yField:f.QUANTILE_FIELD,seriesField:o||f.X_FIELD,tooltip:r.__assign({fields:p},l),state:"object"===i(c)?c.state:{},interval:{color:a,size:8,style:{fillOpacity:1}}}}),h.geometries[0].adjust(d);var g=e.createView({id:f.MEDIAN_VIEW_ID});return s.point({chart:g,options:{xField:f.X_FIELD,yField:f.MEDIAN_FIELD,seriesField:o||f.X_FIELD,tooltip:r.__assign({fields:p},l),state:"object"===i(c)?c.state:{},point:{color:a,size:1,style:{fill:"white",lineWidth:0}}}}),g.geometries[0].adjust(d),h.axis(!1),u.axis(!1),g.axis(!1),g.legend(!1),u.legend(!1),h.legend(!1),t}function m(t){var e,n=t.chart,i=t.options,o=i.meta,a=i.xAxis,s=i.yAxis,c=l.deepAssign({},o,((e={})[f.X_FIELD]=r.__assign(r.__assign({sync:!0},l.pick(a,u.AXIS_META_CONFIG_KEYS)),{type:"cat"}),e[f.VIOLIN_Y_FIELD]=r.__assign({sync:!0},l.pick(s,u.AXIS_META_CONFIG_KEYS)),e[f.MIN_MAX_FIELD]=r.__assign({sync:f.VIOLIN_Y_FIELD},l.pick(s,u.AXIS_META_CONFIG_KEYS)),e[f.QUANTILE_FIELD]=r.__assign({sync:f.VIOLIN_Y_FIELD},l.pick(s,u.AXIS_META_CONFIG_KEYS)),e[f.MEDIAN_FIELD]=r.__assign({sync:f.VIOLIN_Y_FIELD},l.pick(s,u.AXIS_META_CONFIG_KEYS)),e));return n.scale(c),t}function x(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=l.findViewById(e,f.VIOLIN_VIEW_ID);return!1===i?o.axis(f.X_FIELD,!1):o.axis(f.X_FIELD,i),!1===r?o.axis(f.VIOLIN_Y_FIELD,!1):o.axis(f.VIOLIN_Y_FIELD,r),e.axis(!1),t}function b(t){var e=t.chart,n=t.options,i=n.legend,r=n.seriesField,a=n.shape;if(!1===i)e.legend(!1);else{var s=r||f.X_FIELD,l=o.omit(i,["selected"]);a&&a.startsWith("hollow")||o.get(l,["marker","style","lineWidth"])||o.set(l,["marker","style","lineWidth"],0),e.legend(s,l),o.get(i,"selected")&&o.each(e.views,(function(t){return t.legend(s,i)}))}return t}function _(t){var e=t.chart,n=l.findViewById(e,f.VIOLIN_VIEW_ID);return a.annotation()(r.__assign(r.__assign({},t),{chart:n})),t}function O(t){var e=t.chart,n=t.options.animation;return o.each(e.views,(function(t){c.addViewAnimation(t,n)})),t}e.animation=O,e.adaptor=function(t){return l.flow(a.theme,g,y,v,m,a.tooltip,x,b,a.interaction,_,O)(t)}},function(t,e,n){"use strict";var i=Math.log(2),r=t.exports,o=n(269);function a(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return r.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,r=o.isNumber(e.width)?e.width:2,a=o.isNumber(e.size)?e.size:50,s=o.isNumber(e.min)?e.min:(n=!0,o.findMinMulti(t)),l=o.isNumber(e.max)?e.max:(i=!0,o.findMaxMulti(t)),c=(l-s)/(a-1);return n&&(s-=2*r*c),i&&(l+=2*r*c),{min:s,max:l}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var n=o.isNumber(e.size)?e.size:50,i=o.isNumber(e.width)?e.width:2,s=r.getUnifiedMinMax(t,{size:n,width:i,min:e.min,max:e.max}),l=s.min,c=s.max-l,u=c/(n-1);if(0===c)return[{x:l,y:1}];for(var h=[],f=0;f=h.length)){var n=Math.max(e-i,0),r=e,a=Math.min(e+i,h.length-1),s=n-(e-i),c=e+i-a,f=p[-i-1+s]||0,v=p[-i-1+c]||0,m=d/(d-f-v);s>0&&(y+=m*(s-1)*g);var x=Math.max(0,e-i+1);o.inside(0,h.length-1,x)&&(h[x].y+=1*m*g),o.inside(0,h.length-1,r+1)&&(h[r+1].y-=2*m*g),o.inside(0,h.length-1,a+1)&&(h[a+1].y+=1*m*g)}}));var v=y,m=0,x=0;return h.forEach((function(t){m+=t.y,v+=m,t.y=v,x+=v})),x>0&&h.forEach((function(t){t.y/=x})),h},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,i=0,r=0;r=e));r++);return t[i].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){var n=Math.log(t.y);isFinite(n)&&(e+=t.y*n)})),e=-e/i,Math.pow(2,e)}}},function(t,e,n){"use strict";var i=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n1)throw new Error("quantiles must be between 0 and 1");return 1===e?t[t.length-1]:0===e?t[0]:n%1!=0?t[Math.ceil(n)-1]:t.length%2==0?(t[n-1]+t[n])/2:t[n]}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function o(t,e,n,i){for(n=n||0,i=i||t.length-1;i>n;){if(i-n>600){var a=i-n+1,s=e-n+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a);s-a/2<0&&(u*=-1),o(t,e,Math.max(n,Math.floor(e-s*c/a+u)),Math.min(i,Math.floor(e+(a-s)*c/a+u)))}var h=t[e],f=n,p=i;for(r(t,n,e),t[i]>h&&r(t,n,i);fh;)p--}t[n]===h?r(t,n,p):r(t,++p,i),p<=e&&(n=p+1),e<=p&&(i=p-1)}}function a(t,e,n,i){e%1==0?o(t,e,n,i):(o(t,e=Math.floor(e),n,i),o(t,e+1,e+1,i))}function s(t,e){return t-e}function l(t,e){var n=t*e;return 1===e?t-1:0===e?0:n%1!=0?Math.ceil(n)-1:t%2==0?n-.5:n}Object.defineProperty(e,"__esModule",{value:!0}),e.quantile=e.quickselect=e.swap=e.quantileSorted=void 0,e.quantileSorted=i,e.swap=r,e.quickselect=o,e.quantile=function(t,e){var n=t.slice();if(Array.isArray(e)){!function(t,e){for(var n=[0],i=0;ie?e:t},lighten:function(t,e){return t>e?t:e},dodge:function(t,e){return 255===t||(t=e/255*255/(1-t/255))>255?255:t},burn:function(t,e){return 255===e?255:0===t?0:255*(1-Math.min(1,(1-e/255)/(t/255)))}};function o(t){var e,n=t.replace("/s+/g","");return"string"!=typeof n||n.startsWith("rgba")||n.startsWith("#")?(n.startsWith("rgba")&&(e=n.replace("rgba(","").replace(")","").split(",")),n.startsWith("#")&&(e=i.default.rgb2arr(n).concat([1])),e.map((function(t,e){return 3===e?Number(t):0|t}))):i.default.rgb2arr(i.default.toRGB(n)).concat([1])}e.innerBlend=function(t){if(!r[t])throw new Error("unknown blend mode "+t);return r[t]},e.blend=function(t,n,i){void 0===i&&(i="normal");var r,a=(r=e.innerBlend(i),function(t,e){var n=[];return n[0]=r(t[0],e[0]),n[1]=r(t[1],e[1]),n[2]=r(t[2],e[2]),n})(o(t),o(n)),s=o(t),l=s[0],c=s[1],u=s[2],h=s[3],f=o(n),p=f[0],d=f[1],g=f[2],y=f[3],v=Number((h+y*(1-h)).toFixed(2));return"rgba("+Math.round((h*(1-y)*(l/255)+h*y*(a[0]/255)+(1-h)*y*(p/255))/v*255)+", "+Math.round((h*(1-y)*(c/255)+h*y*(a[1]/255)+(1-h)*y*(d/255))/v*255)+", "+Math.round((h*(1-y)*(u/255)+h*y*(a[2]/255)+(1-h)*y*(g/255))/v*255)+", "+v+")"},e.colorToArr=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.scaleSolution=e.normalizeSolution=e.disjointCluster=e.lossFunction=e.greedyLayout=e.constrainedMDSLayout=e.bestInitialLayout=e.getDistanceMatrices=e.distanceFromIntersectArea=e.venn=void 0;var i=n(123),r=n(124);e.venn=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;var n,r=e.initialLayout||s,o=e.lossFunction||u,a=r(t=function(t){t=t.slice();var e,n,i,r,o=[],a={};for(e=0;ee?1:-1})),e=0;e=Math.min(e[i].size,e[s].size)?c=1:t.size<=1e-10&&(c=-1),a[i][s]=a[s][i]=c})),{distances:r,constraints:a}}function s(t,e){var n=c(t,e),i=e.lossFunction||u;if(t.length>=8){var r=l(t,e);i(r,t)+1e-80&&d<=h||f<0&&d>=h||(o+=2*g*g,e[2*r]+=4*g*(a-c),e[2*r+1]+=4*g*(s-u),e[2*l]+=4*g*(c-a),e[2*l+1]+=4*g*(u-s))}return o}(t,e,u,h)};for(n=0;n=Math.min(a[p].size,a[d].size)&&(f=0),s[p].push({set:d,size:h.size,weight:f}),s[d].push({set:p,size:h.size,weight:f})}var g=[];for(n in s)if(s.hasOwnProperty(n)){var y=0;for(l=0;l0){var o=t[0].x,a=t[0].y;for(i=0;i1){var s=Math.atan2(t[1].x,t[1].y)-e,l=void 0,c=void 0,u=Math.cos(s),h=Math.sin(s);for(i=0;i2){for(var f=Math.atan2(t[2].x,t[2].y)-e;f<0;)f+=2*Math.PI;for(;f>2*Math.PI;)f-=2*Math.PI;if(f>Math.PI){var p=t[1].y/(1e-10+t[1].x);for(i=0;i=u&&(c=s[n],u=h)}var f=i.nelderMead((function(n){return-1*o({x:n[0],y:n[1]},t,e)}),[c.x,c.y],{maxIterations:500,minErrorDelta:1e-10}).x,p={x:f[0],y:f[1]},d=!0;for(n=0;nt[n].radius){d=!1;break}for(n=0;n0&&console.log("WARNING: area "+s+" not represented on screen")}return n},e.circlePath=s,e.circleFromPath=function(t){var e=t.split(" ");return{x:parseFloat(e[1]),y:parseFloat(e[2]),radius:-parseFloat(e[4])}},e.intersectionAreaPath=function(t){var e={};r.intersectionArea(t,e);var n=e.arcs;if(0===n.length)return"M 0 0";if(1==n.length){var i=n[0].circle;return s(i.x,i.y,i.radius)}for(var o=["\nM",n[0].p2.x,n[0].p2.y],a=0;ac;o.push("\nA",c,c,0,u?1:0,1,l.p1.x,l.p1.y)}return o.join(" ")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(7),o=n(21),a=n(2),s=n(43);r.registerShape("schema","venn",{draw:function(t,e){var n=t.data,l=o.parsePathString(n[s.PATH_FIELD]),c=function(t){return a.deepAssign({},t.defaultStyle,{fill:t.color},t.style)}(t),u=e.addGroup({name:"venn-shape"});u.addShape("path",{attrs:i.__assign(i.__assign({},c),{path:l}),name:"venn-path"});var h=t.customInfo,f=h.offsetX,p=h.offsetY,d=r.Util.transform(null,[["t",f,p]]);return u.setMatrix(d),u},getMarker:function(t){var e=t.color;return{symbol:"circle",style:{lineWidth:0,stroke:e,fill:e,r:4}}}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(7),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.getLabelPoint=function(t,e,n){var i=t.data,r=i.x,o=i.y,a=t.customLabelInfo,s=a.offsetX,l=a.offsetY;return{content:t.content[n],x:r+s,y:o+l}},e}(r.GeometryLabel);r.registerGeometryLabel("venn",o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),r=n(281),o=n(282),a=n(283);i.registerAction("venn-element-active",r.VennElementActive),i.registerAction("venn-element-highlight",o.VennElementHighlight),i.registerAction("venn-element-selected",a.VennElementSelected),i.registerAction("venn-element-single-selected",a.VennElementSingleSelected),i.registerInteraction("venn-element-active",{start:[{trigger:"element:mouseenter",action:"venn-element-active:active"}],end:[{trigger:"element:mouseleave",action:"venn-element-active:reset"}]}),i.registerInteraction("venn-element-highlight",{start:[{trigger:"element:mouseenter",action:"venn-element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"venn-element-highlight:reset"}]}),i.registerInteraction("venn-element-selected",{start:[{trigger:"element:click",action:"venn-element-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-selected:reset"]}]}),i.registerInteraction("venn-element-single-selected",{start:[{trigger:"element:click",action:"venn-element-single-selected:toggle"}],rollback:[{trigger:"dblclick",action:["venn-element-single-selected:reset"]}]}),i.registerInteraction("venn-legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","venn-element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","venn-element-active:reset"]}]}),i.registerInteraction("venn-legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","venn-element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","venn-element-highlight:reset"]}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VennElementActive=void 0;var i=n(1),r=n(7),o=n(64),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.syncElementsPos=function(){o.placeElementsOrdered(this.context.view)},e.prototype.active=function(){t.prototype.active.call(this),this.syncElementsPos()},e.prototype.toggle=function(){t.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){t.prototype.reset.call(this),this.syncElementsPos()},e}(r.getActionClass("element-active"));e.VennElementActive=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VennElementHighlight=void 0;var i=n(1),r=n(7),o=n(64),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.syncElementsPos=function(){o.placeElementsOrdered(this.context.view)},e.prototype.highlight=function(){t.prototype.highlight.call(this),this.syncElementsPos()},e.prototype.toggle=function(){t.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.clear=function(){t.prototype.clear.call(this),this.syncElementsPos()},e.prototype.reset=function(){t.prototype.reset.call(this),this.syncElementsPos()},e}(r.getActionClass("element-highlight"));e.VennElementHighlight=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VennElementSingleSelected=e.VennElementSelected=void 0;var i=n(1),r=n(7),o=n(64),a=r.getActionClass("element-selected"),s=r.getActionClass("element-single-selected"),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.syncElementsPos=function(){o.placeElementsOrdered(this.context.view)},e.prototype.selected=function(){t.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){t.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){t.prototype.reset.call(this),this.syncElementsPos()},e}(a);e.VennElementSelected=l;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.syncElementsPos=function(){o.placeElementsOrdered(this.context.view)},e.prototype.selected=function(){t.prototype.selected.call(this),this.syncElementsPos()},e.prototype.toggle=function(){t.prototype.toggle.call(this),this.syncElementsPos()},e.prototype.reset=function(){t.prototype.reset.call(this),this.syncElementsPos()},e}(s);e.VennElementSingleSelected=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(82);Object.defineProperty(e,"Interaction",{enumerable:!0,get:function(){return i.Interaction}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.facetFunnel=void 0;var i=n(2),r=n(66);function o(t){var e,n=t.chart,i=t.options,r=i.data,o=void 0===r?[]:r,a=i.yField;return n.data(o),n.scale(((e={})[a]={sync:!0},e)),t}function a(t){var e=t.chart,n=t.options,o=n.seriesField,a=n.isTransposed,s=n.showFacetTitle;return e.facet("rect",{fields:[o],padding:[a?0:32,10,0,10],showTitle:s,eachView:function(e,n){r.basicFunnel(i.deepAssign({},t,{chart:e,options:{data:n.data}}))}}),t}e.facetFunnel=function(t){return i.flow(o,a)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicHeightFunnel=void 0;var i=n(1),r=n(0),o=n(2),a=n(36),s=n(20),l=n(23),c=n(50);function u(t){var e=t.chart,n=t.options,i=n.data,o=void 0===i?[]:i,s=n.yField,l=r.reduce(o,(function(t,e){return t+(e[s]||0)}),0),c=r.maxBy(o,s)[s],u=r.map(o,(function(t,e){var n=[],i=[];if(t[a.FUNNEL_TOTAL_PERCENT]=(t[s]||0)/l,e){var u=o[e-1][a.PLOYGON_X],h=o[e-1][a.PLOYGON_Y];n[0]=u[3],i[0]=h[3],n[1]=u[2],i[1]=h[2]}else n[0]=-.5,i[0]=1,n[1]=.5,i[1]=1;return i[2]=i[1]-t[a.FUNNEL_TOTAL_PERCENT],n[2]=(i[2]+1)/4,i[3]=i[2],n[3]=-n[2],t[a.PLOYGON_X]=n,t[a.PLOYGON_Y]=i,t[a.FUNNEL_PERCENT]=(t[s]||0)/c,t[a.FUNNEL_CONVERSATION]=[r.get(o,[e-1,s]),t[s]],t}));return e.data(u),t}function h(t){var e=t.chart,n=t.options,i=n.xField,o=n.yField,c=n.color,u=n.tooltip,h=n.label,f=n.funnelStyle,p=n.state,d=l.getTooltipMapping(u,[i,o]),g=d.fields,y=d.formatter;return s.geometry({chart:e,options:{type:"polygon",xField:a.PLOYGON_X,yField:a.PLOYGON_Y,colorField:i,tooltipFields:r.isArray(g)&&g.concat([a.FUNNEL_PERCENT,a.FUNNEL_CONVERSATION]),label:h,state:p,mapping:{tooltip:y,color:c,style:f}}}),t}function f(t){var e=t.chart,n=t.options.isTransposed;return e.coordinate({type:"rect",actions:n?[["transpose"],["reflect","x"]]:[]}),t}function p(t){return c.conversionTagComponent((function(t,e,n,r){return i.__assign(i.__assign({},r),{start:[t[a.PLOYGON_X][1],t[a.PLOYGON_Y][1]],end:[t[a.PLOYGON_X][1]+.05,t[a.PLOYGON_Y][1]]})}))(t),t}e.dynamicHeightFunnel=function(t){return o.flow(u,h,f,p)(t)}},function(t,e,n){"use strict";function i(t){return(i="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.ConversionTagAction=void 0;var r=n(1),o=n(0),a=n(7),s=n(66),l=n(130),c=n(50),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rendering=!1,e}return r.__extends(e,t),e.prototype.change=function(t){var e=this;if(!this.rendering){var n=t.seriesField,a=t.compareField,u=a?l.compareConversionTag:s.conversionTag,h=this.context.view,f=n||a?h.views:[h];o.map(f,(function(n,a){var s=n.getController("annotation"),l=o.filter(o.get(s,["option"],[]),(function(t){return t.name!==c.CONVERSION_TAG_NAME}));s.clear(!0),o.each(l,(function(t){"object"===i(t)&&n.annotation()[t.type](t)}));var h=o.get(n,["filteredData"],n.getOptions().data);u({chart:n,index:a,options:r.__assign(r.__assign({},t),{filteredData:c.transformData(h,h,t)})}),n.filterData(h),e.rendering=!0,n.render(!0)}))}this.rendering=!1},e}(a.Action);e.ConversionTagAction=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Liquid=void 0;var i=n(1),r=n(7),o=n(6),a=(n(290),n(291)),s=n(292),l=n(132);n(133);var c=n(133);Object.defineProperty(e,"addWaterWave",{enumerable:!0,get:function(){return c.addWaterWave}});var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="liquid",e}return i.__extends(e,t),e.getDefaultOptions=function(){return s.DEFAULT_OPTIONS},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.changeData=function(t){this.chart.emit(r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,null)),this.updateOption({percent:t}),this.chart.data(l.getLiquidData(t)),a.statistic({chart:this.chart,options:this.options},!0),this.chart.emit(r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,null))},e.prototype.getSchemaAdaptor=function(){return a.adaptor},e}(o.Plot);e.Liquid=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.statistic=void 0;var i=n(1),r=n(0),o=n(10),a=n(2),s=n(15),l=n(132);function c(t){var e=t.chart,n=t.options,i=n.percent,r=n.liquidStyle,o=n.radius,c=n.outline,u=n.wave,h=n.shape,f=n.animation;e.scale({percent:{min:0,max:1}}),e.data(l.getLiquidData(i));var p=n.color||e.getTheme().defaultColor,d=a.deepAssign({},t,{options:{xField:"type",yField:"percent",widthRatio:o,interval:{color:p,style:r,shape:"liquid-fill-gauge"}}}),g=s.interval(d).ext.geometry,y={radius:o,outline:c,wave:u,shape:h,background:e.getTheme().background,animation:f};return g.customInfo(y),e.legend(!1),e.axis(!1),e.tooltip(!1),t}function u(t,e){var n=t.chart,o=t.options,s=o.statistic,l=o.percent,c=o.meta;n.getController("annotation").clear(!0);var u=r.get(c,["percent","formatter"])||function(t){return(100*t).toFixed(2)+"%"},h=s.content;return h&&(h=a.deepAssign({},h,{content:r.isNil(h.content)?u(l):h.content})),a.renderStatistic(n,{statistic:i.__assign(i.__assign({},s),{content:h}),plotType:"liquid"},{percent:l}),e&&n.render(!0),t}e.statistic=u,e.adaptor=function(t){return a.flow(o.theme,o.pattern("liquidStyle"),c,u,o.scale({}),o.animation,o.interaction)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0,e.DEFAULT_OPTIONS={radius:.9,statistic:{title:!1,content:{style:{opacity:.75,fontSize:"30px",lineHeight:"30px",textAlign:"center"}}},outline:{border:2,distance:0},wave:{count:3,length:192},shape:"circle"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Bullet=void 0;var i=n(1),r=n(6),o=(n(294),n(295)),a=n(134),s=n(296),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="bullet",e}return i.__extends(e,t),e.getDefaultOptions=function(){return s.DEFAULT_OPTIONS},e.prototype.changeData=function(t){this.updateOption({data:t});var e=a.transformData(this.options),n=e.min,i=e.max,r=e.ds;o.meta({options:this.options,ext:{data:{min:n,max:i}},chart:this.chart}),this.chart.changeData(r)},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(r.Plot);e.Bullet=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.meta=void 0;var i=n(1),r=n(0),o=n(10),a=n(2),s=n(15),l=n(134);function c(t){var e=t.chart,n=t.options,o=n.bulletStyle,c=n.targetField,u=n.rangeField,h=n.measureField,f=n.xField,p=n.color,d=n.layout,g=n.size,y=n.label,v=l.transformData(n),m=v.min,x=v.max,b=v.ds;e.data(b);var _=a.deepAssign({},t,{options:{xField:f,yField:u,seriesField:"rKey",isStack:!0,label:r.get(y,"range"),interval:{color:r.get(p,"range"),style:r.get(o,"range"),size:r.get(g,"range")}}});s.interval(_),e.geometries[0].tooltip(!1);var O=a.deepAssign({},t,{options:{xField:f,yField:h,seriesField:"mKey",isStack:!0,label:r.get(y,"measure"),interval:{color:r.get(p,"measure"),style:r.get(o,"measure"),size:r.get(g,"measure")}}});s.interval(O);var w=a.deepAssign({},t,{options:{xField:f,yField:c,seriesField:"tKey",label:r.get(y,"target"),point:{color:r.get(p,"target"),style:r.get(o,"target"),size:r.isFunction(r.get(g,"target"))?function(t){return r.get(g,"target")(t)/2}:r.get(g,"target")/2,shape:"horizontal"===d?"line":"hyphen"}}});return s.point(w),"horizontal"===d&&e.coordinate().transpose(),i.__assign(i.__assign({},t),{ext:{data:{min:m,max:x}}})}function u(t){var e,n,i=t.options,r=t.ext,s=i.xAxis,l=i.yAxis,c=i.targetField,u=i.rangeField,h=i.measureField,f=i.xField,p=r.data;return a.flow(o.scale(((e={})[f]=s,e[h]=l,e),((n={})[h]={min:null==p?void 0:p.min,max:null==p?void 0:p.max,sync:!0},n[c]={sync:""+h},n[u]={sync:""+h},n)))(t)}function h(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField,a=n.measureField,s=n.rangeField,l=n.targetField;return e.axis(""+s,!1),e.axis(""+l,!1),!1===i?e.axis(""+o,!1):e.axis(""+o,i),!1===r?e.axis(""+a,!1):e.axis(""+a,r),t}function f(t){var e=t.chart,n=t.options.legend;return e.removeInteraction("legend-filter"),e.legend(n),e.legend("rKey",!1),e.legend("mKey",!1),e.legend("tKey",!1),t}function p(t){var e=t.chart,n=t.options,o=n.label,s=n.measureField,l=n.targetField,c=n.rangeField,u=e.geometries,h=u[0],f=u[1],p=u[2];return r.get(o,"range")?h.label(""+c,i.__assign({layout:[{type:"limit-in-plot"}]},a.transformLabel(o.range))):h.label(!1),r.get(o,"measure")?f.label(""+s,i.__assign({layout:[{type:"limit-in-plot"}]},a.transformLabel(o.measure))):f.label(!1),r.get(o,"target")?p.label(""+l,i.__assign({layout:[{type:"limit-in-plot"}]},a.transformLabel(o.target))):p.label(!1),t}e.meta=u,e.adaptor=function(t){a.flow(c,u,h,f,o.theme,p,o.tooltip,o.interaction,o.animation)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(6),r=n(2);e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{layout:"horizontal",size:{range:30,measure:20,target:20},xAxis:{tickLine:!1,line:null},bulletStyle:{range:{fillOpacity:.5}},label:{measure:{position:"right"}},tooltip:{showMarkers:!1}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Sunburst=void 0;var i=n(1),r=n(6),o=n(44),a=(n(298),n(299)),s=n(67);n(302);var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="sunburst",e}return i.__extends(e,t),e.getDefaultOptions=function(){return s.DEFAULT_OPTIONS},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return a.adaptor},e.SUNBURST_ANCESTOR_FIELD=s.SUNBURST_ANCESTOR_FIELD,e.SUNBURST_PATH_FIELD=s.SUNBURST_PATH_FIELD,e.NODE_ANCESTORS_FIELD=o.NODE_ANCESTORS_FIELD,e}(r.Plot);e.Sunburst=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.tooltip=e.meta=e.axis=void 0;var i=n(1),r=n(0),o=n(15),a=n(10),s=n(2),l=n(32),c=n(67),u=n(300);function h(t){var e,n=t.chart,a=t.options,l=a.color,h=a.colorField,f=void 0===h?c.SUNBURST_ANCESTOR_FIELD:h,p=a.sunburstStyle,d=a.rawFields,g=void 0===d?[]:d,y=u.transformData(a);return n.data(y),p&&(e=function(t){return s.deepAssign({},{fillOpacity:Math.pow(.85,t.depth)},r.isFunction(p)?p(t):p)}),o.polygon(s.deepAssign({},t,{options:{xField:"x",yField:"y",seriesField:f,rawFields:r.uniq(i.__spreadArrays(c.RAW_FIELDS,g)),polygon:{color:l,style:e}}})),t}function f(t){return t.chart.axis(!1),t}function p(t){var e=t.chart,n=t.options.label,r=s.findGeometry(e,"polygon");if(n){var o=n.fields,a=void 0===o?["name"]:o,l=n.callback,c=i.__rest(n,["fields","callback"]);r.label({fields:a,callback:l,cfg:s.transformLabel(c)})}else r.label(!1);return t}function d(t){var e=t.chart,n=t.options,i=n.innerRadius,r=n.radius,o=n.reflect,a=e.coordinate({type:"polar",cfg:{innerRadius:i,radius:r}});return o&&a.reflect(o),t}function g(t){var e,n=t.options,i=n.hierarchyConfig,o=n.meta;return s.flow(a.scale({},((e={})[c.SUNBURST_Y_FIELD]=r.get(o,r.get(i,["field"],"value")),e)))(t)}function y(t){var e=t.chart,n=t.options.tooltip;if(!1===n)e.tooltip(!1);else{var o=n;r.get(n,"fields")||(o=s.deepAssign({},{customItems:function(t){return t.map((function(t){var n=r.get(e.getOptions(),"scales"),o=r.get(n,[c.SUNBURST_PATH_FIELD,"formatter"],(function(t){return t})),a=r.get(n,[c.SUNBURST_Y_FIELD,"formatter"],(function(t){return t}));return i.__assign(i.__assign({},t),{name:o(t.data[c.SUNBURST_PATH_FIELD]),value:a(t.data.value)})}))}},o)),e.tooltip(o)}return t}function v(t){var e=t.drilldown,n=t.interactions,r=void 0===n?[]:n;return(null==e?void 0:e.enabled)?s.deepAssign({},t,{interactions:i.__spreadArrays(r,[{type:"drill-down",cfg:{drillDownConfig:e,transformData:u.transformData}}])}):t}function m(t){var e=t.chart,n=t.options,i=n.drilldown;return a.interaction({chart:e,options:v(n)}),(null==i?void 0:i.enabled)&&(e.appendPadding=l.getAdjustAppendPadding(e.appendPadding,r.get(i,["breadCrumb","position"]))),t}e.axis=f,e.meta=g,e.tooltip=y,e.adaptor=function(t){return s.flow(a.theme,a.pattern("sunburstStyle"),h,f,g,a.legend,d,y,p,m,a.animation,a.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transformData=void 0;var i=n(1),r=n(0),o=n(51),a=n(2),s=n(301),l=n(135),c=n(67);e.transformData=function(t){var e=t.data,n=t.colorField,u=t.rawFields,h=t.hierarchyConfig,f=void 0===h?{}:h,p=f.activeDepth,d={partition:s.partition,treemap:l.treemap},g=t.seriesField,y=t.type||"partition",v=d[y](e,i.__assign(i.__assign({field:g||"value"},r.omit(f,["activeDepth"])),{type:"hierarchy."+y,as:["x","y"]})),m=[];return v.forEach((function(t){var e,r,s,l,h,d;if(0===t.depth)return null;if(p>0&&t.depth>p)return null;for(var y=t.data.name,v=i.__assign({},t);v.depth>1;)y=(null===(r=v.parent.data)||void 0===r?void 0:r.name)+" / "+y,v=v.parent;var x=i.__assign(i.__assign(i.__assign({},a.pick(t.data,i.__spreadArrays(u||[],[f.field]))),((e={})[c.SUNBURST_PATH_FIELD]=y,e[c.SUNBURST_ANCESTOR_FIELD]=v.data.name,e)),t);g&&(x[g]=t.data[g]||(null===(l=null===(s=t.parent)||void 0===s?void 0:s.data)||void 0===l?void 0:l[g])),n&&(x[n]=t.data[n]||(null===(d=null===(h=t.parent)||void 0===h?void 0:h.data)||void 0===d?void 0:d[n])),x.ext=f,x[o.HIERARCHY_DATA_TRANSFORM_PARAMS]={hierarchyConfig:f,colorField:n,rawFields:u},m.push(x)})),m}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.partition=void 0;var i=n(1).__importStar(n(72)),r=n(0),o=n(44),a={field:"value",size:[1,1],round:!1,padding:0,sort:function(t,e){return e.value-t.value},as:["x","y"],ignoreParentValue:!0};e.partition=function(t,e){var n,s=(e=r.assign({},a,e)).as;if(!r.isArray(s)||2!==s.length)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');try{n=o.getField(e)}catch(t){console.warn(t)}var l=function(t){return i.partition().size(e.size).round(e.round).padding(e.padding)(i.hierarchy(t).sum((function(t){return r.size(t.children)?e.ignoreParentValue?0:t[n]-r.reduce(t.children,(function(t,e){return t+e[n]}),0):t[n]})).sort(e.sort))}(t),c=s[0],u=s[1];return l.each((function(t){var e,n;t[c]=[t.x0,t.x1,t.x1,t.x0],t[u]=[t.y1,t.y1,t.y0,t.y0],t.name=t.name||(null===(e=t.data)||void 0===e?void 0:e.name)||(null===(n=t.data)||void 0===n?void 0:n.label),t.data.name=t.name,["x0","x1","y0","y1"].forEach((function(e){-1===s.indexOf(e)&&delete t[e]}))})),o.getAllNodes(l)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(68)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(52)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1);n(7).registerShape("point","gauge-indicator",{draw:function(t,e){var n=t.customInfo,r=n.indicator,o=n.defaultColor,a=r,s=a.pointer,l=a.pin,c=e.addGroup(),u=this.parsePoint({x:0,y:0});return s&&c.addShape("line",{name:"pointer",attrs:i.__assign({x1:u.x,y1:u.y,x2:t.x,y2:t.y,stroke:o},s.style)}),l&&c.addShape("circle",{name:"pin",attrs:i.__assign({x:u.x,y:u.y,stroke:o},l.style)}),c}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),r=n(0);i.registerShape("interval","meter-gauge",{draw:function(t,e){var n=t.customInfo.meter,o=void 0===n?{}:n,a=o.steps,s=void 0===a?50:a,l=o.stepRatio,c=void 0===l?.5:l;s=s<1?1:s,c=r.clamp(c,0,1);var u=this.coordinate,h=u.startAngle,f=u.endAngle,p=0;c>0&&c<1&&(p=(f-h)/s/(c/(1-c)+1-1/s));for(var d=p/(1-c)*c,g=e.addGroup(),y=this.coordinate.getCenter(),v=this.coordinate.getRadius(),m=i.Util.getAngle(t,this.coordinate),x=m.startAngle,b=m.endAngle,_=x;_0?g:y},x=l.deepAssign({},t,{options:{xField:o,yField:c.Y_FIELD,seriesField:o,rawFields:[s,c.DIFF_FIELD,c.IS_TOTAL,c.Y_FIELD],widthRatio:p,interval:{style:d,shape:"waterfall",color:m}}});return a.interval(x).ext.geometry.customInfo({leaderLine:f}),t}function p(t){var e,n,i=t.options,a=i.xAxis,s=i.yAxis,u=i.xField,h=i.yField,f=i.meta,p=l.deepAssign({},{alias:h},r.get(f,h));return l.flow(o.scale(((e={})[u]=a,e[h]=s,e[c.Y_FIELD]=s,e),l.deepAssign({},f,((n={})[c.Y_FIELD]=p,n[c.DIFF_FIELD]=p,n[c.ABSOLUTE_FIELD]=p,n))))(t)}function d(t){var e=t.chart,n=t.options,i=n.xAxis,r=n.yAxis,o=n.xField,a=n.yField;return!1===i?e.axis(o,!1):e.axis(o,i),!1===r?(e.axis(a,!1),e.axis(c.Y_FIELD,!1)):(e.axis(a,r),e.axis(c.Y_FIELD,r)),t}function g(t){var e=t.chart,n=t.options,i=n.legend,o=n.total,a=n.risingFill,c=n.fallingFill,u=n.locale,h=s.getLocale(u);if(!1===i)e.legend(!1);else{var f=[{name:h.get(["general","increase"]),value:"increase",marker:{symbol:"square",style:{r:5,fill:a}}},{name:h.get(["general","decrease"]),value:"decrease",marker:{symbol:"square",style:{r:5,fill:c}}}];o&&f.push({name:o.label||"",value:"total",marker:{symbol:"square",style:l.deepAssign({},{r:5},r.get(o,"style"))}}),e.legend(l.deepAssign({},{custom:!0,position:"top",items:f},i)),e.removeInteraction("legend-filter")}return t}function y(t){var e=t.chart,n=t.options,r=n.label,o=n.labelMode,a=n.xField,s=l.findGeometry(e,"interval");if(r){var u=r.callback,h=i.__rest(r,["callback"]);s.label({fields:"absolute"===o?[c.ABSOLUTE_FIELD,a]:[c.DIFF_FIELD,a],callback:u,cfg:l.transformLabel(h)})}else s.label(!1);return t}function v(t){var e=t.chart,n=t.options,r=n.tooltip,o=n.xField,a=n.yField;if(!1!==r){e.tooltip(i.__assign({showCrosshairs:!1,showMarkers:!1,shared:!0,fields:[a]},r));var s=e.geometries[0];(null==r?void 0:r.formatter)?s.tooltip(o+"*"+a,r.formatter):s.tooltip(a)}else e.tooltip(!1);return t}n(309),e.tooltip=v,e.adaptor=function(t){return l.flow(h,o.theme,f,p,d,g,v,y,o.state,o.interaction,o.animation,o.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(7),o=n(0),a=n(2);r.registerShape("interval","waterfall",{draw:function(t,e){var n=t.customInfo,r=t.points,s=t.nextPoints,l=e.addGroup(),c=this.parsePath(function(t){for(var e=[],n=0;n0?Math.max.apply(Math,i):0,o=Math.abs(t)%360;return o?360*r/o:r},e.getStackedData=function(t,e,n){var r=[];return t.forEach((function(t){var o=r.find((function(n){return n[e]===t[e]}));o?o[n]+=t[n]||null:r.push(i.__assign({},t))})),r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0;var i=n(6),r=n(2);e.DEFAULT_OPTIONS=r.deepAssign({},i.Plot.getDefaultOptions(),{interactions:[{type:"element-active"}],legend:!1,tooltip:{showMarkers:!1},xAxis:{grid:null,tickLine:null,line:null},maxAngle:240})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BidirectionalBar=void 0;var i=n(1),r=n(7),o=n(6),a=n(2),s=(n(316),n(317)),l=n(141),c=n(140),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="bidirectional-bar",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.deepAssign({},t.getDefaultOptions.call(this),{syncViewPadding:l.syncViewPadding})},e.prototype.changeData=function(t){void 0===t&&(t=[]),this.chart.emit(r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.BEFORE_CHANGE_DATA,null)),this.updateOption({data:t});var e=this.options,n=e.xField,i=e.yField,o=e.layout,s=l.transformData(n,i,c.SERIES_FIELD_KEY,t,l.isHorizontal(o)),u=s[0],h=s[1],f=a.findViewById(this.chart,c.FIRST_AXES_VIEW),p=a.findViewById(this.chart,c.SECOND_AXES_VIEW);f.data(u),p.data(h),this.chart.render(!0),this.chart.emit(r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,r.Event.fromData(this.chart,r.VIEW_LIFE_CIRCLE.AFTER_CHANGE_DATA,null))},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return s.adaptor},e.SERIES_FIELD_KEY=c.SERIES_FIELD_KEY,e}(o.Plot);e.BidirectionalBar=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.animation=e.theme=e.limitInPlot=e.interaction=void 0;var i=n(1),r=n(0),o=n(10),a=n(15),s=n(2),l=n(140),c=n(141);function u(t){var e,n,i=t.chart,r=t.options,o=r.data,u=r.xField,h=r.yField,f=r.color,p=r.barStyle,d=r.widthRatio,g=r.legend,y=r.layout,v=c.transformData(u,h,l.SERIES_FIELD_KEY,o,c.isHorizontal(y));g?i.legend(l.SERIES_FIELD_KEY,g):!1===g&&i.legend(!1);var m=v[0],x=v[1];c.isHorizontal(y)?((e=i.createView({region:{start:{x:0,y:0},end:{x:.5,y:1}},id:l.FIRST_AXES_VIEW})).coordinate().transpose().reflect("x"),(n=i.createView({region:{start:{x:.5,y:0},end:{x:1,y:1}},id:l.SECOND_AXES_VIEW})).coordinate().transpose(),e.data(m),n.data(x)):(e=i.createView({region:{start:{x:0,y:0},end:{x:1,y:.5}},id:l.FIRST_AXES_VIEW}),(n=i.createView({region:{start:{x:0,y:.5},end:{x:1,y:1}},id:l.SECOND_AXES_VIEW})).coordinate().reflect("y"),e.data(m),n.data(x));var b=s.deepAssign({},t,{chart:e,options:{widthRatio:d,xField:u,yField:h[0],seriesField:l.SERIES_FIELD_KEY,interval:{color:f,style:p}}});a.interval(b);var _=s.deepAssign({},t,{chart:n,options:{xField:u,yField:h[1],seriesField:l.SERIES_FIELD_KEY,widthRatio:d,interval:{color:f,style:p}}});return a.interval(_),t}function h(t){var e,n,i,a=t.options,c=t.chart,u=a.xAxis,h=a.yAxis,f=a.xField,p=a.yField,d=s.findViewById(c,l.FIRST_AXES_VIEW),g=s.findViewById(c,l.SECOND_AXES_VIEW),y={};return r.keys((null==a?void 0:a.meta)||{}).map((function(t){r.get(null==a?void 0:a.meta,[t,"alias"])&&(y[t]=a.meta[t].alias)})),c.scale(((e={})[l.SERIES_FIELD_KEY]={sync:!0,formatter:function(t){return r.get(y,t,t)}},e)),o.scale(((n={})[f]=u,n[p[0]]=h[p[0]],n))(s.deepAssign({},t,{chart:d})),o.scale(((i={})[f]=u,i[p[1]]=h[p[1]],i))(s.deepAssign({},t,{chart:g})),t}function f(t){var e=t.chart,n=t.options,r=n.xAxis,o=n.yAxis,a=n.xField,u=n.yField,h=n.layout,f=s.findViewById(e,l.FIRST_AXES_VIEW),p=s.findViewById(e,l.SECOND_AXES_VIEW);return"bottom"===(null==r?void 0:r.position)?p.axis(a,i.__assign(i.__assign({},r),{label:{formatter:function(){return""}}})):p.axis(a,!1),!1===r?f.axis(a,!1):f.axis(a,i.__assign({position:c.isHorizontal(h)?"top":"bottom"},r)),!1===o?(f.axis(u[0],!1),p.axis(u[1],!1)):(f.axis(u[0],o[u[0]]),p.axis(u[1],o[u[1]])),e.__axisPosition={position:f.getOptions().axes[a].position,layout:h},t}function p(t){var e=t.chart;return o.interaction(s.deepAssign({},t,{chart:s.findViewById(e,l.FIRST_AXES_VIEW)})),o.interaction(s.deepAssign({},t,{chart:s.findViewById(e,l.SECOND_AXES_VIEW)})),t}function d(t){var e=t.chart,n=t.options,i=n.yField,r=n.yAxis;return o.limitInPlot(s.deepAssign({},t,{chart:s.findViewById(e,l.FIRST_AXES_VIEW),options:{yAxis:r[i[0]]}})),o.limitInPlot(s.deepAssign({},t,{chart:s.findViewById(e,l.SECOND_AXES_VIEW),options:{yAxis:r[i[1]]}})),t}function g(t){var e=t.chart;return o.theme(s.deepAssign({},t,{chart:s.findViewById(e,l.FIRST_AXES_VIEW)})),o.theme(s.deepAssign({},t,{chart:s.findViewById(e,l.SECOND_AXES_VIEW)})),o.theme(t),t}function y(t){var e=t.chart;return o.animation(s.deepAssign({},t,{chart:s.findViewById(e,l.FIRST_AXES_VIEW)})),o.animation(s.deepAssign({},t,{chart:s.findViewById(e,l.SECOND_AXES_VIEW)})),t}function v(t){var e,n,r=this,o=t.chart,a=t.options,u=a.label,h=a.yField,f=a.layout,p=s.findViewById(o,l.FIRST_AXES_VIEW),d=s.findViewById(o,l.SECOND_AXES_VIEW),g=s.findGeometry(p,"interval"),y=s.findGeometry(d,"interval");if(u){var v=u.callback,m=i.__rest(u,["callback"]);m.position||(m.position="middle"),void 0===m.offset&&(m.offset=2);var x=i.__assign({},m);if(c.isHorizontal(f)){var b=(null===(e=x.style)||void 0===e?void 0:e.textAlign)||("middle"===m.position?"center":"left");m.style=s.deepAssign({},m.style,{textAlign:b});x.style=s.deepAssign({},x.style,{textAlign:{left:"right",right:"left",center:"center"}[b]})}else{var _={top:"bottom",bottom:"top",middle:"middle"};"string"==typeof m.position?m.position=_[m.position]:"function"==typeof m.position&&(m.position=function(){for(var t=[],e=0;e "+t.target,value:t.value}}},nodeWidthRatio:.008,nodePaddingRatio:.01,animation:{appear:{animation:"wave-in"},enter:{animation:"wave-in"}}}},e.prototype.changeData=function(t){this.updateOption({data:t});var e=l.transformToViewsData(this.options,this.chart.width,this.chart.height),n=e.nodes,i=e.edges,r=a.findViewById(this.chart,c.NODES_VIEW_ID),o=a.findViewById(this.chart,c.EDGES_VIEW_ID);r.changeData(n),o.changeData(i)},e.prototype.getSchemaAdaptor=function(){return s.adaptor},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e}(o.Plot);e.Sankey=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.nodeDraggable=e.animation=void 0;var i=n(1),r=n(0),o=n(10),a=n(2),s=n(40),l=n(15),c=n(143),u=n(70);function h(t){var e=t.options.rawFields,n=void 0===e?[]:e;return a.deepAssign({},{options:{tooltip:{fields:r.uniq(i.__spreadArrays(["name","source","target","value","isNode"],n))},label:{fields:r.uniq(i.__spreadArrays(["x","name"],n))}}},t)}function f(t){var e=t.chart,n=t.options,i=n.color,r=n.nodeStyle,o=n.edgeStyle,a=n.label,s=n.tooltip,h=n.nodeState,f=n.edgeState;e.legend(!1),e.tooltip(s),e.axis(!1),e.coordinate().reflect("y");var p=c.transformToViewsData(n,e.width,e.height),d=p.nodes,g=p.edges,y=e.createView({id:u.EDGES_VIEW_ID});y.data(g),l.edge({chart:y,options:{xField:u.X_FIELD,yField:u.Y_FIELD,seriesField:u.COLOR_FIELD,edge:{color:i,style:o,shape:"arc"},tooltip:s,state:f}});var v=e.createView({id:u.NODES_VIEW_ID});return v.data(d),l.polygon({chart:v,options:{xField:u.X_FIELD,yField:u.Y_FIELD,seriesField:u.COLOR_FIELD,polygon:{color:i,style:r},label:a,tooltip:s,state:h}}),e.interaction("element-active"),e.scale({x:{sync:!0,nice:!0,min:0,max:1,minLimit:0,maxLimit:1},y:{sync:!0,nice:!0,min:0,max:1,minLimit:0,maxLimit:1},name:{sync:"color",type:"cat"}}),t}function p(t){var e=t.chart,n=t.options.animation,r=i.__spreadArrays(e.views[0].geometries,e.views[1].geometries);return s.addViewAnimation(e,n,r),t}function d(t){var e=t.chart;return t.options.nodeDraggable?e.interaction("sankey-node-draggable"):e.removeInteraction("sankey-node-draggable"),t}function g(t){var e=t.chart,n=t.options,i=n.interactions,r=void 0===i?[]:i,o=[].concat(r,n.nodeInteractions||[]),s=[].concat(r,n.edgeInteractions||[]),l=a.findViewById(e,u.NODES_VIEW_ID),c=a.findViewById(e,u.EDGES_VIEW_ID);return o.forEach((function(t){!1===(null==t?void 0:t.enable)?l.removeInteraction(t.type):l.interaction(t.type,t.cfg||{})})),s.forEach((function(t){!1===(null==t?void 0:t.enable)?c.removeInteraction(t.type):c.interaction(t.type,t.cfg||{})})),t}e.animation=p,e.nodeDraggable=d,e.adaptor=function(t){return a.flow(h,f,g,d,p,o.theme)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sankeyLayout=e.getDefaultOptions=e.getNodeAlignFunction=void 0;var i=n(0),r=n(327),o={left:r.left,right:r.right,center:r.center,justify:r.justify},a={nodeId:function(t){return t.index},nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodeSort:void 0};function s(t){return(i.isString(t)?o[t]:i.isFunction(t)?t:null)||r.justify}function l(t){return i.assign({},a,t)}e.getNodeAlignFunction=s,e.getDefaultOptions=l,e.sankeyLayout=function(t,e){var n=l(t),i=n.nodeId,o=n.nodeSort,a=n.nodeAlign,c=n.nodeWidth,u=n.nodePadding,h=n.nodeDepth,f=r.sankey().nodeSort(o).nodeWidth(c).nodePadding(u).nodeDepth(h).nodeAlign(s(a)).extent([[0,0],[1,1]]).nodeId(i)(e);return{nodes:f.nodes.map((function(t){var e=t.x0,n=t.x1,i=t.y0,r=t.y1;return t.x=[e,n,n,e],t.y=[i,i,r,r],t})).filter((function(t){return null!==t.name})),links:f.links.map((function(t){var e=t.source,n=t.target,i=e.x1,r=n.x0;t.x=[i,i,r,r];var o=t.width/2;return t.y=[t.y0+o,t.y0-o,t.y1+o,t.y1-o],t})).filter((function(t){var e=t.source,n=t.target;return null!==e.name&&null!==n.name}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sankey=void 0;var i=n(328);Object.defineProperty(e,"sankey",{enumerable:!0,get:function(){return i.Sankey}});var r=n(144);Object.defineProperty(e,"center",{enumerable:!0,get:function(){return r.center}}),Object.defineProperty(e,"left",{enumerable:!0,get:function(){return r.left}}),Object.defineProperty(e,"right",{enumerable:!0,get:function(){return r.right}}),Object.defineProperty(e,"justify",{enumerable:!0,get:function(){return r.justify}})},function(t,e,n){"use strict";function i(t){return(i="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})(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.Sankey=void 0;var r=n(144),o=n(329);function a(t,e){return l(t.source,e.source)||t.index-e.index}function s(t,e){return l(t.target,e.target)||t.index-e.index}function l(t,e){return t.y0-e.y0}function c(t){return t.value}function u(t){return t.index}function h(t){return t.nodes}function f(t){return t.links}function p(t,e){var n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function d(t){for(var e=0,n=t.nodes;ei)throw new Error("circular link");r=a,a=new Set}if(e)for(var l=Math.max(o.maxValueBy(n,(function(t){return t.depth}))+1,0),c=void 0,u=0;un)throw new Error("circular link");i=r,r=new Set}}(a),function(e){var i=function(t){for(var e=t.nodes,i=Math.max(o.maxValueBy(e,(function(t){return t.depth}))+1,0),r=(m-y-b)/(i-1),a=new Array(i).fill(0).map((function(){return[]})),s=0,l=e;s0){var m=(h/f-u.y0)*e;u.y0+=m,u.y1+=m,T(u)}}void 0===n&&a.sort(l),a.length&&I(a,i)}}function E(t,e,i){for(var r=t.length-2;r>=0;--r){for(var o=t[r],a=0,s=o;a0){var v=(u/h-c.y0)*e;c.y0+=v,c.y1+=v,T(c)}}void 0===n&&o.sort(l),o.length&&I(o,i)}}function I(e,n){var i=e.length>>1,r=e[i];F(e,r.y0-t,i-1,n),P(e,r.y1+t,i+1,n),F(e,x,e.length-1,n),P(e,v,0,n)}function P(e,n,i,r){for(;i1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+t}}function F(e,n,i,r){for(;i>=0;--i){var o=e[i],a=(o.y1-n)*r;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-t}}function T(t){var e=t.sourceLinks,n=t.targetLinks;if(void 0===g){for(var i=0,r=n;i=1)throw new TypeError("Invalid nodePaddingRatio: it must be in range [0, 1)!");var r=i/(2*n),o=e.nodeWidthRatio;if(o<=0||o>=1)throw new TypeError("Invalid nodeWidthRatio: it must be in range (0, 1)!");var a=0;t.forEach((function(t){a+=t.value})),t.forEach((function(t){t.weight=t.value/a,t.width=t.weight*(1-i),t.height=o})),t.forEach((function(n,i){for(var a=0,s=i-1;s>=0;s--)a+=t[s].width+2*r;var l=n.minX=r+a,c=n.maxX=n.minX+n.width,u=n.minY=e.y-o/2,h=n.maxY=u+o;n.x=[l,c,c,l],n.y=[u,u,h,h]}))}else{var s=1/n;t.forEach((function(t,n){t.x=(n+.5)*s,t.y=e.y}))}return t}(a,n),links:function(t,e,n){if(n.weight){var r={};i.forIn(t,(function(t,e){r[e]=t.value})),e.forEach((function(e){var i=n.source(e),o=n.target(e),a=t[i],s=t[o];if(a&&s){var l=r[i],c=n.sourceWeight(e),u=a.minX+(a.value-l)/a.value*a.width,h=u+c/a.value*a.width;r[i]-=c;var f=r[o],p=n.targetWeight(e),d=s.minX+(s.value-f)/s.value*s.width,g=d+p/s.value*s.width;r[o]-=p;var y=n.y;e.x=[u,h,d,g],e.y=[y,y,y,y],e.source=a,e.target=s}}))}else e.forEach((function(e){var i=t[n.source(e)],r=t[n.target(e)];i&&r&&(e.x=[i.x,r.x],e.y=[i.y,r.y],e.source=i,e.target=r)}));return e}(r,s,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CirclePacking=void 0;var i=n(1),r=n(6),o=n(339),a=n(146);n(342);n(343);var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle-packing",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.DEFAULT_OPTIONS},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e.prototype.triggerResize=function(){this.chart.destroyed||(this.chart.forceFit(),this.chart.clear(),this.execAdaptor(),this.chart.render(!0))},e}(r.Plot);e.CirclePacking=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.meta=void 0;var i=n(1),r=n(0),o=n(85),a=n(10),s=n(2),l=n(32),c=n(340),u=n(146);function h(t){var e=t.chart,n=Math.min(e.viewBBox.width,e.viewBBox.height);return s.deepAssign({options:{size:function(t){return t.r*n}}},t)}function f(t){var e=t.options,n=t.chart,i=n.viewBBox,o=e.padding,a=e.appendPadding,s=e.drilldown,u=a;if(null==s?void 0:s.enabled){var h=l.getAdjustAppendPadding(n.appendPadding,r.get(s,["breadCrumb","position"]));u=l.resolveAllPadding([h,a])}var f=c.resolvePaddingForCircle(o,u,i).finalPadding;return n.padding=f,n.appendPadding=0,t}function p(t){var e=t.chart,n=t.options,r=e.padding,a=e.appendPadding,l=n.color,h=n.colorField,f=n.pointStyle,p=n.hierarchyConfig,d=n.sizeField,g=n.rawFields,y=void 0===g?[]:g,v=n.drilldown,m=c.transformData({data:n.data,hierarchyConfig:p,enableDrillDown:null==v?void 0:v.enabled,rawFields:y});e.data(m);var x=e.viewBBox,b=c.resolvePaddingForCircle(r,a,x).finalSize,_=function(t){return t.r*b};return d&&(_=function(t){return t[d]*b}),o.point(s.deepAssign({},t,{options:{xField:"x",yField:"y",seriesField:h,sizeField:d,rawFields:i.__spreadArrays(u.RAW_FIELDS,y),point:{color:l,style:f,shape:"circle",size:_}}})),t}function d(t){return s.flow(a.scale({},{x:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0},y:{min:0,max:1,minLimit:0,maxLimit:1,nice:!0}}))(t)}function g(t){var e=t.chart,n=t.options.tooltip;if(!1===n)e.tooltip(!1);else{var o=n;r.get(n,"fields")||(o=s.deepAssign({},{customItems:function(t){return t.map((function(t){var n=r.get(e.getOptions(),"scales"),o=r.get(n,["name","formatter"],(function(t){return t})),a=r.get(n,["value","formatter"],(function(t){return t}));return i.__assign(i.__assign({},t),{name:o(t.data.name),value:a(t.data.value)})}))}},o)),e.tooltip(o)}return t}function y(t){return t.chart.axis(!1),t}function v(t){var e=t.drilldown,n=t.interactions,r=void 0===n?[]:n;return(null==e?void 0:e.enabled)?s.deepAssign({},t,{interactions:i.__spreadArrays(r,[{type:"drill-down",cfg:{drillDownConfig:e,transformData:c.transformData,enableDrillDown:!0}}])}):t}function m(t){var e=t.chart,n=t.options;return a.interaction({chart:e,options:v(n)}),t}e.meta=d,e.adaptor=function(t){return s.flow(a.pattern("pointStyle"),h,f,a.theme,d,p,y,a.legend,g,m,a.animation,a.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolvePaddingForCircle=e.transformData=void 0;var i=n(1),r=n(341),o=n(2),a=n(51),s=n(32);e.transformData=function(t){var e=t.data,n=t.hierarchyConfig,s=t.rawFields,l=void 0===s?[]:s,c=t.enableDrillDown,u=r.pack(e,i.__assign(i.__assign({},n),{field:"value",as:["x","y","r"]})),h=[];return u.forEach((function(t){for(var e,r=t.data.name,s=i.__assign({},t);s.depth>1;)r=(null===(e=s.parent.data)||void 0===e?void 0:e.name)+" / "+r,s=s.parent;if(c&&t.depth>2)return null;var u=o.deepAssign({},t.data,i.__assign(i.__assign(i.__assign({},o.pick(t.data,l)),{path:r}),t));u.ext=n,u[a.HIERARCHY_DATA_TRANSFORM_PARAMS]={hierarchyConfig:n,rawFields:l,enableDrillDown:c},h.push(u)})),h},e.resolvePaddingForCircle=function(t,e,n){var i=s.resolveAllPadding([t,e]),r=i[0],o=i[1],a=i[2],l=i[3],c=n.width-(l+o),u=n.height-(r+a),h=Math.min(c,u),f=(c-h)/2,p=(u-h)/2;return{finalPadding:[r+p,o+f,a+p,l+f],finalSize:h<0?0:h}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.pack=void 0;var i=n(1).__importStar(n(72)),r=n(0),o=n(44),a={field:"value",as:["x","y","r"],sort:function(t,e){return e.value-t.value}};e.pack=function(t,e){var n,s=(e=r.assign({},a,e)).as;if(!r.isArray(s)||3!==s.length)throw new TypeError('Invalid as: it must be an array with 3 strings (e.g. [ "x", "y", "r" ])!');try{n=o.getField(e)}catch(t){console.warn(t)}var l=function(t){return i.pack().size(e.size).padding(e.padding)(i.hierarchy(t).sum((function(t){return t[n]})).sort(e.sort))}(t),c=s[0],u=s[1],h=s[2];return l.each((function(t){t[c]=t.x,t[u]=t.y,t[h]=t.r})),o.getAllNodes(l)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(68)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.P=void 0;var i=n(1),r=n(2),o=function(t){function e(e,n,i,o){var a=t.call(this,e,r.deepAssign({},o,n))||this;return a.type="g2-plot",a.defaultOptions=o,a.adaptor=i,a}return i.__extends(e,t),e.prototype.getDefaultOptions=function(){return this.defaultOptions},e.prototype.getSchemaAdaptor=function(){return this.adaptor},e}(n(6).Plot);e.P=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=e.slider=void 0;var i=n(1),r=n(0),o=n(20),a=n(10),s=n(6),l=n(27),c=n(2),u=n(147);function h(t){var e=t.chart,n=t.options,a=n.views,s=n.legend;return r.each(a,(function(t){var n=t.region,a=t.data,s=t.meta,u=t.axes,h=t.coordinate,f=t.interactions,p=t.annotations,d=t.tooltip,g=t.geometries,y=e.createView({region:n});y.data(a);var v={};u&&r.each(u,(function(t,e){v[e]=c.pick(t,l.AXIS_META_CONFIG_KEYS)})),v=c.deepAssign({},s,v),y.scale(v),u?r.each(u,(function(t,e){y.axis(e,t)})):y.axis(!1),y.coordinate(h),r.each(g,(function(t){var e=o.geometry({chart:y,options:t}).ext,n=t.adjust;n&&e.geometry.adjust(n)})),r.each(f,(function(t){!1===t.enable?y.removeInteraction(t.type):y.interaction(t.type,t.cfg)})),r.each(p,(function(t){y.annotation()[t.type](i.__assign({},t))})),"boolean"==typeof t.animation?y.animate(!1):(y.animate(!0),r.each(y.geometries,(function(e){e.animate(t.animation)}))),d&&(y.interaction("tooltip"),y.tooltip(d))})),s?r.each(s,(function(t,n){e.legend(n,t)})):e.legend(!1),e.tooltip(n.tooltip),t}function f(t){var e=t.chart,n=t.options,o=n.plots,a=n.data,l=void 0===a?[]:a;return r.each(o,(function(t){var n=t.type,r=t.region,o=t.options,a=void 0===o?{}:o,h=t.top,f=a.tooltip;if(h)u.execPlotAdaptor(n,e,i.__assign(i.__assign({},a),{data:l}));else{var p=e.createView(i.__assign({region:r},c.pick(a,s.PLOT_CONTAINER_OPTIONS)));f&&p.interaction("tooltip"),u.execPlotAdaptor(n,p,i.__assign({data:l},a))}})),t}function p(t){var e=t.chart,n=t.options;return e.option("slider",n.slider),t}e.slider=p,e.adaptor=function(t){return c.flow(a.animation,h,f,a.interaction,a.animation,a.theme,a.tooltip,p,a.annotation())(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(348)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(0),o=n(7),a=n(2),s=n(349),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.getAssociationItems=function(t,e){var n,i=this.context.event,o=e||{},l=o.linkField,c=o.dim,u=[];if(null===(n=i.data)||void 0===n?void 0:n.data){var h=i.data.data;r.each(t,(function(t){var e,n,i=l;if("x"===c?i=t.getXScale().field:"y"===c?i=null===(e=t.getYScales().find((function(t){return t.field===i})))||void 0===e?void 0:e.field:i||(i=null===(n=t.getGroupScales()[0])||void 0===n?void 0:n.field),i){var o=r.map(a.getAllElements(t),(function(e){var n=!1,o=!1,a=r.isArray(h)?r.get(h[0],i):r.get(h,i);return s.getElementValue(e,i)===a?n=!0:o=!0,{element:e,view:t,active:n,inactive:o}}));u.push.apply(u,o)}}))}return u},e.prototype.showTooltip=function(t){var e=a.getSiblingViews(this.context.view),n=this.getAssociationItems(e,t);r.each(n,(function(t){if(t.active){var e=t.element.shape.getCanvasBBox();t.view.showTooltip({x:e.minX+e.width/2,y:e.minY+e.height/2})}}))},e.prototype.hideTooltip=function(){var t=a.getSiblingViews(this.context.view);r.each(t,(function(t){t.hideTooltip()}))},e.prototype.active=function(t){var e=a.getViews(this.context.view),n=this.getAssociationItems(e,t);r.each(n,(function(t){var e=t.active,n=t.element;e&&n.setState("active",!0)}))},e.prototype.selected=function(t){var e=a.getViews(this.context.view),n=this.getAssociationItems(e,t);r.each(n,(function(t){var e=t.active,n=t.element;e&&n.setState("selected",!0)}))},e.prototype.highlight=function(t){var e=a.getViews(this.context.view),n=this.getAssociationItems(e,t);r.each(n,(function(t){var e=t.inactive,n=t.element;e&&n.setState("inactive",!0)}))},e.prototype.reset=function(){var t=a.getViews(this.context.view);r.each(t,(function(t){s.clearHighlight(t)}))},e}(o.Action);o.registerAction("association",l),o.registerInteraction("association-active",{start:[{trigger:"element:mouseenter",action:"association:active"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]}),o.registerInteraction("association-selected",{start:[{trigger:"element:mouseenter",action:"association:selected"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]}),o.registerInteraction("association-highlight",{start:[{trigger:"element:mouseenter",action:"association:highlight"}],end:[{trigger:"element:mouseleave",action:"association:reset"}]}),o.registerInteraction("association-tooltip",{start:[{trigger:"element:mousemove",action:"association:showTooltip"}],end:[{trigger:"element:mouseleave",action:"association:hideTooltip"}]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clearHighlight=e.getElementValue=void 0;var i=n(0),r=n(2);e.getElementValue=function(t,e){var n=t.getModel().data;return i.isArray(n)?n[0][e]:n[e]},e.clearHighlight=function(t){var e=r.getAllElements(t);i.each(e,(function(t){t.hasState("active")&&t.setState("active",!1),t.hasState("selected")&&t.setState("selected",!1),t.hasState("inactive")&&t.setState("inactive",!1)}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Facet=void 0;var i=n(1),r=n(6),o=n(351),a=n(353),s=(n(354),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="area",e}return i.__extends(e,t),e.getDefaultOptions=function(){return a.DEFAULT_OPTIONS},e.prototype.getDefaultOptions=function(){return e.getDefaultOptions()},e.prototype.getSchemaAdaptor=function(){return o.adaptor},e}(r.Plot));e.Facet=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.adaptor=void 0;var i=n(1),r=n(0),o=n(10),a=n(27),s=n(2),l=n(147),c=n(352);function u(t){var e=t.chart,n=t.options,o=n.type,a=n.data,s=n.fields,u=n.eachView,h=r.omit(n,["type","data","fields","eachView","axes","meta","tooltip","coordinate","theme","legend","interactions","annotations"]);return e.data(a),e.facet(o,i.__assign(i.__assign({},h),{fields:s,eachView:function(t,e){var n=u(t,e);if(n.geometries)c.execViewAdaptor(t,n);else{var i=n,r=i.options;r.tooltip&&t.interaction("tooltip"),l.execPlotAdaptor(i.type,t,r)}}})),t}function h(t){var e=t.chart,n=t.options,o=n.axes,l=n.meta,c=n.tooltip,u=n.coordinate,h=n.theme,f=n.legend,p=n.interactions,d=n.annotations,g={};return o&&r.each(o,(function(t,e){g[e]=s.pick(t,a.AXIS_META_CONFIG_KEYS)})),g=s.deepAssign({},l,g),e.scale(g),e.coordinate(u),o?r.each(o,(function(t,n){e.axis(n,t)})):e.axis(!1),c?(e.interaction("tooltip"),e.tooltip(c)):!1===c&&e.removeInteraction("tooltip"),e.legend(f),h&&e.theme(h),r.each(p,(function(t){!1===t.enable?e.removeInteraction(t.type):e.interaction(t.type,t.cfg)})),r.each(d,(function(t){e.annotation()[t.type](i.__assign({},t))})),t}e.adaptor=function(t){return s.flow(o.theme,u,h)(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.execViewAdaptor=void 0;var i=n(1),r=n(0),o=n(20),a=n(27),s=n(2);e.execViewAdaptor=function(t,e){var n=e.data,l=e.coordinate,c=e.interactions,u=e.annotations,h=e.animation,f=e.tooltip,p=e.axes,d=e.meta,g=e.geometries;n&&t.data(n);var y={};p&&r.each(p,(function(t,e){y[e]=s.pick(t,a.AXIS_META_CONFIG_KEYS)})),y=s.deepAssign({},d,y),t.scale(y),l&&t.coordinate(l),!1===p?t.axis(!1):r.each(p,(function(e,n){t.axis(n,e)})),r.each(g,(function(e){var n=o.geometry({chart:t,options:e}).ext,i=e.adjust;i&&n.geometry.adjust(i)})),r.each(c,(function(e){!1===e.enable?t.removeInteraction(e.type):t.interaction(e.type,e.cfg)})),r.each(u,(function(e){t.annotation()[e.type](i.__assign({},e))})),s.addViewAnimation(t,h),f?(t.interaction("tooltip"),t.tooltip(f)):!1===f&&t.removeInteraction("tooltip")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_OPTIONS=void 0,e.DEFAULT_OPTIONS={title:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},rowTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}},columnTitle:{style:{fontSize:12,fill:"rgba(0,0,0,0.65)"}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lab=e.notice=e.Stage=void 0;var i,r=n(71);function o(t,e){console.warn(t===i.DEV?"Plot '"+e+"' is in DEV stage, just give us issues.":t===i.BETA?"Plot '"+e+"' is in BETA stage, DO NOT use it in production env.":t===i.STABLE?"Plot '"+e+"' is in STABLE stage, import it by \"import { "+e+" } from '@antv/g2plot'\".":"invalid Stage type.")}!function(t){t.DEV="DEV",t.BETA="BETA",t.STABLE="STABLE"}(i=e.Stage||(e.Stage={})),e.notice=o;var a=function(){function t(){}return Object.defineProperty(t,"MultiView",{get:function(){return o(i.STABLE,"MultiView"),r.Mix},enumerable:!1,configurable:!0}),t}();e.Lab=a}])})); \ No newline at end of file diff --git a/data/imgs/bg-anemo.jpg b/data/imgs/bg-anemo.jpg new file mode 100644 index 0000000..985a7d4 Binary files /dev/null and b/data/imgs/bg-anemo.jpg differ diff --git a/data/imgs/bg-cryo.jpg b/data/imgs/bg-cryo.jpg new file mode 100644 index 0000000..cf4bd1d Binary files /dev/null and b/data/imgs/bg-cryo.jpg differ diff --git a/data/imgs/bg-dendro.jpg b/data/imgs/bg-dendro.jpg new file mode 100644 index 0000000..b900d28 Binary files /dev/null and b/data/imgs/bg-dendro.jpg differ diff --git a/data/imgs/bg-electro.jpg b/data/imgs/bg-electro.jpg new file mode 100644 index 0000000..5dec746 Binary files /dev/null and b/data/imgs/bg-electro.jpg differ diff --git a/data/imgs/bg-geo.jpg b/data/imgs/bg-geo.jpg new file mode 100644 index 0000000..d68405f Binary files /dev/null and b/data/imgs/bg-geo.jpg differ diff --git a/data/imgs/bg-hydro.jpg b/data/imgs/bg-hydro.jpg new file mode 100644 index 0000000..cc262f7 Binary files /dev/null and b/data/imgs/bg-hydro.jpg differ diff --git a/data/imgs/bg-pyro.jpg b/data/imgs/bg-pyro.jpg new file mode 100644 index 0000000..302d612 Binary files /dev/null and b/data/imgs/bg-pyro.jpg differ diff --git a/data/imgs/talent-anemo.png b/data/imgs/talent-anemo.png new file mode 100644 index 0000000..e9926f2 Binary files /dev/null and b/data/imgs/talent-anemo.png differ diff --git a/data/imgs/talent-cryo.png b/data/imgs/talent-cryo.png new file mode 100644 index 0000000..2defb36 Binary files /dev/null and b/data/imgs/talent-cryo.png differ diff --git a/data/imgs/talent-dendro.png b/data/imgs/talent-dendro.png new file mode 100644 index 0000000..2359d71 Binary files /dev/null and b/data/imgs/talent-dendro.png differ diff --git a/data/imgs/talent-electro.png b/data/imgs/talent-electro.png new file mode 100644 index 0000000..8e3c59d Binary files /dev/null and b/data/imgs/talent-electro.png differ diff --git a/data/imgs/talent-geo.png b/data/imgs/talent-geo.png new file mode 100644 index 0000000..87d7d0d Binary files /dev/null and b/data/imgs/talent-geo.png differ diff --git a/data/imgs/talent-hydro.png b/data/imgs/talent-hydro.png new file mode 100644 index 0000000..9408117 Binary files /dev/null and b/data/imgs/talent-hydro.png differ diff --git a/data/imgs/talent-pyro.png b/data/imgs/talent-pyro.png new file mode 100644 index 0000000..3349fde Binary files /dev/null and b/data/imgs/talent-pyro.png differ diff --git a/data/panel-0.2.7.css b/data/panel-0.2.7.css new file mode 100644 index 0000000..3677096 --- /dev/null +++ b/data/panel-0.2.7.css @@ -0,0 +1,1114 @@ +:root { + --charRarity5: rgba(200, 124, 36, 0.68); + --charRarity4: rgba(148, 112, 187, 0.68); + --itemRarity5: #C87C24; + --itemRarity4: #9470BB; + --itemRarity3: #5987AD; + --itemRarity2: #5A977A; + --itemRarity1: #818486; + --elemPyro: #FF9999; + --elemHydro: #80C0FF; + --elemAnemo: #80FFD7; + --elemElectro: #FFACFF; + --elemDendro: #99FF88; + --elemCryo: #99FFFF; + --elemGeo: #FFE699; + --weaponAffix5: #DEAF39; + --weaponAffix4: #C539DE; + --weaponAffix3: #396CDE; + --weaponAffix2: #51B72F; + --weaponAffix1: #A3A3A3; + --artiMark4: #FF5722; + --artiMark3: #FFE699; + --artiMark2: #D699FF; + --artiMark1: #FFFFFF; + --ambrLight: rgb(233, 229, 220); + --ambrDeep: rgb(74, 83, 102); + --artiBg: rgba(46, 53, 62, .68); + --tableBg: #2e353e; +} + +@font-face { + font-family: "PanelFont"; + src: url(./font/HYWH-65W.ttf); + font-weight: 400; + font-style: normal +} + +@font-face { + font-family: "PanelNumFont"; + src: url(./font/tttgbnumber.ttf); + font-weight: 400; + font-style: normal +} + +body { + overflow: overlay; + margin: 0px; +} + +#container { + width: 960px; + height: auto; + min-height: 720px; + font-family: "PanelFont"; + background-repeat: no-repeat; + background-position: center 0%; + background-size: auto 100%; + position: absolute; + top: 0; + left: 0; +} + +#container.火 { + background-image: url(./imgs/bg-pyro.jpg); +} + +#container.火 div.TopRightBlur { + background-color: rgba(var(--elemPyro), 0.25); +} + +#container.火 div.TopRightBlur>ul.PropPanel { + border-color: var(--elemPyro); +} + +#container.火 div.AvatarCons>div.cons, +#container.火 div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-image: url(./imgs/talent-pyro.png); +} + +#container.水 { + background-image: url(./imgs/bg-hydro.jpg); +} + +#container.水 div.TopRightBlur { + background-color: rgba(var(--elemHydro), 0.25); +} + +#container.水 div.TopRightBlur>ul.PropPanel { + border-color: var(--elemHydro); +} + +#container.水 div.AvatarCons>div.cons, +#container.水 div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-image: url(./imgs/talent-hydro.png); +} + +#container.风 { + background-image: url(./imgs/bg-anemo.jpg); +} + +#container.风 div.TopRightBlur { + background-color: rgba(var(--elemAnemo), 0.25); +} + +#container.风 div.TopRightBlur>ul.PropPanel { + border-color: var(--elemAnemo); +} + +#container.风 div.AvatarCons>div.cons, +#container.风 div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-image: url(./imgs/talent-anemo.png); +} + +#container.雷 { + background-image: url(./imgs/bg-electro.jpg); +} + +#container.雷 div.TopRightBlur { + background-color: rgba(var(--elemElectro), 0.25); +} + +#container.雷 div.TopRightBlur>ul.PropPanel { + border-color: var(--elemElectro); +} + +#container.雷 div.AvatarCons>div.cons, +#container.雷 div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-image: url(./imgs/talent-electro.png); +} + +#container.草 { + background-image: url(./imgs/bg-dendro.jpg); +} + +#container.草 div.TopRightBlur { + background-color: rgba(var(--elemDendro), 0.25); +} + +#container.草 div.TopRightBlur>ul.PropPanel { + border-color: var(--elemDendro); +} + +#container.草 div.AvatarCons>div.cons, +#container.草 div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-image: url(./imgs/talent-dendro.png); +} + +#container.冰 { + background-image: url(./imgs/bg-cryo.jpg); +} + +#container.冰 div.TopRightBlur { + background-color: rgba(var(--elemCryo), 0.25); +} + +#container.冰 div.TopRightBlur>ul.PropPanel { + border-color: var(--elemCryo); +} + +#container.冰 div.AvatarCons>div.cons, +#container.冰 div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-image: url(./imgs/talent-cryo.png); +} + +#container.岩 { + background-image: url(./imgs/bg-geo.jpg); +} + +#container.岩 div.TopRightBlur { + background-color: rgba(var(--elemGeo), 0.25); +} + +#container.岩 div.TopRightBlur>ul.PropPanel { + border-color: var(--elemGeo); +} + +#container.岩 div.AvatarCons>div.cons, +#container.岩 div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-image: url(./imgs/talent-geo.png); +} + +img.UIGachaAvatarImg { + position: absolute; + width: 1440px; + height: 720px; + right: 0px; + top: 0px +} + +div.UID { + position: absolute; + top: 20px; + left: 20px; + font-size: 32px; + font-weight: 700; + height: 35px; + line-height: 35px; + text-shadow: 0 0 3px #d3bc8e, 2px 2px 4px rgb(0 0 0 / 70%); + color: #fff; + opacity: .68; +} + +div.UID::before { + content: "UID"; + padding-right: 5px; +} + +div.AvatarLevel { + position: absolute; + width: 120px; + height: 100px; + right: 500px; + top: 530px +} + +div.AvatarLevel>div { + align-items: flex-start; + display: flex; + height: 50px; + justify-content: center; + min-width: 120px; +} + +div.AvatarLevel>div>div { + font-size: 24px; + font-weight: 700; + font-style: normal; + height: 50px; + letter-spacing: 0; + line-height: normal; + text-shadow: 3px 5px 4px #333333ad; + color: #ffffff; + display: flex; + flex-direction: column; + justify-content: center; +} + +div.AvatarLevel>div.exp { + border-radius: 20px 0px 0px 0px; +} + +div.AvatarLevel>div.exp.r5 { + background-color: var(--charRarity5); +} + +div.AvatarLevel>div.exp.r4 { + background-color: var(--charRarity4); +} + +div.AvatarLevel>div.fetter { + background-color: #ff5722ad; + border-radius: 0px 0px 20px 0px; +} + +div.AvatarCons { + position: absolute; + width: 452px; + height: 78px; + right: 494px; + top: 642px; + align-items: center; + display: flex; + gap: 4px; + min-width: 452px; +} + +div.AvatarCons>div.cons { + align-items: center; + background-position: 50% 50%; + background-size: cover; + display: flex; + height: 78px; + width: 72px; +} + +div.AvatarCons>div.cons.off { + filter: blur(2px); + opacity: 0.68; +} + +div.AvatarCons>div.cons>img.UITalentIcon { + height: 40px; + width: 40px; + object-fit: cover; + padding-left: 16px; +} + +div.TopRightBlur { + position: relative; + width: 480px; + height: 720px; + left: 480px; + top: 0px; + display: flex; + flex-direction: column; + align-items: center; + backdrop-filter: blur(10px) brightness(100%); + -webkit-backdrop-filter: blur(5px) brightness(100%); +} + +div.TopRightBlur>h1.AvatarTitle { + top: 30px; + color: #FFFFFF; + font-size: 36px; + font-weight: 700; + height: 60px; + width: 460px; + line-height: 60px; + letter-spacing: 0; + text-align: center; + text-shadow: + 2px 2px 0 rgba(0, 0, 0, 0.68), + -2px -2px 0 rgba(0, 0, 0, 0.68), + 2px -2px 0 rgba(0, 0, 0, 0.68), + -2px 2px 0 rgba(0, 0, 0, 0.68), + 2px 2px 0 rgba(0, 0, 0, 0.68); + margin-block-start: 25px; + margin-block-end: 10px; + margin-inline-start: 0px; + margin-inline-end: 0px; +} + +div.TopRightBlur>div.AvatarSkills { + align-items: center; + align-self: center; + display: flex; + gap: 28px; + width: 362px; +} + +div.TopRightBlur>div.AvatarSkills>div.skill { + height: 130px; + position: relative; + width: 102px; +} + +div.TopRightBlur>div.AvatarSkills>div.skill>div.element { + background-position: 50% 50%; + background-size: cover; + width: 102px; + height: 110px; + left: 0; + top: 0; + position: absolute; +} + +div.TopRightBlur>div.AvatarSkills>div.skill>img.UISkillIcon { + height: 50px; + width: 50px; + position: absolute; + top: 32px; + left: 26px; + object-fit: cover; +} + +div.TopRightBlur>div.AvatarSkills>div.skill>div.level { + align-items: center; + background-color: #ffffff; + border: 1px none; + border-radius: 10px; + box-shadow: 6px 6px 3px #00000040; + display: flex; + width: 50px; + height: 40px; + position: absolute; + left: 26px; + top: 90px; +} + +div.TopRightBlur>div.AvatarSkills>div.skill>div.level.extra { + color: #000000; + background-color: #45deff; +} + +div.TopRightBlur>div.AvatarSkills>div.skill>div.level>div { + color: rgba(0, 0, 0, 0.68); + font-size: 24px; + font-weight: 700; + width: 50px; + height: 40px; + line-height: 40px; + letter-spacing: 0; + display: flex; + flex-direction: column; + align-items: center; +} + +div.TopRightBlur>ul.PropPanel { + background-color: #33333399; + border: 2px dashed; + border-radius: 10px; + height: 440px; + width: 440px; + position: absolute; + bottom: 20px; + display: flex; + flex-direction: column; + justify-content: space-around; + list-style-type: none; + margin-block-start: unset; + margin-block-end: unset; + margin-inline-start: unset; + margin-inline-end: unset; + padding-inline-start: unset; +} + +div.TopRightBlur>ul.PropPanel>li { + color: #ffffff; + height: 50px; + font-size: 24px; + font-weight: 700; + text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.4); + display: flex; + flex-direction: row; + align-items: center; +} + +div.TopRightBlur>ul.PropPanel>li>span.weight { + width: 40px; + height: 24px; + position: absolute; + left: 20px; + color: #000000; + background-color: #ffffff; + font-size: 16px; + font-weight: 700; + border-radius: 5px; + text-shadow: none; + box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.4); + display: flex; + justify-content: center; + align-items: center; +} + +div.TopRightBlur>ul.PropPanel>li>span.weight.error { + color: #ffe699; + background-color: rgba(240, 6, 6, 0.7); +} + +div.TopRightBlur>ul.PropPanel>li>div { + position: absolute; + left: 80px; +} + +div.TopRightBlur>ul.PropPanel>li>span.value { + height: 15px; + line-height: 15px; + text-align: right; + position: absolute; + right: 55px; +} + +div.TopRightBlur>ul.PropPanel>li>span.value>div { + display: inline-flex; + font-size: 12px; + font-weight: 400; + opacity: 0.8; +} + +div.TopRightBlur>ul.PropPanel>li>span.value>div:last-child { + color: #90e800; +} + +div.TopRightBlur>ul.PropPanel>li>span.value>div:last-child::before { + content: "+"; +} + +div.AvatarEquips { + position: relative; + width: 900px; + min-height: 310px; + padding-bottom: 60px; + left: 30px; + top: 30px; + + align-items: center; + display: flex; + flex-wrap: wrap; + gap: 30px; +} + +div.AvatarEquips>div.item { + color: #ffffff; + align-items: center; + display: flex; + flex-direction: column; + width: 280px; + height: 310px; + border-radius: 15px; + border: none; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon, +div.AvatarEquips>div.item.arti { + background-color: var(--artiBg); + box-shadow: 0px 15px 15px rgb(0 0 0 / 40%); +} + +div.AvatarEquips>div.item:not(.arti) { + gap: 30px; +} + +div.AvatarEquips>div.item:not(.arti)>div { + width: 280px; + height: 135px; + background-color: var(--tableBg); + box-shadow: 0px 15px 15px rgb(0 0 0 / 40%); + border-radius: 15px; + border: none; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon { + height: 145px; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip { + color: var(--ambrLight); + font-size: 18px; + width: 280px; + position: relative; + top: 15px; + text-align: center; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip::before { + content: "你怎么不强化啊?"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.ACE², +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.ACE, +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.SSS { + color: #e85656; + font-weight: 700; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.SS, +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.S, +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.A { + color: #ffffff; + font-weight: 400; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.ACE²::before { + content: "晒吧,欧不可耻,只是可恨"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.ACE::before { + content: "达成成就:阳寿圣遗物"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.SSS::before { + content: "达成成就:高分圣遗物"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.SS::before { + content: "以普遍理性而论,很好"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.S::before { + content: "达成成就:合格圣遗物"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.A::before { + content: "嗯嗯好好好可以(敷衍"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.tip.B::before { + content: "抽卡有保底,圣遗物无下限"; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail { + font-size: 40px; + font-weight: 700; + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-evenly; + width: 280px; + height: 75px; + position: relative; + top: 20px; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div { + font-family: "PanelNumFont"; + color: var(--artiMark1); + width: 90px; + height: 65px; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.level.ACE², +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.level.ACE { + color: var(--artiMark4); +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.level.SSS, +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.level.SS { + color: var(--artiMark3); +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.level.S, +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.level.A { + color: var(--artiMark2); +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.level::after, +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.goal::after { + font-family: "PanelFont"; + content: "圣遗物评级"; + font-size: 18px; + font-weight: 400; + color: var(--ambrLight); + text-shadow: none; +} + +div.AvatarEquips>div.item:not(.arti)>div.mark>div.detail>div.goal::after { + content: "圣遗物评分"; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>img.UIWeaponIcon { + width: 145px; + height: 145px; + position: relative; + top: 0px; + left: 0px; + border-radius: 15px 0 0 15px; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.level, +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix { + width: 55px; + height: 30px; + font-size: 18px; + text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.4); + position: relative; + top: -150px; + left: 0px; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.level { + background-color: var(--itemRarity1); + border-radius: 15px 0 0 0; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.level::before { + content: "Lv."; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.level.r5 { + background-color: var(--itemRarity5); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.level.r4 { + background-color: var(--itemRarity4); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.level.r3 { + background-color: var(--itemRarity3); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.level.r2 { + background-color: var(--itemRarity2); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix { + background-color: var(--weaponAffix1); + border-radius: 0 0 15px 0; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix::before { + content: "精"; + padding-right: 5px; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix.a5 { + background-color: var(--weaponAffix5); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix.a4 { + background-color: var(--weaponAffix4); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix.a3 { + background-color: var(--weaponAffix3); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix.a2 { + background-color: var(--weaponAffix2); +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.affix.a1 { + opacity: 0; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon:has(div.affix.a1)>div.level { + border-bottom-right-radius: 15px; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.name, +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.prop { + font-size: 25px; + font-weight: 700; + width: 180px; + height: 32px; + position: relative; + top: -195px; + right: -80px; + text-align: right; +} + +div.AvatarEquips>div.item:not(.arti)>div.weapon>div.prop { + color: var(--ambrLight); + font-size: 18px; + font-weight: normal; + top: -170px; +} + +div.AvatarEquips>div.item.arti>img.UIRelicIcon { + width: 90px; + height: 90px; + position: relative; + left: -95px; + border-radius: 15px 0 15px 0; + background-color: var(--itemRarity1); + background-image: linear-gradient(136deg, rgba(49, 43, 71, .5294117647058824), transparent); +} + +div.AvatarEquips>div.item.arti>img.UIRelicIcon.r5 { + background-color: var(--itemRarity5); +} + +div.AvatarEquips>div.item.arti>img.UIRelicIcon.r4 { + background-color: var(--itemRarity4); +} + +div.AvatarEquips>div.item.arti>img.UIRelicIcon.r3 { + background-color: var(--itemRarity3); +} + +div.AvatarEquips>div.item.arti>img.UIRelicIcon.r2 { + background-color: var(--itemRarity2); +} + +div.AvatarEquips>div.item.arti>div.level { + width: 90px; + min-height: 30px; + position: relative; + top: -15px; + left: -95px; + font-size: 18px; + color: rgb(74, 83, 102); + background-color: rgb(233, 229, 220); + border-bottom-right-radius: 15px; + display: flex; + justify-content: center; + align-items: center; +} + +div.AvatarEquips>div.item.arti>div.level::before { + content: "Lv."; +} + +div.AvatarEquips>div.item.arti>div.title { + min-height: 100px; + width: 175px; + display: flex; + flex-direction: column; + align-content: flex-start; + justify-content: flex-end; + align-items: center; + position: relative; + top: -120px; + left: 45px; + color: #ffffff; + font-size: 25px; + font-weight: 700; +} + +div.AvatarEquips>div.item.arti>div.title>div.mark { + font-family: "PanelNumFont"; + font-size: 32px; + color: var(--artiMark1); + margin-top: 10px; +} + +div.AvatarEquips>div.item.arti>div.title>div.mark.ACE², +div.AvatarEquips>div.item.arti>div.title>div.mark.ACE { + color: var(--artiMark4); +} + +div.AvatarEquips>div.item.arti>div.title>div.mark.SSS, +div.AvatarEquips>div.item.arti>div.title>div.mark.SS { + color: var(--artiMark3); +} + +div.AvatarEquips>div.item.arti>div.title>div.mark.S, +div.AvatarEquips>div.item.arti>div.title>div.mark.A { + color: var(--artiMark2); +} + +div.AvatarEquips>div.item.arti>ul.affix { + min-height: 155px; + width: 250px; + position: relative; + bottom: 105px; + display: flex; + flex-direction: column; + justify-content: space-evenly; + list-style-type: none; + margin-block-start: unset; + margin-block-end: unset; + margin-inline-start: unset; + margin-inline-end: unset; + padding-inline-start: unset; +} + +div.AvatarEquips>div.item.arti>ul.affix>li { + font-size: 18px; + font-weight: 400; + text-shadow: 3px 3px 3px rgb(0 0 0 / 40%); + display: flex; + flex-direction: row; + align-items: center; +} + +div.AvatarEquips>div.item.arti>ul.affix>li.main { + font-size: 18px; + font-weight: 700; + text-shadow: 5px 5px 5px rgb(0 0 0 / 68%); +} + +div.AvatarEquips>div.item.arti>ul.affix>li.sub.unuse { + color: #aaaaaa; + text-shadow: none; +} + +div.AvatarEquips>div.item.arti>ul.affix>li.sub.use { + color: #ffffff; + text-shadow: none; +} + +div.AvatarEquips>div.item.arti>ul.affix>li.sub.great { + color: var(--artiMark3); + text-shadow: none; +} + +div.AvatarEquips>div.item.arti>ul.affix>li>div.key { + width: 110px; +} + +div.AvatarEquips>div.item.arti>ul.affix>li>div.value, +div.AvatarEquips>div.item.arti>ul.affix>li>div.goal { + width: 70px; + text-align: left; +} + +div.AvatarEquips>div.item.arti>ul.affix>li>div.goal { + text-align: right; + font-size: small; + opacity: 0.68; +} + +div.AvatarEquips>div.item.arti>ul.affix>li>div.value::before { + content: "+"; + padding-right: 2px; +} + +div.AvatarEquips>div.item.arti>ul.affix>li>div.value.pct::after { + content: "%"; +} + +div.AvatarEquips>div.item.arti>ul.affix>li>div.goal::after { + content: "分"; + padding-left: 3px; +} + +div.AvatarEquips>div.item.arti>div.note { + width: 280px; + min-height: 35px; + font-size: 16px; + position: relative; + top: -100px; + display: flex; + align-items: center; + align-content: center; + justify-content: space-between; + flex-direction: row; +} + +div.AvatarEquips>div.item.arti>div.note>div { + width: 40px; + height: 35px; + background-color: #ff5652; + border-radius: 0 15px 0 15px; + display: flex; + align-items: center; + justify-content: center; +} + +div.AvatarEquips>div.item.arti>div.note>div.nohit::before { + content: "歪"; + padding-right: 3px; + font-size: 10px; +} + +div.AvatarEquips>div.item.arti>div.note>div.nohit::after { + content: "次"; + padding-left: 3px; + font-size: 10px; +} + +div.AvatarEquips>div.item.arti>div.note>div.calc { + width: auto; + min-width: 130px; + background-color: var(--tableBg); + border-radius: 15px 0 15px 0; +} + +div.AvatarEquips>div.item.arti>div.note>div.calc>div { + display: flex; + align-items: center; + justify-content: center; +} + +div.AvatarEquips>div.item.arti>div.note>div.calc>div.main { + width: 110px; +} + +div.AvatarEquips>div.item.arti>div.note>div.calc>div.total { + width: 130px; +} + +div.AvatarEquips>div.item.arti>div.note:not(:has(div.nohit))>div.calc { + position: relative; + right: -150px; +} + +div.AvatarEquips>div.item.arti>div.note:not(:has(div.nohit)):has(div.main)>div.calc { + position: relative; + right: -40px; +} + +div.AvatarEquips>div.item.arti>div.note>div.calc>div.main::before { + content: "主词条・"; + font-size: 10px; +} + +div.AvatarEquips>div.item.arti>div.note>div.calc>div.total::before { + content: "总分对齐・"; + font-size: 10px; +} + +div.AvatarEquips>div.item.arti>div.note>div.calc>div.main::after, +div.AvatarEquips>div.item.arti>div.note>div.calc>div.total::after { + content: "%"; +} + +ul.AvatarDamage, +ul.AvatarBuffs { + height: auto; + min-height: 90px; + width: 900px; + border-radius: 15px; + background-color: var(--tableBg); + box-shadow: 0px 15px 15px rgb(0 0 0 / 40%); + position: relative; + top: 0px; + left: 30px; + display: flex; + flex-direction: column; + justify-content: space-evenly; + list-style-type: none; + margin-block-start: unset; + margin-block-end: 30px; + margin-inline-start: unset; + margin-inline-end: unset; + padding-inline-start: unset; +} + +ul.AvatarDamage>li, +ul.AvatarBuffs>li { + color: #ffffff; + height: auto; + min-height: 40px; + padding-left: 25px; + font-size: 20px; + font-weight: 400; + display: flex; + flex-direction: row; + align-items: stretch; + border-bottom: 2px solid rgba(255 255 255 / 20%); +} + +ul.AvatarDamage>li:last-child, +ul.AvatarBuffs>li:last-child { + border-bottom: none; +} + +ul.AvatarDamage>li.title, +ul.AvatarBuffs>li.title { + height: 50px; + font-size: 25px; + font-weight: 700; + padding-left: 15px; + display: flex; + align-items: center; +} + +ul.AvatarDamage>li.title::after, +ul.AvatarBuffs>li.title::after { + font-size: 18px; + font-weight: 400; + opacity: 0.68; + color: var(--ambrLight); + padding-left: 20px; +} + +ul.AvatarDamage>li>div, +ul.AvatarBuffs>li>div { + color: var(--ambrLight); + height: auto; + min-height: 25px; + padding: 0.4em; + display: flex; + flex: 1; + align-items: center; + justify-content: center; +} + +ul.AvatarDamage>li>div:first-child, +ul.AvatarBuffs>li>div:first-child { + color: #ffffff; + text-align: right; + justify-content: flex-end; + padding-right: 20px; +} + +ul.AvatarDamage>li>div:not(:last-child), +ul.AvatarBuffs>li>div:not(:last-child) { + border-right: 2px solid rgba(255 255 255 / 20%); +} + +ul.AvatarDamage>li.title { + font-family: "PanelNumFont"; +} + +ul.AvatarDamage>li.title::before { + content: "伤害计算・评级"; + font-family: "PanelFont"; + padding-right: 15px; +} + +ul.AvatarDamage>li.title::after { + content: "伤害以 86 级怪物为基准,等级不同数值有微小偏差"; + font-family: "PanelFont"; +} + +ul.AvatarDamage>li>div:first-child { + width: 308px; +} + +ul.AvatarDamage>li>div:not(:first-child) { + width: 270px; +} + + +ul.AvatarDamage>li:nth-child(2)>div:first-child::before { + content: "伤害类型"; + color: #ffffff; +} + +ul.AvatarDamage>li:nth-child(2)>div:nth-child(2)::before { + content: "暴击伤害"; + color: #ffffff; +} + +ul.AvatarDamage>li:nth-child(2)>div:last-child::before { + content: "期望伤害"; + color: #ffffff; +} + +ul.AvatarBuffs>li>div:first-child { + max-width: 270px; +} + +ul.AvatarBuffs>li.title::before { + content: "Buff 列表"; +} + +ul.AvatarBuffs>li.title::after { + content: "部分 Buff 的触发条件以及层数可能影响实际伤害结果"; +} + +div.copyright { + color: #ffffff; + opacity: 0.68; + text-shadow: 3px 5px 4px #333333ad; + font-size: 20px; + width: 960px; + text-align: center; + padding-bottom: 20px; +} + +div.copyright::before { + content: "Data from Enka.Network × Powered by NoneBot2 × Inspired by Miao-Plugin"; +} \ No newline at end of file diff --git a/data/panel-0.2.7.html b/data/panel-0.2.7.html new file mode 100644 index 0000000..1ed129c --- /dev/null +++ b/data/panel-0.2.7.html @@ -0,0 +1,137 @@ + + + + + + + + Document + + +
    + +
    {{ uid }}
    +
    +
    等级 {{ data["level"] }}
    +
    好感 {{ data["fetter"] }}
    +
    +
    + {% for con in data["consts"] %} +
    + {% endfor %} +
    +
    +

    {{ data["slogan"] }}·{{ data["name"] }}

    +
    + {% for sKey, sValue in data["skills"].items() %} +
    +
    + +
    {{ sValue['level'] }}
    +
    + {% endfor %} +
    +
      + {% for pKey, prop in data["fightProp"].items() %} +
    • + {% if prop["weight"] %} + {{ prop["weight"] }} + {% endif %} +
      {{ pKey }}
      + {{ prop["value"] }} + {% if prop.get('detail', '') %} +
      {{ prop["detail"][0] }}
      {{ prop["detail"][1] }}
      + {% endif %} +
      +
    • + {% endfor %} +
    +
    +
    +
    +
    +
    +
    +
    {{ data["relicCalc"]["rank"] }}
    +
    {{ data["relicCalc"]["total"] }}
    +
    +
    +
    + +
    {{ data["weapon"]["level"] }}
    +
    {{ data["weapon"]["affix"] }}
    +
    {{ data["weapon"]["name"] }}
    +
    基础攻击力 {{ data["weapon"]["main"] }}
    +
    {{ data["weapon"]["sub"]["prop"] }} {{ data["weapon"]["sub"]["value"] }}
    +
    +
    + {% for arti in data["relics"] %} +
    + +
    {{ arti["level"] }}
    +
    +
    {{ arti["name"] }}
    +
    {{ arti["calc"]["total"] }} - {{ arti["calc"]['rank'] }}
    +
    +
      +
    • +
      {{ arti["main"]["prop"] }}
      +
      {{ arti["main"]["value"] }}
      +
      {{ arti["calc"]["main"] }}
      +
    • + + {% for sub in arti["sub"] %} +
    • +
      {{ sub["prop"] }}
      +
      {{ sub["value"] }}
      +
      {{ arti["calc"]["sub"][loop.index0]["goal"] }}
      +
    • + {% endfor %} +
    +
    + {% if arti["calc"]["nohit"] %} +
    {{ arti["calc"]["nohit"] }}
    + {% endif %} +
    + {% if arti["pos"] >= 3 %} +
    {{ arti["calc"]["main_pct"] }}
    + {% endif %} +
    {{ arti["calc"]["total_pct"] }}
    +
    +
    +
    + {% endfor %} +
    + {% if data["damage"] %} +
      +
    • {{ data["damage"]["level"] }}
    • +
    • + +
      +
      +
      +
    • + {% for dmg in data["damage"]["data"] %} +
    • +
      {{ dmg[0] }}
      +
      {{ dmg[1] }}
      +
      {{ dmg[2] }}
      +
    • + {% endfor %} +
    + {% if data["damage"]["buff"] %} +
      +
    • + {% for buff in data["damage"]["buff"] %} +
    • +
      {{ buff[0] }}
      +
      {{ buff[1] }}
      +
    • + {% endfor %} +
    + {% endif %} + {% endif %} + +
    + + \ No newline at end of file diff --git a/defs/browser.py b/defs/browser.py new file mode 100644 index 0000000..792ba9d --- /dev/null +++ b/defs/browser.py @@ -0,0 +1,166 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +@Author : yanyongyu +@Date : 2021-03-12 13:42:43 +@LastEditors : yanyongyu +@LastEditTime : 2021-11-01 14:05:41 +@Description : None +@GitHub : https://github.com/yanyongyu +""" +__author__ = "yanyongyu" + +import asyncio +import platform +import jinja2 +from contextlib import asynccontextmanager +from os import getcwd +from typing import Optional, AsyncIterator, Literal, Union +from playwright.async_api import Page, Browser, async_playwright, Error +from ci import logger +from uvicorn.loops import asyncio as _asyncio +from uvicorn import config + + +def asyncio_setup(): + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + + +@property +def should_reload(self): + return False + + +if platform.system() == "Windows": + _asyncio.asyncio_setup = asyncio_setup + config.Config.should_reload = should_reload + logger.warning("检测到当前为 Windows 系统,已自动注入猴子补丁") + +_browser: Optional[Browser] = None +_playwright = None + + +async def init(**kwargs) -> Browser: + global _browser + global _playwright + _playwright = await async_playwright().start() + try: + _browser = await launch_browser(**kwargs) + except Error: + await install_browser() + _browser = await launch_browser(**kwargs) + return _browser + + +async def launch_browser(**kwargs) -> Browser: + return await _playwright.chromium.launch(**kwargs) + + +async def get_browser(**kwargs) -> Browser: + return _browser or await init(**kwargs) + + +@asynccontextmanager +async def get_new_page(**kwargs) -> AsyncIterator[Page]: + browser = await get_browser() + page = await browser.new_page(**kwargs) + try: + yield page + finally: + await page.close() + + +async def shutdown_browser(): + await _browser.close() + await _playwright.stop() + + +async def install_browser(): + logger.info("正在安装 chromium") + import sys + from playwright.__main__ import main + + sys.argv = ["", "install", "chromium"] + try: + main() + except SystemExit: + pass + + +async def html_to_pic( + html: str, + wait: int = 0, + template_path: str = f"file://{getcwd()}", + type: Literal["jpeg", "png"] = "png", + quality: Union[int, None] = None, + **kwargs, +) -> bytes: + """html转图片 + Args: + html (str): html文本 + wait (int, optional): 等待时间. Defaults to 0. + template_path (str, optional): 模板路径 如 "file:///path/to/template/" + type (Literal["jpeg", "png"]): 图片类型, 默认 png + quality (int, optional): 图片质量 0-100 当为`png`时无效 + **kwargs: 传入 page 的参数 + Returns: + bytes: 图片, 可直接发送 + """ + # logger.debug(f"html:\n{html}") + if "file:" not in template_path: + raise Exception("template_path 应该为 file:///path/to/template") + async with get_new_page(**kwargs) as page: + await page.goto(template_path) + await page.set_content(html, wait_until="networkidle") + await page.wait_for_timeout(wait) + img_raw = await page.screenshot( + full_page=True, + type=type, + quality=quality, + ) + return img_raw + + +async def template_to_pic( + template_path: str, + template_name: str, + templates: dict, + pages=None, + wait: int = 0, + type: Literal["jpeg", "png"] = "png", + quality: Union[int, None] = None, +) -> bytes: + """使用jinja2模板引擎通过html生成图片 + Args: + template_path (str): 模板路径 + template_name (str): 模板名 + templates (dict): 模板内参数 如: {"name": "abc"} + pages (dict): 网页参数 Defaults to + {"base_url": f"file://{getcwd()}", "viewport": {"width": 500, "height": 10}} + wait (int, optional): 网页载入等待时间. Defaults to 0. + type (Literal["jpeg", "png"]): 图片类型, 默认 png + quality (int, optional): 图片质量 0-100 当为`png`时无效 + Returns: + bytes: 图片 可直接发送 + """ + + if pages is None: + pages = { + "viewport": {"width": 500, "height": 10}, + "base_url": f"file://{getcwd()}", + } + template_env = jinja2.Environment( + loader=jinja2.FileSystemLoader(template_path), + enable_async=True, + ) + template = template_env.get_template(template_name) + + return await html_to_pic( + template_path=f"file://{template_path}", + html=await template.render_async(**templates), + wait=wait, + type=type, + quality=quality, + **pages, + ) diff --git a/defs/models.py b/defs/models.py new file mode 100644 index 0000000..d2f61cd --- /dev/null +++ b/defs/models.py @@ -0,0 +1,15 @@ +from typing import List + +from pydantic import BaseModel + + +class Char(BaseModel): + name: str + file_id: str + time: int + + +class Player(BaseModel): + name: str = "" + time: int = 0 + all_char: List[Char] = [] diff --git a/defs/player.py b/defs/player.py index 08162a0..efd5200 100644 --- a/defs/player.py +++ b/defs/player.py @@ -2,102 +2,106 @@ import json import time from datetime import datetime +from io import BytesIO from os.path import exists from typing import List from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup -from ci import channel_id, app, sqlite +from ci import channel_id, app, sqlite, lock +from defs.models import Char as CharModel, Player as PlayerModel from gspanel.__utils__ import LOCAL_DIR -from gspanel.data_source import getRawData, getPanelMsg +from gspanel.data_source import getPanel, getAvatarData -def gen_char_dict(name: str, file_id: str) -> dict: - return {"name": name, "file_id": file_id, "time": int(time.time())} +def gen_char_dict(name: str, file_id: str) -> CharModel: + return CharModel(name=name, file_id=file_id, time=int(time.time())) class Player: - name: str = "" - uid: str = "" - all_char: List[dict] = [] - time: int = 0 + uid: str = "0" + _player: PlayerModel def __init__(self, uid: str): self.uid = uid - self.time = 0 - self.all_char = [] - if not exists(LOCAL_DIR / "cache" / f"{uid}__data.json"): - return - with open(LOCAL_DIR / "cache" / f"{uid}__data.json", "r", encoding="utf-8") as fp: + self.cache_path = LOCAL_DIR / "cache" / f"{uid}.json" + sources = sqlite.get(self.uid, None) + if sources: + self._player = PlayerModel.parse_raw(sources) + else: + self._player = PlayerModel(name=self.get_name_from_cache(), time=0, all_char=[]) + + def get_name_from_cache(self) -> str: + if not exists(self.cache_path): + return "unknown" + with open(self.cache_path, "r", encoding="utf-8") as fp: data = json.load(fp) - self.name = data.get("playerInfo", {}).get("nickname", "") + return data.get("playerInfo", {}).get("nickname", "") - def update_name(self): - with open(LOCAL_DIR / "cache" / f"{self.uid}__data.json", "r", encoding="utf-8") as fp: - data = json.load(fp) - self.name = data.get("playerInfo", {}).get("nickname", "") + def update_name(self) -> None: + self._player.name = self.get_name_from_cache() - @staticmethod - def can_refresh(): - return sqlite.get("can_refresh", True) + @property + def name(self) -> str: + return self._player.name - @staticmethod - def lock(): - sqlite["can_refresh"] = False + @property + def time(self) -> int: + return self._player.time - @staticmethod - def unlock(): - sqlite["can_refresh"] = True + @property + def all_char(self) -> List[CharModel]: + return self._player.all_char + + def update_or_create(self, char: CharModel) -> None: + for i in self._player.all_char: + if i.name == char.name: + i.file_id = char.file_id + i.time = char.time + return + self._player.all_char.append(char) async def update_char(self): - if not self.can_refresh(): + if lock.locked(): return "有刷新任务正在运行,请稍等一会儿再试" - self.lock() + await lock.acquire() try: - all_char_ = await getRawData(self.uid) - all_char_ = all_char_.get("list", []) + all_char_ = await getAvatarData(self.uid) + all_char_ = [i["name"] for i in all_char_.get("avatars", [])] + success = [] + failed = [] for i in all_char_: - for f in self.all_char: - if f["name"] == i: - self.all_char.remove(f) - break try: - all_char = await getPanelMsg(self.uid, i) - img = all_char.get("pic", None) - error = all_char.get("error", None) - if img: - msg = await app.send_photo(channel_id, img) - self.all_char.append(gen_char_dict(i, msg.photo.file_id)) - elif error: - return error - else: - print(all_char) + rt = await getPanel(self.uid, i) + if isinstance(rt, bytes): + bytes_stream = BytesIO(rt) + bytes_stream.name = "avatar.png" + msg = await app.send_photo(channel_id, bytes_stream) + self.update_or_create(gen_char_dict(i, msg.photo.file_id)) + success.append(i) + elif isinstance(rt, str): + failed.append(i) except Exception as e: + failed.append(i) print(e) continue - return f"成功缓存了 UID{self.uid} 的{'、'.join(all_char_)}等 {len(all_char_)} 位角色数据!" + return f"缓存成功了 UID{self.uid} 的 {'、'.join(success)} {len(success)} 位角色数据!\n" \ + f"缓存失败了 {'、'.join(failed)} {len(failed)} 位角色数据!" except Exception as e: print(e) return "数据刷新失败,请重试" finally: - self.unlock() + lock.release() def export(self): - return {"name": self.name, "uid": self.uid, "time": int(time.time()), "all_char": self.all_char} - - def restore(self): - sources = sqlite.get(self.uid, None) - if sources: - self.name = sources.get("name", "") - self.time = sources.get("time", 0) - self.all_char = sources.get("all_char", []) + return self._player.json() def gen_keyboard(self) -> InlineKeyboardMarkup: data = [] temp_ = [] num = 0 - for i in self.all_char: - name = i.get("name", "") + for i in self._player.all_char: + name = i.name temp_.append(InlineKeyboardButton(name, callback_data=f"{self.uid}|{name}")) num += 1 if num == 3: @@ -116,9 +120,9 @@ class Player: return datetime.strftime(datetime.fromtimestamp(time_stamp), '%Y-%m-%d %H:%M:%S') def gen_all_char(self) -> str: - if not self.all_char: + if not self._player.all_char: return "" text = "缓存角色有:\n" - for i in self.all_char: - text += "🔸 " + i.get("name", "") + f" `{self.parse_time(i.get('time', time.time()))}`\n" + for i in self._player.all_char: + text += f"🔸 {i.name} `{self.parse_time(i.time)}`\n" return text diff --git a/defs/refresh.py b/defs/refresh.py index cdf1370..20d6ab7 100644 --- a/defs/refresh.py +++ b/defs/refresh.py @@ -5,15 +5,11 @@ import time async def refresh_player(uid: str, force=False) -> str: data = Player(uid) - data.restore() if not force and data.time + 60 * 5 > int(time.time()): return "刷新过快,请稍等一会儿再试" text = await data.update_char() if not text: return "数据刷新失败,请重试" - try: - data.update_name() - except FileNotFoundError: - return "数据刷新失败,请重试" + data.update_name() sqlite[uid] = data.export() return text diff --git a/gspanel/__utils__.py b/gspanel/__utils__.py index 850d837..f50f53b 100644 --- a/gspanel/__utils__.py +++ b/gspanel/__utils__.py @@ -1,12 +1,18 @@ import asyncio import json from pathlib import Path -from typing import Optional, Union +from re import IGNORECASE, findall, sub +from typing import List, Set, Tuple, Union -from httpx import AsyncClient -from playwright.async_api import Browser, async_playwright +from httpx import AsyncClient, Client -GROW_VALUE = { # 词条成长值 +from ci import logger + +# from nonebot import get_driver +# from nonebot.drivers import Driver +# from nonebot.log import logger + +GROW_VALUE = { # 理论最高档(4档)词条成长值 "暴击率": 3.89, "暴击伤害": 7.77, "元素精通": 23.31, @@ -18,13 +24,32 @@ GROW_VALUE = { # 词条成长值 "物理伤害加成": 7.288, "治疗加成": 4.487, } +SINGLE_VALUE = { # 用于计算词条数 + "暴击率": 3.3, + "暴击伤害": 6.6, + "元素精通": 19.75, + "生命值百分比": 4.975, + "攻击力百分比": 4.975, + "防御力百分比": 6.2, + "元素充能效率": 5.5, +} MAIN_AFFIXS = { # 可能的主词条 "3": "攻击力百分比,防御力百分比,生命值百分比,元素精通,元素充能效率".split(","), # EQUIP_SHOES "4": "攻击力百分比,防御力百分比,生命值百分比,元素精通,元素伤害加成,物理伤害加成".split(","), # EQUIP_RING "5": "攻击力百分比,防御力百分比,生命值百分比,元素精通,治疗加成,暴击率,暴击伤害".split(","), # EQUIP_DRESS } SUB_AFFIXS = "攻击力,攻击力百分比,防御力,防御力百分比,生命值,生命值百分比,元素精通,元素充能效率,暴击率,暴击伤害".split(",") -# STAR = {"QUALITY_ORANGE": 5, "QUALITY_PURPLE": 4} +RANK_MAP = [ + ["D", 10], + ["C", 16.5], + ["B", 23.1], + ["A", 29.7], + ["S", 36.3], + ["SS", 42.9], + ["SSS", 49.5], + ["ACE", 56.1], + ["ACE²", 66], +] ELEM = { "Fire": "火", "Water": "水", @@ -34,7 +59,13 @@ ELEM = { "Ice": "冰", "Rock": "岩", } -POS = ["EQUIP_BRACER", "EQUIP_NECKLACE", "EQUIP_SHOES", "EQUIP_RING", "EQUIP_DRESS"] +POS = { + "EQUIP_BRACER": "生之花", + "EQUIP_NECKLACE": "死之羽", + "EQUIP_SHOES": "时之沙", + "EQUIP_RING": "空之杯", + "EQUIP_DRESS": "理之冠", +} SKILL = {"1": "a", "2": "e", "9": "q"} DMG = { "40": "火", @@ -62,21 +93,66 @@ PROP = { "FIGHT_PROP_FIRE_ADD_HURT": "火元素伤害加成", "FIGHT_PROP_ELEC_ADD_HURT": "雷元素伤害加成", "FIGHT_PROP_WATER_ADD_HURT": "水元素伤害加成", + "FIGHT_PROP_GRASS_ADD_HURT": "草元素伤害加成", "FIGHT_PROP_WIND_ADD_HURT": "风元素伤害加成", "FIGHT_PROP_ICE_ADD_HURT": "冰元素伤害加成", "FIGHT_PROP_ROCK_ADD_HURT": "岩元素伤害加成", } -_browser: Optional[Browser] = None +# driver: Driver = get_driver() -EXPIRE_SEC = 60 * 5 -LOCAL_DIR = Path("resources") +# GSPANEL_ALIAS: Set[Union[str, Tuple[str, ...]]] = ( +# set(driver.config.gspanel_alias) +# if hasattr(driver.config, "gspanel_alias") +# else {"面板"} +# ) +LOCAL_DIR = ( + Path() / "data" +) +SCALE_FACTOR = ( + 1.0 +) +DOWNLOAD_MIRROR = ( + "https://enka.network/ui/" +) +if not LOCAL_DIR.exists(): + LOCAL_DIR.mkdir(parents=True, exist_ok=True) if not (LOCAL_DIR / "cache").exists(): (LOCAL_DIR / "cache").mkdir(parents=True, exist_ok=True) +if not (LOCAL_DIR / "qq-uid.json").exists(): + (LOCAL_DIR / "qq-uid.json").write_text("{}", encoding="UTF-8") +_client = Client(verify=False) +CALC_RULES = _client.get("https://cdn.monsterx.cn/bot/gspanel/calc-rule.json").json() +(LOCAL_DIR / "calc-rule.json").write_text( + json.dumps(CALC_RULES, ensure_ascii=False, indent=2), encoding="utf-8" +) +CHAR_DATA = _client.get("https://cdn.monsterx.cn/bot/gspanel/char-data.json").json() +(LOCAL_DIR / "char-data.json").write_text( + json.dumps(CHAR_DATA, ensure_ascii=False, indent=2), encoding="utf-8" +) +CHAR_ALIAS = _client.get("https://cdn.monsterx.cn/bot/gspanel/char-alias.json").json() +(LOCAL_DIR / "char-alias.json").write_text( + json.dumps(CHAR_ALIAS, ensure_ascii=False, indent=2), encoding="utf-8" +) +TEAM_ALIAS = _client.get("https://cdn.monsterx.cn/bot/gspanel/team-alias.json").json() +(LOCAL_DIR / "team-alias.json").write_text( + json.dumps(TEAM_ALIAS, ensure_ascii=False, indent=2), encoding="utf-8" +) +HASH_TRANS = _client.get("https://cdn.monsterx.cn/bot/gspanel/hash-trans.json").json() +(LOCAL_DIR / "hash-trans.json").write_text( + json.dumps(HASH_TRANS, ensure_ascii=False, indent=2), encoding="utf-8" +) +RELIC_APPEND = _client.get("https://cdn.monsterx.cn/bot/gspanel/relic-append.json").json() +(LOCAL_DIR / "relic-append.json").write_text( + json.dumps(RELIC_APPEND, ensure_ascii=False, indent=2), encoding="utf-8" +) +TPL_VERSION = "0.2.7" -def kStr(prop: str) -> str: +def kStr(prop: str, reverse: bool = False) -> str: """转换词条名称为简短形式""" + if reverse: + return prop.replace("充能", "元素充能").replace("伤加成", "元素伤害加成").replace("物理元素", "物理") return ( prop.replace("百分比", "") .replace("元素充能", "充能") @@ -87,42 +163,92 @@ def kStr(prop: str) -> str: def vStr(prop: str, value: Union[int, float]) -> str: """转换词条数值为字符串形式""" - if prop in {"生命值", "攻击力", "防御力", "元素精通"}: + if prop in ["生命值", "攻击力", "防御力", "元素精通"]: return str(value) else: - return f"{str(round(value, 1))}%" + return str(round(value, 1)) + "%" -async def initBrowser(**kwargs) -> Optional[Browser]: - global _browser - browser = await async_playwright().start() - try: - _browser = await browser.chromium.launch(**kwargs) - return _browser - except Exception as e: - print(f"启动 Chromium 发生错误 {type(e)}:{e}") - return None +def getServer(uid: str) -> str: + """获取指定 UID 所属服务器,返回如 ``cn_gf01``""" + if uid[0] == "5": + return "cn_qd01" + elif uid[0] == "6": + return "os_usa" + elif uid[0] == "7": + return "os_euro" + elif uid[0] == "8": + return "os_asia" + elif uid[0] == "9": + return "os_cht" + return "cn_gf01" -async def getBrowser(**kwargs) -> Optional[Browser]: - return _browser or await initBrowser(**kwargs) +async def formatInput(msg: str, qq: str, atqq: str = "") -> Tuple[str, str]: + """ + 输入消息中的 UID 与角色名格式化,应具备处理 ``msg`` 为空、包含中文或数字的能力。 + - 首个中文字符串捕获为角色名,若不包含则返回 ``all`` 请求角色面板列表数据 + - 首个数字字符串捕获为 UID,若不包含则返回 ``uidHelper()`` 根据绑定配置查找的 UID + + * ``param msg: str`` 输入消息,由 ``state["_prefix"]["command_arg"]`` 或 ``event.get_plaintext()`` 生成,可能包含 CQ 码 + * ``param qq: str`` 输入消息触发 QQ + * ``param atqq: str = ""`` 输入消息中首个 at 的 QQ + - ``return: Tuple[str, str]`` UID、角色名 + """ + uid, char, tmp = "", "", "" + group = findall( + r"[0-9]+|[\u4e00-\u9fa5]+|[a-z]+", sub(r"\[CQ:.*\]", "", msg), flags=IGNORECASE + ) + for s in group: + if s.isdigit(): + if len(s) == 9: + if not uid: + uid = s + else: + # 0人,1斗,97忍 + tmp = s + elif s.encode().isalpha(): + # dio娜,abd + tmp = s.lower() + elif not s.isdigit() and not char: + char = tmp + s + uid = uid or await uidHelper(atqq or qq) + char = await aliasWho(char or tmp or "全部") + return uid, char + + +async def formatTeam(msg: str, qq: str, atqq: str = "") -> Tuple[str, List]: + """ + 输入消息中的 UID 与队伍角色名格式化 + + * ``param msg: str`` 输入消息,由 ``MessageSegment.data["text"]`` 拼接组成 + * ``param qq: str`` 输入消息触发 QQ + * ``param atqq: str = ""`` 输入消息中首个 at 的 QQ + - ``return: Tuple[str, List]`` UID、队伍角色名 + """ + uid, chars = "", [] + for seg in msg.split(): + _uid, char = await formatInput(seg, qq, atqq) + uid = uid or _uid + if char != "全部" and char not in chars: + logger.info(f"从 QQ{qq} 的输入「{seg}」中识别到 UID[{uid}] CHAR[{char}]") + chars.append(char) + if not msg: + uid, _ = await formatInput("", qq, atqq) + if len(chars) == 1: + searchTeam = await aliasTeam(chars[0]) + chars = searchTeam if isinstance(searchTeam, List) else chars + return uid, chars async def fetchInitRes() -> None: """ - 插件初始化资源下载,通过阿里云 CDN 获取 Enka.Network API 提供的 JSON 文件、HTML 模板资源文件、角色词条权重配置等 - - https://raw.githubusercontent.com/EnkaNetwork/API-docs/master/store/loc.json - - https://raw.githubusercontent.com/Dimbreath/GenshinData/master/TextMap/TextMapCHS.json - - https://raw.githubusercontent.com/EnkaNetwork/API-docs/master/store/characters.json - - https://raw.githubusercontent.com/monsterxcn/nonebot_plugin_gspanel/main/data/gspanel/template.json - - https://raw.githubusercontent.com/monsterxcn/nonebot_plugin_gspanel/main/data/gspanel/calc-rule.json + 插件初始化资源下载,通过阿里云 CDN 获取 HTML 模板资源文件、角色词条权重配置、角色数据、TextMap 中文翻译数据等 """ - print("正在检查面板插件所需资源...") + logger.info("正在检查面板插件所需资源...") # 仅首次启用插件下载的文件 initRes = [ - "https://cdn.monsterx.cn/bot/gspanel/font/华文中宋.TTF", "https://cdn.monsterx.cn/bot/gspanel/font/HYWH-65W.ttf", - "https://cdn.monsterx.cn/bot/gspanel/font/NZBZ.ttf", "https://cdn.monsterx.cn/bot/gspanel/font/tttgbnumber.ttf", "https://cdn.monsterx.cn/bot/gspanel/imgs/bg-anemo.jpg", "https://cdn.monsterx.cn/bot/gspanel/imgs/bg-cryo.jpg", @@ -131,8 +257,6 @@ async def fetchInitRes() -> None: "https://cdn.monsterx.cn/bot/gspanel/imgs/bg-geo.jpg", "https://cdn.monsterx.cn/bot/gspanel/imgs/bg-hydro.jpg", "https://cdn.monsterx.cn/bot/gspanel/imgs/bg-pyro.jpg", - "https://cdn.monsterx.cn/bot/gspanel/imgs/card-bg.png", - "https://cdn.monsterx.cn/bot/gspanel/imgs/star.png", "https://cdn.monsterx.cn/bot/gspanel/imgs/talent-anemo.png", "https://cdn.monsterx.cn/bot/gspanel/imgs/talent-cryo.png", "https://cdn.monsterx.cn/bot/gspanel/imgs/talent-dendro.png", @@ -140,8 +264,11 @@ async def fetchInitRes() -> None: "https://cdn.monsterx.cn/bot/gspanel/imgs/talent-geo.png", "https://cdn.monsterx.cn/bot/gspanel/imgs/talent-hydro.png", "https://cdn.monsterx.cn/bot/gspanel/imgs/talent-pyro.png", - "https://cdn.monsterx.cn/bot/gspanel/style.css", - "https://cdn.monsterx.cn/bot/gspanel/tpl.html", + "https://cdn.monsterx.cn/bot/gspanel/g2plot.min.js", + f"https://cdn.monsterx.cn/bot/gspanel/team-{TPL_VERSION}.css", + f"https://cdn.monsterx.cn/bot/gspanel/team-{TPL_VERSION}.html", + f"https://cdn.monsterx.cn/bot/gspanel/panel-{TPL_VERSION}.css", + f"https://cdn.monsterx.cn/bot/gspanel/panel-{TPL_VERSION}.html", ] tasks = [] for r in initRes: @@ -149,48 +276,22 @@ async def fetchInitRes() -> None: tasks.append(download(r, local=("" if "." in d else d))) await asyncio.gather(*tasks) tasks.clear() - print("首次启用所需资源检查完毕..") - # 总是尝试更新的文件 - urls = [ - # "https://cdn.monsterx.cn/bot/gapanel/loc.json", # 仅包含 zh-CN 语言 - "https://cdn.monsterx.cn/bot/gspanel/TextMapCHS.json", - "https://cdn.monsterx.cn/bot/gspanel/characters.json", - "https://cdn.monsterx.cn/bot/gspanel/calc-rule.json", - ] - tmp = {"0": {}, "1": {}, "2": {}} - async with AsyncClient(verify=False) as client: - for idx, url in enumerate(urls): - tmp[str(idx)] = (await client.get(url)).json() - (LOCAL_DIR / url.split("/")[-1]).write_text( - json.dumps(tmp[str(idx)], ensure_ascii=False, indent=2), - encoding="utf-8", - ) - # 额外生成一份 {"中文名": "8 位角色 ID", ...} 配置 - name2id, unknownCnt = {}, 1 - for charId in tmp["1"]: # characters.json - if not tmp["1"][charId].get("NameTextMapHash"): - # 10000005-502 10000005-503 10000005-505 - # 10000007-702 10000007-703 10000007-705 - continue - nameTextMapHash = tmp["1"][charId]["NameTextMapHash"] # type: int - nameCn = tmp["0"].get(str(nameTextMapHash), f"未知角色{unknownCnt}") - name2id[nameCn] = charId - if nameCn == f"未知角色{unknownCnt}": - unknownCnt += 1 - (LOCAL_DIR / "name2id.json").write_text( - json.dumps(name2id, ensure_ascii=False, indent=2), encoding="utf-8" - ) - print("面板插件所需资源检查完毕!") + logger.info("面板插件所需资源检查完毕!") -async def download(url: str, local: Union[Path, str] = "") -> Union[Path, None]: +async def download( + url: str, local: Union[Path, str] = "", retry: int = 3 +) -> Union[Path, None]: """ 一般文件下载,通常是即用即下的角色命座图片、技能图片、抽卡大图、圣遗物图片等 - * ``param url: str`` 指定下载链接 - * ``param local: Union[Path, str] = ""`` 指定本地目标路径,传入类型为 ``Path`` 时视为保存文件完整路径,传入类型为 ``str`` 时视为保存文件子文件夹名(默认下载至插件资源根目录) - - ``return: Union[Path, None]`` 本地文件地址,出错时返回空 + * ``param url: str`` 下载链接 + * ``param local: Union[Path, str] = ""`` 下载路径,传入类型为 ``Path`` 时视为保存文件完整路径,传入类型为 ``str`` 时视为保存文件子文件夹名(默认下载至插件资源根目录) + * ``param retry: int = 3`` 下载失败重试次数 + - ``return: Union[Path, None]`` 本地文件路径,出错时返回空 """ + if not url.startswith("http"): + url = DOWNLOAD_MIRROR + url + ".png" if not isinstance(local, Path): d = (LOCAL_DIR / local) if local else LOCAL_DIR if not d.exists(): @@ -203,9 +304,8 @@ async def download(url: str, local: Union[Path, str] = "") -> Union[Path, None]: # 本地文件存在时便不再下载,JSON 文件除外 if f.exists() and ".json" not in f.name: return f - client = AsyncClient() - retryCnt = 3 - while retryCnt: + client, retry = AsyncClient(), 3 + while retry: try: async with client.stream( "GET", url, headers={"user-agent": "NoneBot-GsPanel"} @@ -215,7 +315,45 @@ async def download(url: str, local: Union[Path, str] = "") -> Union[Path, None]: fb.write(chunk) return f except Exception as e: - print(f"面板资源 {f.name} 下载出错 {type(e)}:{e}") - retryCnt -= 1 - await asyncio.sleep(2) + retry -= 1 + if retry: + await asyncio.sleep(2) + else: + logger.opt(exception=e).error(f"面板资源 {f.name} 下载出错") return None + + +async def uidHelper(qq: Union[str, int], uid: str = "") -> str: + """ + UID 助手,根据 QQ 获取对应原神 UID,也可传入 UID 更新指定 QQ 的绑定情况 + + * ``param qq: Union[str, int]`` 操作 QQ + * ``param uid: str = ""`` 操作 UID,默认不传入以查找该值,传入则视为绑定/更新 + - ``return: str``指定 QQ 绑定的原神 UID,绑定/更新时返回操作结果 + """ + qq = str(qq) + cfgFile = LOCAL_DIR / "qq-uid.json" + uidCfg = json.loads(cfgFile.read_text(encoding="utf-8")) + if uid: + uidCfg[qq] = uid + cfgFile.write_text( + json.dumps(uidCfg, ensure_ascii=False, indent=2), encoding="utf-8" + ) + return "已{} QQ{} 的 UID 为 {}".format("更新" if qq in uidCfg else "绑定", qq, uid) + return uidCfg.get(qq, "") + + +async def aliasWho(input: str) -> str: + """角色别名,未找到别名配置的原样返回""" + for char in CHAR_ALIAS: + if (input in char) or (input in CHAR_ALIAS[char]): + return char + return input + + +async def aliasTeam(input: str) -> Union[str, List]: + """队伍别名,未找到别名配置的原样返回""" + for team in TEAM_ALIAS: + if (input == team) or (input in TEAM_ALIAS[team].get("alias", [])): + return TEAM_ALIAS[team]["chars"] # type: List + return input diff --git a/gspanel/data_convert.py b/gspanel/data_convert.py new file mode 100644 index 0000000..6da047d --- /dev/null +++ b/gspanel/data_convert.py @@ -0,0 +1,675 @@ +import json +from time import time +from typing import Dict, List, Tuple + +# from nonebot.log import logger +from ci import logger + +from gspanel.__utils__ import ( + CALC_RULES, + CHAR_DATA, + ELEM, + GROW_VALUE, + HASH_TRANS, + MAIN_AFFIXS, + POS, + PROP, + RANK_MAP, + RELIC_APPEND, + SKILL, + SUB_AFFIXS, + getServer, + kStr, + vStr, +) + + +async def getRelicConfig(char: str, base: Dict = {}) -> Tuple[Dict, Dict, Dict]: + """ + 指定角色圣遗物计算配置获取,包括词条评分权重、词条数值原始权重、各位置圣遗物总分理论最高分和主词条理论最高得分 + + * ``param char: str`` 角色名 + * ``param base: Dict = {}`` 角色的基础数值,可由 Enka 返回获得,格式为 ``{"生命值": 1, "攻击力": 1, "防御力": 1}`` + - ``return: Tuple[Dict, Dict, Dict]`` 词条评分权重、词条数值原始权重、各位置圣遗物最高得分 + """ + affixWeight = CALC_RULES.get(char, {"攻击力百分比": 75, "暴击率": 100, "暴击伤害": 100}) + # 词条评分权重的 key 排序影响最优主词条选择 + # 通过特定排序使同等权重时生命攻击防御固定值词条优先级最低 + # key 的原始排序为 生命值攻击力防御力百分比、暴击率、暴击伤害、元素精通、元素伤害加成、物理伤害加成、元素充能效率 + # 注:已经忘了最初为什么这样写了,但总之就是顺序有影响+现在这样写能用 + affixWeight = dict( + sorted( + affixWeight.items(), + key=lambda item: ( + item[1], + "暴击" in item[0], + "加成" in item[0], + "元素" in item[0], + ), + reverse=True, + ) + ) + # 计算词条数值原始权重 + # 是一种与词条数值的乘积在百位数级别的东西,后续据此计算最终得分 + # 非百分比的生命攻击防御词条也按百分比词条的 affixWeight 权重计算 + pointMark = {k: v / GROW_VALUE[k] for k, v in affixWeight.items()} + if pointMark.get("攻击力百分比"): + pointMark["攻击力"] = pointMark["攻击力百分比"] / base.get("攻击力", 1020) * 100 + if pointMark.get("防御力百分比"): + pointMark["防御力"] = pointMark["防御力百分比"] / base.get("防御力", 300) * 100 + if pointMark.get("生命值百分比"): + pointMark["生命值"] = pointMark["生命值百分比"] / base.get("生命值", 400) * 100 + # 各位置圣遗物的总分理论最高分、主词条理论最高得分 + maxMark = {"1": {}, "2": {}, "3": {}, "4": {}, "5": {}} + for posIdx in range(1, 6): + # 主词条最高得分 + if posIdx <= 2: + # 花和羽不计算主词条得分 + mainAffix = "生命值" if posIdx == 1 else "攻击力" + maxMark[str(posIdx)]["main"] = 0 + maxMark[str(posIdx)]["total"] = 0 + else: + # 沙杯头计算该位置评分权重最高的词条得分 + avalMainAffix = { + k: v for k, v in affixWeight.items() if k in MAIN_AFFIXS[str(posIdx)] + } + # logger.debug( + # "{} 的主词条推荐顺序为:\n{}".format( + # list(POS.values())[posIdx - 1], + # " / ".join(f"{k}[{v}]" for k, v in avalMainAffix.items()), + # ) + # ) + mainAffix = list(avalMainAffix)[0] + maxMark[str(posIdx)]["main"] = affixWeight[mainAffix] + maxMark[str(posIdx)]["total"] = affixWeight[mainAffix] * 2 + # 副词条最高得分 + maxSubAffixs = { + k: v + for k, v in affixWeight.items() + if k in SUB_AFFIXS and k != mainAffix and affixWeight.get(k) + } + # logger.debug( + # "{} 的副词条推荐顺序为:\n{}".format( + # list(POS.values())[posIdx - 1], + # " / ".join(f"{k}[{v}]" for k, v in maxSubAffixs.items()), + # ) + # ) + # 副词条中评分权重最高的词条得分大幅提升 + maxMark[str(posIdx)]["total"] += sum( + affixWeight[k] * (1 if kIdx else 6) + for kIdx, k in enumerate(list(maxSubAffixs)[0:4]) + ) + logger.info( + ( + "「{}」圣遗物评分依据:" + "\n\t词条评分权重 affixWeight\n\t{}" + "\n\t词条数值原始权重 pointMark\n\t{}" + "\n\t各位置圣遗物最高得分 maxMark\n\t{}" + ).format( + char, + " / ".join(f"{k}[{v}]" for k, v in affixWeight.items()), + " / ".join(f"{k}[{v}]" for k, v in pointMark.items()), + " / ".join( + f"{list(POS.values())[int(k)-1]}>主词条[{v['main']}]总分[{v['total']}]" + for k, v in maxMark.items() + ), + ) + ) + return affixWeight, pointMark, maxMark + + +def getRelicRank(score: float) -> str: + """圣遗物评级获取""" + # 在角色等级较低(基础数值较低)时评级可能显示为 "ERR" + # 注:角色等级较低时不为 "ERR" 的评分也有可能出错 + return [r[0] for r in RANK_MAP if score <= r[1]][0] if score <= 66 else "ERR" + + +async def calcRelicMark( + relicData: Dict, charElement: str, affixWeight: Dict, pointMark: Dict, maxMark: Dict +) -> Dict: + """ + 指定角色圣遗物评分计算 + + * ``param relicData: Dict`` 圣遗物数据 + * ``param charElement: str`` 角色的中文元素属性 + * ``param affixWeight: Dict`` 角色的词条评分权重,由 ``getRelicConfig()`` 获取 + * ``param pointMark: Dict`` 角色的词条数值原始权重,由 ``getRelicConfig()`` 获取 + * ``param maxMark: Dict`` 角色的各位置圣遗物最高得分,由 ``getRelicConfig()`` 获取 + - ``return: Dict`` 圣遗物评分结果 + """ + posIdx, relicLevel = str(relicData["pos"]), relicData["level"] + mainProp, subProps = relicData["main"], relicData["sub"] + # 主词条得分、主词条收益系数(百分数) + if posIdx in ["1", "2"]: + calcMain, calcMainPct = 0.0, 100 + else: + # 角色元素属性与伤害属性不同时权重为 0,不影响物理伤害得分 + _mainPointMark: float = pointMark.get( + mainProp["prop"].replace(charElement, ""), 0 + ) + _point: float = _mainPointMark * mainProp["value"] + # 主词条与副词条的得分计算规则一致,但只取 25% + calcMain = _point * 46.6 / 6 / 100 / 4 + # 主词条收益系数用于沙杯头位置主词条不正常时的圣遗物总分惩罚,最多扣除 50% 总分 + _punishPct: float = _point / maxMark[posIdx]["main"] / 2 / 4 + calcMainPct = 100 - 50 * (1 - _punishPct) + # 副词条得分 + calcSubs = [] + for s in subProps: + _subPointMark: float = pointMark.get(s["prop"], 0) + calcSub: float = _subPointMark * s["value"] * 46.6 / 6 / 100 + # 副词条 CSS 样式 + _awKey = f"{s['prop']}百分比" if s["prop"] in ["生命值", "攻击力", "防御力"] else s["prop"] + _subAffixWeight: int = affixWeight.get(_awKey, 0) + subStyleClass = ( + ("great" if _subAffixWeight > 79 else "use") if calcSub else "unuse" + ) + # [词条名, 词条数值, 词条得分] + calcSubs.append([subStyleClass, calcSub]) + # 总分对齐系数(百分数),按满分 66 对齐各位置圣遗物的总分 + calcTotalPct: float = 66 / (maxMark[posIdx]["total"] * 46.6 / 6 / 100) * 100 + # 最终圣遗物总分 + _total = calcMain + sum(s[1] for s in calcSubs) + calcTotal = _total * calcMainPct * calcTotalPct / 10000 + # 强化歪次数 + realAppendPropIdList: List[int] = ( + relicData["_appendPropIdList"][-(relicLevel // 4) :] if (relicLevel // 4) else [] + ) + # logger.debug( + # "{} 强化记录:\n{}".format( + # list(POS.values())[int(posIdx) - 1], + # " / ".join( + # PROP.get(RELIC_APPEND[str(x)], RELIC_APPEND[str(x)]) + # for x in realAppendPropIdList + # ), + # ) + # ) + notHit = len( + [ + x + for x in realAppendPropIdList + if not pointMark.get(PROP.get(RELIC_APPEND[str(x)], RELIC_APPEND[str(x)])) + ] + ) + return { + "rank": getRelicRank(calcTotal), + "total": calcTotal, + "nohit": notHit, + "main": round(calcMain, 1), + "sub": [{"style": subRes[0], "goal": round(subRes[1], 1)} for subRes in calcSubs], + "main_pct": round(calcMainPct, 1), + "total_pct": round(calcTotalPct, 1), + } + + +async def transFromEnka(avatarInfo: Dict, ts: int = 0) -> Dict: + """ + 转换 Enka.Network 角色查询数据为内部格式 + + * ``param avatarInfo: Dict`` Enka.Network 角色查询数据,取自 ``data["avatarInfoList"]`` 列表 + * ``param ts: int = 0`` 数据时间戳 + - ``return: Dict`` 内部格式角色数据,用于本地缓存等 + """ + charData = CHAR_DATA[str(avatarInfo["avatarId"])] + res = { + "id": avatarInfo["avatarId"], # type: int + "rarity": 5 if "QUALITY_ORANGE" in charData["QualityType"] else 4, + "name": charData["NameCN"], + "slogan": charData["Slogan"], + "element": ELEM[charData["Element"]], # 中文单字 + "cons": len(avatarInfo.get("talentIdList", [])), # type: int + "fetter": avatarInfo["fetterInfo"]["expLevel"], # type: int + "level": int(avatarInfo["propMap"]["4001"]["val"]), # type: int + "icon": charData["iconName"], + "gachaAvatarImg": charData["Costumes"][str(avatarInfo["costumeId"])]["art"] + if avatarInfo.get("costumeId") + else charData["iconName"].replace("UI_AvatarIcon_", "UI_Gacha_AvatarImg_"), + "baseProp": { # type: float + "生命值": avatarInfo["fightPropMap"]["1"], + "攻击力": avatarInfo["fightPropMap"]["4"], + "防御力": avatarInfo["fightPropMap"]["7"], + }, + "fightProp": { # type: float + "生命值": avatarInfo["fightPropMap"]["2000"], + # "攻击力": avatarInfo["fightPropMap"]["2001"], + "攻击力": avatarInfo["fightPropMap"]["4"] + * (1 + avatarInfo["fightPropMap"].get("6", 0)) + + avatarInfo["fightPropMap"].get("5", 0), + "防御力": avatarInfo["fightPropMap"]["2002"], + "暴击率": avatarInfo["fightPropMap"]["20"] * 100, + "暴击伤害": avatarInfo["fightPropMap"]["22"] * 100, + "治疗加成": avatarInfo["fightPropMap"]["26"] * 100, + "元素精通": avatarInfo["fightPropMap"]["28"], + "元素充能效率": avatarInfo["fightPropMap"]["23"] * 100, + "物理伤害加成": avatarInfo["fightPropMap"]["30"] * 100, + "火元素伤害加成": avatarInfo["fightPropMap"]["40"] * 100, + "水元素伤害加成": avatarInfo["fightPropMap"]["42"] * 100, + "风元素伤害加成": avatarInfo["fightPropMap"]["44"] * 100, + "雷元素伤害加成": avatarInfo["fightPropMap"]["41"] * 100, + "草元素伤害加成": avatarInfo["fightPropMap"]["43"] * 100, + "冰元素伤害加成": avatarInfo["fightPropMap"]["46"] * 100, + "岩元素伤害加成": avatarInfo["fightPropMap"]["45"] * 100, + }, + "skills": {}, + "consts": [], + "weapon": {}, + "relics": [], + "relicSet": {}, + "relicCalc": {}, + "damage": {}, # 预留 + "time": ts or int(time()), + } + # 技能数据 + skills = {"a": {}, "e": {}, "q": {}} + extraLevels = { + k[-1]: v for k, v in avatarInfo.get("proudSkillExtraLevelMap", {}).items() + } + for idx, skillId in enumerate(charData["SkillOrder"]): + # 实际技能等级、显示技能等级 + level = avatarInfo["skillLevelMap"][str(skillId)] + currentLvl = level + extraLevels.get(list(SKILL)[idx], 0) + skills[list(SKILL.values())[idx]] = { + "style": "extra" if currentLvl > level else "", + "icon": charData["Skills"][str(skillId)], + "level": currentLvl, + "originLvl": level, + } + res["skills"] = skills + # 命座数据 + consts = [] + for cIdx, consImgName in enumerate(charData["Consts"]): + consts.append( + { + "style": "off" if cIdx + 1 > res["cons"] else "", + "icon": consImgName, + } + ) + res["consts"] = consts + # 装备数据 + affixWeight, pointMark, maxMark = await getRelicConfig( + charData["NameCN"], res["baseProp"] + ) + relicsMark, relicsCnt, relicSet = 0.0, 0, {} + for equip in avatarInfo["equipList"]: + if equip["flat"]["itemType"] == "ITEM_WEAPON": + weaponSub: str = equip["flat"]["weaponStats"][-1]["appendPropId"] + weaponSubValue = equip["flat"]["weaponStats"][-1]["statValue"] + res["weapon"] = { + "id": equip["itemId"], + "rarity": equip["flat"]["rankLevel"], # type: int + "name": HASH_TRANS.get(equip["flat"]["nameTextMapHash"], "缺少翻译"), + "affix": list(equip["weapon"].get("affixMap", {"_": 0}).values())[0] + 1, + "level": equip["weapon"]["level"], # type: int + "icon": equip["flat"]["icon"], + "main": equip["flat"]["weaponStats"][0]["statValue"], # type: int + "sub": { + "prop": PROP[weaponSub].replace("百分比", ""), + "value": f"{weaponSubValue}{'' if weaponSub.endswith('ELEMENT_MASTERY') else '%'}", + } + if weaponSub != "FIGHT_PROP_BASE_ATTACK" + else {}, + } + elif equip["flat"]["itemType"] == "ITEM_RELIQUARY": + mainProp: Dict = equip["flat"]["reliquaryMainstat"] + subProps: List = equip["flat"].get("reliquarySubstats", []) + posIdx = list(POS.keys()).index(equip["flat"]["equipType"]) + 1 + relicData = { + "pos": posIdx, + "rarity": equip["flat"]["rankLevel"], + "name": HASH_TRANS.get(equip["flat"]["nameTextMapHash"], "缺少翻译"), + "setName": HASH_TRANS.get(equip["flat"]["setNameTextMapHash"], "缺少翻译"), + "level": equip["reliquary"]["level"] - 1, + "main": { + "prop": PROP[mainProp["mainPropId"]], + "value": mainProp["statValue"], + }, + "sub": [ + {"prop": PROP[s["appendPropId"]], "value": s["statValue"]} + for s in subProps + ], + "calc": {}, + "icon": equip["flat"]["icon"], + "_appendPropIdList": equip["reliquary"].get("appendPropIdList", []), + } + relicData["calc"] = await calcRelicMark( + relicData, res["element"], affixWeight, pointMark, maxMark + ) + # 分数计算完毕后再将词条名称、数值转为适合 HTML 渲染的格式 + relicData["main"]["value"] = vStr( + relicData["main"]["prop"], relicData["main"]["value"] + ) + relicData["main"]["prop"] = kStr(relicData["main"]["prop"]) + relicData["sub"] = [ + {"prop": kStr(s["prop"]), "value": vStr(s["prop"], s["value"])} + for s in relicData["sub"] + ] + # 额外数据处理 + relicData["calc"]["total"] = round(relicData["calc"]["total"], 1) + relicData.pop("_appendPropIdList") + relicSet[relicData["setName"]] = relicSet.get(relicData["setName"], 0) + 1 + res["relics"].append(relicData) + # 累积圣遗物套装评分和计数器 + relicsMark += relicData["calc"]["total"] + relicsCnt += 1 + # 圣遗物套装 + res["relicSet"] = relicSet + res["relicCalc"] = { + "rank": getRelicRank(relicsMark / relicsCnt) if relicsCnt else "NaN", + "total": round(relicsMark, 1), + } + return res + + +async def transToTeyvat(avatarsData: List[Dict], uid: str) -> Dict: + """ + 转换内部格式角色数据为 Teyvat Helper 请求格式 + + * ``param avatarsData: List[Dict]`` 内部格式角色数据,由 ``transFromEnka()`` 获取 + * ``param uid: str`` 角色所属用户 UID + - ``return: Dict`` Teyvat Helper 请求格式角色数据 + """ + res = {"uid": uid, "role_data": []} + if uid[0] not in ["1", "2"]: + res["server"] = getServer(uid) + + for avatarData in avatarsData: + name = avatarData["name"] + cons = avatarData["cons"] + weapon = avatarData["weapon"] + baseProp = avatarData["baseProp"] + fightProp = avatarData["fightProp"] + skills = avatarData["skills"] + relics = avatarData["relics"] + relicSet = avatarData["relicSet"] + + # dataFix from https://github.com/yoimiya-kokomi/miao-plugin/blob/ac27075276154ef5a87a458697f6e5492bd323bd/components/profile-data/enka-data.js#L186 + if name == "雷电将军": + _thunderDmg = fightProp["雷元素伤害加成"] + _recharge = fightProp["元素充能效率"] + fightProp["雷元素伤害加成"] = max(0, _thunderDmg - (_recharge - 100) * 0.4) + if name == "莫娜": + _waterDmg = fightProp["水元素伤害加成"] + _recharge = fightProp["元素充能效率"] + fightProp["水元素伤害加成"] = max(0, _waterDmg - _recharge * 0.2) + if name == "妮露" and cons == 6: + _count = float(fightProp["生命值"] / 1000) + _crit = fightProp["暴击率"] + _critDmg = fightProp["暴击伤害"] + fightProp["暴击率"] = max(5, _crit - min(30, _count * 0.6)) + fightProp["暴击伤害"] = max(50, _critDmg - min(60, _count * 1.2)) + if weapon["name"] in ["息灾", "波乱月白经津", "雾切之回光", "猎人之径"]: + for elem in ["火", "水", "雷", "风", "冰", "岩", "草"]: + _origin = fightProp[f"{elem}元素伤害加成"] + fightProp[f"{elem}元素伤害加成"] = max( + 0, _origin - 12 - 12 * (weapon["affix"] - 1) / 4 + ) + + # 圣遗物数据 + artifacts = [] + for a in relics: + tData = { + "artifacts_name": a["name"], + "artifacts_type": list(POS.values())[a["pos"] - 1], + "level": a["level"], + "maintips": kStr(a["main"]["prop"], reverse=True), + "mainvalue": a["main"]["value"], + } + tData.update( + { + f"tips{sIdx + 1}": "{}+{}".format( + kStr(s["prop"], reverse=True), s["value"] + ) + for sIdx, s in enumerate(a["sub"]) + } + ) + artifacts.append(tData) + + # 单个角色最终结果 + res["role_data"].append( + { + "uid": uid, + "role": name, + "role_class": cons, + "level": int(avatarData["level"]), + "weapon": weapon["name"], + "weapon_level": weapon["level"], + "weapon_class": f"精炼{weapon['affix']}阶", + "hp": int(fightProp["生命值"]), + "base_hp": int(baseProp["生命值"]), + "attack": int(fightProp["攻击力"]), + "base_attack": int(baseProp["攻击力"]), + "defend": int(fightProp["防御力"]), + "base_defend": int(baseProp["防御力"]), + "element": round(fightProp["元素精通"]), + "crit": f"{round(fightProp['暴击率'], 1)}%", + "crit_dmg": f"{round(fightProp['暴击伤害'], 1)}%", + "heal": f"{round(fightProp['治疗加成'], 1)}%", + "recharge": f"{round(fightProp['元素充能效率'], 1)}%", + "fire_dmg": f"{round(fightProp['火元素伤害加成'], 1)}%", + "water_dmg": f"{round(fightProp['水元素伤害加成'], 1)}%", + "thunder_dmg": f"{round(fightProp['雷元素伤害加成'], 1)}%", + "wind_dmg": f"{round(fightProp['风元素伤害加成'], 1)}%", + "ice_dmg": f"{round(fightProp['冰元素伤害加成'], 1)}%", + "rock_dmg": f"{round(fightProp['岩元素伤害加成'], 1)}%", + "grass_dmg": f"{round(fightProp['草元素伤害加成'], 1)}%", + "physical_dmg": f"{round(fightProp['物理伤害加成'], 1)}%", + "artifacts": "+".join( + f"{k}{4 if v >= 4 else (2 if v >= 2 else 1)}" + for k, v in relicSet.items() + if (v >= 2) or ("之人" in k) + ), + "ability1": skills["a"]["level"], + "ability2": skills["e"]["level"], + "ability3": skills["q"]["level"], + "artifacts_detail": artifacts, + } + ) + + return res + + +async def simplDamageRes(damage: Dict) -> Dict: + """ + 转换角色伤害计算请求数据为精简格式 + + * ``param damage: Dict`` 角色伤害计算请求数据,由 ``queryDamageApi()["result"][int]`` 获取 + - ``return: Dict`` 精简格式伤害数据,出错时返回 ``{}`` + """ + res = {"level": damage["zdl_result"] or "NaN", "data": [], "buff": []} + for key in ["damage_result_arr", "damage_result_arr2"]: + for dmgDetail in damage[key]: + dmgTitle = "{}{}".format( + f"[{damage['zdl_result2']}]
    " if key == "damage_result_arr2" else "", + dmgDetail["title"], + ) + if "期望" in str(dmgDetail["value"]) or not dmgDetail.get("expect"): + dmgCrit, dmgExp = "-", str(dmgDetail["value"]).replace("期望", "") + else: + dmgCrit = str(dmgDetail["value"]) + dmgExp = str(dmgDetail["expect"]).replace("期望", "") + res["data"].append([dmgTitle, dmgCrit, dmgExp]) + for buff in damage["bonus"]: + # damage["bonus"]: {"0": {}, "2": {}, ...} + # damage["bonus"]: [{}, {}, ...] + intro = damage["bonus"][buff]["intro"] if isinstance(buff, str) else buff["intro"] + buffTitle, buffDetail = intro.split(":") + if buffTitle not in ["注", "备注"]: + res["buff"].append([buffTitle, buffDetail]) + return res + + +async def simplFightProp( + fightProp: Dict, baseProp: Dict, char: str, element: str +) -> Dict[str, Dict]: + """ + 转换角色面板数据为 HTML 模板需求格式 + + * ``param fightProp: Dict`` 角色面板数据,由 ``transFromEnka()["fightProp"]`` 获取 + * ``param baseProp: Dict`` 角色基础数据,由 ``transFromEnka()["baseProp"]`` 获取 + * ``param element: str`` 角色元素属性 + - ``return: Dict[str, Dict]`` HTML 模板需求格式面板数据 + """ + affixWeight = CALC_RULES.get(char, {"攻击力百分比": 75, "暴击率": 100, "暴击伤害": 100}) + + # 排列伤害加成 + prefer = ( + element if affixWeight.get("元素伤害加成", 0) > affixWeight.get("物理伤害加成", 0) else "物" + ) + damages = sorted( + [{"k": k, "v": v} for k, v in fightProp.items() if str(k).endswith("伤害加成")], + key=lambda x: (x["v"], x["k"][0] == prefer), + reverse=True, + ) + for unuseDmg in damages[1:]: + fightProp.pop(unuseDmg["k"]) + + # 生成模板渲染所需数据 + res = {} + for propTitle, propValue in fightProp.items(): + # 跳过无效治疗加成 + if propTitle == "治疗加成" and not propValue and not affixWeight.get(propTitle): + continue + # 整理渲染数据 + res[propTitle] = { + "value": f"{round(propValue, 1)}%" + if propTitle not in ["生命值", "攻击力", "防御力", "元素精通"] + else round(propValue), + "weight": max(affixWeight.get("元素伤害加成", 0), affixWeight.get("物理伤害加成", 0)) + if propTitle.endswith("伤害加成") + else affixWeight.get(propTitle) or affixWeight.get(f"{propTitle}百分比", 0), + } + # 补充基础数值 + if propTitle in ["生命值", "攻击力", "防御力"]: + res[propTitle]["detail"] = [ + round(baseProp[propTitle]), + round(res[propTitle]["value"] - baseProp[propTitle]), + ] + # 标记异常伤害加成 + if propTitle.endswith("伤害加成"): + if ( + propTitle[0] not in ["物", element] + or affixWeight.get(propTitle[-6:], 0) != res[propTitle]["weight"] + ): + res[propTitle]["error"] = True + + return res + + +async def simplTeamDamageRes(raw: Dict, rolesData: Dict) -> Dict: + """ + 转换队伍伤害计算请求数据为精简格式 + + * ``param raw: Dict`` 队伍伤害计算请求数据,由 ``queryDamageApi(*, "team")["result"]`` 获取 + * ``param rolesData: Dict`` 角色数据,键为角色中文名,值为内部格式 + - ``return: Dict`` 精简格式伤害数据。出错时返回 ``{"error": "错误信息"}`` + """ + s = ( + str(raw["zdl_tips0"]) + .replace("你的队伍", "") + .replace("秒内造成总伤害", "-") + .replace(",DPS为:", "") + ) + tm, total = s.split("-") + + pieData, pieColor = [], [] + for x in raw["chart_data"]: + char, damage = x["name"].split("\n") + pieData.append({"char": char, "damage": float(damage.replace("W", ""))}) + pieColor.append(x["label"]["color"]) + pieData = sorted(pieData, key=lambda x: x["damage"], reverse=True) + # 寻找伤害最高的角色元素属性,跳过绽放等伤害来源 + elem = [ + rolesData[_source["char"]]["element"] + for _source in pieData + if rolesData.get(_source["char"]) + ][0] + + avatars = {} + for role in raw["role_list"]: + panelData = rolesData[role["role"]] + avatars[role["role"]] = { + "rarity": role["role_star"], + "icon": panelData["icon"], + "name": role["role"], + "elem": panelData["element"], + "cons": role["role_class"], + "level": role["role_level"].replace("Lv", ""), + "weapon": { + "icon": panelData["weapon"]["icon"], + "level": panelData["weapon"]["level"], + "rarity": panelData["weapon"]["rarity"], + "affix": panelData["weapon"]["affix"], + }, + "sets": { + [r for r in panelData["relics"] if r["setName"] == k][0]["icon"].split( + "_" + )[-2]: (2 if v < 4 else 4) + for k, v in panelData["relicSet"].items() + if v >= 2 # 暂未排版 祭X之人 单件套装 + }, + "cp": round(panelData["fightProp"]["暴击率"], 1), + "cd": round(panelData["fightProp"]["暴击伤害"], 1), + "key_prop": role["key_ability"], + "key_value": role["key_value"], + "skills": [ + {"icon": skill["icon"], "style": skill["style"], "level": skill["level"]} + for _, skill in panelData["skills"].items() + ], + } + + for rechargeData in raw["recharge_info"]: + name, tmp = rechargeData["recharge"].split("共获取同色球") + same, diff = tmp.split("个,异色球") + if len(diff.split("个,无色球")) == 2: + # 暂未排版无色球 + diff = diff.split("个,无色球")[0] + avatars[name]["recharge"] = { + "pct": rechargeData["rate"], + "same": round(float(same), 1), + "diff": round(float(diff.replace("个", "")), 1), + } + + damages = [] + for step in raw["advice"]: + if not step.get("content"): + logger.error(f"奇怪的伤害:{step}") + continue + # content: "4.2s 雷神e协同,暴击:3016,不暴击:1565,期望:2343" + t, s = step["content"].split(" ") + if len(s.split(",")) == 1: + # "3.89s 万叶q染色为:雷" + a = s.split(",")[0] + d = ["-", "-", "-"] + else: + a, dmgs = s.split(",") + if len(dmgs.split(",")) == 1: + d = ["-", "-", dmgs.split(",")[0].split(":")[-1]] + else: + d = [dd.split(":")[-1] for dd in dmgs.split(",")] + damages.append([t.replace("s", ""), a.upper(), *d]) + + buffs = [] + for buff in raw["buff"]: + if not buff.get("content"): + logger.error(f"奇怪的 Buff:{buff}") + continue + # buff: "1.5s 风套-怪物雷抗减少-40%" + t, tmp = buff["content"].split(" ", 1) + b, bd = tmp.split("-", 1) + buffs.append([t.replace("s", ""), b.upper(), bd.upper()]) + + return { + "uid": raw["uid"], + "elem": elem, + "rank": raw["zdl_tips2"], + "dps": raw["zdl_result"], + "tm": tm, + "total": total, + "pie_data": json.dumps(pieData, ensure_ascii=False), + "pie_color": json.dumps(pieColor), + "avatars": avatars, + "actions": raw["combo_intro"].split(","), + "damages": damages, + "buffs": buffs, + } diff --git a/gspanel/data_source.py b/gspanel/data_source.py index 006abea..b785b5e 100644 --- a/gspanel/data_source.py +++ b/gspanel/data_source.py @@ -1,569 +1,342 @@ import asyncio -import io import json - -# from io import BytesIO -# from PIL import Image +from copy import deepcopy from time import time -from typing import Dict, List, Literal, Tuple +from typing import Dict, List, Literal, Union from httpx import AsyncClient, HTTPError -from gspanel.__utils__ import ( - DMG, - ELEM, - EXPIRE_SEC, - GROW_VALUE, - LOCAL_DIR, - MAIN_AFFIXS, - POS, - PROP, - SKILL, - SUB_AFFIXS, - download, - getBrowser, - kStr, - vStr, +# from nonebot import require +# from nonebot.log import logger +from ci import logger + +# require("nonebot_plugin_htmlrender") +# from nonebot_plugin_htmlrender import template_to_pic +from defs.browser import template_to_pic + +from gspanel.__utils__ import LOCAL_DIR, SCALE_FACTOR, TPL_VERSION, download +from gspanel.data_convert import ( + simplDamageRes, + simplFightProp, + simplTeamDamageRes, + transFromEnka, + transToTeyvat, ) -async def getRawData( - uid: str, - charId: str = "000", - refresh: bool = False, - name2id=None, - source: Literal["enka", "mgg"] = "enka", -) -> Dict: +async def queryPanelApi(uid: str, source: Literal["enka", "mgg"] = "enka") -> Dict: """ - Enka.Network API 原神游戏内角色展柜原始数据获取 + 原神游戏内角色展柜数据请求 - * ``param uid: str`` 指定查询用户 UID - * ``param charId: str = "000"`` 指定查询角色 ID - * ``param refresh: bool = False`` 指定是否强制刷新数据 - * ``param name2id: Dict = {}`` 角色 ID 与中文名转换所需资源 - * ``param source: Literal["enka", "mgg"] = "enka"`` 指定查询接口 - - ``return: Dict`` 查询结果。出错时返回 ``{"error": "错误信息"}`` + * ``param uid: str`` 查询用户 UID + * ``param source: Literal["enka", "mgg"] = "enka"`` 查询接口 + - ``return: Dict`` 查询结果,出错时返回 ``{"error": "错误信息"}`` """ - if name2id is None: - name2id = json.loads((LOCAL_DIR / "name2id.json").read_text(encoding="utf-8")) - cache = LOCAL_DIR / "cache" / f"{uid}__data.json" - print(f"checking cache for {uid}'s {charId}") - # 缓存文件存在且未过期、未要求刷新、查询角色存在于缓存中,三个条件均满足时才返回缓存 - if cache.exists() and (not refresh): - cacheData = json.loads(cache.read_text(encoding="utf-8")) - avalCharIds = [ - str(c["avatarId"]) for c in cacheData["playerInfo"]["showAvatarInfoList"] - ] - if int(time()) - cacheData["time"] > EXPIRE_SEC: - pass - elif charId in avalCharIds: - return [ - c for c in cacheData["avatarInfoList"] if str(c["avatarId"]) == charId - ][0] - elif charId == "000": - return { - "list": [ - [ - nameCn - for nameCn, cId in name2id.items() - if cId == str(x["avatarId"]) - ][0] - for x in cacheData["playerInfo"]["showAvatarInfoList"] - if x["avatarId"] not in [10000005, 10000007] - ] - } - # 请求最新数据 - root = "https://enka.network" if source == "enka" else "https://enka.minigg.cn" + enkaMirrors = [ + "https://enka.network", + "https://enka.minigg.cn", + "https://enka.microgg.cn", + ] + async with AsyncClient() as client: + resJson = {} + for idx, root in enumerate(enkaMirrors): + try: + res = await client.get( + url=f"{root}/u/{uid}/__data.json", + headers={ + "Accept": "application/json", + "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-US;q=0.7", + "Cache-Control": "no-cache", + "Cookie": "locale=zh-CN", + "Referer": "https://enka.network/", + "User-Agent": ( + "Mozilla/5.0 (Linux; Android 12; Nexus 5) " + "AppleWebKit/537.36 (KHTML, like Gecko) " + "Chrome/102.0.0.0 Mobile Safari/537.36" + ), + }, + timeout=20.0, + ) + resJson = res.json() + break + except (HTTPError, json.decoder.JSONDecodeError) as e: + if idx == len(enkaMirrors) - 1: + logger.opt(exception=e).error("面板数据接口无法访问或返回错误") + return {"error": f"[{e.__class__.__name__}] 暂时无法访问面板数据接口.."} + else: + logger.info(f"从 {root} 获取面板失败,正在自动切换镜像重试...") + if not resJson.get("playerInfo"): + return {"error": f"玩家 {uid} 返回信息不全,接口可能正在维护.."} + if not resJson.get("avatarInfoList"): + return {"error": f"玩家 {uid} 的角色展柜详细数据已隐藏!"} + if not resJson["playerInfo"].get("showAvatarInfoList"): + return {"error": f"玩家 {uid} 的角色展柜内还没有角色哦!"} + return resJson + + +async def queryDamageApi(body: Dict, mode: Literal["single", "team"] = "single") -> Dict: + """ + 角色伤害计算数据请求(提瓦特小助手) + + * ``param body: Dict`` 查询角色数据 + * ``param mode: Literal["single", "team"] = "single"`` 查询接口类型,默认请求角色伤害接口,传入 ``"team"`` 请求队伍伤害接口 + - ``return: Dict`` 查询结果,出错时返回 ``{}`` + """ + apiMap = { + "single": "https://api.lelaer.com/ys/getDamageResult.php", + "team": "https://api.lelaer.com/ys/getTeamResult.php", + } async with AsyncClient() as client: try: - res = await client.get( - url=f"{root}/u/{uid}/__data.json", + res = await client.post( + apiMap[mode], + json=body, headers={ - "Accept": "application/json", - "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-US;q=0.7", - "Cache-Control": "no-cache", - "Cookie": "locale=zh-CN", - "Referer": "https://enka.network/", - "User-Agent": ( # "Miao-Plugin/3.0", - "Mozilla/5.0 (Linux; Android 12; Nexus 5) " - "AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/102.0.0.0 Mobile Safari/537.36" + "referer": "https://servicewechat.com/wx2ac9dce11213c3a8/192/page-frame.html", + "user-agent": ( + "Mozilla/5.0 (Linux; Android 12; SM-G977N Build/SP1A.210812.016; wv) " + "AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/86.0.4240.99 " + "XWEB/4375 MMWEBSDK/20221011 Mobile Safari/537.36 MMWEBID/4357 " + "MicroMessenger/8.0.30.2244(0x28001E44) WeChat/arm64 Weixin GPVersion/1 " + "NetType/WIFI Language/zh_CN ABI/arm64 MiniProgramEnv/android" ), }, - timeout=20.0, ) - resJson = res.json() - resJson["time"] = int(time()) - if not resJson.get("playerInfo"): - raise HTTPError("返回信息不全") - if not resJson["playerInfo"].get("showAvatarInfoList"): - return {"error": f"UID{uid} 的角色展柜内还没有角色哦!"} - if not resJson.get("avatarInfoList"): - return {"error": f"UID{uid} 的角色展柜详细数据已隐藏!"} - (LOCAL_DIR / "cache" / f"{uid}__data.json").write_text( - json.dumps(resJson, ensure_ascii=False, indent=2), encoding="utf-8" - ) - # 返回 Enka.Network API 查询结果 - if charId == "000": - return { - "list": [ - [ - nameCn - for nameCn, cId in name2id.items() - if cId == str(x["avatarId"]) - ][0] - for x in resJson["playerInfo"]["showAvatarInfoList"] - if x["avatarId"] not in [10000005, 10000007] - ] - } - elif [x for x in resJson["avatarInfoList"] if str(x["avatarId"]) == charId]: - return [ - x for x in resJson["avatarInfoList"] if str(x["avatarId"]) == charId - ][0] - else: - return {"error": f"UID{uid} 的最新数据中未发现该角色!"} - except (HTTPError or json.decoder.JSONDecodeError): - return {"error": "暂时无法访问面板数据接口.."} + return res.json() + except (HTTPError, json.decoder.JSONDecodeError) as e: + logger.opt(exception=e).error("提瓦特小助手接口无法访问或返回错误") + return {} except Exception as e: - # 出错时返回 {"error": "错误信息"} - print(f"请求 Enka.Network 出错 {type(e)}:{e}") - return {"error": f"[{e.__class__.__name__}]面板数据处理出错辣.."} + logger.opt(exception=e).error("提瓦特小助手接口错误") + return {} -async def getAffixCfg(char: str, base: Dict) -> Tuple[Dict, Dict, Dict]: +async def getAvatarData(uid: str, char: str = "全部") -> Dict: """ - 指定角色词条配置获取,包括词条评分权重、词条数值原始权重、各位置圣遗物总分理论最高分和主词条理论最高得分 + 角色数据获取(内部格式) - * ``param char: str`` 指定角色名 - * ``param base: Dict`` 指定角色的基础数值,可由 Enka 返回直接传入,格式为 ``{"生命值": 1, "攻击力": 1, "防御力": 1}`` - - ``return: Tuple[Dict, Dict, Dict]`` 词条评分权重、词条数值原始权重、各位置圣遗物最高得分 - """ - allCfg = json.loads((LOCAL_DIR / "calc-rule.json").read_text(encoding="utf-8")) - assert isinstance(allCfg, Dict) - affixWeight = allCfg.get(char, {"攻击力百分比": 75, "暴击率": 100, "暴击伤害": 100}) - affixWeight = dict(sorted(affixWeight.items(), key=lambda item: (item[1], "暴击" in item[0], "加成" in item[0], "元素" in item[0]), reverse=True)) - - pointMark = {k: v / GROW_VALUE[k] for k, v in affixWeight.items()} - if pointMark.get("攻击力百分比"): - pointMark["攻击力"] = pointMark["攻击力百分比"] / base.get("攻击力", 1020) * 100 - if pointMark.get("防御力百分比"): - pointMark["防御力"] = pointMark["防御力百分比"] / base.get("防御力", 300) * 100 - if pointMark.get("生命值百分比"): - pointMark["生命值"] = pointMark["生命值百分比"] / base.get("生命值", 400) * 100 - maxMark = {"1": {}, "2": {}, "3": {}, "4": {}, "5": {}} - for posIdx in range(1, 5 + 1): - if posIdx <= 2: - mainAffix = "生命值" if posIdx == 1 else "攻击力" - maxMark[str(posIdx)]["main"] = 0 - maxMark[str(posIdx)]["total"] = 0 - else: - avalMainAffix = {k: v for k, v in affixWeight.items() if k in MAIN_AFFIXS[str(posIdx)]} - - print(f"posIdx:{posIdx} mainAffix:\n{avalMainAffix}") - mainAffix = list(avalMainAffix)[0] - maxMark[str(posIdx)]["main"] = affixWeight[mainAffix] - maxMark[str(posIdx)]["total"] = affixWeight[mainAffix] * 2 - maxSubAffixs = {k: v for k, v in affixWeight.items() if k in SUB_AFFIXS and k != mainAffix and affixWeight.get(k)} - - print(f"posIdx:{posIdx} subAffix:\n{maxSubAffixs}") - maxMark[str(posIdx)]["total"] += sum(affixWeight[k] * (1 if kIdx else 6) for kIdx, k in enumerate(list(maxSubAffixs)[:4])) - - print(f"「{char}」角色词条配置:\naffixWeight:\n {affixWeight}\npointMark:\n {pointMark}\nmaxMark:\n {maxMark}") - - return affixWeight, pointMark, maxMark - - -async def getPanelMsg(uid: str, char: str = "all", refresh: bool = False) -> Dict: - """ - 原神游戏内角色展柜消息生成,针对原始数据进行文本翻译和结构重排。 - - * ``param uid: str`` 指定查询用户 UID - * ``param char: str = "all"`` 指定查询角色 - * ``param refresh: bool = False`` 指定是否强制刷新数据 + * ``param uid: str`` 查询用户 UID + * ``param char: str = "全部"`` 查询角色名 - ``return: Dict`` 查询结果。出错时返回 ``{"error": "错误信息"}`` """ - # 获取查询角色 ID - name2id = json.loads((LOCAL_DIR / "name2id.json").read_text(encoding="utf-8")) - charId = "000" if char == "all" else name2id.get(char, "阿巴") - if not charId.isdigit(): - return {"error": f"「{char}」是哪个角色?"} - # 获取面板数据 - raw = await getRawData(uid, charId=charId, refresh=refresh, name2id=name2id) - if raw.get("error"): - return raw - if char == "all": - return { - "msg": f"成功获取了 UID{uid} 的{'、'.join(raw['list'])}等 {len(raw['list'])} 位角色数据!" - } - - # 加载模板、翻译等资源 - tpl = (LOCAL_DIR / "tpl.html").read_text(encoding="utf-8") - loc = json.loads((LOCAL_DIR / "TextMapCHS.json").read_text(encoding="utf-8")) - characters = json.loads((LOCAL_DIR / "characters.json").read_text(encoding="utf-8")) - propData, equipData = raw["fightPropMap"], raw["equipList"] - # 加载角色数据(抽卡图片、命座、技能图标配置等) - charData = characters[str(raw["avatarId"])] - # 加载角色词条配置 - base = {"生命值": propData["1"], "攻击力": propData["4"], "防御力": propData["7"]} - affixWeight, pointMark, maxMark = await getAffixCfg(char, base) - dlTasks = [] # 所有待下载任务 - - # 准备好了吗,要开始了哦! - - # 元素背景 - tpl = tpl.replace("{{elem_type}}", f"elem_{ELEM[charData['Element']]}") - - # 角色大图 - charImgName = ( - charData["Costumes"][str(raw["costumeId"])]["art"] - if raw.get("costumeId") - else charData["SideIconName"].replace( - "UI_AvatarIcon_Side", "UI_Gacha_AvatarImg" - ) - ) - charImg = LOCAL_DIR / char / f"{charImgName}.png" - dlTasks.append( - download(f"https://enka.network/ui/{charImgName}.png", local=charImg) - ) - tpl = tpl.replace("{{char_img}}", str(charImg.resolve().as_posix())) - - # 角色信息 - tpl = tpl.replace( - "", - f""" -
    {char}
    -
    - UID {uid} - Lv.{raw["propMap"]["4001"]["val"]} - ♥ {raw["fetterInfo"]["expLevel"]} -
    - """, - ) - - # 命座数据 - consActivated, consHtml = len(raw.get("talentIdList", [])), [] - for cIdx, consImgName in enumerate(charData["Consts"]): - # 图像下载及模板替换 - consImg = LOCAL_DIR / char / f"{consImgName}.png" - dlTasks.append( - download(f"https://enka.network/ui/{consImgName}.png", local=consImg) - ) - consHtml.append( - f""" -
    -
    consActivated else ""}"> -
    -
    -
    - """ - ) - tpl = tpl.replace("", "".join(consHtml)) - - # 技能数据 - extraLevels = {k[-1]: v for k, v in raw.get("proudSkillExtraLevelMap", {}).items()} - for idx, skillId in enumerate(charData["SkillOrder"]): - # 实际技能等级、显示技能等级 - level = raw["skillLevelMap"][str(skillId)] - currentLvl = level + extraLevels.get(list(SKILL)[idx], 0) - # 图像下载及模板替换 - skillImgName = charData["Skills"][str(skillId)] - skillImg = LOCAL_DIR / char / f"{skillImgName}.png" - dlTasks.append( - download(f"https://enka.network/ui/{skillImgName}.png", local=skillImg) - ) - tpl = tpl.replace( - f"", - f""" -
    level else ""} {"talent-crown" if level == 10 else ""}"> -
    - {currentLvl} -
    - """, - ) - - # 面板数据 - # 显示物理伤害加成或元素伤害加成中数值最高者 - phyDmg = round(propData["30"] * 100, 1) - elemDmg = sorted( - [{"type": DMG[d], "value": round(propData[d] * 100, 1)} for d in DMG], - key=lambda x: x["value"], - reverse=True, - )[0] - if phyDmg > elemDmg["value"]: - dmgType, dmgValue = "物理伤害加成", phyDmg - elif elemDmg["value"] == 0: - dmgType, dmgValue = f"{ELEM[charData['Element']]}元素伤害加成", 0 + # 总是先读取一遍缓存 + cache = LOCAL_DIR / "cache" / f"{uid}.json" + if cache.exists(): + cacheData = json.loads(cache.read_text(encoding="utf-8")) + nextQueryTime = cacheData["next"] else: - dmgType, dmgValue = f"{elemDmg['type']}元素伤害加成", elemDmg["value"] - # 模板替换,奶妈角色额外显示治疗加成,元素伤害异常时评分权重显示提醒 - tpl = tpl.replace( - "", - f""" -
  • 生命值 - {("" + str(affixWeight["生命值百分比"]) + "") if affixWeight.get("生命值百分比") else ""} - {round(propData["2000"])} - {round(propData["1"])}+{round(propData["2000"] - propData["1"])} -
  • -
  • 攻击力 - {("" + str(affixWeight["攻击力百分比"]) + "") if affixWeight.get("攻击力百分比") else ""} - {round(propData["2001"])} - {round(propData["4"])}+{round(propData["2001"] - propData["4"])} -
  • -
  • 防御力 - {("" + str(affixWeight["防御力百分比"]) + "") if affixWeight.get("防御力百分比") else ""} - {round(propData["2002"])} - {round(propData["7"])}+{round(propData["2002"] - propData["7"])} -
  • -
  • 暴击率 - {("" + str(affixWeight["暴击率"]) + "") if affixWeight.get("暴击率") else ""} - {round(propData["20"] * 100, 1)}% -
  • -
  • 暴击伤害 - {("" + str(affixWeight["暴击伤害"]) + "") if affixWeight.get("暴击伤害") else ""} - {round(propData["22"] * 100, 1)}% -
  • -
  • 元素精通 - {("" + str(affixWeight["元素精通"]) + "") if affixWeight.get("元素精通") else ""} - {round(propData["28"])} -
  • - {f'''
  • 治疗加成 - {("" + str(affixWeight["治疗加成"]) + "")} - {round(propData["26"] * 100, 1)}% -
  • ''' if affixWeight.get("治疗加成") else ""} -
  • 元素充能效率 - {("" + str(affixWeight["元素充能效率"]) + "") if affixWeight.get("元素充能效率") else ""} - {round(propData["23"] * 100, 1)}% -
  • -
  • {dmgType} - { - ( - "" + str(affixWeight[dmgType[-6:]]) + "" - ) - if affixWeight.get(dmgType[-6:]) - else "" - } - {dmgValue}% -
  • - """, - ) + cacheData, nextQueryTime = {}, 0 - # 装备数据(圣遗物、武器) - equipsMark, equipsCnt = 0.0, 0 - for equip in equipData: - if equip["flat"]["itemType"] == "ITEM_WEAPON": - # 武器精炼等级 - affixCnt = list(equip["weapon"].get("affixMap", {".": 0}).values())[0] + 1 - # 图像下载及模板替换 - weaponImgName = equip["flat"]["icon"] - weaponImg = LOCAL_DIR / "weapon" / f"{weaponImgName}.png" - dlTasks.append( - download( - f"https://enka.network/ui/{weaponImgName}.png", local=weaponImg - ) - ) - tpl = tpl.replace( - "", - f""" - -
    - {loc.get(equip["flat"]["nameTextMapHash"], "缺少翻译")} -
    - Lv.{equip["weapon"]["level"]} 精{affixCnt} -
    - """, - ) - elif equip["flat"]["itemType"] == "ITEM_RELIQUARY": - mainProp = equip["flat"]["reliquaryMainstat"] # type: Dict - subProps = equip["flat"].get("reliquarySubstats", []) # type: List - posIdx = POS.index(equip["flat"]["equipType"]) + 1 - # 主词条得分(与副词条计算规则一致,但只取 25%),角色元素属性与伤害属性不同时不得分,不影响物理伤害得分 - calcMain = ( - 0.0 - if posIdx < 3 - else pointMark.get( - PROP[mainProp["mainPropId"]].replace(ELEM[charData["Element"]], ""), - 0, - ) - * mainProp["statValue"] - * 46.6 - / 6 - / 100 - / 4 - ) - # 副词条得分 - calcSubs = [ - # [词条名, 词条数值, 词条得分] - [ - PROP[s["appendPropId"]], - s["statValue"], - pointMark.get(PROP[s["appendPropId"]], 0) - * s["statValue"] - * 46.6 - / 6 - / 100, - ] - for s in subProps - ] - # 主词条收益系数(百分数),沙杯头位置主词条不正常时对圣遗物总分进行惩罚,最多扣除 50% 总分 - calcMainPct = ( - 100 - if posIdx < 3 - else ( - 100 - - 50 - * ( - 1 - - pointMark.get( - PROP[mainProp["mainPropId"]].replace( - ELEM[charData["Element"]], "" - ), - 0, + if int(time()) <= nextQueryTime: + logger.info("UID{} 的角色展柜数据刷新冷却还有 {} 秒!".format(uid, nextQueryTime - int(time()))) + else: + logger.info(f"UID{uid} 的角色展柜数据正在刷新!") + newData = await queryPanelApi(uid) + if not cacheData and newData.get("error"): + return newData + elif not newData.get("error"): + avatarsCache = {str(x["id"]): x for x in cacheData.get("avatars", [])} + now, wait4Dmg, avatars, avatarIdsNew = int(time()), {}, [], [] + for newAvatar in newData["avatarInfoList"]: + if newAvatar["avatarId"] in [10000005, 10000007]: + logger.info("旅行者面板查询暂未支持!") + continue + tmp, gotDmg = await transFromEnka(newAvatar, now), False + + if str(tmp["id"]) in avatarsCache: + # 保留旧的伤害计算数据 + avatarsCache[str(tmp["id"])].pop("time") + cacheDmg = avatarsCache[str(tmp["id"])].pop("damage") + nowStat = { + k: v for k, v in tmp.items() if k not in ["damage", "time"] + } + if cacheDmg and avatarsCache[str(tmp["id"])] == nowStat: + logger.info(f"UID{uid} 的 {tmp['name']} 伤害计算结果无需刷新!") + tmp["damage"], gotDmg = cacheDmg, True + else: + logger.info( + "UID{} 的 {} 数据发生变化:\n{}\n{}".format( + uid, tmp["name"], avatarsCache[str(tmp["id"])], nowStat + ) ) - * mainProp["statValue"] - / maxMark[str(posIdx)]["main"] - / 2 - / 4 + avatarIdsNew.append(tmp["id"]) + avatars.append(tmp) + if not gotDmg: + wait4Dmg[str(len(avatars) - 1)] = tmp + + if wait4Dmg: + logger.info( + "正在为 UID{} 的 {} 重新请求伤害计算接口".format( + uid, "/".join(f"[{aI}]{a['name']}" for aI, a in wait4Dmg.items()) ) ) - ) - # 总分对齐系数(百分数),按满分 66 对齐各位置圣遗物的总分 - calcTotalPct = 66 / (maxMark[str(posIdx)]["total"] * 46.6 / 6 / 100) * 100 - # 最终圣遗物总分 - calcTotal = ( - (calcMain + sum(s[2] for s in calcSubs)) - * calcMainPct - / 100 - * calcTotalPct - / 100 - ) - # 最终圣遗物评级 - calcRankStr = ( - [ - r[0] - for r in [ - ["D", 10], - ["C", 16.5], - ["B", 23.1], - ["A", 29.7], - ["S", 36.3], - ["SS", 42.9], - ["SSS", 49.5], - ["ACE", 56.1], - ["ACE²", 66], - ] - if calcTotal <= r[1] - ][0] - if calcTotal <= 66 - else "E" - ) - # 累积圣遗物套装评分和计数器 - equipsMark += calcTotal - equipsCnt += 1 - # 图像下载及模板替换 - artiImgName = equip["flat"]["icon"] - artiImg = LOCAL_DIR / "artifacts" / f"{artiImgName}.png" - dlTasks.append( - download(f"https://enka.network/ui/{artiImgName}.png", local=artiImg) - ) - tpl = tpl.replace( - f"", - f""" -
    - - +{equip["reliquary"]["level"] - 1} -
    -
    - {loc.get(equip["flat"]["nameTextMapHash"], "缺少翻译")} - {round(calcTotal, 1)}分 - {calcRankStr} -
    -
      -
    • - {kStr(PROP[mainProp["mainPropId"]])} - +{vStr(PROP[mainProp["mainPropId"]], mainProp["statValue"])} - {round(calcMain, 1) if calcMain else "-"} -
    • - {"".join( - '''
    • {}+{} - {} -
    • '''.format( - "great" if affixWeight.get(f'{s[0]}百分比' if s[0] in ["生命值", "攻击力", "防御力"] else s[0], 0) > 79.9 else ("useful" if s[2] else "nouse"), - kStr(s[0]), vStr(s[0], s[1]), round(s[2], 1) - ) for s in calcSubs - )} -
    -
      - {f''' -
    • - 主词条收益系数 - - * {round(calcMainPct, 1)}% - -
    • ''' if posIdx >= 3 else ""} -
    • - 总分对齐系数 - * {round(calcTotalPct, 1)}% -
    • -
    - """, - ) + # 深拷贝避免转换对上下文中的 avatars 产生影响 + wtf = deepcopy([a for _, a in wait4Dmg.items()]) + teyvatBody = await transToTeyvat(wtf, uid) + teyvatRaw = await queryDamageApi(teyvatBody) + if teyvatRaw.get("code", "x") != 200 or len(wait4Dmg) != len( + teyvatRaw.get("result", []) + ): + logger.error( + ( + f"UID{uid} 的 {len(wait4Dmg)} 位角色伤害计算请求失败!" + f"\n>>>> [提瓦特返回] {teyvatRaw}" + ) + ) + else: + for dmgIdx, dmgData in enumerate(teyvatRaw.get("result", [])): + aIdx = int(list(wait4Dmg.keys())[dmgIdx]) + avatars[aIdx]["damage"] = await simplDamageRes(dmgData) - # # 评分时间 - # tpl = tpl.replace("", f"@ {strftime('%m-%d %H:%M', localtime(raw['time']))}") - # 圣遗物总分 - equipsMarkLevel = ( - [ - r[0] - for r in [ - ["D", 10], - ["C", 16.5], - ["B", 23.1], - ["A", 29.7], - ["S", 36.3], - ["SS", 42.9], - ["SSS", 49.5], - ["ACE", 56.1], - ["ACE²", 66], + cacheData["avatars"] = [ + *avatars, + *[ + aData + for _, aData in avatarsCache.items() + if aData["id"] not in avatarIdsNew + ], ] - if equipsMark / equipsCnt <= r[1] - ][0] - if equipsCnt and equipsMark <= 66 * equipsCnt - else "E" - ) - tpl = tpl.replace("{{total_mark_lvl}}", equipsMarkLevel) - tpl = tpl.replace("{{total_mark}}", str(round(equipsMark, 1))) + cacheData["next"] = now + newData["ttl"] + cache.write_text( + json.dumps(cacheData, ensure_ascii=False, indent=2), encoding="utf-8" + ) - # 下载所有图片 + # 获取所需角色数据 + if char == "全部": + return cacheData + searchRes = [x for x in cacheData["avatars"] if x["name"] == char] + return ( + { + "error": "玩家 {} 游戏内展柜中的 {} 位角色中没有 {}!".format( + uid, len(cacheData["avatars"]), char + ) + } + if not searchRes + else searchRes[0] + ) + + +async def getPanel(uid: str, char: str = "全部") -> Union[bytes, str]: + """ + 原神游戏内角色展柜消息生成入口 + + * ``param uid: str`` 查询用户 UID + * ``param char: str = "全部"`` 查询角色 + - ``return: Union[bytes, str]`` 查询结果。一般返回图片字节,出错时返回错误信息字符串 + """ + # 获取面板数据 + data = await getAvatarData(uid, char) + if data.get("error"): + return data["error"] + if char == "全部": + return "成功获取了 UID{} 的{}等 {} 位角色数据!".format( + uid, "、".join(a["name"] for a in data["avatars"]), len(data["avatars"]) + ) + + # 图标下载任务 + dlTasks = [ + download(data["icon"], local=char), + download(data["gachaAvatarImg"], local=char), + *[download(sData["icon"], local=char) for _, sData in data["skills"].items()], + *[download(conData["icon"], local=char) for conData in data["consts"]], + download(data["weapon"]["icon"], local="weapon"), + *[download(relicData["icon"], local="artifacts") for relicData in data["relics"]], + ] await asyncio.gather(*dlTasks) dlTasks.clear() # 渲染截图 - tmpFile = LOCAL_DIR / f"{uid}-{char}.html" - tmpFile.write_text(tpl, encoding="utf-8") - print("启动浏览器截图..") - browser = await getBrowser() - if not browser: - return {"error": "无法生成图片!"} + data["fightProp"] = await simplFightProp( + data["fightProp"], data["baseProp"], char, data["element"] + ) + htmlBase = str(LOCAL_DIR.resolve()) + return await template_to_pic( + template_path=htmlBase, + template_name=f"panel-{TPL_VERSION}.html", + templates={"css": TPL_VERSION, "uid": uid, "data": data}, + pages={ + "device_scale_factor": SCALE_FACTOR, + "viewport": {"width": 600, "height": 300}, + "base_url": f"file://{htmlBase}", + }, + wait=2, + ) + + +async def getTeam(uid: str, chars: List[str] = []) -> Union[bytes, str]: + """ + 队伍伤害消息生成入口 + + * ``param uid: str`` 查询用户 UID + * ``param chars: List[str] = []`` 查询角色,为空默认数据中前四个 + - ``return: Union[bytes, str]`` 查询结果。一般返回图片字节,出错时返回错误信息字符串 + """ + # 获取面板数据 + data = await getAvatarData(uid, "全部") + if data.get("error"): + return data["error"] + + if chars: + extract = [a for a in data["avatars"] if a["name"] in chars] + if len(extract) != len(chars): + gotThis = [a["name"] for a in extract] + return "玩家 {} 的最新数据中未发现{}!".format( + uid, "、".join(c for c in chars if c not in gotThis) + ) + elif len(data["avatars"]) >= 4: + extract = data["avatars"][:4] + logger.info( + "UID{} 未指定队伍,自动选择面板中前 4 位进行计算:{} ...".format( + uid, "、".join(a["name"] for a in extract) + ) + ) + else: + return f"玩家 {uid} 的面板数据甚至不足以组成一支队伍呢!" + + # 图片下载任务 + for tmp in extract: + dlTasks = [ + download(tmp["icon"], local=tmp["name"]), + *[ + download(sData["icon"], local=tmp["name"]) + for _, sData in tmp["skills"].items() + ], + download(tmp["weapon"]["icon"], local="weapon"), + *[ + download( + f"UI_RelicIcon_{relicData['icon'].split('_')[-2]}_4", + local="artifacts", + ) + for relicData in tmp["relics"] + ], + ] + await asyncio.gather(*dlTasks) + dlTasks.clear() + + teyvatBody = await transToTeyvat(deepcopy(extract), uid) + teyvatRaw = await queryDamageApi(teyvatBody, "team") + if teyvatRaw.get("code", "x") != 200 or not teyvatRaw.get("result"): + logger.error( + (f"UID{uid} 的 {len(extract)} 位角色队伍伤害计算请求失败!" f"\n>>>> [提瓦特返回] {teyvatRaw}") + ) + return f"玩家 {uid} 队伍伤害计算失败,接口可能发生变动!" if teyvatRaw else "啊哦,队伍伤害计算小程序状态异常!" try: - page = await browser.new_page() - await page.set_viewport_size({"width": 1000, "height": 1500}) - await page.goto("file://" + str(tmpFile.resolve()), timeout=50000) - card = await page.query_selector("body") - assert card is not None - picBytes = await card.screenshot(timeout=50000) - bio = io.BytesIO(picBytes) - bio.name = "card.png" - print(f"图片大小 {len(picBytes)} 字节") - # _ = Image.open(BytesIO(picBytes)).save( - # str(tmpFile.resolve()).replace(".html", ".png") - # ) - await page.close() - tmpFile.unlink(missing_ok=True) - return {"pic": bio} + data = await simplTeamDamageRes( + teyvatRaw["result"], {a["name"]: a for a in extract} + ) except Exception as e: - print(f"生成角色圣遗物评分图片失败 {type(e)}:{e}") - return {"error": "生成角色圣遗物评分总图失败!"} + logger.opt(exception=e).error("队伍伤害数据解析出错") + return f"[{e.__class__.__name__}] 队伍伤害数据解析出错咯" + + htmlBase = str(LOCAL_DIR.resolve()) + return await template_to_pic( + template_path=htmlBase, + template_name=f"team-{TPL_VERSION}.html", + templates={"css": TPL_VERSION, "data": data}, + pages={ + "device_scale_factor": SCALE_FACTOR, + "viewport": {"width": 600, "height": 300}, + "base_url": f"file://{htmlBase}", + }, + wait=2, + ) diff --git a/plugins/bind.py b/plugins/bind.py index 0c19ba8..6d84d8c 100644 --- a/plugins/bind.py +++ b/plugins/bind.py @@ -3,6 +3,8 @@ from pyrogram.types import Message from defs.bind import check_bind, set_bind, remove_bind from ci import app, me +uidStart = ["1", "2", "5", "6", "7", "8", "9"] + @app.on_message(filters.command(["bind", f"bind@{me['result']['username']}"]) & filters.private) async def bind_command(_: Client, message: Message): @@ -11,12 +13,14 @@ async def bind_command(_: Client, message: Message): return await message.reply("使用 `/info [uid(可选)]` 查询角色缓存状态", quote=True) else: return await message.reply("请使用 /bind [uid] 绑定游戏 uid", quote=True) - if not message.command[1].isdigit(): - if message.command[1] == "remove": + uid = message.command[1] + if not uid.isdigit(): + if uid == "remove": remove_bind(message.from_user.id) return await message.reply("已解除绑定", quote=True) return await message.reply("uid 非数字", quote=True) - uid = message.command[1] + elif uid[0] not in uidStart or len(uid) != 9: + return await message.reply("uid 格式错误", quote=True) set_bind(message.from_user.id, uid) await message.reply(f"绑定成功,您绑定的游戏 uid 为:{uid}\n\n" f"请将角色放入展柜,开启显示详细信息后,使用 /refresh 刷新数据。", quote=True) diff --git a/plugins/callback.py b/plugins/callback.py index 303cb23..fa03756 100644 --- a/plugins/callback.py +++ b/plugins/callback.py @@ -13,7 +13,6 @@ async def answer_callback(_: Client, callback_query: CallbackQuery): uid = data[0] char = callback_query.data.split("|")[1] if len(data) > 1 else None data = Player(uid) - data.restore() if not data.all_char: return await callback_query.answer("没有可展示的角色,可能是数据未刷新", show_alert=True) if not char: @@ -21,9 +20,9 @@ async def answer_callback(_: Client, callback_query: CallbackQuery): InputMediaPhoto(media=f"resources{sep}Kitsune.png", caption=f"请选择 {data.name} 的一个角色:"), reply_markup=data.gen_keyboard()) - if char_data := next((i for i in data.all_char if i.get("name", "") == char), None): + if char_data := next((i for i in data.all_char if i.name == char), None): await callback_query.message.edit_media( - InputMediaPhoto(media=char_data["file_id"]), + InputMediaPhoto(media=char_data.file_id), reply_markup=data.gen_back()) else: return await callback_query.answer("没有可展示的角色,可能是数据未刷新", show_alert=True) diff --git a/plugins/info.py b/plugins/info.py index 885961e..f4ab410 100644 --- a/plugins/info.py +++ b/plugins/info.py @@ -13,5 +13,10 @@ async def info_command(_: Client, message: Message): if len(message.command) > 1 and message.command[1].isnumeric(): uid = message.command[1] data = Player(uid) - data.restore() - return await message.reply(f"游戏 uid 为 {uid} 的角色缓存有:\n\n" f"{data.gen_all_char()}", quote=True) if data.all_char else await message.reply("没有可展示的角色,可能是数据未刷新", quote=True) + return await message.reply( + f"游戏 uid 为 {uid} 的角色缓存有:\n\n{data.gen_all_char()}", + quote=True, + ) if data.all_char else await message.reply( + "没有可展示的角色,可能是数据未刷新", + quote=True, + ) diff --git a/plugins/inline.py b/plugins/inline.py index 47fa874..133e2a7 100644 --- a/plugins/inline.py +++ b/plugins/inline.py @@ -20,18 +20,20 @@ async def answer_callback(_: Client, query: InlineQuery): switch_pm_parameter="start", ) data = Player(uid) - data.restore() if not data.all_char: return await query.answer( results=[], switch_pm_text=f'{emoji.CROSS_MARK} 没有搜索到任何结果', switch_pm_parameter="start", ) - inline_data = [] - for i in data.all_char: - inline_data.append(InlineQueryResultCachedPhoto(photo_file_id=i["file_id"], - title=i["name"], - description=data.name)) - await query.answer(inline_data, - switch_pm_text=f'{emoji.KEY} 搜索到了 {len(data.all_char)} 个角色', - switch_pm_parameter="start") + inline_data = [ + InlineQueryResultCachedPhoto( + photo_file_id=i.file_id, title=i.name, description=data.name + ) + for i in data.all_char + ] + await query.answer( + inline_data, + switch_pm_text=f'{emoji.KEY} 搜索到了 {len(data.all_char)} 个角色', + switch_pm_parameter="start", + ) diff --git a/plugins/search.py b/plugins/search.py index b280715..8f3aa07 100644 --- a/plugins/search.py +++ b/plugins/search.py @@ -20,10 +20,11 @@ async def search_command(_: Client, message: Message): if not uid: return await message.reply("请使用 /search [uid] 或 /bind [uid] 绑定账号后搜索", quote=True) data = Player(uid) - data.restore() if not data.all_char: return await message.reply("没有可展示的角色,可能是数据未刷新", quote=True) - await message.reply_photo(f"resources{sep}Kitsune.png", - caption=f"请选择 {data.name} 的一个角色:", - quote=True, - reply_markup=data.gen_keyboard()) + await message.reply_photo( + f"resources{sep}Kitsune.png", + caption=f"请选择 {data.name} 的一个角色:", + quote=True, + reply_markup=data.gen_keyboard(), + ) diff --git a/requirements.txt b/requirements.txt index 8cc697f..e5aea26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ -httpx -pyrogram==2.0.49 +httpx~=0.23.0 +pyrogram==2.0.97 TGCrypto -sqlitedict -playwright +sqlitedict~=2.0.0 +playwright~=1.25.2 +uvicorn~=0.20.0 +Jinja2~=3.1.2 +pydantic~=1.10.4