!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@antv/g")):"function"==typeof define&&define.amd?define(["@antv/g"],e):"object"==typeof exports?exports.GUI=e(require("@antv/g")):t.GUI=e(t.G)}(window,(function(t){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=13)}([function(e,n){e.exports=t},,,,,function(t,e,n){var i=n(9),r=n(10),o=Object.hasOwnProperty,s=Object.create(null);for(var a in i)o.call(i,a)&&(s[i[a]]=a);var l=t.exports={to:{},get:{}};function u(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}l.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=l.get.hsl(t),n="hsl";break;case"hwb":e=l.get.hwb(t),n="hwb";break;default:e=l.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},l.get.rgb=function(t){if(!t)return null;var e,n,r,s=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var a=2*n;s[n]=parseInt(e.slice(a,a+2),16)}r&&(s[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)s[n]=parseInt(e[n]+e[n],16);r&&(s[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)s[n]=parseInt(e[n+1],0);e[4]&&(e[5]?s[3]=.01*parseFloat(e[4]):s[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:o.call(i,e[1])?((s=i[e[1]])[3]=1,s):null:null;for(n=0;n<3;n++)s[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?s[3]=.01*parseFloat(e[4]):s[3]=parseFloat(e[4]))}for(n=0;n<3;n++)s[n]=u(s[n],0,255);return s[3]=u(s[3],0,1),s},l.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.to.hex=function(){var t=r(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},l.to.rgb=function(){var t=r(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},l.to.rgb.percent=function(){var t=r(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+i+"%)":"rgba("+e+"%, "+n+"%, "+i+"%, "+t[3]+")"},l.to.hsl=function(){var t=r(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},l.to.hwb=function(){var t=r(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},l.to.keyword=function(t){return s[t.slice(0,3)]}},function(t,e,n){var i=n(12).parse;i.parseSVG=i,i.makeAbsolute=function(t){var e,n={x:0,y:0},i={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return t.forEach((function(t){for(var r in"moveto"===t.command&&(e=t),t.x0=n.x,t.y0=n.y,i)r in t&&(t[r]+=t.relative?t[i[r]]:0);"x"in t||(t.x=n.x),"y"in t||(t.y=n.y),t.relative=!1,t.code=t.code.toUpperCase(),"closepath"==t.command&&(t.x=e.x,t.y=e.y),n=t})),t},t.exports=i},,,function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){"use strict";var i=n(11),r=Array.prototype.concat,o=Array.prototype.slice,s=t.exports=function(t){for(var e=[],n=0,s=t.length;n=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){"use strict";function i(t,e,n,r){this.message=t,this.expected=e,this.found=n,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,i)}!function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(i,Error),i.buildMessage=function(t,e){var n={literal:function(t){return'"'+r(t.text)+'"'},class:function(t){var e,n="";for(e=0;e0){for(e=1,i=1;eW&&(W=R,q=[]),q.push(t))}function X(t,e,n){return new i(i.buildMessage(t,e),t,e,n)}function J(){var t,e,n,i,o;for(t=R,e=[],n=bt();n!==r;)e.push(n),n=bt();if(e!==r)if((n=function(){var t,e,n,i,o,s;if(t=R,(e=Q())!==r){for(n=[],i=R,o=[],s=bt();s!==r;)o.push(s),s=bt();for(o!==r&&(s=Q())!==r?i=o=[o,s]:(R=i,i=r);i!==r;){for(n.push(i),i=R,o=[],s=bt();s!==r;)o.push(s),s=bt();o!==r&&(s=Q())!==r?i=o=[o,s]:(R=i,i=r)}n!==r?(t,e=a(e,n),t=e):(R=t,t=r)}else R=t,t=r;return t}())===r&&(n=null),n!==r){for(i=[],o=bt();o!==r;)i.push(o),o=bt();i!==r?(t,t=e=function(t){if(!t)return[];for(var e=[],n=0;n{t&&o(t,e)})}function s(t){l(t,!0)}function a(t){l(t,!1)}function l(t,e){const n=e?"visible":"hidden";o(t,t=>{t.attr("visibility",n)})}class u extends i.Group{constructor(){super(...arguments),this.addEventListener(i.ElementEvent.INSERTED,()=>{a(this)})}}function c(t){const e=t.appendChild(new u({class:"offscreen"}));return a(e),e}function h(t){let e=t;for(;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}var d=function(t){return"object"==typeof t&&null!==t},p={}.toString,f=function(t,e){return p.call(t)==="[object "+e+"]"},g=function(t){if(!d(t)||!f(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},m=function(t){return Array.isArray?Array.isArray(t):f(t,"Array")};const b=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5;Object.entries(e).forEach(r=>{let[o,s]=r;const a=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?g(s)?(g(t[o])||(a[o]={}),n1&&void 0!==arguments[1]?arguments[1]:{};super(y({},{style:e},t)),v(this,"_defaultOptions",void 0),v(this,"_offscreen",void 0),v(this,"initialized",!1),this._defaultOptions=e}connectedCallback(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0}disconnectedCallback(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()}attributeChangedCallback(t){"visibility"===t&&x.call(this)}update(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return this.attr(y({},this.attributes,e)),null===(t=this.render)||void 0===t?void 0:t.call(this,this.attributes,this,n)}clear(){this.removeChildren()}bindEvents(t,e){}}function S(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class k extends i.Text{get offscreenGroup(){return this._offscreen||(this._offscreen=c(this)),this._offscreen}disconnectedCallback(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()}constructor(){let{style:t,...e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super({style:{text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle",...t},...e}),S(this,"_offscreen",void 0)}}function L(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function P(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}function A(t,e){return"".concat(e).concat(L(t))}function M(t,e){var n;let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e||(null===(n=t.match(/^([a-z][a-z0-9]+)/))||void 0===n?void 0:n[0])||"",o=t.replace(new RegExp("^(".concat(r,")")),"");return i?P(o):o}function E(t,e){Object.entries(e).forEach(e=>{let[n,i]=e;[t,...t.querySelectorAll(n)].filter(t=>t.matches(n)).forEach(t=>{if(!t)return;t.style.cssText+=Object.entries(i).reduce((t,e)=>"".concat(t).concat(e.join(":"),";"),"")})})}function C(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i={};return Object.entries(t).forEach(t=>{let[r,o]=t;if("className"===r||"class"===r);else if(r.startsWith("show")&&M(r,"show").startsWith(e)!==n)r===A(e,"show")?i[r]=o:i[r.replace(new RegExp(L(e)),"")]=o;else if(!r.startsWith("show")&&r.startsWith(e)!==n){const t=M(r,e);"filter"===t&&"function"==typeof o||(i[t]=o)}}),i}function B(t,e){return Object.entries(t).reduce((t,n)=>{let[i,r]=n;return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=r:t["".concat(e).concat(L(i))]=r,t},{})}function O(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["x","y","class","className"];const n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},r={};return Object.entries(t).forEach(t=>{let[o,s]=t;e.includes(o)||(-1!==n.indexOf(o)?r[o]=s:i[o]=s)}),[i,r]}var T=function(t){return f(t,"Number")};function j(t){if(T(t))return[t,t,t,t];if(m(t)){const 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]}class N extends Map{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G;if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(_(this,t))}has(t){return super.has(_(this,t))}set(t,e){return super.set(z(this,t),e)}delete(t){return super.delete(I(this,t))}}Set;function _(t,e){let{_intern:n,_key:i}=t;const r=i(e);return n.has(r)?n.get(r):e}function z(t,e){let{_intern:n,_key:i}=t;const r=i(e);return n.has(r)?n.get(r):(n.set(r,e),e)}function I(t,e){let{_intern:n,_key:i}=t;const r=i(e);return n.has(r)&&(e=n.get(r),n.delete(r)),e}function G(t){return null!==t&&"object"==typeof t?t.valueOf():t}function H(t){return t}function F(t,e,n,i){return function t(r,o){if(o>=i.length)return n(r);const s=new N,a=i[o++];let l=-1;for(const t of r){const e=a(t,++l,r),n=s.get(e);n?n.push(t):s.set(e,[t])}for(const[e,n]of s)s.set(e,t(n,o));return e(s)}(t,0)}function D(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function R(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t,e,n){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return n}var W=new WeakSet;class q{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[null,null,null,null,null],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[];D(this,W),R(this,"_elements",void 0),R(this,"_parent",void 0),R(this,"_data",void 0),R(this,"_enter",void 0),R(this,"_exit",void 0),R(this,"_update",void 0),R(this,"_merge",void 0),R(this,"_split",void 0),R(this,"_document",void 0),R(this,"_transitions",void 0),R(this,"_facetElements",void 0),this._elements=Array.from(t),this._data=e,this._parent=n,this._document=i,this._enter=r[0],this._update=r[1],this._exit=r[2],this._merge=r[3],this._split=r[4],this._transitions=o,this._facetElements=s}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new q(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new q(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new q([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:t=>t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>null;const i=[],r=[],o=new Set(this._elements),s=[],a=new Set,l=new Map(this._elements.map((t,n)=>[e(t.__data__,n),t])),u=new Map(this._facetElements.map((t,n)=>[e(t.__data__,n),t])),c=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;in(t.__data__));for(let h=0;h1&&void 0!==arguments[1]?arguments[1]:t=>t,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t=>t.remove(),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t=>t,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t=>t.remove();const r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:t=>t)(this._enter),o=t(this._update),s=e(this._exit),a=n(this._merge),l=i(this._split);return o.merge(r).merge(s).merge(a).merge(l)}remove(){for(let t=0;te.remove()):e.remove()}return new q([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;ee:e;return this.each((function(i,r){void 0!==e&&(this[t]=n.call(this,i,r))}))}style(t,e){const n="function"==typeof e&&(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])?e:()=>e;return this.each((function(i,r){void 0!==e&&(this.style[t]=n.call(this,i,r))}))}styles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.each((function(n,i){Object.entries(t).forEach(t=>{let[r,o]=t;const s="function"==typeof o&&e?o:()=>o;void 0!==o&&this.attr(r,s.call(this,n,i))})}))}update(t){const e="function"==typeof t&&(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?t:()=>t;return this.each((function(n,i){t&&this.update&&this.update(e.call(this,n,i))}))}maybeUpdate(t){const e="function"==typeof t&&(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?t:()=>t;return this.each((function(n,i){t&&this.update&&this.update(e.call(this,n,i))}))}transition(t){const{_transitions:e}=this;return this.each((function(n,i){e[i]=t.call(this,n,i)}))}on(t,e){return this.each((function(){this.addEventListener(t,e)})),this}call(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i!!t)}parent(){return this._parent}}function U(t,e){const n=this._elements[0],i=n.querySelector(t);if(i)return new q([i],null,this._parent,this._document);const r="string"==typeof e?this.createElement(e):e();return n.appendChild(r),new q([r],null,this._parent,this._document)}function K(t){return new q([t],null,t,t.ownerDocument)}function Y(t,e,n){return t.querySelector(e)?K(t).select(e):K(t).append(n)}R(q,"registry",{g:i.Group,rect:i.Rect,circle:i.Circle,path:i.Path,text:k,ellipse:i.Ellipse,image:i.Image,line:i.Line,polygon:i.Polygon,polyline:i.Polyline,html:i.HTML});var Z=function(t){return"function"==typeof t};function $(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:t=>{t.node().removeChildren()};return t?n(e):(i&&r(e),null)}const X=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]],J=X,Q=(t,e,n)=>[["M",t,e+n],["L",t,e-n]],tt=(t,e,n)=>[["M",t-n,e],["L",t+n,e]],et=tt;var nt,it,rt,ot=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},st=function(t){return f(t,"String")};function at(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lt(t){const e=function(t){let e="default";if(ot(t)&&t instanceof Image)e="image";else if(Z(t))e="symbol";else if(st(t)){const n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}class ut extends w{render(t,e){const{symbol:n,size:i=16,...r}=t,o=lt(n);$(!!o,K(e),t=>{t.maybeAppendByClassName("marker",o).attr("className","marker ".concat(o,"-marker")).call(t=>{if("image"===o){const e=2*i;t.styles({img:n,width:e,height:e,x:-i,y:-i})}else{const e=i/2,o=Z(n)?n:ut.getSymbol(n);t.styles({path:null==o?void 0:o(0,0,e),...r})}})})}}at(ut,"MARKER_SYMBOL_MAP",new Map),at(ut,"registerSymbol",(t,e)=>{ut.MARKER_SYMBOL_MAP.set(t,e)}),at(ut,"getSymbol",t=>ut.MARKER_SYMBOL_MAP.get(t)),ut.registerSymbol("cross",(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]),ut.registerSymbol("hyphen",(t,e,n)=>[["M",t-n,e],["L",t+n,e]]),ut.registerSymbol("line",Q),ut.registerSymbol("plus",(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]),ut.registerSymbol("tick",(t,e,n)=>[["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]]),ut.registerSymbol("circle",X),ut.registerSymbol("point",J),ut.registerSymbol("bowtie",(t,e,n)=>{const 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"]]}),ut.registerSymbol("hexagon",(t,e,n)=>{const 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"]]}),ut.registerSymbol("square",(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]),ut.registerSymbol("diamond",(t,e,n)=>[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]),ut.registerSymbol("triangle",(t,e,n)=>{const i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+i],["L",t,e-i],["L",t+n,e+i],["Z"]]}),ut.registerSymbol("triangle-down",(t,e,n)=>{const i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-i],["L",t+n,e-i],["L",t,e+i],["Z"]]}),ut.registerSymbol("line",Q),ut.registerSymbol("dot",tt),ut.registerSymbol("dash",et),ut.registerSymbol("smooth",(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]),ut.registerSymbol("hv",(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]),ut.registerSymbol("vh",(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]),ut.registerSymbol("hvh",(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]),ut.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));class ct extends w{constructor(t){super(t,{padding:4,spacing:4})}render(t,e){const{padding:n=0,marker:i,text:o,radius:s,spacing:a,align:l,verticalAlign:u}=t,c=C(t,"label"),h=C(t,"background"),[d,p,f,g]=j(n),m=Y(e,".tag-content","g").attr("className","tag-content").style("zIndex",0).node(),b=i?{marker:i}:{symbol:"triangle",size:0},y=Y(m,".tag-marker",()=>new ut({style:b})).attr("className","tag-marker").call(t=>{t.node().clear()}).update(b).node(),{x:v,y:x}=function(t,e){const n=t.getLocalBounds();return{x:n.halfExtents[0]?n.max[0]+(e||0):t.style.x,y:n.halfExtents[1]?(n.min[1]+n.max[1])/2:t.style.y}}(y,a);K(m).maybeAppendByClassName("tag-text",()=>new k).styles({fontSize:12,text:r(o)?"":"".concat(o),x:v,y:x,...c,textBaseline:"middle"}).call(t=>{o||t.remove()}),function(t,e,n,i,r){const o=t.getLocalBounds();let s=0,a=0;"start"===i&&(s=e),"center"===i&&(s=-o.halfExtents[0]),"end"===i&&(s=-e-2*o.halfExtents[0]),"top"===r&&(a=n+o.halfExtents[1]),"middle"===r&&(a=0),"bottom"===r&&(a=n-2*o.halfExtents[1]),t.setLocalPosition([s,a])}(m,g,d,l||"start",u||"top");const w=m.getLocalBounds();K(e).maybeAppendByClassName("tag-background","rect").styles({zIndex:-1,y:w.min[1]-d,x:w.min[0]-g,width:null!==h?g+p+2*w.halfExtents[0]:0,height:null!==h?d+f+2*w.halfExtents[1]:0,radius:null!=s?s:2,fill:"#fafafa",stroke:"#d9d9d9",lineWidth:1,...h})}}nt=ct,rt="tag",(it=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(it="tag"))in nt?Object.defineProperty(nt,it,{value:rt,enumerable:!0,configurable:!0,writable:!0}):nt[it]=rt;var ht=function(t){return void 0===t};function dt(t,e,n,i){for(var r in n=n||0,i=i||5,e)if(e.hasOwnProperty(r)){var o=e[r];null!==o&&g(o)?(g(t[r])||(t[r]={}),n{const{onClick:t,state:e}=this.attributes;"disabled"!==e&&(null==t||t.call(this,this))}),bt(this,"mouseenterEvent",()=>{const{state:t}=this.attributes;"disabled"!==t&&(this.state="active",this.render(this.attributes,this))}),bt(this,"mouseleaveEvent",()=>{const{state:t}=this.attributes;this.state=t,this.render(this.attributes,this)})}getStyle(t){const{size:e,type:n}=this.attributes,{state:i}=this,r=pt({},ft[e],gt[n][i],this.attributes.default,this.attributes[i]);return"disabled"===i&&(Object.keys(r).forEach(t=>{t in mt&&(r[t]=mt[t])}),Object.keys(mt.strict).forEach(t=>{r[t]=mt.strict[t]}),pt(r,this.attributes.disabled||{})),C(r,t)}render(t,e){const{text:n="",padding:i=0,markerSymbol:r,markerSpacing:o=0}=t;e.attr("cursor","disabled"===this.state?"not-allowed":"pointer");const[s,a,l,u]=j(i),c=this.buttonHeight,h=this.getStyle("marker"),{markerSize:d}=this,p={...h,symbol:r,x:u+d/2,y:c/2,size:d},f=Y(e,".marker",()=>new ut({className:"marker",style:p})).update({style:p}).node().getLocalBounds(),g=this.getStyle("text");this.textShape=Y(e,".text","text").attr("className","text").styles({x:d?f.max[0]+o:u,y:c/2,...g,text:n,textAlign:"left",textBaseline:"middle",wordWrap:!0,wordWrapWidth:this.textAvailableWidth,maxLines:1,textOverflow:"..."}).node();const m=this.textShape.getLocalBounds(),b=this.getStyle("button");K(e).maybeAppendByClassName(".background","rect").styles({zIndex:-1,...b,height:c,width:u+(d?d+o:0)+2*m.halfExtents[0]+a})}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.attr(pt({},this.attributes,t));const{state:e}=this.attributes;this.state=e,this.render(this.attributes,this)}setState(t){this.update({state:t})}hide(){this.style.visibility="hidden"}show(){this.style.visibility="visible"}bindEvents(){this.addEventListener("click",this.clickEvents),this.addEventListener("mouseenter",this.mouseenterEvent),this.addEventListener("mouseleave",this.mouseleaveEvent)}}bt(yt,"tag","button");var vt=function(t,e){if(t)if(m(t))for(var n=0,i=t.length;nn);const i=n.getLocalBounds(),s=2*i.halfExtents[0],a=2*i.halfExtents[1];if(g+=s,!r(l)){g>l-h&&(n.attr({x:0,y:m+a}),g=s,m+=a)}this.bindInnerEvents(n,e);const{spacing:c=0,text:d="/",style:b}=u||{};if(t!==o.length-1){const e=new k({className:"".concat(kt.tag,"-separator"),id:"".concat(kt.tag,"-separator-").concat(t),style:{x:g+c,y:m+a/2,...b,text:d,textAlign:"end",textBaseline:"middle"}});f.append(()=>e);g+=2*e.getLocalBounds().halfExtents[0]+c}}}update(t){this.attr(pt({},this.attributes,t)),this.render(this.attributes,this)}bindInnerEvents(t,e){const{items:n,onClick:i}=this.attributes;i&&t.addEventListener("click",()=>{i.call(t,e.id,e,n)})}}function Lt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;in=>t(e(n)),t)}function Pt(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function At(t,e,n,i,r){let o=n||0,s=i||t.length;const a=r||(t=>t);for(;oe?s=n:o=n+1}return o}St(kt,"tag","breadcrumb"),St(kt,"defaultOptions",{style:{separator:{text:"/",style:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},spacing:8},textStyle:{default:{fontSize:14,fill:"rgba(0, 0, 0, 0.45)"},active:{fill:"#5468ff",cursor:"pointer"}},padding:[8,8,8,8]}});const Mt=Math.sqrt(50),Et=Math.sqrt(10),Ct=Math.sqrt(2);function Bt(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),o=i/10**r;return r>=0?(o>=Mt?10:o>=Et?5:o>=Ct?2:1)*10**r:-(10**-r)/(o>=Mt?10:o>=Et?5:o>=Ct?2:1)}const Ot=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;const i=[t,e];let r,o=0,s=i.length-1,a=i[o],l=i[s];return l0?(a=Math.floor(a/r)*r,l=Math.ceil(l/r)*r,r=Bt(a,l,n)):r<0&&(a=Math.ceil(a*r)/r,l=Math.floor(l*r)/r,r=Bt(a,l,n)),r>0?(i[o]=Math.floor(a/r)*r,i[s]=Math.ceil(l/r)*r):r<0&&(i[o]=Math.ceil(a*r)/r,i[s]=Math.floor(l*r)/r),i};function Tt(t,e,n,i){const r=(t,r)=>{r&&((t,e)=>{const r=t=>i(t)%e==0;let o=e;for(;o&&!r(t);)n(t,-1),o-=1})(t,r),e(t)},o=(t,e)=>{const i=new Date(+t-1);return r(i,e),n(i,e),r(i),i};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return r(n,e),n},range:(t,e,i,s)=>{const a=[],l=Math.floor(i);for(let u=s?o(t,i):o(t);+u<+e;n(u,l),r(u))a.push(new Date(+u));return a},duration:t}}Tt(1,t=>t,(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+e)}),t=>t.getTime()),Tt(1e3,t=>{t.setMilliseconds(0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+1e3*e)}),t=>t.getSeconds()),Tt(6e4,t=>{t.setSeconds(0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+6e4*e)}),t=>t.getMinutes()),Tt(36e5,t=>{t.setMinutes(0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+36e5*e)}),t=>t.getHours()),Tt(864e5,t=>{t.setHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+864e5*e)}),t=>t.getDate()-1);const jt=Tt(2592e6,t=>{t.setDate(1),t.setHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t.getMonth();t.setMonth(n+e)}),t=>t.getMonth()),Nt=(Tt(6048e5,t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+6048e5*e)}),t=>{const e=jt.floor(t),n=new Date(+t);return Math.floor((+n-+e)/6048e5)}),Tt(31536e6,t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t.getFullYear();t.setFullYear(n+e)}),t=>t.getFullYear()),Tt(1,t=>t,(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+e)}),t=>t.getTime()),Tt(1e3,t=>{t.setUTCMilliseconds(0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+1e3*e)}),t=>t.getUTCSeconds()),Tt(6e4,t=>{t.setUTCSeconds(0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+6e4*e)}),t=>t.getUTCMinutes()),Tt(36e5,t=>{t.setUTCMinutes(0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+36e5*e)}),t=>t.getUTCHours()),Tt(864e5,t=>{t.setUTCHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+864e5*e)}),t=>t.getUTCDate()-1),Tt(2592e6,t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t.getUTCMonth();t.setUTCMonth(n+e)}),t=>t.getUTCMonth()));Tt(6048e5,t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;t.setTime(+t+6048e5*e)}),t=>{const e=Nt.floor(t),n=new Date(+t);return Math.floor((+n-+e)/6048e5)}),Tt(31536e6,t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),t=>t.getUTCFullYear());var _t={}.toString,zt=function(t,e){return _t.call(t)==="[object "+e+"]"},It=function(t){return zt(t,"Function")},Gt=function(t){return Array.isArray?Array.isArray(t):zt(t,"Array")},Ht=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var Ft=function(t,e){if(t)if(Gt(t))for(var n=0,i=t.length;n=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}Object.create;function Qt(){for(var t=0,e=0,n=arguments.length;e{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:i,interpolator:r,round:o}=this.getOptions(),s=e(i.map(t)),a=o?(t=>e=>{const n=t(e);return qt(n)?Math.round(n):n})(r):r;this.output=Lt(a,s,n,t)},n.prototype.invert=void 0}}var ie=n(5),re=n.n(ie);function oe(t,e,n){let i=n;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function se(t){const e=re.a.get(t);if(!e)return null;const{model:n,value:i}=e;return"rgb"===n?i:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,i=t[2]/100,r=t[3];if(0===n)return[255*i,255*i,255*i,r];const o=i<.5?i*(1+n):i+n-i*n,s=2*i-o;return[255*oe(s,o,e+1/3),255*oe(s,o,e),255*oe(s,o,e-1/3),r]}(i):null}const ae=(t,e)=>n=>t*(1-n)+e*n,le=(t,e)=>"number"==typeof t&&"number"==typeof e?ae(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=se(t),i=se(e);return null===n||null===i?n?()=>t:()=>e:t=>{const e=new Array(4);for(let r=0;r<4;r+=1){const o=n[r],s=i[r];e[r]=o*(1-t)+s*t}const[r,o,s,a]=e;return"rgba(".concat(Math.round(r),", ").concat(Math.round(o),", ").concat(Math.round(s),", ").concat(a,")")}})(t,e):()=>t,ue=(t,e)=>{const n=ae(t,e);return t=>Math.round(n(t))};function ce(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)?n.get(r):e}function he(t){return"object"==typeof t?t.valueOf():t}class de extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=he,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(ce({map:this.map,initKey:this.initKey},t))}has(t){return super.has(ce({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)?n.get(r):(n.set(r,e),e)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function(t,e){let{map:n,initKey:i}=t;const r=i(e);return n.has(r)&&(e=n.get(r),n.delete(r)),e}({map:this.map,initKey:this.initKey},t))}}class pe{constructor(t){this.options=$t({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=$t({},this.options,t),this.rescale(t)}rescale(t){}}const fe=Symbol("defaultUnknown");function ge(t,e,n){for(let i=0;i"".concat(t):"object"==typeof t?t=>JSON.stringify(t):t=>t}class ye extends pe{getDefaultOptions(){return{domain:[],range:[],unknown:fe}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&ge(this.domainIndexMap,this.getDomain(),this.domainKey),me({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&ge(this.rangeIndexMap,this.getRange(),this.rangeKey),me({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=be(e),this.rangeKey=be(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new ye(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function ve(t){return Math.round(1e12*t)/1e12}function xe(t){const{domain:e,range:n,paddingOuter:i,paddingInner:r,flex:o,round:s,align:a}=t,l=e.length,u=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,l),[c,h]=n,d=h-c,p=d/(2/l*i+1-1/l*r),f=p*r/l,g=p-l*f,m=function(t){const e=Math.min(...t);return t.map(t=>t/e)}(u),b=g/m.reduce((t,e)=>t+e),y=new de(e.map((t,e)=>{const n=m[e]*b;return[t,s?Math.floor(n):n]})),v=new de(e.map((t,e)=>{const n=m[e]*b+f;return[t,s?Math.floor(n):n]})),x=Array.from(v.values()).reduce((t,e)=>t+e),w=c+(d-(x-x/l*r))*a;let S=s?Math.round(w):w;const k=new Array(l);for(let t=0;t0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:i,flex:r}=this.options,{adjustedRange:o,valueBandWidth:s,valueStep:a}=function(t){var e;const{domain:n}=t,i=n.length;if(0===i)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(null===(e=t.flex)||void 0===e?void 0:e.length))return xe(t);const{range:r,paddingOuter:o,paddingInner:s,round:a,align:l}=t;let u,c,h=r[0];const d=r[1]-h,p=2*o,f=i-s;u=d/Math.max(1,p+f),a&&(u=Math.floor(u)),h+=(d-u*(i-s))*l,c=u*(1-s),a&&(h=Math.round(h),c=Math.round(c));const g=new Array(i).fill(0).map((t,e)=>h+e*u);return{valueStep:u,valueBandWidth:c,adjustedRange:g}}({align:t,range:n,round:i,flex:r,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=a,this.valueBandWidth=s,this.adjustedRange=o}}const Se=(t,e,n)=>{let i,r,o=t,s=e;if(o===s&&n>0)return[o];let a=Bt(o,s,n);if(0===a||!Number.isFinite(a))return[];if(a>0){o=Math.ceil(o/a),s=Math.floor(s/a),r=new Array(i=Math.ceil(s-o+1));for(let t=0;t{const[i,r]=t,[o,s]=e;let a,l;return i{const i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),s=t[0]>t[i],a=s?[...t].reverse():t,l=s?[...e].reverse():e;for(let t=0;t{const n=At(t,e,1,i)-1,s=r[n];return Lt(o[n],s)(e)}},Pe=(t,e,n,i)=>(Math.min(t.length,e.length)>2?Le:ke)(t,e,i?ue:n);class Ae extends pe{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:ae,tickCount:5}}map(t){return ee(t)?this.output(t):this.options.unknown}invert(t){return ee(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...i)}getTicks(){const{tickMethod:t}=this.options,[e,n,i,...r]=this.getTickMethodOptions();return t(e,n,i,...r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return Ot}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,i=this.options.domain.map(t),r=Math.min(i.length,n.length);return e?function(t,e){const n=ee?t:e;return t=>Math.min(Math.max(n,t),i)}(i[0],i[r-1]):Xt}composeOutput(t,e){const{domain:n,range:i,round:r,interpolate:o}=this.options,s=Pe(n.map(t),i,o,r);this.output=Lt(s,e,t)}composeInput(t,e,n){const{domain:i,range:r}=this.options,o=Pe(r,i.map(t),ae);this.input=Lt(e,n,o)}}class Me extends Ae{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:le,tickMethod:Se,tickCount:5}}chooseTransforms(){return[Xt,Xt]}clone(){return new Me(this.options)}}var Ee="[^\\s]+";function Ce(t,e){for(var n=[],i=0,r=t.length;i-1?i:null}};function Oe(t){for(var e=[],n=1;n3?0:(t-t%10!=10?1:0)*t%10]}},ze=(Oe({},_e),function(t){return+t-1}),Ie=[null,"\\d\\d?"],Ge=[null,Ee],He=["isPm",Ee,function(t,e){var n=t.toLowerCase();return n===e.amPm[0]?0:n===e.amPm[1]?1:null}],Fe=["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}];Be("monthNamesShort"),Be("monthNames");var De,Re=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};let Ve=De=class extends Me{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Xt,tickMethod:Se,tickCount:5}}constructor(t){super(t)}clone(){return new De(this.options)}};Ve=De=Re([ne((function(t){return[t(0),t(1)]}),t=>{const[e,n]=t;return Lt(ae(0,1),Pt(e,n))})],Ve);var We,qe=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s};let Ue=We=class extends Me{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:Xt,tickMethod:Se,tickCount:5}}constructor(t){super(t)}clone(){return new We(this.options)}};Ue=We=qe([ne((function(t){return[t(0),t(.5),t(1)]}),t=>{const[e,n,i]=t,r=Lt(ae(0,.5),Pt(e,n)),o=Lt(ae(.5,1),Pt(n,i));return t=>e>i?tt.append("rect").attr("className","column").each((function(t){this.attr(t)})),t=>t.each((function(t){this.attr(t)})),t=>t.remove())}update(t){this.attr(y({},this.attributes,t)),this.render()}clear(){this.removeChildren()}}function Xe(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Je extends i.DisplayObject{constructor(t){let{style:e,...n}=t;super(pt({},{type:"lines"},{style:e,...n})),Xe(this,"linesGroup",this.appendChild(new i.Group)),Xe(this,"areasGroup",this.appendChild(new i.Group)),this.render()}render(){const{lines:t,areas:e}=this.attributes;t&&this.renderLines(t),e&&this.renderAreas(e)}clear(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()}update(t){this.attr(y({},this.attributes,t)),this.render()}renderLines(t){K(this.linesGroup).selectAll(".line").data(t).join(t=>t.append("path").attr("className","line").each((function(t){this.attr(t)})),t=>t.each((function(t){this.attr(t)})),t=>t.remove())}renderAreas(t){K(this.linesGroup).selectAll(".area").data(t).join(t=>t.append("path").attr("className","area").each((function(t){this.attr(t)})),t=>t.each((function(t){this.style(t)})),t=>t.remove())}}var Qe=function(t,e,n){return tn?n:t},tn=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},en=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(st(t)||st(e))return!1;if(tn(t)||tn(e)){if(t.length!==e.length)return!1;for(var n=!0,i=0;i1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[[0,0],[1,1]];const i=!!e,r=[];for(let e=0,n=t.length;e1&&void 0!==arguments[1]&&arguments[1];const n=e?t.length-1:0,i=t.map((t,e)=>[e===n?"M":"L",...t]);return e?i.reverse():i}function mn(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.length<=2)return gn(t);const n=[],i=t.length;for(let r=0;ri&&(n=o,i=s)}return n}};function Sn(t){return 0===t.length?[0,0]:[yn(vn(t,t=>yn(t)||0)),xn(wn(t,t=>xn(t)||0))]}function kn(t){const e=Ye(t),n=e[0].length,[i,r]=[Array(n).fill(0),Array(n).fill(0)];for(let t=0;t=0?(o[t]+=i[t],i[t]=o[t]):(o[t]+=r[t],r[t]=o[t])}return e}function Ln(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Pn extends w{get rawData(){const{data:t}=this.attributes;if(!t||0===(null==t?void 0:t.length))return[[]];const e=Ye(t);return T(e[0])?[e]:e}get data(){return this.attributes.isStack?kn(this.rawData):this.rawData}get scales(){return this.createScales(this.data)}get baseline(){const{y:t}=this.scales,[e,n]=t.getOptions().domain||[0,0];return n<0?t.map(n):t.map(e<0?0:e)}get containerShape(){const{width:t,height:e}=this.attributes;return{width:t,height:e}}get linesStyle(){const{type:t,isStack:e,smooth:n}=this.attributes;if("line"!==t)throw new Error("linesStyle can only be used in line type");const i=C(this.attributes,"area"),r=C(this.attributes,"line"),{width:o}=this.containerShape,{data:s}=this;if(0===s[0].length)return{lines:[],areas:[]};const{x:a,y:l}=this.scales,u=function(t,e){const{x:n,y:i}=e;let[r,o]=i.getOptions().range||[0,0];return o>r&&([o,r]=[r,o]),t.map(t=>t.map((t,e)=>[n.map(e),Qe(i.map(t),o,r)]))}(s,{type:"line",x:a,y:l});let c=[];if(i){const{baseline:t}=this;c=e?n?function(t,e,n){const i=[];for(let r=t.length-1;r>=0;r-=1){const o=t[r],s=mn(o);let a;if(0===r)a=bn(s,e,n);else{const e=mn(t[r-1],!0),n=o[0];e[0][0]="L",a=[...s,...e,["M",...n],["Z"]]}i.push(a)}return i}(u,o,t):function(t,e,n){const i=[];for(let r=t.length-1;r>=0;r-=1){const o=gn(t[r]);let s;if(0===r)s=bn(o,e,n);else{const e=gn(t[r-1],!0);e[0][0]="L",s=[...o,...e,["Z"]]}i.push(s)}return i}(u,o,t):function(t,e,n,i){return t.map(t=>bn(e?mn(t):gn(t),n,i))}(u,n,o,t)}return{lines:u.map((t,e)=>({stroke:this.getColor(e),path:n?mn(t):gn(t),...r})),areas:c.map((t,e)=>({path:t,fill:this.getColor(e),...i}))}}get columnsStyle(){const t=C(this.attributes,"column"),{isStack:e,type:n}=this.attributes;if("column"!==n)throw new Error("columnsStyle can only be used in column type");const{height:i}=this.containerShape;let{rawData:r}=this;if(!r)return{columns:[]};e&&(r=kn(r));const{x:o,y:s}=this.createScales(r),[a,l]=Sn(r),u=new Me({domain:[0,l-(a>0?0:a)],range:[0,i]}),c=o.getBandWidth(),{rawData:h}=this;return{columns:r.map((n,i)=>n.map((n,a)=>{const l=c/r.length;return{fill:this.getColor(i),...t,...e?{x:o.map(a),y:s.map(n),width:c,height:u.map(h[i][a])}:{x:o.map(a)+l*i,y:n>=0?s.map(n):s.map(0),width:l,height:u.map(Math.abs(n))}}}))}}constructor(t){super(t,{type:"line",width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff"}),Ln(this,"container",void 0),Ln(this,"spark",void 0)}render(t,e){this.container=Y(e,".container","rect").attr("className","container").node();const{type:n}=t,i="spark".concat(n),r="line"===n?this.linesStyle:this.columnsStyle;this.spark=Y(e,".".concat(i),()=>"line"===n?new Je({className:i,style:r}):new $e({className:i,style:r})).styles(r).node()}getColor(t){const{color:e}=this.attributes;return m(e)?e[t%e.length]:Z(e)?e.call(null,t):e}createScales(t){var e,n;const{type:i,range:r=[],isGroup:o,spacing:s}=this.attributes,{width:a,height:l}=this.containerShape,[u,c]=Sn(t),h=new Me({domain:[null!==(e=r[0])&&void 0!==e?e:u,null!==(n=r[1])&&void 0!==n?n:c],range:[l,0]});return"line"===i?{type:i,x:new Me({domain:[0,t[0].length-1],range:[0,a]}),y:h}:{type:i,x:new we({domain:t[0].map((t,e)=>e),range:[0,a],paddingInner:o?s:0}),y:h}}}function An(t){if(!t)return{enter:!1,update:!1,exit:!1};const e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter(t=>{let[n]=t;return!e.includes(n)}));return Object.fromEntries(e.map(e=>function(t){return"boolean"!=typeof t&&("enter"in t&&"update"in t&&"exit"in t)}(t)?!1===t[e]?[e,!1]:[e,{...t[e],...n}]:[e,n]))}function Mn(t,e){t?t.finished.then(e):e()}function En(t,e){"update"in t?t.update(e):t.attr(e)}function Cn(t,e,n){if(0===e.length)return null;if(!n){return En(t,{style:e.slice(-1)[0]}),null}return t.animate(e,n)}function Bn(t,e,n){const i={},o={};return Object.entries(e).forEach(e=>{let[n,s]=e;if(!r(s)){const e=t.style[n]||t.parsedStyle[n]||0;e!==s&&(i[n]=e,o[n]=s)}}),n?Cn(t,[i,o],{fill:"both",...n}):(En(t,o),null)}function On(t){const{canvas:e,touches:n,offsetX:i,offsetY:r}=t;if(e){const{x:t,y:n}=e;return[t,n]}if(n){const{clientX:t,clientY:e}=n[0];return[t,e]}return i&&r?[i,r]:[0,0]}function Tn(t,e){const n=10**e;return~~(t*n)/n}function jn(t){return t.toLocaleString()}function Nn(t){return t.toExponential()}function _n(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Math.abs(t)<1e3?String(t):"".concat(Tn(t/1e3,e).toLocaleString(),"K")}Ln(Pn,"tag","sparkline");const zn=(t,e,n)=>t<0&&Number.isFinite(t)?e:n,In=(t,e,n)=>t>0&&Number.isFinite(t)?e:n,Gn=(t,e)=>t*e,Hn=(t,e)=>t/2+(e||0)/2,Fn=(t,e)=>{const n=t=>"".concat(e,"-").concat(t),i=Object.fromEntries(Object.entries(t).map(t=>{let[e,i]=t;const r=n(i);return[e,{name:r,class:".".concat(r),id:"#".concat(r),toString:()=>r}]}));return Object.assign(i,{prefix:n}),i},Dn={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Rn={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Vn={orientation:"horizontal",showLabel:!0,type:"start"},Wn=Fn({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track"},"slider");function qn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Un=Fn({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle");class Kn extends w{render(t,e){const{size:n=10,radius:i=n/4,orientation:r,...o}=t,s=n,a=2.4*s,l=K(e).maybeAppendByClassName(Un.iconRect,"rect").styles({...o,width:s,height:a,radius:i,x:-s/2,y:-a/2}),u=1/3*s,c=2/3*s,h=1/4*a,d=3/4*a;l.maybeAppendByClassName("".concat(Un.iconLine,"-1"),"line").styles({x1:u,x2:u,y1:h,y2:d,...o}),l.maybeAppendByClassName("".concat(Un.iconLine,"-2"),"line").styles({x1:c,x2:c,y1:h,y2:d,...o}),l.node().setOrigin(s/2,a/2),"vertical"===r?e.setLocalEulerAngles(90):e.setLocalEulerAngles(0)}}class Yn extends w{constructor(t){super(t,Vn),qn(this,"label",void 0),qn(this,"icon",void 0)}renderLabel(t){const{showLabel:e}=this.attributes,n=C(this.attributes,"label"),[i,r]=O(n,[]),o=K(t).maybeAppendByClassName(Un.labelGroup,"g").styles(r),{text:s,...a}={...Rn,...i};$(!!e,o,t=>{this.label=t.maybeAppendByClassName(Un.label,"text").styles({...a,text:"".concat(s)}),this.label.on("mousedown",t=>{t.stopPropagation()}),this.label.on("touchstart",t=>{t.stopPropagation()})})}renderIcon(t){const{orientation:e}=this.attributes,n={orientation:e,...Dn,...C(this.attributes,"icon")},{iconShape:i=(()=>new Kn({style:n}))}=this.attributes;K(t).maybeAppendByClassName(Un.iconGroup,"g").selectAll(Un.icon.class).data([i]).join(t=>t.append(i).attr("className",Un.icon.name),t=>t.update(n),t=>t.remove())}render(t,e){this.renderIcon(e),this.renderLabel(e)}}function Zn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class $n extends w{get values(){return this.attributes.values}set values(t){this.attributes.values=this.clampValues(t)}get sparklineStyle(){const{orientation:t}=this.attributes;if("horizontal"!==t)return null;const e=C(this.attributes,"sparkline");return{zIndex:0,...this.availableSpace,...e}}get shape(){const{trackLength:t,trackSize:e}=this.attributes,[n,i]=this.getOrientVal([[t,e],[e,t]]);return{width:n,height:i}}get availableSpace(){const{padding:t}=this.attributes,[e,n,i,r]=j(t),{width:o,height:s}=this.shape;return{x:r,y:e,width:o-(r+n),height:s-(e+i)}}constructor(t){super(t,{animate:{duration:100,fill:"both"},brushable:!0,formatter:t=>t.toString(),handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionCursor:"move",selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],...B(Vn,"handle"),...B(Dn,"handleIcon"),...B(Rn,"handleLabel")}),Zn(this,"range",[0,1]),Zn(this,"trackShape",void 0),Zn(this,"foregroundGroup",void 0),Zn(this,"selectionShape",void 0),Zn(this,"startHandle",void 0),Zn(this,"endHandle",void 0),Zn(this,"selectionStartPos",void 0),Zn(this,"selectionWidth",void 0),Zn(this,"prevPos",void 0),Zn(this,"target",void 0),Zn(this,"onDragStart",t=>e=>{e.stopPropagation(),this.target=t,this.prevPos=this.getOrientVal(On(e));const{x:n,y:i}=this.availableSpace,{x:r,y:o}=this.attributes;this.selectionStartPos=this.getRatio(this.prevPos-this.getOrientVal([n,i])-this.getOrientVal([+r,+o])),this.selectionWidth=0,document.addEventListener("mousemove",this.onDragging),document.addEventListener("touchmove",this.onDragging),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("touchend",this.onDragEnd)}),Zn(this,"onDragging",t=>{const{slidable:e,brushable:n}=this.attributes;t.stopPropagation();const i=this.getOrientVal(On(t)),r=i-this.prevPos;if(!r)return;const o=this.getRatio(r);switch(this.target){case"start":e&&this.setValuesOffset(o);break;case"end":e&&this.setValuesOffset(0,o);break;case"selection":e&&this.setValuesOffset(o,o);break;case"track":if(!n)return;this.selectionWidth+=o,this.innerSetValues([this.selectionStartPos,this.selectionStartPos+this.selectionWidth].sort(),!0)}this.prevPos=i}),Zn(this,"onDragEnd",()=>{document.removeEventListener("mousemove",this.onDragging),document.removeEventListener("mousemove",this.onDragging),document.removeEventListener("mouseup",this.onDragEnd),document.removeEventListener("touchend",this.onDragEnd)}),Zn(this,"onValueChange",t=>{const e=new i.CustomEvent("valuechange",{detail:{oldValue:t,value:this.getValues()}});this.dispatchEvent(e)}),this.selectionStartPos=0,this.selectionWidth=0,this.prevPos=0,this.target=""}getValues(){return this.values}setValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.attributes.values=t;const n=!1!==e&&this.attributes.animate;Bn(this.selectionShape.node(),this.selectionStyle,n),this.updateHandlesPosition(n)}updateHandlesPosition(t){this.attributes.showHandle&&(Bn(this.startHandle,this.getHandleStyle("start"),t),Bn(this.endHandle,this.getHandleStyle("end"),t))}innerSetValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.values,i=this.clampValues(t);this.attr("values",i),this.setValues(i),e&&this.onValueChange(n)}renderTrack(t){const{brushable:e}=this.attributes,n=C(this.attributes,"track");this.trackShape=K(t).maybeAppendByClassName(Wn.track,"rect").styles({cursor:e?"crosshair":"default",...this.shape,...n})}renderSparkline(t){const{orientation:e}=this.attributes;$("horizontal"===e,K(t).maybeAppendByClassName(Wn.sparklineGroup,"g"),t=>{const e=this.sparklineStyle;t.maybeAppendByClassName(Wn.sparkline,()=>new Pn({style:e})).update(e)})}get selectionStyle(){return{...C(this.attributes,"selection"),...this.calcMask()}}renderHandles(){var t;const{showHandle:e}=this.attributes,n=(e?["start","end"]:[]).map(t=>({type:t})),i=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(Wn.handle.class).data(n,t=>t.type).join(t=>t.append(t=>{let{type:e}=t;return new Yn({style:this.getHandleStyle(e)})}).each((function(t){let{type:e}=t;this.attr("class","".concat(Wn.handle.name," ").concat(e,"-handle"));const n="".concat(e,"Handle");i[n]=this,this.addEventListener("pointerdown",t=>{i.onDragStart(e)(t)})})),t=>t.each((function(t){let{type:e}=t;this.update(i.getHandleStyle(e))})),t=>t.each(t=>{let{type:e}=t;const n="".concat(e,"Handle");i[n]=void 0}).remove())}renderSelection(t){this.foregroundGroup=K(t).maybeAppendByClassName(Wn.foreground,"g"),this.selectionShape=this.foregroundGroup.maybeAppendByClassName(Wn.selection,"rect").styles(this.selectionStyle),this.renderHandles()}render(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderSelection(e)}clampValues(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;const[n,i]=this.range,[r,o]=this.getValues().map(t=>Tn(t,e));let[s,a]=(t||[r,o]).map(t=>Tn(t,e));s>a&&([s,a]=[a,s]);const l=a-s;return l>i-n?[n,i]:si?o===i&&r===s?[s,i]:[i-l,i]:[s,a]}calcMask(t){const[e,n]=this.clampValues(t),{x:i,y:r,width:o,height:s}=this.availableSpace;return this.getOrientVal([{y:r,height:s,x:e*o+i,width:(n-e)*o},{x:i,width:o,y:e*s+r,height:(n-e)*s}])}calcHandlePosition(t){const{x:e,y:n,width:i,height:r}=this.availableSpace,[o,s]=this.clampValues(),a=("start"===t?o:s)*this.getOrientVal([i,r]);return{x:e+this.getOrientVal([a,i/2]),y:n+this.getOrientVal([r/2,a])}}calcHandleText(t){const{orientation:e,formatter:n,autoFitLabel:i}=this.attributes,r=C(this.attributes,"handle"),o=C(r,"label"),{spacing:s}=r,a=this.getHandleSize(),l=this.clampValues(),u=n("start"===t?l[0]:l[1]),c=new k({style:{...o,text:u}}),{width:h,height:d}=c.getBBox();if(c.destroy(),!i){const n=s+a+("horizontal"===e?h/2:0);return{text:u,["horizontal"===e?"x":"y"]:"start"===t?-n:n}}let p=0,f=0;const{width:g,height:m}=this.availableSpace,{x:b,y:y,width:v,height:x}=this.calcMask();if("horizontal"===e){const e=s+a,n=e+h/2;if("start"===t){p=b-e-h>0?-n:n}else{p=g-b-v-e>h?n:-n}}else{const e=s+a;f="start"===t?y-a>d?-e:e:m-y-x-a>d?e:-e}return{x:p,y:f,text:u}}getHandleLabelStyle(t){const{showLabel:e}=this.attributes;if(!e)return{};return{...C(this.attributes,"handleLabel"),...this.calcHandleText(t)}}getHandleIconStyle(){const{handleIconShape:t}=this.attributes,e=C(this.attributes,"handleIcon");return{cursor:this.getOrientVal(["ew-resize","ns-resize"]),shape:t,size:this.getHandleSize(),...e}}getHandleStyle(t){const{showLabel:e,orientation:n}=this.attributes,i=this.calcHandlePosition(t),r=this.calcHandleText(t);return{...B(this.getHandleIconStyle(),"icon"),...B({...this.getHandleLabelStyle(t),...r},"label"),...i,orientation:n,showLabel:e,type:t,zIndex:3}}getHandleSize(){const{handleIconSize:t,width:e,height:n}=this.attributes;return t||Math.floor((this.getOrientVal([+n,+e])+4)/2.4)}getOrientVal(t){let[e,n]=t;const{orientation:i}=this.attributes;return"horizontal"===i?e:n}setValuesOffset(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const[i,r]=this.getValues(),o=[i+t,r+e].sort();n?this.setValues(o):this.innerSetValues(o,!0)}getRatio(t){const{width:e,height:n}=this.availableSpace;return t/this.getOrientVal([e,n])}dispatchCustomEvent(t,e,n){t.on(e,t=>{t.stopPropagation(),this.dispatchEvent(new i.CustomEvent(n,{detail:t}))})}bindEvents(){const t=this.selectionShape;this.addEventListener("wheel",this.onScroll),t.on("mousedown",this.onDragStart("selection")),t.on("touchstart",this.onDragStart("selection")),this.dispatchCustomEvent(t,"mouseenter","selectionMouseenter"),this.dispatchCustomEvent(t,"mouseleave","selectionMouseleave"),this.dispatchCustomEvent(t,"click","selectionClick");const e=this.trackShape;this.dispatchCustomEvent(e,"click","trackClick"),this.dispatchCustomEvent(e,"mouseenter","trackMouseenter"),this.dispatchCustomEvent(e,"mouseleave","trackMouseleave"),e.on("mousedown",this.onDragStart("track")),e.on("touchstart",this.onDragStart("track"))}onScroll(t){const{scrollable:e}=this.attributes;if(e){const{deltaX:e,deltaY:n}=t,i=n||e,r=this.getRatio(i);this.setValuesOffset(r,r,!0)}}}function Xn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Zn($n,"tag","slider");class Jn extends w{get padding(){const{padding:t}=this.attributes;return j(t)}constructor(t){super(t,{isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0}),Xn(this,"slider",void 0),Xn(this,"range",[0,1]),Xn(this,"onValueChange",t=>{const{value:e}=this.attributes;if(t===e)return;const n={detail:{oldValue:t,value:e}};this.dispatchEvent(new i.CustomEvent("scroll",n)),this.dispatchEvent(new i.CustomEvent("valuechange",n))}),Xn(this,"onTrackClick",t=>{const{slidable:e}=this.attributes;if(!e)return;const[n,i]=this.getLocalPosition(),[r,,,o]=this.padding,s=this.getOrientVal([n+o,i+r]),a=(this.getOrientVal(On(t))-s)/this.trackLength;this.setValue(a,!0)}),Xn(this,"onThumbMouseenter",t=>{this.dispatchEvent(new i.CustomEvent("thumbMouseenter",{detail:t.detail}))}),Xn(this,"onTrackMouseenter",t=>{this.dispatchEvent(new i.CustomEvent("trackMouseenter",{detail:t.detail}))}),Xn(this,"onThumbMouseleave",t=>{this.dispatchEvent(new i.CustomEvent("thumbMouseleave",{detail:t.detail}))}),Xn(this,"onTrackMouseleave",t=>{this.dispatchEvent(new i.CustomEvent("trackMouseleave",{detail:t.detail}))})}get value(){const{value:t}=this.attributes,[e,n]=this.range;return Qe(t,e,n)}get trackLength(){const{viewportLength:t,trackLength:e=t}=this.attributes;return e}get availableSpace(){const{trackSize:t}=this.attributes,e=this.trackLength,[n,i,r,o]=this.padding,[s,a]=this.getOrientVal([[e,t],[t,e]]);return{x:o,y:n,width:+s-(o+i),height:+a-(n+r)}}get trackRadius(){const{isRound:t,trackSize:e}=this.attributes;return t?e/2:0}get thumbRadius(){const{isRound:t,thumbRadius:e}=this.attributes;if(!t)return 0;const{width:n,height:i}=this.availableSpace;return e||this.getOrientVal([i,n])/2}getValues(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.value;const{viewportLength:e,contentLength:n}=this.attributes,i=e/n,[r,o]=this.range,s=t*(o-r-i);return[s,s+i]}getValue(){return this.value}renderSlider(t){const{orientation:e,trackSize:n,padding:i,slidable:r}=this.attributes,o=C(this.attributes,"track"),s=C(this.attributes,"thumb"),a={brushable:!1,orientation:e,padding:i,selectionRadius:this.thumbRadius,showHandle:!1,slidable:r,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:n,values:this.getValues(),...B(o,"track"),...B(s,"selection")};this.slider=K(t).maybeAppendByClassName("scrollbar",()=>new $n({style:a})).update(a).node()}render(t,e){this.renderSlider(e)}setValue(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{value:n}=this.attributes,[i,r]=this.range;this.slider.setValues(this.getValues(Qe(t,i,r)),e),this.onValueChange(n)}bindEvents(){this.slider.addEventListener("trackClick",t=>{t.stopPropagation(),this.onTrackClick(t.detail)}),this.onHover()}getOrientVal(t){const{orientation:e}=this.attributes;return"horizontal"===e?t[0]:t[1]}onHover(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)}}function Qn(t,e){if(t.length<=e)return t;const n=Math.floor(t.length/e),i=[];for(let e=0;enew i.Path({style:{path:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],anchor:"0.5 0.5",fill:"black",transformOrigin:"center"}}),labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",tickStrokeOpacity:.65,labelOverlap:[]},ei=(pt({},ti,{style:{type:"arc"}}),pt({},ti,{style:{}}),Fn({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"));function ni(t){return t*Math.PI/180}function ii(t){return Number((180*t/Math.PI).toPrecision(5))}function ri(t,e){return Z(t)?t(...e):t}var oi=function(t,e){return t.style.opacity||(t.style.opacity=1),Bn(t,{opacity:0},e)};const si=["$el","anchor","cx","cy","d","defX","defY","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function ai(t){return si.includes(t)}function li(t){const e={};for(const n in t)ai(n)&&(e[n]=t[n]);return e}const ui=Fn({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function ci(t){return t.reduce((t,e,n)=>(t.push([0===n?"M":"L",...e]),t),[])}function hi(t,e,n){return"surround"===e.type?function(t,e,n){const{connect:i="line",center:r}=e;if("line"===i)return ci(t);if(!r)return[];const o=un(t[0],r),s=n?0:1;return t.reduce((t,e,n)=>(0===n?t.push(["M",...e]):t.push(["A",o,o,0,0,s,...e]),t),[])}(t,e,n):ci(t)}function di(t,e,n){const{type:i,connect:r,center:o,closed:s}=n,a=s?[["Z"]]:[],[l,u]=[hi(t,n),hi(e.slice().reverse(),n,!0)],[c,h]=[t[0],e.slice(-1)[0]],d=(t,e)=>[l,t,u,e,a].flat();if("line"===r||"surround"===i)return d([["L",...h]],[["L",...c]]);if(!o)throw new Error("Arc grid need to specified center");const[p,f]=[un(h,o),un(c,o)];return d([["A",p,p,0,0,1,...h],["L",...h]],[["A",f,f,0,0,0,...c],["L",...c]])}class pi extends w{render(t,e){const{type:n,center:i,areaFill:r,closed:o,...s}=t,a=function(t){const{data:e=[],closed:n}=t;return n?e.map(t=>{const{points:e}=t,[n]=e;return{...t,points:[...e,n]}}):e}(t),l=K(e).maybeAppendByClassName(ui.lineGroup,"g"),u=K(e).maybeAppendByClassName(ui.regionGroup,"g");return[...function(t,e,n,i){const{animate:r}=n,o=e.map((t,e)=>({id:t.id||"grid-line-".concat(e),path:hi(t.points,n)}));return t.selectAll(ui.line.class).data(o,t=>t.id).join(t=>t.append("path").each((function(t,e){const n=ri(li({path:t.path,...i}),[t,e,o]);this.attr({class:ui.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],...n})})),t=>t.transition((function(t,e){return Bn(this,ri(li({path:t.path,...i}),[t,e,o]),r.update)})),t=>t.transition((function(){const t=oi(this,r.exit);return Mn(t,()=>this.remove()),t}))).transitions()}(l,a,t,s),...function(t,e,n){const{animate:i,connect:r,areaFill:o}=n;if(e.length<2||!o||!r)return[];const s=Array.isArray(o)?o:[o,"transparent"],a=t=>s[t%s.length],l=[];for(let t=0;te).join(t=>t.append("path").each((function(t,e){const n=ri(t,[t,e,l]);this.attr(n)})).attr("className",ui.region.name),t=>t.transition((function(t,e){return Bn(this,ri(t,[t,e,l]),i.update)})),t=>t.transition((function(){const t=oi(this,i.exit);return Mn(t,()=>this.remove()),t}))).transitions()}(u,a,t)]}}var fi=function(t,e){if(!Z(t))throw new TypeError("Expected a function");var n=function(){for(var i=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={},i={};return Object.entries(e).forEach(e=>{let[r,o]=e;r in t?n[r]=vi(t[r],o):i[r]=o}),function(t){return Object.entries(n).forEach(e=>{let[n,r]=e;return i[n]=r(t)}),i}}function vi(t,e){return"number"==typeof t&&"number"==typeof e?mi(t,e):Array.isArray(t)&&Array.isArray(e)?bi(t,e):"object"==typeof t&&"object"==typeof e?yi(t,e):e=>t}function xi(t,e,n,i){if(!i)return t.attr("__keyframe_data__",n),null;const{duration:r=0}=i,o=vi(e,n),s=Math.ceil(+r/16),a=new Array(s).fill(0).map((t,e,n)=>({__keyframe_data__:o(e/(n.length-1))}));return t.animate(a,{fill:"both",...i})}function wi(t){return"function"==typeof t?t():st(t)||T(t)?new k({style:{text:String(t)}}):t}function Si(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{width:i,height:r}=t.getBBox(),o=e/Math.max(i,r);return n&&t.scale(o),o}function ki(t,e){const n={},i=Array.isArray(e)?e:[e];for(const e in t)i.includes(e)||(n[e]=t[e]);return n}function Li(t,e){return Object.fromEntries(Object.entries(t).map(t=>{let[n,i]=t;return[n,ri(i,e)]}))}function Pi(t,e){return e&&Z(e)?t.filter(e):t}const Ai=fi((t,e)=>{const{startAngle:n,endAngle:i}=e;return(i-n)*t+n},(t,e)=>[t,e.startAngle,e.endAngle].join()),Mi=fi((t,e)=>{if("linear"===e.type){const{startPos:[t,n],endPos:[i,r]}=e,[o,s]=[i-t,r-n];return cn([o,s])}const n=ni(Ai(t,e));return[-Math.sin(n),Math.cos(n)]},(t,e)=>{const n=function(t){if("linear"===t.type){const{startPos:e,endPos:n}=t;return[...e,...n]}const{startAngle:e,endAngle:n,center:i,radius:r}=t;return[e,n,...i,r]}(e);return"arc"===e.type&&n.push(t),n.join()});function Ei(t,e,n){return dn(Mi(t,n),"positive"!==e)}function Ci(t,e){return Ei(t,e.labelDirection,e)}const Bi=fi((t,e)=>{const{startPos:[n,i],endPos:[r,o]}=e,[s,a]=[r-n,o-i];return[n+s*t,i+a*t]},(t,e)=>[t,...e.startPos,...e.endPos].join()),Oi=fi((t,e)=>{const{radius:n,center:[i,r]}=e,o=ni(Ai(t,e));return[i+n*Math.cos(o),r+n*Math.sin(o)]},(t,e)=>{const{startAngle:n,endAngle:i,radius:r,center:o}=e;return[t,n,i,r,...o].join()});function Ti(t,e){return"linear"===e.type?Bi(t,e):Oi(t,e)}function ji(t){return 0===Mi(0,t)[1]}function Ni(t){return 0===Mi(0,t)[0]}function _i(t,e){return e-t==360}function zi(t,e,n,i,r){const o=e-t,[s,a]=[r,r],[l,u]=[ni(t),ni(e)],c=t=>[n+r*Math.cos(t),i+r*Math.sin(t)],[h,d]=c(l),[p,f]=c(u);if(_i(t,e)){const t=(u+l)/2,[e,n]=c(t);return[["M",h,d],["A",s,a,0,1,0,e,n],["A",s,a,0,1,0,p,f]]}const g=o>180?1:0,m=t>e?0:1;return"M".concat(h,",").concat(d,",A").concat(s,",").concat(a,",0,").concat(g,",").concat(m,",").concat(p,",").concat(f)}function Ii(t){const[[e,n],[i,r]]=t;return{x1:e,y1:n,x2:i,y2:r}}function Gi(t,e,n,i){const{showTrunc:r,startPos:o,endPos:s,truncRange:a,lineExtension:l}=e,[[u,c],[h,d]]=[o,s],[p,f,g,m]=l?function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0];const[[i,r],[o,s],[a,l]]=[t,e,n],[u,c]=[o-i,s-r],h=Math.sqrt(u**2+c**2),[d,p]=[-a/h,l/h];return[d*u,d*c,p*u,p*c]}(o,s,l):new Array(4).fill(0),b=e=>t.selectAll(ei.line.class).data(e,(t,e)=>e).join(t=>t.append("line").attr("className",t=>"".concat(ei.line.name," ").concat(t.className)).styles(n).transition((function(t){return Bn(this,Ii(t.line),!1)})),t=>t.styles(n).transition((function(t){let{line:e}=t;return Bn(this,Ii(e),i.update)})),t=>t.remove()).transitions();if(!r||!a)return b([{line:[[u+p,c+f],[h+g,d+m]],className:ei.line.name}]);const[y,v]=a,x=h-u,w=d-c,[S,k]=[u+x*y,c+w*y],[L,P]=[u+x*v,c+w*v],A=b([{line:[[u+p,c+f],[S,k]],className:ei.lineFirst.name},{line:[[L,P],[h+g,d+m]],className:ei.lineSecond.name}]);return function(t,e){let{truncRange:n,truncShape:i,lineExtension:r}=e}(0,e),A}function Hi(t,e,n){const{type:i}=e;let r;const o=C(e,"line");return r="linear"===i?Gi(t,e,ki(o,"arrow"),n):function(t,e,n,i){const{startAngle:r,endAngle:o,center:s,radius:a}=e;return t.selectAll(ei.line.class).data([{path:zi(r,o,...s,a)}],(t,e)=>e).join(t=>t.append("path").attr("className",ei.line.name).styles(e).styles({path:t=>t.path}),t=>t.transition((function(){const t=xi(this,function(t){const{startAngle:e,endAngle:n,center:i,radius:r}=t.attributes;return[e,n,...i,r]}(this),[r,o,...s,a],i.update);if(t){const e=()=>{const t=gi(this.attributes,"__keyframe_data__");this.style.path=zi(...t)};t.onframe=e,t.onfinish=e}return t})).styles(e),t=>t.remove()).styles(n).transitions()}(t,e,ki(o,"arrow"),n),function(t,e,n,i){const{showArrow:r,showTrunc:o,lineArrow:s,lineArrowOffset:a,lineArrowSize:l}=n;let u;if(u="arc"===e?t.select(ei.line.class):o?t.select(ei.lineSecond.class):t.select(ei.line.class),!r||!s||"arc"===n.type&&_i(n.startAngle,n.endAngle)){const t=u.node();return void(t&&(t.style.markerEnd=void 0))}const c=wi(s);c.attr(i),Si(c,l,!0),u.style("markerEnd",c).style("markerEndOffset",-a)}(t,i,e,o),r}function Fi(t){const{type:e,gridCenter:n}=t;return"linear"===e?n:n||t.center}function Di(t,e){const{gridLength:n}=e;return t.map((t,i)=>{let{value:r}=t;const[o,s]=Ti(r,e),[a,l]=rn(function(t,e){return Ei(t,e.gridDirection,e)}(r,e),n);return{id:i,points:[[o,s],[o+a,s+l]]}})}function Ri(t,e,n,i){const r=C(n,"grid"),{type:o,areaFill:s}=r,a=Fi(n),l=Pi(e,n.gridFilter),u="segment"===o?Di(l,n):function(t,e){const n=e.gridControlAngles,i=Fi(e);if(!i)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");const[r,o]=i;return t.map((t,i)=>{let{value:s}=t;const[a,l]=Ti(s,e),[u,c]=[a-r,l-o],h=[];return n.forEach(t=>{const e=ni(t),[n,i]=[Math.cos(e),Math.sin(e)],s=u*n-c*i+r,a=u*i+c*n+o;h.push([s,a])}),{points:h,id:i}})}(l,n),c={...r,center:a,areaFill:Z(s)?l.map((t,e)=>ri(s,[t,e,l])):s,animate:i,data:u};return t.selectAll(ei.grid.class).data([1]).join(t=>t.append(()=>new pi({style:c})).attr("className",ei.grid.name),t=>t.transition((function(){return this.update(c)})),t=>t.remove()).transitions()}function Vi(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4?arguments[4]:void 0;return!!(i&&t===e||r&&t===n)||t>e&&t{const n=st(t)?t:t.style.text.toString(),{fontSize:i,fontFamily:r,fontWeight:o,fontStyle:s,fontVariant:a}=e||Ui(t);return Wi||(Wi=document.createElement("canvas").getContext("2d")),Wi.font=[s,a,o,"".concat(i,"px"),r].join(" "),Wi.measureText(n).width},(t,e)=>[st(t)?t:t.style.text.toString(),Object.values(e||Ui(t)).join()].join("")),Ui=t=>{const e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",i=t.style.fontStyle||"normal",r=t.style.fontVariant;let o=t.style.fontSize;return o="object"==typeof o?o.value:o,{fontSize:o,fontFamily:e,fontWeight:n,fontStyle:i,fontVariant:r}};function Ki(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Yi(t,e){const n=Ki(t);n&&n.attr(e)}function Zi(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";Yi(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function $i(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"top";Yi(t,{wordWrap:!0,wordWrapWidth:e,maxLines:n,textBaseline:i})}function Xi(t,e,n){const{width:i,height:r}=t.getBBox(),[o,s]=[e,n].map((t,e)=>{var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:r):t});return[o,s]}function Ji(t,e){if(e)try{const n=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,i=e.replace(n,(e,n,i)=>"translate(".concat(Xi(t,n,i),")"));t.attr("transform",i)}catch(t){}}const Qi=t=>void 0!==t&&null!=t&&!Number.isNaN(t);function tr(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class er{constructor(t,e,n,i){tr(this,"x1",void 0),tr(this,"y1",void 0),tr(this,"x2",void 0),tr(this,"y2",void 0),this.set(t,e,n,i)}get left(){return this.x1}get top(){return this.y1}get right(){return this.x2}get bottom(){return this.y2}get width(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0}get height(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0}rotatedPoints(t,e,n){const{x1:i,y1:r,x2:o,y2:s}=this,a=Math.cos(t),l=Math.sin(t),u=e-e*a+n*l,c=n-e*l-n*a;return[[a*i-l*s+u,l*i+a*s+c],[a*o-l*s+u,l*o+a*s+c],[a*i-l*r+u,l*i+a*r+c],[a*o-l*r+u,l*o+a*r+c]]}set(t,e,n,i){return nfunction(t,e){const n=t.length;if(n<3)return!1;const i=[e,[9999,e[1]]];let r=0,o=0;do{const s=[t[o],t[(o+1)%n]];if(sr(s,i)){if(0===or(s[0],e,s[1]))return rr(s,e);r++}o=(o+1)%n}while(0!==o);return!!(1&r)}(t,e))}function lr(t,e){const[n,i,r,o]=t,[s,a,l,u]=e,c=r-n,h=o-i,d=l-s,p=u-a,f=c*p-d*h;if(0===f)return!1;const g=f>0,m=n-s,b=i-a,y=c*b-h*m;if(y<0===g)return!1;const v=d*b-p*m;return v<0!==g&&(y>f!==g&&v>f!==g)}function ur(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some(t=>lr(e,t))}function cr(t,e,n){const{crossPadding:i}=e,r=new Set;let o=null;const s=function(t,e){const{type:n,labelDirection:i,crossSize:r}=t;if(!r)return!1;if("arc"===n){const{center:n,radius:o}=t,[s,a]=n,l="negative"===i?0:r,u=-o-l,c=o+l,[h,d,p,f]=j(e);return new er(s+u-f,a+u-h,s+c+d,a+c+p)}const{startPos:[o,s],endPos:[a,l]}=t,[u,c,h,d]=Ni(t)?[-e,0,e,0]:[0,e,0,-e],p=rn(Ci(0,t),r),f=new er(o,s,a,l);return f.x1+=d,f.y1+=u,f.x2+=c+p[0],f.y2+=h+p[1],f}(e,i),a=t=>!s||function(t,e,n){const{x1:i,x2:r,y1:o,y2:s}=t;return ar([[i,o],[r,o],[r,s],[i,s]],nr(e,n))}(s,t),l=(t,e)=>!t||!function(t,e,n){const i=nr(t,n).flat(1),r=nr(e,n).flat(1),o=[[i[0],i[1],i[2],i[3]],[i[0],i[1],i[4],i[5]],[i[4],i[5],i[6],i[7]],[i[2],i[3],i[6],i[7]]];for(const t of o)if(ur(r,t))return!0;return!1}(t,e,j(n));for(const e of t)a(e)?!o||l(o,e)?o=e:(r.add(o),r.add(e)):r.add(e);return Array.from(r)}function hr(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(t)?0:"number"==typeof t?t:Math.floor(qi(t,e))}function dr(t){const e=t&&t.getRenderBounds();if(!e)return{width:0,height:0};const n=e.getMax(),i=e.getMin();return{width:n[0]-i[0],height:n[1]-i[1]}}function pr(t){const{min:e,max:n}=t.getLocalBounds(),[[i,r],[o,s]]=[e,n];return{x:i,y:r,width:o-i,height:s-r,left:i,bottom:s,top:r,right:o}}function fr(t,e){const n=K(t).append("text").node();return n.attr({...e,visibility:"hidden"}),n}function gr(t,e){const[n,i]=t,[r,o]=e;return n!==r&&i===o}function mr(t,e){const[n,i]=t,[r,o]=e;return n===r&&i!==o}const br=(t,e)=>{let{seq:n=2}=e;return t.filter((t,e)=>!(e%n)||(a(t),!1))};const yr=new Map([["hide",function(t,e,n,i){const r=t.length,{keepHeader:o,keepTail:s}=e;if(r<=1||2===r&&o&&s)return;const a=br,l=t=>(t.forEach(i.show),t);let u=2;const c=t.slice();let h=t.slice();const d=Math.min(1,...t.map(t=>ir(t).width));if("linear"===n.type&&(ji(n)||Ni(n))){const e=pr(t[0]).left,n=pr(t[r-1]).right,i=Math.abs(n-e)||1;u=Math.max(Math.floor(r*d/i),u)}let p,f;for(o&&(p=c.splice(0,1)[0]),s&&(f=c.splice(-1,1)[0],c.reverse()),l(c);ut.getLocalEulerAngles()),l=e=>t.forEach((t,n)=>{const r=Array.isArray(e)?e[n]:e;i.rotate(t,+r)});for(const e of r)if(l(e),cr(t,n,o).length<1)return;s&&l(a)}],["ellipsis",function(t,e,n,i){if(t.length<=1)return;const{suffix:o="...",minLength:s,maxLength:a=1/0,step:l=" ",margin:u=[0,0,0,0]}=e,c=Ui(i.getTextShape(t[0])),h=hr(l,c),d=s?hr(s,c):h;let p=hr(a,c);(r(p)||p===1/0)&&(p=Math.max.apply(null,t.map(t=>ir(t).width)));let f=t.slice();const[g=0,m=0,b=g,y=m]=u;for(let e=p;e>d+h;e-=h)if(f.forEach(t=>{i.ellipsis(i.getTextShape(t),e,o)}),f=cr(t,n,u),f.length<1)return}],["wrap",function(t,e,n,i){const{wordWrapWidth:r=50,maxLines:o=3,recoverWhenFailed:s=!0,margin:a=[0,0,0,0]}=e,l=t.map(t=>t.attr("maxLines")||1),u=Math.min(...l),c=function(t){const{type:e,labelDirection:n}=t;return"linear"===e&&ji(t)?"negative"===n?"bottom":"top":"middle"}(n),h=e=>t.forEach((t,n)=>{const o=Array.isArray(e)?e[n]:e;i.wrap(t,r,o,c)});if(!(u>o)){for(let e=u;e<=o;e++)if(h(e),cr(t,n,a).length<1)return;s&&h(l)}}]]);function vr(t,e,n){const{labelOverlap:i=[]}=e;i.length&&i.forEach(i=>{const{type:r}=i,o=yr.get(r);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!h(t[0]):"rotate"===n?!t.some(t=>{var e;return!(null===(e=t.attr("transform"))||void 0===e||!e.includes("rotate"))}):"ellipsis"!==n&&"wrap"!==n||t.filter(t=>t.querySelector("text")).length>1)})(t,e,r)&&(null==o||o(t,i,e,n))})}function xr(){const t=t=>"positive"===t?-1:1;for(var e=arguments.length,n=new Array(e),i=0;ie*t(n),1)}const wr=t=>{let e=t;for(;e<0;)e+=360;return Math.round(e%360)},Sr=fi((t,e)=>{const[n,i]=t,[r,o]=e,[s,a]=[n*r+i*o,n*o-i*r];return Math.atan2(a,s)},(t,e)=>[...t,...e].join());function kr(t,e,n){var i;const{labelAlign:r}=n;if(null===(i=e.style.transform)||void 0===i?void 0:i.includes("rotate"))return e.getLocalEulerAngles();let o=0;const s=Ci(t.value,n),a=Mi(t.value,n);return"horizontal"===r?0:(o="perpendicular"===r?Sr([1,0],s):Sr([a[0]<0?-1:1,0],a),function(t){let e=(t+360)%180;return Vi(e,-90,90)||(e+=180),e}(ii(o)))}function Lr(t,e,n){const{type:i,labelAlign:r}=n,o=Ci(t,n),s=wr(e),a=wr(ii(Sr([1,0],o)));let l="center",u="middle";return"linear"===i?[90,270].includes(a)&&0===s?(l="center",u=1===o[1]?"top":"bottom"):a%180||![90,270].includes(s)?0===a?(Vi(s,0,90,!1,!0)||Vi(s,0,90)||Vi(s,270,360))&&(l="start"):90===a?Vi(s,0,90,!1,!0)?l="start":(Vi(s,90,180)||Vi(s,270,360))&&(l="end"):270===a?Vi(s,0,90,!1,!0)?l="end":(Vi(s,90,180)||Vi(s,270,360))&&(l="start"):180===a&&(90===s?l="start":(Vi(s,0,90)||Vi(s,270,360))&&(l="end")):l="center":"parallel"===r?u=Vi(a,0,180,!0)?"top":"bottom":"horizontal"===r?Vi(a,90,270,!1)?l="end":(Vi(a,270,360,!1)||Vi(a,0,90))&&(l="start"):"perpendicular"===r&&(l=Vi(a,90,270)?"end":"start"),{textAlign:l,textBaseline:u}}function Pr(t,e,n){const{showTick:i,tickLength:r,tickDirection:o,labelDirection:s,labelSpacing:a}=n,l=e.indexOf(t),u=ri(a,[t,l,e]),[c,h]=[Ci(t.value,n),xr(s,o)],d=1===h?ri(i?r:0,[t,l,e]):0,[p,f]=on(rn(c,u+d),Ti(t.value,n));return{x:p,y:f}}function Ar(t,e){"text"===t.nodeName&&t.attr(e)}function Mr(t){vr(this.node().childNodes,t,{hide:a,show:s,rotate:(e,n)=>{!function(t,e,n){e.setLocalEulerAngles(t);const{value:i}=e.__data__,r=Lr(i,t,n),o=e.querySelector(ei.labelItem.class);o&&Ar(o,r)}(+n,e,t)},ellipsis:function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2?arguments[2]:void 0;t&&Zi(t,e,n)},wrap:(t,e,n)=>{t&&$i(t,e,n)},getTextShape:t=>t.querySelector("text")})}function Er(t,e,n,i,r){const o=n.indexOf(e),s=K(t).append(function(t,e,n,i){const{labelFormatter:r}=i;return Z(r)?()=>wi(ri(r,[t,e,n,Ci(t.value,i)])):()=>wi(t.label||"")}(e,o,n,r)).attr("className",ei.labelItem.name).node(),[a,{transform:l,...u}]=O(Li(i,[e,o,n]));Ji(t,l);const c=kr(e,t,r);return t.setLocalEulerAngles(+c),Ar(s,{...Lr(e.value,c,r),...a}),Ji(t,l),t.attr(u),s}function Cr(t,e,n,i){const r=Pi(e,n.labelFilter),o=C(n,"label");return t.selectAll(ei.label.class).data(r,(t,e)=>e).join(i=>i.append("g").attr("className",ei.label.name).transition((function(t){return Er(this,t,e,o,n),this.attr(Pr(t,e,n)),this.__bbox__=t.bbox,null})).call(()=>Mr.call(t,n)),r=>r.transition((function(t){const r=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"destroy";const r=()=>{"destroy"===i?t.destroy():"hide"===i&&a(t),e.isVisible()&&s(e)};if(!n)return r(),[null];const{duration:o=0,delay:l=0}=n,u=Math.ceil(+o/2),c=+o/4,h=t=>{if("circle"===t.nodeName){const[e,n]=t.getLocalPosition(),i=t.attr("r");return[e-i,n-i]}return t.getLocalPosition()},[d,p]=h(t),[f,g]=h(e),[m,b]=[(d+f)/2-d,(p+g)/2-p],y=t.animate([{opacity:1,transform:"translate(0, 0)"},{opacity:0,transform:"translate(".concat(m,", ").concat(b,")")}],{fill:"both",...n,duration:l+u+c}),v=e.animate([{opacity:0,transform:"translate(".concat(-m,", ").concat(-b,")"),offset:.01},{opacity:1,transform:"translate(0, 0)"}],{fill:"both",...n,duration:u+c,delay:l+u-c});return Mn(v,r),[y,v]}(this.querySelector(ei.labelItem.class),Er(this,t,e,o,n),i.update),l=Bn(this,Pr(t,e,n),i.update);return this.__bbox__=t.bbox,[...r,l]})).call(e=>{const i=gi(e,"_transitions").flat().filter(Qi);var r,o;o=()=>Mr.call(t,n),0===(r=i).length?o():Promise.all(r.map(t=>null==t?void 0:t.finished)).then(o)}),t=>t.transition((function(){const t=oi(this,i.exit);return Mn(t,()=>K(this).remove()),t}))).transitions()}function Br(t,e){return Ei(t,e.tickDirection,e)}const Or=fi((t,e)=>{const[n,i]=t;return[[0,0],[n*e,i*e]]},(t,e)=>[...t,e].join());function Tr(t,e,n,i,r,o,s){const a=Br(t.value,o),{x1:l,x2:u,y1:c,y2:h}=function(t,e,n,i,r){const{tickLength:o}=r,[[s,a],[l,u]]=Or(i,ri(o,[t,e,n]));return{x1:s,x2:l,y1:a,y2:u}}(t,e,n,a,o),[d,p]=O(Li(s,[t,e,n,a]));"line"===i.node().nodeName&&i.styles({x1:l,x2:u,y1:c,y2:h,...d}),r.attr(p),i.styles(d)}function jr(t,e,n,i,r,o){Tr(t,e,n,function(t,e,n,i,r){const{tickFormatter:o}=r,s=Br(e.value,r);let a="line";return Z(o)&&(a=()=>ri(o,[e,n,i,s])),t.append(a).attr("className",ei.tickItem.name)}(K(this),t,e,n,i),this,i,r);const[s,a]=Ti(t.value,i);return Bn(this,{x:s,y:a},o)}function Nr(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class _r{get bottom(){return this.y+this.height}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;Nr(this,"x",0),Nr(this,"y",0),Nr(this,"width",0),Nr(this,"height",0),this.x=t,this.y=e,this.width=n,this.height=i}static fromRect(t){return new _r(t.x,t.y,t.width,t.height)}toJSON(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}}}function zr(t){const{min:[e,n],max:[i,r]}=t.getRenderBounds();return new _r(e,n,i-e,r-n)}function Ir(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Gr=Fn({text:"text"},"title");function Hr(t){return/\S+-\S+/g.test(t)?t.split("-").map(t=>t[0]):t.length>2?[t[0]]:t.split("")}function Fr(t,e){const n=Object.entries(e).reduce((e,n)=>{let[i,r]=n;return t.node().attr(i)||(e[i]=r),e},{});t.styles(n)}class Dr extends w{constructor(t){super(t,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"}),Ir(this,"title",void 0)}getAvailableSpace(){const{width:t,height:e,position:n,spacing:i,inset:r}=this.attributes,o=this.querySelector(Gr.text.class);if(!o)return new _r(0,0,+t,+e);const{width:s,height:a}=o.getBBox(),[l,u,c,h]=j(i);let[d,p,f,g]=[0,0,+t,+e];const m=Hr(n);if(m.includes("i"))return new _r(d,p,f,g);m.forEach((n,i)=>{"t"===n&&([p,g]=0===i?[a+c,+e-a-c]:[0,+e]),"r"===n&&([f]=[+t-s-h]),"b"===n&&([g]=[+e-a-l]),"l"===n&&([d,f]=0===i?[s+u,+t-s-u]:[0,+t])});const[b,y,v,x]=j(r),[w,S]=[x+y,b+v];return new _r(d+x,p+b,f-w,g-S)}getBBox(){return this.title?this.title.getBBox():new _r(0,0,0,0)}render(t,e){const{width:n,height:i,position:r,spacing:o,...s}=t,[a]=O(s),{x:l,y:u,textAlign:c,textBaseline:h}=function(t){const{width:e,height:n,position:i}=t,[r,o]=[+e/2,+n/2];let[s,a,l,u]=[+r,+o,"center","middle"];const c=Hr(i);return c.includes("l")&&([s,l]=[0,"start"]),c.includes("r")&&([s,l]=[+e,"end"]),c.includes("t")&&([a,u]=[0,"top"]),c.includes("b")&&([a,u]=[+n,"bottom"]),{x:s,y:a,textAlign:l,textBaseline:u}}(t);$(!!s.text,K(e),t=>{this.title=t.maybeAppendByClassName(Gr.text,"text").styles(a).call(Fr,{x:l,y:u,textAlign:c,textBaseline:h}).node()})}}function Rr(t,e,n,i,r){const o=C(i,"title"),[s,{transform:a="",...l}]=O(o);t.styles(s),e.styles(l),Ji(t.node(),a);const{x:u,y:c}=function(t,e,n){const{titlePosition:i="lb",titleSpacing:r}=n,o=Hr(i),{min:[s,a],halfExtents:[l,u]}=t.node().getLocalBounds(),[c,h]=e.node().getLocalBounds().halfExtents;let[d,p]=[s+l,a+u];const[f,g,m,b]=j(r);if(["start","end"].includes(i)&&"linear"===n.type){const{startPos:t,endPos:e}=n,[r,o]="start"===i?[t,e]:[e,t],s=cn([-o[0]+r[0],-o[1]+r[1]]),[a,l]=rn(s,f);return{x:r[0]+a,y:r[1]+l}}return o.includes("t")&&(p-=u+h+f),o.includes("r")&&(d+=l+c+g),o.includes("l")&&(d-=l+c+b),o.includes("b")&&(p+=u+h+m),{x:d,y:p}}(K(n._offscreen||n.querySelector(ei.mainGroup.class)),e,i),h=Bn(e.node(),{x:u,y:c},r);return Ji(t.node(),a),h}function Vr(t,e,n,i){const{showLine:r,showTick:o,showLabel:s}=t;return[...$(r,e.maybeAppendByClassName(ei.lineGroup,"g"),e=>Hi(e,t,i))||[],...$(o,e.maybeAppendByClassName(ei.tickGroup,"g"),e=>function(t,e,n,i){const r=Pi(e,n.tickFilter),o=C(n,"tick");return t.selectAll(ei.tick.class).data(r,t=>t.id||t.label).join(t=>t.append("g").attr("className",ei.tick.name).transition((function(t,e){return jr.call(this,t,e,r,n,o,!1)})),t=>t.transition((function(t,e){return this.removeChildren(),jr.call(this,t,e,r,n,o,i.update)})),t=>t.transition((function(){const t=oi(this,i.exit);return Mn(t,()=>this.remove()),t}))).transitions()}(e,n,t,i))||[],...$(s,e.maybeAppendByClassName(ei.labelGroup,"g"),e=>Cr(e,n,t,i))||[]].filter(t=>!!t)}class Wr extends w{constructor(t){super(t,ti)}render(t,e,n){const{titleText:i,data:r,animate:o,showTitle:s,showGrid:a,dataThreshold:l,truncRange:u}=t,c=Qn(r,l).filter(t=>{let{value:e}=t;return!(u&&e>u[0]&&eRi(e,c,t,h))||[],p=K(e).maybeAppendByClassName(ei.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Vr(t,K(this.offscreenGroup),c,An(!1));return[...d,...Vr(t,K(p.node()),c,h),...$(s,K(e).maybeAppendByClassName(ei.titleGroup,"g"),e=>function(t,e,n,i){const{titleText:r}=n;return t.selectAll(ei.title.class).data([{title:r}].filter(t=>!!t.title),(t,e)=>t.title).join(o=>o.append(()=>wi(r)).attr("className",ei.title.name).transition((function(){return Rr(K(this),t,e,n,i.enter)})),r=>r.transition((function(){return Rr(K(this),t,e,n,i.update)})),t=>t.remove()).transitions()}(e,this,t,h))||[]].flat().filter(t=>!!t)}}class qr{}const Ur={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:t=>t.toString(),labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",zIndex:999};function Kr(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Yr=Fn({background:"background",labelGroup:"label-group",label:"label"},"indicator");class Zr extends w{constructor(t){super(t,Ur),Kr(this,"group",void 0),Kr(this,"background",void 0),Kr(this,"label",void 0),Kr(this,"point",[0,0]),this.group=this.appendChild(new i.Group({})),this.isMutationObserved=!0}renderBackground(){if(!this.label)return;const{position:t,padding:e}=this.attributes,[n,i,r,o]=j(e),{min:s,max:a}=this.label.node().getLocalBounds(),l=[[s[0]-o,s[1]-n],[a[0]+i,a[1]+r]],u=this.getPath(t,l),c=C(this.attributes,"background");this.background=K(this.group).maybeAppendByClassName(Yr.background,"path").styles({...c,path:u}),this.group.appendChild(this.label.node())}renderLabel(){const{formatter:t,labelText:e}=this.attributes,n=C(this.attributes,"label"),[{text:i,...r},o]=O(n);if(this.label=K(this.group).maybeAppendByClassName(Yr.labelGroup,"g").styles(o),!e)return;this.label.maybeAppendByClassName(Yr.label,()=>wi(t(e))).style("text",t(e).toString()).selectAll("text").styles(r)}adjustLayout(){const[t,e]=this.point;this.group.attr("x",-t).attr("y",-e)}getPath(t,e){const[[n,i],[r,o]]=e,s={top:[[n,i],[r,i]],right:[[r,i],[r,o]],bottom:[[r,o],[n,o]],left:[[n,o],[n,i]]},a={top:"bottom",right:"left",bottom:"top",left:"right"},l=Object.entries(s).map(e=>{let[n,i]=e;return n===a[t]?this.createCorner(i):[["M",...i[0]],["L",...i[1]]]});return l.push([["Z"]]),l.flat().filter((t,e,n)=>0===e||"M"!==t[0])}createCorner(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;const n=gr(...t),[[i,r],[o,s]]=t,[a,[l,u]]=n?[o-i,[i,o]]:[s-r,[r,s]],c=a/2,h=e*(a/Math.abs(a)),d=h/2,p=h*Math.sqrt(3)/2*.8,[f,g,m,b,y]=[l,l+c-d,l+c,l+c+d,u];return n?(this.point=[m,r-p],[["M",f,r],["L",g,r],["L",m,r-p],["L",b,r],["L",y,r]]):(this.point=[i+p,m],[["M",i,f],["L",i,g],["L",i+p,m],["L",i,b],["L",i,y]])}bindEvents(){this.label.on(i.ElementEvent.BOUNDS_CHANGED,this.renderBackground)}render(){this.renderLabel(),this.renderBackground(),this.adjustLayout()}}ut.registerSymbol("hiddenHandle",(function(t,e,n){const i=1.4*n;return[["M",t-n,e-i],["L",t+n,e-i],["L",t+n,e+i],["L",t-n,e+i],["Z"]]})),ut.registerSymbol("verticalHandle",(function(t,e,n){const i=1.4*n,r=n/2,o=n/6,s=t+.4*i;return[["M",t,e],["L",s,e+r],["L",t+i,e+r],["L",t+i,e-r],["L",s,e-r],["Z"],["M",s,e+o],["L",t+i-2,e+o],["M",s,e-o],["L",t+i-2,e-o]]})),ut.registerSymbol("horizontalHandle",(function(t,e,n){const i=1.4*n,r=n/2,o=n/6,s=e+.4*i;return[["M",t,e],["L",t-r,s],["L",t-r,e+i],["L",t+r,e+i],["L",t+r,s],["Z"],["M",t-o,s],["L",t-o,e+i-2],["M",t+o,s],["L",t+o,e+i-2]]}));function $r(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"horizontal",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return"horizontal"===t?e:n}function Xr(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Jr=Fn({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Qr={showLabel:!0,formatter:t=>t.toString(),markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0};class to extends w{constructor(t){super(t,Qr),Xr(this,"marker",void 0)}render(t,e){const n=K(e).maybeAppendByClassName(Jr.markerGroup,"g");this.renderMarker(n);const i=K(e).maybeAppendByClassName(Jr.labelGroup,"g");this.renderLabel(i)}renderMarker(t){const{orientation:e,markerSymbol:n=$r(e,"horizontalHandle","verticalHandle")}=this.attributes;$(!!n,t,t=>{const e=C(this.attributes,"marker"),i={symbol:n,...e};this.marker=t.maybeAppendByClassName(Jr.marker,()=>new ut({style:i})).update(i)})}renderLabel(t){const{showLabel:e,orientation:n,spacing:i=0,formatter:r}=this.attributes;$(e,t,t=>{var e;const{text:o,...s}=C(this.attributes,"label"),{width:a=0,height:l=0}=(null===(e=t.select(Jr.marker.class))||void 0===e?void 0:e.node().getBBox())||{},[u,c,h,d]=$r(n,[0,l+i,"center","top"],[a+i,0,"start","middle"]);t.maybeAppendByClassName(Jr.label,"text").styles({...s,x:u,y:c,text:r(o).toString(),textAlign:h,textBaseline:d})})}}const eo={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},no=y({},eo,{}),io=y({},eo,B(Qr,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),ro=Fn({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend");function oo(t,e){const[n,i]=function(t,e){for(let n=1;n=i&&e<=r)return[i,r]}return[e,e]}(t,e);return{tick:e>(n+i)/2?i:n,range:[n,i]}}const so=Fn({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function ao(t){const{orientation:e,size:n,length:i}=t;return $r(e,[i,n],[n,i])}function lo(t){const{type:e}=t,[n,i]=ao(t);return"size"===e?[["M",0,i],["L",0+n,0],["L",0+n,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+n,0],["L",0+n,i],["Z"]]}function uo(t){return lo(t)}function co(t){const{orientation:e,color:n,block:r,partition:o}=t;let s;if(Z(n)){s=new Array(20).fill(0).map((t,e,i)=>n(e/(i.length-1)))}else s=n;const a=s.length,l=s.map(t=>Object(i.parseColor)(t).toString());return a?1===a?l[0]:r?function(t,e,n){const i=Array.from(e),r=t.length;return new Array(r).fill(0).reduce((e,n,o)=>{const s=i[o%i.length];return e+" ".concat(t[o],":").concat(s).concat(ot+" ".concat(n/(a-1),":").concat(e),"l(".concat($r(e,"0","270"),")")):""}function ho(t){const{orientation:e,range:n}=t;if(!n)return[];const[i,r]=ao(t),[o,s]=n,a=$r(e,o*i,0),l=$r(e,0,o*r),u=$r(e,s*i,i),c=$r(e,r,s*r);return[["M",a,l],["L",a,c],["L",u,c],["L",u,l],["Z"]]}class po extends w{constructor(t){super(t,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})}render(t,e){!function(t,e){const n=C(e,"track");t.maybeAppendByClassName(so.track,"path").styles({path:lo(e),...n})}(K(e).maybeAppendByClassName(so.trackGroup,"g"),t);!function(t,e){const n=C(e,"selection"),i=co(e),r=t.maybeAppendByClassName(so.selection,"path").styles({path:uo(e),fill:i,...n}),o=r.maybeAppendByClassName(so.clipPath,"path").styles({path:ho(e)}).node();r.style("clip-path",o)}(K(e).maybeAppendByClassName(so.selectionGroup,"g"),t)}}function fo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const go=fi(t=>({min:Math.min(...t.map(t=>t.value)),max:Math.max(...t.map(t=>t.value))}),t=>t.map(t=>t.id));class mo extends w{constructor(t){super(t,io),fo(this,"eventToOffsetScale",new Me({})),fo(this,"innerRibbonScale",new Me({})),fo(this,"title",void 0),fo(this,"label",void 0),fo(this,"ribbon",void 0),fo(this,"indicator",void 0),fo(this,"handlesGroup",void 0),fo(this,"startHandle",void 0),fo(this,"endHandle",void 0),fo(this,"cacheLabelBBox",null),fo(this,"cacheHandleBBox",null),fo(this,"target",void 0),fo(this,"prevValue",void 0),fo(this,"onHovering",t=>{const{data:e,block:n}=this.attributes;t.stopPropagation();const i=this.getValueByCanvasPoint(t);if(n){const{range:t}=oo(e.map(t=>{let{value:e}=t;return e}),i);this.showIndicator((t[0]+t[1])/2,"".concat(t[0],"-").concat(t[1])),this.dispatchIndicated(i,t)}else{const t=this.getTickValue(i);this.showIndicator(t),this.dispatchIndicated(t)}}),fo(this,"onDragStart",t=>e=>{e.stopPropagation(),this.attributes.slidable&&(this.target=t,this.prevValue=this.getTickValue(this.getValueByCanvasPoint(e)),document.addEventListener("mousemove",this.onDragging),document.addEventListener("touchmove",this.onDragging),document.addEventListener("mouseleave",this.onDragEnd),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("mouseup",this.onDragEnd),document.addEventListener("touchend",this.onDragEnd))}),fo(this,"onDragging",t=>{const{target:e}=this;this.updateMouse();const[n,i]=this.selection,r=this.getTickValue(this.getValueByCanvasPoint(t)),o=r-this.prevValue;"start"===e?n!==r&&this.updateSelection(r,i):"end"===e?i!==r&&this.updateSelection(n,r):"ribbon"===e&&0!==o&&(this.prevValue=r,this.updateSelection(o,o,!0))}),fo(this,"onDragEnd",()=>{this.style.cursor="default",document.removeEventListener("mousemove",this.onDragging),document.removeEventListener("touchmove",this.onDragging),document.removeEventListener("mouseup",this.onDragEnd),document.removeEventListener("touchend",this.onDragEnd)})}get handleOffsetRatio(){return this.ifHorizontal(.5,.5)}getBBox(){const{width:t,height:e}=this.attributes;return new _r(0,0,t,e)}render(t,e){const{showLabel:n}=t;this.renderTitle(K(e));const{x:i,y:r}=this.availableSpace,o=K(e).maybeAppendByClassName(ro.contentGroup,"g").styles({x:i,y:r});$(!!n,o.maybeAppendByClassName(ro.labelGroup,"g").styles({zIndex:1}),t=>{this.renderLabel(t)});const s=o.maybeAppendByClassName(ro.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=o.maybeAppendByClassName(ro.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(s),this.renderIndicator(o),this.adjustLabel(),this.adjustHandles()}get range(){const{data:t}=this.attributes;return go(t)}get ribbonScale(){const{min:t,max:e}=this.range;return this.innerRibbonScale.update({domain:[t,e],range:[0,1]}),this.innerRibbonScale}get ribbonRange(){const[t,e]=this.selection,n=this.ribbonScale;return[n.map(t),n.map(e)]}get selection(){const{min:t,max:e}=this.range,{defaultValue:[n,i]=[t,e]}=this.attributes;return[n,i]}ifHorizontal(t,e){return $r(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)}renderTitle(t){const{showTitle:e,titleText:n,width:i,height:r}=this.attributes,o={...C(this.attributes,"title"),width:i,height:r,text:n},s=this;t.selectAll(ro.title.class).data(e?[n]:[]).join(t=>t.append(()=>new Dr({style:o})).attr("className",ro.title.name).each((function(){s.title=this})),t=>t.update(o),t=>t.each(()=>{s.title=void 0}).remove())}get availableSpace(){if(this.title)return this.title.getAvailableSpace();const{width:t,height:e}=this.attributes;return new _r(0,0,t,e)}get labelFixedSpacing(){const{showTick:t}=this.attributes;return t?5:0}get labelPosition(){const{orientation:t,labelDirection:e}=this.attributes;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[t][e]}get labelBBox(){var t;const{showLabel:e}=this.attributes;if(!e)return new _r(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;const{width:n,height:i}=(null===(t=this.label.querySelector(ei.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox();return this.cacheLabelBBox=new _r(0,0,n,i),this.cacheLabelBBox}get labelShape(){const{showLabel:t,labelSpacing:e=0}=this.attributes;if(!t)return{width:0,height:0,size:0,length:0};const{width:n,height:i}=this.labelBBox;return{width:n,height:i,size:this.ifHorizontal(i,n)+e+this.labelFixedSpacing,length:this.ifHorizontal(n,i)}}get ribbonBBox(){const{showHandle:t,ribbonSize:e}=this.attributes,{width:n,height:i}=this.availableSpace,{size:r,length:o}=this.labelShape,[s,a]=this.ifHorizontal([i,n],[n,i]),{size:l,length:u}=t?this.handleShape:{size:0,length:0},c=this.handleOffsetRatio;let h=0;const d=this.labelPosition;h=e||(["bottom","right"].includes(d)?Math.min(s-r,(s-l)/c):s*(1-c)>l?Math.max(s-r,0):Math.max((s-r-l)/c,0));const p=Math.max(u,o),f=a-p,[g,m]=this.ifHorizontal([f,h],[h,f]),b=["top","left"].includes(d)?r:0,[y,v]=this.ifHorizontal([p/2,b],[b,p/2]);return new _r(y,v,g,m)}get ribbonShape(){const{width:t,height:e}=this.ribbonBBox;return this.ifHorizontal({size:e,length:t},{size:t,length:e})}renderRibbon(t){const{data:e,type:n,orientation:i,color:r,block:o}=this.attributes,s=C(this.attributes,"ribbon"),{min:a,max:l}=this.range,{x:u,y:c}=this.ribbonBBox,{length:h,size:d}=this.ribbonShape,p=y({x:u,y:c,length:h,size:d,type:n,orientation:i,color:r,block:o,partition:e.map(t=>(t.value-a)/(l-a)),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(ro.ribbon,()=>new po({style:p})).update(p)}getHandleClassName(t){return"".concat(ro.prefix("".concat(t,"-handle")))}renderHandles(){const{showHandle:t,orientation:e}=this.attributes,n=C(this.attributes,"handle"),[i,r]=this.selection,o={...n,orientation:e},{shape:s="slider"}=n,a="basic"===s?to:Yn,l=this;this.handlesGroup.selectAll(ro.handle.class).data(t?[{value:i,type:"start"},{value:r,type:"end"}]:[],t=>t.type).join(t=>t.append(()=>new a({style:o})).attr("className",t=>{let{type:e}=t;return"".concat(ro.handle," ").concat(l.getHandleClassName(e))}).each((function(t){let{type:e,value:n}=t;this.update({labelText:n});const i="".concat(e,"Handle");l[i]=this,this.addEventListener("pointerdown",l.onDragStart(e))})),t=>t.update(o).each((function(t){let{value:e}=t;this.update({labelText:e})})),t=>t.each(t=>{let{type:e}=t;const n="".concat(e,"Handle");l[n]=void 0}).remove())}adjustHandles(){const[t,e]=this.selection;this.setHandlePosition("start",t),this.setHandlePosition("end",e)}get handleBBox(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new _r(0,0,0,0);const{width:t,height:e}=this.startHandle.getBBox(),{width:n,height:i}=this.endHandle.getBBox(),[r,o]=[Math.max(t,n),Math.max(e,i)];return this.cacheHandleBBox=new _r(0,0,r,o),this.cacheHandleBBox}get handleShape(){const{width:t,height:e}=this.handleBBox,[n,i]=this.ifHorizontal([e,t],[t,e]);return{width:t,height:e,size:n,length:i}}setHandlePosition(t,e){const{handleFormatter:n}=this.attributes,{x:i,y:r}=this.ribbonBBox,{size:o}=this.ribbonShape,s=this.getOffset(e),[a,l]=this.ifHorizontal([i+s,r+o*this.handleOffsetRatio],[i+o*this.handleOffsetRatio,r+s]),u=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==u||u.update({x:a,y:l,formatter:n})}renderIndicator(t){const e=C(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(ro.indicator,()=>new Zr({})).update(e)}get labelData(){const{data:t}=this.attributes;return t.reduce((t,e,n,i)=>{var r,o;const s=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:n.toString();if(t.push({...e,id:s,index:n,type:"value",label:null!==(o=null==e?void 0:e.label)&&void 0!==o?o:e.value.toString(),value:this.ribbonScale.map(e.value)}),n"value"===(null==t?void 0:t.type)&&(!n||n(t,t.index,i.filter(t=>"value"!==t.type))),labelFilter:(t,e,i)=>(null==t?void 0:t.type)===s&&(!n||n(t,t.index,i.filter(t=>t.type===s))),labelFormatter:i}};this.label=t.maybeAppendByClassName(ro.label,()=>new Wr({style:a})).node(),this.label.update(a,!1)}get labelAxisStyle(){const{showTick:t,labelDirection:e,labelSpacing:n,tickLength:i}=this.attributes,{size:r}=this.ribbonShape,o=this.labelPosition,s=this.labelFixedSpacing;let[a,l,u]=[0,0,0];const c=null!=i?i:r;return t?(u=c,l=s,"positive"===e?"right"===o?(a=c,u=c):"bottom"===o&&(a=u):"negative"===e&&("top"===o||"left"===o)&&(a=r)):"positive"===e?"right"===o?l=c:"bottom"===o&&(a=r+s,l=n):"negative"===e&&("left"===o||"top"===o)&&(l=n),{offset:a,spacing:n,tickLength:u}}adjustLabel(){const{showLabel:t}=this.attributes;if(!t)return;const{x:e,y:n,width:i,height:r}=this.ribbonBBox,{offset:o,spacing:s,tickLength:a}=this.labelAxisStyle,[l,u]=this.ifHorizontal([[e,n+o],[e+i,n+o]],[[e+o,n+r],[e+o,n]]);this.label.update({startPos:l,endPos:u,tickLength:a,labelSpacing:s},!1)}bindEvents(){this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)}showIndicator(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"".concat(t);const{showIndicator:n}=this.attributes;if(!n||"number"!=typeof t)return void this.hideIndicator();const{min:i,max:r}=this.range,{x:o,y:a}=this.ribbonBBox,l=Qe(t,i,r),u=this.getOffset(l),c=this.ifHorizontal([u+o,a],[o,u+a]);this.indicator.update({x:c[0],y:c[1],position:this.ifHorizontal("top","left"),labelText:e}),s(this.indicator.node())}hideIndicator(){a(this.indicator.node())}updateMouse(){this.attributes.slidable&&(this.style.cursor="grabbing")}setSelection(t,e){this.updateSelection(t,e)}updateSelection(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const[i,r]=this.selection;let[o,s]=[t,e];n&&(o+=i,s+=r);const{min:a,max:l}=this.range;[o,s]=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:4;const[r,o]=t,[s,a]=e,[l,u]=n;let[c,h]=[s,a];const d=h-c;return c>h&&([c,h]=[h,c]),d>o-r?[r,o]:co?u===o&&l===c?[c,o]:[o-d,o]:[Tn(c,i),Tn(h,i)]}([a,l],[o,s],this.selection),this.update({defaultValue:[o,s]}),this.dispatchSelection()}get step(){const{step:t=1}=this.attributes,{min:e,max:n}=this.range;return ht(t)?Tn(.01*(n-e),0):t}getTickValue(t){const{data:e,block:n}=this.attributes,{min:i}=this.range;return n?oo(e.map(t=>{let{value:e}=t;return e}),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)}getValueByCanvasPoint(t){const{min:e,max:n}=this.range,[i,r]=this.ribbon.node().getPosition(),o=this.ifHorizontal(i,r),s=this.ifHorizontal(...On(t))-o;return Qe(this.getOffset(s,!0),e,n)}getOffset(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{min:n,max:i}=this.range,{length:r}=this.ribbonShape,o=this.eventToOffsetScale;return o.update({domain:[n,i],range:[0,r]}),e?o.invert(t):o.map(t)}dispatchSelection(){const t=new i.CustomEvent("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)}dispatchIndicated(t,e){const n=new i.CustomEvent("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)}}var bo=function(){};function yo(t,e){return t.reduce((t,n)=>((t[n[e]]=t[n[e]]||[]).push(n),t),{})}var vo=function(t,e,n){var i;return function(){var r=this,o=arguments,s=function(){i=null,n||t.apply(r,o)},a=n&&!i;clearTimeout(i),i=setTimeout(s,e),a&&t.apply(r,o)}};function xo(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((e,n)=>t.map(t=>t[n])))||[]}function wo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const So=Fn({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator");class ko extends w{constructor(t){var e,n,r;super(t,{animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonPath:(e=0,n=0,r=6,[["M",e-r,n-r],["L",e+r,n],["L",e-r,n+r],["Z"]]),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:(t,e)=>"".concat(t,"/").concat(e),defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"}),wo(this,"playState","idle"),wo(this,"contentGroup",this.appendChild(new i.Group({class:So.contentGroup.name}))),wo(this,"playWindow",this.contentGroup.appendChild(new i.Group({class:So.playWindow.name}))),wo(this,"innerCurrPage",this.defaultPage),wo(this,"clipPath",void 0),wo(this,"prevBtnGroup",void 0),wo(this,"nextBtnGroup",void 0),wo(this,"pageInfoGroup",void 0)}get defaultPage(){const{defaultPage:t}=this.attributes;return Qe(t,0,Math.max(this.pageViews.length-1,0))}get pageViews(){return this.playWindow.children}get controllerShape(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}}get pageShape(){const{pageViews:t}=this,[e,n]=xo(t.map(t=>{const{width:e,height:n}=t.getBBox();return[e,n]})).map(t=>Math.max(...t)),{pageWidth:i=e,pageHeight:r=n}=this.attributes;return{pageWidth:i,pageHeight:r}}getContainer(){return this.playWindow}get totalPages(){return this.pageViews.length}get currPage(){return this.innerCurrPage}getBBox(){const{x:t,y:e}=super.getBBox(),n=this.controllerShape,{pageWidth:i,pageHeight:r}=this.pageShape;return new _r(t,e,i+n.width,r)}goTo(t){const{animate:e}=this.attributes,{currPage:n,playState:i,playWindow:r,pageViews:o}=this;if("idle"!==i||t<0||o.length<=0||t>=o.length)return null;o[n].setLocalPosition(0,0),this.prepareFollowingPage(t);const[s,a]=this.getFollowingPageDiff(t);this.playState="running";const l=Cn(r,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-s,", ").concat(-a,")")}],e);return Mn(l,()=>{this.innerCurrPage=t,this.playState="idle",this.setVisiblePages([t]),this.updatePageInfo()}),l}prev(){const{loop:t}=this.attributes,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;const i=t?(n-1+e)%e:Qe(n-1,0,e);return this.goTo(i)}next(){const{loop:t}=this.attributes,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;const i=t?(n+1)%e:Qe(n+1,0,e);return this.goTo(i)}renderClipPath(t){const{pageWidth:e,pageHeight:n}=this.pageShape;e&&n?(this.clipPath=t.maybeAppendByClassName(So.clipPath,"rect").styles({width:e,height:n}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0}setVisiblePages(t){this.playWindow.children.forEach((e,n)=>{t.includes(n)?s(e):a(e)})}adjustControllerLayout(){const{prevBtnGroup:t,nextBtnGroup:e,pageInfoGroup:n}=this,{orientation:i,controllerPadding:r}=this.attributes,{width:o,height:s}=n.getBBox(),[a,l]="horizontal"===i?[-180,0]:[-90,90];t.setLocalEulerAngles(a),e.setLocalEulerAngles(l);const{width:u,height:c}=t.getBBox(),{width:h,height:d}=e.getBBox(),p=Math.max(u,o,h),{offset:[[f,g],[m,b],[y,v]],textAlign:x}="horizontal"===i?{offset:[[0,0],[u/2+r,0],[u+o+2*r,0]],textAlign:"start"}:{offset:[[p/2,-c-r],[p/2,0],[p/2,d+r]],textAlign:"center"},w=n.querySelector("text");w&&(w.style.textAlign=x),t.setLocalPosition(f,g),n.setLocalPosition(m,b),e.setLocalPosition(y,v)}updatePageInfo(){var t;const{currPage:e,pageViews:n,attributes:{formatter:i}}=this;n.length<2||(null===(t=this.pageInfoGroup.querySelector(So.pageInfo.class))||void 0===t||t.attr("text",i(e+1,n.length)),this.adjustControllerLayout())}getFollowingPageDiff(t){const{currPage:e}=this;if(e===t)return[0,0];const{orientation:n}=this.attributes,{pageWidth:i,pageHeight:r}=this.pageShape,o=t=2,o=t.maybeAppendByClassName(So.controller,"g");if(l(o.node(),r),!r)return;const s=C(this.attributes,"button"),a=C(this.attributes,"pageNum"),[{size:u,...c},h]=O(s),d=!o.select(So.prevBtnGroup.class).node(),p=o.maybeAppendByClassName(So.prevBtnGroup,"g").styles(h);this.prevBtnGroup=p.node();const f=p.maybeAppendByClassName(So.prevBtn,"path"),g=o.maybeAppendByClassName(So.nextBtnGroup,"g").styles(h);this.nextBtnGroup=g.node();[f,g.maybeAppendByClassName(So.nextBtn,"path")].forEach(t=>{t.styles({...c,transformOrigin:"center"}),Si(t.node(),u,!0)});const m=o.maybeAppendByClassName(So.pageInfoGroup,"g");this.pageInfoGroup=m.node(),m.maybeAppendByClassName(So.pageInfo,"text").styles(a),this.updatePageInfo(),o.node().setLocalPosition(n+e,i/2),d&&(this.prevBtnGroup.addEventListener("click",()=>{this.prev()}),this.nextBtnGroup.addEventListener("click",()=>{this.next()}))}render(t,e){const n=K(e);this.renderClipPath(n),this.renderController(n),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)}bindEvents(){const t=vo(()=>this.render(this.attributes,this),50);this.playWindow.addEventListener(i.ElementEvent.INSERTED,t),this.playWindow.addEventListener(i.ElementEvent.REMOVED,t)}}function Lo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Po=Fn({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");class Ao extends w{constructor(t){super(t,{span:[1,1],marker:()=>new i.Circle({style:{r:6}}),markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"}),Lo(this,"markerGroup",void 0),Lo(this,"labelGroup",void 0),Lo(this,"valueGroup",void 0),Lo(this,"background",void 0)}get showValue(){const{valueText:t}=this.attributes;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))}get actualSpace(){const t=this.labelGroup,e=this.valueGroup,{markerSize:n}=this.attributes,{width:i,height:r}=t.node().getBBox(),{width:o,height:s}=e.node().getBBox();return{markerWidth:n,labelWidth:i,valueWidth:o,height:Math.max(n,r,s)}}get span(){const{span:t}=this.attributes;if(!t)return[1,1];const[e,n]=j(t),i=this.showValue?n:0,r=e+i;return[e/r,i/r]}get shape(){const{markerSize:t,width:e}=this.attributes,n=this.actualSpace,{markerWidth:i,height:r}=n;let{labelWidth:o,valueWidth:s}=this.actualSpace;const[a,l]=this.spacing;if(e){const n=e-t-a-l,[i,r]=this.span;[o,s]=[i*n,r*n]}return{width:i+o+s+a+l,height:r,markerWidth:i,labelWidth:o,valueWidth:s}}get spacing(){const{spacing:t}=this.attributes;if(!t)return[0,0];const[e,n]=j(t);return this.showValue?[e,n]:[e,0]}get layout(){const{markerWidth:t,labelWidth:e,valueWidth:n,width:i,height:r}=this.shape,[o,s]=this.spacing;return{height:r,width:i,markerWidth:t,labelWidth:e,valueWidth:n,position:[t/2,t+o,t+e+o+s]}}get scaleSize(){const t=function(t){const e=t.querySelector(Po.marker.class);return e?e.style:{}}(this.markerGroup.node()),{markerSize:e,markerStrokeWidth:n=t.strokeWidth,markerLineWidth:i=t.lineWidth,markerStroke:r=t.stroke}=this.attributes,o=+(n||i||(r?1:0))*Math.sqrt(2),{width:s,height:a}=this.markerGroup.node().getBBox();return(1-o/Math.max(s,a))*e}renderMarker(t){const{marker:e}=this.attributes,n=C(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Po.markerGroup,"g").style("zIndex",0),$(!!e,this.markerGroup,()=>{this.markerGroup.maybeAppendByClassName(Po.marker,e).styles(n),this.markerGroup.node().scale(1/this.markerGroup.node().getScale()[0]),Si(this.markerGroup.node(),this.scaleSize,!0)})}renderLabel(t){const{text:e,...n}=C(this.attributes,"label");this.labelGroup=t.maybeAppendByClassName(Po.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Po.label,()=>wi(e)).styles(n)}renderValue(t){const{text:e,...n}=C(this.attributes,"value");this.valueGroup=t.maybeAppendByClassName(Po.valueGroup,"g").style("zIndex",0),$(this.showValue,this.valueGroup,()=>{this.valueGroup.maybeAppendByClassName(Po.value,()=>wi(e)).styles(n)})}renderBackground(t){const{width:e,height:n}=this.shape,i=C(this.attributes,"background");this.background=t.maybeAppendByClassName(Po.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Po.background,"rect").styles({width:e,height:n,...i})}adjustLayout(){const{layout:{labelWidth:t,valueWidth:e,height:n,position:[i,r,o]}}=this,s=n/2;this.markerGroup.styles({x:i,y:s}),this.labelGroup.styles({x:r,y:s}),Zi(this.labelGroup.select(Po.label.class).node(),Math.ceil(t)),this.showValue&&(this.valueGroup.styles({x:o,y:s}),Zi(this.valueGroup.select(Po.value.class).node(),Math.ceil(e)))}render(t,e){const n=K(e);this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()}}function Mo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const Eo=Fn({page:"item-page",navigator:"navigator",item:"item"},"items"),Co=function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t?e(t):n};class Bo extends w{constructor(t){super(t,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:bo,mouseenter:bo,mouseleave:bo}),Mo(this,"navigator",void 0),Mo(this,"navigatorShape",[0,0])}get pageViews(){return this.navigator.getContainer()}get grid(){const{gridRow:t,gridCol:e,data:n}=this.attributes;if(!t&&!e)throw new Error("gridRow and gridCol can not be set null at the same time");return t&&e?[t,e]:t?[t,n.length]:[n.length,e]}get renderData(){const{data:t,layout:e}=this.attributes,n=C(this.attributes,"item");return t.map((i,r)=>{const{id:o=r,label:s,value:a}=i;return{id:"".concat(o),index:r,style:{layout:e,labelText:s,valueText:a,...Object.fromEntries(Object.entries(n).map(e=>{let[n,o]=e;return[n,ri(o,[i,r,t])]}))}}})}getGridLayout(){const{orientation:t,width:e,rowPadding:n,colPadding:i}=this.attributes,[r]=this.navigatorShape,[o,s]=this.grid,a=s*o;let l=0;return this.pageViews.children.map((u,c)=>{const h=Math.floor(c/a),d=c%a,p=this.ifHorizontal(s,o),f=[Math.floor(d/p),d%p];"vertical"===t&&f.reverse();const[g,m]=f,b=(e-r-(s-1)*i)/s,y=u.getBBox().height;let[v,x]=[0,0];return"horizontal"===t?([v,x]=[l,g*(y+n)],l=m===s-1?0:l+b+i):([v,x]=[m*(b+i),l],l=g===o-1?0:l+y+n),{page:h,index:c,row:g,col:m,pageIndex:d,width:b,height:y,x:v,y:x}})}getFlexLayout(){const{width:t,height:e,rowPadding:n,colPadding:i}=this.attributes,[r]=this.navigatorShape,[o,s]=this.grid,[a,l]=[t-r,e];let[u,c,h,d,p,f,g,m]=[0,0,0,0,0,0,0,0];return this.pageViews.children.map((t,e)=>{const{width:r,height:b}=t.getBBox(),y=0===g?0:i,v=g+y+r;if(v<=a&&Co(p,t=>tt0?(this.navigatorShape=[55,0],t.call(this)):e}ifHorizontal(t,e){const{orientation:n}=this.attributes;return $r(n,t,e)}flattenPage(t){t.querySelectorAll(Eo.item.class).forEach(e=>{t.appendChild(e)}),t.querySelectorAll(Eo.page.class).forEach(e=>{t.removeChild(e).destroy()})}renderItems(t){const{click:e,mouseenter:n,mouseleave:i}=this.attributes;this.flattenPage(t);const r=this.dispatchCustomEvent.bind(this);K(t).selectAll(Eo.item.class).data(this.renderData,t=>t.id).join(t=>t.append(t=>{let{style:e}=t;return new Ao({style:e})}).attr("className",Eo.item.name).on("click",(function(){null==e||e(this),r("itemClick",{item:this})})).on("pointerenter",(function(){null==n||n(this),r("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),r("itemMouseleave",{item:this})})),t=>t.each((function(t){let{style:e}=t;this.update(e)})),t=>t.remove())}relayoutNavigator(){var t;const{layout:e,width:n}=this.attributes,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,[r,o]=this.navigatorShape;this.navigator.update("grid"===e?{pageWidth:n-r,pageHeight:i-o}:{})}adjustLayout(){const t=Object.entries(yo(this.itemsLayout,"page")).map(t=>{let[e,n]=t;return{page:e,layouts:n}}),e=[...this.navigator.getContainer().children];t.forEach(t=>{let{layouts:n}=t;const r=this.pageViews.appendChild(new i.Group({className:Eo.page.name}));n.forEach(t=>{const{x:n,y:i,index:o,width:s,height:a}=t,l=e[o];r.appendChild(l),function(t,e,n){var i=t,r=st(e)?e.split("."):e;r.forEach((function(t,e){et.append(()=>new ko({style:i})).attr("className",Eo.navigator.name).each((function(){r.navigator=this})),t=>t.each((function(){this.update(i)})),t=>t.remove()),this.navigator}getBBox(){return this.navigator.getBBox()}render(t,e){const{data:n}=this.attributes;if(!n||0===n.length)return;const i=this.renderNavigator(K(e));this.renderItems(i.getContainer()),this.adjustLayout()}dispatchCustomEvent(t,e){const n=new i.CustomEvent(t,{detail:e});this.dispatchEvent(n)}}function Oo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class To extends w{constructor(t){super(t,no),Oo(this,"titleGroup",void 0),Oo(this,"title",void 0),Oo(this,"itemsGroup",void 0),Oo(this,"items",void 0)}renderTitle(t,e,n){const{showTitle:i,titleText:r}=this.attributes,o=C(this.attributes,"title"),[s,a]=O(o);this.titleGroup=t.maybeAppendByClassName(ro.titleGroup,"g").styles(a);const l={width:e,height:n,...s,text:i?r:""};this.title=this.titleGroup.maybeAppendByClassName(ro.title,()=>new Dr({style:l})).update(l)}renderItems(t,e){const{x:n,y:i,width:r,height:o}=e,s=C(this.attributes,"title",!0),[a,l]=O(s),u={...a,width:r,height:o,x:0,y:0};this.itemsGroup=t.maybeAppendByClassName(ro.itemsGroup,"g").styles({x:n,y:i,...l});const c=this;this.itemsGroup.selectAll(ro.items.class).data(["items"]).join(t=>t.append(()=>new Bo({style:u})).attr("className",ro.items.name).each((function(){c.items=K(this)})),t=>t.update(u),t=>t.remove())}adjustLayout(){const{showTitle:t}=this.attributes;if(t){const{x:t,y:e}=this.title.node().getAvailableSpace();this.itemsGroup.node().setLocalPosition(t,e)}}get availableSpace(){const{showTitle:t,width:e,height:n}=this.attributes;return t?this.title.node().getAvailableSpace():new _r(0,0,e,n)}getBBox(){var t,e;const n=null===(t=this.title)||void 0===t?void 0:t.node(),i=null===(e=this.items)||void 0===e?void 0:e.node();return n&&i?function(t,e){const{position:n,spacing:i,inset:r,text:o}=t.attributes,s=t.getBBox(),a=e.getBBox(),l=Hr(n),[u,c,h,d]=j(o?i:0),[p,f,g,m]=j(r),[b,y]=[d+c,u+h],[v,x]=[m+f,p+g];if("l"===l[0])return new _r(s.x,s.y,a.width+s.width+b+v,Math.max(a.height+x,s.height));if("t"===l[0])return new _r(s.x,s.y,Math.max(a.width+v,s.width),a.height+s.height+y+x);const[w,S]=[e.attributes.width||a.width,e.attributes.height||a.height];return new _r(a.x,a.y,w+s.width+b+v,S+s.height+y+x)}(n,i):super.getBBox()}render(t,e){const{width:n,height:i}=t,r=K(e);this.renderTitle(r,n,i),this.renderItems(r,this.availableSpace),this.adjustLayout()}}var jo,No,_o,zo;function Io(t){jo||(jo=document.createElement("table"),No=document.createElement("tr"),_o=/^\s*<(\w+|!)[^>]*>/,zo={tr:document.createElement("tbody"),tbody:jo,thead:jo,tfoot:jo,td:No,th:No,"*":document.createElement("div")});var e=_o.test(t)&&RegExp.$1;e&&e in zo||(e="*");var n=zo[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}var Go=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t};function Ho(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(n,i,r)=>{const o=r.value;let s;"function"==typeof o&&(r.value=function(){for(var n=arguments.length,i=new Array(n),r=0;r{o.apply(a,i),s=null},t)})}}function Fo(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}const Do={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function Ro(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=Fo(t);return{[".".concat(e.CONTAINER)]:{position:"absolute",visibility:"visible","z-index":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)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},[".".concat(e.TITLE)]:{color:"rgba(0, 0, 0, 0.45)"},[".".concat(e.LIST)]:{margin:"0px","list-style-type":"none",padding:"0px"},[".".concat(e.LIST_ITEM)]:{"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},[".".concat(e.MARKER)]:{width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},[".".concat(e.NAME)]:{display:"flex","align-items":"center","max-width":"216px"},[".".concat(e.NAME_LABEL)]:{flex:1,...Do},[".".concat(e.VALUE)]:{display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)",...Do},[".".concat(e.CROSSHAIR_X)]:{position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},[".".concat(e.CROSSHAIR_Y)]:{position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"}}}function Vo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Wo extends w{get HTMLTooltipElement(){return this.element}getContainer(){return this.element}set position(t){let[e,n]=t;this.attributes.x=e,this.attributes.y=n,this.updatePosition()}get elementSize(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}}get HTMLTooltipItemsElements(){const{data:t,template:e}=this.attributes;return t.map((t,n)=>{let{name:i="",color:r="black",index:o,...s}=t;const a={name:i,color:r,index:null!=o?o:n,...s};return Io(Go(e.item,a))})}constructor(t){var e,n;const i=null===(e=t.style)||void 0===e||null===(n=e.template)||void 0===n?void 0:n.prefixCls,r=Fo(i);super(t,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'
'),title:'
'),item:'
  • \n \n \n {name}\n \n {value}\n
  • ')},style:Ro(i)}),Vo(this,"element",void 0),Vo(this,"prevCustomContentKey",this.attributes.contentKey),this.initShape(),this.render(this.attributes,this)}render(t,e){this.renderHTMLTooltipElement(),this.updatePosition()}destroy(){var t;null===(t=this.element)||void 0===t||t.remove(),super.destroy()}show(t,e){if(void 0!==t&&void 0!==e){const n=this.element.style.transition;this.element.style.transition="none",this.position=[null!=t?t:+this.attributes.x,null!=e?e:+this.attributes.y],setTimeout(()=>{this.element.style.transition=n},10)}this.element.style.visibility="visible"}hide(){this.element.style.visibility="hidden"}initShape(){const{template:t}=this.attributes;this.element=Io(t.container),this.id&&this.element.setAttribute("id",this.id)}renderCustomContent(){if(void 0!==this.prevCustomContentKey&&this.prevCustomContentKey===this.attributes.contentKey)return;this.prevCustomContentKey=this.attributes.contentKey;const{content:t}=this.attributes;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}renderHTMLTooltipElement(){const{template:t,title:e,enterable:n,style:i,content:r}=this.attributes,o=Fo(t.prefixCls),s=this.element;if(this.element.style.pointerEvents=n?"auto":"none",r)this.renderCustomContent();else{var a,l;e?(s.innerHTML=t.title,s.getElementsByClassName(o.TITLE)[0].innerHTML=e):null===(a=s.getElementsByClassName(o.TITLE))||void 0===a||null===(l=a[0])||void 0===l||l.remove();const n=this.HTMLTooltipItemsElements,i=document.createElement("ul");i.className=o.LIST,i.replaceChildren(...n);const r=this.element.querySelector(".".concat(o.LIST));r?r.replaceWith(i):s.appendChild(i)}E(s,i)}getRelativeOffsetFromCursor(t){const{position:e,offset:n}=this.attributes,i=(t||e).split("-"),r={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},{width:o,height:s}=this.elementSize;let a=[-o/2,-s/2];return i.forEach(t=>{const[e,i]=a,[l,u]=r[t];a=[e+(o/2+n[0])*l,i+(s/2+n[1])*u]}),a}setOffsetPosition(t){let[e,n]=t;const{x:i=0,y:r=0,container:{x:o,y:s}}=this.attributes;this.element.style.left="".concat(+i+o+e,"px"),this.element.style.top="".concat(+r+s+n,"px")}updatePosition(){this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor()))}autoPosition(t){let[e,n]=t;const{x:i,y:r,bounding:o,position:s}=this.attributes;if(!o)return[e,n];const{offsetWidth:a,offsetHeight:l}=this.element,[u,c]=[+i+e,+r+n],h={left:"right",right:"left",top:"bottom",bottom:"top"},{x:d,y:p,width:f,height:g}=o,m={left:ud+f,top:cp+g},b=[];s.split("-").forEach(t=>{m[t]?b.push(h[t]):b.push(t)});const y=b.join("-");return this.getRelativeOffsetFromCursor(y)}}Vo(Wo,"tag","tooltip"),Jt([Ho(100,!0)],Wo.prototype,"updatePosition",null);const qo={default:{sizeStyle:{width:44,height:22,radius:11},tagStyle:{textStyle:{fontSize:12,lineHeight:16,fill:"#fff"},padding:0},markerStyle:{size:11}},small:{sizeStyle:{width:28,height:16,radius:8},tagStyle:{textStyle:{fontSize:10,lineHeight:14,fill:"#fff"},padding:0},markerStyle:{size:8}},mini:{sizeStyle:{width:20,height:14,radius:7},tagStyle:{textStyle:{fontSize:7,lineHeight:10,fill:"#fff"},padding:0},markerStyle:{size:7}}};function Uo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ko(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=Number(t.style.height)-2*e;return{x:n?Number(t.style.width)+Number(t.style.x)-e-i:Number(t.style.x)+e,y:Number(t.style.y)+e,width:i,height:i,radius:i/2}}class Yo extends w{constructor(t){super(t,{x:0,y:0,size:"default",spacing:2,checked:!0,disabled:!1}),Uo(this,"checked",void 0)}render(t,e){const{size:n,spacing:i,disabled:r,checked:o,unCheckedChildren:s,checkedChildren:a}=t;this.attributes;const l=K(e).maybeAppendByClassName("switch-content","g").node(),u=l.getLocalBounds(),{sizeStyle:c,tagStyle:h}=gi(qo,n,qo.default),d=r?"no-drop":"pointer",p=o?"#1890FF":"#00000040";let f=c;const g=o?a:s;(a||s)&&K(l).maybeAppendByClassName("switch-tag",()=>new ct({})).call(t=>{const e=t.node();e.update({cursor:d,backgroundStyle:null,text:!1,marker:!1,...h,...g});const{max:n,min:i}=null==e?void 0:e.getLocalBounds(),r=n[0]-i[0]+c.radius,s=n[1]-i[1],a=Math.max(r+c.height+2,c.width);f={...c,width:a},e.update(function(t,e){let{width:n,height:i}=e,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return{x:o?Number(t.x)+r:Number(t.width)+Number(t.x)-n,y:Number(t.y)+(Number(t.height)-i)/2}}({x:u.min[0],y:u.min[1],width:a,height:f.height},{width:r,height:s},f.radius,o))});const m=K(l).maybeAppendByClassName("switch-background","rect").styles({zIndex:(l.style.zIndex||0)-1,x:u.min[0],y:u.min[1],fill:p,cursor:d,fillOpacity:r?.4:1,...f}).node(),b=K(l).maybeAppendByClassName("switch-background-stroke","rect").styles({zIndex:(l.style.zIndex||0)-2,x:u.min[0],y:u.min[1],stroke:p,lineWidth:0,...f}).node();K(l).maybeAppendByClassName("switch-handle","rect").styles({fill:"#fff",cursor:d}).call(t=>{const e=t.node(),n=Ko(m,i,o),r=Ko(m,i,!o);var s,a;e.attr("x")&&!nn(n,r)&&this.checked!==o?(e.attr(r),null===(s=e.getAnimations()[0])||void 0===s||s.cancel(),null===(a=b.getAnimations()[0])||void 0===a||a.cancel(),e.animate([{x:r.x},{x:n.x}],{duration:120,fill:"both"}),b.animate([{lineWidth:0,strokeOpacity:.5},{lineWidth:14,strokeOpacity:0}],{duration:400,easing:"ease-on"})):e.attr(n)}),this.checked=!!o}}Uo(Yo,"tag","switch");const Zo={tagText:"",lineStroke:"#416180",lineStrokeOpacity:.45,lineLineWidth:1,lineLineDash:[5,5]},$o=y({},Zo,{type:"line",tagPosition:"start",tagAlign:"center",tagVerticalAlign:"bottom"}),Xo=y({},Zo,{type:"circle",defaultRadius:0}),Jo=y({},Zo,{type:"polygon",defaultRadius:0,startAngle:0});function Qo(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ts extends w{get localPointer(){const[t,e]=this.getPosition(),[n,i]=this.pointer;return[n-t,i-e]}get tagStyle(){return C(this.attributes,"tag")}get crosshairStyle(){return{...C(this.attributes,"line"),path:this.crosshairPath}}constructor(t){super(t,Zo),Qo(this,"pointer",void 0),Qo(this,"shapesGroup",void 0),Qo(this,"tagShape",void 0),Qo(this,"crosshairShape",void 0)}render(t,e){const n=K(e).maybeAppendByClassName(".crosshair-group","g").node();this.shapesGroup=n;const i=this.tagStyle,r=this.crosshairStyle;this.tagShape=K(n).maybeAppendByClassName("crosshair-tag",()=>new ct({style:i})).styles(i).node(),this.crosshairShape=K(n).maybeAppendByClassName(".crosshair-path","path").styles(r).node(),this.adjustLayout()}setPointer(t){this.pointer=t}}function es(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Qo(ts,"tag","crosshair-base");class ns extends ts{get crosshairPath(){const{startPos:[t,e],endPos:[n,i]}=this.attributes;return[["M",0,0],["L",n-t,i-e],["Z"]]}get localPointer(){if(!this.pointer)return this.attributes.startPos;const[t,e]=this.getPosition(),[n,i]=this.pointer;return[n-t,i-e]}get isVertical(){const{startPos:[t,e],endPos:[n,i]}=this.attributes;return t===n&&e!==i}get tagShapeSpace(){const{width:t,height:e}=dr(this.tagShape);return{width:t,height:e}}constructor(t){super(y({},ns.defaultOptions,t))}update(t){super.update(t)}setPointer(t){super.setPointer(t),this.adjustPosition()}setText(t){this.tagShape.update({text:t}),this.adjustTag()}adjustLayout(){this.adjustPosition(),this.adjustTag()}adjustPosition(){const[t,e]=this.localPointer,{startPos:[n,i]}=this.attributes,r=this.getOrientVal([n,e],[t,i]);this.shapesGroup.setLocalPosition(r)}adjustTag(){const{tagText:t,tagPosition:e,startPos:[n,i],endPos:[r,o]}=this.attributes;if(!t||""===t)return void a(this.tagShape);s(this.tagShape);const{width:l,height:u}=this.tagShapeSpace,[c,h]=this.getOrientVal({start:[-l/2,u/2],end:[r-n+l/2,u/2]},{start:[0,0],end:[0,o-i+u]})[e];this.tagShape.setLocalPosition(c,h)}getOrientVal(t,e){return this.isVertical?e:t}}function is(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}es(ns,"tag","line-crosshair"),es(ns,"defaultOptions",{style:$o});class rs extends ts{get crosshairPath(){return this.createCirclePath()}constructor(t){super(y({},rs.defaultOptions,t))}update(t){super.update(t)}setPointer(t){let[e,n]=t;super.setPointer([e,n]);const[i,r]=this.localPointer,{center:[o,s]}=this.attributes,a=this.createCirclePath(((i-o)**2+(r-s)**2)**.5);this.crosshairShape.attr({path:a})}adjustLayout(){a(this.tagShape)}createCirclePath(t){const{center:[e,n],defaultRadius:i}=this.attributes;return X(e,n,t||i)}}function os(t,e){let[n,i]=t,[r,o]=e;return((n-r)**2+(i-o)**2)**.5}function ss(t,e,n,i,r,o){return(t===e||Math.min(t,e)<=r&&r<=Math.max(t,e))&&(n===i||Math.min(n,i)<=o&&o<=Math.max(n,i))}function as(t,e,n){const i=t;(!t.length||e=0&&t<=1&&e>=0&&e<=1&&(d[0]=r+t*(s-r),d[1]=o+t*(a-o))}return d}function us(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}is(rs,"tag","circle-crosshair"),is(rs,"defaultOptions",{style:Xo});class cs extends ts{get crosshairPath(){return this.createPolygonPath()}constructor(t){super(y({},cs.defaultOptions,t))}update(t){super.update(t)}get points(){const{startAngle:t,sides:e}=this.attributes,n=2*Math.PI/e,i=[1,0],r=[];for(let o=0;o{let[s,a]=r;const[l,u]=rn([s,a],t||e);return[0===o?"M":"L",n+l,i+u]});return r.push(["Z"]),r}intersection(t){let[e,n]=t;const{points:i}=this,{center:[r,o]}=this.attributes;let s,a;for(let t=1;t<=i.length;t+=1){const[l,u]=i[t-1],[c,h]=i[t%i.length],d=ls([e,n],[r,o],[l+r,u+o],[c+r,h+o]);0!==d.length&&([s,a]=d)}return[s,a]}}us(cs,"tag","polygon-crosshair"),us(cs,"defaultOptions",{style:Jo});const hs=B({fill:"rgba(0,0,0,0.45)",fontSize:10,textAlign:"start",textBaseline:"middle",overflow:"clip"},"label"),ds={width:12,height:12,radius:2,stroke:"#dadada",lineWidth:1,fill:"#ffffff",cursor:"pointer"},ps={width:12,height:12,radius:2,stroke:"#3471F9",lineWidth:1,fill:"#3471F9",cursor:"pointer"},fs={path:[["M",3,6],["L","5","8.5"],["L","8.5","4"]],lineWidth:1,cursor:"pointer"};function gs(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class ms extends w{constructor(t){super(t,{x:0,y:0,labelText:"",spacing:4,checked:!1,...hs}),gs(this,"checkboxBoxShape",void 0),gs(this,"checked",void 0)}render(t,e){const{checked:n,spacing:i}=t;this.checked=!!n;const r=Y(e,".checkbox-content","g").attr("className","checkbox-content").node(),o=C(t,"box"),s=C(t,"checked"),a=C(t,"label"),l={...this.checked?ps:ds,...o},u={...fs,...s};this.checkboxBoxShape=Y(r,".checkbox-box","rect").styles({className:"checkbox-box",zIndex:(r.style.zIndex||0)-1,...l}).node(),Y(this.checkboxBoxShape,".checkbox-checked","path").styles({className:"checkbox-box-checked",stroke:"#fff",...u});const{x:c,y:h}=function(t,e){const n=t.getLocalBounds();return{x:n.halfExtents[0]?n.max[0]+(e||0):t.style.x,y:n.halfExtents[1]?(n.min[1]+n.max[1])/2:t.style.y}}(this.checkboxBoxShape,Number(i));Y(r,".checkbox-label","text").styles({className:"checkbox-label",x:c,y:h,...a})}}function bs(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}gs(ms,"tag","checkbox");var ys=function(t){return t instanceof Element||t instanceof HTMLDocument};const vs="gui-poptip",xs="gui-poptip-arrow",ws="gui-poptip-text",Ss={[".".concat(vs)]:{visibility:"visible",position:"absolute","background-color":"rgba(0, 0, 0)","box-shadow":"0px 0px 10px #aeaeae","border-radius":"3px",color:"#fff",opacity:.8,"font-size":"12px",padding:"4px 6px",display:"flex","justify-content":"center","align-items":"center","z-index":8,transition:"visibility 50ms"},[".".concat(ws)]:{"text-align":"center"},[".".concat(vs,"[data-position='top']")]:{transform:"translate(-50%, -100%)"},[".".concat(vs,"[data-position='left']")]:{transform:"translate(-100%, -50%)"},[".".concat(vs,"[data-position='right']")]:{transform:"translate(0, -50%)"},[".".concat(vs,"[data-position='bottom']")]:{transform:"translate(-50%, 0)"},[".".concat(vs,"[data-position='top-left']")]:{transform:"translate(0,-100%)"},[".".concat(vs,"[data-position='top-right']")]:{transform:"translate(-100%,-100%)"},[".".concat(vs,"[data-position='left-top']")]:{transform:"translate(-100%, 0)"},[".".concat(vs,"[data-position='left-bottom']")]:{transform:"translate(-100%, -100%)"},[".".concat(vs,"[data-position='right-top']")]:{transform:"translate(0, 0)"},[".".concat(vs,"[data-position='right-bottom']")]:{transform:"translate(0, -100%)"},[".".concat(vs,"[data-position='bottom-left']")]:{transform:"translate(0, 0)"},[".".concat(vs,"[data-position='bottom-right']")]:{transform:"translate(-100%, 0)"},[".".concat(xs)]:{width:"4px",height:"4px",transform:"rotate(45deg)","background-color":"rgba(0, 0, 0)",position:"absolute","z-index":-1},[".".concat(vs,"[data-position='top']")]:{transform:"translate(-50%, calc(-100% - 5px))"},["[data-position='top'] .".concat(xs)]:{bottom:"-2px"},[".".concat(vs,"[data-position='left']")]:{transform:"translate(calc(-100% - 5px), -50%)"},["[data-position='left'] .".concat(xs)]:{right:"-2px"},[".".concat(vs,"[data-position='right']")]:{transform:"translate(5px, -50%)"},["[data-position='right'] .".concat(xs)]:{left:"-2px"},[".".concat(vs,"[data-position='bottom']")]:{transform:"translate(-50%, 5px)"},["[data-position='bottom'] .".concat(xs)]:{top:"-2px"},[".".concat(vs,"[data-position='top-left']")]:{transform:"translate(0, calc(-100% - 5px))"},["[data-position='top-left'] .".concat(xs)]:{left:"10px",bottom:"-2px"},[".".concat(vs,"[data-position='top-right']")]:{transform:"translate(-100%, calc(-100% - 5px))"},["[data-position='top-right'] .".concat(xs)]:{right:"10px",bottom:"-2px"},[".".concat(vs,"[data-position='left-top']")]:{transform:"translate(calc(-100% - 5px), 0)"},["[data-position='left-top'] .".concat(xs)]:{right:"-2px",top:"8px"},[".".concat(vs,"[data-position='left-bottom']")]:{transform:"translate(calc(-100% - 5px), -100%)"},["[data-position='left-bottom'] .".concat(xs)]:{right:"-2px",bottom:"8px"},[".".concat(vs,"[data-position='right-top']")]:{transform:"translate(5px, 0)"},["[data-position='right-top'] .".concat(xs)]:{left:"-2px",top:"8px"},[".".concat(vs,"[data-position='right-bottom']")]:{transform:"translate(5px, -100%)"},["[data-position='right-bottom'] .".concat(xs)]:{left:"-2px",bottom:"8px"},[".".concat(vs,"[data-position='bottom-left']")]:{transform:"translate(0, 5px)"},["[data-position='bottom-left'] .".concat(xs)]:{top:"-2px",left:"8px"},[".".concat(vs,"[data-position='bottom-right']")]:{transform:"translate(-100%, 5px)"},["[data-position='bottom-right'] .".concat(xs)]:{top:"-2px",right:"8px"}};function ks(t){let e=t&&document.getElementById(t);return e||(e=document.createElement("div"),e.setAttribute("id",t),document.body.appendChild(e)),e}function Ls(t){return(t=>{let e;return function(){for(var n=arguments.length,i=new Array(n),r=0;r{let r=t,o=this.style,s=n;if(e){const{html:t,target:n,...h}="function"==typeof e?e.call(null,i):e;a={},l=this.style,u=h,l&&bs(a,l),u&&bs(a,u),c&&bs(a,c),o=a,(n||!1===n)&&(r=n),"string"==typeof t&&(s=t)}var a,l,u,c;const{position:h,arrowPointAtCenter:d,follow:p,offset:f}=o;if(r){const{clientX:t,clientY:e}=i,[n,o]=function(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(o)return[t,e];const{x:s,y:a,width:l,height:u}=n.getBoundingClientRect();switch(i){case"top":return r?[s+l/2,a]:[t,a];case"left":return r?[s,a+u/2]:[s,e];case"bottom":return r?[s+l/2,a+u]:[t,a+u];case"right":return r?[s+l,a+u/2]:[s+l,e];case"top-right":case"right-top":return[s+l,a];case"left-bottom":case"bottom-left":return[s,a+u];case"right-bottom":case"bottom-right":return[s+l,a+u];case"top-left":case"left-top":default:return[s,a]}}(t,e,r,h,d,p);this.showTip(n,o,{text:s,position:h,offset:f})}else this.hideTip()},r=()=>{this.hideTip()};t.addEventListener("mousemove",i),t.addEventListener("mouseleave",r),this.map.set(t,[i,r])}unbind(t){if(this.map.has(t)){const[e,n]=this.map.get(t)||[];e&&t.removeEventListener("mousemove",e),n&&t.removeEventListener("mouseleave",n),this.map.delete(t)}}clear(){this.container.innerHTML=""}destroy(){var t;[...this.map.keys()].forEach(t=>this.unbind(t)),null===(t=this.container)||void 0===t||t.remove(),super.destroy()}showTip(t,e,n){const i=gi(n,"text");if((!i||"string"==typeof i)&&(this.applyStyles(),t&&e&&n)){const{offset:r,position:o}=n;if(o&&this.container.setAttribute("data-position",o),this.setOffsetPosition(t,e,r),"string"==typeof i){const t=this.container.querySelector(".".concat(ws));t&&(t.innerHTML=i)}this.visibility="visible",this.container.style.visibility="visible"}}hideTip(){this.visibility="hidden",this.container.style.visibility="hidden"}getContainer(){return this.container}getClassName(){const{containerClassName:t}=this.style;return"".concat(vs).concat(t?" ".concat(t):"")}initShape(){const{id:t}=this.style;this.container=Ls(t),this.container.className=this.getClassName(),this.container.addEventListener("mousemove",()=>this.showTip()),this.container.addEventListener("mouseleave",()=>this.hideTip())}updatePoptipElement(){const{container:t}=this;this.clear();const{id:e,template:n,text:i}=this.style;this.container.setAttribute("id",e),this.container.className=this.getClassName();const r='');t.innerHTML=r,st(n)?t.innerHTML+=n:n&&ys(n)&&t.appendChild(n),i&&(t.getElementsByClassName(ws)[0].textContent=i),this.applyStyles(),this.container.style.visibility=this.visibility}applyStyles(){const t=y({},Ss,this.style.domStyles),e=Object.entries(t).reduce((t,e)=>{let[n,i]=e;const r=Object.entries(i).reduce((t,e)=>{let[n,i]=e;return"".concat(t).concat(n,": ").concat(i,";")},"");return"".concat(t).concat(n,"{").concat(r,"}")},"");if(this.domStyles!==e){this.domStyles=e;let t=this.container.querySelector("style");t&&this.container.removeChild(t),t=document.createElement("style"),t.innerHTML=e,this.container.appendChild(t)}}setOffsetPosition(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.style.offset;const[i=0,r=0]=n;this.container.style.left="".concat(t+i,"px"),this.container.style.top="".concat(e+r,"px")}}function Ms(t){let e=1/0,n=1/0,i=-1/0,r=-1/0;for(let o=0;oi&&(i=c),h>r&&(r=h)}return new _r(e,n,i-e,r-n)}Ps(As,"tag","poptip"),Ps(As,"defaultOptions",{style:{x:0,y:0,width:0,height:0,target:null,visibility:"hidden",text:"",position:"top",follow:!1,offset:[0,0],domStyles:Ss,template:'
    ')}});const Es=function(t,e,n){const{width:i,height:r}=t,{flexDirection:o="row",flexWrap:s="nowrap",justifyContent:a="flex-start",alignContent:l="flex-start",alignItems:u="flex-start"}=n,c="row"===o,h="row"===o||"column"===o,d=c?h?[1,0]:[-1,0]:h?[0,1]:[0,-1];let[p,f]=[0,0];const g=e.map(t=>{const{width:e,height:n}=t,[i,r]=[p,f];return[p,f]=[p+e*d[0],f+n*d[1]],new _r(i,r,e,n)}),m=Ms(g),b={"flex-start":0,"flex-end":c?i-m.width:r-m.height,center:c?(i-m.width)/2:(r-m.height)/2},y=g.map(t=>{const{x:e,y:n}=t,i=_r.fromRect(t);return i.x=c?e+b[a]:e,i.y=c?n:n+b[a],i}),v=(Ms(y),t=>{const[e,n]=c?["height",r]:["width",i];switch(u){case"flex-start":return 0;case"flex-end":return n-t[e];case"center":return n/2-t[e]/2;default:return 0}});return y.map(t=>{const{x:e,y:n}=t,i=_r.fromRect(t);return i.x=c?e:e+v(i),i.y=c?n+v(i):n,i}).map(e=>{var n,i;const r=_r.fromRect(e);return r.x+=null!==(n=t.x)&&void 0!==n?n:0,r.y+=null!==(i=t.y)&&void 0!==i?i:0,r})},Cs=function(t,e,n){return[]};var Bs=(t,e,n)=>{if(0===e.length)return[];const i={flex:Es,grid:Cs},r=n.display in i?i[n.display]:null;return(null==r?void 0:r.call(null,t,e,n))||[]};function Os(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Ts extends i.Group{set margin(t){this.$margin=j(t)}get margin(){return this.$margin}set padding(t){this.$padding=j(t)}get padding(){return this.$padding}getBBox(){const{x:t=0,y:e=0,width:n,height:i}=this.attributes,[r,o,s,a]=this.$margin;return new _r(t-a,e-r,n+a+o,i+r+s)}appendChild(t,e){return t.isMutationObserved=!0,super.appendChild(t,e),t}getAvailableSpace(){const{width:t,height:e}=this.attributes,[n,i,r,o]=this.$padding,[s,,,a]=this.$margin;return new _r(o+a,n+s,t-o-i,e-n-r)}constructor(t){super(t),Os(this,"layoutEvents",[i.ElementEvent.BOUNDS_CHANGED,i.ElementEvent.INSERTED,i.ElementEvent.REMOVED]),Os(this,"$margin",j(0)),Os(this,"$padding",j(0));const{margin:e=0,padding:n=0}=t.style||{};this.margin=e,this.padding=n,this.isMutationObserved=!0,this.bindEvents()}layout(){if(this.attributes.display&&this.isConnected&&!this.children.some(t=>!t.isConnected))try{const t=Bs(this.getAvailableSpace(),this.children.map(t=>t.getBBox()),this.attributes);this.children.forEach((e,n)=>{const{x:i,y:r}=t[n];e.attr({x:i,y:r})})}catch(t){}}bindEvents(){this.layoutEvents.forEach(t=>{this.addEventListener(t,t=>{t.target.isMutationObserved=!0,this.layout()})})}attributeChangedCallback(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()}}function js(t){const e=document.createElement("div");return e.innerHTML=t,e.firstChild}function Ns(t){return"string"==typeof t?js(t):t}var _s=n(6),zs=n.n(_s);function Is(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1014;return(i,r,o)=>zs()(t).map(t=>{const s=[];s.push(!0===t.relative?t.code.toLowerCase():t.code.toUpperCase());return[[t.x1,t.y1],[t.x2,t.y2],[t.x,t.y]].forEach(a=>{const[l,u]=a;void 0!==l&&s.push(!0===t.relative?l/e*2*o:i-o+2*o*(l/e)),void 0!==u&&s.push(!0===t.relative?u/n*2*o:r-o+2*o*(u/n))}),s})}function Gs(t){const e=/[];let i=1024,r=1024;return null!==n&&n.length>=3&&(Number.isNaN(parseInt(n[1],10))||(i=parseInt(n[1],10)),Number.isNaN(parseInt(n[2],10))||(r=parseInt(n[2],10))),Is(e[1],i,r)}const Hs=["year","month","day","hour","minute","second"],Fs=["YYYY","MM","DD","hh","mm","ss"];function Ds(t){return t instanceof Date?t:new Date(t)}function Rs(t){let[e,n]=t;const i=Hs.indexOf(e),r=Hs.indexOf(n);let o="";for(let t=i;t<=r;t+=1)if(o+=Fs[t],t2&&(e=":"),o+=e}return o}function Vs(t,e){const n={YYYY:t.getFullYear(),MM:t.getMonth()+1,DD:t.getDate(),hh:t.getHours(),mm:t.getMinutes(),ss:t.getSeconds()};let i=e;return Object.keys(n).forEach(t=>{const e=n[t];i=i.replace(t,"YYYY"===t?"".concat(e):"0".concat(e).slice(-2))}),i}function Ws(t,e){return Ds(t).getTime()-Ds(e).getTime()}function qs(t,e){const[n,i]=[Ds(t),Ds(e)];return n.getFullYear()!==i.getFullYear()?"year":n.getMonth()!==i.getMonth()?"month":n.getDay()!==i.getDay()?"day":n.getHours()!==i.getHours()?"hour":n.getMinutes()!==i.getMinutes()?"minute":"second"}function Us(t,e){const n=new Date(t);return{year:t=>{t.setMonth(0),t.setHours(0,0,0,0)},month:t=>{t.setDate(1),t.setHours(0,0,0,0)},day:t=>t.setHours(0,0,0,0),hour:t=>t.setMinutes(0,0,0),minute:t=>t.setSeconds(0,0),second:t=>t.setMilliseconds(0)}[e](n),Vs(n,Rs(["year",e]))}function Ks(t){const e=localStorage.getItem("__debug__");return(n,i,r)=>{const o="[".concat(i,"] ").concat(t),s=r.value;"function"==typeof s&&(r.value=function(){e&&console.time(o);for(var t=arguments.length,n=new Array(t),i=0;i