@nebula.js/sn-gauge 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  /*
2
- * @nebula.js/sn-gauge v0.7.1
2
+ * @nebula.js/sn-gauge v0.7.2
3
3
  * Copyright (c) 2025 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["sn-gauge"]=e(t.stardust)}(this,(function(t){"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function n(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(t){c=!0,r=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function l(t,n){if(t){if("string"==typeof t)return e(t,n);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}var c=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],u=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var h=function(t){return{value:t,label:t.charAt(0).toUpperCase()+t.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:t}}};function d(t){var e=t.theme,n=t.translator,i=t.defaultValue,r=t.flags,o=[],s=e.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,a(new Set([i].concat(a(s.map((function(t){return t.split(",").map((function(t){return t.trim()})).map((function(t){return t.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(a(o.map((function(t){return h(t)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],a(function(t){return null!=t&&t.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?u:c}(r).map((function(t){return h(t)}))))}function f(t){var e=t.theme,n=t.translator,i=t.id,r=t.path,o=t.flags,a=function(){return e.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return d({theme:e,translator:n,defaultValue:a(),flags:o})}}}var p,g,m=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],y=function(t){return{value:t,label:t,groupHeader:!1,disabled:!1}};function x(t){var e=t.theme,n=t.translator,i=t.id,r=t.path,o=function(){return e.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(t){var e=t.translator,n=t.defaultValue,i=[],r=t.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,a(new Set([n].concat(a(r))))):i.push(n),[{value:"ThemeHeader",label:e.get("properties.themeFontSizes"),metaText:e.get("properties.theme"),groupHeader:!0}].concat(a(i.map((function(t){return y(t)}))),[{value:"DefaultHeader",label:e.get("properties.allFontSizes"),metaText:e.get("properties.default"),groupHeader:!0}],a(m.map((function(t){return y(t)}))))}({theme:e,translator:n,defaultValue:o()})}}}function v(t){var e=t.theme,n=t.translator,i=t.id,r=t.path;return{fontFamily:f({theme:e,translator:n,id:i,path:r,flags:t.flags}),fontSize:x({theme:e,translator:n,id:i,path:r})}}var b,w=function(){if(g)return p;g=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===e.call(t)},o=function(n){if(!n||"[object Object]"!==e.call(n))return!1;var i,r=t.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&t.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||t.call(n,i)},a=function(t,e){n&&"__proto__"===e.name?n(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};return p=function t(){var e,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(e=arguments[d]))for(n in e)i=s(h,n),h!==(l=s(e,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:t(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},p}(),M=(b=w)&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b;function k(t,e){return{range:function(t){var n=t.resources,i=t.data,r=n.theme.palette("categorical",0===e?i.items.length:e);return i.items.map((function(t){return r[t.value%r.length]}))},valueAccessor:t.value}}function _(t,e){return{range:function(t){var n=t.resources,i=t.data,r=n.theme.palette("categorical",0===e?i.items.length:e);return i.items.map((function(t){return r[t.row.value%r.length]}))},valueAccessor:t.value}}function S(t,e,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(e.input.persistent||t.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&t.hc.qSize.qcy>((null===(a=(o=t.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=e.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,c)}return{}}function N(t,e){var n=t.hc.qDimensionInfo,i=e.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function R(t,e){var n;return e.activeDimensionIndex>=0?n=t.pic.fields().filter((function(t){return"dimension"===t.type()}))[e.activeDimensionIndex]:"libraryItem"===e.type?!1===(n=e.key?t.pic.field((function(t){return t.raw().colorMapRef===e.key})):void 0)&&(n=t.pic.field((function(t){return"colorByAlternative"===t.raw().id}))):"expression"===e.type&&(n=t.pic.field((function(t){return"colorByAlternative"===t.raw().id}))),n}function A(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function C(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function D(){}var O=1/.7,E="\\s*([+-]?\\d+)\\s*",z="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",I="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",T=/^#([0-9a-f]{3,8})$/,P=new RegExp(`^rgb\\(${E},${E},${E}\\)$`),q=new RegExp(`^rgb\\(${I},${I},${I}\\)$`),L=new RegExp(`^rgba\\(${E},${E},${E},${z}\\)$`),j=new RegExp(`^rgba\\(${I},${I},${I},${z}\\)$`),F=new RegExp(`^hsl\\(${z},${I},${I}\\)$`),B=new RegExp(`^hsla\\(${z},${I},${I},${z}\\)$`),V={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function $(){return this.rgb().formatHex()}function H(){return this.rgb().formatRgb()}function W(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=T.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?U(e):3===n?new K(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Y(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Y(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=P.exec(t))?new K(e[1],e[2],e[3],1):(e=q.exec(t))?new K(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=L.exec(t))?Y(e[1],e[2],e[3],e[4]):(e=j.exec(t))?Y(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=F.exec(t))?nt(e[1],e[2]/100,e[3]/100,1):(e=B.exec(t))?nt(e[1],e[2]/100,e[3]/100,e[4]):V.hasOwnProperty(t)?U(V[t]):"transparent"===t?new K(NaN,NaN,NaN,0):null}function U(t){return new K(t>>16&255,t>>8&255,255&t,1)}function Y(t,e,n,i){return i<=0&&(t=e=n=NaN),new K(t,e,n,i)}function X(t){return t instanceof D||(t=W(t)),t?new K((t=t.rgb()).r,t.g,t.b,t.opacity):new K}function G(t,e,n,i){return 1===arguments.length?X(t):new K(t,e,n,null==i?1:i)}function K(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Z(){return`#${et(this.r)}${et(this.g)}${et(this.b)}`}function J(){const t=Q(this.opacity);return`${1===t?"rgb(":"rgba("}${tt(this.r)}, ${tt(this.g)}, ${tt(this.b)}${1===t?")":`, ${t})`}`}function Q(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function tt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function et(t){return((t=tt(t))<16?"0":"")+t.toString(16)}function nt(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new rt(t,e,n,i)}function it(t){if(t instanceof rt)return new rt(t.h,t.s,t.l,t.opacity);if(t instanceof D||(t=W(t)),!t)return new rt;if(t instanceof rt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new rt(a,s,l,t.opacity)}function rt(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function ot(t){return(t=(t||0)%360)<0?t+360:t}function at(t){return Math.max(0,Math.min(1,t||0))}function st(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}A(D,W,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:$,formatHex:$,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return it(this).formatHsl()},formatRgb:H,toString:H}),A(K,G,C(D,{brighter(t){return t=null==t?O:Math.pow(O,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new K(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new K(tt(this.r),tt(this.g),tt(this.b),Q(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Z,formatHex:Z,formatHex8:function(){return`#${et(this.r)}${et(this.g)}${et(this.b)}${et(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:J,toString:J})),A(rt,(function(t,e,n,i){return 1===arguments.length?it(t):new rt(t,e,n,null==i?1:i)}),C(D,{brighter(t){return t=null==t?O:Math.pow(O,t),new rt(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?.7:Math.pow(.7,t),new rt(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new K(st(t>=240?t-240:t+120,r,i),st(t,r,i),st(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new rt(ot(this.h),at(this.s),at(this.l),Q(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Q(this.opacity);return`${1===t?"hsl(":"hsla("}${ot(this.h)}, ${100*at(this.s)}%, ${100*at(this.l)}%${1===t?")":`, ${t})`}`}}));const lt=Math.PI/180,ct=180/Math.PI,ut=4/29,ht=6/29,dt=3*ht*ht;function ft(t){if(t instanceof pt)return new pt(t.l,t.a,t.b,t.opacity);if(t instanceof vt)return bt(t);t instanceof K||(t=X(t));var e,n,i=xt(t.r),r=xt(t.g),o=xt(t.b),a=gt((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?e=n=a:(e=gt((.4360747*i+.3850649*r+.1430804*o)/.96422),n=gt((.0139322*i+.0971045*r+.7141733*o)/.82521)),new pt(116*a-16,500*(e-a),200*(a-n),t.opacity)}function pt(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function gt(t){return t>.008856451679035631?Math.pow(t,1/3):t/dt+ut}function mt(t){return t>ht?t*t*t:dt*(t-ut)}function yt(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function xt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function vt(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function bt(t){if(isNaN(t.h))return new pt(t.l,0,0,t.opacity);var e=t.h*lt;return new pt(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}A(pt,(function(t,e,n,i){return 1===arguments.length?ft(t):new pt(t,e,n,null==i?1:i)}),C(D,{brighter(t){return new pt(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new pt(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new K(yt(3.1338561*(e=.96422*mt(e))-1.6168667*(t=1*mt(t))-.4906146*(n=.82521*mt(n))),yt(-.9787684*e+1.9161415*t+.033454*n),yt(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),A(vt,(function(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof vt)return new vt(t.h,t.c,t.l,t.opacity);if(t instanceof pt||(t=ft(t)),0===t.a&&0===t.b)return new vt(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*ct;return new vt(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new vt(t,e,n,null==i?1:i)}),C(D,{brighter(t){return new vt(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new vt(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return bt(this).rgb()}}));var wt=t=>()=>t;function Mt(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):wt(isNaN(t)?e:t)}var kt=function t(e){var n=function(t){return 1==(t=+t)?Mt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):wt(isNaN(e)?n:e)}}(e);function i(t,e){var i=n((t=G(t)).r,(e=G(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=Mt(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1),_t=/^class(-pyramid)?/,St=function(t,e,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),s=r,l=o,c=e.limits,u={},h="percent"===e.limitType?c.map((function(t){return r+(o-r)*t})):c,d=e.colors.map((function(e){return t.resolveUIColor(e)}));if(r=Math.min.apply(Math,[r].concat(a(h))),o=Math.max.apply(Math,[o].concat(a(h))),u.min=r,u.max=o,e.breakTypes&&-1===e.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(t){var e=t.min,n=t.max,i=t.limits,r=t.range,o=[],a=[];if(i.length)if(i[i.length-1]<e)a.push(e,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(e,n),o.push(r[0],r[0],r[0]);else{if(i[0]>e)a.push(e),o.push(r[0]);else{a.push(e);for(var s=0;s<i.length;s++)if(e<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)e<i[l]&&i[l]<n&&(a.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)a.push(n),o.push(r[i.length]),o.push(r[i.length]);else{a.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:e,max:n,range:o,domain:a}}({min:"percent"===e.limitType?r:s,max:"percent"===e.limitType?o:l,range:d,limits:"percent"===e.limitType?h:c}));else if(e.breakTypes){var f=e.breakTypes;u.type="continuous",u.domain=[r],u.range=[d[0]];for(var p=0;p<h.length;p+=1)if(f[p]){var g=d[p],m=d[p+1],y=kt(g,m)(.5);u.range.push(y),u.domain.push(h[p]),p<h.length-1&&f[p+1]&&(u.range.push(d[p+1]),u.domain.push((h[p]+h[p+1])/2))}else u.range.push(d[p]),u.range.push(d[p+1]),u.domain.push(h[p]),u.domain.push(h[p]+Math.min(1e-6,(o-r)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=h,u.range=d;return u};function Nt(t,e,n,i,r){var o,a,s,l=0,c=[],u=(t-e)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-e),s=n[o]>t?Math.floor(t/u):n[o]<e?0:Math.floor(a/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):Nt(t,e,n,i+1,r)}var Rt=function(t,e,n,i){var r,o,s=e.theme,l=e.hc,c=i.f,u={mode:"field",fieldType:"measure",field:c?c.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(t){return t.resources.theme.palette("quant")}},h=[],d=!0;if(c){if(Number.isNaN(+c.min())||Number.isNaN(+c.max()))return{invalid:!0};(d=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(h=n.pic.extract({field:0,props:{num:{field:c.key()},exclude:{fields:l.qDimensionInfo.map((function(t,e){return{field:"qDimensionInfo/".concat(e)}})),value:function(t){return Math.min.apply(Math,a(t))<0}}}}).filter((function(t){return t.value>=0&&!t.exclude.value})).map((function(t){return t.num.value})).filter((function(t){return"number"==typeof t})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(c&&!d)u.min=c.min(),u.max=c.max();else if(c){if(!h.length)return{invalid:!0};u.min=Math.min.apply(Math,a(h)),u.max=Math.max.apply(Math,a(h))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),s){var f=s.getDataColorScales().filter((function(t){return t.key===n.input.measureScheme}))[0];u.type=f&&_t.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(t){return Array.isArray(t)}))?Math.max.apply(Math,a(f.colors.map((function(t){return t?t.length:0})))):f.colors.length)}if("categorical"===u.type){for(var p=d?Nt(u.max,u.min,h,1,o):o,g=(u.max-u.min)/p,m=[],y=0;y<p+1;y+=1)m.push(u.min+g*y);u.domain=m,u.range=function(t){for(var e=t.resources.theme.palette("quant",p),n=Math.max(1,Math.floor(e.length/p)),i=[],r=0;r<p;r+=1)i.push(e[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return u};function At(t,e){var n;return e.activeMeasureIndex>=0?n=t.pic.fields().filter((function(t){return"measure"===t.type()}))[e.activeMeasureIndex]:"libraryItem"===e.type?n=t.pic.field((function(t){return t.raw().colorMapRef===e.key&&void 0!==e.key})):"expression"===e.type&&(n=t.pic.field((function(t){return"colorByAlternative"===t.raw().id}))),n||(n=t.pic.field((function(t){return void 0!==t.raw().matchMeasure})))&&(n=t.pic.fields().filter((function(t){return"measure"===t.type()}))[n.raw().matchMeasure]),n}function Ct(t){t.measureOverrides.every((function(t){return!t}))&&(t.measureOverrides=null)}function Dt(t,e){for(var n=(null==e?void 0:e.domain)||[],i=(null==e?void 0:e.range)||[],r=[],o=0;o<t.length;++o){var a=t[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),i.push(a.primary)):i[s]=a.primary,t[o]=null}else if(a){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function Ot(t,e,n,i){var o,a=function(t,e,n,i){if(e.input&&!e.input.auto){if("byMeasure"===e.input.mode)return function(t,e,n){var i=e.theme,r=e.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?At:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=Rt(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(t){return"measure"===t.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&M(c,St(t,h.gradient,c,u))}else c.auxiliary=s;return c}(t,n,e);if("byDimension"===e.input.mode)return function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?N:r,a=i.getCByField,s=void 0===a?R:a,l=i.getPersistence,c=void 0===l?S:l,u=o(e,n),h=s(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),M(p,c(e,n,u,h,{byRow:_,byElemNo:k})),p}(t,n,e);if("byExpression"===e.input.mode)return function(t,e,n,i){var r=e.hc,o=e.theme,a=e.translator,s=n.pic.field((function(t){return"colorByExpression"===t.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Rt(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,e,i);if("byMultiple"===e.input.mode||"primary"===e.input.mode)return function(t,e,n,i){var r=e.hc,o=e.theme,a=e.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(e,n){if(e.baseColor||e.coloring&&e.coloring.baseColor){l.push(n);var r=t.resolveUIColor(e.baseColor||e.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var d=[],f=[];return r.qDimensionInfo.forEach((function(e,n){if(e.baseColor||e.coloring&&e.coloring.baseColor){d.push(n);var r=t.resolveUIColor(e.baseColor||e.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=t.resolveUIColor(n.input.paletteColor));else{var g=n.input.singleColor;"number"!=typeof g||Number.isNaN(g)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][g])}return{mode:"constant",type:"constant",primary:p}}(t,n,e,i)}return{}}(t,e,n,i);return null!==(o=e.input)&&void 0!==o&&o.measureOverrides?(a.measureOverrides=e.input.measureOverrides.map((function(n,o){return function(t){var e,n=t.cm,i=t.defaults,o=t.index,a=t.input,s=t.pic;if(!a||!a.on)return null;var l=null!==(e=a.mode)&&void 0!==e?e:"primary";return"primary"===l?function(t,e,n){var i=n.primary;return void 0!==e.paletteColor&&e.paletteColor&&(i=t.resolveUIColor(e.paletteColor)),r(r({},n),{},{mode:"constant",type:"constant",primary:i})}(n,a,i):"byExpression"===l?function(t,e,n){var i="qMeasureInfo/".concat(t,"/"),o=e.field((function(t){return t.id().startsWith(i)&&"colorByMeasureExpression"===t.raw().id})),a=o;return r(r({},n),{},a?{mode:"field",fieldType:"expression",field:o?o.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(o,s,i):null}({cm:t,input:n,defaults:i,index:o,pic:e.pic})})),function(t,e){var n,i,r,o=e.translator;if(Ct(t),1===(null===(n=t.measureOverrides)||void 0===n?void 0:n.length))return t.measureOverrides[0];if("measure"===t.mode&&t.measureOverrides&&(t.explicit=Dt(t.measureOverrides,t.explicit),Ct(t)),null!==(i=t.measureOverrides)&&void 0!==i&&i.every((function(t){return"constant"===(null==t?void 0:t.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Dt(t.measureOverrides),a}return null!==(r=t.measureOverrides)&&void 0!==r&&r.every((function(t){return t}))?{invalid:!0,measureOverrides:t.measureOverrides}:t}(a,n)):a}var Et=function(t,e){var n=t.fieldType,i={};if(e)if("measure"===n){var r=e.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=e[0],a=e[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},zt=function(t){throw t.isHandled=!0,t};function It(t){return function(e){return"object"===s(e.datum[t])?e.datum[t].value:void 0}}function Tt(t){return"object"===s(t.datum.isNull)?t.datum.isNull.value:-2===t.datum.value}function Pt(t){return-3===t.datum.value}var qt={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Lt={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function jt(t){var e=t.theme,n=t.key,i=t.styleOverrides,r={title:{color:qt.COLOR,fontSize:qt.FONT_SIZE,fontFamily:qt.FONT_FAMILY},label:{color:Lt.COLOR,fontSize:Lt.FONT_SIZE,fontFamily:Lt.FONT_FAMILY}};if(!e&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(t){var e=t.theme,n=t.key;return function(t,i,r,o){return void 0!==t?t:e?e.getStyle(n,i,r):o}}({theme:e,key:n});return r.title.color=l(null==a?void 0:a.color,"legend.title","color",qt.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",qt.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",qt.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",Lt.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",Lt.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",Lt.FONT_FAMILY),r}var Ft=function(t,e,n){var i=t&&t.dock||void 0;if("auto"!==i)return i||"right";if(e){var r=e.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},Bt=function(t,e,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&e.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof t.show?t.show():!1!==t.show)};function Vt(t,e){var n=t.styleReference,i=t.styleOverrides,r=t.chart,o=t.rtl,a=e.legendProps,s=e.coloring,l=e.theme,c=e.hc,u=jt({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:Ft(a,r,o)},show:"function"==typeof a.show?function(){return Bt(a,c,s)}:Bt(a,c,s),renderer:"svg",mounted:function(t){t.childNodes[0].style.pointerEvents="none",t.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function $t(t,e,i){var o=[],a=[],s=function(t,e,n){return"categorical"===e.coloring.type?function(t,e,n){var i=Vt(t,e);if(!i.show)return!1;var o,a=t.key,s=t.styleReference,l=t.styleOverrides,c=t.viewState,u=t.rtl,h=t.settings,d=t.style,f=e.scaleKey,p=e.theme,g=e.scales,m=jt({theme:p,key:s,styleOverrides:l}),y=i.layout.dock,x="left"===y||"right"===y?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===e.coloring.fieldType&&(o=function(t){return t.datum.value>=0||-3===t.datum.value});var b="".concat(f,"Legend");return M(!0,i,{type:"legend-cat",key:"".concat(a,"-cat"),scale:b in g?b:f,settings:{layout:{scrollOffset:function(){return c?c.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:o,label:r({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},x)},navigation:{disabled:n,button:{content:function(t,e){var n=e.direction;return t("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[t("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",a],style:{inactive:{opacity:.3}}}]}},{settings:h,style:d})}(t,e,n):"continuous"===e.coloring.type&&function(t,e){var n,i=t.key,r=t.styleReference,o=t.styleOverrides,a=t.rtl,s=t.settings,l=t.style,c=e.scaleKey,u=e.theme,h="".concat(c,"Range"),d=Vt(t,e);if(!d.show)return!1;var f=jt({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,g="right"===p||"left"===p,m=null===(n=e.scales)||void 0===n?void 0:n[h];return g&&m&&(m.invert=!0),M(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(t,e)}(t,e,i&&i.navigationDisabled);return o.push(s),s&&"legend-cat"===s.type&&(a.push(function(t){var e=t.key,n=t.requireFailure,i=t.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(e),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(t,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(t){return t.key==="".concat(e,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(t){t.preventDefault();var e=t.srcEvent.target;e&&e.hasAttribute("data-action")&&e.hasAttribute("data-component-key")&&this.chart.component(e.getAttribute("data-component-key")).emit(e.getAttribute("data-action"))}}}}(t,i)),a.push(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.eventName,i=t.key,r=t.requireFailure,o=t.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:r,recognizeWith:o,options:{event:e,pointers:1,threshold:10,enable:function(t,n){var r;return this.started===e||!n||!(null!=a&&null!==(r=a.interact)&&void 0!==r&&r.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(t){return t.key==="".concat(i,"-cat")}))}},events:n(n(n({},"".concat(e,"start"),(function(t){t.preventDefault(),this.started!==e&&(this.started=e,this.chart.component("".concat(i,"-cat")).emit("panstart",t))})),"".concat(e,"move"),(function(t){t.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",t)})),"".concat(e,"end"),(function(t){t.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",t),this.started=!1}))}}(t,i))),{interactions:a,components:o}}function Ht(t){var e=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.auto,n=function(t){var e=r({hc:null,colorProps:null,layout:null,theme:null},t),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},o={auto:function(t){return t?(i.auto=t,o):i.auto},getDimensionColorMap:function(t){return t?(i.getDimensionColorMap=t,o):i.getDimensionColorMap},getAttributeDimension:function(t){return t?(i.getAttributeDimension=t,o):i.getAttributeDimension},getMeasure:function(t){return t?(i.getMeasure=t,o):i.getMeasure},set:function(t){var r;if(!t.colorProps)throw new Error('Missing "colorProps"');if(M(e,t),(n={pic:e.picasso.data("q")({data:e.hc,config:{localeInfo:e.localeInfo}}),input:e.colorProps}).input.auto){var o=i.auto(t.layout);n.input=M(!0,{},n.input,o,{auto:!1});var a=e.theme?e.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),e.hc&&e.hc.qDimensionInfo[s]&&e.hc.qDimensionInfo[s].coloring&&e.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=e.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(t){return!t||!t.on}))&&(n.input=M(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var t=e.theme,i=[];(t&&t.getDataColorPickerPalettes()||[]).forEach((function(t){i.push({key:"ui",colors:t.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!t.auxiliary&&!/qAttrDimInfo/.test(t.field))return Promise.resolve();var r=(t.auxiliary||{}).key;if("measure"===t.fieldType)return i.getMeasure(r,e).catch((function(){}));if("dimension"===t.fieldType){var o="".concat(n,"/").concat(t.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(t.field)?i.getAttributeDimension(o,e).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,e).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(t,i){var o=this;return t.auxiliary||/qAttrDimInfo/.test(t.field)?(this.palettes(),this.getAuxiliaryData(t,i).then((function(i){if(!i)return{};if("measure"===t.fieldType){if(i.coloring&&i.coloring.gradient){var a=n.pic.field(t.field);return St(o,i.coloring.gradient,t,a)}return{}}if("dimension"===t.fieldType){var s={nil:t.nil,others:t.others},l=i[0],c=i[1]?i[1].colorMap:null;if(l){var u=e.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(t.field).raw(),n.pic.field(t.field).raw()],qMeasureInfo:[],qDataPages:l,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=u}return c?function(t,e,n,i){var o=i.external,a=i.field,s=r({},t);M(s,k(a,a.raw().qCardinal));var l=o.theme?o.theme.getDataColorPalettes()[0]:null;return e.nul&&(s.nil=n.resolveUIColor(e.nul)),e.oth&&(s.others=n.resolveUIColor(e.oth)),e.usePal?(s.palettes={categorical:e.pal},l&&!e.pal&&(s.palettes.categorical=l.key,M(s,k(a)))):!1===e.autoFill&&e.single?s.range=[n.resolveUIColor(e.single)]:e.autoFill&&(l&&(s.palettes={categorical:l.key}),M(s,k(a))),e.colors&&e.colors.length&&(s.explicit=function(t,e,n){for(var i={},r=0;r<t.length;r+=1)i[t[r].value]=t[r].baseColor;var o=[];return{domain:function(t){var r=t.data,a=[];o=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],c=(l.text||l).label;i[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(e.resolveUIColor(i[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(e.colors,n,s)),s}(s,c,o,{external:e,field:n.pic.field(t.field)}):s}return{}}))):Promise.resolve()},resolveUIColor:function(t){if(t.index<0||void 0===t.index)return t.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(t){return"ui"===t.key}))[0]||!1),!n.uiPalette)return t.color;var e="none"===n.uiPalette.colors[0]?t.index:t.index-1;return void 0===n.uiPalette.colors[e]?t.color:n.uiPalette.colors[e]},settings:function(){if(this.palettes(),!n.settings){var t={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=e.theme;i&&(t=r(r({},t),i.getDataColorSpecials())),n.settings=M(t,Ot(this,n,e,t))}return n.settings}};return o}(t.resources).auto(e||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(t,e){return function(t,e){var n=e.layout,i=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(t)).then((function(t){return t.getLayout()})):Promise.reject()}(t,{layout:e.layout,app:e.app})})).getMeasure((function(t,e){return function(t,e){var n=e.layout,i=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(t).then((function(t){return t.getMeasure()})):Promise.reject()}(t,{layout:e.layout,app:e.app})})).getAttributeDimension((function(t,e){return function(t,e){var n=e.layout,i=e.model,r=e.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(t,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(zt):Promise.reject()}(t,{layout:e.layout,model:e.model,app:e.app})}));return n.getSnapshotData=Et,n}({resources:t}),i={},o={},s=function(t){return o.settings||(t||console.warn("settings() called before auxiliarySettings()"),o.settings=e.settings()),o.settings},l={config:function(n){if(i=r({},n),o={},!i.key)throw new Error("Missing key");e.set(r(r({},t),i))},auto:function(t){return t?(e.auto(t),l):e.auto()},getAuxiliarySettings:function(t){return o.auxiliarySettings?Promise.resolve(o.auxiliarySettings):e.getAuxiliarySettings(s(!0),t).then((function(t){return o.auxiliarySettings=t||{},o.settings=r(r({},o.settings),o.auxiliarySettings),o.scales=void 0,o.color=void 0,o.auxiliarySettings}))},getAuxiliaryData:function(){return e.getAuxiliaryData(s())},getSnapshotData:function(t){var n=s();return e.getAuxiliaryData(n,t).then((function(t){return e.getSnapshotData(n,t)}))},resolveUIColor:function(t){return e.resolveUIColor(t)},settings:function(){var t=s();return{mode:t.mode,type:t.type,label:t.label,field:t.field,fieldType:t.fieldType,nil:t.nil,others:t.others,primary:t.primary}},settingsForMeasure:function(t){var e;return(null===(e=s().measureOverrides)||void 0===e?void 0:e[t])||this.settings()},isSelectionLocked:function(t){var e=t.isMeasureSelectionLocked;return function(t,e){var n=e.isMeasureSelectionLocked;return"field"!==t.mode||("dimension"===t.fieldType?t.isFieldLocked:"measure"!==t.fieldType||n)}(s(),{isMeasureSelectionLocked:e})},palettes:function(){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.colorProps,n=t.coloring,i=t.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||e.dimensionScheme,s=i.getDataColorPalettes().filter((function(t){return t.key===o}))[0]||i.getDataColorPalettes()[0];o&&s&&r.push({key:"categorical",colors:s.colors});var l=n.palettes.metric||e.measureScheme,c=i.getDataColorScales().filter((function(t){return t.key===l}))[0]||i.getDataColorScales()[0];if(c){var u=c.colors[0]?c.colors:[[]].concat(a(c.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(t){return t.slice().reverse()})):u.slice().reverse(),r.push({key:"quant",colors:u})}}return r}({coloring:s(),colorProps:i.colorProps,theme:i.theme})},scales:function(){return o.scales=o.scales||function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hc,n=t.coloring,i=t.rtl,o=t.key,s=t.source,l=t.picasso,c={},u=o;if(n){var h={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(a((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(a((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var d,f=function(t){var e=t.hc,n=t.source,i=t.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=e.qDataPages[0]?e.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(t){return t.qText},reduce:"first"}}}]},expando:0};return r}({hc:e,source:s,coloring:n}).data;if(n.legendDataset){var p=0,g={};l.data("q")({data:e}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(t){var e=t[0];return g[e]=p++,t[0]}}),d={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(t){return t.qElemNumber>=0},props:{row:{value:function(t){return g[t.qElemNumber]}}}}}}var m={data:f,range:n.range,domain:n.domain,explicit:h,type:"categorical-color",label:function(t){return t.datum.text&&t.datum.text.value?t.datum.text.value:t.datum.label}};c[u]=m,d&&(c["".concat(u,"Legend")]=r(r({},m),{},{data:d})),e&&e.qHasOtherValues&&d&&((d||m.data).amend=[{label:e.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var y={data:{field:n.field},min:n.min,max:n.max};c[u]=M({},y,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===c[u].type&&(c["".concat(u,"Range")]=M({},y,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var x={data:e.qDimensionInfo.map((function(t,e){return e})),label:function(t){return e.qDimensionInfo[t.datum.value].qFallbackTitle},explicit:h,type:"categorical-color"};c[u]=x}else if("measure"===n.mode){var v={data:e.qMeasureInfo.map((function(t,e){return e})).filter((function(t){var e;return!(null!==(e=n.explicit)&&void 0!==e&&null!==(e=e.exclude)&&void 0!==e&&e.includes(t))})),label:function(t){return e.qMeasureInfo[t.datum.value].qFallbackTitle},explicit:h,type:"categorical-color"};c[u]=v}}return c}({hc:i.hc,coloring:s(),key:i.key,source:i.source,picasso:t.picasso}),o.scales},color:function(){return o.color=o.color||function(t){var e=t.coloring,n=t.scales,i=t.key,r=It(i),o=It("".concat(i,"IsAnOther")),a=function(t,e){var i=t.fieldType,a=t.invalid,s=t.mode,l=t.nil,c=t.others,u=t.primary,h=t.type;return a?function(t){return Pt(t)||o(t)?c:l}:n[e]?function(t){return Pt(t)?c:Tt(t)||-2===r(t)&&"dimension"===i||"NaN"===r(t)?l:o(t)?c:t.resources.scale(e)(r(t))||c}:"constant"===s?function(t){return Pt(t)||o(t)?c:Tt(t)?l:u}:"color"===h?function(t){return Pt(t)||o(t)?c:Tt(t)?l:r(t)||c}:null},s=a(e,i);if(e.measureOverrides){var l=It("".concat(i,"MeasureIdx")),c=e.measureOverrides.map((function(t){return t&&a(t)}));return function(t){var e=l(t);return c[e]?c[e](t):s(t)}}return s}({coloring:s(),scales:this.scales(),key:i.key}),o.color},datumProps:function(t){return function(t){var e,i,r=t.hc,o=t.coloring,a=t.scales,s=t.key,l=t.addMeasureIx,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=s,h=o.nil;"field"===o.mode&&o.field?e=o.field:a[s]&&"field"===o.mode&&(e=a[s].data.field||o.field),e?(i={field:e,reduce:"first"},"color"===o.type&&(i.value=function(t){return"NaN"!==t.qNum?function(t){return"rgba(".concat([(16711680&t)>>16,(65280&t)>>8,255&t,((4278190080&t)>>>24)/255].join(","),")")}(t.qNum):t.qText&&W(t.qText)?t.qText:h})):"dimension"===o.mode?i=void 0!==o.field?o.field:r.qDimensionInfo.length-1:"measure"===o.mode&&(i=c);var d=n({},u,i);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(t,e){return{field:"qDimensionInfo/".concat(e)}})),value:function(t){return-1!==t.indexOf(-3)}}),l&&(d["".concat(u,"MeasureIdx")]=c),d}({coloring:this.settingsForMeasure(t),scales:this.scales(),key:i.key,hc:i.hc,addMeasureIx:s().measureOverrides},t)},data:function(){var t=s(),e={key:"dummy",data:[["field"],["a"]]};return t.legendDataset?[e,{type:"q",key:"attrDim",data:t.legendDataset.raw(),config:{localeInfo:i.localeInfo}}]:[e]},legend:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.eventName,n=t.key,r=t.viewState,o=t.chart,a=t.rtl,l=t.styleReference,c=void 0===l?"object.legend":l,u=t.styleOverrides,h=t.settings,d=void 0===h?{}:h,f=t.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return $t({eventName:e,key:n,rtl:a,viewState:r,chart:o,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:i.legendProps,scaleKey:i.key,coloring:s(),theme:i.theme,hc:i.hc,scales:this.scales()},p)}};return l}var Wt=function(t){return t.baseColor||t.coloring&&t.coloring.baseColor};function Ut(t){var e=t.qHyperCube,n=e.qDimensionInfo,i=e.qMeasureInfo,r=n.some(Wt),o=i.some(Wt),a=t.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var Yt=function(t){return t.baseColor||t.coloring&&t.coloring.baseColor};function Xt(t){var e,n=t.qHyperCube.qDimensionInfo.some(Yt),i=t.qHyperCube.qMeasureInfo.some(Yt),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(e=null!=r?r:i?"measure":void 0)&&void 0!==e?e:"off",paletteColor:null}}var Gt=function(){};function Kt(t){var e,n,i,o,a=t.picasso,s=t.model,l=t.app,c=t.translator,u=t.layoutService,h=void 0===u?void 0:u,d=t.createConfig,f=void 0===d?Gt:d,p=t.config,g=void 0===p?{}:p,m=t.custom,y=void 0===m?{}:m,x=g.localeInfo,v=g.key,b=g.theme,w=void 0===b?void 0:b,M=g.auto,k=void 0===M?void 0:M,_=g.definitionPath,S=null==h||null===(e=h.getLayout)||void 0===e?void 0:e.call(h),N={theme:w,key:v,localeInfo:x,layout:S,hc:null==h||null===(n=h.getHyperCube)||void 0===n?void 0:n.call(h),legendProps:null==h||null===(i=h.getLayoutValue)||void 0===i?void 0:i.call(h,"legend"),colorProps:r(r({},null==h||null===(o=h.getLayoutValue)||void 0===o?void 0:o.call(h,"color")),{},{useBaseColors:S?Ut(S):void 0})},R=Ht({picasso:a,model:s,app:l,translator:c,auto:k});!1!==k&&R.auto((function(t){return k?k({layout:t,defaultAuto:Xt}):Xt(t)}));var A=!1,C={getColor:function(){return R.color()},getPaletteColor:function(t){var e=t.index,n=t.color;return R.resolveUIColor({index:e,color:n})},getData:function(){return R.data()},getDatumProps:function(t){return R.datumProps(t)},getSnapshotData:function(){return R.getSnapshotData(_)},getSettingsForMeasure:function(t){return R.settingsForMeasure(t)},getSettings:function(){return R.settings()},getLegend:function(t,e){return R.legend(t,e)},getScales:function(){return R.scales()},getPalettes:function(){return R.palettes()},isSelectionLocked:function(t){var e=t.isMeasureSelectionLocked;return R.isSelectionLocked({isMeasureSelectionLocked:e})},isInitialized:function(){return A},custom:r({},y),initialize:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,e=(void 0===t?f:t)({getUseBaseColors:Ut}),n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(r(r({},t),e),{},{colorProps:r(r({},t.colorProps),e.colorProps||{})})}(N,e);return R.config(n),R.getAuxiliarySettings(_).then((function(){A=!0}))}};return C}var Zt="center",Jt="bottom";function Qt(t){var e=t.chart,n=t.logicalSize;if(n)return n;var i=e?e.element.getBoundingClientRect():{};return{width:i.width,height:i.height}}[{key:"NoDataExist",alignment:Zt,condition:function(t){var e=t.layoutService;if(!e)return!1;var n=e.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Zt,condition:function(t){var e=t.layoutService;return!!e&&e.getHyperCubeValue("qMeasureInfo").every((function(t){return"NaN"===t.qMin&&"NaN"===t.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Zt,condition:function(t){var e=t.layoutService;if(!e)return!1;if(!e.meta.isContinuous)return!1;var n=e.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Zt},{key:"DataRangeIncludingZero",alignment:Jt},{key:"LimitedData",alignment:Jt},{key:"NegativeOrZeroValues",alignment:Jt}].reduce((function(t,e){return t[e.key]=e,t}),{});var te=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function ee(t){var e=t.width,n=t.height,i=te.filter((function(t){return e>=t.size.width&&n>=t.size.height})).shift();return i?i.key:"SPARK"}var ne={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function ie(t){var e=t.orientation,n=t.dock,i=t.btt,r=t.rtl,o="horizontal"===e?function(t){return"bottom"===t||"near"===t?"bottom":"top"}(n):function(t,e){var n="left"===t||"near"===t?"left":"right";return e?ne[n]:n}(n,r),a=function(t,e,n){return"vertical"===t?e?"bottom":"top":n?"right":"left"}(e,i,r);return{current:o,opposite:ne[o],start:a,end:ne[a]}}function re(t){var e=t.chart,n=t.layoutService,i=t.config,o=void 0===i?{}:i,a=o.logicalSize,s=void 0!==a&&a,l=o.rtl,c=void 0!==l&&l,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},h={type:"x-y",config:r({},o),meta:u,update:function(t){u.chart.size={width:t.width,height:t.height},u.chart.mode=ee(t);var e=ie({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:c}),i=e.current,r=e.opposite;u.x.dock=i,u.x.opposite=r,u.x.size=t.width;var o=ie({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:c}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=t.height}};return h.update(Qt({chart:e,logicalSize:s})),h}var oe="vertical",ae="horizontal";function se(t){var e=t.chart,n=t.layoutService,i=t.config,o=void 0===i?{}:i,a=t.typeConfig,s=void 0===a?{}:a,l=o.logicalSize,c=void 0!==l&&l,u=o.rtl,h=void 0!==u&&u,d=s.fallback===oe?oe:ae,f=!!s.invert,p=s.measureAxes||[{ref:"measureAxis",name:"minor"}],g={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},m={type:"major-minor",config:r({},o),meta:g,update:function(t){g.chart.orientation=n.getLayoutValue("orientation",d),g.chart.size={width:t.width,height:t.height},g.chart.mode=ee(t),g.major.orientation=function(t){var e=t.chartOrientation,n=t.invert;return t.layoutService.meta.isContinuous?ae:n?e===oe?ae:oe:e}({layoutService:n,chartOrientation:g.chart.orientation,invert:f});var e=ie({orientation:g.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:h}),i=e.current,r=e.opposite;g.major.dock=i,g.major.opposite=r,g.major.size=g.major.orientation===oe?t.height:t.width,p.forEach((function(e){var i={};i.orientation=g.major.orientation===oe?ae:oe;var r=ie({orientation:i.orientation,dock:n.getLayoutValue("".concat(e.ref,".dock")),btt:!0,rtl:h}),o=r.current,a=r.opposite,s=r.start,l=r.end;i.dock=o,i.opposite=a,i.start=s,i.end=l,i.size=i.orientation===oe?t.height:t.width,g[e.name]=i}))}};return m.update(Qt({chart:e,logicalSize:c})),m}function le(t){var e=t.chart,n=t.layoutService,i=t.config,r=void 0===i?{}:i,o=t.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?re:se)({chart:e,layoutService:n,config:r,typeConfig:a})}function ce(t,e,n){if(void 0===t||void 0===e)return n;for(var i=e.split("."),r=t,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}var ue=["__proto__","constructor"];function he(t,e,n){if(void 0!==t&&void 0!==e){var i=e.split("."),r=i[i.length-1];if(!ue.some((function(t){return i.includes(t)}))){for(var o=t,a=0;a<i.length-1;++a){var s=i[a];void 0===o[s]&&(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}}}var de,fe={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},pe=function(t,e){return t[e].reduce((function(t,e,n){var i;return i=e,fe.ERROR_CODES.some((function(t){var e;return t===(null===(e=i.qError)||void 0===e?void 0:e.qErrorCode)}))?t.filtered.push(n):t.reduced.push(e),t}),{reduced:[],filtered:[]})};function ge(t){var e;return((null==t||null===(e=t.qHyperCube)||void 0===e?void 0:e.qDimensionInfo)||[]).map((function(t){var e,n=null===(e=t.qCardinalities)||void 0===e?void 0:e.qHypercubeCardinal;if(n)return n;var i=t.qStateCounts||{},r=i.qLocked,o=void 0===r?0:r,a=i.qOption,s=void 0===a?0:a,l=i.qSelected;return o+s+(void 0===l?0:l)}))}function me(t){switch(t.qHyperCube.qMode){case"S":return function(t){var e=t.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:e.qcx,y:e.qcy,dimensions:ge(t)}}}(t);case"K":return function(t){var e=ge(t);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:t.qHyperCube.qSize.qcx,y:e[0],dimensions:e}}}(t);case"T":return function(t){var e=ge(t);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:t.qHyperCube.qSize.qcx,y:e[0],dimensions:e}}}(t);default:throw new Error("Mode not supported")}}function ye(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function xe(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=be)):void 0===e&&(e=ve);for(var n,i,r,o,a,s=new ke(t),l=[s];n=l.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new ke(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(Me)}function ve(t){return t.children}function be(t){return Array.isArray(t)?t[1]:null}function we(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Me(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function ke(t){this.data=t,this.depth=this.height=0,this.parent=null}ke.prototype=xe.prototype={constructor:ke,count:function(){return this.eachAfter(ye)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;for(t=n.pop(),e=i.pop();t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return xe(this).eachBefore(we)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}},de=function(t){
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-gauge"]=t(e.stardust)}(this,(function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function n(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function l(e,n){if(e){if("string"==typeof e)return t(e,n);var i={}.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,n):void 0}}var c=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],u=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var h=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function d(e){var t=e.theme,n=e.translator,i=e.defaultValue,r=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,a(new Set([i].concat(a(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(i),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(a(o.map((function(e){return h(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],a(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?u:c}(r).map((function(e){return h(e)}))))}function f(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=e.flags,a=function(){return t.getStyle(i,r,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return d({theme:t,translator:n,defaultValue:a(),flags:o})}}}var p,m,g=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],y=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function x(e){var t=e.theme,n=e.translator,i=e.id,r=e.path,o=function(){return t.getStyle(i,r,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,i=[],r=e.theme.getStyle("","","fontSizes");return Array.isArray(r)&&r.length?i.push.apply(i,a(new Set([n].concat(a(r))))):i.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(a(i.map((function(e){return y(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],a(g.map((function(e){return y(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function v(e){var t=e.theme,n=e.translator,i=e.id,r=e.path;return{fontFamily:f({theme:t,translator:n,id:i,path:r,flags:e.flags}),fontSize:x({theme:t,translator:n,id:i,path:r})}}var b,w=function(){if(m)return p;m=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return p=function e(){var t,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=s(h,n),h!==(l=s(t,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},p}(),M=(b=w)&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b;function k(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.value%r.length]}))},valueAccessor:e.value}}function S(e,t){return{range:function(e){var n=e.resources,i=e.data,r=n.theme.palette("categorical",0===t?i.items.length:t);return i.items.map((function(e){return r[e.row.value%r.length]}))},valueAccessor:e.value}}function _(e,t,n,i,r){var o,a,s=r.byRow,l=r.byElemNo;if(i&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(i,i.raw().qCardinal);if(i){var c=t.pic.extract({field:i.key(),trackBy:i.value}).length;return s(i,c)}return{}}function q(e,t){var n=e.hc.qDimensionInfo,i=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(i.activeDimensionIndex>=0){var r=n[i.activeDimensionIndex];i=r.coloring&&r.coloring.colorMapRef?{type:"libraryItem",key:r.coloring.colorMapRef,activeDimensionIndex:i.activeDimensionIndex}:{activeDimensionIndex:i.activeDimensionIndex}}return i}function D(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter((function(e){return"dimension"===e.type()}))[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field((function(e){return e.raw().colorMapRef===t.key})):void 0)&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n}function A(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function C(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function N(){}var E=1/.7,R="\\s*([+-]?\\d+)\\s*",I="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",O="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",P=/^#([0-9a-f]{3,8})$/,L=new RegExp(`^rgb\\(${R},${R},${R}\\)$`),T=new RegExp(`^rgb\\(${O},${O},${O}\\)$`),z=new RegExp(`^rgba\\(${R},${R},${R},${I}\\)$`),F=new RegExp(`^rgba\\(${O},${O},${O},${I}\\)$`),j=new RegExp(`^hsl\\(${I},${O},${O}\\)$`),V=new RegExp(`^hsla\\(${I},${O},${O},${I}\\)$`),B={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function H(){return this.rgb().formatHex()}function $(){return this.rgb().formatRgb()}function W(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=P.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?U(t):3===n?new K(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Y(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Y(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=L.exec(e))?new K(t[1],t[2],t[3],1):(t=T.exec(e))?new K(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=z.exec(e))?Y(t[1],t[2],t[3],t[4]):(t=F.exec(e))?Y(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=j.exec(e))?ne(t[1],t[2]/100,t[3]/100,1):(t=V.exec(e))?ne(t[1],t[2]/100,t[3]/100,t[4]):B.hasOwnProperty(e)?U(B[e]):"transparent"===e?new K(NaN,NaN,NaN,0):null}function U(e){return new K(e>>16&255,e>>8&255,255&e,1)}function Y(e,t,n,i){return i<=0&&(e=t=n=NaN),new K(e,t,n,i)}function G(e){return e instanceof N||(e=W(e)),e?new K((e=e.rgb()).r,e.g,e.b,e.opacity):new K}function X(e,t,n,i){return 1===arguments.length?G(e):new K(e,t,n,null==i?1:i)}function K(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Z(){return`#${te(this.r)}${te(this.g)}${te(this.b)}`}function J(){const e=Q(this.opacity);return`${1===e?"rgb(":"rgba("}${ee(this.r)}, ${ee(this.g)}, ${ee(this.b)}${1===e?")":`, ${e})`}`}function Q(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ee(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function te(e){return((e=ee(e))<16?"0":"")+e.toString(16)}function ne(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new re(e,t,n,i)}function ie(e){if(e instanceof re)return new re(e.h,e.s,e.l,e.opacity);if(e instanceof N||(e=W(e)),!e)return new re;if(e instanceof re)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new re(a,s,l,e.opacity)}function re(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function oe(e){return(e=(e||0)%360)<0?e+360:e}function ae(e){return Math.max(0,Math.min(1,e||0))}function se(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}A(N,W,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:H,formatHex:H,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ie(this).formatHsl()},formatRgb:$,toString:$}),A(K,X,C(N,{brighter(e){return e=null==e?E:Math.pow(E,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new K(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new K(ee(this.r),ee(this.g),ee(this.b),Q(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Z,formatHex:Z,formatHex8:function(){return`#${te(this.r)}${te(this.g)}${te(this.b)}${te(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:J,toString:J})),A(re,(function(e,t,n,i){return 1===arguments.length?ie(e):new re(e,t,n,null==i?1:i)}),C(N,{brighter(e){return e=null==e?E:Math.pow(E,e),new re(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new re(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new K(se(e>=240?e-240:e+120,r,i),se(e,r,i),se(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new re(oe(this.h),ae(this.s),ae(this.l),Q(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Q(this.opacity);return`${1===e?"hsl(":"hsla("}${oe(this.h)}, ${100*ae(this.s)}%, ${100*ae(this.l)}%${1===e?")":`, ${e})`}`}}));const le=Math.PI/180,ce=180/Math.PI,ue=4/29,he=6/29,de=3*he*he;function fe(e){if(e instanceof pe)return new pe(e.l,e.a,e.b,e.opacity);if(e instanceof ve)return be(e);e instanceof K||(e=G(e));var t,n,i=xe(e.r),r=xe(e.g),o=xe(e.b),a=me((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=me((.4360747*i+.3850649*r+.1430804*o)/.96422),n=me((.0139322*i+.0971045*r+.7141733*o)/.82521)),new pe(116*a-16,500*(t-a),200*(a-n),e.opacity)}function pe(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function me(e){return e>.008856451679035631?Math.pow(e,1/3):e/de+ue}function ge(e){return e>he?e*e*e:de*(e-ue)}function ye(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function xe(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ve(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function be(e){if(isNaN(e.h))return new pe(e.l,0,0,e.opacity);var t=e.h*le;return new pe(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}A(pe,(function(e,t,n,i){return 1===arguments.length?fe(e):new pe(e,t,n,null==i?1:i)}),C(N,{brighter(e){return new pe(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new pe(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new K(ye(3.1338561*(t=.96422*ge(t))-1.6168667*(e=1*ge(e))-.4906146*(n=.82521*ge(n))),ye(-.9787684*t+1.9161415*e+.033454*n),ye(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),A(ve,(function(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof ve)return new ve(e.h,e.c,e.l,e.opacity);if(e instanceof pe||(e=fe(e)),0===e.a&&0===e.b)return new ve(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ce;return new ve(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ve(e,t,n,null==i?1:i)}),C(N,{brighter(e){return new ve(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ve(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return be(this).rgb()}}));var we=e=>()=>e;function Me(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):we(isNaN(e)?t:e)}var ke=function e(t){var n=function(e){return 1==(e=+e)?Me:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):we(isNaN(t)?n:t)}}(t);function i(e,t){var i=n((e=X(e)).r,(t=X(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Me(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1),Se=/^class(-pyramid)?/,_e=function(e,t,n,i){var r=void 0!==n.min?n.min:i.min(),o=void 0!==n.max?n.max:i.max(),s=r,l=o,c=t.limits,u={},h="percent"===t.limitType?c.map((function(e){return r+(o-r)*e})):c,d=t.colors.map((function(t){return e.resolveUIColor(t)}));if(r=Math.min.apply(Math,[r].concat(a(h))),o=Math.max.apply(Math,[o].concat(a(h))),u.min=r,u.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))u.type="categorical",Object.assign(u,function(e){var t=e.min,n=e.max,i=e.limits,r=e.range,o=[],a=[];if(i.length)if(i[i.length-1]<t)a.push(t,n),o.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(i[0]>n)a.push(t,n),o.push(r[0],r[0],r[0]);else{if(i[0]>t)a.push(t),o.push(r[0]);else{a.push(t);for(var s=0;s<i.length;s++)if(t<i[s]){o.push(r[s]);break}}for(var l=0;l<i.length;l++)t<i[l]&&i[l]<n&&(a.push(i[l]),o.push(r[l]));if(i[i.length-1]<n)a.push(n),o.push(r[i.length]),o.push(r[i.length]);else{a.push(n);for(var c=0;c<i.length;c++)if(i[c]>n){o.push(r[c]),o.push(r[c]);break}}}else o.push(r[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?r:s,max:"percent"===t.limitType?o:l,range:d,limits:"percent"===t.limitType?h:c}));else if(t.breakTypes){var f=t.breakTypes;u.type="continuous",u.domain=[r],u.range=[d[0]];for(var p=0;p<h.length;p+=1)if(f[p]){var m=d[p],g=d[p+1],y=ke(m,g)(.5);u.range.push(y),u.domain.push(h[p]),p<h.length-1&&f[p+1]&&(u.range.push(d[p+1]),u.domain.push((h[p]+h[p+1])/2))}else u.range.push(d[p]),u.range.push(d[p+1]),u.domain.push(h[p]),u.domain.push(h[p]+Math.min(1e-6,(o-r)/1e6));u.range.push(d[d.length-1]),u.domain.push(o)}else u.domain=h,u.range=d;return u};function qe(e,t,n,i,r){var o,a,s,l=0,c=[],u=(e-t)/(i+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(a/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=i||l>=r?Math.max(l,i):qe(e,t,n,i+1,r)}var De=function(e,t,n,i){var r,o,s=t.theme,l=t.hc,c=i.f,u={mode:"field",fieldType:"measure",field:c?c.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},h=[],d=!0;if(c){if(Number.isNaN(+c.min())||Number.isNaN(+c.max()))return{invalid:!0};(d=!("S"===(r=n.pic.raw()).qMode&&(r.qDataPages[0]&&r.qSize.qcy>r.qDataPages[0].qArea.qHeight||!r.qDataPages.length&&r.qSize.qcy>0)||"K"===r.qMode&&r.qStackedDataPages[0]&&r.qSize.qcy>r.qStackedDataPages[0].qArea.qHeight||"T"===r.qMode&&r.qSize.qcy>r.qTreeDataPages[0].qGroupSize))&&(h=n.pic.extract({field:0,props:{num:{field:c.key()},exclude:{fields:l.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return Math.min.apply(Math,a(e))<0}}}}).filter((function(e){return e.value>=0&&!e.exclude.value})).map((function(e){return e.num.value})).filter((function(e){return"number"==typeof e})))}if(!1===n.input.autoMinMax){if(u.min=n.input.measureMin,u.max=n.input.measureMax,u.max<u.min)return{invalid:!0}}else if(c&&!d)u.min=c.min(),u.max=c.max();else if(c){if(!h.length)return{invalid:!0};u.min=Math.min.apply(Math,a(h)),u.max=Math.max.apply(Math,a(h))}if(n.input.measureScheme&&(u.palettes={quant:n.input.measureScheme}),s){var f=s.getDataColorScales().filter((function(e){return e.key===n.input.measureScheme}))[0];u.type=f&&Se.test(f.type)?"categorical":"continuous","categorical"===u.type&&(o=f.colors.some((function(e){return Array.isArray(e)}))?Math.max.apply(Math,a(f.colors.map((function(e){return e?e.length:0})))):f.colors.length)}if("categorical"===u.type){for(var p=d?qe(u.max,u.min,h,1,o):o,m=(u.max-u.min)/p,g=[],y=0;y<p+1;y+=1)g.push(u.min+m*y);u.domain=g,u.range=function(e){for(var t=e.resources.theme.palette("quant",p),n=Math.max(1,Math.floor(t.length/p)),i=[],r=0;r<p;r+=1)i.push(t[r*n]);return[i[0]].concat(i,[i[i.length-1]])}}return u};function Ae(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field((function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key})):"expression"===t.type&&(n=e.pic.field((function(e){return"colorByAlternative"===e.raw().id}))),n||(n=e.pic.field((function(e){return void 0!==e.raw().matchMeasure})))&&(n=e.pic.fields().filter((function(e){return"measure"===e.type()}))[n.raw().matchMeasure]),n}function Ce(e){e.measureOverrides.every((function(e){return!e}))&&(e.measureOverrides=null)}function Ne(e,t){for(var n=(null==t?void 0:t.domain)||[],i=(null==t?void 0:t.range)||[],r=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),i.push(a.primary)):i[s]=a.primary,e[o]=null}else if(a){r.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),i.splice(l,1))}}return{domain:n,range:i,exclude:r}}function Ee(e,t,n,i){var o,a=function(e,t,n,i){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var i=t.theme,r=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Ae:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=De(0,{theme:i,hc:r},n,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter((function(e){return"measure"===e.type()}))[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var h=u.raw().coloring;h&&h.gradient&&M(c,_e(e,h.gradient,c,u))}else c.auxiliary=s;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.getCDef,o=void 0===r?q:r,a=i.getCByField,s=void 0===a?D:a,l=i.getPersistence,c=void 0===l?_:l,u=o(t,n),h=s(n,u),d=h?h.raw():{},f=n&&n.pic?n.pic.raw():{};if(d.qError||d.qSize&&0===d.qSize.qcy&&!f.qHasOtherValues)return{invalid:!0};var p={mode:"field",fieldType:"dimension",type:"categorical",field:h?h.key():void 0,isFieldLocked:d.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(p.label=u.label,"color.altLabel"===d.labelExpRef&&(p.label=n.input.altLabel)),!p.label&&h&&(p.label=h.title()),n.input.dimensionScheme&&(p.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(p.auxiliary=u),M(p,c(t,n,u,h,{byRow:S,byElemNo:k})),p}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.pic.field((function(e){return"colorByExpression"===e.raw().id}));if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:i.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=De(0,{hc:r,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,i);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,i){var r=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&r.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&r.qMeasureInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?c.push(i.primary):c.push(r)}}));var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,h=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&h&&(u={categorical:h.key}),{mode:"measure",type:"categorical",palettes:u,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var d=[],f=[];return r.qDimensionInfo.forEach((function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){d.push(n);var r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?f.push(i.primary):f.push(r)}})),{mode:"dimension",type:"categorical",field:d.length?d[0]:void 0,explicit:d.length?{domain:d,range:f}:void 0}}var p=i.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(p=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(p=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:p}}(e,n,t,i)}return{}}(e,t,n,i);return null!==(o=t.input)&&void 0!==o&&o.measureOverrides?(a.measureOverrides=t.input.measureOverrides.map((function(n,o){return function(e){var t,n=e.cm,i=e.defaults,o=e.index,a=e.input,s=e.pic;if(!a||!a.on)return null;var l=null!==(t=a.mode)&&void 0!==t?t:"primary";return"primary"===l?function(e,t,n){var i=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(i=e.resolveUIColor(t.paletteColor)),r(r({},n),{},{mode:"constant",type:"constant",primary:i})}(n,a,i):"byExpression"===l?function(e,t,n){var i="qMeasureInfo/".concat(e,"/"),o=t.field((function(e){return e.id().startsWith(i)&&"colorByMeasureExpression"===e.raw().id})),a=o;return r(r({},n),{},a?{mode:"field",fieldType:"expression",field:o?o.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(o,s,i):null}({cm:e,input:n,defaults:i,index:o,pic:t.pic})})),function(e,t){var n,i,r,o=t.translator;if(Ce(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Ne(e.measureOverrides,e.explicit),Ce(e)),null!==(i=e.measureOverrides)&&void 0!==i&&i.every((function(e){return"constant"===(null==e?void 0:e.mode)}))){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Ne(e.measureOverrides),a}return null!==(r=e.measureOverrides)&&void 0!==r&&r.every((function(e){return e}))?{invalid:!0,measureOverrides:e.measureOverrides}:e}(a,n)):a}var Re=function(e,t){var n=e.fieldType,i={};if(t)if("measure"===n){var r=t.coloring;r&&(i.measureGradient=r.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(i.legendDataPage=o),a&&(i.dimValsData=a.colorMap)}return i},Ie=function(e){throw e.isHandled=!0,e};function Oe(e){return function(t){return"object"===s(t.datum[e])?t.datum[e].value:void 0}}function Pe(e){return"object"===s(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Le(e){return-3===e.datum.value}var Te={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},ze={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function Fe(e){var t=e.theme,n=e.key,i=e.styleOverrides,r={title:{color:Te.COLOR,fontSize:Te.FONT_SIZE,fontFamily:Te.FONT_FAMILY},label:{color:ze.COLOR,fontSize:ze.FONT_SIZE,fontFamily:ze.FONT_FAMILY}};if(!t&&!i)return r;var o=i||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,i,r,o){return void 0!==e?e:t?t.getStyle(n,i,r):o}}({theme:t,key:n});return r.title.color=l(null==a?void 0:a.color,"legend.title","color",Te.COLOR),r.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",Te.FONT_SIZE),r.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",Te.FONT_FAMILY),r.label.color=l(null==s?void 0:s.color,"legend.label","color",ze.COLOR),r.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",ze.FONT_SIZE),r.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",ze.FONT_FAMILY),r}var je=function(e,t,n){var i=e&&e.dock||void 0;if("auto"!==i)return i||"right";if(t){var r=t.element.getBoundingClientRect();if(r.height>r.width)return"bottom"}return n?"left":"right"},Ve=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function Be(e,t){var n=e.styleReference,i=e.styleOverrides,r=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,c=t.hc,u=Fe({theme:l,key:n,styleOverrides:i});return{layout:{minimumLayoutMode:"MEDIUM",dock:je(a,r,o)},show:"function"==typeof a.show?function(){return Ve(a,c,s)}:Ve(a,c,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function He(e,t,i){var o=[],a=[],s=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var i=Be(e,t);if(!i.show)return!1;var o,a=e.key,s=e.styleReference,l=e.styleOverrides,c=e.viewState,u=e.rtl,h=e.settings,d=e.style,f=t.scaleKey,p=t.theme,m=t.scales,g=Fe({theme:p,key:s,styleOverrides:l}),y=i.layout.dock,x="left"===y||"right"===y?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(o=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(f,"Legend");return M(!0,i,{type:"legend-cat",key:"".concat(a,"-cat"),scale:b in m?b:f,settings:{layout:{scrollOffset:function(){return c?c.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(i.layout.dock)?2:1,direction:u?"rtl":"ltr",horizontal:20},item:{show:o,label:r({fill:g.label.color,fontSize:g.label.fontSize,fontFamily:g.label.fontFamily},x)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",a],style:{inactive:{opacity:.3}}}]}},{settings:h,style:d})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,i=e.key,r=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,c=t.scaleKey,u=t.theme,h="".concat(c,"Range"),d=Be(e,t);if(!d.show)return!1;var f=Fe({theme:u,key:r,styleOverrides:o}),p=d.layout.dock,m="right"===p||"left"===p,g=null===(n=t.scales)||void 0===n?void 0:n[h];return m&&g&&(g.invert=!0),M(!0,d,{type:"legend-seq",key:"".concat(i,"-seq"),settings:{fill:c,major:h,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!a||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,i&&i.navigationDisabled);return o.push(s),s&&"legend-cat"===s.type&&(a.push(function(e){var t=e.key,n=e.requireFailure,i=e.recognizeWith,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:i,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var i;if(!n)return!0;if(null!=r&&null!==(i=r.interact)&&void 0!==i&&i.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(t,"-cat")})))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,i)),a.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,i=e.key,r=e.requireFailure,o=e.recognizeWith,a=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(i),type:"Pan",requireFailure:r,recognizeWith:o,options:{event:t,pointers:1,threshold:10,enable:function(e,n){var r;return this.started===t||!n||!(null!=a&&null!==(r=a.interact)&&void 0!==r&&r.enabled&&!a.interact.enabled())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some((function(e){return e.key==="".concat(i,"-cat")}))}},events:n(n(n({},"".concat(t,"start"),(function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(i,"-cat")).emit("panstart",e))})),"".concat(t,"move"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panmove",e)})),"".concat(t,"end"),(function(e){e.preventDefault(),this.chart.component("".concat(i,"-cat")).emit("panend",e),this.started=!1}))}}(e,i))),{interactions:a,components:o}}function $e(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=r({hc:null,colorProps:null,layout:null,theme:null},e),n={},i={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},o={auto:function(e){return e?(i.auto=e,o):i.auto},getDimensionColorMap:function(e){return e?(i.getDimensionColorMap=e,o):i.getDimensionColorMap},getAttributeDimension:function(e){return e?(i.getAttributeDimension=e,o):i.getAttributeDimension},getMeasure:function(e){return e?(i.getMeasure=e,o):i.getMeasure},set:function(e){var r;if(!e.colorProps)throw new Error('Missing "colorProps"');if(M(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=i.auto(e.layout);n.input=M(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(r=n.input.measureOverrides)&&void 0!==r&&r.every((function(e){return!e||!e.on}))&&(n.input=M(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,i=[];(e&&e.getDataColorPickerPalettes()||[]).forEach((function(e){i.push({key:"ui",colors:e.colors})})),n.palettes=i}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var r=(e.auxiliary||{}).key;if("measure"===e.fieldType)return i.getMeasure(r,t).catch((function(){}));if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?i.getAttributeDimension(o,t).catch((function(){})):Promise.resolve(),r?i.getDimensionColorMap(r,t).catch((function(){})):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,i){var o=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,i).then((function(i){if(!i)return{};if("measure"===e.fieldType){if(i.coloring&&i.coloring.gradient){var a=n.pic.field(e.field);return _e(o,i.coloring.gradient,e,a)}return{}}if("dimension"===e.fieldType){var s={nil:e.nil,others:e.others},l=i[0],c=i[1]?i[1].colorMap:null;if(l){var u=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:l,qInterColumnSortOrder:[0,1],qMode:"S"}});s.legendDataset=u}return c?function(e,t,n,i){var o=i.external,a=i.field,s=r({},e);M(s,k(a,a.raw().qCardinal));var l=o.theme?o.theme.getDataColorPalettes()[0]:null;return t.nul&&(s.nil=n.resolveUIColor(t.nul)),t.oth&&(s.others=n.resolveUIColor(t.oth)),t.usePal?(s.palettes={categorical:t.pal},l&&!t.pal&&(s.palettes.categorical=l.key,M(s,k(a)))):!1===t.autoFill&&t.single?s.range=[n.resolveUIColor(t.single)]:t.autoFill&&(l&&(s.palettes={categorical:l.key}),M(s,k(a))),t.colors&&t.colors.length&&(s.explicit=function(e,t,n){for(var i={},r=0;r<e.length;r+=1)i[e[r].value]=e[r].baseColor;var o=[];return{domain:function(e){var r=e.data,a=[];o=[];for(var s=0;s<r.items.length;s++){var l=r.items[s],c=(l.text||l).label;i[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(i[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,s)),s}(s,c,o,{external:t,field:n.pic.field(e.field)}):s}return{}}))):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter((function(e){return"ui"===e.key}))[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},i=t.theme;i&&(e=r(r({},e),i.getDataColorSpecials())),n.settings=M(e,Ee(this,n,t,e))}return n.settings}};return o}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():i&&i.getObject?i.getObject("ColorMapModel_".concat(e)).then((function(e){return e.getLayout()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getMeasure((function(e,t){return function(e,t){var n=t.layout,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():i&&i.getMeasure?i.getMeasure(e).then((function(e){return e.getMeasure()})):Promise.reject()}(e,{layout:t.layout,app:t.app})})).getAttributeDimension((function(e,t){return function(e,t){var n=t.layout,i=t.model,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():i&&i.session&&r?i.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Ie):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})}));return n.getSnapshotData=Re,n}({resources:e}),i={},o={},s=function(e){return o.settings||(e||console.warn("settings() called before auxiliarySettings()"),o.settings=t.settings()),o.settings},l={config:function(n){if(i=r({},n),o={},!i.key)throw new Error("Missing key");t.set(r(r({},e),i))},auto:function(e){return e?(t.auto(e),l):t.auto()},getAuxiliarySettings:function(e){return o.auxiliarySettings?Promise.resolve(o.auxiliarySettings):t.getAuxiliarySettings(s(!0),e).then((function(e){return o.auxiliarySettings=e||{},o.settings=r(r({},o.settings),o.auxiliarySettings),o.scales=void 0,o.color=void 0,o.auxiliarySettings}))},getAuxiliaryData:function(){return t.getAuxiliaryData(s())},getSnapshotData:function(e){var n=s();return t.getAuxiliaryData(n,e).then((function(e){return t.getSnapshotData(n,e)}))},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=s();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=s().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(s(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,i=e.theme,r=[];if(n&&n.palettes&&i){var o=n.palettes.categorical||t.dimensionScheme,s=i.getDataColorPalettes().filter((function(e){return e.key===o}))[0]||i.getDataColorPalettes()[0];o&&s&&r.push({key:"categorical",colors:s.colors});var l=n.palettes.metric||t.measureScheme,c=i.getDataColorScales().filter((function(e){return e.key===l}))[0]||i.getDataColorScales()[0];if(c){var u=c.colors[0]?c.colors:[[]].concat(a(c.colors.slice(1)));u=Array.isArray(u[0])?u.map((function(e){return e.slice().reverse()})):u.slice().reverse(),r.push({key:"quant",colors:u})}}return r}({coloring:s(),colorProps:i.colorProps,theme:i.theme})},scales:function(){return o.scales=o.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,i=e.rtl,o=e.key,s=e.source,l=e.picasso,c={},u=o;if(n){var h={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(a((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(a((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var d,f=function(e){var t=e.hc,n=e.source,i=e.coloring,r={data:{extract:[{source:"dummy",field:0,filter:function(){return r.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:i.field,trackBy:i.valueAccessor,reduce:"first",props:{row:{reduce:function(){return r.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return r}({hc:t,source:s,coloring:n}).data;if(n.legendDataset){var p=0,m={};l.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return m[t]=p++,e[0]}}),d={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return m[e.qElemNumber]}}}}}}var g={data:f,range:n.range,domain:n.domain,explicit:h,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};c[u]=g,d&&(c["".concat(u,"Legend")]=r(r({},g),{},{data:d})),t&&t.qHasOtherValues&&d&&((d||g.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var y={data:{field:n.field},min:n.min,max:n.max};c[u]=M({},y,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===c[u].type&&(c["".concat(u,"Range")]=M({},y,{invert:!!i}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var x={data:t.qDimensionInfo.map((function(e,t){return t})),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:h,type:"categorical-color"};c[u]=x}else if("measure"===n.mode){var v={data:t.qMeasureInfo.map((function(e,t){return t})).filter((function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))})),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:h,type:"categorical-color"};c[u]=v}}return c}({hc:i.hc,coloring:s(),key:i.key,source:i.source,picasso:e.picasso}),o.scales},color:function(){return o.color=o.color||function(e){var t=e.coloring,n=e.scales,i=e.key,r=Oe(i),o=Oe("".concat(i,"IsAnOther")),a=function(e,t){var i=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,c=e.others,u=e.primary,h=e.type;return a?function(e){return Le(e)||o(e)?c:l}:n[t]?function(e){return Le(e)?c:Pe(e)||-2===r(e)&&"dimension"===i||"NaN"===r(e)?l:o(e)?c:e.resources.scale(t)(r(e))||c}:"constant"===s?function(e){return Le(e)||o(e)?c:Pe(e)?l:u}:"color"===h?function(e){return Le(e)||o(e)?c:Pe(e)?l:r(e)||c}:null},s=a(t,i);if(t.measureOverrides){var l=Oe("".concat(i,"MeasureIdx")),c=t.measureOverrides.map((function(e){return e&&a(e)}));return function(e){var t=l(e);return c[t]?c[t](e):s(e)}}return s}({coloring:s(),scales:this.scales(),key:i.key}),o.color},datumProps:function(e){return function(e){var t,i,r=e.hc,o=e.coloring,a=e.scales,s=e.key,l=e.addMeasureIx,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=s,h=o.nil;"field"===o.mode&&o.field?t=o.field:a[s]&&"field"===o.mode&&(t=a[s].data.field||o.field),t?(i={field:t,reduce:"first"},"color"===o.type&&(i.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&W(e.qText)?e.qText:h})):"dimension"===o.mode?i=void 0!==o.field?o.field:r.qDimensionInfo.length-1:"measure"===o.mode&&(i=c);var d=n({},u,i);return r.qDimensionInfo.length>1&&(d["".concat(u,"IsAnOther")]={fields:r.qDimensionInfo.map((function(e,t){return{field:"qDimensionInfo/".concat(t)}})),value:function(e){return-1!==e.indexOf(-3)}}),l&&(d["".concat(u,"MeasureIdx")]=c),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:i.key,hc:i.hc,addMeasureIx:s().measureOverrides},e)},data:function(){var e=s(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:i.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.viewState,o=e.chart,a=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,h=e.settings,d=void 0===h?{}:h,f=e.style,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return He({eventName:t,key:n,rtl:a,viewState:r,chart:o,styleReference:c,styleOverrides:u,settings:d,style:void 0===f?{}:f},{legendProps:i.legendProps,scaleKey:i.key,coloring:s(),theme:i.theme,hc:i.hc,scales:this.scales()},p)}};return l}var We=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Ue(e){var t=e.qHyperCube,n=t.qDimensionInfo,i=t.qMeasureInfo,r=n.some(We),o=i.some(We),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!r?"off":a}var Ye=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function Ge(e){var t,n=e.qHyperCube.qDimensionInfo.some(Ye),i=e.qHyperCube.qMeasureInfo.some(Ye),r=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=r?r:i?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var Xe=function(){};function Ke(e){var t,n,i,o,a=e.picasso,s=e.model,l=e.app,c=e.translator,u=e.layoutService,h=void 0===u?void 0:u,d=e.createConfig,f=void 0===d?Xe:d,p=e.config,m=void 0===p?{}:p,g=e.custom,y=void 0===g?{}:g,x=m.localeInfo,v=m.key,b=m.theme,w=void 0===b?void 0:b,M=m.auto,k=void 0===M?void 0:M,S=m.definitionPath,_=null==h||null===(t=h.getLayout)||void 0===t?void 0:t.call(h),q={theme:w,key:v,localeInfo:x,layout:_,hc:null==h||null===(n=h.getHyperCube)||void 0===n?void 0:n.call(h),legendProps:null==h||null===(i=h.getLayoutValue)||void 0===i?void 0:i.call(h,"legend"),colorProps:r(r({},null==h||null===(o=h.getLayoutValue)||void 0===o?void 0:o.call(h,"color")),{},{useBaseColors:_?Ue(_):void 0})},D=$e({picasso:a,model:s,app:l,translator:c,auto:k});!1!==k&&D.auto((function(e){return k?k({layout:e,defaultAuto:Ge}):Ge(e)}));var A=!1,C={getColor:function(){return D.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return D.resolveUIColor({index:t,color:n})},getData:function(){return D.data()},getDatumProps:function(e){return D.datumProps(e)},getSnapshotData:function(){return D.getSnapshotData(S)},getSettingsForMeasure:function(e){return D.settingsForMeasure(e)},getSettings:function(){return D.settings()},getLegend:function(e,t){return D.legend(e,t)},getScales:function(){return D.scales()},getPalettes:function(){return D.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return D.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return A},custom:r({},y),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:Ue}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r(r(r({},e),t),{},{colorProps:r(r({},e.colorProps),t.colorProps||{})})}(q,t);return D.config(n),D.getAuxiliarySettings(S).then((function(){A=!0}))}};return C}var Ze="center",Je="bottom";function Qe(e){var t=e.chart,n=e.logicalSize;if(n)return n;var i=t?t.element.getBoundingClientRect():{};return{width:i.width,height:i.height}}[{key:"NoDataExist",alignment:Ze,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Ze,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Ze,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Ze},{key:"DataRangeIncludingZero",alignment:Je},{key:"LimitedData",alignment:Je},{key:"NegativeOrZeroValues",alignment:Je}].reduce((function(e,t){return e[t.key]=t,e}),{});var et=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function tt(e){var t=e.width,n=e.height,i=et.filter((function(e){return t>=e.size.width&&n>=e.size.height})).shift();return i?i.key:"SPARK"}var nt={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function it(e){var t=e.orientation,n=e.dock,i=e.btt,r=e.rtl,o="horizontal"===t?function(e){return"bottom"===e||"near"===e?"bottom":"top"}(n):function(e,t){var n="left"===e||"near"===e?"left":"right";return t?nt[n]:n}(n,r),a=function(e,t,n){return"vertical"===e?t?"bottom":"top":n?"right":"left"}(t,i,r);return{current:o,opposite:nt[o],start:a,end:nt[a]}}function rt(e){var t=e.chart,n=e.layoutService,i=e.config,o=void 0===i?{}:i,a=o.logicalSize,s=void 0!==a&&a,l=o.rtl,c=void 0!==l&&l,u={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},h={type:"x-y",config:r({},o),meta:u,update:function(e){u.chart.size={width:e.width,height:e.height},u.chart.mode=tt(e);var t=it({orientation:"horizontal",dock:n.getLayoutValue("xAxis.dock"),btt:!1,rtl:c}),i=t.current,r=t.opposite;u.x.dock=i,u.x.opposite=r,u.x.size=e.width;var o=it({orientation:"vertical",dock:n.getLayoutValue("yAxis.dock"),btt:!0,rtl:c}),a=o.current,s=o.opposite;u.y.dock=a,u.y.opposite=s,u.y.size=e.height}};return h.update(Qe({chart:t,logicalSize:s})),h}var ot="vertical",at="horizontal";function st(e){var t=e.chart,n=e.layoutService,i=e.config,o=void 0===i?{}:i,a=e.typeConfig,s=void 0===a?{}:a,l=o.logicalSize,c=void 0!==l&&l,u=o.rtl,h=void 0!==u&&u,d=s.fallback===ot?ot:at,f=!!s.invert,p=s.measureAxes||[{ref:"measureAxis",name:"minor"}],m={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},g={type:"major-minor",config:r({},o),meta:m,update:function(e){m.chart.orientation=n.getLayoutValue("orientation",d),m.chart.size={width:e.width,height:e.height},m.chart.mode=tt(e),m.major.orientation=function(e){var t=e.chartOrientation,n=e.invert;return e.layoutService.meta.isContinuous?at:n?t===ot?at:ot:t}({layoutService:n,chartOrientation:m.chart.orientation,invert:f});var t=it({orientation:m.major.orientation,dock:n.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:h}),i=t.current,r=t.opposite;m.major.dock=i,m.major.opposite=r,m.major.size=m.major.orientation===ot?e.height:e.width,p.forEach((function(t){var i={};i.orientation=m.major.orientation===ot?at:ot;var r=it({orientation:i.orientation,dock:n.getLayoutValue("".concat(t.ref,".dock")),btt:!0,rtl:h}),o=r.current,a=r.opposite,s=r.start,l=r.end;i.dock=o,i.opposite=a,i.start=s,i.end=l,i.size=i.orientation===ot?e.height:e.width,m[t.name]=i}))}};return g.update(Qe({chart:t,logicalSize:c})),g}function lt(e){var t=e.chart,n=e.layoutService,i=e.config,r=void 0===i?{}:i,o=e.typeConfig,a=void 0===o?{}:o;return("x-y"===a.type?rt:st)({chart:t,layoutService:n,config:r,typeConfig:a})}function ct(e,t,n){if(void 0===e||void 0===t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(void 0===r[a])return n;r=r[a]}return r}var ut=["__proto__","constructor"];function ht(e,t,n){if(void 0!==e&&void 0!==t){var i=t.split("."),r=i[i.length-1];if(!ut.some((function(e){return i.includes(e)}))){for(var o=e,a=0;a<i.length-1;++a){var s=i[a];void 0===o[s]&&(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}}}function dt(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}var ft,pt={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},mt=function(e,t){return e[t].reduce((function(e,t,n){var i;return i=t,pt.ERROR_CODES.some((function(e){var t;return e===(null===(t=i.qError)||void 0===t?void 0:t.qErrorCode)}))?e.filtered.push(n):e.reduced.push(t),e}),{reduced:[],filtered:[]})};function gt(e){var t;return((null==e||null===(t=e.qHyperCube)||void 0===t?void 0:t.qDimensionInfo)||[]).map((function(e){var t,n=null===(t=e.qCardinalities)||void 0===t?void 0:t.qHypercubeCardinal;if(n)return n;var i=e.qStateCounts||{},r=i.qLocked,o=void 0===r?0:r,a=i.qOption,s=void 0===a?0:a,l=i.qSelected;return o+s+(void 0===l?0:l)}))}function yt(e){switch(e.qHyperCube.qMode){case"S":return function(e){var t=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t.qcx,y:t.qcy,dimensions:gt(e)}}}(e);case"K":return function(e){var t=gt(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){var t=gt(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function xt(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function vt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=wt)):void 0===t&&(t=bt);for(var n,i,r,o,a,s=new St(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new St(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(kt)}function bt(e){return e.children}function wt(e){return Array.isArray(e)?e[1]:null}function Mt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function kt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function St(e){this.data=e,this.depth=this.height=0,this.parent=null}St.prototype=vt.prototype={constructor:St,count:function(){return this.eachAfter(xt)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return vt(this).eachBefore(Mt)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}},ft=function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- t.exports=function(t,e){if(!t||isNaN(+e))return e;var n,i,r,o,a,s,l,c,u,h,d=t.length,f=t.search(/[0-9\-\+#]/),p=f>0?t.substring(0,f):"",g=t.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,x=t.substring(y,y+1),v=y+("."===x||","===x?1:0),b=m>0?t.substring(v,d):"";if(n=(e="-"===(t=t.substring(f,v)).charAt(0)?-e:+e)<0?e=-e:0,r=(i=t.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",t=t.split(r),e=+(e=e.toFixed(t[1]&&t[1].length))+"",s=t[1]&&t[1].lastIndexOf("0"),(!(c=e.split("."))[1]||c[1]&&c[1].length<=s)&&(e=(+e).toFixed(s+1)),u=t[0].split(o),t[0]=u.join(""),(a=t[0]&&t[0].indexOf("0"))>-1)for(;c[0].length<t[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((e=e.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=e[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);e[0]=g}return e[1]=t[1]&&e[1]?r+e[1]:"","0"!==(i=e.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},de({exports:{}});var _e="'Source Sans Pro', 'Arial', 'sans-serif'",Se="#333333",Ne="#595959",Re="#737373",Ae="#cccccc",Ce="#e6e6e6";function De(t){var e={};return[].concat(a(t),a([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Ne],["object","axis.label.name","fontFamily",_e],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ae],["object","axis.line.minor","color",Ce],["object","axis.title","color"],["object","axis.title","fontFamily",_e],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Ce],["object","grid.line.major","color",Ae],["object","grid.line.minor","color",Ce],["object","label.value","color",Ne],["object","label.value","fontFamily",_e],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Ne],[!1,"label.value","lightColor",Ce],["object","outOfRange","color","#999"],["object","legend.title","color",Se],["object","legend.title","fontFamily",_e],["object","legend.title","fontSize","15px"],["object","legend.label","color",Ne],["object","legend.label","fontFamily",_e],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Se],["object","referenceLine.label.name","fontFamily",_e],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Ce],["object","referenceLine.outOfBounds","fontFamily",_e],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Re,function(t){return"transparent"===t?Re:t}]])).reduce((function(t,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return e[i]||(e[i]=!0,t.push(n)),t}),[]).sort((function(t,e){return(t[0].split?t[0].split(".").length:0)-(e[0].split?e[0].split(".").length:0)}))}var Oe=function(t){return t};function Ee(t){var e=t.theme,n=t.id,i=t.transform,r=t.extend,a=t.matrix,s={},l=i.reduce((function(t,e){var n=o(e,2),i=n[0],r=n[1];return t[i]=r,t}),{});return a.forEach((function(t){var i=o(t,5),r=i[0],a=i[1],c=i[2],u=i[3],h=i[4],d=void 0===h?function(t){return t}:h,f=function(t){var e=t.theme,n=t.base,i=t.path,r=t.attribute,o=t.defaultValue,a=void 0===o?void 0:o;if(!e||!1===n)return a;var s=e.getStyle(n,i,r);return void 0===s?a:s}({theme:e,base:"object"===r&&n?"".concat("object",".").concat(n):r,path:a,attribute:c,defaultValue:u}),p=(l["".concat(a,".").concat(c)]||Oe)(d(f));he(s,[a,c].filter(Boolean).join("."),p)})),r.forEach((function(t){var e=o(t,2),n=e[0],i=e[1];he(s,n,i)})),s}const ze=(t,e,n)=>{const i=function(t){var e=t.theme,n=t.translator,i=t.config,r=void 0===i?{}:i,o=t.flags,a=function(t){var e=t.config,n=void 0===e?{}:e,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),s=a.id,l=a.paths,c={};l.forEach((function(t){for(var i=t.split("."),r=c,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=v({theme:e,translator:n,id:s,path:t,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(t){for(var e=t.split("."),n=c,i=0;i<e.length;i++){var r=e[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(t,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(t){return u(t).getDefaultValue()},c.getOptions=function(t){return u(t).getOptions()},c}({theme:n,translator:e,flags:t,config:{id:"gauge",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",chartTitle:"Object.Gauge",translation:"LayerStyleEditor.component.styling",useBackground:!0,subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.title.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.title.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.title","color")}),width:!1}}}}}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.label.name.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.label.name.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.label.name","color")}),width:!1}}}}}}},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"value",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"label.value.fontFamily",component:"dropdown",options:()=>i.getOptions("label.value.fontFamily"),defaultValue:()=>i.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};function Ie(t){return"measure"===ce(t,"color.useBaseColors")}function Te(t){const{flags:e,translator:n,sense:i}=t,r=i.theme,o={items:{labels:{items:{header:{show(t){var e;return null===(e=t.qHyperCubeDef.qMeasures)||void 0===e?void 0:e.length}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(t){var e;return null===(e=t.qHyperCubeDef.qMeasures)||void 0===e?void 0:e.length},convertFunctions:{get:(t,e,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(t,e,n,i,r){r.measureAxis.show=t?"labels":"all"}}}}}}};return{definition:{type:"items",component:"accordion",items:{data:{uses:"data"},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{type:"items",uses:"settings",component:"expandable-items",translation:"Common.Appearance",items:{simpleLabels:o,presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:ze(e,n,r),rangeLimits:{type:"items",items:{text:{component:"text",translation:"properties.axis.rangeLimits",style:"sHeader"},min:{ref:"measureAxis.min",translation:"properties.axis.min",type:"number",expression:"optional",invalid:t=>t.measureAxis&&t.measureAxis.min>=t.measureAxis.max},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:t=>t.measureAxis&&t.measureAxis.min>=t.measureAxis.max}}},type:{ref:"gaugetype",type:"string",component:"item-selection-list",defaultValue:"radial",horizontal:!0,items:[{icon:"gauge_gauge",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.radial",value:"radial"},{icon:"gauge_vertical_bar",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.bar",value:"bar"}]},autoOrientation:{ref:"autoOrientation",translation:"properties.orientation",type:"boolean",defaultValue:!0,component:"switch",undefinedValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:t=>"bar"===t.gaugetype},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:t=>"bar"===t.gaugetype&&!t.autoOrientation},angle:{ref:"angle",translation:"properties.gauge.angle",type:"number",component:"slider",min:.2,max:.98,step:.1,defaultValue:.7,show:()=>!1},segments:{type:"items",items:{useSegments:{ref:"useSegments",type:"boolean",component:"switch",defaultValue:!1,translation:"properties.gauge.useSegments",change(t){const e=(n=t.segmentInfo).paletteColors&&n.paletteColors.length?n.paletteColors:n.colors&&n.colors.length?n.colors:void 0;var n;e&&(t.useSegments&&1===e.length?t.segmentInfo.paletteColors=[t.paletteProgressColor||t.progressColor]:t.paletteProgressColor=e[0])},options:[{value:!1,translation:"properties.off"},{value:!0,translation:"properties.on"}]},useBaseColor:{ref:"color.useBaseColors",type:"string",defaultValue:"measure",translation:"properties.useLibraryMeasureColors",component:"switch",show:t=>(t.color||(t.color={}),t.color.useBaseColors||(t.color.useBaseColors="off"),!0),options:[{value:"off",translation:"properties.off"},{value:"measure",translation:"properties.on"}]},paletteProgressColor:{component:"color-picker",translation:"properties.color",ref:"paletteProgressColor",type:"object",dualOutput:!0,defaultValue:()=>{var t;if(!r)return-1;const{primary:e}=r.getDataColorSpecials(),n=null===(t=r.getDataColorPickerPalettes()[0])||void 0===t?void 0:t.colors,i=n.indexOf(e);return{index:-1===i?Math.min(6,n.length-1):i}},show:t=>!Ie(t)&&!t.useSegments},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:t=>!Ie(t)&&t.useSegments,items:{limits:{ref:"segmentInfo.limits",type:"array",items:{value:{ref:"value",type:"number",expression:"optional",invalid:(t,e)=>"number"==typeof t.value&&(t.value<e.measureAxis.min||t.value>e.measureAxis.max),defaultValue:1},gradient:{translation:"properties.gradient",ref:"gradient",type:"boolean",show:!1}}},paletteColors:{items:{color:{ref:"color",type:"string"},index:{ref:"index",type:"integer",defaultValue:6}},type:"array",ref:"segmentInfo.paletteColors"}}}}},disclaimerClosed:{ref:"disclaimerClosed",type:"boolean",defaultValue:!1,show:!1}}},measureAxis:{type:"items",translation:"properties.measureAxis",grouped:!0,items:{axis:{type:"items",snapshot:{title:"properties.measureAxis",tid:"property-yAxis"},items:{show:{ref:"measureAxis.show",translation:"properties.axis.labelsAndTitle",type:"string",component:"dropdown",options:[{value:"all",translation:"properties.axis.show.all"},{value:"labels",translation:"properties.axis.show.labels"},{value:"title",translation:"properties.axis.show.title"},{value:"none",translation:"Common.None"}],defaultValue:"all"},spacing:{ref:"measureAxis.spacing",translation:"properties.axis.scale",type:"number",component:"dropdown",defaultValue:1,show:t=>t.measureAxis&&"none"!==t.measureAxis.show&&"title"!==t.measureAxis.show,options:[{value:2,translation:"properties.gridLine.wide"},{value:1,translation:"properties.gridLine.medium"},{value:.5,translation:"properties.gridLine.narrow"}]}}}}}}}}},support:{cssScaling:!1,snapshot:!0,export:!0,sharing:!0,exportData:!0,viewData:!0}}}function Pe(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Le(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?qe(Object(n),!0).forEach((function(e){Pe(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var je=Object.prototype.hasOwnProperty,Fe=Object.prototype.toString,Be=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,$e=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Fe.call(t)},He=function(t){if(!t||"[object Object]"!==Fe.call(t))return!1;var e,n=je.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&je.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||je.call(t,e)},We=function(t,e){Be&&"__proto__"===e.name?Be(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},Ue=function(t,e){if("__proto__"===e){if(!je.call(t,e))return;if(Ve)return Ve(t,e).value}return t[e]},Ye=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=Ue(s,n),s!==(r=Ue(e,n))&&(u&&r&&(He(r)||(o=$e(r)))?(o?(o=!1,a=i&&$e(i)?i:[]):a=i&&He(i)?i:{},We(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&We(s,{name:n,newValue:r}));return s};function Xe(t,e,n,i){if(!t)return-1;const r=n.cache,o=t.origin?t.origin():null;o&&(t=o);let a=r.fields.indexOf(t),s=-1,l=-1;if(-1===a)for(let e=0;e<r.wrappedFields.length;e++)if(l=r.wrappedFields[e].attrDims.map((t=>t.instance)).indexOf(t),s=r.wrappedFields[e].attrExps.map((t=>t.instance)).indexOf(t),-1!==l||-1!==s){a=e;break}if(Array.isArray(i)&&i.some(((t,e)=>t!==e))){const t=i.indexOf(a);-1!==t&&(a=t)}return a-=e.qArea.qLeft,a<0||a>=e.qArea.qWidth?-1:l>=0?t=>t[a].qAttrDims.qValues[l]:s>=0?t=>t[a].qAttrExps.qValues[s]:t=>t[a]}function Ge(t,e,n){let{key:i}=n;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function Ke(t){let{cache:e,f:n,mainCell:i,p:r,prop:o,page:a,rowIdx:s,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=t,f=i;if(r.field&&r.field!==n){const t=Xe(r.field,a,{cache:e},d);if(-1===t)return;f=Ye({qRow:s},t(l))}u[h]=Ge(r,f,{key:c})}function Ze(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let t=0;t<r.length;t++)if(void 0!==r[t].field){const a=e.raw(),s=e.key(),l="object"==typeof r[t].field?r[t].field:e.field(r[t].field),{props:c,main:u}=i.normalizeConfig(r[t],e),h=Object.keys(c),d=!!r[t].trackBy,f=typeof r[t].trackBy,p={},g=[],m=[];for(let e=0;e<a.qDataPages.length;e++){const o=Xe(l,a.qDataPages[e],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[e].qMatrix.length;y++){const x=a.qDataPages[e].qArea.qTop+y,v=Ye({qRow:x},o(a.qDataPages[e].qMatrix[y])),b=Ge(u,v,{key:s});if(!(u.filter&&!u.filter(v))){for(let t=0;t<h.length;t++){const i=c[h[t]];let r=i.fields||[i];i.fields&&(b[h[t]]=[]);for(let o=0;o<r.length;o++)Ke({cache:n,f:l,mainCell:v,p:r[o],prop:h[t],props:c,page:a.qDataPages[e],rowIdx:x,row:a.qDataPages[e].qMatrix[y],sourceKey:s,target:i.fields?b[h[t]]:b,targetProp:i.fields?o:h[t],columnOrder:a.qColumnOrder});if(i.fields){const e=b[h[t]].map((t=>t.value)),n=b[h[t]].map((t=>t.label));b[h[t]]={value:"function"==typeof i.value?i.value(e):void 0!==i.value?i.value:e,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[t]].value)}}}d&&i.track({cfg:r[t],itemData:v,obj:b,target:g,tracker:p,trackType:f}),m.push(b)}}}const y=d?i.collect(g,{main:u,propsArr:h,props:c}):m;o=[...o,...y]}return o}function Je(t){var e=0,n=t.children,i=n&&n.length;if(i)for(;--i>=0;)e+=n[i].value;else e=1;t.value=e}function Qe(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=en)):void 0===e&&(e=tn);for(var n,i,r,o,a,s=new on(t),l=[s];n=l.pop();)if((r=e(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new on(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(rn)}function tn(t){return t.children}function en(t){return Array.isArray(t)?t[1]:null}function nn(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function rn(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function on(t){this.data=t,this.depth=this.height=0,this.parent=null}function an(t){return null==t?null:function(t){if("function"!=typeof t)throw new Error;return t}(t)}on.prototype=Qe.prototype={constructor:on,count:function(){return this.eachAfter(Je)},each:function(t,e){let n=-1;for(const i of this)t.call(e,i,++n,this);return this},eachAfter:function(t,e){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)t.call(e,o,++l,this);return this},eachBefore:function(t,e){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(t.call(e,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(t,e){let n=-1;for(const i of this)if(t.call(e,i,++n,this))return i},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,i=e.children,r=i&&i.length;--r>=0;)n+=i[r].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop(),e=i.pop();for(;t===e;)r=t,t=n.pop(),e=i.pop();return r}(e,t),i=[e];e!==n;)e=e.parent,i.push(e);for(var r=i.length;t!==n;)i.splice(r,0,t),t=t.parent;return i},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return Qe(this).eachBefore(nn)},[Symbol.iterator]:function*(){var t,e,n,i,r=this,o=[r];do{for(t=o.reverse(),o=[];r=t.pop();)if(yield r,e=r.children)for(n=0,i=e.length;n<i;++n)o.push(e[n])}while(o.length)}};var sn={depth:-1},ln={},cn={};function un(t){return t.id}function hn(t){return t.parentId}function dn(){var t,e=un,n=hn;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=e,p=n,g=new Map;if(null!=t){const e=d.map(((e,n)=>function(t){t=`${t}`;let e=t.length;pn(t,e-1)&&!pn(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,i)))),n=e.map(fn),r=new Set(e).add("");for(const t of n)r.has(t)||(r.add(t),e.push(t),n.push(fn(t)),d.push(cn));f=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new on(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,g.set(h,g.has(h)?ln:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===ln)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=t){for(;s.data===cn&&1===s.children.length;)s=s.children[0],--r;for(let t=d.length-1;t>=0&&(c=d[t]).data===cn;--t)c.data=null}if(s.parent=sn,s.eachBefore((function(t){t.depth=t.parent.depth+1,--r})).eachBefore(rn),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(t){return arguments.length?(e=an(t),i):e},i.parentId=function(t){return arguments.length?(n=an(t),i):n},i.path=function(e){return arguments.length?(t=an(e),i):t},i}function fn(t){let e=t.length;if(e<2)return"";for(;--e>1&&!pn(t,e););return t.slice(0,e)}function pn(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function gn(t,e){"/"===t.charAt(0)&&(t=t.substring(1));const n=t.split("/");let i,r=e;for(let t=0;t<n.length;t++){if("*"===n[t]&&Array.isArray(r)){const e=[];i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++){let n=gn(i,r[t]);Array.isArray(n)?e.push(...n):e.push(n)}return e}if(!n[t]&&Array.isArray(r)){const e=new Array(r.length);i=n.slice(t+1).join("/");for(let t=0;t<r.length;t++)e[t]=gn(i,r[t]);return e}n[t]in r&&(r=r[n[t]])}return r}function mn(t,e,n){let i=[];if(!t||!t.length)return i;if(e<=0){const e=n>=0?[t[n]]:t;i=[...i,...e]}else for(let r=0;r<t.length;r++)t[r].children&&t[r].children.length&&(i=[...i,...mn(t[r].children,e-1,n)]);return i}function yn(t,e,n){if(t===e)return t=>t;if(t>e){const n=Math.max(0,Math.min(100,t-e));return t=>{let e=t;for(let t=0;t<n;++t)e=e.parent;return e}}if(e>t){const i=Math.max(0,Math.min(100,e-t));return t=>mn(t.children,i-1,n)}return!1}const xn=/^qDimensionInfo(?:\/(\d+))?/,vn=/^\/?qMeasureInfo\/(\d+)/,bn=/\/qAttrExprInfo\/(\d+)/,wn=/\/qAttrDimInfo\/(\d+)/;function Mn(t){return(t.qColumnOrder&&t.qColumnOrder.length?t.qColumnOrder:t.qDimensionInfo.map(((t,e)=>e))).filter((e=>e<t.qDimensionInfo.length))}function kn(t,e){let{cube:n}=e;if(!t)return-1;let i=t.origin&&t.origin()?t.origin().key():t.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=Mn(n);return xn.test(h)&&(r=!0,o=+xn.exec(h)[1],h=i.replace(xn,"")),vn.test(h)&&("K"===n.qMode?c=+vn.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+vn.exec(h)[1],u=0):u=+vn.exec(h)[1],h=h.replace(vn,"")),h&&(wn.exec(h)?s=+wn.exec(h)[1]:bn.exec(h)&&(a=+bn.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function _n(t,e){let n,i,r=yn(t.fieldDepth,e.fieldDepth,e.pseudoMeasureIndex);return n=e.measureIdx>=0?t=>t.data.qValues[e.measureIdx]:t=>t.data,e.attrDimIdx>=0?i=t=>{var n;return null==t||null===(n=t.qAttrDims)||void 0===n?void 0:n.qValues[e.attrDimIdx]}:e.attrIdx>=0&&(i=t=>{var n;return null==t||null===(n=t.qAttrExps)||void 0===n?void 0:n.qValues[e.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function Sn(t,e,n){let{key:i}=n;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}function Nn(t){let{propsArr:e,props:n,item:i,itemData:r,ret:o,sourceKey:a}=t;for(let t=0;t<e.length;t++){const s=n[e[t]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,g,m,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=t=>h.value(t,i)),"function"==typeof h.label&&(f=t=>h.label(t,i)),h.accessor?(g=h.accessor(i),Array.isArray(g)?(m=g.map(h.valueAccessor),h.attrAccessor&&(m=m.map(h.attrAccessor)),d&&(p=m.map(d),d=null),f&&(y=m.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(g)):h.valueAccessor(g),y=p)):(p=r,y=r)),s.fields){const t=d?d(p):p;c.push(t),u.push(f&&null!=y?f(y):null!=y?y:String(t))}else{const n=d?d(p):p;o[e[t]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[e[t]].source={field:h.field.key(),key:a})}}c&&(o[e[t]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const Rn=(t,e,n)=>{const i="K"===t.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===t.qMode?"qSubNodes":"qNodes",o=gn(i,t);return o&&o[0]?(e.tree=Qe(o[0],n.children||(t=>t[r])),e.tree):null};const An=t=>{let{propsArr:e,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=t;for(let t=0;t<e.length;t++){const s=n[e[t]],l=s.fields?s.fields:[s];for(let t=0;t<l.length;t++){const e=l[t];if(e.field!==a){const t=_n(o,kn(e.field,{cube:i,cache:r}));e.accessor=t.nodeFn,e.valueAccessor=t.valueFn,e.attrAccessor=t.attrFn}}}};function Cn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=e.raw(),o=e.key(),a="S"===r.qMode?function(t){const e=t.raw().qDataPages.length?t.raw().qDataPages[0].qMatrix:[],n=function(t){const e=t.raw().qColumnOrder,n=t.fields();return e&&e.length===n.length?e:n.map(((t,e)=>e))}(t),i=t.fields(),r=t.fields().filter((t=>"dimension"===t.type())).map((t=>n.indexOf(i.indexOf(t)))),o=t.fields().filter((t=>"measure"===t.type())).map((t=>n.indexOf(i.indexOf(t)))),a={__root:{__id:"__root",qValues:[]}};for(let t=0;t<e.length;t++){const n=e[t];let i="__root",l=!1;for(let t=0;t<r.length;t++){var s;const e=n[r[t]],o="".concat(i,"__").concat(null!==(s=e.qElemNumber)&&void 0!==s?s:e.qElemNo);a[o]||(a[o]=Le({__id:o,__parent:i,qValues:[]},e),l=!0),i=o}if(l)for(let t=0;t<o.length;t++){const e=n[o[t]];a[i].qValues.push(e)}}const l=Object.keys(a).map((t=>a[t])),c=dn().id((t=>t.__id)).parentId((t=>t.__parent))(l);return c}(e):Rn(r,n,t);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let t=Mn(r)[o-1];a=n.fields[t]}else{let t=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(t=r.qDimensionInfo.length),a=n.fields[t]}const{props:s,main:c}=i.normalizeConfig(Le(Le({},t),{},{field:a?a.key():void 0}),e),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?kn(a,{cube:r,cache:n}):{fieldDepth:0};An({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let t=0;t<u.length;t++){const e=l[u[t].depth].propsArr,n=l[u[t].depth].props,i=l[u[t].depth].main,r=c[t],a=r.data,s=Sn(i,a,{key:o});Nn({propsArr:e,props:n,item:r,itemData:a,ret:s,sourceKey:o,isTree:!0}),u[t].data=s}return a}function Dn(t,e,n,i){const r=Array.isArray(t)?t:[t];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=e.raw(),l=e.key();if(!Rn(s,n,t))continue;const c="object"==typeof r[a].field?r[a].field:e.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],e),d=Object.keys(u),f=kn(c,{cube:s,cache:n}),{nodeFn:p,attrFn:g,valueFn:m}=_n({fieldDepth:0},f);An({propsArr:d,props:u,cube:s,cache:n,itemDepthObject:f,f:c});const y=!!r[a].trackBy,x=typeof r[a].trackBy,v={},b=[],w=p(n.tree),M=[];for(let t=0;t<w.length;t++){const e=w[t],n=g?g(m(e)):m(e);if(h.filter&&!h.filter(n))continue;const o=Sn(h,n,{key:l});Nn({propsArr:d,props:u,item:e,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[a],itemData:n,obj:o,target:b,tracker:v,trackType:x}),M.push(o)}const k=y?i.collect(b,{main:h,propsArr:d,props:u}):M;o=[...o,...k]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var On=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)m+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}},ft({exports:{}});var _t="'Source Sans Pro', 'Arial', 'sans-serif'",qt="#333333",Dt="#595959",At="#737373",Ct="#cccccc",Nt="#e6e6e6";function Et(e){var t={};return[].concat(a(e),a([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Dt],["object","axis.label.name","fontFamily",_t],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ct],["object","axis.line.minor","color",Nt],["object","axis.title","color"],["object","axis.title","fontFamily",_t],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Nt],["object","grid.line.major","color",Ct],["object","grid.line.minor","color",Nt],["object","label.value","color",Dt],["object","label.value","fontFamily",_t],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Dt],[!1,"label.value","lightColor",Nt],["object","outOfRange","color","#999"],["object","legend.title","color",qt],["object","legend.title","fontFamily",_t],["object","legend.title","fontSize","15px"],["object","legend.label","color",Dt],["object","legend.label","fontFamily",_t],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",qt],["object","referenceLine.label.name","fontFamily",_t],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Nt],["object","referenceLine.outOfBounds","fontFamily",_t],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",At,function(e){return"transparent"===e?At:e}]])).reduce((function(e,n){var i="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[i]||(t[i]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var Rt=function(e){return e};function It(e){var t=e.theme,n=e.id,i=e.transform,r=e.extend,a=e.matrix,s={},l=i.reduce((function(e,t){var n=o(t,2),i=n[0],r=n[1];return e[i]=r,e}),{});return a.forEach((function(e){var i=o(e,5),r=i[0],a=i[1],c=i[2],u=i[3],h=i[4],d=void 0===h?function(e){return e}:h,f=function(e){var t=e.theme,n=e.base,i=e.path,r=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,i,r);return void 0===s?a:s}({theme:t,base:"object"===r&&n?"".concat("object",".").concat(n):r,path:a,attribute:c,defaultValue:u}),p=(l["".concat(a,".").concat(c)]||Rt)(d(f));ht(s,[a,c].filter(Boolean).join("."),p)})),r.forEach((function(e){var t=o(e,2),n=t[0],i=t[1];ht(s,n,i)})),s}function Ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pt,Lt={exports:{}};var Tt=(Pt||(Pt=1,function(e){self,e.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=l(h,n),h!==(r=l(t,n))&&(p&&r&&(a(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&a(i)?i:{},s(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&s(h,{name:n,newValue:r}));return h}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,i=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var i,r=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!o)return!1;for(i in e);return void 0===i||t.call(e,i)},s=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(r)return r(e,n).value}return e[n]};e.exports=function e(){var t,n,i,r,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=l(h,n),h!==(r=l(t,n))&&(p&&r&&(a(r)||(c=o(r)))?(c?(c=!1,u=i&&o(i)?i:[]):u=i&&a(i)?i:{},s(h,{name:n,newValue:e(p,u,r)})):void 0!==r&&s(h,{name:n,newValue:r}));return h}}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{i.r(r),i.d(r,{default:()=>Ee});var e=i(229),t=i.n(e);const n=function(e,t,n){if(!t)return!1;var i,r=t.split("."),o=r[r.length-1],a=e;for(i=0;i<r.length-1;++i)void 0===a[r[i]]&&(a[r[i]]=Number.isNaN(+r[i+1])?{}:[]),a=a[r[i]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var i,r=t.split("."),o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,i;for(n=0;n<t.length;n++)if((i=t[n]).qInfo.qId===e)return i;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var i=function(e,t){if(!t)return null;var n,i,r=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((i=t[n]).qName===r)return i;if(i.qDerivedFieldData)for(var o=0;o<i.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=i.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===r)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return i&&i.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function x(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,i=e.dimensions,r=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(i&&1===i.length){var c=x(u(i[0],r),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(i&&2===i.length){var h=u(i[0],r),d=u(i[1],r),f=p(0),m=p(1),g=x(h,f),y=x(d,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function b(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,i=e.dimensions,r=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:i,dimensionAndFieldList:r}),l=o?"":", 0";if(i&&1===i.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(i&&2===i.length){var h=p(0),d=p(1);return"If(Count(".concat(h,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,i){return m(e,t)+n+g(i)},getFunctionPrefix:b,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return b(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,i=e.layout,r=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===r&&2===w({properties:n,layout:i})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),i=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return i;var r=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(r[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(r[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(i,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(i,", ").concat(o,")"):n.qSortByAscii?"(".concat(i,", ").concat(a,")"):i},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var i=t.indexOf(l);if(-1!==i)return t.substring(n+s.length,i)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,i=e.minDimensions,r=void 0===i?1:i,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=r&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var i=t||e.outputExpression;if(e.base&&e.base.qDef&&(i=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var r=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));r&&t!==r.qDef.qLabel&&(i=r.qLibraryId||r.qDef.base.qLibraryId?"[".concat(r.qDef.qLabel,"]"):r.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);i=i.startsWith("=")?i.substr(1):i,i="".concat(o,"(").concat(i,", ").concat(e.steps,")")}return i},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var i=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&i.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}var _=t().bind(null,!0),q={},D=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===S(e)}function C(e){return void 0===e}function N(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function E(e,t){var n,i=t.substring(1).split("/").slice(0,-1);return i.forEach((function(t,r){if(r!==i.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=C(e[n||t])?o:e[t],e=e[n||t]}})),e}function R(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(i){R(e[i],t[i])||(n=!1)})),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i+=1)if(!R(e[i],t[i]))return!1;return!0}return e===t}q.generate=function(e,t,n){n=n||"";var i=[];return Object.keys(t).forEach((function(r){var o=function(e){return e?_({},{val:e}).val:e}(t[r]),a=e[r],s="".concat(n,"/").concat(r);R(o,a)||N(t,r)||(C(a)?i.push({op:"add",path:s,value:o}):A(o)&&A(a)?i=i.concat(q.generate(a,o,s)):D(o)&&D(a)?i=i.concat(function(e,t,n){var i=[],r=e.slice(),o=-1;function a(e,t,n){if(e[n]&&C(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var i=0,r=e.length;i<r;i+=1)if(e[i]&&e[i].qInfo.qId===t)return i;return-1}if(R(t,r))return i;if(!C(t[0])&&C(t[0].qInfo))return i.push({op:"replace",path:n,value:t}),i;for(var s=r.length-1;s>=0;s-=1)-1===(o=a(t,r[s].qInfo&&r[s].qInfo.qId,s))?(i.push({op:"remove",path:"".concat(n,"/").concat(s)}),r.splice(s,1)):i=i.concat(q.generate(r[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(r,t[l].qInfo&&t[l].qInfo.qId))?(i.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),r.splice(l,0,t[l])):o!==l&&(i.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),r.splice(l,0,r.splice(o,1)[0]));return i}(a,o,s)):i.push({op:"replace",path:"".concat(n,"/").concat(r),value:o}))})),Object.keys(e).forEach((function(r){C(t[r])&&!N(e,r)&&i.push({op:"remove",path:"".concat(n,"/").concat(r)})})),i},q.apply=function(e,t){t.forEach((function(t){var n,i,r=E(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?r[o]:r[+o]||r,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,a=e),"add"===t.op||"replace"===t.op)if(D(r))"-"===o&&(o=r.length),r.splice(+o,"add"===t.op?0:1,t.value);else if(D(a)&&D(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(i=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(A(a)&&A(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!N(n,e)&&delete n[e]})),_(a,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[o]=t.value}else if("move"===t.op){var u=E(e,t.from);D(r)?r.splice(+o,0,u.splice(+s,1)[0]):(r[o]=u[s],delete u[s])}else"remove"===t.op&&(D(r)?r.splice(+o,1):delete r[o])}))},q.clone=function(e){return _({},e)},q.createPatch=function(e,t,n){var i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):_(e,t)};const I=q,O=function(e,n,i){if(!e)return Promise.resolve();var r=I.generate(n,i);return t()(!0,n,i),r&&r.length?(r=r.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(r,!0)):Promise.resolve()};var P="accumulation";function L(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===P)return n[i]}function T(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===P)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var z={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=M.getNumStepComp(n,l),d=M.getAboveComp(n,l,u,h),f=M.getRangeComp("RangeSum",d);if(M.needDimension({modifier:n,properties:i,layout:r})){var p=M.getDimComp(c,1),m=M.getDimComp(c,0),g=M.getAggrComp(f,p,m);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,z)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(T(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(T(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(T(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(T(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=L(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=L(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(T(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(P))return!1;var o=L(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===j)return n[i]}function B(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===j)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,i=e.modifier,r=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!i)return n;var c=s;void 0===c&&(c=M.getNumDimensions({properties:r,layout:a}));var u=o(r,"qHyperCubeDef.qDimensions",[]),h=i.showExcludedValues&&i.nullSuppression,d=M.getExpressionWithExcludedComp({expression:n,modifier:i,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:h}),f=M.getNumStepComp(i,c),p=M.getAboveComp(i,c,d,f);if(i.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var m=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var i=e.steps,r="number"!=typeof i||Number.isNaN(i)?6:i;return"RangeMin(".concat(r,", ").concat(n,")")}return n}(i,c);t="".concat(m," / ").concat(g)}var y=t;if(M.needDimension({modifier:i,properties:r,layout:a})){var x=M.getDimComp(u,1),v=M.getDimComp(u,0),b=M.getAggrComp(y,x,v);y=i.showExcludedValues?M.getExcludedComp({modifier:i,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:b}):b}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(B(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(B(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(t,e);if(n){var i=n.steps;n.steps="number"!=typeof i||Number.isNaN(i)?6:Math.abs(i)}},show:function(t){var n=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(j))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===W)return n[i]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===W)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties;return n?M.generateTSDExpression(n,t,i):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=M.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var i=U(t,e);if(i){var r=i.steps;i.steps="number"!=typeof r||Number.isNaN(r)?2:Math.abs(r),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=r:e.steps=e.steps,e})),e}))}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var K="difference";function Z(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===K)return n[i]}function J(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===K)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=M.getAboveComp(n,l,u),d="".concat(u," - ").concat(h);if(M.needDimension({modifier:n,properties:i,layout:r})){var f=M.getDimComp(c,1),p=M.getDimComp(c,0),m=M.getAggrComp(d,f,p);d=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return d},initModifier:function(e){Object.keys(Q).forEach((function(t){void 0===e[t]&&(e[t]=Q[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(J(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(J(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(J(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(K))return!1;var o=Z(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var i=0;i<n.length;i++)if(n[i].type===te)return n[i]}function ie(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var i=0;i<n.length;i++)if(n[i].type===te)return i;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function re(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,i=e.properties,r=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=M.getNumDimensions({properties:i,layout:r}));var c=o(i,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),h=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,i,r,o,a){var s=ae(t),l=se(t,n,i),c=""===s&&""===l?"":s||l,u=le(r,o),h=ce(r,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(h," Aggr(").concat(c," ").concat(e,", ").concat(d,"))")}(u,h,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(ie(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var i=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return i=function(e,t){if(1===e){var n=re(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,i),i}(n,t,e)}},field:{refFn:function(t){return"".concat(ie(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(ie(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(ie(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,i){return function(e,t,n,i){var r=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===r?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=re(t,0);t.splice(n,1)}return t}(r,o),o=function(e,t){if(0===e){var n=re(t,1);t.splice(n,1)}return t}(ne(e,i).selectionScope,o),o}(n,i,t,e)}},primaryDimension:{refFn:function(t){return"".concat(ie(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,i){var r=i.ext.support.modifiers;if(!Array.isArray(r)||-1===r.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var he="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,he)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,he)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",xe="qDef.base.qDef",ve="qLibraryId",be="qDef.base.qLibraryId",we="qDef.qLabel",Me="qDef.qLabelExpression",ke="qDef.base.qLabel",Se="qDef.base.qLabelExpression",_e="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,xe,o(e,ye)),n(e,be,o(e,ve)),n(e,ke,o(e,we)),n(e,Se,o(e,Me)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,xe)),n(e,ve,o(e,be)),n(e,we,o(e,ke)),n(e,Me,o(e,Se)),o(e,_e)&&o(e,qe)&&n(e,_e,o(e,qe)),delete e.qDef.base)},isValid:function(e){var t=o(e,xe),n=o(e,be);return void 0!==t||void 0!==n}};const Ae=De;function Ce(e){return Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ce(e)}var Ne={accumulation:F,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Ee={modifiers:Ne,apply:Ie,applyModifiers:Oe,cleanUpMeasure:Pe,destroy:function(e){e&&Re[e.id]&&Re[e.id].masterItemSubscriber&&(Re[e.id].masterItemSubscriber&&Re[e.id].masterItemSubscriber.unsubscribe(),delete Re[e.id])},hasActiveModifiers:Le,getActiveModifier:Te,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return Ne[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return Ne[e]&&Ne[e].isApplicable({properties:n,layout:i})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,i=e.layout,r=!1,o=!1;return t.forEach((function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:i})&&(r=!0,o=o||Je({modifiers:t,properties:n,layout:i}))})),r&&!o},ifEnableTotalsFunction:ze};var Re={};function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,i=e.properties,r=e.isSnapshot,a=void 0!==r&&r,s=e.masterItem,l=!1;Re[n.id]=Re[n.id]||{isFirstTime:!0};var c=Re[n.id].isFirstTime;if(Re[n.id].isFirstTime=!1,i&&"object"===Ce(i))return Oe({model:n,properties:i});var u=n?n.layout:void 0,h=o(u,"qSelectionInfo.qInSelections");if(a||h)return Promise.resolve(l);var d=o(u,"qHyperCube.qMeasureInfo"),f=Re[n.id].lastReloadTime;if(Re[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Le({measures:d,layout:u})){var p=function(e){var t=e.measures,n=e.layout,i=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==i&&function(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ue({measure:e,properties:n,layout:i})}))}({measures:t,layout:n})}({measures:d,layout:u,model:n,lastReloadTime:f});return p||function(e){var t=e.measures,n=e.layout,i=e.masterItem,r=e.isFirstTime;return!!Array.isArray(t)&&(r||i||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then((function(e){var i=t()(!0,{},e);Be(i);var r=Qe(i);return Ge({model:n}).then((function(t){return Xe({libraryIds:r,model:n}).then((function(r){return p&&function(e){var t=e.properties;Fe(t).forEach((function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,i=t.qDef.modifiers;Array.isArray(i)&&i.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var i=Ne[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==i&&$e(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(i)&&(t.qDef.base.qDef=i)}}))}}({measure:e,properties:t})}))}({properties:i}),Oe({model:n,oldProperties:e,properties:i,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:r,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ce(e.base)}))}(d)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,i=e.properties,r=Qe(i);return et({model:n,libraryIds:r}).then((function(){var e=t()(!0,{},i);return Fe(i).forEach((function(e){return Pe(e)})),Ze({oldProperties:e,newProperties:i,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Oe(e){var n=e.model,i=e.oldProperties,r=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,h=e.dimensionAndFieldList;void 0===i&&(i=l?t()(!0,{},r):r),Be(r);var d=Qe(r);return et({model:n,libraryIds:d,masterItem:c}).then((function(){return function(e){var n=e.measures,i=e.properties,r=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(i)),!n.length)return Promise.resolve();if(!Le({measures:n,properties:i}))return n.forEach((function(e){return Pe(e)})),Promise.resolve();var l=a?void 0:Qe(i);return Ge({model:r,dimensionAndFieldList:s}).then((function(e){return Xe({libraryIds:l,model:r,libraryItemsProps:a}).then((function(r){n.forEach((function(n){Ye({modifiers:n.qDef.modifiers,properties:i})?(function(e){var n=e.measure,i=e.properties,r=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===Ce(e)&&!e.disabled){if(s++,"object"!==Ce(Ne[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ne[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ne[i.type].generateExpression({expression:s,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=l,n.qDef.qDef=i.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:i,libraryItemsProps:r,dimensionAndFieldList:a}):function(e){var n=e.measure,i=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ne[i.type].updateModifier&&Ne[i.type].updateModifier(i,r.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Ne[i.type].generateExpression({expression:a,modifier:i,properties:r,dimensionAndFieldList:o});i.outputExpression=s,n.qDef.qDef=i.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,i.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:i,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||ze(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ze(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:i,libraryItemsProps:r,dimensionAndFieldList:e}),He(n)):Pe(n)}))}))}))}({measures:a,properties:r,model:n,libraryItemsProps:u,dimensionAndFieldList:h}).then((function(){return l?Ze({oldProperties:i,newProperties:r,model:n}):Promise.resolve(!1)}))}))}function Pe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&!Ne[e.type]}))}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,He(e)}function Le(e){var t=e.measures,n=e.properties,i=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ye({modifiers:je(e),properties:n,layout:i})}))}function Te(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var i=t[n];if(Ne[i.type]&&!i.disabled)return i}}function ze(e){var t=Te(e);return!t||Ne[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){Fe(e).forEach((function(e){return function(e){var n=Te(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function He(e){var t=je(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ce(t)&&(t.disabled||!Ne[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,i=e.layout;return!We(t)&&Ye({modifiers:je(t),properties:n,layout:i})}function Ye(e){var t=e.modifiers,n=e.properties,i=e.layout,r={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ce(e)||e.disabled||!Ne[e.type])&&(void 0===r[e.type]&&(r[e.type]=Ne[e.type].isApplicable({properties:n,layout:i})),r[e.type])}))}function Ge(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var i=[],r={},o=t.app.getDimensionList().then((function(e){r.dimensionList=e}));i.push(o);var a=t.app.getFieldList().then((function(e){r.fieldList=e}));return i.push(a),Promise.all(i).then((function(){return r}))}function Xe(e){var t=e.libraryIds,n=e.model,i=e.libraryItemsProps;if(i)return Promise.resolve(i);var r=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return r.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Ke(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,i=e.model,r=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ke)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ke)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ke)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ke);return r?function(e){var t=e.model,n=e.oldProperties,i=e.newProperties,r=t.layout;return r&&!r.qHasSoftPatches&&!r.qExtendsId&&o(r,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(i):O(t,n,i)}({model:i,oldProperties:t,newProperties:n}).then((function(){return r})):Promise.resolve(r)}function Je(e){var t=e.modifiers,n=e.properties,i=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ce(e)&&!e.disabled&&Ne[e.type]&&Ne[e.type].needDimension({modifier:e,properties:n,layout:i})}))}function Qe(e){var t=Fe(e),n=[],i=[],r=!1;return t.forEach((function(t){var i=je(t);if(Ye({modifiers:i,properties:e})){var o=We(t);o&&n.push(o),r=r||Je({modifiers:i,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&i.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:i}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Re[t.id].masterItemSubscriber=Re[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,i={},r={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(i[t]){var r=l(e);i[t].properties!==r&&(i[t].properties=r,"function"==typeof n&&i[t].enabled&&n(e)),i[t].enabled=!0}}function u(e,n){return t.app[n](e).then((function(t){i[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;r={},e.measureLibraryIds.forEach((function(e){r[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(i).forEach((function(e){r[e]||a[e]||(i[e].listener.dispose(),delete i[e])})),t.app&&(Object.keys(r).forEach((function(e){r[e]&&!i[e]&&s.push(u(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!i[e]&&s.push(u(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(i).forEach((function(e){i[e].listener.dispose()})),i={}}}}({model:t,callback:function(e){return Ie({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Re[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=r.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return(()=>{function e(t){var n,i=t;return i>9?(n=65+i-10)>90&&(n+=6):i="".concat(i).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(i+1):String.fromCharCode(n)}function t(n){var i=e(n%62),r=Math.floor(n/62);return r>0?t(r)+i:i}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(i,{default:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var i=t.split("."),r=e,o=0;o<i.length;++o){var a=i[o];if(""!==a){if(void 0===r[a]||null===r[a])return n;r=r[a]}}return r},setValue:function(e,t,n){if(null!=e&&null!=t){for(var i=t.split("."),r=i[i.length-1],o=e,a=0;a<i.length-1;++a){var s=i[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+i[a+1])?{}:[]),o=o[s]}void 0!==n?o[r]=n:delete o[r]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(r(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function u(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return i;return-1}return-1}const h={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var i=0;i<t.length;i++){var r=e.indexOf(t[i]);if(n>r)return!1;n=r}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,i=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(i=n);return e.splice(i,1),i},findItemByPropertyValue:function(e,t,n){if(e){for(var i=0;i<e.length;i++)if(e[i][t]===n)return e[i];return null}return null},findIndexByPropertyValue:u};var d=n(645),f=n.n(d);const p=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.dimensions).push.apply(t,a(i.qDimensions));var s,l=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=r.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,i=e.qHyperCubeDef,r=n.data[0];(t=r.measures).push.apply(t,l(i.qMeasures));var a,s=o.getValue(i,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=r.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,i=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),i.interColumnSortOrder=n.qInterColumnSortOrder.concat();var r=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");r&&h.isOrderedSubset(r,i.interColumnSortOrder)&&(i.interColumnSortOrder=r.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},x=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach((function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function b(e,t,n){var i,r,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((r=(r=(i=JSON.stringify(a)).match(/:\{/g))?r.length:0)>2)return;a=JSON.parse(i)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var w=n(229),M=n.n(w);function k(e,t){var n=M()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function S(e,t){return M()(!0,{},t,e)}function _(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}const C=function(e,t,n){var i="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",i),e.visualization=n.visualization},N=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},E=function(e,t,n,i){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=i},R=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},I=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,i=e.maxDimensions,r=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=k(s.dimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=k(s.excludedDimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},P=function(e){var t,n=e.exportFormat,i=e.maxMeasures,r=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=S(s.measures[t],a);o.qMeasures.length<i?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=S(s.excludedMeasures[t],a);o.qMeasures.length<r?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},L=function(e){var t=e.exportFormat,n=e.dataDefinition,i=void 0===n?{}:n,r=t.data[0],o=i.dimensions||{max:0},a=i.measures||{max:0},s=_(a.max,r.dimensions.length,q),l=_(a.min,r.dimensions.length,0);return{maxDimensions:_(o.max,s,q),minDimensions:_(o.min,l,0),maxMeasures:s,minMeasures:l}},T=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,i=t.data[0],r=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=i.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==r)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=i.interColumnSortOrder.concat());o!==r;)o<r?(h.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,h.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,i=e.hypercubePath,r={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(r.qLayoutExclude.quarantine=M()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&i?o.setValue(r,"".concat(i,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?r[e]=t.properties[e]:r.qLayoutExclude.disabled[e]=t.properties[e]})),null===(r=M()(!0,{},n,r)).components&&(r.components=[]),r},F=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>r&&r>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>i||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!r&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,i=e.minDimensions,r=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>i)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>r&&r>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!r&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},V=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.dimensions&&"function"==typeof i.dimensions.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return D(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),i.dimensions.added(e,n)}))}},B=function(e){var t,n=e.newProperties,i=e.dataDefinition,r=e.hypercubePath;if(i.measures&&"function"==typeof i.measures.added){var a=o.getValue(n,r||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return A(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),i.measures.added(e,n)}))}},H=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p({exportFormat:r,qHyperCubeDef:l}),m({exportFormat:r,qHyperCubeDef:l}),g({exportFormat:r,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:r,properties:a}),n&&(r.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),x({exportFormat:r,properties:a}),i||v(r.properties.qHyperCubeDef.qMeasures),Array.isArray(r.properties.filters)&&(b(r.properties,"filters","storedFilters"),delete r.properties.filters),r.properties.qHyperCubeDef.qContextSetExpression&&(b(r.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),r.properties.qHyperCubeDef.qContextSetExpression=""),r.properties.qHyperCubeDef.qDynamicScript&&r.properties.qHyperCubeDef.qDynamicScript.length&&(b(r.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),r.properties.qHyperCubeDef.qDynamicScript=[]),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=void 0===n?{}:n,r=e.dataDefinition,a=void 0===r?{}:r,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,h=e.supportedFilters,d=void 0===h||h,f=e.isHCModifierSupported,p=void 0===f||f,m={qChildren:[]},g=z({exportFormat:t,initialProperties:i,hypercubePath:c}),y=o.getValue(i,c||"").qHyperCubeDef,x=o.getValue(g,c||"").qHyperCubeDef,v=L({exportFormat:t,dataDefinition:a}),b=v.maxDimensions,w=v.minDimensions,M=v.maxMeasures,k=v.minMeasures,S=l.defaultDimension,_=void 0===S?R():S,q=l.defaultMeasure,D=void 0===q?I():q;x.qDimensions.length=0,x.qMeasures.length=0,F({exportFormat:t,maxDimensions:b,minDimensions:w,maxMeasures:M,minMeasures:k})&&j({exportFormat:t,maxDimensions:b,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:x}),O({exportFormat:t,maxDimensions:b,minDimensions:w,newHyperCubeDef:x,defaultDimension:_}),P({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:x,defaultMeasure:D}),V({newProperties:g,dataDefinition:a,hypercubePath:c}),B({newProperties:g,dataDefinition:a,hypercubePath:c}),T({exportFormat:t,newHyperCubeDef:x}),N("qMaxStackedCells",y,x),N("qNoOfLeftDims",y,x),E("qInitialDataFetch",y,x,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),E("qMode",y,x,"S"),E("qReductionMode",y,x,"N"),E("qSortbyYValue",y,x),E("qIndentMode",y,x),E("qShowTotalsAbove",y,x),C(g,t,i),m.qProperty=g;var A=o.getValue(u||{},"support.modifiers");return H({measures:x.qMeasures,modifierTypes:A}),d&&$(m.qProperty,"storedFilters"),"S"===x.qMode&&p&&$(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,i){t=t||[];var r=u(e,i,n),o=u(t,i,n);if(-1!==r&&-1===o){var a=e.splice(r,1);t.push(a[0])}return t}function G(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,i,r){n=n||"qAttributeExpressions",r=r||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,i,r),G(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},K={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>0&&K.getNumMeasures(e)<=1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)>0},expression:function(e){return K.getNumMeasures(e)>=1}}},J={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumMeasures(e)>=1}}};var Q={scatterplot:J,"sn-scatter-plot":J,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)<=1},expression:function(e){return K.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return K.getNumDimensions(e)>=1},multiColor:function(e){return K.getNumMeasures(e)>1},measure:function(e){return K.getNumDimensions(e)>=1},expression:function(e){return K.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return K.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var i=h.findIndexByPropertyValue(e[t],"id",n);i>=0&&e[t].splice(i,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function ie(e){var t=e.properties,n=e.isDimension,i=e.dimensions,r=e.excludedDimensions,a=e.measures,s=e.label;te(i,r);var l=i[i.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,i=e.item,r=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||i.label,r?t.qDef=i.key:(t.qExpression=i.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=i.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,i=e.item,r=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=h.findIndexByPropertyValue(n,"qLibraryId",i.key),r&&(t.qNumFormat=r,t.isCustomFormatted=o)),void 0!==i.expression?t.qExpression=i.expression:t.qLibraryId=i.key,t.colorMapRef=i.key}({attributeExpression:f,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function re(e,t,n,i){var r,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":r=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),r?(s.type="measure",s.name=r,s.id=r,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,i),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,i){var r=n?"expression":t.type,o=e.color,a=o.mode,s=K.getItemLabel(t);switch(ne(e,s||""),r){case"field":a="byDimension",o.byDimDef={label:t.label||K.wrapFieldName(t.name),key:K.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:n||s,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}i||(o.auto=!1,o.mode=a)}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"color.byDimDef");i.activeDimensionIndex=Math.min(i.activeDimensionIndex,n.length-1);var r=re("dimension",!1,n[i.activeDimensionIndex]);r.activeDimensionIndex=i.activeDimensionIndex,ae(e,r)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=n[function(e,t,n){var i=o.getValue(t,"visualization"),r=n.split("."),a=Number(r[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===i&&"point"===s}(n,e,t)?0:n.length-1],r=X.IDMAP.COLOR_BY_ALTERNATIVE,a=h.findItemByPropertyValue(i.qAttributeDimensions,"id",r);return ae(e,re("dimension",!!a,a||i)),!!a}(e,t))return;ie({properties:e,isDimension:!0,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var i=e.qLayoutExclude;i&&(i.changed||(i.changed={}),i.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var i=(Q[t]||Z).colorModeOptions||Z.colorModeOptions;n.byDimension=i.dimension(e),n.byMeasure=i.measure(e),n.byMultiple=i.multiColor(e),n.byExpression=i.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,i=e.colorMode,r=e.dimensions;return!(t[i]&&!n&&("byDimension"!==i&&"byMeasure"!==i||!r.length))},he=function(e,t){var n,i=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?te(a,l):!(n={auto:r,colorMode:i,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,i=e.dimensions,r=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!i.length||"map"!==s&&!r.length)}({auto:r,colorMode:i,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"color.byMeasureDef");if(i.activeMeasureIndex=Math.min(i.activeMeasureIndex,n.length-1),i.activeMeasureIndex>-1){var r=re("measure",!1,n[i.activeMeasureIndex],!0);r.activeMeasureIndex=i.activeMeasureIndex,ae(e,r)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,i)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),r=n[n.length-1],a=X.IDMAP.COLOR_BY_ALTERNATIVE,s=h.findItemByPropertyValue(r.qAttributeExpressions,"id",a);return ae(e,re("measure",!!s,s||i[0])),!!s}(e,t))return;ie({properties:e,isDimension:!1,dimensions:n,excludedDimensions:r,measures:i,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&r.length<2&&o.setValue(e,"color.mode","primary"),te(i,a)}(e,t)},de=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,i=o.getValue(n,"qHyperCubeDef.qMeasures",[]),r=o.getValue(n,"color.mode","");return!t&&"byExpression"===r&&i.length>0},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),o=r.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(a,[],"qAttributeDimensions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",u),r},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty,d=o.getValue(h,"visualization"),f=o.getValue(h,"qHyperCubeDef.qDimensions",[]),p=o.getValue(h,"color.mode",""),m=o.getValue(h,"color.auto",""),g=ce(h,d),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:f});return g[p]?fe({shouldUpdateColorBy:y,properties:h})&&pe(h):me(h),y&&he(h,"qHyperCubeDef."),ge(h)&&le(h,"color.persistent",!0),de(f),u}};var xe=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},be=function(e){var t,n=e.exportFormat,i=e.initialProperties,r=e.properties,o=e.measureType,a=r.qHyperCubeDef,s=r.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:i})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,i=n.type,r=n.axis;t[r]||(t[r]={axis:r,type:{line:0,marker:0,bar:0,total:0}}),xe.includes(i)&&t[r].type[i]++,t[r].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&M()(s,n.properties.measureAxes[t[0].axis])):M()(s,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,i=e.viewDataMode,r=e.supportedAutoMinMax,o=void 0===r||r,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:i}),s=a.properties;return o?(b(s,"measureAxis.min","supportedAutoMinMax"),b(s,"measureAxis.max","supportedAutoMinMax")):(b(s,"measureAxis.min","unsupportedAutoMinMax"),b(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,i=e.dataDefinition,r=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:i,defaultPropertyValues:r,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),h=u.qProperty;return ve({initialProperties:n,properties:h}),be({exportFormat:t,initialProperties:n,properties:h,measureType:a}),we(h.qHyperCubeDef),h.qHyperCubeDef.qColumnOrder=[],h.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Se(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,a);if(void 0!==s){var l=o.getValue(r,"qDef.cId");l||(l=o.generateId(),o.setValue(r,"qDef.cId",l));var c=ke(n,i,l);o.setValue(t,c,s),o.setValue(r,a,void 0)}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}function _e(e){var t=e.properties,n=e.arrayPath,i=e.quarantineName,r=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,i=e.arrayName,r=e.item,a=e.itemPath,s=o.getValue(r,"qDef.cId");if(s){var l=ke(n,i,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(r,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:i,arrayName:r,item:e,itemPath:a})}))}var qe="qHyperCubeDef.qMeasures",De="conditionalColoring",Ae="measures",Ce="qDef.conditionalColoring";const Ne={quarantine:function(e){Se({properties:e,arrayPath:qe,quarantineName:De,arrayName:Ae,itemPath:Ce})},unquarantine:function(e){_e({properties:e,arrayPath:qe,itemPath:Ce,arrayName:Ae,quarantineName:De})}};var Ee="qHyperCubeDef.qMeasures",Re="measures",Ie="qHyperCubeDef.qDimensions",Oe="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Le="alternativeMeasures",Te="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const Ve={quarantine:function(e){Se({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Re,itemPath:Fe}),Se({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},unquarantine:function(e){_e({properties:e,arrayPath:Ee,quarantineName:je,arrayName:Re,itemPath:Fe}),_e({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},quarantineAlternative:function(e){Se({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Le,itemPath:Fe}),Se({properties:e,arrayPath:Te,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){_e({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Le,itemPath:Fe}),_e({properties:e,arrayPath:Te,quarantineName:je,arrayName:ze,itemPath:Fe})}},Be={hypercube:W,colorChart:ye,axisChart:Me,quarantineProperty:b,unquarantineProperty:$,quarantineArrayProp:Se,unquarantineArrayProp:_e,conditionalColoring:Ne,conditionalShow:Ve}})(),i.default})()}(Lt)),Lt.exports),zt=Ot(Tt);function Ft(e){return{dimensions:{min:0,max:0},measures:{min:1,max:1,description:()=>e.translator.get("Visualizations.Descriptions.Gauge.Measure")}}}const jt=(e,t,n)=>{const i=function(e){var t=e.theme,n=e.translator,i=e.config,r=void 0===i?{}:i,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,i=n.id,r=n.paths;return{id:void 0===i?"object":"".concat("object",".").concat(i),paths:Array.isArray(r)?r:[]}}({config:r}),s=a.id,l=a.paths,c={};l.forEach((function(e){for(var i=e.split("."),r=c,a=0;a<i.length;a++){var l=i[a];a===i.length-1?r[l]=v({theme:t,translator:n,id:s,path:e,flags:o}):void 0===r[l]&&(r[l]={}),r=r[l]}}));var u=function(e){for(var t=e.split("."),n=c,i=0;i<t.length;i++){var r=t[i];if(void 0===n[r])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[r]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}({theme:n,translator:t,flags:e,config:{id:"gauge",paths:["axis.title","axis.label.name","label.value"]}});return{component:"styling-panel",chartTitle:"Object.Gauge",translation:"LayerStyleEditor.component.styling",useBackground:!0,subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.title.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.title.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.title.fontFamily")},fontColor:{ref:"axis.title.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.title","color")}),width:!1}}}}}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"axis",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"axis.label.name.fontFamily",component:"dropdown",options:()=>i.getOptions("axis.label.name.fontFamily"),defaultValue:()=>i.getDefaultValue("axis.label.name.fontFamily"),width:!0},fontColor:{ref:"axis.label.name.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","axis.label.name","color")}),width:!1}}}}}}},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:{labelSection:{component:"items",ref:"components",key:"value",items:{fontWrapper:{component:"inline-wrapper",items:{fontFamily:{ref:"label.value.fontFamily",component:"dropdown",options:()=>i.getOptions("label.value.fontFamily"),defaultValue:()=>i.getDefaultValue("label.value.fontFamily"),width:!0},fontColor:{ref:"label.value.color",component:"color-picker",defaultValue:()=>({color:n.getStyle("object.gauge","label.value","color")}),width:!1}}}}}}}}}};let Vt;function Bt(e){return"measure"===ct(e,"color.useBaseColors")}function Ht(e){const{flags:t,translator:n,sense:i}=e,r=null==i?void 0:i.theme,o={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qMeasures)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,r){r.measureAxis.show=e?"labels":"all"}}}}}}};return{definition:{type:"items",component:"accordion",items:{data:{uses:"data"},addons:{type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},settings:{type:"items",uses:"settings",component:"expandable-items",translation:"Common.Appearance",items:{simpleLabels:o,presentation:{type:"items",grouped:!0,translation:"properties.presentation",items:{styleEditor:jt(t,n,r),rangeLimits:{type:"items",items:{text:{component:"text",translation:"properties.axis.rangeLimits",style:"sHeader"},min:{ref:"measureAxis.min",translation:"properties.axis.min",type:"number",expression:"optional",invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max},max:{ref:"measureAxis.max",translation:"Common.Max",type:"number",expression:"optional",defaultValue:100,invalid:e=>e.measureAxis&&e.measureAxis.min>=e.measureAxis.max}}},type:{ref:"gaugetype",type:"string",component:"item-selection-list",defaultValue:"radial",horizontal:!0,items:[{icon:"gauge_gauge",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.radial",value:"radial"},{icon:"gauge_vertical_bar",component:"icon-item",labelPlacement:"bottom",translation:"properties.gauge.bar",value:"bar"}],change(e){"radial"===e.gaugetype?(Vt=e.orientation,e.orientation="horizontal"):e.orientation=Vt}},autoOrientation:{ref:"autoOrientation",translation:"properties.orientation",type:"boolean",defaultValue:!0,component:"switch",undefinedValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}],show:e=>"bar"===e.gaugetype},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"horizontal",horizontal:!0,items:[{component:"icon-item",icon:"direction_up_down",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"direction_left_right",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:e=>"bar"===e.gaugetype&&!e.autoOrientation},angle:{ref:"angle",translation:"properties.gauge.angle",type:"number",component:"slider",min:.2,max:.98,step:.1,defaultValue:.7,show:()=>!1},segments:{type:"items",items:{useSegments:{ref:"useSegments",type:"boolean",component:"switch",defaultValue:!1,translation:"properties.gauge.useSegments",change(e){const t=(n=e.segmentInfo).paletteColors&&n.paletteColors.length?n.paletteColors:n.colors&&n.colors.length?n.colors:void 0;var n;t&&(e.useSegments&&1===t.length?e.segmentInfo.paletteColors=[e.paletteProgressColor||e.progressColor]:e.paletteProgressColor=t[0])},options:[{value:!1,translation:"properties.off"},{value:!0,translation:"properties.on"}]},useBaseColor:{ref:"color.useBaseColors",type:"string",defaultValue:"measure",translation:"properties.useLibraryMeasureColors",component:"switch",show:e=>(e.color||(e.color={}),e.color.useBaseColors||(e.color.useBaseColors="off"),!0),options:[{value:"off",translation:"properties.off"},{value:"measure",translation:"properties.on"}]},paletteProgressColor:{component:"color-picker",translation:"properties.color",ref:"paletteProgressColor",type:"object",dualOutput:!0,defaultValue:()=>{var e;if(!r)return-1;const{primary:t}=r.getDataColorSpecials(),n=null===(e=r.getDataColorPickerPalettes()[0])||void 0===e?void 0:e.colors,i=n.indexOf(t);return{index:-1===i?Math.min(6,n.length-1):i}},show:e=>!Bt(e)&&!e.useSegments},maxSegments:{ref:"maxSegments",type:"number",defaultValue:6,show:!1},segmentInfo:{ref:"segments",type:"items",component:"color-scale-creator",show:e=>!Bt(e)&&e.useSegments,items:{limits:{ref:"segmentInfo.limits",type:"array",items:{value:{ref:"value",type:"number",expression:"optional",invalid:(e,t)=>"number"==typeof e.value&&(e.value<t.measureAxis.min||e.value>t.measureAxis.max),defaultValue:1},gradient:{translation:"properties.gradient",ref:"gradient",type:"boolean",show:!1}}},paletteColors:{items:{color:{ref:"color",type:"string"},index:{ref:"index",type:"integer",defaultValue:6}},type:"array",ref:"segmentInfo.paletteColors"}}}}},disclaimerClosed:{ref:"disclaimerClosed",type:"boolean",defaultValue:!1,show:!1}}},measureAxis:{type:"items",translation:"properties.measureAxis",grouped:!0,items:{axis:{type:"items",snapshot:{title:"properties.measureAxis",tid:"property-yAxis"},items:{show:{ref:"measureAxis.show",translation:"properties.axis.labelsAndTitle",type:"string",component:"dropdown",options:[{value:"all",translation:"properties.axis.show.all"},{value:"labels",translation:"properties.axis.show.labels"},{value:"title",translation:"properties.axis.show.title"},{value:"none",translation:"Common.None"}],defaultValue:"all"},spacing:{ref:"measureAxis.spacing",translation:"properties.axis.scale",type:"number",component:"dropdown",defaultValue:1,show:e=>e.measureAxis&&"none"!==e.measureAxis.show&&"title"!==e.measureAxis.show,options:[{value:2,translation:"properties.gridLine.wide"},{value:1,translation:"properties.gridLine.medium"},{value:.5,translation:"properties.gridLine.narrow"}]}}}}}}}}},support:{cssScaling:!1,snapshot:!0,export:!0,sharing:!0,exportData:!0,viewData:!0},importProperties:(t,n,i,r)=>zt.axisChart.importProperties({exportFormat:t,initialProperties:n,hypercubePath:r,extension:i,dataDefinition:Ft(e)}),exportProperties:(e,t,n)=>zt.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n,supportedAutoMinMax:!1})}}function $t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Ut(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wt(Object(n),!0).forEach((function(t){$t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Yt=Object.prototype.hasOwnProperty,Gt=Object.prototype.toString,Xt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor,Zt=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Gt.call(e)},Jt=function(e){if(!e||"[object Object]"!==Gt.call(e))return!1;var t,n=Yt.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Yt.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Yt.call(e,t)},Qt=function(e,t){Xt&&"__proto__"===t.name?Xt(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},en=function(e,t){if("__proto__"===t){if(!Yt.call(e,t))return;if(Kt)return Kt(e,t).value}return e[t]},tn=function e(){var t,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=en(s,n),s!==(r=en(t,n))&&(u&&r&&(Jt(r)||(o=Zt(r)))?(o?(o=!1,a=i&&Zt(i)?i:[]):a=i&&Jt(i)?i:{},Qt(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&Qt(s,{name:n,newValue:r}));return s};function nn(e,t,n,i){if(!e)return-1;const r=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=r.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<r.wrappedFields.length;t++)if(l=r.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=r.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(i)&&i.some(((e,t)=>e!==t))){const e=i.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function rn(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function on(e){let{cache:t,f:n,mainCell:i,p:r,prop:o,page:a,rowIdx:s,row:l,sourceKey:c,target:u,targetProp:h,columnOrder:d}=e,f=i;if(r.field&&r.field!==n){const e=nn(r.field,a,{cache:t},d);if(-1===e)return;f=tn({qRow:s},e(l))}u[h]=rn(r,f,{key:c})}function an(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<r.length;e++)if(void 0!==r[e].field){const a=t.raw(),s=t.key(),l="object"==typeof r[e].field?r[e].field:t.field(r[e].field),{props:c,main:u}=i.normalizeConfig(r[e],t),h=Object.keys(c),d=!!r[e].trackBy,f=typeof r[e].trackBy,p={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=nn(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const x=a.qDataPages[t].qArea.qTop+y,v=tn({qRow:x},o(a.qDataPages[t].qMatrix[y])),b=rn(u,v,{key:s});if(!(u.filter&&!u.filter(v))){for(let e=0;e<h.length;e++){const i=c[h[e]];let r=i.fields||[i];i.fields&&(b[h[e]]=[]);for(let o=0;o<r.length;o++)on({cache:n,f:l,mainCell:v,p:r[o],prop:h[e],props:c,page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:i.fields?b[h[e]]:b,targetProp:i.fields?o:h[e],columnOrder:a.qColumnOrder});if(i.fields){const t=b[h[e]].map((e=>e.value)),n=b[h[e]].map((e=>e.label));b[h[e]]={value:"function"==typeof i.value?i.value(t):void 0!==i.value?i.value:t,label:"function"==typeof i.label?i.label(n):void 0!==i.label?String(i.label):String(b[h[e]].value)}}}d&&i.track({cfg:r[e],itemData:v,obj:b,target:m,tracker:p,trackType:f}),g.push(b)}}}const y=d?i.collect(m,{main:u,propsArr:h,props:c}):g;o=[...o,...y]}return o}function sn(e){var t=0,n=e.children,i=n&&n.length;if(i)for(;--i>=0;)t+=n[i].value;else t=1;e.value=t}function ln(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=un)):void 0===t&&(t=cn);for(var n,i,r,o,a,s=new fn(e),l=[s];n=l.pop();)if((r=t(n.data))&&(a=(r=Array.from(r)).length))for(n.children=r,o=a-1;o>=0;--o)l.push(i=r[o]=new fn(r[o])),i.parent=n,i.depth=n.depth+1;return s.eachBefore(dn)}function cn(e){return e.children}function un(e){return Array.isArray(e)?e[1]:null}function hn(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function dn(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function fn(e){this.data=e,this.depth=this.height=0,this.parent=null}function pn(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}fn.prototype=ln.prototype={constructor:fn,count:function(){return this.eachAfter(sn)},each:function(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this},eachAfter:function(e,t){for(var n,i,r,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(i=0,r=n.length;i<r;++i)a.push(n[i]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,i,r=this,o=[r],a=-1;r=o.pop();)if(e.call(t,r,++a,this),n=r.children)for(i=n.length-1;i>=0;--i)o.push(n[i]);return this},find:function(e,t){let n=-1;for(const i of this)if(e.call(t,i,++n,this))return i},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,i=t.children,r=i&&i.length;--r>=0;)n+=i[r].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;e=n.pop(),t=i.pop();for(;e===t;)r=e,e=n.pop(),t=i.pop();return r}(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return ln(this).eachBefore(hn)},[Symbol.iterator]:function*(){var e,t,n,i,r=this,o=[r];do{for(e=o.reverse(),o=[];r=e.pop();)if(yield r,t=r.children)for(n=0,i=t.length;n<i;++n)o.push(t[n])}while(o.length)}};var mn={depth:-1},gn={},yn={};function xn(e){return e.id}function vn(e){return e.parentId}function bn(){var e,t=xn,n=vn;function i(i){var r,o,a,s,l,c,u,h,d=Array.from(i),f=t,p=n,m=new Map;if(null!=e){const t=d.map(((t,n)=>function(e){e=`${e}`;let t=e.length;Mn(e,t-1)&&!Mn(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,i)))),n=t.map(wn),r=new Set(t).add("");for(const e of n)r.has(e)||(r.add(e),t.push(e),n.push(wn(e)),d.push(yn));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,r=d.length;a<r;++a)o=d[a],c=d[a]=new fn(o),null!=(u=f(o,a,i))&&(u+="")&&(h=c.id=u,m.set(h,m.has(h)?gn:c)),null!=(u=p(o,a,i))&&(u+="")&&(c.parent=u);for(a=0;a<r;++a)if(u=(c=d[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===gn)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===yn&&1===s.children.length;)s=s.children[0],--r;for(let e=d.length-1;e>=0&&(c=d[e]).data===yn;--e)c.data=null}if(s.parent=mn,s.eachBefore((function(e){e.depth=e.parent.depth+1,--r})).eachBefore(dn),s.parent=null,r>0)throw new Error("cycle");return s}return i.id=function(e){return arguments.length?(t=pn(e),i):t},i.parentId=function(e){return arguments.length?(n=pn(e),i):n},i.path=function(t){return arguments.length?(e=pn(t),i):e},i}function wn(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Mn(e,t););return e.slice(0,t)}function Mn(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function kn(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let i,r=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(r)){const t=[];i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++){let n=kn(i,r[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(r)){const t=new Array(r.length);i=n.slice(e+1).join("/");for(let e=0;e<r.length;e++)t[e]=kn(i,r[e]);return t}n[e]in r&&(r=r[n[e]])}return r}function Sn(e,t,n){let i=[];if(!e||!e.length)return i;if(t<=0){const t=n>=0?[e[n]]:e;i=[...i,...t]}else for(let r=0;r<e.length;r++)e[r].children&&e[r].children.length&&(i=[...i,...Sn(e[r].children,t-1,n)]);return i}function _n(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const i=Math.max(0,Math.min(100,t-e));return e=>Sn(e.children,i-1,n)}return!1}const qn=/^qDimensionInfo(?:\/(\d+))?/,Dn=/^\/?qMeasureInfo\/(\d+)/,An=/\/qAttrExprInfo\/(\d+)/,Cn=/\/qAttrDimInfo\/(\d+)/;function Nn(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function En(e,t){let{cube:n}=t;if(!e)return-1;let i=e.origin&&e.origin()?e.origin().key():e.key(),r=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,h=i;const d=n.qEffectiveInterColumnSortOrder,f=Nn(n);return qn.test(h)&&(r=!0,o=+qn.exec(h)[1],h=i.replace(qn,"")),Dn.test(h)&&("K"===n.qMode?c=+Dn.exec(h)[1]:d&&-1!==d.indexOf(-1)?(c=+Dn.exec(h)[1],u=0):u=+Dn.exec(h)[1],h=h.replace(Dn,"")),h&&(Cn.exec(h)?s=+Cn.exec(h)[1]:An.exec(h)&&(a=+An.exec(h)[1])),l=r?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function Rn(e,t){let n,i,r=_n(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?i=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(i=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:r,attrFn:i,valueFn:n}}function In(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}function On(e){let{propsArr:t,props:n,item:i,itemData:r,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const h=l[n];let d,f,p,m,g,y;if("primitive"===h.type?(p=h.value,y=String(h.value)):("function"==typeof h.value&&(d=e=>h.value(e,i)),"function"==typeof h.label&&(f=e=>h.label(e,i)),h.accessor?(m=h.accessor(i),Array.isArray(m)?(g=m.map(h.valueAccessor),h.attrAccessor&&(g=g.map(h.attrAccessor)),d&&(p=g.map(d),d=null),f&&(y=g.map(f),f=null),p=h.reduce?h.reduce(p):p,y=h.reduceLabel?h.reduceLabel(y,p):String(p)):(p=h.attrAccessor?h.attrAccessor(h.valueAccessor(m)):h.valueAccessor(m),y=p)):(p=r,y=r)),s.fields){const e=d?d(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},h.field&&(o[t[e]].source={field:h.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,i):c,label:"function"==typeof s.label?s.label(u,i):u})}}const Pn=(e,t,n)=>{const i="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",r="K"===e.qMode?"qSubNodes":"qNodes",o=kn(i,e);return o&&o[0]?(t.tree=ln(o[0],n.children||(e=>e[r])),t.tree):null};const Ln=e=>{let{propsArr:t,props:n,cube:i,cache:r,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=Rn(o,En(t.field,{cube:i,cache:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function Tn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const r=t.raw(),o=t.key(),a="S"===r.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}(e),i=e.fields(),r=e.fields().filter((e=>"dimension"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),o=e.fields().filter((e=>"measure"===e.type())).map((e=>n.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let i="__root",l=!1;for(let e=0;e<r.length;e++){var s;const t=n[r[e]],o="".concat(i,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Ut({__id:o,__parent:i,qValues:[]},t),l=!0),i=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[i].qValues.push(t)}}const l=Object.keys(a).map((e=>a[e])),c=bn().id((e=>e.__id)).parentId((e=>e.__parent))(l);return c}(t):Pn(r,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===r.qMode){let e=Nn(r)[o-1];a=n.fields[e]}else{let e=r.qEffectiveInterColumnSortOrder[o-1];o>r.qEffectiveInterColumnSortOrder.length&&(e=r.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=i.normalizeConfig(Ut(Ut({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const h=a?En(a,{cube:r,cache:n}):{fieldDepth:0};Ln({propsArr:u,props:s,cube:r,cache:n,itemDepthObject:h,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,i=l[u[e].depth].main,r=c[e],a=r.data,s=In(i,a,{key:o});On({propsArr:t,props:n,item:r,itemData:a,ret:s,sourceKey:o,isTree:!0}),u[e].data=s}return a}function zn(e,t,n,i){const r=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<r.length;a++)if(void 0!==r[a].field){const s=t.raw(),l=t.key();if(!Pn(s,n,e))continue;const c="object"==typeof r[a].field?r[a].field:t.field(r[a].field),{props:u,main:h}=i.normalizeConfig(r[a],t),d=Object.keys(u),f=En(c,{cube:s,cache:n}),{nodeFn:p,attrFn:m,valueFn:g}=Rn({fieldDepth:0},f);Ln({propsArr:d,props:u,cube:s,cache:n,itemDepthObject:f,f:c});const y=!!r[a].trackBy,x=typeof r[a].trackBy,v={},b=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(h.filter&&!h.filter(n))continue;const o=In(h,n,{key:l});On({propsArr:d,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&i.track({cfg:r[a],itemData:n,obj:o,target:b,tracker:v,trackType:x}),M.push(o)}const k=y?i.collect(b,{main:h,propsArr:d,props:u}):M;o=[...o,...k]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Fn=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){
10
10
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
11
- t.exports=function(t,e){if(!t||isNaN(+e))return e;var n,i,r,o,a,s,l,c,u,h,d=t.length,f=t.search(/[0-9\-\+#]/),p=f>0?t.substring(0,f):"",g=t.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=d-m,x=t.substring(y,y+1),v=y+("."===x||","===x?1:0),b=m>0?t.substring(v,d):"";if(n=(e="-"===(t=t.substring(f,v)).charAt(0)?-e:+e)<0?e=-e:0,r=(i=t.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",t=t.split(r),e=+(e=e.toFixed(t[1]&&t[1].length))+"",s=t[1]&&t[1].lastIndexOf("0"),(!(c=e.split("."))[1]||c[1]&&c[1].length<=s)&&(e=(+e).toFixed(s+1)),u=t[0].split(o),t[0]=u.join(""),(a=t[0]&&t[0].indexOf("0"))>-1)for(;c[0].length<t[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((e=e.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(g="",y=(h=e[0]).length%l,d=h.length,v=0;v<d;v++)g+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(g+=o);e[0]=g}return e[1]=t[1]&&e[1]?r+e[1]:"","0"!==(i=e.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}}));function En(t){return t.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const zn={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},In=/%\)?$/,Tn=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Pn=/^\(oct\)/i,qn=/^\(dec\)/i,Ln=/^\(hex\)/i,jn=/^\(bin\)/i,Fn=/^\(rom\)/i,Bn=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Vn=/#|0/g;function $n(t,e,n,i){return t=t.toString(e),n[1]===n[1].toUpperCase()&&(t=t.toUpperCase()),t.length-t.indexOf(".")>10&&(t=t.slice(0,t.indexOf(".")+11)),t.replace(".",i||".")}function Hn(t,e,n){let i;return Tn.test(e)?t=$n(t,Number(/\d{2}/.exec(e)[0]),e,n):Pn.test(e)?t=$n(t,8,e,n):qn.test(e)?t=$n(t,10,e,n):Ln.test(e)?t=$n(t,16,e,n):jn.test(e)?t=$n(t,2,e,n):Fn.test(e)&&(i="",t<0&&(i="-",t=-t),0===(t=Math.floor(t))?t="0":t<=5e5?(t=function(t,e){let n,i="",r=Number(String(t).slice(-3)),o=(t-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return e[1]!==e[1].toUpperCase()&&(i=i.toLowerCase()),i}(t,e),t=i+t):t=e+i+t.toExponential(0)),t}function Wn(t,e,n){const i=En(t);return n?i:new RegExp(i||"",e)}function Un(t,e,n,i){let r,o,a,s,l,c,u,h,d,f=t.pattern;var p,g;i&&(t.abbreviate=!0),p=e,(g=n)&&(g=En(g)),p&&(p=En(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(g,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),e&&e===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,e=""),c=e,e=/,/.test(n)?"¤":",",c&&(a=a.replace(Wn(c,"g"),e)),u=n,n=".",u&&(a=a.replace(Wn(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const m=f.split(u);let y;m[1]&&(y=m[1].match(Vn)),t.prefix=s||"",t.postfix=l||"",t.pattern=f,t.maxPrecision=y?y.length:2,t.percentage=In.test(f),t.numericPattern=a||"",t.numericRegex=new RegExp("".concat(Wn(e,null,!0),"|").concat(Wn(n,null,!0)),"g"),t.groupTemp=c,t.decTemp=u,t.t=e,t.d=n,t.temp=h}class Yn{constructor(t,e,n,i,r){this.localeInfo=t,this.pattern=e,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(t,e){if(!t||!t.qNumericalAbbreviation)return zn;const n={};return t.qNumericalAbbreviation.split(e).forEach((t=>{let e=t.split(":");2===e.length&&(n[e[0]]=e[1])})),n}(t,this.patternSeparator),this.prepare()}clone(){const t=new Yn(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return t.subtype=this.subtype,t}format(t,e,n,i){return this.prepare(e,n,i),this.formatValue(t)}prepare(t,e,n){let i;if(void 0===t&&(t=this.pattern),void 0===e&&(e=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!t)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:e,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,t=t.split(this.patternSeparator),i.positive.pattern=t[0],i.negative.pattern=t[1],i.zero.pattern=t[2],Bn.test(t[0])&&(i.positive.isFunctional=!0),t[1]?Bn.test(t[1])&&(i.negative.isFunctional=!0):i.negative=!1,t[2]?Bn.test(t[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||Un(i.positive,e,n,r),i.negative&&!i.negative.isFunctional&&Un(i.negative,e,n,r),i.zero&&!i.zero.isFunctional&&Un(i.zero,e,n,r)}formatValue(t){let e,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=t;if(isNaN(t))return"".concat(f);if(t=+t,!1===u.pattern)return t.toString();if(0===t&&u.zero)return u=u.zero,u.pattern;if(t<0&&u.negative?(u=u.negative,t=-t):u=u.positive,o=u.d,a=u.t,u.isFunctional)t=Hn(t,u.pattern,o);else{if(u.percentage&&(t*=100),u.abbreviate){const e=Object.keys(this.abbreviations).map((t=>parseInt(t,10))).sort(((t,e)=>t-e));let i,r,o=e[0];for(s=0,n=Number(Number(t).toExponential().split("e")[1]);o<=n&&s<e.length;)s++,o=e[s];s>0&&(i=e[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],t/=10**r)}if(i=Math.abs(t),e=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(t=Math.round(t)),r=t,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)t=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const e=Number((t+1e-15*(t<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,t=On(n,e)||"0",c){const e=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(e).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(t+=o+r)}else 0===e&&(r=0)}else if(i>=10**e||i<1||i<1e-4)0===t?t="0":i<1e-4||i>=1e20?(t=(t=r.toExponential(Math.max(1,Math.min(14,e))-1)).replace(/\.?0+(?=e)/,""),d=""):(t=t.toPrecision(Math.max(1,Math.min(14,e)))).indexOf(".")>=0&&(t=(t=t.replace(t.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,e=Math.max(0,Math.min(20,e-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<e;s++)l+="#";t=On(l,t)}t=t.replace(u.numericRegex,(t=>t===a?u.groupTemp:t===o?u.decTemp:"")),r<0&&!/^-/.test(t)&&(t="-".concat(t))}return u.prefix+t+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:t=>"".concat(t)}}}function Xn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=t=>t}=e;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return a=r(...arguments),o.has(a)?o.get(a):o.set(a,t(...arguments))}:e=>(a=r(e),o.has(a)?o.get(a):o.set(a,t(e))),o.set=(t,e)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[t]=e,l[c]=t,c++,e),o.get=t=>s[t],o.has=t=>t in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function Gn(t,e,n,i,r){const o=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Yn(...e)}(r,t,e,n,i),a=Xn(o.formatValue.bind(o),{toKey:t=>isNaN(t)?t:+t});function s(t){return a(t)}return s.format=function(t,e,n,i){return a.clear(),o.format(e,t,n,i)},s.pattern=function(t){return t&&(a.clear(),o.pattern=t,o.prepare()),o.pattern},s}const Kn="D",Zn="T",Jn="TS",Qn="IV",ti=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ei=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ni=["January","February","March","April","May","June","July","August","September","October","November","December"],ii=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ri(t,e){for(let n=t.length;n<e;n++)t="0".concat(t);return t}function oi(t){let e=t.toString().split(".");return e[1]?(e=Number("0.".concat(e[1])),e):0}function ai(t,e){let n,i=function(t){const e=t,n=24*oi(e),i=60*oi(n),r=60*oi(i),o=1e3*oi(r);return{d:Math.floor(e),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(t),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(e)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,Math.round(86400*(t-Math.floor(t))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(e)||(o+=24*r),/h+/gi.test(e)||(a+=60*o),/m+/gi.test(e)||(s+=60*a),/w+/gi.test(e)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}class si{constructor(t,e,n){const i=t||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:ti,qDayNames:ei,qLongMonthNames:ni,qMonthNames:ii}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!e){e={[Zn]:i.qTimeFmt||"hh:mm:ss",[Kn]:i.qDateFmt||"YYYY-MM-DD",[Jn]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=e}clone(){const t=new si(this.localeInfo,this.pattern);return t.subtype=this.subtype,t}format(t,e){e||(e=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),e=e.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(e);let i;t instanceof Date?i=function(t,e){let n=t.getUTCHours(),i=t.getUTCDay()-1;return e&&(n%=12,n||(n=12)),i<0&&(i=6),{year:t.getUTCFullYear(),month:t.getUTCMonth(),day:i,date:t.getUTCDate(),h:n,m:t.getUTCMinutes(),s:t.getUTCSeconds(),f:t.getUTCMilliseconds(),t:t.getUTCHours()>=12?"pm":"am"}}(t,n):(t<0&&(t=-t,e="-".concat(e)),i=ai(t,e));const r=function(t,e){return{"Y+|y+":{Y:"".concat(Number("".concat(e.year).slice(-2))),YY:ri("".concat(e.year).slice(-2),2),YYY:ri("".concat(e.year).slice(-3),3),def:t=>ri("".concat(e.year),t.length)},"M+":{M:e.month+1,MM:ri("".concat(e.month+1),2),MMM:t.locale_months_abbr[e.month],def:t.locale_months[e.month]},"W+|w+":{W:e.day,WW:ri("".concat(e.day),2),WWW:t.locale_days_abbr[e.day],def:t.locale_days[e.day]},"D+|d+":{D:e.date,def:t=>ri("".concat(e.date),t.length)},"h+|H+":{h:e.h,def:t=>ri("".concat(e.h),t.length)},"m+":{m:e.m,def:t=>ri("".concat(e.m),t.length)},"s+|S+":{s:e.s,def:t=>ri("".concat(e.s),t.length)},"f+|F+":{def(t){let n="".concat(e.f),i=t.length-n.length;if(i>0)for(let t=0;t<i;t++)n+="0";else i<0&&(n=n.slice(0,t.length));return n}},"t{1,2}|T{1,2}":{def(t){let n=e.t;return t[0].toUpperCase()===t[0]&&(n=n.toUpperCase()),n=n.slice(0,t.length),n}}}}(this,i),o=[];for(const t in r)Object.prototype.hasOwnProperty.call(r,t)&&o.push(t);const a=new RegExp(o.join("|"),"g"),s=e.replace(a,(t=>{let e,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(e=new RegExp(n),e.test(t)))break;if(!e)return"";for(const e in r[n])if(e===t||e.toLowerCase()===t){i=r[n][e],void 0===i&&(i=r[n][e.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(t)),i}));return s}}function li(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new si(...e)}function ci(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=li(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,t,e),i=Xn(n.format.bind(n),{toKey:t=>"object"==typeof t&&"function"==typeof t.getTime?t.getTime():t});function r(t){return e!==Qn?function(t){return new Date(Date.UTC(1899,11,30+Math.floor(t),0,0,0,Math.round(864e5*(t-Math.floor(t)))))}(t):t}function o(t){return t=r(t),i(t)}return o.format=function(t,e){return i.clear(),e=r(e),n.format(e,t)},o.locale=function(r){return n=li(r,t,e),i=Xn(n.format.bind(n),{toKey:t=>"object"==typeof t?t.getTime():t}),this},o.qtype=function(t){return void 0!==t&&(e=t,i.clear()),e},o}function ui(){let t,{meta:e,id:n,key:i,localeInfo:r,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?t=>null==t?void 0:t.qElemNo:t=>null==t?void 0:t.qValue),u="dimension"===s?"first":"avg",h=function(t,e){if(t&&t.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(t.qNumFormat.qType))return ci(t.qNumFormat.qFmt,t.qNumFormat.qType,e);let n="#",i=e&&void 0!==e.qThousandSep?e.qThousandSep:",",r=e&&void 0!==e.qDecimalSep?e.qDecimalSep:".",o="U",a=t&&!!t.qIsAutoFormat;return t&&t.qNumFormat?(n=t.qNumFormat.qFmt||n,i=t.qNumFormat.qThou||i,r=t.qNumFormat.qDec||r,o=t.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(t.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),Gn(n,i,r,o,e)}(e,r),d="dimension"===s?"first":(t,e)=>h(e),f={id:()=>n,key:()=>i,raw:()=>e,title:()=>e.qFallbackTitle||e.label,type:()=>s,origin:()=>l,items:()=>(t||(t=o(f)),t),min:()=>e.qMin,max:()=>e.qMax,value:c,label:t=>(null==t?void 0:t.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>e.qTags};return f}function hi(t,e,n,i,r){return(e[t]||[]).map(((e,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(t,"/").concat(o),s={instance:ui(Ye({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:e},r))};return s.attrDims=hi("qAttrDimInfo",e,n,a,Ye({},r,{value:t=>null==t?void 0:t.qElemNo,type:"dimension"})),s.attrExps=hi("qAttrExprInfo",e,n,a,Ye({},r,{value:t=>null==t?void 0:t.qNum,type:"measure"})),s.measures=hi("qMeasureInfo",e,n,a,Ye({},r,{value:t=>null==t?void 0:t.qValue,type:"measure"})),s}))}function di(){let{key:t,data:e,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=e;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=di.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>t,raw:()=>r,field:t=>function(t,e){let{cache:n}=e;if("number"==typeof t)return n.fields[t];const i=n.allFields;if("function"==typeof t){for(let e=0;e<i.length;e++)if(t(i[e]))return i[e];return!1}if("string"==typeof t){for(let e=0;e<i.length;e++)if(i[e].key()===t||i[e].title()===t)return i[e]}else if(t&&-1!==i.indexOf(t))return t;throw Error("Field not found: ".concat(t))}(t,a),fields:()=>i.fields.slice(),extract:t=>a.extractor(t,s,i,o),hierarchy:t=>a.hierarchy(t,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=Dn,a.hierarchy=Cn,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=Ze,a.pages=r.qDataPages,a.hierarchy=Cn):a.extractor=()=>[],a.fieldExtractor=t=>a.extractor({field:t},s,i,o);const l="S"===r.qMode?t=>t.qElemNumber:void 0,c="S"===r.qMode?t=>t.qNum:void 0;i.wrappedFields.push(...hi("qDimensionInfo",r,t,"",Ye({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...hi("qMeasureInfo",r,t,"",Ye({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((t=>t.instance));const u=t=>{t.forEach((t=>{i.allFields.push(t.instance),u(t.measures),u(t.attrDims),u(t.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((e=>{const n=s.field(e.from),r=ui(Le({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:t=>a.extractor({field:t},s,i,o),key:e.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},e.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const fi=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],pi=/\/qDimensionInfo(?:\/(\d+))?/,gi=/\/qMeasureInfo\/(\d+)/,mi=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,yi=/\/qAttrExprInfo\/(\d+)/,xi=/\/?qHyperCube/,vi=/\/?qTreeData/,bi=t=>"".concat(t.substr(0,t.indexOf("/qHyperCubeDef")+14)),wi=t=>"".concat(t.substr(0,t.indexOf("/qTreeDataDef")+13));function Mi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=e.byCells,r=e.primarySource,o=[],a={},s=t.isActive();let l=!1;if(t.brushes().forEach((t=>{const e=function(t,e){let n=t,i=-1,r=-1,o="",a=t=>t;xi.test(t)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=bi):vi.test(t)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=wi);let s=!0;if(pi.test(t)&&(i=+pi.exec(t)[1]),gi.test(t)&&(r=+gi.exec(t)[1]),mi.test(t)){r=-1,i=0;const t=+mi.exec(n)[2];isNaN(t)||(i=t,n=n.replace(/\/\d+$/,"")),s=!1}if(yi.test(t)){const t=r;if(e){r=0;const a=gn(o,e);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((t,e)=>t+e.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((t,e)=>t+e.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,t).reduce(((t,e)=>t+e.qAttrExprInfo.length),r)),r+=+yi.exec(n)[1]}else i>-1?(i=-1,r=+yi.exec(n)[1]):r+=+yi.exec(n)[1]+1}return fi.forEach((t=>{let[e,i]=t;n=n.replace(e,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(t.id,n);if("range"===t.type&&e.measureIdx>-1&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:e.path,ranges:[]}),n.forEach((t=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:e.measureIdx,qDimensionIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===t.type&&e.measureIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:e.path,ranges:[]}),n.forEach((t=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:e.measureIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===t.type&&e.dimensionIdx>-1){const n=t.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:e.path,ranges:[]}),n.forEach((t=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:e.dimensionIdx,qRange:{qMin:t.min,qMax:t.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===t.type&&e.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(e.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:e.path,cells:[]}),t.id===r||!r){const n=t.brush.values().map((t=>+t)).filter((t=>!isNaN(t)));(0===o||s>=o)&&o>-1?n.forEach((t=>{a.selectPivotCells.cells.push({qType:"T",qCol:t,qRow:s-o})})):n.forEach((t=>{a.selectPivotCells.cells.push({qType:"L",qCol:e.dimensionIdx,qRow:t})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:e.path,cols:[]}),a.selectHyperCubeCells.cols.push(e.dimensionIdx),t.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=t.brush.values().map((t=>+t)).filter((t=>!isNaN(t))),l=!!a.selectHyperCubeCells.values.length);else{const n=t.brush.values().map((t=>+t)).filter((t=>!isNaN(t)));l=!!n.length,o.push({params:[e.path,e.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=e.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function ki(t){di.util=t.data("matrix").util,t.data("q",di),t.formatter("q-number",Gn),t.formatter("q-time",ci)}ki.qBrushHelper=Mi,ki.selections=Mi;var _i=Object.prototype.hasOwnProperty,Si=Object.prototype.toString,Ni=Object.defineProperty,Ri=Object.getOwnPropertyDescriptor,Ai=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Si.call(t)},Ci=function(t){if(!t||"[object Object]"!==Si.call(t))return!1;var e,n=_i.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_i.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||_i.call(t,e)},Di=function(t,e){Ni&&"__proto__"===e.name?Ni(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},Oi=function(t,e){if("__proto__"===e){if(!_i.call(t,e))return;if(Ri)return Ri(t,e).value}return t[e]},Ei=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=Oi(s,n),s!==(r=Oi(e,n))&&(u&&r&&(Ci(r)||(o=Ai(r)))?(o?(o=!1,a=i&&Ai(i)?i:[]):a=i&&Ci(i)?i:{},Di(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&Di(s,{name:n,newValue:r}));return s},zi="2.6.0";function Ii(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ti(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Pi(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ti(Object(n),!0).forEach((function(e){Ii(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ti(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qi(t){return!!t.changedTouches}function Li(t){return"number"==typeof t&&!isNaN(t)}function ji(t){return"number"!=typeof t||isNaN(t)}function Fi(t){const e=t.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let a=0;a<e;a++)n=isNaN(n)?t[a].x:Math.min(n,t[a].x),i=isNaN(i)?t[a].x:Math.max(i,t[a].x),r=isNaN(r)?t[a].y:Math.min(r,t[a].y),o=isNaN(o)?t[a].y:Math.max(o,t[a].y);return[n,r,i,o]}function Bi(t){return[{x:t.x1||0,y:t.y1||0},{x:t.x2||0,y:t.y2||0}]}function Vi(t){return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}]}function $i(t){const[e,n,i,r]=Fi(t);return{x:e,y:n,width:i-e,height:r-n}}function Hi(t){return{x1:t[0].x,y1:t[0].y,x2:t[1].x,y2:t[1].y}}function Wi(t){const{x:e,y:n,width:i,height:r,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:h,vertices:d}=t||{};return Li(c)&&Li(u)&&Li(h)?"circle":Li(o)&&Li(a)&&Li(s)&&Li(l)?"line":Li(e)&&Li(n)&&Li(i)&&Li(r)?"rect":Li(e)&&Li(n)?"point":Array.isArray(d)?d.every((t=>Array.isArray(t)))?"geopolygon":"polygon":null}function Ui(t,e){return{x:e.x-t,y:e.y-t,width:e.width+t,height:e.height+t}}var Yi=Math.PI,Xi=2*Yi,Gi=1e-6,Ki=Xi-Gi;function Zi(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Ji(){return new Zi}function Qi(t){return function(){return t}}Zi.prototype=Ji.prototype={constructor:Zi,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,i){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(t,e,n,i,r,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(t,e,n,i,r){t=+t,e=+e,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-t,l=i-e,c=o-t,u=a-e,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>Gi)if(Math.abs(u*s-l*c)>Gi&&r){var d=n-o,f=i-a,p=s*s+l*l,g=d*d+f*f,m=Math.sqrt(p),y=Math.sqrt(h),x=r*Math.tan((Yi-Math.acos((p+h-g)/(2*m*y)))/2),v=x/y,b=x/m;Math.abs(v-1)>Gi&&(this._+="L"+(t+v*c)+","+(e+v*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=t+b*s)+","+(this._y1=e+b*l)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,i,r,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=t+a,c=e+s,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>Gi||Math.abs(this._y1-c)>Gi)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%Xi+Xi),h>Ki?this._+="A"+n+","+n+",0,1,"+u+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>Gi&&(this._+="A"+n+","+n+",0,"+ +(h>=Yi)+","+u+","+(this._x1=t+n*Math.cos(r))+","+(this._y1=e+n*Math.sin(r))))},rect:function(t,e,n,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var tr=Math.abs,er=Math.atan2,nr=Math.cos,ir=Math.max,rr=Math.min,or=Math.sin,ar=Math.sqrt,sr=1e-12,lr=Math.PI,cr=lr/2,ur=2*lr;function hr(t){return t>=1?cr:t<=-1?-cr:Math.asin(t)}function dr(t){return t.innerRadius}function fr(t){return t.outerRadius}function pr(t){return t.startAngle}function gr(t){return t.endAngle}function mr(t){return t&&t.padAngle}function yr(t,e,n,i,r,o,a){var s=t-n,l=e-i,c=(a?o:-o)/ar(s*s+l*l),u=c*l,h=-c*s,d=t+u,f=e+h,p=n+u,g=i+h,m=(d+p)/2,y=(f+g)/2,x=p-d,v=g-f,b=x*x+v*v,w=r-o,M=d*g-p*f,k=(v<0?-1:1)*ar(ir(0,w*w*b-M*M)),_=(M*v-x*k)/b,S=(-M*x-v*k)/b,N=(M*v+x*k)/b,R=(-M*x+v*k)/b,A=_-m,C=S-y,D=N-m,O=R-y;return A*A+C*C>D*D+O*O&&(_=N,S=R),{cx:_,cy:S,x01:-u,y01:-h,x11:_*(r/w-1),y11:S*(r/w-1)}}function xr(){var t=dr,e=fr,n=Qi(0),i=null,r=pr,o=gr,a=mr,s=null;function l(){var l,c,u=+t.apply(this,arguments),h=+e.apply(this,arguments),d=r.apply(this,arguments)-cr,f=o.apply(this,arguments)-cr,p=tr(f-d),g=f>d;if(s||(s=l=Ji()),h<u&&(c=h,h=u,u=c),h>sr)if(p>ur-sr)s.moveTo(h*nr(d),h*or(d)),s.arc(0,0,h,d,f,!g),u>sr&&(s.moveTo(u*nr(f),u*or(f)),s.arc(0,0,u,f,d,g));else{var m,y,x=d,v=f,b=d,w=f,M=p,k=p,_=a.apply(this,arguments)/2,S=_>sr&&(i?+i.apply(this,arguments):ar(u*u+h*h)),N=rr(tr(h-u)/2,+n.apply(this,arguments)),R=N,A=N;if(S>sr){var C=hr(S/u*or(_)),D=hr(S/h*or(_));(M-=2*C)>sr?(b+=C*=g?1:-1,w-=C):(M=0,b=w=(d+f)/2),(k-=2*D)>sr?(x+=D*=g?1:-1,v-=D):(k=0,x=v=(d+f)/2)}var O=h*nr(x),E=h*or(x),z=u*nr(w),I=u*or(w);if(N>sr){var T,P=h*nr(v),q=h*or(v),L=u*nr(b),j=u*or(b);if(p<lr&&(T=function(t,e,n,i,r,o,a,s){var l=n-t,c=i-e,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<sr))return[t+(d=(u*(e-o)-h*(t-r))/d)*l,e+d*c]}(O,E,L,j,P,q,z,I))){var F=O-T[0],B=E-T[1],V=P-T[0],$=q-T[1],H=1/or(function(t){return t>1?0:t<-1?lr:Math.acos(t)}((F*V+B*$)/(ar(F*F+B*B)*ar(V*V+$*$)))/2),W=ar(T[0]*T[0]+T[1]*T[1]);R=rr(N,(u-W)/(H-1)),A=rr(N,(h-W)/(H+1))}}k>sr?A>sr?(m=yr(L,j,O,E,h,A,g),y=yr(P,q,z,I,h,A,g),s.moveTo(m.cx+m.x01,m.cy+m.y01),A<N?s.arc(m.cx,m.cy,A,er(m.y01,m.x01),er(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,A,er(m.y01,m.x01),er(m.y11,m.x11),!g),s.arc(0,0,h,er(m.cy+m.y11,m.cx+m.x11),er(y.cy+y.y11,y.cx+y.x11),!g),s.arc(y.cx,y.cy,A,er(y.y11,y.x11),er(y.y01,y.x01),!g))):(s.moveTo(O,E),s.arc(0,0,h,x,v,!g)):s.moveTo(O,E),u>sr&&M>sr?R>sr?(m=yr(z,I,P,q,u,-R,g),y=yr(O,E,L,j,u,-R,g),s.lineTo(m.cx+m.x01,m.cy+m.y01),R<N?s.arc(m.cx,m.cy,R,er(m.y01,m.x01),er(y.y01,y.x01),!g):(s.arc(m.cx,m.cy,R,er(m.y01,m.x01),er(m.y11,m.x11),!g),s.arc(0,0,u,er(m.cy+m.y11,m.cx+m.x11),er(y.cy+y.y11,y.cx+y.x11),g),s.arc(y.cx,y.cy,R,er(y.y11,y.x11),er(y.y01,y.x01),!g))):s.arc(0,0,u,w,b,g):s.lineTo(z,I)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-lr/2;return[nr(i)*n,or(i)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Qi(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Qi(+t),l):n},l.padRadius=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Qi(+t),l):i},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:Qi(+t),l):r},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Qi(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Qi(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function vr(t){this._context=t}function br(t){return new vr(t)}function wr(t){return t[0]}function Mr(t){return t[1]}function kr(){var t=wr,e=null,n=Qi(0),i=Mr,r=Qi(!0),o=null,a=br,s=null;function l(l){var c,u,h,d,f,p=l.length,g=!1,m=new Array(p),y=new Array(p);for(null==o&&(s=a(f=Ji())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===g)if(g=!g)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=c-1;h>=u;--h)s.point(m[h],y[h]);s.lineEnd(),s.areaEnd()}g&&(m[c]=+t(d,c,l),y[c]=+n(d,c,l),s.point(e?+e(d,c,l):m[c],i?+i(d,c,l):y[c]))}if(f)return s=null,f+""||null}function c(){return function(){var t=wr,e=Mr,n=Qi(!0),i=null,r=br,o=null;function a(a){var s,l,c,u=a.length,h=!1;for(null==i&&(o=r(c=Ji())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(l,s,a),+e(l,s,a));if(c)return o=null,c+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:Qi(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:Qi(!!t),a):n},a.curve=function(t){return arguments.length?(r=t,null!=i&&(o=r(i)),a):r},a.context=function(t){return arguments.length?(null==t?i=o=null:o=r(i=t),a):i},a}().defined(r).curve(a).context(o)}return l.x=function(n){return arguments.length?(t="function"==typeof n?n:Qi(+n),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Qi(+t),l):e},l.y=function(t){return arguments.length?(n="function"==typeof t?t:Qi(+t),i=null,l):n},l.y0=function(t){return arguments.length?(n="function"==typeof t?t:Qi(+t),l):n},l.y1=function(t){return arguments.length?(i=null==t?null:"function"==typeof t?t:Qi(+t),l):i},l.lineX0=l.lineY0=function(){return c().x(t).y(n)},l.lineY1=function(){return c().x(t).y(i)},l.lineX1=function(){return c().x(e).y(n)},l.defined=function(t){return arguments.length?(r="function"==typeof t?t:Qi(!!t),l):r},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}function _r(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function Sr(t){return t}vr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var Nr=Array.prototype.slice;function Rr(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Ar(t){this._context=t}function Cr(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function Dr(t,e){this._context=t,this._k=(1-e)/6}Ar.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rr(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}},Dr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Cr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:Cr(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Or=function t(e){function n(t){return new Dr(t,e)}return n.tension=function(e){return t(+e)},n}(0);function Er(t,e){this._context=t,this._alpha=e}Er.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(t,e,n){var i=t._x1,r=t._y1,o=t._x2,a=t._y2;if(t._l01_a>sr){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,l=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/l,r=(r*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/l}if(t._l23_a>sr){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(i,r,o,a,t._x2,t._y2)}(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var zr=function t(e){function n(t){return e?new Er(t,e):new Dr(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ir(t){return t<0?-1:1}function Tr(t,e,n){var i=t._x1-t._x0,r=e-t._x1,o=(t._y1-t._y0)/(i||r<0&&-0),a=(n-t._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(Ir(o)+Ir(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Pr(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function qr(t,e,n){var i=t._x0,r=t._y0,o=t._x1,a=t._y1,s=(o-i)/3;t._context.bezierCurveTo(i+s,r+s*e,o-s,a-s*n,o,a)}function Lr(t){this._context=t}function jr(t){this._context=new Fr(t)}function Fr(t){this._context=t}function Br(t){this._context=t}function Vr(t){var e,n,i=t.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e<i-1;++e)r[e]=1,o[e]=4,a[e]=4*t[e]+2*t[e+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*t[i-1]+t[i],e=1;e<i;++e)n=r[e]/o[e-1],o[e]-=n,a[e]-=n*a[e-1];for(r[i-1]=a[i-1]/o[i-1],e=i-2;e>=0;--e)r[e]=(a[e]-r[e+1])/o[e];for(o[i-1]=(t[i]+r[i-1])/2,e=0;e<i-1;++e)o[e]=2*t[e+1]-r[e+1];return[r,o]}function $r(t,e){this._context=t,this._t=e}function Hr(t,e){if((r=t.length)>1)for(var n,i,r,o=1,a=t[e[0]],s=a.length;o<r;++o)for(i=a,a=t[e[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Wr(t){for(var e=t.length,n=new Array(e);--e>=0;)n[e]=e;return n}function Ur(t,e){return t[e]}function Yr(t){for(var e,n=-1,i=0,r=t.length,o=-1/0;++n<r;)(e=+t[n][1])>o&&(o=e,i=n);return i}function Xr(t){for(var e,n=0,i=-1,r=t.length;++i<r;)(e=+t[i][1])&&(n+=e);return n}function Gr(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=t||{get:()=>{},has:()=>!1,default:()=>{}};function a(t,e){if(!t||"string"!=typeof t)throw new TypeError("Invalid argument: key must be a non-empty string");return!(t in r)&&(r[t]=e,!0)}function s(t){return r[t]||o.get(t)}function l(t,r){if(void 0!==r)return a(t,r);const o=s(t);return i&&void 0===o&&i.warn("".concat(t," does not exist in ").concat(n," registry")),o||s(e)}return e=o.default(),l.add=a,l.get=s,l.has=function(t){return!!r[t]||o.has(t)},l.remove=function(t){const e=r[t];return delete r[t],e},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map((t=>r[t]))},l.default=function(t){return void 0!==t&&(e=t),e},l.register=a,l}function Kr(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function Zr(t){return(t=Kr(Math.abs(t)))?t[1]:NaN}Lr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:qr(this,this._t0,Pr(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,qr(this,Pr(this,n=Tr(this,t,e)),n);break;default:qr(this,this._t0,n=Tr(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(jr.prototype=Object.create(Lr.prototype)).point=function(t,e){Lr.prototype.point.call(this,e,t)},Fr.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,r,o){this._context.bezierCurveTo(e,t,i,n,o,r)}},Br.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),2===n)this._context.lineTo(t[1],e[1]);else for(var i=Vr(t),r=Vr(e),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],t[a],e[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}},$r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Jr,Qr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function to(t){if(!(e=Qr.exec(t)))throw new Error("invalid format: "+t);var e;return new eo({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function eo(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function no(t,e){var n=Kr(t,e);if(!n)return t+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}to.prototype=eo.prototype,eo.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var io={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>no(100*t,e),r:no,s:function(t,e){var n=Kr(t,e);if(!n)return t+"";var i=n[0],r=n[1],o=r-(Jr=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+Kr(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ro(t){return t}var oo,ao,so,lo=Array.prototype.map,co=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function uo(t){var e,n,i=void 0===t.grouping||void 0===t.thousands?ro:(e=lo.call(t.grouping,Number),n=t.thousands+"",function(t,i){for(var r=t.length,o=[],a=0,s=e[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(t.substring(r-=s,r+s)),!((l+=s+1)>i));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),r=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?ro:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(lo.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=to(t)).fill,n=t.align,h=t.sign,d=t.symbol,f=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,x=t.type;"n"===x?(g=!0,x="g"):io[x]||(void 0===m&&(m=12),y=!0,x="g"),(f||"0"===e&&"="===n)&&(f=!0,e="0",n="=");var v="$"===d?r:"#"===d&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",b="$"===d?o:/[%p]/.test(x)?l:"",w=io[x],M=/[defgprs%]/.test(x);function k(t){var r,o,l,d=v,k=b;if("c"===x)k=w(t)+k,t="";else{var _=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,i=1,r=-1;i<n;++i)switch(t[i]){case".":r=e=i;break;case"0":0===r&&(r=i),e=i;break;default:if(!+t[i])break t;r>0&&(r=0)}return r>0?t.slice(0,r)+t.slice(e+1):t}(t)),_&&0==+t&&"+"!==h&&(_=!1),d=(_?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===x?co[8+Jr/3]:"")+k+(_&&"("===h?")":""),M)for(r=-1,o=t.length;++r<o;)if(48>(l=t.charCodeAt(r))||l>57){k=(46===l?a+t.slice(r+1):t.slice(r))+k,t=t.slice(0,r);break}}g&&!f&&(t=i(t,1/0));var S=d.length+t.length+k.length,N=S<p?new Array(p-S+1).join(e):"";switch(g&&f&&(t=i(N+t,N.length?p-k.length:1/0),N=""),n){case"<":t=d+t+k+N;break;case"=":t=d+N+t+k;break;case"^":t=N.slice(0,S=N.length>>1)+d+t+k+N.slice(S);break;default:t=N+d+t+k}return s(t)}return m=void 0===m?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),k.toString=function(){return t+""},k}return{format:h,formatPrefix:function(t,e){var n=h(((t=to(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor(Zr(e)/3))),r=Math.pow(10,-i),o=co[8+i/3];return function(t){return n(r*t)+o}}}}!function(t){oo=uo(t),ao=oo.format,so=oo.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const ho=new Date,fo=new Date;function po(t,e,n,i){function r(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return r.floor=e=>(t(e=new Date(+e)),e),r.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),r.round=t=>{const e=r(t),n=r.ceil(t);return t-e<n-t?e:n},r.offset=(t,n)=>(e(t=new Date(+t),null==n?1:Math.floor(n)),t),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return a;let s;do{a.push(s=new Date(+n)),e(n,o),t(n)}while(s<n&&n<i);return a},r.filter=n=>po((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,i)=>{if(t>=t)if(i<0)for(;++i<=0;)for(;e(t,-1),!n(t););else for(;--i>=0;)for(;e(t,1),!n(t););})),n&&(r.count=(e,i)=>(ho.setTime(+e),fo.setTime(+i),t(ho),t(fo),Math.floor(n(ho,fo))),r.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?r.filter(i?e=>i(e)%t==0:e=>r.count(0,e)%t==0):r:null)),r}const go=6e4,mo=864e5,yo=6048e5,xo=po((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*go)/mo),(t=>t.getDate()-1));xo.range;const vo=po((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/mo),(t=>t.getUTCDate()-1));vo.range;const bo=po((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/mo),(t=>Math.floor(t/mo)));function wo(t){return po((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*go)/yo))}bo.range;const Mo=wo(0),ko=wo(1),_o=wo(2),So=wo(3),No=wo(4),Ro=wo(5),Ao=wo(6);function Co(t){return po((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/yo))}Mo.range,ko.range,_o.range,So.range,No.range,Ro.range,Ao.range;const Do=Co(0),Oo=Co(1),Eo=Co(2),zo=Co(3),Io=Co(4),To=Co(5),Po=Co(6);Do.range,Oo.range,Eo.range,zo.range,Io.range,To.range,Po.range;const qo=po((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));qo.every=t=>isFinite(t=Math.floor(t))&&t>0?po((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,qo.range;const Lo=po((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));function jo(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Fo(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Bo(t){let e,n,i;function r(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<0?r=e+1:o=e}while(r<o)}return r}return 2!==t.length?(e=jo,n=(e,n)=>jo(t(e),n),i=(e,n)=>t(e)-n):(e=t===jo||t===Fo?t:Vo,n=t,i=t),{left:r,center:function(t,e,n=0,o=t.length){const a=r(t,e,n,o-1);return a>n&&i(t[a-1],e)>-i(t[a],e)?a-1:a},right:function(t,i,r=0,o=t.length){if(r<o){if(0!==e(i,i))return o;do{const e=r+o>>>1;n(t[e],i)<=0?r=e+1:o=e}while(r<o)}return r}}}function Vo(){return 0}Lo.every=t=>isFinite(t=Math.floor(t))&&t>0?po((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Lo.range;const $o=Bo(jo).right;Bo((function(t){return null===t?NaN:+t})).center;var Ho=$o;class Wo extends Map{constructor(t,e=Yo){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(Uo(this,t))}has(t){return super.has(Uo(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):(t.set(i,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const i=e(n);t.has(i)&&(n=t.get(i),t.delete(i));return n}(this,t))}}function Uo({_intern:t,_key:e},n){const i=e(n);return t.has(i)?t.get(i):n}function Yo(t){return null!==t&&"object"==typeof t?t.valueOf():t}const Xo=Math.sqrt(50),Go=Math.sqrt(10),Ko=Math.sqrt(2);function Zo(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=Xo?10:o>=Go?5:o>=Ko?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(t*c),l=Math.round(e*c),s/c<t&&++s,l/c>e&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(t/c),l=Math.round(e/c),s*c<t&&++s,l*c>e&&--l),l<s&&.5<=n&&n<2?Zo(t,e,2*n):[s,l,c]}function Jo(t,e,n){return Zo(t=+t,e=+e,n=+n)[2]}function Qo(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ta(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ea(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function na(t){var e=t.dateTime,n=t.date,i=t.time,r=t.periods,o=t.days,a=t.shortDays,s=t.months,l=t.shortMonths,c=ca(r),u=ua(r),h=ca(o),d=ua(o),f=ca(a),p=ua(a),g=ca(s),m=ua(s),y=ca(l),x=ua(l),v={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return l[t.getMonth()]},B:function(t){return s[t.getMonth()]},c:null,d:Oa,e:Oa,f:Pa,g:Ya,G:Ga,H:Ea,I:za,j:Ia,L:Ta,m:qa,M:La,p:function(t){return r[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:xs,s:vs,S:ja,u:Fa,U:Ba,V:$a,w:Ha,W:Wa,x:null,X:null,y:Ua,Y:Xa,Z:Ka,"%":ys},b={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return l[t.getUTCMonth()]},B:function(t){return s[t.getUTCMonth()]},c:null,d:Za,e:Za,f:ns,g:fs,G:gs,H:Ja,I:Qa,j:ts,L:es,m:is,M:rs,p:function(t){return r[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:xs,s:vs,S:os,u:as,U:ss,V:cs,w:us,W:hs,x:null,X:null,y:ds,Y:ps,Z:ms,"%":ys},w={a:function(t,e,n){var i=f.exec(e.slice(n));return i?(t.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(t,e,n){var i=h.exec(e.slice(n));return i?(t.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(t,e,n){var i=y.exec(e.slice(n));return i?(t.m=x.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(t,e,n){var i=g.exec(e.slice(n));return i?(t.m=m.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(t,n,i){return _(t,e,n,i)},d:wa,e:wa,f:Ra,g:ya,G:ma,H:ka,I:ka,j:Ma,L:Na,m:ba,M:_a,p:function(t,e,n){var i=c.exec(e.slice(n));return i?(t.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:va,Q:Ca,s:Da,S:Sa,u:da,U:fa,V:pa,w:ha,W:ga,x:function(t,e,i){return _(t,n,e,i)},X:function(t,e,n){return _(t,i,e,n)},y:ya,Y:ma,Z:xa,"%":Aa};function M(t,e){return function(n){var i,r,o,a=[],s=-1,l=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===t.charCodeAt(s)&&(a.push(t.slice(l,s)),null!=(r=ia[i=t.charAt(++s)])?i=t.charAt(++s):r="e"===i?" ":"0",(o=e[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(t.slice(l,s)),a.join("")}}function k(t,e){return function(n){var i,r,o=ea(1900,void 0,1);if(_(o,t,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(e&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=ta(ea(o.y,0,1))).getUTCDay(),i=r>4||0===r?Oo.ceil(i):Oo(i),i=vo.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=Qo(ea(o.y,0,1))).getDay(),i=r>4||0===r?ko.ceil(i):ko(i),i=xo.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?ta(ea(o.y,0,1)).getUTCDay():Qo(ea(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ta(o)):Qo(o)}}function _(t,e,n,i){for(var r,o,a=0,s=e.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=e.charCodeAt(a++))){if(r=e.charAt(a++),!(o=w[r in ia?e.charAt(a++):r])||(i=o(t,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return v.x=M(n,v),v.X=M(i,v),v.c=M(e,v),b.x=M(n,b),b.X=M(i,b),b.c=M(e,b),{format:function(t){var e=M(t+="",v);return e.toString=function(){return t},e},parse:function(t){var e=k(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=M(t+="",b);return e.toString=function(){return t},e},utcParse:function(t){var e=k(t+="",!0);return e.toString=function(){return t},e}}}var ia={"-":"",_:" ",0:"0"},ra=/^\s*\d+/,oa=/^%/,aa=/[\\^$*+?|[\]().{}]/g;function sa(t,e,n){var i=t<0?"-":"",r=(i?-t:t)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(e)+r:r)}function la(t){return t.replace(aa,"\\$&")}function ca(t){return new RegExp("^(?:"+t.map(la).join("|")+")","i")}function ua(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}function ha(t,e,n){var i=ra.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function da(t,e,n){var i=ra.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function fa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function pa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function ga(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function ma(t,e,n){var i=ra.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function ya(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function xa(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function va(t,e,n){var i=ra.exec(e.slice(n,n+1));return i?(t.q=3*i[0]-3,n+i[0].length):-1}function ba(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function wa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Ma(t,e,n){var i=ra.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function ka(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function _a(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Sa(t,e,n){var i=ra.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Na(t,e,n){var i=ra.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Ra(t,e,n){var i=ra.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Aa(t,e,n){var i=oa.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function Ca(t,e,n){var i=ra.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Da(t,e,n){var i=ra.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Oa(t,e){return sa(t.getDate(),e,2)}function Ea(t,e){return sa(t.getHours(),e,2)}function za(t,e){return sa(t.getHours()%12||12,e,2)}function Ia(t,e){return sa(1+xo.count(qo(t),t),e,3)}function Ta(t,e){return sa(t.getMilliseconds(),e,3)}function Pa(t,e){return Ta(t,e)+"000"}function qa(t,e){return sa(t.getMonth()+1,e,2)}function La(t,e){return sa(t.getMinutes(),e,2)}function ja(t,e){return sa(t.getSeconds(),e,2)}function Fa(t){var e=t.getDay();return 0===e?7:e}function Ba(t,e){return sa(Mo.count(qo(t)-1,t),e,2)}function Va(t){var e=t.getDay();return e>=4||0===e?No(t):No.ceil(t)}function $a(t,e){return t=Va(t),sa(No.count(qo(t),t)+(4===qo(t).getDay()),e,2)}function Ha(t){return t.getDay()}function Wa(t,e){return sa(ko.count(qo(t)-1,t),e,2)}function Ua(t,e){return sa(t.getFullYear()%100,e,2)}function Ya(t,e){return sa((t=Va(t)).getFullYear()%100,e,2)}function Xa(t,e){return sa(t.getFullYear()%1e4,e,4)}function Ga(t,e){var n=t.getDay();return sa((t=n>=4||0===n?No(t):No.ceil(t)).getFullYear()%1e4,e,4)}function Ka(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+sa(e/60|0,"0",2)+sa(e%60,"0",2)}function Za(t,e){return sa(t.getUTCDate(),e,2)}function Ja(t,e){return sa(t.getUTCHours(),e,2)}function Qa(t,e){return sa(t.getUTCHours()%12||12,e,2)}function ts(t,e){return sa(1+vo.count(Lo(t),t),e,3)}function es(t,e){return sa(t.getUTCMilliseconds(),e,3)}function ns(t,e){return es(t,e)+"000"}function is(t,e){return sa(t.getUTCMonth()+1,e,2)}function rs(t,e){return sa(t.getUTCMinutes(),e,2)}function os(t,e){return sa(t.getUTCSeconds(),e,2)}function as(t){var e=t.getUTCDay();return 0===e?7:e}function ss(t,e){return sa(Do.count(Lo(t)-1,t),e,2)}function ls(t){var e=t.getUTCDay();return e>=4||0===e?Io(t):Io.ceil(t)}function cs(t,e){return t=ls(t),sa(Io.count(Lo(t),t)+(4===Lo(t).getUTCDay()),e,2)}function us(t){return t.getUTCDay()}function hs(t,e){return sa(Oo.count(Lo(t)-1,t),e,2)}function ds(t,e){return sa(t.getUTCFullYear()%100,e,2)}function fs(t,e){return sa((t=ls(t)).getUTCFullYear()%100,e,2)}function ps(t,e){return sa(t.getUTCFullYear()%1e4,e,4)}function gs(t,e){var n=t.getUTCDay();return sa((t=n>=4||0===n?Io(t):Io.ceil(t)).getUTCFullYear()%1e4,e,4)}function ms(){return"+0000"}function ys(){return"%"}function xs(t){return+t}function vs(t){return Math.floor(+t/1e3)}const bs=Gr();bs("d3-number",(function(t,e,n){let i,r;function o(t){return r(t)}function a(){o.locale({decimal:n||".",thousands:e||",",grouping:[3],currency:["$",""]})}return o.locale=function(e){return i=uo(e),r=i.format(t),this},a(),o.format=function(t,r,o,s){return(o||s)&&(e=o,n=s,a()),i.format(t)(r)},o.pattern=function(e){return e&&(t=e,r=i.format(e)),t},o})),bs("d3-time",(function(t){let e=na({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=e.format(t);function i(t){return n(t)}return i.format=function(t,n){return e.format(t)(n)},i.locale=function(){return e=na(...arguments),n=e.format(t),this},i.parse=function(t,n){return e.parse(t)(n)},i.parsePattern=function(t){return e.parse(t)},i}));const ws={id:t=>"".concat(t.source,"/").concat(t.key||t.title),key:t=>String(t.key||t.title),tags:t=>t.tags,min:t=>t.min,max:t=>t.max,type:t=>t.type,title:t=>String(t.title),values:t=>t.values,value:t=>t,label:t=>t,formatter:t=>(t=>{if("function"==typeof t.formatter)return t.formatter();const e=t.formatter||{};return bs(e.type||"d3-number")(e.format||"")})(t)};function Ms(t){let{id:e=ws.id,key:n=ws.key,min:i=ws.min,max:r=ws.max,type:o=ws.type,tags:a=ws.tags,title:s=ws.title,values:l=ws.values,value:c=ws.value,label:u=ws.label,formatter:h=ws.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>e(t),key:()=>n(t),raw:()=>t,tags:()=>a(t),type:()=>o(t),min:()=>i(t),max:()=>r(t),title:()=>s(t),items:()=>l(t),formatter:()=>h(t),value:c,label:u}}const ks=t=>t.filter((t=>"number"==typeof t&&!isNaN(t))),_s=t=>t.reduce(((t,e)=>t+e),0),Ss={first:t=>t[0],last:t=>t[t.length-1],min:t=>{const e=ks(t);return e.length?Math.min.apply(null,e):NaN},max:t=>{const e=ks(t);return e.length?Math.max.apply(null,e):NaN},sum:t=>{const e=ks(t);return e.length?e.reduce(((t,e)=>t+e),0):NaN},avg:t=>{const e=ks(t),n=e.length;return n?_s(e)/n:NaN}};function Ns(t,e,n,i){const r={},o=i.field||(void 0!==t.field?e.field(t.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=r[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>Ns(t,e,{main:n},i).main)):void 0!==s.field?(l.type="field",l.field=e.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=Ss[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Ss[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=Ss[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Ss[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Rs(t,e){const{main:n}=Ns(t,e,{main:{value:t.value,label:t.label,reduce:t.reduce,filter:t.filter}},{});return{props:Ns(t,e,t.props||{},n),main:n}}function As(t,e,n,i){const r=Array(t.length),o=Array(t.length);let a;for(let e=0;e<t.length;e++)a=i?t[e][i]:t[e],r[e]=a.value,o[e]=a.label;const s=e.reduce,l=e.reduceLabel,c=s?s(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&t[0][i].source?(u.source=t[0][i].source,u):!i&&t[0].source?(u.source=t[0].source,u):u}function Cs(t,e){let{main:n,propsArr:i,props:r}=e,o=[];const a=n.field.formatter(),s={};return i.forEach((t=>{s[t]=r[t].field?r[t].field.formatter():t=>t})),o.push(...t.map((t=>{const e=As(t.items,n,a);return i.forEach((n=>{e[n]=As(t.items,r[n],s[n],n)})),e}))),o}function Ds(t){let{cfg:e,itemData:n,obj:i,target:r,tracker:o,trackType:a}=t;const s="function"===a?e.trackBy(n):n[e.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},r.push(l)),l.items.push(i)}function Os(t){if(t.length<1e4)return Math.max(...t);let e=-1/0;const n=t.length;for(let i=0;i<n;i++)e<t[i]&&(e=t[i]);return e}function Es(t){if(t.length<1e4)return Math.min(...t);let e=1/0;const n=t.length;for(let i=0;i<n;i++)e>t[i]&&(e=t[i]);return e}const zs={diverging:function(t,e){if((s=t.length)>0)for(var n,i,r,o,a,s,l=0,c=t[e[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(r=(i=t[e[n]][l])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=a,i[0]=a+=r):i[0]=o},none:Hr,silhouette:function(t,e){if((n=t.length)>0){for(var n,i=0,r=t[e[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=t[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}Hr(t,e)}},expand:function(t,e){if((i=t.length)>0){for(var n,i,r,o=0,a=t[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=t[n][o][1]||0;if(r)for(n=0;n<i;++n)t[n][o][1]/=r}Hr(t,e)}},wiggle:function(t,e){if((r=t.length)>0&&(i=(n=t[e[0]]).length)>0){for(var n,i,r,o=0,a=1;a<i;++a){for(var s=0,l=0,c=0;s<r;++s){for(var u=t[e[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=t[e[f]];d+=(p[a][1]||0)-(p[a-1][1]||0)}l+=h,c+=d*h}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,Hr(t,e)}}},Is={ascending:function(t){var e=t.map(Xr);return Wr(t).sort((function(t,n){return e[t]-e[n]}))},insideout:function(t){var e,n,i=t.length,r=t.map(Xr),o=function(t){var e=t.map(Yr);return Wr(t).sort((function(t,n){return e[t]-e[n]}))}(t),a=0,s=0,l=[],c=[];for(e=0;e<i;++e)n=o[e],a<s?(a+=r[n],l.push(n)):(s+=r[n],c.push(n));return c.reverse().concat(l)},none:Wr,reverse:function(t){return Wr(t).reverse()}};function Ts(t,e,n){const i={},r=e.stackKey,o=e.value,a=e.startProp||"start",s=e.endProp||"end",l=e.offset||"none",c=e.order||"none",u=e.valueRef||"";let h=0,d={};for(let e=0;e<t.items.length;e++){let n=t.items[e],o=u?n[u]:null;if(o&&o.source){let t="".concat(o.source.key||"","/").concat(o.source.field);d[t]||(d[t]=o.source)}let a=r(n);i[a]=i[a]||{items:[]},i[a].items.push(n),h=Math.max(h,i[a].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(i).map((t=>i[t].items)),g=function(){var t=Qi([]),e=Wr,n=Hr,i=Ur;function r(r){var o,a,s=t.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=s[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,a=e(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return r.keys=function(e){return arguments.length?(t="function"==typeof e?e:Qi(Nr.call(e)),r):t},r.value=function(t){return arguments.length?(i="function"==typeof t?t:Qi(+t),r):i},r.order=function(t){return arguments.length?(e=null==t?Wr:"function"==typeof t?t:Qi(Nr.call(t)),r):e},r.offset=function(t){return arguments.length?(n=null==t?Hr:t,r):n},r}().keys(f).value(((t,e)=>t[e]?o(t[e]):0)).order(Is[c]).offset(zs[l]);let m=g(p),y=[];for(let t=0;t<m.length;t++){let e=m[t];for(let t=0;t<e.length;t++){let n=e[t],i=e[t].data[e.key];i&&(i[a]={value:n[0]},i[s]={value:n[1]},y.push(n[0],n[1]))}}let x=Object.keys(d).map((t=>{let e=n(d[t].key);return e?e.field(d[t].field):null})).filter((t=>!!t));const v=Ms({title:x.map((t=>t.title())).join(", "),min:Es(y),max:Os(y),type:"measure",formatter:x[0]?x[0].formatter:void 0});t.fields.push(v)}function Ps(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(t))n.items=t.map((t=>({value:t,label:String(t)})));else if(t){if("collection"in t)n=Pi({},e.collection(t.collection));else{const r=e.dataset?e.dataset(t.source):null;let o=t.value||(t=>t),a=t.label||(t=>t);if(t.groupBy||t.mapTo)i.warn('Deprecated "data" configuration',t),n.items=[];else if(t.hierarchy)n.root=r.hierarchy?r.hierarchy(t.hierarchy):null,n.fields=r.fields();else if(t.items)n.items=t.items.map((t=>({value:o(t),label:String(a(t))})));else if(t.extract){const i=Array.isArray(t.extract)?t.extract:[t.extract];n.items=[];const o=[];i.forEach((t=>{const i=t.source?e.dataset(t.source):r;i&&(n.items=[...n.items,...i.extract(t)],void 0!==t.field&&o.push(i.field(t.field)))})),o.length&&(n.fields=o),t.amend&&Array.isArray(t.amend)&&(n.items=[...n.items,...t.amend])}else if(void 0!==t.field&&r){const e=r.field(t.field);e&&(n.fields||(n.fields=[]),n.fields.push(e),"value"in t||(o=e.value||(t=>t),a=e.label||(t=>t),n.value=o),n.items=e.items().map((e=>({value:o(e),label:String(a(e)),source:{field:t.field}}))))}else t.fields&&t.fields.forEach((t=>{const i="object"==typeof t&&t.source?e.dataset(t.source):r;if(!i)return;let o;o="object"==typeof t&&void 0!==t.field?i.field(t.field):i.field(t),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&t.map&&(n.items=n.items.map(t.map))}t&&t.stack&&Ts(n,t.stack,e.dataset)}return t&&!Array.isArray(t)&&"function"==typeof t.filter&&n.items&&(n.items=n.items.filter(t.filter)),t&&!Array.isArray(t)&&"function"==typeof t.sort&&n.items&&(n.items=n.items.sort(t.sort)),n}function qs(t,e,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ps;if(t.data){const i=r(t.data,e,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=t.formatter?"".concat(t.formatter,"-").concat(t.type||"number"):t.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(t.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function Ls(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}const js=Symbol("implicit");function Fs(){var t=new Wo,e=[],n=[],i=js;function r(r){let o=t.get(r);if(void 0===o){if(i!==js)return i;t.set(r,o=e.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Wo;for(const i of n)t.has(i)||t.set(i,e.push(i)-1);return r},r.range=function(t){return arguments.length?(n=Array.from(t),r):n.slice()},r.unknown=function(t){return arguments.length?(i=t,r):i},r.copy=function(){return Fs(e,n).unknown(i)},Ls.apply(r,arguments),r}function Bs(){var t,e,n=Fs().unknown(void 0),i=n.domain,r=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=a<o,d=h?a:o,f=h?o:a;t=(f-d)/Math.max(1,n-l+2*c),s&&(t=Math.floor(t)),d+=(f-d-t*(n-l))*u,e=t*(1-l),s&&(d=Math.round(d),e=Math.round(e));var p=function(t,e,n){t=+t,e=+e,n=(r=arguments.length)<2?(e=t,t=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(r);++i<r;)o[i]=t+i*n;return o}(n).map((function(e){return d+t*e}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(t){return arguments.length?(i(t),h()):i()},n.range=function(t){return arguments.length?([o,a]=t,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(t){return[o,a]=t,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return e},n.step=function(){return t},n.round=function(t){return arguments.length?(s=!!t,h()):s},n.padding=function(t){return arguments.length?(l=Math.min(1,c=+t),h()):l},n.paddingInner=function(t){return arguments.length?(l=Math.min(1,t),h()):l},n.paddingOuter=function(t){return arguments.length?(c=+t,h()):c},n.align=function(t){return arguments.length?(u=Math.max(0,Math.min(1,t)),h()):u},n.copy=function(){return Bs(i(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},Ls.apply(h(),arguments)}function Vs(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $s(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Hs(){}var Ws=.7,Us=1/Ws,Ys="\\s*([+-]?\\d+)\\s*",Xs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ks=/^#([0-9a-f]{3,8})$/,Zs=new RegExp(`^rgb\\(${Ys},${Ys},${Ys}\\)$`),Js=new RegExp(`^rgb\\(${Gs},${Gs},${Gs}\\)$`),Qs=new RegExp(`^rgba\\(${Ys},${Ys},${Ys},${Xs}\\)$`),tl=new RegExp(`^rgba\\(${Gs},${Gs},${Gs},${Xs}\\)$`),el=new RegExp(`^hsl\\(${Xs},${Gs},${Gs}\\)$`),nl=new RegExp(`^hsla\\(${Xs},${Gs},${Gs},${Xs}\\)$`),il={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function rl(){return this.rgb().formatHex()}function ol(){return this.rgb().formatRgb()}function al(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ks.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?sl(e):3===n?new ul(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ll(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ll(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Zs.exec(t))?new ul(e[1],e[2],e[3],1):(e=Js.exec(t))?new ul(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Qs.exec(t))?ll(e[1],e[2],e[3],e[4]):(e=tl.exec(t))?ll(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=el.exec(t))?ml(e[1],e[2]/100,e[3]/100,1):(e=nl.exec(t))?ml(e[1],e[2]/100,e[3]/100,e[4]):il.hasOwnProperty(t)?sl(il[t]):"transparent"===t?new ul(NaN,NaN,NaN,0):null}function sl(t){return new ul(t>>16&255,t>>8&255,255&t,1)}function ll(t,e,n,i){return i<=0&&(t=e=n=NaN),new ul(t,e,n,i)}function cl(t,e,n,i){return 1===arguments.length?function(t){return t instanceof Hs||(t=al(t)),t?new ul((t=t.rgb()).r,t.g,t.b,t.opacity):new ul}(t):new ul(t,e,n,null==i?1:i)}function ul(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function hl(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}`}function dl(){const t=fl(this.opacity);return`${1===t?"rgb(":"rgba("}${pl(this.r)}, ${pl(this.g)}, ${pl(this.b)}${1===t?")":`, ${t})`}`}function fl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function pl(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function gl(t){return((t=pl(t))<16?"0":"")+t.toString(16)}function ml(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new xl(t,e,n,i)}function yl(t){if(t instanceof xl)return new xl(t.h,t.s,t.l,t.opacity);if(t instanceof Hs||(t=al(t)),!t)return new xl;if(t instanceof xl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new xl(a,s,l,t.opacity)}function xl(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function vl(t){return(t=(t||0)%360)<0?t+360:t}function bl(t){return Math.max(0,Math.min(1,t||0))}function wl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Vs(Hs,al,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:rl,formatHex:rl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return yl(this).formatHsl()},formatRgb:ol,toString:ol}),Vs(ul,cl,$s(Hs,{brighter(t){return t=null==t?Us:Math.pow(Us,t),new ul(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Ws:Math.pow(Ws,t),new ul(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new ul(pl(this.r),pl(this.g),pl(this.b),fl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hl,formatHex:hl,formatHex8:function(){return`#${gl(this.r)}${gl(this.g)}${gl(this.b)}${gl(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:dl,toString:dl})),Vs(xl,(function(t,e,n,i){return 1===arguments.length?yl(t):new xl(t,e,n,null==i?1:i)}),$s(Hs,{brighter(t){return t=null==t?Us:Math.pow(Us,t),new xl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Ws:Math.pow(Ws,t),new xl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new ul(wl(t>=240?t-240:t+120,r,i),wl(t,r,i),wl(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new xl(vl(this.h),bl(this.s),bl(this.l),fl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=fl(this.opacity);return`${1===t?"hsl(":"hsla("}${vl(this.h)}, ${100*bl(this.s)}%, ${100*bl(this.l)}%${1===t?")":`, ${t})`}`}}));var Ml=t=>()=>t;function kl(t){return 1==(t=+t)?_l:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Ml(isNaN(e)?n:e)}}function _l(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Ml(isNaN(t)?e:t)}var Sl=function t(e){var n=kl(e);function i(t,e){var i=n((t=cl(t)).r,(e=cl(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=_l(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Nl(t,e){e||(e=[]);var n,i=t?Math.min(e.length,t.length):0,r=e.slice();return function(o){for(n=0;n<i;++n)r[n]=t[n]*(1-o)+e[n]*o;return r}}function Rl(t,e){var n,i=e?e.length:0,r=t?Math.min(i,t.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=Il(t[n],e[n]);for(;n<i;++n)a[n]=e[n];return function(t){for(n=0;n<r;++n)a[n]=o[n](t);return a}}function Al(t,e){var n=new Date;return t=+t,e=+e,function(i){return n.setTime(t*(1-i)+e*i),n}}function Cl(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function Dl(t,e){var n,i={},r={};for(n in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)n in t?i[n]=Il(t[n],e[n]):r[n]=e[n];return function(t){for(n in i)r[n]=i[n](t);return r}}var Ol=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,El=new RegExp(Ol.source,"g");function zl(t,e){var n,i,r,o=Ol.lastIndex=El.lastIndex=0,a=-1,s=[],l=[];for(t+="",e+="";(n=Ol.exec(t))&&(i=El.exec(e));)(r=i.index)>o&&(r=e.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Cl(n,i)})),o=El.lastIndex;return o<e.length&&(r=e.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(t){return function(e){return t(e)+""}}(l[0].x):function(t){return function(){return t}}(e):(e=l.length,function(t){for(var n,i=0;i<e;++i)s[(n=l[i]).i]=n.x(t);return s.join("")})}function Il(t,e){var n,i=typeof e;return null==e||"boolean"===i?Ml(e):("number"===i?Cl:"string"===i?(n=al(e))?(e=n,Sl):zl:e instanceof al?Sl:e instanceof Date?Al:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Nl:Array.isArray(e)?Rl:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Dl:Cl)(t,e)}function Tl(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}}function Pl(t){return+t}var ql=[0,1];function Ll(t){return t}function jl(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function Fl(t,e,n){var i=t[0],r=t[1],o=e[0],a=e[1];return r<i?(i=jl(r,i),o=n(a,o)):(i=jl(i,r),o=n(o,a)),function(t){return o(i(t))}}function Bl(t,e,n){var i=Math.min(t.length,e.length)-1,r=new Array(i),o=new Array(i),a=-1;for(t[i]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<i;)r[a]=jl(t[a],t[a+1]),o[a]=n(e[a],e[a+1]);return function(e){var n=Ho(t,e,1,i)-1;return o[n](r[n](e))}}function Vl(){var t,e,n,i,r,o,a=ql,s=ql,l=Il,c=Ll;function u(){var t=Math.min(a.length,s.length);return c!==Ll&&(c=function(t,e){var n;return t>e&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),i=t>2?Bl:Fl,r=o=null,h}function h(e){return null==e||isNaN(e=+e)?n:(r||(r=i(a.map(t),s,l)))(t(c(e)))}return h.invert=function(n){return c(e((o||(o=i(s,a.map(t),Cl)))(n)))},h.domain=function(t){return arguments.length?(a=Array.from(t,Pl),u()):a.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),l=Tl,u()},h.clamp=function(t){return arguments.length?(c=!!t||Ll,u()):c!==Ll},h.interpolate=function(t){return arguments.length?(l=t,u()):l},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,i){return t=n,e=i,u()}}function $l(t,e,n,i){var r,o=function(t,e,n){n=+n;const i=(e=+e)<(t=+t),r=i?Jo(e,t,n):Jo(t,e,n);return(i?-1:1)*(r<0?1/-r:r)}(t,e,n);switch((i=to(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=i.precision||isNaN(r=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Zr(e)/3)))-Zr(Math.abs(t)))}(o,a))||(i.precision=r),so(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Zr(e)-Zr(t))+1}(o,Math.max(Math.abs(t),Math.abs(e))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(t){return Math.max(0,-Zr(Math.abs(t)))}(o))||(i.precision=r-2*("%"===i.type))}return ao(i)}function Hl(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const i=e<t,[r,o,a]=i?Zo(e,t,n):Zo(t,e,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let t=0;t<s;++t)l[t]=(o-t)/-a;else for(let t=0;t<s;++t)l[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)l[t]=(r+t)/-a;else for(let t=0;t<s;++t)l[t]=(r+t)*a;return l}(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var i=e();return $l(i[0],i[i.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var i,r,o=e(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(r=l,l=c,c=r,r=a,a=s,s=r);u-- >0;){if((r=Jo(l,c,n))===i)return o[a]=l,o[s]=c,e(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return t},t}function Wl(){var t=Vl()(Ll,Ll);return t.copy=function(){return e=t,Wl().domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown());var e},Ls.apply(t,arguments),Hl(t)}function Ul(){var t,e=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[Ho(e,r,0,i)]:t}return r.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,n.length-1),r):e.slice()},r.range=function(t){return arguments.length?(n=Array.from(t),i=Math.min(e.length,n.length-1),r):n.slice()},r.invertExtent=function(t){var i=n.indexOf(t);return[e[i-1],e[i]]},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return Ul().domain(e).range(n).unknown(t)},Ls.apply(r,arguments)}function Yl(t){return void 0===t?t=>t:e=>t(e)}function Xl(t){return Math.max(0,Math.min(1,t))}function Gl(t){return"object"==typeof t}function Kl(t,e,n){const i=Math.abs(e-n)/(t+1),r=[];for(let o=1;o<=t;o++){const t=o*i;r.push(e<n?e+t:e-t)}return r}function Zl(t,e,n){if(1===t.length)return t;const i=t.concat([]);for(let r=0;r<t.length;r++){let o=t[r],a=t[r+1];0===r&&o!==n.start()?(i.push(...Kl(e,o,a)),o-=a-o,a=t[r],i.push(...Kl(e,o,a))):r===t.length-1&&a!==n.end()?(a=o+(o-t[r-1]),i.push(...Kl(e,o,a))):i.push(...Kl(e,o,a))}return i.filter((t=>t>=n.min()&&t<=n.max()))}function Jl(t){let{distance:e,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=t;const a=ji(r)||ji(e)?2:Math.max(e/r,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=i>0?Zl(l,i,n):l;c.sort(((t,e)=>t-e));const u=c.map(Yl(o));return c.map(((t,e)=>{const i=n(t);return{position:i,start:i,end:i,label:u[e],value:t,isMinor:-1===l.indexOf(t)}}))}function Ql(t){let{distance:e,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=t;const a=ji(r)||ji(e)?2:Math.max(e/r,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=i>0?Zl(c,i,n):c;u.sort(((t,e)=>t-e));const h=u.map(Yl(o));return u.map(((t,e)=>{const i=n(t);return{position:i,start:i,end:i,label:h[e],value:t,isMinor:-1===c.indexOf(t)}}))}function tc(t){let e,{settings:n,scale:i,distance:r,formatter:o=t=>t}=t;const a=n.minorTicks&&!ji(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const t=n.ticks.values.filter((t=>"object"==typeof t?!ji(t.value):!ji(t)));e=function(t){let{values:e,scale:n,formatter:i=t=>t}=t;return e.sort(((t,e)=>(Gl(t)?t.value:t)-(Gl(e)?e.value:e))).filter(((t,e,i)=>{const r=Gl(t)?t.value:t;return r<=n.max()&&r>=n.min()&&i.indexOf(t)===e})).map((t=>{const e=Gl(t),r=e?t.value:t,o=n(r);return{position:o,value:r,label:e&&void 0!==t.label?t.label:i(r),isMinor:!!e&&!!t.isMinor,start:e&&!isNaN(t.start)?Xl(n(t.start)):o,end:e&&!isNaN(t.end)?Xl(n(t.end)):o}}))}({values:t,scale:i.copy(),formatter:o})}else if(ji(n.ticks.count)){e=(n.ticks.tight?Ql:Jl)({distance:r,minorCount:a,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(t,e,n){const i=t.map((t=>t.position)),r=e.range();-1===i.indexOf(r[0])?t.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(e.start()),isMinor:!1,value:e.start()}):t[0]&&t[0].isMinor&&(t[0].isMinor=!1);const o=t[t.length-1];-1===i.indexOf(r[1])?t.push({position:r[1],start:r[1],end:r[1],label:n(e.end()),isMinor:!1,value:e.end()}):o&&o.isMinor&&(o.isMinor=!1)}(e,i,o)}else{e=function(t){let{count:e,minorCount:n,scale:i,formatter:r}=t;return i.ticks((e-1)*n+e).map(((t,e)=>{const o=i(t);return{position:o,start:o,end:o,label:r(t),isMinor:e%(n+1)!=0,value:t}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:i.copy(),formatter:o})}return e}function ec(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(e).forEach((r=>{const o=typeof t[r];i[r]="function"===o?t[r](n):"undefined"===o?e[r]:t[r]})),i}const nc={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},ic={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},rc={count:NaN};function oc(t,e){t.instance||(t.instance=e.copy(),t.instance.domain([e.start(),e.end()]),t.instance.clamp(!0),t.instance.range(t.invert?[1,0]:[0,1]))}function ac(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Wl(),r={instance:null,invert:!1},o={data:e,resources:n},a=ec(t,nc,o);let s;function l(t){return ji(t)?NaN:i(t)}a.ticks=ec(t.ticks,ic,o),a.minorTicks=ec(t.minorTicks,rc,o),l.data=()=>e,l.invert=function(t){return i.invert(t)},l.rangeRound=function(t){return i.rangeRound(t),l},l.clamp=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(t),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(t){return null!==t&&"object"==typeof t?(t.settings=t.settings||{},t.settings=Ei(!0,{},a,t.settings),t.scale=l,s=tc(t),s):(s=i.ticks(t),s)},l.nice=function(t){return i.nice(t),l},l.tickFormat=function(t,e){return i.tickFormat(t,e)},l.interpolate=function(t){return i.interpolate(t),l},l.domain=function(t){return arguments.length?(i.domain(t),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(t){return arguments.length?(i.range(t),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(t){let e=(l.start()-l.end())/t,n=[l.end()],i=[],r=e/2;for(let o=0;o<t;o++){let t=n[n.length-1]||0,o=t+e,a=l(t+r);n.push(o,o),i.push(a,a)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=ac(t,e,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(t){return oc(r,l),r.instance(t)},l.normInvert=function(t){return oc(r,l),r.instance.invert(t)};const{mini:c,maxi:u}=function(t,e){const n=+t.min,i=+t.max;let r=0,o=1;if(e&&e[0]){const n=e.map((t=>t.min())).filter((t=>!isNaN(t))),i=e.map((t=>t.max())).filter((t=>!isNaN(t)));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(t.expand)){const e=o-r;r-=e*t.expand,o+=e*t.expand}if(Array.isArray(t.include)){const e=t.include.filter((t=>!isNaN(t)));r=Math.min(...e,r),o=Math.max(...e,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(a,e?e.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),r.invert=a.invert,l}const sc={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function lc(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:e,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=ec(t,sc,n),r=e.items||[],o={},a=[],s=[];function l(t,n){t.data=()=>e,t.datum=t=>r[o[t]],t.start=function(){return t.domain()[0]},t.end=function(){return t.domain()[t.domain().length-1]},t.labels=()=>s,t.ticks=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.scale=t,function(t){let{scale:e}=t;const n=e.domain(),i=e.data().items,r=e.labels?e.labels():n,o=e.bandwidth();return n.map(((t,n)=>{const a=e(t);return{position:a+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:a,end:a+o}}))}(e,n.trackBy)}}const c=Bs();l(c,t),c.pxScale=function(e){const n=i.maxPxStep;if(isNaN(n))return c;const r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=e)return c;const a=c.copy();a.type=c.type,l(a,t);const s=o*n/e,u=(1-s)*c.align();return a.range(i.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof t.value?t.value:t=>t.datum.value,h="function"==typeof t.label?t.label:t=>t.datum.label;for(let t=0;t<r.length;t++){const e=Ei({datum:r[t]},n),i=u(e,t);-1===a.indexOf(i)&&(a.push(i),s.push(h(e,t)),o[i]=t)}return c.domain(a),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}const cc={depth:0};function uc(t,e,n){return t.ancestors().map((t=>e(Ei({datum:t.data},n)))).reverse().slice(1).toString()}const hc=t=>t.min(),dc=t=>t.max();function fc(t,e){const n=t&&!isNaN(t.min),i=t&&!isNaN(t.max);let r=n?+t.min:0,o=i?+t.max:1;if(e&&e.length){if(!n){const t=e.map(hc).filter(Li);r=t.length?Math.min(...t):r}if(!i){const t=e.map(dc).filter(Li);o=t.length?Math.max(...t):o}}return[r,o]}const pc={domain:[],range:[],invert:!1,min:NaN,max:NaN};function gc(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=ac(t,e,n).clamp(!0).interpolate(Sl),r=ec(t,pc,{data:e,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length,s=i;Ei(!0,s,i);const[l,c]=fc(r,e?e.fields:[]),u=o?r.domain.length:-1,h=n.theme?n.theme.palette("sequential",u>0?u:2):[],d=a?r.range:h;return s.range(r.invert?d.slice().reverse():d.slice()),s.domain(o?r.domain:function(t,e,n){const i=t.length;if(2===i)return[e,n];const r=[],o=(n-e)/(i-1);r.push(e);for(let t=1;t<i-1;t++)r.push(e+o*t);return r.push(n),r}(s.range(),l,c)),s}const mc={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function yc(t){const e=[];for(let n=0;n<t.length-1;n++)e.push((t[n]+t[n+1])/2);return e}const xc={domain:[],range:[]};const vc={domain:[],range:[],unknown:void 0},bc={domain:[],range:[],override:!1};const wc=Gr();function Mc(t,e,n){let i=t.data;t.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(t.source)?t.source:[t.source]).forEach((t=>{i.extract.push({field:t})})));const r=Ps(i,e,n);let o,a=t.type||function(t){return t.root?"h-band":t.fields&&t.fields[0]?function(t){const e=t.map((t=>"dimension"===t.type()?"band":"linear"));return-1!==e.indexOf("linear")?"linear":"band"}(t.fields):"linear"}(r);return"color"===a&&(a=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(t,r,{theme:n.theme,logger:n.logger}),o.type=a),o}wc("linear",ac),wc("band",lc),wc("h-band",(function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=ec(e,sc,r);o.ticks=ec(e.ticks,cc,r),o.value="function"==typeof e.value?e.value:t=>t.datum.value,o.label="function"==typeof e.label?e.label:t=>t.datum.value;let a=lc(o);const{values:s,labels:l,items:c,ticks:u}=function(t,e,n){const i=e.ticks.depth,r=e.value,o=e.label,a=[],s=[],l={},c=[];let u=0;if(!t)return{values:a,labels:s,items:l,ticks:c};t.eachAfter((t=>{if(t.depth>0){const e=uc(t,r,n),h=t.leaves()||[t],d=r(Ei({datum:t.data},n)),f=o(Ei({datum:t.data},n)),p=Array.isArray(t.children),g={key:e,count:h.length,value:d,label:f,leftEdge:uc(h[0],r,n),rightEdge:uc(h[Math.max(h.length-1,0)],r,n),node:t};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(e),s.push(f)),(i<=0&&!p||t.depth===i)&&c.push(g),l[e]=g}}));const h=t.height-1;return h>0&&a.splice(-h),{values:a,labels:s,items:l,ticks:c}}(n.root,o,r),h=function(t){const e=String(t),n=c[e];return a(n?o.invert?n.rightEdge:n.leftEdge:e)};Ei(!0,h,a),h.bandwidth=function(t){const e=c[String(t)],n=a.bandwidth();if(e&&!e.isLeaf){const t=h(e.leftEdge),i=h(e.rightEdge);return Math.abs(t-i)+n}return n},h.step=function(t){const e=c[String(t)],n=e?e.count:1;let i=a.step();return i*=n,i},h.data=()=>n,h.datum=t=>{const e=c[String(t)];return e?e.node.data:null},h.copy=()=>t(e,n,i),h.labels=()=>l,h.ticks=()=>u.map((t=>{const e=h(t.key),n=h.bandwidth(t.key);return{position:e+n/2,label:t.label,data:t.node.data,start:e,end:e+n}}));const d=a.pxScale;return h.pxScale=function(t){return a=d(t),h},h.domain(s),h})),wc("sequential-color",gc),wc("threshold-color",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Ul(),r=ec(t,mc,{data:e,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length;function s(t){return ji(t)?NaN:i(t)}Object.keys(i).forEach((t=>s[t]=i[t]));const l=e.fields,[c,u]=fc(r,l),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=a?r.range:d,p=[];return p=o?r.domain:r.nice?function(t,e,n){const i=2===t.length?10:Math.max(1,t.length),r=Wl().domain([e,n]).nice(i).ticks(i);if(!t||!t.length)return r;const o=Math.max(0,t.length-1);for(;r.length>o;)r[0]-e<=n-r[r.length-1]?r.shift():r.pop();return r}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(t,e,n){const i=t.length;if(2===i)return[e+(n-e)/2];const r=[],o=(n-e)/i;for(let t=1;t<i;t++)r.push(e+o*t);return r}(f,c,u):f.length<p.length+1&&(f=function(t,e,n,i){n=t[0],i=t&&t.length>=2?t[t.length-1]:i;const r=gc().domain([n,i]).range(e);return[n,...yc(t),i].map((t=>r(t)))}(p,f,c,u)),s.data=()=>e,s.range(r.invert?f.slice().reverse():f),s.domain(p),s})),wc("categorical-color",(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Fs(),r={data:e,resources:n},o=ec(t,xc,r),a="function"==typeof t.value?t.value:t=>t.datum.value,s="function"==typeof t.label?t.label:t=>t.datum.label,l=e.items||[],c={},u=[],h=[];for(let t=0;t<l.length;t++){const e=Ei({datum:l[t]},r),n=a(e,t);-1===u.indexOf(n)&&(u.push(n),h.push(s(e,t)),c[n]=t)}return i.data=()=>e,i.labels=()=>h,i.label=t=>h[u.indexOf(t)],i.datum=t=>l[c[t]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}(t,e,n),r=n.theme,o=ec(t,vc,{data:e,resources:n});let a;if(o.explicit=ec(t.explicit,bc,{data:e,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let t=r.palette("unknown");i.unknown(t[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const t=i.domain().slice(),e=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(t.length/a.length);for(let t=1;t<r+1;t*=2)a=a.concat(a);if(o.explicit.override)for(let i=0;i<e.length;i++){const r=t.indexOf(e[i]);r>-1&&(a[r]=n[i])}else{const i=e.map(((e,i)=>[t.indexOf(e),e,n[i]])).sort(((t,e)=>t[0]-e[0]));i.forEach((e=>{const n=t.indexOf(e[1]);-1!==n&&a.splice(n,0,e[2])}))}a.length=t.length}return i.range(a),i}));var kc={};function _c(){_c.init.call(this)}kc.isObject=function(t){return"object"==typeof t&&null!==t},kc.isNumber=function(t){return"number"==typeof t},kc.isUndefined=function(t){return void 0===t},kc.isFunction=function(t){return"function"==typeof t};var Sc=_c;_c.EventEmitter=_c,_c.prototype._events=void 0,_c.prototype._maxListeners=void 0,_c.defaultMaxListeners=10,_c.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},_c.prototype.setMaxListeners=function(t){if(!kc.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},_c.prototype.emit=function(t){var e,n,i,r,o,a;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(e=arguments[1])instanceof Error?e:Error('Uncaught, unspecified "error" event.');if(n=this._events[t],kc.isUndefined(n))return!1;if(kc.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(kc.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(a=n.slice()).length,o=0;o<i;o++)a[o].apply(this,r)}return!0},_c.prototype.addListener=function(t,e){var n;if(!kc.isFunction(e))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,kc.isFunction(e.listener)?e.listener:e),this._events[t]?kc.isObject(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,kc.isObject(this._events[t])&&!this._events[t].warned)&&((n=kc.isUndefined(this._maxListeners)?_c.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,kc.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),kc.isFunction(console.trace)&&console.trace()));return this},_c.prototype.on=_c.prototype.addListener,_c.prototype.once=function(t,e){if(!kc.isFunction(e))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(t,i),n||(n=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},_c.prototype.removeListener=function(t,e){var n,i,r,o;if(!kc.isFunction(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=(n=this._events[t]).length,i=-1,n===e||kc.isFunction(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(kc.isObject(n)){for(o=r;o-- >0;)if(n[o]===e||n[o].listener&&n[o].listener===e){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},_c.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],kc.isFunction(n))this.removeListener(t,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},_c.prototype.listeners=function(t){return this._events&&this._events[t]?kc.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},_c.listenerCount=function(t,e){return t._events&&t._events[e]?kc.isFunction(t._events[e])?1:t._events[e].length:0};var Nc={mixin:t=>(Object.keys(Sc.prototype).forEach((e=>{t[e]=Sc.prototype[e]})),Sc.init(t),t)};function Rc(){let t=0,e=0,n=0,i=0;n=n||t;const r={move(t){this.moveTo(n+t)},moveTo(o){const a=Math.max(t,Math.min(e-i,o));n!==a&&(n=a,r.emit("update"))},update(o){let a=!1;({min:t=t,max:e=e}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,a=!0);const s=Math.max(t,Math.min(e-i,n));n!==s&&(n=s,a=!0),a&&r.emit("update")},getState:()=>({min:t,max:e,start:n,viewSize:i})};return Nc.mixin(r),r}function Ac(t,e){const n=t.min||0,i=t.max||0,r=t.viewSize||0,o=e||Rc();return o.update({min:n,max:i,viewSize:r}),o}function Cc(t,e){return t<=e}function Dc(t,e){return t<e}function Oc(t,e,n){let i=0;for(;i<t.length&&e>t[i];)++i;return t[i]===e&&n&&++i,i}function Ec(){let t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:i=!0,includeMin:r=!0}=n;t=i?Cc:Dc,e=r?Cc:Dc},r.add=t=>{let{min:e,max:n}=t;const r=Oc(i,e),o=Oc(i,n,!0),a=[r,o-r];r%2==0&&a.push(e),o%2==0&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.remove=t=>{let{min:e,max:n}=t;const r=Oc(i,e),o=Oc(i,n,!0),a=[r,o-r];r%2==1&&a.push(e),o%2==1&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.set=t=>{const e=i.join(",");i=[],Array.isArray(t)?t.forEach(r.add):r.add(t);return e!==i.join(",")},r.clear=()=>{const t=i.length>0;return i=[],t},r.containsValue=n=>function(t,e,n,i){const r=t.length;for(let o=1;o<r;o+=2)if(n(t[o-1],e)&&i(e,t[o]))return!0;return!1}(i,n,e,t),r.containsRange=t=>{let{min:e,max:n}=t;const r=Oc(i,e,!0),o=Oc(i,n);return r===o&&o%2==1},r.toggle=t=>r.containsRange(t)?r.remove(t):r.add(t),r.ranges=()=>{const t=[];for(let e=1;e<i.length;e+=2)t.push({min:i[e-1],max:i[e]});return t},r.configure(n),r}function zc(){let t=[];function e(){}return e.add=e=>-1===t.indexOf(e)&&(t.push(e),!0),e.remove=e=>{const n=t.indexOf(e);return-1!==n&&(t.splice(n,1),!0)},e.contains=e=>-1!==t.indexOf(e),e.values=()=>t.slice(),e.clear=()=>t=[],e.toString=()=>t.join(";"),e}const Ic={key:void 0,includeMin:!0,includeMax:!0};function Tc(t){let{items:e,collection:n,vc:i}=t;const r={},o=[];let a,s;for(let t=0,o=e.length;t<o;t++){a=e[t].key,n[a]||(n[a]=i()),s=e[t].values||[e[t].value];for(let t=0;t<s.length;t++)n[a].add(s[t])&&(r[a]=r[a]||[],r[a].push(s[t]))}const l=Object.keys(r);for(let t=0,e=l.length;t<e;t++)a=l[t],o.push({id:a,values:r[a]});return o}function Pc(t){let{items:e,collection:n}=t;const i={},r=[];let o,a;for(let t=0,r=e.length;t<r;t++)if(o=e[t].key,n[o]){a=e[t].values||[e[t].value];for(let t=0;t<a.length;t++)n[o].remove(a[t])&&(i[o]=i[o]||[],i[o].push(a[t]))}const s=Object.keys(i);for(let t=0,e=s.length;t<e;t++)o=s[t],r.push({id:o,values:i[o]});return r}function qc(t){const e={};let n,i;for(let r=0,o=t.length;r<o;r++){n=t[r].key,i=t[r].values||[t[r].value],e[n]||(e[n]=[]);for(let t=0;t<i.length;t++){-1===e[n].indexOf(i[t])&&e[n].push(i[t])}}return e}function Lc(t){let{key:e,collection:n,obj:i,fn:r,value:o}=t;n[e]||(n[e]=r()),i[e]=i[e]||[],i[e].push(o),n[e].add(o)}function jc(t,e){const n=[],i=Object.keys(t);let r,o;const a=t=>-1===e[r].indexOf(t);for(let s=0,l=i.length;s<l;s++)r=i[s],e[r]?(o=t[r].filter(a),o.length&&n.push({id:r,values:o})):n.push({id:r,values:t[r]});return n}function Fc(t,e,n){const i=function(t,e){if(!Object.keys(e).length)return t;const n=t.length,i=Array(n);for(let r=0;r<n;r++)i[r]=t[r].key in e?Ei({},t[r],{key:e[t[r].key]}):t[r];return i}(e,n);return t&&t.length?t.reduce(((t,e)=>e(t)),i):i}function Bc(t){return t.replace(/(-[a-z])/g,(t=>t.toUpperCase().replace("-","")))}function Vc(t){return t.replace(/([A-Z])/g,(t=>"-".concat(t.toLowerCase())))}function $c(t,e,n){let{ranges:i,interceptors:r,rc:o,aliases:a,rangeConfig:s}=n;const l=Fc(r["".concat(e,"Ranges")],t,a);let c=!1;return l.forEach((t=>{const n=t.key;if(i[n]||(i[n]=o(s.sources[n]||s.default)),"set"===e)c=i[n][e](t.ranges||t.range)||c;else{const r=t.ranges||[t.range];for(let t=0;t<r.length;t++)c=i[n][e](r[t])||c}})),c}function Hc(){let{vc:t=zc,rc:e=Ec}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},a={sources:{},default:Ei({},Ic)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const t={values:{},ranges:{}};return Object.keys(r).forEach((e=>{t.values[e]=r[e].values()})),Object.keys(i).forEach((e=>{t.ranges[e]=i[e].ranges()})),t},c={ls:[],clear(){this.ls.forEach((t=>t.clear()))},start(){this.ls.forEach((t=>t.start()))},end(){this.ls.forEach((t=>t.end()))},update(){const t=l();this.ls.forEach((e=>e._state(t)))},updateValues(){const t=l();this.ls.forEach((e=>e._state({values:t.values})))},updateRanges(){const t=l();this.ls.forEach((e=>e._state({ranges:t.ranges})))}},u={configure:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(t.ranges)&&t.ranges.length&&(a={sources:{},default:Ei({},Ic)},t.ranges.forEach((t=>{const e={};Object.keys(Ic).filter((t=>"key"!==t)).forEach((n=>{e[n]=void 0!==t[n]?t[n]:Ic[n]})),void 0!==t.key?a.sources[t.key]=e:a.default=e})),Object.keys(i).forEach((t=>i[t].configure(a.sources[t]||a.default))),u.emit("update",[],[]))},link:t=>{if(u===t)throw new Error("Can't link to self");c.ls.push(t),t._state(l())},_state:t=>{if(!t)return l();if(t.values){const e=[];Object.keys(t.values).forEach((n=>{r[n]&&t.values[n].join(";")===r[n].toString()||e.push({key:n,values:t.values[n]})})),Object.keys(r).forEach((n=>{t.values[n]||e.push({key:n,values:[]})})),e.length&&u.setValues(e)}if(t.ranges){const e=[];Object.keys(t.ranges).forEach((n=>{i[n]&&t.ranges[n].join(";")===i[n].toString()||e.push({key:n,ranges:t.ranges[n]})})),Object.keys(i).forEach((n=>{t.ranges[n]||e.push({key:n,ranges:[]})})),e.length&&u.setRanges(e)}},start:function(){if(!n){n=!0;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];u.emit("start",...e),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];u.emit("end",...e),c.end()}},isActive:()=>n,clear:()=>{const t=u.brushes().filter((t=>"value"===t.type&&t.brush.values().length)).map((t=>({id:t.id,values:t.brush.values()}))),e=Object.keys(i).length>0||t.length;i={},r={},e&&(u.emit("update",[],t),c.clear())},brushes:()=>{let t=[];return t=t.concat(Object.keys(i).map((t=>({type:"range",id:t,brush:i[t]})))),t=t.concat(Object.keys(r).map((t=>({type:"value",id:t,brush:r[t]})))),t},addValue:(t,e)=>{u.addValues([{key:t,value:e}])},addValues:e=>{const i=Fc(s.addValues,e,o),a=Tc({vc:t,collection:r,items:i});u.emit("add-values",i),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=e=>{const i=Fc(s.setValues,e,o),a=function(t){let{items:e,vCollection:n,vc:i}=t;const r={},o=qc(e);let a,s=[],l=[];const c={},u=Object.keys(n);for(let t=0,e=u.length;t<e;t++)a=u[t],c[a]=n[a].values().slice(),delete n[a];const h=t=>{n[a]&&n[a].contains(t)||Lc({key:a,value:t,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let t=0,e=d.length;t<e;t++)a=d[t],o[a].forEach(h);return l=jc(c,r),s=jc(r,c),[s,l]}({items:i,vCollection:r,vc:t});u.emit("set-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(t,e)=>{u.removeValues([{key:t,value:e}])},u.removeValues=t=>{const e=Fc(s.removeValues,t,o),n=Pc({collection:r,items:e});u.emit("remove-values",e),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(e,i)=>{const a=Fc(s.addValues,e,o),l=Fc(s.removeValues,i,o),h=Tc({vc:t,collection:r,items:a}),d=Pc({collection:r,items:l});u.emit("add-values",a),u.emit("remove-values",l),(h.length||d.length)&&(n||(n=!0,u.emit("start")),u.emit("update",h,d),c.updateValues())},u.toggleValue=(t,e)=>{u.toggleValues([{key:t,value:e}])},u.toggleValues=e=>{const i=Fc(s.toggleValues,e,o),a=function(t){let{items:e,values:n,vc:i}=t;const r={},o={},a=[],s=[],l=qc(e);let c,u,h;const d=Object.keys(l);for(let t=0,e=d.length;t<e;t++){c=d[t],h=l[c];for(let t=0,e=h.length;t<e;t++)u=h[t],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):Lc({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let t=0,e=f.length;t<e;t++)c=f[t],a.push({id:c,values:r[c]});const p=Object.keys(o);for(let t=0,e=p.length;t<e;t++)c=p[t],s.push({id:c,values:o[c]});return[a,s]}({items:i,values:r,vc:t});u.emit("toggle-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(t,e)=>{let n=o[t]||t;return!!r[n]&&r[n].contains(e)},u.addRange=(t,e)=>{u.addRanges([{key:t,range:e}])},u.addRanges=t=>{$c(t,"add",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(t,e)=>{u.removeRanges([{key:t,range:e}])},u.removeRanges=t=>{$c(t,"remove",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(t,e)=>{u.setRanges([{key:t,range:e}])},u.setRanges=t=>{$c(t,"set",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(t,e)=>{u.toggleRanges([{key:t,range:e}])},u.toggleRanges=t=>{$c(t,"toggle",{ranges:i,rc:e,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(t,e)=>{let n=o[t]||t;return!!i[n]&&i[n].containsValue(e)},u.containsRange=(t,e)=>{let n=o[t]||t;return!!i[n]&&i[n].containsRange(e)},u.containsMappedData=(t,e,n)=>{let a=[];const s=Object.keys(t);let l,c,u,h;for(let e=0,n=s.length;e<n;e++){if(l=s[e],"value"===l)c=t,a[e]={key:"",i:e,bool:!1};else{if("source"===l)continue;c=t[l],a[e]={key:l,i:e,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,i[u]?a[e].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(a[e].bool=!0))}return e?(a=a.filter((t=>-1!==e.indexOf(t.key))),"and"===n?!!a.length&&!a.some((t=>!1===t.bool)):"xor"===n?!!a.length&&a.some((t=>t.bool))&&a.some((t=>!1===t.bool)):a.some((t=>t.bool))):a.some((t=>t.bool))},u.intercept=(t,e)=>{const n=Bc(t);s[n]&&s[n].push(e)},u.removeInterceptor=(t,e)=>{const n=Bc(t);if(!s[n])return;const i=s[n].indexOf(e);-1!==i&&s[n].splice(i,1)},u.removeAllInterceptors=t=>{const e=[];if(t){const n=Bc(t);s[n]&&s[n].length&&e.push({name:t,handlers:s[n]})}else Object.keys(s).forEach((t=>{s[t].length&&e.push({name:Vc(t),handlers:s[t]})}));e.forEach((t=>{t.handlers.slice().forEach((e=>u.removeInterceptor(t.name,e)))}))},u.addKeyAlias=(t,e)=>{o[t]=e},u.removeKeyAlias=t=>{delete o[t]},Nc.mixin(u),u}function Wc(t){return t*t*t}function Uc(t){return--t*t*t+1}function Yc(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Gr();const Xc=["stroke","fill","color","backgroundColor","thumbColor"];function Gc(t,e){const n=e?e.length:0,i=t?Math.min(n,t.length):0,r=new Array(i),o=new Array(n);let a;for(a=0;a<i;++a)r[a]=Kc(t[a],e[a]);for(;a<n;++a)o[a]=e[a];return function(t){for(a=0;a<i;++a)o[a]=r[a](t);return o}}function Kc(t,e,n){const i=typeof e;let r;return null==e||"boolean"===i?function(t){return()=>t}(e):("number"===i?Cl:"string"===i?(r=al(e))&&Xc.includes(n)?(e=r,Sl):zl:e instanceof al?Sl:e instanceof Date?Al:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}(e)?Nl:Array.isArray(e)?Gc:"function"!=typeof e.valueOf&&"function"!=typeof e.toString||isNaN(e)?Zc:Cl)(t,e)}function Zc(t,e){const n={},i={};let r;for(r in null!==t&&"object"==typeof t||(t={}),null!==e&&"object"==typeof e||(e={}),e)r in t?n[r]=Kc(t[r],e[r],r):i[r]=e[r];return function(t){for(r in n)i[r]=n[r](t);return i}}function Jc(t,e){return t.data?t.data.value:"text"===t.type?t.text:e}const Qc={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},tu=/^\$/;function eu(t){const e=typeof t;return"object"!==e&&"function"!==e&&"undefined"!==e}function nu(t,e,n){const i=t[e];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(t[e]=i.pxScale(n))}function iu(t,e){return t.pxScale?t.pxScale(e):t}const ru={normalizeSettings:function(t,e,n){const i=Ei({},t),r=Ei({},e);return Object.keys(i).forEach((t=>{r[t]={};const o=i[t],a=typeof o;if("function"==typeof o)r[t].fn=o;else if(eu(o)){let n=e[t];"string"==typeof n&&tu.test(n)&&(n=Qc[n]);const i=typeof n;r[t]="undefined"===i||i===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[t].fn=o.fn),void 0!==o.scale&&(r[t].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[t].ref=o.ref))})),Object.keys(e).forEach((t=>{if(t in i)return;const n=e[t];"string"===typeof n&&tu.test(n)?r[t]=Qc[n]:r[t]=n})),r},resolveForItem:function(t,e,n){const i={},r=Object.keys(e),o=r.length,a=t.datum,s=t.datum;for(let l=0;l<o;l++){const o=r[l],c=e[o],u="object"==typeof s&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in s,f=h?s[c.ref]:d?s[o]:a;eu(c)?i[o]=c:u&&c.fn?(c.scale&&(t.scale=c.scale),i[o]=c.fn.call(null,t,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,t,n):i[o]=c}return i},updateScaleSize:nu};function ou(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((t,e)=>Array.isArray(e.children)?(t.push(...ou(e.children)),t):(t.push(e),t)),[])}function au(t,e){let{context:n,data:i,style:r,filter:o,mode:a}=e;const s=t.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((t=>{h.push(t)})),Object.keys(u).forEach((t=>{-1===h.indexOf(t)&&h.push(t)}));const d=[];let f=!1;const p=()=>{let e=ou(t.nodes);return"function"==typeof o&&(e=e.filter(o)),e},g=()=>{const t=p(),e=t.length;let n,i=!1;const r="function"==typeof l?l({brush:s}):l;for(let i=0;i<e;i++){if(n=t[i].data,!n)continue;t[i].__style||(t[i].__style={},h.forEach((e=>{t[i].__style[e]=t[i][e]})));const e=s.containsMappedData(n,r,a),o=d.indexOf(t[i]);let l=!1;e&&-1===o?(d.push(t[i]),l=!0):e||-1===o||(d.splice(o,1),l=!0),t[i].needToUpdate=l||f,t[i].isActive=e}for(let r=0;r<e;r++)if(n=t[r].data,n){if(t[r].needToUpdate){const e=Ei({},t[r],t[r].__style),n=t[r].isActive;h.forEach((i=>{t[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,e,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,e,d):u[i]:t[r].__style[i]})),i=!0}delete t[r].needToUpdate}return f=!1,i},m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=e,i=p(),r=i.length;for(let t=0;t<r;t++)i[t].data&&(i[t].__style=i[t].__style||{},h.forEach((e=>{i[t].__style[e]=i[t][e],e in u&&(i[t][e]="function"==typeof u[e]?u[e].call(null,i[t]):u[e])})));f=!0,d.length=0,n||t.renderer.render(t.nodes)},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=e,i=p(),r=i.length;for(let t=0;t<r;t++)i[t].__style&&(Object.keys(i[t].__style).forEach((e=>{i[t][e]=i[t].__style[e]})),i[t].__style=void 0);d.length=0,n||t.renderer.render(t.nodes)},x=()=>{if(g()){const e="function"==typeof t.config.sortNodes?t.config.sortNodes(t):t.nodes;"function"==typeof t.config.customRender?t.config.customRender({render:t.renderer.render,nodes:e}):t.renderer.render(e)}};return s.on("start",m),s.on("end",y),s.on("update",x),{isActive:()=>s.isActive(),update:()=>{d.length=0,f=!0,g()},cleanUp:function(){s.removeListener("start",m),s.removeListener("end",y),s.removeListener("update",x)}}}function su(t){let{nodes:e,action:n,chart:i,trigger:r}=t;const o=[];for(let t=0;t<e.length;t++){let n=e[t].data;null!==n&&o.push(n)}!function(t){let{dataPoints:e,action:n,chart:i,trigger:r}=t;if(!r)return;const o=r.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let t=0;t<e.length;t++){const n=e[t];n&&o.forEach((t=>{let e=n&&!t?n:n[t];if(e){let t={key:e.source.field};void 0!==e.source.key&&(t.key="".concat(e.source.key,"/").concat(e.source.field)),Array.isArray(e.value)?(t.range={min:e.value[0],max:e.value[1]},a.items.push(t)):(t.value=e.value,s.items.push(t))}}))}r.contexts.forEach((t=>{a.items.length?i.brush(t)[a.actionFn](a.items):i.brush(t)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function lu(t){let{collisions:e,t:n,config:i,action:r}=t,o=[],a=!1;e.length>0&&(o=e,a=!0,"stop"===n.propagation&&(o=[e[e.length-1]]));const s=o.map((t=>t.node));return su({nodes:s,action:r,chart:i.chart,data:i.data,trigger:n}),a}function cu(t,e,n){const i=n.element().getBoundingClientRect();let r=qi(t)?function(t,e){return 1!==t.changedTouches.length?null:{x:t.changedTouches[0].clientX-e.left,y:t.changedTouches[0].clientY-e.top}}(t,i):function(t,e){return{x:t.clientX-e.left,y:t.clientY-e.top}}(t,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(e.touchRadius>0&&qi(t)?r={cx:r.x,cy:r.y,r:e.touchRadius}:e.mouseRadius>0&&!qi(t)&&(r={cx:r.x,cy:r.y,r:e.mouseRadius}),n.itemsAt(r))}function uu(t,e,n){return t?"function"==typeof t?t(e):t:n}const hu={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function du(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let e=0;e<t.length;e++){const i=t[e];n+=0===e?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return e&&(n+="Z"),n}function fu(t,e,n,i){const r=n/2,o=t-i/2,a=e-i/2,s=t-r,l=e-r;return[{x:o,y:a},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:a},{x:s+n,y:a},{x:s+n,y:a+i},{x:o+i,y:a+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:a+i},{x:s,y:a+i},{x:s,y:a}]}function pu(t){return-t/180*Math.PI}function gu(t){return function(t){let e=(.5*(Math.floor(t/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(e-t))*Math.sqrt(2),i=n*Math.cos(t),r=n*Math.sin(t);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(pu(t))}function mu(t,e){return{x:t.x+e.x,y:t.y+e.y}}function yu(t,e){return{x:t.x-e.x,y:t.y-e.y}}function xu(t,e){return{x:t.x*e,y:t.y*e}}function vu(t,e){return t.x-e.x}function bu(t,e){return t.y-e.y}function wu(t,e){return vu(t,e)**2+bu(t,e)**2}function Mu(t,e){return Math.sqrt(wu(t,e))}function ku(t,e){return t.x*e.x+t.y*e.y}function _u(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(e),r=Math.sin(e),o=yu(t,n);return mu({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const Su={up:0,down:180,left:90,right:-90};function Nu(t){let{x:e,y:n,size:i}=t;const r=i/2;return{type:"rect",x:e-r,y:n-r,width:i,height:i}}const Ru=Gr();Ru.add("circle",(function(t){return{type:"circle",fill:"black",cx:t.x,cy:t.y,r:t.size/2}})),Ru.add("diamond",(function(t){const e=t.size,n=t.x-e/2,i=t.y-e/2;return{type:"path",fill:"black",d:du([{x:n,y:i+e/2},{x:n+e/2,y:i},{x:n+e,y:i+e/2},{x:n+e/2,y:i+e},{x:n,y:i+e/2}])}})),Ru.add("saltire",(function(t){const e=pu(45),n=t.size/2,i=isNaN(t.width)?n/2:t.width,r=Math.min(i,n);let o=t.size;const a=Math.sin(Math.asin(-e))*(r/2);o+=2*(n/Math.sin(-e)-n),o-=2*a;const s={x:t.x,y:t.y},l=fu(t.x,t.y,o,r).map((t=>_u(t,e,s)));return{type:"path",fill:"black",d:du(l)}})),Ru.add("square",(function(t){const e=t.size;return{type:"rect",fill:"black",x:t.x-e/2,y:t.y-e/2,width:e,height:e}})),Ru.add("triangle",(function(t){const e=t.size,n={x:t.x,y:t.y},i=Su[t.direction]||0,r=e/2,o=t.x-r,a=t.y-r;let s=[{x:o,y:a+e},{x:o+r,y:a},{x:o+e,y:a+e},{x:o,y:a+e}];const l=pu(i);return s=s.map((t=>_u(t,l,n))),{type:"path",fill:"black",d:du(s)}})),Ru.add("line",(function(t){const e="vertical"===t.direction,n=t.size/2,i=t.x,r=t.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(e?0:n),y1:r-(e?n:0),x2:i+(e?0:n),y2:r+(e?n:0),collider:Nu(t)}})),Ru.add("star",(function(t){const e=t.size,n=[],i=e/2,r=t.points||5,o=Math.min(t.innerRadius||e/2,e)/2,a=isNaN(t.startAngle)?90:t.startAngle,s=360/r;for(let e=1;e<=r;e++){const r=s*e+a,l=pu(r),c=pu(r+s/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:t.x+h*i,y:t.y+u*i}),n.push({x:t.x+f*o,y:t.y+d*o})}return{type:"path",fill:"black",d:du(n)}})),Ru.add("n-polygon",(function(t){const e=[],n=t.size/2,i=Math.max(isNaN(t.sides)?6:t.sides,3),r=360/i,o=isNaN(t.startAngle)?0:t.startAngle;for(let a=1;a<=i;a++){const i=pu(r*a+o),s=Math.sin(i),l=Math.cos(i);e.push({x:t.x+l*n,y:t.y+s*n})}return{type:"path",fill:"black",d:du(e)}})),Ru.add("cross",(function(t){const e=t.x,n=t.y,i=t.size/2,r=isNaN(t.width)?i/2:t.width,o=Math.min(r,i);return{type:"path",fill:"black",d:du(fu(e,n,t.size,o))}})),Ru.add("bar",(function(t){const e={x:t.x,y:t.y},n="vertical"===t.direction,i=t.size/2,r=i/2/2;let o=[{x:e.x-i,y:e.y+r},{x:e.x-i,y:e.y-r},{x:e.x+i,y:e.y-r},{x:e.x+i,y:e.y+r}];if(n){const t=pu(90);o=o.map((n=>_u(n,t,e)))}const a=$i(o);return a.type="rect",a.fill="black",a})),Ru.add("rect",(function(t){const{x:e,y:n,size:i}=t,r=void 0===t.width?i:t.width,o=void 0===t.height?i:t.height;return{type:"rect",fill:"black",x:e-r/2,y:n-o/2,width:r,height:o}}));const Au=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ru;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=t.get(e.type);if(n){const t=n(e);return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(e).forEach((n=>{void 0!==hu[n]&&"transform"!==n&&(t[n]=e[n])}))}(t,e),void 0!==e.data&&(t.data=e.data),t}return n}};function Cu(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:i=0,prioOrder:r=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=t;n=n||"center";return{computePreferredSize(t){let{inner:n,outer:i,children:r}=t;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},e):o},dock(t){return void 0!==t?(n=t,this):"function"==typeof n?n(e):n},displayOrder(t){return void 0!==t?(i=t,this):"function"==typeof i?i(e):i},prioOrder(t){return void 0!==t?(r=t,this):"function"==typeof r?r(e):r},minimumLayoutMode(t){return void 0!==t?(a=t,this):"function"==typeof a?a(e):a},show(t){return void 0!==t?(s=t,this):"function"==typeof s?s(e):s}}}function Du(t,e,n){const{require:i=[]}=e,r=e.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:g,registries:m,resolver:y,update:x,_DO_NOT_USE_getInfo:v,symbol:b,isVisible:w}=n;t.emit=()=>{},w&&(t.isVisible=w),Object.defineProperty(t,"settings",{get:o}),Object.defineProperty(t,"data",{get:l}),Object.defineProperty(t,"formatter",{get:a}),Object.defineProperty(t,"scale",{get:s}),Object.defineProperty(t,"mediator",{get:d}),Object.defineProperty(t,"style",{get:g}),Object.defineProperty(t,"registries",{get:m}),p&&Object.defineProperty(t,"rect",{get:p}),v&&(t._DO_NOT_USE_getInfo=v),Object.keys(e).forEach((n=>{var i;i=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((t=>t===i))||("function"==typeof e[n]?t[n]=e[n].bind(t):t[n]=e[n])})),i.forEach((e=>{"renderer"===e?Object.defineProperty(t,"renderer",{get:c}):"chart"===e?Object.defineProperty(t,"chart",{get:u}):"dockConfig"===e?Object.defineProperty(t,"dockConfig",{get:h}):"instance"===e?Object.defineProperty(t,"instance",{get:f}):"update"===e&&x?Object.defineProperty(t,"update",{get:x}):"resolver"===e?Object.defineProperty(t,"resolver",{get:y}):"symbol"===e&&Object.defineProperty(t,"symbol",{get:b})})),Object.keys(r).forEach((e=>{t.mediator.on(e,r[e].bind(t))}))}function Ou(t,e,n){const i=e=>t[e]?(n.warn("Deprecation Warning the ".concat(e," property should be moved into layout: {} property")),t[e]):t.layout?t.layout[e]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),t.layout=t.layout||{},t.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:t.layout.displayOrder,t.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:t.layout.prioOrder,t.layout.dock=r.dock||t.layout.dock,t.layout.minimumLayoutMode=r.minimumLayoutMode||t.layout.minimumLayoutMode,r.show=t.show,r.preferredSize=e,r}function Eu(t,e,n){Object.keys(n.on||{}).forEach((i=>{t.eventListeners=t.eventListeners||[];const r=n.on[i].bind(t);t.eventListeners.push({event:i,listener:r}),e.on(i,r)})),t.emit=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return e.emit(t,...i)}}function zu(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=()=>({})}=t,{chart:r,container:o,mediator:a,registries:s,theme:l,renderer:c}=e,u=Nc.mixin({});let h,d,f,p,g,m=e.settings||{},y=Ei(!0,{},n,m),x=[],v=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ru,n={};return{resolve:function(i){let{data:r,settings:o,defaults:a={},scaled:s}=i;const l=n.norm=e.normalizeSettings(o,a,t.chart),c={scale:t.chart.scale,formatter:t.chart.formatter};s&&Object.keys(s).forEach((t=>{l[t]&&e.updateScaleSize(l,t,s[t])}));const u=[];if(!r||!Array.isArray(r.items)){const t={data:r,resources:c};let i=e.resolveForItem(t,n.norm,-1);return{settings:n.norm,item:i}}{let t;for(let i=0,o=r.items.length;i<o;i++){t={datum:r.items[i],data:r,resources:c};let o=e.resolveForItem(t,n.norm,i);o.data=r.items[i],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:r}),b=!1;const w={nodes:[],chart:r,config:y.brush||{},renderer:null},M={tap:[],over:[]},k=[],_={},S=Ei({},m);function N(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==t[e],o=void 0!==m[e];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return r&&("function"==typeof t[e]?a=t[e].call(_,...l):i&&(a=t[e])),o&&("function"==typeof m[e]?a=m[e].call(S,...l):i&&(a=m[e])),r||o||(a=n.call(_,...l)),a}}const R=N("preferredSize",(()=>0),!0),A=N("resize",(t=>{let{inner:e}=t;return e})),C=N("created"),D=N("beforeMount"),O=N("mounted"),E=N("beforeUnmount"),z=N("beforeUpdate"),I=N("updated"),T=N("beforeRender"),P=N("beforeDestroy"),q=N("destroyed"),L=t.render,j=()=>{y.brush&&(y.brush.consume||[]).forEach((t=>{t.context&&t.style&&k.push(au(w,t))}))},F=()=>{y.brush&&(y.brush.trigger||[]).forEach((t=>{"over"===t.on?M.over.push(t):M.tap.push(t)}))};Object.defineProperty(w,"data",{get:()=>x});const B=y.renderer||t.renderer,V=B?c||s.renderer(B)():c||s.renderer()();"function"==typeof V.settings&&V.settings(y.rendererSettings),w.renderer=V;const $={resources:r.logger?{logger:r.logger()}:{}};let H=Cu(Ou(y,R,r.logger()),$);const W=t=>{t.key=y.key,t.element=V.element()},U=()=>{};U.dockConfig=()=>H,U.set=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.settings&&(m=t.settings,y=Ei(!0,{},n,t.settings),H=Cu(Ou(y,R,r.logger()),$),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:t}=y,e="function"==typeof(null==t?void 0:t.progressive)&&t.progressive(),n=Ps(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);e?e.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=h?h.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?d=r.formatter(y.formatter):h&&h.data().fields&&(d=h.data().fields[0].formatter()),g=l.style(y.style||{})},U.resize=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=A({inner:t,outer:e});p=n?V.size(n):V.size(t),S.rect=Ei(!0,{computedPhysical:p.computedPhysical,computedOuter:e.computed||e,computedInner:t.computed||t},t),p=Ei(!0,{computedOuter:e.computed||e,computedInner:t.computed||t},p)},U.getRect=()=>S.rect;const Y=()=>{const t=V.renderArgs?V.renderArgs.slice(0):[],{rendererSettings:e}=y;let n=x;const i="function"==typeof(null==e?void 0:e.progressive)&&e.progressive();return x.items&&i&&(n=Pi(Pi({},x),{},{items:x.items.slice(i.start,i.end)})),t.push({data:n}),t};let X,G,K;function Z(t){const{rendererSettings:e}=y,n="function"==typeof(null==e?void 0:e.progressive)&&e.progressive();n?n.isFirst?w.nodes=[...t||[]]:w.nodes&&(w.nodes=[...w.nodes,...t||[]]):w.nodes=t}U.beforeMount=D,U.beforeRender=()=>{T({size:p})},U.render=()=>{const t=L.call(_,...Y());Z(t),V.render(t),X=t,G=S.rect.computed},U.hide=()=>{U.unmount(),V.size({x:0,y:0,width:0,height:0}),V.clear()},U.beforeUpdate=()=>{z({settings:y,data:x})},U.update=()=>{K&&K.stop();const{rendererSettings:t,brush:e,animations:n}=y;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return V.render(),void(X=null);const i=L.call(_,...Y());Z(i),k.forEach((t=>t.cleanUp())),k.length=0,M.tap=[],M.over=[],e&&(j(),F()),k.forEach((t=>{t.isActive()&&t.update()})),X&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:X,currentRect:S.rect.computed,previousRect:G}),K=function(t,e,n,i){let r,{old:o,current:a}=t,{renderer:s}=e,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||Jc,g={start(){let t={};if(o.forEach(((e,n)=>{let i=p(e,n);t[i]=e})),a.forEach(((e,n)=>{let i=p(e,n);if(t[i]){if("path"===e.type&&e.points&&e.points.length>0&&"trend"!==e.data.source.key){const n=function(t,e){const n=t.points.filter((t=>!t.dummy)),i=e.points.filter((t=>!t.dummy)),r=i.map((t=>t.data.major.value)),o=n.filter((t=>r.includes(t.data.major.value))).map((t=>t.data.major.value)),a=n.filter((t=>o.includes(t.data.major.value))),s=i.filter((t=>o.includes(t.data.major.value)));return{old:a,current:s}}(t[i],e);h.ips.push(Zc(Ei({},t[i],{points:n.old}),Ei({},e,{points:n.current}))),l.push(Ei({},t[i],{commonPoints:n.old}))}else h.ips.push(Zc(t[i],e)),l.push(t[i]);h.nodes.push(e),t[i]=!1}else c.nodes.push(e),c.ips.push(Zc(Ei({},e,{r:.001,opacity:0}),e))})),Object.keys(t).forEach((e=>{t[e]&&(u.nodes.push(t[e]),u.ips.push(Zc(t[e],Ei({},t[e],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:Wc,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:Yc,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:Uc,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var e;const t=null===(e=n.isMainComponent)||void 0===e?void 0:e.filterFn,r=t?l.filter(t).length:l.length,{isInit:o,shouldBeRemoved:a}=i.getValue("animations.updatingStageMeta");!1===o?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===r)}d.length&&(f=s.getScene(a),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(g.tick)))},tick(){let t=d[0];t||g.stop(),t.started||(t.started=Date.now());let e=(Date.now()-t.started)/t.duration,n=[],o=t.tweens.map((n=>n(t.easing(Math.min(1,e)))));if(n.push(...o),n.push(...t.nodes),s.render(n),e>=1){d.shift();const{isInit:t,shouldBeRemoved:e}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&e&&d.shift():(!0===t&&i.setValue("animations.updatingStageMeta.isInit",!1),g.stop())}r&&(r=window.requestAnimationFrame(g.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return g}({old:X,current:i},{renderer:V},n,r.storage),K.start()):V.render(i),X=i,G=S.rect.computed,V.setKey&&"string"==typeof m.key&&V.setKey(m.key)},U.updated=I,U.destroy=()=>{U.unmount(),P(f),V.destroy(),q(),f=null};const J=t=>{w.nodes=t,k.forEach((t=>{t.isActive()&&t.update()})),V.render(t)};return Du(_,t,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>V,chart:()=>r,dockConfig:()=>H,mediator:()=>a,instance:()=>S,rect:()=>S.rect,style:()=>g,update:()=>J,registries:()=>s,resolver:()=>v,symbol:()=>Au(s.symbol)}),Du(S,m,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>V,chart:()=>r,dockConfig:()=>H,mediator:()=>a,style:()=>g,_DO_NOT_USE_getInfo:i.bind(_),isVisible:()=>b}),U.getBrushedShapes=function(t,e,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(t),a=V.findShapes("*");y.brush.consume.filter((e=>e.context===t)).forEach((t=>{for(let r=0;r<a.length;r++){const s=a[r];s.data&&o.containsMappedData(s.data,n||t.data,e)&&(W(s),i.push(s),a.splice(r,1),r--)}}))}return i},U.findShapes=t=>{var e;const n=(null!==(e=K)&&void 0!==e&&e.inProgress()?K.targetScene:V).findShapes(t);for(let t=0,e=n.length;t<e;t++)W(n[t]);return n},U.shapesAt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=V.itemsAt(t);let i;i=e&&"stop"===e.propagation&&n.length>0?[n.pop().node]:n.map((t=>t.node));for(let t=0,e=i.length;t<e;t++)W(i[t]);return i},U.brushFromShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.contexts=Array.isArray(e.contexts)?e.contexts:[];su({nodes:t,action:e.action||"toggle",trigger:e,chart:r,data:w.data})},U.mount=()=>{f=V.element&&V.element()?f:V.appendTo(o),V.setKey&&"string"==typeof m.key&&V.setKey(m.key),y.brush&&(j(),F()),Eu(S,u,m),Eu(_,u,t),b=!0},U.mounted=()=>O(f),U.unmount=()=>{[S,_].forEach((t=>{!function(t,e){t.eventListeners&&(t.eventListeners.forEach((t=>{let{event:n,listener:i}=t;e.removeListener(n,i)})),t.eventListeners.length=0),t.emit=()=>{}}(t,u)})),M.tap=[],M.over=[],k.forEach((t=>{t.cleanUp()})),k.length=0,E(),b=!1},U.onBrushTap=t=>{M.tap.forEach((e=>{(function(t){let{e:e,t:n,config:i}=t;return lu({collisions:cu(e,n,i.renderer),t:n,config:i,action:uu(n.action,e,"toggle")})})({e:t,t:e,config:w})&&"stop"===e.globalPropagation&&r.toggleBrushing(!0)}))},U.onBrushOver=t=>{M.over.forEach((e=>{(function(t){let{e:e,t:n,config:i}=t;return lu({collisions:cu(e,n,i.renderer),t:n,config:i,action:uu(n.action,e,"set")})})({e:t,t:e,config:w})&&"stop"===e.globalPropagation&&r.toggleBrushing(!0)}))},U.def=_,U.ctx=S,U.renderer=()=>V,U.set({settings:m}),C(),U}function Iu(t){const e=Ei(!0,{},t),n={getAll:()=>e,getValue:(t,n)=>function(t,e,n){if(void 0===t||void 0===e)return n;const i=e.split(".");let r=t;for(let t=0;t<i.length;++t){const e=i[t];if(void 0===r[e])return n;r=r[e]}return r}(e,t,n),setValue:(t,n)=>function(t,e,n){if(void 0===t||void 0===e)return;const i=e.split("."),r=i[i.length-1];let o=t;for(let t=0;t<i.length-1;++t){const e=i[t];void 0===o[e]&&(o[e]=Number.isNaN(+i[t+1])?{}:[]),o=o[e]}void 0!==n?o[r]=n:delete o[r]}(e,t,n)};return n}function Tu(t,e,n){const i=mu(function(t,e){const n=ku(t,e)/ku(e,e)||1;return{x:e.x*n,y:e.y*n}}(yu(n,t),yu(e,t)),t);return i}function Pu(t,e,n){return Mu(t,n)+Mu(e,n)-Mu(t,e)<1e-12}function qu(t,e){return t.x>=e.x&&t.x+t.width<=e.x+e.width&&t.y>=e.y&&t.y+t.height<=e.y+e.height}function Lu(t){return t.x1===t.x2&&t.y1===t.y2}function ju(t){return t.width<=0||t.height<=0}function Fu(t){return t.r<=0}function Bu(t){return t.edges.length<=2}function Vu(t,e){let n=!1;for(let i=0,r=e.edges.length;i<r;i++)if(n=Gu(t,Hi(e.edges[i])),!0===n)return!0;return!1}function $u(t,e){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++){if(n=rh(t,r[e]),!0===n)return!0}return!1}function Hu(t,e){if(Fu(t))return!1;return wu({x:t.cx,y:t.cy},e)<=t.r**2}function Wu(t,e){if(ju(e)||Fu(t))return!1;const n=e.width/2,i=e.height/2,r=e.x+n,o=e.y+i,a=t.r,s=t.cx,l=t.cy,c=Math.abs(s-r),u=Math.abs(l-o);if(c>n+a||u>i+a)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=a**2}function Uu(t,e){if(Fu(t)||Lu(e))return!1;const[n,i]=Bi(e);if(Hu(t,n)||Hu(t,i))return!0;const r={x:t.cx,y:t.cy},o=Tu(n,i,r);return wu(o,r)<=t.r**2&&Pu(n,i,o)}function Yu(t,e){if(Bu(e)||Fu(t))return!1;if(Xu(e,{x:t.cx,y:t.cy}))return!0;const n=e.edges.length;for(let i=0;i<n;i++){if(Uu(t,Hi(e.edges[i])))return!0}return!1}function Xu(t,e){if(Bu(t)||!Qu(t.boundingRect(),e))return!1;const{x:n,y:i}=e,r=t.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=r.length,s=a-1;++l<a;s=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[s].y&&r[l].y===i&&(n-r[l].x)*(n-r[s].x)<=0)return!0;if(r[l].y<i&&i<=r[s].y||r[s].y<i&&i<=r[l].y){if(c=(r[s].x-r[l].x)*(i-r[l].y)/(r[s].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Gu(t,e){if(Bu(t))return!1;for(let n=0,i=t.edges.length;n<i;n++){if(eh(e,Hi(t.edges[n])))return!0}const[n,i]=Bi(e);return Xu(t,n)||Xu(t,i)}function Ku(t,e){if(Bu(t))return!1;for(let n=0,i=t.edges.length;n<i;n++){if(th(e,Hi(t.edges[n])))return!0}const[n,i,r,o]=Vi(e);return Xu(t,n)||Xu(t,i)||Xu(t,r)||Xu(t,o)}function Zu(t,e){return!ju(t)&&!ju(e)&&(t.x<=e.x+e.width&&e.x<=t.x+t.width&&t.y<=e.y+e.height&&e.y<=t.y+t.height)}function Ju(t,e){if(ju(t)||ju(e))return!1;return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}].every((e=>Qu(t,e)))}function Qu(t,e){return!ju(t)&&(e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height)}function th(t,e){if(Lu(e)||ju(t))return!1;const[n,i]=Bi(e);if(Qu(t,n)||Qu(t,i))return!0;const r=Vi(t);let o=r.length;for(let t=0;t<o;t++){if(eh(Hi([r[t],r[3!==t?t+1:0]]),e))return!0}return!1}function eh(t,e){const[n,i]=Bi(t),[r,o]=Bi(e),a=vu(i,n),s=bu(i,n),l=vu(o,r),c=bu(o,r),u=vu(n,r),h=bu(n,r);let d=c*a-l*s;const f=l*h-c*u,p=a*h-s*u;let g,m;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===a){if(0===s)return n.x===i.x&&n.y===i.y;g=bu(r,n)/s,m=bu(o,n)/s}else g=(r.x-n.x)/a,m=(o.x-n.x)/a;return!(g<0&&m<0||g>1&&m>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function nh(t,e){if(Lu(t))return!1;const[n,i]=Bi(t);return Pu(n,i,e)}function ih(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!Zu(n,i)&&(Ju(n,i)?Vu(t,e):Vu(e,t))}function rh(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!Zu(n,i)&&(Ju(i,n)?function(t,e){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++)if(n=ih(e,r[t]),!0===n)return!0;return!1}(t,e):function(t,e){let n=!1;for(let i=0,r=e.edges.length;i<r;i++)if(n=sh(t,Hi(e.edges[i])),!0===n)return!0;return!1}(t,e))}function oh(t,e){if(Fu(t))return!1;if(ah(e,{x:t.cx,y:t.cy}))return!0;const{numPolygons:n,polygons:i}=e;for(let e=0;e<n;e++){const n=i[e],r=n.edges.length;for(let e=0;e<r;e++){if(Uu(t,Hi(n.edges[e])))return!0}}return!1}function ah(t,e){if(!Qu(t.boundingRect(),e))return!1;const{x:n,y:i}=e,r=t.numPolygons;let o,a,s,l,c,u,h=!1;for(a=0;a<r;a++)for(o=t.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function sh(t,e){const[n,i]=Bi(e);if(ah(t,n)||ah(t,i))return!0;const{numPolygons:r,polygons:o}=t;for(let t=0;t<r;t++){const n=o[t];for(let t=0,i=n.edges.length;t<i;t++){if(eh(e,Hi(n.edges[t])))return!0}}return!1}function lh(t,e){const[n,i,r,o]=Vi(e);if(ah(t,n)||ah(t,i)||ah(t,r)||ah(t,o))return!0;const{numPolygons:a,polygons:s}=t;for(let t=0;t<a;t++){const n=s[t];for(let t=0,i=n.edges.length;t<i;t++){if(th(e,Hi(n.edges[t])))return!0}}return!1}const ch=/^\$/,uh="@extend";function hh(t){throw new Error('Cyclical reference for "'.concat(t,'"'))}function dh(t,e,n){if("string"==typeof t){let i=e[t];return-1!==n.indexOf(t)&&hh(t),ch.test(i)?(n.push(t),dh(i,e,n)):i}let i=t;const r=Ei(!0,{},e,t),o={};if(t[uh]){const o=t[uh];-1!==n.indexOf(o)&&hh(o);let a=n.slice();a.push(o),i=Ei(!0,{},dh(r[o],e,a),t)}return Object.keys(i).forEach((t=>{let e=n.slice();if(t===uh||ch.test(t))return;o[t]=i[t];let a=o[t];ch.test(a)&&a in r?(-1!==n.indexOf(a)&&hh(a),e.push(a),a=r[a],"object"==typeof a||ch.test(a)&&a in r?o[t]=dh(a,r,e):o[t]=a):"object"==typeof a&&(o[t]=dh(a,r,e))})),o}function fh(t,e){return dh(t,e,[])}function ph(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={},n=t;const i=t=>{t.forEach((t=>{const n=Array.isArray(t.colors[0])?t.colors:[t.colors];e[t.key]={colors:n,sizes:n.map((t=>t?t.length:0))}}))},r={palette:(t,n)=>((t,n)=>{const i=e[t];if(!i)return[];const r=i.sizes;for(let t=0;t<r.length;t++)if(n<=r[t])return i.colors[t];return i.colors[r.length-1]})(t,n),setPalettes:i,style:t=>fh(t,n),setStyle:e=>{n=Ei({},t,e)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function gh(t){t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height)}function mh(t){const e={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return Ei(!0,e,t),e.center.minWidthRatio=Math.min(Math.max(e.center.minWidthRatio,0),1),e.center.minHeightRatio=Math.min(Math.max(e.center.minHeightRatio,0),1),e.center.minWidth=Math.max(e.center.minWidth,0),e.center.minHeight=Math.max(e.center.minHeight,0),e}function yh(t,e,n,i,r){return{x:isNaN(t)?0:t,y:isNaN(t)?0:e,width:isNaN(t)?0:n,height:isNaN(t)?0:i,margin:isNaN(r)?0:r}}function xh(t,e,n){if(void 0===t.cachedSize){const i=t.config.dock();let r,o=t.comp.preferredSize({inner:e,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),t.cachedSize=Math.ceil(r),t.edgeBleed=o.edgeBleed||0}return t.cachedSize}function vh(t,e){switch(e.config.dock()){case"top":t.y+=e.cachedSize,t.height-=e.cachedSize;break;case"bottom":t.height-=e.cachedSize;break;case"left":t.x+=e.cachedSize,t.width-=e.cachedSize;break;case"right":t.width-=e.cachedSize}}function bh(t,e){const n=e.edgeBleed;n&&(t.left=Math.max(t.left,n.left||0),t.right=Math.max(t.right,n.right||0),t.top=Math.max(t.top,n.top||0),t.bottom=Math.max(t.bottom,n.bottom||0))}function wh(t,e,n){e.x<n.left&&(e.width-=n.left-e.x,e.x=n.left);const i=t.width-(e.x+e.width);i<n.right&&(e.width-=n.right-i),e.y<n.top&&(e.height-=n.top-e.y,e.y=n.top);const r=t.height-(e.y+e.height);r<n.bottom&&(e.height-=n.bottom-r)}function Mh(t,e,n,i,r){const o=Ei({},e),a=Ei({},n);vh(o,i),bh(a,i),wh(t,o,a);const s=function(t,e,n){const i=Math.min(n.center.minWidth,t.width)||Math.max(t.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,t.height)||Math.max(t.height*n.center.minHeightRatio,1);return e.width>=i&&e.height>=r}(t,o,r);return!!s&&(vh(e,i),bh(n,i),!0)}function kh(t){return{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y}}function _h(t){return $i([].concat(...t.map(Vi)))}function Sh(t){let{visible:e,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=t;const a=yh(i.x,i.y,i.width,i.height),s=yh(i.x,i.y,i.width,i.height),l={},c=e.slice(),u=c.slice().sort(((t,e)=>t.config.displayOrder()-e.config.displayOrder()));return e.sort(((t,e)=>{if(t.referencedDocks.length>0&&e.referencedDocks.length>0)return 0;if(e.referencedDocks.length>0)return-1;if(t.referencedDocks.length>0)return 1;const n=t.config.displayOrder()-e.config.displayOrder();return 0===n?c.indexOf(t)-c.indexOf(e):n})).forEach((t=>{let e={},c={};switch(t.config.dock()){case"top":e.height=c.height=t.cachedSize,e.width=n.width,c.width=a.width,e.x=n.x,c.x=a.x,e.y=c.y=a.y-t.cachedSize,a.y-=t.cachedSize,a.height+=t.cachedSize;break;case"bottom":e.x=n.x,c.x=a.x,e.y=c.y=a.y+a.height,e.width=n.width,c.width=a.width,e.height=c.height=t.cachedSize,a.height+=t.cachedSize;break;case"left":e.x=c.x=s.x-t.cachedSize,e.y=n.y,c.y=s.y,e.width=c.width=t.cachedSize,e.height=n.height,c.height=s.height,s.x-=t.cachedSize,s.width+=t.cachedSize;break;case"right":e.x=c.x=s.x+s.width,e.y=n.y,c.y=s.y,e.width=c.width=t.cachedSize,e.height=n.height,c.height=s.height,s.width+=t.cachedSize;break;case"center":e.x=c.x=i.x,e.y=c.y=i.y,e.width=c.width=i.width,e.height=c.height=i.height;break;default:if(t.referencedDocks.length>0){const n=t.referencedDocks.map((t=>l[t])).filter((t=>!!t));n.length>0&&(e=_h(n.map((t=>t.outerRect))),c=_h(n.map((t=>t.r))))}}t.key&&(l[t.key]={r:c,outerRect:e}),function(t,e,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const t=r.x<r.y,e=Math.min(r.x,r.y);r.x=e,r.y=e;const a=t?"height":"width",s=(i[a]-n[a]*r.x)*n.align;o.left=t?0:s,o.top=t?s:0}t.scaleRatio=r,t.margin=o,e.scaleRatio=r,e.margin=o,n.scaleRatio=r,n.margin=o}(c,e,n,r),c.edgeBleed=t.edgeBleed,c.computed=kh(c),e.edgeBleed=t.edgeBleed,e.computed=kh(e),c.x+=o.x,c.y+=o.y,e.x+=o.x,e.y+=o.y,t.comp.resize(c,e),t.cachedSize=void 0,t.edgeBleed=void 0})),u}function Nh(t,e,n){const i=t.layoutModes||{},r=e.minimumLayoutMode();let o=e.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function Rh(t){if(!t.resize||"function"!=typeof t.resize)throw new Error("Component is missing resize function");if(!t.dockConfig&&!t.preferredSize)throw new Error("Component is missing preferredSize function")}function Ah(t){let e=mh(t);const n={};return n.layout=function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t||isNaN(t.x)||isNaN(t.y)||isNaN(t.width)||isNaN(t.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=function(t,e){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=t.width||0,n.height=t.height||0,void 0!==e.size&&(n.width=isNaN(e.size.width)?n.width:e.size.width,n.height=isNaN(e.size.height)?n.height:e.size.height),void 0!==e.logicalSize?(i.width=isNaN(e.logicalSize.width)?n.width:e.logicalSize.width,i.height=isNaN(e.logicalSize.height)?n.height:e.logicalSize.height,i.align=isNaN(e.logicalSize.align)?.5:Math.min(Math.max(e.logicalSize.align,0),1),i.preserveAspectRatio=e.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),gh(i),gh(n),{logicalContainerRect:i,containerRect:n}}(t,e),[o,a]=function(t,e,n){const i=[],r=[];for(let o=0;o<t.length;++o){const a=t[o];Rh(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((t=>t.replace(/^\s*@/,""))):[];Nh(e,s,n)?i.push({comp:a,key:l,config:s,referencedDocks:u}):r.push({comp:a,key:l,config:s,referencedDocks:u})}return[i,r]}(n,e,i),s=function(t){let{layoutRect:e,visible:n,hidden:i,settings:r}=t;const o=yh(e.x,e.y,e.width,e.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((t,e)=>t.config.prioOrder()-e.config.prioOrder()));for(let t=0;t<s.length;++t){const n=s[t];xh(n,o,e),Mh(e,o,a,n,r)||(i.push(s.splice(t,1)[0]),--t)}!function(t,e){if(0!==e.length)for(let n=0;n<t.length;++n){let i=t[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((t=>e.some((e=>e.key===t))));r&&e.push(t.splice(n,1)[0])}}}(n,i);const l=n.filter((t=>-1!==s.indexOf(t)));return n.length=0,n.push(...l),wh(e,o,a),o}({layoutRect:i,visible:o,hidden:a,settings:e}),l=Sh({visible:o,layoutRect:i,reducedRect:s,containerRect:r,translation:{x:t.x,y:t.y}});return a.forEach((t=>{t.comp.visible=!1;const e=yh();t.comp.resize(e,e)})),{visible:o.map((t=>t.comp)),hidden:a.map((t=>t.comp)),ordered:l.map((t=>t.comp))}},n.settings=function(t){e=mh(t)},n}const Ch=(t,e)=>{for(let n=0;n<t.length;n++){const i=t[n];if(i.hasKey&&i.key===e)return t[n]}return null},Dh=t=>null==t?void 0:t.map((t=>{const e=t.instance.dockConfig();return{preferredSize:n=>e.computePreferredSize(Pi(Pi({},n),{},{children:Dh(t.children)}))}})),Oh=(t,e)=>({visible:[],hidden:e,ordered:[]}),Eh=t=>(e,n)=>{var i;const r=n.map(((t,e)=>{const n=t.instance.dockConfig();return{index:e,key:t.key,dockConfig:n,resize:t.instance.resize,preferredSize:e=>n.computePreferredSize(Pi(Pi({},e),{},{children:Dh(t.children)}))}})),o=t=>n[t.index],{visible:a=r,hidden:s=[],ordered:l=a}=null!==(i=t(e,r))&&void 0!==i?i:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},zh=t=>"function"==typeof t?Eh(t):(t=>{const e=Ah(t);return Eh(((t,n)=>e.layout(t,n)))})(t);function Ih(t,e,n){const i=e.left-n.left,r=e.top-n.top,o=Wi(t),a=Ei(!0,{},t);switch(o){case"circle":a.cx+=i,a.cy+=r;break;case"polygon":for(let t=0,e=a.vertices.length;t<e;t++){const e=a.vertices[t];e.x+=i,e.y+=r}break;case"geopolygon":for(let t=0;t<a.vertices.length;t++){const e=a.vertices[t];for(let t=0,n=e.length;t<n;t++){const n=e[t];n.x+=i,n.y+=r}}break;case"line":a.x1+=i,a.y1+=r,a.x2+=i,a.y2+=r;break;case"point":case"rect":a.x+=i,a.y+=r}return a}function Th(t,e){const n=[];let i=0;e.forEach((t=>{n.push(i),i++;const e=t.instance.def.additionalElements&&t.instance.def.additionalElements();e&&(i+=e.length)})),e.forEach(((e,i)=>((t,e,n)=>{const i=e.instance.renderer().element();if(isNaN(n)||!i||!t||!t.children)return;const r=t.children[Math.max(0,n)];if(i===r)return;const o=e.instance.def.additionalElements&&e.instance.def.additionalElements().filter(Boolean);t.insertBefore&&void 0!==r?(t.insertBefore(i,r),o&&o.forEach((e=>{t.insertBefore(e,i)}))):(o&&o.forEach((e=>{t.appendChild(e,i)})),t.appendChild(i))})(t,e,n[i])))}function Ph(t,e){let{element:n,data:i=[],settings:r={},on:o={}}=t;const a=e.registries,s=e.logger,l=ph(e.style,e.palettes),c=[],u=Ei({},t),h=function(){const t={};return Nc.mixin(t),t}();let d=[],f=null,p=null,g=null,m=[],y=()=>{},x=()=>{};const v={};let b=!1;const w=function(t){let{createComponent:e}=t;const n={};let i=[],r=[];const o=t=>{const n=e(t);return n&&(i.push(n),t.components&&(n.children=t.components.map((t=>o(t))).filter((t=>!!t)))),n},a=t=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)},s=(t,e)=>{for(let n=t.length-1;n>=0;n--){const i=t[n],r=e.find((t=>i.hasKey&&i.key===t.key));r?i.children&&r.components&&s(i.children,r.components):(t.splice(n,1),a(i),i.children&&s(i.children,[]),i.instance.destroy())}},l=t=>{let{compList:e,data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:s}=t;return s.map((t=>{const s=Ch(e,t.key);return i.indexOf(t.key)>-1?(delete s.updateWith,s):s?(t.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(t.rendererSettings),t.rendererSettings&&"function"==typeof t.rendererSettings.transform&&t.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:r,scales:a,data:n,settings:t},t.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:t.components})),s)):o(t)})).filter((t=>!!t))},c=t=>{let{components:e,hidden:n,layoutFn:i,ordered:r,rect:o,visible:a}=t;const{visible:s,hidden:l,ordered:u}=i(o,e);a.push(...s),n.push(...l),r.push(...u),s.forEach((t=>{if(t.children){var e,i;const o=zh(null!==(e=null===(i=t.settings)||void 0===i?void 0:i.strategy)&&void 0!==e?e:{});c({components:t.children,hidden:n,layoutFn:o,ordered:r,rect:t.instance.getRect(),visible:a})}})),l.forEach((t=>{t.children&&c({components:t.children,hidden:n,layoutFn:Oh,ordered:r,rect:null,visible:a})}))};return n.destroy=()=>{i.forEach((t=>t.instance.destroy())),i=[],r=[]},n.findComponentByKey=t=>Ch(i,t),n.forEach=t=>{i.forEach(t)},n.layout=t=>{let{layoutSettings:e,rect:n}=t;const i=[],o=[],a=[],s=zh(e);return c({components:r,hidden:o,layoutFn:s,ordered:a,rect:n,visible:i}),{visible:i,hidden:o,ordered:a}},n.set=t=>{let{components:e}=t;r=e.map((t=>o(t))).filter((t=>!!t))},n.update=t=>{let{components:e,data:n,excludeFromUpdate:i,formatters:o,scales:a}=t;s(r,e),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:a,settingsList:e})},n}({createComponent:t=>{if(!a.component.has(t.type))return s.warn("Unknown component: ".concat(t.type)),!1;return{instance:zu(a.component(t.type),{settings:t,chart:u,mediator:h,registries:a,theme:l,container:n}),settings:Ei(!0,{},t),key:t.key,hasKey:void 0!==t.key}}});function M(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof t[e];let r;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=i?t[e].call(u,...a):n.call(u,...a),r}}const k=()=>{let t;r.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),t=r.dockLayout):t=r.strategy;const e=function(t){if("function"==typeof t.getBoundingClientRect){const{width:e,height:n}=t.getBoundingClientRect();return{x:0,y:0,width:e,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:t,rect:e})},_=M("created"),S=M("beforeMount"),N=M("mounted"),R=M("beforeUpdate"),A=M("updated"),C=M("beforeRender"),D=M("beforeDestroy"),O=M("destroyed"),E=function(t,e){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=e;y=function(t,e){let{types:n,logger:i}=e;const r={},o=[];return Array.isArray(t)?o.push(...t):(i.warn('Deprecated: "data-source" configuration"'),o.push(t)),o.forEach(((t,e)=>{let o=n(t.type);if(o){let n=t.key;void 0===t.key&&(i.warn("Missing key for dataset. Using index '".concat(e,"' as key.")),n=e);let a=o({key:n,data:t.data,config:t.config});r[n]=a}})),t=>t?r[t]:r[Object.keys(r)[0]]}(t,{logger:s,types:a.data}),n||Object.keys(v).forEach((t=>v[t].clear())),e.palettes&&l.setPalettes(e.palettes),e.style&&l.setStyle(e.style),x=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ps;const r={};return(t||[]).forEach((t=>{if(!t.key)throw new Error('Data collection is missing "key" property');if("object"==typeof t.data&&"collection"in t.data)throw new Error("Data config for collections may not reference other collections");r[t.key]=()=>i(t.data,e,n)})),t=>{let e,n;if("string"==typeof t?e=t:"object"==typeof t&&(e=t.key,n=t),!(e in r))throw new Error("Unknown data collection: ".concat(e));"function"==typeof r[e]&&(r[e]=r[e]());let i=r[e];if(n&&n.fields&&n.fields.filter){let t=i.fields.filter(n.fields.filter);i.fields.length!==t.length&&(i=Ei(i,{fields:t}))}return i}}(e.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};f=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mc;const r={};return{get(o){let a;return"string"==typeof o&&t[o]?a=o:"object"==typeof o&&"scale"in o&&t[o.scale]&&(a=o.scale),a?(r[a]=r[a]||i(t[a],e,n),r[a]):i(o,e,n)},all(){return Object.keys(t).forEach(this.get),r}}}(r,{dataset:y,collection:x},Pi(Pi({},c),{},{scale:a.scale})),p=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qs;const r={};return{get(o){let a;return"string"==typeof o&&t[o]?a=o:"object"==typeof o&&"formatter"in o&&t[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&t[o.type]&&(a=o.type),a?(r[a]=r[a]||i(t[a],e,n),r[a]):i(o||{},e,n)},all(){return Object.keys(t).forEach(this.get),r}}}(i,{dataset:y,collection:x},Pi(Pi({},c),{},{formatter:a.formatter})),g=function(t,e){const n={};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=Ac(t[i],e?e[i]:null));return n}(o,g)};function z(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e={},i=t.filter((t=>!!t.key)).map((t=>t.key));m.forEach((t=>{t.key&&-1!==i.indexOf(t.key)?e[t.key]=t:t.destroy()})),m=t.map((t=>{const i=t.key&&e[t.key]?e[t.key]:a.interaction(t.type)(u,h,n);return i.set(t),i}))}const I=t=>{const e=n.getBoundingClientRect(),i="clientX"in t?t.clientX:t.x,r="clientY"in t?t.clientY:t.y,o={x:i-e.left,y:r-e.top},a=[];return d.forEach((t=>{const e=t.instance.getRect();Qu(e.computedPhysical?e.computedPhysical:{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y},o)&&a.push(t)})),a},T=()=>{if(c.length||!n)return;Object.keys(o).forEach((t=>{const e=o[t].bind(u);n.addEventListener(t,e),c.push({key:t,listener:e})}));const t={},e=e=>{e.touches?(t.x=e.touches[0].clientX,t.y=e.touches[0].clientY,t.multiTouch=e.touches.length>1):(t.x=e.clientX,t.y=e.clientY,t.multiTouch=!1),t.time=Date.now(),t.comps=I(t)},i=e=>{const n=t.comps||I(e);if(!n.every((t=>t.instance.def.disableTriggers))&&("touchend"===e.type&&e.preventDefault(),function(t,e){const n=qi(t),i=n?t.changedTouches[0]:t,r=Date.now()-e.time,o=isNaN(e.x)?0:Math.abs(i.clientX-e.x),a=isNaN(e.y)?0:Math.abs(i.clientY-e.y);return(0===t.button||n)&&!e.multiTouch&&o<=12&&a<=12&&r<=300}(e,t)))for(let t=n.length-1;t>=0;t--){if(n[t].instance.onBrushTap(e),b){b=!1;break}}},r=[];r.push({key:"mousedown",listener:e}),r.push({key:"mouseup",listener:i}),function(t){return"ontouchstart"in t&&"ontouchend"in t||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:e}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:t=>{const e=I(t);for(let n=e.length-1;n>=0;n--){if(e[n].instance.onBrushOver(t),b){b=!1;break}}}}),r.forEach((t=>{n.addEventListener(t.key,t.listener),c.push(t)}))},P=()=>{c.forEach((t=>{let{key:e,listener:i}=t;return n.removeEventListener(e,i)})),c.length=0},q=()=>{n.innerHTML="",(()=>{const{components:t=[]}=r;C(),E(i,r),w.set({components:t});const{visible:e,hidden:o,ordered:a}=k();d=e,o.forEach((t=>{t.instance.hide(),t.visible=!1})),e.forEach((t=>t.instance.beforeMount())),e.forEach((t=>t.instance.mount())),e.forEach((t=>t.instance.beforeRender())),e.forEach((t=>t.instance.render())),e.forEach((t=>t.instance.mounted())),e.forEach((t=>{t.visible=!0})),Th(n,a)})(),T(),z(r.interactions)};return u.layoutComponents=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:e=[]}=t;t.data&&(i=t.data),t.settings&&(r=t.settings,z(t.settings.interactions)),R(),E(i,r);const{formatters:n,scales:o,components:a=[]}=r;w.update({components:a,data:i,excludeFromUpdate:e,formatters:n,scales:o}),w.forEach((t=>{t.updateWith&&t.instance.set(t.updateWith)})),w.forEach((t=>{t.updateWith&&t.instance.beforeUpdate()})),k()},u.update=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:e,excludeFromUpdate:o=[]}=t;let a;t.data&&(i=t.data),t.settings&&(r=t.settings,z(t.settings.interactions)),R(),E(i,r,{partialData:e});const{formatters:s,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((t=>{t.updateWith&&t.instance.set(t.updateWith)})),w.forEach((t=>{t.updateWith&&t.instance.beforeUpdate()}));const u=[],h=[];let f;if(e)w.forEach((t=>{(t.updateWith||t.applyTransform)&&t.visible&&u.push(t)})),f=u;else{const{visible:t,hidden:e,ordered:n}=k();d=t,f=t,a=n,t.forEach((t=>{t.updateWith&&t.visible?u.push(t):h.push(t)})),e.forEach((t=>{t.instance.hide(),t.visible=!1,delete t.updateWith,t.applyTransform=!1}))}h.forEach((t=>t.instance.beforeMount())),h.forEach((t=>t.instance.mount())),f.forEach((t=>t.instance.beforeRender())),f.forEach((t=>{(t.updateWith||t.applyTransform)&&t.visible?t.instance.update():t.instance.render()})),e||Th(n,a),h.forEach((t=>t.instance.mounted())),u.forEach((t=>t.instance.updated())),d.forEach((t=>{delete t.updateWith,t.visible=!0,t.applyTransform=!1})),A()},u.destroy=()=>{D(),w.destroy(),P(),z(),delete u.update,delete u.destroy,O()},u.getAffectedShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return d.filter((t=>null==i||t.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(t,e,n);r=[...r,...o]})),r},u.findShapes=t=>{let e=[];return d.forEach((n=>{const i=n.instance.findShapes(t);e=[...e,...i]})),e},u.componentsFromPoint=t=>I(t).map((t=>t.instance.ctx)),u.shapesAt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(e.components)&&e.components.length>0){const t=e.components.map((t=>t.key));o=d.filter((e=>-1!==t.indexOf(e.key))).map((n=>({instance:n.instance,opts:e.components[t.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=Ih(t,r,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===e.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<e.components.length;n++){const i=e.components[n].key;d.filter((t=>i===t.key)).forEach((i=>{let r=t.filter((t=>t.key===i.key));i.instance.brushFromShapes(r,e.components[n])}))}},u.scroll=function(){return function(t,e){return e[t]||(e[t]=Rc()),e[t]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",g)},u.dataset=t=>y(t),u.dataCollection=t=>x(t),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[t]||(v[t]=Hc()),v[t]},u.scale=function(t){return f.get(t)},u.formatter=function(t){return p.get(t)},u.toggleBrushing=function(t){b=void 0!==t?t:!b},u.component=t=>{const e=w.findComponentByKey(t);return null==e?void 0:e.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=Iu({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:m,on(){T(),m.forEach((t=>t.on()))},off(){P(),m.forEach((t=>t.off()))}})}),_(),n&&(S(),q(),N(n),u.element=n),u}const qh=t=>{let e=Gr(t);return e.prio=t=>t?e.default(t[0]):[e.default()],e.types=()=>e.getKeys(),e};var Lh=Gr();function jh(t,e,n){let{key:i}=n;const r={value:"function"==typeof t.value?t.value(e):void 0!==t.value?t.value:e};return r.label="function"==typeof t.label?t.label(e):void 0!==t.label?String(t.label):String(r.value),t.field&&(r.source={key:i,field:t.field.key()}),r}const Fh=t=>t.filter((t=>"number"==typeof t&&!isNaN(t)));const Bh=t=>{let{key:e,data:n,cache:i,config:r}=t;if(!n)return;let o=n;"string"==typeof o&&(o=(t=>{let{data:e,config:n}=t;const i=e.split("\n"),r=i[0],o=i[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(r){const t=[/,/,/\t/,/;/];for(let e=0;e<t.length;e++){const n=t[e];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){a=n;break}}else n.test(r)&&(a=n)}}return i.map((t=>t.split(a)))})({data:n,config:r})),Array.isArray(o)&&function(t){let e,{source:n,data:i,cache:r,config:o}=t,a=i;const s=o&&o.parse;Array.isArray(i[0])?s&&!1===s.headers?e=i[0].map(((t,e)=>e)):(e=i[0],a=i.slice(1)):e=Object.keys(i[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=e;u=s&&"function"==typeof s.fields?s.fields(u.slice()):e.map((t=>({key:t,title:t}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((t=>{c[t.key]=[]})));for(let t=0;t<a.length;t++){const e=l?l(a[t],t,u):a[t];if(e)if(Array.isArray(e))for(let t=0;t<u.length;t++)c[t].push(e[t]);else for(let t=0;t<u.length;t++)c[u[t].key].push(e[u[t].key])}const h=Array.isArray(c)?t=>c[t]:t=>c[u[t].key];for(let t=0;t<u.length;t++){const e=h(t),i=Fh(e),o=i.length>0,a=o?"measure":"dimension",s=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(Ms(Ei({source:n,key:t,title:u[t].title,values:e,min:s,max:l,type:a},u[t]),{value:u[t].value,label:u[t].label}))}}({data:o,cache:i,source:e,config:r})};function Vh(){let{key:t,data:e,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>t,raw:()=>e,field:t=>function(t,e){let{cache:n}=e;if("number"==typeof t)return n.fields[t];for(let e=0;e<n.fields.length;e++)if(n.fields[e].key()===t)return n.fields[e];for(let e=0;e<n.fields.length;e++)if(n.fields[e].title()===t)return n.fields[e];return null}(t,{cache:i,matrix:e}),fields:()=>i.fields.slice(),extract:t=>function(t,e){const n=Array.isArray(t)?t:[t];let i=[];return n.forEach((t=>{if(void 0!==t.field){const n=e.field(t.field),r=e.key();if(!n)throw Error("Field '".concat(t.field,"' not found"));const{props:o,main:a}=Rs(t,e),s=Object.keys(o),l=!!t.trackBy,c=typeof t.trackBy,u={},h=[],d=n.items(),f=[];for(let e=0;e<d.length;e++){const n=d[e];if(a.filter&&!a.filter(n))continue;const i=jh(a,n,{key:r});s.forEach((t=>{const a=o[t];let s=a.field?a.field.items()[e]:n;i[t]=jh(a,s,{key:r})})),l&&Ds({cfg:t,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...Cs(h,{main:a,propsArr:s,props:o})]:[...i,...f]}})),i}(t,r),hierarchy:()=>null};return Bh({key:t,data:e,config:n,cache:i}),r}Vh.util={normalizeConfig:Rs,collect:Cs,track:Ds};const $h=Gr();$h.default("matrix"),$h("matrix",Vh),$h("default",Vh);const Hh=Gr();function Wh(t,e,n){return Math.max(t,Math.min(e,n))}function Uh(t){let{item:e,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:a,symbol:s}=t,l="x",c="y",u=r,h=o,d=n<.5?90:-90;return a&&(l="y",c="x",u=o,h=r,d=n<.5?180:0),s(Ei({},e.oob,{[l]:i*u,[c]:Math.max(e.oob.size/2,Math.min(n*h,h-e.oob.size/2)),startAngle:d}))}function Yh(t){let{item:e,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:a}=t,s="x",l="y",c="width",u="height",h=r,d=o;a&&(s="y",l="x",c="height",u="width",h=o,d=r);const{actualDiff:f,actualLow:p}=function(t){let{start:e,end:n,minPx:i=.1,maxPx:r=1}=t;const o=Math.max(e,n),a=Math.min(e,n),s=Wh(-.1,1.2,o),l=Wh(-.1,1.2,a),c=s*r-l*r,u=Math.max(i,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*r-h}}({start:e.start,end:e.end,minPx:e.box.minHeightPx,maxPx:d});return Ei({},e.box,{type:"rect",[s]:(i+e.major)*h,[l]:p,[u]:f,[c]:n*h,data:e.data||{},collider:{type:null}})}function Xh(t){let{item:e,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:a,flipXY:s}=t,l="x1",c="y1",u="x2",h="y2",d=o,f=a;return s&&(l="y1",c="x1",u="y2",h="x2",d=a,f=o),Ei({},e.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:e.data||{},collider:{type:null}})}function Gh(t){let{item:e,key:n,position:i,width:r,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=t,c="x1",u="y1",h="x2",d="y2",f=a,p=s;l&&(c="y1",u="x1",h="y2",d="x2",f=s,p=a);const g=r/2;return Ei({type:"line"},e[n],{[u]:Math.floor(i*p),[c]:(o-g)*f,[d]:Math.floor(i*p),[h]:(o+g)*f,r:g*f,cx:o*f,cy:i*p,width:r*f,data:e.data||{},collider:{type:null}})}function Kh(t,e,n){const{width:i,maxWidthPx:r,minWidthPx:o}=e.box,a=t>=0?1:-1;let s=Math.min(a*t*i,isNaN(r)?n:r/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}Hh("native",(function(t,e,n){let i,r,o={chart:t,mediator:e,element:n},a=[],s=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((t=>{const e=i.events[t].bind(o);n.addEventListener(t,e),a.push({key:t,listener:e})}))}function c(){a.forEach((t=>{let{key:e,listener:i}=t;n.removeEventListener(e,i)})),a=[]}return{get key(){return r},set(t){!function(t){r=t.key,i=t,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(t),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,i=null}}}));const Zh={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},Jh=Object.keys(Zh),Qh={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(t){let{data:e}=t;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=Jh.filter((t=>!this.settings.settings[t]||!1!==this.settings.settings[t].show)),c={};l.forEach((t=>c[t]=Zh[t]));const u=function(t){let{keys:e,data:n,defaultSettings:i,style:r,settings:o,width:a,height:s,resolver:l}=t;const c=Ei(!0,{},i||{},r||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},h=o.major;let d;d="object"==typeof h&&"object"==typeof h.ref&&void 0!==h.ref.start&&void 0!==h.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Ei(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof h&&void 0!==h.binStart&&void 0!==h.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Ei(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((t=>{(f[t]||n.items&&n.items.length&&n.items[0][t])&&(p[t]={scale:f.scale,ref:t})}));let g,m={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Ei(!0,{},p,f)})};for(let t=0,i=e.length;t<i;t++)o[g]&&!1===o[g].show||(g=e[t],m[g]=l.resolve({data:n,defaults:c[g],settings:o[g],scaled:u}));return m}({keys:l,data:e,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:a}),{settings:h,items:d}=u,f=function(t){let{width:e,height:n,flipXY:i,resolved:r,keys:o,symbol:a}=t;const s=[],l=r.major.items;if(!l.length)return s;const c=e,u=n,h=i?n:e,d=r.major.settings,f=["start","end","min","max","med"].filter((t=>void 0!==r.minor.settings[t])),p=f.length,g=o.filter((t=>"oob"!==t));let m,y,x,v,b,w,M,k,_;const S=o?o.length:0,N=g?g.length:0,R={box:function(){x.box&&Li(x.start)&&Li(x.end)&&m.push(Yh({item:x,boxWidth:v,boxPadding:b,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){Li(x.min)&&Li(x.start)&&m.push(Xh({item:x,from:x.min,to:x.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),Li(x.max)&&Li(x.end)&&m.push(Xh({item:x,from:x.max,to:x.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){x.median&&Li(x.med)&&m.push(Gh({item:x,key:"median",position:x.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(x.whisker){const t=v*x.whisker.width;Li(x.min)&&m.push(Gh({item:x,key:"whisker",position:x.min,width:t,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),Li(x.max)&&m.push(Gh({item:x,key:"whisker",position:x.max,width:t,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function A(){let t,e=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)t=x[f[i]],Li(t)&&(e<t&&(e=t),n>t&&(n=t));M=e<0&&e!==-Number.MAX_VALUE,k=n>1&&n!==Number.MAX_VALUE,_=M||k}for(let t=0,e=l.length;t<e;t++){m=[],y=null;const e=l[t],n=e.data;let f=null,p=null;void 0!==d.binStart?(f=e.binStart,p=e.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?e.major:0);let C=0;y?y.bandwidth?(C=y.bandwidth(),f-=C/2):C=p-f:C=1,x=Ei({},{major:f,majorEnd:p},r.minor.items[t]);for(let e=0;e<S;e++)x[o[e]]=r[o[e]].items[t];if(v=Kh(C,x,h),b=(C-v)/2,w=b+x.major+v/2,A(),_)x.oob&&(M?m.push(Uh({item:x,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})):k&&m.push(Uh({item:x,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})));else for(let t=0;t<N;t++)x[g[t]]&&!1===x[g[t]].show||R[g[t]]();const D={type:"container",data:n,collider:{type:"bounds"},children:m};s.push(D)}return s}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:s});return f}};const td={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},ed=/px$/,nd={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},id={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function rd(t,e){return t&&"function"==typeof t.bandwidth?{isBandwidth:!0,value:Math.max(1,t.bandwidth()*e)}:{isBandwidth:!1,value:Math.max(1,e)}}function od(t,e,n,i){let{width:r,height:o}=e;return t.filter((t=>!1!==t.show&&!isNaN(t.x+t.y))).map((t=>{let e=t,a=ed.test(t.size)?parseInt(t.size,10):n.min+e.size*(n.max-n.min);ji(a)&&(e=td,a=n.min+e.size*(n.max-n.min));const[s,l]=function(t){let e=nd.shape,n={};return"object"==typeof t.shape&&"string"==typeof t.shape.type?(e=t.shape.type,n=t.shape):"string"==typeof t.shape&&(e=t.shape),[e,n]}(e),c=Pi(Pi({},l),{},{type:s,label:t.label,x:t.x*r,y:t.y*o,fill:e.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity});e===t.errorShape&&(c.width=e.width);const u=i(c);return u.data=t.data,u}))}const ad={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:t=>t.data.value},style:{item:"$shape"}},render(t){let{data:e}=t;const n=this.resolver.resolve({data:e,defaults:Ei({},nd,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=Ei({},id,this.settings.settings.sizeLimits),a=n.items,s=function(t,e,n,i,r){const o=rd(t?t.scale:void 0,n),a=rd(e?e.scale:void 0,i);let s=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*r[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*r[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,i,r,o);return od(a,this.rect,s,this.settings.shapeFn||this.symbol)}};Math.PI;const sd={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function ld(t,e,n,i){let{x:r,y:o,width:a,height:s}=e;const l=xr(),c={x:r+a/2,y:o+s/2},u=Math.min(a,s)/2,h=Math.min(a,s)/2,d=h/100;return t.map(((t,e)=>{const r=n[e];r.type="path";const o=h*r.outerRadius,a=u*r.innerRadius,s=d*r.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),r.arcDatum=t;const f=l.centroid(t),p=r.offset?function(t,e,n,i){let[r,o]=t;const a=Math.sqrt(r*r+o*o);r/=a,o/=a;const s=n-i;return{x:r*e*s,y:o*e*s}}(f,r.offset,o,a):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:t.value/i,slice:{start:t.startAngle,end:t.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function cd(t,e){return t.slice&&"arc"in t.slice?e.arc:e.data.value}const ud={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(t){let{data:e}=t;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:e,defaults:Ei({},sd,this.style.slice),settings:r.slice});let a=0;for(let t=0,e=o.length;t<e;t++){const e=cd(r,o[t]);e>0&&o[t].outerRadius>=o[t].innerRadius&&(n.push(e),i.push(o[t]),a+=e)}const s=function(){var t=Sr,e=_r,n=null,i=Qi(0),r=Qi(ur),o=Qi(0);function a(a){var s,l,c,u,h,d=a.length,f=0,p=new Array(d),g=new Array(d),m=+i.apply(this,arguments),y=Math.min(ur,Math.max(-ur,r.apply(this,arguments)-m)),x=Math.min(Math.abs(y)/d,o.apply(this,arguments)),v=x*(y<0?-1:1);for(s=0;s<d;++s)(h=g[p[s]=s]=+t(a[s],s,a))>0&&(f+=h);for(null!=e?p.sort((function(t,n){return e(g[t],g[n])})):null!=n&&p.sort((function(t,e){return n(a[t],a[e])})),s=0,c=f?(y-d*v)/f:0;s<d;++s,m=u)l=p[s],u=m+((h=g[l])>0?h*c:0)+v,g[l]={data:a[l],index:s,value:h,startAngle:m,endAngle:u,padAngle:x};return g}return a.value=function(e){return arguments.length?(t="function"==typeof e?e:Qi(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Qi(+t),a):i},a.endAngle=function(t){return arguments.length?(r="function"==typeof t?t:Qi(+t),a):r},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:Qi(+t),a):o},a}().sortValues(null);s.startAngle(r.startAngle),s.endAngle(r.endAngle),s.padAngle(r.padAngle);return ld(s(n),Ei({},this.rect,{x:0,y:0}),i,a)}};const hd=function(t){function e(e){if(t[e.type]&&t[e.type].condition(e)){const n=t[e.type],i=void 0===n.conditionAppend||n.conditionAppend(e);n.items.forEach((t=>{const n=Math.round(e[t.key]),r=e[t.key]-n;e[t.key]=n,i&&"append"===t.type&&(r>0?e[t.key]+=.5:e[t.key]-=.5)}))}}return void 0===t&&((t={}).line={append:["x1","x2","y1","y2"],round:[],condition:t=>t.x1===t.x2||t.y1===t.y2,conditionAppend:t=>t.strokeWidth%2!=0},t.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:t=>t.strokeWidth%2!=0}),Object.keys(t).forEach((e=>{const n=t[e];n.items=[],n.append.forEach((t=>{n.items.push({key:t,type:"append"})})),n.round.forEach((t=>{n.items.push({key:t,type:"round"})}))})),e.multiple=t=>t.forEach((t=>e(t))),e}();class dd{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(t,e){if(e){const e=t.substring(0,1),n=t.substring(1);if("x"===e)return"y".concat(n);if("y"===e)return"x".concat(n);if("cx"===t)return"cy";if("cy"===t)return"cx";if("width"===t)return"height";if("height"===t)return"width"}return t}transposeCoordinate(t,e,n){if("number"==typeof e&&isFinite(e)){const i=t.substring(0,1);if("x"===i||"cx"===t)return e*this.width;if("width"===t)return e*this.width;if("r"===t)return e*(n?this.height:this.width);if("y"===i||"cy"===t)return e*this.height;if("height"===t)return e*this.height}return e}push(){return this.storage.push(...arguments),this}processItem(t){let e={};const n=void 0!==t.flipXY?t.flipXY:this.flipXY,i=void 0!==t.crisp?t.crisp:this.crisp;if(t.fn&&"function"==typeof t.fn){let i=n?this.height:this.width,r=n?this.width:this.height;t=t.fn({width:i,height:r,flipXY:n});const o=Object.keys(t);for(let i=0,r=o.length;i<r;i++){let r=o[i];e[dd.evaluateKey(r,n)]=t[r]}}else{const i=Object.keys(t);for(let r=0,o=i.length;r<o;r++){let o=i[r];const a=dd.evaluateKey(o,n),s=this.transposeCoordinate(a,t[o],n);e[a]=s}}return i&&hd(e),e}output(){let t=[];for(let e=0,n=this.storage.length;e<n;e++){let n=this.processItem(this.storage[e]);t.push(n)}return t}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function fd(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new dd(...e)}function pd(t,e){return t&&e?t.cachedTicks&&t.cachedTicks()||t.ticks({distance:e}):[]}const gd={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=fd(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,nu(this,"x",this.rect.width),nu(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=Ei({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=Ei({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=pd(this.x,this.rect.width),this.lines.y=pd(this.y,this.rect.height),this.lines.y=this.lines.y.map((t=>Ei(t,{flipXY:!0})));let t=t=>{let{dir:e,isMinor:n}=t,i=this.lines[e].filter((t=>!!t.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:e}}).items.forEach((t=>{let n=t.data;var i,r;t.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:t.stroke||"black",strokeWidth:void 0!==t.strokeWidth?t.strokeWidth:1,strokeDasharray:void 0!==t.strokeDasharray?t.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:e})}))};return t({dir:"x",isMinor:!1}),t({dir:"x",isMinor:!0}),t({dir:"y",isMinor:!1}),t({dir:"y",isMinor:!0}),this.blueprint.output()}};function md(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(t," ").concat(e-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(t," ").concat(e+n,"\n L ").concat(r?t+n:t-n," ").concat(e," Z\n ")}let r="bottom"===i;return"\n M ".concat(t-n," ").concat(e,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(t+n," ").concat(e,"\n L ").concat(t," ").concat(r?e+n:e-n," Z\n ")}function yd(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(t+=r?1.5*n:-1.5*n," ").concat(e-n,"\n L ").concat(t," ").concat(e+n,"\n L ").concat(r?t+n:t-n," ").concat(e," Z\n ")}let r="bottom"===i;return e+=r?1.5*n:-1.5*n,"\n M ".concat(t-n," ").concat(e,"\n L ").concat(t+n," ").concat(e,"\n L ").concat(t," ").concat(r?e+n:e-n," Z\n ")}function xd(t,e,n){return t<e||t>n}function vd(t,e){if("string"==typeof t.formatter)return e.formatter(t.formatter);if("object"==typeof t.formatter)return e.formatter(t.formatter);if(void 0!==t.scale&&t.scale.data){const e=t.scale.data()&&t.scale.data().fields;return e&&e[0]?e[0].formatter():null}return null}function bd(t){if(void 0===t)return 0;if("number"==typeof t&&isFinite(t))return t;if("string"==typeof t)switch(t){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function wd(t){let{chart:e,blueprint:n,renderer:i,p:r,settings:o,items:a,slopeLine:s}=t,l=!0,c=!1,u=!1,h=!1,d=!1,f=Ei(!0,{},o.style.line,r.line||{}),p=Ei(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:f.stroke});if(c=s?n.processItem({type:"line",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:!1,value:r.valueInfo?r.valueInfo.id:r.value}):n.processItem({type:"line",x1:r.position,y1:0,x2:r.position,y2:1,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:r.flipXY||!1,value:r.valueInfo?r.valueInfo.id:r.value}),r.label){const t=Ei(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:f.stroke},r.label);let s,c={width:0,height:0},p="";s=vd(r,e),!1!==r.label.showValue&&(s?p=" (".concat(s(r.value),")"):r.scale&&(p=" (".concat(r.value,")"))),p&&(c=i.measureText({text:p,fontFamily:t.fontFamily,fontSize:t.fontSize}));let g=i.measureText({text:t.text||"",fontFamily:t.fontFamily,fontSize:t.fontSize}),m={width:g.width+c.width,height:Math.max(g.height,c.height)},y=t.padding,x=bd(r.flipXY?t.vAlign:t.align),v=bd(r.flipXY?t.align:t.vAlign),b=Math.min(1+m.width+2*y,t.maxWidth*n.width,t.maxWidthPx),w=m.height+2*y,M=r.flipXY?w:b,k=r.flipXY?b:w;if(u=n.processItem({fn:e=>{let{width:i,height:o}=e,a=r.position*i-(r.flipXY?w:b)*(1-x);a=r.flipXY?a:Math.max(a,0);return{type:"rect",x:a,y:Math.max(Math.abs(v*o-k*v),0),width:r.flipXY?M:Math.min(M,n.width-a),height:k,stroke:t.background.stroke,strokeWidth:t.background.strokeWidth,fill:t.background.fill,opacity:t.background.opacity}},flipXY:r.flipXY||!1}),u.x<-1||u.x+u.width>n.width+1||u.y<-1||u.y+u.height>n.height+1)u=void 0;else{h={type:"text",text:t.text||"",fill:t.fill,opacity:t.opacity,fontFamily:t.fontFamily,fontSize:t.fontSize,x:u.x+y,y:u.y+u.height/2+m.height/3,maxWidth:u.width-2*y-c.width,anchor:"start"},p&&(d={type:"text",text:p||"",fill:t.fill,opacity:t.opacity,fontFamily:t.fontFamily,fontSize:t.fontSize,x:h.x+3+(u.width-(c.width+2*y)),y:h.y});for(let t=0,e=a.length;t<e;t++){let e=a[t];"rect"===e.type?Zu(u,e)&&(l=!1):"line"===e.type&&r.flipXY===e.flipXY&&th(u,e)&&(l=!1)}}}if(c&&a.push(c),0!==(null==s?void 0:s.slope)&&(null!=s&&s.showLabel||null!=s&&s.showValue)){let t,o;const l=120;let u=s.showLabel?s.refLineLabel:"";if(s.showValue){const n=vd(r,e),i=n?n(s.value):s.value;t="(".concat(s.slope,"x + ").concat(i,")"),u+=s.refLineLabel?" ".concat(t):t}if(u.length>1){var g;const t=i.measureText({text:u,fontFamily:p.fontFamily,fontSize:p.fontSize});t.width=t.width>l?l:t.width;const r=function(t,e,n){const i=t.scale({scale:"x"}),r=t.scale({scale:"y"});if(e>0){if(i.max()*e+n>=r.max())return!0}else if(e<0&&i.min()*e+n>=r.max())return!0;return!1}(e,s.slope,s.value)?function(t,e,n){const i=t.scale({scale:"x"}),r=t.scale({scale:"y"});return i((r.max()-n)/e)}(e,s.slope,s.value):void 0,h=void 0===r||s.isRtl?p.padding:3*p.padding,d=void 0!==r||s.slope>0?3*p.padding:p.padding,m=function(t,e,n,i,r,o){let a=0;if(void 0!==n){if(n<.8)return a=t.slope<0||t.isRtl?3*o.padding:2*o.padding,t.isRtl,n*r.width+a;if(1===n)return t.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return t.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(t.slope>0)return e.x2-(i.width+2*o.padding);return t.isRtl?e.x1-(i.width+2*o.padding):e.x1}(s,c,r,t,n,p),y=Math.min(c.y1,c.y2);s.labelStroke&&(o={type:"rect",x:s.isRtl?Math.max(m,h)-2:Math.max(m,h)+2,y:Math.abs(Math.max(y,d)-t.height),rx:3,ry:3,width:t.width+p.padding,height:t.height-2,stroke:f.stroke,fill:f.stroke});const x={type:"text",text:u,fill:null!==(g=s.labelStroke)&&void 0!==g?g:f.stroke,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:o?o.x+2:Math.max(m,h)+2,y:o?o.y+t.height-p.padding:Math.abs(Math.max(y,d)-p.padding/2),anchor:"start",title:u,maxWidth:l,width:t.width};(function(t,e,n,i,r){for(let o=0,a=t.length;o<a;o++){const a=t[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-e.x)<Math.max(a.width+i,e.width+i)&&Math.abs(a.y-e.y)<n.height+r)return!0}return!1})(a,x,t,h,d)||(o&&a.push(o),a.push(x))}}l&&u&&h&&(a.push(u,h),d&&a.push(d))}function Md(t){const e={value:t.value};return t.label&&(e.label=t.label.text),e}function kd(t){return void 0!==("function"==typeof t.value?t.value():t.value)}function _d(t,e){const n=t.min();if(n===t.max()){const i=function(t){const e=t.range();return 2===(null==e?void 0:e.length)&&e[0]>e[1]}(t);if(e<n)return i?2:-1;if(e>n)return i?-1:2}return t(e)}function Sd(t,e){return t&&e&&Math.abs(t.x-e.x)<1e-15&&Math.abs(t.y-e.y)<1e-15}const Nd={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=fd(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let t=this.settings;if(this.lines={x:[],y:[]},this.lines.x=t.lines&&t.lines.x||[],this.lines.y=t.lines&&t.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const e={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(kd).map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=this.chart.scale(t.scale);const n=_d(e,t.value);return Ei(t,{scale:e,position:n})}return Ei(t,{position:t.value})})),this.lines.y=this.lines.y.filter(kd).map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=this.chart.scale(t.scale);const n=_d(e,t.value);return Ei(t,{scale:e,position:n,flipXY:!0})}return Ei(t,{position:t.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((t=>!(t.position<0||t.position>1)||(e["x".concat(t.position>1?1:0)].push(Md(t)),!1))),this.lines.y=this.lines.y.filter((t=>!(!t.slope||0===t.slope)||(!(t.position<0||t.position>1)||(e["y".concat(t.position>1?1:0)].push(Md(t)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((i=>{if(!0===i.show||void 0===i.show){let r;if(i.slope&&0!==i.slope){const t=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=t.min(),a=t.max(),s=n.min(),l=n.max();r=Pi(Pi({},i),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*i.slope+i.value,u=a*i.slope+i.value,h=(s-i.value)/i.slope,d=(l-i.value)/i.slope;let f=[];xd(c,s,l)||(f[0]={x:_d(t,o),y:_d(n,c)}),xd(h,o,a)||(f[1]={x:_d(t,h),y:1}),xd(u,s,l)||(f[2]={x:_d(t,a),y:_d(n,u)}),xd(d,o,a)||(f[3]={x:_d(t,d),y:0});if(f.filter((t=>!!t)).length>2&&function(t){Sd(t[0],t[1])&&(t[1]=void 0),Sd(t[1],t[2])&&(t[2]=void 0),Sd(t[2],t[3])&&(t[3]=void 0),Sd(t[3],t[0])&&(t[3]=void 0)}(f),f=f.filter((t=>!!t)),f.length<2)return void e["y".concat(c>l?0:1)].push(Md(i));r.x1=f[0].x,r.y1=f[0].y,r.x2=f[1].x,r.y2=f[1].y}else r=void 0;wd({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:t,items:n,slopeLine:r})}})),t.style.oob.show&&function(t){let{blueprint:e,oob:n,settings:i,items:r}=t;const o=Object.keys(n);let a=i.style.oob||{};for(let t=0,i=o.length;t<i;t++){const i=o[t],s=n[i];if(s.length>0){let t=i.charAt(1),n="y"===i.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===t?"bottom":"top":"1"===t?"right":"left";let u=e.processItem({fn:e=>{let{width:i,height:r}=e,u=t*i+("1"===t?-o:o),h=n?l:r-l;return"arc"===a.type?{type:"path",d:md(n?h:u,n?u:h,a.width,c),x:u,y:h,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y,f={type:"text",text:s.length||"",x:h-.4*a.width,y:d+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},p={type:"path",d:yd(h,d,a.width,c),x:h,y:d,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};r.push(u,f,p)}}}({blueprint:this.blueprint,oob:e,settings:t,items:n}),n}};function Rd(t){const e={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===t.align||"bottom"===t.align?(e.x1=t.innerRect.x-t.outerRect.x,e.x2=e.x1+t.innerRect.width,e.y1=e.y2="top"===t.align?t.innerRect.height-t.padding:t.padding):(e.x1=e.x2="left"===t.align?t.innerRect.width-t.padding:t.padding,e.y1=t.innerRect.y-t.outerRect.y,e.y2=e.y1+t.innerRect.height),function(t,e){Ei(t,e.style)}(e,t),e}function Ad(t){return"string"==typeof t||"number"==typeof t?t:"-"}function Cd(t,e,n){n.layered||!n.stepSize?function(t,e){e.collider={type:"polygon",vertices:[{x:e.boundingRect.x,y:e.boundingRect.y},{x:e.boundingRect.x+e.boundingRect.width,y:e.boundingRect.y},{x:e.boundingRect.x+e.boundingRect.width,y:e.boundingRect.y+e.boundingRect.height},{x:e.boundingRect.x,y:e.boundingRect.y+e.boundingRect.height}]}}(0,e):n.tilted?function(t,e,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,e.boundingRect.height/2),o="start"===e.anchor,a="end"===e.anchor&&i<0,s="start"===e.anchor&&i>=0,l=e.boundingRect.y+(s||a?e.boundingRect.height:0),c=[{x:e.x-r,y:l},{x:e.x+r,y:l}].map((t=>_u(t,i,{x:e.x,y:e.y}))),u={x:o?e.boundingRect.x+e.boundingRect.width+10:e.boundingRect.x-10,y:e.boundingRect.y+e.boundingRect.height},h={x:o?e.boundingRect.x+e.boundingRect.width+10:e.boundingRect.x-10,y:e.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),e.collider={type:"polygon",vertices:c}}(0,e,n):function(t,e,n){if("bottom"===n.align||"top"===n.align){const i=t.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);e.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=t.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);e.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=e.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(t,e,n)}function Dd(t,e){const n=isNaN(t.style.align)?.5:Math.min(Math.max(t.style.align,0),1);let i=0;if(t.tilted)i=t.stepSize*n;else{const r=e?t.textRect.height:t.textRect.width;i=Math.max(0,t.stepSize-r)*n}return i}function Od(t,e){var n,i;const r={type:"text",text:Ad(t.label),x:0,y:0,maxWidth:e.maxWidth,maxHeight:e.maxHeight,tickValue:null!==(n=t.value)&&void 0!==n?n:null===(i=t.data)||void 0===i?void 0:i.value};return"top"===e.align||"bottom"===e.align?(r.x=t.start*e.innerRect.width+(e.innerRect.x-e.outerRect.x)+Dd(e,!1),r.y="top"===e.align?e.innerRect.height:0,r.anchor=e.stepSize?"start":"middle",r.x+=isNaN(e.style.offset)?0:+e.style.offset):(r.y=t.start*e.innerRect.height+(e.innerRect.y-e.outerRect.y)+Dd(e,!0),r.x="left"===e.align?e.innerRect.width:0,r.anchor="left"===e.align?"end":"start",r.baseline=e.stepSize?"text-before-edge":"central",r.y+=isNaN(e.style.offset)?0:+e.style.offset),function(t,e){["fill","fontSize","fontFamily"].forEach((n=>{t[n]=e.style[n]}))}(r,e),function(t,e){if(!e.tilted&&!e.stepSize)if("top"===e.align||"bottom"===e.align){const n=0,i=e.outerRect.width,r=Math.min(e.maxWidth/2,e.textRect.width/2),o=t.x-r,a=t.x+r;o<n?(t.anchor="start",t.x=e.innerRect.x-e.outerRect.x):a>i&&(t.anchor="end",t.x=e.innerRect.width+e.innerRect.x)}else{const n=0,i=e.outerRect.height,r=e.maxHeight/2,o=t.y-r,a=t.y+r;o<n?(t.y=e.innerRect.y-e.outerRect.y,t.baseline="text-before-edge"):a>i&&(t.y=e.innerRect.height+(e.innerRect.y-e.outerRect.y),t.baseline="text-after-edge")}}(r,e),function(t,e){"top"===e.align?t.y-=e.padding:"bottom"===e.align?t.y+=e.padding+e.maxHeight:"left"===e.align?t.x-=e.padding:"right"===e.align&&(t.x+=e.padding)}(r,e),function(t,e){if(e.tilted){const n=-e.angle,i=n*(Math.PI/180);"bottom"===e.align?(t.x-=e.maxHeight*Math.sin(i)/2,t.y-=e.maxHeight,t.y+=e.maxHeight*Math.cos(i)/2):t.x-=e.maxHeight*Math.sin(i)/3,t.transform="rotate(".concat(n,", ").concat(t.x,", ").concat(t.y,")"),t.anchor="bottom"===e.align==e.angle<0?"start":"end";const r=Math.cos(i)*e.maxWidth;if("bottom"===e.align==e.angle<0){const n=e.outerRect.width-e.paddingEnd;t.x+r>n&&(t.maxWidth=(n-t.x-10)/Math.cos(i))}else{const n=e.paddingEnd;t.x-r<n&&(t.maxWidth=(t.x-n-10)/Math.cos(i))}}}(r,e),function(t,e){t.boundingRect=e.textBounds(t)}(r,e),Cd(t,r,e),r}function Ed(t,e){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:t.value};return"top"===e.align||"bottom"===e.align?(n.x1=n.x2=t.position*e.innerRect.width+(e.innerRect.x-e.outerRect.x),n.y1="top"===e.align?e.innerRect.height:0,n.y2="top"===e.align?n.y1-e.tickSize:n.y1+e.tickSize):(n.y1=n.y2=t.position*e.innerRect.height+(e.innerRect.y-e.outerRect.y),n.x1="left"===e.align?e.innerRect.width:0,n.x2="left"===e.align?n.x1-e.tickSize:n.x1+e.tickSize),function(t,e){Ei(t,e.style)}(n,e),function(t,e){"top"===e.align?(t.y1-=e.padding,t.y2-=e.padding):"bottom"===e.align?(t.y1+=e.padding,t.y2+=e.padding):"left"===e.align?(t.x1-=e.padding,t.x2-=e.padding):"right"===e.align&&(t.x1+=e.padding,t.x2+=e.padding)}(n,e),function(t,e){const n=t.strokeWidth/2;t.x1===e.innerRect.width?(t.x1-=n,t.x2-=n):0===t.x1?(t.x1+=n,t.x2+=n):t.y1===e.innerRect.height?(t.y1-=n,t.y2-=n):0===t.y1&&(t.y1+=n,t.y2+=n)}(n,e),n}function zd(t){return!t.isMinor&&t.position>=0&&t.position<=1}function Id(t){let{rect:e,state:n,majorTicks:i,measure:r,horizontal:o}=t;return o?function(t){let{majorTicks:e,measureText:n,rect:i,state:r}=t;const o="layered"===r.labels.activeMode?2:1,a=i.width,s=e.map((t=>t.label)).map((t=>"".concat(t.slice(0,1)).concat(t.length>1?"…":""))).map(n).map((t=>t.width));for(let t=0;t<e.length;++t){const n=e[t];if(o*a*Math.abs(n.start-n.end)<s[t])return!0}return!1}({majorTicks:i,measureText:r,rect:e,state:n}):function(t){let{majorTicks:e,measureText:n,rect:i}=t;const r=i.height,o=n("M").height;return!(e.length<2)&&r*Math.abs(e[0].position-e[1].position)<o}({majorTicks:i,measureText:r,rect:e,state:n})}function Td(t){let{value:e,maxValue:n,minValue:i,range:r,modifier:o}=t;return isNaN(r)||isNaN(o)||(e=r*o),e>n&&(e=n),e<i&&(e=i),e}function Pd(t){let{isDiscrete:e,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=t,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=a.labels;if(a.labels.show){const t=a.align,d="top"===t||"bottom"===t,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:f,formatter:i}).filter(zd),g=t=>{const e=r({text:t,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return e.width=Td({value:e.width,maxValue:u,minValue:h}),e};if(e&&d&&"auto"===a.labels.mode&&(!function(t){let{majorTicks:e,measure:n,rect:i,state:r,settings:o}=t;const a=o.labels.maxGlyphCount,s="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(a))for(let t=0;t<e.length;t++){const i=e[t],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=s*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=s*u*e.reduce(((t,e)=>Math.min(Math.abs(e.start-e.end),t)),1/0),h=n("M").width*l*a,h+c>d)return!0;return!1}({majorTicks:p,measure:g,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&Id({rect:n.inner,state:s,majorTicks:p,measure:g,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let m,y;if("tilted"===s.labels.activeMode){const t=Math.abs(a.labels.tiltAngle)*(Math.PI/180);m=e=>Td({value:e.width,maxValue:u,minValue:h})*Math.sin(t)+e.height*Math.cos(t)}else m=d?t=>t.height:t=>Td({value:t.width,maxValue:u,minValue:h});if(d&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((t=>t.label));else{let t="";for(let e=0;e<a.labels.maxGlyphCount;e++)t+="M";y=[t]}const x=y.map(g),v=x.map(m),b=Math.max(...v,0);if(l+=b,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const t="bottom"===a.align==a.labels.tiltAngle>=0,e=Math.abs(a.labels.tiltAngle)*(Math.PI/180),i=(b-g("M").height*Math.cos(e))/Math.sin(e),r=t=>Math.min(i,t.width)*Math.cos(e)+t.height,o=(e,i)=>{const r=p[i]?p[i].position:0;return t?e-r*n.inner.width:e-(1-r)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...x.map(r).map(o),0))+a.paddingEnd;if(c[t?"left":"right"]=s,!a.labels.filterOverlapping&&function(t){let{majorTicks:e,measureText:n,rect:i,bleedSize:r,angle:o}=t;if(e.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(e[0].position-e[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:g,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const qd=(t,e,n)=>t.width*Math.abs(e.position-n.position);function Ld(t){let{layered:e,major:n,innerRect:i,outerRect:r,tick:o,index:a}=t;const s=e?2:1,l=n[a-s],c=n[a+s],u=l?qd(i,o,l)/2-2:1/0,h=c?qd(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(t=>{let{innerRect:e,outerRect:n,tick:i,prevWidth:r}=t;const o=e.x-n.x,a=n.width-e.width-o,s=e.width-e.width*i.position+a,l=2*Math.min(r,s),c=1===i.position?e.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(t=>{let{innerRect:e,outerRect:n,tick:i,nextWidth:r}=t;const o=e.x-n.x,a=e.width*i.position+o,s=2*Math.min(r,a),l=0===i.position?e.width/2-2:0;return Math.max(r,s,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function jd(t){const e=t.innerRect,n={cx:e.width/2,cy:e.height/2},i=Math.min(e.height,e.width)/2*t.radius,r=i+t.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:t.startAngle,endAngle:t.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:i,outerRadius:r}},ticks:[]};return function(t,e){Ei(t,e.style)}(o,t),o}function Fd(t,e,n,i){return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}function Bd(t,e){const n=e.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*e.radius+e.padding,o=e.startAngle,a=e.endAngle,s=e.tickSize,l=a-o;let c=a-t.position*l;c-=Math.PI/2;const u=Fd(i.cx,i.cy,r+s,c),h=Fd(i.cx,i.cy,r,c),d={type:"line",x1:u.x,y1:u.y,x2:h.x,y2:h.y,value:t.value};return function(t,e){const n=Pi({},e.style);Ei(t,n)}(d,e),d}function Vd(t){return"string"==typeof t||"number"==typeof t?t:"-"}function $d(t,e,n){let i;return i="left"===e?n.x:"right"===e?t.outerRect.width-n.x:Math.max(n.x,t.outerRect.width-n.x),i}function Hd(t,e){const n=e.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*e.radius+e.padding,o=e.startAngle,a=e.endAngle,s=e.tickSize,l=a-o,c=.2;let u,h;u="top"===e.align||"bottom"===e.align?a-t.position*l:o+t.position*l,h=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const d=function(t,e,n,i){return{x:t+n*Math.cos(i),y:e+n*Math.sin(i)}}(i.cx,i.cy,r+s+6,u);let f;f="left"===h?"end":"right"===h?"start":"middle";const p={type:"text",text:Vd(t.label),align:h,x:d.x,y:d.y,maxHeight:e.maxHeight,maxWidth:$d(e,h,d),anchor:f,baseline:"middle"};return function(t,e){["fill","fontSize","fontFamily"].forEach((n=>{t[n]=e.style[n]}))}(p,e),function(t,e){t.boundingRect=e.textBounds(t)}(p,e),function(t,e,n){let i,r;const o=parseFloat(n.fontSize)||0;i=e.y-o/2,r=t.innerRect.height-(e.y+o/2),(i<0||r<0)&&(n.text="")}(e,d,p),p}function Wd(t){let e=0;return e+=t.paddingStart,e+=t.line.show?t.line.strokeWidth/2:0,e+=t.ticks.show?t.ticks.margin:0,e}function Ud(t){let e=0;return e+=t.line.show?t.line.strokeWidth/2:0,e+=t.ticks.show?t.ticks.margin:0,e}function Yd(t){let e=0;return e+=t.ticks.show?t.ticks.tickSize:0,e+=Wd(t)+t.labels.margin,e}function Xd(t,e){return t.map((t=>Ed(t,e)))}function Gd(t,e){return e?Math.abs(e.end-e.start):t.bandwidth()}function Kd(t){let{textMetrics:e,settings:n,innerRect:i,scale:r,tilted:o,layered:a,tick:s}=t;const l=e.height,c=Gd(r,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-Yd(n)-n.paddingEnd;else if(a)u.width=c*i.width*2;else if(o){const t=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-Yd(n)-n.paddingEnd-l*Math.cos(t))/Math.sin(t)}else u.width=c*i.width;return u.width=Td({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function Zd(t){let{textMetrics:e,settings:n,innerRect:i,outerRect:r,tilted:o,layered:a,tick:s,index:l,major:c}=t;const u=e.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-Yd(n)-n.paddingEnd;else if(o){const t=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-Yd(n)-n.paddingEnd-u*Math.cos(t))/Math.sin(t)}else h.width=Ld({layered:a,major:c,innerRect:i,outerRect:r,tick:s,index:l});return h.width=Td({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function Jd(t){let e;function n(){return e=Zd,n}function i(){return e=Kd,i}function r(t){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=t;const u=[],h=function(t){return t.filter((t=>!t.isMinor))}(s),d=function(t){return t.filter((t=>t.isMinor))}(s),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,g="layered"===l.labels.activeMode;let m;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(jd(f)):u.push(Rd(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Wd(n),n.arc?(f.padding=Ud(n),m=function(t,e){return t.map((t=>Bd(t,e)))}(h,f)):m=Xd(h,f)),n.labels.show){const t=Yd(n);f.style=n.labels,f.padding=t,f.tilted=p,f.layered=g,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(t,l)=>{f.textRect=function(t){let{style:e,measureText:n,tick:i}=t;return n({text:i.label,fontSize:e.fontSize,fontFamily:e.fontFamily})}({tick:t,measureText:a,style:f.style});const c=e({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:g,tick:t,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(t){let{innerRect:e,scale:n,settings:i,tick:r}=t;return("top"===i.align||"bottom"===i.align?e.width:e.height)*Gd(n,r)}({innerRect:r,scale:i,ticks:s,settings:n,tick:t})};let d=[];n.arc?(f.padding=function(t){let e=0;return e+=t.ticks.show?t.ticks.tickSize:0,e+=Ud(t)+t.labels.margin,e}(n),d=function(t,e,n){return t.map(((t,i)=>{n(t,i);const r=Hd(t,e);return r.data=t.data,r}))}(h,f,l)):d=!g||"top"!==n.align&&"bottom"!==n.align?function(t,e,n){return t.map(((t,i)=>{n(t,i);const r=Od(t,e);return r.data=t.data,r}))}(h,f,l):function(t,e,n,i){const r=e.padding,o=Yd(n);return t.map(((t,a)=>{i(t,a);const s=o+e.maxHeight+n.labels.margin;e.layer=a%2,e.padding=a%2==0?r:s;const l=Od(t,e);return l.data=t.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(t,e,n){let i=(e,n)=>Zu(Ui(1,t[e].boundingRect),Ui(1,t[n].boundingRect));if(n&&n.tilted){const e=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(t[n].x-t[i].x),o=Math.sin(e*(Math.PI/180))/r;return t[n].boundingRect.height>o}}for(let n=0;n<=t.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(t.length-1));r++)t[n]&&t[r]&&i(n,r)&&(r===t.length-1?(t.splice(n,1),e&&e.splice(n,1)):(t.splice(r,1),e&&e.splice(r,1)),r--,n--)}(d,m,f),u.push(...d)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(t){return t.line.strokeWidth+t.minorTicks.margin}(n),u.push(...Xd(d,f))),m&&u.push(...m),u}return n.build=r,i.build=r,t?i():n()}const Qd={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},tf={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const ef={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(t){let{state:e,style:n,settings:i}=t;const r=Ei(!0,{},e.isDiscrete?Qd:tf,n),o=Ei(!0,{},r,i.settings),a=i.layout.dock||e.defaultDock;o.dock=a,o.align=function(t,e){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(t)&&-1===i.indexOf(e)||-1!==i.indexOf(t)&&-1===n.indexOf(e)?t:e}(i.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Jd(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(t,e,n){const i=e.labels.mode;return n&&t.isHorizontal?"auto"===i?t.labels.activeMode:-1!==["layered","tilted"].indexOf(e.labels.mode)&&-1!==["top","bottom"].indexOf(e.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(t){const{formatter:e,state:n,scale:i}=this,r=this.state.isHorizontal?t.inner.width:t.inner.height;this.state.pxScale=iu(i,r);const o=function(t){let{isDiscrete:e,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=t,l=0;const{size:c,edgeBleed:u,isToLarge:h}=Pd({isDiscrete:e,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s});if(l+=c,h)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const t=a.minorTicks.margin+a.minorTicks.tickSize;t>l&&(l=t)}if(a.line.show){const t=a.line.strokeWidth/2;l+=t,u[function(t){switch(t){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return t}}(a.align)]=Math.ceil(t)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:t.inner,outer:t.outer},formatter:e,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:e}=t;this.setState(e)},resize(t){const{inner:e,outer:n}=t,i=Ei({},e,function(t){let{align:e,inner:n}=t;return"left"===e?{x:n.width+n.x}:"right"===e||"bottom"===e?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:e})),r=n||i;return Ei(this.state.innerRect,i),Ei(this.state.outerRect,r),n},beforeRender(){const{scale:t,formatter:e}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=iu(t,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:e}).filter((t=>t.position>=0&&t.position<=1))},render(){const{state:t}=this,e=[];return e.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:t})),hd.multiple(e),e}};const nf={render:()=>[]};function rf(t,e,n){let i="";if("function"==typeof t)i=t();else if("string"==typeof t)i=t;else if(n){const t=(n.data().fields||[]).map((t=>t.title()));i=t.join(e)}return i}function of(t,e){let n="middle";return"left"===t?"top"===e?n="end":"bottom"===e&&(n="start"):"right"===t?"top"===e?n="start":"bottom"===e&&(n="end"):"left"===e?n="start":"right"===e&&(n="end"),n}const af={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const t=this.settings.text,e=this.definitionSettings.join;this.title=rf(t,e,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:t,definitionSettings:e,rect:n}=this,i=[];return i.push(function(t){let{title:e,definitionSettings:n,dock:i,rect:r,measureText:o,style:a}=t;const s={type:"text",text:e,x:0,y:0,dx:0,dy:0,anchor:of(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};Ei(s,a.text);const l=o(s);if("top"===i||"bottom"===i){let t=r.width/2;"left"===n.anchor?t=n.paddingLeft||0:"right"===n.anchor&&(t=r.width-(n.paddingRight||0)),s.x=t,s.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===i?-l.height/6:-l.height/3,s.maxWidth=.8*r.width}else{let t=r.height/2;"top"===n.anchor?t=n.paddingStart:"bottom"===n.anchor&&(t=r.height-n.paddingStart),s.y=t,s.x="left"===i?r.width-n.paddingStart:n.paddingStart,s.dx="left"===i?-l.height/3:l.height/3;const e="left"===i?270:90;s.transform="rotate(".concat(e,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:t,dock:this.settings.layout.dock,definitionSettings:e,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(t){t.settings&&(Ei(this.settings,t.settings),this.definitionSettings=t.settings.settings);const e=this.settings.text,n=this.definitionSettings.join;this.title=rf(e,n,this.scale)}};function sf(t,e){const n=t.settings.layout.dock,i=t.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",a=t.rect[o],s=t.chart.scroll(t.settings.scroll);let l;{let t=e[r?"x":"y"];i&&(t=a-t);const n=s.getState();l={startOffset:t,startScroll:n.start,swipe:!1};const o=t/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:t=>{let e=t[r?"x":"y"];if(i&&(e=a-e),!l.swipe){if(Math.abs(l.startOffset-e)<=1)return;l.swipe=!0}const n=s.getState(),o=(e-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:t=>{let e=t[r?"x":"y"];i&&(e=a-e);const n=s.getState();if(l.swipe){const t=(e-l.startOffset)/a*(n.max-n.min),i=l.startScroll+t;s.moveTo(i)}else{const t=e/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(t)}}}}function lf(t,e){const n=e.element().getBoundingClientRect();return{x:t.center.x-n.left,y:t.center.y-n.top}}const cf={require:["chart","renderer"],on:{panStart(t){const e=lf(t,this.renderer),n={x:e.x-t.deltaX,y:e.y-t.deltaY};this.currentMove=sf(this,n),this.currentMove.update(e)},panMove(t){if(!this.currentMove)return;const e=lf(t,this.renderer);this.currentMove.update(e)},panEnd(t){if(!this.currentMove)return;const e=lf(t,this.renderer);this.currentMove.end(e),this.currentMove=null},panCancel(){this.currentMove=null},tap(t){const e=lf(t,this.renderer);sf(this,e).end(e)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(t){const e=this.chart.scroll(this.settings.scroll).getState();if(e.viewSize>=e.max-e.min){return Math.max(t.width,t.height)}return this.settings.settings.width},render:function(t){const e=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===e||"bottom"===e,r=i?"width":"height",o=this.rect[r],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),t("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(t("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(s,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function uf(t){let{h:e,isVertical:n,value:i,pos:r,align:o,borderHit:a,state:s,idx:l}=t;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let h=0,d="100%",f="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(d="".concat(s.targetRect.x+s.targetRect.width,"px"),f="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(h=n?s.targetRect.x:s.targetRect.y,d="".concat(s.rect.width-h,"px"),f="".concat(s.rect.height-h,"px")),c||(r-=a),e("div",{onmouseover(t){t.srcElement.children[0].style.backgroundColor="#000",t.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(t){t.srcElement.children[0].style.backgroundColor=s.style.line.stroke,t.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:r,"px"),top:"".concat(n?r:h,"px"),height:n?"".concat(a,"px"):f,width:n?d:"".concat(a,"px"),pointerEvents:"auto"}},[e("div",{style:Ei({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function hf(t){let{h:e,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=t;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let g=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const m={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const x=g?e("input",{type:"text",value:u,style:Pi(Pi({},m),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(t){if("Enter"===t.key){t.preventDefault(),t.stopPropagation();const e=parseFloat(t.target.value);isNaN(e)?(y="rgba(230, 78, 78, 0.6)",t.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,e,r)}else"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),c.onEditCanceled())}}):e("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":a,style:m},[i]);return e("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[x])}function df(t){let{h:e,isVertical:n,top:i,height:r,color:o,on:a,opacity:s}=t;return e("div",Ei({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},a),[])}function ff(t){let{borderHit:e,els:n,isVertical:i,state:r,vStart:o,vEnd:a,idx:s}=t,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(a)*r.size:a,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const t=r.targetFillRect||r.targetRect,e=i?t.height:t.width,s=c?r.scale.norm(o)*e:o,l=c?r.scale.norm(a)*e:a,u=Math.abs(s-l),h=Math.min(s,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(t){t.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(t){t.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(t.x,"px"),top:"".concat(t.y,"px"),height:"".concat(t.height,"px"),width:"".concat(t.width,"px")}},[df(d)]))}const g=u<h?o:a,m=u<h?a:o,[y,x]=c?r.scale.domain():[Math.min(o,a),Math.max(o,a)],v=g+1e-5>=y&&g-1e-5<=x,b=m-1e-5<=x&&m+1e-5>=y;v&&n.push(uf({h:r.h,isVertical:i,borderHit:e,value:g,pos:f,align:"start",state:r,idx:s})),b&&n.push(uf({h:r.h,isVertical:i,borderHit:e,value:m,pos:p,align:"end",state:r,idx:s}));const w=r.settings.bubbles;if(w&&w.show){const t={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},e=[o,a];v&&n.push(hf({h:r.h,isVertical:i,align:w.align,style:t,rangeIdx:s,idx:0,otherValue:m,value:g,label:"".concat(r.format(g,e)),pos:f,state:r})),b&&n.push(hf({h:r.h,isVertical:i,align:w.align,style:t,rangeIdx:s,idx:1,otherValue:g,value:m,label:"".concat(r.format(m,e)),pos:p,state:r}))}}function pf(t){const e=t.active.limitHigh-t.active.end,n=t.active.limitLow-t.active.start;let i=t.current-t.start;return i=i<0?Math.max(i,n):Math.min(i,e),i}function gf(t){let e=[];const n=0===t.direction;if(Array.isArray(t.ranges)&&t.ranges.forEach(((i,r)=>{t.active&&r===t.active.idx||ff({borderHit:5,els:e,isVertical:n,state:t,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),t.active){let i=t.start,r=t.current;if(-1!==t.active.idx)if("foo"===t.active.mode)i=Math.min(t.active.start,t.active.end),r=Math.max(t.active.start,t.active.end);else if("modify"===t.active.mode)i=Math.min(t.start,t.current),r=Math.max(t.start,t.current);else{const e=pf(t);i=t.active.start+e,r=t.active.end+e}ff({borderHit:5,els:e,isVertical:n,state:t,vStart:i,vEnd:r,idx:t.active.idx})}return e}function mf(t){return{min:t.scale.min(),max:t.scale.max()}}function yf(t){return{min:0,max:t.direction?t.rect.width:t.rect.height}}function xf(t,e,n){let i,r,o=t.ranges,a=-1;for(i=0;i<o.length;i++){if(o[i].min<=e&&e<=o[i].max){a=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(e<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===a&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(r={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),t.active=r}function vf(t){t.renderer.render(gf(t))}function bf(t,e){if(!e||!e.isActive())return[];const n=t.scale.data(),i=(n&&n.fields||[]).map((t=>t.id())),r=e.brushes().filter((t=>"range"===t.type&&-1!==i.indexOf(t.id)))[0];return r?r.brush.ranges():[]}function wf(t,e){let n,i=1/0;const r=e.domain(),o=e.bandwidth()/2;for(let a=0;a<r.length;++a){const s=Math.abs(t-o-e(r[a]));s<i&&(i=s,n=r[a])}return n}function Mf(t,e){return Math.min(...t)<=Math.max(...e)&&Math.max(...t)>=Math.min(...e)}function kf(t){return $i(t.reduce(((t,e)=>(t.push(...Vi(e.bounds)),t)),[]))}const _f={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(t){this.start(t)},rangeMove(t){this.move(t)},rangeEnd(t){this.end(t)},rangeClear(t){this.clear(t)},bubbleStart(t){this.bubbleStart(t)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(t){this.state.rect=t.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=bf(this.state,this.state.brushInstance),this.state.active=null,vf(this.state))},render(t){const e=this.settings.settings;this.state.direction="vertical"===e.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=iu(this.chart.scale(e.scale),i);const o=function(t){const e={targetRect:null,targetFillRect:null,scale:null,size:null},n=t.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((e=>t.chart.component(e))).filter((t=>!!t&&!!t.rect)),r=n.target&&n.target.selector?t.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?t.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=kf(r);if(e.size=i[0===t.state.direction?"height":"width"],e.scale=iu(t.chart.scale(n.scale),e.size),e.targetRect=i,o.length>0){const t=kf(o);e.targetFillRect=t}}else if(i&&i.length>0){const n=i.slice(1).reduce(((t,e)=>({x0:Math.min(t.x0,e.rect.computedInner.x),y0:Math.min(t.y0,e.rect.computedInner.y),x1:Math.max(t.x1,e.rect.computedInner.x+e.rect.computedInner.width),y1:Math.max(t.y1,e.rect.computedInner.y+e.rect.computedInner.height)})),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});e.targetRect={x:n.x0-t.state.rect.x,y:n.y0-t.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return e}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=e,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof e.brush?e.brush.context:e.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!e.multiple,this.state.h=t,this.state.onEditConfirmed=(t,e,n)=>{this.state.edit=null,function(t,e,n,i){let r=t.ranges.map((t=>({min:t.min,max:t.max})));const o=t.scale.min(),a=t.scale.max();r[e]={min:Math.max(o,Math.min(n,i)),max:Math.min(a,Math.max(n,i))},t.ranges[e]=Pi({},r[e]);const s=t.scale.data();s&&s.fields&&s.fields.forEach((e=>{t.fauxBrushInstance||t.brushInstance.setRange(e.id(),r)}))}(this.state,t,e,n),this.emit("bubbleEnd"),vf(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,vf(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof e.bubbles.label&&((t,n)=>e.bubbles.label.call(void 0,{datum:t,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof e.brush&&e.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const t=this.state.scale.data();!this.state.format&&t&&t.fields&&t.fields[0]&&(this.state.format=t.fields[0].formatter())}else this.state.editable=!1,this.state.scale=ac(),this.state.scale.data=r.data,this.state.format||(this.state.format=(t,e)=>Mf(r.range(),e)?function(t,e){const n=e.ticks(),i=e.domain().indexOf(wf(t,e));return-1!==i?n[i].label:"-"}(t,r):"-"),this.state.fauxBrushInstance=Hc(),this.state.findValues=t=>function(t,e){const n=e.domain(),i=e.range(),r=[];return t.forEach((t=>{if(!Mf(i,[t.min,t.max]))return;const o=n.indexOf(wf(t.min,e)),a=n.indexOf(wf(t.max,e));r.push.apply(r,n.slice(Math.min(o,a),Math.max(o,a)+1))})),r}(t,r);return this.state.ranges=bf(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[gf(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(t){!function(t){let{state:e,e:n,renderer:i,ranges:r,targetSize:o}=t;if(e.started)return;e.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};e.offset=Ei({},i.element().getBoundingClientRect());const u=a-e.offset.left,h=s-e.offset.top;e.offset.left+=e.targetRect?e.targetRect.x:0,e.offset.top+=e.targetRect?e.targetRect.y:0,e.ranges=r(e,e.fauxBrushInstance||e.brushInstance);const d=n.center[e.cssCoord.coord]-n[e.cssCoord.pos]-e.offset[e.cssCoord.offset],f=n.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];c.current=e.scale.normInvert(f/e.size),c.start=e.scale.normInvert(d/e.size);let p=e.ranges;const g=mf(e);let m,y,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),g.min=x>0?p[x-1].max:g.min,g.max=x+1<p.length?p[x+1].min:g.max;else{for(m=0;m<p.length;m++){if(p[m].min<=c.start&&c.start<=p[m].max){x=m,g.min=m?p[m-1].max:g.min,g.max=m+1<p.length?p[m+1].min:g.max;break}if(c.start<p[m].min){g.max=p[m].min,g.min=m?p[m-1].max:g.min;break}}-1===x&&p.length&&m>=p.length&&(g.min=p[p.length-1].max)}if(-1!==x||e.multi||(c.ranges=[],g.min=e.scale.min(),g.max=e.scale.max()),-1!==x)if(y={idx:x,start:p[x].min,end:p[x].max,limitLow:g.min,limitHigh:g.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let t=e.scale.norm(y.start)*e.size,n=e.scale.norm(y.end)*e.size;Math.abs(d-t)<=o?(c.start=y.end,y.mode="modify"):Math.abs(d-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:g.min,limitHigh:g.max,mode:"current"};c.active=y,"modify"!==y.mode&&e.targetRect&&!Qu(e.targetRect,{x:u,y:h})||Object.keys(c).forEach((t=>e[t]=c[t]))}({e:t,state:this.state,renderer:this.renderer,ranges:bf,targetSize:5})},end(){this.state.started&&(!function(t,e){t.started=!1,t.ranges=e(t,t.fauxBrushInstance||t.brushInstance);const n=mf(t);xf(t,t.current,n)}(this.state,bf),vf(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(t){this.state.started&&(!function(t,e){const n=(e.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset])/t.size,i=t.scale.normInvert(n);t.current=Math.max(Math.min(i,t.active.limitHigh),t.active.limitLow)}(this.state,t),function(t){let e=t.ranges.map((t=>({min:t.min,max:t.max})));if(-1!==t.active.idx)if("modify"===t.active.mode)e[t.active.idx].min=Math.min(t.start,t.current),e[t.active.idx].max=Math.max(t.start,t.current);else{const n=pf(t);e[t.active.idx].min+=n,e[t.active.idx].max+=n}else e.push({min:Math.min(t.start,t.current),max:Math.max(t.start,t.current)});const n=t.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(t.fauxBrushInstance){let i=bf(t,t.fauxBrushInstance),r=t.findValues(i),o=t.findValues(e),a=o.filter((t=>-1===r.indexOf(t))),s=r.filter((t=>-1===o.indexOf(t))),l=a.map((t=>({key:n.id(),value:t}))),c=s.map((t=>({key:n.id(),value:t})));t.brushInstance.addAndRemoveValues(l,c),t.fauxBrushInstance.setRange(n.id(),e)}else t.brushInstance.setRange(n.id(),e)}))}(this.state),vf(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(t){if(!this.state.editable)return;const e=t.srcEvent||t,n=e.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault();const r=n.parentNode;vf(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function Sf(t){t.renderer.render(gf(t))}function Nf(t){return t.rc.ranges()}function Rf(t,e){const n={x:t.direction?e.min+t.rect.x:t.rect.x,y:t.direction?t.rect.y:e.min+t.rect.y,width:t.direction?e.max-e.min:t.rect.width+t.rect.x,height:t.direction?t.rect.height+t.rect.y:e.max-e.min};return t.chart.shapesAt(n,t.settings.brush)}const Af={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(t){this.start(t)},areaMove(t){this.move(t)},areaEnd(t){this.end(t)},areaClear(t){this.clear(t)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(t){this.state.rect=this.rect;const e=this.settings.settings,n="vertical"===e.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(e.target?e.target.components||[e.target.component]:[]).map((t=>this.chart.component(t))).filter((t=>!!t&&!!t.rect)),a=o[0]?o.slice(1).reduce(((t,e)=>({x0:Math.min(t.x0,e.rect.x),y0:Math.min(t.y0,e.rect.y),x1:Math.max(t.x1,e.rect.x+e.rect.width),y1:Math.max(t.y1,e.rect.y+e.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=e,this.state.offset=r,this.state.rc=Ec(),this.state.renderer=this.renderer,this.state.multi=!!e.multiple,this.state.h=t,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(t,e){return function(t,e,n){const i=Math.min(...n),r=Math.max(...n),o={x:t.direction?i+t.rect.x:t.rect.x,y:t.direction?t.rect.y:i+t.rect.y,width:t.direction?r-i:t.rect.width+t.rect.x,height:t.direction?t.rect.height+t.rect.y:r-i},a=t.chart.shapesAt(o,t.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,r)=>{const o=n.bounds,a=r.bounds;return e===i?o[t.cssCoord.coord]<=a[t.cssCoord.coord]?n:r:o[t.cssCoord.coord]+o[t.cssCoord.area]>=a[t.cssCoord.coord]+a[t.cssCoord.area]?n:r})),l=t.settings.brush.components.reduce(((t,e)=>t.key===s.key?t:e));return"function"==typeof t.settings.bubbles.label?t.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,t,e)},[]},start(t){!function(t){let{state:e,e:n,renderer:i,ranges:r,targetSize:o}=t;if(e.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};e.offset=i.element().getBoundingClientRect(),e.ranges=r(e);const u=a-e.offset.left,h=s-e.offset.top,d=n.center[e.cssCoord.coord]-n[e.cssCoord.pos]-e.offset[e.cssCoord.offset],f=n.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];let p=f,g=d;c.start=d,c.current=f;let m=e.ranges;const y=yf(e);let x,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?m[b-1].max:y.min,y.max=b+1<m.length?m[b+1].min:y.max;else{for(x=0;x<m.length;x++){if(m[x].min<=g&&g<=m[x].max){b=x,y.min=x?m[x-1].max:y.min,y.max=x+1<m.length?m[x+1].min:y.max;break}if(g<m[x].min){y.max=m[x].min,y.min=x?m[x-1].max:y.min;break}}-1===b&&m.length&&x>=m.length&&(y.min=m[m.length-1].max)}if(-1!==b||e.multi||(c.ranges=[],y.min=0,y.max=e.direction?e.rect.width:e.rect.height),-1!==b)if(v={idx:b,start:m[b].min,end:m[b].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let t=v.start,e=v.end;Math.abs(d-t)<=o?(c.start=v.end,v.mode="modify"):Math.abs(d-e)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:g,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&e.targetRect&&!Qu(e.targetRect,{x:u,y:h})||Object.keys(c).forEach((t=>e[t]=c[t]))}({e:t,state:this.state,renderer:this.renderer,ranges:Nf,targetSize:5})},end(){this.state.started&&(!function(t,e){t.started=!1,t.ranges=e(t);const n=yf(t);xf(t,t.current,n)}(this.state,Nf),Sf(this.state))},move(t){this.state.started&&(!function(t,e){const n=e.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];t.current=Math.max(Math.min(n,t.active.limitHigh),t.active.limitLow)}(this.state,t),function(t){const e=t.ranges.map((t=>({min:t.min,max:t.max})));if(-1!==t.active.idx)if("modify"===t.active.mode)e[t.active.idx].min=Math.min(t.start,t.current),e[t.active.idx].max=Math.max(t.start,t.current);else{const n=pf(t);e[t.active.idx].min=t.active.start+n,e[t.active.idx].max=t.active.end+n}else e.push({min:Math.min(t.start,t.current),max:Math.max(t.start,t.current)});t.rc.set(e);let n=[];e.forEach((e=>{n=[...n,...Rf(t,e)]})),function(t,e){t.chart.brushFromShapes(e,t.settings.brush)}(t,n)}(this.state),Sf(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function Cf(t){const e="vertical"===t.direction,n=t.rect[e?"height":"width"],i=t.rect[e?"width":"height"];return function(t){const e=t.brush;if(!e||!e.isActive())return[];const n=t.scale.data(),i=(n&&n.fields||[]).map((t=>t.id())),r=e.brushes().filter((t=>"range"===t.type&&-1!==i.indexOf(t.id)))[0];return r?r.brush.ranges():[]}(t).map((r=>{const o=t.scale(r.min)*n,a=t.scale(r.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:t.fill,opacity:t.opacity,x:e?0:s,width:e?i:l,y:e?s:0,height:e?l:i}}))}function Df(t,e,n,i){function r(){!function(t){t.renderer.render(Cf(t))}(t)}function o(){!function(t){t.renderer.render(Cf(t))}(t)}function a(){!function(t){t.renderer.render(Cf(t))}(t)}t.brush=e,e&&(e.on("start",r),e.on("update",o),e.on("end",a),t.start=r,t.update=o,t.end=a,t.brush=e,t.scale=n,t.renderer=i)}function Of(t){t.brush&&(t.brush.removeListener("start",t.start),t.brush.removeListener("update",t.update),t.brush.removeListener("end",t.end)),t.start=void 0,t.update=void 0,t.end=void 0,t.brush=void 0,t.scale=void 0,t.renderer=void 0}const Ef={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const t=this.settings.settings,e=this.chart.brush(t.brush),n=t.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=iu(this.chart.scale(t.scale),i);return Of(this.state),Df(this.state,e,r,this.renderer),this.state.rect=this.rect,this.state.fill=t.fill||"#ccc",this.state.opacity=void 0!==t.opacity?t.opacity:1,this.state.direction=n,Cf(this.state)},beforeDestroy(){Of(this.state)}};function zf(t,e){const n=e.center.x,i=e.center.y;return{x:n-t.left,y:i-t.top}}function If(t,e,n){return wu(t,e.points[0])<n.settings.snapIndicator.threshold**2}function Tf(t,e){null==t.path.d?t.path.d="M".concat(e.x," ").concat(e.y," "):t.path.d+="L".concat(e.x," ").concat(e.y," "),t.points.push(e)}function Pf(t){let{state:e,start:n=null,end:i=null}=t;null!==n&&(e.snapIndicator.x1=n.x,e.snapIndicator.y1=n.y),null!==i&&(e.snapIndicator.x2=i.x,e.snapIndicator.y2=i.y)}function qf(t,e){t.snapIndicator.visible=e}const Lf={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(t){this.start(t)},lassoEnd(t){this.end(t)},lassoMove(t){this.move(t)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(t){var e;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(e=this.settings.settings.lasso).fill,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,strokeDasharray:e.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(t){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:t.strokeDasharray,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(t){return{visible:!0,type:"circle",cx:0,cy:0,r:t.r,fill:t.fill,opacity:t.opacity,stroke:t.stroke,strokeWidth:t.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(t,e){const n=t.element.getBoundingClientRect();return{x:e.left-n.left,y:e.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((t=>({key:t.key,contexts:t.contexts||["lassoBrush"],data:t.data||[""],action:t.action||"add"})));const n=zf(this.state.rendererBounds,t);Tf(this.state,n),Pf({state:this.state,start:n}),function(t,e){t.startPoint.cx=e.x,t.startPoint.cy=e.y}(this.state,n)},move(t){if(!this.state.active)return;const e=zf(this.state.rendererBounds,t);If(e,this.state,this.settings)?qf(this.state,!0):qf(this.state,!1),Tf(this.state,e),Pf({state:this.state,end:e}),function(t,e){const n=[t.startPoint,t.path,t.snapIndicator].filter((t=>t.visible));e.render(n)}(this.state,this.renderer),function(t,e){if(t.active){const n=t.points[t.points.length-2],i=t.points[t.points.length-1];t.lineBrushShape.x1=n.x+t.componentDelta.x,t.lineBrushShape.y1=n.y+t.componentDelta.y,t.lineBrushShape.x2=i.x+t.componentDelta.x,t.lineBrushShape.y2=i.y+t.componentDelta.y;const r=e.shapesAt(t.lineBrushShape,{components:t.brushConfig});e.brushFromShapes(r,{components:t.brushConfig})}}(this.state,this.chart)},end(t){if(!this.state.active)return;qf(this.state,!1);If(zf(this.state.rendererBounds,t),this.state,this.settings)&&function(t,e){if(t.active){const n=t.componentDelta.x,i=t.componentDelta.y,r=t.points.map((t=>({x:t.x+n,y:t.y+i}))),o=e.shapesAt({vertices:r},{components:t.brushConfig});e.brushFromShapes(o,{components:t.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var t,e;this.state.active&&(t=this.state,e=this.chart,t.brushConfig.forEach((t=>{t.contexts.forEach((t=>{e.brush(t).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function jf(t,e,n,i,r){let o,a=0,s=e.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=r(e[l]),o[n]+o[i]<t[n]?a=l+1:s=l}return a}function Ff(t){let{orientation:e,targetNodes:n,labels:i,container:r}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jf;const a=[],s="v"===e?"x":"y",l="v"===e?"width":"height",c=t=>t.textBounds,u=t=>t.node.localBounds;return(t,e)=>{const{textBounds:h,node:d}=i[e];if(h[s]<r[s]||h[s]+h[l]>r[s]+r[l])return!1;for(let t=o(h,a,s,l,c);t<a.length;t++)if(Zu(h,a[t].textBounds))return!1;const f=o(h,n,s,l,u),p=h[s]+h[l];for(let t=f;t<n.length;t++){const e=n[t].node;if(p<e.localBounds[s])break;if(Zu(h,e.localBounds)&&d!==e)return!1}return a.push(i[e]),!0}}const Bf=4;function Vf(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function $f(t){const e=typeof t;return("string"===e||"number"===e)&&""!==t}function Hf(t){return Pi(Pi({type:"rect",rx:2,ry:2,fill:t.backgroundColor},t.backgroundBounds),{},{data:"".concat(t.data," ").concat(t.text),rotation:t.transform&&t.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Wf(t,e,n){return n?t.width>=e.height:t.width>=e.width}function Uf(t,e,n){return n?t.height>=e.width:t.height>=e.height}function Yf(t,e,n,i,r){let o,a;return"v"===t?(o=i||r||Wf(e,n,!0),a=Uf(e,n,!i)):(o=Wf(e,n),a=r||Uf(e,n,!1)),o&&a}function Xf(t,e,n,i){return t+.5*e+(i-.5)*(e-n)-.5*n}function Gf(t,e,n){const i={type:"text",text:e,maxWidth:n.rotate?t.height:t.width,x:0,y:t.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(t,e,n){return Wf(t,e,n.rotate)&&Uf(t,e,n.rotate)}(t,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=Xf(t.x,t.width,r.height,n.align)+o,i.y=Xf(t.y,t.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=Xf(t.x,t.width,r.width,n.align),i.y=Xf(t.y,t.height,r.height,n.justify)+o),i}function Kf(t){let{bar:e,view:n,direction:i,position:r,padding:o=Bf,measured:a}=t;const s={};if(Ei(s,e),r&&"inside"!==r)if("up"===i||"down"===i){const t=Math.max(0,Math.min(e.y,n.height)),o=Math.max(0,Math.min(e.y+e.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=t):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const t=Math.max(0,Math.min(e.x,n.width)),o=Math.max(0,Math.min(e.x+e.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=t):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(t,e){const n=Math.max(0,Math.min(t.y,e.height)),i=Math.max(0,Math.min(t.y+t.height,e.height)),r=Math.max(0,Math.min(t.x,e.width)),o=Math.max(0,Math.min(t.x+t.width,e.width));t.x=r,t.width=o-r,t.y=n,t.height=i-n}(s,n),function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:i=Bf,bottom:r=Bf,left:o=Bf,right:a=Bf}=n,s="function"==typeof o?o(e):o,l="function"==typeof a?a(e):a,c="function"==typeof i?i(e):i,u="function"==typeof r?r(e):r;t.x+=s,t.width-=s+l,t.y+=c,t.height-=c+u}(s,a,o),s}function Zf(t){let e,n,i,r,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=t,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kf;const p=[],g="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:a,position:i.position,padding:i.padding,measured:l}),p.push(r),e=!o||r[g]>e[g]?r:e,Yf(u,r,l,s,i.overflow)){n=r;break}return n||(n=e,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function Jf(t,e,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=Bf,bottom:a=Bf,left:s=Bf,right:l=Bf}=r,c="function"==typeof s?s(e):s,u="function"==typeof l?l(e):l,h="function"==typeof o?o(e):o,d="function"==typeof a?a(e):a,f=t.x+t.dx,p=t.y+t.dy,g=n?Math.min(e.width,i.height):Math.min(e.height,i.width),m=n?Math.min(e.height,i.height):Math.min(e.width,i.width),y=.5*e.height,x=1e-9;return{x:(n?f-y:f)-c-x,y:(n?p:p-y)-h-x,width:m+(c+u)-x,height:g+(h+d)-x}}function Qf(t){let{chart:e,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zf,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gf,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ff;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,g,m,y,x,v,b,w,M,k,_;for(let t=0,l=n.length;t<l;t++){m=null,d=n[t],f=d.node,k=Vf(f,e),v=d.direction,_="left"===v||"right"===v?"h":"v";for(let e=0;e<d.texts.length;e++){if(p=d.texts[e],!$f(p))continue;b=d.labelSettings[e],x=d.measurements[e],M=b.placements;const n=a({direction:v,fitsHorizontally:r,lblStngs:b,measured:x,node:f,orientation:_,placements:M,placementSettings:d.placementSettings[e],rect:i});if(m=n.bounds,w=n.placement,m&&w){g=w.justify;const e="function"==typeof b.linkData?b.linkData(k,t):void 0,n="function"==typeof w.overflow?w.overflow(k,t):w.overflow;"up"===v&&(g=1-g),"opposite"===w.position&&(g=1-g),"left"===v&&(g=1-g);const i=!("h"===o||r);if(h=s(m,p,{justify:"h"===_?w.align:g,align:"h"===_?g:w.align,fontSize:b.fontSize,fontFamily:b.fontFamily,textMetrics:x,rotate:i,overflow:!!n}),h){const n=Jf(h,x,i,m,w.padding);y="function"==typeof w.fill?w.fill(Pi(Pi({},k),{},{textBounds:n}),t):w.fill,h.fill=y,void 0!==e&&(h.data=e),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill(Pi(Pi({},k),{},{textBounds:n}),t):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=Jf(h,x,i,m,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const S=c.filter(l(u));return[...S.filter((t=>void 0!==t.backgroundBounds)).map(Hf),...S]}function tp(t){const e=2*Math.PI;return(t%e+e)%e}function ep(t,e){t.x+=e,t.width-=2*e,t.y+=e,t.height-=2*e}function np(t){return{x:t.x,y:t.y-t.height/2,width:t.width,height:t.height}}function ip(t,e,n){let{x:i,y:r}=e;if(i*i+r*r>t*t)return null;let o=Math.sin(n),a=Math.cos(n),s=i*a-r*o,l=t*t-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function rp(t){let e,n,{radius:i,size:r,angle:o}=t,{width:a,height:s}=r,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(e=ip(i,l,o),!e)return null;e.y*=-1,n={x:-a,y:0};break;case 1:if(e=ip(i,l,Math.PI-o),!e)return null;n={x:-a,y:-s};break;case 2:if(e=ip(i,l,o-Math.PI),!e)return null;e.x*=-1,n={x:0,y:-s};break;case 3:if(e=ip(i,l,2*Math.PI-o),!e)return null;e.x*=-1,e.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:e.x+n.x,y:e.y+n.y,width:a,height:s}}function op(t){let{slice:e,measured:n,padding:i}=t,{start:r,end:o,innerRadius:a,outerRadius:s}=e,l=s-a-2*i,c=o-r;if(c<Math.PI){let t=(n.height/2+i)/Math.tan(c/2);t>a&&(l=s-t-2*i)}if(l<0||l<n.minReqWidth)return null;const u=tp((r+o)/2);let h=s-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function ap(t){let{context:e,node:n,bounds:i}=t;let{start:r,end:o}=n.desc.slice;const a=tp((r+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:e.q1maxY=i.y-2,void 0===e.q2minY&&(e.q2minY=i.y+i.height+2);break;case 1:e.q2minY=i.y+i.height+2;break;case 2:e.q3minY=i.y+i.height+2;break;case 3:e.q4maxY=i.y-2,void 0===e.q3minY&&(e.q3minY=i.y+i.height+2)}}function sp(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function lp(t,e,n){const i={type:"text",text:e,maxWidth:t.width,x:t.x,y:t.y+("top"===t.baseline?t.height/2:0),fill:n.fill,anchor:t.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(t.angle)){let e=t.angle*(360/(2*Math.PI));i.transform="rotate(".concat(e,", ").concat(i.x,", ").concat(i.y,")")}return i}function cp(t){let e,n,{slice:i,direction:r,position:o,padding:a,measured:s,view:l,context:c,store:u}=t,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":e="rotate"===r?op({slice:i,measured:s,padding:a}):function(t){let{slice:e,padding:n,measured:i}=t,{start:r,end:o,innerRadius:a,outerRadius:s}=e;const l=tp((r+o)/2);let c=rp({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",th(c,{x1:0,y1:0,x2:Math.sin(r)*s,y2:-Math.cos(r)*s})||th(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Wu({cx:0,cy:0,r:a},c)?null:(ep(c,n),c)):null}({slice:i,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},e="rotate"===r?op({slice:n,measured:s,padding:a}):function(t){let{slice:e,padding:n,measured:i,store:r}=t;const{start:o,end:a,outerRadius:s}=e,l=tp((o+a)/2);let c=rp({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",ep(c,n),r.insideLabelBounds.some((t=>Zu(t,c)))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":e="rotate"===r?function(t){let{slice:e,measured:n,padding:i,view:r}=t,{start:o,end:a,outerRadius:s,offset:l}=e,c=s+i,u=a-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=tp((o+a)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,g=h%Math.PI;if(g>Math.PI/2&&(g=Math.PI-g),Math.cos(g)>.001){let t=f<0?r.y:r.y+r.height,e=Math.abs(t-l.y)/Math.cos(g)-Math.tan(g)*(n.height/2)-2*i-s;e<p&&(p=e)}if(Math.sin(g)>.001){let t=d<0?r.x:r.x+r.width,e=Math.abs(t-l.x)/Math.sin(g)-n.height/2/Math.tan(g)-2*i-s;e<p&&(p=e)}if(p<=0||p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return h<Math.PI?(m.angle=h-Math.PI/2,m.anchor="start"):(m.angle=h+Math.PI/2,m.anchor="end"),m}({slice:i,measured:s,padding:a,view:l}):function(t){let{slice:e,measured:n,padding:i,view:r,context:o}=t,{start:a,end:s,outerRadius:l,offset:c}=e;const u=tp((a+s)/2);if(function(t,e,n){switch(e){case 0:return t.q1maxY<0;case 1:return t.q2minY>n.height;case 2:return t.q3minY>n.height;case 3:return t.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let t=Math.abs(r.x+r.width-(d+c.x));t<p&&(p=t)}else{let t=Math.abs(r.x-(d+c.x));t<p&&(p=t)}if(p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return u<Math.PI?g.anchor="start":g.anchor="end",g}({slice:i,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return e&&(e.x+=p.x,e.y+=p.y,"outside"===o&&"rotate"!==r&&function(t,e,n){const{start:i,end:r,offset:o,outerRadius:a}=n,s=tp((i+r)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==e.q1maxY){let n=Math.min(t.y,e.q1maxY-t.height),i=t.y-n;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x-2,y1:t.y+2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 1:if(void 0!==e.q2minY){let n=Math.max(t.y,e.q2minY),i=n-t.y;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x-2,y1:t.y-2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 2:if(void 0!==e.q3minY){let n=Math.max(t.y,e.q3minY),i=n-t.y;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x+2,y1:t.y-2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}break;case 3:if(void 0!==e.q4maxY){let n=Math.min(t.y,e.q4maxY-t.height),i=t.y-n;if(t.y=n,i>1){let e=a+2;t.line={type:"line",x1:t.x+2,y1:t.y+2,x2:o.x+Math.sin(s)*e,y2:o.y-Math.cos(s)*e,strokeWidth:1}}}}}(e,c,i)),e}function up(t){let{context:e,direction:n,measured:i,node:r,placementSettings:o,rect:a,store:s}=t,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:cp;for(let t=0;t<o.length;t++){let c=o[t],u=l({context:e,slice:r.desc.slice,view:a,direction:n,position:c.position,measured:i,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function hp(t,e,n){const i=e.fontFamily,r="".concat(e.fontSize,"px"),o=n.measureText({text:t,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(t[0],"…"),fontFamily:i,fontSize:r}).width),o}const dp=/\n+|\r+|\r\n/,fp=/\s/,pp=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function gp(t){return"string"==typeof t?-1!==t.search(dp):-1!==String(t).search(dp)}function mp(t){return-1!==t.search(fp)}function yp(t){return-1!==t.search(pp)}function xp(t,e,n){return Math.max(e,Math.min(n,t))}function vp(){let{string:t,separator:e="",reverse:n=!1,measureText:i=t=>({width:t.length,height:1}),mandatoryBreakIdentifiers:r=[gp],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[mp,gp,t=>""===t],hyphenationIdentifiers:s=[yp]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(t).split(e);!function(t){""===t[0]&&t.shift(),""===t[t.length-1]&&t.pop()}(l);const c=l.length,u=n?t=>t>=0:t=>t<c;let h=n?c:-1;function d(t){const e=xp(t,0,c-1),n=l[e],u=i(n),h=function(t,e,n,i,r){return i.some((i=>i(t,e,n)))?1:r.some((i=>i(t,e,n)))?0:2}(n,e,l,r,o);return{index:e,value:n,breakOpportunity:h,suppress:a.some((t=>t(n,e,l))),hyphenation:s.some((t=>t(n,e,l))),width:u.width,height:u.height,done:!1}}return{next:function(t){return isNaN(t)?n?h--:h++:h=xp(t,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const bp="…",wp=/^\s*\d+(\.\d+)?px\s*$/i;function Mp(t){return"string"===typeof t&&wp.test(t)}function kp(t){const e=t["font-size"]||t.fontSize;return Mp(e)?parseFloat(e)*Math.max(isNaN(t.lineHeight)?1.2:t.lineHeight,0):19.2}function _p(t){const e=t.maxHeight,n=Math.max(t.maxLines,1)||1/0;if(isNaN(e))return n;const i=kp(t);return Math.max(1,Math.min(Math.floor(e/i),n))}function Sp(t,e){return{lines:[],line:"",width:0,maxLines:_p(t),maxWidth:t.maxWidth,hyphens:{enabled:"auto"===t.hyphens,char:"‐",metrics:e("‐")}}}function Np(t){t.lines.push(t.line),t.line="",t.width=0}function Rp(t,e){t.line+=e.value,t.width+=e.width}function Ap(t,e,n){if(e.width>t.maxWidth)return e;const i=e.index;for(let r=1;r<5;r++){const o=n.peek(e.index-1);if(!e.hyphenation||!o.hyphenation||0===e.index)return e;if(t.width+t.hyphens.metrics.width<=t.maxWidth)return t.line+=t.hyphens.char,e;if(1===t.line.length)return e;e=n.next(i-r),t.line=t.line.slice(0,-1),t.width-=e.width}return e}function Cp(t,e,n){const i=vp({string:e.value,measureText:n});for(;t.lines.length<t.maxLines;){let e=i.next();if(e.done)break;t.width+e.width>t.maxWidth&&2===e.breakOpportunity&&t.line.length>0?(e=t.hyphens.enabled?Ap(t,e,i):e,Np(t),Rp(t,e)):Rp(t,e)}}function Dp(t,e){const n=vp({string:t.text,separator:"",measureText:e,noBreakAllowedIdentifiers:[(t,e)=>0===e]}),i=Sp(t,e);let r=!0;for(;i.lines.length<i.maxLines;){let t=n.next();if(t.done){Np(i),r=!1;break}1===t.breakOpportunity?Np(i):i.width+t.width>i.maxWidth&&2===t.breakOpportunity?t.suppress?i.width+=t.width:(t=i.hyphens.enabled?Ap(i,t,n):t,Np(i),Rp(i,t)):Rp(i,t)}return{lines:i.lines,reduced:r}}function Op(t,e){const n=vp({string:t.text,separator:/(\s|-|\u2010)/,measureText:e}),i=Sp(t,e);let r=!0;for(;i.lines.length<i.maxLines;){let t=n.next();if(t.done){Np(i),r=!1;break}1===t.breakOpportunity?Np(i):i.width+t.width>i.maxWidth&&2===t.breakOpportunity?t.suppress?Np(i):t.width>i.maxWidth?Cp(i,t,e):(Np(i),Rp(i,t)):Rp(i,t)}return{lines:i.lines,reduced:r}}function Ep(t){return{"break-all":Dp,"break-word":Op}[t.wordBreak]}function zp(t){return e=>{const n=e.node;if(function(t){return"text"===t.type&&!t._lineBreak}(n)){const i=Ep(n);if(!i)return;const r=t(n);if(r.width>n.maxWidth||gp(n.text)){const o=(kp(n)-r.height)/2,a=i(n,function(t,e){return n=>e({text:n,fontSize:t.fontSize,fontFamily:t.fontFamily})}(n,t));e.node=function(t,e,n,i){const r={type:"container",children:[]};void 0!==e.id&&(r.id=e.id);let o=0;return t.lines.forEach(((a,s)=>{const l=Ei({},e);l.text=a,l._lineBreak=!0,o+=n,t.reduced&&s===t.lines.length-1?l.text+=bp:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)})),r}(a,n,o,r.height)}}}}function Ip(t,e){let{text:n,"font-size":i,"font-family":r,maxWidth:o}=t;if(n="string"==typeof n?n:"".concat(n),void 0===o)return n;let a=e({text:n,fontSize:i,fontFamily:r}).width;if(a<=o)return n;let s=0,l=n.length-1;for(;s<=l;){let t=Math.floor((s+l)/2);a=e({text:n.substr(0,t)+bp,fontSize:i,fontFamily:r}).width,a<=o?s=t+1:l=t-1}return n.substr(0,l)+bp}function Tp(t){const e=t.baseline||t["dominant-baseline"];let n=0;const i=parseInt(t.fontSize||t["font-size"],10)||0;switch(e){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const Pp={},qp={},Lp={fontSize:void 0,fontFamily:void 0};let jp;function Fp(t,e){return!t&&!e||t===e}function Bp(t){let{text:e,fontWeight:n,fontSize:i,fontFamily:r}=t;const o="".concat(e," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof qp[o]&&(jp=jp||document.createElement("canvas").getContext("2d"),function(t){let{fontWeight:e,fontSize:n,fontFamily:i}=t;Fp(Lp.fontWeight,e)&&Fp(Lp.fontSize,n)&&Fp(Lp.fontFamily,i)||(jp.font=[e,n,i].filter((t=>!!t)).join(" "),Lp.fontWeight=e,Lp.fontSize=n,Lp.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),qp[o]=jp.measureText(e).width),qp[o]}function Vp(t){return"number"!=typeof Pp[t]&&(Pp[t]=function(t){if(Mp(t)){const e=parseFloat(t);return e+4*Math.ceil((e+1e-12)/24)}return 16}(t)),Pp[t]}function $p(t){let{text:e,fontWeight:n,fontSize:i,fontFamily:r}=t;return{width:Bp({text:e,fontWeight:n,fontSize:i,fontFamily:r}),height:Vp(i)}}function Hp(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;const n=t["font-size"]||t.fontSize,i=t["font-family"]||t.fontFamily,r=e({text:t.text,fontFamily:i,fontSize:n}),o=Math.min(t.maxWidth||r.width,r.width),a=t.x||0,s=t.y||0,l=t.dx||0,c={x:0,y:s+((t.dy||0)+Tp(t))-.75*r.height,width:o,height:r.height},u=t["text-anchor"]||t.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function Wp(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$p;const n=Ep(t),i=t["font-size"]||t.fontSize,r=t["font-family"]||t.fontFamily,o=e({text:t.text,fontFamily:r,fontSize:i});if(n&&(o.width>t.maxWidth||gp(t.text))){const o=n(t,(t=>e({text:t,fontFamily:r,fontSize:i}))),a=Ei({},t);let s=0,l="";for(let t=0,n=o.lines.length;t<n;t++){let a=o.lines[t];a+=t===n-1&&o.reduced?bp:"";const c=e({text:a,fontSize:i,fontFamily:r}).width;c>=s&&(s=c,l=a)}a.text=l;const c=Hp(a,e);return c.height=kp(t)*o.lines.length,c}return Hp(t,e)}function Up(t,e){return{node:t,data:t.data,scale:e.scale,formatter:e.formatter,dataset:e.dataset}}function Yp(t,e,n){const i={type:"text",text:e,maxWidth:t.width,x:0,y:t.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(t.width<n.fontSize)return!1;const o=Math.max(0,t.width-r.width);return i.x=t.x+n.align*o,i.y=t.y+r.height/1.2,i}function Xp(t){let{cx:e,cy:n,r:i}=t;return{type:"circle",bounds:{cx:e,cy:n,r:i}}}function Gp(t){return t.desc&&t.desc.slice?function(t){let{start:e,end:n,innerRadius:i,outerRadius:r,offset:o}=t;if(Math.abs(e+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==i?i:r;return Xp({cx:o.x,cy:o.y,r:a})}(t.desc.slice):"circle"===t.type?Xp(t.attrs):"rect"===t.type?{type:"rect",bounds:t.bounds}:{type:null,bounds:null}}var Kp={bar:function(t){let{settings:e,chart:n,nodes:i,rect:r,renderer:o,style:a}=t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Qf;const l=Ei({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=e.labels.map((t=>Ei({},l,e,t))),u=e.labels.map((t=>t.placements.map((n=>Ei({},l,e,t,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=function(t){let{nodes:e,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:a,renderer:s}=t;const l={},c=[];let u,h,d,f,p,g,m,y=!0,x=!1;for(let t=0;t<e.length;t++){if(h=e[t],f=h.localBounds,!Zu(f,n))continue;let v=Vf(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let e=0;e<r.length;e++)g=r[e],d="function"==typeof g.label?g.label(v,t):void 0,$f(d)&&(m="function"==typeof a.direction?a.direction(v,t):a.direction||"up",x=x||"left"===m||"right"===m,l.fontFamily=g.fontFamily,l.fontSize="".concat(g.fontSize,"px"),l.text=d,p=s.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(g),u.placementSettings.push(o[e]),u.direction=m,y=y&&p.width<=f.width-2*Bf);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:x}}({nodes:i,chart:n,renderer:o,settings:e,rect:r,labelSettings:c,placementSettings:u}),p=function(t){let{orientation:e="auto",defaultOrientation:n="h"}=t;switch(e.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:e.orientation,defaultOrientation:d?"h":"v"}),g="h"===p?"y":"x",m="h"===p?"height":"width";return f.sort(((t,e)=>t.node.localBounds[g]+t.node.localBounds[m]-(e.node.localBounds[g]+e.node.localBounds[m]))),s({chart:n,targetNodes:f,stngs:e,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(t){let{settings:e,chart:n,nodes:i,rect:r,renderer:o,style:a}=t,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:up,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lp;const c=Ei({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=e.labels.map((t=>Ei({},c,e,t))),h=e.labels.map((t=>t.placements.map((n=>Ei({},c,e,t,n))))),d=[],f={insideLabelBounds:[]};i=function(t){const e=[],n=[],i=[],r=[];for(let o=0;o<t.length;++o){const{start:a,end:s}=t[o].desc.slice,l=tp((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:e.push(t[o]);break;case 1:n.push(t[o]);break;case 2:i.push(t[o]);break;case 3:r.push(t[o])}}const o=(t,e)=>tp((t.desc.slice.start+t.desc.slice.end)/2)-tp((e.desc.slice.start+e.desc.slice.end)/2),a=(t,e)=>o(e,t);return e.sort(a),n.sort(o),i.sort(a),r.sort(o),e.concat(n,r,i)}(i);const p={};for(let t=0,e=i.length;t<e;t++){const e=i[t],a=sp(e,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(a,t):"";if(!c)continue;const g="function"==typeof i.direction?i.direction(a,t):i.direction||"horizontal",m="function"==typeof i.linkData?i.linkData(a,t):void 0,y=hp(c,i,o),x=s({context:p,direction:g,lblStngs:i,measured:y,node:e,placementSettings:h[n],rect:r,store:f}),v=x.bounds,b=x.placement;if(v&&b){if("outside"===b.position&&"rotate"!==g){ap({context:p,node:e,bounds:v});if(!qu(np(v),r))continue}const n="function"==typeof b.fill?b.fill(a,t):b.fill,o=l(v,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==m&&(o.data=m),d.push(o),v.line&&(v.line.stroke=n,d.push(v.line)))}}}return d},rows:function(t){let{settings:e,chart:n,nodes:i,renderer:r,style:o}=t,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yp;const s=Ei({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=Ei({},s,e),c=e.labels.map((t=>Ei({},l,t))),u={},h=[];for(let t=0,e=i.length;t<e;t++){let e=i[t],o=Up(e,n),{type:s,bounds:d}=Gp(e);if(!d)continue;let f,p=0,g=[],m=[],y="circle"===s?2*d.r*.9:d.height;for(p+=l.padding,f=0;f<c.length;f++){let e=c[f],n="function"==typeof e.label?e.label(o,t):"";u.fontFamily=e.fontFamily,u.fontSize="".concat(e.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+e.padding,p>y)break;m.push(n),g.push(i)}const x=f,v=Math.max(0,y-p);let b;for(b="circle"===s?d.cy-.9*d.r:d.y,b+=l.justify*v+l.padding,f=0;f<x;f++){let e,n=c[f];if("circle"===s){let t=Math.max(Math.abs(b-d.cy),Math.abs(b+g[f].height-d.cy)),n=Math.sqrt(d.r*d.r-t*t);e={x:d.cx-n+l.padding,y:b,width:2*n-2*l.padding,height:g[f].height}}else e={x:d.x+l.padding,y:b,width:d.width-2*l.padding,height:g[f].height};b+=g[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,t):n.fill;const u="function"==typeof n.linkData?n.linkData(o,t):void 0;let p=a(e,m[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[f]});if(p){if(p.text&&p.text!==bp){const t=Ip(p,r.measureText);if(bp===t)continue;p.ellipsed=t}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const Zp={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const t=this.settings.settings,e=[];return(t.sources||[]).forEach((t=>{t.strategy&&Kp[t.strategy.type]&&t.component&&e.push(...function(t,e){let{chart:n,source:i,rect:r,renderer:o,style:a}=t;if(!n.component(i.component))return[];const s=n.findShapes(i.selector).filter((t=>t.key===i.component));return e({chart:n,settings:i.strategy.settings,nodes:s,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:t,style:this.style},Kp[t.strategy.type]))})),e}};const Jp={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function Qp(t){let{x:e=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:a="ltr"}=t,s=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===a;let h={x:u?e+r.maxLabelBounds.width:e+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(t,e,n){const i=Math.max(0,t.width-e),r=Math.max(0,t.height-e);return{x:t.x+e/2+n.align*i,y:t.y+e/2+n.justify*r}}({x:u?e+r.maxLabelBounds.width+r.spacing:e,y:n,width:r.maxSymbolSize,height:h.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(Ei({},c,d));return delete f.collider,s.anchor=u?"end":"start",function(t,e,n){const i=n.textMetrics;if(t.height<i.height)return!1;const r=Math.max(0,t.width-i.width);e.baseline="text-before-edge";const o=Math.max(0,t.height-i.height);e.x=t.x+n.align*r,e.y=t.y+n.justify*o+.175*parseInt(e.fontSize,10)}(h,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[f,s],collider:{type:"rect",x:e,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function tg(t,e){const n=t.items.length,i=Math.ceil(n/e),r="horizontal"===t.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return t.globalMetrics.maxItemBounds[r]*i+(i-1)*t.layout.margin[o]}function eg(t,e){let n,i,r,o,{onScroll:a=()=>{}}=e,s=null,l=0;const c={itemize:e=>{n=function(t,e){let n,i,{resolved:r,dock:o}=t,a=[],s=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let t=0;t<s.length;t++){if(!1===s[t].show)continue;const r=void 0!==c[t].text?c[t].text:c[t].data.label||"";n=Ei({},c[t],{type:"text",fontSize:"".concat(parseInt(c[t].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[t]},label:{displayObject:n,bounds:e.textBounds(n)}},a.push(i),u=Math.max(l[t].size,u),h=Math.max(i.label.bounds.width,h),d=Math.max(i.label.bounds.height,d)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,d),width:u+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(e,t.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:e=>{r=e.viewRect,l=c.getContentOverflow(r);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=Ei({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(t,e,n){let{viewRect:i}=t,{itemized:r,create:o=Qp,parallels:a,createSymbol:s}=n;const l=r.layout.direction,c=r.globalMetrics,u=r.items,h="horizontal"===r.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,g=c.maxItemBounds.width,m=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+g;let x=e.x,v=e.y,b=i.x-e.x;for(let t=0;t<u.length;t++){let n=o({y:v,x:"rtl"===l?i.x+b+i.width-g-(x-e.x):x,item:u[t],globalMetrics:c,direction:l,createSymbol:s});if((h&&x>=i.x-g||!h&&v>=i.y-p)&&f.push(n.item),d++,d>=a?(d=0,h?(x+=y,v=e.y):(v+=m,x=e.x)):h?v+=m:x+=y,!h&&v>i.y+i.height)break;if(h&&x>i.x+i.width)break}return f}(e,o,{itemized:n,parallels:i,createSymbol:t.symbol})},parallelize:(t,e)=>(i=function(t,e,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let s=Math.ceil(a/t);if(null!=e){const t="horizontal"===n.layout.orientation?"height":"width",i="width"===t?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((e+r)/(r+n.globalMetrics.maxItemBounds[t]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(t,e,n),i),hasContentOverflow:()=>{const t="horizontal"===n.layout.orientation?"width":"height";return tg(n,i)>r[t]},getContentOverflow:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const e="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,tg(n,i)-t[e])},getNextSize:()=>{const t="horizontal"===n.layout.orientation?"width":"height",e="width"===t?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[t]+n.layout.margin[e]},getPrevSize:()=>{const t="horizontal"===n.layout.orientation?"width":"height",e="width"===t?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[t]+n.layout.margin[e]},hasNext:()=>"horizontal"===c.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<r.x:o.y<r.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:t=>{const e=Math.max(0,Math.min(l,s-t));e!==s&&(s=e,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>tg(n,i),spread:()=>function(t,e){const n=e,i="horizontal"===t.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return t.globalMetrics.maxItemBounds[i]*n+(n-1)*t.layout.margin[r]}(n,i)};return c}function ng(t){return Object.keys(t).filter((e=>t[e])).join(" ")}const ig={up:"▲",right:"▶",down:"▼",left:"◀"};function rg(t,e){let{size:n,isActive:i,direction:r,nav:o,attrs:a}=e,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:r}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(t,{direction:r})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!i||o&&o.disabled)&&(c.disabled="disabled"),t("button",Ei({class:ng(s),style:u},c),[l||t("span",{style:{pointerEvents:"none"}},[ig[r]])])}function og(t){let e;const n={itemize:t=>{e=function(t){let{dock:e,navigation:n}=t;return{layout:{orientation:"top"===e||"bottom"===e?"vertical":"horizontal"},navigation:n}}(t)},render:i=>function(t,e,n,i){let{rect:r,itemRenderer:o}=e;if(!t||!t.renderArgs)return;t.size(r);const a=t.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void t.render([]);const h=s?["right","left"]:["down","up"];l&&s&&h.reverse();const d=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[rg(a,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),rg(a,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];t.render(d)}(n.renderer,i,e,t),extent:()=>32,spread:()=>64};return n}function ag(t){let e;const n={itemize:n=>{e=function(t,e){let{resolved:n}=t;if(!1===n.title.item.show)return null;const i=Ei({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const t=e.scale.data().fields;i.text=t&&t[0]?t[0].title():""}return{displayObject:i,bounds:e.renderer.textBounds(i)}}(n,t)},render:t=>{!function(t,e,n){let{rect:i}=t;if(!e)return;const r=[];if(e.size(i),n){const t={start:0,end:i.width,middle:i.width/2};r.push(Ei({},n.displayObject,{x:t[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}e.render(r)}(t,n.renderer,e)},spread:()=>e?e.bounds.height:0,extent:()=>e?e.bounds.width:0};return n}function sg(t,e,n,i){let r,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:e.spacing,y:e.spacing,width:t.width-2*e.spacing,height:t.height-2*e.spacing};if(r={x:d.x,y:d.y,width:d.width,height:c.spread()},"horizontal"===n){r={x:d.x,y:d.y,width:c.extent(),height:c.spread()};const t=d.width-r.width-(r.width?e.spacing:0),n=d.height;s.parallelize(t,u?void 0:n);const i=s.extent()>t?l.extent():0,f=s.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?e.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?e.spacing:0)-(r.width?e.spacing:0),height:n},a={x:o.x+o.width+(i?e.spacing:0),y:d.y,width:i,height:d.height},r.y=o.y;"rtl"===s.direction()&&(a.x=d.x,o.x=a.x+a.width+(a.width?e.spacing:0),r.x=o.x+o.width+(r.width?e.spacing:0)),h=Math.max(r.height,p,s.spread())}else{const t=d.height-r.height-(r.height?e.spacing:0),n=d.width;s.parallelize(t,u?void 0:n);const i=s.extent()>t?l.extent():0;a={x:d.x,y:d.y+d.height-i,width:d.width,height:i},o={x:d.x,y:r.y+r.height+(r.height?e.spacing:0),width:d.width,height:d.height-r.height-(r.height?e.spacing:0)-a.height-(a.height?e.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,s.spread())}return o=Ei({},t,{x:t.x+o.x,y:t.y+o.y,width:o.width,height:o.height}),a.x+=t.x,a.y+=t.y,r.x+=t.x,r.y+=t.y,{title:Ei({},t,r),content:Ei({},t,o),navigation:Ei({},t,a),orientation:n,preferredSize:h}}function lg(t){t.state.resolved=function(t){const e=t.scale.domain();let n={items:[]};const i=t.settings.layout.dock;if("threshold-color"===t.scale.type){const r=t.scale.data().fields[0];let o=t=>String(t);t.settings.formatter?o=t.chart.formatter(t.settings.formatter):r&&(o=r.formatter());for(let t=0;t<e.length-1;t++){const i={value:e[t],label:"".concat(o(e[t])," - < ").concat(o(e[t+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=t.scale.labels?t.scale.labels():null;n.items=e.map(((e,n)=>{const r=t.scale.datum?Ei({},t.scale.datum(e)):{value:e};return r.value=e,t.scale.label?r.label=t.scale.label(e):i&&(r.label=i[n]),r}))}const r=t.resolver.resolve({data:{fields:t.scale.data().fields},defaults:Ei(!0,{},Jp.title,t.style.title),settings:t.settings.settings.title}),o=t.resolver.resolve({data:{fields:t.scale.data().fields},defaults:Jp.layout,settings:t.settings.settings.layout}),a=t.resolver.resolve({data:n,defaults:Ei(!0,{},Jp.item.label,t.style.item.label),settings:(t.settings.settings.item||{}).label}),s=Ei(!0,{},(t.settings.settings.item||{}).shape);void 0===s.fill&&t.settings.scale&&(s.fill={scale:t.settings.scale});const l=t.resolver.resolve({data:n,defaults:Ei(!0,{},Jp.item.shape,t.style.item.shape),settings:s}),c=t.resolver.resolve({data:n,defaults:Ei(!0,{},{show:Jp.item.show}),settings:{show:(t.settings.settings.item||{}).show}});function u(t,n){let i=t.data.value,r=e[n+1];t.data.value=[i,r]}"threshold-color"===t.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:r,labels:a,symbols:l,items:c,layout:o}}(t),t.titleRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center"}),t.itemRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center"}),t.navigationRenderer.itemize({resolved:t.state.resolved,dock:t.settings.layout.dock||"center",navigation:t.settings.settings.navigation}),t.state.display={spacing:8}}function cg(t){const{rect:e,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:a}=t,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=sg(e,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:a});t.renderer.size(c.content);let u=r.getItemsToRender({viewRect:Ei({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),a.render({rect:c.title}),t.state.views={layout:c},u}const ug={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(t){t&&t.parentNode&&(this.navigationRenderer.renderer.appendTo(t.parentNode),this.titleRenderer.renderer.appendTo(t.parentNode),t.parentNode.insertBefore(this.navigationRenderer.renderer.element(),t),t.parentNode.insertBefore(this.titleRenderer.renderer.element(),t)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(t){if(!this.state.interaction.started)return;const e="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*t.deltaX:t.deltaY;this.itemRenderer.scroll(e-this.state.interaction.delta),this.state.interaction.delta=e},panend(){this.state.interaction.started=!1},scroll(t){this.itemRenderer.scroll(-t)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const t=cg(this);this.update(t)},this.itemRenderer=eg(this,{onScroll:this.onScroll}),this.navigationRenderer=og(this),this.titleRenderer=ag(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),lg(this)},preferredSize(t){return function(t,e){let n=0;const i=t.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=t.state.display,a=sg(e.inner,o,r,{itemRenderer:t.itemRenderer,navigationRenderer:t.navigationRenderer,titleRenderer:t.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,t)},beforeUpdate(){lg(this)},render(){return cg(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function hg(t,e){let n=0;const i=t.state.isVertical?"justify":"align",r=t.state.isVertical?"y":"x",o=t.state.isVertical?"height":"width",a=t.state.isVertical?"requiredHeight":"requiredWidth";n=t.state.rect[o]-t.state.legend.length()-t.state.title[a](),n*=Math.min(1,Math.max(t.stgns[i],0)),e[r]+=n}function dg(t,e,n){const i=n[t];return"object"==typeof i?-1!==i.valid.indexOf(e)?e:i.default:n.default}function fg(t){return dg(t.layout.dock,t.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function pg(t,e){const n={x:0,y:0,width:0,height:0},i=t.stgns.padding;return n.x=i.left,n.y=i.top,n.width=e.width-i.left-i.right,n.height=e.height-i.top-i.bottom,n}function gg(t){const e="top"!==t.settings.layout.dock&&"bottom"!==t.settings.layout.dock,n=t.stgns.title,i=t.chart.scale(t.stgns.fill),r=t.chart.scale(t.stgns.major),o=function(t,e){const n=e.domain();let i=n,r=t.stgns.tick.label;!r&&t.formatter?r=t.formatter:!r&&e.data().fields&&(r=e.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String));const o=n.map(((n,r)=>{const o=i[r];return{value:n,label:o,pos:e.norm(parseFloat(n,10)),textMetrics:t.renderer.measureText({text:o,fontSize:t.stgns.tick.fontSize,fontFamily:t.stgns.tick.fontFamily})}}));return o}(t,r),a=dg((s=t.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const t=r.data().fields;n.text=t&&t[0]?t[0].title():""}const l=t.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=t.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:e,nodes:[],title:{anchor:fg(t.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let t=c.width,i=n.maxLengthPx;return e||(t+=n.padding,i+=n.padding),Math.min(t,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let t=c.height;return e&&(t+=n.padding),Math.min(t,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((t=>t.textMetrics.width))),t.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map((t=>t.textMetrics.height)))+t.stgns.tick.padding:0,height:Math.max(...o.map((t=>t.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=e?"height":"width",i=e?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*t.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,t.stgns.maxLengthPx))}}};return u}const mg={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(t){const e=this.state;e.rect=pg(this,t.inner);let n=this.stgns.size;const i=e.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(t.inner.width,t.inner.height);if("left"===e.ticks.anchor||"right"===e.ticks.anchor){const t=e.ticks.values.reduce(((t,e)=>t+e.textMetrics.height),0);if(t>this.state.legend.length())return r;n+=e.ticks.length}else{if(e.ticks.length>this.state.legend.length())return r;n+=Math.max(...e.ticks.values.map((t=>t.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===e.title.anchor||"right"===e.title.anchor?Math.max(e.title.textBounds.height+i,n):Math.max(n,e.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=gg(this)},beforeUpdate(t){this.stgns=t.settings.settings,this.state=gg(this)},beforeRender(t){if(this.state.nodes=[],this.state.rect=pg(this,t.size),this.stgns.title.show){const t=function(t){const e=t.state,n=t.stgns,i="left"===e.ticks.anchor,r="top"===e.ticks.anchor;let o=e.rect.x,a=e.rect.y,s="start";"left"===e.title.anchor?(o+=e.title.requiredWidth()-n.title.padding,a+=e.title.textMetrics.height,a+=r?e.rect.height-e.title.textBounds.height:0,s="end"):"right"===e.title.anchor?(o+=e.legend.length(),o+=n.title.padding,a+=e.title.textMetrics.height,a+=r?e.rect.height-e.title.textBounds.height:0):"top"===e.title.anchor&&(o+=i?e.rect.width:0,a+=e.title.textMetrics.height,s=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,e.rect.y+e.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return hg(t,l),l}(this);this.state.nodes.push(t)}const e=function(t){const e=t.state.legend.fillScale,n=t.state.legend.majorScale,i=e.domain().map((t=>({type:"stop",color:e(t),offset:Math.min(1,Math.max(0,n.norm(t)))})));return i.sort(((t,e)=>t.offset-e.offset))}(this),n=function(t,e){const n=t.state,i=t.stgns,r=n.rect;let o=r.x,a=r.y,s=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(a+=n.rect.height-i.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:e,degree:n.isVertical?90:180}};return hg(t,c),c}(this,e),i=function(t,e){const n=t.state,i=t.stgns;let r="start";const o={type:"rect",x:e.x,y:e.y,width:n.isVertical?0:e.width,height:n.isVertical?e.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=e.y+e.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=e.x+e.width*a.pos,"right"===n.ticks.anchor?(s=e.x+i.size+i.tick.padding,o.x=e.x+e.width):"left"===n.ticks.anchor?(s=e.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=e.y-i.tick.padding,c-=.25*a.textMetrics.height,r=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=e.y+e.height+i.tick.padding,c=.8*a.textMetrics.height,r=0===a.pos?"start":"end",o.y=e.y+e.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:t.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const yg={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function xg(t,e){let{generatorType:n,item:i,data:r,major:o,minor:a,layerObj:s,stngs:l}=e,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:t,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function vg(t){const{metaLayers:e,coordinates:n,layers:i,lines:r,areas:o}=function(t){let{data:e,stngs:n,rect:i,resolver:r,style:o,domain:a}=t;const{width:s,height:l}=i,c=r.resolve({data:e,defaults:yg.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),h={};let d=0;for(let t=0;t<c.items.length;t++){let e=c.items[t],n=e.layerId;if(u){const t=h[n]?h[n].items[h[n].items.length-1]:null,i=t?a.indexOf(t.data.major?t.data.major.value:t.data.value):null;t&&a.indexOf(e.data.major?e.data.major.value:e.data.value)-1!==i&&h[n].items.push({dummy:!0})}h[n]=h[n]||{order:d++,id:n,items:[],dataItems:[],consumableData:{}},h[n].dataItems.push(e.data),h[n].items.push(e)}const f=Object.keys(h).map((t=>(h[t].consumableData=Pi({points:h[t].dataItems},h[t].dataItems[0]),h[t]))),p={items:f.map((t=>t.consumableData))},g=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:yg.layers.curve,show:yg.layers.show},settings:{curve:g.curve,show:g.show}}),lines:r.resolve({data:p,defaults:Ei({},yg.layers.line,o.line),settings:g.line}),areas:r.resolve({data:p,defaults:Ei({},yg.layers.area,o.area),settings:g.area})}}(t),a=[];return e.forEach(((e,s)=>{const l=i.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=e.id;const c=[],u=[];let h,d;for(let i=0;i<e.items.length;i++){if(h=e.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;t.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((t,e)=>t-e))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:r.items[s],areaObj:o.items[s],median:f,points:u,consumableData:e.consumableData})})),a}const bg={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(t){let{data:e}=t;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=vg({data:e,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:r,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const t=o.map((t=>({id:t.layerObj.id,data:t.layerObj.data}))).sort(this.stngs.layers.sort).map((t=>t.id));o.sort(((e,n)=>t.indexOf(e.layerObj.id)-t.indexOf(n.layerObj.id)))}else o.sort(((t,e)=>t.median-e.median));return function(t,e){let{width:n,height:i,missingMinor0:r,stngs:o}=e;const a=[],s=o.layers||{};return t.forEach((t=>{const{lineObj:e,layerObj:l,areaObj:c,points:u}=t;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const t=Ei(!0,{},d);d=Ei(!0,{},h),h=Ei(!0,{},t)}s.area&&!1!==c.show&&a.push(xg(u,{data:t.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),e&&!1!==e.show&&(a.push(xg(u,{data:t.consumableData,item:e,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&s.area&&!1!==c.show&&!1!==e.showMinor0&&a.push(xg(u,{data:t.consumableData,item:e,generatorType:"line".concat(h.p.toUpperCase(),"0"),major:d,minor:h,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:i,missingMinor0:r,stngs:this.stngs})}};function wg(t,e){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof e.center?(n=e.center.x,i=e.center.y):(n=e.clientX,i=e.clientY);const o=n-t.state.boundingRect.left,a=i-t.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,t.rect.width)):o,y:r?Math.max(0,Math.min(a,t.rect.height)):a}}function Mg(t,e){return{x:e.x+t.rect.x,y:e.y+t.rect.y}}function kg(t,e){const n=Math.min(t.x,e.x),i=Math.min(t.y,e.y);return{x:n,y:i,width:Math.max(t.x,e.x)-n,height:Math.max(t.y,e.y)-i}}const _g={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(t){this.start(t)},areaMove(t){this.move(t)},areaEnd(t){this.end(t)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(t){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const e=wg(this,t,!1);Qu({x:0,y:0,width:this.rect.width,height:this.rect.height},e)&&(this.state.brushConfig=this.settings.settings.brush.components.map((t=>({key:t.key,contexts:t.contexts,data:t.data,action:t.action||"set"}))),this.state.start=wg(this,t),this.state.active=!0)},move(t){var e;this.state.active&&(this.state.end=wg(this,t),function(t){if(t.state.active){const e=Mg(t,t.state.start),n=Mg(t,t.state.end),i=t.chart.shapesAt(kg(e,n),{components:t.state.brushConfig});t.chart.brushFromShapes(i,{components:t.state.brushConfig})}}(this),(e=this).renderer.render([Ei({type:"rect"},kg(e.state.start,e.state.end),e.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var t,e;this.state.active&&(t=this.state,e=this.chart,t.brushConfig.forEach((t=>{Array.isArray(t.contexts)&&t.contexts.forEach((t=>{e.brush(t).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Sg(t,e,n){let{renderer:i,style:r,props:o,h:a}=n;const s=function(t,e){return{tooltip:"function"==typeof t.tooltipClass?t.tooltipClass({dock:e.dock}):t.tooltipClass,content:"function"==typeof t.contentClass?t.contentClass({dock:e.dock}):t.contentClass,arrow:"function"==typeof t.arrowClass?t.arrowClass({dock:e.dock}):t.arrowClass}}(o,e),l=function(t,e,n,i){return i.content({h:t,style:n,data:e})}(a,t,r,o),c=a("div",{dir:o.direction,class:ng(Ei({"pic-tooltip":!0},s.tooltip)),style:Ei({position:"relative",display:"inline-block"},e.computedTooltipStyle)},a("div",{style:r.content,class:ng(Ei({"pic-tooltip-content":!0},s.content))},l),a("div",{class:ng(Ei({"pic-tooltip-arrow":!0},s.arrow)),style:Ei({},r.arrow,r["arrow-".concat(e.dock)],e.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Ng(t){let{defaultDuration:e,defaultDelay:n}=t,i=null,r=null,o=!1;const a=function(){const t=function(){},e={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return t.set=t=>{n=t,e[n].forEach((e=>e(t)))},t.on=(t,n)=>{Array.isArray(t)?t.forEach((t=>e[t].push(n))):e[t].push(n)},t.destroy=()=>{Object.keys(e).forEach((t=>{e[t].length=0}))},t}(),s=function(){},l=()=>{i=null,r=null,o=!1,a.set("fulfilled")};return s.invoke=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),a.set("debounced")),a.set("pending"),i=setTimeout((()=>{t(),o=!0,i=null,a.set("active")}),c),s>0&&(r&&clearTimeout(r),r=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):i&&(clearTimeout(i),a.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},s.on=(t,e)=>{a.on(t,e)},s.destroy=()=>{s.clear(),a.destroy()},s}function Rg(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-t,"px)"),right:"translate(".concat(t,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-t,"px)"),bottom:"translate(-50%, ".concat(t,"px)"),inside:"translate(-50%, -50%)"}}function Ag(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-t-n,y:-e/2},right:{x:n,y:-e/2},top:{x:-t/2,y:-e-n},bottom:{x:-t/2,y:n},inside:{x:-t/2,y:-e/2}}}function Cg(t,e){const n=t>0?"-":"+";return t=Math.abs(t),void 0===e&&(e=t),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(t,"px)"),borderWidth:"".concat(e,"px")},right:{left:"".concat(2*-t,"px"),top:"calc(50% ".concat(n," ").concat(t,"px)"),borderWidth:"".concat(e,"px")},top:{left:"calc(50% ".concat(n," ").concat(t,"px)"),top:"100%",borderWidth:"".concat(e,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(t,"px)"),top:"".concat(2*-t,"px"),borderWidth:"".concat(e,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function Dg(t,e,n,i,r,o){const a=e+o.x,s=n+o.y,l=r;return!(a<0||s<0)&&!(a+i>t.width||s+l>t.height)}function Og(t){let{area:e,vx:n,vy:i,width:r,height:o,offset:a}=t;const s=n+a.x,l=i+a.y,c=r,u=o;let h=s<0?-s:0,d=l<0?-l:0;return h+=s+c>e.width?-(s+c-e.width):0,d+=l+u>e.height?-(l+u-e.height):0,{x:h,y:d}}function Eg(t){let{options:e,pointer:n,width:i,height:r,dockOrder:o,x:a,y:s}=t;const{targetBounds:l}=n,c=Rg(e.offset),u=c[e.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:Cg(e.offset)[e.dock],dock:e.dock};const h={width:"target"===e.area?l.width:window.innerWidth,height:"target"===e.area?l.height:window.innerHeight},d=Ag(i,r,e.offset),f=[],p="target"===e.area?a:l.left+a,g="target"===e.area?s:l.top+s;for(let t=0;t<o.length;t+=1){const n=o[t],l=Og({area:h,vx:p,vy:g,width:i,height:r,offset:d[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},m=Cg(e.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),m.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:m,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((t,e)=>Math.abs(t.offset.x)-Math.abs(e.offset.x))),f[0]}function zg(t,e,n){const i=t.key?n.component(t.key):n.componentsFromPoint({x:e.clientX,y:e.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return Ei({scaleRatio:r.scaleRatio},r.computedInner)}const Ig={bounds:function(t){let{resources:e,nodes:n,pointer:i,width:r,height:o,options:a}=t;const{targetBounds:s}=i,{x:l,y:c,width:u,height:h}=e.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h},inside:{x:l+u/2,y:c+h/2}},f=Rg(a.offset),p=f[a.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[a.dock].x,"px"),top:"".concat(d[a.dock].y,"px"),transform:p},computedArrowStyle:Cg(a.offset)[a.dock],dock:a.dock};const g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},m=Ag(r,o,a.offset),y=["top","left","right","bottom","inside"];for(let t=0;t<y.length;t+=1){const e=y[t];if(Dg(g,"target"===a.area?d[e].x:s.left+d[e].x,"target"===a.area?d[e].y:s.top+d[e].y,r,o,m[e]))return{computedTooltipStyle:{left:"".concat(d[e].x,"px"),top:"".concat(d[e].y,"px"),transform:f[e]},computedArrowStyle:Cg(a.offset)[e],dock:e}}const x=function(t){let{options:e,docks:n,dockOffsets:i,targetBounds:r,area:o,width:a,height:s}=t;const l="top",c="target"===e.area?n[l].x:r.left+n[l].x,u=("target"===e.area?n[l].y:(r.top,n[l].y),i[l]),h=c+u.x,d=(u.y,a);let f=n.top.x;return h<0&&h+d>o.width||(h<0?f-=h:h+d>o.width&&(f-=h+d-o.width)),f}({options:a,docks:d,dockOffsets:m,targetBounds:s,area:g,width:r,height:o});return{computedTooltipStyle:{left:"".concat(x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Cg(a.offset+x-d.top.x,a.offset).top,dock:"top"}},pointer:function(t){let{options:e,pointer:n,width:i,height:r}=t;const{x:o,y:a}=n;return Eg({x:o,y:a,pointer:n,width:i,height:r,options:e,dockOrder:["top","left","right","bottom"]})},slice:function(t){let{options:e,pointer:n,width:i,height:r,nodes:o,resources:a}=t;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:g}=s.desc.slice,m=(f+p)/2-Math.PI/2,y=2*Math.PI,x=(m%y+y)%y;let v=["top","left","right","bottom"];return"auto"===e.dock&&(v=x<=Math.PI/4||x>=7*Math.PI/4?["right","top","bottom","left"]:x<=3*Math.PI/4?["bottom","left","right","top"]:x<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),Eg({x:h+g*u.scaleRatio.x*Math.cos(x),y:d+g*u.scaleRatio.y*Math.sin(x),pointer:n,width:i,height:r,options:e,dockOrder:v})}};function Tg(t,e){let{width:n,height:i}=t,{chart:r,state:o,props:a}=e;const s={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:t=>zg(t,o.pointer,r),getNodeBoundsRelativeToTarget:t=>function(t,e,n){const i=zg(t,e,n),r=t.bounds;return{x:i.x+e.dx+r.x,y:i.y+e.dy+r.y,width:r.width,height:r.height}}(t,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=Ei(c,a.placement(s))),"object"===l&&Ig[a.placement.type]?c=Ei(c,a.placement):"string"===l&&Ig[a.placement]&&(c=Ei(c,{type:a.placement})),s.options=c;const u=Ig[c.type](s);let{x:h,y:d,width:f,height:p}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return h+=s.pointer.dx,f+=h,d+=s.pointer.dy,p+=d,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let Pg;function qg(){Pg=null}const Lg={duration:8e3,delay:500,filter:t=>t.filter((t=>t.data&&void 0!==t.data.value)),extract:t=>t.node.data.value,content:t=>{let{h:e,data:n}=t;return n.map((t=>e("div",{},t)))},isEqual:(t,e)=>t.length&&t.length===e.length&&t.every(((t,n)=>e[n]&&JSON.stringify(t.data)===JSON.stringify(e[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const jg={require:["chart","renderer"],defaultSettings:{settings:Lg,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(t,e)},prevent(t){this.prevent(t)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(t){let e,{nodes:n,duration:i,delay:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(t,e){let{chart:n,state:i}=e,r=0,o=0;t.center?(r+=t.center.x,o+=t.center.y):(r+=t.clientX,o+=t.clientY);const a=n.element.getBoundingClientRect(),s=i.targetElement.getBoundingClientRect(),l=r,c=o,u=a.left-s.left,h=a.top-s.top,d=r-a.left,f=o-a.top;return r-=s.left,o-=s.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(t,this),e=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,e)||(this.dispatcher.clear(),this.state.activeNodes=e,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(t){this.state.prevent=!!t},init(t){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=t.settings,this.dispatcher=Ng({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const e=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(t){Pg&&Pg!==t&&Pg()}(e),Pg=e,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const t={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,Ei({element:this.state.tooltipElm},t)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,Ei({element:this.state.tooltipElm},t)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,t),Pg===e&&(Pg=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(t){let{settings:e}=t;this.dispatcher&&(this.dispatcher.destroy(),qg()),this.init(e)},render(t){return this.h=t,[]},beforeDestroy(){this.dispatcher.destroy(),qg()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:t,height:e}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:t,height:e}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(t){const e=function(t,e){let{chart:n,scale:i,props:r,h:o}=e;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},s=[];return t.forEach((t=>{if("function"==typeof r.extract){const e=Ei({node:t},a);s.push(r.extract(e))}})),s}(t,this),n=Tg(Sg(e,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Sg(e,n,this)}};const Fg={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const t=this.chart.findShapes(this.props.selector).filter((t=>t.key===this.props.target)),e=t.filter((t=>t.collider)).map((t=>t.collider));e.forEach((t=>{t.fill=this.props.fill,t.stroke=this.props.stroke,t.opacity=this.props.opacity,t.collider={type:null}})),this.renderer.render(e)},created(){this.props=this.settings.settings},resize(t){let{outer:e,inner:n}=t;return this.props.useOuterRect?e:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Bg={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Vg=/([astvzqmhlc])([^astvzqmhlc]*)/gi,$g=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Hg(t){const e=[],n=String(t).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Vg,((t,n,i)=>{const r=function(t){const e=t.match($g);return e?e.map(Number):[]}(i);let o=n.toLowerCase(),a=n;if("m"===o&&r.length>2&&(e.push([a,...r.splice(0,2)]),o="l",a="m"===a?"l":"L"),r.length<Bg[o])return"";for(e.push([a,...r.splice(0,Bg[o])]);r.length>=Bg[o]&&r.length&&Bg[o];)e.push([a,...r.splice(0,Bg[o])]);return""})),e}const Wg=2*Math.PI;function Ug(t,e){return{x:.5*(t.x+e.x),y:.5*(t.y+e.y)}}function Yg(t,e,n,i,r){const o=1-t;return o**3*e+3*o**2*t*n+3*o*t**2*i+t**3*r}function Xg(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]:8;if(o<1||function(t,e,n,i){return Math.abs(t.x+n.x-(e.x+e.x))+Math.abs(t.y+n.y-(e.y+e.y))+Math.abs(e.x+i.x-(n.x+n.x))+Math.abs(e.y+i.y-(n.y+n.y))}(t,e,n,i)<=10)return r[r.length-1]!==t&&r.push(t),r.push(i),r;const a=Ug(t,e),s=Ug(e,n),l=Ug(n,i),c={x:Yg(.5,t.x,e.x,n.x,i.x),y:Yg(.5,t.y,e.y,n.y,i.y)},u=Ug(a,s),h=Ug(s,l);return Xg(t,a,u,c,r,o-1),Xg(c,h,l,i,r,o-1),r}function Gg(t,e,n){const{cp1:i,cp2:r}=function(t,e,n){return{cp1:{x:t.x+2/3*(e.x-t.x),y:t.y+2/3*(e.y-t.y)},cp2:{x:n.x+2/3*(e.x-n.x),y:n.y+2/3*(e.y-n.y)}}}(t,e,n);return Xg(t,i,r,n)}function Kg(t,e,n){const i=[],r=!!t[4],o=!!t[5],a=t[3];let s,l,c,u,h=t[6],d=t[7],f=t[1],p=t[2];if("a"===t[0]&&(h+=e,d+=n),e===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;({cx:s,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(t,e,n,i,r,o,a,s,l){let c,u,h,d,f,p;const g=pu(n%360),m=Math.cos(g),y=Math.sin(g),x=(s-o)/2,v=(l-a)/2,b=m*x+y*v,w=m*v-y*x;p=b**2/(t=Math.abs(t))**2+w**2/(e=Math.abs(e))**2,p>1&&(p=Math.sqrt(p),t*=p,e*=p);const M=t*w,k=e*b,_=M**2+k**2,S=(t*e)**2-_;let N=Math.sqrt(Math.max(S/_,0));i===r&&(N=-N);const R=N*(M/e),A=N*(-k/t);d=m*R-y*A+(s+o)/2,f=y*R+m*A+(l+a)/2;const C=(b-R)/t,D=(w-A)/e,O=(-b-R)/t,E=(-w-A)/e;return c=Math.atan2(D,C),c+=c<0?Wg:0,u=Math.atan2(E,O),u+=u<0?Wg:0,h=u-c,!r&&c<u?h-=Wg:r&&u<c&&(h+=Wg),h%=Wg,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:t,ry:e}}(f,p,a,r,o,h,d,e,n));const g=Math.abs(c*Math.sqrt((f**2+p**2)/2)),m=Math.ceil(g/10),y=c/m;for(let t=1;t<=m;t++){const e=(u+y*t)%Wg,n=Math.cos(e),r=Math.sin(e);i.push({x:s+n*f+-r*n,y:l+r*p+n*r})}return i}function Zg(t){const e=Hg(t),n=[],i=[];let r=0,o=0,a=null,s=null,l=null,c=null;for(let t=0;t<e.length;++t){const u=e[t],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(a=null,s=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...Kg(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...Kg(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...Xg({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),a=u[3]+r,s=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...Xg({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],r=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=r,s=o),i.push(...Xg({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),a=u[1]+r,s=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=r,s=o),i.push(...Xg({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],r=u[3],o=u[4];break;case"Q":i.push(...Gg({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...Gg({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Gg({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...Gg({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(t.splice(e,1),e--)}}(i),n.push(i.splice(0)),n}const Jg={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const t=this.chart.findShapes("path").filter((t=>t.key===this.props.target)),e=[];t.forEach((t=>{Zg(t.attrs.d).forEach((t=>{t.forEach((t=>{e.push({type:"circle",cx:t.x,cy:t.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(e)},created(){this.props=this.settings.settings},resize(t){let{outer:e,inner:n}=t;return this.props.useOuterRect?e:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Qg=[function(t){t.component("box",Qh),t.component("box-marker",Qh)},function(t){t.component("point",ad),t.component("point-marker",ad)},function(t){t.component("pie",ud)},function(t){t.component("grid-line",gd)},function(t){t.component("ref-line",Nd)},function(t){t.component("axis",ef)},function(t){t.component("container",nf)},function(t){t.component("text",af)},function(t){t.component("scrollbar",cf)},function(t){t.component("brush-range",_f),t.component("brush-area-dir",Af)},function(t){t.component("range",Ef)},function(t){t.component("brush-lasso",Lf)},function(t){t.component("labels",Zp)},function(t){t.component("legend-cat",ug)},function(t){t.component("legend-seq",mg)},function(t){t.component("line",bg)},function(t){t.component("brush-area",_g)},function(t){t.component("tooltip",jg)},function(t){t.component("debug-collider",Fg)},function(t){t.component("debug-path-to-points",Jg)}];class tm{constructor(t){this._parent=null,this._children=[],this._ancestors=null,this.type=t,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let t=[];const e=this.children.length;let n,i;for(n=0;n<e;n++)i=this.children[n],t.push(i),i.children.length&&(t=[...t,...i.descendants]);return t}equals(t){const e=this.children,n=t.children;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!e[t].equals(n[t]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((t=>t.toJSON()))}}}class em{constructor(){let{x:t=0,y:e=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:t,y:e,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:t=0,y:e=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=t,this.width=Math.max(n,r)):(this.x=t+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=e,this.height=Math.max(i,o)):(this.y=e+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(t){return Qu(this,t)}intersectsLine(t){return th(this,Hi(t))}intersectsRect(t){return Zu(this,$i(t))}intersectsCircle(t){return Wu(t,this)}intersectsPolygon(t){return Ku(t,this)}intersectsGeoPolygon(t){return lh(t,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class nm{constructor(){let{cx:t=0,cy:e=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:t,cy:e,r:n,minRadius:i})}set(){let{cx:t=0,cy:e=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=t,this.cy=e,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(t){return Hu(this,t)}intersectsLine(t){return Uu(this,Hi(t))}intersectsRect(t){return Wu(this,$i(t))}intersectsCircle(t){return n=t,!Fu(e=this)&&!Fu(n)&&(e.cx-n.cx)**2+(e.cy-n.cy)**2<=(e.r+n.r)**2;var e,n}intersectsPolygon(t){return Yu(this,t)}intersectsGeoPolygon(t){return oh(this,t)}points(){return[{x:this.cx,y:this.cy}]}}class im{constructor(){let{x1:t=0,y1:e=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:t,y1:e,x2:n,y2:i,tolerance:r})}set(){let{x1:t=0,y1:e=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=t,this.y1=e,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=t===n&&e===i}containsPoint(t){if(this.tolerance>0){return Uu({cx:t.x,cy:t.y,r:this.tolerance},this)}return nh(this,t)}intersectsLine(t){return eh(this,Hi(t))}intersectsRect(t){return th($i(t),this)}intersectsCircle(t){return Uu(t,this)}intersectsPolygon(t){return Gu(t,this)}intersectsGeoPolygon(t){return sh(t,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class rm{constructor(){let{vertices:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:t})}set(){let{vertices:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];n.x===i.x&&n.y===i.y&&(t.splice(e,1),e--)}}(this.vertices),!(this.vertices.length<=2)){!function(t){const e=t[0],n=t[t.length-1];e.x===n.x&&e.y===n.y||t.push(e)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let t=0;t<this.vertices.length;t++)t<this.vertices.length-1&&this.edges.push([this.vertices[t],this.vertices[t+1]]),this.xMin=isNaN(this.xMin)?this.vertices[t].x:Math.min(this.xMin,this.vertices[t].x),this.xMax=isNaN(this.xMax)?this.vertices[t].x:Math.max(this.xMax,this.vertices[t].x),this.yMin=isNaN(this.yMin)?this.vertices[t].y:Math.min(this.yMin,this.vertices[t].y),this.yMax=isNaN(this.yMax)?this.vertices[t].y:Math.max(this.yMax,this.vertices[t].y);this._bounds=null,this._boundingRect=null}}containsPoint(t){return Xu(this,t)}intersectsCircle(t){return Yu(t,this)}intersectsLine(t){return Gu(this,Hi(t))}intersectsRect(t){return Ku(this,$i(t))}intersectsPolygon(t){return ih(this,t)}intersectsGeoPolygon(t){return rh(t,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function om(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new rm(...e)}function am(t){const e=t[0],n=t[t.length-1];e.x===n.x&&e.y===n.y||t.push(e)}function sm(t){for(let e=0;e<t.length-1;e++){const n=t[e],i=t[e+1];n.x===i.x&&n.y===i.y&&(t.splice(e,1),e--)}}class lm{constructor(){let{vertices:t=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:t})}set(){let{vertices:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=t.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let t=0;t<this.numPolygons;t++)sm(this.vertices[t]),this.vertices[t].length>2&&am(this.vertices[t]),this.polygons[t]=om({vertices:this.vertices[t]}),this.xMin=isNaN(this.xMin)?this.polygons[t].xMin:Math.min(this.xMin,this.polygons[t].xMin),this.xMax=isNaN(this.xMax)?this.polygons[t].xMax:Math.max(this.xMax,this.polygons[t].xMax),this.yMin=isNaN(this.yMin)?this.polygons[t].yMin:Math.min(this.yMin,this.polygons[t].yMin),this.yMax=isNaN(this.yMax)?this.polygons[t].yMax:Math.max(this.yMax,this.polygons[t].yMax);this._bounds=null,this._boundingRect=null}containsPoint(t){return ah(this,t)}intersectsCircle(t){return oh(t,this)}intersectsLine(t){return sh(this,Hi(t))}intersectsRect(t){return lh(this,$i(t))}intersectsPolygon(t){return rh(this,t)}intersectsGeoPolygon(t){return function(t,e){const n=t.boundingRect(),i=e.boundingRect();return!!Zu(n,i)&&(Ju(i,n)?$u(e,t):$u(t,e))}(this,t)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function cm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new lm(...e)}class um{constructor(){let{points:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:t})}set(){let{points:t=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let t=0,i=this._points.length-1;t<i;t++)e=this._points[t],n=this._points[t+1],(e.x!==n.x||e.y!==n.y)&&this.segments.push({x1:this._points[t].x,y1:this._points[t].y,x2:this._points[t+1].x,y2:this._points[t+1].y});var e,n}containsPoint(t){return this.segments.some((e=>nh(e,t)))}intersectsCircle(t){return this.segments.some((e=>Uu(t,e)))}intersectsLine(t){const e=Hi(t);return this.segments.some((t=>eh(t,e)))}intersectsRect(t){const e=$i(t);return this.segments.some((t=>th(e,t)))}intersectsPolygon(t){return this.segments.some((e=>Gu(t,e)))}intersectsGeoPolygon(t){return this.segments.some((e=>sh(t,e)))}points(){return this._points}}const hm=Gr();function dm(t,e){return hm.get(t)(e)}hm.add("rect",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new em(...e)})),hm.add("circle",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new nm(...e)})),hm.add("line",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new im(...e)})),hm.add("polygon",om),hm.add("geopolygon",cm),hm.add("polyline",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new um(...e)}));class fm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(t)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],t.forEach((t=>{const e=dm(t.type,t);e&&this.geometries.push(e)}))}containsPoint(t){return this.geometries.some((e=>e.containsPoint(t)))}intersectsLine(t){return this.geometries.some((e=>e.intersectsLine(t)))}intersectsRect(t){return this.geometries.some((e=>e.intersectsRect(t)))}intersectsCircle(t){return this.geometries.some((e=>e.intersectsCircle(t)))}intersectsPolygon(t){return this.geometries.some((e=>e.intersectsPolygon(t)))}intersectsGeoPolygon(t){return this.geometries.some((e=>e.intersectsGeoPolygon(t)))}}class pm{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new pm).multiply(this)}set(t){return this._elements=t,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(t){let e,n;for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)this._elements[e][n]+=t;return this}translate(t,e){return this.multiply([[1,0,t],[0,1,e],[0,0,1]]),this}rotate(t){let e=Math.cos(-t),n=Math.sin(-t);return this.multiply([[e,n,0],[-n,e,0],[0,0,1]]),this}multiply(t){let e,n,i,r;if(t instanceof pm&&(t=t._elements),Array.isArray(t)){for(i=[[0,0,0],[0,0,0],[0,0,0]],e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)for(r=0;r<3;r++)i[e][n]+=this._elements[e][r]*t[r][n];this._elements=i}else for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)this._elements[e][n]*=t;return this}scale(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return this.multiply([[t,0,0],[0,e,0],[0,0,1]]),this}transform(t,e,n,i,r,o){return this.multiply([[t,n,r],[e,i,o],[0,0,1]]),this}determinant(){let t=this._elements[0][0],e=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=t*r*l+e*o*a+n*i*s-n*r*a-e*i*l-t*o*s,c}invert(){let t=this.determinant(),e=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,i*l-n*c,n*a-i*o],[a*s-r*c,e*c-i*s,i*r-e*a],[r*l-o*s,s*n-e*l,e*o-n*r]],this.multiply(1/t),this}transpose(){const t=Object.create(this._elements);return this._elements=[[t[0][0],t[1][0],t[2][0]],[t[0][1],t[1][1],t[2][1]],[t[0][2],t[1][2],t[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((t=>t.join("\t"))).join("\n"))}isIdentity(){const t=this._elements;return 1===t[0][0]&&0===t[0][1]&&0===t[0][2]&&0===t[1][0]&&1===t[1][1]&&0===t[1][2]&&0===t[2][0]&&0===t[2][1]&&1===t[2][2]}transformPoint(t){let e,n,i=[t.x,t.y,1],r=this._elements,o=[0,0,0];for(e=0;e<this._elements.length;e++)for(n=0;n<this._elements[e].length;n++)o[e]+=i[n]*r[e][n];return{x:o[0],y:o[1]}}transformPoints(t){let e,n,i,r,o,a=this._elements,s=[];for(r=0;r<t.length;r++){for(e=[t[r].x,t[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=e[i]*a[n][i];s.push({x:o[0],y:o[1]})}return s}get elements(){const t=this._elements;return[[t[0][0],t[0][1],t[0][2]],[t[1][0],t[1][1],t[1][2]],[t[2][0],t[2][1],t[2][2]]]}}const gm=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function mm(t,e){const n=e.args[0]*(Math.PI/180);if(e.args.length>2){const i=e.args[1],r=e.args[2];t.translate(i,r),t.rotate(n),t.translate(-i,-r)}else 1===e.args.length&&t.rotate(n)}function ym(t,e){const n=e.args[0],i=isNaN(e.args[1])?e.args[0]:e.args[1];t.scale(n,i)}function xm(t,e){const n=e.args[0],i=isNaN(e.args[1])?0:e.args[1];t.translate(n,i)}function vm(t,e){e.args.length>=6&&t.transform(...e.args)}function bm(t,e){const n=function(t){let e,n=[];for(;null!==(e=gm.exec(t));){const t=e[2].trim(),i=-1===t.indexOf(",")?t.split(" "):t.split(",");n.push({cmd:e[1],args:i.filter((t=>t.trim().length>0)).map((t=>Number(t)))})}return n}(t);let i;for(let t=0,r=n.length;t<r;t++)i=n[t],"rotate"===i.cmd?mm(e,i):"scale"===i.cmd?ym(e,i):"matrix"===i.cmd?vm(e,i):"translate"===i.cmd&&xm(e,i)}const wm={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Mm={type:(t,e)=>e.filter((e=>{const n=e.type;return!!n&&n.toLowerCase()===t.toLowerCase()})),attr:(t,e,n,i)=>i.filter((i=>{const r=i.attrs[t];if(!e)return void 0!==r;if(void 0===r)return!1;switch(e){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:t=>t,tag:(t,e)=>e.filter((e=>{const n=e.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(t.replace(".",""))}))};function km(t,e){if(!e||!e.length||!t||"function"!=typeof Mm[t.type])return[];switch(t.type){case"type":case"tag":return Mm[t.type](t.value,e);case"attr":return Mm[t.type](t.attribute,t.operator,t.attributeValue,e);case"universal":return Mm[t.type](e);default:return[]}}var _m={find:function(t,e){const n=[],i=[];let r,o;if(e.isBranch){let a;r=function(t){const e=[];let n,i,r,o;return t.split(/\s*,\s*/).forEach((t=>{t=t.trim(),n=[];const a=e=>{r=t.match(wm[e]),r&&(o=!0,t=t.slice(r[0].length),i={type:e,value:r[0]},"attr"===e&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;t&&(o=!1,r=t.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),t=t.slice(r[0].length)),Object.keys(wm).forEach(a),n&&n.length&&e.indexOf(n)<0&&e.push(n),o););})),e}(t),o=e.descendants;for(let t=0,e=r.length;t<e;t++){a=r[t];const e=[];let n=o.slice(),s=!1;a.reverse().forEach((t=>{if(" "===t.type)return e.push(n),n=o.slice(),void(s=!1);n=km(t,n),s=!0})),s&&e.push(n);const l=e[0].filter((t=>{let n,i=t.parent;for(let t=1;t<e.length;t++){for(n=e[t].indexOf(i);i&&n<0;)i=i.parent,n=e[t].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let t=0,e=i.length;t<e;t++)for(let e=0,r=i[t].length;e<r;e++)n.indexOf(i[t][e])<0&&n.push(i[t][e])}return n||[]}};function Sm(t,e,n){const i=t.type;let r=t.points();n&&(r=r.every((t=>Array.isArray(t)))?r.map((t=>n.transformPoints(t))):n.transformPoints(r)),function(t,e){for(let n=0,i=t.length;n<i;n++)t[n].x/=e,t[n].y/=e}(r,e);let o=null;if("rect"===i||"bounds"===i)o=$i(r),o.type=i;else if("circle"===i)o=function(t,e){return{cx:t[0].x,cy:t[0].y,r:e}}(r,t.r),o.type=i;else if("line"===i)o=Hi(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:du(r,"polygon"===i)}}else if("geopolygon"===i){let t="";for(let e=0;e<r.length;e++)t+=du(r[e],!0);o={type:"path",d:t}}return o}class Nm{constructor(t){this._bounds=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=t.boundingRect?t.boundingRect(e):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=t.attrs,this._type=t.type,this._data=t.data,this._dpi=t.stage?t.stage.dpi:1,this._collider=()=>function(t,e){if(t.collider){const n=t.modelViewMatrix;return"collection"===t.colliderType?{type:"container",children:t.collider.geometries.map((t=>Sm(t,e,n)))}:Sm(t.collider,e,n)}return null}(t,this._dpi),this._desc=t.desc,this._tag=t.tag,this._children=()=>t.children.map((t=>new Nm(t))),this._parent=()=>t.parent?new Nm(t.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(t){this._cache.elementBoundingRect=null,this._element=t}get element(){return this._element}set key(t){this._key=t}get key(){return this._key}get bounds(){const t=this._bounds();return t.x/=this._dpi,t.y/=this._dpi,t.width/=this._dpi,t.height/=this._dpi,t}get localBounds(){return this._bounds(!1)}boundsRelativeTo(t){const e=typeof t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===e&&null!==t&&"function"==typeof t.getBoundingClientRect){const{left:e=0,top:n=0}=t.getBoundingClientRect();r-=e,o-=n}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function Rm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Nm(...e)}class Am{constructor(t){this._node=Rm(t),this._parent=null,this._input=null}get node(){return this._node}set parent(t){this._parent=t}get parent(){return this._parent}set input(t){this._input=t}get input(){return this._input}}function Cm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Am(...e)}function Dm(t,e){const n=t.parent;if(n&&"stage"!==n.type){e.parent=Cm(n);const t=n.parent;t&&"stage"!==t.type&&Dm(t,e.parent)}}function Om(t,e,n){if(null===t.colliderType)return null;const i=function(t,e){let n={};if(t.modelViewMatrix)if(Array.isArray(e))n=t.inverseModelViewMatrix.transformPoints(e);else if(isNaN(e.r))Array.isArray(e.vertices)?n.vertices=t.inverseModelViewMatrix.transformPoints(e.vertices):n=t.inverseModelViewMatrix.transformPoint(e);else{const i={x:e.cx,y:e.cy};({x:n.cx,y:n.cy}=t.inverseModelViewMatrix.transformPoint(i)),n.r=e.r}else n=e;return Array.isArray(n.vertices)&&(n=n.vertices.every((t=>Array.isArray(t)))?cm(n):om(n)),n}(t,n);return"frontChild"===t.colliderType?function(t,e,n){for(let i=t.descendants.length-1;i>=0;i--){const r=t.descendants[i];if(null!==r.collider&&r.collider[e](n)){const t=Cm(r);return Dm(r,t),t}}return null}(t,e,i):function(t,e,n){if(t.collider[e](n)){const e=Cm(t);return Dm(t,e),e}return null}(t,e,i)}function Em(t,e,n,i){const r=t.length;for(let o=0;o<r;o++){const r=t[o],a=Om(r,e,i);a&&n.push(a),!r.children||a||r.collider||Em(r.children,e,n,i)}}function zm(t,e,n){const i=t.length;for(let r=0;r<i;r++){const i=t[r];if(null!==Om(i,e,n))return!0;if(i.children&&!i.collider)return zm(i.children,e,n)}return!1}function Im(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(Wi(t)){case"circle":return n.cx=t.cx*e,n.cy=t.cy*e,n.r=t.r,["intersectsCircle",n];case"rect":return n=Vi(t).map((t=>xu(t,e))),["intersectsRect",n];case"line":return n=Bi(t).map((t=>xu(t,e))),["intersectsLine",n];case"point":return n=xu(t,e),["containsPoint",n];case"polygon":return n.vertices=t.vertices.map((t=>xu(t,e))),["intersectsPolygon",n];case"geopolygon":return n.vertices=t.vertices.map((t=>t.map((t=>xu(t,e))))),["intersectsGeoPolygon",n];default:return[]}}function Tm(t,e){const[n,i]=Im(e,t.dpi),r=[];return n&&(Em([t],n,r,i),function(t,e){for(let n=0,i=e.length;n<i;n++)e[n].input=t}(e,r)),r}function Pm(t,e){const[n,i]=Im(e,t.dpi);return zm([t],n,i)}class qm extends tm{constructor(t){super(t),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=t;const{data:e,desc:n,tag:i,strokeReference:r,fillReference:o}=t;var a,s;a=this.attrs,s=t,Object.keys(hu).forEach((t=>{const e=s[t];void 0!==e&&(a[hu[t]]=e)})),void 0!==e&&(this.data=e),"object"==typeof n&&(this.desc=Ei(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(t){return _m.find(t,this).map((t=>Rm(t)))}getItemsFrom(t){return Tm(this,t)}containsPoint(t){return Pm(this,t)}intersectsLine(t){return Pm(this,t)}intersectsRect(t){return Pm(this,t)}intersectsCircle(t){return Pm(this,t)}intersectsPolygon(t){return Pm(this,t)}intersectsGeoPolygon(t){return Pm(this,t)}resolveLocalTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new pm;void 0!==this.attrs.transform&&bm(this.attrs.transform,t),this.modelViewMatrix=t.clone()}resolveGlobalTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new pm;const e=this.ancestors;if(e.length>0)for(let n=e.length-1;n>=0;n--)e[n].resolveLocalTransform(t),t=e[n].modelViewMatrix;this.resolveLocalTransform(t)}attr(t){return this.attrs[t]}equals(t){const e=this.attrs,n=Object.keys(e),i=t.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let t=0;t<n.length;t++){const r=n[t];if(!Object.hasOwnProperty.call(i,r))return!1;if(e[r]!==i[r])return!1}return super.equals(t)}toJSON(){const t=super.toJSON();return t.attrs=this.attrs,t}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(t){this._mvm=t,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(t){this._node=t}get node(){return this._node}set collider(t){const e=Array.isArray(t)?"collection":t&&t.type;return"string"!=typeof e?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===e&&null!==this._collider.fn?(this._collider.fn.set(t),void(this._collider.definition=t)):(this._collider.type=e,void(this._collider.definition=t))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new fm(...e)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=dm("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=dm(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class Lm extends tm{addChild(t){if(!(t&&t instanceof tm))throw new TypeError("Expecting a Node as argument, but got ".concat(t));if(t===this)throw new Error("Can not add itself as child!");if(t._children&&t._children.length&&this.ancestors.indexOf(t)>=0)throw new Error("Can not add an ancestor as child!");return t._parent&&t._parent!==this&&t._parent.removeChild(t),this._children.push(t),t._parent=this,t._ancestors=null,this}addChildren(t){let e,n=t?t.length:0;for(e=0;e<n;e++)this.addChild(t[e]);return this}removeChild(t){const e=this._children.indexOf(t);return e>=0&&(this._children.splice(e,1),t._parent=null,t._ancestors=null),this}removeChildren(t){let e,n;if(!this._children)return this;if(t)for(n=t.length,e=0;e<n;e++)this.removeChild(t[e]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const jm=Lm.prototype;class Fm extends qm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:e="container"}=t;super(e),this.set(t)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const{collider:e}=t,n=Ei({type:null},e);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(t,e){if(void 0!==t.bounds){const n=this.__boundingRect[e]||{},[i,,r]=t.bounds(e),{x:o,y:a}=i,{x:s,y:l}=r,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[e]=n}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=this.children.length;for(let n=0;n<e;n++)this.appendChildRect(this.children[n],t);return this.__boundingRect[t]=Ei({x:0,y:0,width:0,height:0},this.__boundingRect[t]),this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}addChild(t){const e=jm.addChild.call(this,t);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(t,!0);const e=Ei({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=e}return e}addChildren(t){const e=jm.addChildren.call(this,t),n=t.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let e=0;e<n;e++)this.appendChildRect(t[e],!0);const e=Ei({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=e}return e}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;if(jm.removeChild.call(this,t),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const t=Ei(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}removeChildren(t){if(jm.removeChildren.call(this,t),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const t=Ei(this.boundingRect(!0),{type:"bounds"});this.collider=t}return this}}function Bm(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Fm(...e)}class Vm extends Fm{constructor(t){super("stage"),this._stage=this,this._dpiRatio=t||1}get dpi(){return this._dpiRatio}}const $m=Lm.prototype,Hm=["x1","x2","y1","y2","id","offset","style"];class Wm extends qm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:e="container"}=t;super(e),this.set(t),this._boundingRect={}}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const e=this.attrs;let n="";for(let i=0,r=Hm.length;i!==r;i++)n=Hm[i],void 0!==t[n]&&(e[n]=t[n])}addChild(t){return $m.addChild.call(this,t)}addChildren(t){return $m.addChildren.call(this,t)}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;return $m.removeChild.call(this,t),this}removeChildren(t){return $m.removeChildren.call(this,t),this}}function Um(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Wm(...e)}const Ym=Lm.prototype,Xm=["patternUnits","x","y","width","height","id"];class Gm extends qm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:e="container"}=t;super(e),this.set(t),this._boundingRect={}}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(t);const e=this.attrs;let n="";for(let i=0,r=Xm.length;i!==r;i++)n=Xm[i],void 0!==t[n]&&(e[n]=t[n])}addChild(t){return Ym.addChild.call(this,t)}addChildren(t){return Ym.addChildren.call(this,t)}removeChild(t){t._stage=null;let e,n=t.descendants,i=n?n.length:0;for(e=0;e<i;e++)n[e]._stage=null;return Ym.removeChild.call(this,t),this}removeChildren(t){return Ym.removeChildren.call(this,t),this}}class Km extends qm{constructor(){super("rect"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:e=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:a=0,collider:s}=t,l=Ei({type:"rect",x:e,y:n,width:i,height:r},s);super.set(t),i>=0?(this.attrs.x=e,this.attrs.width=i):(this.attrs.x=e+i,this.attrs.width=-i),r>=0?(this.attrs.y=n,this.attrs.height=r):(this.attrs.y=n+r,this.attrs.height=-r),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=Vi(this.attrs),n=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(e):e,[i,r,o,a]=Fi(n);return this.__boundingRect[t]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}class Zm extends qm{constructor(){super("circle"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:e=0,cy:n=0,r:i=0,collider:r}=t,o=Ei({type:"circle",cx:e,cy:n,r:i},r);super.set(t),this.attrs.cx=e,this.attrs.cy=n,this.attrs.r=i,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];const e=this.bounds(t);return this.__boundingRect[t]={x:e[0].x,y:e[0].y,width:e[2].x-e[0].x,height:e[2].y-e[0].y},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const{cx:e,cy:n,r:i,r:r}=this.attrs,o=e-i,a=n-r;let s=2*i,l=2*r,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(t&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[e,n,i,r]=Fi(c);s=i-e,l=r-n,this.__bounds[t]=[{x:e,y:n},{x:e+s,y:n},{x:e+s,y:n+l},{x:e,y:n+l}]}else this.__bounds[t]=c;return this.__bounds[t]}}class Jm extends qm{constructor(){super("line"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:e=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=t;super.set(t),this.attrs.x1=e,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const a={type:"line",x1:e,y1:n,x2:i,y2:r};this.collider=Ei(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];let e=Bi(this.attrs);t&&this.modelViewMatrix&&(e=this.modelViewMatrix.transformPoints(e));const[n,i,r,o]=Fi(e),a=n!==r||i!==o;return this.__boundingRect[t]={x:n,y:i,width:a?Math.max(1,r-n):0,height:a?Math.max(1,o-i):0},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}const Qm=Math.PI/2;function ty(t,e){const n=Math.atan2(e.y-t.y,e.x-t.x);return n<0?n+2*Math.PI:n}function ey(t,e,n){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}const ny={step:function(t){return new $r(t,.5)},stepAfter:function(t){return new $r(t,1)},stepBefore:function(t){return new $r(t,0)},linear:br,basis:function(t){return new Ar(t)},cardinal:Or.tension(0),catmullRom:zr,monotonex:function(t){return new Lr(t)},monotoney:function(t){return new jr(t)},natural:function(t){return new Br(t)}};function iy(t){if(t.length<2)return!1;const e=t[0],n=t[t.length-1];return Math.abs(e.x-n.x)<1e-12&&Math.abs(e.y-n.y)<1e-12}class ry extends qm{constructor(){super("path"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(t),this.segments=[],this.points=[],t.arcDatum){const e=xr();e.innerRadius(t.desc.slice.innerRadius),e.outerRadius(t.desc.slice.outerRadius),e.cornerRadius(t.desc.slice.cornerRadius);const n=e(t.arcDatum);this.attrs.d=n}else if(t.points){const{major:e,minor:n,layerObj:i,points:r,stngs:o,generatorType:a}=t,s=kr(),l=o.coordinates?o.coordinates.defined:null;s[e.p]((t=>t.major*e.size))["".concat(n.p,"1")]((t=>t.minor*n.size))["".concat(n.p,"0")]((t=>t.minor0*n.size)).curve(ny["monotone"===i.curve?"monotone".concat(e.p):i.curve]),l?s.defined((t=>!t.dummy&&"number"==typeof t.minor&&!isNaN(t.minor)&&t.defined)):s.defined((t=>!t.dummy&&"number"==typeof t.minor&&!isNaN(t.minor)));const c=o.connect?r.filter(s.defined()):r,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else t.d&&(this.attrs.d=t.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(t.collider)||"object"==typeof t.collider&&void 0!==t.collider.type)this.collider=t.collider;else if(this.attrs.d){if(this.segments=Zg(this.attrs.d),this.segments.length>1&&this.segments.every((t=>iy(t))))return void(this.collider=Ei({type:"geopolygon",vertices:this.segments},t.collider));this.segments.forEach((e=>{if(e.length<=1);else if(iy(e))this.collider=Ei({type:"polygon",vertices:e},t.collider);else if("object"==typeof t.collider&&t.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const e=t[0].x<t[1].x?-1:1,n=t[t.length-1].x>t[t.length-2].x?1:-1;t.unshift({x:t[0].x+e,y:t[0].y}),t.push({x:t[t.length-1].x+n,y:t[t.length-1].y})}else if("v"===n.forceOrientation){const e=t[0].y<t[1].y?-1:1,n=t[t.length-1].y>t[t.length-2].y?1:-1;t.unshift({x:t[0].x,y:t[0].y+e}),t.push({x:t[t.length-1].x,y:t[t.length-1].y+n})}const o=t.length-1;for(let n=1;n<o;n++){const a=t[n-1],s=t[n],l=t[n+1],c=ty(s,a),u=ty(s,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),g=c>u;if(1===n){const t=ty(a,s);i.push(ey(a,t-Qm,e)),r.unshift(ey(a,t+Qm,e))}const m=g?f:p,y=g?p:f;if(i.push(ey(s,m,e)),r.unshift(ey(s,y,e)),n===o-1){const t=ty(l,s);i.push(ey(l,t+Qm,e)),r.unshift(ey(l,t-Qm,e))}}return{type:"polygon",vertices:[...i,...r]}}(e,n,t.collider)}else this.collider=Ei({type:"polyline",points:e},t.collider)}))}}boundingRect(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];this.points.length||(this.segments=this.segments.length?this.segments:Zg(this.attrs.d),this.points=function(t){const e=[];let n,i=t.length;for(let r=0;r<i;r++){n=t[r];for(let t=0;t<n.length;t++)e.push(n[t])}return e}(this.segments));const e=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=Fi(e);return this.__boundingRect[t]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[t]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}function oy(t){let{data:e,_boundingRect:n,_textBoundsFn:i}=t;return null!=e&&(n||i)}class ay extends qm{constructor(){super("text"),this.set(...arguments)}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:e=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=t;super.set(t),this.attrs.x=e,this.attrs.y=n,this.attrs.dx=i,this.attrs.dy=r,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=Ei({type:oy(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};t=this._textBoundsFn(this.attrs);const n=Vi(t),i=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,a,s]=Fi(i);return this.__boundingRect[e]={x:r,y:o,width:a-r,height:s-o},this.__boundingRect[e]}bounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[t])return this.__bounds[t];const e=this.boundingRect(t);return this.__bounds[t]=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],this.__bounds[t]}}const sy=Gr();function ly(t,e){return sy.get(t)(e)}sy.add("rect",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Km(...e)})),sy.add("circle",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Zm(...e)})),sy.add("text",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new ay(...e)})),sy.add("line",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Jm(...e)})),sy.add("path",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new ry(...e)})),sy.add("stage",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Vm(...e)})),sy.add("container",Bm),sy.add("defs",Bm),sy.add("linearGradient",Um),sy.add("radialGradient",Um),sy.add("conicGradient",Um),sy.add("stop",Um),sy.add("pattern",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Gm(...e)}));const cy=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=[{}];function n(){return e[e.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let a="";for(let e=0;e<t.length;e++)a=t[e],void 0!==r[a]&&(o[a]=r[a]);return Ei(o,i),e.push(o),n()},n.restore=function(){e.splice(e.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function uy(t,e){if(Array.isArray(e))for(let n=0,i=e.length;n<i;n++)e[n](t)}function hy(t,e,n){t.node=n[e],t.index=e}function dy(t,e,n,i){let r=!1;const o={siblings:t,node:null,index:0};for(let a=0,s=t.length;a<s;a++){if(hy(o,a,t),uy(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=cy.save(o.node);const s=ly(o.node.type,o.node);s&&(o.node.transform&&(n.save(),bm(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),e.addChild(s),o.node.children&&dy(o.node.children,s,n,i),o.node.transform&&n.restore()),cy.restore()}}function fy(t){let{items:e,stage:n,dpi:i,on:r={}}=t;return n||(n=ly("stage",i)),dy(e,n,new pm,r),n}function py(t,e,n){const{orientation:i,degree:r,stops:o=[]}=n;let a=null;if("radial"===i){const n=e.boundingRect();a=t.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===i){const e=n.startAngle||0,i=n.x||0,r=n.y||0;a=t.createConicGradient(e,i,r)}else{const i=gu(r);["x1","x2","y1","y2"].forEach((t=>{t in n&&(i[t]=n[t])}));const o=e.boundingRect();a=t.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let t=0,e=o.length;t<e;t++){let e=o[t];a.addColorStop(e.offset,e.color)}return a}function gy(t,e,n){return e.width=t.width,e.height=t.height,n.save(),n.fillStyle=t.fill,t.shapes.forEach((t=>{if("rect"===t.type)n.rect(t.x,t.y,t.width,t.height)})),n.fill(),n.restore(),n.createPattern(e,"repeat")}function my(){let{x:t,y:e,width:n,height:i,scaleRatio:r,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(t)?s.x:t,s.y=isNaN(e)?s.y:e,s.width=isNaN(n)?s.width:n,s.height=isNaN(i)?s.height:i,void 0!==r&&(s.scaleRatio.x=isNaN(r.x)?s.scaleRatio.x:r.x,s.scaleRatio.y=isNaN(r.y)?s.scaleRatio.y:r.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((t=>{!isNaN(a[t])&&a[t]>0&&(s.edgeBleed[t]=a[t],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function yy(){const t={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:$p,textBounds:Wp,setKey:e=>{t.element().setAttribute("data-key",e)}};return t}function xy(t){return e=>{let{node:n}=e;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=t.textBounds)}}const vy=200,by=200;class wy{constructor(t){this.targetCanvas=t,this.bufferCanvas=t.cloneNode()}updateSize(t){let e,{rect:n,dpiRatio:i,canvasBufferSize:r}=t;e=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*vy,height:n.computedPhysical.height+2*by},this.bufferCanvas.style.width="".concat(e.width,"px"),this.bufferCanvas.style.height="".concat(e.height,"px"),this.bufferCanvas.width=Math.round(e.width*i),this.bufferCanvas.height=Math.round(e.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const My=Gr();function ky(t){return Array.isArray(t)?t:"string"==typeof t?-1!==t.indexOf(",")?t.split(","):t.split(" "):[]}function _y(t){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}function Sy(t,e){e.setTransform(t[0][0],t[1][0],t[0][1],t[1][1],t[0][2],t[1][2])}function Ny(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const a=o[0],s=o[1],l=o[2];if(a in e.attrs&&!(s in i)&&t[s]!==e.attrs[a]){const n=l?l(e.attrs[a]):e.attrs[a];"function"==typeof t[s]?t[s](n):t[s]=n}}for(let e=0,n=r.length;e<n;e++){const n=r[e];t[n]=i[n]}}function Ry(t,e,n,i){for(let r=0,o=t.length;r<o;r++){let o=t[r],a={};e.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=py(e,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=py(e,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=i.patterns.create(o.attrs.stroke))),Ny(e,o,n,a),o.modelViewMatrix&&Sy(o.modelViewMatrix.elements,e),My.has(o.type)&&My.get(o.type)(o.attrs,{g:e,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Ry(o.children,e,n,i),e.restore()}}function Ay(){let t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fy;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,a=my();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",ky]];let l;const c=yy();return c.element=()=>t,c.root=()=>t,c.settings=t=>(t&&Object.keys(i).forEach((e=>{void 0!==t[e]&&(i[e]=t[e])})),i),c.appendTo=n=>(t||(t=n.ownerDocument.createElement("canvas"),t.style.position="absolute",t.style["-webkit-font-smoothing"]="antialiased",t.style["-moz-osx-font-smoothing"]="antialiased",t.style.pointerEvents="none"),"function"!=typeof i.transform||e||(e=new wy(t)),n.appendChild(t),t),c.getScene=i=>{const r=_y(e&&e.getContext()||t.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:i,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*r*o,", ").concat(a.edgeBleed.top*r*s,")"):""};return 1===r&&1===o&&1===s||(l.transform+="scale(".concat(r*o,", ").concat(r*s,")")),n({items:[l],dpi:r,on:{create:[zp(c.measureText),xy(c)]}})},c.render=n=>{if(!t)return!1;l||(l=function(t){const e=t.createElement("canvas"),n=e.getContext("2d");let i={};return{create(t){const r=t.key;return r?(i[r]=i[r]||gy(t,e,n),i[r]):gy(t,e,n)},clear(){i={}}}}(t.ownerDocument));const u=e&&e.getContext()||t.getContext("2d"),h=_y(u),d=e&&i.transform();if(d)return t.width=t.width,function(t){let{el:e,dpiRatio:n,transform:i}=t;if("object"==typeof i){const t=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];e.getContext("2d").setTransform(...t)}}({el:t,dpiRatio:h,transform:d}),e.apply(),!0;o&&(t.style.left="".concat(a.computedPhysical.x,"px"),t.style.top="".concat(a.computedPhysical.y,"px"),t.style.width="".concat(a.computedPhysical.width,"px"),t.style.height="".concat(a.computedPhysical.height,"px"),t.width=Math.round(a.computedPhysical.width*h),t.height=Math.round(a.computedPhysical.height*h),e&&e.updateSize({rect:a,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const g=o||p,m="function"==typeof i.progressive&&i.progressive();return g&&(m&&!m.isFirst||c.clear(),Ry(f.children,u,s,{patterns:l})),e&&(t.width=t.width,e.apply()),o=!1,m&&!m.isFirst&&f.children.unshift(...r.children),r=f,g},c.itemsAt=t=>r?r.getItemsFrom(t):[],c.findShapes=t=>r?r.findShapes(t):[],c.clear=()=>(t&&(t.width=t.width),e&&e.clear(),r=null,c),c.size=t=>{if(t){const e=my(t);JSON.stringify(a)!==JSON.stringify(e)&&(o=!0,a=e)}return a},c.destroy=()=>{t&&(t.parentElement&&t.parentElement.removeChild(t),t=null),e&&(e=null),r=null},c}function Cy(t,e){My.add(t,e)}function Dy(t,e){return Math.max(0,Math.min(t,e))}const Oy=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Ey=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),zy=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Iy(t){return Oy.test(t)}function Ty(t){return Ey.test(t)||zy.test(t)}function Py(t){let e,n,i=t?t.length:0;for(e=0;e<i;e++){if(n=t[e],Iy(n))return"ltr";if(Ty(n))return"rtl"}return"ltr"}const qy={start:"end",end:"start",center:"center",middle:"middle"};function Ly(t,e){return"rtl"===e?qy[t]:t}function jy(t,e){const n=[];let i;const r=[],o=[],a=[];let s,l;const c=t=>t.id,u=(t,e)=>{let n;return n="object"==typeof t?"id"in t?t.id:e:t,{content:t,id:"".concat(n,"__").concat(t.type||"")}};t.isTree||(t=t.map(u)),e=e.map(u),s=t.map(c),l=e.map(c);for(let t=0,i=e.length;t<i;t++){-1===s.indexOf(e[t].id)?n.push(e[t]):o.push(e[t])}for(let e=0,n=t.length;e<n;e++){-1===l.indexOf(t[e].id)?r.push(t[e]):a.push(t[e])}for(let t=0,e=n.length;t<e;t++)n[t].content.children&&(n[t].diff=jy([],n[t].content.children),n[t].children=n[t].diff.updatedNew.concat(n[t].diff.added),n[t].children.isTree=!0);for(let t=0,e=o.length;t<e;t++)o[t].diff=jy(a[t].children||[],o[t].content.children||[]),o[t].object=a[t].object,o[t].children=o[t].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,a.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:r,items:i}}function Fy(t,e,n){for(let i=0,r=t.length;i<r;i++)t[i].object=n(t[i].content.type,e)}function By(t,e){for(let n=0,i=t.length;n<i;n++)null!==t[n].object&&void 0!==t[n].object&&(e(t[n].object),t[n].object=null)}function Vy(t,e,n,i){let r;for(let o=0,a=t.length;o<a;o++)r=t[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(Fy(r.diff.added,r.object,e),By(r.diff.removed,i),Vy(r.diff.items,e,n,i)))}function $y(t,e,n,i,r,o){const a=jy(t,e);return Fy(a.added,n,i),By(a.removed,o),Vy(a.items,i,r,o),a.items}Cy("rect",(function(t,e){let{g:n,doFill:i,doStroke:r}=e;n.beginPath(),t.rx>0||t.ry>0?function(t,e,n,i,r,o,a){o=Dy(i/2,o>0?o:a),a=Dy(r/2,a>0?a:o),t.moveTo(e,n+a),t.lineTo(e,n+r-a),t.quadraticCurveTo(e,n+r,e+o,n+r),t.lineTo(e+i-o,n+r),t.quadraticCurveTo(e+i,n+r,e+i,n+r-a),t.lineTo(e+i,n+a),t.quadraticCurveTo(e+i,n,e+i-o,n),t.lineTo(e+o,n),t.quadraticCurveTo(e,n,e,n+a)}(n,t.x,t.y,t.width,t.height,t.rx,t.ry):n.rect(t.x,t.y,t.width,t.height),i&&n.fill(),r&&n.stroke()})),Cy("circle",(function(t,e){let{g:n,doFill:i,doStroke:r}=e;n.beginPath(),n.moveTo(t.cx+t.r,t.cy),n.arc(t.cx,t.cy,t.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),Cy("line",(function(t,e){let{g:n,doStroke:i}=e;n.beginPath(),n.moveTo(t.x1,t.y1),n.lineTo(t.x2,t.y2),i&&n.stroke()})),Cy("path",(function(t,e){let{g:n,doStroke:i,doFill:r}=e;const o=new Path2D(t.d);r&&n.fill(o),i&&n.stroke(o)})),Cy("text",(function(t,e){let{g:n,ellipsed:i,doStroke:r}=e;const o=i||Ip(t,$p);n.font=[t["font-style"],t["font-weight"],t["font-size"],t["font-family"]].filter((t=>!!t)).join(" ");const a=Py(t.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=Ly("middle"===t["text-anchor"]?"center":t["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=Tp(t);n.fillText(o,t.x+t.dx,t.y+t.dy+l),r&&n.strokeText(o,t.x+t.dx,t.y+t.dy+l)}));const Hy="http://www.w3.org/2000/svg",Wy=(t,e)=>{if(!t||"string"!=typeof t)throw new Error("Invalid type: ".concat(t));const n=e.ownerDocument.createElementNS(Hy,"container"===t?"g":t);return e.appendChild(n),n},Uy=t=>{t.parentNode&&t.parentNode.removeChild(t)},Yy=(t,e)=>{if((t=>{switch(t.type){case"circle":return!isNaN(t.attrs.cx)&&!isNaN(t.attrs.cy)&&!isNaN(t.attrs.r);case"line":return!(isNaN(t.attrs.x1)||isNaN(t.attrs.y1)||isNaN(t.attrs.x2)||isNaN(t.attrs.y2));case"rect":return!(isNaN(t.attrs.x)||isNaN(t.attrs.y)||isNaN(t.attrs.width)||isNaN(t.attrs.height));case"text":return!isNaN(t.attrs.x)&&!isNaN(t.attrs.y);default:return!0}})(e)){for(const n in e.attrs)if("stroke"===n&&e.strokeReference)t.setAttribute("stroke",e.strokeReference);else if("fill"===n&&e.fillReference)t.setAttribute("fill",e.fillReference);else if("text"===n){t.setAttribute("style","white-space: pre"),t.textContent=e.ellipsed||Ip(e.attrs,$p);const n=Py(e.attrs.text);"rtl"===n&&(t.setAttribute("direction","rtl"),t.setAttribute("dir","rtl"),t.setAttribute("text-anchor",Ly(t.getAttribute("text-anchor"),n)))}else if("text"!==e.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===e.type&&"title"===n&&e.attrs.title){const n=t.ownerDocument.createElementNS(Hy,"title");n.textContent=e.attrs.title,t.appendChild(n)}else t.setAttribute(n,e.attrs[n]);else{const i=+t.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?Tp(e.attrs):e.attrs[n],t.setAttribute("dy",r+i)}if("string"==typeof e.data||"number"==typeof e.data||"boolean"==typeof e.data)t.setAttribute("data",e.data);else if("object"==typeof e.data&&null!==e.data)for(const n in e.data)"string"!=typeof e.data[n]&&"number"!=typeof e.data[n]&&"boolean"!=typeof e.data[n]||t.setAttribute("data-".concat(n),e.data[n])}};class Xy{constructor(t,e,n,i){this.create=t,this.nodeCreator=e,this.nodeMaintainer=n,this.nodeDestroyer=i}render(t,e){return this.create([],t,e,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function Gy(){return new Xy($y,Wy,Yy,Uy)}function Ky(t){let e,n,i,r=0;if(0===(t=JSON.stringify(t)).length)return r;for(e=0,i=t.length;e<i;e++)n=t.charCodeAt(e),r=(r<<5)-r+n,r&=r;return r}function Zy(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hy,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fy;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gy)();let i,r,o,a=!1,s=my();const l={transform:void 0},c=yy(),u={type:"defs",children:[]},h=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ky,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=e(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const e={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((t=>{e.children.push(t)})),t.push(e),n[c]=!0}r.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return r}(u.children),d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ky,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=e(r[o]),l="picasso-gradient-".concat(i,"-").concat(s);if(!n[s]){let{orientation:e,degree:i,stops:a=[]}=r[o],c={};void 0===i&&(i=90),"radial"===e?c.type="radialGradient":(c=gu(i),["x1","x2","y1","y2"].forEach((t=>{t in r[o]&&(c[t]=r[o][t])})),c.type="linearGradient"),c.id=l,c.children=a.map((t=>{let{offset:e,color:n,opacity:i}=t;return{type:"stop",offset:"".concat(100*e,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),t.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(t){let e="";"undefined"!=typeof window&&(e=window.location.href.split("#")[0]);const n=t.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",e)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",e))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=t=>(t&&Object.keys(l).forEach((e=>{void 0!==t[e]&&(l[e]=t[e])})),l),c.appendTo=e=>(i||(i=e.ownerDocument.createElementNS(t,"svg"),i.style.position="absolute",i.style["-webkit-font-smoothing"]="antialiased",i.style["-moz-osx-font-smoothing"]="antialiased",i.style.pointerEvents="none",i.setAttribute("xmlns",t),r=e.ownerDocument.createElementNS(t,"g"),r.style.pointerEvents="auto",i.appendChild(r)),e.appendChild(i),i),c.getScene=t=>{const n=s.scaleRatio.x,i=s.scaleRatio.y,r={type:"container",children:Array.isArray(t)?[...t,u]:t,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*i,")"):""};return 1===n&&1===i||(r.transform+="scale(".concat(n,", ").concat(i,")")),e({items:[r],on:{create:[t=>{t.node.fillReference=void 0,t.node.strokeReference=void 0},d.onCreate,h.onCreate,zp(c.measureText),xy(c)]}})},c.render=t=>{if(!i)return!1;const e="function"==typeof l.transform&&l.transform();if(e){const{horizontalScaling:t,horizontalSkewing:n,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=e;return r.style.transform="matrix(".concat(t,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}r.style.transform="",a&&(i.style.left="".concat(s.computedPhysical.x,"px"),i.style.top="".concat(s.computedPhysical.y,"px"),i.setAttribute("width",s.computedPhysical.width),i.setAttribute("height",s.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(t),p=!o||!f.equals(o),g=a||p;return g&&(c.clear(),n.render(f.children,r)),a=!1,o=f,g},c.itemsAt=t=>o?o.getItemsFrom(t):[],c.findShapes=t=>o?o.findShapes(t):[],c.clear=()=>{if(!r)return c;o=null;const t=r.cloneNode(!1);return i.replaceChild(t,r),r=t,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=t=>{if(t){const e=my(t);JSON.stringify(s)!==JSON.stringify(e)&&(a=!0,s=e)}return s},c}var Jy,Qy,tx,ex,nx,ix,rx,ox={},ax=[],sx=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function lx(t,e){for(var n in e)t[n]=e[n];return t}function cx(t){var e=t.parentNode;e&&e.removeChild(t)}function ux(t,e,n){var i,r,o,a={};for(o in e)"key"==o?i=e[o]:"ref"==o?r=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Jy.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return hx(t,a,i,r,null)}function hx(t,e,n,i,r){var o={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++tx:r};return null==r&&null!=Qy.vnode&&Qy.vnode(o),o}function dx(t){return t.children}function fx(t,e){this.props=t,this.context=e}function px(t,e){if(null==e)return t.__?px(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?px(t):null}function gx(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return gx(t)}}function mx(t){(!t.__d&&(t.__d=!0)&&ex.push(t)&&!yx.__r++||nx!==Qy.debounceRendering)&&((nx=Qy.debounceRendering)||ix)(yx)}function yx(){var t,e,n,i,r,o,a,s;for(ex.sort(rx);t=ex.shift();)t.__d&&(e=ex.length,i=void 0,r=void 0,a=(o=(n=t).__v).__e,(s=n.__P)&&(i=[],(r=lx({},o)).__v=o.__v+1,Nx(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,i,null==a?px(o):a,o.__h),Rx(i,o),o.__e!=a&&gx(o)),ex.length>e&&ex.sort(rx));yx.__r=0}function xx(t,e,n,i,r,o,a,s,l,c){var u,h,d,f,p,g,m,y=i&&i.__k||ax,x=y.length;for(n.__k=[],u=0;u<e.length;u++)if(null!=(f=n.__k[u]=null==(f=e[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?hx(null,f,null,null,f):Array.isArray(f)?hx(dx,{children:f},null,null,null):f.__b>0?hx(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<x;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}Nx(t,f,d=d||ox,r,o,a,s,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(m||(m=[]),d.ref&&m.push(d.ref,null,f),m.push(h,f.__c||p,f)),null!=p?(null==g&&(g=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=vx(f,l,t):l=bx(t,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=t&&(l=px(d))}for(n.__e=g,u=x;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=wx(i).nextSibling),Dx(y[u],y[u]));if(m)for(u=0;u<m.length;u++)Cx(m[u],m[++u],m[++u])}function vx(t,e,n){for(var i,r=t.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=t,e="function"==typeof i.type?vx(i,e,n):bx(n,i,i,r,i.__e,e));return e}function bx(t,e,n,i,r,o){var a,s,l;if(void 0!==e.__d)a=e.__d,e.__d=void 0;else if(null==n||r!=o||null==r.parentNode)t:if(null==o||o.parentNode!==t)t.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break t;t.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function wx(t){var e,n,i;if(null==t.type||"string"==typeof t.type)return t.__e;if(t.__k)for(e=t.__k.length-1;e>=0;e--)if((n=t.__k[e])&&(i=wx(n)))return i;return null}function Mx(t,e,n){"-"===e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||sx.test(e)?n:n+"px"}function kx(t,e,n,i,r){var o;t:if("style"===e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof i&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Mx(t.style,e,"");if(n)for(e in n)i&&n[e]===i[e]||Mx(t.style,e,n[e])}else if("o"===e[0]&&"n"===e[1])o=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?i||t.addEventListener(e,o?Sx:_x,o):t.removeEventListener(e,o?Sx:_x,o);else if("dangerouslySetInnerHTML"!==e){if(r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==e&&"height"!==e&&"href"!==e&&"list"!==e&&"form"!==e&&"tabIndex"!==e&&"download"!==e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!==e[4]?t.removeAttribute(e):t.setAttribute(e,n))}}function _x(t){return this.l[t.type+!1](Qy.event?Qy.event(t):t)}function Sx(t){return this.l[t.type+!0](Qy.event?Qy.event(t):t)}function Nx(t,e,n,i,r,o,a,s,l){var c,u,h,d,f,p,g,m,y,x,v,b,w,M,k,_=e.type;if(void 0!==e.constructor)return null;null!=n.__h&&(l=n.__h,s=e.__e=n.__e,e.__h=null,o=[s]),(c=Qy.__b)&&c(e);try{t:if("function"==typeof _){if(m=e.props,y=(c=_.contextType)&&i[c.__c],x=c?y?y.props.value:c.__:i,n.__c?g=(u=e.__c=n.__c).__=u.__E:("prototype"in _&&_.prototype.render?e.__c=u=new _(m,x):(e.__c=u=new fx(m,x),u.constructor=_,u.render=Ox),y&&y.sub(u),u.props=m,u.state||(u.state={}),u.context=x,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=_.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=lx({},u.__s)),lx(u.__s,_.getDerivedStateFromProps(m,u.__s))),d=u.props,f=u.state,u.__v=e,h)null==_.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==_.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,x),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,x)||e.__v===n.__v){for(e.__v!==n.__v&&(u.props=m,u.state=u.__s,u.__d=!1),u.__e=!1,e.__e=n.__e,e.__k=n.__k,e.__k.forEach((function(t){t&&(t.__=e)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break t}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=x,u.props=m,u.__P=t,b=Qy.__r,w=0,"prototype"in _&&_.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(e),c=u.render(u.props,u.state,u.context),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[]}else do{u.__d=!1,b&&b(e),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=lx(lx({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),k=null!=c&&c.type===dx&&null==c.key?c.props.children:c,xx(t,Array.isArray(k)?k:[k],e,n,i,r,o,a,s,l),u.base=e.__e,e.__h=null,u.__h.length&&a.push(u),g&&(u.__E=u.__=null),u.__e=!1}else null==o&&e.__v===n.__v?(e.__k=n.__k,e.__e=n.__e):e.__e=Ax(n.__e,e,n,i,r,o,a,l);(c=Qy.diffed)&&c(e)}catch(t){e.__v=null,(l||null!=o)&&(e.__e=s,e.__h=!!l,o[o.indexOf(s)]=null),Qy.__e(t,e,n)}}function Rx(t,e){Qy.__c&&Qy.__c(e,t),t.some((function(e){try{t=e.__h,e.__h=[],t.some((function(t){t.call(e)}))}catch(t){Qy.__e(t,e.__v)}}))}function Ax(t,e,n,i,r,o,a,s){var l,c,u,h=n.props,d=e.props,f=e.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){t=l,o[p]=null;break}if(null==t){if(null===f)return document.createTextNode(d);t=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,s=!1}if(null===f)h===d||s&&t.data===d||(t.data=d);else{if(o=o&&Jy.call(t.childNodes),c=(h=n.props||ox).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<t.attributes.length;p++)h[t.attributes[p].name]=t.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===t.innerHTML)||(t.innerHTML=u&&u.__html||""))}if(function(t,e,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in e||kx(t,o,null,n[o],i);for(o in e)r&&"function"!=typeof e[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===e[o]||kx(t,o,e[o],n[o],i)}(t,d,h,r,s),u)e.__k=[];else if(p=e.props.children,xx(t,Array.isArray(p)?p:[p],e,n,i,r&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&px(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&cx(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==t.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&kx(t,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==t.checked&&kx(t,"checked",p,h.checked,!1))}return t}function Cx(t,e,n){try{"function"==typeof t?t(e):t.current=e}catch(t){Qy.__e(t,n)}}function Dx(t,e,n){var i,r;if(Qy.unmount&&Qy.unmount(t),(i=t.ref)&&(i.current&&i.current!==t.__e||Cx(i,null,e)),null!=(i=t.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){Qy.__e(t,e)}i.base=i.__P=null,t.__c=void 0}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&Dx(i[r],e,n||"function"!=typeof t.type);n||null==t.__e||cx(t.__e),t.__=t.__e=t.__d=void 0}function Ox(t,e,n){return this.constructor(t,n)}function Ex(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:e=document.createElement.bind(document)}=t;let n,i,r=my();const o={transform:void 0},a=yy();return a.element=()=>n,a.root=()=>n,a.settings=t=>(t&&Object.keys(o).forEach((e=>{void 0!==t[e]&&(o[e]=t[e])})),o),a.appendTo=t=>(n||(n=e("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),t.appendChild(n),n),a.render=t=>{if(!n)return!1;const e="function"==typeof o.transform&&o.transform();if(e){const{horizontalScaling:t,horizontalSkewing:i,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=e;return n.style.transform="matrix(".concat(t,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}let a;return n.style.transform="",n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),a=Array.isArray(t)?ux("div",null,t):t,i=function(t,e,n){var i,r,o;Qy.__&&Qy.__(t,e),r=(i="function"==typeof n)?null:n&&n.__k||e.__k,o=[],Nx(e,t=(!i&&n||e).__k=ux(dx,null,[t]),r||ox,ox,void 0!==e.ownerSVGElement,!i&&n?[n]:r?null:e.firstChild?Jy.call(e.childNodes):null,o,!i&&n?n:r?r.__e:e.firstChild,i),Rx(o,t)}(a,n,i),!0},a.renderArgs=[ux],a.clear=()=>{if(n){let t=n.firstChild;for(;t;)n.removeChild(t),t=n.firstChild;i=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},a.size=t=>(t&&(r=my(t)),r),a}Jy=ax.slice,Qy={__e:function(t,e,n,i){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(t)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,i||{}),a=r.__d),a)return r.__E=r}catch(e){t=e}throw t}},tx=0,fx.prototype.setState=function(t,e){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=lx({},this.state),"function"==typeof t&&(t=t(lx({},n),this.props)),t&&lx(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),mx(this))},fx.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),mx(this))},fx.prototype.render=dx,ex=[],ix="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rx=function(t,e){return t.__v.__b-e.__v.__b},yx.__r=0;var zx=[function(t){t.renderer("svg",Zy)},function(t){t.renderer("canvas",Ay)},function(t){t.renderer("dom",Ex)}];const Ix={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const Tx=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let{level:t=Ix.OFF,pipe:e=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t;const i={[Ix.OFF]:()=>{},[Ix.ERROR]:function(){return e.error(...arguments)},[Ix.WARN]:function(){return e.warn(...arguments)},[Ix.INFO]:function(){return e.info(...arguments)},[Ix.DEBUG]:function(){return e.log(...arguments)}},r=function(t){if(t&&!(n<t)){for(var e=arguments.length,r=new Array(e>1?e-1:0),o=1;o<e;o++)r[o-1]=arguments[o];(i[t]||i[Ix.DEBUG])(...r)}};return{log:r,error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.ERROR,...e)},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.WARN,...e)},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.INFO,...e)},debug:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r(Ix.DEBUG,...e)},level:t=>("number"==typeof t&&(n=t),n),LOG_LEVEL:Ix}}(e.logger),r={component:Gr(n.component,"component",i),data:Gr(n.data,"data",i),formatter:Gr(n.formatter,"formatter",i),interaction:Gr(n.interaction,"interaction",i),renderer:qh(n.renderer),scale:Gr(n.scale,"scale",i),symbol:Gr(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t({palettes:e.palettes.concat(n.palettes||[]),style:Ei({},e.style,n.style),logger:n.logger||e.logger,renderer:n.renderer||e.renderer},r)}return e.renderer&&e.renderer.prio&&r.renderer.default(e.renderer.prio[0]),o.use=function(t){return function(t){t(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=t=>Ph(t,{registries:r,logger:i,style:e.style,palettes:e.palettes}),o.config=()=>e,Object.keys(r).forEach((t=>{o[t]=r[t]})),o.version=zi,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:Lh,data:$h,formatter:bs,interaction:Hh,renderer:qh(),scale:wc,symbol:Ru});Qg.forEach(Tx.use),zx.forEach(Tx.use),[].forEach(Tx.use);const Px=52,qx=-2*Math.PI/3,Lx=2*Math.PI/3,jx="#EEEEEE",Fx=2.38,Bx={MIN:12,MAX:60},Vx={MIN:100,MAX:1e3},$x={TOP:-4,BOTTOM:0,LEFT:4,RIGHT:4},Hx={VERTICAL_ALIGNMENT_FACTOR:.4},Wx={VERTICAL_ALIGNMENT_FACTOR:1.25},Ux=1.2,Yx={DARK:"#595959",LIGHT:"#E6E6E6"},Xx=.4,Gx=1,Kx=2,Zx=.75,Jx=.75,Qx={MAX_WIDTH:150,MAX_LINES:2,CLEARANCE:12,ESTIMATED_LINE_HEIGHT:16,GAP:8},tv=70,ev=3,nv={MEASURE:"measure"},iv={BAR:"bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR:"radial-oob-indicator",RADIAL_GAUGE:"radial-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label"},rv="XSMALL",ov="SMALL",av="XSMALL_VERTICAL",sv="XSMALL_HORIZONTAL",lv="SMALL",cv={FULL:{width:550,height:450},MEDIUM:{width:300,height:150},SMALL:{width:150,height:84},SMALLER:{width:150,height:75},XSMALL:{width:84,height:84},XSMALL_VERTICAL:{width:105,height:0},XSMALL_HORIZONTAL:{width:0,height:104},SPARK:{height:75,width:50}},uv=600,hv=200,dv=500;function fv(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pv(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function gv(){}var mv=.7,yv=1/mv,xv="\\s*([+-]?\\d+)\\s*",vv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",bv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",wv=/^#([0-9a-f]{3,8})$/,Mv=new RegExp(`^rgb\\(${xv},${xv},${xv}\\)$`),kv=new RegExp(`^rgb\\(${bv},${bv},${bv}\\)$`),_v=new RegExp(`^rgba\\(${xv},${xv},${xv},${vv}\\)$`),Sv=new RegExp(`^rgba\\(${bv},${bv},${bv},${vv}\\)$`),Nv=new RegExp(`^hsl\\(${vv},${bv},${bv}\\)$`),Rv=new RegExp(`^hsla\\(${vv},${bv},${bv},${vv}\\)$`),Av={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Cv(){return this.rgb().formatHex()}function Dv(){return this.rgb().formatRgb()}function Ov(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=wv.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ev(e):3===n?new Pv(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?zv(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?zv(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Mv.exec(t))?new Pv(e[1],e[2],e[3],1):(e=kv.exec(t))?new Pv(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=_v.exec(t))?zv(e[1],e[2],e[3],e[4]):(e=Sv.exec(t))?zv(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Nv.exec(t))?Vv(e[1],e[2]/100,e[3]/100,1):(e=Rv.exec(t))?Vv(e[1],e[2]/100,e[3]/100,e[4]):Av.hasOwnProperty(t)?Ev(Av[t]):"transparent"===t?new Pv(NaN,NaN,NaN,0):null}function Ev(t){return new Pv(t>>16&255,t>>8&255,255&t,1)}function zv(t,e,n,i){return i<=0&&(t=e=n=NaN),new Pv(t,e,n,i)}function Iv(t){return t instanceof gv||(t=Ov(t)),t?new Pv((t=t.rgb()).r,t.g,t.b,t.opacity):new Pv}function Tv(t,e,n,i){return 1===arguments.length?Iv(t):new Pv(t,e,n,null==i?1:i)}function Pv(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function qv(){return`#${Bv(this.r)}${Bv(this.g)}${Bv(this.b)}`}function Lv(){const t=jv(this.opacity);return`${1===t?"rgb(":"rgba("}${Fv(this.r)}, ${Fv(this.g)}, ${Fv(this.b)}${1===t?")":`, ${t})`}`}function jv(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fv(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Bv(t){return((t=Fv(t))<16?"0":"")+t.toString(16)}function Vv(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Hv(t,e,n,i)}function $v(t){if(t instanceof Hv)return new Hv(t.h,t.s,t.l,t.opacity);if(t instanceof gv||(t=Ov(t)),!t)return new Hv;if(t instanceof Hv)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(n<i):n===o?(i-e)/s+2:(e-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new Hv(a,s,l,t.opacity)}function Hv(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Wv(t){return(t=(t||0)%360)<0?t+360:t}function Uv(t){return Math.max(0,Math.min(1,t||0))}function Yv(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}fv(gv,Ov,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Cv,formatHex:Cv,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return $v(this).formatHsl()},formatRgb:Dv,toString:Dv}),fv(Pv,Tv,pv(gv,{brighter(t){return t=null==t?yv:Math.pow(yv,t),new Pv(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?mv:Math.pow(mv,t),new Pv(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Pv(Fv(this.r),Fv(this.g),Fv(this.b),jv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qv,formatHex:qv,formatHex8:function(){return`#${Bv(this.r)}${Bv(this.g)}${Bv(this.b)}${Bv(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Lv,toString:Lv})),fv(Hv,(function(t,e,n,i){return 1===arguments.length?$v(t):new Hv(t,e,n,null==i?1:i)}),pv(gv,{brighter(t){return t=null==t?yv:Math.pow(yv,t),new Hv(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?mv:Math.pow(mv,t),new Hv(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Pv(Yv(t>=240?t-240:t+120,r,i),Yv(t,r,i),Yv(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new Hv(Wv(this.h),Uv(this.s),Uv(this.l),jv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=jv(this.opacity);return`${1===t?"hsl(":"hsla("}${Wv(this.h)}, ${100*Uv(this.s)}%, ${100*Uv(this.l)}%${1===t?")":`, ${t})`}`}}));const Xv=Math.PI/180,Gv=180/Math.PI,Kv=.96422,Zv=.82521,Jv=4/29,Qv=6/29,tb=3*Qv*Qv,eb=Qv*Qv*Qv;function nb(t){if(t instanceof ib)return new ib(t.l,t.a,t.b,t.opacity);if(t instanceof cb)return ub(t);t instanceof Pv||(t=Iv(t));var e,n,i=sb(t.r),r=sb(t.g),o=sb(t.b),a=rb((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?e=n=a:(e=rb((.4360747*i+.3850649*r+.1430804*o)/Kv),n=rb((.0139322*i+.0971045*r+.7141733*o)/Zv)),new ib(116*a-16,500*(e-a),200*(a-n),t.opacity)}function ib(t,e,n,i){this.l=+t,this.a=+e,this.b=+n,this.opacity=+i}function rb(t){return t>eb?Math.pow(t,1/3):t/tb+Jv}function ob(t){return t>Qv?t*t*t:tb*(t-Jv)}function ab(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function sb(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function lb(t,e,n,i){return 1===arguments.length?function(t){if(t instanceof cb)return new cb(t.h,t.c,t.l,t.opacity);if(t instanceof ib||(t=nb(t)),0===t.a&&0===t.b)return new cb(NaN,0<t.l&&t.l<100?0:NaN,t.l,t.opacity);var e=Math.atan2(t.b,t.a)*Gv;return new cb(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new cb(t,e,n,null==i?1:i)}function cb(t,e,n,i){this.h=+t,this.c=+e,this.l=+n,this.opacity=+i}function ub(t){if(isNaN(t.h))return new ib(t.l,0,0,t.opacity);var e=t.h*Xv;return new ib(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}function hb(t){return function(t){return lb(t).l<70}(t)?Yx.LIGHT:Yx.DARK}function db(t,e=!0){let n="";for(let e=0;e<t.length;e++){const i=t[e];n+=0===e?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return e&&(n+="Z"),n}function fb(t){const{angle:e,origin:n}=t,i=t.points.map((t=>function(t,e,n={x:0,y:0}){const i=Math.cos(e),r=Math.sin(e),o=(s=n,{x:(a=t).x-s.x,y:a.y-s.y});var a,s;return function(t,e){return{x:t.x+e.x,y:t.y+e.y}}({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}(t,e,n)));return{type:"path",fill:t.fill,d:db(i)}}fv(ib,(function(t,e,n,i){return 1===arguments.length?nb(t):new ib(t,e,n,null==i?1:i)}),pv(gv,{brighter(t){return new ib(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new ib(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Pv(ab(3.1338561*(e=Kv*ob(e))-1.6168667*(t=1*ob(t))-.4906146*(n=Zv*ob(n))),ab(-.9787684*e+1.9161415*t+.033454*n),ab(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),fv(cb,lb,pv(gv,{brighter(t){return new cb(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker(t){return new cb(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb(){return ub(this).rgb()}}));const pb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{size:i,component:r,selector:o,pointingTo:a}=e;if(!t.component(e.component))return[];const s=t.findShapes(o).filter((t=>t.key===r));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:c}=t.element;let u=l/2,h=c/2,d=-Math.PI/2;const f=i/3;switch(a){case"top":h=f;break;case"bottom":h=c-f,d=3*Math.PI/2-Math.PI;break;case"right":u=l-f,d=0;break;case"left":u=f,d=Math.PI}const p=[];for(let t=0;t<s.length;t+=1){const e=s[t],n=hb(["top","right"].includes(a)?e.attrs.fill:jx),r={x:u,y:h},o=i/6,l=fb({points:[{x:r.x+2*o,y:r.y},{x:r.x,y:r.y+o},{x:r.x,y:r.y-o}],angle:d,fill:n,origin:r});p.push(l)}return p}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}};function gb(t,e,n,i){const r=Math.floor(Math.min(t,e)),o=Math.abs(i-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-bb(t,e)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/dv*50,10))/r,outerRadius:s,radiusIncrease:a}}function mb(t,e,n,i){const r=i-Math.PI/2;return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}}function yb(t,e){const n=t.getColor()({datum:{value:()=>0}});return e?"#595959":n}function xb({innerRadius:t,outerRadius:e,width:n,height:i}){return(e-t)*Math.min(n,i)/2}function vb(t){return!1!==t.show&&0!==t.show&&"0"!==t.show}function bb(t,e){return Math.min(6,Math.min(t,e)/hv)}const wb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{valueAngle:i}=e;if(!t.component(e.component))return[];const{clientWidth:r,clientHeight:o}=t.element,{outerRadius:a,innerRadius:s}=gb(r,o,qx,Lx),l=xb({innerRadius:s,outerRadius:a,width:r,height:o});let c=mb(r/2,o/2,a*Math.min(r,o)/2,e.valueAngle),u=c.x,h=c.y;const d=[],f=hb(jx),p={x:u,y:h},g=l/6,m=fb({points:[{x:p.x,y:p.y},{x:p.x-8*g,y:p.y+g},{x:p.x-8*g,y:p.y-g}],angle:i-Math.PI/2,fill:f,origin:p});return d.push(m),d}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}};const Mb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{size:i,component:r,selector:o,angle:a,radius:s}=e;if(!t.component(e.component))return[];const l=t.findShapes(o).filter((t=>t.key===r));if(null==l||!l.length)return[];const{clientWidth:c,clientHeight:u}=t.element;let h=c/2,d=u/2,{x:f,y:p}=mb(h,d,s,a);const g=[],m=e.fill,y=a===qx?-1:1,x={x:f,y:p},v=i/6,b=fb({points:[{x:x.x+(2*v+1)*y,y:x.y+.5},{x:x.x+1*y,y:x.y+v+.5},{x:x.x+1*y,y:x.y-v+.5}],angle:a,fill:m,origin:x});return g.push(b),g}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}};function kb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _b=Object.prototype.hasOwnProperty,Sb=Object.prototype.toString,Nb=Object.defineProperty,Rb=Object.getOwnPropertyDescriptor,Ab=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===Sb.call(t)},Cb=function(t){if(!t||"[object Object]"!==Sb.call(t))return!1;var e,n=_b.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&_b.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;for(e in t);return void 0===e||_b.call(t,e)},Db=function(t,e){Nb&&"__proto__"===e.name?Nb(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},Ob=function(t,e){if("__proto__"===e){if(!_b.call(t,e))return;if(Rb)return Rb(t,e).value}return t[e]},Eb=function t(){var e,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(e=arguments[l]))for(n in e)i=Ob(s,n),s!==(r=Ob(e,n))&&(u&&r&&(Cb(r)||(o=Ab(r)))?(o?(o=!1,a=i&&Ab(i)?i:[]):a=i&&Cb(i)?i:{},Db(s,{name:n,newValue:t(u,a,r)})):void 0!==r&&Db(s,{name:n,newValue:r}));return s},zb=kb(Eb);let Ib;function Tb(){Ib=Ib||document.createElement("canvas").getContext("2d")}const Pb={measureTextWidth(t){Tb();const{width:e}=Ib.measureText(t);return e},lineWrap(t,e,n,i){let r,o;Tb();const a=t?t.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,h,d=t?t.split(/\s+/):[],f=a[0];if("number"!=typeof e||e<=0)return[t];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(Ib.font=n),o=0;o<a.length;o++){for(h=a[o],d=h.split(/\s+/),[f]=d,u="",r=1;r<d.length;r++)if(l=`${f} ${d[r]}`,c=Pb.measureTextWidth(l),c>e&&("number"!=typeof i||i>s.length)?(s.push(f),f=d[r]):f=l,"number"==typeof i&&s.length>=i){u=d.slice(r+1).join(" ");break}"number"!=typeof i||s.length<i?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${f} ${u}`}return s},wordWrap(t,e,n,i,r){if(Tb(),!t||!t.length)return[];n&&(Ib.font=n);let o=[];const a=t.slice();let s,l,c,u="";if(a.filter((t=>!!t)),"number"!=typeof e||e<0)return t.slice();for(c=0;c<a.length;c++){var h;if(l=a[c],u="",l.length<=1||Pb.measureTextWidth(l)<=e)o.push(l);else if(s=Pb.splitWord(l,e,void 0,void 0===i?void 0:i-o.length),s.length<=1)o.push(s[0]);else u=null!==(h=s.pop())&&void 0!==h?h:"",o=o.concat(s),a[c+1]?Pb.measureTextWidth(`${u} ${a[c+1]}`)>e&&(void 0===i||o.length+a.length-c<=i)?a.splice(c+1,0,u):a[c+1]=`${u} ${a[c+1]}`:a.push(u)}return o.forEach(((t,e,n)=>{n[e]=t.trim()})),void 0!==i&&o.length>i?(o=o.splice(0,i),o[o.length-1]=Pb.truncate(o[o.length-1],e,n,r).text):(l=o[o.length-1],l&&l.length>1&&Pb.measureTextWidth(l)>e&&(o[o.length-1]=Pb.truncate(l,e,n,r).text)),o},truncate(t,e,n,i="…"){Tb();let r,o,a,s,l=t;const c=Pb.measureTextWidth("i");if(n&&(Ib.font=n),t&&e){if(Pb.measureTextWidth(l)>e){const t=Math.ceil(e/c);for(r=Math.min(t,l.length);r>0;r--)if(o=l.substring(0,r-1),a=o.trim()+i,Pb.measureTextWidth(a)<=e){s=l.substring(r-1),l=a;break}r||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:t=>"number"==typeof t&&Number.isFinite(t),explodeWord(t,e,n,i){let r;Tb();let o,a=t,s="",l=[];if(void 0!==n&&Pb.isNumber(n)&&n<=1)return[t];const c=Math.ceil(e/i);for(r=Math.min(t.length,c);r>0&&(a=t.substring(0,r),o=t.substring(r-1,r)," "===o?a=t.substring(0,r-1):a+="-",s=t.substring(r),!(Pb.measureTextWidth(a)<=e));r--);return(!r&&!a||Pb.measureTextWidth(a)>e)&&(a=t.substring(0,1),s=t.substring(1)),l.push(a),s?(Pb.measureTextWidth(s)>e?l=l.concat(Pb.explodeWord(s,e,void 0===n?void 0:n-1,i)):l.push(s),l.filter((t=>""!==t.trim()))):l},splitWord:(t,e,n,i)=>(Tb(),t&&e?(n&&(Ib.font=n),Pb.explodeWord(t,e,i,Math.max(1,Pb.measureTextWidth("i")))):[]),wrapText(t,e,n,i,r="…"){let o;return Number.isNaN(e)||!e?[t]:(o=void 0===i||i>1?Pb.lineWrap(t,e,n,i):[t],o=Pb.wordWrap(o,e,n,i,r),o)},getFontHeight:t=>(Tb(),t&&(Ib.font=t),1.5*Pb.measureTextWidth("m")),tokenize(t,e,n,i,r,o,a=1){Tb(),e&&(Ib.font=e);const s=Pb.getFontHeight(),l=a*s;let c=[],u=[];if(void 0!==o&&o<s)return[];const h=o?Math.max(1,Math.floor(o/l)):i||1;return c=[void 0===i||Number.isNaN(i)||i<=0?h:Math.min(h,i)],Array.isArray(t)?t.forEach(((t,n)=>{u.length<h&&(u=u.concat(Pb.wrapText(t,r,e,c[n])))})):u=Pb.wrapText(t,r,e,c[0],n),u}};function qb({chart:t,renderer:e,refLine:n,settings:i,width:r,height:o,barWidth:a}){if(!t||!e||!i)return{};const{position:s,scale:l,value:c,label:u,line:h,formatter:d}=n,f=n.radius?n.radius*(Math.min(r,o)/2):r/2,p=(Lx-qx)*s+qx-Math.PI/2,g={x:r/2,y:o/2};let m=zb(!0,{},i.style.line,h||{});const y={type:"line",...{x1:g.x+Math.cos(p)*f,y1:g.y+Math.sin(p)*f,x2:g.x+Math.cos(p)*(f+a),y2:g.y+Math.sin(p)*(f+a)},stroke:m.stroke,strokeWidth:m.strokeWidth,strokeDasharray:m.strokeDasharray};let x;if(u){const n=zb(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:m.stroke},u),{fontFamily:s,fontSize:h,fill:y,opacity:v}=n,b=u.showLabel?n.text:"";let w,M="";if("string"==typeof d||"object"==typeof d)w=t.formatter(d);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const t=l.data()&&l.data().fields;w=t&&t[0]?t[0].formatter():null}!1!==u.showValue&&(w?M=` (${w("function"==typeof c?c():c)})`:l&&(M=` (${c})`));const k=t=>e.measureText({text:t,fontFamily:s,fontSize:h}),_=k("M").height,S=`normal ${h} ${s}`;let N,R=ev;const A=`${b}${M}`||"",C=Math.min(r,o),D=Math.min(8,C/200),O=mb(g.x,g.y,f+a+D,p+Math.PI/2),E=k(A).width;N=Math.min(O.x,r-O.x-Fx,tv),R=function(t,e,n){const i=Math.min(Math.floor((t+Fx)/e),Math.floor((n-t)/e));return Math.min(i,ev)}(O.y,_,o);let z=Pb.tokenize(A,S,`... ${M}`,R,N,void 0);const I=function(t){let e="start";const n=t>-Math.PI&&t<0?"baseline":"hanging";return(t+=Math.PI/2)<0&&t>-Math.PI?e="end":t>0&&t<Math.PI&&(e="start"),{textAnchor:e,baseline:n}}(p);O.y-2*_>0&&O.y+2*_<o&&(O.x-E+Fx<0&&"end"===I.textAnchor||O.x+E-Fx>r)&&(z=Pb.tokenize(A,S,`... ${M}`,R,N,void 0)),x={fill:y,opacity:v,fontFamily:s,fontSize:h,linePosition:O,lineHeight:_,align:"left",baseline:I.baseline,textAnchor:I.textAnchor,lines:z}}return{lineNode:y,labelNode:x}}const Lb={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var t,e;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(t=null==n||null===(e=n.settings)||void 0===e?void 0:e.barWidth)&&void 0!==t?t:0;let c=(null==n?void 0:n.lines)&&n.lines.radial||[];if(0===c.length)return[];c=c.map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=null==i?void 0:i.scale("string"==typeof t.scale?t.scale:"");const n=e(t.value);return zb(t,{scale:e,position:n})}return zb(t,{position:t.value})}));const u=[];let h=[];[...c].forEach((t=>{if(t.position>0&&t.position<1){const{lineNode:e,labelNode:o}=qb({chart:i,renderer:r,refLine:t,settings:n,width:a,height:s,barWidth:l});e&&u.push(e),o&&h.push(o)}}));const d=[];h.forEach((t=>{const{fill:e,opacity:n,fontFamily:i,fontSize:r,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:c}=t,u=l,h=o.length-1,f=o.map(((t,o)=>{let l=u.y;return h>0&&("baseline"===c?l-=(h-o)*a:l+=o*a),{type:"text",text:t,baseline:c,anchor:s,fill:e,opacity:n,fontFamily:i,fontSize:r,x:u.x,y:l}}));d.push(...f)}));const{MEDIUM:f,SMALLER:p}=cv,g=a>=f.width&&s>=f.height;return[...a>=p.width&&s>=p.height?u:[],...g?d:[]]}};const jb={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var t;return function({chart:t,settings:e,symbol:n}){if(!t||!e||!n)return[];const{valueAngle:i}=e,{clientWidth:r,clientHeight:o}=t.element,a=.4*Math.min(r,o),s=[],l=e.fill,c={x:r/2,y:o/2},u=fb({points:[{x:c.x-a/2,y:c.y+a/2},{x:c.x,y:c.y-a},{x:c.x+a/2,y:c.y+a/2}],angle:i,fill:l,origin:c});return s.push(u),s}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,symbol:this.symbol})}},Fb={getGap(t,e){const n=t.position<e.position?t:e,i=t.position<e.position?e:t;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(t,e,n){const i=t.position+t.radius,r=t.position-Math.max(0,i-n),o=r-t.radius;return r+Math.max(0,e-o)},layoutPositionFromMin(t,e,n,i=0){const r=t.length-1;let o,a,s,l=e;for(let e=0;e<r;e++)o=t[e],a=t[e+1],s=(o.position+a.position)/2-i/2,o.position=Fb.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+i;a&&(a.position=Fb.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(t,e,n,i=0){const r=t.length-1,o=Math.max(0,t[r].position+t[r].radius-n);if(0===o)return;let a,s,l,c,u=0;for(a=r;a>0&&(s=t[a],l=t[a-1],c=Math.max(0,Fb.getGap(l,s)-i),c-=Math.max(0,u+c-o),u+=c,s.move=c,!(u>=o));a--);for(u<o&&l&&(c=Math.max(0,l.position-l.radius-e),c-=Math.max(0,u+c-o),u+=c,l.move=c),u=0,a=0;a<=r;a++)s=t[a],u+=s.move||0,s.move=u,s.position-=u},createLayout(t,e,n,i=0){const r=t.map((t=>t.segment)),o=r.length-1;if(o<0)return[];if(0===o){const t=r[0];t.position=Fb.findSegmentPositionMeetMaxThenMin(t,e,n)}else Fb.layoutPositionFromMin(r,e,n,i),Fb.adjustPositionFromMax(r,e,n,i);return t.filter((t=>{const i=Math.ceil(t.segment.position-t.segment.radius),r=t.segment.position+t.segment.radius;return i>=e&&r<=n}))}};const Bb={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var t,e;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(t=null==n||null===(e=n.settings)||void 0===e?void 0:e.barWidth)&&void 0!==t?t:0,c=(null==n?void 0:n.lines)&&n.lines.x||[],u=(null==n?void 0:n.lines)&&n.lines.y||[];let h=c.length>0?c:u;if(0===h.length)return[];const d=c.length>0;h=h.map((t=>{if("function"==typeof t.value&&(t.value=t.value()),t.scale){let e=null==i?void 0:i.scale("string"==typeof t.scale?t.scale:"");const n=e(t.value);return zb(t,{scale:e,position:n})}return zb(t,{position:t.value})}));const f=[];let p=[];if([...h].forEach((t=>{if(vb(t)&&t.position>0&&t.position<1){const{lineNode:e,labelNode:o}=function({chart:t,renderer:e,refLine:n,settings:i,width:r,height:o,isVerticalRefLine:a,barWidth:s}){if(!t||!e||!i)return{};const{position:l,scale:c,value:u,label:h,line:d,formatter:f}=n;let p=zb(!0,{},i.style.line,d||{});const g={type:"line",...a?{x1:l*r,x2:l*r,y1:o/2-s/2,y2:o/2+s/2}:{x1:r/2-s/2,x2:r/2+s/2,y1:l*o,y2:l*o},stroke:p.stroke,strokeWidth:p.strokeWidth,strokeDasharray:p.strokeDasharray};let m;if(h){const n=zb(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:p.stroke},h),{fontFamily:d,fontSize:g,fill:y,opacity:x}=n,v=h.showLabel?n.text:"";let b,w="";if("string"==typeof f||"object"==typeof f)b=t.formatter(f);else if(void 0!==c&&"string"!=typeof c&&"function"==typeof c.data){const t=c.data()&&c.data().fields;b=t&&t[0]?t[0].formatter():null}!1!==h.showValue&&(b?w=` (${b("function"==typeof u?u():u)})`:c&&(w=` (${u})`));const M=t=>e.measureText({text:t,fontFamily:d,fontSize:g}),k=M("M").height,_=`normal ${g} ${d}`,S=a?Qx.MAX_WIDTH:r/2-s/2-Qx.CLEARANCE,N=a?2:1,R=`${v}${w}`||"",A=Pb.tokenize(R,_,`... ${w}`,N,S,void 0),C=(a?r:o)*l,D=Math.min(S,Math.max(...A.map((t=>M(t).width)))),O=A.length*k;m={fill:y,opacity:x,fontFamily:d,fontSize:g,linePosition:C,lineHeight:k,lines:A,segment:{position:C,radius:a?D/2:O/2}}}return{lineNode:g,labelNode:m}}({chart:i,renderer:r,refLine:t,settings:n,width:a,height:s,isVerticalRefLine:d,barWidth:l});e&&f.push(e),o&&p.push(o)}})),d)p=Fb.createLayout(p,0,a,Qx.GAP);else{const{attrs:t}=i.findShapes("text").filter((t=>t.key===iv.GAUGE_LABEL))[0],{"font-size":e}=t,n=parseFloat(e);let r=p.filter((e=>e.segment.position<t.y)),o=p.filter((e=>e.segment.position>t.y));r.sort(((t,e)=>t.segment.position-e.segment.position)),o.sort(((t,e)=>t.segment.position-e.segment.position)),r=Fb.createLayout(r,0,t.y-n/2),o=Fb.createLayout(o,t.y+n/2,s),p=[...r,...o]}const g=[],m=[];p.forEach((t=>{const{fill:e,opacity:n,fontFamily:i,fontSize:r,lines:o,segment:c,linePosition:u,lineHeight:h}=t,{position:f}=c;if(u!==f&&""!==t.lines[0]){let t={x1:a/2+l/2,x2:a/2+l/2+.75*Qx.CLEARANCE,y1:u,y2:f};d&&(t={y1:s/2+l/2,y2:s/2+l/2+Qx.CLEARANCE,x1:u,x2:f});const n={type:"line",...t,stroke:e,strokeWidth:1};m.push(n)}const p=o.map(((t,o)=>{let c=d?s/2+l/2+h/2+Qx.CLEARANCE:f;return c+=o*h,{type:"text",text:t,baseline:"central",anchor:d?"middle":"start",fill:e,opacity:n,fontFamily:i,fontSize:r,x:d?f:a/2+l/2+Qx.CLEARANCE,y:c}}));g.push(...p)}));const{MEDIUM:y,SMALLER:x}=cv,v=a>=y.width&&s>=y.height;return[...a>=x.width&&s>=x.height?f:[],...v?g:[],...v?m:[]]}};function Vb({layout:t,options:e}){return t.snapshotData&&!e.freeResize?{width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h}:void 0}function $b(t,e,n){if(t>=n)return 1;if(t<=e)return 0;const i=Math.min(1,Math.max(0,(t-e)/(n-e)));return Number.isNaN(i)?0:i}function Hb({chart:t,layoutService:e,dockService:n}){const{width:i,height:r}=n.meta.chart.size,{isVertical:o}=e.meta,a=Math.min(Px,o?i/10:r/10),s=o?r:i;function l(){const{min:t,max:n}=e.meta.rangeLimits,i=e.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return s*$b(i,t,n)}const c={getBottomPadding(t){if(o){const e=l()+-t.height*Hx.VERTICAL_ALIGNMENT_FACTOR,n=$x.BOTTOM,i=s-t.height-$x.TOP;return e<n?n:e>i?i:e}const{MAX_LINES:n,ESTIMATED_LINE_HEIGHT:c,CLEARANCE:u}=Qx,h=function(){const{MEDIUM:t}=cv,n=i>=t.width&&r>=t.height,{refLines:o}=e.meta;return o&&o.filter(vb).length>0&&n}()?n*c+u:0;return-a*Wx.VERTICAL_ALIGNMENT_FACTOR-h},getTopPadding:t=>-c.getBottomPadding(t),getLeftPadding(t){if(o)return i/5+a;const e=l()-t.width/2,n=$x.RIGHT,r=s-t.width-$x.LEFT;return e<n?n:e>r?r:e},getRightPadding:t=>-c.getLeftPadding(t)},u={getLeftPadding(e){if(!o)return 0;const n=t.findShapes("container").filter((t=>t.key===iv.BAR_AXIS));if(1!==n.length)return 0;const r=n[0],s=Math.max(...r.children.filter((t=>"text"===t.type)).map((t=>t.bounds.width))),l=Math.max(...r.children.filter((t=>"line"===t.type)).map((t=>t.bounds.width)));let c=a/2+s+l+a*Jx;return c>i/2-e.height/4&&(c=i/2-e.height/4),-c},getRightPadding:t=>-u.getLeftPadding(t),getTopPadding(){if(o)return-4;const e=t.findShapes("container").filter((t=>t.key===iv.BAR_AXIS));if(1!==e.length)return 0;const n=e[0],i=Math.max(...n.children.filter((t=>"text"===t.type)).map((t=>t.bounds.height))),r=Math.max(...n.children.filter((t=>"line"===t.type)).map((t=>t.bounds.height)));return-(a/2+i+r+a*Zx)},getBottomPadding:()=>-u.getTopPadding()};return{getBarWidthInPixels:()=>a,getValueLabelFontSize:function(t,e){const n=$b(Math.min(r,i),Vx.MIN,Vx.MAX);return t+Math.round(n*(e-t))},barValueLabel:c,barAxisTitle:u}}const Wb=({core:e})=>{const n=t.useStaleLayout(),i=t.useTheme(),o=t.useApp(),a=t.useModel(),s=t.useRect(),l=t.useOptions(),c=t.useTranslator(),{qLocaleInfo:u}=t.useAppLayout(),[h,d]=t.useState(null);return t.useEffect((()=>{if(!n||!e)return;const{picassoInstance:t,chart:h}=e;if(!h)return;const f=function(t){var e=t.source,n=t.metaAdditionsFn,i=t.experimental,o=void 0===i?{filter:!1}:i,a=M(!0,{},e),s=o.filter?function(t){var e=t.qHyperCube,n=pe(e,fe.DIMENSION),i=n.reduced,r=n.filtered;e[fe.DIMENSION]=i;var o=pe(e,fe.MEASURE),a=o.reduced,s=o.filtered;return e[fe.MEASURE]=a,{dimensions:r,measures:s}}(a):{dimensions:[],measures:[]},l=me(a),c=function(){var t=function(t){var e=t.layout,n=t.additionsFn,i=void 0===n?function(){return{}}:n,o=t.additionsProps,a=void 0===o?{}:o,s=e.qHyperCube,l=s.qDimensionInfo,c=s.qMeasureInfo,u=s.qMode,h=l.length,d=c.length,f=r({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:h,measureCount:d,hasMultipleDimensions:h>1,hasMultipleMeasures:d>1,isOneDimensional:1===h,isTwoDimensional:2===h},a);return r(r({},f),i({layout:e,meta:f}))}({layout:a,additionsFn:n,additionsProps:{size:l.size}});return t.filteredFields=s,t},u={refs:r({},l.refs),meta:c(),getLayout:function(){return a},getLayoutValue:function(t,e){return ce(a,t,e)},setLayoutValue:function(t,e){he(a,t,e),l=me(a),u.meta=c()},getHyperCube:function(){return a.qHyperCube},getHyperCubeValue:function(t,e){return ce(a.qHyperCube,t,e)},setHyperCubeValue:function(t,e){he(a.qHyperCube,t,e),l=me(a),u.meta=c()},getDataPages:function(){return ce(a,l.refs.dataPages)},setDataPages:function(t){he(a,l.refs.dataPages,t),u.meta=c()}};return u}({source:n,metaAdditionsFn:function({layout:t}){var e;const{measureAxis:n,qHyperCube:i,autoOrientation:r,gaugetype:o,useSegments:a,segmentInfo:l,refLine:c}=t,u=null===(e=t.qHyperCube)||void 0===e?void 0:e.qMeasureInfo[0].qFallbackTitle,{width:h,height:d}=s;let f=t.orientation;r&&(f=h>=d?"horizontal":"vertical");const p="vertical"===f,g=function({measureAxis:t,qHyperCube:e}){if(!t||!e)return{min:0,max:1};let{min:n,max:i}=t;if(n=Number(n),i=Number(i),n!==i)return{min:Math.min(n,i),max:Math.max(n,i)};const r=e.qDataPages[0].qMatrix[0][0].qNum;let o=Math.abs(r-n)/2;return 0===o&&(o=0!==n?Math.abs(n)/2:Number.MAX_VALUE/2),{min:n-o,max:i+o}}({measureAxis:n,qHyperCube:i}),m=(null==c?void 0:c.refLines)||[];return{measureAxisTitle:u,measureAxisSpacing:null==n?void 0:n.spacing,rangeLimits:g,qHyperCube:i,orientation:f,autoOrientation:r,gaugetype:o,isVertical:p,useSegments:a,segmentInfo:l,refLines:m}}}),p=Vb({layout:f.getLayout(),options:l}),g=le({chart:h,layoutService:f,config:{logicalSize:p},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),m=Kt({app:o,model:a,translator:c,picasso:t,layoutService:f,config:{key:"color",localeInfo:u,theme:i,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})}}),y=function(t){var e=t.theme,n=t.config,i=void 0===n?{}:n,r=i.id,o=i.resolve,a=void 0===o?[]:o,s=i.transform,l=void 0===s?[]:s,c=i.extend,u=void 0===c?[]:c,h={theme:e,matrix:De(a),styles:void 0};return h.styles=Ee({theme:e,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(t){h.theme=t,h.styles=Ee({theme:t,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:i,config:{id:"gauge"}}),x=Hb({chart:h,layoutService:f,dockService:g}),v=function({layoutService:t,themeService:e,colorService:n}){const i=e.getStyles(),r=e=>{var n;const i=null===(n=t.getLayoutValue("components",[]))||void 0===n?void 0:n.find((t=>t.key===e));return i},o=t=>t?n.getPaletteColor(t):void 0;return{query:{axis:{title:{getStyle:()=>{var t,e,n,a;return{fontFamily:null!==(t=null===(e=r("axis"))||void 0===e||null===(e=e.axis)||void 0===e||null===(e=e.title)||void 0===e?void 0:e.fontFamily)&&void 0!==t?t:i.axis.title.fontFamily,fontSize:i.axis.title.fontSize,color:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.title)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.title.color}}},label:{getStyle:()=>{var t,e,n,a;return{fontFamily:null!==(t=null===(e=r("axis"))||void 0===e||null===(e=e.axis)||void 0===e||null===(e=e.label)||void 0===e||null===(e=e.name)||void 0===e?void 0:e.fontFamily)&&void 0!==t?t:i.axis.label.name.fontFamily,fontSize:i.axis.label.name.fontSize,fill:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.name)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.label.name.color}}}},label:{getStyle:()=>{var t,e,n,a;return{fontFamily:null!==(t=null===(e=r("value"))||void 0===e||null===(e=e.label)||void 0===e||null===(e=e.value)||void 0===e?void 0:e.fontFamily)&&void 0!==t?t:i.label.value.fontFamily,fill:null!==(n=o(null===(a=r("value"))||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.value)||void 0===a?void 0:a.color))&&void 0!==n?n:i.label.value.color}}}}}}({layoutService:f,themeService:y,colorService:m});d({layoutService:f,colorService:m,dockService:g,labelService:x,themeService:y,styleService:v})}),[a,o,n,i.name(),c.language(),e,s]),h};function Ub({width:t,height:e,fontSize:n}){const{FULL:i}=cv;if(t>=i.width&&e>=i.height){let t=Number.parseFloat(n);return t=Math.floor(t*Ux),`${t}px`}return n}function Yb({width:t,height:e,isVertical:n,styleService:i,themeService:r}){const o=r.getStyles(),a=i.query.axis.label.getStyle(),{fontFamily:s,fill:l,fontSize:c}=a;return[{type:"axis",key:iv.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:rv},settings:{align:n?"left":"top",line:{show:!n},labels:{minLengthPx:20,fontFamily:s,fill:l,fontSize:Ub({width:t,height:e,fontSize:c})},paddingStart:()=>{if(n){const e=Math.min(t/10,Px);return t/2+e/2}const i=Math.min(e/10,Px);return e/2+i/2+Kx},ticks:{stroke:o.axis.line.major.color}}}]}function Xb({width:t,height:e,measureAxisTitle:n,isVertical:i,labelService:r,styleService:o}){const{getTopPadding:a,getBottomPadding:s,getLeftPadding:l,getRightPadding:c}=r.barAxisTitle,u=o.query.axis.title.getStyle(),{fontFamily:h,fontSize:d,color:f}=u;return[{type:"labels",key:iv.AXIS_TITLE,layout:{minimumLayoutMode:ov},settings:{sources:[{component:iv.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:i?"up":"right",align:.5,justify:.5,labels:[{fontFamily:h,fill:f,fontSize:Number.parseFloat(Ub({width:t,height:e,fontSize:d})),label:()=>n,placements:[{position:"inside",padding:{top:a,bottom:s,left:l,right:c},overflow:!0}]}]}}}]}}]}var Gb=t=>()=>t;function Kb(t){return 1==(t=+t)?Zb:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}(e,n,t):Gb(isNaN(e)?n:e)}}function Zb(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Gb(isNaN(t)?e:t)}var Jb=function t(e){var n=Kb(e);function i(t,e){var i=n((t=Tv(t)).r,(e=Tv(e)).r),r=n(t.g,e.g),o=n(t.b,e.b),a=Zb(t.opacity,e.opacity);return function(e){return t.r=i(e),t.g=r(e),t.b=o(e),t.opacity=a(e),t+""}}return i.gamma=t,i}(1);function Qb({thisColor:t,paletteColors:e,paletteIndex:n,limit:i,isLeft:r=!1,themeService:o}){const a=r?0:1,s=0===Object.entries(i).length,l=i.gradient;let c=n+(r?-1:1);s&&(c=r?0:e.length-1);const u=o.getTheme().getColorPickerColor(c<e.length&&c>=0?e[c]:e[0]);return{color:l?Jb(t,u)(.5):t,offset:a,gradient:l}}function tw({limits:t,paletteColors:e,paletteIndex:n,themeService:i}){const r=ce(t,""+(n-1),{}),o=ce(t,`${n}`,{}),a=[r,o].map((t=>t.gradient)).includes(!0),s=i.getTheme().getColorPickerColor(e[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[Qb({thisColor:s,paletteColors:e,paletteIndex:n,limit:r,isLeft:!0,themeService:i}),Qb({thisColor:s,paletteColors:e,paletteIndex:n,limit:o,isLeft:!1,themeService:i})],c=2===l.filter((t=>t.gradient)).length;c&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map((({offset:t,color:e,gradient:n})=>({offset:t,color:e,gradient:n})));return u}function ew({themeService:t,segmentInfo:e,rangeLimits:n}){const{limits:i,paletteColors:r}=e,{min:o,max:a}=n;i.sort(((t,e)=>t.value-e.value));const s=[o,...i.map((t=>t.value)),a],l=[];for(let e=0;e<r.length;e++){const n=tw({limits:i,paletteColors:r,paletteIndex:e,themeService:t}).map((t=>({offset:$b(s[e]+t.offset*(s[e+1]-s[e]),o,a),color:t.color,gradient:"gradient"in t?t.gradient:void 0})));l.push(...n)}return l}function nw(t,e,n){const i=ew({themeService:e,segmentInfo:n,rangeLimits:t}),r=(Lx-qx)/(2*Math.PI),o=i.map((t=>({offset:t.offset*r,color:t.color})));return{type:"gradient",orientation:"conic",startAngle:qx-Math.PI/2,x:0,y:0,stops:o}}function iw({orientation:t,colorService:e,rangeLimits:n,isVertical:i,useSegments:r,themeService:o,segmentInfo:a}){let{min:s,max:l}=n;const c={type:"box",key:iv.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:{field:"qMeasureInfo/0"}}}},settings:{minor:{scale:"m"},orientation:t,box:{width:.1,maxWidthPx:Px,fill:e.getColor()}}},u={type:"box",key:iv.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:t,box:{width:.1,maxWidthPx:Px,fill:()=>function({themeService:t,isVertical:e,segmentInfo:n,rangeLimits:i}){return{type:"gradient",x1:0,x2:e?0:1,y1:e?1:0,y2:0,stops:ew({themeService:t,segmentInfo:n,rangeLimits:i})}}({themeService:o,isVertical:i,segmentInfo:a,rangeLimits:n})}}},h={type:"box",key:iv.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:l}}},settings:{minor:{scale:"m"},orientation:t,box:{width:.1,maxWidthPx:Px,fill:jx}}};return[{type:"box",key:iv.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:s,end:s}}},settings:{minor:{scale:"m"},orientation:t,box:{width:i?Xx:Gx,opacity:0}}},h,r?u:c]}function rw({isVertical:t,chart:e,labelService:n,styleService:i}){if(!e.formatter)return[];const{getValueLabelFontSize:r,barValueLabel:o}=n,{getTopPadding:a,getBottomPadding:s,getLeftPadding:l,getRightPadding:c}=o,u=r(Bx.MIN,Bx.MAX),h=i.query.label.getStyle();return[{type:"labels",key:iv.GAUGE_LABEL,layout:{minimumLayoutMode:t?av:sv},settings:{sources:[{component:iv.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:t?"up":"right",orientation:"horizontal",fontFamily:h.fontFamily,fill:h.fill,fontSize:u,align:t?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(nv.MEASURE)(t.value):"",placements:[{position:"outside",padding:{top:a,bottom:s,left:l,right:c},overflow:!0}]}]}}}]}}]}function ow({labelService:t,rangeLimits:e,qHyperCube:n,isVertical:i}){const{min:r,max:o}=e,a=n.qDataPages[0].qMatrix[0][0].qNum;if(a<=o&&a>=r)return!1;let s=i?"bottom":"left";return a>o&&(s=i?"top":"right"),{type:"oob-indicator",key:iv.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"bar",selector:"rect",pointingTo:s,size:t.getBarWidthInPixels()}}}function aw({width:t,height:e,styleService:n,themeService:i}){const r=gb(t,e,qx,Lx),{innerRadius:o,outerRadius:a,radiusIncrease:s}=r,l=4*s,c=Math.min(t,e)/2,u=i.getStyles(),h=n.query.axis.label.getStyle(),{tickLength:d,labelPadding:f}=function({width:t,height:e,defaultTickSize:n,defaultLabelPadding:i}){const r=Math.min(Math.min(t,e)/uv,1);return{tickLength:n*r,labelPadding:i*r}}({width:t,height:e,defaultTickSize:8,defaultLabelPadding:20}),p=bb(t,e);return[{type:"axis",dock:"center",layout:{minimumLayoutMode:lv},scale:"m",settings:{arc:{radius:a,startAngle:qx,endAngle:Lx,offset:-10*l*(a-o)*c},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:d,stroke:u.axis.line.major.color,margin:p},labels:{margin:-6-2*d+f,fontFamily:h.fontFamily,fill:h.fill,fontSize:h.fontSize}}}]}function sw({qHyperCube:t,rangeLimits:e,width:n,height:i,colorService:r,themeService:o,segmentInfo:a,useSegments:s}){const{outerRadius:l,innerRadius:c}=gb(n,i,qx,Lx),u=e.max,h=t.qDataPages[0].qMatrix[0][0].qNum,d=u-h,f=[{value:h-e.min,valueLabel:"Measure"},{value:d,valueLabel:"Remaining"}],p=function({themeService:t,segmentInfo:e,rangeLimits:n}){const i=ew({themeService:t,segmentInfo:e,rangeLimits:n});let r=0,o=0,a=i.map((t=>(o=0===n.max?t.offset*(n.max-n.min)-r:t.offset*n.max-r,r+=o,{value:o,color:t.color,gradient:t.gradient}))).filter((t=>0!==t.value));return a.forEach((t=>{t.value=Math.abs(t.value)})),a}({themeService:o,segmentInfo:a,rangeLimits:e}),g={type:"pie",key:iv.RADIAL_GAUGE,data:{items:f},settings:{startAngle:qx,endAngle:Lx,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,fill:(t,e)=>{const n=r.getColor();return 0===e?n(t):jx},strokeWidth:0}}},m={type:"pie",key:iv.RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:p},settings:{startAngle:qx,endAngle:Lx,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,strokeWidth:0,fill:(t,n)=>{var i;return t.datum.value.gradient||null!==(i=p[n-1])&&void 0!==i&&i.gradient?nw(e,o,a):t.datum.value.color}}}},y={type:"pie",key:"circle-gauge",renderer:"canvas",displayOrder:0,data:{items:[{value:h,valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>l,innerRadius:()=>c,fill:()=>function(t,e,n){let i=nw(t,e,n);const r={offset:(Lx-qx)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return i.stops.push(r),i.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),i}(e,o,a),opacity:s?1:0}}};return[y,s?m:g]}function lw({qHyperCube:t,chart:e,styleService:n,labelService:i}){const r=t.qMeasureInfo[0].qFallbackTitle,o=n.query.label.getStyle(),a=n.query.axis.title.getStyle(),{getValueLabelFontSize:s}=i,l=s(Bx.MIN,Bx.MAX),c={type:"labels",key:iv.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:"circle-gauge",selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,labels:[{fontSize:l,fontFamily:o.fontFamily,fill:o.fill,label({data:t}){const n=e.formatter(nv.MEASURE);return t&&n?n(t.value.value):""}},{fontSize:Number.parseFloat(a.fontSize),fontFamily:a.fontFamily,fill:a.color,label:()=>r}]}}}]}};return[c]}function cw({width:t,height:e,rangeLimits:n,qHyperCube:i}){const{min:r,max:o}=n,a=i.qDataPages[0].qMatrix[0][0].qNum;if(a>o||a<r)return!1;const s=gb(t,e,qx,Lx).outerRadius,l=qx+(a-r)/(o-r)*(Lx-qx);return{type:"radial-gauge-needle",key:iv.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",radius:s,valueAngle:l}}}function uw({rangeLimits:t,qHyperCube:e,width:n,height:i,colorService:r,useSegments:o}){const{min:a,max:s}=t,l=e.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:c,innerRadius:u}=gb(n,i,qx,Lx),h=(u+(c-u)/2)*Math.min(n,i)/2;if(l<=s&&l>=a)return!1;let d=qx;return l>s&&(d=Lx),{type:"radial-oob-indicator",key:iv.RADIAL_OOB_INDICATOR,layout:{displayOrder:2},settings:{component:"radial-gauge",selector:"path",angle:d,radius:h,size:xb({innerRadius:u,outerRadius:c,width:n,height:i}),fill:yb(r,o)}}}function hw({refLines:t,colorService:e,themeService:n,width:i,height:r}){const o=n.getStyles(),a=gb(i,r,qx,Lx),s={type:"radial-custom-ref-line",key:"radial-reference-lines",displayOrder:1,settings:{barWidth:xb({innerRadius:a.innerRadius,outerRadius:a.outerRadius,width:i,height:r})},lines:{radial:t.filter(vb).map((t=>{var n,i;return{scale:"m",value:t.refLineExpr.value,label:{text:t.label,...o.referenceLine.label.name,showValue:t.showValue,showLabel:t.showLabel},radius:a.innerRadius,line:{stroke:e.getPaletteColor(t.paletteColor||{index:t.color}),strokeWidth:(null===(n=t.style)||void 0===n?void 0:n.lineThickness)||2,strokeDasharray:null===(i=t.style)||void 0===i?void 0:i.lineType}}}))}};return s}function dw({width:t,height:e,rangeLimits:n,qHyperCube:i,colorService:r,useSegments:o,segmentInfo:a}){const{min:s,max:l}=n,c=i.qDataPages[0].qMatrix[0][0].qNum,u=gb(t,e,qx,Lx).outerRadius;let h;h=c<s?qx:c>l?Lx:qx+(c-s)/(l-s)*(Lx-qx);const d=r.getColor()({datum:{value:()=>0}}),f=a.paletteColors[0].color||d;return{type:"radial-spark",key:iv.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:o?f:d,radius:u,valueAngle:h}}}function fw({refLines:t,isVertical:e,labelService:n,colorService:i,themeService:r}){const o=r.getStyles(),a={type:"custom-ref-line",key:iv.REFERENCE_LINES_AND_LABELS,settings:{barWidth:n.getBarWidthInPixels()},lines:{[e?"y":"x"]:t.filter(vb).map((t=>{var e,n;return{scale:"m",value:t.refLineExpr.value,label:{text:t.label,...o.referenceLine.label.name,showValue:t.showValue,showLabel:t.showLabel},line:{stroke:i.getPaletteColor(t.paletteColor||{index:t.color}),strokeWidth:(null===(e=t.style)||void 0===e?void 0:e.lineThickness)||2,strokeDasharray:null===(n=t.style)||void 0===n?void 0:n.lineType}}}))}};return a}const pw=Math.log(10),gw={log:(t,e)=>t<=0||e<=0?NaN:Math.log(t)/Math.log(e),log10:t=>t<=0?NaN:Math.log(t)/pw,getNiceNumber(t){let e;if(0===t)return 0;const n=Math.floor(Math.log(Math.abs(t))/pw),i=t/10**n;return e=i<=1?1:i<=2?2:i<=5?5:10,e*10**n*(t<0?-1:1)},getSmallNiceNumber(t){let e;if(0===t)return 0;let n=Math.floor(Math.log(Math.abs(t))/pw);const i=t/10**n;return i<1?(e=5,n--):e=i<2?1:i<5?2:5,e*10**n*(t<0?-1:1)},getGoodNumber(t){let e;if(0===t)return 0;const n=Math.floor(Math.log(Math.abs(t))/pw),i=t/10**n;return e=Math.ceil(i),7!==e&&9!==e||e++,i>1&&i<=1.5?e=1.5:i>2&&i<=2.5&&(e=2.5),e*10**n*(t<0?-1:1)},calculateTicks(t,e,n,i,r,o){return this.plotSize=t,this.explicitPlotMin=e,this.explicitPlotMax=n,this.minTickSpacingInPixel=i,this.absMax=Math.abs(this.explicitPlotMax),this.absMin=Math.abs(this.explicitPlotMin),this.usedDataRange=this.explicitPlotMax-this.explicitPlotMin,this.maxNumIntervals=this.plotSize/this.minTickSpacingInPixel,this.maxNumTicks=this.maxNumIntervals+1,this.minTickDataSpacing=o||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=r,this.tickBaseValue=0,this.spaceUseLimit=.6,0===t?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,_w.call(this),Nw.call(this)):(this.maxNumIntervals<1?vw.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?xw.call(this,!0):this.maxNumIntervals>=5?yw.call(this):this.maxNumIntervals<2?bw.call(this):ww.call(this):yw.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),vw.call(this)):Mw.call(this)),_w.call(this),Nw.call(this))}};function mw(t,e,n){void 0===t&&(t=null!==this.explicitPlotMin),void 0===e&&(e=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?gw.getGoodNumber(this.tickDataSpacing):gw.getNiceNumber(this.tickDataSpacing),Sw.apply(this,[t,e])}function yw(){mw.call(this);const t=this.tickMaxIndex-this.tickMinIndex;let e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange;let n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(n&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),mw.call(this),e=this.plotMax-this.plotMin,this.spaceUseFactor=e/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!n)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(n||t<=2&&this.maxNumIntervals>=2*t)&&mw.apply(this,[void 0,void 0,!0]),e=this.plotMax-this.plotMin,this.spaceUseFactor=e/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),mw.apply(this,[void 0,void 0,!0]),e=this.plotMax-this.plotMin,this.spaceUseFactor=e/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function xw(t){t?(this.tickDataSpacingNN=gw.getGoodNumber(this.absMax),this.tickBaseValue=-this.tickDataSpacingNN,this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickMinIndex=1,this.tickMaxIndex=1,this.tickDataSpacingNN*=2):(this.plotMax=this.explicitPlotMax,this.plotMin=this.explicitPlotMin,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,this.tickDataSpacingNN=gw.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=gw.getNiceNumber(1.1*this.absMax)))}function vw(){let t;this.tickDataSpacingNN=gw.getNiceNumber(this.tickDataSpacing),this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,(this.explicitPlotMax<0||this.explicitPlotMin>0)&&(t=gw.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/t)*t)}function bw(){const t=this.explicitPlotMax>=-this.explicitPlotMin,e=t||null!==this.explicitPlotMin,n=!t||null!==this.explicitPlotMax;mw.apply(this,[e,n,!0]);const i=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=i&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),mw.apply(this,[e,n,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function ww(){yw.call(this);const t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange}function Mw(){const t=gw.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===t||0!==this.tickBaseValue)return;const e=this.tickDataSpacingNN,n=this.tickMinIndex,i=this.tickMaxIndex,r=i-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=t,Sw.apply(this,[null!==this.explicitPlotMin,null!==this.explicitPlotMax]);const s=this.plotMax-this.plotMin;this.spaceUseFactor=s/this.plotRange;const l=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel,c=this.tickMaxIndex-this.tickMinIndex;!l&&(c===r||c>=10||c>=3&&1.5*c>=r)||(this.tickDataSpacingNN=e,this.tickMinIndex=n,this.tickMaxIndex=i,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function kw(){this.plotMax===this.plotMin||0===this.plotSize?(this.minTickValue=this.plotMin,this.maxTickValue=this.plotMax):(this.minTickValue=this.tickBaseValue+this.tickMinIndex*this.tickDataSpacingNN,this.maxTickValue=this.tickBaseValue+this.tickMaxIndex*this.tickDataSpacingNN)}function _w(){let t,e;if(this.mainTickValues=[],this.secondaryTickValues=[],kw.call(this),0===this.plotSize)return;t=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(e=0;e<=n;e++)this.mainTickValues.push(t+(e+this.tickMinIndex)*this.tickDataSpacingNN);for(t=this.tickBaseValue+this.tickDataSpacingNN/2,e=0;e<n;e++)this.secondaryTickValues.push(t+(e+this.tickMinIndex)*this.tickDataSpacingNN)}}function Sw(t,e){this.tickMinIndex=t?Math.ceil(this.explicitPlotMin/this.tickDataSpacingNN):Math.floor(this.explicitPlotMin/this.tickDataSpacingNN),this.tickMaxIndex=e?Math.floor(this.explicitPlotMax/this.tickDataSpacingNN):Math.ceil(this.explicitPlotMax/this.tickDataSpacingNN),this.plotMin=t?this.explicitPlotMin:this.tickMinIndex*this.tickDataSpacingNN,this.plotMax=e?this.explicitPlotMax:this.tickMaxIndex*this.tickDataSpacingNN,this.plotRange=this.plotMax-this.plotMin}function Nw(){return{plotMin:this.plotMin,plotMax:this.plotMax,tickSpacing:this.tickDataSpacingNN,tickBaseValue:this.tickBaseValue,tickMinIndex:this.tickMinIndex,tickMaxIndex:this.tickMaxIndex,minTickValue:this.minTickValue,maxTickValue:this.maxTickValue,mainTickValues:this.mainTickValues,secondaryTickValues:this.secondaryTickValues}}function Rw({core:t,dockService:e,rangeLimits:n,measureAxisSpacing:i,isRadial:r,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:c,height:u}=function(t){return{width:t.meta.chart.size.width,height:t.meta.chart.size.height}}(e);let h,d=96*i;if(r)h=Math.min(u,c);else{h=o?u:c;const{chart:e,picassoInstance:n}=t;if(e&&n){const t=e.formatter(nv.MEASURE),r=n.renderer("svg")(),f=a.query.axis.label.getStyle(),{fontFamily:p,fontSize:g}=f,m=t=>r.measureText({text:t,fontSize:Ub({width:c,height:u,fontSize:g}),fontFamily:p}),y=Math.max(96,...[s,l,(l-s)/2].map((e=>m(t(e)).width)));d=o?4*m("M").height:y;d=h/(Math.max(2,h/d/i+1)-1)}}const f=function({plotSize:t,rangeMax:e,rangeMin:n,minTickSpacingInPixel:i}){const r=gw.calculateTicks(t,n,e,i,20,0);r.tickSpacing;let o=r.mainTickValues;0===o.length&&o.push(r.minTickValue);const a=o[0];o[0]=r.plotMin,a-r.plotMin>=r.tickSpacing/2&&o.splice(1,0,a);const s=r.mainTickValues[r.mainTickValues.length-1];return r.plotMax-s<=r.tickSpacing/2?o[r.mainTickValues.length-1]=Math.round(r.plotMax):o.push(Math.round(r.plotMax)),o}({plotSize:h,rangeMin:s,rangeMax:l,minTickSpacingInPixel:d});return{values:f}}function Aw({core:t,services:e,logicalSize:n}){const{layoutService:i,dockService:r,colorService:o,labelService:a,themeService:s,styleService:l}=e;if(!i.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const{width:c,height:u}=r.meta.chart.size,{autoOrientation:h,gaugetype:d,rangeLimits:f,measureAxisTitle:p,qHyperCube:g,useSegments:m,segmentInfo:y,refLines:x,measureAxisSpacing:v}=i.meta;let b,w;w="radial"===d,b=h?c>=u?"horizontal":"vertical":i.meta.orientation;const M="vertical"===b,k=function({width:t,height:e,isVertical:n,orientation:i,measureAxisTitle:r,qHyperCube:o,rangeLimits:a,gaugetype:s,colorService:l,core:c,labelService:u,useSegments:h,themeService:d,segmentInfo:f,refLines:p,styleService:g}){const{chart:m}=c;if(!m)return[];let y=[];return y="bar"===s?[...Yb({width:t,height:e,isVertical:n,styleService:g,themeService:d}),...iw({orientation:i,colorService:l,rangeLimits:a,isVertical:n,useSegments:h,themeService:d,segmentInfo:f}),...Xb({width:t,height:e,labelService:u,measureAxisTitle:r,isVertical:n,styleService:g}),...rw({isVertical:n,chart:m,labelService:u,styleService:g}),ow({labelService:u,rangeLimits:a,qHyperCube:o,isVertical:n}),fw({refLines:p,isVertical:n,labelService:u,colorService:l,themeService:d})]:t>=cv.SPARK.width&&e>=cv.SPARK.height?[...sw({qHyperCube:o,rangeLimits:a,width:t,height:e,colorService:l,themeService:d,segmentInfo:f,useSegments:h}),...lw({qHyperCube:o,chart:m,styleService:g,labelService:u}),...aw({width:t,height:e,styleService:g,themeService:d}),...h?[cw({width:t,height:e,rangeLimits:a,qHyperCube:o})]:[],uw({rangeLimits:a,qHyperCube:o,width:t,height:e,colorService:l,useSegments:h}),hw({refLines:p,isVertical:n,labelService:u,colorService:l,themeService:d,width:t,height:e})]:[dw({width:t,height:e,rangeLimits:a,qHyperCube:o,colorService:l,useSegments:h,segmentInfo:f})],y}({width:c,height:u,isVertical:M,orientation:b,measureAxisTitle:p,qHyperCube:g,rangeLimits:f,gaugetype:d,colorService:o,core:t,labelService:a,themeService:s,useSegments:m,segmentInfo:y,refLines:x,styleService:l}),_=function({core:t,colorService:e,isVertical:n,isRadial:i,dockService:r,rangeLimits:o,measureAxisSpacing:a,styleService:s}){const l=Rw({core:t,dockService:r,rangeLimits:o,measureAxisSpacing:a,isRadial:i,isVertical:n,styleService:s});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:!!i||n,min:o.min,max:o.max,ticks:{values:l.values}},...e.getScales()}}({core:t,measureAxisSpacing:v,isVertical:M,colorService:o,isRadial:w,dockService:r,rangeLimits:f,styleService:l});return{scales:_,components:k,formatters:{[nv.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:cv,logicalSize:n}}}return function(e){return{qae:{properties:{qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:2,qHeight:5e3}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:10},orientation:"vertical",segmentInfo:{limits:[],colors:[{color:3}]}},data:{targets:[{path:"/qHyperCubeDef",dimensions:{min:0,max:0},measures:{min:1,max:1}}]}},ext:Te(e),component(){const e=(()=>{const e=t.useElement(),n=t.useOptions(),[i,r]=t.useState({});return t.useEffect((()=>{e.style.overflow="hidden";const t=Tx();t.use(ki),t.component("oob-indicator",pb),t.component("radial-gauge-needle",wb),t.component("radial-custom-ref-line",Lb),t.component("custom-ref-line",Bb),t.component("radial-oob-indicator",Mb),t.component("radial-spark",jb);const i=t({renderer:{prio:[n.renderer||"svg"]}}),o=i.chart({element:e,data:[],settings:{}});return r({picassoInstance:i,chart:o}),()=>{o.destroy()}}),[]),i})(),n=Wb({core:e}),i=(({core:e,services:n})=>{const[i,r]=t.useState({}),o=t.useOptions(),a=t.useRect(),s=t.useTheme(),l=t.useStaleLayout(),{qLocaleInfo:c}=t.useAppLayout();return t.usePromise((async()=>{if(!n)return Promise.resolve();const{colorService:t}=n;return t.initialize({createConfig:()=>({theme:s,layout:l,localeInfo:c,hc:l.qHyperCube,colorProps:{...l.color,auto:!0,useBaseColors:"off",paletteColor:l.paletteProgressColor}})}).then((()=>{const{layoutService:t}=n,i=Vb({layout:t.getLayout(),options:o}),a=Aw({core:e,services:n,logicalSize:i});r(a)}))}),[n]),t.useEffect((()=>{if(n&&n.dockService&&n.layoutService){const{dockService:t,layoutService:i}=n,s=Vb({layout:i.getLayout(),options:o});t.update(s||a);const l=Aw({core:e,services:n,logicalSize:s});r(l)}}),[a]),i})({core:e,services:n});(({core:e,services:n,settings:i})=>{t.useEffect((()=>{if(!i||!e||!n)return;const{chart:t}=e;t&&t.update({data:[{type:"q",key:"qHyperCube",data:n.layoutService.getHyperCube()},...n.colorService.getData()],settings:i})}),[e,i])})({core:e,settings:i,services:n}),(({services:e})=>{t.onTakeSnapshot((t=>{if(e){const{dockService:n}=e,{width:i,height:r}=n.meta.chart.size;t.snapshotData=t.snapshotData||{content:{size:{w:i,h:r}}},t.snapshotData.content={size:{w:i,h:r}}}return Promise.resolve(t)}))})({services:n})}}}}));
11
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,i,r,o,a,s,l,c,u,h,d=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=d-g,x=e.substring(y,y+1),v=y+("."===x||","===x?1:0),b=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,r=(i=e.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",e=e.split(r),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(h=t[0]).length%l,d=h.length,v=0;v<d;v++)m+=h.charAt(v),!((v-y+1)%l)&&v<d-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?r+t[1]:"","0"!==(i=t.join(""))&&""!==i||(n=!1),p+(n?"-":"")+i+b}}));function jn(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Vn={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Bn=/%\)?$/,Hn=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,$n=/^\(oct\)/i,Wn=/^\(dec\)/i,Un=/^\(hex\)/i,Yn=/^\(bin\)/i,Gn=/^\(rom\)/i,Xn=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Kn=/#|0/g;function Zn(e,t,n,i){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",i||".")}function Jn(e,t,n){let i;return Hn.test(t)?e=Zn(e,Number(/\d{2}/.exec(t)[0]),t,n):$n.test(t)?e=Zn(e,8,t,n):Wn.test(t)?e=Zn(e,10,t,n):Un.test(t)?e=Zn(e,16,t,n):Yn.test(t)?e=Zn(e,2,t,n):Gn.test(t)&&(i="",e<0&&(i="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,i="",r=Number(String(e).slice(-3)),o=(e-r)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;r>0;)for(n=0;n<a.length;n++)if(a[n]<=r){i+=s[n],r-=a[n];break}for(n=0;n<o;n++)i="M".concat(i);return t[1]!==t[1].toUpperCase()&&(i=i.toLowerCase()),i}(e,t),e=i+e):e=t+i+e.toExponential(0)),e}function Qn(e,t,n){const i=jn(e);return n?i:new RegExp(i||"",t)}function ei(e,t,n,i){let r,o,a,s,l,c,u,h,d,f=e.pattern;var p,m;i&&(e.abbreviate=!0),p=t,(m=n)&&(m=jn(m)),p&&(p=jn(p)),d=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(r=a.split(n),o=r.pop(),a=r.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(Qn(c,"g"),t)),u=n,n=".",u&&(a=a.replace(Qn(u,"g"),n)),h=a.match(/#/g),h=h?h.length:0;const g=f.split(u);let y;g[1]&&(y=g[1].match(Kn)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=y?y.length:2,e.percentage=Bn.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Qn(t,null,!0),"|").concat(Qn(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=h}class ti{constructor(e,t,n,i,r){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=i||".",this.type=r||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return Vn;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new ti(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,i){return this.prepare(t,n,i),this.formatValue(e)}prepare(e,t,n){let i;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},i=this._prepared,e=e.split(this.patternSeparator),i.positive.pattern=e[0],i.negative.pattern=e[1],i.zero.pattern=e[2],Xn.test(e[0])&&(i.positive.isFunctional=!0),e[1]?Xn.test(e[1])&&(i.negative.isFunctional=!0):i.negative=!1,e[2]?Xn.test(e[2])&&(i.zero.isFunctional=!0):i.zero=!1;const r="U"===this.type;i.positive.isFunctional||ei(i.positive,t,n,r),i.negative&&!i.negative.isFunctional&&ei(i.negative,t,n,r),i.zero&&!i.zero.isFunctional&&ei(i.zero,t,n,r)}formatValue(e){let t,n,i,r,o,a,s,l,c,u=this._prepared,h="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=Jn(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let i,r,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(i=t[s-1]),i&&n>0&&i>0?r=i:(n<0&&i<0||!i)&&(o<0&&o-n<=u.maxPrecision?r=o:i<=n&&!(o>0&&-n<=u.maxPrecision)&&(r=i)),r&&(h=this.abbreviations[r],e/=10**r)}if(i=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),r=e,c||"#"!==l.slice(-1)[0])if(i>=1e15||i>0&&i<=1e-14)e=i?i.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Fn(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let r=("I"===this.type?0:i%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=r.length;s<n;s++)r+="0";r&&(e+=o+r)}else 0===t&&(r=0)}else if(i>=10**t||i<1||i<1e-4)0===e?e="0":i<1e-4||i>=1e20?(e=(e=r.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(i)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Fn(l,e)}e=e.replace(u.numericRegex,(e=>e===a?u.groupTemp:e===o?u.decTemp:"")),r<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+d+h+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function ni(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:i=!1,toKey:r=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=i?function(){return a=r(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=r(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function ii(e,t,n,i,r){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ti(...t)}(r,e,t,n,i),a=ni(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,i){return a.clear(),o.format(t,e,n,i)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const ri="D",oi="T",ai="TS",si="IV",li=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ci=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ui=["January","February","March","April","May","June","July","August","September","October","November","December"],hi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function di(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function fi(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function pi(e,t){let n,i=function(e){const t=e,n=24*fi(t),i=60*fi(n),r=60*fi(i),o=1e3*fi(r);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(i),s:Math.floor(r),f:Math.round(o)}}(e),r=i.d,o=i.h,a=i.m,s=i.s,l=i.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*r),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:r,h:o,m:a,s:s,f:l,t:u}}class mi{constructor(e,t,n){const i=e||{};if(i.qCalendarStrings||(i.qCalendarStrings={qLongDayNames:li,qDayNames:ci,qLongMonthNames:ui,qMonthNames:hi}),this.localeInfo=i,this.locale_days=i.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=i.qCalendarStrings.qDayNames.slice(),this.locale_months=i.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=i.qCalendarStrings.qMonthNames.slice(),!t){t={[oi]:i.qTimeFmt||"hh:mm:ss",[ri]:i.qDateFmt||"YYYY-MM-DD",[ai]:i.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new mi(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let i;e instanceof Date?i=function(e,t){let n=e.getUTCHours(),i=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),i<0&&(i=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:i,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),i=pi(e,t));const r=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:di("".concat(t.year).slice(-2),2),YYY:di("".concat(t.year).slice(-3),3),def:e=>di("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:di("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:di("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>di("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>di("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>di("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>di("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),i=e.length-n.length;if(i>0)for(let e=0;e<i;e++)n+="0";else i<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,i),o=[];for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,(e=>{let t,n,i;for(n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in r[n])if(t===e||t.toLowerCase()===e){i=r[n][t],void 0===i&&(i=r[n][t.toLowerCase()]);break}return void 0===i&&(i=r[n].def),"function"==typeof i&&(i=i(e)),i}));return s}}function gi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mi(...t)}function yi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=gi(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),i=ni(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function r(e){return t!==si?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=r(e),i(e)}return o.format=function(e,t){return i.clear(),t=r(t),n.format(t,e)},o.locale=function(r){return n=gi(r,e,t),i=ni(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,i.clear()),t},o}function xi(){let e,{meta:t,id:n,key:i,localeInfo:r,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",h=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return yi(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",i=t&&void 0!==t.qThousandSep?t.qThousandSep:",",r=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,i=e.qNumFormat.qThou||i,r=e.qNumFormat.qDec||r,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(r,"##"),o="U"),ii(n,i,r,o,t)}(t,r),d="dimension"===s?"first":(e,t)=>h(t),f={id:()=>n,key:()=>i,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:d,formatter:()=>h,tags:()=>t.qTags};return f}function vi(e,t,n,i,r){return(t[e]||[]).map(((t,o)=>{const a="".concat(i?"".concat(i,"/"):"").concat(e,"/").concat(o),s={instance:xi(tn({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},r))};return s.attrDims=vi("qAttrDimInfo",t,n,a,tn({},r,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=vi("qAttrExprInfo",t,n,a,tn({},r,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=vi("qMeasureInfo",t,n,a,tn({},r,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function bi(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},r=t;if(!r)throw new Error('Missing "data" input');if(!r.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=bi.util,a={cache:i,cube:r,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>r,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const i=n.allFields;if("function"==typeof e){for(let t=0;t<i.length;t++)if(e(i[t]))return i[t];return!1}if("string"==typeof e){for(let t=0;t<i.length;t++)if(i[t].key()===e||i[t].title()===e)return i[t]}else if(e&&-1!==i.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,s,i,o),hierarchy:e=>a.hierarchy(e,s,i,o),_cache:()=>i};"K"===r.qMode||"T"===r.qMode||!r.qMode&&r.qNodesOnDim?(a.extractor=zn,a.hierarchy=Tn,a.pages="K"===r.qMode?r.qStackedDataPages:r.qTreeDataPages):"S"===r.qMode?(a.extractor=an,a.pages=r.qDataPages,a.hierarchy=Tn):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,i,o);const l="S"===r.qMode?e=>e.qElemNumber:void 0,c="S"===r.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...vi("qDimensionInfo",r,e,"",tn({},a,{value:l,type:"dimension"}))),i.wrappedFields.push(...vi("qMeasureInfo",r,e,"",tn({},a,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const u=e=>{e.forEach((e=>{i.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)}))};return u(i.wrappedFields),(n.virtualFields||[]).forEach((t=>{const n=s.field(t.from),r=xi(Ut({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,i,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));i.virtualFields.push(r)})),i.allFields.push(...i.virtualFields),s}const wi=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],Mi=/\/qDimensionInfo(?:\/(\d+))?/,ki=/\/qMeasureInfo\/(\d+)/,Si=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,_i=/\/qAttrExprInfo\/(\d+)/,qi=/\/?qHyperCube/,Di=/\/?qTreeData/,Ai=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),Ci=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function Ni(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const i=t.byCells,r=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach((e=>{const t=function(e,t){let n=e,i=-1,r=-1,o="",a=e=>e;qi.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Ai):Di.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=Ci);let s=!0;if(Mi.test(e)&&(i=+Mi.exec(e)[1]),ki.test(e)&&(r=+ki.exec(e)[1]),Si.test(e)){r=-1,i=0;const e=+Si.exec(n)[2];isNaN(e)||(i=e,n=n.replace(/\/\d+$/,"")),s=!1}if(_i.test(e)){const e=r;if(t){r=0;const a=kn(o,t);r+=(a.qMeasureInfo||[]).length,i>-1?(r=a.qDimensionInfo.slice(0,i).reduce(((e,t)=>e+t.qAttrExprInfo.length),r),i=-1):(r=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),r),r=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),r)),r+=+_i.exec(n)[1]}else i>-1?(i=-1,r=+_i.exec(n)[1]):r+=+_i.exec(n)[1]+1}return wi.forEach((e=>{let[t,i]=e;n=n.replace(t,i)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:r,dimensionIdx:i,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(i)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const i=n.qHyperCube,o=i.qNoOfLeftDims,s=i.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===r||!r){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==r&&(r||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o}function Ei(e){bi.util=e.data("matrix").util,e.data("q",bi),e.formatter("q-number",ii),e.formatter("q-time",yi)}Ei.qBrushHelper=Ni,Ei.selections=Ni;var Ri=Object.prototype.hasOwnProperty,Ii=Object.prototype.toString,Oi=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,Li=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Ii.call(e)},Ti=function(e){if(!e||"[object Object]"!==Ii.call(e))return!1;var t,n=Ri.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&Ri.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!i)return!1;for(t in e);return void 0===t||Ri.call(e,t)},zi=function(e,t){Oi&&"__proto__"===t.name?Oi(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Fi=function(e,t){if("__proto__"===t){if(!Ri.call(e,t))return;if(Pi)return Pi(e,t).value}return e[t]},ji=function e(){var t,n,i,r,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)i=Fi(s,n),s!==(r=Fi(t,n))&&(u&&r&&(Ti(r)||(o=Li(r)))?(o?(o=!1,a=i&&Li(i)?i:[]):a=i&&Ti(i)?i:{},zi(s,{name:n,newValue:e(u,a,r)})):void 0!==r&&zi(s,{name:n,newValue:r}));return s},Vi="2.8.0";function Bi(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function $i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hi(Object(n),!0).forEach((function(t){Bi(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Wi(e){return!!e.changedTouches}function Ui(e){return"number"==typeof e&&!isNaN(e)}function Yi(e){return"number"!=typeof e||isNaN(e)}function Gi(e){const t=e.length;let n=NaN,i=NaN,r=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),i=isNaN(i)?e[a].x:Math.max(i,e[a].x),r=isNaN(r)?e[a].y:Math.min(r,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,r,i,o]}function Xi(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function Ki(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function Zi(e){const[t,n,i,r]=Gi(e);return{x:t,y:n,width:i-t,height:r-n}}function Ji(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function Qi(e){const{x:t,y:n,width:i,height:r,x1:o,x2:a,y1:s,y2:l,cx:c,cy:u,r:h,vertices:d}=e||{};return Ui(c)&&Ui(u)&&Ui(h)?"circle":Ui(o)&&Ui(a)&&Ui(s)&&Ui(l)?"line":Ui(t)&&Ui(n)&&Ui(i)&&Ui(r)?"rect":Ui(t)&&Ui(n)?"point":Array.isArray(d)?d.every((e=>Array.isArray(e)))?"geopolygon":"polygon":null}function er(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}var tr=Math.PI,nr=2*tr,ir=1e-6,rr=nr-ir;function or(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function ar(){return new or}function sr(e){return function(){return e}}or.prototype=ar.prototype={constructor:or,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,n,i){this._+="Q"+ +e+","+ +t+","+(this._x1=+n)+","+(this._y1=+i)},bezierCurveTo:function(e,t,n,i,r,o){this._+="C"+ +e+","+ +t+","+ +n+","+ +i+","+(this._x1=+r)+","+(this._y1=+o)},arcTo:function(e,t,n,i,r){e=+e,t=+t,n=+n,i=+i,r=+r;var o=this._x1,a=this._y1,s=n-e,l=i-t,c=o-e,u=a-t,h=c*c+u*u;if(r<0)throw new Error("negative radius: "+r);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=t);else if(h>ir)if(Math.abs(u*s-l*c)>ir&&r){var d=n-o,f=i-a,p=s*s+l*l,m=d*d+f*f,g=Math.sqrt(p),y=Math.sqrt(h),x=r*Math.tan((tr-Math.acos((p+h-m)/(2*g*y)))/2),v=x/y,b=x/g;Math.abs(v-1)>ir&&(this._+="L"+(e+v*c)+","+(t+v*u)),this._+="A"+r+","+r+",0,0,"+ +(u*d>c*f)+","+(this._x1=e+b*s)+","+(this._y1=t+b*l)}else this._+="L"+(this._x1=e)+","+(this._y1=t);else;},arc:function(e,t,n,i,r,o){e=+e,t=+t,o=!!o;var a=(n=+n)*Math.cos(i),s=n*Math.sin(i),l=e+a,c=t+s,u=1^o,h=o?i-r:r-i;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+l+","+c:(Math.abs(this._x1-l)>ir||Math.abs(this._y1-c)>ir)&&(this._+="L"+l+","+c),n&&(h<0&&(h=h%nr+nr),h>rr?this._+="A"+n+","+n+",0,1,"+u+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+u+","+(this._x1=l)+","+(this._y1=c):h>ir&&(this._+="A"+n+","+n+",0,"+ +(h>=tr)+","+u+","+(this._x1=e+n*Math.cos(r))+","+(this._y1=t+n*Math.sin(r))))},rect:function(e,t,n,i){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +i+"h"+-n+"Z"},toString:function(){return this._}};var lr=Math.abs,cr=Math.atan2,ur=Math.cos,hr=Math.max,dr=Math.min,fr=Math.sin,pr=Math.sqrt,mr=1e-12,gr=Math.PI,yr=gr/2,xr=2*gr;function vr(e){return e>=1?yr:e<=-1?-yr:Math.asin(e)}function br(e){return e.innerRadius}function wr(e){return e.outerRadius}function Mr(e){return e.startAngle}function kr(e){return e.endAngle}function Sr(e){return e&&e.padAngle}function _r(e,t,n,i,r,o,a){var s=e-n,l=t-i,c=(a?o:-o)/pr(s*s+l*l),u=c*l,h=-c*s,d=e+u,f=t+h,p=n+u,m=i+h,g=(d+p)/2,y=(f+m)/2,x=p-d,v=m-f,b=x*x+v*v,w=r-o,M=d*m-p*f,k=(v<0?-1:1)*pr(hr(0,w*w*b-M*M)),S=(M*v-x*k)/b,_=(-M*x-v*k)/b,q=(M*v+x*k)/b,D=(-M*x+v*k)/b,A=S-g,C=_-y,N=q-g,E=D-y;return A*A+C*C>N*N+E*E&&(S=q,_=D),{cx:S,cy:_,x01:-u,y01:-h,x11:S*(r/w-1),y11:_*(r/w-1)}}function qr(){var e=br,t=wr,n=sr(0),i=null,r=Mr,o=kr,a=Sr,s=null;function l(){var l,c,u=+e.apply(this,arguments),h=+t.apply(this,arguments),d=r.apply(this,arguments)-yr,f=o.apply(this,arguments)-yr,p=lr(f-d),m=f>d;if(s||(s=l=ar()),h<u&&(c=h,h=u,u=c),h>mr)if(p>xr-mr)s.moveTo(h*ur(d),h*fr(d)),s.arc(0,0,h,d,f,!m),u>mr&&(s.moveTo(u*ur(f),u*fr(f)),s.arc(0,0,u,f,d,m));else{var g,y,x=d,v=f,b=d,w=f,M=p,k=p,S=a.apply(this,arguments)/2,_=S>mr&&(i?+i.apply(this,arguments):pr(u*u+h*h)),q=dr(lr(h-u)/2,+n.apply(this,arguments)),D=q,A=q;if(_>mr){var C=vr(_/u*fr(S)),N=vr(_/h*fr(S));(M-=2*C)>mr?(b+=C*=m?1:-1,w-=C):(M=0,b=w=(d+f)/2),(k-=2*N)>mr?(x+=N*=m?1:-1,v-=N):(k=0,x=v=(d+f)/2)}var E=h*ur(x),R=h*fr(x),I=u*ur(w),O=u*fr(w);if(q>mr){var P,L=h*ur(v),T=h*fr(v),z=u*ur(b),F=u*fr(b);if(p<gr&&(P=function(e,t,n,i,r,o,a,s){var l=n-e,c=i-t,u=a-r,h=s-o,d=h*l-u*c;if(!(d*d<mr))return[e+(d=(u*(t-o)-h*(e-r))/d)*l,t+d*c]}(E,R,z,F,L,T,I,O))){var j=E-P[0],V=R-P[1],B=L-P[0],H=T-P[1],$=1/fr(function(e){return e>1?0:e<-1?gr:Math.acos(e)}((j*B+V*H)/(pr(j*j+V*V)*pr(B*B+H*H)))/2),W=pr(P[0]*P[0]+P[1]*P[1]);D=dr(q,(u-W)/($-1)),A=dr(q,(h-W)/($+1))}}k>mr?A>mr?(g=_r(z,F,E,R,h,A,m),y=_r(L,T,I,O,h,A,m),s.moveTo(g.cx+g.x01,g.cy+g.y01),A<q?s.arc(g.cx,g.cy,A,cr(g.y01,g.x01),cr(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,A,cr(g.y01,g.x01),cr(g.y11,g.x11),!m),s.arc(0,0,h,cr(g.cy+g.y11,g.cx+g.x11),cr(y.cy+y.y11,y.cx+y.x11),!m),s.arc(y.cx,y.cy,A,cr(y.y11,y.x11),cr(y.y01,y.x01),!m))):(s.moveTo(E,R),s.arc(0,0,h,x,v,!m)):s.moveTo(E,R),u>mr&&M>mr?D>mr?(g=_r(I,O,L,T,u,-D,m),y=_r(E,R,z,F,u,-D,m),s.lineTo(g.cx+g.x01,g.cy+g.y01),D<q?s.arc(g.cx,g.cy,D,cr(g.y01,g.x01),cr(y.y01,y.x01),!m):(s.arc(g.cx,g.cy,D,cr(g.y01,g.x01),cr(g.y11,g.x11),!m),s.arc(0,0,u,cr(g.cy+g.y11,g.cx+g.x11),cr(y.cy+y.y11,y.cx+y.x11),m),s.arc(y.cx,y.cy,D,cr(y.y11,y.x11),cr(y.y01,y.x01),!m))):s.arc(0,0,u,w,b,m):s.lineTo(I,O)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,i=(+r.apply(this,arguments)+ +o.apply(this,arguments))/2-gr/2;return[ur(i)*n,fr(i)*n]},l.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:sr(+t),l):e},l.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:sr(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:sr(+e),l):n},l.padRadius=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:sr(+e),l):i},l.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:sr(+e),l):r},l.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:sr(+e),l):o},l.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:sr(+e),l):a},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function Dr(e){this._context=e}function Ar(e){return new Dr(e)}function Cr(e){return e[0]}function Nr(e){return e[1]}function Er(){var e=Cr,t=null,n=sr(0),i=Nr,r=sr(!0),o=null,a=Ar,s=null;function l(l){var c,u,h,d,f,p=l.length,m=!1,g=new Array(p),y=new Array(p);for(null==o&&(s=a(f=ar())),c=0;c<=p;++c){if(!(c<p&&r(d=l[c],c,l))===m)if(m=!m)u=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=c-1;h>=u;--h)s.point(g[h],y[h]);s.lineEnd(),s.areaEnd()}m&&(g[c]=+e(d,c,l),y[c]=+n(d,c,l),s.point(t?+t(d,c,l):g[c],i?+i(d,c,l):y[c]))}if(f)return s=null,f+""||null}function c(){return function(){var e=Cr,t=Nr,n=sr(!0),i=null,r=Ar,o=null;function a(a){var s,l,c,u=a.length,h=!1;for(null==i&&(o=r(c=ar())),s=0;s<=u;++s)!(s<u&&n(l=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+e(l,s,a),+t(l,s,a));if(c)return o=null,c+""||null}return a.x=function(t){return arguments.length?(e="function"==typeof t?t:sr(+t),a):e},a.y=function(e){return arguments.length?(t="function"==typeof e?e:sr(+e),a):t},a.defined=function(e){return arguments.length?(n="function"==typeof e?e:sr(!!e),a):n},a.curve=function(e){return arguments.length?(r=e,null!=i&&(o=r(i)),a):r},a.context=function(e){return arguments.length?(null==e?i=o=null:o=r(i=e),a):i},a}().defined(r).curve(a).context(o)}return l.x=function(n){return arguments.length?(e="function"==typeof n?n:sr(+n),t=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:sr(+t),l):e},l.x1=function(e){return arguments.length?(t=null==e?null:"function"==typeof e?e:sr(+e),l):t},l.y=function(e){return arguments.length?(n="function"==typeof e?e:sr(+e),i=null,l):n},l.y0=function(e){return arguments.length?(n="function"==typeof e?e:sr(+e),l):n},l.y1=function(e){return arguments.length?(i=null==e?null:"function"==typeof e?e:sr(+e),l):i},l.lineX0=l.lineY0=function(){return c().x(e).y(n)},l.lineY1=function(){return c().x(e).y(i)},l.lineX1=function(){return c().x(t).y(n)},l.defined=function(e){return arguments.length?(r="function"==typeof e?e:sr(!!e),l):r},l.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),l):a},l.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),l):o},l}function Rr(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Ir(e){return e}Dr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Or=Array.prototype.slice;function Pr(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Lr(e){this._context=e}function Tr(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function zr(e,t){this._context=e,this._k=(1-t)/6}Lr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Pr(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Pr(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},zr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Tr(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Tr(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Fr=function e(t){function n(e){return new zr(e,t)}return n.tension=function(t){return e(+t)},n}(0);function jr(e,t){this._context=e,this._alpha=t}jr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var i=e._x1,r=e._y1,o=e._x2,a=e._y2;if(e._l01_a>mr){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>mr){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(i,r,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Vr=function e(t){function n(e){return t?new jr(e,t):new zr(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Br(e){return e<0?-1:1}function Hr(e,t,n){var i=e._x1-e._x0,r=t-e._x1,o=(e._y1-e._y0)/(i||r<0&&-0),a=(n-e._y1)/(r||i<0&&-0),s=(o*r+a*i)/(i+r);return(Br(o)+Br(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function $r(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Wr(e,t,n){var i=e._x0,r=e._y0,o=e._x1,a=e._y1,s=(o-i)/3;e._context.bezierCurveTo(i+s,r+s*t,o-s,a-s*n,o,a)}function Ur(e){this._context=e}function Yr(e){this._context=new Gr(e)}function Gr(e){this._context=e}function Xr(e){this._context=e}function Kr(e){var t,n,i=e.length-1,r=new Array(i),o=new Array(i),a=new Array(i);for(r[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<i-1;++t)r[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(r[i-1]=2,o[i-1]=7,a[i-1]=8*e[i-1]+e[i],t=1;t<i;++t)n=r[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(r[i-1]=a[i-1]/o[i-1],t=i-2;t>=0;--t)r[t]=(a[t]-r[t+1])/o[t];for(o[i-1]=(e[i]+r[i-1])/2,t=0;t<i-1;++t)o[t]=2*e[t+1]-r[t+1];return[r,o]}function Zr(e,t){this._context=e,this._t=t}function Jr(e,t){if((r=e.length)>1)for(var n,i,r,o=1,a=e[t[0]],s=a.length;o<r;++o)for(i=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(i[n][1])?i[n][0]:i[n][1]}function Qr(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function eo(e,t){return e[t]}function to(e){for(var t,n=-1,i=0,r=e.length,o=-1/0;++n<r;)(t=+e[n][1])>o&&(o=t,i=n);return i}function no(e){for(var t,n=0,i=-1,r=e.length;++i<r;)(t=+e[i][1])&&(n+=t);return n}function io(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",i=arguments.length>2?arguments[2]:void 0;const r={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in r)&&(r[e]=t,!0)}function s(e){return r[e]||o.get(e)}function l(e,r){if(void 0!==r)return a(e,r);const o=s(e);return i&&void 0===o&&i.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!r[e]||o.has(e)},l.remove=function(e){const t=r[e];return delete r[e],t},l.getKeys=function(){return Object.keys(r)},l.getValues=function(){return Object.keys(r).map((e=>r[e]))},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function ro(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function oo(e){return(e=ro(Math.abs(e)))?e[1]:NaN}Ur.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Wr(this,this._t0,$r(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Wr(this,$r(this,n=Hr(this,e,t)),n);break;default:Wr(this,this._t0,n=Hr(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(Yr.prototype=Object.create(Ur.prototype)).point=function(e,t){Ur.prototype.point.call(this,t,e)},Gr.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,o){this._context.bezierCurveTo(t,e,i,n,o,r)}},Xr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var i=Kr(e),r=Kr(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(i[0][o],r[0][o],i[1][o],r[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Zr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var ao,so=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lo(e){if(!(t=so.exec(e)))throw new Error("invalid format: "+e);var t;return new co({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function co(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function uo(e,t){var n=ro(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}lo.prototype=co.prototype,co.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var ho={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>uo(100*e,t),r:uo,s:function(e,t){var n=ro(e,t);if(!n)return e+"";var i=n[0],r=n[1],o=r-(ao=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,a=i.length;return o===a?i:o>a?i+new Array(o-a+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+ro(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function fo(e){return e}var po,mo,go,yo=Array.prototype.map,xo=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vo(e){var t,n,i=void 0===e.grouping||void 0===e.thousands?fo:(t=yo.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var r=e.length,o=[],a=0,s=t[0],l=0;r>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),o.push(e.substring(r-=s,r+s)),!((l+=s+1)>i));)s=t[a=(a+1)%t.length];return o.reverse().join(n)}),r=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?fo:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(yo.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=lo(e)).fill,n=e.align,h=e.sign,d=e.symbol,f=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,x=e.type;"n"===x?(m=!0,x="g"):ho[x]||(void 0===g&&(g=12),y=!0,x="g"),(f||"0"===t&&"="===n)&&(f=!0,t="0",n="=");var v="$"===d?r:"#"===d&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",b="$"===d?o:/[%p]/.test(x)?l:"",w=ho[x],M=/[defgprs%]/.test(x);function k(e){var r,o,l,d=v,k=b;if("c"===x)k=w(e)+k,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:w(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,r=-1;i<n;++i)switch(e[i]){case".":r=t=i;break;case"0":0===r&&(r=i),t=i;break;default:if(!+e[i])break e;r>0&&(r=0)}return r>0?e.slice(0,r)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==h&&(S=!1),d=(S?"("===h?h:c:"-"===h||"("===h?"":h)+d,k=("s"===x?xo[8+ao/3]:"")+k+(S&&"("===h?")":""),M)for(r=-1,o=e.length;++r<o;)if(48>(l=e.charCodeAt(r))||l>57){k=(46===l?a+e.slice(r+1):e.slice(r))+k,e=e.slice(0,r);break}}m&&!f&&(e=i(e,1/0));var _=d.length+e.length+k.length,q=_<p?new Array(p-_+1).join(t):"";switch(m&&f&&(e=i(q+e,q.length?p-k.length:1/0),q=""),n){case"<":e=d+e+k+q;break;case"=":e=d+q+e+k;break;case"^":e=q.slice(0,_=q.length>>1)+d+e+k+q.slice(_);break;default:e=q+d+e+k}return s(e)}return g=void 0===g?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var n=h(((e=lo(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(oo(t)/3))),r=Math.pow(10,-i),o=xo[8+i/3];return function(e){return n(r*e)+o}}}}!function(e){po=vo(e),mo=po.format,go=po.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const bo=new Date,wo=new Date;function Mo(e,t,n,i){function r(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return r.floor=t=>(e(t=new Date(+t)),t),r.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),r.round=e=>{const t=r(e),n=r.ceil(e);return e-t<n-e?t:n},r.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),r.range=(n,i,o)=>{const a=[];if(n=r.ceil(n),o=null==o?1:Math.floor(o),!(n<i&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<i);return a},r.filter=n=>Mo((t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)}),((e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})),n&&(r.count=(t,i)=>(bo.setTime(+t),wo.setTime(+i),e(bo),e(wo),Math.floor(n(bo,wo))),r.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?r.filter(i?t=>i(t)%e==0:t=>r.count(0,t)%e==0):r:null)),r}const ko=6e4,So=864e5,_o=6048e5,qo=Mo((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ko)/So),(e=>e.getDate()-1));qo.range;const Do=Mo((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/So),(e=>e.getUTCDate()-1));Do.range;const Ao=Mo((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/So),(e=>Math.floor(e/So)));function Co(e){return Mo((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ko)/_o))}Ao.range;const No=Co(0),Eo=Co(1),Ro=Co(2),Io=Co(3),Oo=Co(4),Po=Co(5),Lo=Co(6);function To(e){return Mo((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/_o))}No.range,Eo.range,Ro.range,Io.range,Oo.range,Po.range,Lo.range;const zo=To(0),Fo=To(1),jo=To(2),Vo=To(3),Bo=To(4),Ho=To(5),$o=To(6);zo.range,Fo.range,jo.range,Vo.range,Bo.range,Ho.range,$o.range;const Wo=Mo((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear()));Wo.every=e=>isFinite(e=Math.floor(e))&&e>0?Mo((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n*e)})):null,Wo.range;const Uo=Mo((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));function Yo(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Go(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Xo(e){let t,n,i;function r(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<0?r=t+1:o=t}while(r<o)}return r}return 2!==e.length?(t=Yo,n=(t,n)=>Yo(e(t),n),i=(t,n)=>e(t)-n):(t=e===Yo||e===Go?e:Ko,n=e,i=e),{left:r,center:function(e,t,n=0,o=e.length){const a=r(e,t,n,o-1);return a>n&&i(e[a-1],t)>-i(e[a],t)?a-1:a},right:function(e,i,r=0,o=e.length){if(r<o){if(0!==t(i,i))return o;do{const t=r+o>>>1;n(e[t],i)<=0?r=t+1:o=t}while(r<o)}return r}}}function Ko(){return 0}Uo.every=e=>isFinite(e=Math.floor(e))&&e>0?Mo((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)})):null,Uo.range;const Zo=Xo(Yo).right;Xo((function(e){return null===e?NaN:+e})).center;var Jo=Zo;class Qo extends Map{constructor(e,t=ta){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(ea(this,e))}has(e){return super.has(ea(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const i=t(n);e.has(i)&&(n=e.get(i),e.delete(i));return n}(this,e))}}function ea({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function ta(e){return null!==e&&"object"==typeof e?e.valueOf():e}const na=Math.sqrt(50),ia=Math.sqrt(10),ra=Math.sqrt(2);function oa(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),o=i/Math.pow(10,r),a=o>=na?10:o>=ia?5:o>=ra?2:1;let s,l,c;return r<0?(c=Math.pow(10,-r)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,r)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?oa(e,t,2*n):[s,l,c]}function aa(e,t,n){return oa(e=+e,t=+t,n=+n)[2]}function sa(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function la(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function ca(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ua(e){var t=e.dateTime,n=e.date,i=e.time,r=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=ya(r),u=xa(r),h=ya(o),d=xa(o),f=ya(a),p=xa(a),m=ya(s),g=xa(s),y=ya(l),x=xa(l),v={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Fa,e:Fa,f:$a,g:ts,G:is,H:ja,I:Va,j:Ba,L:Ha,m:Wa,M:Ua,p:function(e){return r[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:qs,s:Ds,S:Ya,u:Ga,U:Xa,V:Za,w:Ja,W:Qa,x:null,X:null,y:es,Y:ns,Z:rs,"%":_s},b={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:os,e:os,f:us,g:ws,G:ks,H:as,I:ss,j:ls,L:cs,m:hs,M:ds,p:function(e){return r[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:qs,s:Ds,S:fs,u:ps,U:ms,V:ys,w:xs,W:vs,x:null,X:null,y:bs,Y:Ms,Z:Ss,"%":_s},w={a:function(e,t,n){var i=f.exec(t.slice(n));return i?(e.w=p.get(i[0].toLowerCase()),n+i[0].length):-1},A:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=d.get(i[0].toLowerCase()),n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=x.get(i[0].toLowerCase()),n+i[0].length):-1},B:function(e,t,n){var i=m.exec(t.slice(n));return i?(e.m=g.get(i[0].toLowerCase()),n+i[0].length):-1},c:function(e,n,i){return S(e,t,n,i)},d:Ca,e:Ca,f:Pa,g:_a,G:Sa,H:Ea,I:Ea,j:Na,L:Oa,m:Aa,M:Ra,p:function(e,t,n){var i=c.exec(t.slice(n));return i?(e.p=u.get(i[0].toLowerCase()),n+i[0].length):-1},q:Da,Q:Ta,s:za,S:Ia,u:ba,U:wa,V:Ma,w:va,W:ka,x:function(e,t,i){return S(e,n,t,i)},X:function(e,t,n){return S(e,i,t,n)},y:_a,Y:Sa,Z:qa,"%":La};function M(e,t){return function(n){var i,r,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(r=ha[i=e.charAt(++s)])?i=e.charAt(++s):r="e"===i?" ":"0",(o=t[i])&&(i=o(n,r)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function k(e,t){return function(n){var i,r,o=ca(1900,void 0,1);if(S(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(r=(i=la(ca(o.y,0,1))).getUTCDay(),i=r>4||0===r?Fo.ceil(i):Fo(i),i=Do.offset(i,7*(o.V-1)),o.y=i.getUTCFullYear(),o.m=i.getUTCMonth(),o.d=i.getUTCDate()+(o.w+6)%7):(r=(i=sa(ca(o.y,0,1))).getDay(),i=r>4||0===r?Eo.ceil(i):Eo(i),i=qo.offset(i,7*(o.V-1)),o.y=i.getFullYear(),o.m=i.getMonth(),o.d=i.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),r="Z"in o?la(ca(o.y,0,1)).getUTCDay():sa(ca(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(r+5)%7:o.w+7*o.U-(r+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,la(o)):sa(o)}}function S(e,t,n,i){for(var r,o,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(r=t.charCodeAt(a++))){if(r=t.charAt(a++),!(o=w[r in ha?t.charAt(a++):r])||(i=o(e,n,i))<0)return-1}else if(r!=n.charCodeAt(i++))return-1}return i}return v.x=M(n,v),v.X=M(i,v),v.c=M(t,v),b.x=M(n,b),b.X=M(i,b),b.c=M(t,b),{format:function(e){var t=M(e+="",v);return t.toString=function(){return e},t},parse:function(e){var t=k(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},utcParse:function(e){var t=k(e+="",!0);return t.toString=function(){return e},t}}}var ha={"-":"",_:" ",0:"0"},da=/^\s*\d+/,fa=/^%/,pa=/[\\^$*+?|[\]().{}]/g;function ma(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",o=r.length;return i+(o<n?new Array(n-o+1).join(t)+r:r)}function ga(e){return e.replace(pa,"\\$&")}function ya(e){return new RegExp("^(?:"+e.map(ga).join("|")+")","i")}function xa(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function va(e,t,n){var i=da.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function ba(e,t,n){var i=da.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function wa(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function Ma(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function ka(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Sa(e,t,n){var i=da.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function _a(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function qa(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Da(e,t,n){var i=da.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function Aa(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function Ca(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function Na(e,t,n){var i=da.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function Ea(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function Ra(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Ia(e,t,n){var i=da.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Oa(e,t,n){var i=da.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Pa(e,t,n){var i=da.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function La(e,t,n){var i=fa.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Ta(e,t,n){var i=da.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function za(e,t,n){var i=da.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Fa(e,t){return ma(e.getDate(),t,2)}function ja(e,t){return ma(e.getHours(),t,2)}function Va(e,t){return ma(e.getHours()%12||12,t,2)}function Ba(e,t){return ma(1+qo.count(Wo(e),e),t,3)}function Ha(e,t){return ma(e.getMilliseconds(),t,3)}function $a(e,t){return Ha(e,t)+"000"}function Wa(e,t){return ma(e.getMonth()+1,t,2)}function Ua(e,t){return ma(e.getMinutes(),t,2)}function Ya(e,t){return ma(e.getSeconds(),t,2)}function Ga(e){var t=e.getDay();return 0===t?7:t}function Xa(e,t){return ma(No.count(Wo(e)-1,e),t,2)}function Ka(e){var t=e.getDay();return t>=4||0===t?Oo(e):Oo.ceil(e)}function Za(e,t){return e=Ka(e),ma(Oo.count(Wo(e),e)+(4===Wo(e).getDay()),t,2)}function Ja(e){return e.getDay()}function Qa(e,t){return ma(Eo.count(Wo(e)-1,e),t,2)}function es(e,t){return ma(e.getFullYear()%100,t,2)}function ts(e,t){return ma((e=Ka(e)).getFullYear()%100,t,2)}function ns(e,t){return ma(e.getFullYear()%1e4,t,4)}function is(e,t){var n=e.getDay();return ma((e=n>=4||0===n?Oo(e):Oo.ceil(e)).getFullYear()%1e4,t,4)}function rs(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ma(t/60|0,"0",2)+ma(t%60,"0",2)}function os(e,t){return ma(e.getUTCDate(),t,2)}function as(e,t){return ma(e.getUTCHours(),t,2)}function ss(e,t){return ma(e.getUTCHours()%12||12,t,2)}function ls(e,t){return ma(1+Do.count(Uo(e),e),t,3)}function cs(e,t){return ma(e.getUTCMilliseconds(),t,3)}function us(e,t){return cs(e,t)+"000"}function hs(e,t){return ma(e.getUTCMonth()+1,t,2)}function ds(e,t){return ma(e.getUTCMinutes(),t,2)}function fs(e,t){return ma(e.getUTCSeconds(),t,2)}function ps(e){var t=e.getUTCDay();return 0===t?7:t}function ms(e,t){return ma(zo.count(Uo(e)-1,e),t,2)}function gs(e){var t=e.getUTCDay();return t>=4||0===t?Bo(e):Bo.ceil(e)}function ys(e,t){return e=gs(e),ma(Bo.count(Uo(e),e)+(4===Uo(e).getUTCDay()),t,2)}function xs(e){return e.getUTCDay()}function vs(e,t){return ma(Fo.count(Uo(e)-1,e),t,2)}function bs(e,t){return ma(e.getUTCFullYear()%100,t,2)}function ws(e,t){return ma((e=gs(e)).getUTCFullYear()%100,t,2)}function Ms(e,t){return ma(e.getUTCFullYear()%1e4,t,4)}function ks(e,t){var n=e.getUTCDay();return ma((e=n>=4||0===n?Bo(e):Bo.ceil(e)).getUTCFullYear()%1e4,t,4)}function Ss(){return"+0000"}function _s(){return"%"}function qs(e){return+e}function Ds(e){return Math.floor(+e/1e3)}const As=io();As("d3-number",(function(e,t,n){let i,r;function o(e){return r(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return i=vo(t),r=i.format(e),this},a(),o.format=function(e,r,o,s){return(o||s)&&(t=o,n=s,a()),i.format(e)(r)},o.pattern=function(t){return t&&(e=t,r=i.format(t)),e},o})),As("d3-time",(function(e){let t=ua({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function i(e){return n(e)}return i.format=function(e,n){return t.format(e)(n)},i.locale=function(){return t=ua(...arguments),n=t.format(e),this},i.parse=function(e,n){return t.parse(e)(n)},i.parsePattern=function(e){return t.parse(e)},i}));const Cs={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return As(t.type||"d3-number")(t.format||"")})(e)};function Ns(e){let{id:t=Cs.id,key:n=Cs.key,min:i=Cs.min,max:r=Cs.max,type:o=Cs.type,tags:a=Cs.tags,title:s=Cs.title,values:l=Cs.values,value:c=Cs.value,label:u=Cs.label,formatter:h=Cs.formatter}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{id:()=>t(e),key:()=>n(e),raw:()=>e,tags:()=>a(e),type:()=>o(e),min:()=>i(e),max:()=>r(e),title:()=>s(e),items:()=>l(e),formatter:()=>h(e),value:c,label:u}}const Es=e=>e.filter((e=>"number"==typeof e&&!isNaN(e))),Rs=e=>e.reduce(((e,t)=>e+t),0),Is={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=Es(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=Es(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=Es(e);return t.length?t.reduce(((e,t)=>e+t),0):NaN},avg:e=>{const t=Es(e),n=t.length;return n?Rs(t)/n:NaN}};function Os(e,t,n,i){const r={},o=i.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach((a=>{const s=n[a],l=r[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map((n=>Os(e,t,{main:n},i).main)):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=Is[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?Is[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=Is[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?Is[l.field.reduceLabel]:l.field.reduceLabel))})),r}function Ps(e,t){const{main:n}=Os(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{});return{props:Os(e,t,e.props||{},n),main:n}}function Ls(e,t,n,i){const r=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=i?e[t][i]:e[t],r[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(r):r,u={value:c,label:l?l(o,c):n?n(c):String(c)};return i&&e[0][i].source?(u.source=e[0][i].source,u):!i&&e[0].source?(u.source=e[0].source,u):u}function Ts(e,t){let{main:n,propsArr:i,props:r}=t,o=[];const a=n.field.formatter(),s={};return i.forEach((e=>{s[e]=r[e].field?r[e].field.formatter():e=>e})),o.push(...e.map((e=>{const t=Ls(e.items,n,a);return i.forEach((n=>{t[n]=Ls(e.items,r[n],s[n],n)})),t}))),o}function zs(e){let{cfg:t,itemData:n,obj:i,target:r,tracker:o,trackType:a}=e;const s="function"===a?t.trackBy(n):n[t.trackBy];let l=o[s];l||(l=o[s]={items:[],id:s},r.push(l)),l.items.push(i)}function Fs(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let i=0;i<n;i++)t<e[i]&&(t=e[i]);return t}function js(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let i=0;i<n;i++)t>e[i]&&(t=e[i]);return t}const Vs={diverging:function(e,t){if((s=e.length)>0)for(var n,i,r,o,a,s,l=0,c=e[t[0]].length;l<c;++l)for(o=a=0,n=0;n<s;++n)(r=(i=e[t[n]][l])[1]-i[0])>=0?(i[0]=o,i[1]=o+=r):r<0?(i[1]=a,i[0]=a+=r):i[0]=o},none:Jr,silhouette:function(e,t){if((n=e.length)>0){for(var n,i=0,r=e[t[0]],o=r.length;i<o;++i){for(var a=0,s=0;a<n;++a)s+=e[a][i][1]||0;r[i][1]+=r[i][0]=-s/2}Jr(e,t)}},expand:function(e,t){if((i=e.length)>0){for(var n,i,r,o=0,a=e[0].length;o<a;++o){for(r=n=0;n<i;++n)r+=e[n][o][1]||0;if(r)for(n=0;n<i;++n)e[n][o][1]/=r}Jr(e,t)}},wiggle:function(e,t){if((r=e.length)>0&&(i=(n=e[t[0]]).length)>0){for(var n,i,r,o=0,a=1;a<i;++a){for(var s=0,l=0,c=0;s<r;++s){for(var u=e[t[s]],h=u[a][1]||0,d=(h-(u[a-1][1]||0))/2,f=0;f<s;++f){var p=e[t[f]];d+=(p[a][1]||0)-(p[a-1][1]||0)}l+=h,c+=d*h}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,Jr(e,t)}}},Bs={ascending:function(e){var t=e.map(no);return Qr(e).sort((function(e,n){return t[e]-t[n]}))},insideout:function(e){var t,n,i=e.length,r=e.map(no),o=function(e){var t=e.map(to);return Qr(e).sort((function(e,n){return t[e]-t[n]}))}(e),a=0,s=0,l=[],c=[];for(t=0;t<i;++t)n=o[t],a<s?(a+=r[n],l.push(n)):(s+=r[n],c.push(n));return c.reverse().concat(l)},none:Qr,reverse:function(e){return Qr(e).reverse()}};function Hs(e,t,n){const i={},r=t.stackKey,o=t.value,a=t.startProp||"start",s=t.endProp||"end",l=t.offset||"none",c=t.order||"none",u=t.valueRef||"";let h=0,d={};for(let t=0;t<e.items.length;t++){let n=e.items[t],o=u?n[u]:null;if(o&&o.source){let e="".concat(o.source.key||"","/").concat(o.source.field);d[e]||(d[e]=o.source)}let a=r(n);i[a]=i[a]||{items:[]},i[a].items.push(n),h=Math.max(h,i[a].items.length)}const f=Array.apply(null,{length:h}).map(Number.call,Number),p=Object.keys(i).map((e=>i[e].items)),m=function(){var e=sr([]),t=Qr,n=Jr,i=eo;function r(r){var o,a,s=e.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(o=0;o<c;++o){for(var h,d=s[o],f=u[o]=new Array(l),p=0;p<l;++p)f[p]=h=[0,+i(r[p],d,p,r)],h.data=r[p];f.key=d}for(o=0,a=t(u);o<c;++o)u[a[o]].index=o;return n(u,a),u}return r.keys=function(t){return arguments.length?(e="function"==typeof t?t:sr(Or.call(t)),r):e},r.value=function(e){return arguments.length?(i="function"==typeof e?e:sr(+e),r):i},r.order=function(e){return arguments.length?(t=null==e?Qr:"function"==typeof e?e:sr(Or.call(e)),r):t},r.offset=function(e){return arguments.length?(n=null==e?Jr:e,r):n},r}().keys(f).value(((e,t)=>e[t]?o(e[t]):0)).order(Bs[c]).offset(Vs[l]);let g=m(p),y=[];for(let e=0;e<g.length;e++){let t=g[e];for(let e=0;e<t.length;e++){let n=t[e],i=t[e].data[t.key];i&&(i[a]={value:n[0]},i[s]={value:n[1]},y.push(n[0],n[1]))}}let x=Object.keys(d).map((e=>{let t=n(d[e].key);return t?t.field(d[e].field):null})).filter((e=>!!e));const v=Ns({title:x.map((e=>e.title())).join(", "),min:js(y),max:Fs(y),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(v)}function $s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map((e=>({value:e,label:String(e)})));else if(e){if("collection"in e)n=$i({},t.collection(e.collection));else{const r=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)i.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=r.hierarchy?r.hierarchy(e.hierarchy):null,n.fields=r.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map((e=>({value:o(e),label:String(a(e))})));else if(e.extract){const i=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];i.forEach((e=>{const i=e.source?t.dataset(e.source):r;i&&(n.items=[...n.items,...i.extract(e)],void 0!==e.field&&o.push(i.field(e.field)))})),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&r){const t=r.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map((t=>({value:o(t),label:String(a(t)),source:{field:e.field}}))))}else e.fields&&e.fields.forEach((e=>{const i="object"==typeof e&&e.source?t.dataset(e.source):r;if(!i)return;let o;o="object"==typeof e&&void 0!==e.field?i.field(e.field):i.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))}));n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&Hs(n,e.stack,t.dataset)}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function Ws(e,t,n){let i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$s;if(e.data){const i=r(e.data,t,n);if(i&&i.fields&&i.fields[0])return i.fields[0].formatter()}if(i=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(i)){return n.formatter.get(i)(e.format||"")}throw new Error("Formatter of type '".concat(i,"' was not found"))}function Us(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const Ys=Symbol("implicit");function Gs(){var e=new Qo,t=[],n=[],i=Ys;function r(r){let o=e.get(r);if(void 0===o){if(i!==Ys)return i;e.set(r,o=t.push(r)-1)}return n[o%n.length]}return r.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Qo;for(const i of n)e.has(i)||e.set(i,t.push(i)-1);return r},r.range=function(e){return arguments.length?(n=Array.from(e),r):n.slice()},r.unknown=function(e){return arguments.length?(i=e,r):i},r.copy=function(){return Gs(t,n).unknown(i)},Us.apply(r,arguments),r}function Xs(){var e,t,n=Gs().unknown(void 0),i=n.domain,r=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function h(){var n=i().length,h=a<o,d=h?a:o,f=h?o:a;e=(f-d)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),d+=(f-d-e*(n-l))*u,t=e*(1-l),s&&(d=Math.round(d),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(r);++i<r;)o[i]=e+i*n;return o}(n).map((function(t){return d+e*t}));return r(h?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(i(e),h()):i()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,h()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,h()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,h()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),h()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),h()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,h()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),h()):u},n.copy=function(){return Xs(i(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},Us.apply(h(),arguments)}function Ks(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Zs(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Js(){}var Qs=.7,el=1/Qs,tl="\\s*([+-]?\\d+)\\s*",nl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",il="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rl=/^#([0-9a-f]{3,8})$/,ol=new RegExp(`^rgb\\(${tl},${tl},${tl}\\)$`),al=new RegExp(`^rgb\\(${il},${il},${il}\\)$`),sl=new RegExp(`^rgba\\(${tl},${tl},${tl},${nl}\\)$`),ll=new RegExp(`^rgba\\(${il},${il},${il},${nl}\\)$`),cl=new RegExp(`^hsl\\(${nl},${il},${il}\\)$`),ul=new RegExp(`^hsla\\(${nl},${il},${il},${nl}\\)$`),hl={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function dl(){return this.rgb().formatHex()}function fl(){return this.rgb().formatRgb()}function pl(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=rl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ml(t):3===n?new xl(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?gl(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?gl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=ol.exec(e))?new xl(t[1],t[2],t[3],1):(t=al.exec(e))?new xl(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=sl.exec(e))?gl(t[1],t[2],t[3],t[4]):(t=ll.exec(e))?gl(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=cl.exec(e))?Sl(t[1],t[2]/100,t[3]/100,1):(t=ul.exec(e))?Sl(t[1],t[2]/100,t[3]/100,t[4]):hl.hasOwnProperty(e)?ml(hl[e]):"transparent"===e?new xl(NaN,NaN,NaN,0):null}function ml(e){return new xl(e>>16&255,e>>8&255,255&e,1)}function gl(e,t,n,i){return i<=0&&(e=t=n=NaN),new xl(e,t,n,i)}function yl(e,t,n,i){return 1===arguments.length?function(e){return e instanceof Js||(e=pl(e)),e?new xl((e=e.rgb()).r,e.g,e.b,e.opacity):new xl}(e):new xl(e,t,n,null==i?1:i)}function xl(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function vl(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}`}function bl(){const e=wl(this.opacity);return`${1===e?"rgb(":"rgba("}${Ml(this.r)}, ${Ml(this.g)}, ${Ml(this.b)}${1===e?")":`, ${e})`}`}function wl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ml(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kl(e){return((e=Ml(e))<16?"0":"")+e.toString(16)}function Sl(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ql(e,t,n,i)}function _l(e){if(e instanceof ql)return new ql(e.h,e.s,e.l,e.opacity);if(e instanceof Js||(e=pl(e)),!e)return new ql;if(e instanceof ql)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new ql(a,s,l,e.opacity)}function ql(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Dl(e){return(e=(e||0)%360)<0?e+360:e}function Al(e){return Math.max(0,Math.min(1,e||0))}function Cl(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Ks(Js,pl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dl,formatHex:dl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return _l(this).formatHsl()},formatRgb:fl,toString:fl}),Ks(xl,yl,Zs(Js,{brighter(e){return e=null==e?el:Math.pow(el,e),new xl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Qs:Math.pow(Qs,e),new xl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xl(Ml(this.r),Ml(this.g),Ml(this.b),wl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vl,formatHex:vl,formatHex8:function(){return`#${kl(this.r)}${kl(this.g)}${kl(this.b)}${kl(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:bl,toString:bl})),Ks(ql,(function(e,t,n,i){return 1===arguments.length?_l(e):new ql(e,t,n,null==i?1:i)}),Zs(Js,{brighter(e){return e=null==e?el:Math.pow(el,e),new ql(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Qs:Math.pow(Qs,e),new ql(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new xl(Cl(e>=240?e-240:e+120,r,i),Cl(e,r,i),Cl(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new ql(Dl(this.h),Al(this.s),Al(this.l),wl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wl(this.opacity);return`${1===e?"hsl(":"hsla("}${Dl(this.h)}, ${100*Al(this.s)}%, ${100*Al(this.l)}%${1===e?")":`, ${e})`}`}}));var Nl=e=>()=>e;function El(e){return 1==(e=+e)?Rl:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):Nl(isNaN(t)?n:t)}}function Rl(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Nl(isNaN(e)?t:e)}var Il=function e(t){var n=El(t);function i(e,t){var i=n((e=yl(e)).r,(t=yl(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=Rl(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Ol(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,r=t.slice();return function(o){for(n=0;n<i;++n)r[n]=e[n]*(1-o)+t[n]*o;return r}}function Pl(e,t){var n,i=t?t.length:0,r=e?Math.min(i,e.length):0,o=new Array(r),a=new Array(i);for(n=0;n<r;++n)o[n]=Bl(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<r;++n)a[n]=o[n](e);return a}}function Ll(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function Tl(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function zl(e,t){var n,i={},r={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=Bl(e[n],t[n]):r[n]=t[n];return function(e){for(n in i)r[n]=i[n](e);return r}}var Fl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,jl=new RegExp(Fl.source,"g");function Vl(e,t){var n,i,r,o=Fl.lastIndex=jl.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Fl.exec(e))&&(i=jl.exec(t));)(r=i.index)>o&&(r=t.slice(o,r),s[a]?s[a]+=r:s[++a]=r),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Tl(n,i)})),o=jl.lastIndex;return o<t.length&&(r=t.slice(o),s[a]?s[a]+=r:s[++a]=r),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}function Bl(e,t){var n,i=typeof t;return null==t||"boolean"===i?Nl(t):("number"===i?Tl:"string"===i?(n=pl(t))?(t=n,Il):Vl:t instanceof pl?Il:t instanceof Date?Ll:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Ol:Array.isArray(t)?Pl:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?zl:Tl)(e,t)}function Hl(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function $l(e){return+e}var Wl=[0,1];function Ul(e){return e}function Yl(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Gl(e,t,n){var i=e[0],r=e[1],o=t[0],a=t[1];return r<i?(i=Yl(r,i),o=n(a,o)):(i=Yl(i,r),o=n(o,a)),function(e){return o(i(e))}}function Xl(e,t,n){var i=Math.min(e.length,t.length)-1,r=new Array(i),o=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)r[a]=Yl(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Jo(e,t,1,i)-1;return o[n](r[n](t))}}function Kl(){var e,t,n,i,r,o,a=Wl,s=Wl,l=Bl,c=Ul;function u(){var e=Math.min(a.length,s.length);return c!==Ul&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),i=e>2?Xl:Gl,r=o=null,h}function h(t){return null==t||isNaN(t=+t)?n:(r||(r=i(a.map(e),s,l)))(e(c(t)))}return h.invert=function(n){return c(t((o||(o=i(s,a.map(e),Tl)))(n)))},h.domain=function(e){return arguments.length?(a=Array.from(e,$l),u()):a.slice()},h.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},h.rangeRound=function(e){return s=Array.from(e),l=Hl,u()},h.clamp=function(e){return arguments.length?(c=!!e||Ul,u()):c!==Ul},h.interpolate=function(e){return arguments.length?(l=e,u()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,i){return e=n,t=i,u()}}function Zl(e,t,n,i){var r,o=function(e,t,n){n=+n;const i=(t=+t)<(e=+e),r=i?aa(t,e,n):aa(e,t,n);return(i?-1:1)*(r<0?1/-r:r)}(e,t,n);switch((i=lo(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(r=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(oo(t)/3)))-oo(Math.abs(e)))}(o,a))||(i.precision=r),go(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(r=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,oo(t)-oo(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=r-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(r=function(e){return Math.max(0,-oo(Math.abs(e)))}(o))||(i.precision=r-2*("%"===i.type))}return mo(i)}function Jl(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const i=t<e,[r,o,a]=i?oa(t,e,n):oa(e,t,n);if(!(o>=r))return[];const s=o-r+1,l=new Array(s);if(i)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(r+e)/-a;else for(let e=0;e<s;++e)l[e]=(r+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return Zl(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,r,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(r=l,l=c,c=r,r=a,a=s,s=r);u-- >0;){if((r=aa(l,c,n))===i)return o[a]=l,o[s]=c,t(o);if(r>0)l=Math.floor(l/r)*r,c=Math.ceil(c/r)*r;else{if(!(r<0))break;l=Math.ceil(l*r)/r,c=Math.floor(c*r)/r}i=r}return e},e}function Ql(){var e=Kl()(Ul,Ul);return e.copy=function(){return t=e,Ql().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},Us.apply(e,arguments),Jl(e)}function ec(){var e,t=[.5],n=[0,1],i=1;function r(r){return null!=r&&r<=r?n[Jo(t,r,0,i)]:e}return r.domain=function(e){return arguments.length?(t=Array.from(e),i=Math.min(t.length,n.length-1),r):t.slice()},r.range=function(e){return arguments.length?(n=Array.from(e),i=Math.min(t.length,n.length-1),r):n.slice()},r.invertExtent=function(e){var i=n.indexOf(e);return[t[i-1],t[i]]},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return ec().domain(t).range(n).unknown(e)},Us.apply(r,arguments)}function tc(e){return void 0===e?e=>e:t=>e(t)}function nc(e){return Math.max(0,Math.min(1,e))}function ic(e){return"object"==typeof e}function rc(e,t,n){const i=Math.abs(t-n)/(e+1),r=[];for(let o=1;o<=e;o++){const e=o*i;r.push(t<n?t+e:t-e)}return r}function oc(e,t,n){if(1===e.length)return e;const i=e.concat([]);for(let r=0;r<e.length;r++){let o=e[r],a=e[r+1];0===r&&o!==n.start()?(i.push(...rc(t,o,a)),o-=a-o,a=e[r],i.push(...rc(t,o,a))):r===e.length-1&&a!==n.end()?(a=o+(o-e[r-1]),i.push(...rc(t,o,a))):i.push(...rc(t,o,a))}return i.filter((e=>e>=n.min()&&e<=n.max()))}function ac(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=Yi(r)||Yi(t)?2:Math.max(t/r,2),s=Math.min(1e3,Math.round(a));let l=n.ticks(s);l.length<=1&&(l=n.ticks(s+1));const c=i>0?oc(l,i,n):l;c.sort(((e,t)=>e-t));const u=c.map(tc(o));return c.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:u[t],value:e,isMinor:-1===l.indexOf(e)}}))}function sc(e){let{distance:t,scale:n,minorCount:i=0,unitDivider:r=100,formatter:o}=e;const a=Yi(r)||Yi(t)?2:Math.max(t/r,2),s=Math.min(1e3,Math.round(a)),l=s>10?10:s;n.nice(l);const c=n.ticks(s),u=i>0?oc(c,i,n):c;u.sort(((e,t)=>e-t));const h=u.map(tc(o));return u.map(((e,t)=>{const i=n(e);return{position:i,start:i,end:i,label:h[t],value:e,isMinor:-1===c.indexOf(e)}}))}function lc(e){let t,{settings:n,scale:i,distance:r,formatter:o=e=>e}=e;const a=n.minorTicks&&!Yi(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter((e=>"object"==typeof e?!Yi(e.value):!Yi(e)));t=function(e){let{values:t,scale:n,formatter:i=e=>e}=e;return t.sort(((e,t)=>(ic(e)?e.value:e)-(ic(t)?t.value:t))).filter(((e,t,i)=>{const r=ic(e)?e.value:e;return r<=n.max()&&r>=n.min()&&i.indexOf(e)===t})).map((e=>{const t=ic(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?nc(n(e.start)):o,end:t&&!isNaN(e.end)?nc(n(e.end)):o}}))}({values:e,scale:i.copy(),formatter:o})}else if(Yi(n.ticks.count)){t=(n.ticks.tight?sc:ac)({distance:r,minorCount:a,unitDivider:n.ticks.distance,scale:i,formatter:o}),n.ticks.forceBounds&&function(e,t,n){const i=e.map((e=>e.position)),r=t.range();-1===i.indexOf(r[0])?e.splice(0,0,{position:r[0],start:r[0],end:r[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===i.indexOf(r[1])?e.push({position:r[1],start:r[1],end:r[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,i,o)}else{t=function(e){let{count:t,minorCount:n,scale:i,formatter:r}=e;return i.ticks((t-1)*n+t).map(((e,t)=>{const o=i(e);return{position:o,start:o,end:o,label:r(e),isMinor:t%(n+1)!=0,value:e}}))}({count:Math.min(1e3,n.ticks.count),minorCount:a,scale:i.copy(),formatter:o})}return t}function cc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={};return Object.keys(t).forEach((r=>{const o=typeof e[r];i[r]="function"===o?e[r](n):"undefined"===o?t[r]:e[r]})),i}const uc={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},hc={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},dc={count:NaN};function fc(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function pc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Ql(),r={instance:null,invert:!1},o={data:t,resources:n},a=cc(e,uc,o);let s;function l(e){return Yi(e)?NaN:i(e)}a.ticks=cc(e.ticks,hc,o),a.minorTicks=cc(e.minorTicks,dc,o),l.data=()=>t,l.invert=function(e){return i.invert(e)},l.rangeRound=function(e){return i.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return i.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=ji(!0,{},a,e.settings),e.scale=l,s=lc(e),s):(s=i.ticks(e),s)},l.nice=function(e){return i.nice(e),l},l.tickFormat=function(e,t){return i.tickFormat(e,t)},l.interpolate=function(e){return i.interpolate(e),l},l.domain=function(e){return arguments.length?(i.domain(e),r.instance&&r.instance.domain([l.start(),l.end()]),l):i.domain()},l.range=function(e){return arguments.length?(i.range(e),l):i.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],i=[],r=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+r);n.push(o,o),i.push(a,a)}return n.pop(),l.domain(n),l.range(i),l},l.copy=function(){const r=pc(e,t,n);return r.domain(l.domain()),r.range(l.range()),r.clamp(i.clamp()),r},l.norm=function(e){return fc(r,l),r.instance(e)},l.normInvert=function(e){return fc(r,l),r.instance.invert(e)};const{mini:c,maxi:u}=function(e,t){const n=+e.min,i=+e.max;let r=0,o=1;if(t&&t[0]){const n=t.map((e=>e.min())).filter((e=>!isNaN(e))),i=t.map((e=>e.max())).filter((e=>!isNaN(e)));if(r=n.length?Math.min(...n):Number.NaN,o=i.length?Math.max(...i):Number.NaN,isNaN(r)||isNaN(o))r=-1,o=1;else if(r===o&&0===r)r=-1,o=1;else if(r===o&&r)r-=Math.abs(.1*r),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-r;r-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter((e=>!isNaN(e)));r=Math.min(...t,r),o=Math.max(...t,o)}}return{mini:isNaN(n)?r:n,maxi:isNaN(i)?o:i}}(a,t?t.fields:[]);return l.domain([c,u]),l.range(a.invert?[1,0]:[0,1]),r.invert=a.invert,l}const mc={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function gc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},i=cc(e,mc,n),r=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>r[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let{scale:t}=e;const n=t.domain(),i=t.data().items,r=t.labels?t.labels():n,o=t.bandwidth();return n.map(((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(r[n]),data:i?i[n]:void 0,start:a,end:a+o}}))}(t,n.trackBy)}}const c=Xs();l(c,e),c.pxScale=function(t){const n=i.maxPxStep;if(isNaN(n))return c;const r=c.domain().length,o=Math.max(1,r-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(i.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,h="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<r.length;e++){const t=ji({datum:r[e]},n),i=u(t,e);-1===a.indexOf(i)&&(a.push(i),s.push(h(t,e)),o[i]=e)}return c.domain(a),c.range(i.invert?i.range.slice().reverse():i.range),c.padding(isNaN(i.padding)?0:i.padding),isNaN(i.paddingInner)||c.paddingInner(i.paddingInner),isNaN(i.paddingOuter)||c.paddingOuter(i.paddingOuter),c.align(isNaN(i.align)?.5:i.align),c}const yc={depth:0};function xc(e,t,n){return e.ancestors().map((e=>t(ji({datum:e.data},n)))).reverse().slice(1).toString()}const vc=e=>e.min(),bc=e=>e.max();function wc(e,t){const n=e&&!isNaN(e.min),i=e&&!isNaN(e.max);let r=n?+e.min:0,o=i?+e.max:1;if(t&&t.length){if(!n){const e=t.map(vc).filter(Ui);r=e.length?Math.min(...e):r}if(!i){const e=t.map(bc).filter(Ui);o=e.length?Math.max(...e):o}}return[r,o]}const Mc={domain:[],range:[],invert:!1,min:NaN,max:NaN};function kc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=pc(e,t,n).clamp(!0).interpolate(Il),r=cc(e,Mc,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length,s=i;ji(!0,s,i);const[l,c]=wc(r,t?t.fields:[]),u=o?r.domain.length:-1,h=n.theme?n.theme.palette("sequential",u>0?u:2):[],d=a?r.range:h;return s.range(r.invert?d.slice().reverse():d.slice()),s.domain(o?r.domain:function(e,t,n){const i=e.length;if(2===i)return[t,n];const r=[],o=(n-t)/(i-1);r.push(t);for(let e=1;e<i-1;e++)r.push(t+o*e);return r.push(n),r}(s.range(),l,c)),s}const Sc={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function _c(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const qc={domain:[],range:[]};const Dc={domain:[],range:[],unknown:void 0},Ac={domain:[],range:[],override:!1};const Cc=io();function Nc(e,t,n){let i=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),i={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach((e=>{i.extract.push({field:e})})));const r=$s(i,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map((e=>"dimension"===e.type()?"band":"linear"));return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(r);return"color"===a&&(a=r.fields&&r.fields[0]&&"dimension"===r.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,r,{theme:n.theme,logger:n.logger}),o.type=a),o}Cc("linear",pc),Cc("band",gc),Cc("h-band",(function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={data:n,resources:i},o=cc(t,mc,r);o.ticks=cc(t.ticks,yc,r),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=gc(o);const{values:s,labels:l,items:c,ticks:u}=function(e,t,n){const i=t.ticks.depth,r=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter((e=>{if(e.depth>0){const t=xc(e,r,n),h=e.leaves()||[e],d=r(ji({datum:e.data},n)),f=o(ji({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:h.length,value:d,label:f,leftEdge:xc(h[0],r,n),rightEdge:xc(h[Math.max(h.length-1,0)],r,n),node:e};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(f)),(i<=0&&!p||e.depth===i)&&c.push(m),l[t]=m}}));const h=e.height-1;return h>0&&a.splice(-h),{values:a,labels:s,items:l,ticks:c}}(n.root,o,r),h=function(e){const t=String(e),n=c[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};ji(!0,h,a),h.bandwidth=function(e){const t=c[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),i=h(t.rightEdge);return Math.abs(e-i)+n}return n},h.step=function(e){const t=c[String(e)],n=t?t.count:1;let i=a.step();return i*=n,i},h.data=()=>n,h.datum=e=>{const t=c[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,i),h.labels=()=>l,h.ticks=()=>u.map((e=>{const t=h(e.key),n=h.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}}));const d=a.pxScale;return h.pxScale=function(e){return a=d(e),h},h.domain(s),h})),Cc("sequential-color",kc),Cc("threshold-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=ec(),r=cc(e,Sc,{data:t,resources:n}),o=Array.isArray(r.domain)&&r.domain.length,a=Array.isArray(r.range)&&r.range.length;function s(e){return Yi(e)?NaN:i(e)}Object.keys(i).forEach((e=>s[e]=i[e]));const l=t.fields,[c,u]=wc(r,l),h=o?r.domain.length:-1,d=n.theme?n.theme.palette("sequential",h>0?h:2):[];let f=a?r.range:d,p=[];return p=o?r.domain:r.nice?function(e,t,n){const i=2===e.length?10:Math.max(1,e.length),r=Ql().domain([t,n]).nice(i).ticks(i);if(!e||!e.length)return r;const o=Math.max(0,e.length-1);for(;r.length>o;)r[0]-t<=n-r[r.length-1]?r.shift():r.pop();return r}(f,c,u):[c+(u-c)/2],f.length>p.length+1?p=function(e,t,n){const i=e.length;if(2===i)return[t+(n-t)/2];const r=[],o=(n-t)/i;for(let e=1;e<i;e++)r.push(t+o*e);return r}(f,c,u):f.length<p.length+1&&(f=function(e,t,n,i){n=e[0],i=e&&e.length>=2?e[e.length-1]:i;const r=kc().domain([n,i]).range(t);return[n,..._c(e),i].map((e=>r(e)))}(p,f,c,u)),s.data=()=>t,s.range(r.invert?f.slice().reverse():f),s.domain(p),s})),Cc("categorical-color",(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=Gs(),r={data:t,resources:n},o=cc(e,qc,r),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],h=[];for(let e=0;e<l.length;e++){const t=ji({datum:l[e]},r),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),h.push(s(t,e)),c[n]=e)}return i.data=()=>t,i.labels=()=>h,i.label=e=>h[u.indexOf(e)],i.datum=e=>l[c[e]],i.range(o.range),Array.isArray(o.domain)&&o.domain.length?i.domain(o.domain):i.domain(u),i}(e,t,n),r=n.theme,o=cc(e,Dc,{data:t,resources:n});let a;if(o.explicit=cc(e.explicit,Ac,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():r?r.palette("categorical",i.domain().length).slice():[],o.unknown)i.unknown(o.unknown);else if(r&&r.palette("unknown")){let e=r.palette("unknown");i.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=i.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],r=Math.floor(e.length/a.length);for(let e=1;e<r+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let i=0;i<t.length;i++){const r=e.indexOf(t[i]);r>-1&&(a[r]=n[i])}else{const i=t.map(((t,i)=>[e.indexOf(t),t,n[i]])).sort(((e,t)=>e[0]-t[0]));i.forEach((t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])}))}a.length=e.length}return i.range(a),i}));var Ec={};function Rc(){Rc.init.call(this)}Ec.isObject=function(e){return"object"==typeof e&&null!==e},Ec.isNumber=function(e){return"number"==typeof e},Ec.isUndefined=function(e){return void 0===e},Ec.isFunction=function(e){return"function"==typeof e};var Ic=Rc;Rc.EventEmitter=Rc,Rc.prototype._events=void 0,Rc.prototype._maxListeners=void 0,Rc.defaultMaxListeners=10,Rc.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},Rc.prototype.setMaxListeners=function(e){if(!Ec.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},Rc.prototype.emit=function(e){var t,n,i,r,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],Ec.isUndefined(n))return!1;if(Ec.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];n.apply(this,r)}else if(Ec.isObject(n)){for(i=arguments.length,r=new Array(i-1),o=1;o<i;o++)r[o-1]=arguments[o];for(i=(a=n.slice()).length,o=0;o<i;o++)a[o].apply(this,r)}return!0},Rc.prototype.addListener=function(e,t){var n;if(!Ec.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Ec.isFunction(t.listener)?t.listener:t),this._events[e]?Ec.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Ec.isObject(this._events[e])&&!this._events[e].warned)&&((n=Ec.isUndefined(this._maxListeners)?Rc.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,Ec.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),Ec.isFunction(console.trace)&&console.trace()));return this},Rc.prototype.on=Rc.prototype.addListener,Rc.prototype.once=function(e,t){if(!Ec.isFunction(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},Rc.prototype.removeListener=function(e,t){var n,i,r,o;if(!Ec.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=(n=this._events[e]).length,i=-1,n===t||Ec.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Ec.isObject(n)){for(o=r;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){i=o;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},Rc.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],Ec.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},Rc.prototype.listeners=function(e){return this._events&&this._events[e]?Ec.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},Rc.listenerCount=function(e,t){return e._events&&e._events[t]?Ec.isFunction(e._events[t])?1:e._events[t].length:0};var Oc={mixin:e=>(Object.keys(Ic.prototype).forEach((t=>{e[t]=Ic.prototype[t]})),Ic.init(e),e)};function Pc(){let e=0,t=0,n=0,i=0;n=n||e;const r={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-i,o));n!==a&&(n=a,r.emit("update"))},update(o){let a=!1;({min:e=e,max:t=t}=o),void 0!==o.viewSize&&o.viewSize!==i&&(i=o.viewSize,a=!0);const s=Math.max(e,Math.min(t-i,n));n!==s&&(n=s,a=!0),a&&r.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:i})};return Oc.mixin(r),r}function Lc(e,t){const n=e.min||0,i=e.max||0,r=e.viewSize||0,o=t||Pc();return o.update({min:n,max:i,viewSize:r}),o}function Tc(e,t){return e<=t}function zc(e,t){return e<t}function Fc(e,t,n){let i=0;for(;i<e.length&&t>e[i];)++i;return e[i]===t&&n&&++i,i}function jc(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=[];function r(){}return r.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{includeMax:i=!0,includeMin:r=!0}=n;e=i?Tc:zc,t=r?Tc:zc},r.add=e=>{let{min:t,max:n}=e;const r=Fc(i,t),o=Fc(i,n,!0),a=[r,o-r];r%2==0&&a.push(t),o%2==0&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.remove=e=>{let{min:t,max:n}=e;const r=Fc(i,t),o=Fc(i,n,!0),a=[r,o-r];r%2==1&&a.push(t),o%2==1&&a.push(n);const s=i.join(",");i.splice(...a);return s!==i.join(",")},r.set=e=>{const t=i.join(",");i=[],Array.isArray(e)?e.forEach(r.add):r.add(e);return t!==i.join(",")},r.clear=()=>{const e=i.length>0;return i=[],e},r.containsValue=n=>function(e,t,n,i){const r=e.length;for(let o=1;o<r;o+=2)if(n(e[o-1],t)&&i(t,e[o]))return!0;return!1}(i,n,t,e),r.containsRange=e=>{let{min:t,max:n}=e;const r=Fc(i,t,!0),o=Fc(i,n);return r===o&&o%2==1},r.toggle=e=>r.containsRange(e)?r.remove(e):r.add(e),r.ranges=()=>{const e=[];for(let t=1;t<i.length;t+=2)e.push({min:i[t-1],max:i[t]});return e},r.configure(n),r}function Vc(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const Bc={key:void 0,includeMin:!0,includeMax:!0};function Hc(e){let{items:t,collection:n,vc:i}=e;const r={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=i()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(r[a]=r[a]||[],r[a].push(s[e]))}const l=Object.keys(r);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:r[a]});return o}function $c(e){let{items:t,collection:n}=e;const i={},r=[];let o,a;for(let e=0,r=t.length;e<r;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(i[o]=i[o]||[],i[o].push(a[e]))}const s=Object.keys(i);for(let e=0,t=s.length;e<t;e++)o=s[e],r.push({id:o,values:i[o]});return r}function Wc(e){const t={};let n,i;for(let r=0,o=e.length;r<o;r++){n=e[r].key,i=e[r].values||[e[r].value],t[n]||(t[n]=[]);for(let e=0;e<i.length;e++){-1===t[n].indexOf(i[e])&&t[n].push(i[e])}}return t}function Uc(e){let{key:t,collection:n,obj:i,fn:r,value:o}=e;n[t]||(n[t]=r()),i[t]=i[t]||[],i[t].push(o),n[t].add(o)}function Yc(e,t){const n=[],i=Object.keys(e);let r,o;const a=e=>-1===t[r].indexOf(e);for(let s=0,l=i.length;s<l;s++)r=i[s],t[r]?(o=e[r].filter(a),o.length&&n.push({id:r,values:o})):n.push({id:r,values:e[r]});return n}function Gc(e,t,n){const i=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,i=Array(n);for(let r=0;r<n;r++)i[r]=e[r].key in t?ji({},e[r],{key:t[e[r].key]}):e[r];return i}(t,n);return e&&e.length?e.reduce(((e,t)=>t(e)),i):i}function Xc(e){return e.replace(/(-[a-z])/g,(e=>e.toUpperCase().replace("-","")))}function Kc(e){return e.replace(/([A-Z])/g,(e=>"-".concat(e.toLowerCase())))}function Zc(e,t,n){let{ranges:i,interceptors:r,rc:o,aliases:a,rangeConfig:s}=n;const l=Gc(r["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach((e=>{const n=e.key;if(i[n]||(i[n]=o(s.sources[n]||s.default)),"set"===t)c=i[n][t](e.ranges||e.range)||c;else{const r=e.ranges||[e.range];for(let e=0;e<r.length;e++)c=i[n][t](r[e])||c}})),c}function Jc(){let{vc:e=Vc,rc:t=jc}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=!1,i={},r={},o={},a={sources:{},default:ji({},Bc)};const s={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},l=()=>{const e={values:{},ranges:{}};return Object.keys(r).forEach((t=>{e.values[t]=r[t].values()})),Object.keys(i).forEach((t=>{e.ranges[t]=i[t].ranges()})),e},c={ls:[],clear(){this.ls.forEach((e=>e.clear()))},start(){this.ls.forEach((e=>e.start()))},end(){this.ls.forEach((e=>e.end()))},update(){const e=l();this.ls.forEach((t=>t._state(e)))},updateValues(){const e=l();this.ls.forEach((t=>t._state({values:e.values})))},updateRanges(){const e=l();this.ls.forEach((t=>t._state({ranges:e.ranges})))}},u={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(a={sources:{},default:ji({},Bc)},e.ranges.forEach((e=>{const t={};Object.keys(Bc).filter((e=>"key"!==e)).forEach((n=>{t[n]=void 0!==e[n]?e[n]:Bc[n]})),void 0!==e.key?a.sources[e.key]=t:a.default=t})),Object.keys(i).forEach((e=>i[e].configure(a.sources[e]||a.default))),u.emit("update",[],[]))},link:e=>{if(u===e)throw new Error("Can't link to self");c.ls.push(e),e._state(l())},_state:e=>{if(!e)return l();if(e.values){const t=[];Object.keys(e.values).forEach((n=>{r[n]&&e.values[n].join(";")===r[n].toString()||t.push({key:n,values:e.values[n]})})),Object.keys(r).forEach((n=>{e.values[n]||t.push({key:n,values:[]})})),t.length&&u.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach((n=>{i[n]&&e.ranges[n].join(";")===i[n].toString()||t.push({key:n,ranges:e.ranges[n]})})),Object.keys(i).forEach((n=>{e.ranges[n]||t.push({key:n,ranges:[]})})),t.length&&u.setRanges(t)}},start:function(){if(!n){n=!0;for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];u.emit("start",...t),c.start()}},end:function(){if(n){n=!1,i={},r={};for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];u.emit("end",...t),c.end()}},isActive:()=>n,clear:()=>{const e=u.brushes().filter((e=>"value"===e.type&&e.brush.values().length)).map((e=>({id:e.id,values:e.brush.values()}))),t=Object.keys(i).length>0||e.length;i={},r={},t&&(u.emit("update",[],e),c.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(i).map((e=>({type:"range",id:e,brush:i[e]})))),e=e.concat(Object.keys(r).map((e=>({type:"value",id:e,brush:r[e]})))),e},addValue:(e,t)=>{u.addValues([{key:e,value:t}])},addValues:t=>{const i=Gc(s.addValues,t,o),a=Hc({vc:e,collection:r,items:i});u.emit("add-values",i),a.length&&(n||(n=!0,u.emit("start")),u.emit("update",a,[]),c.updateValues())}};return u.setValues=t=>{const i=Gc(s.setValues,t,o),a=function(e){let{items:t,vCollection:n,vc:i}=e;const r={},o=Wc(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const h=e=>{n[a]&&n[a].contains(e)||Uc({key:a,value:e,collection:n,obj:r,fn:i})},d=Object.keys(o);for(let e=0,t=d.length;e<t;e++)a=d[e],o[a].forEach(h);return l=Yc(c,r),s=Yc(r,c),[s,l]}({items:i,vCollection:r,vc:e});u.emit("set-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.removeValue=(e,t)=>{u.removeValues([{key:e,value:t}])},u.removeValues=e=>{const t=Gc(s.removeValues,e,o),n=$c({collection:r,items:t});u.emit("remove-values",t),n.length&&(u.emit("update",[],n),c.updateValues())},u.addAndRemoveValues=(t,i)=>{const a=Gc(s.addValues,t,o),l=Gc(s.removeValues,i,o),h=Hc({vc:e,collection:r,items:a}),d=$c({collection:r,items:l});u.emit("add-values",a),u.emit("remove-values",l),(h.length||d.length)&&(n||(n=!0,u.emit("start")),u.emit("update",h,d),c.updateValues())},u.toggleValue=(e,t)=>{u.toggleValues([{key:e,value:t}])},u.toggleValues=t=>{const i=Gc(s.toggleValues,t,o),a=function(e){let{items:t,values:n,vc:i}=e;const r={},o={},a=[],s=[],l=Wc(t);let c,u,h;const d=Object.keys(l);for(let e=0,t=d.length;e<t;e++){c=d[e],h=l[c];for(let e=0,t=h.length;e<t;e++)u=h[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):Uc({key:c,value:u,collection:n,obj:r,fn:i})}const f=Object.keys(r);for(let e=0,t=f.length;e<t;e++)c=f[e],a.push({id:c,values:r[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:o[c]});return[a,s]}({items:i,values:r,vc:e});u.emit("toggle-values",i),(a[0].length>0||a[1].length>0)&&(n||(n=!0,u.emit("start")),u.emit("update",a[0],a[1]),c.updateValues())},u.containsValue=(e,t)=>{let n=o[e]||e;return!!r[n]&&r[n].contains(t)},u.addRange=(e,t)=>{u.addRanges([{key:e,range:t}])},u.addRanges=e=>{Zc(e,"add",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.removeRange=(e,t)=>{u.removeRanges([{key:e,range:t}])},u.removeRanges=e=>{Zc(e,"remove",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.setRange=(e,t)=>{u.setRanges([{key:e,range:t}])},u.setRanges=e=>{Zc(e,"set",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.toggleRange=(e,t)=>{u.toggleRanges([{key:e,range:t}])},u.toggleRanges=e=>{Zc(e,"toggle",{ranges:i,rc:t,interceptors:s,aliases:o,rangeConfig:a})&&(n||(n=!0,u.emit("start")),u.emit("update",[],[]),c.updateRanges())},u.containsRangeValue=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsValue(t)},u.containsRange=(e,t)=>{let n=o[e]||e;return!!i[n]&&i[n].containsRange(t)},u.containsMappedData=(e,t,n)=>{let a=[];const s=Object.keys(e);let l,c,u,h;for(let t=0,n=s.length;t<n;t++){if(l=s[t],"value"===l)c=e,a[t]={key:"",i:t,bool:!1};else{if("source"===l)continue;c=e[l],a[t]={key:l,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in o&&(u=o[u]),h=c.value,i[u]?a[t].bool=Array.isArray(h)?i[u].containsRange({min:h[0],max:h[1]}):i[u].containsValue(h):r[u]&&r[u].contains(h)&&(a[t].bool=!0))}return t?(a=a.filter((e=>-1!==t.indexOf(e.key))),"and"===n?!!a.length&&!a.some((e=>!1===e.bool)):"xor"===n?!!a.length&&a.some((e=>e.bool))&&a.some((e=>!1===e.bool)):a.some((e=>e.bool))):a.some((e=>e.bool))},u.intercept=(e,t)=>{const n=Xc(e);s[n]&&s[n].push(t)},u.removeInterceptor=(e,t)=>{const n=Xc(e);if(!s[n])return;const i=s[n].indexOf(t);-1!==i&&s[n].splice(i,1)},u.removeAllInterceptors=e=>{const t=[];if(e){const n=Xc(e);s[n]&&s[n].length&&t.push({name:e,handlers:s[n]})}else Object.keys(s).forEach((e=>{s[e].length&&t.push({name:Kc(e),handlers:s[e]})}));t.forEach((e=>{e.handlers.slice().forEach((t=>u.removeInterceptor(e.name,t)))}))},u.addKeyAlias=(e,t)=>{o[e]=t},u.removeKeyAlias=e=>{delete o[e]},Oc.mixin(u),u}function Qc(e){return e*e*e}function eu(e){return--e*e*e+1}function tu(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}io();const nu=["stroke","fill","color","backgroundColor","thumbColor"];function iu(e,t){const n=t?t.length:0,i=e?Math.min(n,e.length):0,r=new Array(i),o=new Array(n);let a;for(a=0;a<i;++a)r[a]=ru(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<i;++a)o[a]=r[a](e);return o}}function ru(e,t,n){const i=typeof t;let r;return null==t||"boolean"===i?function(e){return()=>e}(t):("number"===i?Tl:"string"===i?(r=pl(t))&&nu.includes(n)?(t=r,Il):Vl:t instanceof pl?Il:t instanceof Date?Ll:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Ol:Array.isArray(t)?iu:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?ou:Tl)(e,t)}function ou(e,t){const n={},i={};let r;for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=ru(e[r],t[r],r):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}function au(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const su={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},lu=/^\$/;function cu(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function uu(e,t,n){const i=e[t];i&&i.scale&&i.scale.pxScale?i.scale=i.scale.pxScale(n):i&&i.pxScale&&(e[t]=i.pxScale(n))}function hu(e,t){return e.pxScale?e.pxScale(t):e}const du={normalizeSettings:function(e,t,n){const i=ji({},e),r=ji({},t);return Object.keys(i).forEach((e=>{r[e]={};const o=i[e],a=typeof o;if("function"==typeof o)r[e].fn=o;else if(cu(o)){let n=t[e];"string"==typeof n&&lu.test(n)&&(n=su[n]);const i=typeof n;r[e]="undefined"===i||i===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(r[e].fn=o.fn),void 0!==o.scale&&(r[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(r[e].ref=o.ref))})),Object.keys(t).forEach((e=>{if(e in i)return;const n=t[e];"string"===typeof n&&lu.test(n)?r[e]=su[n]:r[e]=n})),r},resolveForItem:function(e,t,n){const i={},r=Object.keys(t),o=r.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=r[l],c=t[o],u="object"==typeof s&&void 0!==c,h=u&&"string"==typeof c.ref,d=u&&o in s,f=h?s[c.ref]:d?s[o]:a;cu(c)?i[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),i[o]=c.fn.call(null,e,n)):u&&c.scale&&f?(i[o]=c.scale(f.value),c.scale.bandwidth&&(i[o]+=c.scale.bandwidth()/2)):h&&f?i[o]=f.value:c.fn?i[o]=c.fn.call(null,e,n):i[o]=c}return i},updateScaleSize:uu};function fu(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(((e,t)=>Array.isArray(t.children)?(e.push(...fu(t.children)),e):(e.push(t),e)),[])}function pu(e,t){let{context:n,data:i,style:r,filter:o,mode:a}=t;const s=e.chart.brush(n),l=i,c=r.active||{},u=r.inactive||{},h=[];Object.keys(c).forEach((e=>{h.push(e)})),Object.keys(u).forEach((e=>{-1===h.indexOf(e)&&h.push(e)}));const d=[];let f=!1;const p=()=>{let t=fu(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,i=!1;const r="function"==typeof l?l({brush:s}):l;for(let i=0;i<t;i++){if(n=e[i].data,!n)continue;e[i].__style||(e[i].__style={},h.forEach((t=>{e[i].__style[t]=e[i][t]})));const t=s.containsMappedData(n,r,a),o=d.indexOf(e[i]);let l=!1;t&&-1===o?(d.push(e[i]),l=!0):t||-1===o||(d.splice(o,1),l=!0),e[i].needToUpdate=l||f,e[i].isActive=t}for(let r=0;r<t;r++)if(n=e[r].data,n){if(e[r].needToUpdate){const t=ji({},e[r],e[r].__style),n=e[r].isActive;h.forEach((i=>{e[r][i]=n&&i in c?"function"==typeof c[i]?c[i].call(null,t,d):c[i]:!n&&i in u?"function"==typeof u[i]?u[i].call(null,t,d):u[i]:e[r].__style[i]})),i=!0}delete e[r].needToUpdate}return f=!1,i},g=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].data&&(i[e].__style=i[e].__style||{},h.forEach((t=>{i[e].__style[t]=i[e][t],t in u&&(i[e][t]="function"==typeof u[t]?u[t].call(null,i[e]):u[t])})));f=!0,d.length=0,n||e.renderer.render(e.nodes)},y=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1};const{suppressRender:n}=t,i=p(),r=i.length;for(let e=0;e<r;e++)i[e].__style&&(Object.keys(i[e].__style).forEach((t=>{i[e][t]=i[e].__style[t]})),i[e].__style=void 0);d.length=0,n||e.renderer.render(e.nodes)},x=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",x),{isActive:()=>s.isActive(),update:()=>{d.length=0,f=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",x)}}}function mu(e){let{nodes:t,action:n,chart:i,trigger:r}=e;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let{dataPoints:t,action:n,chart:i,trigger:r}=e;if(!r)return;const o=r.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach((e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}}))}r.contexts.forEach((e=>{a.items.length?i.brush(e)[a.actionFn](a.items):i.brush(e)[s.actionFn](s.items)}))}({dataPoints:o,action:n,chart:i,trigger:r})}function gu(e){let{collisions:t,t:n,config:i,action:r}=e,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map((e=>e.node));return mu({nodes:s,action:r,chart:i.chart,data:i.data,trigger:n}),a}function yu(e,t,n){const i=n.element().getBoundingClientRect();let r=Wi(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,i):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,i);return null===r||r.x<0||r.y<0||r.x>i.width||r.y>i.height?[]:(t.touchRadius>0&&Wi(e)?r={cx:r.x,cy:r.y,r:t.touchRadius}:t.mouseRadius>0&&!Wi(e)&&(r={cx:r.x,cy:r.y,r:t.mouseRadius}),n.itemsAt(r))}function xu(e,t,n){return e?"function"==typeof e?e(t):e:n}const vu={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function bu(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?"M".concat(i.x," ").concat(i.y):"L".concat(i.x," ").concat(i.y),n+=" "}return t&&(n+="Z"),n}function wu(e,t,n,i){const r=n/2,o=e-i/2,a=t-i/2,s=e-r,l=t-r;return[{x:o,y:a},{x:o,y:l},{x:o+i,y:l},{x:o+i,y:a},{x:s+n,y:a},{x:s+n,y:a+i},{x:o+i,y:a+i},{x:o+i,y:l+n},{x:o,y:l+n},{x:o,y:a+i},{x:s,y:a+i},{x:s,y:a}]}function Mu(e){return-e/180*Math.PI}function ku(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),i=n*Math.cos(e),r=n*Math.sin(e);return{x1:i<0?1:0,y1:r<0?1:0,x2:i>=0?i:i+1,y2:r>=0?r:r+1}}(Mu(e))}function Su(e,t){return{x:e.x+t.x,y:e.y+t.y}}function _u(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qu(e,t){return{x:e.x*t,y:e.y*t}}function Du(e,t){return e.x-t.x}function Au(e,t){return e.y-t.y}function Cu(e,t){return Du(e,t)**2+Au(e,t)**2}function Nu(e,t){return Math.sqrt(Cu(e,t))}function Eu(e,t){return e.x*t.x+e.y*t.y}function Ru(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const i=Math.cos(t),r=Math.sin(t),o=_u(e,n);return Su({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}const Iu={up:0,down:180,left:90,right:-90};function Ou(e){let{x:t,y:n,size:i}=e;const r=i/2;return{type:"rect",x:t-r,y:n-r,width:i,height:i}}const Pu=io();Pu.add("circle",(function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}})),Pu.add("diamond",(function(e){const t=e.size,n=e.x-t/2,i=e.y-t/2;return{type:"path",fill:"black",d:bu([{x:n,y:i+t/2},{x:n+t/2,y:i},{x:n+t,y:i+t/2},{x:n+t/2,y:i+t},{x:n,y:i+t/2}])}})),Pu.add("saltire",(function(e){const t=Mu(45),n=e.size/2,i=isNaN(e.width)?n/2:e.width,r=Math.min(i,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(r/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=wu(e.x,e.y,o,r).map((e=>Ru(e,t,s)));return{type:"path",fill:"black",d:bu(l)}})),Pu.add("square",(function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}})),Pu.add("triangle",(function(e){const t=e.size,n={x:e.x,y:e.y},i=Iu[e.direction]||0,r=t/2,o=e.x-r,a=e.y-r;let s=[{x:o,y:a+t},{x:o+r,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=Mu(i);return s=s.map((e=>Ru(e,l,n))),{type:"path",fill:"black",d:bu(s)}})),Pu.add("line",(function(e){const t="vertical"===e.direction,n=e.size/2,i=e.x,r=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:i-(t?0:n),y1:r-(t?n:0),x2:i+(t?0:n),y2:r+(t?n:0),collider:Ou(e)}})),Pu.add("star",(function(e){const t=e.size,n=[],i=t/2,r=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/r;for(let t=1;t<=r;t++){const r=s*t+a,l=Mu(r),c=Mu(r+s/2),u=Math.sin(l),h=Math.cos(l),d=Math.sin(c),f=Math.cos(c);n.push({x:e.x+h*i,y:e.y+u*i}),n.push({x:e.x+f*o,y:e.y+d*o})}return{type:"path",fill:"black",d:bu(n)}})),Pu.add("n-polygon",(function(e){const t=[],n=e.size/2,i=Math.max(isNaN(e.sides)?6:e.sides,3),r=360/i,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=i;a++){const i=Mu(r*a+o),s=Math.sin(i),l=Math.cos(i);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:bu(t)}})),Pu.add("cross",(function(e){const t=e.x,n=e.y,i=e.size/2,r=isNaN(e.width)?i/2:e.width,o=Math.min(r,i);return{type:"path",fill:"black",d:bu(wu(t,n,e.size,o))}})),Pu.add("bar",(function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,i=e.size/2,r=i/2/2;let o=[{x:t.x-i,y:t.y+r},{x:t.x-i,y:t.y-r},{x:t.x+i,y:t.y-r},{x:t.x+i,y:t.y+r}];if(n){const e=Mu(90);o=o.map((n=>Ru(n,e,t)))}const a=Zi(o);return a.type="rect",a.fill="black",a})),Pu.add("rect",(function(e){const{x:t,y:n,size:i}=e,r=void 0===e.width?i:e.width,o=void 0===e.height?i:e.height;return{type:"rect",fill:"black",x:t-r/2,y:n-o/2,width:r,height:o}}));const Lu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Pu;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach((n=>{void 0!==vu[n]&&"transform"!==n&&(e[n]=t[n])}))}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function Tu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{dock:n="center",displayOrder:i=0,prioOrder:r=0,preferredSize:o=0,minimumLayoutMode:a,show:s=!0}=e;n=n||"center";return{computePreferredSize(e){let{inner:n,outer:i,children:r}=e;return"function"==typeof o?o({inner:n,outer:i,children:r,dock:this.dock()},t):o},dock(e){return void 0!==e?(n=e,this):"function"==typeof n?n(t):n},displayOrder(e){return void 0!==e?(i=e,this):"function"==typeof i?i(t):i},prioOrder(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},minimumLayoutMode(e){return void 0!==e?(a=e,this):"function"==typeof a?a(t):a},show(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s}}}function zu(e,t,n){const{require:i=[]}=t,r=t.mediator||{},{settings:o,formatter:a,scale:s,data:l,renderer:c,chart:u,dockConfig:h,mediator:d,instance:f,rect:p,style:m,registries:g,resolver:y,update:x,_DO_NOT_USE_getInfo:v,symbol:b,isVisible:w}=n;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:o}),Object.defineProperty(e,"data",{get:l}),Object.defineProperty(e,"formatter",{get:a}),Object.defineProperty(e,"scale",{get:s}),Object.defineProperty(e,"mediator",{get:d}),Object.defineProperty(e,"style",{get:m}),Object.defineProperty(e,"registries",{get:g}),p&&Object.defineProperty(e,"rect",{get:p}),v&&(e._DO_NOT_USE_getInfo=v),Object.keys(t).forEach((n=>{var i;i=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some((e=>e===i))||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])})),i.forEach((t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:c}):"chart"===t?Object.defineProperty(e,"chart",{get:u}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:h}):"instance"===t?Object.defineProperty(e,"instance",{get:f}):"update"===t&&x?Object.defineProperty(e,"update",{get:x}):"resolver"===t?Object.defineProperty(e,"resolver",{get:y}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:b})})),Object.keys(r).forEach((t=>{e.mediator.on(t,r[t].bind(e))}))}function Fu(e,t,n){const i=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,r={};return r.displayOrder=i("displayOrder"),r.dock=i("dock"),r.prioOrder=i("prioOrder"),r.minimumLayoutMode=i("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==r.displayOrder?r.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==r.prioOrder?r.prioOrder:e.layout.prioOrder,e.layout.dock=r.dock||e.layout.dock,e.layout.minimumLayoutMode=r.minimumLayoutMode||e.layout.minimumLayoutMode,r.show=e.show,r.preferredSize=t,r}function ju(e,t,n){Object.keys(n.on||{}).forEach((i=>{e.eventListeners=e.eventListeners||[];const r=n.on[i].bind(e);e.eventListeners.push({event:i,listener:r}),t.on(i,r)})),e.emit=function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.emit(e,...i)}}function Vu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{defaultSettings:n={},_DO_NOT_USE_getInfo:i=()=>({})}=e,{chart:r,container:o,mediator:a,registries:s,theme:l,renderer:c}=t,u=Oc.mixin({});let h,d,f,p,m,g=t.settings||{},y=ji(!0,{},n,g),x=[],v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:du,n={};return{resolve:function(i){let{data:r,settings:o,defaults:a={},scaled:s}=i;const l=n.norm=t.normalizeSettings(o,a,e.chart),c={scale:e.chart.scale,formatter:e.chart.formatter};s&&Object.keys(s).forEach((e=>{l[e]&&t.updateScaleSize(l,e,s[e])}));const u=[];if(!r||!Array.isArray(r.items)){const e={data:r,resources:c};let i=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:i}}{let e;for(let i=0,o=r.items.length;i<o;i++){e={datum:r.items[i],data:r,resources:c};let o=t.resolveForItem(e,n.norm,i);o.data=r.items[i],u.push(o)}}return{settings:n.norm,items:u}}}}({chart:r}),b=!1;const w={nodes:[],chart:r,config:y.brush||{},renderer:null},M={tap:[],over:[]},k=[],S={},_=ji({},g);function q(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const r=void 0!==e[t],o=void 0!==g[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return r&&("function"==typeof e[t]?a=e[t].call(S,...l):i&&(a=e[t])),o&&("function"==typeof g[t]?a=g[t].call(_,...l):i&&(a=g[t])),r||o||(a=n.call(S,...l)),a}}const D=q("preferredSize",(()=>0),!0),A=q("resize",(e=>{let{inner:t}=e;return t})),C=q("created"),N=q("beforeMount"),E=q("mounted"),R=q("beforeUnmount"),I=q("beforeUpdate"),O=q("updated"),P=q("beforeRender"),L=q("beforeDestroy"),T=q("destroyed"),z=e.render,F=()=>{y.brush&&(y.brush.consume||[]).forEach((e=>{e.context&&e.style&&k.push(pu(w,e))}))},j=()=>{y.brush&&(y.brush.trigger||[]).forEach((e=>{"over"===e.on?M.over.push(e):M.tap.push(e)}))};Object.defineProperty(w,"data",{get:()=>x});const V=y.renderer||e.renderer,B=V?c||s.renderer(V)():c||s.renderer()();"function"==typeof B.settings&&B.settings(y.rendererSettings),w.renderer=B;const H={resources:r.logger?{logger:r.logger()}:{}};let $=Tu(Fu(y,D,r.logger()),H);const W=e=>{e.key=y.key,e.element=B.element()},U=()=>{};U.dockConfig=()=>$,U.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(g=e.settings,y=ji(!0,{},n,e.settings),$=Tu(Fu(y,D,r.logger()),H),w.config=y.brush||{}),y.scale&&(h=r.scale(y.scale)),y.data){const{rendererSettings:e}=y,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=$s(y.data,{dataset:r.dataset,collection:r.dataCollection},{logger:r.logger()},r.dataCollection);t?t.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=h?h.data():[];"string"==typeof y.formatter||"object"==typeof y.formatter?d=r.formatter(y.formatter):h&&h.data().fields&&(d=h.data().fields[0].formatter()),m=l.style(y.style||{})},U.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=A({inner:e,outer:t});p=n?B.size(n):B.size(e),_.rect=ji(!0,{computedPhysical:p.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),p=ji(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},p)},U.getRect=()=>_.rect;const Y=()=>{const e=B.renderArgs?B.renderArgs.slice(0):[],{rendererSettings:t}=y;let n=x;const i="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&i&&(n=$i($i({},x),{},{items:x.items.slice(i.start,i.end)})),e.push({data:n}),e};let G,X,K;function Z(e){const{rendererSettings:t}=y,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}U.beforeMount=N,U.beforeRender=()=>{P({size:p})},U.render=()=>{const e=z.call(S,...Y());Z(e),B.render(e),G=e,X=_.rect.computed},U.hide=()=>{U.unmount(),B.size({x:0,y:0,width:0,height:0}),B.clear()},U.beforeUpdate=()=>{I({settings:y,data:x})},U.update=()=>{K&&K.stop();const{rendererSettings:e,brush:t,animations:n}=y;if("function"==typeof(null==e?void 0:e.transform)&&e.transform())return B.render(),void(G=null);const i=z.call(S,...Y());Z(i),k.forEach((e=>e.cleanUp())),k.length=0,M.tap=[],M.over=[],t&&(F(),j()),k.forEach((e=>{e.isActive()&&e.update()})),G&&n&&("function"==typeof n.enabled?n.enabled():n.enabled)?(n.compensateForLayoutChanges&&n.compensateForLayoutChanges({currentNodes:G,currentRect:_.rect.computed,previousRect:X}),K=function(e,t,n,i){let r,{old:o,current:a}=e,{renderer:s}=t,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},h={nodes:[],ips:[]},d=[],f=null;const p=n.trackBy||au,m={start(){let e={};if(o.forEach(((t,n)=>{let i=p(t,n);e[i]=t})),a.forEach(((t,n)=>{let i=p(t,n);if(e[i]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter((e=>!e.dummy)),i=t.points.filter((e=>!e.dummy)),r=i.map((e=>e.data.major.value)),o=n.filter((e=>r.includes(e.data.major.value))).map((e=>e.data.major.value)),a=n.filter((e=>o.includes(e.data.major.value))),s=i.filter((e=>o.includes(e.data.major.value)));return{old:a,current:s}}(e[i],t);h.ips.push(ou(ji({},e[i],{points:n.old}),ji({},t,{points:n.current}))),l.push(ji({},e[i],{commonPoints:n.old}))}else h.ips.push(ou(e[i],t)),l.push(e[i]);h.nodes.push(t),e[i]=!1}else c.nodes.push(t),c.ips.push(ou(ji({},t,{r:.001,opacity:0}),t))})),Object.keys(e).forEach((t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(ou(e[t],ji({},e[t],{r:1e-4,opacity:0}))))})),d.push({name:"exiting",easing:Qc,duration:200,tweens:u.ips,nodes:[...l]}),d.push({name:"updating",easing:tu,duration:400,tweens:h.ips,nodes:[]}),d.push({name:"entering",easing:eu,duration:200,tweens:c.ips,nodes:[...h.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,r=e?l.filter(e).length:l.length,{isInit:o,shouldBeRemoved:a}=i.getValue("animations.updatingStageMeta");!1===o?(i.setValue("animations.updatingStageMeta.shouldBeRemoved",0===r),i.setValue("animations.updatingStageMeta.isInit",!0)):i.setValue("animations.updatingStageMeta.shouldBeRemoved",a&&0===r)}d.length&&(f=s.getScene(a),d[0].started=Date.now(),"undefined"!=typeof window&&(r=window.requestAnimationFrame(m.tick)))},tick(){let e=d[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map((n=>n(e.easing(Math.min(1,t)))));const{adjustTweenedNodes:l}=n;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){d.shift();const{isInit:e,shouldBeRemoved:t}=i.getValue("animations.updatingStageMeta");d.length?"updating"===d[0].name&&t&&d.shift():(!0===e&&i.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}r&&(r=window.requestAnimationFrame(m.tick))},stop(){r&&(window.cancelAnimationFrame(r),r=!1)},inProgress:()=>!!r,get targetScene(){return f}};return m}({old:G,current:i},{renderer:B},n,r.storage),K.start()):B.render(i),G=i,X=_.rect.computed,B.setKey&&"string"==typeof g.key&&B.setKey(g.key)},U.updated=O,U.destroy=()=>{U.unmount(),L(f),B.destroy(),T(),f=null};const J=e=>{w.nodes=e,k.forEach((e=>{e.isActive()&&e.update()})),B.render(e)};return zu(S,e,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>B,chart:()=>r,dockConfig:()=>$,mediator:()=>a,instance:()=>_,rect:()=>_.rect,style:()=>m,update:()=>J,registries:()=>s,resolver:()=>v,symbol:()=>Lu(s.symbol)}),zu(_,g,{settings:()=>y,data:()=>x,scale:()=>h,formatter:()=>d,renderer:()=>B,chart:()=>r,dockConfig:()=>$,mediator:()=>a,style:()=>m,_DO_NOT_USE_getInfo:i.bind(S),isVisible:()=>b}),U.getBrushedShapes=function(e,t,n){const i=[];if(y.brush&&y.brush.consume){const o=r.brush(e),a=B.findShapes("*");y.brush.consume.filter((t=>t.context===e)).forEach((e=>{for(let r=0;r<a.length;r++){const s=a[r];s.data&&o.containsMappedData(s.data,n||e.data,t)&&(W(s),i.push(s),a.splice(r,1),r--)}}))}return i},U.findShapes=e=>{var t;const n=(null!==(t=K)&&void 0!==t&&t.inProgress()?K.targetScene:B).findShapes(e);for(let e=0,t=n.length;e<t;e++)W(n[e]);return n},U.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=B.itemsAt(e);let i;i=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map((e=>e.node));for(let e=0,t=i.length;e<t;e++)W(i[e]);return i},U.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];mu({nodes:e,action:t.action||"toggle",trigger:t,chart:r,data:w.data})},U.mount=()=>{f=B.element&&B.element()?f:B.appendTo(o),B.setKey&&"string"==typeof g.key&&B.setKey(g.key),y.brush&&(F(),j()),ju(_,u,g),ju(S,u,e),b=!0},U.mounted=()=>E(f),U.unmount=()=>{[_,S].forEach((e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach((e=>{let{event:n,listener:i}=e;t.removeListener(n,i)})),e.eventListeners.length=0),e.emit=()=>{}}(e,u)})),M.tap=[],M.over=[],k.forEach((e=>{e.cleanUp()})),k.length=0,R(),b=!1},U.onBrushTap=e=>{M.tap.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return gu({collisions:yu(t,n,i.renderer),t:n,config:i,action:xu(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},U.onBrushOver=e=>{M.over.forEach((t=>{(function(e){let{e:t,t:n,config:i}=e;return gu({collisions:yu(t,n,i.renderer),t:n,config:i,action:xu(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&r.toggleBrushing(!0)}))},U.def=S,U.ctx=_,U.renderer=()=>B,U.set({settings:g}),C(),U}function Bu(e){const t=ji(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const i=t.split(".");let r=e;for(let e=0;e<i.length;++e){const t=i[e];if(void 0===r[t])return n;r=r[t]}return r}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const i=t.split("."),r=i[i.length-1];let o=e;for(let e=0;e<i.length-1;++e){const t=i[e];void 0===o[t]&&(o[t]=Number.isNaN(+i[e+1])?{}:[]),o=o[t]}void 0!==n?o[r]=n:delete o[r]}(t,e,n)};return n}function Hu(e,t,n){const i=Su(function(e,t){const n=Eu(e,t)/Eu(t,t)||1;return{x:t.x*n,y:t.y*n}}(_u(n,e),_u(t,e)),e);return i}function $u(e,t,n){return Nu(e,n)+Nu(t,n)-Nu(e,t)<1e-12}function Wu(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function Uu(e){return e.x1===e.x2&&e.y1===e.y2}function Yu(e){return e.width<=0||e.height<=0}function Gu(e){return e.r<=0}function Xu(e){return e.edges.length<=2}function Ku(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=ih(e,Ji(t.edges[i])),!0===n)return!0;return!1}function Zu(e,t){let n=!1;const{numPolygons:i,polygons:r}=t;for(let t=0;t<i;t++){if(n=dh(e,r[t]),!0===n)return!0}return!1}function Ju(e,t){if(Gu(e))return!1;return Cu({x:e.cx,y:e.cy},t)<=e.r**2}function Qu(e,t){if(Yu(t)||Gu(e))return!1;const n=t.width/2,i=t.height/2,r=t.x+n,o=t.y+i,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-r),u=Math.abs(l-o);if(c>n+a||u>i+a)return!1;if(c<=n||u<=i)return!0;return(c-n)**2+(u-i)**2<=a**2}function eh(e,t){if(Gu(e)||Uu(t))return!1;const[n,i]=Xi(t);if(Ju(e,n)||Ju(e,i))return!0;const r={x:e.cx,y:e.cy},o=Hu(n,i,r);return Cu(o,r)<=e.r**2&&$u(n,i,o)}function th(e,t){if(Xu(t)||Gu(e))return!1;if(nh(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let i=0;i<n;i++){if(eh(e,Ji(t.edges[i])))return!0}return!1}function nh(e,t){if(Xu(e)||!sh(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=r.length,s=a-1;++l<a;s=l){if(r[l].x===n&&r[l].y===i)return!0;if(r[l].y===r[s].y&&r[l].y===i&&(n-r[l].x)*(n-r[s].x)<=0)return!0;if(r[l].y<i&&i<=r[s].y||r[s].y<i&&i<=r[l].y){if(c=(r[s].x-r[l].x)*(i-r[l].y)/(r[s].y-r[l].y)+r[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function ih(e,t){if(Xu(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(ch(t,Ji(e.edges[n])))return!0}const[n,i]=Xi(t);return nh(e,n)||nh(e,i)}function rh(e,t){if(Xu(e))return!1;for(let n=0,i=e.edges.length;n<i;n++){if(lh(t,Ji(e.edges[n])))return!0}const[n,i,r,o]=Ki(t);return nh(e,n)||nh(e,i)||nh(e,r)||nh(e,o)}function oh(e,t){return!Yu(e)&&!Yu(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function ah(e,t){if(Yu(e)||Yu(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every((t=>sh(e,t)))}function sh(e,t){return!Yu(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function lh(e,t){if(Uu(t)||Yu(e))return!1;const[n,i]=Xi(t);if(sh(e,n)||sh(e,i))return!0;const r=Ki(e);let o=r.length;for(let e=0;e<o;e++){if(ch(Ji([r[e],r[3!==e?e+1:0]]),t))return!0}return!1}function ch(e,t){const[n,i]=Xi(e),[r,o]=Xi(t),a=Du(i,n),s=Au(i,n),l=Du(o,r),c=Au(o,r),u=Du(n,r),h=Au(n,r);let d=c*a-l*s;const f=l*h-c*u,p=a*h-s*u;let m,g;if(0===a&&0===s)return!1;if(0===l&&0===c)return!1;if(0===d){if(0===f&&0===p){if(0===a){if(0===s)return n.x===i.x&&n.y===i.y;m=Au(r,n)/s,g=Au(o,n)/s}else m=(r.x-n.x)/a,g=(o.x-n.x)/a;return!(m<0&&g<0||m>1&&g>1)}return!1}const y=f/d;return d=p/d,y>=0&&y<=1&&d>=0&&d<=1}function uh(e,t){if(Uu(e))return!1;const[n,i]=Xi(e);return $u(n,i,t)}function hh(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!oh(n,i)&&(ah(n,i)?Ku(e,t):Ku(t,e))}function dh(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!oh(n,i)&&(ah(i,n)?function(e,t){let n=!1;const{numPolygons:i,polygons:r}=e;for(let e=0;e<i;e++)if(n=hh(t,r[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let i=0,r=t.edges.length;i<r;i++)if(n=mh(e,Ji(t.edges[i])),!0===n)return!0;return!1}(e,t))}function fh(e,t){if(Gu(e))return!1;if(ph(t,{x:e.cx,y:e.cy}))return!0;const{numPolygons:n,polygons:i}=t;for(let t=0;t<n;t++){const n=i[t],r=n.edges.length;for(let t=0;t<r;t++){if(eh(e,Ji(n.edges[t])))return!0}}return!1}function ph(e,t){if(!sh(e.boundingRect(),t))return!1;const{x:n,y:i}=t,r=e.numPolygons;let o,a,s,l,c,u,h=!1;for(a=0;a<r;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===i)return!0;if(o[c].y===o[l].y&&o[c].y===i&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<i&&i<=o[l].y||o[l].y<i&&i<=o[c].y){if(u=(o[l].x-o[c].x)*(i-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(h=!h)}}return h}function mh(e,t){const[n,i]=Xi(t);if(ph(e,n)||ph(e,i))return!0;const{numPolygons:r,polygons:o}=e;for(let e=0;e<r;e++){const n=o[e];for(let e=0,i=n.edges.length;e<i;e++){if(ch(t,Ji(n.edges[e])))return!0}}return!1}function gh(e,t){const[n,i,r,o]=Ki(t);if(ph(e,n)||ph(e,i)||ph(e,r)||ph(e,o))return!0;const{numPolygons:a,polygons:s}=e;for(let e=0;e<a;e++){const n=s[e];for(let e=0,i=n.edges.length;e<i;e++){if(lh(t,Ji(n.edges[e])))return!0}}return!1}const yh=/^\$/,xh="@extend";function vh(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function bh(e,t,n){if("string"==typeof e){let i=t[e];return-1!==n.indexOf(e)&&vh(e),yh.test(i)?(n.push(e),bh(i,t,n)):i}let i=e;const r=ji(!0,{},t,e),o={};if(e[xh]){const o=e[xh];-1!==n.indexOf(o)&&vh(o);let a=n.slice();a.push(o),i=ji(!0,{},bh(r[o],t,a),e)}return Object.keys(i).forEach((e=>{let t=n.slice();if(e===xh||yh.test(e))return;o[e]=i[e];let a=o[e];yh.test(a)&&a in r?(-1!==n.indexOf(a)&&vh(a),t.push(a),a=r[a],"object"==typeof a||yh.test(a)&&a in r?o[e]=bh(a,r,t):o[e]=a):"object"==typeof a&&(o[e]=bh(a,r,t))})),o}function wh(e,t){return bh(e,t,[])}function Mh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const i=e=>{e.forEach((e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map((e=>e?e.length:0))}}))},r={palette:(e,n)=>((e,n)=>{const i=t[e];if(!i)return[];const r=i.sizes;for(let e=0;e<r.length;e++)if(n<=r[e])return i.colors[e];return i.colors[r.length-1]})(e,n),setPalettes:i,style:e=>wh(e,n),setStyle:t=>{n=ji({},e,t)}};return i(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),r}function kh(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function Sh(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return ji(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function _h(e,t,n,i,r){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:i,margin:isNaN(r)?0:r}}function qh(e,t,n){if(void 0===e.cachedSize){const i=e.config.dock();let r,o=e.comp.preferredSize({inner:t,outer:n,dock:i});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},r="top"===i||"bottom"===i?o.height:"right"===i||"left"===i?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(r),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function Dh(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function Ah(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function Ch(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const i=e.width-(t.x+t.width);i<n.right&&(t.width-=n.right-i),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const r=e.height-(t.y+t.height);r<n.bottom&&(t.height-=n.bottom-r)}function Nh(e,t,n,i,r){const o=ji({},t),a=ji({},n);Dh(o,i),Ah(a,i),Ch(e,o,a);const s=function(e,t,n){const i=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),r=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=i&&t.height>=r}(e,o,r);return!!s&&(Dh(t,i),Ah(n,i),!0)}function Eh(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function Rh(e){return Zi([].concat(...e.map(Ki)))}function Ih(e){let{visible:t,layoutRect:n,reducedRect:i,containerRect:r,translation:o}=e;const a=_h(i.x,i.y,i.width,i.height),s=_h(i.x,i.y,i.width,i.height),l={},c=t.slice(),u=c.slice().sort(((e,t)=>e.config.displayOrder()-t.config.displayOrder()));return t.sort(((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n})).forEach((e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=i.x,t.y=c.y=i.y,t.width=c.width=i.width,t.height=c.height=i.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map((e=>l[e])).filter((e=>!!e));n.length>0&&(t=Rh(n.map((e=>e.outerRect))),c=Rh(n.map((e=>e.r))))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,i){const r={x:i.width/n.width,y:i.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=r.x<r.y,t=Math.min(r.x,r.y);r.x=t,r.y=t;const a=e?"height":"width",s=(i[a]-n[a]*r.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=r,e.margin=o,t.scaleRatio=r,t.margin=o,n.scaleRatio=r,n.margin=o}(c,t,n,r),c.edgeBleed=e.edgeBleed,c.computed=Eh(c),t.edgeBleed=e.edgeBleed,t.computed=Eh(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0})),u}function Oh(e,t,n){const i=e.layoutModes||{},r=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof r?o=i[r.width]&&i[r.height]&&n.width>=i[r.width].width&&n.height>=i[r.height].height:o&&void 0!==r&&(o=i[r]&&n.width>=i[r].width&&n.height>=i[r].height),o}function Ph(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function Lh(e){let t=Sh(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const{logicalContainerRect:i,containerRect:r}=function(e,t){const n={x:0,y:0,width:0,height:0},i={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(i.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,i.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,i.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),i.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(i.width=n.width,i.height=n.height,i.preserveAspectRatio=!1),kh(i),kh(n),{logicalContainerRect:i,containerRect:n}}(e,t),[o,a]=function(e,t,n){const i=[],r=[];for(let o=0;o<e.length;++o){const a=e[o];Ph(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map((e=>e.replace(/^\s*@/,""))):[];Oh(t,s,n)?i.push({comp:a,key:l,config:s,referencedDocks:u}):r.push({comp:a,key:l,config:s,referencedDocks:u})}return[i,r]}(n,t,i),s=function(e){let{layoutRect:t,visible:n,hidden:i,settings:r}=e;const o=_h(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort(((e,t)=>e.config.prioOrder()-t.config.prioOrder()));for(let e=0;e<s.length;++e){const n=s[e];qh(n,o,t),Nh(t,o,a,n,r)||(i.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let i=e[n];if(i.referencedDocks.length){const r=i.referencedDocks.every((e=>t.some((t=>t.key===e))));r&&t.push(e.splice(n,1)[0])}}}(n,i);const l=n.filter((e=>-1!==s.indexOf(e)));return n.length=0,n.push(...l),Ch(t,o,a),o}({layoutRect:i,visible:o,hidden:a,settings:t}),l=Ih({visible:o,layoutRect:i,reducedRect:s,containerRect:r,translation:{x:e.x,y:e.y}});return a.forEach((e=>{e.comp.visible=!1;const t=_h();e.comp.resize(t,t)})),{visible:o.map((e=>e.comp)),hidden:a.map((e=>e.comp)),ordered:l.map((e=>e.comp))}},n.settings=function(e){t=Sh(e)},n}const Th=(e,t)=>{for(let n=0;n<e.length;n++){const i=e[n];if(i.hasKey&&i.key===t)return e[n]}return null},zh=e=>null==e?void 0:e.map((e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize($i($i({},n),{},{children:zh(e.children)}))}})),Fh=(e,t)=>({visible:[],hidden:t,ordered:[]}),jh=e=>(t,n)=>{var i;const r=n.map(((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize($i($i({},t),{},{children:zh(e.children)}))}})),o=e=>n[e.index],{visible:a=r,hidden:s=[],ordered:l=a}=null!==(i=e(t,r))&&void 0!==i?i:{};return{visible:a.map(o),hidden:s.map(o),ordered:l.map(o)}},Vh=e=>"function"==typeof e?jh(e):(e=>{const t=Lh(e);return jh(((e,n)=>t.layout(e,n)))})(e);function Bh(e,t,n){const i=t.left-n.left,r=t.top-n.top,o=Qi(e),a=ji(!0,{},e);switch(o){case"circle":a.cx+=i,a.cy+=r;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=i,t.y+=r}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=i,n.y+=r}}break;case"line":a.x1+=i,a.y1+=r,a.x2+=i,a.y2+=r;break;case"point":case"rect":a.x+=i,a.y+=r}return a}function Hh(e,t){const n=[];let i=0;t.forEach((e=>{n.push(i),i++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(i+=t.length)})),t.forEach(((t,i)=>((e,t,n)=>{const i=t.instance.renderer().element();if(isNaN(n)||!i||!e||!e.children)return;const r=e.children[Math.max(0,n)];if(i===r)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==r?(e.insertBefore(i,r),o&&o.forEach((t=>{e.insertBefore(t,i)}))):(o&&o.forEach((t=>{e.appendChild(t,i)})),e.appendChild(i))})(e,t,n[i])))}function $h(e,t){let{element:n,data:i=[],settings:r={},on:o={}}=e;const a=t.registries,s=t.logger,l=Mh(t.style,t.palettes),c=[],u=ji({},e),h=function(){const e={};return Oc.mixin(e),e}();let d=[],f=null,p=null,m=null,g=[],y=()=>{},x=()=>{};const v={};let b=!1;const w=function(e){let{createComponent:t}=e;const n={};let i=[],r=[];const o=e=>{const n=t(e);return n&&(i.push(n),e.components&&(n.children=e.components.map((e=>o(e))).filter((e=>!!e)))),n},a=e=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const i=e[n],r=t.find((e=>i.hasKey&&i.key===e.key));r?i.children&&r.components&&s(i.children,r.components):(e.splice(n,1),a(i),i.children&&s(i.children,[]),i.instance.destroy())}},l=e=>{let{compList:t,data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:s}=e;return s.map((e=>{const s=Th(t,e.key);return i.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:r,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:i,formatters:r,scales:a,settingsList:e.components})),s)):o(e)})).filter((e=>!!e))},c=e=>{let{components:t,hidden:n,layoutFn:i,ordered:r,rect:o,visible:a}=e;const{visible:s,hidden:l,ordered:u}=i(o,t);a.push(...s),n.push(...l),r.push(...u),s.forEach((e=>{if(e.children){var t,i;const o=Vh(null!==(t=null===(i=e.settings)||void 0===i?void 0:i.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:r,rect:e.instance.getRect(),visible:a})}})),l.forEach((e=>{e.children&&c({components:e.children,hidden:n,layoutFn:Fh,ordered:r,rect:null,visible:a})}))};return n.destroy=()=>{i.forEach((e=>e.instance.destroy())),i=[],r=[]},n.findComponentByKey=e=>Th(i,e),n.forEach=e=>{i.forEach(e)},n.layout=e=>{let{layoutSettings:t,rect:n}=e;const i=[],o=[],a=[],s=Vh(t);return c({components:r,hidden:o,layoutFn:s,ordered:a,rect:n,visible:i}),{visible:i,hidden:o,ordered:a}},n.set=e=>{let{components:t}=e;r=t.map((e=>o(e))).filter((e=>!!e))},n.update=e=>{let{components:t,data:n,excludeFromUpdate:i,formatters:o,scales:a}=e;s(r,t),r=l({compList:r,data:n,excludeFromUpdate:i,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!a.component.has(e.type))return s.warn("Unknown component: ".concat(e.type)),!1;return{instance:Vu(a.component(e.type),{settings:e,chart:u,mediator:h,registries:a,theme:l,container:n}),settings:ji(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function M(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const i="function"==typeof e[t];let r;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return r=i?e[t].call(u,...a):n.call(u,...a),r}}const k=()=>{let e;r.dockLayout?(s.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=r.dockLayout):e=r.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();return{x:0,y:0,width:t,height:n}}return{x:0,y:0,width:0,height:0}}(n);return w.layout({layoutSettings:e,rect:t})},S=M("created"),_=M("beforeMount"),q=M("mounted"),D=M("beforeUpdate"),A=M("updated"),C=M("beforeRender"),N=M("beforeDestroy"),E=M("destroyed"),R=function(e,t){let{partialData:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{formatters:i={},scales:r={},scroll:o={}}=t;y=function(e,t){let{types:n,logger:i}=t;const r={},o=[];return Array.isArray(e)?o.push(...e):(i.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach(((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(i.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});r[n]=a}})),e=>e?r[e]:r[Object.keys(r)[0]]}(e,{logger:s,types:a.data}),n||Object.keys(v).forEach((e=>v[e].clear())),t.palettes&&l.setPalettes(t.palettes),t.style&&l.setStyle(t.style),x=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:$s;const r={};return(e||[]).forEach((e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");r[e.key]=()=>i(e.data,t,n)})),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in r))throw new Error("Unknown data collection: ".concat(t));"function"==typeof r[t]&&(r[t]=r[t]());let i=r[t];if(n&&n.fields&&n.fields.filter){let e=i.fields.filter(n.fields.filter);i.fields.length!==e.length&&(i=ji(i,{fields:e}))}return i}}(t.collections,{dataset:y},{logger:s});const c={theme:l,logger:s};f=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Nc;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o,t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(r,{dataset:y,collection:x},$i($i({},c),{},{scale:a.scale})),p=function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ws;const r={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(r[a]=r[a]||i(e[a],t,n),r[a]):i(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),r}}}(i,{dataset:y,collection:x},$i($i({},c),{},{formatter:a.formatter})),m=function(e,t){const n={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=Lc(e[i],t?t[i]:null));return n}(o,m)};function I(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},i=e.filter((e=>!!e.key)).map((e=>e.key));g.forEach((e=>{e.key&&-1!==i.indexOf(e.key)?t[e.key]=e:e.destroy()})),g=e.map((e=>{const i=e.key&&t[e.key]?t[e.key]:a.interaction(e.type)(u,h,n);return i.set(e),i}))}const O=e=>{const t=n.getBoundingClientRect(),i="clientX"in e?e.clientX:e.x,r="clientY"in e?e.clientY:e.y,o={x:i-t.left,y:r-t.top},a=[];return d.forEach((e=>{const t=e.instance.getRect();sh(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)})),a},P=()=>{if(c.length||!n)return;Object.keys(o).forEach((e=>{const t=o[e].bind(u);n.addEventListener(e,t),c.push({key:e,listener:t})}));const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=O(e)},i=t=>{const n=e.comps||O(t);if(!n.every((e=>e.instance.def.disableTriggers))&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=Wi(e),i=n?e.changedTouches[0]:e,r=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(i.clientX-t.x),a=isNaN(t.y)?0:Math.abs(i.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&r<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),b){b=!1;break}}},r=[];r.push({key:"mousedown",listener:t}),r.push({key:"mouseup",listener:i}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(r.push({key:"touchstart",listener:t}),r.push({key:"touchend",listener:i})),r.push({key:"mousemove",listener:e=>{const t=O(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),b){b=!1;break}}}}),r.forEach((e=>{n.addEventListener(e.key,e.listener),c.push(e)}))},L=()=>{c.forEach((e=>{let{key:t,listener:i}=e;return n.removeEventListener(t,i)})),c.length=0},T=()=>{n.innerHTML="",(()=>{const{components:e=[]}=r;C(),R(i,r),w.set({components:e});const{visible:t,hidden:o,ordered:a}=k();d=t,o.forEach((e=>{e.instance.hide(),e.visible=!1})),t.forEach((e=>e.instance.beforeMount())),t.forEach((e=>e.instance.mount())),t.forEach((e=>e.instance.beforeRender())),t.forEach((e=>e.instance.render())),t.forEach((e=>e.instance.mounted())),t.forEach((e=>{e.visible=!0})),Hh(n,a)})(),P(),I(r.interactions)};return u.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{excludeFromUpdate:t=[]}=e;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),D(),R(i,r);const{formatters:n,scales:o,components:a=[]}=r;w.update({components:a,data:i,excludeFromUpdate:t,formatters:n,scales:o}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()})),k()},u.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{partialData:t,excludeFromUpdate:o=[]}=e;let a;e.data&&(i=e.data),e.settings&&(r=e.settings,I(e.settings.interactions)),D(),R(i,r,{partialData:t});const{formatters:s,scales:l,components:c=[]}=r;w.update({components:c,data:i,excludeFromUpdate:o,formatters:s,scales:l}),w.forEach((e=>{e.updateWith&&e.instance.set(e.updateWith)})),w.forEach((e=>{e.updateWith&&e.instance.beforeUpdate()}));const u=[],h=[];let f;if(t)w.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible&&u.push(e)})),f=u;else{const{visible:e,hidden:t,ordered:n}=k();d=e,f=e,a=n,e.forEach((e=>{e.updateWith&&e.visible?u.push(e):h.push(e)})),t.forEach((e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1}))}h.forEach((e=>e.instance.beforeMount())),h.forEach((e=>e.instance.mount())),f.forEach((e=>e.instance.beforeRender())),f.forEach((e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()})),t||Hh(n,a),h.forEach((e=>e.instance.mounted())),u.forEach((e=>e.instance.updated())),d.forEach((e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1})),A()},u.destroy=()=>{N(),w.destroy(),L(),I(),delete u.update,delete u.destroy,E()},u.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=[];return d.filter((e=>null==i||e.key===i)).forEach((i=>{const o=i.instance.getBrushedShapes(e,t,n);r=[...r,...o]})),r},u.findShapes=e=>{let t=[];return d.forEach((n=>{const i=n.instance.findShapes(e);t=[...t,...i]})),t},u.componentsFromPoint=e=>O(e).map((e=>e.instance.ctx)),u.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=[];const r=n.getBoundingClientRect();let o=d;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map((e=>e.key));o=d.filter((t=>-1!==e.indexOf(t.key))).map((n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]})))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=Bh(e,r,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(i=[...i,...l],i.length>0&&c)return i}return i},u.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const i=t.components[n].key;d.filter((e=>i===e.key)).forEach((i=>{let r=e.filter((e=>e.key===i.key));i.instance.brushFromShapes(r,t.components[n])}))}},u.scroll=function(){return function(e,t){return t[e]||(t[e]=Pc()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",m)},u.dataset=e=>y(e),u.dataCollection=e=>x(e),u.scales=function(){return f.all()},u.formatters=function(){return p.all()},u.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return v[e]||(v[e]=Jc()),v[e]},u.scale=function(e){return f.get(e)},u.formatter=function(e){return p.get(e)},u.toggleBrushing=function(e){b=void 0!==e?e:!b},u.component=e=>{const t=w.findComponentByKey(e);return null==t?void 0:t.instance.ctx},u.logger=()=>s,u.theme=()=>l,u.storage=Bu({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(u,"interactions",{get:()=>({instances:g,on(){P(),g.forEach((e=>e.on()))},off(){L(),g.forEach((e=>e.off()))}})}),S(),n&&(_(),T(),q(n),u.element=n),u}const Wh=e=>{let t=io(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var Uh=io();function Yh(e,t,n){let{key:i}=n;const r={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return r.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(r.value),e.field&&(r.source={key:i,field:e.field.key()}),r}const Gh=e=>e.filter((e=>"number"==typeof e&&!isNaN(e)));const Xh=e=>{let{key:t,data:n,cache:i,config:r}=e;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let{data:t,config:n}=e;const i=t.split("\n"),r=i[0],o=i[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(r){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(r&&o){if(n.test(r)&&n.test(o)&&r.split(n).length===o.split(n).length){a=n;break}}else n.test(r)&&(a=n)}}return i.map((e=>e.split(a)))})({data:n,config:r})),Array.isArray(o)&&function(e){let t,{source:n,data:i,cache:r,config:o}=e,a=i;const s=o&&o.parse;Array.isArray(i[0])?s&&!1===s.headers?t=i[0].map(((e,t)=>t)):(t=i[0],a=i.slice(1)):t=Object.keys(i[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map((e=>({key:e,title:e}))),Array.isArray(i[0])?c=u.map((()=>[])):(c={},u.forEach((e=>{c[e.key]=[]})));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const h=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=h(e),i=Gh(t),o=i.length>0,a=o?"measure":"dimension",s=o?Math.min(...i):NaN,l=o?Math.max(...i):NaN;r.fields.push(Ns(ji({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:i,source:t,config:r})};function Kh(){let{key:e,data:t,config:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[]},r={key:()=>e,raw:()=>t,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i,matrix:t}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let i=[];return n.forEach((e=>{if(void 0!==e.field){const n=t.field(e.field),r=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const{props:o,main:a}=Ps(e,t),s=Object.keys(o),l=!!e.trackBy,c=typeof e.trackBy,u={},h=[],d=n.items(),f=[];for(let t=0;t<d.length;t++){const n=d[t];if(a.filter&&!a.filter(n))continue;const i=Yh(a,n,{key:r});s.forEach((e=>{const a=o[e];let s=a.field?a.field.items()[t]:n;i[e]=Yh(a,s,{key:r})})),l&&zs({cfg:e,itemData:n,obj:i,target:h,tracker:u,trackType:c}),f.push(i)}i=l?[...i,...Ts(h,{main:a,propsArr:s,props:o})]:[...i,...f]}})),i}(e,r),hierarchy:()=>null};return Xh({key:e,data:t,config:n,cache:i}),r}Kh.util={normalizeConfig:Ps,collect:Ts,track:zs};const Zh=io();Zh.default("matrix"),Zh("matrix",Kh),Zh("default",Kh);const Jh=io();function Qh(e,t,n){return Math.max(e,Math.min(t,n))}function ed(e){let{item:t,value:n,boxCenter:i,rendWidth:r,rendHeight:o,flipXY:a,symbol:s}=e,l="x",c="y",u=r,h=o,d=n<.5?90:-90;return a&&(l="y",c="x",u=o,h=r,d=n<.5?180:0),s(ji({},t.oob,{[l]:i*u,[c]:Math.max(t.oob.size/2,Math.min(n*h,h-t.oob.size/2)),startAngle:d}))}function td(e){let{item:t,boxWidth:n,boxPadding:i,rendWidth:r,rendHeight:o,flipXY:a}=e,s="x",l="y",c="width",u="height",h=r,d=o;a&&(s="y",l="x",c="height",u="width",h=o,d=r);const{actualDiff:f,actualLow:p}=function(e){let{start:t,end:n,minPx:i=.1,maxPx:r=1}=e;const o=Math.max(t,n),a=Math.min(t,n),s=Qh(-.1,1.2,o),l=Qh(-.1,1.2,a),c=s*r-l*r,u=Math.max(i,c),h=(u-c)/2;return{actualDiff:u,startModifier:h,actualLow:l*r-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d});return ji({},t.box,{type:"rect",[s]:(i+t.major)*h,[l]:p,[u]:f,[c]:n*h,data:t.data||{},collider:{type:null}})}function nd(e){let{item:t,from:n,to:i,boxCenter:r,rendWidth:o,rendHeight:a,flipXY:s}=e,l="x1",c="y1",u="x2",h="y2",d=o,f=a;return s&&(l="y1",c="x1",u="y2",h="x2",d=a,f=o),ji({},t.line,{type:"line",[h]:Math.floor(n*f),[l]:r*d,[c]:Math.floor(i*f),[u]:r*d,data:t.data||{},collider:{type:null}})}function id(e){let{item:t,key:n,position:i,width:r,boxCenter:o,rendWidth:a,rendHeight:s,flipXY:l}=e,c="x1",u="y1",h="x2",d="y2",f=a,p=s;l&&(c="y1",u="x1",h="y2",d="x2",f=s,p=a);const m=r/2;return ji({type:"line"},t[n],{[u]:Math.floor(i*p),[c]:(o-m)*f,[d]:Math.floor(i*p),[h]:(o+m)*f,r:m*f,cx:o*f,cy:i*p,width:r*f,data:t.data||{},collider:{type:null}})}function rd(e,t,n){const{width:i,maxWidthPx:r,minWidthPx:o}=t.box,a=e>=0?1:-1;let s=Math.min(a*e*i,isNaN(r)?n:r/n);return s=isNaN(o)?s:Math.max(o/n,s),s*a}Jh("native",(function(e,t,n){let i,r,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&Object.keys(i.events).forEach((e=>{const t=i.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})}))}function c(){a.forEach((e=>{let{key:t,listener:i}=e;n.removeEventListener(t,i)})),a=[]}return{get key(){return r},set(e){!function(e){r=e.key,i=e,i.events=i.events||[],void 0===i.enable&&(i.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,i=null}}}));const od={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},ad=Object.keys(od),sd={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let{data:t}=e;const{width:n,height:i}=this.rect,r="horizontal"===this.settings.settings.orientation,{style:o,resolver:a,symbol:s}=this,l=ad.filter((e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show)),c={};l.forEach((e=>c[e]=od[e]));const u=function(e){let{keys:t,data:n,defaultSettings:i,style:r,settings:o,width:a,height:s,resolver:l}=e;const c=ji(!0,{},i||{},r||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},h=o.major;let d;d="object"==typeof h&&"object"==typeof h.ref&&void 0!==h.ref.start&&void 0!==h.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ji(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof h&&void 0!==h.binStart&&void 0!==h.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ji(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const f=o.minor||{},p={};["start","end","min","max","med"].forEach((e=>{(f[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:f.scale,ref:e})}));let m,g={major:d,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:ji(!0,{},p,f)})};for(let e=0,i=t.length;e<i;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:l,data:t,defaultSettings:c,style:o,settings:this.settings.settings,width:n,height:i,resolver:a}),{settings:h,items:d}=u,f=function(e){let{width:t,height:n,flipXY:i,resolved:r,keys:o,symbol:a}=e;const s=[],l=r.major.items;if(!l.length)return s;const c=t,u=n,h=i?n:t,d=r.major.settings,f=["start","end","min","max","med"].filter((e=>void 0!==r.minor.settings[e])),p=f.length,m=o.filter((e=>"oob"!==e));let g,y,x,v,b,w,M,k,S;const _=o?o.length:0,q=m?m.length:0,D={box:function(){x.box&&Ui(x.start)&&Ui(x.end)&&g.push(td({item:x,boxWidth:v,boxPadding:b,rendWidth:c,rendHeight:u,flipXY:i}))},line:function(){Ui(x.min)&&Ui(x.start)&&g.push(nd({item:x,from:x.min,to:x.start,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),Ui(x.max)&&Ui(x.end)&&g.push(nd({item:x,from:x.max,to:x.end,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},median:function(){x.median&&Ui(x.med)&&g.push(id({item:x,key:"median",position:x.med,width:v,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))},whisker:function(){if(x.whisker){const e=v*x.whisker.width;Ui(x.min)&&g.push(id({item:x,key:"whisker",position:x.min,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i})),Ui(x.max)&&g.push(id({item:x,key:"whisker",position:x.max,width:e,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i}))}}};function A(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let i=0;i<p;i++)e=x[f[i]],Ui(e)&&(t<e&&(t=e),n>e&&(n=e));M=t<0&&t!==-Number.MAX_VALUE,k=n>1&&n!==Number.MAX_VALUE,S=M||k}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let f=null,p=null;void 0!==d.binStart?(f=t.binStart,p=t.binEnd,y=d.binStart.scale):(y=d.major.scale,f=y?t.major:0);let C=0;y?y.bandwidth?(C=y.bandwidth(),f-=C/2):C=p-f:C=1,x=ji({},{major:f,majorEnd:p},r.minor.items[e]);for(let t=0;t<_;t++)x[o[t]]=r[o[t]].items[e];if(v=rd(C,x,h),b=(C-v)/2,w=b+x.major+v/2,A(),S)x.oob&&(M?g.push(ed({item:x,value:0,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})):k&&g.push(ed({item:x,value:1,boxCenter:w,rendWidth:c,rendHeight:u,flipXY:i,symbol:a})));else for(let e=0;e<q;e++)x[m[e]]&&!1===x[m[e]].show||D[m[e]]();const N={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(N)}return s}({items:d,settings:h,width:n,height:i,flipXY:r,resolved:u,keys:l,symbol:s});return f}};const ld={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},cd=/px$/,ud={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},hd={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function dd(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function fd(e,t,n,i){let{width:r,height:o}=t;return e.filter((e=>!1!==e.show&&!isNaN(e.x+e.y))).map((e=>{let t=e,a=cd.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);Yi(a)&&(t=ld,a=n.min+t.size*(n.max-n.min));const[s,l]=function(e){let t=ud.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),c=$i($i({},l),{},{type:s,label:e.label,x:e.x*r,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity});t===e.errorShape&&(c.width=t.width);const u=i(c);return u.data=e.data,u}))}const pd={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let{data:t}=e;const n=this.resolver.resolve({data:t,defaults:ji({},ud,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),{width:i,height:r}=this.rect,o=ji({},hd,this.settings.settings.sizeLimits),a=n.items,s=function(e,t,n,i,r){const o=dd(e?e.scale:void 0,n),a=dd(t?t.scale:void 0,i);let s=Math.min(o.value*r[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*r[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*r[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*r[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:r.maxPx,minGlobal:r.minPx}}(n.settings.x,n.settings.y,i,r,o);return fd(a,this.rect,s,this.settings.shapeFn||this.symbol)}};Math.PI;const md={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function gd(e,t,n,i){let{x:r,y:o,width:a,height:s}=t;const l=qr(),c={x:r+a/2,y:o+s/2},u=Math.min(a,s)/2,h=Math.min(a,s)/2,d=h/100;return e.map(((e,t)=>{const r=n[t];r.type="path";const o=h*r.outerRadius,a=u*r.innerRadius,s=d*r.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),r.arcDatum=e;const f=l.centroid(e),p=r.offset?function(e,t,n,i){let[r,o]=e;const a=Math.sqrt(r*r+o*o);r/=a,o/=a;const s=n-i;return{x:r*t*s,y:o*t*s}}(f,r.offset,o,a):{x:0,y:0};return r.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),r.desc={share:e.value/i,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},r}))}function yd(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const xd={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let{data:t}=e;const n=[],i=[],r=this.settings.settings,{items:o}=this.resolver.resolve({data:t,defaults:ji({},md,this.style.slice),settings:r.slice});let a=0;for(let e=0,t=o.length;e<t;e++){const t=yd(r,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),i.push(o[e]),a+=t)}const s=function(){var e=Ir,t=Rr,n=null,i=sr(0),r=sr(xr),o=sr(0);function a(a){var s,l,c,u,h,d=a.length,f=0,p=new Array(d),m=new Array(d),g=+i.apply(this,arguments),y=Math.min(xr,Math.max(-xr,r.apply(this,arguments)-g)),x=Math.min(Math.abs(y)/d,o.apply(this,arguments)),v=x*(y<0?-1:1);for(s=0;s<d;++s)(h=m[p[s]=s]=+e(a[s],s,a))>0&&(f+=h);for(null!=t?p.sort((function(e,n){return t(m[e],m[n])})):null!=n&&p.sort((function(e,t){return n(a[e],a[t])})),s=0,c=f?(y-d*v)/f:0;s<d;++s,g=u)l=p[s],u=g+((h=m[l])>0?h*c:0)+v,m[l]={data:a[l],index:s,value:h,startAngle:g,endAngle:u,padAngle:x};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:sr(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:sr(+e),a):i},a.endAngle=function(e){return arguments.length?(r="function"==typeof e?e:sr(+e),a):r},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:sr(+e),a):o},a}().sortValues(null);s.startAngle(r.startAngle),s.endAngle(r.endAngle),s.padAngle(r.padAngle);return gd(s(n),ji({},this.rect,{x:0,y:0}),i,a)}};const vd=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],i=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach((e=>{const n=Math.round(t[e.key]),r=t[e.key]-n;t[e.key]=n,i&&"append"===e.type&&(r>0?t[e.key]+=.5:t[e.key]-=.5)}))}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach((t=>{const n=e[t];n.items=[],n.append.forEach((e=>{n.items.push({key:e,type:"append"})})),n.round.forEach((e=>{n.items.push({key:e,type:"round"})}))})),t.multiple=e=>e.forEach((e=>t(e))),t}();class bd{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const i=e.substring(0,1);if("x"===i||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===i||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,i=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let i=n?this.height:this.width,r=n?this.width:this.height;e=e.fn({width:i,height:r,flipXY:n});const o=Object.keys(e);for(let i=0,r=o.length;i<r;i++){let r=o[i];t[bd.evaluateKey(r,n)]=e[r]}}else{const i=Object.keys(e);for(let r=0,o=i.length;r<o;r++){let o=i[r];const a=bd.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return i&&vd(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function wd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new bd(...t)}function Md(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const kd={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=wd(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,uu(this,"x",this.rect.width),uu(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=ji({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=ji({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Md(this.x,this.rect.width),this.lines.y=Md(this.y,this.rect.height),this.lines.y=this.lines.y.map((e=>ji(e,{flipXY:!0})));let e=e=>{let{dir:t,isMinor:n}=e,i=this.lines[t].filter((e=>!!e.isMinor===n)),r=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:r,data:{items:i,dir:t}}).items.forEach((e=>{let n=e.data;var i,r;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(i=n.value)&&void 0!==i?i:null===(r=n.data)||void 0===r?void 0:r.value,dir:t})}))};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function Sd(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(r?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function _d(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===i||"right"===i){let r="right"===i;return"\n M ".concat(e+=r?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(r?e+n:e-n," ").concat(t," Z\n ")}let r="bottom"===i;return t+=r?1.5*n:-1.5*n,"\n M ".concat(e-n," ").concat(t,"\n L ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(r?t+n:t-n," Z\n ")}function qd(e,t,n){return e<t||e>n}function Dd(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function Ad(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function Cd(e){let{chart:t,blueprint:n,renderer:i,p:r,settings:o,items:a,slopeLine:s}=e,l=!0,c=!1,u=!1,h=!1,d=!1,f=ji(!0,{},o.style.line,r.line||{}),p=ji(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:f.stroke});if(c=s?n.processItem({type:"line",x1:s.x1,y1:s.y1,x2:s.x2,y2:s.y2,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:!1,value:r.valueInfo?r.valueInfo.id:r.value}):n.processItem({type:"line",x1:r.position,y1:0,x2:r.position,y2:1,stroke:f.stroke||"black",strokeWidth:f.strokeWidth||1,strokeDasharray:f.strokeDasharray,flipXY:r.flipXY||!1,value:r.valueInfo?r.valueInfo.id:r.value}),r.label){const e=ji(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},o.style.label||{},{fill:f.stroke},r.label);let s,c={width:0,height:0},p="";s=Dd(r,t),!1!==r.label.showValue&&(s?p=" (".concat(s(r.value),")"):r.scale&&(p=" (".concat(r.value,")"))),p&&(c=i.measureText({text:p,fontFamily:e.fontFamily,fontSize:e.fontSize}));let m=i.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:m.width+c.width,height:Math.max(m.height,c.height)},y=e.padding,x=Ad(r.flipXY?e.vAlign:e.align),v=Ad(r.flipXY?e.align:e.vAlign),b=Math.min(1+g.width+2*y,e.maxWidth*n.width,e.maxWidthPx),w=g.height+2*y,M=r.flipXY?w:b,k=r.flipXY?b:w;if(u=n.processItem({fn:t=>{let{width:i,height:o}=t,a=r.position*i-(r.flipXY?w:b)*(1-x);a=r.flipXY?a:Math.max(a,0);return{type:"rect",x:a,y:Math.max(Math.abs(v*o-k*v),0),width:r.flipXY?M:Math.min(M,n.width-a),height:k,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:r.flipXY||!1}),u.x<-1||u.x+u.width>n.width+1||u.y<-1||u.y+u.height>n.height+1)u=void 0;else{h={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:u.x+y,y:u.y+u.height/2+g.height/3,maxWidth:u.width-2*y-c.width,anchor:"start"},p&&(d={type:"text",text:p||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+3+(u.width-(c.width+2*y)),y:h.y});for(let e=0,t=a.length;e<t;e++){let t=a[e];"rect"===t.type?oh(u,t)&&(l=!1):"line"===t.type&&r.flipXY===t.flipXY&&lh(u,t)&&(l=!1)}}}if(c&&a.push(c),0!==(null==s?void 0:s.slope)&&(null!=s&&s.showLabel||null!=s&&s.showValue)){let e,o;const l=120;let u=s.showLabel?s.refLineLabel:"";if(s.showValue){const n=Dd(r,t),i=n?n(s.value):s.value;e="(".concat(s.slope,"x + ").concat(i,")"),u+=s.refLineLabel?" ".concat(e):e}if(u.length>1){var m;const e=i.measureText({text:u,fontFamily:p.fontFamily,fontSize:p.fontSize});e.width=e.width>l?l:e.width;const r=function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});if(t>0){if(i.max()*t+n>=r.max())return!0}else if(t<0&&i.min()*t+n>=r.max())return!0;return!1}(t,s.slope,s.value)?function(e,t,n){const i=e.scale({scale:"x"}),r=e.scale({scale:"y"});return i((r.max()-n)/t)}(t,s.slope,s.value):void 0,h=void 0===r||s.isRtl?p.padding:3*p.padding,d=void 0!==r||s.slope>0?3*p.padding:p.padding,g=function(e,t,n,i,r,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*r.width+a;if(1===n)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding);if(n>.8)return e.isRtl?n*r.width-(i.width+3*o.padding):n*r.width-(i.width+6*o.padding)}else if(e.slope>0)return t.x2-(i.width+2*o.padding);return e.isRtl?t.x1-(i.width+2*o.padding):t.x1}(s,c,r,e,n,p),y=Math.min(c.y1,c.y2);s.labelStroke&&(o={type:"rect",x:s.isRtl?Math.max(g,h)-2:Math.max(g,h)+2,y:Math.abs(Math.max(y,d)-e.height),rx:3,ry:3,width:e.width+p.padding,height:e.height-2,stroke:f.stroke,fill:f.stroke});const x={type:"text",text:u,fill:null!==(m=s.labelStroke)&&void 0!==m?m:f.stroke,opacity:p.opacity,fontFamily:p.fontFamily,fontSize:p.fontSize,x:o?o.x+2:Math.max(g,h)+2,y:o?o.y+e.height-p.padding:Math.abs(Math.max(y,d)-p.padding/2),anchor:"start",title:u,maxWidth:l,width:e.width};(function(e,t,n,i,r){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+i,t.width+i)&&Math.abs(a.y-t.y)<n.height+r)return!0}return!1})(a,x,e,h,d)||(o&&a.push(o),a.push(x))}}l&&u&&h&&(a.push(u,h),d&&a.push(d))}function Nd(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function Ed(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function Rd(e,t){const n=e.min();if(n===e.max()){const i=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return i?2:-1;if(t>n)return i?-1:2}return e(t)}function Id(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const Od={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=wd(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(Ed).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Rd(t,e.value);return ji(e,{scale:t,position:n})}return ji(e,{position:e.value})})),this.lines.y=this.lines.y.filter(Ed).map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=Rd(t,e.value);return ji(e,{scale:t,position:n,flipXY:!0})}return ji(e,{position:e.value,flipXY:!0})})),this.lines.x=this.lines.x.filter((e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(Nd(e)),!1))),this.lines.y=this.lines.y.filter((e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(Nd(e)),!1))));let n=[];return[...this.lines.x,...this.lines.y].forEach((i=>{if(!0===i.show||void 0===i.show){let r;if(i.slope&&0!==i.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();r=$i($i({},i),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*i.slope+i.value,u=a*i.slope+i.value,h=(s-i.value)/i.slope,d=(l-i.value)/i.slope;let f=[];qd(c,s,l)||(f[0]={x:Rd(e,o),y:Rd(n,c)}),qd(h,o,a)||(f[1]={x:Rd(e,h),y:1}),qd(u,s,l)||(f[2]={x:Rd(e,a),y:Rd(n,u)}),qd(d,o,a)||(f[3]={x:Rd(e,d),y:0});if(f.filter((e=>!!e)).length>2&&function(e){Id(e[0],e[1])&&(e[1]=void 0),Id(e[1],e[2])&&(e[2]=void 0),Id(e[2],e[3])&&(e[3]=void 0),Id(e[3],e[0])&&(e[3]=void 0)}(f),f=f.filter((e=>!!e)),f.length<2)return void t["y".concat(c>l?0:1)].push(Nd(i));r.x1=f[0].x,r.y1=f[0].y,r.x2=f[1].x,r.y2=f[1].y}else r=void 0;Cd({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:i,settings:e,items:n,slopeLine:r})}})),e.style.oob.show&&function(e){let{blueprint:t,oob:n,settings:i,items:r}=e;const o=Object.keys(n);let a=i.style.oob||{};for(let e=0,i=o.length;e<i;e++){const i=o[e],s=n[i];if(s.length>0){let e=i.charAt(1),n="y"===i.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let{width:i,height:r}=t,u=e*i+("1"===e?-o:o),h=n?l:r-l;return"arc"===a.type?{type:"path",d:Sd(n?h:u,n?u:h,a.width,c),x:u,y:h,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:h,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),h=u.cx||u.x,d=u.cy||u.y,f={type:"text",text:s.length||"",x:h-.4*a.width,y:d+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},p={type:"path",d:_d(h,d,a.width,c),x:h,y:d,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};r.push(u,f,p)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function Pd(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){ji(e,t.style)}(t,e),t}function Ld(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Td(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const i=n.angle*(Math.PI/180),r=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&i<0,s="start"===t.anchor&&i>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-r,y:l},{x:t.x+r,y:l}].map((e=>Ru(e,i,{x:t.x,y:t.y}))),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},h={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},d=i>=0?[u,h]:[h,u];c.push(...d),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const i=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:i,y:0,width:i<0?n.stepSize+i:n.stepSize,height:n.innerRect.height}}else{const i=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:i,width:n.innerRect.width,height:i<0?n.stepSize+i:n.stepSize}}const i=t.collider;i.x=Math.max(i.x,0),i.y=Math.max(i.y,0);const r=i.x+i.width-(n.outerRect.x+n.outerRect.width);i.width=r>0?i.width-r:i.width;const o=i.y+i.height-(n.outerRect.y+n.outerRect.height);i.height=o>0?i.height-o:i.height}(e,t,n)}function zd(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let i=0;if(e.tilted)i=e.stepSize*n;else{const r=t?e.textRect.height:e.textRect.width;i=Math.max(0,e.stepSize-r)*n}return i}function Fd(e,t){var n,i;const r={type:"text",text:Ld(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(i=e.data)||void 0===i?void 0:i.value};return"top"===t.align||"bottom"===t.align?(r.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+zd(t,!1),r.y="top"===t.align?t.innerRect.height:0,r.anchor=t.stepSize?"start":"middle",r.x+=isNaN(t.style.offset)?0:+t.style.offset):(r.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+zd(t,!0),r.x="left"===t.align?t.innerRect.width:0,r.anchor="left"===t.align?"end":"start",r.baseline=t.stepSize?"text-before-edge":"central",r.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(r,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,i=t.outerRect.width,r=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-r,a=e.x+r;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>i&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,i=t.outerRect.height,r=t.maxHeight/2,o=e.y-r,a=e.y+r;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>i&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(r,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(r,t),function(e,t){if(t.tilted){const n=-t.angle,i=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(i)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(i)/2):e.x-=t.maxHeight*Math.sin(i)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const r=Math.cos(i)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+r>n&&(e.maxWidth=(n-e.x-10)/Math.cos(i))}else{const n=t.paddingEnd;e.x-r<n&&(e.maxWidth=(e.x-n-10)/Math.cos(i))}}}(r,t),function(e,t){e.boundingRect=t.textBounds(e)}(r,t),Td(e,r,t),r}function jd(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){ji(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function Vd(e){return!e.isMinor&&e.position>=0&&e.position<=1}function Bd(e){let{rect:t,state:n,majorTicks:i,measure:r,horizontal:o}=e;return o?function(e){let{majorTicks:t,measureText:n,rect:i,state:r}=e;const o="layered"===r.labels.activeMode?2:1,a=i.width,s=t.map((e=>e.label)).map((e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":""))).map(n).map((e=>e.width));for(let e=0;e<t.length;++e){const n=t[e];if(o*a*Math.abs(n.start-n.end)<s[e])return!0}return!1}({majorTicks:i,measureText:r,rect:t,state:n}):function(e){let{majorTicks:t,measureText:n,rect:i}=e;const r=i.height,o=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<o}({majorTicks:i,measureText:r,rect:t,state:n})}function Hd(e){let{value:t,maxValue:n,minValue:i,range:r,modifier:o}=e;return isNaN(r)||isNaN(o)||(t=r*o),t>n&&(t=n),t<i&&(t=i),t}function $d(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const c={left:0,top:0,right:0,bottom:0},{maxLengthPx:u,minLengthPx:h}=a.labels;if(a.labels.show){const e=a.align,d="top"===e||"bottom"===e,f=d?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:f,formatter:i}).filter(Vd),m=e=>{const t=r({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=Hd({value:t.width,maxValue:u,minValue:h}),t};if(t&&d&&"auto"===a.labels.mode&&(!function(e){let{majorTicks:t,measure:n,rect:i,state:r,settings:o}=e;const a=o.labels.maxGlyphCount,s="layered"===r.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=i.width;let h=0,d=0;if(isNaN(a))for(let e=0;e<t.length;e++){const i=t[e],r=i.label,o=n(r).width*(r.length>1?l:1);if(d=s*u*Math.abs(i.start-i.end),o+c>d)return!0}else if(d=s*u*t.reduce(((e,t)=>Math.min(Math.abs(t.start-t.end),e)),1/0),h=n("M").width*l*a,h+c>d)return!0;return!1}({majorTicks:p,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&Bd({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:d})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>Hd({value:t.width,maxValue:u,minValue:h})*Math.sin(e)+t.height*Math.cos(e)}else g=d?e=>e.height:e=>Hd({value:e.width,maxValue:u,minValue:h});if(d&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map((e=>e.label));else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const x=y.map(m),v=x.map(g),b=Math.max(...v,0);if(l+=b,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),i=(b-m("M").height*Math.cos(t))/Math.sin(t),r=e=>Math.min(i,e.width)*Math.cos(t)+e.height,o=(t,i)=>{const r=p[i]?p[i].position:0;return e?t-r*n.inner.width:t-(1-r)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...x.map(r).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let{majorTicks:t,measureText:n,rect:i,bleedSize:r,angle:o}=e;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(i.outer.width-r,i.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const Wd=(e,t,n)=>e.width*Math.abs(t.position-n.position);function Ud(e){let{layered:t,major:n,innerRect:i,outerRect:r,tick:o,index:a}=e;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?Wd(i,o,l)/2-2:1/0,h=c?Wd(i,o,c)/2-2:1/0;return n.length<2?i.width:l?c?2*Math.min(u,h):(e=>{let{innerRect:t,outerRect:n,tick:i,prevWidth:r}=e;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*i.position+a,l=2*Math.min(r,s),c=1===i.position?t.width/2-2:0;return Math.max(r,l,c)})({innerRect:i,outerRect:r,tick:o,prevWidth:u}):(e=>{let{innerRect:t,outerRect:n,tick:i,nextWidth:r}=e;const o=t.x-n.x,a=t.width*i.position+o,s=2*Math.min(r,a),l=0===i.position?t.width/2-2:0;return Math.max(r,s,l)})({innerRect:i,outerRect:r,tick:o,nextWidth:h})}function Yd(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},i=Math.min(t.height,t.width)/2*e.radius,r=i+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:i,outerRadius:r}},ticks:[]};return function(e,t){ji(e,t.style)}(o,e),o}function Gd(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function Xd(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=Gd(i.cx,i.cy,r+s,c),h=Gd(i.cx,i.cy,r,c),d={type:"line",x1:u.x,y1:u.y,x2:h.x,y2:h.y,value:e.value};return function(e,t){const n=$i({},t.style);ji(e,n)}(d,t),d}function Kd(e){return"string"==typeof e||"number"==typeof e?e:"-"}function Zd(e,t,n){let i;return i="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),i}function Jd(e,t){const n=t.innerRect,i={cx:n.width/2,cy:n.height/2},r=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,h;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,h=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const d=function(e,t,n,i){return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}(i.cx,i.cy,r+s+6,u);let f;f="left"===h?"end":"right"===h?"start":"middle";const p={type:"text",text:Kd(e.label),align:h,x:d.x,y:d.y,maxHeight:t.maxHeight,maxWidth:Zd(t,h,d),anchor:f,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach((n=>{e[n]=t.style[n]}))}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let i,r;const o=parseFloat(n.fontSize)||0;i=t.y-o/2,r=e.innerRect.height-(t.y+o/2),(i<0||r<0)&&(n.text="")}(t,d,p),p}function Qd(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function ef(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function tf(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Qd(e)+e.labels.margin,t}function nf(e,t){return e.map((e=>jd(e,t)))}function rf(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function of(e){let{textMetrics:t,settings:n,innerRect:i,scale:r,tilted:o,layered:a,tick:s}=e;const l=t.height,c=rf(r,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=i.width-tf(n)-n.paddingEnd;else if(a)u.width=c*i.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(i.height-tf(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*i.width;return u.width=Hd({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function af(e){let{textMetrics:t,settings:n,innerRect:i,outerRect:r,tilted:o,layered:a,tick:s,index:l,major:c}=e;const u=t.height,h={width:0,height:u};if("left"===n.align||"right"===n.align)h.width=i.width-tf(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);h.width=(i.height-tf(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else h.width=Ud({layered:a,major:c,innerRect:i,outerRect:r,tick:s,index:l});return h.width=Hd({value:h.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),h}function sf(e){let t;function n(){return t=af,n}function i(){return t=of,i}function r(e){let{settings:n,scale:i,innerRect:r,outerRect:o,measureText:a,ticks:s,state:l,textBounds:c}=e;const u=[],h=function(e){return e.filter((e=>!e.isMinor))}(s),d=function(e){return e.filter((e=>e.isMinor))}(s),f={innerRect:r,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(f.startAngle=n.arc.startAngle,f.endAngle=n.arc.endAngle,f.radius=n.arc.radius),n.line.show&&(f.style=n.line,f.padding=n.paddingStart,n.arc?u.push(Yd(f)):u.push(Pd(f))),n.ticks.show&&(f.style=n.ticks,f.tickSize=n.ticks.tickSize,f.padding=Qd(n),n.arc?(f.padding=ef(n),g=function(e,t){return e.map((e=>Xd(e,t)))}(h,f)):g=nf(h,f)),n.labels.show){const e=tf(n);f.style=n.labels,f.padding=e,f.tilted=p,f.layered=m,f.angle=n.labels.tiltAngle,f.paddingEnd=n.paddingEnd,f.textBounds=c;const l=(e,l)=>{f.textRect=function(e){let{style:t,measureText:n,tick:i}=e;return n({text:i.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:f.style});const c=t({textMetrics:f.textRect,settings:n,innerRect:r,outerRect:o,scale:i,tilted:p,layered:m,tick:e,major:h,index:l});f.maxWidth=c.width,f.maxHeight=c.height,f.stepSize=function(e){let{innerRect:t,scale:n,settings:i,tick:r}=e;return("top"===i.align||"bottom"===i.align?t.width:t.height)*rf(n,r)}({innerRect:r,scale:i,ticks:s,settings:n,tick:e})};let d=[];n.arc?(f.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=ef(e)+e.labels.margin,t}(n),d=function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=Jd(e,t);return r.data=e.data,r}))}(h,f,l)):d=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map(((e,i)=>{n(e,i);const r=Fd(e,t);return r.data=e.data,r}))}(h,f,l):function(e,t,n,i){const r=t.padding,o=tf(n);return e.map(((e,a)=>{i(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?r:s;const l=Fd(e,t);return l.data=e.data,l}))}(h,f,n,l),n.labels.filterOverlapping&&function(e,t,n){let i=(t,n)=>oh(er(1,e[t].boundingRect),er(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);i=(n,i)=>{const r=1/Math.abs(e[n].x-e[i].x),o=Math.sin(t*(Math.PI/180))/r;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let r=n+1;r<=Math.min(n+5,n+(e.length-1));r++)e[n]&&e[r]&&i(n,r)&&(r===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(r,1),t&&t.splice(r,1)),r--,n--)}(d,g,f),u.push(...d)}return n.minorTicks&&n.minorTicks.show&&d.length>0&&(f.style=n.minorTicks,f.tickSize=n.minorTicks.tickSize,f.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...nf(d,f))),g&&u.push(...g),u}return n.build=r,i.build=r,e?i():n()}const lf={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},cf={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const uf={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let{state:t,style:n,settings:i}=e;const r=ji(!0,{},t.isDiscrete?lf:cf,n),o=ji(!0,{},r,i.settings),a=i.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],i=["left","right"];return-1!==n.indexOf(e)&&-1===i.indexOf(t)||-1!==i.indexOf(e)&&-1===n.indexOf(t)?e:t}(i.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const{paddingStart:s,paddingEnd:l}=o;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=sf(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const i=t.labels.mode;return n&&e.isHorizontal?"auto"===i?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?i:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const{formatter:t,state:n,scale:i}=this,r=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=hu(i,r);const o=function(e){let{isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s}=e,l=0;const{size:c,edgeBleed:u,isToLarge:h}=$d({isDiscrete:t,rect:n,formatter:i,measureText:r,scale:o,settings:a,state:s});if(l+=c,h)return{size:l};if(a.ticks.show&&(l+=a.ticks.margin,l+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>l&&(l=e)}if(a.line.show){const e=a.line.strokeWidth/2;l+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return l+=a.paddingStart,l+=a.paddingEnd,{size:l,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{settings:t}=e;this.setState(t)},resize(e){const{inner:t,outer:n}=e,i=ji({},t,function(e){let{align:t,inner:n}=e;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),r=n||i;return ji(this.state.innerRect,i),ji(this.state.outerRect,r),n},beforeRender(){const{scale:e,formatter:t}=this,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=hu(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter((e=>e.position>=0&&e.position<=1))},render(){const{state:e}=this,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),vd.multiple(t),t}};const hf={render:()=>[]};function df(e,t,n){let i="";if("function"==typeof e)i=e();else if("string"==typeof e)i=e;else if(n){const e=(n.data().fields||[]).map((e=>e.title()));i=e.join(t)}return i}function ff(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const pf={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=df(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const{title:e,definitionSettings:t,rect:n}=this,i=[];return i.push(function(e){let{title:t,definitionSettings:n,dock:i,rect:r,measureText:o,style:a}=e;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:ff(i,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};ji(s,a.text);const l=o(s);if("top"===i||"bottom"===i){let e=r.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=r.width-(n.paddingRight||0)),s.x=e,s.y="top"===i?r.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===i?-l.height/6:-l.height/3,s.maxWidth=.8*r.width}else{let e=r.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=r.height-n.paddingStart),s.y=e,s.x="left"===i?r.width-n.paddingStart:n.paddingStart,s.dx="left"===i?-l.height/3:l.height/3;const t="left"===i?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*r.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),i},beforeUpdate(e){e.settings&&(ji(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=df(t,n,this.scale)}};function mf(e,t){const n=e.settings.layout.dock,i=e.settings.settings.invert,r="top"===n||"bottom"===n,o=r?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[r?"x":"y"];i&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[r?"x":"y"];if(i&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[r?"x":"y"];i&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),i=l.startScroll+e;s.moveTo(i)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function gf(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const yf={require:["chart","renderer"],on:{panStart(e){const t=gf(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=mf(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=gf(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=gf(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=gf(e,this.renderer);mf(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,i="top"===t||"bottom"===t,r=i?"width":"height",o=this.rect[r],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[i?"left":"top"]:"".concat(s,"px"),[i?"top":"left"]:"25%",[i?"height":"width"]:"50%",[r]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function xf(e){let{h:t,isVertical:n,value:i,pos:r,align:o,borderHit:a,state:s,idx:l}=e;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let h=0,d="100%",f="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(d="".concat(s.targetRect.x+s.targetRect.width,"px"),f="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(h=n?s.targetRect.x:s.targetRect.y,d="".concat(s.rect.width-h,"px"),f="".concat(s.rect.height-h,"px")),c||(r-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":i,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?h:r,"px"),top:"".concat(n?r:h,"px"),height:n?"".concat(a,"px"):f,width:n?d:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:ji({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function vf(e){let{h:t,isVertical:n,label:i,otherValue:r,rangeIdx:o,idx:a,pos:s,align:l,state:c,value:u}=e;const h="end"!==l,d="outside"===c.settings.bubbles.placement;let f,p="none";n?(f=h?"left":"right",d&&(p=h?"translate(-100%, 0px)":"translate(100%, 0px)")):(f=h?"top":"bottom",d&&(p=h?"translate(0px, -100%)":"translate(0px, 100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const x=m?t("input",{type:"text",value:u,style:$i($i({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,r)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":r,"data-idx":o,"data-bidx":a,style:g},[i]);return t("div",{style:{position:"absolute",[f]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[x])}function bf(e){let{h:t,isVertical:n,top:i,height:r,color:o,on:a,opacity:s}=e;return t("div",ji({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(i,"px"),top:n?"".concat(i,"px"):0,height:n?"".concat(r,"px"):"100%",width:n?"100%":"".concat(r,"px"),pointerEvents:"auto"}},a),[])}function wf(e){let{borderHit:t,els:n,isVertical:i,state:r,vStart:o,vEnd:a,idx:s}=e,l=0;r.targetRect&&(l=i?r.targetRect.y:r.targetRect.x);const c=!!r.scale,u=c?r.scale.norm(o)*r.size:o,h=c?r.scale.norm(a)*r.size:a,d=Math.abs(u-h),f=Math.min(u,h)+l,p=f+d;if(r.targetRect){const e=r.targetFillRect||r.targetRect,t=i?e.height:e.width,s=c?r.scale.norm(o)*t:o,l=c?r.scale.norm(a)*t:a,u=Math.abs(s-l),h=Math.min(s,l),d={h:r.h,isVertical:i,top:h,height:u,color:r.style.target.fill,opacity:r.style.target.opacity};r.style.target.opacity<.8&&(d.on={onmouseover(e){e.srcElement.style.opacity=r.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=r.style.target.opacity}}),n.push(r.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[bf(d)]))}const m=u<h?o:a,g=u<h?a:o,[y,x]=c?r.scale.domain():[Math.min(o,a),Math.max(o,a)],v=m+1e-5>=y&&m-1e-5<=x,b=g-1e-5<=x&&g+1e-5>=y;v&&n.push(xf({h:r.h,isVertical:i,borderHit:t,value:m,pos:f,align:"start",state:r,idx:s})),b&&n.push(xf({h:r.h,isVertical:i,borderHit:t,value:g,pos:p,align:"end",state:r,idx:s}));const w=r.settings.bubbles;if(w&&w.show){const e={fontSize:w.fontSize,fontFamily:w.fontFamily,color:w.fill},t=[o,a];v&&n.push(vf({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(r.format(m,t)),pos:f,state:r})),b&&n.push(vf({h:r.h,isVertical:i,align:w.align,style:e,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(r.format(g,t)),pos:p,state:r}))}}function Mf(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let i=e.current-e.start;return i=i<0?Math.max(i,n):Math.min(i,t),i}function kf(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach(((i,r)=>{e.active&&r===e.active.idx||wf({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(i.min,i.max),vEnd:Math.max(i.min,i.max),idx:r})})),e.active){let i=e.start,r=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)i=Math.min(e.active.start,e.active.end),r=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)i=Math.min(e.start,e.current),r=Math.max(e.start,e.current);else{const t=Mf(e);i=e.active.start+t,r=e.active.end+t}wf({borderHit:5,els:t,isVertical:n,state:e,vStart:i,vEnd:r,idx:e.active.idx})}return t}function Sf(e){return{min:e.scale.min(),max:e.scale.max()}}function _f(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function qf(e,t,n){let i,r,o=e.ranges,a=-1;for(i=0;i<o.length;i++){if(o[i].min<=t&&t<=o[i].max){a=i,n.min=i?o[i-1].max:n.min,n.max=i+1<o.length?o[i+1].min:n.max;break}if(t<o[i].min){n.max=o[i].min,n.min=i?o[i-1].max:n.min;break}}-1===a&&o.length&&i>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(r={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=r}function Df(e){e.renderer.render(kf(e))}function Af(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}function Cf(e,t){let n,i=1/0;const r=t.domain(),o=t.bandwidth()/2;for(let a=0;a<r.length;++a){const s=Math.abs(e-o-t(r[a]));s<i&&(i=s,n=r[a])}return n}function Nf(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function Ef(e){return Zi(e.reduce(((e,t)=>(e.push(...Ki(t.bounds)),e)),[]))}const Rf={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=Af(this.state,this.state.brushInstance),this.state.active=null,Df(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),i=this.state.rect[0===this.state.direction?"height":"width"];let r=hu(this.chart.scale(t.scale),i);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,i=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map((t=>e.chart.component(t))).filter((e=>!!e&&!!e.rect)),r=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(r.length>0){const i=Ef(r);if(t.size=i[0===e.state.direction?"height":"width"],t.scale=hu(e.chart.scale(n.scale),t.size),t.targetRect=i,o.length>0){const e=Ef(o);t.targetFillRect=e}}else if(i&&i.length>0){const n=i.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)})),{x0:i[0].rect.computedInner.x,y0:i[0].rect.computedInner.y,x1:i[0].rect.computedInner.x+i[0].rect.computedInner.width,y1:i[0].rect.computedInner.y+i[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(r=o.scale?o.scale:r,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?i:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,i){let r=e.ranges.map((e=>({min:e.min,max:e.max})));const o=e.scale.min(),a=e.scale.max();r[t]={min:Math.max(o,Math.min(n,i)),max:Math.min(a,Math.max(n,i))},e.ranges[t]=$i({},r[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach((t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),r)}))}(this.state,e,t,n),this.emit("bubbleEnd"),Df(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,Df(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:r,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(r,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=r;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=pc(),this.state.scale.data=r.data,this.state.format||(this.state.format=(e,t)=>Nf(r.range(),t)?function(e,t){const n=t.ticks(),i=t.domain().indexOf(Cf(e,t));return-1!==i?n[i].label:"-"}(e,r):"-"),this.state.fauxBrushInstance=Jc(),this.state.findValues=e=>function(e,t){const n=t.domain(),i=t.range(),r=[];return e.forEach((e=>{if(!Nf(i,[e.min,e.max]))return;const o=n.indexOf(Cf(e.min,t)),a=n.indexOf(Cf(e.max,t));r.push.apply(r,n.slice(Math.min(o,a),Math.max(o,a)+1))})),r}(e,r);return this.state.ranges=Af(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[kf(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};t.offset=ji({},i.element().getBoundingClientRect());const u=a-t.offset.left,h=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=r(t,t.fauxBrushInstance||t.brushInstance);const d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(f/t.size),c.start=t.scale.normInvert(d/t.size);let p=t.ranges;const m=Sf(t);let g,y,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),m.min=x>0?p[x-1].max:m.min,m.max=x+1<p.length?p[x+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){x=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===x&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==x)if(y={idx:x,start:p[x].min,end:p[x].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(d-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(d-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!sh(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Af,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Sf(e);qf(e,e.current,n)}(this.state,Af),Df(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,i=e.scale.normInvert(n);e.current=Math.max(Math.min(i,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Mf(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach((n=>{if(e.fauxBrushInstance){let i=Af(e,e.fauxBrushInstance),r=e.findValues(i),o=e.findValues(t),a=o.filter((e=>-1===r.indexOf(e))),s=r.filter((e=>-1===o.indexOf(e))),l=a.map((e=>({key:n.id(),value:e}))),c=s.map((e=>({key:n.id(),value:e})));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)}))}(this.state),Df(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,i={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(i.rangeIdx)||JSON.stringify(i)===JSON.stringify(this.state.edit))return;this.state.edit=i,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const r=n.parentNode;Df(this.state);const o=r.querySelector("input");o.focus(),o.select()}};function If(e){e.renderer.render(kf(e))}function Of(e){return e.rc.ranges()}function Pf(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const Lf={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,i=this.state.rect[0===n?"height":"width"],r=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map((e=>this.chart.component(e))).filter((e=>!!e&&!!e.rect)),a=o[0]?o.slice(1).reduce(((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)})),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=r,this.state.rc=jc(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=i,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const i=Math.min(...n),r=Math.max(...n),o={x:e.direction?i+e.rect.x:e.rect.x,y:e.direction?e.rect.y:i+e.rect.y,width:e.direction?r-i:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:r-i},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce(((n,r)=>{const o=n.bounds,a=r.bounds;return t===i?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:r:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:r})),l=e.settings.brush.components.reduce(((e,t)=>e.key===s.key?e:t));return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let{state:t,e:n,renderer:i,ranges:r,targetSize:o}=e;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);i.element().contains(l)||(l=null);const c={started:!0};t.offset=i.element().getBoundingClientRect(),t.ranges=r(t);const u=a-t.offset.left,h=s-t.offset.top,d=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],f=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=f,m=d;c.start=d,c.current=f;let g=t.ranges;const y=_f(t);let x,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),y.min=b>0?g[b-1].max:y.min,y.max=b+1<g.length?g[b+1].min:y.max;else{for(x=0;x<g.length;x++){if(g[x].min<=m&&m<=g[x].max){b=x,y.min=x?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;break}if(m<g[x].min){y.max=g[x].min,y.min=x?g[x-1].max:y.min;break}}-1===b&&g.length&&x>=g.length&&(y.min=g[g.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==b)if(v={idx:b,start:g[b].min,end:g[b].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=v.start,t=v.end;Math.abs(d-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(d-t)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!sh(t.targetRect,{x:u,y:h})||Object.keys(c).forEach((e=>t[e]=c[e]))}({e:e,state:this.state,renderer:this.renderer,ranges:Of,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=_f(e);qf(e,e.current,n)}(this.state,Of),If(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map((e=>({min:e.min,max:e.max})));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=Mf(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach((t=>{n=[...n,...Pf(e,t)]})),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),If(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function Tf(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],i=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),i=(n&&n.fields||[]).map((e=>e.id())),r=t.brushes().filter((e=>"range"===e.type&&-1!==i.indexOf(e.id)))[0];return r?r.brush.ranges():[]}(e).map((r=>{const o=e.scale(r.min)*n,a=e.scale(r.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?i:l,y:t?s:0,height:t?l:i}}))}function zf(e,t,n,i){function r(){!function(e){e.renderer.render(Tf(e))}(e)}function o(){!function(e){e.renderer.render(Tf(e))}(e)}function a(){!function(e){e.renderer.render(Tf(e))}(e)}e.brush=t,t&&(t.on("start",r),t.on("update",o),t.on("end",a),e.start=r,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=i)}function Ff(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const jf={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",i="horizontal"===n?this.rect.width:this.rect.height,r=hu(this.chart.scale(e.scale),i);return Ff(this.state),zf(this.state,t,r,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,Tf(this.state)},beforeDestroy(){Ff(this.state)}};function Vf(e,t){const n=t.center.x,i=t.center.y;return{x:n-e.left,y:i-e.top}}function Bf(e,t,n){return Cu(e,t.points[0])<n.settings.snapIndicator.threshold**2}function Hf(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function $f(e){let{state:t,start:n=null,end:i=null}=e;null!==n&&(t.snapIndicator.x1=n.x,t.snapIndicator.y1=n.y),null!==i&&(t.snapIndicator.x2=i.x,t.snapIndicator.y2=i.y)}function Wf(e,t){e.snapIndicator.visible=t}const Uf={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"})));const n=Vf(this.state.rendererBounds,e);Hf(this.state,n),$f({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=Vf(this.state.rendererBounds,e);Bf(t,this.state,this.settings)?Wf(this.state,!0):Wf(this.state,!1),Hf(this.state,t),$f({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter((e=>e.visible));t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],i=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=i.x+e.componentDelta.x,e.lineBrushShape.y2=i.y+e.componentDelta.y;const r=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(r,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;Wf(this.state,!1);Bf(Vf(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,i=e.componentDelta.y,r=e.points.map((e=>({x:e.x+n,y:e.y+i}))),o=t.shapesAt({vertices:r},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function Yf(e,t,n,i,r){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=r(t[l]),o[n]+o[i]<e[n]?a=l+1:s=l}return a}function Gf(e){let{orientation:t,targetNodes:n,labels:i,container:r}=e,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Yf;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const{textBounds:h,node:d}=i[t];if(h[s]<r[s]||h[s]+h[l]>r[s]+r[l])return!1;for(let e=o(h,a,s,l,c);e<a.length;e++)if(oh(h,a[e].textBounds))return!1;const f=o(h,n,s,l,u),p=h[s]+h[l];for(let e=f;e<n.length;e++){const t=n[e].node;if(p<t.localBounds[s])break;if(oh(h,t.localBounds)&&d!==t)return!1}return a.push(i[t]),!0}}const Xf=4;function Kf(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Zf(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function Jf(e){return $i($i({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function Qf(e,t,n){return n?e.width>=t.height:e.width>=t.width}function ep(e,t,n){return n?e.height>=t.width:e.height>=t.height}function tp(e,t,n,i,r){let o,a;return"v"===e?(o=i||r||Qf(t,n,!0),a=ep(t,n,!i)):(o=Qf(t,n),a=r||ep(t,n,!1)),o&&a}function np(e,t,n,i){return e+.5*t+(i-.5)*(t-n)-.5*n}function ip(e,t,n){const i={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(!n.overflow&&!function(e,t,n){return Qf(e,t,n.rotate)&&ep(e,t,n.rotate)}(e,r,n))return!1;const o=.5*r.height;return n.rotate?(i.x=np(e.x,e.width,r.height,n.align)+o,i.y=np(e.y,e.height,r.width,n.justify),i.transform="rotate(-90, ".concat(i.x+i.dx,", ").concat(i.y+i.dy,")")):(i.x=np(e.x,e.width,r.width,n.align),i.y=np(e.y,e.height,r.height,n.justify)+o),i}function rp(e){let{bar:t,view:n,direction:i,position:r,padding:o=Xf,measured:a}=e;const s={};if(ji(s,t),r&&"inside"!==r)if("up"===i||"down"===i){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===r&&"up"===i||"opposite"===r&&"down"===i?(s.y=0,s.height=e):("outside"===r&&"down"===i||"opposite"===r&&"up"===i)&&(s.y=o,s.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===r&&"left"===i||"opposite"===r&&"right"===i?(s.x=0,s.width=e):("outside"===r&&"right"===i||"opposite"===r&&"left"===i)&&(s.x=o,s.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),i=Math.max(0,Math.min(e.y+e.height,t.height)),r=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=r,e.width=o-r,e.y=n,e.height=i-n}(s,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{top:i=Xf,bottom:r=Xf,left:o=Xf,right:a=Xf}=n,s="function"==typeof o?o(t):o,l="function"==typeof a?a(t):a,c="function"==typeof i?i(t):i,u="function"==typeof r?r(t):r;e.x+=s,e.width-=s+l,e.y+=c,e.height-=c+u}(s,a,o),s}function op(e){let t,n,i,r,o,{direction:a,fitsHorizontally:s,measured:l,node:c,orientation:u,placementSettings:h,rect:d}=e,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rp;const p=[],m="h"===u?"width":"height";for(o=0;o<h.length;o++)if(i=h[o],r=f({bar:c.localBounds,view:d,direction:a,position:i.position,padding:i.padding,measured:l}),p.push(r),t=!o||r[m]>t[m]?r:t,tp(u,r,l,s,i.overflow)){n=r;break}return n||(n=t,o=p.indexOf(n)),i=h[o],{bounds:n,placement:i}}function ap(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{top:o=Xf,bottom:a=Xf,left:s=Xf,right:l=Xf}=r,c="function"==typeof s?s(t):s,u="function"==typeof l?l(t):l,h="function"==typeof o?o(t):o,d="function"==typeof a?a(t):a,f=e.x+e.dx,p=e.y+e.dy,m=n?Math.min(t.width,i.height):Math.min(t.height,i.width),g=n?Math.min(t.height,i.height):Math.min(t.width,i.width),y=.5*t.height,x=1e-9;return{x:(n?f-y:f)-c-x,y:(n?p:p-y)-h-x,width:g+(c+u)-x,height:m+(h+d)-x}}function sp(e){let{chart:t,targetNodes:n,rect:i,fitsHorizontally:r,collectiveOrientation:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:op,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ip,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Gf;const c=[],u={container:i,targetNodes:n,labels:[],orientation:o};let h,d,f,p,m,g,y,x,v,b,w,M,k,S;for(let e=0,l=n.length;e<l;e++){g=null,d=n[e],f=d.node,k=Kf(f,t),v=d.direction,S="left"===v||"right"===v?"h":"v";for(let t=0;t<d.texts.length;t++){if(p=d.texts[t],!Zf(p))continue;b=d.labelSettings[t],x=d.measurements[t],M=b.placements;const n=a({direction:v,fitsHorizontally:r,lblStngs:b,measured:x,node:f,orientation:S,placements:M,placementSettings:d.placementSettings[t],rect:i});if(g=n.bounds,w=n.placement,g&&w){m=w.justify;const t="function"==typeof b.linkData?b.linkData(k,e):void 0,n="function"==typeof w.overflow?w.overflow(k,e):w.overflow;"up"===v&&(m=1-m),"opposite"===w.position&&(m=1-m),"left"===v&&(m=1-m);const i=!("h"===o||r);if(h=s(g,p,{justify:"h"===S?w.align:m,align:"h"===S?m:w.align,fontSize:b.fontSize,fontFamily:b.fontFamily,textMetrics:x,rotate:i,overflow:!!n}),h){const n=ap(h,x,i,g,w.padding);y="function"==typeof w.fill?w.fill($i($i({},k),{},{textBounds:n}),e):w.fill,h.fill=y,void 0!==t&&(h.data=t),"object"==typeof w.background&&(h.backgroundColor="function"==typeof w.background.fill?w.background.fill($i($i({},k),{},{textBounds:n}),e):w.background.fill,void 0!==h.backgroundColor&&(h.backgroundBounds=ap(h,x,i,g,w.background.padding))),c.push(h),u.labels.push({node:f,textBounds:n})}}}}const _=c.filter(l(u));return[..._.filter((e=>void 0!==e.backgroundBounds)).map(Jf),..._]}function lp(e){const t=2*Math.PI;return(e%t+t)%t}function cp(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function up(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function hp(e,t,n){let{x:i,y:r}=t;if(i*i+r*r>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=i*a-r*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function dp(e){let t,n,{radius:i,size:r,angle:o}=e,{width:a,height:s}=r,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=hp(i,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=hp(i,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=hp(i,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=hp(i,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function fp(e){let{slice:t,measured:n,padding:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t,l=s-a-2*i,c=o-r;if(c<Math.PI){let e=(n.height/2+i)/Math.tan(c/2);e>a&&(l=s-e-2*i)}if(l<0||l<n.minReqWidth)return null;const u=lp((r+o)/2);let h=s-i,d={x:Math.sin(u)*h,y:-Math.cos(u)*h,width:l,height:n.height};return u<Math.PI?(d.angle=u-Math.PI/2,d.anchor="end"):(d.angle=u+Math.PI/2,d.anchor="start"),d}function pp(e){let{context:t,node:n,bounds:i}=e;let{start:r,end:o}=n.desc.slice;const a=lp((r+o)/2);switch(Math.floor(a/(Math.PI/2))){case 0:t.q1maxY=i.y-2,void 0===t.q2minY&&(t.q2minY=i.y+i.height+2);break;case 1:t.q2minY=i.y+i.height+2;break;case 2:t.q3minY=i.y+i.height+2;break;case 3:t.q4maxY=i.y-2,void 0===t.q3minY&&(t.q3minY=i.y+i.height+2)}}function mp(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function gp(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));i.transform="rotate(".concat(t,", ").concat(i.x,", ").concat(i.y,")")}return i}function yp(e){let t,n,{slice:i,direction:r,position:o,padding:a,measured:s,view:l,context:c,store:u}=e,{start:h,end:d,innerRadius:f,offset:p}=i;switch(o){case"into":t="rotate"===r?fp({slice:i,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i}=e,{start:r,end:o,innerRadius:a,outerRadius:s}=t;const l=lp((r+o)/2);let c=dp({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",lh(c,{x1:0,y1:0,x2:Math.sin(r)*s,y2:-Math.cos(r)*s})||lh(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Qu({cx:0,cy:0,r:a},c)?null:(cp(c,n),c)):null}({slice:i,measured:s,padding:a});break;case"inside":n={start:h,end:d,innerRadius:0,outerRadius:f},t="rotate"===r?fp({slice:n,measured:s,padding:a}):function(e){let{slice:t,padding:n,measured:i,store:r}=e;const{start:o,end:a,outerRadius:s}=t,l=lp((o+a)/2);let c=dp({radius:s,size:{width:i.width+2*n+1,height:i.height+2*n},angle:l});return c?(c.baseline="top",cp(c,n),r.insideLabelBounds.some((e=>oh(e,c)))?null:(r.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===r?function(e){let{slice:t,measured:n,padding:i,view:r}=e,{start:o,end:a,outerRadius:s,offset:l}=t,c=s+i,u=a-o;if(u<Math.PI&&(n.height/2+i)/Math.tan(u/2)>c)return null;const h=lp((o+a)/2);let d=Math.sin(h)*c,f=-Math.cos(h)*c,p=n.width+1,m=h%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=f<0?r.y:r.y+r.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*i-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=d<0?r.x:r.x+r.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*i-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:d,y:f,width:p,height:n.height};return h<Math.PI?(g.angle=h-Math.PI/2,g.anchor="start"):(g.angle=h+Math.PI/2,g.anchor="end"),g}({slice:i,measured:s,padding:a,view:l}):function(e){let{slice:t,measured:n,padding:i,view:r,context:o}=e,{start:a,end:s,outerRadius:l,offset:c}=t;const u=lp((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),r))return null;let h=l+i+n.height/2,d=Math.sin(u)*h,f=-Math.cos(u)*h,p=n.width+1;if(u<Math.PI){let e=Math.abs(r.x+r.width-(d+c.x));e<p&&(p=e)}else{let e=Math.abs(r.x-(d+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:d,y:f,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:i,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==r&&function(e,t,n){const{start:i,end:r,offset:o,outerRadius:a}=n,s=lp((i+r)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),i=n-e.y;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),i=e.y-n;if(e.y=n,i>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,i)),t}function xp(e){let{context:t,direction:n,measured:i,node:r,placementSettings:o,rect:a,store:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yp;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:r.desc.slice,view:a,direction:n,position:c.position,measured:i,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function vp(e,t,n){const i=t.fontFamily,r="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:i,fontSize:r});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:i,fontSize:r}).width),o}const bp=/\n+|\r+|\r\n/,wp=/\s/,Mp=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function kp(e){return"string"==typeof e?-1!==e.search(bp):-1!==String(e).search(bp)}function Sp(e){return-1!==e.search(wp)}function _p(e){return-1!==e.search(Mp)}function qp(e,t,n){return Math.max(t,Math.min(n,e))}function Dp(){let{string:e,separator:t="",reverse:n=!1,measureText:i=e=>({width:e.length,height:1}),mandatoryBreakIdentifiers:r=[kp],noBreakAllowedIdentifiers:o=[],suppressIdentifier:a=[Sp,kp,e=>""===e],hyphenationIdentifiers:s=[_p]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=String(e).split(t);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(l);const c=l.length,u=n?e=>e>=0:e=>e<c;let h=n?c:-1;function d(e){const t=qp(e,0,c-1),n=l[t],u=i(n),h=function(e,t,n,i,r){return i.some((i=>i(e,t,n)))?1:r.some((i=>i(e,t,n)))?0:2}(n,t,l,r,o);return{index:t,value:n,breakOpportunity:h,suppress:a.some((e=>e(n,t,l))),hyphenation:s.some((e=>e(n,t,l))),width:u.width,height:u.height,done:!1}}return{next:function(e){return isNaN(e)?n?h--:h++:h=qp(e,0,c-1),u(h)?d(h):{done:!0}},peek:d,length:c}}const Ap="…",Cp=/^\s*\d+(\.\d+)?px\s*$/i;function Np(e){return"string"===typeof e&&Cp.test(e)}function Ep(e){const t=e["font-size"]||e.fontSize;return Np(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function Rp(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const i=Ep(e);return Math.max(1,Math.min(Math.floor(t/i),n))}function Ip(e,t){return{lines:[],line:"",width:0,maxLines:Rp(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function Op(e){e.lines.push(e.line),e.line="",e.width=0}function Pp(e,t){e.line+=t.value,e.width+=t.width}function Lp(e,t,n){if(t.width>e.maxWidth)return t;const i=t.index;for(let r=1;r<5;r++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(i-r),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function Tp(e,t,n){const i=Dp({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=i.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?Lp(e,t,i):t,Op(e),Pp(e,t)):Pp(e,t)}}function zp(e,t){const n=Dp({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),i=Ip(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Op(i),r=!1;break}1===e.breakOpportunity?Op(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?i.width+=e.width:(e=i.hyphens.enabled?Lp(i,e,n):e,Op(i),Pp(i,e)):Pp(i,e)}return{lines:i.lines,reduced:r}}function Fp(e,t){const n=Dp({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),i=Ip(e,t);let r=!0;for(;i.lines.length<i.maxLines;){let e=n.next();if(e.done){Op(i),r=!1;break}1===e.breakOpportunity?Op(i):i.width+e.width>i.maxWidth&&2===e.breakOpportunity?e.suppress?Op(i):e.width>i.maxWidth?Tp(i,e,t):(Op(i),Pp(i,e)):Pp(i,e)}return{lines:i.lines,reduced:r}}function jp(e){return{"break-all":zp,"break-word":Fp}[e.wordBreak]}function Vp(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const i=jp(n);if(!i)return;const r=e(n);if(r.width>n.maxWidth||kp(n.text)){const o=(Ep(n)-r.height)/2,a=i(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,i){const r={type:"container",children:[]};void 0!==t.id&&(r.id=t.id);let o=0;return e.lines.forEach(((a,s)=>{const l=ji({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=Ap:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=i,o+=n,r.children.push(l)})),r}(a,n,o,r.height)}}}}function Bp(e,t){const n=e["font-family"]||e.fontFamily,i=e["font-size"]||e.fontSize,r="string"==typeof e.text?e.text:"".concat(e.text),{maxWidth:o}=e;if(void 0===o)return r;let a=t({text:r,fontSize:i,fontFamily:n}).width;if(a<=o)return r;let s=0,l=r.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:r.substr(0,e)+Ap,fontSize:i,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return r.substr(0,l)+Ap}function Hp(e){const t=e.baseline||e["dominant-baseline"];let n=0;const i=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*i;break;case"text-before-edge":n=.85*i;break;case"middle":n=.25*i;break;case"central":n=.35*i;break;case"mathemetical":n=i/2;break;case"text-after-edge":case"ideographic":n=.2*-i;break;default:n=0}return n}const $p={},Wp={},Up={fontSize:void 0,fontFamily:void 0};let Yp;function Gp(e,t){return!e&&!t||e===t}function Xp(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;const o="".concat(t," ").concat(n," ").concat(i," ").concat(r);return"number"!=typeof Wp[o]&&(Yp=Yp||document.createElement("canvas").getContext("2d"),function(e){let{fontWeight:t,fontSize:n,fontFamily:i}=e;Gp(Up.fontWeight,t)&&Gp(Up.fontSize,n)&&Gp(Up.fontFamily,i)||(Yp.font=[t,n,i].filter((e=>!!e)).join(" "),Up.fontWeight=t,Up.fontSize=n,Up.fontFamily=i)}({fontWeight:n,fontSize:i,fontFamily:r}),Wp[o]=Yp.measureText(t).width),Wp[o]}function Kp(e){return"number"!=typeof $p[e]&&($p[e]=function(e){if(Np(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),$p[e]}function Zp(e){let{text:t,fontWeight:n,fontSize:i,fontFamily:r}=e;return{width:Xp({text:t,fontWeight:n,fontSize:i,fontFamily:r}),height:Kp(i)}}function Jp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zp;const n=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,r=t({text:e.text,fontFamily:i,fontSize:n}),o=Math.min(e.maxWidth||r.width,r.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+Hp(e))-.75*r.height,width:o,height:r.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function Qp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zp;const n=jp(e),i=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:r,fontSize:i});if(n&&(o.width>e.maxWidth||kp(e.text))){const o=n(e,(e=>t({text:e,fontFamily:r,fontSize:i}))),a=ji({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?Ap:"";const c=t({text:a,fontSize:i,fontFamily:r}).width;c>=s&&(s=c,l=a)}a.text=l;const c=Jp(a,t);return c.height=Ep(e)*o.lines.length,c}return Jp(e,t)}function em(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function tm(e,t,n){const i={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},r=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-r.width);return i.x=e.x+n.align*o,i.y=e.y+r.height/1.2,i}function nm(e){let{cx:t,cy:n,r:i}=e;return{type:"circle",bounds:{cx:t,cy:n,r:i}}}function im(e){return e.desc&&e.desc.slice?function(e){let{start:t,end:n,innerRadius:i,outerRadius:r,offset:o}=e;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==i?i:r;return nm({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?nm(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var rm={bar:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sp;const l=ji({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map((e=>ji({},l,t,e))),u=t.labels.map((e=>e.placements.map((n=>ji({},l,t,e,n))))),{fitsHorizontally:h,hasHorizontalDirection:d,targetNodes:f}=function(e){let{nodes:t,rect:n,chart:i,labelSettings:r,placementSettings:o,settings:a,renderer:s}=e;const l={},c=[];let u,h,d,f,p,m,g,y=!0,x=!1;for(let e=0;e<t.length;e++){if(h=t[e],f=h.localBounds,!oh(f,n))continue;let v=Kf(h,i);u={node:h,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<r.length;t++)m=r[t],d="function"==typeof m.label?m.label(v,e):void 0,Zf(d)&&(g="function"==typeof a.direction?a.direction(v,e):a.direction||"up",x=x||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=d,p=s.measureText(l),u.measurements.push(p),u.texts.push(d),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=f.width-2*Xf);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:x}}({nodes:i,chart:n,renderer:o,settings:t,rect:r,labelSettings:c,placementSettings:u}),p=function(e){let{orientation:t="auto",defaultOrientation:n="h"}=e;switch(t.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return n}}({orientation:t.orientation,defaultOrientation:d?"h":"v"}),m="h"===p?"y":"x",g="h"===p?"height":"width";return f.sort(((e,t)=>e.node.localBounds[m]+e.node.localBounds[g]-(t.node.localBounds[m]+t.node.localBounds[g]))),s({chart:n,targetNodes:f,stngs:t,rect:r,fitsHorizontally:h,collectiveOrientation:p})},slice:function(e){let{settings:t,chart:n,nodes:i,rect:r,renderer:o,style:a}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xp,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gp;const c=ji({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map((e=>ji({},c,t,e))),h=t.labels.map((e=>e.placements.map((n=>ji({},c,t,e,n))))),d=[],f={insideLabelBounds:[]};i=function(e){const t=[],n=[],i=[],r=[];for(let o=0;o<e.length;++o){const{start:a,end:s}=e[o].desc.slice,l=lp((a+s)/2);switch(Math.floor(l/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:i.push(e[o]);break;case 3:r.push(e[o])}}const o=(e,t)=>lp((e.desc.slice.start+e.desc.slice.end)/2)-lp((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),i.sort(a),r.sort(o),t.concat(n,r,i)}(i);const p={};for(let e=0,t=i.length;e<t;e++){const t=i[e],a=mp(t,n);for(let n=0;n<u.length;n++){const i=u[n],c="function"==typeof i.label?i.label(a,e):"";if(!c)continue;const m="function"==typeof i.direction?i.direction(a,e):i.direction||"horizontal",g="function"==typeof i.linkData?i.linkData(a,e):void 0,y=vp(c,i,o),x=s({context:p,direction:m,lblStngs:i,measured:y,node:t,placementSettings:h[n],rect:r,store:f}),v=x.bounds,b=x.placement;if(v&&b){if("outside"===b.position&&"rotate"!==m){pp({context:p,node:t,bounds:v});if(!Wu(up(v),r))continue}const n="function"==typeof b.fill?b.fill(a,e):b.fill,o=l(v,c,{fill:n,fontSize:i.fontSize,fontFamily:i.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),d.push(o),v.line&&(v.line.stroke=n,d.push(v.line)))}}}return d},rows:function(e){let{settings:t,chart:n,nodes:i,renderer:r,style:o}=e,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tm;const s=ji({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=ji({},s,t),c=t.labels.map((e=>ji({},l,e))),u={},h=[];for(let e=0,t=i.length;e<t;e++){let t=i[e],o=em(t,n),{type:s,bounds:d}=im(t);if(!d)continue;let f,p=0,m=[],g=[],y="circle"===s?2*d.r*.9:d.height;for(p+=l.padding,f=0;f<c.length;f++){let t=c[f],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let i=r.measureText(u);if(p+=i.height+t.padding,p>y)break;g.push(n),m.push(i)}const x=f,v=Math.max(0,y-p);let b;for(b="circle"===s?d.cy-.9*d.r:d.y,b+=l.justify*v+l.padding,f=0;f<x;f++){let t,n=c[f];if("circle"===s){let e=Math.max(Math.abs(b-d.cy),Math.abs(b+m[f].height-d.cy)),n=Math.sqrt(d.r*d.r-e*e);t={x:d.cx-n+l.padding,y:b,width:2*n-2*l.padding,height:m[f].height}}else t={x:d.x+l.padding,y:b,width:d.width-2*l.padding,height:m[f].height};b+=m[f].height+l.padding;let i="function"==typeof n.fill?n.fill(o,e):n.fill;const u="function"==typeof n.linkData?n.linkData(o,e):void 0;let p=a(t,g[f],{fill:i,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:m[f]});if(p){if(p.text&&p.text!==Ap){const e=Bp(p,r.measureText);if(Ap===e)continue;p.ellipsed=e}void 0!==u&&(p.data=u),h.push(p)}}}return h}};const om={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach((e=>{e.strategy&&rm[e.strategy.type]&&e.component&&t.push(...function(e,t){let{chart:n,source:i,rect:r,renderer:o,style:a}=e;if(!n.component(i.component))return[];const s=n.findShapes(i.selector).filter((e=>e.key===i.component));return t({chart:n,settings:i.strategy.settings,nodes:s,rect:{x:0,y:0,width:r.width,height:r.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},rm[e.strategy.type]))})),t}};const am={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,justify:.5,align:.5,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25},navigation:{button:{class:void 0,content:void 0,tabIndex:void 0},disabled:!1}};function sm(e){let{x:t=0,y:n,item:i,globalMetrics:r,createSymbol:o,direction:a="ltr"}=e,s=i.label.displayObject,l=i.label.bounds,c=i.symbol.meta;const u="rtl"===a;let h={x:u?t+r.maxLabelBounds.width:t+r.maxSymbolSize+r.spacing,y:n,width:r.maxLabelBounds.width,height:Math.max(r.maxSymbolSize,r.maxLabelBounds.height)},d=function(e,t,n){const i=Math.max(0,e.width-t),r=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*i,y:e.y+t/2+n.justify*r}}({x:u?t+r.maxLabelBounds.width+r.spacing:t,y:n,width:r.maxSymbolSize,height:h.height},c.size,{align:void 0===c.align?.5:c.align,justify:void 0===c.justify?.5:c.justify});const f=o(ji({},c,d));return delete f.collider,s.anchor=u?"end":"start",function(e,t,n){const i=n.textMetrics;if(e.height<i.height)return!1;const r=Math.max(0,e.width-i.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-i.height);t.x=e.x+n.align*r,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(h,s,{textMetrics:l,fontSize:parseInt(s.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[f,s],collider:{type:"rect",x:t,y:n,width:r.maxItemBounds.width,height:r.maxItemBounds.height}},metrics:h}}function lm(e,t){const n=e.items.length,i=Math.ceil(n/t),r="horizontal"===e.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*i+(i-1)*e.layout.margin[o]}function cm(e,t){let n,i,r,o,{onScroll:a=()=>{}}=t,s=null,l=0;const c={itemize:t=>{n=function(e,t){let n,i,{resolved:r,dock:o}=e,a=[],s=r.items.items,l=r.symbols.items,c=r.labels.items,u=0,h=0,d=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const r=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=ji({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:r,title:r}),i={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(i),u=Math.max(l[e].size,u),h=Math.max(i.label.bounds.width,h),d=Math.max(i.label.bounds.height,d)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,d),width:u+8+h},maxLabelBounds:{width:h,height:d}},layout:{margin:{vertical:void 0!==r.layout.item.vertical?r.layout.item.vertical:4,horizontal:void 0!==r.layout.item.horizontal?r.layout.item.horizontal:4},mode:r.layout.item.mode,size:r.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:r.layout.item.direction,scrollOffset:r.layout.item.scrollOffset}}}(t,e.renderer),s=isNaN(n.layout.scrollOffset)?s:n.layout.scrollOffset},getItemsToRender:t=>{r=t.viewRect,l=c.getContentOverflow(r);const a=c.extent();s=Math.max(0,Math.min(s,l)),o=ji({},r);const u="horizontal"===c.orientation()?"x":"y";return o[u]-=s,o["x"===u?"width":"height"]=a,function(e,t,n){let{viewRect:i}=e,{itemized:r,create:o=sm,parallels:a,createSymbol:s}=n;const l=r.layout.direction,c=r.globalMetrics,u=r.items,h="horizontal"===r.layout.orientation;let d=0;const f=[],p=c.maxItemBounds.height,m=c.maxItemBounds.width,g=r.layout.margin.vertical+p,y=r.layout.margin.horizontal+m;let x=t.x,v=t.y,b=i.x-t.x;for(let e=0;e<u.length;e++){let n=o({y:v,x:"rtl"===l?i.x+b+i.width-m-(x-t.x):x,item:u[e],globalMetrics:c,direction:l,createSymbol:s});if((h&&x>=i.x-m||!h&&v>=i.y-p)&&f.push(n.item),d++,d>=a?(d=0,h?(x+=y,v=t.y):(v+=g,x=t.x)):h?v+=g:x+=y,!h&&v>i.y+i.height)break;if(h&&x>i.x+i.width)break}return f}(t,o,{itemized:n,parallels:i,createSymbol:e.symbol})},parallelize:(e,t)=>(i=function(e,t,n){const i=n.items.length,r="horizontal"===n.layout.orientation?"width":"height",o="width"===r?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[r]*i+(i-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",i="width"===e?"horizontal":"vertical",r=n.layout.margin[i]||4,o=Math.floor((t+r)/(r+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),i),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return lm(n,i)>r[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,lm(n,i)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===c.orientation()?r.x+r.width<o.x+o.width:r.y+r.height<o.y+o.height,hasPrev:()=>"horizontal"===c.orientation()?o.x<r.x:o.y<r.y,next:()=>{c.scroll(-c.getNextSize())},prev:()=>{c.scroll(c.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(l,s-e));t!==s&&(s=t,a())},offset:()=>s,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>lm(n,i),spread:()=>function(e,t){const n=t,i="horizontal"===e.layout.orientation?"height":"width",r="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*n+(n-1)*e.layout.margin[r]}(n,i)};return c}function um(e){return Object.keys(e).filter((t=>e[t])).join(" ")}const hm={up:"▲",right:"▶",down:"▼",left:"◀"};function dm(e,t){let{size:n,isActive:i,direction:r,nav:o,attrs:a}=t,s={},l="";const c=a;o&&o.button&&("function"==typeof o.button.class?s=o.button.class({direction:r}):o.button.class&&(s=o.button.class),"function"==typeof o.button.content&&(l=o.button.content(e,{direction:r})),void 0!==o.button.tabIndex&&(c.tabindex=o.button.tabIndex));const u={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(s).length||(u.border="0",u.background="none"),(!i||o&&o.disabled)&&(c.disabled="disabled"),e("button",ji({class:um(s),style:u},c),[l||e("span",{style:{pointerEvents:"none"}},[hm[r]])])}function fm(e){let t;const n={itemize:e=>{t=function(e){let{dock:t,navigation:n}=e;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:n}}(e)},render:i=>function(e,t,n,i){let{rect:r,itemRenderer:o}=t;if(!e||!e.renderArgs)return;e.size(r);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const h=s?["right","left"]:["down","up"];l&&s&&h.reverse();const d=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[dm(a,{size:32,isActive:c,direction:h[0],attrs:{"data-action":"next","data-component-key":i.settings.key},nav:n.navigation}),dm(a,{size:32,isActive:u,direction:h[1],attrs:{"data-action":"prev","data-component-key":i.settings.key},nav:n.navigation})])];e.render(d)}(n.renderer,i,t,e),extent:()=>32,spread:()=>64};return n}function pm(e){let t;const n={itemize:n=>{t=function(e,t){let{resolved:n}=e;if(!1===n.title.item.show)return null;const i=ji({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(i.anchor&&"start"!==i.anchor?"end"===i.anchor&&(i.anchor="start"):i.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;i.text=e&&e[0]?e[0].title():""}return{displayObject:i,bounds:t.renderer.textBounds(i)}}(n,e)},render:e=>{!function(e,t,n){let{rect:i}=e;if(!t)return;const r=[];if(t.size(i),n){const e={start:0,end:i.width,middle:i.width/2};r.push(ji({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(r)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function mm(e,t,n,i){let r,o,a,{itemRenderer:s,navigationRenderer:l,titleRenderer:c,isPreliminary:u=!1}=i,h=0;const d={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(r={x:d.x,y:d.y,width:d.width,height:c.spread()},"horizontal"===n){r={x:d.x,y:d.y,width:c.extent(),height:c.spread()};const e=d.width-r.width-(r.width?t.spacing:0),n=d.height;s.parallelize(e,u?void 0:n);const i=s.extent()>e?l.extent():0,f=s.spread(),p=i?l.spread():0;o={x:r.x+r.width+(r.width?t.spacing:0),y:d.y+Math.max(0,(p-f)/2),width:d.width-i-r.width-(i?t.spacing:0)-(r.width?t.spacing:0),height:n},a={x:o.x+o.width+(i?t.spacing:0),y:d.y,width:i,height:d.height},r.y=o.y;"rtl"===s.direction()&&(a.x=d.x,o.x=a.x+a.width+(a.width?t.spacing:0),r.x=o.x+o.width+(r.width?t.spacing:0)),h=Math.max(r.height,p,s.spread())}else{const e=d.height-r.height-(r.height?t.spacing:0),n=d.width;s.parallelize(e,u?void 0:n);const i=s.extent()>e?l.extent():0;a={x:d.x,y:d.y+d.height-i,width:d.width,height:i},o={x:d.x,y:r.y+r.height+(r.height?t.spacing:0),width:d.width,height:d.height-r.height-(r.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},h=Math.max(c.extent(),i?l.spread():0,s.spread())}return o=ji({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,r.x+=e.x,r.y+=e.y,{title:ji({},e,r),content:ji({},e,o),navigation:ji({},e,a),orientation:n,preferredSize:h}}function gm(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const i=e.settings.layout.dock;if("threshold-color"===e.scale.type){const r=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):r&&(o=r.formatter());for(let e=0;e<t.length-1;e++){const i={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};r&&(i.source={field:r.id()}),n.items.push(i)}"vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")&&n.items.reverse()}else{const i=e.scale.labels?e.scale.labels():null;n.items=t.map(((t,n)=>{const r=e.scale.datum?ji({},e.scale.datum(t)):{value:t};return r.value=t,e.scale.label?r.label=e.scale.label(t):i&&(r.label=i[n]),r}))}const r=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:ji(!0,{},am.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:am.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:ji(!0,{},am.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=ji(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:ji(!0,{},am.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:ji(!0,{},{show:am.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let i=e.data.value,r=t[n+1];e.data.value=[i,r]}"threshold-color"===e.scale.type&&("vertical"==("top"===i||"bottom"===i?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:r,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function ym(e){const{rect:t,settings:n,state:i,itemRenderer:r,navigationRenderer:o,titleRenderer:a}=e,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=mm(t,i.display,l,{itemRenderer:r,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=r.getItemsToRender({viewRect:ji({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:r}),a.render({rect:c.title}),e.state.views={layout:c},u}const xm={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=ym(this);this.update(e)},this.itemRenderer=cm(this,{onScroll:this.onScroll}),this.navigationRenderer=fm(this),this.titleRenderer=pm(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),gm(this)},preferredSize(e){return function(e,t){let n=0;const i=e.settings.layout.dock||"center",r="top"===i||"bottom"===i?"horizontal":"vertical",o=e.state.display,a=mm(t.inner,o,r,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){gm(this)},render(){return ym(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function vm(e,t){let n=0;const i=e.state.isVertical?"justify":"align",r=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[i],0)),t[r]+=n}function bm(e,t,n){const i=n[e];return"object"==typeof i?-1!==i.valid.indexOf(t)?t:i.default:n.default}function wm(e){return bm(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function Mm(e,t){const n={x:0,y:0,width:0,height:0},i=e.stgns.padding;return n.x=i.left,n.y=i.top,n.width=t.width-i.left-i.right,n.height=t.height-i.top-i.bottom,n}function km(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,i=e.chart.scale(e.stgns.fill),r=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let i=n,r=e.stgns.tick.label;!r&&e.formatter?r=e.formatter:!r&&t.data().fields&&(r=t.data().fields[0].formatter()),"function"==typeof r&&(i=n.map(r).map(String));const o=n.map(((n,r)=>{const o=i[r];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}}));return o}(e,r),a=bm((s=e.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const e=r.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:wm(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,i=n.maxLengthPx;return t||(e+=n.padding,i+=n.padding),Math.min(e,i,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map((e=>e.textMetrics.width))),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map((e=>e.textMetrics.height)))+e.stgns.tick.padding:0,height:Math.max(...o.map((e=>e.textMetrics.height)))},legend:{fillScale:i,majorScale:r,length:()=>{const n=t?"height":"width",i=t?"requiredHeight":"requiredWidth",r=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[i]();return Math.max(0,Math.min(r,e.stgns.maxLengthPx))}}};return u}const Sm={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=Mm(this,e.inner);let n=this.stgns.size;const i=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=i;const r=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce(((e,t)=>e+t.textMetrics.height),0);if(e>this.state.legend.length())return r;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return r;n+=Math.max(...t.ticks.values.map((e=>e.textMetrics.height)))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+i,n):Math.max(n,t.title.requiredWidth()+i)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=km(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=km(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Mm(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,i="left"===t.ticks.anchor,r="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=r?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=i?t.rect.width:0,a+=t.title.textMetrics.height,s=i?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return vm(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,i=t.domain().map((e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))})));return i.sort(((e,t)=>e.offset-t.offset))}(this),n=function(e,t){const n=e.state,i=e.stgns,r=n.rect;let o=r.x,a=r.y,s=n.isVertical?i.size:n.legend.length(),l=n.isVertical?n.legend.length():i.size;"left"===n.ticks.anchor?o+=n.rect.width-i.size:"top"===n.ticks.anchor&&(a+=n.rect.height-i.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return vm(e,c),c}(this,t),i=function(e,t){const n=e.state,i=e.stgns;let r="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map((a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+i.size+i.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-i.tick.padding,r="end"):"top"===n.ticks.anchor?(l=t.y-i.tick.padding,c-=.25*a.textMetrics.height,r=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+i.tick.padding,c=.8*a.textMetrics.height,r=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:i.tick.fontSize,fontFamily:i.tick.fontFamily,fill:i.tick.fill,maxWidth:n.isVertical?i.tick.maxLengthPx:Math.min(i.tick.maxLengthPx,n.legend.length()/2),anchor:r,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}}));return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),r={id:"legend-seq-target",type:"container",children:[n,i]};this.state.nodes.push(r)},render(){return this.state.nodes}};const _m={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},connect:!1,orientation:"horizontal",layers:{curve:"linear",show:!0,sort:void 0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function qm(e,t){let{generatorType:n,item:i,data:r,major:o,minor:a,layerObj:s,stngs:l}=t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:i.opacity,stroke:i.stroke,strokeWidth:i.strokeWidth,strokeLinejoin:i.strokeLinejoin,fill:c||i.fill,data:r};return i.strokeDasharray&&(u.strokeDasharray=i.strokeDasharray),u}function Dm(e){const{metaLayers:t,coordinates:n,layers:i,lines:r,areas:o}=function(e){let{data:t,stngs:n,rect:i,resolver:r,style:o,domain:a}=e;const{width:s,height:l}=i,c=r.resolve({data:t,defaults:_m.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),h={};let d=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=h[n]?h[n].items[h[n].items.length-1]:null,i=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==i&&h[n].items.push({dummy:!0})}h[n]=h[n]||{order:d++,id:n,items:[],dataItems:[],consumableData:{}},h[n].dataItems.push(t.data),h[n].items.push(t)}const f=Object.keys(h).map((e=>(h[e].consumableData=$i({points:h[e].dataItems},h[e].dataItems[0]),h[e]))),p={items:f.map((e=>e.consumableData))},m=n.layers||{};return{coordinates:c,metaLayers:f,layers:r.resolve({data:p,defaults:{curve:_m.layers.curve,show:_m.layers.show},settings:{curve:m.curve,show:m.show}}),lines:r.resolve({data:p,defaults:ji({},_m.layers.line,o.line),settings:m.line}),areas:r.resolve({data:p,defaults:ji({},_m.layers.area,o.area),settings:m.area})}}(e),a=[];return t.forEach(((t,s)=>{const l=i.items[s];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let h,d;for(let i=0;i<t.items.length;i++){if(h=t.items[i],d=h.data,!h.dummy){if(isNaN(h.major))continue;e.missingMinor0&&(h.minor0=n.settings.minor.scale?n.settings.minor.scale(d.minor0?d.minor0.value:0):0),isNaN(h.minor)||c.push(h.minor),l.data.push(h.data)}u.push(h)}const f=c.sort(((e,t)=>e-t))[Math.floor((c.length-1)/2)];a.push({layerObj:l,lineObj:r.items[s],areaObj:o.items[s],median:f,points:u,consumableData:t.consumableData})})),a}const Am={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let{data:t}=e;const{width:n,height:i}=this.rect;this.stngs=this.settings.settings||{};const r=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,o=Dm({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:r,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=o.map((e=>({id:e.layerObj.id,data:e.layerObj.data}))).sort(this.stngs.layers.sort).map((e=>e.id));o.sort(((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id)))}else o.sort(((e,t)=>e.median-t.median));return function(e,t){let{width:n,height:i,missingMinor0:r,stngs:o}=t;const a=[],s=o.layers||{};return e.forEach((e=>{const{lineObj:t,layerObj:l,areaObj:c,points:u}=e;let h={size:i,p:"y"},d={size:n,p:"x"};if("vertical"===o.orientation){const e=ji(!0,{},d);d=ji(!0,{},h),h=ji(!0,{},e)}s.area&&!1!==c.show&&a.push(qm(u,{data:e.consumableData,item:c,generatorType:"area",major:d,minor:h,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(qm(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"1"),major:d,minor:h,layerObj:l,stngs:o},"none")),!r&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(qm(u,{data:e.consumableData,item:t,generatorType:"line".concat(h.p.toUpperCase(),"0"),major:d,minor:h,layerObj:l,stngs:o},"none")))})),a}(o,{width:n,height:i,missingMinor0:r,stngs:this.stngs})}};function Cm(e,t){let n,i,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,i=t.center.y):(n=t.clientX,i=t.clientY);const o=n-e.state.boundingRect.left,a=i-e.state.boundingRect.top;return{x:r?Math.max(0,Math.min(o,e.rect.width)):o,y:r?Math.max(0,Math.min(a,e.rect.height)):a}}function Nm(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function Em(e,t){const n=Math.min(e.x,t.x),i=Math.min(e.y,t.y);return{x:n,y:i,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-i}}const Rm={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=Cm(this,e,!1);sh({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map((e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"}))),this.state.start=Cm(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=Cm(this,e),function(e){if(e.state.active){const t=Nm(e,e.state.start),n=Nm(e,e.state.end),i=e.chart.shapesAt(Em(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(i,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([ji({type:"rect"},Em(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){var e,t;this.state.active&&(e=this.state,t=this.chart,e.brushConfig.forEach((e=>{Array.isArray(e.contexts)&&e.contexts.forEach((e=>{t.brush(e).end()}))})),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function Im(e,t,n){let{renderer:i,style:r,props:o,h:a}=n;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,i){return i.content({h:e,style:n,data:t})}(a,e,r,o),c=a("div",{dir:o.direction,class:um(ji({"pic-tooltip":!0},s.tooltip)),style:ji({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:r.content,class:um(ji({"pic-tooltip-content":!0},s.content))},l),a("div",{class:um(ji({"pic-tooltip-arrow":!0},s.arrow)),style:ji({},r.arrow,r["arrow-".concat(t.dock)],t.computedArrowStyle)}));return i.render(c),i.element().children[0]}function Om(e){let{defaultDuration:t,defaultDelay:n}=e,i=null,r=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach((t=>t(e)))},e.on=(e,n)=>{Array.isArray(e)?e.forEach((e=>t[e].push(n))):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach((e=>{t[e].length=0}))},e}(),s=function(){},l=()=>{i=null,r=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;i&&(clearTimeout(i),a.set("debounced")),a.set("pending"),i=setTimeout((()=>{e(),o=!0,i=null,a.set("active")}),c),s>0&&(r&&clearTimeout(r),r=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):i&&(clearTimeout(i),a.set("rejected")),r&&clearTimeout(r),i=null,r=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function Pm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function Lm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function Tm(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function zm(e,t,n,i,r,o){const a=t+o.x,s=n+o.y,l=r;return!(a<0||s<0)&&!(a+i>e.width||s+l>e.height)}function Fm(e){let{area:t,vx:n,vy:i,width:r,height:o,offset:a}=e;const s=n+a.x,l=i+a.y,c=r,u=o;let h=s<0?-s:0,d=l<0?-l:0;return h+=s+c>t.width?-(s+c-t.width):0,d+=l+u>t.height?-(l+u-t.height):0,{x:h,y:d}}function jm(e){let{options:t,pointer:n,width:i,height:r,dockOrder:o,x:a,y:s}=e;const{targetBounds:l}=n,c=Pm(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:Tm(t.offset)[t.dock],dock:t.dock};const h={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},d=Lm(i,r,t.offset),f=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=Fm({area:h,vx:p,vy:m,width:i,height:r,offset:d[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=Tm(t.offset)[n];0!==l.x&&(u.width="".concat(i-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:i,height:r}};if(0===l.x&&0===l.y)return y;y.offset=l,f.push(y)}return f.sort(((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x))),f[0]}function Vm(e,t,n){const i=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!i)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const r=i.rect;return ji({scaleRatio:r.scaleRatio},r.computedInner)}const Bm={bounds:function(e){let{resources:t,nodes:n,pointer:i,width:r,height:o,options:a}=e;const{targetBounds:s}=i,{x:l,y:c,width:u,height:h}=t.getNodeBoundsRelativeToTarget(n[0]),d={left:{x:l,y:c+h/2},right:{x:l+u,y:c+h/2},top:{x:l+u/2,y:c},bottom:{x:l+u/2,y:c+h},inside:{x:l+u/2,y:c+h/2}},f=Pm(a.offset),p=f[a.dock];if(p)return{computedTooltipStyle:{left:"".concat(d[a.dock].x,"px"),top:"".concat(d[a.dock].y,"px"),transform:p},computedArrowStyle:Tm(a.offset)[a.dock],dock:a.dock};const m={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},g=Lm(r,o,a.offset),y=["top","left","right","bottom","inside"];for(let e=0;e<y.length;e+=1){const t=y[e];if(zm(m,"target"===a.area?d[t].x:s.left+d[t].x,"target"===a.area?d[t].y:s.top+d[t].y,r,o,g[t]))return{computedTooltipStyle:{left:"".concat(d[t].x,"px"),top:"".concat(d[t].y,"px"),transform:f[t]},computedArrowStyle:Tm(a.offset)[t],dock:t}}const x=function(e){let{options:t,docks:n,dockOffsets:i,targetBounds:r,area:o,width:a,height:s}=e;const l="top",c="target"===t.area?n[l].x:r.left+n[l].x,u=("target"===t.area?n[l].y:(r.top,n[l].y),i[l]),h=c+u.x,d=(u.y,a);let f=n.top.x;return h<0&&h+d>o.width||(h<0?f-=h:h+d>o.width&&(f-=h+d-o.width)),f}({options:a,docks:d,dockOffsets:g,targetBounds:s,area:m,width:r,height:o});return{computedTooltipStyle:{left:"".concat(x,"px"),top:"".concat(d.top.y,"px"),transform:f.top},computedArrowStyle:Tm(a.offset+x-d.top.x,a.offset).top,dock:"top"}},pointer:function(e){let{options:t,pointer:n,width:i,height:r}=e;const{x:o,y:a}=n;return jm({x:o,y:a,pointer:n,width:i,height:r,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let{options:t,pointer:n,width:i,height:r,nodes:o,resources:a}=e;const s=o[0],{dx:l,dy:c}=n,u=a.getComponentBoundsFromNode(s),h=l+u.x+u.width/2,d=c+u.y+u.height/2,{start:f,end:p,outerRadius:m}=s.desc.slice,g=(f+p)/2-Math.PI/2,y=2*Math.PI,x=(g%y+y)%y;let v=["top","left","right","bottom"];return"auto"===t.dock&&(v=x<=Math.PI/4||x>=7*Math.PI/4?["right","top","bottom","left"]:x<=3*Math.PI/4?["bottom","left","right","top"]:x<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),jm({x:h+m*u.scaleRatio.x*Math.cos(x),y:d+m*u.scaleRatio.y*Math.sin(x),pointer:n,width:i,height:r,options:t,dockOrder:v})}};function Hm(e,t){let{width:n,height:i}=e,{chart:r,state:o,props:a}=t;const s={resources:{formatter:r.formatter,scale:r.scale,component:r.component,getComponentBoundsFromNode:e=>Vm(e,o.pointer,r),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const i=Vm(e,t,n),r=e.bounds;return{x:i.x+t.dx+r.x,y:i.y+t.dy+r.y,width:r.width,height:r.height}}(e,o.pointer,r)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:i},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=ji(c,a.placement(s))),"object"===l&&Bm[a.placement.type]?c=ji(c,a.placement):"string"===l&&Bm[a.placement]&&(c=ji(c,{type:a.placement})),s.options=c;const u=Bm[c.type](s);let{x:h,y:d,width:f,height:p}=s.resources.getComponentBoundsFromNode(s.nodes[0]);return h+=s.pointer.dx,f+=h,d+=s.pointer.dy,p+=d,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.left)),f),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,d,parseFloat(u.computedTooltipStyle.top)),p),"px"),u}let $m;function Wm(){$m=null}const Um={duration:8e3,delay:500,filter:e=>e.filter((e=>e.data&&void 0!==e.data.value)),extract:e=>e.node.data.value,content:e=>{let{h:t,data:n}=e;return n.map((e=>t("div",{},e)))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every(((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data))),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const Ym={require:["chart","renderer"],defaultSettings:{settings:Um,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,{nodes:n,duration:i,delay:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let{chart:n,state:i}=t,r=0,o=0;e.center?(r+=e.center.x,o+=e.center.y):(r+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=i.targetElement.getBoundingClientRect(),l=r,c=o,u=a.left-s.left,h=a.top-s.top,d=r-a.left,f=o-a.top;return r-=s.left,o-=s.top,{x:r,y:o,dx:u,dy:h,cx:d,cy:f,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(n)?this.props.filter(n):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke((()=>this.invokeRenderer(this.state.activeNodes)),i,r)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=Om({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",(()=>{!function(e){$m&&$m!==e&&$m()}(t),$m=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})),this.dispatcher.on(["cancelled","fulfilled"],(()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,ji({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,ji({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),$m===t&&($m=null),this.state.tooltipElm=void 0})),this.dispatcher.on("active",(()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}))},created(){this.init(this.settings)},beforeUpdate(e){let{settings:t}=e;this.dispatcher&&(this.dispatcher.destroy(),Wm()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),Wm()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const{width:e,height:t}=this.state.targetElement.getBoundingClientRect();this.renderer.destroy(),this.renderer.size({width:e,height:t}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let{chart:n,scale:i,props:r,h:o}=t;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:i,h:o},s=[];return e.forEach((e=>{if("function"==typeof r.extract){const t=ji({node:e},a);s.push(r.extract(t))}})),s}(e,this),n=Hm(Im(t,{style:{left:"0px",top:"0px",visibility:"hidden"}},this).getBoundingClientRect(),this);this.state.tooltipElm=Im(t,n,this)}};const Gm={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter((e=>e.key===this.props.target)),t=e.filter((e=>e.collider)).map((e=>e.collider));t.forEach((e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Xm={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Km=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Zm=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function Jm(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(Km,((e,n,i)=>{const r=function(e){const t=e.match(Zm);return t?t.map(Number):[]}(i);let o=n.toLowerCase(),a=n;if("m"===o&&r.length>2&&(t.push([a,...r.splice(0,2)]),o="l",a="m"===a?"l":"L"),r.length<Xm[o])return"";for(t.push([a,...r.splice(0,Xm[o])]);r.length>=Xm[o]&&r.length&&Xm[o];)t.push([a,...r.splice(0,Xm[o])]);return""})),t}const Qm=2*Math.PI;function eg(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function tg(e,t,n,i,r){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*i+e**3*r}function ng(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,i){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+i.x-(n.x+n.x))+Math.abs(t.y+i.y-(n.y+n.y))}(e,t,n,i)<=10)return r[r.length-1]!==e&&r.push(e),r.push(i),r;const a=eg(e,t),s=eg(t,n),l=eg(n,i),c={x:tg(.5,e.x,t.x,n.x,i.x),y:tg(.5,e.y,t.y,n.y,i.y)},u=eg(a,s),h=eg(s,l);return ng(e,a,u,c,r,o-1),ng(c,h,l,i,r,o-1),r}function ig(e,t,n){const{cp1:i,cp2:r}=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return ng(e,i,r,n)}function rg(e,t,n){const i=[],r=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,h=e[6],d=e[7],f=e[1],p=e[2];if("a"===e[0]&&(h+=t,d+=n),t===d&&n===d)return i;if(!f||!p)return i.push({x:h,y:d}),i;({cx:s,cy:l,rx:f,ry:p,sweepAngle:c,startAngle:u}=function(e,t,n,i,r,o,a,s,l){let c,u,h,d,f,p;const m=Mu(n%360),g=Math.cos(m),y=Math.sin(m),x=(s-o)/2,v=(l-a)/2,b=g*x+y*v,w=g*v-y*x;p=b**2/(e=Math.abs(e))**2+w**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const M=e*w,k=t*b,S=M**2+k**2,_=(e*t)**2-S;let q=Math.sqrt(Math.max(_/S,0));i===r&&(q=-q);const D=q*(M/t),A=q*(-k/e);d=g*D-y*A+(s+o)/2,f=y*D+g*A+(l+a)/2;const C=(b-D)/e,N=(w-A)/t,E=(-b-D)/e,R=(-w-A)/t;return c=Math.atan2(N,C),c+=c<0?Qm:0,u=Math.atan2(R,E),u+=u<0?Qm:0,h=u-c,!r&&c<u?h-=Qm:r&&u<c&&(h+=Qm),h%=Qm,{startAngle:c,sweepAngle:h,cx:d,cy:f,rx:e,ry:t}}(f,p,a,r,o,h,d,t,n));const m=Math.abs(c*Math.sqrt((f**2+p**2)/2)),g=Math.ceil(m/10),y=c/g;for(let e=1;e<=g;e++){const t=(u+y*e)%Qm,n=Math.cos(t),r=Math.sin(t);i.push({x:s+n*f+-r*n,y:l+r*p+n*r})}return i}function og(e){const t=Jm(e),n=[],i=[];let r=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],h=u[0];switch("S"!==h&&"s"!==h&&"C"!==h&&"c"!==h&&(a=null,s=null),"T"!==h&&"t"!==h&&"Q"!==h&&"q"!==h&&(l=null,c=null),h){case"m":i.length&&n.push(i.splice(0));case"l":r+=u[1],o+=u[2],i.push({x:r,y:o});break;case"M":i.length&&n.push(i.splice(0));case"L":r=u[1],o=u[2],i.push({x:r,y:o});break;case"H":r=u[1],i.push({x:r,y:o});break;case"h":r+=u[1],i.push({x:r,y:o});break;case"V":o=u[1],i.push({x:r,y:o});break;case"v":o+=u[1],i.push({x:r,y:o});break;case"a":i.push(...rg(u,r,o)),r+=u[6],o+=u[7];break;case"A":i.push(...rg(u,r,o)),r=u[6],o=u[7];break;case"c":i.push(...ng({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o},{x:u[5]+r,y:u[6]+o})),a=u[3]+r,s=u[4]+o,r+=u[5],o+=u[6];break;case"C":i.push(...ng({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],r=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=r,s=o),i.push(...ng({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),a=u[1]+r,s=u[2]+o,r+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=r,s=o),i.push(...ng({x:r,y:o},{x:2*r-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],r=u[3],o=u[4];break;case"Q":i.push(...ig({x:r,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],r=u[3],o=u[4];break;case"q":i.push(...ig({x:r,y:o},{x:u[1]+r,y:u[2]+o},{x:u[3]+r,y:u[4]+o})),l=u[1]+r,c=u[2]+o,r+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...ig({x:r,y:o},{x:l,y:c},{x:u[1],y:u[2]})),r=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=r,c=o),l=2*r-l,c=2*o-c,i.push(...ig({x:r,y:o},{x:l,y:c},{x:u[1]+r,y:u[2]+o})),r+=u[1],o+=u[2];break;case"z":case"Z":i.length&&i.push({x:i[0].x,y:i[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];Math.abs(n.x-i.x)<1e-12&&Math.abs(n.y-i.y)<1e-12&&(e.splice(t,1),t--)}}(i),n.push(i.splice(0)),n}const ag={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter((e=>e.key===this.props.target)),t=[];e.forEach((e=>{og(e.attrs.d).forEach((e=>{e.forEach((e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})}))}))})),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let{outer:t,inner:n}=e;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var sg=[function(e){e.component("box",sd),e.component("box-marker",sd)},function(e){e.component("point",pd),e.component("point-marker",pd)},function(e){e.component("pie",xd)},function(e){e.component("grid-line",kd)},function(e){e.component("ref-line",Od)},function(e){e.component("axis",uf)},function(e){e.component("container",hf)},function(e){e.component("text",pf)},function(e){e.component("scrollbar",yf)},function(e){e.component("brush-range",Rf),e.component("brush-area-dir",Lf)},function(e){e.component("range",jf)},function(e){e.component("brush-lasso",Uf)},function(e){e.component("labels",om)},function(e){e.component("legend-cat",xm)},function(e){e.component("legend-seq",Sm)},function(e){e.component("line",Am)},function(e){e.component("brush-area",Rm)},function(e){e.component("tooltip",Ym)},function(e){e.component("debug-collider",Gm)},function(e){e.component("debug-path-to-points",ag)}];class lg{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,i;for(n=0;n<t;n++)i=this.children[n],e.push(i),i.children.length&&(e=[...e,...i.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map((e=>e.toJSON()))}}}class cg{constructor(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x:e,y:t,width:n,height:i,minWidth:r,minHeight:o})}set(){let{x:e=0,y:t=0,width:n=0,height:i=0,minWidth:r=0,minHeight:o=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="rect",n>=0?(this.x=e,this.width=Math.max(n,r)):(this.x=e+Math.min(n,-r),this.width=-Math.min(n,-r)),i>=0?(this.y=t,this.height=Math.max(i,o)):(this.y=t+Math.min(i,-o),this.height=-Math.min(i,-o))}containsPoint(e){return sh(this,e)}intersectsLine(e){return lh(this,Ji(e))}intersectsRect(e){return oh(this,Zi(e))}intersectsCircle(e){return Qu(e,this)}intersectsPolygon(e){return rh(e,this)}intersectsGeoPolygon(e){return gh(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class ug{constructor(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({cx:e,cy:t,r:n,minRadius:i})}set(){let{cx:e=0,cy:t=0,r:n=0,minRadius:i=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="circle",this.cx=e,this.cy=t,this.r=Math.max(n,i),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Ju(this,e)}intersectsLine(e){return eh(this,Ji(e))}intersectsRect(e){return Qu(this,Zi(e))}intersectsCircle(e){return n=e,!Gu(t=this)&&!Gu(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return th(this,e)}intersectsGeoPolygon(e){return fh(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class hg{constructor(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({x1:e,y1:t,x2:n,y2:i,tolerance:r})}set(){let{x1:e=0,y1:t=0,x2:n=0,y2:i=0,tolerance:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="line",this.x1=e,this.y1=t,this.x2=n,this.y2=i,this.tolerance=Math.max(0,Math.round(r)),this.vectors=this.points(),this.zeroSize=e===n&&t===i}containsPoint(e){if(this.tolerance>0){return eh({cx:e.x,cy:e.y,r:this.tolerance},this)}return uh(this,e)}intersectsLine(e){return ch(this,Ji(e))}intersectsRect(e){return lh(Zi(e),this)}intersectsCircle(e){return eh(e,this)}intersectsPolygon(e){return ih(e,this)}intersectsGeoPolygon(e){return mh(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class dg{constructor(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polygon",this.vertices=e.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return nh(this,e)}intersectsCircle(e){return th(e,this)}intersectsLine(e){return ih(this,Ji(e))}intersectsRect(e){return rh(this,Zi(e))}intersectsPolygon(e){return hh(this,e)}intersectsGeoPolygon(e){return dh(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function fg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dg(...t)}function pg(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function mg(e){for(let t=0;t<e.length-1;t++){const n=e[t],i=e[t+1];n.x===i.x&&n.y===i.y&&(e.splice(t,1),t--)}}class gg{constructor(){let{vertices:e=[[]]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({vertices:e})}set(){let{vertices:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.type="geopolygon",this.vertices=e.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)mg(this.vertices[e]),this.vertices[e].length>2&&pg(this.vertices[e]),this.polygons[e]=fg({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return ph(this,e)}intersectsCircle(e){return fh(e,this)}intersectsLine(e){return mh(this,Ji(e))}intersectsRect(e){return gh(this,Zi(e))}intersectsPolygon(e){return dh(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),i=t.boundingRect();return!!oh(n,i)&&(ah(i,n)?Zu(t,e):Zu(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function yg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new gg(...t)}class xg{constructor(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.set({points:e})}set(){let{points:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.type="polyline",this.segments=[],this._points=e.slice(),this._points.length>1)for(let e=0,i=this._points.length-1;e<i;e++)t=this._points[e],n=this._points[e+1],(t.x!==n.x||t.y!==n.y)&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y});var t,n}containsPoint(e){return this.segments.some((t=>uh(t,e)))}intersectsCircle(e){return this.segments.some((t=>eh(e,t)))}intersectsLine(e){const t=Ji(e);return this.segments.some((e=>ch(e,t)))}intersectsRect(e){const t=Zi(e);return this.segments.some((e=>lh(t,e)))}intersectsPolygon(e){return this.segments.some((t=>ih(e,t)))}intersectsGeoPolygon(e){return this.segments.some((t=>mh(e,t)))}points(){return this._points}}const vg=io();function bg(e,t){return vg.get(e)(t)}vg.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cg(...t)})),vg.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ug(...t)})),vg.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new hg(...t)})),vg.add("polygon",fg),vg.add("geopolygon",yg),vg.add("polyline",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new xg(...t)}));class wg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach((e=>{const t=bg(e.type,e);t&&this.geometries.push(t)}))}containsPoint(e){return this.geometries.some((t=>t.containsPoint(e)))}intersectsLine(e){return this.geometries.some((t=>t.intersectsLine(e)))}intersectsRect(e){return this.geometries.some((t=>t.intersectsRect(e)))}intersectsCircle(e){return this.geometries.some((t=>t.intersectsCircle(e)))}intersectsPolygon(e){return this.geometries.some((t=>t.intersectsPolygon(e)))}intersectsGeoPolygon(e){return this.geometries.some((t=>t.intersectsGeoPolygon(e)))}}class Mg{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Mg).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,i,r;if(e instanceof Mg&&(e=e._elements),Array.isArray(e)){for(i=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(r=0;r<3;r++)i[t][n]+=this._elements[t][r]*e[r][n];this._elements=i}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,i,r,o){return this.multiply([[e,n,r],[t,i,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],i=this._elements[1][0],r=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*r*l+t*o*a+n*i*s-n*r*a-t*i*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],i=this._elements[0][2],r=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,i*l-n*c,n*a-i*o],[a*s-r*c,t*c-i*s,i*r-t*a],[r*l-o*s,s*n-t*l,t*o-n*r]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map((e=>e.join("\t"))).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,i=[e.x,e.y,1],r=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=i[n]*r[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,i,r,o,a=this._elements,s=[];for(r=0;r<e.length;r++){for(t=[e[r].x,e[r].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(i=0;i<this._elements[n].length;i++)o[n]+=t[i]*a[n][i];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const kg=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Sg(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const i=t.args[1],r=t.args[2];e.translate(i,r),e.rotate(n),e.translate(-i,-r)}else 1===t.args.length&&e.rotate(n)}function _g(e,t){const n=t.args[0],i=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,i)}function qg(e,t){const n=t.args[0],i=isNaN(t.args[1])?0:t.args[1];e.translate(n,i)}function Dg(e,t){t.args.length>=6&&e.transform(...t.args)}function Ag(e,t){const n=function(e){let t,n=[];for(;null!==(t=kg.exec(e));){const e=t[2].trim(),i=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:i.filter((e=>e.trim().length>0)).map((e=>Number(e)))})}return n}(e);let i;for(let e=0,r=n.length;e<r;e++)i=n[e],"rotate"===i.cmd?Sg(t,i):"scale"===i.cmd?_g(t,i):"matrix"===i.cmd?Dg(t,i):"translate"===i.cmd&&qg(t,i)}const Cg={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},Ng={type:(e,t)=>t.filter((t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()})),attr:(e,t,n,i)=>i.filter((i=>{const r=i.attrs[e];if(!t)return void 0!==r;if(void 0===r)return!1;switch(t){case"=":return n===String(r);case"!=":return n!==String(r);default:return!1}})),universal:e=>e,tag:(e,t)=>t.filter((t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))}))};function Eg(e,t){if(!t||!t.length||!e||"function"!=typeof Ng[e.type])return[];switch(e.type){case"type":case"tag":return Ng[e.type](e.value,t);case"attr":return Ng[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return Ng[e.type](t);default:return[]}}var Rg={find:function(e,t){const n=[],i=[];let r,o;if(t.isBranch){let a;r=function(e){const t=[];let n,i,r,o;return e.split(/\s*,\s*/).forEach((e=>{e=e.trim(),n=[];const a=t=>{r=e.match(Cg[t]),r&&(o=!0,e=e.slice(r[0].length),i={type:t,value:r[0]},"attr"===t&&(r=r[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),i.attribute=r[1],i.operator=r[2],i.attributeValue=r[3]),n.push(i))};for(;e&&(o=!1,r=e.match(/^\s*([>+~]|\s)\s*/),r&&(o=!0,n.push({type:" ",value:r[0]}),e=e.slice(r[0].length)),Object.keys(Cg).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););})),t}(e),o=t.descendants;for(let e=0,t=r.length;e<t;e++){a=r[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach((e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=Eg(e,n),s=!0})),s&&t.push(n);const l=t[0].filter((e=>{let n,i=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(i);i&&n<0;)i=i.parent,n=t[e].indexOf(i);if(n<0)return!1}return!0}));i.push(l)}for(let e=0,t=i.length;e<t;e++)for(let t=0,r=i[e].length;t<r;t++)n.indexOf(i[e][t])<0&&n.push(i[e][t])}return n||[]}};function Ig(e,t,n){const i=e.type;let r=e.points();n&&(r=r.every((e=>Array.isArray(e)))?r.map((e=>n.transformPoints(e))):n.transformPoints(r)),function(e,t){for(let n=0,i=e.length;n<i;n++)e[n].x/=t,e[n].y/=t}(r,t);let o=null;if("rect"===i||"bounds"===i)o=Zi(r),o.type=i;else if("circle"===i)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(r,e.r),o.type=i;else if("line"===i)o=Ji(r),o.type=i;else if("polygon"===i||"polyline"===i){o={type:"path",d:bu(r,"polygon"===i)}}else if("geopolygon"===i){let e="";for(let t=0;t<r.length;t++)e+=bu(r[t],!0);o={type:"path",d:e}}return o}class Og{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{x:n,y:i,width:r,height:o}=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n,y:i,width:r,height:o}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map((e=>Ig(e,t,n)))}:Ig(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map((e=>new Og(e))),this._parent=()=>e.parent?new Og(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,i=this._getElementBoundingRect();let r=i.left,o=i.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const{left:t=0,top:n=0}=e.getBoundingClientRect();r-=t,o-=n}return n.x+=r,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function Pg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Og(...t)}class Lg{constructor(e){this._node=Pg(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function Tg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lg(...t)}function zg(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=Tg(n);const e=n.parent;e&&"stage"!==e.type&&zg(e,t.parent)}}function Fg(e,t,n){if(null===e.colliderType)return null;const i=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};({x:n.cx,y:n.cy}=e.inverseModelViewMatrix.transformPoint(i)),n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every((e=>Array.isArray(e)))?yg(n):fg(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let i=e.descendants.length-1;i>=0;i--){const r=e.descendants[i];if(null!==r.collider&&r.collider[t](n)){const e=Tg(r);return zg(r,e),e}}return null}(e,t,i):function(e,t,n){if(e.collider[t](n)){const t=Tg(e);return zg(e,t),t}return null}(e,t,i)}function jg(e,t,n,i){const r=e.length;for(let o=0;o<r;o++){const r=e[o],a=Fg(r,t,i);a&&n.push(a),!r.children||a||r.collider||jg(r.children,t,n,i)}}function Vg(e,t,n){const i=e.length;for(let r=0;r<i;r++){const i=e[r];if(null!==Fg(i,t,n))return!0;if(i.children&&!i.collider)return Vg(i.children,t,n)}return!1}function Bg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(Qi(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=Ki(e).map((e=>qu(e,t))),["intersectsRect",n];case"line":return n=Xi(e).map((e=>qu(e,t))),["intersectsLine",n];case"point":return n=qu(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map((e=>qu(e,t))),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map((e=>e.map((e=>qu(e,t))))),["intersectsGeoPolygon",n];default:return[]}}function Hg(e,t){const[n,i]=Bg(t,e.dpi),r=[];return n&&(jg([e],n,r,i),function(e,t){for(let n=0,i=t.length;n<i;n++)t[n].input=e}(t,r)),r}function $g(e,t){const[n,i]=Bg(t,e.dpi);return Vg([e],n,i)}class Wg extends lg{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const{data:t,desc:n,tag:i,strokeReference:r,fillReference:o}=e;var a,s;a=this.attrs,s=e,Object.keys(vu).forEach((e=>{const t=s[e];void 0!==t&&(a[vu[e]]=t)})),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=ji(!0,{},n)),"string"==typeof i&&(this.tag=i),"string"==typeof r&&(this.strokeReference=r),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return Rg.find(e,this).map((e=>Pg(e)))}getItemsFrom(e){return Hg(this,e)}containsPoint(e){return $g(this,e)}intersectsLine(e){return $g(this,e)}intersectsRect(e){return $g(this,e)}intersectsCircle(e){return $g(this,e)}intersectsPolygon(e){return $g(this,e)}intersectsGeoPolygon(e){return $g(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Mg;void 0!==this.attrs.transform&&Ag(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Mg;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),i=e.attrs,r=Object.keys(i);if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const r=n[e];if(!Object.hasOwnProperty.call(i,r))return!1;if(t[r]!==i[r])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new wg(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=bg("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=bg(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class Ug extends lg{addChild(e){if(!(e&&e instanceof lg))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const Yg=Ug.prototype;class Gg extends Wg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const{collider:t}=e,n=ji({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},[i,,r]=e.bounds(t),{x:o,y:a}=i,{x:s,y:l}=r,c=isNaN(n.width)?s:Math.max(s,n.width+n.x),u=isNaN(n.height)?l:Math.max(l,n.height+n.y);n.x=isNaN(n.x)?o:Math.min(o,n.x),n.y=isNaN(n.y)?a:Math.min(a,n.y),n.width=c-n.x,n.height=u-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=ji({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=Yg.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=ji({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=Yg.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=ji({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;if(Yg.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=ji(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(Yg.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=ji(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function Xg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Gg(...t)}class Kg extends Gg{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const Zg=Ug.prototype,Jg=["x1","x2","y1","y2","id","offset","style"];class Qg extends Wg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=Jg.length;i!==r;i++)n=Jg[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Zg.addChild.call(this,e)}addChildren(e){return Zg.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return Zg.removeChild.call(this,e),this}removeChildren(e){return Zg.removeChildren.call(this,e),this}}function ey(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Qg(...t)}const ty=Ug.prototype,ny=["patternUnits","x","y","width","height","id"];class iy extends Wg{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{type:t="container"}=e;super(t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let i=0,r=ny.length;i!==r;i++)n=ny[i],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return ty.addChild.call(this,e)}addChildren(e){return ty.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,i=n?n.length:0;for(t=0;t<i;t++)n[t]._stage=null;return ty.removeChild.call(this,e),this}removeChildren(e){return ty.removeChildren.call(this,e),this}}class ry extends Wg{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,width:i=0,height:r=0,rx:o=0,ry:a=0,collider:s}=e,l=ji({type:"rect",x:t,y:n,width:i,height:r},s);super.set(e),i>=0?(this.attrs.x=t,this.attrs.width=i):(this.attrs.x=t+i,this.attrs.width=-i),r>=0?(this.attrs.y=n,this.attrs.height=r):(this.attrs.y=n+r,this.attrs.height=-r),o>0&&(this.attrs.rx=o),a>0&&(this.attrs.ry=a),this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=Ki(this.attrs),n=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t,[i,r,o,a]=Gi(n);return this.__boundingRect[e]={x:i,y:r,width:o-i,height:a-r},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class oy extends Wg{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{cx:t=0,cy:n=0,r:i=0,collider:r}=e,o=ji({type:"circle",cx:t,cy:n,r:i},r);super.set(e),this.attrs.cx=t,this.attrs.cy=n,this.attrs.r=i,this.collider=o,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const{cx:t,cy:n,r:i,r:r}=this.attrs,o=t-i,a=n-r;let s=2*i,l=2*r,c=[{x:o,y:a},{x:o+s,y:a},{x:o+s,y:a+l},{x:o,y:a+l}];if(e&&this.modelViewMatrix){c=this.modelViewMatrix.transformPoints(c);const[t,n,i,r]=Gi(c);s=i-t,l=r-n,this.__bounds[e]=[{x:t,y:n},{x:t+s,y:n},{x:t+s,y:n+l},{x:t,y:n+l}]}else this.__bounds[e]=c;return this.__bounds[e]}}class ay extends Wg{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x1:t=0,y1:n=0,x2:i=0,y2:r=0,collider:o}=e;super.set(e),this.attrs.x1=t,this.attrs.y1=n,this.attrs.x2=i,this.attrs.y2=r;const a={type:"line",x1:t,y1:n,x2:i,y2:r};this.collider=ji(a,o),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=Xi(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const[n,i,r,o]=Gi(t),a=n!==r||i!==o;return this.__boundingRect[e]={x:n,y:i,width:a?Math.max(1,r-n):0,height:a?Math.max(1,o-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const sy=Math.PI/2;function ly(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function cy(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const uy={step:function(e){return new Zr(e,.5)},stepAfter:function(e){return new Zr(e,1)},stepBefore:function(e){return new Zr(e,0)},linear:Ar,basis:function(e){return new Lr(e)},cardinal:Fr.tension(0),catmullRom:Vr,monotonex:function(e){return new Ur(e)},monotoney:function(e){return new Yr(e)},natural:function(e){return new Xr(e)}};function hy(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class dy extends Wg{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=qr();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const{major:t,minor:n,layerObj:i,points:r,stngs:o,generatorType:a}=e,s=Er(),l=o.coordinates?o.coordinates.defined:null;s[t.p]((e=>e.major*t.size))["".concat(n.p,"1")]((e=>e.minor*n.size))["".concat(n.p,"0")]((e=>e.minor0*n.size)).curve(uy["monotone"===i.curve?"monotone".concat(t.p):i.curve]),l?s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined)):s.defined((e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)));const c=o.connect?r.filter(s.defined()):r,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=og(this.attrs.d),this.segments.length>1&&this.segments.every((e=>hy(e))))return void(this.collider=ji({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach((t=>{if(t.length<=1);else if(hy(t))this.collider=ji({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=[],r=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=ly(s,a),u=ly(s,l),h=(c+u)/2,d=h+Math.PI,f=Math.max(h,d),p=Math.min(h,d),m=c>u;if(1===n){const e=ly(a,s);i.push(cy(a,e-sy,t)),r.unshift(cy(a,e+sy,t))}const g=m?f:p,y=m?p:f;if(i.push(cy(s,g,t)),r.unshift(cy(s,y,t)),n===o-1){const e=ly(l,s);i.push(cy(l,e+sy,t)),r.unshift(cy(l,e-sy,t))}}return{type:"polygon",vertices:[...i,...r]}}(t,n,e.collider)}else this.collider=ji({type:"polyline",points:t},e.collider)}))}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:og(this.attrs.d),this.points=function(e){const t=[];let n,i=e.length;for(let r=0;r<i;r++){n=e[r];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points,[n,i,r,o]=Gi(t);return this.__boundingRect[e]={x:n||0,y:i||0,width:r-n||0,height:o-i||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function fy(e){let{data:t,_boundingRect:n,_textBoundsFn:i}=e;return null!=t&&(n||i)}class py extends Wg{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{x:t=0,y:n=0,dx:i=0,dy:r=0,textBoundsFn:o,text:a,title:s,collider:l,boundingRect:c,ellipsed:u}=e;super.set(e),this.attrs.x=t,this.attrs.y=n,this.attrs.dx=i,this.attrs.dy=r,this.attrs.text=a,void 0!==s&&(this.attrs.title=String(s)),"object"==typeof c?this._textBoundsFn=()=>c:"function"==typeof o&&(this._textBoundsFn=o),"string"==typeof u&&(this.ellipsed=u),this.collider=ji({type:fy(this)?"bounds":null},l),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=Ki(e),i=t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n,[r,o,a,s]=Gi(i);return this.__boundingRect[t]={x:r,y:o,width:a-r,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const my=io();function gy(e,t){return my.get(e)(t)}my.add("rect",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ry(...t)})),my.add("circle",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new oy(...t)})),my.add("text",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new py(...t)})),my.add("line",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ay(...t)})),my.add("path",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new dy(...t)})),my.add("stage",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Kg(...t)})),my.add("container",Xg),my.add("defs",Xg),my.add("linearGradient",ey),my.add("radialGradient",ey),my.add("conicGradient",ey),my.add("stop",ey),my.add("pattern",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new iy(...t)}));const yy=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==r[a]&&(o[a]=r[a]);return ji(o,i),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function xy(e,t){if(Array.isArray(t))for(let n=0,i=t.length;n<i;n++)t[n](e)}function vy(e,t,n){e.node=n[t],e.index=t}function by(e,t,n,i){let r=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(vy(o,a,e),xy(o,i.create),r="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,r)continue;o.node=yy.save(o.node);const s=gy(o.node.type,o.node);s&&(o.node.transform&&(n.save(),Ag(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&by(o.node.children,s,n,i),o.node.transform&&n.restore()),yy.restore()}}function wy(e){let{items:t,stage:n,dpi:i,on:r={}}=e;return n||(n=gy("stage",i)),by(t,n,new Mg,r),n}function My(e,t,n){const{orientation:i,degree:r,stops:o=[]}=n;let a=null;if("radial"===i){const n=t.boundingRect();a=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===i){const t=n.startAngle||0,i=n.x||0,r=n.y||0;a=e.createConicGradient(t,i,r)}else{const i=ku(r);["x1","x2","y1","y2"].forEach((e=>{e in n&&(i[e]=n[e])}));const o=t.boundingRect();a=e.createLinearGradient(o.x+i.x1*o.width,o.y+i.y1*o.height,o.x+i.x2*o.width,o.y+i.y2*o.height)}for(let e=0,t=o.length;e<t;e++){let t=o[e];a.addColorStop(t.offset,t.color)}return a}function ky(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach((e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)})),n.fill(),n.restore(),n.createPattern(t,"repeat")}function Sy(){let{x:e,y:t,width:n,height:i,scaleRatio:r,margin:o,edgeBleed:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return s.x=isNaN(e)?s.x:e,s.y=isNaN(t)?s.y:t,s.width=isNaN(n)?s.width:n,s.height=isNaN(i)?s.height:i,void 0!==r&&(s.scaleRatio.x=isNaN(r.x)?s.scaleRatio.x:r.x,s.scaleRatio.y=isNaN(r.y)?s.scaleRatio.y:r.y),void 0!==o&&(s.margin.left=isNaN(o.left)?0:o.left,s.margin.top=isNaN(o.top)?0:o.top),"object"==typeof a&&["left","right","top","bottom"].forEach((e=>{!isNaN(a[e])&&a[e]>0&&(s.edgeBleed[e]=a[e],s.edgeBleed.bool=!0)})),s.computedPhysical={x:Math.round(s.margin.left+(s.x-s.edgeBleed.left)*s.scaleRatio.x),y:Math.round(s.margin.top+(s.y-s.edgeBleed.top)*s.scaleRatio.y),width:Math.round((s.width+s.edgeBleed.left+s.edgeBleed.right)*s.scaleRatio.x),height:Math.round((s.height+s.edgeBleed.top+s.edgeBleed.bottom)*s.scaleRatio.y)},s}function _y(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Zp,textBounds:Qp,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function qy(e){return t=>{let{node:n}=t;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const Dy=200,Ay=200;class Cy{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,{rect:n,dpiRatio:i,canvasBufferSize:r}=e;t=r?"function"==typeof r?r(n):r:{width:n.computedPhysical.width+2*Dy,height:n.computedPhysical.height+2*Ay},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*i),this.bufferCanvas.height=Math.round(t.height*i)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const Ny=io();function Ey(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Ry(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Iy(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Oy(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=Object.keys(i);for(let r=0,o=n.length;r<o;r++){let o=n[r];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in i)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=r.length;t<n;t++){const n=r[t];e[n]=i[n]}}function Py(e,t,n,i){for(let r=0,o=e.length;r<o;r++){let o=e[r],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=My(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=i.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=My(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=i.patterns.create(o.attrs.stroke))),Oy(t,o,n,a),o.modelViewMatrix&&Iy(o.modelViewMatrix.elements,t),Ny.has(o.type)&&Ny.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Py(o.children,t,n,i),t.restore()}}function Ly(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wy;const i={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let r,o=!1,a=Sy();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Ey]];let l;const c=_y();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(i).forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof i.transform||t||(t=new Cy(e)),n.appendChild(e),e),c.getScene=i=>{const r=Ry(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:i,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*r*o,", ").concat(a.edgeBleed.top*r*s,")"):""};return 1===r&&1===o&&1===s||(l.transform+="scale(".concat(r*o,", ").concat(r*s,")")),n({items:[l],dpi:r,on:{create:[Vp(c.measureText),qy(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let i={};return{create(e){const r=e.key;return r?(i[r]=i[r]||ky(e,t,n),i[r]):ky(e,t,n)},clear(){i={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),h=Ry(u),d=t&&i.transform();if(d)return e.width=e.width,function(e){let{el:t,dpiRatio:n,transform:i}=e;if("object"==typeof i){const e=[i.horizontalScaling,i.horizontalSkewing,i.verticalSkewing,i.verticalScaling,i.horizontalMoving*n,i.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:h,transform:d}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*h),e.height=Math.round(a.computedPhysical.height*h),t&&t.updateSize({rect:a,dpiRatio:h,canvasBufferSize:i.canvasBufferSize}));const f=c.getScene(n),p=!r||!f.equals(r);l.clear();const m=o||p,g="function"==typeof i.progressive&&i.progressive();return m&&(g&&!g.isFirst||c.clear(),Py(f.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&f.children.unshift(...r.children),r=f,m},c.itemsAt=e=>r?r.getItemsFrom(e):[],c.findShapes=e=>r?r.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),r=null,c),c.size=e=>{if(e){const t=Sy(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),r=null},c}function Ty(e,t){Ny.add(e,t)}function zy(e,t){return Math.max(0,Math.min(e,t))}const Fy=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),jy=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Vy=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function By(e){return Fy.test(e)}function Hy(e){return jy.test(e)||Vy.test(e)}function $y(e){let t,n,i=e?e.length:0;for(t=0;t<i;t++){if(n=e[t],By(n))return"ltr";if(Hy(n))return"rtl"}return"ltr"}const Wy={start:"end",end:"start",center:"center",middle:"middle"};function Uy(e,t){return"rtl"===t?Wy[e]:e}function Yy(e,t){const n=[];let i;const r=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,i=t.length;e<i;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?r.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Yy([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=Yy(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return i=o.concat(n),n.isTree=!0,r.isTree=!0,o.isTree=!0,a.isTree=!0,i.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:r,items:i}}function Gy(e,t,n){for(let i=0,r=e.length;i<r;i++)e[i].object=n(e[i].content.type,t)}function Xy(e,t){for(let n=0,i=e.length;n<i;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Ky(e,t,n,i){let r;for(let o=0,a=e.length;o<a;o++)r=e[o],null!==r.object&&void 0!==r.object&&(n(r.object,r.content),r.diff&&(Gy(r.diff.added,r.object,t),Xy(r.diff.removed,i),Ky(r.diff.items,t,n,i)))}function Zy(e,t,n,i,r,o){const a=Yy(e,t);return Gy(a.added,n,i),Xy(a.removed,o),Ky(a.items,i,r,o),a.items}Ty("rect",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,i,r,o,a){o=zy(i/2,o>0?o:a),a=zy(r/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+r-a),e.quadraticCurveTo(t,n+r,t+o,n+r),e.lineTo(t+i-o,n+r),e.quadraticCurveTo(t+i,n+r,t+i,n+r-a),e.lineTo(t+i,n+a),e.quadraticCurveTo(t+i,n,t+i-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),i&&n.fill(),r&&n.stroke()})),Ty("circle",(function(e,t){let{g:n,doFill:i,doStroke:r}=t;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),i&&n.fill(),r&&n.stroke()})),Ty("line",(function(e,t){let{g:n,doStroke:i}=t;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),i&&n.stroke()})),Ty("path",(function(e,t){let{g:n,doStroke:i,doFill:r}=t;const o=new Path2D(e.d);r&&n.fill(o),i&&n.stroke(o)})),Ty("text",(function(e,t){let{g:n,ellipsed:i,doStroke:r}=t;const o=i||Bp(e,Zp);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter((e=>!!e)).join(" ");const a=$y(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=Uy("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=Hp(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),r&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}));const Jy="http://www.w3.org/2000/svg",Qy=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(Jy,"container"===e?"g":e);return t.appendChild(n),n},ex=e=>{e.parentNode&&e.parentNode.removeChild(e)},tx=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||Bp(t.attrs,Zp);const n=$y(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",Uy(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(Jy,"title");n.textContent=t.attrs.title,e.appendChild(n)}else e.setAttribute(n,t.attrs[n]);else{const i=+e.getAttribute(n)||0;let r=0;r="dominant-baseline"===n?Hp(t.attrs):t.attrs[n],e.setAttribute("dy",r+i)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class nx{constructor(e,t,n,i){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=i}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function ix(){return new nx(Zy,Qy,tx,ex)}function rx(e){let t,n,i,r=0;if(0===(e=JSON.stringify(e)).length)return r;for(t=0,i=e.length;t<i;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r&=r;return r}function ox(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jy,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:wy;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:ix)();let i,r,o,a=!1,s=Sy();const l={transform:void 0,disableScreenReader:!1},c=_y(),u={type:"defs",children:[]},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rx,n={},i=Date.now();const r={onCreate(r){let o={};r.node&&"object"==typeof r.node.fill&&"pattern"===r.node.fill.type&&r.node.fill.shapes&&(o.fill=r.node.fill),r.node&&"object"==typeof r.node.stroke&&"pattern"===r.node.stroke.type&&r.node.stroke.shapes&&(o.stroke=r.node.stroke),Object.keys(o).forEach((a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(i,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach((e=>{t.children.push(e)})),e.push(t),n[c]=!0}r.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")}))},clear(){n={}}};return r}(u.children),d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rx,n={},i=Date.now();const r={getOrCreateGradient(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(r[o]),l="picasso-gradient-".concat(i,"-").concat(s);if(!n[s]){let{orientation:t,degree:i,stops:a=[]}=r[o],c={};void 0===i&&(i=90),"radial"===t?c.type="radialGradient":(c=ku(i),["x1","x2","y1","y2"].forEach((e=>{e in r[o]&&(c[e]=r[o][e])})),c.type="linearGradient"),c.id=l,c.children=a.map((e=>{let{offset:t,color:n,opacity:i}=e;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==i?i:1)}})),e.push(c),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=r.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=r.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return r}(u.children);return c.element=()=>i,c.root=()=>r,c.settings=e=>(e&&Object.keys(l).forEach((t=>{void 0!==e[t]&&(l[t]=e[t])})),l),c.appendTo=t=>(i||(i=t.ownerDocument.createElementNS(e,"svg"),i.style.position="absolute",i.style["-webkit-font-smoothing"]="antialiased",i.style["-moz-osx-font-smoothing"]="antialiased",i.style.pointerEvents="none",i.setAttribute("xmlns",e),r=t.ownerDocument.createElementNS(e,"g"),r.style.pointerEvents="auto",i.appendChild(r)),t.appendChild(i),i),c.getScene=e=>{const n=s.scaleRatio.x,i=s.scaleRatio.y,r={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*i,")"):""};return 1===n&&1===i||(r.transform+="scale(".concat(n,", ").concat(i,")")),t({items:[r],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},d.onCreate,h.onCreate,Vp(c.measureText),qy(c)]}})},c.render=e=>{if(!i)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const{horizontalScaling:e,horizontalSkewing:n,verticalSkewing:i,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return r.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}r.style.transform="";l.disableScreenReader&&i.setAttribute("aria-hidden",!0),a&&(i.style.left="".concat(s.computedPhysical.x,"px"),i.style.top="".concat(s.computedPhysical.y,"px"),i.setAttribute("width",s.computedPhysical.width),i.setAttribute("height",s.computedPhysical.height)),d.clear(),h.clear(),u.children.length=0;const f=c.getScene(e),p=!o||!f.equals(o),m=a||p;return m&&(c.clear(),n.render(f.children,r)),a=!1,o=f,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!r)return c;o=null;const e=r.cloneNode(!1);return i.replaceChild(e,r),r=e,c},c.destroy=()=>{i&&i.parentNode&&i.parentNode.removeChild(i),i=null,r=null},c.size=e=>{if(e){const t=Sy(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var ax,sx,lx,cx,ux,hx,dx,fx={},px=[],mx=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function gx(e,t){for(var n in t)e[n]=t[n];return e}function yx(e){var t=e.parentNode;t&&t.removeChild(e)}function xx(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?ax.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return vx(e,a,i,r,null)}function vx(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++lx:r};return null==r&&null!=sx.vnode&&sx.vnode(o),o}function bx(e){return e.children}function wx(e,t){this.props=e,this.context=t}function Mx(e,t){if(null==t)return e.__?Mx(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Mx(e):null}function kx(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return kx(e)}}function Sx(e){(!e.__d&&(e.__d=!0)&&cx.push(e)&&!_x.__r++||ux!==sx.debounceRendering)&&((ux=sx.debounceRendering)||hx)(_x)}function _x(){var e,t,n,i,r,o,a,s;for(cx.sort(dx);e=cx.shift();)e.__d&&(t=cx.length,i=void 0,r=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(i=[],(r=gx({},o)).__v=o.__v+1,Ox(s,o,r,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,i,null==a?Mx(o):a,o.__h),Px(i,o),o.__e!=a&&kx(o)),cx.length>t&&cx.sort(dx));_x.__r=0}function qx(e,t,n,i,r,o,a,s,l,c){var u,h,d,f,p,m,g,y=i&&i.__k||px,x=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(f=n.__k[u]=null==(f=t[u])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?vx(null,f,null,null,f):Array.isArray(f)?vx(bx,{children:f},null,null,null):f.__b>0?vx(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=y[u])||d&&f.key==d.key&&f.type===d.type)y[u]=void 0;else for(h=0;h<x;h++){if((d=y[h])&&f.key==d.key&&f.type===d.type){y[h]=void 0;break}d=null}Ox(e,f,d=d||fx,r,o,a,s,l,c),p=f.__e,(h=f.ref)&&d.ref!=h&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(h,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=Dx(f,l,e):l=Ax(e,f,d,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=e&&(l=Mx(d))}for(n.__e=m,u=x;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=Cx(i).nextSibling),zx(y[u],y[u]));if(g)for(u=0;u<g.length;u++)Tx(g[u],g[++u],g[++u])}function Dx(e,t,n){for(var i,r=e.__k,o=0;r&&o<r.length;o++)(i=r[o])&&(i.__=e,t="function"==typeof i.type?Dx(i,t,n):Ax(n,i,i,r,i.__e,t));return t}function Ax(e,t,n,i,r,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||r!=o||null==r.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(r),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<i.length;l+=1)if(s==r)break e;e.insertBefore(r,o),a=o}return void 0!==a?a:r.nextSibling}function Cx(e){var t,n,i;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(i=Cx(n)))return i;return null}function Nx(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||mx.test(t)?n:n+"px"}function Ex(e,t,n,i,r){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Nx(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||Nx(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i||e.addEventListener(t,o?Ix:Rx,o):e.removeEventListener(t,o?Ix:Rx,o);else if("dangerouslySetInnerHTML"!==t){if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Rx(e){return this.l[e.type+!1](sx.event?sx.event(e):e)}function Ix(e){return this.l[e.type+!0](sx.event?sx.event(e):e)}function Ox(e,t,n,i,r,o,a,s,l){var c,u,h,d,f,p,m,g,y,x,v,b,w,M,k,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=sx.__b)&&c(t);try{e:if("function"==typeof S){if(g=t.props,y=(c=S.contextType)&&i[c.__c],x=c?y?y.props.value:c.__:i,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in S&&S.prototype.render?t.__c=u=new S(g,x):(t.__c=u=new wx(g,x),u.constructor=S,u.render=Fx),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=x,u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=S.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=gx({},u.__s)),gx(u.__s,S.getDerivedStateFromProps(g,u.__s))),d=u.props,f=u.state,u.__v=t,h)null==S.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,x),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,x)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,x),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,f,p)}))}if(u.context=x,u.props=g,u.__P=e,b=sx.__r,w=0,"prototype"in S&&S.prototype.render){for(u.state=u.__s,u.__d=!1,b&&b(t),c=u.render(u.props,u.state,u.context),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[]}else do{u.__d=!1,b&&b(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=gx(gx({},i),u.getChildContext())),h||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(d,f)),k=null!=c&&c.type===bx&&null==c.key?c.props.children:c,qx(e,Array.isArray(k)?k:[k],t,n,i,r,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Lx(n.__e,t,n,i,r,o,a,l);(c=sx.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),sx.__e(e,t,n)}}function Px(e,t){sx.__c&&sx.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){sx.__e(e,t.__v)}}))}function Lx(e,t,n,i,r,o,a,s){var l,c,u,h=n.props,d=t.props,f=t.type,p=0;if("svg"===f&&(r=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!f&&(f?l.localName===f:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===f)return document.createTextNode(d);e=r?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,d.is&&d),o=null,s=!1}if(null===f)h===d||s&&e.data===d||(e.data=d);else{if(o=o&&ax.call(e.childNodes),c=(h=n.props||fx).dangerouslySetInnerHTML,u=d.dangerouslySetInnerHTML,!s){if(null!=o)for(h={},p=0;p<e.attributes.length;p++)h[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,i,r){var o;for(o in n)"children"===o||"key"===o||o in t||Ex(e,o,null,n[o],i);for(o in t)r&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||Ex(e,o,t[o],n[o],i)}(e,d,h,r,s),u)t.__k=[];else if(p=t.props.children,qx(e,Array.isArray(p)?p:[p],t,n,i,r&&"foreignObject"!==f,o,a,o?o[0]:n.__k&&Mx(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&yx(o[p]);s||("value"in d&&void 0!==(p=d.value)&&(p!==e.value||"progress"===f&&!p||"option"===f&&p!==h.value)&&Ex(e,"value",p,h.value,!1),"checked"in d&&void 0!==(p=d.checked)&&p!==e.checked&&Ex(e,"checked",p,h.checked,!1))}return e}function Tx(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){sx.__e(e,n)}}function zx(e,t,n){var i,r;if(sx.unmount&&sx.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Tx(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){sx.__e(e,t)}i.base=i.__P=null,e.__c=void 0}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&zx(i[r],t,n||"function"!=typeof e.type);n||null==e.__e||yx(e.__e),e.__=e.__e=e.__d=void 0}function Fx(e,t,n){return this.constructor(e,n)}function jx(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createElement:t=document.createElement.bind(document)}=e;let n,i,r=Sy();const o={transform:void 0,disableScreenReader:!1},a=_y();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach((t=>{void 0!==e[t]&&(o[t]=e[t])})),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const{horizontalScaling:e,horizontalSkewing:i,verticalSkewing:r,verticalScaling:o,horizontalMoving:a,verticalMoving:s}=t;return n.style.transform="matrix(".concat(e,", ").concat(i,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(r.computedPhysical.x,"px"),n.style.top="".concat(r.computedPhysical.y,"px"),n.style.width="".concat(r.computedPhysical.width,"px"),n.style.height="".concat(r.computedPhysical.height,"px"),a=Array.isArray(e)?xx("div",null,e):e,i=function(e,t,n){var i,r,o;sx.__&&sx.__(e,t),r=(i="function"==typeof n)?null:n&&n.__k||t.__k,o=[],Ox(t,e=(!i&&n||t).__k=xx(bx,null,[e]),r||fx,fx,void 0!==t.ownerSVGElement,!i&&n?[n]:r?null:t.firstChild?ax.call(t.childNodes):null,o,!i&&n?n:r?r.__e:t.firstChild,i),Px(o,e)}(a,n,i),!0},a.renderArgs=[xx],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;i=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,i=null},a.size=e=>(e&&(r=Sy(e)),r),a}ax=px.slice,sx={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},lx=0,wx.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=gx({},this.state),"function"==typeof e&&(e=e(gx({},n),this.props)),e&&gx(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Sx(this))},wx.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Sx(this))},wx.prototype.render=bx,cx=[],hx="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,dx=function(e,t){return e.__v.__b-t.__v.__b},_x.__r=0;var Vx=[function(e){e.renderer("svg",ox)},function(e){e.renderer("canvas",Ly)},function(e){e.renderer("dom",jx)}];const Bx={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const Hx=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=function(){let{level:e=Bx.OFF,pipe:t=console}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e;const i={[Bx.OFF]:()=>{},[Bx.ERROR]:function(){return t.error(...arguments)},[Bx.WARN]:function(){return t.warn(...arguments)},[Bx.INFO]:function(){return t.info(...arguments)},[Bx.DEBUG]:function(){return t.log(...arguments)}},r=function(e){if(e&&!(n<e)){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];(i[e]||i[Bx.DEBUG])(...r)}};return{log:r,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Bx.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Bx.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Bx.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r(Bx.DEBUG,...t)},level:e=>("number"==typeof e&&(n=e),n),LOG_LEVEL:Bx}}(t.logger),r={component:io(n.component,"component",i),data:io(n.data,"data",i),formatter:io(n.formatter,"formatter",i),interaction:io(n.interaction,"interaction",i),renderer:Wh(n.renderer),scale:io(n.scale,"scale",i),symbol:io(n.symbol,"symbol",i),logger:i};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:ji({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},r)}return t.renderer&&t.renderer.prio&&r.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r)},o.chart=e=>$h(e,{registries:r,logger:i,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(r).forEach((e=>{o[e]=r[e]})),o.version=Vi,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:Uh,data:Zh,formatter:As,interaction:Jh,renderer:Wh(),scale:Cc,symbol:Pu});sg.forEach(Hx.use),Vx.forEach(Hx.use),[].forEach(Hx.use);const $x={require:["chart","renderer"],renderer:"dom",render(e){var t;return function({chart:e,settings:t,h:n}){if(!e)return[];const i=function({h:e,settings:t}){if(!t)return[];const{isRtl:n,title:i,text:r}=t,o={disclaimer:{borderRadius:"10px",border:"1px solid #404040",position:"absolute",top:"10%",left:"50%",margin:"0 0 0 -150px",width:"298px",cursor:"default",background:"white",direction:n?"rtl":"ltr"},closeIcon:{position:"absolute",[n?"left":"right"]:"5px",top:"3px",cursor:"pointer",color:"#595959",pointerEvents:"auto"},dmHeader:{color:"#575859",fontSize:"18px",paddingLeft:"20px",paddingTop:"10px",paddingRight:"20px",paddingBottom:"0px",maxHeight:"44px",overflow:"hidden"},dmMain:{display:"block",color:"#575859",paddingLeft:"20px",paddingRight:"20px",paddingTop:"10px",paddingBottom:"10px"},dmP:{paddingBottom:"10px"},hidden:{display:"none"}};return[e("div",{style:o.disclaimer},e("div",{style:o.closeIcon,onClick:()=>null==t?void 0:t.close()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},e("defs",{},e("path",{id:"remove-a",d:"M9.41421356,8 L11.8890873,5.52512627 C12.065864,5.34834957 12.0305087,4.95944084 11.8183766,4.74730881 L11.2526912,4.18162338 C11.0405592,3.96949135 10.6516504,3.93413601 10.4748737,4.1109127 L8,6.58578644 L5.52512627,4.1109127 C5.34834957,3.93413601 4.95944084,3.96949135 4.74730881,4.18162338 L4.25233406,4.67659813 C3.96949135,4.95944084 3.93413601,5.34834957 4.1109127,5.52512627 L6.58578644,8 L4.1109127,10.4748737 C3.93413601,10.6516504 3.96949135,11.0405592 4.18162338,11.2526912 L4.67659813,11.7476659 C4.95944084,12.0305087 5.34834957,12.065864 5.52512627,11.8890873 L8,9.41421356 L10.4748737,11.8890873 C10.6516504,12.065864 11.0405592,12.0305087 11.2526912,11.8183766 L11.8183766,11.2526912 C12.0305087,11.0405592 12.065864,10.6516504 11.8890873,10.4748737 L9.41421356,8 Z M8,0 C12.4,0 16,3.6 16,8 C16,12.4 12.4,16 8,16 C3.6,16 0,12.4 0,8 C0,3.6 3.6,0 8,0 Z"})),e("use",{xlinkHref:"#remove-a"}))),e("header",{style:o.dmHeader},`${i}`),e("main",{style:o.dmMain},e("p",{style:o.dmP},`${r}`)))]}({settings:t,h:n});return i}({chart:this.chart,settings:null===(t=this.settings)||void 0===t?void 0:t.settings,h:e})}},Wx=52,Ux=-2*Math.PI/3,Yx=2*Math.PI/3,Gx="#EEEEEE",Xx=2.38,Kx={MIN:12,MAX:60},Zx={MIN:100,MAX:1e3},Jx={TOP:-4,BOTTOM:0,LEFT:4,RIGHT:4},Qx={VERTICAL_ALIGNMENT_FACTOR:.4},ev={VERTICAL_ALIGNMENT_FACTOR:1.25},tv=2,nv=1.2,iv="#595959",rv="#E6E6E6",ov=.4,av=1,sv=2,lv=.75,cv=.75,uv={MAX_WIDTH:150,MAX_LINES:2,CLEARANCE:12,ESTIMATED_LINE_HEIGHT:16,GAP:8},hv=70,dv=3,fv={MEASURE:"measure"},pv={BAR:"bar",SEGMENT_BAR:"segment-bar",LABEL_BAR:"label-bar",BACKGROUND_BAR:"background-bar",MARK:"mark",OOB_INDICATOR:"oob-indicator",BAR_AXIS:"bar-axis",AXIS_TITLE:"axis-title",GAUGE_LABEL:"gauge-label",RADIAL_AXIS:"radial-axis",RADIAL_GAUGE_NEEDLE:"radial-gauge-needle",RADIAL_OOB_INDICATOR_MIN:"radial-oob-indicator-min",RADIAL_OOB_INDICATOR_MAX:"radial-oob-indicator-max",RADIAL_GAUGE:"radial-gauge",CIRCLE_GAUGE:"circle-gauge",REFERENCE_LINES_AND_LABELS:"reference-lines-and-labels",RADIAL_SPARK:"radial-spark",RADIAL_GAUGE_LABEL:"radial-gauge-label",RADIAL_REFERENCE_LINES:"radial-reference-lines",SEGMENT_RADIAL_GAUGE:"segment-radial-gauge",LABEL_RADIAL_GAUGE:"label-radial-gauge"},mv=1e-4,gv="XSMALL",yv="SMALL",xv="XSMALL_VERTICAL",vv="XSMALL_HORIZONTAL",bv="SMALL",wv="MEDIUM",Mv={FULL:{width:550,height:450},MEDIUM:{width:300,height:150},SMALL:{width:150,height:84},SMALLER:{width:150,height:75},XSMALL:{width:84,height:84},XSMALL_VERTICAL:{width:105,height:0},XSMALL_HORIZONTAL:{width:0,height:104},SPARK:{height:75,width:50}},kv=600,Sv=200,_v=500;function qv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Dv(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Av(){}var Cv=.7,Nv=1/Cv,Ev="\\s*([+-]?\\d+)\\s*",Rv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Iv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ov=/^#([0-9a-f]{3,8})$/,Pv=new RegExp(`^rgb\\(${Ev},${Ev},${Ev}\\)$`),Lv=new RegExp(`^rgb\\(${Iv},${Iv},${Iv}\\)$`),Tv=new RegExp(`^rgba\\(${Ev},${Ev},${Ev},${Rv}\\)$`),zv=new RegExp(`^rgba\\(${Iv},${Iv},${Iv},${Rv}\\)$`),Fv=new RegExp(`^hsl\\(${Rv},${Iv},${Iv}\\)$`),jv=new RegExp(`^hsla\\(${Rv},${Iv},${Iv},${Rv}\\)$`),Vv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Bv(){return this.rgb().formatHex()}function Hv(){return this.rgb().formatRgb()}function $v(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ov.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Wv(t):3===n?new Xv(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Uv(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Uv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Pv.exec(e))?new Xv(t[1],t[2],t[3],1):(t=Lv.exec(e))?new Xv(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Tv.exec(e))?Uv(t[1],t[2],t[3],t[4]):(t=zv.exec(e))?Uv(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Fv.exec(e))?tb(t[1],t[2]/100,t[3]/100,1):(t=jv.exec(e))?tb(t[1],t[2]/100,t[3]/100,t[4]):Vv.hasOwnProperty(e)?Wv(Vv[e]):"transparent"===e?new Xv(NaN,NaN,NaN,0):null}function Wv(e){return new Xv(e>>16&255,e>>8&255,255&e,1)}function Uv(e,t,n,i){return i<=0&&(e=t=n=NaN),new Xv(e,t,n,i)}function Yv(e){return e instanceof Av||(e=$v(e)),e?new Xv((e=e.rgb()).r,e.g,e.b,e.opacity):new Xv}function Gv(e,t,n,i){return 1===arguments.length?Yv(e):new Xv(e,t,n,null==i?1:i)}function Xv(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Kv(){return`#${eb(this.r)}${eb(this.g)}${eb(this.b)}`}function Zv(){const e=Jv(this.opacity);return`${1===e?"rgb(":"rgba("}${Qv(this.r)}, ${Qv(this.g)}, ${Qv(this.b)}${1===e?")":`, ${e})`}`}function Jv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function eb(e){return((e=Qv(e))<16?"0":"")+e.toString(16)}function tb(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ib(e,t,n,i)}function nb(e){if(e instanceof ib)return new ib(e.h,e.s,e.l,e.opacity);if(e instanceof Av||(e=$v(e)),!e)return new ib;if(e instanceof ib)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),o=Math.max(t,n,i),a=NaN,s=o-r,l=(o+r)/2;return s?(a=t===o?(n-i)/s+6*(n<i):n===o?(i-t)/s+2:(t-n)/s+4,s/=l<.5?o+r:2-o-r,a*=60):s=l>0&&l<1?0:a,new ib(a,s,l,e.opacity)}function ib(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function rb(e){return(e=(e||0)%360)<0?e+360:e}function ob(e){return Math.max(0,Math.min(1,e||0))}function ab(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}qv(Av,$v,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bv,formatHex:Bv,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return nb(this).formatHsl()},formatRgb:Hv,toString:Hv}),qv(Xv,Gv,Dv(Av,{brighter(e){return e=null==e?Nv:Math.pow(Nv,e),new Xv(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Cv:Math.pow(Cv,e),new Xv(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Xv(Qv(this.r),Qv(this.g),Qv(this.b),Jv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Kv,formatHex:Kv,formatHex8:function(){return`#${eb(this.r)}${eb(this.g)}${eb(this.b)}${eb(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Zv,toString:Zv})),qv(ib,(function(e,t,n,i){return 1===arguments.length?nb(e):new ib(e,t,n,null==i?1:i)}),Dv(Av,{brighter(e){return e=null==e?Nv:Math.pow(Nv,e),new ib(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Cv:Math.pow(Cv,e),new ib(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Xv(ab(e>=240?e-240:e+120,r,i),ab(e,r,i),ab(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new ib(rb(this.h),ob(this.s),ob(this.l),Jv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Jv(this.opacity);return`${1===e?"hsl(":"hsla("}${rb(this.h)}, ${100*ob(this.s)}%, ${100*ob(this.l)}%${1===e?")":`, ${e})`}`}}));const sb=Math.PI/180,lb=180/Math.PI,cb=.96422,ub=.82521,hb=4/29,db=6/29,fb=3*db*db,pb=db*db*db;function mb(e){if(e instanceof gb)return new gb(e.l,e.a,e.b,e.opacity);if(e instanceof Mb)return kb(e);e instanceof Xv||(e=Yv(e));var t,n,i=bb(e.r),r=bb(e.g),o=bb(e.b),a=yb((.2225045*i+.7168786*r+.0606169*o)/1);return i===r&&r===o?t=n=a:(t=yb((.4360747*i+.3850649*r+.1430804*o)/cb),n=yb((.0139322*i+.0971045*r+.7141733*o)/ub)),new gb(116*a-16,500*(t-a),200*(a-n),e.opacity)}function gb(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function yb(e){return e>pb?Math.pow(e,1/3):e/fb+hb}function xb(e){return e>db?e*e*e:fb*(e-hb)}function vb(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function bb(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function wb(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof Mb)return new Mb(e.h,e.c,e.l,e.opacity);if(e instanceof gb||(e=mb(e)),0===e.a&&0===e.b)return new Mb(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*lb;return new Mb(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Mb(e,t,n,null==i?1:i)}function Mb(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function kb(e){if(isNaN(e.h))return new gb(e.l,0,0,e.opacity);var t=e.h*sb;return new gb(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}function Sb(e){return function(e){return wb(e).l<70}(e)?rv:iv}function _b(e,t=!0){let n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return t&&(n+="Z"),n}function qb(e){const{angle:t,origin:n}=e,i=e.points.map((e=>function(e,t,n={x:0,y:0}){const i=Math.cos(t),r=Math.sin(t),o=(s=n,{x:(a=e).x-s.x,y:a.y-s.y});var a,s;return function(e,t){return{x:e.x+t.x,y:e.y+t.y}}({x:i*o.x-r*o.y,y:r*o.x+i*o.y},n)}(e,t,n)));return{type:"path",fill:e.fill,d:_b(i)}}qv(gb,(function(e,t,n,i){return 1===arguments.length?mb(e):new gb(e,t,n,null==i?1:i)}),Dv(Av,{brighter(e){return new gb(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new gb(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new Xv(vb(3.1338561*(t=cb*xb(t))-1.6168667*(e=1*xb(e))-.4906146*(n=ub*xb(n))),vb(-.9787684*t+1.9161415*e+.033454*n),vb(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),qv(Mb,wb,Dv(Av,{brighter(e){return new Mb(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Mb(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return kb(this).rgb()}}));const Db={require:["chart"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t}){if(!e||!t)return[];const{size:n,component:i,selector:r,pointingTo:o,isRtl:a}=t;if(!e.component(t.component))return[];const s=e.findShapes(r).filter((e=>e.key===i));if(null==s||!s.length)return[];const{clientWidth:l,clientHeight:c}=e.element;let u=l/2,h=c/2,d=-Math.PI/2;const f=n/3;switch(o){case"top":h=f;break;case"bottom":h=c-f,d=3*Math.PI/2-Math.PI;break;case"right":u=l-f,d=0;break;case"left":u=f,d=Math.PI}const p=[];for(let e=0;e<s.length;e+=1){const t=s[e];let r=["top",...a?["left"]:["right"]].includes(o)?t.attrs.fill:Gx;if(i===pv.SEGMENT_BAR){const{stops:e}=t.attrs.fill;if(["top","right"].includes(o)){const t=e.find((e=>1===e.offset));r=(null==t?void 0:t.color)||iv}else{const t=e.toReversed().find((e=>0===e.offset));r=(null==t?void 0:t.color)||iv}}const l=Sb(r),c={x:u,y:h},f=n/6,m=qb({points:[{x:c.x+2*f,y:c.y},{x:c.x,y:c.y+f},{x:c.x,y:c.y-f}],angle:d,fill:l,origin:c});p.push(m)}return p}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings})}};function Ab(e,t,n,i){const r=Math.floor(Math.min(e,t)),o=Math.abs(i-n),a=.02*Math.tan(-o/4+Math.PI/2),s=2*(.4+a)-Rb(e,t)/r;return{innerRadius:s-2*(r>500?50:Math.max(r/_v*50,10))/r,outerRadius:s,radiusIncrease:a,labelGaugeRadius:1.39*(.4+a)}}function Cb(e,t,n,i){const r=i-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Nb({innerRadius:e,outerRadius:t,width:n,height:i}){return(t-e)*Math.min(n,i)/2}function Eb(e){return!1!==e.show&&0!==e.show&&"0"!==e.show}function Rb(e,t){return Math.min(6,Math.min(e,t)/Sv)}const Ib={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:i}=t;if(!e.component(t.component))return[];const{clientWidth:r,clientHeight:o}=e.element,{outerRadius:a,innerRadius:s}=Ab(r,o,Ux,Yx),l=Nb({innerRadius:s,outerRadius:a,width:r,height:o});let c=r/2,u=o/2,h=a*Math.min(r,o)/2,d=Cb(c,u,h,t.valueAngle),f=d.x,p=d.y;const m=[],g=Gx,y=t.fill||Sb(g),x={x:f,y:p},v=l/6;let b=[{x:x.x+.3*v,y:x.y},{x:x.x-7.5*v,y:x.y+v},{x:x.x-7.5*v,y:x.y-v}];const w=i-Math.PI/2,M=qb({points:b,angle:w,fill:y,origin:x});return M.data={pointerWidth:v,angle:w,radius:h,fill:y},m.push(M),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};const Ob={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{size:i,component:r,selector:o,angle:a,radius:s}=t;if(!e.component(t.component))return[];const l=e.findShapes(o).filter((e=>e.key===r));if(null==l||!l.length)return[];const{clientWidth:c,clientHeight:u}=e.element;let h=c/2,d=u/2,{x:f,y:p}=Cb(h,d,s,a);const m=[],g=t.fill,y=a===Ux?-1:1,x={x:f,y:p},v=i/6,b=qb({points:[{x:x.x+(2*v+1)*y,y:x.y+.5},{x:x.x+1*y,y:x.y+v+.5},{x:x.x+1*y,y:x.y-v+.5}],angle:a,fill:g,origin:x});return m.push(b),m}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}};var Pb,Lb;var Tb=function(){if(Lb)return Pb;Lb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,r=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,r=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!r&&!o)return!1;for(i in n);return void 0===i||e.call(n,i)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(i)return i(t,n).value}return t[n]};return Pb=function e(){var t,n,i,l,c,u,h=arguments[0],d=1,f=arguments.length,p=!1;for("boolean"==typeof h&&(p=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)i=s(h,n),h!==(l=s(t,n))&&(p&&l&&(o(l)||(c=r(l)))?(c?(c=!1,u=i&&r(i)?i:[]):u=i&&o(i)?i:{},a(h,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(h,{name:n,newValue:l}));return h},Pb}(),zb=Ot(Tb);let Fb;function jb(){Fb=Fb||document.createElement("canvas").getContext("2d")}const Vb={measureTextWidth(e){jb();const{width:t}=Fb.measureText(e);return t},lineWrap(e,t,n,i){let r,o;jb();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,h,d=e?e.split(/\s+/):[],f=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(Fb.font=n),o=0;o<a.length;o++){for(h=a[o],d=h.split(/\s+/),[f]=d,u="",r=1;r<d.length;r++)if(l=`${f} ${d[r]}`,c=Vb.measureTextWidth(l),c>t&&("number"!=typeof i||i>s.length)?(s.push(f),f=d[r]):f=l,"number"==typeof i&&s.length>=i){u=d.slice(r+1).join(" ");break}"number"!=typeof i||s.length<i?s.push(f):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]} ${f} ${u}`}return s},wordWrap(e,t,n,i,r){if(jb(),!e||!e.length)return[];n&&(Fb.font=n);let o=[];const a=e.slice();let s,l,c,u="";if(a.filter((e=>!!e)),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++){var h;if(l=a[c],u="",l.length<=1||Vb.measureTextWidth(l)<=t)o.push(l);else if(s=Vb.splitWord(l,t,void 0,void 0===i?void 0:i-o.length),s.length<=1)o.push(s[0]);else u=null!==(h=s.pop())&&void 0!==h?h:"",o=o.concat(s),a[c+1]?Vb.measureTextWidth(`${u} ${a[c+1]}`)>t&&(void 0===i||o.length+a.length-c<=i)?a.splice(c+1,0,u):a[c+1]=`${u} ${a[c+1]}`:a.push(u)}return o.forEach(((e,t,n)=>{n[t]=e.trim()})),void 0!==i&&o.length>i?(o=o.splice(0,i),o[o.length-1]=Vb.truncate(o[o.length-1],t,n,r).text):(l=o[o.length-1],l&&l.length>1&&Vb.measureTextWidth(l)>t&&(o[o.length-1]=Vb.truncate(l,t,n,r).text)),o},truncate(e,t,n,i="…"){jb();let r,o,a,s,l=e;const c=Vb.measureTextWidth("i");if(n&&(Fb.font=n),e&&t){if(Vb.measureTextWidth(l)>t){const e=Math.ceil(t/c);for(r=Math.min(e,l.length);r>0;r--)if(o=l.substring(0,r-1),a=o.trim()+i,Vb.measureTextWidth(a)<=t){s=l.substring(r-1),l=a;break}r||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,i){let r;jb();let o,a=e,s="",l=[];if(void 0!==n&&Vb.isNumber(n)&&n<=1)return[e];const c=Math.ceil(t/i);for(r=Math.min(e.length,c);r>0&&(a=e.substring(0,r),o=e.substring(r-1,r)," "===o?a=e.substring(0,r-1):a+="-",s=e.substring(r),!(Vb.measureTextWidth(a)<=t));r--);return(!r&&!a||Vb.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Vb.measureTextWidth(s)>t?l=l.concat(Vb.explodeWord(s,t,void 0===n?void 0:n-1,i)):l.push(s),l.filter((e=>""!==e.trim()))):l},splitWord:(e,t,n,i)=>(jb(),e&&t?(n&&(Fb.font=n),Vb.explodeWord(e,t,i,Math.max(1,Vb.measureTextWidth("i")))):[]),wrapText(e,t,n,i,r="…"){let o;return Number.isNaN(t)||!t?[e]:(o=void 0===i||i>1?Vb.lineWrap(e,t,n,i):[e],o=Vb.wordWrap(o,t,n,i,r),o)},getFontHeight:e=>(jb(),e&&(Fb.font=e),1.5*Vb.measureTextWidth("m")),tokenize(e,t,n,i,r,o,a=1){jb(),t&&(Fb.font=t);const s=Vb.getFontHeight(),l=a*s;let c=[],u=[];if(void 0!==o&&o<s)return[];const h=o?Math.max(1,Math.floor(o/l)):i||1;return c=[void 0===i||Number.isNaN(i)||i<=0?h:Math.min(h,i)],Array.isArray(e)?e.forEach(((e,n)=>{u.length<h&&(u=u.concat(Vb.wrapText(e,r,t,c[n])))})):u=Vb.wrapText(e,r,t,c[0],n),u}};function Bb({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,barWidth:a}){if(!e||!t||!i)return{};const{position:s,scale:l,value:c,label:u,line:h,formatter:d,cId:f}=n,p=n.radius?n.radius*(Math.min(r,o)/2):r/2,m=(Yx-Ux)*s+Ux-Math.PI/2,g={x:r/2,y:o/2};let y=zb(!0,{},i.style.line,h||{});const x={type:"line",cId:f,...{x1:g.x+Math.cos(m)*p,y1:g.y+Math.sin(m)*p,x2:g.x+Math.cos(m)*(p+a),y2:g.y+Math.sin(m)*(p+a)},data:{angle:m,innerRadius:p},stroke:y.stroke,strokeWidth:y.strokeWidth,strokeDasharray:y.strokeDasharray};let v;if(u){const n=zb(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:y.stroke},u),{fontFamily:s,fontSize:h,fill:x,opacity:b}=n,w=u.showLabel?n.text:"";let M,k="";if("string"==typeof d||"object"==typeof d)M=e.formatter(d);else if(void 0!==l&&"string"!=typeof l&&"function"==typeof l.data){const e=l.data()&&l.data().fields;M=e&&e[0]?e[0].formatter():null}!1!==u.showValue&&(M?k=` (${M("function"==typeof c?c():c)})`:l&&(k=` (${c})`));const S=e=>t.measureText({text:e,fontFamily:s,fontSize:h}),_=S("M").height,q=`normal ${h} ${s}`;let D,A=dv;const C=`${w}${k}`||"",N=Math.min(r,o),E=Math.min(8,N/200),R=Cb(g.x,g.y,p+a+E,m+Math.PI/2),I=S(C).width;D=Math.min(R.x,r-R.x-Xx,hv),A=function(e,t,n){const i=Math.min(Math.floor((e+Xx)/t),Math.floor((n-e)/t));return Math.min(i,dv)}(R.y,_,o);let O=Vb.tokenize(C,q,`... ${k}`,A,D,void 0);const P=function(e){let t="start";const n=e>-Math.PI&&e<0?"baseline":"hanging";return(e+=Math.PI/2)<0&&e>-Math.PI?t="end":e>0&&e<Math.PI&&(t="start"),{textAnchor:t,baseline:n}}(m);R.y-2*_>0&&R.y+2*_<o&&(R.x-I+Xx<0&&"end"===P.textAnchor||R.x+I-Xx>r)&&(O=Vb.tokenize(C,q,`... ${k}`,A,D,void 0)),v={fill:x,opacity:b,fontFamily:s,fontSize:h,linePosition:R,lineHeight:_,align:"left",baseline:P.baseline,textAnchor:P.textAnchor,lines:O,cId:f}}return{lineNode:x,labelNode:v}}const Hb={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t;let{settings:n,chart:i,renderer:r,rect:o}=this;if(!(i&&o&&n&&r))return[];const{width:a,height:s}=o,l=null!==(e=null==n||null===(t=n.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0;let c=(null==n?void 0:n.lines)&&n.lines.radial||[];if(0===c.length)return[];c=c.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==i?void 0:i.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return zb(e,{scale:t,position:n})}return zb(e,{position:e.value})}));const u=[];let h=[];[...c].forEach((e=>{if(e.position>0&&e.position<1){const{lineNode:t,labelNode:o}=Bb({chart:i,renderer:r,refLine:e,settings:n,width:a,height:s,barWidth:l});t&&u.push(t),o&&h.push(o)}}));const d=[];h.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,lineHeight:a,textAnchor:s,linePosition:l,baseline:c,cId:u}=e,h=l,f=o.length-1,p=o.map(((e,o)=>{let l=h.y;return f>0&&("baseline"===c?l-=(f-o)*a:l+=o*a),{type:"text",text:e,cId:u,baseline:c,anchor:s,fill:t,opacity:n,fontFamily:i,fontSize:r,x:h.x,y:l}}));d.push(...p)}));const{MEDIUM:f,SMALLER:p}=Mv,m=a>=f.width&&s>=f.height;return[...a>=p.width&&s>=p.height?u:[],...m?d:[]]}};const $b={require:["chart","symbol"],defaultSettings:{settings:{},style:{}},render(){var e;return function({chart:e,settings:t,symbol:n}){if(!e||!t||!n)return[];const{valueAngle:i}=t,{clientWidth:r,clientHeight:o}=e.element,a=.4*Math.min(r,o),s=[],l=t.fill,c={x:r/2,y:o/2},u=qb({points:[{x:c.x-a/2,y:c.y+a/2},{x:c.x,y:c.y-a},{x:c.x+a/2,y:c.y+a/2}],angle:i,fill:l,origin:c});return s.push(u),s}({chart:this.chart,settings:null===(e=this.settings)||void 0===e?void 0:e.settings,symbol:this.symbol})}},Wb={getGap(e,t){const n=e.position<t.position?e:t,i=e.position<t.position?t:e;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMaxThenMin(e,t,n){const i=e.position+e.radius,r=e.position-Math.max(0,i-n),o=r-e.radius;return r+Math.max(0,t-o)},layoutPositionFromMin(e,t,n,i=0){const r=e.length-1;let o,a,s,l=t;for(let t=0;t<r;t++)o=e[t],a=e[t+1],s=(o.position+a.position)/2-i/2,o.position=Wb.findSegmentPositionMeetMaxThenMin(o,l,s),l=o.position+o.radius+i;a&&(a.position=Wb.findSegmentPositionMeetMaxThenMin(a,l,n))},adjustPositionFromMax(e,t,n,i=0){const r=e.length-1,o=Math.max(0,e[r].position+e[r].radius-n);if(0===o)return;let a,s,l,c,u=0;for(a=r;a>0&&(s=e[a],l=e[a-1],c=Math.max(0,Wb.getGap(l,s)-i),c-=Math.max(0,u+c-o),u+=c,s.move=c,!(u>=o));a--);for(u<o&&l&&(c=Math.max(0,l.position-l.radius-t),c-=Math.max(0,u+c-o),u+=c,l.move=c),u=0,a=0;a<=r;a++)s=e[a],u+=s.move||0,s.move=u,s.position-=u},createLayout(e,t,n,i=0){const r=e.map((e=>e.segment)),o=r.length-1;if(o<0)return[];if(0===o){const e=r[0];e.position=Wb.findSegmentPositionMeetMaxThenMin(e,t,n)}else Wb.layoutPositionFromMin(r,t,n,i),Wb.adjustPositionFromMax(r,t,n,i);return e.filter((e=>{const i=Math.ceil(e.segment.position-e.segment.radius),r=e.segment.position+e.segment.radius;return i>=t&&r<=n}))}};const Ub={require:["chart","renderer"],defaultSettings:{style:{line:{stroke:"#000"}}},render(){var e,t,n,i;let{settings:r,chart:o,renderer:a,rect:s}=this;if(!(o&&s&&r&&a))return[];const{width:l,height:c}=s,u=null!==(e=null==r||null===(t=r.settings)||void 0===t?void 0:t.barWidth)&&void 0!==e?e:0,h=null!==(n=null===(i=r.settings)||void 0===i?void 0:i.isRtl)&&void 0!==n&&n,d=h?-1:1,f=(null==r?void 0:r.lines)&&r.lines.x||[],p=(null==r?void 0:r.lines)&&r.lines.y||[];let m=f.length>0?f:p;if(0===m.length)return[];const g=f.length>0;m=m.map((e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=null==o?void 0:o.scale("string"==typeof e.scale?e.scale:"");const n=t(e.value);return zb(e,{scale:t,position:n})}return zb(e,{position:e.value})}));const y=[];let x=[];if([...m].forEach((e=>{if(Eb(e)&&e.position>0&&e.position<1){const{lineNode:t,labelNode:n}=function({chart:e,renderer:t,refLine:n,settings:i,width:r,height:o,isVerticalRefLine:a,barWidth:s}){if(!e||!t||!i)return{};const{position:l,scale:c,value:u,label:h,line:d,formatter:f,cId:p}=n;let m=zb(!0,{},i.style.line,d||{});const g={type:"line",cId:p,...a?{x1:l*r,x2:l*r,y1:o/2-s/2,y2:o/2+s/2}:{x1:r/2-s/2,x2:r/2+s/2,y1:l*o,y2:l*o},stroke:m.stroke,strokeWidth:m.strokeWidth,strokeDasharray:m.strokeDasharray};let y;if(h){const n=zb(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},i.style.label||{},{fill:m.stroke},h),{fontFamily:d,fontSize:g,fill:x,opacity:v}=n,b=h.showLabel?n.text:"";let w,M="";if("string"==typeof f||"object"==typeof f)w=e.formatter(f);else if(void 0!==c&&"string"!=typeof c&&"function"==typeof c.data){const e=c.data()&&c.data().fields;w=e&&e[0]?e[0].formatter():null}!1!==h.showValue&&(w?M=` (${w("function"==typeof u?u():u)})`:c&&(M=` (${u})`));const k=e=>t.measureText({text:e,fontFamily:d,fontSize:g}),S=k("M").height,_=`normal ${g} ${d}`,q=a?uv.MAX_WIDTH:r/2-s/2-uv.CLEARANCE,D=a?2:1,A=`${b}${M}`||"",C=Vb.tokenize(A,_,`... ${M}`,D,q,void 0),N=(a?r:o)*l,E=Math.min(q,Math.max(...C.map((e=>k(e).width)))),R=C.length*S;y={fill:x,opacity:v,fontFamily:d,fontSize:g,linePosition:N,lineHeight:S,lines:C,cId:p,segment:{position:N,radius:a?E/2:R/2}}}return{lineNode:g,labelNode:y}}({chart:o,renderer:a,refLine:e,settings:r,width:l,height:c,isVerticalRefLine:g,barWidth:u});t&&y.push(t),n&&x.push(n)}})),g)x.sort(((e,t)=>e.segment.position-t.segment.position)),x=Wb.createLayout(x,0,l,uv.GAP);else{const{attrs:e}=o.findShapes("text").filter((e=>e.key===pv.GAUGE_LABEL))[0],{"font-size":t}=e,n=parseFloat(t);let i=x.filter((t=>t.segment.position<e.y)),r=x.filter((t=>t.segment.position>e.y));i.sort(((e,t)=>e.segment.position-t.segment.position)),r.sort(((e,t)=>e.segment.position-t.segment.position)),i=Wb.createLayout(i,0,e.y-n/2),r=Wb.createLayout(r,e.y+n/2,c),x=[...i,...r]}const v=[],b=[];x.forEach((e=>{const{fill:t,opacity:n,fontFamily:i,fontSize:r,lines:o,segment:a,linePosition:s,lineHeight:f,cId:p}=e,{position:m}=a;if(s!==m&&""!==e.lines[0]){let e={x1:l/2+d*(u/2),x2:l/2+d*(u/2+.75*uv.CLEARANCE),y1:s,y2:m};g&&(e={y1:c/2+u/2,y2:c/2+u/2+uv.CLEARANCE,x1:s,x2:m});const n={type:"line",...e,stroke:t,strokeWidth:1,isConnector:!0,cId:p};b.push(n)}const y=o.map(((e,o)=>{let a=g?c/2+u/2+f/2+uv.CLEARANCE:m;return a+=o*f,{type:"text",text:e,cId:p,baseline:"central",anchor:g?"middle":h?"end":"start",fill:t,opacity:n,fontFamily:i,fontSize:r,x:g?m:l/2+d*(u/2+uv.CLEARANCE),y:a}}));v.push(...y)}));const{MEDIUM:w,SMALLER:M}=Mv,k=l>=w.width&&c>=w.height;return[...l>=M.width&&c>=M.height?y:[],...k?v:[],...k?b:[]]}};var Yb={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qFallbackTitle","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qNumFormat","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","measureAxis.min","measureAxis.max","refLine.refLines[].refLineExpr"]};function Gb(e){const{qHyperCube:t,...n}=e,{qDataPages:i,qStackedDataPages:r,qTreeDataPages:o,...a}=t||{},s=zb(!0,{},{...n,qHyperCube:{...a,qDataPages:null,qStackedDataPages:null,qTreeDataPages:null}}),{dataRelatedPropertiesPaths:l}=Yb;return l.forEach((e=>{const t=e.split("[");if(1===t.length)void 0!==ct(s,e)&&ht(s,e,null);else{const e=t[0],n=t[1].split("].")[1];ct(s,e,[]).forEach((e=>{void 0!==ct(e,n)&&ht(e,n,null)}))}})),s}const Xb=({core:t,services:n,settings:i})=>{e.useEffect((()=>{if(!i||!t||!n)return;const{chart:e,cache:r}=t;if(!e)return;const{colorService:o,layoutService:a}=n;e.update({data:[{type:"q",key:"qHyperCube",data:a.getHyperCube()},...o.getData()],settings:i}),r&&function({cache:e,layout:t}){const n=Gb(t);e.set("dataIndependentProperties",JSON.stringify(n))}({cache:r,layout:a.getLayout()})}),[t,i])};function Kb({layout:e,options:t}){return e.snapshotData&&!t.freeResize?{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}:void 0}function Zb({options:e,cache:t,layoutService:n}){const i={isSizeChanging:!1};return{enabled:()=>!1!==e.chartAnimations&&!i.isSizeChanging&&!function({cache:e,layout:t}){const n=Gb(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)}({cache:t,layout:n.getLayout()}),meta:i}}function Jb({layout:e,rect:t}){var n;const{measureAxis:i,qHyperCube:r,autoOrientation:o,gaugetype:a,useSegments:s,segmentInfo:l,refLine:c}=e,u=null===(n=e.qHyperCube)||void 0===n?void 0:n.qMeasureInfo[0].qFallbackTitle,{width:h,height:d}=t;let f=e.orientation;o&&(f=h>=d?"horizontal":"vertical");const p="vertical"===f,m=function({measureAxis:e,qHyperCube:t}){if(!e||!t)return{min:0,max:1};let{min:n,max:i}=e;if(n=Number(n),i=Number(i),n!==i)return{min:Math.min(n,i),max:Math.max(n,i)};const r=t.qDataPages[0].qMatrix[0][0].qNum;let o=Math.abs(r-n)/2;return 0===o&&(o=0!==n?Math.abs(n)/2:Number.MAX_VALUE/2),{min:n-o,max:i+o}}({measureAxis:i,qHyperCube:r}),g=(null==c?void 0:c.refLines)||[];return{measureAxisTitle:u,measureAxisSpacing:null==i?void 0:i.spacing,measureAxisShow:null==i?void 0:i.show,rangeLimits:m,qHyperCube:r,orientation:f,autoOrientation:o,gaugetype:a,isVertical:p,useSegments:s,segmentInfo:l,refLines:g}}function Qb({dockService:e,layoutService:t}){const{width:n,height:i}=e.meta.chart.size,{orientation:r,autoOrientation:o}=t.meta;return o?n<i:"vertical"===r}function ew(e,t,n){if(e>=n)return 1;if(e<=t)return 0;const i=Math.min(1,Math.max(0,(e-t)/(n-t)));return Number.isNaN(i)?0:i}function tw(e){return"none"!==e&&"labels"!==e}function nw(e){return"none"!==e&&"title"!==e}function iw({chart:e,layoutService:t,dockService:n}){function i(){const{width:e,height:i}=n.meta.chart.size,r=Qb({dockService:n,layoutService:t});return Math.min(Wx,r?e/10:i/10)}function r(){const{width:e,height:i}=n.meta.chart.size;return Qb({dockService:n,layoutService:t})?i:e}function o(e){const{min:n,max:i}=t.meta.rangeLimits,o=e?i-(t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum-n):t.meta.qHyperCube.qDataPages[0].qMatrix[0][0].qNum;return r()*ew(o,n,i)}const a={getBottomPadding(e){if(Qb({dockService:n,layoutService:t})){const t=o(!1)+-e.height*Qx.VERTICAL_ALIGNMENT_FACTOR,n=Jx.BOTTOM,i=r()-e.height-Jx.TOP;return t<n?n:t>i?i:t}const{MAX_LINES:a,ESTIMATED_LINE_HEIGHT:s,CLEARANCE:l}=uv,c=function({layoutService:e,dockService:t}){const{width:n,height:i}=t.meta.chart.size,{min:r,max:o}=e.meta.rangeLimits,{MEDIUM:a}=Mv,s=n>=a.width&&i>=a.height,{refLines:l}=e.meta;return l&&l.filter(Eb).length>0&&l.filter((e=>e.refLineExpr.value>=r&&e.refLineExpr.value<=o)).length>0&&s}({layoutService:t,dockService:n})?a*s+l:0;return-i()*ev.VERTICAL_ALIGNMENT_FACTOR-c},getTopPadding:e=>-a.getBottomPadding(e),getLeftPadding(e){const{width:a}=n.meta.chart.size,s=n.config.rtl,l=i(),c=Qb({dockService:n,layoutService:t}),u=Math.min(e.width,a*ov);if(c)return s?a/5-l-u:a/5+l;const h=o(s)-e.width/2,d=Jx.RIGHT,f=r()-e.width-Jx.LEFT;return h<d?d:h>f?f:h},getRightPadding:e=>-a.getLeftPadding(e)},s={getLeftPadding(r){if(!Qb({dockService:n,layoutService:t}))return 0;const o=e.findShapes("container").filter((e=>e.key===pv.BAR_AXIS));if(1!==o.length)return 0;const a=o[0],s=nw(t.meta.measureAxisShow)?Math.max(...a.children.filter((e=>"text"===e.type)).map((e=>e.bounds.width))):0,l=Math.max(...a.children.filter((e=>"line"===e.type)).map((e=>e.bounds.width))),c=i();let u=c/2+s+l+c*cv;const{width:h}=n.meta.chart.size;u>h/2-r.height/4&&(u=h/2-r.height/4);return n.config.rtl?u:-u},getRightPadding:e=>-s.getLeftPadding(e),getTopPadding(){if(Qb({dockService:n,layoutService:t}))return-4;const r=e.findShapes("container").filter((e=>e.key===pv.BAR_AXIS));if(1!==r.length)return 0;const o=r[0],a=nw(t.meta.measureAxisShow)?Math.max(...o.children.filter((e=>"text"===e.type)).map((e=>e.bounds.height))):0,s=Math.max(...o.children.filter((e=>"line"===e.type)).map((e=>e.bounds.height))),l=i();return-(l/2+a+s+l*lv)},getBottomPadding:()=>-s.getTopPadding()};return{getBarWidthInPixels:i,getValueLabelFontSize:function(e,t){const{width:i,height:r}=n.meta.chart.size,o=ew(Math.min(r,i),Zx.MIN,Zx.MAX);return e+Math.round(o*(t-e))},barValueLabel:a,barAxisTitle:s}}const rw=({core:t})=>{const n=e.useStaleLayout(),i=e.useTheme(),o=e.useApp(),a=e.useModel(),s=e.useRect(),l=e.useTranslator(),{qLocaleInfo:c}=e.useAppLayout(),[u,h]=e.useState(null),d=e.useOptions(),f=e.useInteractionState();return e.useEffect((()=>{if(!n||!t)return;const{picassoInstance:e,chart:u,cache:p}=t;if(!u)return;const m=function(e){var t=e.source,n=e.metaAdditionsFn,i=e.experimental,o=void 0===i?{filter:!1}:i,a=M(!0,{},t),s=o.filter?function(e){var t=e.qHyperCube,n=mt(t,pt.DIMENSION),i=n.reduced,r=n.filtered;t[pt.DIMENSION]=i;var o=mt(t,pt.MEASURE),a=o.reduced,s=o.filtered;return t[pt.MEASURE]=a,{dimensions:r,measures:s}}(a):{dimensions:[],measures:[]},l=yt(a),c=function(){var e=function(e){var t=e.layout,n=e.additionsFn,i=void 0===n?function(){return{}}:n,o=e.additionsProps,a=void 0===o?{}:o,s=t.qHyperCube,l=s.qDimensionInfo,c=s.qMeasureInfo,u=s.qMode,h=l.length,d=c.length,f=r({mode:{S:"S"===u,P:"P"===u,K:"K"===u,T:"T"===u},dimensionCount:h,measureCount:d,hasMultipleDimensions:h>1,hasMultipleMeasures:d>1,isOneDimensional:1===h,isTwoDimensional:2===h},a);return r(r({},f),i({layout:t,meta:f}))}({layout:a,additionsFn:n,additionsProps:{size:l.size}});return e.filteredFields=s,e},u={refs:r({},l.refs),meta:c(),getLayout:function(){return a},getLayoutValue:function(e,t){return ct(a,e,t)},setLayoutValue:function(e,t){ht(a,e,t),l=yt(a),u.meta=c()},getHyperCube:function(){return a.qHyperCube},getHyperCubeValue:function(e,t){return ct(a.qHyperCube,e,t)},setHyperCubeValue:function(e,t){ht(a.qHyperCube,e,t),l=yt(a),u.meta=c()},getDataPages:function(){return ct(a,l.refs.dataPages)},setDataPages:function(e){ht(a,l.refs.dataPages,e),u.meta=c()}};return u}({source:n,metaAdditionsFn:()=>Jb({layout:n,rect:s})}),{direction:g="ltr"}=d,y=Kb({layout:m.getLayout(),options:d}),x=lt({chart:u,layoutService:m,config:{rtl:"rtl"===g,logicalSize:y},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),v=Ke({app:o,model:a,translator:l,picasso:e,layoutService:m,config:{key:"color",localeInfo:c,theme:i,auto:()=>({mode:"primary",byMeasureDef:{activeMeasureIndex:0,type:"expression",label:""}})}}),b=function(e){var t=e.theme,n=e.config,i=void 0===n?{}:n,r=i.id,o=i.resolve,a=void 0===o?[]:o,s=i.transform,l=void 0===s?[]:s,c=i.extend,u=void 0===c?[]:c,h={theme:t,matrix:Et(a),styles:void 0};return h.styles=It({theme:t,id:r,transform:l,extend:u,matrix:h.matrix}),{getStyles:function(){return h.styles},getTheme:function(){return h.theme},setTheme:function(e){h.theme=e,h.styles=It({theme:e,id:r,transform:l,extend:u,matrix:h.matrix})}}}({theme:i,config:{id:"gauge"}}),w=iw({chart:u,layoutService:m,dockService:x}),k=function({layoutService:e,themeService:t,colorService:n}){const i=t.getStyles(),r=t=>{var n;const i=null===(n=e.getLayoutValue("components",[]))||void 0===n?void 0:n.find((e=>e.key===t));return i},o=e=>e?n.getPaletteColor(e):void 0;return{query:{axis:{title:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.title)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:i.axis.title.fontFamily,fontSize:i.axis.title.fontSize,color:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.title)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.title.color}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("axis"))||void 0===t||null===(t=t.axis)||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.name)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:i.axis.label.name.fontFamily,fontSize:i.axis.label.name.fontSize,fill:null!==(n=o(null===(a=r("axis"))||void 0===a||null===(a=a.axis)||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.name)||void 0===a?void 0:a.color))&&void 0!==n?n:i.axis.label.name.color}}}},label:{getStyle:()=>{var e,t,n,a;return{fontFamily:null!==(e=null===(t=r("value"))||void 0===t||null===(t=t.label)||void 0===t||null===(t=t.value)||void 0===t?void 0:t.fontFamily)&&void 0!==e?e:i.label.value.fontFamily,fill:null!==(n=o(null===(a=r("value"))||void 0===a||null===(a=a.label)||void 0===a||null===(a=a.value)||void 0===a?void 0:a.color))&&void 0!==n?n:i.label.value.color}}}}}}({layoutService:m,themeService:b,colorService:v}),S=Zb({options:d,cache:p,layoutService:m}),_=function({layout:e,model:t,translator:n,interactionState:i}){return{isClosed:()=>e.disclaimerClosed,close:()=>{t.getProperties().then((e=>{e.disclaimerClosed=!0,t.setProperties(e)}))},translator:n,isEditMode:i.edit}}({layout:n,model:a,translator:l,interactionState:f});h({layoutService:m,colorService:v,dockService:x,labelService:w,themeService:b,styleService:k,animationsService:S,disclaimerService:_})}),[a,o,n,i.name(),l.language(),t,d.direction,f.edit]),u};function ow({width:e,height:t,fontSize:n}){const{FULL:i}=Mv;if(e>=i.width&&t>=i.height){let e=Number.parseFloat(n);return e=Math.floor(e*nv),`${e}px`}return n}var aw=e=>()=>e;function sw(e){return 1==(e=+e)?lw:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):aw(isNaN(t)?n:t)}}function lw(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):aw(isNaN(e)?t:e)}var cw=function e(t){var n=sw(t);function i(e,t){var i=n((e=Gv(e)).r,(t=Gv(t)).r),r=n(e.g,t.g),o=n(e.b,t.b),a=lw(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=r(t),e.b=o(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function uw({thisColor:e,paletteColors:t,paletteIndex:n,limit:i,isLeft:r=!1,themeService:o}){const a=r?0:1,s=0===Object.entries(i).length,l=i.gradient;let c=n+(r?-1:1);s&&(c=r?0:t.length-1);const u=o.getTheme().getColorPickerColor(c<t.length&&c>=0?t[c]:t[0]);return{color:l?cw(e,u)(.5):e,offset:a,gradient:l}}function hw({limits:e,paletteColors:t,paletteIndex:n,themeService:i}){const r=ct(e,""+(n-1),{}),o=ct(e,`${n}`,{}),a=[r,o].map((e=>e.gradient)).includes(!0),s=i.getTheme().getColorPickerColor(t[n]);if(!a)return[{offset:0,color:s},{offset:1,color:s}];const l=[uw({thisColor:s,paletteColors:t,paletteIndex:n,limit:r,isLeft:!0,themeService:i}),uw({thisColor:s,paletteColors:t,paletteIndex:n,limit:o,isLeft:!1,themeService:i})],c=2===l.filter((e=>e.gradient)).length;c&&l.splice(1,0,{offset:.5,color:s,gradient:!0});const u=l.map((({offset:e,color:t,gradient:n})=>({offset:e,color:t,gradient:n})));return u}function dw({themeService:e,segmentInfo:t,rangeLimits:n}){const{limits:i,paletteColors:r}=t,{min:o,max:a}=n;i.sort(((e,t)=>e.value-t.value));const s=[o,...i.map((e=>e.value)),a],l=[];for(let t=0;t<r.length;t++){const n=hw({limits:i,paletteColors:r,paletteIndex:t,themeService:e}).map((e=>({offset:ew(s[t]+e.offset*(s[t+1]-s[t]),o,a),color:e.color,gradient:"gradient"in e?e.gradient:void 0})));l.push(...n)}return l}function fw(e){return e.map((e=>({...e,offset:1-e.offset}))).reverse()}function pw({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:r}){return{type:"gradient",x1:0,x2:t?0:1,y1:t?1:0,y2:0,stops:r&&!t?fw(dw({themeService:e,segmentInfo:n,rangeLimits:i})):dw({themeService:e,segmentInfo:n,rangeLimits:i})}}function mw({services:e}){const{dockService:t,disclaimerService:n}=e,{translator:i,isClosed:r,isEditMode:o}=n;if(r()||!o)return!1;const a=t.config.rtl;return{key:"disclaimer-component",type:"disclaimer-component",layout:{displayOrder:5,minimumLayoutMode:wv},settings:{isRtl:a,close:e.disclaimerService.close,title:i.get("Object.Gauge.RangeIsDefaultTitle"),text:i.get("Object.Gauge.RangeIsDefault")}}}function gw({services:e}){const{dockService:t,layoutService:n,themeService:i,animationsService:r}=e,{qHyperCube:o,useSegments:a,segmentInfo:s,rangeLimits:l}=n.meta,c=Qb({dockService:t,layoutService:n}),u=c?"vertical":"horizontal";if(!a)return!1;const{min:h,max:d}=l,f=o.qDataPages[0].qMatrix[0][0].qNum,p=Math.max(h,Math.min(d,f)),m={type:"box",key:pv.MARK,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:p,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:u,box:{width:.1,maxWidthPx:Wx,minHeightPx:tv,fill:()=>function({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,value:r}){const o=pw({themeService:e,isVertical:t,segmentInfo:n,rangeLimits:i,isRtl:!1});let{min:a,max:s}=i;const l=ew(r,a,s),{stops:c}=o;let u="black";for(let e=0;e<c.length;e++){const t=c[e].offset,n=c[e+1].offset;if(l>=t&&l<=n){const i=ew(l,t,n);u=Sb(cw(c[e].color,c[e+1].color)(i));break}}return u}({value:f,themeService:i,isVertical:c,segmentInfo:s,rangeLimits:l}),stroke:"transparent"}},animations:{enabled:r.enabled,trackBy:e=>`${e.data.measureIndex.value}`}};return m}function yw({services:e}){const{dockService:t,themeService:n,styleService:i,layoutService:r,animationsService:o}=e;if(!nw(r.meta.measureAxisShow))return[];const{width:a,height:s}=t.meta.chart.size,l=Ab(a,s,Ux,Yx),{innerRadius:c,outerRadius:u,radiusIncrease:h}=l,d=4*h,f=Math.min(a,s)/2,p=n.getStyles(),m=i.query.axis.label.getStyle(),{tickLength:g,labelPadding:y}=function({width:e,height:t,defaultTickSize:n,defaultLabelPadding:i}){const r=Math.min(Math.min(e,t)/kv,1);return{tickLength:n*r,labelPadding:i*r}}({width:a,height:s,defaultTickSize:8,defaultLabelPadding:20}),x=Rb(a,s),v={key:pv.RADIAL_AXIS,type:"axis",rendererSettings:{disableScreenReader:!0},dock:"center",layout:{minimumLayoutMode:bv},scale:"m",settings:{arc:{radius:u,startAngle:Ux,endAngle:Yx,offset:-10*d*(u-c)*f},align:"top",line:{show:!1,stroke:"#cdcdcd"},ticks:{tickSize:g,stroke:p.axis.line.major.color,margin:x},labels:{margin:-6-2*g+y,fontFamily:m.fontFamily,fill:m.fill,fontSize:m.fontSize}},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,text:n,x:i,y:r,x1:o,y1:a,value:s}=e;return"text"===t?`text-${n}-${i}-${r}`:`tick-${s}-${o}-${a}`}}};return[v]}function xw(e,t,n,i){const r=i?fw(dw({themeService:t,segmentInfo:n,rangeLimits:e})):dw({themeService:t,segmentInfo:n,rangeLimits:e}),o=(Yx-Ux)/(2*Math.PI),a=r.map((e=>({offset:e.offset*o,color:e.color})));return{type:"gradient",orientation:"conic",startAngle:Ux-Math.PI/2,x:0,y:0,stops:a}}function vw({services:e}){const{dockService:t,themeService:n,layoutService:i,colorService:r,animationsService:o}=e,{rangeLimits:a,useSegments:s,segmentInfo:l,qHyperCube:c}=i.meta,{width:u,height:h}=t.meta.chart.size,d=t.config.rtl,{outerRadius:f,innerRadius:p,labelGaugeRadius:m}=Ab(u,h,Ux,Yx),g=a.max,y=c.qDataPages[0].qMatrix[0][0].qNum,x=g-y,v=[{value:Math.max(mv,y-a.min),valueLabel:"Measure"},{value:Math.max(mv,x),valueLabel:"Remaining"}];let b=function({themeService:e,segmentInfo:t,rangeLimits:n}){const i=dw({themeService:e,segmentInfo:t,rangeLimits:n});let r=0,o=0,a=i.map((e=>(o=0===n.max?e.offset*(n.max-n.min)-r:e.offset*n.max-r,r+=o,{value:o,color:e.color,gradient:e.gradient}))).filter((e=>0!==e.value));return a.forEach((e=>{e.value=Math.abs(e.value)})),a}({themeService:n,segmentInfo:l,rangeLimits:a});d&&(v.reverse(),b.reverse());const w={type:"pie",key:pv.RADIAL_GAUGE,data:{items:v},settings:{startAngle:Ux,endAngle:Yx,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>p,fill:(e,t)=>{const n=r.getColor();return d?1===t?n(e):Gx:0===t?n(e):Gx},strokeWidth:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel}},M={type:"pie",key:pv.SEGMENT_RADIAL_GAUGE,renderer:"canvas",displayOrder:1,data:{items:b},settings:{startAngle:Ux,endAngle:Yx,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>p,strokeWidth:0,fill:(e,t)=>{var i,r;return(d?e.datum.value.gradient||(null===(i=b[t+1])||void 0===i?void 0:i.gradient):e.datum.value.gradient||(null===(r=b[t-1])||void 0===r?void 0:r.gradient))?xw(a,n,l,d):e.datum.value.color}}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.color}},k={type:"pie",key:pv.CIRCLE_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(y,mv),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>f,innerRadius:()=>p,fill:()=>function(e,t,n,i){let r=xw(e,t,n,i);const o={offset:(Yx-Ux)/(2*Math.PI),color:"rgba(0, 0, 0, 0)"};return r.stops.push(o),r.stops.push({offset:1,color:"rgba(0, 0, 0, 0)"}),r}(a,n,l,d),opacity:s?1:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}},S={type:"pie",key:pv.LABEL_RADIAL_GAUGE,renderer:"canvas",displayOrder:0,data:{items:[{value:Math.max(y,mv),valueLabel:"Measure"}]},settings:{startAngle:0,endAngle:2*Math.PI,slice:{arc:{ref:"value"},outerRadius:()=>m+1,innerRadius:()=>m,opacity:0}},animations:{enabled:o.enabled,trackBy:e=>e.data.value.valueLabel,isMainComponent:!0}};return s?[k,S,M]:[S,w]}function bw({services:e}){const{dockService:t,layoutService:n,animationsService:i}=e,{width:r,height:o}=t.meta.chart.size,a=t.config.rtl,{rangeLimits:s,qHyperCube:l}=n.meta,{min:c,max:u}=s;let h,d=l.qDataPages[0].qMatrix[0][0].qNum;(d>u||d<c)&&(h="#00000000"),a&&(d=u-(d-c));const f=Ux+ew(d,c,u)*(Yx-Ux);return{type:"radial-gauge-needle",key:pv.RADIAL_GAUGE_NEEDLE,layout:{displayOrder:2},settings:{component:pv.SEGMENT_RADIAL_GAUGE,fill:h,valueAngle:f},animations:{enabled:i.enabled,trackBy:e=>e.type,adjustTweenedNodes(e){e.forEach((e=>{const{data:t}=e;if(t){const{pointerWidth:n,angle:i,radius:a,fill:s}=t,l=Cb(r/2,o/2,a,i+Math.PI/2),{x:c,y:u}=l,h=[{x:c+.3*n,y:u},{x:c-7.5*n,y:u+n},{x:c-7.5*n,y:u-n}],{d:d}=qb({points:h,angle:i,fill:s,origin:l});e.d=d}}))}}}}function ww({core:e,services:t}){const{chart:n}=e;if(!n)return[];const{width:i,height:r}=t.dockService.meta.chart.size,{useSegments:o}=t.layoutService.meta;let a=[mw({services:t})];return"bar"===t.layoutService.meta.gaugetype?a.push(...function({services:e}){const{dockService:t,layoutService:n,styleService:i,themeService:r,animationsService:o}=e;if("none"===n.meta.measureAxisShow)return[];const{width:a,height:s}=t.meta.chart.size,l=t.config.rtl,c=Qb({dockService:t,layoutService:n}),u=r.getStyles(),h=i.query.axis.label.getStyle(),{fontFamily:d,fill:f,fontSize:p}=h,m=nw(n.meta.measureAxisShow);return[{type:"axis",rendererSettings:{disableScreenReader:!0},key:pv.BAR_AXIS,dock:"center",scale:"m",layout:{minimumLayoutMode:gv},settings:{align:c?l?"right":"left":"top",line:{show:!c},labels:{show:m,minLengthPx:20,fontFamily:d,fill:f,fontSize:ow({width:a,height:s,fontSize:p})},paddingStart:()=>{if(c){const e=Math.min(a/10,Wx);return a/2+e/2}const e=Math.min(s/10,Wx);return s/2+e/2+sv},ticks:{stroke:u.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:e=>void 0===e.tickValue?"axis":"text"===e.type?`label: ${e.tickValue}`:`mark: ${e.tickValue}`}}]}({services:t}),...function({services:e}){const{colorService:t,themeService:n,dockService:i,layoutService:r,animationsService:o}=e,{rangeLimits:a,segmentInfo:s,useSegments:l}=r.meta,c=i.config.rtl,u=Qb({dockService:i,layoutService:r}),h=u?"vertical":"horizontal",{min:d,max:f}=a,p=c&&!u?f:d,m={type:"box",key:pv.BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:d,end:{field:"qMeasureInfo/0"},measureIndex:0}}},settings:{minor:{scale:"m"},orientation:h,box:{width:.1,maxWidthPx:Wx,fill:t.getColor()}},animations:{enabled:o.enabled,isMainComponent:!0,trackBy:e=>`${e.data.measureIndex.value}`}},g={type:"box",key:pv.SEGMENT_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:d,end:f,measureIndex:0}}},settings:{minor:{scale:"m"},orientation:h,box:{width:.1,maxWidthPx:Wx,fill:()=>pw({themeService:n,isVertical:u,segmentInfo:s,rangeLimits:a,isRtl:c}),stroke:"transparent"}},animations:{enabled:o.enabled,trackBy:e=>`${e.data.measureIndex.value}`}},y={type:"box",key:pv.BACKGROUND_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:d,end:f}}},settings:{minor:{scale:"m"},orientation:h,box:{width:.1,maxWidthPx:Wx,fill:Gx}}},x={type:"box",key:pv.LABEL_BAR,data:{extract:{field:"qMeasureInfo/0",props:{start:p,end:p}}},settings:{minor:{scale:"m"},orientation:h,box:{width:u?ov:av,opacity:0}}};return l?[x,g]:[x,y,m]}({services:t}),...function({services:e}){const{dockService:t,labelService:n,styleService:i,layoutService:r}=e;if(!tw(r.meta.measureAxisShow))return[];const{width:o,height:a}=t.meta.chart.size,s=Qb({dockService:t,layoutService:r}),{measureAxisTitle:l,useSegments:c}=r.meta,{getTopPadding:u,getBottomPadding:h,getLeftPadding:d,getRightPadding:f}=n.barAxisTitle,p=i.query.axis.title.getStyle(),{fontFamily:m,fontSize:g,color:y}=p;return[{type:"labels",key:pv.AXIS_TITLE,layout:{minimumLayoutMode:yv},settings:{sources:[{component:c?pv.SEGMENT_BAR:pv.BACKGROUND_BAR,selector:"rect",strategy:{type:"bar",settings:{direction:s?"up":"right",align:.5,justify:.5,labels:[{fontFamily:m,fill:y,fontSize:Number.parseFloat(ow({width:o,height:a,fontSize:g})),label:()=>l,placements:[{position:"inside",padding:{top:u,bottom:h,left:d,right:f},overflow:!0}]}]}}}]}}]}({services:t}),function({chart:e,services:t}){if(!e.formatter)return!1;const{labelService:n,styleService:i,dockService:r,layoutService:o,animationsService:a}=t,s=Qb({dockService:r,layoutService:o}),{getValueLabelFontSize:l,barValueLabel:c}=n,{getTopPadding:u,getBottomPadding:h,getLeftPadding:d,getRightPadding:f}=c,p=l(Kx.MIN,Kx.MAX),m=i.query.label.getStyle(),g={type:"labels",key:pv.GAUGE_LABEL,layout:{minimumLayoutMode:s?xv:vv},settings:{sources:[{component:pv.LABEL_BAR,selector:"rect",formatter:"measure",strategy:{type:"bar",settings:{direction:s?"up":"right",orientation:"horizontal",fontFamily:m.fontFamily,fill:m.fill,fontSize:p,align:s?0:.5,justify:0,labels:[{label:({data:t})=>t?e.formatter(fv.MEASURE)(t.value):"",linkData:({data:e})=>e?{value:e.value,formatter:fv.MEASURE}:null,placements:[{position:"outside",padding:{top:u,bottom:h,left:d,right:f},overflow:!0}]}]}}}]},animations:{enabled:a.enabled,trackBy:e=>e.type,adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;"text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value))}))}}};return g}({chart:n,services:t}),function({services:e}){const{layoutService:t,dockService:n,labelService:i,animationsService:r}=e,{qHyperCube:o,rangeLimits:a,useSegments:s}=t.meta,l=n.config.rtl,c=Qb({dockService:n,layoutService:t}),{min:u,max:h}=a,d=o.qDataPages[0].qMatrix[0][0].qNum;let f=i.getBarWidthInPixels();d<=h&&d>=u&&(f=0);let p=c?"bottom":l?"right":"left";return d>h&&(p=c?"top":l?"left":"right"),{type:"oob-indicator",key:pv.OOB_INDICATOR,layout:{displayOrder:2},settings:{component:s?pv.SEGMENT_BAR:pv.BAR,isRtl:l,selector:"rect",pointingTo:p,size:f},animations:{enabled:r.enabled,trackBy:e=>e.type}}}({services:t}),function({services:e}){const{dockService:t,layoutService:n,labelService:i,themeService:r,colorService:o,animationsService:a}=e,{refLines:s}=n.meta,l=t.config.rtl,c=Qb({dockService:t,layoutService:n}),u=r.getStyles(),h={type:"custom-ref-line",key:pv.REFERENCE_LINES_AND_LABELS,settings:{barWidth:i.getBarWidthInPixels(),isRtl:l},lines:{[c?"y":"x"]:s.filter(Eb).map((e=>{var t,n;return{scale:"m",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...u.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},line:{stroke:o.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:a.enabled,trackBy:e=>{const{type:t,cId:n,text:i,isConnector:r}=e;return"text"===t?`${n}-text-${i}`:"line"===t?r?`${n}-connector`:`${n}-line`:Math.random()}}};return h}({services:t}),gw({services:t})):i>=Mv.SPARK.width&&r>=Mv.SPARK.height?a.push(...vw({services:t}),...function({chart:e,services:t}){const{layoutService:n,styleService:i,labelService:r,animationsService:o,dockService:a}=t,{width:s,height:l}=a.meta.chart.size,c=tw(n.meta.measureAxisShow),{qHyperCube:u}=n.meta,h=u.qMeasureInfo[0].qFallbackTitle,d=u.qDataPages[0].qMatrix[0][0].qNum,f=i.query.label.getStyle(),p=i.query.axis.title.getStyle(),{getValueLabelFontSize:m}=r,g=m(Kx.MIN,Kx.MAX),y={type:"labels",key:pv.RADIAL_GAUGE_LABEL,layout:{displayOrder:4},settings:{sources:[{component:pv.LABEL_RADIAL_GAUGE,selector:"path",strategy:{type:"rows",settings:{fill:"#000",padding:0,labels:[{fontSize:g,fontFamily:f.fontFamily,fill:f.fill,label({data:t}){const n=e.formatter(fv.MEASURE);return t&&n?n(d):""},linkData:({data:e})=>e?{value:e.value.value,formatter:fv.MEASURE}:null},{fontSize:Number.parseFloat(ow({width:s,height:l,fontSize:p.fontSize})),fontFamily:p.fontFamily,fill:p.color,label:()=>c?h:""}]}}}]},animations:{enabled:o.enabled,trackBy:e=>"text"+(e.data?"value-label":"axis-title"),adjustTweenedNodes(t){t.forEach((t=>{const{type:n,data:i}=t;if("text"===n&&i&&i.value&&i.formatter&&(t.text=e.formatter(i.formatter)(i.value),t.ellipsed)){const{text:e,fontSize:n,fontFamily:i,maxWidth:r}=t,o=`normal ${n} ${i}`,a="…",s=1;t.ellipsed=Vb.tokenize(e,o,a,s,r)[0]}}))}}};return[y]}({chart:n,services:t}),...yw({services:t}),...o?[bw({services:t})]:[],...function({services:e}){const{dockService:t,layoutService:n,colorService:i,animationsService:r}=e,{width:o,height:a}=t.meta.chart.size,s=t.config.rtl,{rangeLimits:l,useSegments:c,qHyperCube:u}=n.meta,{min:h,max:d}=l,f=u.qDataPages[0].qMatrix[0][0].qNum,{outerRadius:p,innerRadius:m}=Ab(o,a,Ux,Yx),g=(m+(p-m)/2)*Math.min(o,a)/2,{RADIAL_OOB_INDICATOR_MIN:y,RADIAL_OOB_INDICATOR_MAX:x,SEGMENT_RADIAL_GAUGE:v,RADIAL_GAUGE:b}=pv;return[y,x].map(((e,t)=>{const n=c?v:b,l=function(e,t){const n=e.getColor()({datum:{value:()=>0}});return t?"#595959":n}(i,c);let u=0;(0===t&&f<h||1===t&&f>d)&&(u=Nb({innerRadius:m,outerRadius:p,width:o,height:a}));let y=Ux;return(0===t&&s||1===t&&!s)&&(y=Yx),{type:"radial-oob-indicator",key:e,layout:{displayOrder:2},settings:{component:n,selector:"path",angle:y,radius:g,size:u,fill:l},animations:{enabled:r.enabled,trackBy:e=>e.type}}}))}({services:t}),function({services:e}){const{dockService:t,themeService:n,colorService:i,layoutService:r,animationsService:o}=e,{width:a,height:s}=t.meta.chart.size,{refLines:l}=r.meta,c=n.getStyles(),u=Ab(a,s,Ux,Yx),{innerRadius:h,outerRadius:d}=u,f=Nb({innerRadius:h,outerRadius:d,width:a,height:s}),p={type:"radial-custom-ref-line",key:pv.RADIAL_REFERENCE_LINES,displayOrder:1,settings:{barWidth:f},lines:{radial:l.filter(Eb).map((e=>{var t,n;return{scale:"r",value:e.refLineExpr.value,cId:e.cId,label:{text:e.label,...c.referenceLine.label.name,showValue:e.showValue,showLabel:e.showLabel},radius:u.innerRadius,line:{stroke:i.getPaletteColor(e.paletteColor||{index:e.color}),strokeWidth:(null===(t=e.style)||void 0===t?void 0:t.lineThickness)||2,strokeDasharray:null===(n=e.style)||void 0===n?void 0:n.lineType}}}))},animations:{enabled:o.enabled,trackBy:e=>{const{type:t,cId:n}=e;return"line"===t?`${n}-line`:Math.random()},adjustTweenedNodes(e){e.forEach((e=>{const{type:t,data:n}=e;if("line"===t){const{angle:t,innerRadius:i}=n;e.x1=a/2+Math.cos(t)*i,e.y1=s/2+Math.sin(t)*i,e.x2=a/2+Math.cos(t)*(i+f),e.y2=s/2+Math.sin(t)*(i+f)}}))}}};return p}({services:t})):a.push(function({services:e}){var t;const{dockService:n,layoutService:i,colorService:r,animationsService:o}=e,{width:a,height:s}=n.meta.chart.size,{rangeLimits:l,useSegments:c,segmentInfo:u,qHyperCube:h}=i.meta,{min:d,max:f}=l,p=h.qDataPages[0].qMatrix[0][0].qNum,m=Ab(a,s,Ux,Yx).outerRadius;let g;g=p<d?Ux:p>f?Yx:Ux+(p-d)/(f-d)*(Yx-Ux);const y=r.getColor()({datum:{value:()=>0}}),x=(null===(t=u.paletteColors[0])||void 0===t?void 0:t.color)||y;return{type:"radial-spark",key:pv.RADIAL_SPARK,layout:{displayOrder:2},settings:{fill:c?x:y,radius:m,valueAngle:g},animations:{enabled:o.enabled,trackBy:e=>e.type}}}({services:t})),a}const Mw=Math.log(10),kw={log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/Mw,getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Mw),i=e/10**n;return t=i<=1?1:i<=2?2:i<=5?5:10,t*10**n*(e<0?-1:1)},getSmallNiceNumber(e){let t;if(0===e)return 0;let n=Math.floor(Math.log(Math.abs(e))/Mw);const i=e/10**n;return i<1?(t=5,n--):t=i<2?1:i<5?2:5,t*10**n*(e<0?-1:1)},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/Mw),i=e/10**n;return t=Math.ceil(i),7!==t&&9!==t||t++,i>1&&i<=1.5?t=1.5:i>2&&i<=2.5&&(t=2.5),t*10**n*(e<0?-1:1)},calculateTicks(e,t,n,i,r,o){return this.plotSize=e,this.explicitPlotMin=t,this.explicitPlotMax=n,this.minTickSpacingInPixel=i,this.absMax=Math.abs(this.explicitPlotMax),this.absMin=Math.abs(this.explicitPlotMin),this.usedDataRange=this.explicitPlotMax-this.explicitPlotMin,this.maxNumIntervals=this.plotSize/this.minTickSpacingInPixel,this.maxNumTicks=this.maxNumIntervals+1,this.minTickDataSpacing=o||0,this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),this.fontHeight=r,this.tickBaseValue=0,this.spaceUseLimit=.6,0===e?(this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickDataSpacingNN=this.tickDataSpacing,Rw.call(this),Ow.call(this)):(this.maxNumIntervals<1?Dw.call(this):(this.explicitPlotMax>0&&this.explicitPlotMin<0?1===this.maxNumIntervals?qw.call(this,!0):this.maxNumIntervals>=5?_w.call(this):this.maxNumIntervals<2?Aw.call(this):Cw.call(this):_w.call(this),this.tickMaxIndex<this.tickMinIndex?(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),Dw.call(this)):Nw.call(this)),Rw.call(this),Ow.call(this))}};function Sw(e,t,n){void 0===e&&(e=null!==this.explicitPlotMin),void 0===t&&(t=null!==this.explicitPlotMax),this.tickDataSpacingNN=n?kw.getGoodNumber(this.tickDataSpacing):kw.getNiceNumber(this.tickDataSpacing),Iw.apply(this,[e,t])}function _w(){Sw.call(this);const e=this.tickMaxIndex-this.tickMinIndex;let t=this.plotMax-this.plotMin;this.spaceUseFactor=t/this.plotRange;let n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(n&&this.maxNumIntervals>=5){for(;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Sw.call(this),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;if(!n)return}for(this.tickDataSpacing=Math.max(this.usedDataRange/this.maxNumIntervals,this.minTickDataSpacing),(n||e<=2&&this.maxNumIntervals>=2*e)&&Sw.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;this.tickDataSpacing<=this.absMax&&n;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Sw.apply(this,[void 0,void 0,!0]),t=this.plotMax-this.plotMin,this.spaceUseFactor=t/this.plotRange,n=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel}function qw(e){e?(this.tickDataSpacingNN=kw.getGoodNumber(this.absMax),this.tickBaseValue=-this.tickDataSpacingNN,this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.tickMinIndex=1,this.tickMaxIndex=1,this.tickDataSpacingNN*=2):(this.plotMax=this.explicitPlotMax,this.plotMin=this.explicitPlotMin,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,this.tickDataSpacingNN=kw.getNiceNumber(this.absMax),this.tickDataSpacingNN===this.absMax&&(this.tickDataSpacingNN=kw.getNiceNumber(1.1*this.absMax)))}function Dw(){let e;this.tickDataSpacingNN=kw.getNiceNumber(this.tickDataSpacing),this.plotMin=this.explicitPlotMin,this.plotMax=this.explicitPlotMax,this.plotRange=this.plotMax-this.plotMin,this.tickMinIndex=0,this.tickMaxIndex=0,(this.explicitPlotMax<0||this.explicitPlotMin>0)&&(e=kw.getSmallNiceNumber(this.plotRange),this.tickBaseValue=Math.ceil(this.plotMin/e)*e)}function Aw(){const e=this.explicitPlotMax>=-this.explicitPlotMin,t=e||null!==this.explicitPlotMin,n=!e||null!==this.explicitPlotMax;Sw.apply(this,[t,n,!0]);const i=(this.absMax+(1-this.spaceUseLimit)*this.absMin)/this.spaceUseLimit*1.0001;for(;this.tickDataSpacing<=i&&this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel;)this.tickDataSpacing=Math.max(1.1*this.tickDataSpacingNN,this.minTickDataSpacing),Sw.apply(this,[t,n,!0]);const r=this.plotMax-this.plotMin;this.spaceUseFactor=r/this.plotRange}function Cw(){_w.call(this);const e=this.plotMax-this.plotMin;this.spaceUseFactor=e/this.plotRange}function Nw(){const e=kw.getNiceNumber(this.tickDataSpacingNN);if(this.tickDataSpacingNN===e||0!==this.tickBaseValue)return;const t=this.tickDataSpacingNN,n=this.tickMinIndex,i=this.tickMaxIndex,r=i-n,o=this.plotMin,a=this.plotMax;this.tickDataSpacingNN=e,Iw.apply(this,[null!==this.explicitPlotMin,null!==this.explicitPlotMax]);const s=this.plotMax-this.plotMin;this.spaceUseFactor=s/this.plotRange;const l=this.plotSize*this.tickDataSpacingNN/this.plotRange<this.minTickSpacingInPixel,c=this.tickMaxIndex-this.tickMinIndex;!l&&(c===r||c>=10||c>=3&&1.5*c>=r)||(this.tickDataSpacingNN=t,this.tickMinIndex=n,this.tickMaxIndex=i,this.plotMin=o,this.plotMax=a,this.plotRange=this.plotMax-this.plotMin)}function Ew(){this.plotMax===this.plotMin||0===this.plotSize?(this.minTickValue=this.plotMin,this.maxTickValue=this.plotMax):(this.minTickValue=this.tickBaseValue+this.tickMinIndex*this.tickDataSpacingNN,this.maxTickValue=this.tickBaseValue+this.tickMaxIndex*this.tickDataSpacingNN)}function Rw(){let e,t;if(this.mainTickValues=[],this.secondaryTickValues=[],Ew.call(this),0===this.plotSize)return;e=this.tickBaseValue;const n=this.tickMaxIndex-this.tickMinIndex;if(!(n<1)){for(t=0;t<=n;t++)this.mainTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN);for(e=this.tickBaseValue+this.tickDataSpacingNN/2,t=0;t<n;t++)this.secondaryTickValues.push(e+(t+this.tickMinIndex)*this.tickDataSpacingNN)}}function Iw(e,t){this.tickMinIndex=e?Math.ceil(this.explicitPlotMin/this.tickDataSpacingNN):Math.floor(this.explicitPlotMin/this.tickDataSpacingNN),this.tickMaxIndex=t?Math.floor(this.explicitPlotMax/this.tickDataSpacingNN):Math.ceil(this.explicitPlotMax/this.tickDataSpacingNN),this.plotMin=e?this.explicitPlotMin:this.tickMinIndex*this.tickDataSpacingNN,this.plotMax=t?this.explicitPlotMax:this.tickMaxIndex*this.tickDataSpacingNN,this.plotRange=this.plotMax-this.plotMin}function Ow(){return{plotMin:this.plotMin,plotMax:this.plotMax,tickSpacing:this.tickDataSpacingNN,tickBaseValue:this.tickBaseValue,tickMinIndex:this.tickMinIndex,tickMaxIndex:this.tickMaxIndex,minTickValue:this.minTickValue,maxTickValue:this.maxTickValue,mainTickValues:this.mainTickValues,secondaryTickValues:this.secondaryTickValues}}function Pw({core:e,dockService:t,rangeLimits:n,measureAxisSpacing:i,isRadial:r,isVertical:o,styleService:a}){const s=n.min,l=n.max,{width:c,height:u}=function(e){return{width:e.meta.chart.size.width,height:e.meta.chart.size.height}}(t);let h,d=96*i;if(r)h=Math.min(u,c);else{h=o?u:c;const{chart:t,picassoInstance:n}=e;if(t&&n){const e=t.formatter(fv.MEASURE),r=n.renderer("svg")(),f=a.query.axis.label.getStyle(),{fontFamily:p,fontSize:m}=f,g=e=>r.measureText({text:e,fontSize:ow({width:c,height:u,fontSize:m}),fontFamily:p}),y=Math.max(96,...[s,l,(l-s)/2].map((t=>g(e(t)).width)));d=o?4*g("M").height:y;d=h/(Math.max(2,h/d/i+1)-1)}}const f=function({plotSize:e,rangeMax:t,rangeMin:n,minTickSpacingInPixel:i}){const r=kw.calculateTicks(e,n,t,i,20,0);r.tickSpacing;let o=r.mainTickValues;0===o.length&&o.push(r.minTickValue);const a=o[0];o[0]=r.plotMin,a-r.plotMin>=r.tickSpacing/2&&o.splice(1,0,a);const s=r.mainTickValues[r.mainTickValues.length-1];return r.plotMax-s<=r.tickSpacing/2?o[r.mainTickValues.length-1]=Math.round(r.plotMax):o.push(Math.round(r.plotMax)),o}({plotSize:h,rangeMin:s,rangeMax:l,minTickSpacingInPixel:d});return{values:f}}function Lw({isRadial:e,dockService:t,isVertical:n}){return e?!t.config.rtl:!!n||t.config.rtl}function Tw({core:e,services:t,logicalSize:n}){if(!t.layoutService.meta.qHyperCube)throw new Error("Layout is missing a hypercube");const i=ww({core:e,services:t}),r=function({core:e,services:t}){const{dockService:n,styleService:i,colorService:r,layoutService:o}=t,{rangeLimits:a,measureAxisSpacing:s,gaugetype:l}=o.meta,c=Qb({dockService:n,layoutService:o}),u="radial"===l,h=Pw({core:e,dockService:n,rangeLimits:a,measureAxisSpacing:s,isRadial:u,isVertical:c,styleService:i});return{m:{data:{field:"qMeasureInfo/0"},type:"linear",invert:Lw({isRadial:u,dockService:n,isVertical:c}),min:a.min,max:a.max,ticks:{values:h.values}},r:{data:{field:"qMeasureInfo/0"},invert:n.config.rtl,min:a.min,max:a.max},...r.getScales()}}({core:e,services:t});return{scales:r,components:i,formatters:{[fv.MEASURE]:{data:{field:"qMeasureInfo/0"}}},strategy:{layoutModes:Mv,logicalSize:n}}}const zw={Object_Gauge_RangeIsDefault:{id:"Object.Gauge.RangeIsDefault",locale:{"de-DE":"Max. und Min. auf Standardwerte festgelegt. Sie können über das Eigenschaften-Fenster unter Darstellung > Präsentation geändert werden.","en-US":"Max. and Min. set to default values. You can change them via the properties window under Display > Presentation.","es-ES":"Máx y mín se han configurado como valores predefinidos. Puede cambiarlos en el panel de propiedades en Aspecto > Presentación.","fr-FR":"Les valeurs max. et min. par défaut sont définies. Vous pouvez les modifier via le panneau des propriétés sous Aspect > Présentation.","it-IT":"Il massimo e il minimo vengono impostati sui valori predefiniti. È possibile modificarli nel pannello delle proprietà in Aspetto > Presentazione.","ja-JP":"最大値と最小値は規定値に設定されています。これは、スタイル > プレゼンテーションからプロパティ パネルで変更できます。","ko-KR":"최대 및 최소 값이 기본값으로 설정됩니다. 모양 > 프레젠테이션 아래 속성 패널에서 이를 변경할 수 있습니다.","nl-NL":"Max. en min. zijn ingesteld op standaardwaarden. U kunt deze wijzigen in het eigenschappenvenster onder Uiterlijk > Presentatie.","pl-PL":"Maks. i Min. są ustawione na wartości domyślne. Można je zmienić w panelu właściwości, w obszarze Wygląd > Prezentacja.","pr-BR":"Máx. e mín. estão definidos com valores padrão. É possível alterá-los no painel de propriedades, em Aparência > Apresentação.","ru-RU":"Максимальные и минимальные значения установлены по умолчанию. Эти значения можно изменить на панели свойств в меню Вид > Представление.","sv-SE":"Max och min är inställda på standardvärden. Du kan ändra dem i egenskapspanelen under Utseende > Presentation.","tr-TR":"Maks. ve min. değerleri varsayılan değerlere ayarlanmıştır. Görünüş > Sunum altındaki özellikler panelinden bu değerleri değiştirebilirsiniz.","zh-CN":"最大值和最小值已设置为默认值。您可以在“外观”>“显示”下的属性面板中进行更改。","zh-TW":"最大值與最小值均設為預設值。您可以在 [外觀] > [呈現方式] 之下的屬性面板中變更這些值。"}},Object_Gauge_RangeIsDefaultTitle:{id:"Object.Gauge.RangeIsDefaultTitle",locale:{"de-DE":"Bereich auf Standardwerte eingestellt","en-US":"Range set to default values","es-ES":"Rango fijado a valores predeterminados","fr-FR":"Plage définie sur les valeurs par défaut","it-IT":"Scala impostata sui valori predefiniti","ja-JP":"範囲は規定値に設定されています","ko-KR":"범위가 기본값으로 설정됩니다.","nl-NL":"Bereik ingesteld op standaardwaarden","pl-PL":"Zakres ustawiony na wartości domyślne","pt-BR":"Intervalo definido com valores padrão","ru-RU":"Значения диапазона установлены по умолчанию","sv-SE":"Intervallet har standardvärden","tr-TR":"Varsayılan değerlere ayarlı aralık","zh-CN":"范围设置为默认值","zh-TW":"範圍會設為預設值"}}};function Fw(e){return{properties:{qHyperCubeDef:{qMeasures:[],qInitialDataFetch:[{qWidth:1,qHeight:1}],qSuppressZero:!1,qSuppressMissing:!0},showTitles:!0,title:"",subtitle:"",footnote:"",measureAxis:{min:0,max:100},orientation:"horizontal",valueMode:"absolute",segmentInfo:{limits:[],colors:[{color:3}]}},data:{targets:[{path:"/qHyperCubeDef",...Ft(e)}]}}}return function(t){return function(e){if(e&&e.get&&e.add){const t="Object.Gauge.RangeIsDefault";if(e.get(t)!==t)return;Object.keys(zw).forEach((t=>{e.add(zw[t])}))}}(t.translator),{qae:Fw(t),ext:Ht(t),component(){const t=(()=>{const t=e.useElement(),n=e.useOptions(),[i,r]=e.useState({});return e.useEffect((()=>{t.style.overflow="hidden";const e=Hx();e.use(Ei),e.component("oob-indicator",Db),e.component("radial-gauge-needle",Ib),e.component("radial-custom-ref-line",Hb),e.component("custom-ref-line",Ub),e.component("radial-oob-indicator",Ob),e.component("radial-spark",$b),e.component("disclaimer-component",$x);const i=e({renderer:{prio:[n.renderer||"svg"]}}),o=i.chart({element:t,data:[],settings:{}});return r({picassoInstance:i,chart:o,cache:dt()}),()=>{o.destroy()}}),[]),i})(),n=rw({core:t}),i=(({core:t,services:n})=>{const[i,r]=e.useState({}),o=e.useOptions(),a=e.useRect(),s=e.useTheme(),l=e.useStaleLayout(),{qLocaleInfo:c}=e.useAppLayout();return e.usePromise((async()=>{if(!n)return Promise.resolve();const{colorService:e}=n;return e.initialize({createConfig:()=>({theme:s,layout:l,localeInfo:c,hc:l.qHyperCube,colorProps:{...l.color,auto:!0,useBaseColors:"off",paletteColor:l.paletteProgressColor}})}).then((()=>{const{layoutService:e}=n,i=Kb({layout:e.getLayout(),options:o}),a=Tw({core:t,services:n,logicalSize:i});r(a)}))}),[n]),e.useEffect((()=>{if(n&&n.dockService&&n.layoutService){const{dockService:e,layoutService:i,animationsService:s}=n;s.meta.isSizeChanging=!0;const l=Kb({layout:i.getLayout(),options:o});e.update(l||a);const c=Tw({core:t,services:n,logicalSize:l});r(c)}}),[a]),i})({core:t,services:n});Xb({core:t,settings:i,services:n}),(({services:t})=>{e.onTakeSnapshot((e=>{if(t){const{dockService:n}=t,{width:i,height:r}=n.meta.chart.size;e.snapshotData=e.snapshotData||{content:{size:{w:i,h:r}}},e.snapshotData.content={size:{w:i,h:r}}}return Promise.resolve(e)}))})({services:n})}}}}));