@nebula.js/sn-bar-chart 2.6.0 → 2.7.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,12 +1,12 @@
1
1
  /*
2
- * @nebula.js/sn-bar-chart v2.6.0
2
+ * @nebula.js/sn-bar-chart v2.7.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
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-bar-chart"]=t(e.stardust)}(this,function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},s=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var t,i=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(t in e);return void 0===t||n.call(e,t)},l=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},c=function(e,t){if("__proto__"===t){if(!n.call(e,t))return;if(o)return o(e,t).value}return e[t]},u=function e(){var t,n,r,i,o,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(s(i)||(o=a(i)))?(o?(o=!1,u=r&&a(r)?r:[]):u=r&&s(r)?r:{},l(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&l(d,{name:n,newValue:i}));return d},d="2.11.5";function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(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 r=n.call(e,t);if("object"!=typeof r)return r;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 p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function g(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 r,i,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=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(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 y(e){return!!e.changedTouches}function v(e){return"number"==typeof e&&!isNaN(e)}function b(e){return"number"!=typeof e||isNaN(e)}function x(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function S(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function w(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 M(e){const t=g(x(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function k(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function C(e){const t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,c=t.y2,u=t.cx,d=t.cy,f=t.r,h=t.vertices;return v(u)&&v(d)&&v(f)?"circle":v(a)&&v(s)&&v(l)&&v(c)?"line":v(n)&&v(r)&&v(i)&&v(o)?"rect":v(n)&&v(r)?"point":Array.isArray(h)?h.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function q(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function E(e){return function(){return e}}const D=Math.abs,T=Math.atan2,O=Math.cos,N=Math.max,A=Math.min,_=Math.sin,I=Math.sqrt,L=1e-12,P=Math.PI,R=P/2,z=2*P;function F(e){return e>=1?R:e<=-1?-R:Math.asin(e)}const j=Math.PI,B=2*j,H=1e-6,V=B-H;function $(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class W{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?$:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return $;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>H)if(Math.abs(u*s-l*c)>H&&i){let f=n-o,h=r-a,p=s*s+l*l,m=f*f+h*h,g=Math.sqrt(p),y=Math.sqrt(d),v=i*Math.tan((j-Math.acos((p+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>H&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*f>c*h)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>H||Math.abs(this._y1-c)>H)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%B+B),d>V?this._append`A${n},${n},0,1,${u},${e-a},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>H&&this._append`A${n},${n},0,${+(d>=j)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function U(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new W(t)}function Y(e){return e.innerRadius}function K(e){return e.outerRadius}function G(e){return e.startAngle}function X(e){return e.endAngle}function J(e){return e&&e.padAngle}function Z(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/I(s*s+l*l),u=c*l,d=-c*s,f=e+u,h=t+d,p=n+u,m=r+d,g=(f+p)/2,y=(h+m)/2,v=p-f,b=m-h,x=v*v+b*b,S=i-o,w=f*m-p*h,M=(b<0?-1:1)*I(N(0,S*S*x-w*w)),k=(w*b-v*M)/x,C=(-w*v-b*M)/x,q=(w*b+v*M)/x,E=(-w*v+b*M)/x,D=k-g,T=C-y,O=q-g,A=E-y;return D*D+T*T>O*O+A*A&&(k=q,C=E),{cx:k,cy:C,x01:-u,y01:-d,x11:k*(i/S-1),y11:C*(i/S-1)}}function Q(){var e=Y,t=K,n=E(0),r=null,i=G,o=X,a=J,s=null,l=U(c);function c(){var c,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),h=i.apply(this,arguments)-R,p=o.apply(this,arguments)-R,m=D(p-h),g=p>h;if(s||(s=c=l()),f<d&&(u=f,f=d,d=u),f>L)if(m>z-L)s.moveTo(f*O(h),f*_(h)),s.arc(0,0,f,h,p,!g),d>L&&(s.moveTo(d*O(p),d*_(p)),s.arc(0,0,d,p,h,g));else{var y,v,b=h,x=p,S=h,w=p,M=m,k=m,C=a.apply(this,arguments)/2,q=C>L&&(r?+r.apply(this,arguments):I(d*d+f*f)),E=A(D(f-d)/2,+n.apply(this,arguments)),N=E,j=E;if(q>L){var B=F(q/d*_(C)),H=F(q/f*_(C));(M-=2*B)>L?(S+=B*=g?1:-1,w-=B):(M=0,S=w=(h+p)/2),(k-=2*H)>L?(b+=H*=g?1:-1,x-=H):(k=0,b=x=(h+p)/2)}var V=f*O(b),$=f*_(b),W=d*O(w),U=d*_(w);if(E>L){var Y,K=f*O(x),G=f*_(x),X=d*O(S),J=d*_(S);if(m<P)if(Y=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,f=d*l-u*c;if(!(f*f<L))return[e+(f=(u*(t-o)-d*(e-i))/f)*l,t+f*c]}(V,$,X,J,K,G,W,U)){var Q=V-Y[0],ee=$-Y[1],te=K-Y[0],ne=G-Y[1],re=1/_(function(e){return e>1?0:e<-1?P:Math.acos(e)}((Q*te+ee*ne)/(I(Q*Q+ee*ee)*I(te*te+ne*ne)))/2),ie=I(Y[0]*Y[0]+Y[1]*Y[1]);N=A(E,(d-ie)/(re-1)),j=A(E,(f-ie)/(re+1))}else N=j=0}k>L?j>L?(y=Z(X,J,V,$,f,j,g),v=Z(K,G,W,U,f,j,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),j<E?s.arc(y.cx,y.cy,j,T(y.y01,y.x01),T(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,j,T(y.y01,y.x01),T(y.y11,y.x11),!g),s.arc(0,0,f,T(y.cy+y.y11,y.cx+y.x11),T(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,j,T(v.y11,v.x11),T(v.y01,v.x01),!g))):(s.moveTo(V,$),s.arc(0,0,f,b,x,!g)):s.moveTo(V,$),d>L&&M>L?N>L?(y=Z(W,U,K,G,d,-N,g),v=Z(V,$,X,J,d,-N,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),N<E?s.arc(y.cx,y.cy,N,T(y.y01,y.x01),T(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,N,T(y.y01,y.x01),T(y.y11,y.x11),!g),s.arc(0,0,d,T(y.cy+y.y11,y.cx+y.x11),T(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,N,T(v.y11,v.x11),T(v.y01,v.x01),!g))):s.arc(0,0,d,w,S,g):s.lineTo(W,U)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-P/2;return[O(r)*n,_(r)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:E(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:E(+e),c):n},c.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:E(+e),c):r},c.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:E(+e),c):i},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:E(+e),c):o},c.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:E(+e),c):a},c.context=function(e){return arguments.length?(s=null==e?null:e,c):s},c}function ee(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function te(e){this._context=e}function ne(e){return new te(e)}function re(e){return e[0]}function ie(e){return e[1]}function oe(e,t,n){var r=null,i=E(!0),o=null,a=ne,s=null,l=U(c);function c(c){var u,d,f,h,p,m=(c=ee(c)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(s=a(p=l())),u=0;u<=m;++u){if(!(u<m&&i(h=c[u],u,c))===g)if(g=!g)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(y[f],v[f]);s.lineEnd(),s.areaEnd()}g&&(y[u]=+e(h,u,c),v[u]=+t(h,u,c),s.point(r?+r(h,u,c):y[u],n?+n(h,u,c):v[u]))}if(p)return s=null,p+""||null}function u(){return function(e,t){var n=E(!0),r=null,i=ne,o=null,a=U(s);function s(s){var l,c,u,d=(s=ee(s)).length,f=!1;for(null==r&&(o=i(u=a())),l=0;l<=d;++l)!(l<d&&n(c=s[l],l,s))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(c,l,s),+t(c,l,s));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?re:E(e),t="function"==typeof t?t:void 0===t?ie:E(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:E(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:E(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),s):i},s.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),s):r},s}().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?re:E(+e),t="function"==typeof t?t:E(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?ie:E(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:E(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:E(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:E(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:E(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:E(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(i="function"==typeof e?e:E(!!e),c):i},c.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),c):a},c.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),c):o},c}function ae(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function se(e){return e}function le(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 ce(e){this._context=e}function ue(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 de(e,t){this._context=e,this._k=(1-t)/6}te.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)}}},ce.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:le(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:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},de.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:ue(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:ue(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 fe=function e(t){function n(e){return new de(e,t)}return n.tension=function(t){return e(+t)},n}(0);function he(e,t){this._context=e,this._alpha=t}he.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,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,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 r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>L){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);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>L){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(r,i,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 pe=function e(t){function n(e){return t?new he(e,t):new de(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function me(e){return e<0?-1:1}function ge(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(me(o)+me(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function ye(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function ve(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function be(e){this._context=e}function xe(e){this._context=new Se(e)}function Se(e){this._context=e}function we(e){this._context=e}function Me(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function ke(e,t){this._context=e,this._t=t}function Ce(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function qe(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Ee(e,t){return e[t]}function De(e){const t=[];return t.key=e,t}function Te(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function Oe(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function Ne(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},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 i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.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!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map(e=>i[e])},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function Ae(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function _e(e){return(e=Ae(Math.abs(e)))?e[1]:NaN}be.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:ve(this,this._t0,ye(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,ve(this,ye(this,n=ge(this,e,t)),n);break;default:ve(this,this._t0,n=ge(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(xe.prototype=Object.create(be.prototype)).point=function(e,t){be.prototype.point.call(this,t,e)},Se.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,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},we.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 r=Me(e),i=Me(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[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)}},ke.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 Ie,Le=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Pe(e){if(!(t=Le.exec(e)))throw new Error("invalid format: "+e);var t;return new Re({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 Re(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 ze(e,t){var n=Ae(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Pe.prototype=Re.prototype,Re.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 Fe={"%":(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)=>ze(100*e,t),r:ze,s:function(e,t){var n=Ae(e,t);if(!n)return Ie=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(Ie=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Ae(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function je(e){return e}var Be,He,Ve,$e=Array.prototype.map,We=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ue(e){var t=void 0===e.grouping||void 0===e.thousands?je:function(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}($e.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?je:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}($e.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=void 0===e.minus?"−":e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function c(e,c){var u=(e=Pe(e)).fill,d=e.align,f=e.sign,h=e.symbol,p=e.zero,m=e.width,g=e.comma,y=e.precision,v=e.trim,b=e.type;"n"===b?(g=!0,b="g"):Fe[b]||(void 0===y&&(y=12),v=!0,b="g"),(p||"0"===u&&"="===d)&&(p=!0,u="0",d="=");var x=(c&&void 0!==c.prefix?c.prefix:"")+("$"===h?n:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),S=("$"===h?r:/[%p]/.test(b)?a:"")+(c&&void 0!==c.suffix?c.suffix:""),w=Fe[b],M=/[defgprs%]/.test(b);function k(e){var n,r,a,c=x,h=S;if("c"===b)h=w(e)+h,e="";else{var k=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:w(Math.abs(e),y),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),k&&0===+e&&"+"!==f&&(k=!1),c=(k?"("===f?f:s:"-"===f||"("===f?"":f)+c,h=("s"!==b||isNaN(e)||void 0===Ie?"":We[8+Ie/3])+h+(k&&"("===f?")":""),M)for(n=-1,r=e.length;++n<r;)if(48>(a=e.charCodeAt(n))||a>57){h=(46===a?i+e.slice(n+1):e.slice(n))+h,e=e.slice(0,n);break}}g&&!p&&(e=t(e,1/0));var C=c.length+e.length+h.length,q=C<m?new Array(m-C+1).join(u):"";switch(g&&p&&(e=t(q+e,q.length?m-h.length:1/0),q=""),d){case"<":e=c+e+h+q;break;case"=":e=c+q+e+h;break;case"^":e=q.slice(0,C=q.length>>1)+c+e+h+q.slice(C);break;default:e=q+c+e+h}return o(e)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),k.toString=function(){return e+""},k}return{format:c,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(_e(t)/3))),r=Math.pow(10,-n),i=c(((e=Pe(e)).type="f",e),{suffix:We[8+n/3]});return function(e){return i(r*e)}}}}!function(e){Be=Ue(e),He=Be.format,Ve=Be.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const Ye=new Date,Ke=new Date;function Ge(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>Ge(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Ye.setTime(+t),Ke.setTime(+r),e(Ye),e(Ke),Math.floor(n(Ye,Ke))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const Xe=6e4,Je=864e5,Ze=6048e5,Qe=Ge(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xe)/Je,e=>e.getDate()-1);Qe.range;const et=Ge(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Je,e=>e.getUTCDate()-1);et.range;const tt=Ge(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Je,e=>Math.floor(e/Je));function nt(e){return Ge(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())*Xe)/Ze)}tt.range;const rt=nt(0),it=nt(1),ot=nt(2),at=nt(3),st=nt(4),lt=nt(5),ct=nt(6);function ut(e){return Ge(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)/Ze)}rt.range,it.range,ot.range,at.range,st.range,lt.range,ct.range;const dt=ut(0),ft=ut(1),ht=ut(2),pt=ut(3),mt=ut(4),gt=ut(5),yt=ut(6);dt.range,ft.range,ht.range,pt.range,mt.range,gt.range,yt.range;const vt=Ge(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());vt.every=e=>isFinite(e=Math.floor(e))&&e>0?Ge(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,vt.range;const bt=Ge(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 xt(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function St(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function wt(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=xt,n=(t,n)=>xt(e(t),n),r=(t,n)=>e(t)-n):(t=e===xt||e===St?e:Mt,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function Mt(){return 0}bt.every=e=>isFinite(e=Math.floor(e))&&e>0?Ge(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,bt.range;const kt=wt(xt).right;wt(function(e){return null===e?NaN:+e}).center;var Ct=kt;class qt extends Map{constructor(e,t=Dt){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(Et(this,e))}has(e){return super.has(Et(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function Et({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Dt(e){return null!==e&&"object"==typeof e?e.valueOf():e}const Tt=Math.sqrt(50),Ot=Math.sqrt(10),Nt=Math.sqrt(2);function At(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Tt?10:o>=Ot?5:o>=Nt?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/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,i)*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?At(e,t,2*n):[s,l,c]}function _t(e,t,n){return At(e=+e,t=+t,n=+n)[2]}function It(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 Lt(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 Pt(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Rt(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=$t(i),u=Wt(i),d=$t(o),f=Wt(o),h=$t(a),p=Wt(a),m=$t(s),g=Wt(s),y=$t(l),v=Wt(l),b={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:hn,e:hn,f:vn,g:Tn,G:Nn,H:pn,I:mn,j:gn,L:yn,m:bn,M:xn,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:er,s:tr,S:Sn,u:wn,U:Mn,V:Cn,w:qn,W:En,x:null,X:null,y:Dn,Y:On,Z:An,"%":Qn},x={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:_n,e:_n,f:zn,g:Gn,G:Jn,H:In,I:Ln,j:Pn,L:Rn,m:Fn,M:jn,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:er,s:tr,S:Bn,u:Hn,U:Vn,V:Wn,w:Un,W:Yn,x:null,X:null,y:Kn,Y:Xn,Z:Zn,"%":Qn},S={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return k(e,t,n,r)},d:nn,e:nn,f:cn,g:Zt,G:Jt,H:on,I:on,j:rn,L:ln,m:tn,M:an,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:en,Q:dn,s:fn,S:sn,u:Yt,U:Kt,V:Gt,w:Ut,W:Xt,x:function(e,t,r){return k(e,n,t,r)},X:function(e,t,n){return k(e,r,t,n)},y:Zt,Y:Jt,Z:Qt,"%":un};function w(e,t){return function(n){var r,i,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!=(i=zt[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function M(e,t){return function(n){var r,i,o=Pt(1900,void 0,1);if(k(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?(i=(r=Lt(Pt(o.y,0,1))).getUTCDay(),r=i>4||0===i?ft.ceil(r):ft(r),r=et.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=It(Pt(o.y,0,1))).getDay(),r=i>4||0===i?it.ceil(r):it(r),r=Qe.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.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),i="Z"in o?Lt(Pt(o.y,0,1)).getUTCDay():It(Pt(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Lt(o)):It(o)}}function k(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=S[i in zt?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=w(n,b),b.X=w(r,b),b.c=w(t,b),x.x=w(n,x),x.X=w(r,x),x.c=w(t,x),{format:function(e){var t=w(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=M(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=w(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=M(e+="",!0);return t.toString=function(){return e},t}}}var zt={"-":"",_:" ",0:"0"},Ft=/^\s*\d+/,jt=/^%/,Bt=/[\\^$*+?|[\]().{}]/g;function Ht(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Vt(e){return e.replace(Bt,"\\$&")}function $t(e){return new RegExp("^(?:"+e.map(Vt).join("|")+")","i")}function Wt(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Ut(e,t,n){var r=Ft.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Yt(e,t,n){var r=Ft.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Kt(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Gt(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Xt(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Jt(e,t,n){var r=Ft.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Zt(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Qt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function en(e,t,n){var r=Ft.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function tn(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function nn(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function rn(e,t,n){var r=Ft.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function on(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function an(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function sn(e,t,n){var r=Ft.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ln(e,t,n){var r=Ft.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function cn(e,t,n){var r=Ft.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function un(e,t,n){var r=jt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dn(e,t,n){var r=Ft.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function fn(e,t,n){var r=Ft.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function hn(e,t){return Ht(e.getDate(),t,2)}function pn(e,t){return Ht(e.getHours(),t,2)}function mn(e,t){return Ht(e.getHours()%12||12,t,2)}function gn(e,t){return Ht(1+Qe.count(vt(e),e),t,3)}function yn(e,t){return Ht(e.getMilliseconds(),t,3)}function vn(e,t){return yn(e,t)+"000"}function bn(e,t){return Ht(e.getMonth()+1,t,2)}function xn(e,t){return Ht(e.getMinutes(),t,2)}function Sn(e,t){return Ht(e.getSeconds(),t,2)}function wn(e){var t=e.getDay();return 0===t?7:t}function Mn(e,t){return Ht(rt.count(vt(e)-1,e),t,2)}function kn(e){var t=e.getDay();return t>=4||0===t?st(e):st.ceil(e)}function Cn(e,t){return e=kn(e),Ht(st.count(vt(e),e)+(4===vt(e).getDay()),t,2)}function qn(e){return e.getDay()}function En(e,t){return Ht(it.count(vt(e)-1,e),t,2)}function Dn(e,t){return Ht(e.getFullYear()%100,t,2)}function Tn(e,t){return Ht((e=kn(e)).getFullYear()%100,t,2)}function On(e,t){return Ht(e.getFullYear()%1e4,t,4)}function Nn(e,t){var n=e.getDay();return Ht((e=n>=4||0===n?st(e):st.ceil(e)).getFullYear()%1e4,t,4)}function An(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ht(t/60|0,"0",2)+Ht(t%60,"0",2)}function _n(e,t){return Ht(e.getUTCDate(),t,2)}function In(e,t){return Ht(e.getUTCHours(),t,2)}function Ln(e,t){return Ht(e.getUTCHours()%12||12,t,2)}function Pn(e,t){return Ht(1+et.count(bt(e),e),t,3)}function Rn(e,t){return Ht(e.getUTCMilliseconds(),t,3)}function zn(e,t){return Rn(e,t)+"000"}function Fn(e,t){return Ht(e.getUTCMonth()+1,t,2)}function jn(e,t){return Ht(e.getUTCMinutes(),t,2)}function Bn(e,t){return Ht(e.getUTCSeconds(),t,2)}function Hn(e){var t=e.getUTCDay();return 0===t?7:t}function Vn(e,t){return Ht(dt.count(bt(e)-1,e),t,2)}function $n(e){var t=e.getUTCDay();return t>=4||0===t?mt(e):mt.ceil(e)}function Wn(e,t){return e=$n(e),Ht(mt.count(bt(e),e)+(4===bt(e).getUTCDay()),t,2)}function Un(e){return e.getUTCDay()}function Yn(e,t){return Ht(ft.count(bt(e)-1,e),t,2)}function Kn(e,t){return Ht(e.getUTCFullYear()%100,t,2)}function Gn(e,t){return Ht((e=$n(e)).getUTCFullYear()%100,t,2)}function Xn(e,t){return Ht(e.getUTCFullYear()%1e4,t,4)}function Jn(e,t){var n=e.getUTCDay();return Ht((e=n>=4||0===n?mt(e):mt.ceil(e)).getUTCFullYear()%1e4,t,4)}function Zn(){return"+0000"}function Qn(){return"%"}function er(e){return+e}function tr(e){return Math.floor(+e/1e3)}const nr=Ne();nr("d3-number",function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=Ue(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o}),nr("d3-time",function(e){let t=Rt({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 r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=Rt(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r});const rr={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 nr(t.type||"d3-number")(t.format||"")})(e)};function ir(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?rr.id:n,i=t.key,o=void 0===i?rr.key:i,a=t.min,s=void 0===a?rr.min:a,l=t.max,c=void 0===l?rr.max:l,u=t.type,d=void 0===u?rr.type:u,f=t.tags,h=void 0===f?rr.tags:f,p=t.title,m=void 0===p?rr.title:p,g=t.values,y=void 0===g?rr.values:g,v=t.value,b=void 0===v?rr.value:v,x=t.label,S=void 0===x?rr.label:x,w=t.formatter,M=void 0===w?rr.formatter:w;return{id:()=>r(e),key:()=>o(e),raw:()=>e,tags:()=>h(e),type:()=>d(e),min:()=>s(e),max:()=>c(e),title:()=>m(e),items:()=>y(e),formatter:()=>M(e),value:b,label:S}}const or=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),ar=e=>e.reduce((e,t)=>e+t,0),sr={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=or(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=or(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=or(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=or(e),n=t.length;return n?ar(t)/n:NaN}};function lr(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(a=>{const s=n[a],l=i[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=>lr(e,t,{main:n},r).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=sr[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?sr[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=sr[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?sr[l.field.reduceLabel]:l.field.reduceLabel))}),i}function cr(e,t){const n=lr(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:lr(e,t,e.props||{},n),main:n}}function ur(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function dr(e,t){let n=t.main,r=t.propsArr,i=t.props,o=[];const a=n.field.formatter(),s={};return r.forEach(e=>{s[e]=i[e].field?i[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=ur(e.items,n,a);return r.forEach(n=>{t[n]=ur(e.items,i[n],s[n],n)}),t})),o}function fr(e){let t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker;const a="function"===e.trackType?t.trackBy(n):n[t.trackBy];let s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function hr(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function pr(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const mr={diverging:function(e,t){const n=e.length;if(n<=0)return;const r=e[t[0]].length;for(let i=0;i<r;++i){let r=0,o=0;for(let a=0;a<n;++a){const n=e[t[a]][i],s=n[1]-n[0];s>=0?(n[0]=r,r+=s,n[1]=r):s<0?(n[1]=o,o+=s,n[0]=o):n[0]=r}}},none:Ce,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}Ce(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}Ce(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,f=(d-(u[a-1][1]||0))/2,h=0;h<s;++h){var p=e[t[h]];f+=(p[a][1]||0)-(p[a-1][1]||0)}l+=d,c+=f*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,Ce(e,t)}}},gr={ascending:function(e){var t=e.map(Oe);return qe(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,r=e.length,i=e.map(Oe),o=function(e){var t=e.map(Te);return qe(e).sort(function(e,n){return t[e]-t[n]})}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:qe,reverse:function(e){return qe(e).reverse()}};function yr(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",f=t.valueRef||"";let h=0,p={};for(let e=0;e<i.length;e++){let t=i[e],n=f?t[f]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);p[e]||(p[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),h=Math.max(h,o[r].items.length)}const m=Array.apply(null,{length:h}).map(Number.call,Number),g=Object.keys(o).map(e=>o[e].items),y=function(){var e=E([]),t=qe,n=Ce,r=Ee;function i(i){var o,a,s=Array.from(e.apply(this,arguments),De),l=s.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,i)]).data=e;for(o=0,a=ee(t(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:E(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:E(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?qe:"function"==typeof e?e:E(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?Ce:e,i):n},i}().keys(m).value((e,t)=>e[t]?s(e[t]):0).order(gr[d]).offset(mr[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(p).map(e=>{let t=n(p[e].key);return t?t.field(p[e].field):null}).filter(e=>!!e);const S=ir({title:x.map(e=>e.title()).join(", "),min:pr(b),max:hr(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(S)}function vr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(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=m({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.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 r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach(e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.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&&i){const t=i.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 r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.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&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach(r=>{const i=n.items.filter(e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r});yr(n,e.stack,t.dataset,i)}):yr(n,e.stack,t.dataset,n.items))}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 br(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vr;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function xr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const Sr=Symbol("implicit");function wr(){var e=new qt,t=[],n=[],r=Sr;function i(i){let o=e.get(i);if(void 0===o){if(r!==Sr)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new qt;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return wr(t,n).unknown(r)},xr.apply(i,arguments),i}function Mr(){var e,t,n=wr().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,f=d?a:o,h=d?o:a;e=(h-f)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),f+=(h-f-e*(n-l))*u,t=e*(1-l),s&&(f=Math.round(f),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map(function(t){return f+e*t});return i(d?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return Mr(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},xr.apply(d(),arguments)}function kr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Cr(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function qr(){}var Er=.7,Dr=1/Er,Tr="\\s*([+-]?\\d+)\\s*",Or="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Nr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ar=/^#([0-9a-f]{3,8})$/,_r=new RegExp(`^rgb\\(${Tr},${Tr},${Tr}\\)$`),Ir=new RegExp(`^rgb\\(${Nr},${Nr},${Nr}\\)$`),Lr=new RegExp(`^rgba\\(${Tr},${Tr},${Tr},${Or}\\)$`),Pr=new RegExp(`^rgba\\(${Nr},${Nr},${Nr},${Or}\\)$`),Rr=new RegExp(`^hsl\\(${Or},${Nr},${Nr}\\)$`),zr=new RegExp(`^hsla\\(${Or},${Nr},${Nr},${Or}\\)$`),Fr={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 jr(){return this.rgb().formatHex()}function Br(){return this.rgb().formatRgb()}function Hr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ar.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Vr(t):3===n?new Ur(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?$r(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?$r(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=_r.exec(e))?new Ur(t[1],t[2],t[3],1):(t=Ir.exec(e))?new Ur(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Lr.exec(e))?$r(t[1],t[2],t[3],t[4]):(t=Pr.exec(e))?$r(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Rr.exec(e))?Zr(t[1],t[2]/100,t[3]/100,1):(t=zr.exec(e))?Zr(t[1],t[2]/100,t[3]/100,t[4]):Fr.hasOwnProperty(e)?Vr(Fr[e]):"transparent"===e?new Ur(NaN,NaN,NaN,0):null}function Vr(e){return new Ur(e>>16&255,e>>8&255,255&e,1)}function $r(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ur(e,t,n,r)}function Wr(e,t,n,r){return 1===arguments.length?function(e){return e instanceof qr||(e=Hr(e)),e?new Ur((e=e.rgb()).r,e.g,e.b,e.opacity):new Ur}(e):new Ur(e,t,n,null==r?1:r)}function Ur(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Yr(){return`#${Jr(this.r)}${Jr(this.g)}${Jr(this.b)}`}function Kr(){const e=Gr(this.opacity);return`${1===e?"rgb(":"rgba("}${Xr(this.r)}, ${Xr(this.g)}, ${Xr(this.b)}${1===e?")":`, ${e})`}`}function Gr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Jr(e){return((e=Xr(e))<16?"0":"")+e.toString(16)}function Zr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ei(e,t,n,r)}function Qr(e){if(e instanceof ei)return new ei(e.h,e.s,e.l,e.opacity);if(e instanceof qr||(e=Hr(e)),!e)return new ei;if(e instanceof ei)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new ei(a,s,l,e.opacity)}function ei(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function ti(e){return(e=(e||0)%360)<0?e+360:e}function ni(e){return Math.max(0,Math.min(1,e||0))}function ri(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}kr(qr,Hr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jr,formatHex:jr,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Qr(this).formatHsl()},formatRgb:Br,toString:Br}),kr(Ur,Wr,Cr(qr,{brighter(e){return e=null==e?Dr:Math.pow(Dr,e),new Ur(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Er:Math.pow(Er,e),new Ur(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ur(Xr(this.r),Xr(this.g),Xr(this.b),Gr(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:Yr,formatHex:Yr,formatHex8:function(){return`#${Jr(this.r)}${Jr(this.g)}${Jr(this.b)}${Jr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Kr,toString:Kr})),kr(ei,function(e,t,n,r){return 1===arguments.length?Qr(e):new ei(e,t,n,null==r?1:r)},Cr(qr,{brighter(e){return e=null==e?Dr:Math.pow(Dr,e),new ei(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Er:Math.pow(Er,e),new ei(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,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ur(ri(e>=240?e-240:e+120,i,r),ri(e,i,r),ri(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ei(ti(this.h),ni(this.s),ni(this.l),Gr(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=Gr(this.opacity);return`${1===e?"hsl(":"hsla("}${ti(this.h)}, ${100*ni(this.s)}%, ${100*ni(this.l)}%${1===e?")":`, ${e})`}`}}));var ii=e=>()=>e;function oi(e){return 1===(e=+e)?ai: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(r){return Math.pow(e+r*t,n)}}(t,n,e):ii(isNaN(t)?n:t)}}function ai(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ii(isNaN(e)?t:e)}var si=function e(t){var n=oi(t);function r(e,t){var r=n((e=Wr(e)).r,(t=Wr(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=ai(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function li(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function ci(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=gi(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function ui(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function di(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function fi(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=gi(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var hi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pi=new RegExp(hi.source,"g");function mi(e,t){var n,r,i,o=hi.lastIndex=pi.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=hi.exec(e))&&(r=pi.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:di(n,r)})),o=pi.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),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,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function gi(e,t){var n,r=typeof t;return null==t||"boolean"===r?ii(t):("number"===r?di:"string"===r?(n=Hr(t))?(t=n,si):mi:t instanceof Hr?si:t instanceof Date?ui:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?li:Array.isArray(t)?ci:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?fi:di)(e,t)}function yi(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function vi(e){return+e}var bi=[0,1];function xi(e){return e}function Si(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function wi(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Si(i,r),o=n(a,o)):(r=Si(r,i),o=n(o,a)),function(e){return o(r(e))}}function Mi(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Si(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Ct(e,t,1,r)-1;return o[n](i[n](t))}}function ki(){var e,t,n,r,i,o,a=bi,s=bi,l=gi,c=xi;function u(){var e=Math.min(a.length,s.length);return c!==xi&&(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])),r=e>2?Mi:wi,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),di)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,vi),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=yi,u()},d.clamp=function(e){return arguments.length?(c=!!e||xi,u()):c!==xi},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function Ci(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?_t(t,e,n):_t(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=Pe(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(_e(t)/3)))-_e(Math.abs(e)))}(o,a))||(r.precision=i),Ve(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,_e(t)-_e(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-_e(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return He(r)}function qi(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 r=t<e,[i,o,a]=r?At(t,e,n):At(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)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]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Ci(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=_t(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function Ei(){var e=ki()(xi,xi);return e.copy=function(){return t=e,Ei().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},xr.apply(e,arguments),qi(e)}function Di(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Ct(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return Di().domain(t).range(n).unknown(e)},xr.apply(i,arguments)}function Ti(e){return void 0===e?e=>e:t=>e(t)}function Oi(e){return Math.max(0,Math.min(1,e))}function Ni(e){return"object"==typeof e}function Ai(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function _i(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...Ai(t,o,a)),o-=a-o,a=e[i],r.push(...Ai(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...Ai(t,o,a))):r.push(...Ai(t,o,a))}return r.filter(e=>e>=n.min()&&e<=n.max())}function Ii(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=b(a)||b(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c));let d=n.ticks(u);d.length<=1&&(d=n.ticks(u+1));const f=i>0?_i(d,i,n):d;f.sort((e,t)=>e-t);const h=f.map(Ti(l));return f.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===d.indexOf(e)}})}function Li(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=b(a)||b(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c)),d=u>10?10:u;n.nice(d);const f=n.ticks(u),h=i>0?_i(f,i,n):f;h.sort((e,t)=>e-t);const p=h.map(Ti(l));return h.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===f.indexOf(e)}})}function Pi(e){let t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?e=>e:o;const s=n.minorTicks&&!b(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?!b(e.value):!b(e));t=function(e){let t=e.values,n=e.scale,r=e.formatter,i=void 0===r?e=>e:r;return t.sort((e,t)=>(Ni(e)?e.value:e)-(Ni(t)?t.value:t)).filter((e,t,r)=>{const i=Ni(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t}).map(e=>{const t=Ni(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)?Oi(n(e.start)):o,end:t&&!isNaN(e.end)?Oi(n(e.end)):o}})}({values:e,scale:r.copy(),formatter:a})}else if(b(n.ticks.count)){t=(n.ticks.tight?Li:Ii)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){const r=e.map(e=>e.position),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[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===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){let t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!==0,value:e}})}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function Ri(){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 r={};return Object.keys(t).forEach(i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]}),r}const zi={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},Fi={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},ji={count:NaN};function Bi(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 Hi(){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 r=Ei(),i={instance:null,invert:!1},o={data:t,resources:n},a=Ri(e,zi,o);let s;function l(e){return b(e)?NaN:r(e)}a.ticks=Ri(e.ticks,Fi,o),a.minorTicks=Ri(e.minorTicks,ji,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.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=u(!0,{},a,e.settings),e.scale=l,s=Pi(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.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()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=Hi(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return Bi(i,l),i.instance(e)},l.normInvert=function(e){return Bi(i,l),i.instance.invert(e)};const c=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map(e=>e.min()).filter(e=>!isNaN(e)),r=t.map(e=>e.max()).filter(e=>!isNaN(e));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter(e=>!isNaN(e));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]),d=c.mini,f=c.maxi;return l.domain([d,f]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const Vi={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function $i(){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]:{}},r=Ri(e,Vi,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[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 t=e.scale;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}})}(t,n.trackBy)}}const c=Mr();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-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(r.invert?[s+u,u]:[u,s+u]),a};const d="function"==typeof e.value?e.value:e=>e.datum.value,f="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=u({datum:i[e]},n),r=d(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(f(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const Wi={depth:0};function Ui(e,t,n){return e.ancestors().map(e=>t(u({datum:e.data},n))).reverse().slice(1).toString()}const Yi=e=>e.min(),Ki=e=>e.max();function Gi(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(Yi).filter(v);i=e.length?Math.min(...e):i}if(!r){const e=t.map(Ki).filter(v);o=e.length?Math.max(...e):o}}return[i,o]}const Xi={domain:[],range:[],invert:!1,min:NaN,max:NaN};function Ji(){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 r=Hi(e,t,n).clamp(!0).interpolate(si),i=Ri(e,Xi,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;u(!0,s,r);const l=g(Gi(i,t?t.fields:[]),2),c=l[0],d=l[1],f=o?i.domain.length:-1,h=n.theme?n.theme.palette("sequential",f>0?f:2):[],p=a?i.range:h;return s.range(i.invert?p.slice().reverse():p.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),c,d)),s}const Zi={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function Qi(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const eo={domain:[],range:[]};const to={domain:[],range:[],unknown:void 0},no={domain:[],range:[],override:!1};const ro=Ne();function io(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach(e=>{r.extract.push({field:e})}));const i=vr(r,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"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}ro("linear",Hi),ro("band",$i),ro("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]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=Ri(t,Vi,i);o.ticks=Ri(t.ticks,Wi,i),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=$i(o);const s=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let d=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=Ui(e,i,n),f=e.leaves()||[e],h=i(u({datum:e.data},n)),p=o(u({datum:e.data},n)),m=Array.isArray(e.children),g={key:t,count:f.length,value:h,label:p,leftEdge:Ui(f[0],i,n),rightEdge:Ui(f[Math.max(f.length-1,0)],i,n),node:e};m?(a.push("SPACER_".concat(d,"_SPACER")),d++):(a.push(t),s.push(p)),(r<=0&&!m||e.depth===r)&&c.push(g),l[t]=g}});const f=e.height-1;return f>0&&a.splice(-f),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),l=s.values,c=s.labels,d=s.items,f=s.ticks,h=function(e){const t=String(e),n=d[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};u(!0,h,a),h.bandwidth=function(e){const t=d[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=h(t.leftEdge),r=h(t.rightEdge);return Math.abs(e-r)+n}return n},h.step=function(e){const t=d[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},h.data=()=>n,h.datum=e=>{const t=d[String(e)];return t?t.node.data:null},h.copy=()=>e(t,n,r),h.labels=()=>c,h.ticks=()=>f.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 p=a.pxScale;return h.pxScale=function(e){return a=p(e),h},h.domain(l),h}),ro("sequential-color",Ji),ro("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 r=Di(),i=Ri(e,Zi,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return b(e)?NaN:r(e)}Object.keys(r).forEach(e=>s[e]=r[e]);const l=g(Gi(i,t.fields),2),c=l[0],u=l[1],d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[];let h=a?i.range:f,p=[];return p=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=Ei().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(h,c,u):[c+(u-c)/2],h.length>p.length+1?p=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(h,c,u):h.length<p.length+1&&(h=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=Ji().domain([n,r]).range(t);return[n,...Qi(e),r].map(e=>i(e))}(p,h,c,u)),s.data=()=>t,s.range(i.invert?h.slice().reverse():h),s.domain(p),s}),ro("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 r=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 r=wr(),i={data:t,resources:n},o=Ri(e,eo,i),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={},d=[],f=[];for(let e=0;e<l.length;e++){const t=u({datum:l[e]},i),n=a(t,e);-1===d.indexOf(n)&&(d.push(n),f.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>f,r.label=e=>f[d.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(d),r}(e,t,n),i=n.theme,o=Ri(e,to,{data:t,resources:n});let a;if(o.explicit=Ri(e.explicit,no,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map((t,r)=>[e.indexOf(t),t,n[r]]).sort((e,t)=>e[0]-t[0]);r.forEach(t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])})}a.length=e.length}return r.range(a),r});var oo={};function ao(){ao.init.call(this)}oo.isObject=function(e){return"object"==typeof e&&null!==e},oo.isNumber=function(e){return"number"==typeof e},oo.isUndefined=function(e){return void 0===e},oo.isFunction=function(e){return"function"==typeof e};var so=ao;ao.EventEmitter=ao,ao.prototype._events=void 0,ao.prototype._maxListeners=void 0,ao.defaultMaxListeners=10,ao.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},ao.prototype.setMaxListeners=function(e){if(!oo.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},ao.prototype.emit=function(e){var t,n,r,i,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],oo.isUndefined(n))return!1;if(oo.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(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(oo.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},ao.prototype.addListener=function(e,t){var n;if(!oo.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,oo.isFunction(t.listener)?t.listener:t),this._events[e]?oo.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,oo.isObject(this._events[e])&&!this._events[e].warned)&&((n=oo.isUndefined(this._maxListeners)?ao.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,oo.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),oo.isFunction(console.trace)&&console.trace()));return this},ao.prototype.on=ao.prototype.addListener,ao.prototype.once=function(e,t){if(!oo.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},ao.prototype.removeListener=function(e,t){var n,r,i,o;if(!oo.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||oo.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(oo.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},ao.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],oo.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},ao.prototype.listeners=function(e){return this._events&&this._events[e]?oo.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},ao.listenerCount=function(e,t){return e._events&&e._events[t]?oo.isFunction(e._events[t])?1:e._events[t].length:0};var lo={mixin:e=>(Object.keys(so.prototype).forEach(t=>{e[t]=so.prototype[t]}),so.init(e),e)};function co(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;var s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const c=Math.max(e,Math.min(t-r,n));n!==c&&(n=c,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return lo.mixin(i),i}function uo(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||co();return o.update({min:n,max:r,viewSize:i}),o}function fo(e,t){return e<=t}function ho(e,t){return e<t}function po(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function mo(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n.includeMax,i=void 0===r||r,o=n.includeMin;e=i?fo:ho,t=void 0===o||o?fo:ho},i.add=e=>{let t=e.min,n=e.max;const i=po(r,t),o=po(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let t=e.min,n=e.max;const i=po(r,t),o=po(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let t=e.min,n=e.max;const i=po(r,t,!0),o=po(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function go(){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 yo={key:void 0,includeMin:!0,includeMax:!0};function vo(e){let t=e.items,n=e.collection,r=e.vc;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function bo(e){let t=e.items,n=e.collection;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;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])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function xo(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function So(e){let t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function wo(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function Mo(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?u({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((e,t)=>t(e),r):r}function ko(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function Co(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function qo(e,t,n){let r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig;const l=Mo(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach(e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}}),c}function Eo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?go:t,r=e.rc,i=void 0===r?mo:r,o=!1,a={},s={},l={},c={sources:{},default:u({},yo)};const d={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},f=()=>{const e={values:{},ranges:{}};return Object.keys(s).forEach(t=>{e.values[t]=s[t].values()}),Object.keys(a).forEach(t=>{e.ranges[t]=a[t].ranges()}),e},h={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=f();this.ls.forEach(t=>t._state(e))},updateValues(){const e=f();this.ls.forEach(t=>t._state({values:e.values}))},updateRanges(){const e=f();this.ls.forEach(t=>t._state({ranges:e.ranges}))}},p={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(c={sources:{},default:u({},yo)},e.ranges.forEach(e=>{const t={};Object.keys(yo).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:yo[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(a).forEach(e=>a[e].configure(c.sources[e]||c.default)),p.emit("update",[],[]))},link:e=>{if(p===e)throw new Error("Can't link to self");h.ls.push(e),e._state(f())},_state:e=>{if(!e)return f();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(s).forEach(n=>{e.values[n]||t.push({key:n,values:[]})}),t.length&&p.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach(n=>{a[n]&&e.ranges[n].join(";")===a[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(a).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&p.setRanges(t)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit("start",...t),h.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];p.emit("end",...t),h.end()}},isActive:()=>o,clear:()=>{const e=p.brushes().filter(e=>"value"===e.type&&e.brush.values().length).map(e=>({id:e.id,values:e.brush.values()})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(p.emit("update",[],e),h.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(a).map(e=>({type:"range",id:e,brush:a[e]}))),e=e.concat(Object.keys(s).map(e=>({type:"value",id:e,brush:s[e]}))),e},addValue:(e,t)=>{p.addValues([{key:e,value:t}])},addValues:e=>{const t=Mo(d.addValues,e,l),r=vo({vc:n,collection:s,items:t});p.emit("add-values",t),r.length&&(o||(o=!0,p.emit("start")),p.emit("update",r,[]),h.updateValues())}};return p.setValues=e=>{const t=Mo(d.setValues,e,l),r=function(e){let t=e.items,n=e.vCollection,r=e.vc;const i={},o=xo(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 d=e=>{n[a]&&n[a].contains(e)||So({key:a,value:e,collection:n,obj:i,fn:r})},f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)a=f[e],o[a].forEach(d);return l=wo(c,i),s=wo(i,c),[s,l]}({items:t,vCollection:s,vc:n});p.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),h.updateValues())},p.removeValue=(e,t)=>{p.removeValues([{key:e,value:t}])},p.removeValues=e=>{const t=Mo(d.removeValues,e,l),n=bo({collection:s,items:t});p.emit("remove-values",t),n.length&&(p.emit("update",[],n),h.updateValues())},p.addAndRemoveValues=(e,t)=>{const r=Mo(d.addValues,e,l),i=Mo(d.removeValues,t,l),a=vo({vc:n,collection:s,items:r}),c=bo({collection:s,items:i});p.emit("add-values",r),p.emit("remove-values",i),(a.length||c.length)&&(o||(o=!0,p.emit("start")),p.emit("update",a,c),h.updateValues())},p.toggleValue=(e,t)=>{p.toggleValues([{key:e,value:t}])},p.toggleValues=e=>{const t=Mo(d.toggleValues,e,l),r=function(e){let t=e.items,n=e.values,r=e.vc;const i={},o={},a=[],s=[],l=xo(t);let c,u,d;const f=Object.keys(l);for(let e=0,t=f.length;e<t;e++){c=f[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[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)):So({key:c,value:u,collection:n,obj:i,fn:r})}const h=Object.keys(i);for(let e=0,t=h.length;e<t;e++)c=h[e],a.push({id:c,values:i[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:t,values:s,vc:n});p.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,p.emit("start")),p.emit("update",r[0],r[1]),h.updateValues())},p.containsValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].contains(t)},p.addRange=(e,t)=>{p.addRanges([{key:e,range:t}])},p.addRanges=e=>{qo(e,"add",{ranges:a,rc:i,interceptors:d,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.removeRange=(e,t)=>{p.removeRanges([{key:e,range:t}])},p.removeRanges=e=>{qo(e,"remove",{ranges:a,rc:i,interceptors:d,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.setRange=(e,t)=>{p.setRanges([{key:e,range:t}])},p.setRanges=e=>{qo(e,"set",{ranges:a,rc:i,interceptors:d,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.toggleRange=(e,t)=>{p.toggleRanges([{key:e,range:t}])},p.toggleRanges=e=>{qo(e,"toggle",{ranges:a,rc:i,interceptors:d,aliases:l,rangeConfig:c})&&(o||(o=!0,p.emit("start")),p.emit("update",[],[]),h.updateRanges())},p.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},p.containsRange=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},p.containsMappedData=(e,t,n)=>{let r=[];const i=Object.keys(e);let o,c,u,d;for(let t=0,n=i.length;t<n;t++){if(o=i[t],"value"===o)c=e,r[t]={key:"",i:t,bool:!1};else{if("source"===o)continue;c=e[o],r[t]={key:o,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 l&&(u=l[u]),d=c.value,a[u]?r[t].bool=Array.isArray(d)?a[u].containsRange({min:d[0],max:d[1]}):a[u].containsValue(d):s[u]&&s[u].contains(d)&&(r[t].bool=!0))}return t?(r=r.filter(e=>-1!==t.indexOf(e.key)),"and"===n?!!r.length&&!r.some(e=>!1===e.bool):"xor"===n?!!r.length&&r.some(e=>e.bool)&&r.some(e=>!1===e.bool):r.some(e=>e.bool)):r.some(e=>e.bool)},p.intercept=(e,t)=>{const n=ko(e);d[n]&&d[n].push(t)},p.removeInterceptor=(e,t)=>{const n=ko(e);if(!d[n])return;const r=d[n].indexOf(t);-1!==r&&d[n].splice(r,1)},p.removeAllInterceptors=e=>{const t=[];if(e){const n=ko(e);d[n]&&d[n].length&&t.push({name:e,handlers:d[n]})}else Object.keys(d).forEach(e=>{d[e].length&&t.push({name:Co(e),handlers:d[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>p.removeInterceptor(e.name,t))})},p.addKeyAlias=(e,t)=>{l[e]=t},p.removeKeyAlias=e=>{delete l[e]},lo.mixin(p),p}function Do(e){return e*e*e}function To(e){return--e*e*e+1}function Oo(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}Ne();const No=["stroke","fill","color","backgroundColor","thumbColor"];function Ao(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=_o(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function _o(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?di:"string"===r?(i=Hr(t))&&No.includes(n)?(t=i,si):mi:t instanceof Hr?si:t instanceof Date?ui:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?li:Array.isArray(t)?Ao:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Io:di)(e,t)}function Io(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=_o(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function Lo(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const Po={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},Ro=/^\$/;function zo(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function Fo(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function jo(e,t){return e.pxScale?e.pxScale(t):e}const Bo={normalizeSettings:function(e,t,n){const r=u({},e),i=u({},t);return Object.keys(r).forEach(e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(zo(o)){let n=t[e];"string"==typeof n&&Ro.test(n)&&(n=Po[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))}),Object.keys(t).forEach(e=>{if(e in r)return;const n=t[e];"string"===typeof n&&Ro.test(n)?i[e]=Po[n]:i[e]=n}),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,f=u&&o in s,h=d?s[c.ref]:f?s[o]:a;zo(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&h?(r[o]=c.scale(h.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&h?r[o]=h.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:Fo};function Ho(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...Ho(t.children)),e):(e.push(t),e),[])}function Vo(e,t){let n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode;const s=e.chart.brush(n),l=r,c=i.active||{},d=i.inactive||{},f=[];Object.keys(c).forEach(e=>{f.push(e)}),Object.keys(d).forEach(e=>{-1===f.indexOf(e)&&f.push(e)});const h=[];let p=!1;const m=()=>{let t=Ho(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},g=()=>{const e=m(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},f.forEach(t=>{e[r].__style[t]=e[r][t]}));const t=s.containsMappedData(n,i,a),o=h.indexOf(e[r]);let l=!1;t&&-1===o?(h.push(e[r]),l=!0):t||-1===o||(h.splice(o,1),l=!0),e[r].needToUpdate=l||p,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=u({},e[i],e[i].__style),n=e[i].isActive;f.forEach(r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,h):c[r]:!n&&r in d?"function"==typeof d[r]?d[r].call(null,t,h):d[r]:e[i].__style[r]}),r=!0}delete e[i].needToUpdate}return p=!1,r},y=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=m(),r=n.length;for(let e=0;e<r;e++)n[e].data&&(n[e].__style=n[e].__style||{},f.forEach(t=>{n[e].__style[t]=n[e][t],t in d&&(n[e][t]="function"==typeof d[t]?d[t].call(null,n[e]):d[t])}));p=!0,h.length=0,t||e.renderer.render(e.nodes)},v=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=m(),r=n.length;for(let e=0;e<r;e++)n[e].__style&&(Object.keys(n[e].__style).forEach(t=>{n[e][t]=n[e].__style[t]}),n[e].__style=void 0);h.length=0,t||e.renderer.render(e.nodes)},b=()=>{if(g()){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",y),s.on("end",v),s.on("update",b),{isActive:()=>s.isActive(),update:()=>{h.length=0,p=!0,g()},cleanUp:function(){s.removeListener("start",y),s.removeListener("end",v),s.removeListener("update",b)}}}function $o(e){let t=e.nodes,n=e.action,r=e.chart,i=e.trigger;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(!i)return;const o=i.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))}})}i.contexts.forEach(e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)})}({dataPoints:o,action:n,chart:r,trigger:i})}function Wo(e){let t=e.collisions,n=e.t,r=e.config,i=e.action,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 $o({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function Uo(e,t,n){const r=n.element().getBoundingClientRect();let i=y(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,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&y(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!y(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function Yo(e,t,n){return e?"function"==typeof e?e(t):e:n}const Ko={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 Go(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function Xo(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function Jo(e){return-e/180*Math.PI}function Zo(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),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(Jo(e))}function Qo(e,t){return{x:e.x+t.x,y:e.y+t.y}}function ea(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ta(e,t){return{x:e.x*t,y:e.y*t}}function na(e,t){return e.x-t.x}function ra(e,t){return e.y-t.y}function ia(e,t){return na(e,t)**2+ra(e,t)**2}function oa(e,t){return Math.sqrt(ia(e,t))}function aa(e,t){return e.x*t.x+e.y*t.y}function sa(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=ea(e,n);return Qo({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const la={up:0,down:180,left:90,right:-90};function ca(e){let t=e.x,n=e.y,r=e.size;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const ua=Ne();ua.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),ua.add("diamond",function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:Go([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}}),ua.add("saltire",function(e){const t=Jo(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=Xo(e.x,e.y,o,i).map(e=>sa(e,t,s));return{type:"path",fill:"black",d:Go(l)}}),ua.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}}),ua.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},r=la[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=Jo(r);return s=s.map(e=>sa(e,l,n)),{type:"path",fill:"black",d:Go(s)}}),ua.add("line",function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:ca(e)}}),ua.add("star",function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=Jo(i),c=Jo(i+s/2),u=Math.sin(l),d=Math.cos(l),f=Math.sin(c),h=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+h*o,y:e.y+f*o})}return{type:"path",fill:"black",d:Go(n)}}),ua.add("n-polygon",function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=Jo(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:Go(t)}}),ua.add("cross",function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:Go(Xo(t,n,e.size,o))}}),ua.add("bar",function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=Jo(90);o=o.map(n=>sa(n,e,t))}const a=M(o);return a.type="rect",a.fill="black",a}),ua.add("rect",function(e){const t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}),ua.add("image",function(e){const t=e.x,n=e.y,r=e.imageSettings||{},i=r.width,o=r.height,a=r.imageSrc,s=r.position;return{type:"image",x:t,y:n,width:i,height:o,src:a,symbol:r.symbol,r:10,cx:0,cy:0,imageScalingFactor:r.imageScalingFactor,imagePosition:s}});const da=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ua;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!==Ko[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function fa(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,d=e.show,f=void 0===d||d;r=r||"center";return{computePreferredSize(e){let n=e.inner,r=e.outer,i=e.children;return"function"==typeof c?c({inner:n,outer:r,children:i,dock:this.dock()},t):c},dock(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(f=e,this):"function"==typeof f?f(t):f}}}function ha(e,t,n){const r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,c=n.data,u=n.renderer,d=n.chart,f=n.dockConfig,h=n.mediator,p=n.instance,m=n.rect,g=n.style,y=n.registries,v=n.resolver,b=n.update,x=n._DO_NOT_USE_getInfo,S=n.symbol,w=n.isVisible;e.emit=()=>{},w&&(e.isVisible=w),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:h}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:y}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach(n=>{var r;r=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===r)||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])}),i.forEach(t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:u}):"chart"===t?Object.defineProperty(e,"chart",{get:d}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:f}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:v}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:S})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function pa(e,t,n){const r=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,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function ma(e,t,n){Object.keys(n.on||{}).forEach(r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)}),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function ga(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.defaultSettings,r=void 0===n?{}:n,i=e._DO_NOT_USE_getInfo,o=void 0===i?()=>({}):i,a=t.chart,s=t.container,l=t.mediator,c=t.registries,d=t.theme,f=t.renderer,h=lo.mixin({});let p,g,y,v,b,x=t.settings||{},S=u(!0,{},r,x),w=[],M=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Bo,n={};return{resolve:function(r){let i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled;const c=n.norm=t.normalizeSettings(o,s,e.chart),u={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach(e=>{c[e]&&t.updateScaleSize(c,e,l[e])});const d=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:u};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:u};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],d.push(o)}}return{settings:n.norm,items:d}}}}({chart:a}),k=!1;const C={nodes:[],chart:a,config:S.brush||{},renderer:null},q={tap:[],over:[]},E=[],D={},T=u({},x);function O(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==x[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(D,...l):r&&(a=e[t])),o&&("function"==typeof x[t]?a=x[t].call(T,...l):r&&(a=x[t])),i||o||(a=n.call(D,...l)),a}}const N=O("preferredSize",()=>0,!0),A=O("resize",e=>e.inner),_=O("created"),I=O("beforeMount"),L=O("mounted"),P=O("beforeUnmount"),R=O("beforeUpdate"),z=O("updated"),F=O("beforeRender"),j=O("beforeDestroy"),B=O("destroyed"),H=e.render,V=()=>{S.brush&&(S.brush.consume||[]).forEach(e=>{e.context&&e.style&&E.push(Vo(C,e))})},$=()=>{S.brush&&(S.brush.trigger||[]).forEach(e=>{"over"===e.on?q.over.push(e):q.tap.push(e)})};Object.defineProperty(C,"data",{get:()=>w});const W=S.renderer||e.renderer,U=W?f||c.renderer(W)():f||c.renderer()();"function"==typeof U.settings&&U.settings(S.rendererSettings),C.renderer=U;const Y={resources:a.logger?{logger:a.logger()}:{}};let K=fa(pa(S,N,a.logger()),Y);const G=e=>{e.key=S.key,e.element=U.element()},X=()=>{};X.dockConfig=()=>K,X.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(x=e.settings,S=u(!0,{},r,e.settings),K=fa(pa(S,N,a.logger()),Y),C.config=S.brush||{}),S.scale&&(p=a.scale(S.scale)),S.data){const e=S.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=vr(S.data,{dataset:a.dataset,collection:a.dataCollection},{logger:a.logger()},a.dataCollection);t?t.isFirst?(w=n,w.items&&(w.items=[...n.items])):w.items&&(w.items=[...w.items,...n.items||[]]):w=n}else w=p?p.data():[];"string"==typeof S.formatter||"object"==typeof S.formatter?g=a.formatter(S.formatter):p&&p.data().fields&&(g=p.data().fields[0].formatter()),b=d.style(S.style||{})},X.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});v=n?U.size(n):U.size(e),T.rect=u(!0,{computedPhysical:v.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),v=u(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},v)},X.getRect=()=>T.rect;const J=()=>{const e=U.renderArgs?U.renderArgs.slice(0):[],t=S.rendererSettings;let n=w;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return w.items&&r&&(n=m(m({},w),{},{items:w.items.slice(r.start,r.end)})),e.push({data:n}),e};let Z,Q,ee;function te(e){const t=S.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?C.nodes=[...e||[]]:C.nodes&&(C.nodes=[...C.nodes,...e||[]]):C.nodes=e}X.beforeMount=I,X.beforeRender=()=>{F({size:v})},X.render=()=>{const e=H.call(D,...J());te(e),U.render(e),Z=e,Q=T.rect.computed},X.hide=()=>{X.unmount(),U.size({x:0,y:0,width:0,height:0}),U.clear()},X.beforeUpdate=()=>{R({settings:S,data:w})},X.update=()=>{ee&&ee.stop();const e=S,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return U.render(),void(Z=null);const i=H.call(D,...J());te(i),E.forEach(e=>e.cleanUp()),E.length=0,q.tap=[],q.over=[],n&&(V(),$()),E.forEach(e=>{e.isActive()&&e.update()}),Z&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:Z,currentRect:T.rect.computed,previousRect:Q}),ee=function(e,t,n,r){let i,o=e.old,a=e.current,s=t.renderer,l=[],c={nodes:[],ips:[]},d={nodes:[],ips:[]},f={nodes:[],ips:[]},h=[],p=null;const m=n.trackBy||Lo,g={start(){let e={};if(o.forEach((t,n)=>{let r=m(t,n);e[r]=t}),a.forEach((t,n)=>{let r=m(t,n);if(e[r]){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),r=t.points.filter(e=>!e.dummy),i=r.map(e=>e.data.major.value),o=n.filter(e=>i.includes(e.data.major.value)).map(e=>e.data.major.value),a=n.filter(e=>o.includes(e.data.major.value)),s=r.filter(e=>o.includes(e.data.major.value));return{old:a,current:s}}(e[r],t);f.ips.push(Io(u({},e[r],{points:n.old}),u({},t,{points:n.current}))),l.push(u({},e[r],{commonPoints:n.old}))}else f.ips.push(Io(e[r],t)),l.push(e[r]);f.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(Io(u({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(d.nodes.push(e[t]),d.ips.push(Io(e[t],u({},e[t],{r:1e-4,opacity:0}))))}),h.push({name:"exiting",easing:Do,duration:200,tweens:d.ips,nodes:[...l]}),h.push({name:"updating",easing:Oo,duration:400,tweens:f.ips,nodes:[]}),h.push({name:"entering",easing:To,duration:200,tweens:c.ips,nodes:[...f.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,o=r.getValue("animations.updatingStageMeta"),a=o.isInit,s=o.shouldBeRemoved;!1===a?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===i)}h.length&&(p=s.getScene(a),h[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(g.tick)))},tick(){let e=h[0];e||g.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 l=n.adjustTweenedNodes;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){h.shift();const e=r.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;h.length?"updating"===h[0].name&&n&&h.shift():(!0===t&&r.setValue("animations.updatingStageMeta.isInit",!1),g.stop())}i&&(i=window.requestAnimationFrame(g.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return p}};return g}({old:Z,current:i},{renderer:U},r,a.storage),ee.start()):U.render(i),Z=i,Q=T.rect.computed,U.setKey&&"string"==typeof x.key&&U.setKey(x.key)},X.updated=z,X.destroy=()=>{X.unmount(),j(y),U.destroy(),B(),y=null};const ne=e=>{C.nodes=e,E.forEach(e=>{e.isActive()&&e.update()}),U.render(e)};return ha(D,e,{settings:()=>S,data:()=>w,scale:()=>p,formatter:()=>g,renderer:()=>U,chart:()=>a,dockConfig:()=>K,mediator:()=>l,instance:()=>T,rect:()=>T.rect,style:()=>b,update:()=>ne,registries:()=>c,resolver:()=>M,symbol:()=>da(c.symbol)}),ha(T,x,{settings:()=>S,data:()=>w,scale:()=>p,formatter:()=>g,renderer:()=>U,chart:()=>a,dockConfig:()=>K,mediator:()=>l,style:()=>b,_DO_NOT_USE_getInfo:o.bind(D),isVisible:()=>k}),X.getBrushedShapes=function(e,t,n){const r=[];if(S.brush&&S.brush.consume){const i=a.brush(e),o=U.findShapes("*");S.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let a=0;a<o.length;a++){const s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(G(s),r.push(s),o.splice(a,1),a--)}})}return r},X.findShapes=e=>{var t;const n=(null!==(t=ee)&&void 0!==t&&t.inProgress()?ee.targetScene:U).findShapes(e);for(let e=0,t=n.length;e<t;e++)G(n[e]);return n},X.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=U.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map(e=>e.node);for(let e=0,t=r.length;e<t;e++)G(r[e]);return r},X.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];$o({nodes:e,action:t.action||"toggle",trigger:t,chart:a,data:C.data})},X.mount=()=>{y=U.element&&U.element()?y:U.appendTo(s),U.setKey&&"string"==typeof x.key&&U.setKey(x.key),S.brush&&(V(),$()),ma(T,h,x),ma(D,h,e),k=!0},X.mounted=()=>L(y),X.unmount=()=>{[T,D].forEach(e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach(e=>{let n=e.event,r=e.listener;t.removeListener(n,r)}),e.eventListeners.length=0),e.emit=()=>{}}(e,h)}),q.tap=[],q.over=[],E.forEach(e=>{e.cleanUp()}),E.length=0,P(),k=!1},X.onBrushTap=e=>{q.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return Wo({collisions:Uo(t,n,r.renderer),t:n,config:r,action:Yo(n.action,t,"toggle")})})({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},X.onBrushOver=e=>{q.over.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return Wo({collisions:Uo(t,n,r.renderer),t:n,config:r,action:Yo(n.action,t,"set")})})({e:e,t:t,config:C})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},X.def=D,X.ctx=T,X.renderer=()=>U,X.set({settings:x}),_(),X}function ya(e){const t=u(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function va(e,t,n){const r=Qo(function(e,t){const n=aa(e,t)/aa(t,t)||1;return{x:t.x*n,y:t.y*n}}(ea(n,e),ea(t,e)),e);return r}function ba(e,t,n){return oa(e,n)+oa(t,n)-oa(e,t)<1e-12}function xa(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 Sa(e){return e.x1===e.x2&&e.y1===e.y2}function wa(e){return e.width<=0||e.height<=0}function Ma(e){return e.r<=0}function ka(e){return e.edges.length<=2}function Ca(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Aa(e,k(t.edges[r])),!0===n)return!0;return!1}function qa(e,t){let n=!1;const r=t.numPolygons,i=t.polygons;for(let t=0;t<r;t++){if(n=Ba(e,i[t]),!0===n)return!0}return!1}function Ea(e,t){if(Ma(e))return!1;return ia({x:e.cx,y:e.cy},t)<=e.r**2}function Da(e,t){if(wa(t)||Ma(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function Ta(e,t){if(Ma(e)||Sa(t))return!1;const n=g(S(t),2),r=n[0],i=n[1];if(Ea(e,r)||Ea(e,i))return!0;const o={x:e.cx,y:e.cy},a=va(r,i,o);return ia(a,o)<=e.r**2&&ba(r,i,a)}function Oa(e,t){if(ka(t)||Ma(e))return!1;if(Na(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(Ta(e,k(t.edges[r])))return!0}return!1}function Na(e,t){if(ka(e)||!Pa(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Aa(e,t){if(ka(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(za(t,k(e.edges[n])))return!0}const n=g(S(t),2),r=n[0],i=n[1];return Na(e,r)||Na(e,i)}function _a(e,t){if(ka(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(Ra(t,k(e.edges[n])))return!0}const n=g(w(t),4),r=n[0],i=n[1],o=n[2],a=n[3];return Na(e,r)||Na(e,i)||Na(e,o)||Na(e,a)}function Ia(e,t){return!wa(e)&&!wa(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 La(e,t){if(wa(e)||wa(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=>Pa(e,t))}function Pa(e,t){return!wa(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function Ra(e,t){if(Sa(t)||wa(e))return!1;const n=g(S(t),2),r=n[0],i=n[1];if(Pa(e,r)||Pa(e,i))return!0;const o=w(e);let a=o.length;for(let e=0;e<a;e++){if(za(k([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function za(e,t){const n=g(S(e),2),r=n[0],i=n[1],o=g(S(t),2),a=o[0],s=o[1],l=na(i,r),c=ra(i,r),u=na(s,a),d=ra(s,a),f=na(r,a),h=ra(r,a);let p=d*l-u*c;const m=u*h-d*f,y=l*h-c*f;let v,b;if(0===l&&0===c)return!1;if(0===u&&0===d)return!1;if(0===p){if(0===m&&0===y){if(0===l){if(0===c)return r.x===i.x&&r.y===i.y;v=ra(a,r)/c,b=ra(s,r)/c}else v=(a.x-r.x)/l,b=(s.x-r.x)/l;return!(v<0&&b<0||v>1&&b>1)}return!1}const x=m/p;return p=y/p,x>=0&&x<=1&&p>=0&&p<=1}function Fa(e,t){if(Sa(e))return!1;const n=g(S(e),2);return ba(n[0],n[1],t)}function ja(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Ia(n,r)&&(La(n,r)?Ca(e,t):Ca(t,e))}function Ba(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Ia(n,r)&&(La(r,n)?function(e,t){let n=!1;const r=e.numPolygons,i=e.polygons;for(let e=0;e<r;e++)if(n=ja(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=$a(e,k(t.edges[r])),!0===n)return!0;return!1}(e,t))}function Ha(e,t){if(Ma(e))return!1;if(Va(t,{x:e.cx,y:e.cy}))return!0;const n=t.numPolygons,r=t.polygons;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(Ta(e,k(n.edges[t])))return!0}}return!1}function Va(e,t){if(!Pa(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;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===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function $a(e,t){const n=g(S(t),2),r=n[0],i=n[1];if(Va(e,r)||Va(e,i))return!0;const o=e.numPolygons,a=e.polygons;for(let e=0;e<o;e++){const n=a[e];for(let e=0,r=n.edges.length;e<r;e++){if(za(t,k(n.edges[e])))return!0}}return!1}function Wa(e,t){const n=g(w(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(Va(e,r)||Va(e,i)||Va(e,o)||Va(e,a))return!0;const s=e.numPolygons,l=e.polygons;for(let e=0;e<s;e++){const n=l[e];for(let e=0,r=n.edges.length;e<r;e++){if(Ra(t,k(n.edges[e])))return!0}}return!1}const Ua=/^\$/,Ya="@extend";function Ka(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function Ga(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&Ka(e),Ua.test(r)?(n.push(e),Ga(r,t,n)):r}let r=e;const i=u(!0,{},t,e),o={};if(e[Ya]){const o=e[Ya];-1!==n.indexOf(o)&&Ka(o);let a=n.slice();a.push(o),r=u(!0,{},Ga(i[o],t,a),e)}return Object.keys(r).forEach(e=>{let t=n.slice();if(e===Ya||Ua.test(e))return;o[e]=r[e];let a=o[e];Ua.test(a)&&a in i?(-1!==n.indexOf(a)&&Ka(a),t.push(a),a=i[a],"object"==typeof a||Ua.test(a)&&a in i?o[e]=Ga(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=Ga(a,i,t))}),o}function Xa(e,t){return Ga(e,t,[])}function Ja(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=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)}})},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>Xa(e,n),setStyle:t=>{n=u({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function Za(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 Qa(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return u(!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 es(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function ts(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function ns(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 rs(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 is(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function os(e,t,n,r,i){const o=u({},t),a=u({},n);ns(o,r),rs(a,r),is(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(ns(t,r),rs(n,r),!0)}function as(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 ss(e){return M([].concat(...e.map(w)))}function ls(e){let t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation;const a=es(r.x,r.y,r.width,r.height),s=es(r.x,r.y,r.width,r.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=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map(e=>l[e]).filter(e=>!!e);n.length>0&&(t=ss(n.map(e=>e.outerRect)),c=ss(n.map(e=>e.r)))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=as(c),t.edgeBleed=e.edgeBleed,t.computed=as(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 cs(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function us(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 ds(e){let t=Qa(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 r=function(e,t){const n={x:0,y:0,width:0,height:0},r={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?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),Za(r),Za(n),{logicalContainerRect:r,containerRect:n}}(e,t),i=r.logicalContainerRect,o=r.containerRect,a=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];us(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];cs(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,i),s=g(a,2),l=s[0],c=s[1],u=function(e){let t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings;const o=es(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];ts(n,o,t),os(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every(e=>t.some(t=>t.key===e));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter(e=>-1!==s.indexOf(e));return n.length=0,n.push(...l),is(t,o,a),o}({layoutRect:i,visible:l,hidden:c,settings:t}),d=ls({visible:l,layoutRect:i,reducedRect:u,containerRect:o,translation:{x:e.x,y:e.y}});return c.forEach(e=>{e.comp.visible=!1;const t=es();e.comp.resize(t,t)}),{visible:l.map(e=>e.comp),hidden:c.map(e=>e.comp),ordered:d.map(e=>e.comp)}},n.settings=function(e){t=Qa(e)},n}const fs=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},hs=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(m(m({},n),{},{children:hs(e.children)}))}}),ps=(e,t)=>({visible:[],hidden:t,ordered:[]}),ms=e=>(t,n)=>{var r;const i=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(m(m({},t),{},{children:hs(e.children)}))}}),o=e=>n[e.index],a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,c=a.hidden,u=void 0===c?[]:c,d=a.ordered,f=void 0===d?l:d;return{visible:l.map(o),hidden:u.map(o),ordered:f.map(o)}},gs=e=>"function"==typeof e?ms(e):(e=>{const t=ds(e);return ms((e,n)=>t.layout(e,n))})(e);function ys(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=C(e),a=u(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}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+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function vs(e,t){const n=[];let r=0;t.forEach(e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)}),t.forEach((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach(t=>{e.insertBefore(t,r)})):(o&&o.forEach(t=>{e.appendChild(t,r)}),e.appendChild(r))})(e,t,n[r]))}function bs(e,t){let n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s;const c=t.registries,d=t.logger,f=Ja(t.style,t.palettes),h=[],p=u({},e),g=function(){const e={};return lo.mixin(e),e}();let v=[],b=null,x=null,S=null,w=[],M=()=>{},k=()=>{};const C={};let q=!1;const E=function(e){let t=e.createComponent;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map(e=>o(e)).filter(e=>!!e))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find(e=>r.hasKey&&r.key===e.key);i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,r=e.excludeFromUpdate,i=e.formatters,a=e.scales;return e.settingsList.map(e=>{const s=fs(t,e.key);return r.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:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,r=e.layoutFn,i=e.ordered,o=e.rect,a=e.visible;const s=r(o,t),l=s.visible,u=s.hidden,d=s.ordered;a.push(...l),n.push(...u),i.push(...d),l.forEach(e=>{if(e.children){var t,r;const o=gs(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:ps,ordered:i,rect:null,visible:a})})};return n.destroy=()=>{r.forEach(e=>e.instance.destroy()),r=[],i=[]},n.findComponentByKey=e=>fs(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const r=[],o=[],a=[],s=gs(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let t=e.components;i=t.map(e=>o(e)).filter(e=>!!e)},n.update=e=>{let t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,a=e.scales;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return d.warn("Unknown component: ".concat(e.type)),!1;return{instance:ga(c.component(e.type),{settings:e,chart:p,mediator:g,registries:c,theme:f,container:n}),settings:u(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function D(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(p,...a):n.call(p,...a),i}}const T=()=>{let e;a.dockLayout?(d.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return E.layout({layoutSettings:e,rect:t})},O=D("created"),N=D("beforeMount"),A=D("mounted"),_=D("beforeUpdate"),I=D("updated"),L=D("beforeRender"),P=D("beforeDestroy"),R=D("destroyed"),z=function(e,t){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).partialData;const r=t.formatters,i=void 0===r?{}:r,o=t.scales,a=void 0===o?{}:o,s=t.scroll,l=void 0===s?{}:s;M=function(e,t){let n=t.types,r=t.logger;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.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&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}}),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:d,types:c.data}),n||Object.keys(C).forEach(e=>C[e].clear()),t.palettes&&f.setPalettes(t.palettes),t.style&&f.setStyle(t.style),k=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vr;const i={};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");i[e.key]=()=>r(e.data,t,n)}),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=u(r,{fields:e}))}return r}}(t.collections,{dataset:M},{logger:d});const h={theme:f,logger:d};b=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:io;const i={};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?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(a,{dataset:M,collection:k},m(m({},h),{},{scale:c.scale})),x=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:br;const i={};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?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:M,collection:k},m(m({},h),{},{formatter:c.formatter})),S=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=uo(e[r],t?t[r]:null));return n}(l,S)};function F(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter(e=>!!e.key).map(e=>e.key);w.forEach(e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()}),w=e.map(e=>{const r=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(p,g,n);return r.set(e),r})}const j=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return v.forEach(e=>{const t=e.instance.getRect();Pa(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},B=()=>{if(h.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(p);n.addEventListener(e,t),h.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=j(e)},r=t=>{const n=e.comps||j(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=y(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),q){q=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=j(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),q){q=!1;break}}}}),i.forEach(e=>{n.addEventListener(e.key,e.listener),h.push(e)})},H=()=>{h.forEach(e=>{let t=e.key,r=e.listener;return n.removeEventListener(t,r)}),h.length=0},V=()=>{n.innerHTML="",(()=>{const e=a.components,t=void 0===e?[]:e;L(),z(i,a),E.set({components:t});const r=T(),o=r.visible,s=r.hidden,l=r.ordered;v=o,s.forEach(e=>{e.instance.hide(),e.visible=!1}),o.forEach(e=>e.instance.beforeMount()),o.forEach(e=>e.instance.mount()),o.forEach(e=>e.instance.beforeRender()),o.forEach(e=>e.instance.render()),o.forEach(e=>e.instance.mounted()),o.forEach(e=>{e.visible=!0}),vs(n,l)})(),B(),F(a.interactions)};return p.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,F(e.settings.interactions)),_(),z(i,a);const r=a,o=r.formatters,s=r.scales,l=r.components,c=void 0===l?[]:l;E.update({components:c,data:i,excludeFromUpdate:n,formatters:o,scales:s}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),T()},p.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.partialData,r=e.excludeFromUpdate,o=void 0===r?[]:r;let s;e.data&&(i=e.data),e.settings&&(a=e.settings,F(e.settings.interactions)),_(),z(i,a,{partialData:t});const l=a,c=l.formatters,u=l.scales,d=l.components,f=void 0===d?[]:d;E.update({components:f,data:i,excludeFromUpdate:o,formatters:c,scales:u}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const h=[],p=[];let m;if(t)E.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&h.push(e)}),m=h;else{const e=T(),t=e.visible,n=e.hidden,r=e.ordered;v=t,m=t,s=r,t.forEach(e=>{e.updateWith&&e.visible?h.push(e):p.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}p.forEach(e=>e.instance.beforeMount()),p.forEach(e=>e.instance.mount()),m.forEach(e=>e.instance.beforeRender()),m.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()}),t||vs(n,s),p.forEach(e=>e.instance.mounted()),h.forEach(e=>e.instance.updated()),v.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),I()},p.destroy=()=>{P(),E.destroy(),H(),F(),delete p.update,delete p.destroy,R()},p.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return v.filter(e=>null==r||e.key===r).forEach(r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]}),i},p.findShapes=e=>{let t=[];return v.forEach(n=>{const r=n.instance.findShapes(e);t=[...t,...r]}),t},p.componentsFromPoint=e=>j(e).map(e=>e.instance.ctx),p.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=v;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map(e=>e.key);o=v.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=ys(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},p.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 r=t.components[n].key;v.filter(e=>r===e.key).forEach(r=>{let i=e.filter(e=>e.key===r.key);r.instance.brushFromShapes(i,t.components[n])})}},p.scroll=function(){return function(e,t){return t[e]||(t[e]=co()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",S)},p.dataset=e=>M(e),p.dataCollection=e=>k(e),p.scales=function(){return b.all()},p.formatters=function(){return x.all()},p.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return C[e]||(C[e]=Eo()),C[e]},p.scale=function(e){return b.get(e)},p.formatter=function(e){return x.get(e)},p.toggleBrushing=function(e){q=void 0!==e?e:!q},p.component=e=>{const t=E.findComponentByKey(e);return null==t?void 0:t.instance.ctx},p.logger=()=>d,p.theme=()=>f,p.storage=ya({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(p,"interactions",{get:()=>({instances:w,on(){B(),w.forEach(e=>e.on())},off(){H(),w.forEach(e=>e.off())}})}),O(),n&&(N(),V(),A(n),p.element=n),p}const xs=e=>{let t=Ne(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var Ss=Ne();function ws(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}const Ms=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const ks=e=>{let t=e.key,n=e.data,r=e.cache,i=e.config;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let t=e.data,n=e.config;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map(e=>e.split(a))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((e,t)=>t):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,d=t;d=s&&"function"==typeof s.fields?s.fields(d.slice()):t.map(e=>({key:e,title:e})),Array.isArray(r[0])?c=d.map(()=>[]):(c={},d.forEach(e=>{c[e.key]=[]}));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,d):a[e];if(t)if(Array.isArray(t))for(let e=0;e<d.length;e++)c[e].push(t[e]);else for(let e=0;e<d.length;e++)c[d[e].key].push(t[d[e].key])}const f=Array.isArray(c)?e=>c[e]:e=>c[d[e].key];for(let e=0;e<d.length;e++){const t=f(e),r=Ms(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(ir(u({source:n,key:e,title:d[e].title,values:t,min:s,max:l,type:a},d[e]),{value:d[e].value,label:d[e].label}))}}({data:o,cache:r,source:t,config:i})};function Cs(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config;const i={fields:[]},o={key:()=>t,raw:()=>n,field:e=>function(e,t){let n=t.cache;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}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach(e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const o=cr(e,t),a=o.props,s=o.main,l=Object.keys(a),c=!!e.trackBy,u=typeof e.trackBy,d={},f=[],h=n.items(),p=[];for(let t=0;t<h.length;t++){const n=h[t];if(s.filter&&!s.filter(n))continue;const r=ws(s,n,{key:i});l.forEach(e=>{const o=a[e];let s=o.field?o.field.items()[t]:n;r[e]=ws(o,s,{key:i})}),c&&fr({cfg:e,itemData:n,obj:r,target:f,tracker:d,trackType:u}),p.push(r)}r=c?[...r,...dr(f,{main:s,propsArr:l,props:a})]:[...r,...p]}}),r}(e,o),hierarchy:()=>null};return ks({key:t,data:n,config:r,cache:i}),o}Cs.util={normalizeConfig:cr,collect:dr,track:fr};const qs=Ne();qs.default("matrix"),qs("matrix",Cs),qs("default",Cs);const Es=Ne();function Ds(e,t,n){return Math.max(e,Math.min(t,n))}function Ts(e){let t=e.item,n=e.value,r=e.boxCenter,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l=i,c=o,d=n<.5?90:-90;return e.flipXY&&(a="y",s="x",l=o,c=i,d=n<.5?180:0),(0,e.symbol)(u({},t.oob,{[a]:r*l,[s]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:d}))}function Os(e){let t=e.item,n=e.boxWidth,r=e.boxPadding,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l="width",c="height",d=i,f=o;e.flipXY&&(a="y",s="x",l="height",c="width",d=o,f=i);const h=function(e){let t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o;const s=Math.max(t,n),l=Math.min(t,n),c=Ds(-.1,1.2,s),u=Ds(-.1,1.2,l),d=c*a-u*a,f=Math.max(i,d),h=(f-d)/2;return{actualDiff:f,startModifier:h,actualLow:u*a-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:f}),p=h.actualDiff,m=h.actualLow;return u({},t.box,{type:"rect",[a]:(r+t.major)*d,[s]:m,[c]:p,[l]:n*d,data:t.data||{},collider:{type:null}})}function Ns(e){let t=e.item,n=e.from,r=e.to,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x1",l="y1",c="x2",d="y2",f=o,h=a;return e.flipXY&&(s="y1",l="x1",c="y2",d="x2",f=a,h=o),u({},t.line,{type:"line",[d]:Math.floor(n*h),[s]:i*f,[l]:Math.floor(r*h),[c]:i*f,data:t.data||{},collider:{type:null}})}function As(e){let t=e.item,n=e.key,r=e.position,i=e.width,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",c="y1",d="x2",f="y2",h=a,p=s;e.flipXY&&(l="y1",c="x1",d="y2",f="x2",h=s,p=a);const m=i/2;return u({type:"line"},t[n],{[c]:Math.floor(r*p),[l]:(o-m)*h,[f]:Math.floor(r*p),[d]:(o+m)*h,r:m*h,cx:o*h,cy:r*p,width:i*h,data:t.data||{},collider:{type:null}})}function _s(e,t,n){const r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1;let l=Math.min(s*e*i,isNaN(o)?n:o/n);return l=isNaN(a)?l:Math.max(a/n,l),l*s}Es("native",function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach(e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})})}function c(){a.forEach(e=>{let t=e.key,r=e.listener;n.removeEventListener(t,r)}),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}});const Is={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}},Ls=Object.keys(Is),Ps={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 t=e.data;const n=this.rect,r=n.width,i=n.height,o="horizontal"===this.settings.settings.orientation,a=this.style,s=this.resolver,l=this.symbol,c=Ls.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),d={};c.forEach(e=>d[e]=Is[e]);const f=function(e){let t=e.keys,n=e.data,r=e.defaultSettings,i=e.style,o=e.settings,a=e.width,s=e.height,l=e.resolver;const c=u(!0,{},r||{},i||{}),d={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},f=o.major;let h;h="object"==typeof f&&"object"==typeof f.ref&&void 0!==f.ref.start&&void 0!==f.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:d,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof f&&void 0!==f.binStart&&void 0!==f.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:d,settings:u(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:d,defaults:{major:.5},settings:{major:o.major}});const p=o.minor||{},m={};["start","end","min","max","med"].forEach(e=>{(p[e]||n.items&&n.items.length&&n.items[0][e])&&(m[e]={scale:p.scale,ref:e})});let g,y={major:h,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:d,settings:u(!0,{},m,p)})};for(let e=0,r=t.length;e<r;e++)o[g]&&!1===o[g].show||(g=t[e],y[g]=l.resolve({data:n,defaults:c[g],settings:o[g],scaled:d}));return y}({keys:c,data:t,defaultSettings:d,style:a,settings:this.settings.settings,width:r,height:i,resolver:s});f.settings,f.items;const h=function(e){let t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol;const s=[],l=i.major.items;if(!l.length)return s;const c=t,d=n,f=r?n:t,h=i.major.settings,p=["start","end","min","max","med"].filter(e=>void 0!==i.minor.settings[e]),m=p.length,g=o.filter(e=>"oob"!==e);let y,b,x,S,w,M,k,C,q;const E=o?o.length:0,D=g?g.length:0;function T(){k?y.push(Ts({item:x,value:0,boxCenter:M,rendWidth:c,rendHeight:d,flipXY:r,symbol:a})):C&&y.push(Ts({item:x,value:1,boxCenter:M,rendWidth:c,rendHeight:d,flipXY:r,symbol:a}))}const O={box:function(){x.box&&v(x.start)&&v(x.end)&&y.push(Os({item:x,boxWidth:S,boxPadding:w,rendWidth:c,rendHeight:d,flipXY:r}))},line:function(){v(x.min)&&v(x.start)&&y.push(Ns({item:x,from:x.min,to:x.start,boxCenter:M,rendWidth:c,rendHeight:d,flipXY:r})),v(x.max)&&v(x.end)&&y.push(Ns({item:x,from:x.max,to:x.end,boxCenter:M,rendWidth:c,rendHeight:d,flipXY:r}))},median:function(){x.median&&v(x.med)&&y.push(As({item:x,key:"median",position:x.med,width:S,boxCenter:M,rendWidth:c,rendHeight:d,flipXY:r}))},whisker:function(){if(x.whisker){const e=S*x.whisker.width;v(x.min)&&y.push(As({item:x,key:"whisker",position:x.min,width:e,boxCenter:M,rendWidth:c,rendHeight:d,flipXY:r})),v(x.max)&&y.push(As({item:x,key:"whisker",position:x.max,width:e,boxCenter:M,rendWidth:c,rendHeight:d,flipXY:r}))}}};function N(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<m;r++)e=x[p[r]],v(e)&&(t<e&&(t=e),n>e&&(n=e));k=t<0&&t!==-Number.MAX_VALUE,C=n>1&&n!==Number.MAX_VALUE,q=k||C}for(let e=0,t=l.length;e<t;e++){y=[],b=null;const t=l[e],n=t.data;let r=null,a=null;void 0!==h.binStart?(r=t.binStart,a=t.binEnd,b=h.binStart.scale):(b=h.major.scale,r=b?t.major:0);let c=0;b?b.bandwidth?(c=b.bandwidth(),r-=c/2):c=a-r:c=1,x=u({},{major:r,majorEnd:a},i.minor.items[e]);for(let t=0;t<E;t++)x[o[t]]=i[o[t]].items[e];if(S=_s(c,x,f),w=(c-S)/2,M=w+x.major+S/2,N(),q)x.oob&&T();else for(let e=0;e<D;e++)x[g[e]]&&!1===x[g[e]].show||O[g[e]]();const d={type:"container",data:n,collider:{type:"bounds"},children:y};s.push(d)}return s}({width:r,height:i,flipXY:o,resolved:f,keys:c,symbol:l});return h}};const Rs={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},zs=/px$/,Fs={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},js={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},Bs={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function Hs(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 Vs(e,t,n,r){let i=t.width,o=t.height;return e.filter(e=>!1!==e.show&&!isNaN(e.x+e.y)).map(e=>{let t=e,a=zs.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);b(a)&&(t=Rs,a=n.min+t.size*(n.max-n.min));const s=function(e){let t=Fs.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),l=g(s,2),c=l[0],u=m(m({},l[1]),{},{type:c,label:e.label,x:e.x*i,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,imageSettings:t.imageSettings});t===e.errorShape&&(u.width=t.width);const d=r(u);return d.data=e.data,d})}const $s={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let t=e.data;const n=this.resolver.resolve({data:t,defaults:u({},Fs,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=u({},Bs,this.settings.settings.sizeLimits),s=n.items;s.length>0&&"image"===s[0].shape&&t.items.forEach((e,t)=>{s[t].imageSettings=u({},js,this.settings.settings.imageSettings)});const l=function(e,t,n,r,i){const o=Hs(e?e.scale:void 0,n),a=Hs(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return Vs(s,this.rect,l,this.settings.shapeFn||this.symbol)}};const Ws={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function Us(e,t,n,r){let i=t.x,o=t.y,a=t.width,s=t.height;const l=Q(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,f=d/100;return e.map((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const h=l.centroid(e),p=i.offset?function(e,t,n,r){let i=g(e,2),o=i[0],a=i[1];const s=Math.sqrt(o*o+a*a);o/=s,a/=s;const l=n-r;return{x:o*t*l,y:a*t*l}}(h,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},i})}function Ys(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const Ks={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let t=e.data;const n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:u({},Ws,this.style.slice),settings:i.slice}).items;let a=0;for(let e=0,t=o.length;e<t;e++){const t=Ys(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=se,t=ae,n=null,r=E(0),i=E(z),o=E(0);function a(a){var s,l,c,u,d,f=(a=ee(a)).length,h=0,p=new Array(f),m=new Array(f),g=+r.apply(this,arguments),y=Math.min(z,Math.max(-z,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/f,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<f;++s)(d=m[p[s]=s]=+e(a[s],s,a))>0&&(h+=d);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=h?(y-f*b)/h:0;s<f;++s,g=u)l=p[s],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:E(+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?(r="function"==typeof e?e:E(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:E(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:E(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return Us(s(n),u({},this.rect,{x:0,y:0}),r,a)}};const Gs=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach(e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>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 Xs{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 r=e.substring(0,1);if("x"===r||"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"===r||"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,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[Xs.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=Xs.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&Gs(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 Js(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Xs(...t)}function Zs(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const Qs={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=Js(),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,Fo(this,"x",this.rect.width),Fo(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=u({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=u({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=Zs(this.x,this.rect.width),this.lines.y=Zs(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>u(e,{flipXY:!0}));let e=e=>{let t=e.dir,n=e.isMinor,r=this.lines[t].filter(e=>!!e.isMinor===n),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach(e=>{let n=e.data;var r,i;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!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.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 el(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e," ").concat(t-n,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return"\n M ".concat(e-n," ").concat(t,"\n A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n L ").concat(e," ").concat(i?t+n:t-n," Z\n ")}function tl(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n L ").concat(e," ").concat(t+n,"\n L ").concat(i?e+n:e-n," ").concat(t," Z\n ")}let i="bottom"===r;return t+=i?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(i?t+n:t-n," Z\n ")}function nl(e,t,n){return e<t||e>n}function rl(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 il(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 ol(e){var t,n;let r=e.chart,i=e.blueprint,o=e.renderer,a=e.p,s=e.settings,l=e.items,c=e.slopeLine,d=!0,f=!1,h=!1,p=!1,m=!1,g=u(!0,{},s.style.line,a.line||{}),y=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:g.stroke});if(f=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:g.stroke||"black",strokeWidth:g.strokeWidth||1,strokeDasharray:g.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:g.stroke||"black",strokeWidth:g.strokeWidth||1,strokeDasharray:g.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=u(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:g.stroke},a.label);let t,n={width:0,height:0},c="";t=rl(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let f=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),y={width:f.width+n.width,height:Math.max(f.height,n.height)},v=e.padding,b=il(a.flipXY?e.vAlign:e.align),x=il(a.flipXY?e.align:e.vAlign),S=Math.min(1+y.width+2*v,e.maxWidth*i.width,e.maxWidthPx),w=y.height+2*v,M=a.flipXY?w:S,k=a.flipXY?S:w;if(h=i.processItem({fn:t=>{let n=t.width,r=t.height,o=a.position*n-(a.flipXY?w:S)*(1-b);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(x*r-k*x),0),width:a.flipXY?M:Math.min(M,i.width-o),height:k,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),h.x<-1||h.x+h.width>i.width+1||h.y<-1||h.y+h.height>i.height+1)h=void 0;else{p={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+v,y:h.y+h.height/2+y.height/3,maxWidth:h.width-2*v-n.width,anchor:"start"},c&&(m={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:p.x+3+(h.width-(n.width+2*v)),y:p.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?Ia(h,t)&&(d=!1):"line"===t.type&&a.flipXY===t.flipXY&&Ra(h,t)&&(d=!1)}}}if(f&&l.push(f),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var v,b,x;let e,t;const n=120;let s=!1!==(null===(v=c.label)||void 0===v?void 0:v.show)?null===(b=c.label)||void 0===b?void 0:b.text:"";if(!1!==(null===(x=c.label)||void 0===x?void 0:x.showValue)){var S;const t=rl(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(S=c.label)&&void 0!==S&&S.text?" ".concat(e):e}if(s.length>1){var w,M,k;const e=o.measureText({text:s,fontFamily:y.fontFamily,fontSize:y.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?y.padding:3*y.padding,d=void 0!==a||c.slope>0?3*y.padding:y.padding,h=function(e,t,n,r,i,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*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,f,a,e,i,y),p=Math.min(f.y1,f.y2);null!==(w=c.label)&&void 0!==w&&w.stroke&&(t={type:"rect",x:c.isRtl?Math.max(h,u)-2:Math.max(h,u)+2,y:Math.abs(Math.max(p,d)-e.height),rx:3,ry:3,width:e.width+y.padding,height:e.height-2,stroke:g.stroke,fill:g.stroke});const m={type:"text",text:s,fill:null!==(M=null===(k=c.label)||void 0===k?void 0:k.stroke)&&void 0!==M?M:g.stroke,opacity:y.opacity,fontFamily:y.fontFamily,fontSize:y.fontSize,x:t?t.x+2:Math.max(h,u)+2,y:t?t.y+e.height-y.padding:Math.abs(Math.max(p,d)-y.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){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+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,m,e,u,d)||(t&&l.push(t),l.push(m))}}d&&h&&p&&(l.push(h,p),m&&l.push(m))}function al(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function sl(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function ll(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function cl(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const ul={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=Js(),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(sl).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=ll(t,e.value);return u(e,{scale:t,position:n})}return u(e,{position:e.value})}),this.lines.y=this.lines.y.filter(sl).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=ll(t,e.value);return u(e,{scale:t,position:n,flipXY:!0})}return u(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(al(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(al(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach(r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.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();i=m(m({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,f=(l-r.value)/r.slope;let h=[];nl(c,s,l)||(h[0]={x:ll(e,o),y:ll(n,c)}),nl(d,o,a)||(h[1]={x:ll(e,d),y:1}),nl(u,s,l)||(h[2]={x:ll(e,a),y:ll(n,u)}),nl(f,o,a)||(h[3]={x:ll(e,f),y:0});const p=h.filter(e=>!!e).length;if(p>2&&function(e){cl(e[0],e[1])&&(e[1]=void 0),cl(e[1],e[2])&&(e[2]=void 0),cl(e[2],e[3])&&(e[3]=void 0),cl(e[3],e[0])&&(e[3]=void 0)}(h),h=h.filter(e=>!!e),h.length<2)return void t["y".concat(c>l?0:1)].push(al(r));i.x1=h[0].x,i.y1=h[0].y,i.x2=h[1].x,i.y2=h[1].y}else i=void 0;ol({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}}),e.style.oob.show&&function(e){let t=e.blueprint,n=e.oob,r=e.settings,i=e.items;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.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 r=t.width,i=t.height,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:el(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,f=u.cy||u.y;const h=s.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),p=h.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let m={type:"text",text:s.length||"",title:p,x:d-.4*a.width,y:f+.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},g={type:"path",d:tl(d,f,a.width,c),x:d,y:f,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function dl(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){u(e,t.style)}(t,e),t}function fl(e){return"string"==typeof e||"number"==typeof e?e:"-"}function hl(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 r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map(e=>sa(e,r,{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},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[u,d]:[d,u];c.push(...f),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function pl(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function ml(e,t){var n,r;const i={type:"text",text:fl(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+pl(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+pl(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,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)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),hl(e,i,t),i}function gl(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){u(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 yl(e){return!e.isMinor&&e.position>=0&&e.position<=1}function vl(e){let t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){let t=e.majorTicks,n=e.measureText,r=e.rect;const i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=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(i*o*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let t=e.majorTicks,n=e.measureText;const r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t})}function bl(e){let t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function xl(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=a.labels,d=u.maxLengthPx,f=u.minLengthPx;if(a.labels.show){const e=a.align,u="top"===e||"bottom"===e,h=u?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:h,formatter:r}).filter(yl),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=bl({value:t.width,maxValue:d,minValue:f}),t};if(t&&u&&"auto"===a.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,f=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(f=s*u*Math.abs(r.start-r.end),o+c>f)return!0}else{const e=t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0);if(f=s*u*e,d=n("M").width*l*a,d+c>f)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&&vl({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:u})){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=>bl({value:t.width,maxValue:d,minValue:f})*Math.sin(e)+t.height*Math.cos(e)}else g=u?e=>e.height:e=>bl({value:e.width,maxValue:d,minValue:f});if(u&&"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 v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,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),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=p[r]?p[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.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 Sl=(e,t,n)=>e.width*Math.abs(t.position-n.position);function wl(e){let t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?Sl(r,o,l)/2-2:1/0,d=c?Sl(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function Ml(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+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:r,outerRadius:i}},ticks:[]};return function(e,t){u(e,t.style)}(o,e),o}function kl(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Cl(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=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 d=kl(r.cx,r.cy,i+s,c),f=kl(r.cx,r.cy,i,c),h={type:"line",x1:d.x,y1:d.y,x2:f.x,y2:f.y,value:e.value};return function(e,t){const n=m({},t.style);u(e,n)}(h,t),h}function ql(e){return"string"==typeof e||"number"==typeof e?e:"-"}function El(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function Dl(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=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,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const f=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let h;h="left"===d?"end":"right"===d?"start":"middle";const p={type:"text",text:ql(e.label),align:d,x:f.x,y:f.y,maxHeight:t.maxHeight,maxWidth:El(t,d,f),anchor:h,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 r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,f,p),p}function Tl(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 Ol(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function Nl(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Tl(e)+e.labels.margin,t}function Al(e,t){return e.map(e=>gl(e,t))}function _l(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function Il(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick;const l=t.height,c=_l(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-Nl(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-Nl(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=bl({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function Ll(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,c=e.major;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-Nl(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-Nl(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=wl({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=bl({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function Pl(e){let t;function n(){return t=Ll,n}function r(){return t=Il,r}function i(e){let n=e.settings,r=e.scale,i=e.innerRect,o=e.outerRect,a=e.measureText,s=e.ticks,l=e.state,c=e.textBounds;const u=[],d=function(e){return e.filter(e=>!e.isMinor)}(s),f=function(e){return e.filter(e=>e.isMinor)}(s),h={innerRect:i,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(h.startAngle=n.arc.startAngle,h.endAngle=n.arc.endAngle,h.radius=n.arc.radius),n.line.show&&(h.style=n.line,h.padding=n.paddingStart,n.arc?u.push(Ml(h)):u.push(dl(h))),n.ticks.show&&(h.style=n.ticks,h.tickSize=n.ticks.tickSize,h.padding=Tl(n),n.arc?(h.padding=Ol(n),g=function(e,t){return e.map(e=>Cl(e,t))}(d,h)):g=Al(d,h)),n.labels.show){const e=Nl(n);h.style=n.labels,h.padding=e,h.tilted=p,h.layered=m,h.angle=n.labels.tiltAngle,h.paddingEnd=n.paddingEnd,h.textBounds=c;const s=(e,s)=>{h.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:h.style});const l=t({textMetrics:h.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:p,layered:m,tick:e,major:d,index:s});h.maxWidth=l.width,h.maxHeight=l.height,h.stepSize=function(e){let t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*_l(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(h.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=Ol(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,r)=>{n(e,r);const i=Dl(e,t);return i.data=e.data,i})}(d,h,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,r)=>{n(e,r);const i=ml(e,t);return i.data=e.data,i})}(d,h,s):function(e,t,n,r){const i=t.padding,o=Nl(n);return e.map((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=ml(e,t);return l.data=e.data,l})}(d,h,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Ia(q(1,e[t].boundingRect),q(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,h),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&f.length>0&&(h.style=n.minorTicks,h.tickSize=n.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...Al(f,h))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const Rl={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"},zl={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0,centerEndLabels:!1},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const Fl={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 t=e.state,n=e.style,r=e.settings;const i=u(!0,{},t.isDiscrete?Rl:zl,n),o=u(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=Pl(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 r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=jo(r,i);const o=function(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0;const l=xl({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),c=l.size,u=l.edgeBleed;if(s+=c,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>s&&(s=e)}if(a.line.show){const e=a.line.strokeWidth/2;s+=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 s+=a.paddingStart,s+=a.paddingEnd,{size:s,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(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).settings;this.setState(e)},resize(e){const t=e.inner,n=e.outer,r=u({},t,function(e){let t=e.align,n=e.inner;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})),i=n||r;return u(this.state.innerRect,r),u(this.state.outerRect,i),n},beforeRender(){const e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=jo(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter(e=>e.position>=0&&e.position<=1)},render(){const e=this.state,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})),Gs.multiple(t),t}};const jl={render:()=>[]};function Bl(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map(e=>e.title());r=e.join(t)}return r}function Hl(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 Vl={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=Bl(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 e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){let t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:Hl(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};u(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.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})),r},beforeUpdate(e){e.settings&&(u(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=Bl(t,n,this.scale)}};function $l(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(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[i?"x":"y"];if(r&&(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[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function Wl(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const Ul={require:["chart","renderer"],on:{panStart(e){const t=Wl(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=$l(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=Wl(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=Wl(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=Wl(e,this.renderer);$l(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,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],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",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function Yl(e){let t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx;const c="end"!==o,d=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let f=0,h="100%",p="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(h="".concat(s.targetRect.x+s.targetRect.width,"px"),p="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(f=n?s.targetRect.x:s.targetRect.y,h="".concat(s.rect.width-f,"px"),p="".concat(s.rect.height-f,"px")),c||(i-=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":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?f:i,"px"),top:"".concat(n?i:f,"px"),height:n?"".concat(a,"px"):p,width:n?h:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:u({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},d)})])}function Kl(e){let t=e.h,n=e.isVertical,r=e.label,i=e.otherValue,o=e.rangeIdx,a=e.idx,s=e.pos,l=e.align,c=e.state,u=e.value;const d="end"!==l,f="outside"===c.settings.bubbles.placement;let h,p="none";n?(h=d?"left":"right",f&&(p=d?"translate(-100%, 0px)":"translate(100%, 0px)")):(h=d?"top":"bottom",f&&(p=d?"translate(0px, -100%)":"translate(0px, 100%)"));let g=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const y={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 v=c.style.bubble.stroke;const b=g?t("input",{type:"text",value:u,style:m(m({},y),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(v="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(v)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:y},[r]);return t("div",{style:{position:"absolute",[h]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[b])}function Gl(e){let t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",u({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function Xl(e){let t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,f=Math.abs(u-d),h=Math.min(u,d)+l,p=h+f;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),f={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(f.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.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")}},[Gl(f)]))}const m=u<d?o:a,y=u<d?a:o,v=g(c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),b=v[0],x=v[1],S=m+1e-5>=b&&m-1e-5<=x,w=y-1e-5<=x&&y+1e-5>=b;S&&n.push(Yl({h:i.h,isVertical:r,borderHit:t,value:m,pos:h,align:"start",state:i,idx:s})),w&&n.push(Yl({h:i.h,isVertical:r,borderHit:t,value:y,pos:p,align:"end",state:i,idx:s}));const M=i.settings.bubbles;if(M&&M.show){M.fontSize,M.fontFamily,M.fill;const e=[o,a];S&&n.push(Kl({h:i.h,isVertical:r,align:M.align,rangeIdx:s,idx:0,otherValue:y,value:m,label:"".concat(i.format(m,e)),pos:h,state:i})),w&&n.push(Kl({h:i.h,isVertical:r,align:M.align,rangeIdx:s,idx:1,otherValue:m,value:y,label:"".concat(i.format(y,e)),pos:p,state:i}))}}function Jl(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function Zl(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((r,i)=>{e.active&&i===e.active.idx||Xl({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})}),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=Jl(e);r=e.active.start+t,i=e.active.end+t}Xl({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function Ql(e){return{min:e.scale.min(),max:e.scale.max()}}function ec(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function tc(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function nc(e){e.renderer.render(Zl(e))}function rc(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}function ic(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function oc(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function ac(e){const t=e.reduce((e,t)=>(e.push(...w(t.bounds)),e),[]);return M(t)}const sc={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=rc(this.state,this.state.brushInstance),this.state.active=null,nc(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=jo(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map(t=>e.chart.component(t)).filter(e=>!!e&&!!e.rect),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=ac(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=jo(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=ac(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.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:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[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(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r: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,r){let i=e.ranges.map(e=>({min:e.min,max:e.max}));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=m({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)})}(this.state,e,t,n),this.emit("bubbleEnd"),nc(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,nc(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:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"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=i;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=Hi(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>oc(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(ic(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=Eo(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach(e=>{if(!oc(r,[e.min,e.max]))return;const o=n.indexOf(ic(e.min,t)),a=n.indexOf(ic(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}),i}(e,i);return this.state.ranges=rc(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[Zl(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 t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;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);r.element().contains(l)||(l=null);const c={started:!0};t.offset=u({},r.element().getBoundingClientRect());const d=a-t.offset.left,f=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const h=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],p=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(p/t.size),c.start=t.scale.normInvert(h/t.size);let m=t.ranges;const g=Ql(t);let y,v,b=-1;if(l&&l.hasAttribute("data-idx"))b=parseInt(l.getAttribute("data-idx"),10),g.min=b>0?m[b-1].max:g.min,g.max=b+1<m.length?m[b+1].min:g.max;else{for(y=0;y<m.length;y++){if(m[y].min<=c.start&&c.start<=m[y].max){b=y,g.min=y?m[y-1].max:g.min,g.max=y+1<m.length?m[y+1].min:g.max;break}if(c.start<m[y].min){g.max=m[y].min,g.min=y?m[y-1].max:g.min;break}}-1===b&&m.length&&y>=m.length&&(g.min=m[m.length-1].max)}if(-1!==b||t.multi||(c.ranges=[],g.min=t.scale.min(),g.max=t.scale.max()),-1!==b)if(v={idx:b,start:m[b].min,end:m[b].max,limitLow:g.min,limitHigh:g.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),v.mode="modify";else{let e=t.scale.norm(v.start)*t.size,n=t.scale.norm(v.end)*t.size;Math.abs(h-e)<=o?(c.start=v.end,v.mode="modify"):Math.abs(h-n)<=o&&(c.start=v.start,v.mode="modify")}else v={idx:-1,start:c.start,end:c.current,limitLow:g.min,limitHigh:g.max,mode:"current"};c.active=v,"modify"!==v.mode&&t.targetRect&&!Pa(t.targetRect,{x:d,y:f})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:rc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=Ql(e);tc(e,e.current,n)}(this.state,rc),nc(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,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,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=Jl(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 r=rc(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter(e=>-1===i.indexOf(e)),s=i.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),nc(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,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;nc(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function lc(e){e.renderer.render(Zl(e))}function cc(e){return e.rc.ranges()}function uc(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 dc={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,r=this.state.rect[0===n?"height":"width"],i=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=i,this.state.rc=mo(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,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 r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i}),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 t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=h,m=f;c.start=f,c.current=h;let g=t.ranges;const y=ec(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(f-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(f-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!Pa(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:cc,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=ec(e);tc(e,e.current,n)}(this.state,cc),lc(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=Jl(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,...uc(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),lc(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function fc(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}(e).map(i=>{const o=e.scale(i.min)*n,a=e.scale(i.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?r:l,y:t?s:0,height:t?l:r}})}function hc(e,t,n,r){function i(){!function(e){e.renderer.render(fc(e))}(e)}function o(){!function(e){e.renderer.render(fc(e))}(e)}function a(){!function(e){e.renderer.render(fc(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function pc(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 mc={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",r="horizontal"===n?this.rect.width:this.rect.height,i=jo(this.chart.scale(e.scale),r);return pc(this.state),hc(this.state,t,i,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,fc(this.state)},beforeDestroy(){pc(this.state)}};function gc(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function yc(e,t,n){return ia(e,t.points[0])<n.settings.snapIndicator.threshold**2}function vc(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 bc(e){let t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function xc(e,t){e.snapIndicator.visible=t}const Sc={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=gc(this.state.rendererBounds,e);vc(this.state,n),bc({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=gc(this.state.rendererBounds,e);yc(t,this.state,this.settings)?xc(this.state,!0):xc(this.state,!1),vc(this.state,t),bc({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],r=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=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;xc(this.state,!1);yc(gc(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map(e=>({x:e.x+n,y:e.y+r})),o=t.shapesAt({vertices:i},{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(){this.state.active&&(!function(e,t){e.brushConfig.forEach(e=>{e.contexts.forEach(e=>{t.brush(e).end()})})}(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([]))},render(){}};function wc(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function Mc(e){let t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wc;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 d=r[t],f=d.textBounds,h=d.node;if(f[s]<i[s]||f[s]+f[l]>i[s]+i[l])return!1;for(let e=o(f,a,s,l,c);e<a.length;e++)if(Ia(f,a[e].textBounds))return!1;const p=o(f,n,s,l,u),m=f[s]+f[l];for(let e=p;e<n.length;e++){const t=n[e].node;if(m<t.localBounds[s])break;if(Ia(f,t.localBounds)&&h!==t)return!1}return a.push(r[t]),!0}}function kc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Cc(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function qc(e){return m(m({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 Ec(e,t,n){return n?e.width>=t.height:e.width>=t.width}function Dc(e,t,n){return n?e.height>=t.width:e.height>=t.height}function Tc(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||Ec(t,n,!0),a=Dc(t,n,!r)):(o=Ec(t,n),a=i||Dc(t,n,!1)),o&&a}function Oc(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function Nc(e,t,n){const r={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},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return Ec(e,t,n.rotate)&&Dc(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=Oc(e.x,e.width,i.height,n.align)+o,r.y=Oc(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=Oc(e.x,e.width,i.width,n.align),r.y=Oc(e.y,e.height,i.height,n.justify)+o),r}function Ac(e){let t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s=e.measured;const l={};if(u(l,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(l.y=0,l.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(l.y=o,l.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"===i&&"left"===r||"opposite"===i&&"right"===r?(l.x=0,l.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(l.x=o,l.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(l,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=n.top,i=void 0===r?4:r,o=n.bottom,a=void 0===o?4:o,s=n.left,l=void 0===s?4:s,c=n.right,u=void 0===c?4:c,d="function"==typeof l?l(t):l,f="function"==typeof u?u(t):u,h="function"==typeof i?i(t):i,p="function"==typeof a?a(t):a;e.x+=d,e.width-=d+f,e.y+=h,e.height-=h+p}(l,s,a),l}function _c(e){let t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,d=e.placementSettings,f=e.rect,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ac;const p=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=h({bar:c.localBounds,view:f,direction:a,position:r.position,padding:r.padding,measured:l}),p.push(i),t=!o||i[m]>t[m]?i:t,Tc(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),r=d[o],{bounds:n,placement:r}}function Ic(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,c=i.left,u=void 0===c?4:c,d=i.right,f=void 0===d?4:d,h="function"==typeof u?u(t):u,p="function"==typeof f?f(t):f,m="function"==typeof a?a(t):a,g="function"==typeof l?l(t):l,y=e.x+e.dx,v=e.y+e.dy,b=n?Math.min(t.width,r.height):Math.min(t.height,r.width),x=n?Math.min(t.height,r.height):Math.min(t.width,r.width),S=.5*t.height,w=1e-9;return{x:(n?y-S:y)-h-w,y:(n?v:v-S)-m-w,width:x+(h+p)-w,height:b+(m+g)-w}}function Lc(e){let t=e.chart,n=e.targetNodes,r=e.rect,i=e.fitsHorizontally,o=e.collectiveOrientation,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_c,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Nc,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mc;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,f,h,p,g,y,v,b,x,S,w,M,k,C;for(let e=0,l=n.length;e<l;e++){y=null,f=n[e],h=f.node,k=kc(h,t),x=f.direction,C="left"===x||"right"===x?"h":"v";for(let t=0;t<f.texts.length;t++){if(p=f.texts[t],!Cc(p))continue;S=f.labelSettings[t],b=f.measurements[t],M=S.placements;const n=a({direction:x,fitsHorizontally:i,lblStngs:S,measured:b,node:h,orientation:C,placements:M,placementSettings:f.placementSettings[t],rect:r});if(y=n.bounds,w=n.placement,y&&w){var q;g=w.justify;const t="function"==typeof S.linkData?S.linkData(k,e):void 0,n="function"==typeof w.overflow?w.overflow(k,e):w.overflow;"up"===x&&(g=1-g),"opposite"===w.position&&(g=1-g),"left"===x&&(g=1-g);const r=!("h"===o||i);if(d=s(y,p,{justify:"h"===C?w.align:g,align:"h"===C?g:w.align,fontSize:S.fontSize,fontFamily:S.fontFamily,textMetrics:b,rotate:r,overflow:!!n,dock:null!==(q=S.dock)&&void 0!==q?q:"left"}),d){const n=Ic(d,b,r,y,w.padding);v="function"==typeof w.fill?w.fill(m(m({},k),{},{textBounds:n}),e):w.fill,d.fill=v,void 0!==t&&(d.data=t),"object"==typeof w.background&&(d.backgroundColor="function"==typeof w.background.fill?w.background.fill(m(m({},k),{},{textBounds:n}),e):w.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=Ic(d,b,r,y,w.background.padding))),c.push(d),u.labels.push({node:h,textBounds:n})}}}}const E=c.filter(l(u));return[...E.filter(e=>void 0!==e.backgroundBounds).map(qc),...E]}function Pc(e){const t=2*Math.PI;return(e%t+t)%t}function Rc(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function zc(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function Fc(e,t,n){let r=t.x,i=t.y;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*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 jc(e){let t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=Fc(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=Fc(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=Fc(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=Fc(r,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 Bc(e){let t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=Pc((i+o)/2);let d=s-r,f={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(f.angle=u-Math.PI/2,f.anchor="end"):(f.angle=u+Math.PI/2,f.anchor="start"),f}function Hc(e){let t=e.context,n=e.node,r=e.bounds;let i=n.desc.slice;const o=Pc((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function Vc(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function $c(e,t,n){const r={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));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function Wc(e){let t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,c=e.context,u=e.store,d=r.start,f=r.end,h=r.innerRadius,p=r.offset;switch(o){case"into":t="rotate"===i?Bc({slice:r,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius;const l=Pc((i+o)/2);let c=jc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Ra(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||Ra(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Da({cx:0,cy:0,r:a},c)?null:(Rc(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:f,innerRadius:0,outerRadius:h},t="rotate"===i?Bc({slice:n,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=e.store;const o=t.start,a=t.end,s=t.outerRadius,l=Pc((o+a)/2);let c=jc({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",Rc(c,n),i.insideLabelBounds.some(e=>Ia(e,c))?null:(i.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"===i?function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=Pc((o+a)/2);let f=Math.sin(d)*c,h=-Math.cos(d)*c,p=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=h<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=f<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:f,y:h,width:p,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,c=t.offset;const u=Pc((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)),i))return null;let d=l+r+n.height/2,f=Math.sin(u)*d,h=-Math.cos(u)*d,p=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(f+c.x));e<p&&(p=e)}else{let e=Math.abs(i.x-(f+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:f,y:h,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,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"!==i&&function(e,t,n){const r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=Pc((r+i)/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),r=e.y-n;if(e.y=n,r>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),r=n-e.y;if(e.y=n,r>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),r=n-e.y;if(e.y=n,r>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),r=e.y-n;if(e.y=n,r>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,r)),t}function Uc(e){let t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wc;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function Yc(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const Kc=/\n+|\r+|\r\n/,Gc=/\s/,Xc=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function Jc(e){return"string"==typeof e?-1!==e.search(Kc):-1!==String(e).search(Kc)}function Zc(e){return-1!==e.search(Gc)}function Qc(e){return-1!==e.search(Xc)}function eu(e,t,n){return Math.max(t,Math.min(n,e))}function tu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?e=>({width:e.length,height:1}):a,l=e.mandatoryBreakIdentifiers,c=void 0===l?[Jc]:l,u=e.noBreakAllowedIdentifiers,d=void 0===u?[]:u,f=e.suppressIdentifier,h=void 0===f?[Zc,Jc,e=>""===e]:f,p=e.hyphenationIdentifiers,m=void 0===p?[Qc]:p;const g=String(t).split(r);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(g);const y=g.length,v=o?e=>e>=0:e=>e<y;let b=o?y:-1;function x(e){const t=eu(e,0,y-1),n=g[t],r=s(n),i=function(e,t,n,r,i){return r.some(r=>r(e,t,n))?1:i.some(r=>r(e,t,n))?0:2}(n,t,g,c,d);return{index:t,value:n,breakOpportunity:i,suppress:h.some(e=>e(n,t,g)),hyphenation:m.some(e=>e(n,t,g)),width:r.width,height:r.height,done:!1}}return{next:function(e){return isNaN(e)?o?b--:b++:b=eu(e,0,y-1),v(b)?x(b):{done:!0}},peek:x,length:y}}const nu="…",ru=/^\s*\d+(\.\d+)?px\s*$/i;function iu(e){return"string"===typeof e&&ru.test(e)}function ou(e){const t=e["font-size"]||e.fontSize;return iu(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function au(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=ou(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function su(e,t){return{lines:[],line:"",width:0,maxLines:au(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function lu(e){e.lines.push(e.line),e.line="",e.width=0}function cu(e,t){e.line+=t.value,e.width+=t.width}function uu(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){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(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function du(e,t,n){const r=tu({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?uu(e,t,r):t,lu(e),cu(e,t)):cu(e,t)}}function fu(e,t){const n=tu({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=su(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){lu(r),i=!1;break}1===e.breakOpportunity?lu(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?uu(r,e,n):e,lu(r),cu(r,e)):cu(r,e)}return{lines:r.lines,reduced:i}}function hu(e,t){const n=tu({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=su(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){lu(r),i=!1;break}1===e.breakOpportunity?lu(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?lu(r):e.width>r.maxWidth?du(r,e,t):(lu(r),cu(r,e)):cu(r,e)}return{lines:r.lines,reduced:i}}function pu(e){return{"break-all":fu,"break-word":hu}[e.wordBreak]}function mu(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=pu(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||Jc(n.text)){const o=(ou(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach((a,s)=>{const l=u({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=nu:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)}),i}(a,n,o,i.height)}}}}function gu(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),o=e.maxWidth;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+nu,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+nu}function yu(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const vu={},bu={},xu={fontSize:void 0,fontFamily:void 0};let Su;function wu(e,t){return!e&&!t||e===t}function Mu(e){let t=e.text,n=e.fontWeight,r=e.fontSize,i=e.fontFamily;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof bu[o]&&(Su=Su||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,r=e.fontFamily;wu(xu.fontWeight,t)&&wu(xu.fontSize,n)&&wu(xu.fontFamily,r)||(Su.font=[t,n,r].filter(e=>!!e).join(" "),xu.fontWeight=t,xu.fontSize=n,xu.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),bu[o]=Su.measureText(t).width),bu[o]}function ku(e){return"number"!=typeof vu[e]&&(vu[e]=function(e){if(iu(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),vu[e]}function Cu(e){let t=e.text,n=e.fontWeight,r=e.fontSize;return{width:Mu({text:t,fontWeight:n,fontSize:r,fontFamily:e.fontFamily}),height:ku(r)}}function qu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cu;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+yu(e))-.75*i.height,width:o,height:i.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 Eu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Cu;const n=pu(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||Jc(e.text))){const o=n(e,e=>t({text:e,fontFamily:i,fontSize:r})),a=u({},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?nu:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=qu(a,t);return c.height=ou(e)*o.lines.length,c}return qu(e,t)}function Du(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function Tu(e,t,n){const r={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},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function Ou(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function Nu(e){return e.desc&&e.desc.slice?function(e){let t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return Ou({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?Ou(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var Au={bar:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lc;const l=u({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>u({},l,t,e)),d=t.labels.map(e=>e.placements.map(n=>u({},l,t,e,n))),f=function(e){let t=e.nodes,n=e.rect,r=e.chart,i=e.labelSettings,o=e.placementSettings,a=e.settings,s=e.renderer;const l={},c=[];let u,d,f,h,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],h=d.localBounds,!Ia(h,n))continue;let b=kc(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],f="function"==typeof m.label?m.label(b,e):void 0,Cc(f)&&(g="function"==typeof a.direction?a.direction(b,e):a.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=f,p=s.measureText(l),u.measurements.push(p),u.texts.push(f),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=h.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:d}),h=f.fitsHorizontally,p=f.hasHorizontalDirection,m=f.targetNodes,g=function(e){let t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}({orientation:t.orientation,defaultOrientation:p?"h":"v"}),y="h"===g?"y":"x",v="h"===g?"height":"width";return m.sort((e,t)=>e.node.localBounds[y]+e.node.localBounds[v]-(t.node.localBounds[y]+t.node.localBounds[v])),s({chart:n,targetNodes:m,stngs:t,rect:i,fitsHorizontally:h,collectiveOrientation:g})},slice:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Uc,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$c;const c=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const d=t.labels.map(e=>u({},c,t,e)),f=t.labels.map(e=>e.placements.map(n=>u({},c,t,e,n))),h=[],p={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o].desc.slice,s=Pc((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>Pc((e.desc.slice.start+e.desc.slice.end)/2)-Pc((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const m={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=Vc(t,n);for(let n=0;n<d.length;n++){const r=d[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const u="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=Yc(c,r,o),v=s({context:m,direction:u,lblStngs:r,measured:y,node:t,placementSettings:f[n],rect:i,store:p}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==u){Hc({context:m,node:t,bounds:b});if(!xa(zc(b),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),h.push(o),b.line&&(b.line.stroke=n,h.push(b.line)))}}}return h},rows:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tu;const s=u({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=u({},s,t),c=t.labels.map(e=>u({},l,e)),d={},f=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=Du(t,n),s=Nu(t),u=s.type,h=s.bounds;if(!h)continue;let p,m=0,g=[],y=[],v="circle"===u?2*h.r*.9:h.height;for(m+=l.padding,p=0;p<c.length;p++){let t=c[p],n="function"==typeof t.label?t.label(o,e):"";d.fontFamily=t.fontFamily,d.fontSize="".concat(t.fontSize,"px"),d.text=n;let r=i.measureText(d);if(m+=r.height+t.padding,m>v)break;y.push(n),g.push(r)}const b=p,x=Math.max(0,v-m);let S;for(S="circle"===u?h.cy-.9*h.r:h.y,S+=l.justify*x+l.padding,p=0;p<b;p++){let t,n=c[p];if("circle"===u){let e=Math.max(Math.abs(S-h.cy),Math.abs(S+g[p].height-h.cy)),n=Math.sqrt(h.r*h.r-e*e);t={x:h.cx-n+l.padding,y:S,width:2*n-2*l.padding,height:g[p].height}}else t={x:h.x+l.padding,y:S,width:h.width-2*l.padding,height:g[p].height};S+=g[p].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const s="function"==typeof n.linkData?n.linkData(o,e):void 0;let d=a(t,y[p],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[p]});if(d){if(d.text&&d.text!==nu){const e=gu(d,i.measureText);if(nu===e)continue;d.ellipsed=e}void 0!==s&&(d.data=s),f.push(d)}}}return f}};const _u={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&Au[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter(e=>e.key===r.component);return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},Au[e.strategy.type]))}),t}};const Iu={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,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}};function Lu(e){let t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,c=i.label.displayObject,d=i.label.bounds,f=i.symbol.meta;const h="rtl"===l;let p={x:h?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},m=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:h?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:p.height},f.size,{align:void 0===f.align?.5:f.align,justify:void 0===f.justify?.5:f.justify});const g=a(u({},f,m));return delete g.collider,c.anchor=h?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(p,c,{textMetrics:d,fontSize:parseInt(c.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[g,c],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:p}}function Pu(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function Ru(e,t){let n,r,i,o,a=t.onScroll,s=void 0===a?()=>{}:a,l=null,c=0;const d={itemize:t=>{n=function(e,t){let n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,d=0,f=0,h=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=u({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),d=Math.max(l[e].size,d),f=Math.max(r.label.bounds.width,f),h=Math.max(r.label.bounds.height,h)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:d,maxItemBounds:{height:Math.max(d,h),width:d+8+f},maxLabelBounds:{width:f,height:h}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,c=d.getContentOverflow(i);const a=d.extent();l=Math.max(0,Math.min(l,c)),o=u({},i);const s="horizontal"===d.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){let r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?Lu:o,s=n.parallels,l=n.createSymbol;const c=i.layout.direction,u=i.globalMetrics,d=i.items,f="horizontal"===i.layout.orientation;let h=0;const p=[],m=u.maxItemBounds.height,g=u.maxItemBounds.width,y=i.layout.margin.vertical+m,v=i.layout.margin.horizontal+g;let b=t.x,x=t.y,S=r.x-t.x;for(let e=0;e<d.length;e++){let n=a({y:x,x:"rtl"===c?r.x+S+r.width-g-(b-t.x):b,item:d[e],globalMetrics:u,direction:c,createSymbol:l});if((f&&b>=r.x-g||!f&&x>=r.y-m)&&p.push(n.item),h++,h>=s?(h=0,f?(b+=v,x=t.y):(x+=y,b=t.x)):f?x+=y:b+=v,!f&&x>r.y+r.height)break;if(f&&b>r.x+r.width)break}return p}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+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),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return Pu(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,Pu(n,r)-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"===d.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===d.orientation()?o.x<i.x:o.y<i.y,next:()=>{d.scroll(-d.getNextSize())},prev:()=>{d.scroll(d.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(c,l-e));t!==l&&(l=t,s())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>Pu(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return d}function zu(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const Fu={up:"▲",right:"▶",down:"▼",left:"◀"};function ju(e,t){let n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));const c={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(c.border="0",c.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",u({class:zu(a),style:c},l),[s||e("span",{style:{pointerEvents:"none"}},[Fu[i]])])}function Bu(e){let t;const n={itemize:e=>{t=function(e){let t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:r=>function(e,t,n,r){let i=t.rect,o=t.itemRenderer;if(!e||!e.renderArgs)return;e.size(i);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 d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[ju(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),ju(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function Hu(e){let t;const n={itemize:n=>{t=function(e,t){let n=e.resolved;if(!1===n.title.item.show)return null;const r=u({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let r=e.rect;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(u({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function Vu(e,t,n,r){let i,o,a,s=r.itemRenderer,l=r.navigationRenderer,c=r.titleRenderer,d=r.isPreliminary,f=void 0!==d&&d,h=0;const p={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:p.x,y:p.y,width:p.width,height:c.spread()},"horizontal"===n){i={x:p.x,y:p.y,width:c.extent(),height:c.spread()};const e=p.width-i.width-(i.width?t.spacing:0),n=p.height;s.parallelize(e,f?void 0:n);const r=s.extent()>e?l.extent():0,u=s.spread(),d=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:p.y+Math.max(0,(d-u)/2),width:p.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:p.y,width:r,height:p.height},i.y=o.y;"rtl"===s.direction()&&(a.x=p.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),h=Math.max(i.height,d,s.spread())}else{const e=p.height-i.height-(i.height?t.spacing:0),n=p.width;s.parallelize(e,f?void 0:n);const r=s.extent()>e?l.extent():0;a={x:p.x,y:p.y+p.height-r,width:p.width,height:r},o={x:p.x,y:i.y+i.height+(i.height?t.spacing:0),width:p.width,height:p.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},h=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=u({},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,i.x+=e.x,i.y+=e.y,{title:u({},e,i),content:u({},e,o),navigation:u({},e,a),orientation:n,preferredSize:h}}function $u(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map((t,n)=>{const i=e.scale.datum?u({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i})}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:u(!0,{},Iu.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Iu.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:u(!0,{},Iu.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=u(!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:u(!0,{},Iu.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:u(!0,{},{show:Iu.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function d(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(d),c.items.reverse()):c.items.forEach(d));return{title:i,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 Wu(e){const t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=Vu(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let d=i.getItemsToRender({viewRect:u({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},d}const Uu={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=Wu(this);this.update(e)},this.itemRenderer=Ru(this,{onScroll:this.onScroll}),this.navigationRenderer=Bu(this),this.titleRenderer=Hu(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),$u(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=Vu(t.inner,o,i,{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(){$u(this)},render(){return Wu(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 Yu(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=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[r],0)),t[i]+=n}function Ku(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function Gu(e){return Ku(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 Xu(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function Ju(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map((n,i)=>{const o=r[i];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,i),a=Ku((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=i.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:Gu(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,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:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return u}const Zu={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=Xu(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=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 i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;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+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=Ju(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=Ju(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=Xu(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="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+=i?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+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"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 Yu(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map(e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}));return r.sort((e,t)=>e.offset-t.offset)}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.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 Yu(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="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+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=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:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const Qu={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!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 ed(e,t){let n=t.generatorType,r=t.item,i=t.data,o=t.major,a=t.minor,s=t.layerObj,l=t.stngs,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:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function td(e){const t=function(e){let t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain;const s=r.width,l=r.height,c=i.resolve({data:t,defaults:Qu.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),d=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),f={};let h=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(d){const e=f[n]?f[n].items[f[n].items.length-1]:null,r=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!==r&&f[n].items.push({dummy:!0})}f[n]=f[n]||{order:h++,id:n,items:[],dataItems:[],consumableData:{}},f[n].dataItems.push(t.data),f[n].items.push(t)}const p=Object.keys(f).map(e=>(f[e].consumableData=m({points:f[e].dataItems},f[e].dataItems[0]),f[e])),g={items:p.map(e=>e.consumableData)},y=n.layers||{};return{coordinates:c,metaLayers:p,layers:i.resolve({data:g,defaults:{curve:Qu.layers.curve,show:Qu.layers.show},settings:{curve:y.curve,show:y.show}}),lines:i.resolve({data:g,defaults:u({},Qu.layers.line,o.line),settings:y.line}),areas:i.resolve({data:g,defaults:u({},Qu.layers.area,o.area),settings:y.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((t,n)=>{const l=i.items[n];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,f;for(let n=0;n<t.items.length;n++){if(d=t.items[n],f=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=r.settings.minor.scale?r.settings.minor.scale(f.minor0?f.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const h=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:h,points:u,consumableData:t.consumableData})}),s}const nd={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};const o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=td({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,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=a.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);a.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else a.sort((e,t)=>e.median-t.median);return function(e,t){let n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs;const a=[],s=o.layers||{};return e.forEach(e=>{const t=e.lineObj,l=e.layerObj,c=e.areaObj,d=e.points;let f={size:r,p:"y"},h={size:n,p:"x"};if("vertical"===o.orientation){const e=u(!0,{},h);h=u(!0,{},f),f=u(!0,{},e)}s.area&&!1!==c.show&&a.push(ed(d,{data:e.consumableData,item:c,generatorType:"area",major:h,minor:f,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(ed(d,{data:e.consumableData,item:t,generatorType:"line".concat(f.p.toUpperCase(),"1"),major:h,minor:f,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(ed(d,{data:e.consumableData,item:t,generatorType:"line".concat(f.p.toUpperCase(),"0"),major:h,minor:f,layerObj:l,stngs:o},"none")))}),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function rd(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function id(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function od(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const ad={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=rd(this,e,!1);Pa({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=rd(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=rd(this,e),function(e){if(e.state.active){const t=id(e,e.state.start),n=id(e,e.state.end),r=e.chart.shapesAt(od(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([u({type:"rect"},od(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(){this.state.active&&(!function(e,t){e.brushConfig.forEach(e=>{Array.isArray(e.contexts)&&e.contexts.forEach(e=>{t.brush(e).end()})})}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function sd(e,t,n){let r=n.renderer,i=n.style,o=n.props,a=n.h;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,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:zu(u({"pic-tooltip":!0},s.tooltip)),style:u({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:zu(u({"pic-tooltip-content":!0},s.content))},l),a("div",{class:zu(u({"pic-tooltip-arrow":!0},s.arrow)),style:u({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function ld(e){let t=e.defaultDuration,n=e.defaultDelay,r=null,i=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=()=>{r=null,i=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;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout(()=>{e(),o=!0,r=null,a.set("active")},c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function cd(){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 ud(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 dd(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 fd(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function hd(e){let t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,f=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,f+=l+u>t.height?-(l+u-t.height):0,{x:d,y:f}}function pd(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y;const l=n.targetBounds,c=cd(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:dd(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=ud(r,i,t.offset),h=[],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=hd({area:d,vx:p,vy:m,width:r,height:i,offset:f[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=dd(t.offset)[n];0!==l.x&&(u.width="".concat(r-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:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,h.push(y)}return h.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),h[0]}function md(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return u({scaleRatio:i.scaleRatio},i.computedInner)}const gd={bounds:function(e){let t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options;const s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,d=l.width,f=l.height,h={left:{x:c,y:u+f/2},right:{x:c+d,y:u+f/2},top:{x:c+d/2,y:u},bottom:{x:c+d/2,y:u+f},inside:{x:c+d/2,y:u+f/2}},p=cd(a.offset),m=p[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(h[a.dock].x,"px"),top:"".concat(h[a.dock].y,"px"),transform:m},computedArrowStyle:dd(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},y=ud(i,o,a.offset),v=["top","left","right","bottom","inside"];for(let e=0;e<v.length;e+=1){const t=v[e];if(fd(g,"target"===a.area?h[t].x:s.left+h[t].x,"target"===a.area?h[t].y:s.top+h[t].y,i,o,y[t]))return{computedTooltipStyle:{left:"".concat(h[t].x,"px"),top:"".concat(h[t].y,"px"),transform:p[t]},computedArrowStyle:dd(a.offset)[t],dock:t}}const b=function(e){let t=e.options,n=e.docks,r=e.dockOffsets,i=e.targetBounds,o=e.area,a=e.width;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let f=n.top.x;return u<0&&u+d>o.width||(u<0?f-=u:u+d>o.width&&(f-=u+d-o.width)),f}({options:a,docks:h,dockOffsets:y,targetBounds:s,area:g,width:i});return{computedTooltipStyle:{left:"".concat(b,"px"),top:"".concat(h.top.y,"px"),transform:p.top},computedArrowStyle:dd(a.offset+b-h.top.x,a.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height;return pd({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources;const s=o[0],l=n.dx,c=n.dy,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,f=c+u.y+u.height/2,h=s.desc.slice,p=h.start,m=h.end,g=h.outerRadius,y=(p+m)/2-Math.PI/2,v=2*Math.PI,b=(y%v+v)%v;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),pd({x:d+g*u.scaleRatio.x*Math.cos(b),y:f+g*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function yd(e,t){let n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>md(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=md(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},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=u(c,a.placement(s))),"object"===l&&gd[a.placement.type]?c=u(c,a.placement):"string"===l&&gd[a.placement]&&(c=u(c,{type:a.placement})),s.options=c;const d=gd[c.type](s);let f=s.resources.getComponentBoundsFromNode(s.nodes[0]),h=f.x,p=f.y,m=f.width,g=f.height;return h+=s.pointer.dx,m+=h,p+=s.pointer.dy,g+=p,d.computedTooltipStyle.left="".concat(Math.min(Math.max(0,h,parseFloat(d.computedTooltipStyle.left)),m),"px"),d.computedTooltipStyle.top="".concat(Math.min(Math.max(0,p,parseFloat(d.computedTooltipStyle.top)),g),"px"),d}let vd;function bd(){vd=null}const xd={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 t=e.h;return e.data.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 Sd={require:["chart","renderer"],defaultSettings:{settings:xd,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,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.nodes,i=n.duration,o=n.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,f=i-a.left,h=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:f,cy:h,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(r)?this.props.filter(r):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,o)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=ld({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){vd&&vd!==e&&vd()}(t),vd=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,u({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,u({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),vd===t&&(vd=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 t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),bd()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),bd()},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 e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),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 n=t.chart,r=t.scale,i=t.props,o=t.h;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach(e=>{if("function"==typeof i.extract){const t=u({node:e},a);s.push(i.extract(t))}}),s}(e,this),n=yd(sd(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=sd(t,n,this)}};const wd={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 t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Md={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},kd=/([astvzqmhlc])([^astvzqmhlc]*)/gi,Cd=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function qd(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(kd,(e,n,r)=>{const i=function(e){const t=e.match(Cd);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<Md[o])return"";for(t.push([a,...i.splice(0,Md[o])]);i.length>=Md[o]&&i.length&&Md[o];)t.push([a,...i.splice(0,Md[o])]);return""}),t}const Ed=2*Math.PI;function Dd(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function Td(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function Od(e,t,n,r){let i=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,r){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+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=Dd(e,t),s=Dd(t,n),l=Dd(n,r),c={x:Td(.5,e.x,t.x,n.x,r.x),y:Td(.5,e.y,t.y,n.y,r.y)},u=Dd(a,s),d=Dd(s,l);return Od(e,a,u,c,i,o-1),Od(c,d,l,r,i,o-1),i}function Nd(e,t,n){const 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 Od(e,r.cp1,r.cp2,n)}function Ad(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],f=e[7],h=e[1],p=e[2];if("a"===e[0]&&(d+=t,f+=n),t===f&&n===f)return r;if(!h||!p)return r.push({x:d,y:f}),r;var m=function(e,t,n,r,i,o,a,s,l){let c,u,d,f,h,p;const m=Jo(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,S=g*b-y*v;p=x**2/(e=Math.abs(e))**2+S**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const w=e*S,M=t*x,k=w**2+M**2,C=(e*t)**2-k;let q=Math.sqrt(Math.max(C/k,0));r===i&&(q=-q);const E=q*(w/t),D=q*(-M/e);f=g*E-y*D+(s+o)/2,h=y*E+g*D+(l+a)/2;const T=(x-E)/e,O=(S-D)/t,N=(-x-E)/e,A=(-S-D)/t;return c=Math.atan2(O,T),c+=c<0?Ed:0,u=Math.atan2(A,N),u+=u<0?Ed:0,d=u-c,!i&&c<u?d-=Ed:i&&u<c&&(d+=Ed),d%=Ed,{startAngle:c,sweepAngle:d,cx:f,cy:h,rx:e,ry:t}}(h,p,a,i,o,d,f,t,n);s=m.cx,l=m.cy,h=m.rx,p=m.ry,c=m.sweepAngle,u=m.startAngle;const g=Math.abs(c*Math.sqrt((h**2+p**2)/2)),y=Math.ceil(g/10),v=c/y;for(let e=1;e<=y;e++){const t=(u+v*e)%Ed,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*h+-i*n,y:l+i*p+n*i})}return r}function _d(e){const t=qd(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...Ad(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...Ad(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...Od({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...Od({x:i,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],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...Od({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...Od({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...Nd({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...Nd({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...Nd({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...Nd({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const Id={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=>{_d(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 t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var Ld=[function(e){e.component("box",Ps),e.component("box-marker",Ps)},function(e){e.component("point",$s),e.component("point-marker",$s)},function(e){e.component("pie",Ks)},function(e){e.component("grid-line",Qs)},function(e){e.component("ref-line",ul)},function(e){e.component("axis",Fl)},function(e){e.component("container",jl)},function(e){e.component("text",Vl)},function(e){e.component("scrollbar",Ul)},function(e){e.component("brush-range",sc),e.component("brush-area-dir",dc)},function(e){e.component("range",mc)},function(e){e.component("brush-lasso",Sc)},function(e){e.component("labels",_u)},function(e){e.component("legend-cat",Uu)},function(e){e.component("legend-seq",Zu)},function(e){e.component("line",nd)},function(e){e.component("brush-area",ad)},function(e){e.component("tooltip",Sd)},function(e){e.component("debug-collider",wd)},function(e){e.component("debug-path-to-points",Id)}];let Pd=class{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,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.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 Rd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,f=void 0===d?0:d;this.set({x:n,y:i,width:a,height:l,minWidth:u,minHeight:f})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,f=void 0===d?0:d;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,u)):(this.x=n+Math.min(a,-u),this.width=-Math.min(a,-u)),l>=0?(this.y=i,this.height=Math.max(l,f)):(this.y=i+Math.min(l,-f),this.height=-Math.min(l,-f))}containsPoint(e){return Pa(this,e)}intersectsLine(e){return Ra(this,k(e))}intersectsRect(e){return Ia(this,M(e))}intersectsCircle(e){return Da(e,this)}intersectsPolygon(e){return _a(e,this)}intersectsGeoPolygon(e){return Wa(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 zd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.set({cx:n,cy:i,r:a,minRadius:l})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Ea(this,e)}intersectsLine(e){return Ta(this,k(e))}intersectsRect(e){return Da(this,M(e))}intersectsCircle(e){return n=e,!Ma(t=this)&&!Ma(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Oa(this,e)}intersectsGeoPolygon(e){return Ha(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class Fd{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:i,x2:a,y2:l,tolerance:u})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}containsPoint(e){if(this.tolerance>0){return Ta({cx:e.x,cy:e.y,r:this.tolerance},this)}return Fa(this,e)}intersectsLine(e){return za(this,k(e))}intersectsRect(e){return Ra(M(e),this)}intersectsCircle(e){return Ta(e,this)}intersectsPolygon(e){return Aa(e,this)}intersectsGeoPolygon(e){return $a(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class jd{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.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 Na(this,e)}intersectsCircle(e){return Oa(e,this)}intersectsLine(e){return Aa(this,k(e))}intersectsRect(e){return _a(this,M(e))}intersectsPolygon(e){return ja(this,e)}intersectsGeoPolygon(e){return Ba(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 Bd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new jd(...t)}function Hd(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function Vd(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class $d{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[[]]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;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 e=0;e<this.numPolygons;e++)Vd(this.vertices[e]),this.vertices[e].length>2&&Hd(this.vertices[e]),this.polygons[e]=Bd({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 Va(this,e)}intersectsCircle(e){return Ha(e,this)}intersectsLine(e){return $a(this,k(e))}intersectsRect(e){return Wa(this,M(e))}intersectsPolygon(e){return Ba(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Ia(n,r)&&(La(r,n)?qa(t,e):qa(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 Wd(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $d(...t)}function Ud(e,t){return e.x!==t.x||e.y!==t.y}class Yd{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;this.set({points:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let e=0,t=this._points.length-1;e<t;e++)Ud(this._points[e],this._points[e+1])&&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})}containsPoint(e){return this.segments.some(t=>Fa(t,e))}intersectsCircle(e){return this.segments.some(t=>Ta(e,t))}intersectsLine(e){const t=k(e);return this.segments.some(e=>za(e,t))}intersectsRect(e){const t=M(e);return this.segments.some(e=>Ra(t,e))}intersectsPolygon(e){return this.segments.some(t=>Aa(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>$a(e,t))}points(){return this._points}}const Kd=Ne();function Gd(e,t){return Kd.get(e)(t)}Kd.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Rd(...t)}),Kd.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new zd(...t)}),Kd.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Fd(...t)}),Kd.add("polygon",Bd),Kd.add("geopolygon",Wd),Kd.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Yd(...t)});class Xd{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=Gd(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 Jd{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new Jd).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,r,i;if(e instanceof Jd&&(e=e._elements),Array.isArray(e)){for(r=[[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(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}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,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=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*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=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,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],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,r=[e.x,e.y,1],i=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]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];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 Zd=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function Qd(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function ef(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function tf(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function nf(e,t){t.args.length>=6&&e.transform(...t.args)}function rf(e,t){const n=function(e){let t,n=[];for(;null!==(t=Zd.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter(e=>e.trim().length>0).map(e=>Number(e))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?Qd(t,r):"scale"===r.cmd?ef(t,r):"matrix"===r.cmd?nf(t,r):"translate"===r.cmd&&tf(t,r)}const of={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},af={type:(e,t)=>t.filter(t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}),attr:(e,t,n,r)=>r.filter(r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);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 sf(e,t){if(!t||!t.length||!e||"function"!=typeof af[e.type])return[];switch(e.type){case"type":case"tag":return af[e.type](e.value,t);case"attr":return af[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return af[e.type](t);default:return[]}}var lf={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const a=t=>{i=e.match(of[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(of).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););}),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[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=sf(e,n),s=!0}),s&&t.push(n);const l=t[0].filter(e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0});r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function cf(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every(e=>Array.isArray(e))?i.map(e=>n.transformPoints(e)):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=M(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=k(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:Go(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=Go(i[t],!0);o={type:"path",d:e}}return o}class uf{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n.x,y:n.y,width:n.width,height:n.height}},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=>cf(e,t,n))}:cf(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new uf(e)),this._parent=()=>e.parent?new uf(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,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect(),n=t.left,r=void 0===n?0:n,a=t.top;i-=r,o-=void 0===a?0:a}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function df(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new uf(...t)}class ff{constructor(e){this._node=df(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 hf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ff(...t)}function pf(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=hf(n);const e=n.parent;e&&"stage"!==e.type&&pf(e,t.parent)}}function mf(e,t,n){if(null===e.colliderType)return null;const r=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};var r=e.inverseModelViewMatrix.transformPoint(i);n.cx=r.x,n.cy=r.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every(e=>Array.isArray(e))?Wd(n):Bd(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=hf(i);return pf(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=hf(e);return pf(e,t),t}return null}(e,t,r)}function gf(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=mf(i,t,r);a&&n.push(a),!i.children||a||i.collider||gf(i.children,t,n,r)}}function yf(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==mf(r,t,n))return!0;if(r.children&&!r.collider)return yf(r.children,t,n)}return!1}function vf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(C(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=w(e).map(e=>ta(e,t)),["intersectsRect",n];case"line":return n=S(e).map(e=>ta(e,t)),["intersectsLine",n];case"point":return n=ta(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>ta(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>ta(e,t))),["intersectsGeoPolygon",n];default:return[]}}function bf(e,t){const n=g(vf(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(gf([e],r,o,i),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function xf(e,t){const n=g(vf(t,e.dpi),2);return yf([e],n[0],n[1])}class Sf extends Pd{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 t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;var a,s;a=this.attrs,s=e,Object.keys(Ko).forEach(e=>{const t=s[e];void 0!==t&&(a[Ko[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=u(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return lf.find(e,this).map(e=>df(e))}getItemsFrom(e){return bf(this,e)}containsPoint(e){return xf(this,e)}intersectsLine(e){return xf(this,e)}intersectsRect(e){return xf(this,e)}intersectsCircle(e){return xf(this,e)}intersectsPolygon(e){return xf(this,e)}intersectsGeoPolygon(e){return xf(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jd;void 0!==this.attrs.transform&&rf(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Jd;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),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])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 Xd(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=Gd("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=Gd(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class wf extends Pd{addChild(e){if(!(e&&e instanceof Pd))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 Mf=wf.prototype;class kf extends Sf{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=e.collider,n=u({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]||{},r=g(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,c=o.y,u=isNaN(n.width)?l:Math.max(l,n.width+n.x),d=isNaN(n.height)?c:Math.max(c,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=u-n.x,n.height=d-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]=u({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=Mf.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=u({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=Mf.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=u({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,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if(Mf.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=u(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if(Mf.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=u(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function Cf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new kf(...t)}class qf extends kf{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const Ef=wf.prototype,Df=["x1","x2","y1","y2","id","offset","style"];class Tf extends Sf{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":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 r=0,i=Df.length;r!==i;r++)n=Df[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Ef.addChild.call(this,e)}addChildren(e){return Ef.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Ef.removeChild.call(this,e),this}removeChildren(e){return Ef.removeChildren.call(this,e),this}}function Of(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Tf(...t)}const Nf=wf.prototype,Af=["patternUnits","x","y","width","height","id"];class _f extends Sf{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":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 r=0,i=Af.length;r!==i;r++)n=Af[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return Nf.addChild.call(this,e)}addChildren(e){return Nf.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return Nf.removeChild.call(this,e),this}removeChildren(e){return Nf.removeChildren.call(this,e),this}}class If extends Sf{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,d=void 0===c?0:c,f=e.ry,h=void 0===f?0:f,p=e.collider,m=u({type:"rect",x:n,y:i,width:a,height:l},p);super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),d>0&&(this.attrs.rx=d),h>0&&(this.attrs.ry=h),this.collider=m,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=w(this.attrs),n=g(x(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},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 Lf extends Sf{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.collider,l=u({type:"circle",cx:n,cy:i,r:a},s);super.set(e),this.attrs.cx=n,this.attrs.cy=i,this.attrs.r=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=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 t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o;let l=2*i,c=2*o,u=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+c},{x:a,y:s+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=g(x(u),4),n=t[0],r=t[1];l=t[2]-n,c=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+l,y:r},{x:n+l,y:r+c},{x:n,y:r+c}]}else this.__bounds[e]=u;return this.__bounds[e]}}class Pf extends Sf{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=i,this.attrs.x2=a,this.attrs.y2=l;const d={type:"line",x1:n,y1:i,x2:a,y2:l};this.collider=u(d,c),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=S(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=g(x(t),4),r=n[0],i=n[1],o=n[2],a=n[3],s=r!==o||i!==a;return this.__boundingRect[e]={x:r,y:i,width:s?Math.max(1,o-r):0,height:s?Math.max(1,a-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 Rf=Math.PI/2;function zf(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function Ff(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const jf={step:function(e){return new ke(e,.5)},stepAfter:function(e){return new ke(e,1)},stepBefore:function(e){return new ke(e,0)},linear:ne,basis:function(e){return new ce(e)},cardinal:fe.tension(0),catmullRom:pe,monotonex:function(e){return new be(e)},monotoney:function(e){return new xe(e)},natural:function(e){return new we(e)}};function Bf(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 Hf extends Sf{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=Q();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 t=e.major,n=e.minor,r=e.layerObj,i=e.points,o=e.stngs,a=e.generatorType,s=oe(),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(jf["monotone"===r.curve?"monotone".concat(t.p):r.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?i.filter(s.defined()):i,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=_d(this.attrs.d),this.segments.length>1&&this.segments.every(e=>Bf(e)))return void(this.collider=u({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(Bf(t))this.collider=u({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 r=[],i=[];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=zf(s,a),u=zf(s,l),d=(c+u)/2,f=d+Math.PI,h=Math.max(d,f),p=Math.min(d,f),m=c>u;if(1===n){const e=zf(a,s);r.push(Ff(a,e-Rf,t)),i.unshift(Ff(a,e+Rf,t))}const g=m?h:p,y=m?p:h;if(r.push(Ff(s,g,t)),i.unshift(Ff(s,y,t)),n===o-1){const e=zf(l,s);r.push(Ff(l,e+Rf,t)),i.unshift(Ff(l,e-Rf,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=u({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:_d(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=g(x(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points),4),n=t[0],r=t[1],i=t[2],o=t[3];return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||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 Vf(e){let t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}class $f extends Sf{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.dx,a=void 0===o?0:o,s=e.dy,l=void 0===s?0:s,c=e.textBoundsFn,d=e.text,f=e.title,h=e.collider,p=e.boundingRect,m=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=i,this.attrs.dx=a,this.attrs.dy=l,this.attrs.text=d,void 0!==f&&(this.attrs.title=String(f)),"object"==typeof p?this._textBoundsFn=()=>p:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof m&&(this.ellipsed=m),this.collider=u({type:Vf(this)?"bounds":null},h),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=w(e),r=g(x(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[t]={x:i,y:o,width:a-i,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]}}class Wf extends Sf{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,d=void 0===c?0:c,f=e.ry,h=void 0===f?0:f,p=e.src,m=e.collider,g=e.cx,y=void 0===g?0:g,v=e.cy,b=void 0===v?0:v,x=e.r,S=void 0===x?0:x,w=e.opacity,M=e.imageScalingFactor,k=e.imagePosition,C=e.symbol;let q;q="circle"===e.symbol?u({type:"circle",cx:y,cy:b,r:S},m):u({type:"bounds",x:n,y:i,width:a,height:l},m),super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),d>0&&(this.attrs.rx=d),h>0&&(this.attrs.ry=h),p&&(this.attrs.src=p),this.attrs.r=S,this.attrs.cx=y,this.attrs.cy=b,this.attrs.opacity=void 0!==w?w:1,this.attrs.imageScalingFactor=void 0!==M?M:1,this.attrs.imagePosition=k||"center-center",this.attrs.symbol=C||"rectangle",this.collider=q,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?u(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):u(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=w(this.attrs),n=g(x(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const t=g(x(s),4),n=t[0],r=t[1];o=t[2]-n,a=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+o,y:r},{x:n+o,y:r+a},{x:n,y:r+a}]}else this.__bounds[e]=s;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 Uf=Ne();function Yf(e,t){return Uf.get(e)(t)}Uf.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new If(...t)}),Uf.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Lf(...t)}),Uf.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new $f(...t)}),Uf.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Pf(...t)}),Uf.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Hf(...t)}),Uf.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new qf(...t)}),Uf.add("container",Cf),Uf.add("defs",Cf),Uf.add("linearGradient",Of),Uf.add("radialGradient",Of),Uf.add("conicGradient",Of),Uf.add("stop",Of),Uf.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new _f(...t)}),Uf.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Wf(...t)});const Kf=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 r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return u(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function Gf(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function Xf(e,t,n){e.node=n[t],e.index=t}function Jf(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(Xf(o,a,e),Gf(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=Kf.save(o.node);const s=Yf(o.node.type,o.node);s&&(o.node.transform&&(n.save(),rf(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&Jf(o.node.children,s,n,r),o.node.transform&&n.restore()),Kf.restore()}}function Zf(e){let t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=Yf("stage",r)),Jf(t,n,new Jd,o),n}function Qf(e,t,n){const r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o;let s=null;if("radial"===r){const n=t.boundingRect();s=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"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;s=e.createConicGradient(t,r,i)}else{const r=Zo(i);["x1","x2","y1","y2"].forEach(e=>{e in n&&(r[e]=n[e])});const o=t.boundingRect();s=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=a.length;e<t;e++){let t=a[e];s.addColorStop(t.offset,t.color)}return s}function eh(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 th(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed;const l={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 l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"==typeof s&&["left","right","top","bottom"].forEach(e=>{!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)}),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function nh(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:Cu,textBounds:Eu,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function rh(e){return t=>{let n=t.node;"text"===n.type&&function(e){return null!=e}(n.data)&&!n.textBoundsFn&&(n.textBoundsFn=e.textBounds)}}const ih=200,oh=200;class ah{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*ih,height:n.computedPhysical.height+2*oh},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const sh=Ne();function lh(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function ch(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function uh(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function dh(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&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=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function fh(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],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=Qf(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=Qf(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),dh(t,o,n,a),o.modelViewMatrix&&uh(o.modelViewMatrix.elements,t),sh.has(o.type)&&sh.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&&fh(o.children,t,n,r),t.restore()}}function hh(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zf;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=th();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",lh]];let l;const c=nh();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach(t=>{void 0!==e[t]&&(r[t]=e[t])}),r),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 r.transform||t||(t=new ah(e)),n.appendChild(e),e),c.getScene=r=>{const i=ch(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[mu(c.measureText),rh(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||eh(e,t,n),r[i]):eh(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=ch(u),f=t&&r.transform();if(f)return e.width=e.width,function(e){let t=e.el,n=e.dpiRatio,r=e.transform;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:f}),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*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const h=c.getScene(n),p=!i||!h.equals(i);l.clear();const m=o||p,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),fh(h.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&h.children.unshift(...i.children),i=h,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=th(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),i=null},c}function ph(e,t){sh.add(e,t)}function mh(e,t){return Math.max(0,Math.min(e,t))}const gh=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),yh=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),vh=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function bh(e){return gh.test(e)}function xh(e){return yh.test(e)||vh.test(e)}function Sh(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],bh(n))return"ltr";if(xh(n))return"rtl"}return"ltr"}const wh={start:"end",end:"start",center:"center",middle:"middle"};function Mh(e,t){return"rtl"===t?wh[e]:e}function kh(e,t){if(kh.cache[e])return void t(kh.cache[e]);const n=new Image;n.src=e,n.onload=()=>{kh.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function Ch(e,t){const n=[];let r;const i=[],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,r=t.length;e<r;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)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Ch([],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=Ch(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function qh(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function Eh(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Dh(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(qh(i.diff.added,i.object,t),Eh(i.diff.removed,r),Dh(i.diff.items,t,n,r)))}function Th(e,t,n,r,i,o){const a=Ch(e,t);return qh(a.added,n,r),Eh(a.removed,o),Dh(a.items,r,i,o),a.items}kh.cache={},ph("rect",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=mh(r/2,o>0?o:a),a=mh(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-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),r&&n.fill(),i&&n.stroke()}),ph("circle",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()}),ph("line",function(e,t){let n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()}),ph("path",function(e,t){let n=t.g,r=t.doStroke,i=t.doFill;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)}),ph("text",function(e,t){let n=t.g,r=t.ellipsed,i=t.doStroke;const o=r||gu(e,Cu);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const a=Sh(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=Mh("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=yu(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}),ph("image",function(e,t){let n=t.g;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),kh(e.src,t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)})});const Oh="http://www.w3.org/2000/svg",Nh=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(Oh,"container"===e?"g":e);return t.appendChild(n),n},Ah=e=>{e.parentNode&&e.parentNode.removeChild(e)};function _h(e){let t=e.element,n=e.attrs;return function(){const e=n.width,r=n.height,i=n.imagePosition,o=n.imageScalingFactor,a=n.symbol;let s=n.x,l=void 0===s?0:s,c=n.y,u=void 0===c?0:c,d=e>0?e:this.naturalWidth,f=r>0?r:this.naturalHeight;switch(o&&(d*=o,f*=o),i){case"top-center":u-=f/2;break;case"center-left":l-=d/2;break;case"center-right":l+=d/2;break;case"top-left":l-=d/2,u-=f/2;break;case"top-right":l+=d/2,u-=f/2;break;case"bottom-left":l-=d/2,u+=f/2;break;case"bottom-right":l+=d/2,u+=f/2;break;case"bottom-center":u+=f/2}if(t.setAttribute("width",d),t.setAttribute("height",f),t.setAttribute("x",l-d/2),t.setAttribute("y",u-f/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(Oh,"defs"),e.firstChild),r=document.createElementNS(Oh,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(Oh,"circle");i.setAttribute("cx",l),i.setAttribute("cy",u),i.setAttribute("r",Math.min(d,f)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const Ih=(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":case"image":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||gu(t.attrs,Cu);const n=Sh(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",Mh(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(Oh,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=_h({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?yu(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}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 Lh{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function Ph(){return new Lh(Th,Nh,Ih,Ah)}function Rh(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function zh(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Oh,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zf;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ph)();let r,i,o,a=!1,s=th();const l={transform:void 0,disableScreenReader:!1},c=nh(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rh,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach(a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").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}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")})},clear(){n={}}};return i}(u.children),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rh,n={},r=Date.now();const i={getOrCreateGradient(){let i=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(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let t=i[o],r=t.orientation,a=t.degree,c=t.stops,u=void 0===c?[]:c,d={};void 0===a&&(a=90),"radial"===r?d.type="radialGradient":(d=Zo(a),["x1","x2","y1","y2"].forEach(e=>{e in i[o]&&(d[e]=i[o][e])}),d.type="linearGradient"),d.id=l,d.children=u.map(e=>{let t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}}),e.push(d),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=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach(t=>{void 0!==e[t]&&(l[t]=e[t])}),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,mu(c.measureText),rh(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const e=t.horizontalScaling,n=t.horizontalSkewing,r=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),f.clear(),d.clear(),u.children.length=0;const h=c.getScene(e),p=!o||!h.equals(o),m=a||p;return m&&(c.clear(),n.render(h.children,i)),a=!1,o=h,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=th(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var Fh,jh,Bh,Hh,Vh,$h,Wh,Uh={},Yh=[],Kh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Gh(e,t){for(var n in t)e[n]=t[n];return e}function Xh(e){var t=e.parentNode;t&&t.removeChild(e)}function Jh(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Fh.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 Zh(e,a,r,i,null)}function Zh(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++Bh:i};return null==i&&null!=jh.vnode&&jh.vnode(o),o}function Qh(e){return e.children}function ep(e,t){this.props=e,this.context=t}function tp(e,t){if(null==t)return e.__?tp(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?tp(e):null}function np(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 np(e)}}function rp(e){(!e.__d&&(e.__d=!0)&&Hh.push(e)&&!ip.__r++||Vh!==jh.debounceRendering)&&((Vh=jh.debounceRendering)||$h)(ip)}function ip(){var e,t,n,r,i,o,a,s;for(Hh.sort(Wh);e=Hh.shift();)e.__d&&(t=Hh.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=Gh({},o)).__v=o.__v+1,hp(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?tp(o):a,o.__h),pp(r,o),o.__e!=a&&np(o)),Hh.length>t&&Hh.sort(Wh));ip.__r=0}function op(e,t,n,r,i,o,a,s,l,c){var u,d,f,h,p,m,g,y=r&&r.__k||Yh,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h||"function"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?Zh(null,h,null,null,h):Array.isArray(h)?Zh(Qh,{children:h},null,null,null):h.__b>0?Zh(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(f=y[u])||f&&h.key==f.key&&h.type===f.type)y[u]=void 0;else for(d=0;d<v;d++){if((f=y[d])&&h.key==f.key&&h.type===f.type){y[d]=void 0;break}f=null}hp(e,h,f=f||Uh,i,o,a,s,l,c),p=h.__e,(d=h.ref)&&f.ref!=d&&(g||(g=[]),f.ref&&g.push(f.ref,null,h),g.push(d,h.__c||p,h)),null!=p?(null==m&&(m=p),"function"==typeof h.type&&h.__k===f.__k?h.__d=l=ap(h,l,e):l=sp(e,h,f,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=tp(f))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=lp(r).nextSibling),gp(y[u],y[u]));if(g)for(u=0;u<g.length;u++)mp(g[u],g[++u],g[++u])}function ap(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?ap(r,t,n):sp(n,r,r,i,r.__e,t));return t}function sp(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function lp(e){var t,n,r;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])&&(r=lp(n)))return r;return null}function cp(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Kh.test(t)?n:n+"px"}function up(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||cp(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||cp(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?r||e.addEventListener(t,o?fp:dp,o):e.removeEventListener(t,o?fp:dp,o);else if("dangerouslySetInnerHTML"!==t){if(i)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 dp(e){return this.l[e.type+!1](jh.event?jh.event(e):e)}function fp(e){return this.l[e.type+!0](jh.event?jh.event(e):e)}function hp(e,t,n,r,i,o,a,s,l){var c,u,d,f,h,p,m,g,y,v,b,x,S,w,M,k=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=jh.__b)&&c(t);try{e:if("function"==typeof k){if(g=t.props,y=(c=k.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in k&&k.prototype.render?t.__c=u=new k(g,v):(t.__c=u=new ep(g,v),u.constructor=k,u.render=yp),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=k.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Gh({},u.__s)),Gh(u.__s,k.getDerivedStateFromProps(g,u.__s))),f=u.props,h=u.state,u.__v=t,d)null==k.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==k.getDerivedStateFromProps&&g!==f&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||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)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(f,h,p)})}if(u.context=v,u.props=g,u.__P=e,x=jh.__r,S=0,"prototype"in k&&k.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++S<25);u.state=u.__s,null!=u.getChildContext&&(r=Gh(Gh({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(f,h)),M=null!=c&&c.type===Qh&&null==c.key?c.props.children:c,op(e,Array.isArray(M)?M:[M],t,n,r,i,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=function(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,f=t.props,h=t.type,p=0;if("svg"===h&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),o=null,s=!1}if(null===h)d===f||s&&e.data===f||(e.data=f);else{if(o=o&&Fh.call(e.childNodes),c=(d=n.props||Uh).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<e.attributes.length;p++)d[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,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||up(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||up(e,o,t[o],n[o],r)}(e,f,d,i,s),u)t.__k=[];else if(p=t.props.children,op(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==h,o,a,o?o[0]:n.__k&&tp(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&Xh(o[p]);s||("value"in f&&void 0!==(p=f.value)&&(p!==e.value||"progress"===h&&!p||"option"===h&&p!==d.value)&&up(e,"value",p,d.value,!1),"checked"in f&&void 0!==(p=f.checked)&&p!==e.checked&&up(e,"checked",p,d.checked,!1))}return e}(n.__e,t,n,r,i,o,a,l);(c=jh.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),jh.__e(e,t,n)}}function pp(e,t){jh.__c&&jh.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){jh.__e(e,t.__v)}})}function mp(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){jh.__e(e,n)}}function gp(e,t,n){var r,i;if(jh.unmount&&jh.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||mp(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){jh.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&gp(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||Xh(e.__e),e.__=e.__e=e.__d=void 0}function yp(e,t,n){return this.constructor(e,n)}function vp(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createElement,t=void 0===e?document.createElement.bind(document):e;let n,r,i=th();const o={transform:void 0,disableScreenReader:!1},a=nh();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 e=t.horizontalScaling,r=t.horizontalSkewing,i=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?Jh("div",null,e):e,r=function(e,t,n){var r,i,o;jh.__&&jh.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],hp(t,e=(!r&&n||t).__k=Jh(Qh,null,[e]),i||Uh,Uh,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?Fh.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),pp(o,e)}(a,n,r),!0},a.renderArgs=[Jh],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=th(e)),i),a}Fh=Yh.slice,jh={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},Bh=0,ep.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Gh({},this.state),"function"==typeof e&&(e=e(Gh({},n),this.props)),e&&Gh(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),rp(this))},ep.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rp(this))},ep.prototype.render=Qh,Hh=[],$h="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Wh=function(e,t){return e.__v.__b-t.__v.__b},ip.__r=0;var bp=[function(e){e.renderer("svg",zh)},function(e){e.renderer("canvas",hh)},function(e){e.renderer("dom",vp)}];const xp={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const Sp=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.level,n=void 0===t?xp.OFF:t,r=e.pipe,i=void 0===r?console:r,o=n;const a={[xp.OFF]:()=>{},[xp.ERROR]:function(){return i.error(...arguments)},[xp.WARN]:function(){return i.warn(...arguments)},[xp.INFO]:function(){return i.info(...arguments)},[xp.DEBUG]:function(){return i.log(...arguments)}},s=function(e){if(e&&!(o<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(a[e]||a[xp.DEBUG])(...n)}};return{log:s,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(xp.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(xp.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(xp.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(xp.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:xp}}(t.logger),i={component:Ne(n.component,"component",r),data:Ne(n.data,"data",r),formatter:Ne(n.formatter,"formatter",r),interaction:Ne(n.interaction,"interaction",r),renderer:xs(n.renderer),scale:Ne(n.scale,"scale",r),symbol:Ne(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:u({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.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]:{},i)},o.chart=e=>bs(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach(e=>{o[e]=i[e]}),o.version=d,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:Ss,data:qs,formatter:nr,interaction:Es,renderer:xs(),scale:ro,symbol:ua});function wp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Mp(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 r=n.call(e,t);if("object"!=typeof r)return r;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 kp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kp(Object(n),!0).forEach(function(t){Mp(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qp(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 r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wp(e,t):void 0}}(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.")}()}Ld.forEach(Sp.use),bp.forEach(Sp.use),[].forEach(Sp.use);var Ep=Object.prototype.hasOwnProperty,Dp=Object.prototype.toString,Tp=Object.defineProperty,Op=Object.getOwnPropertyDescriptor,Np=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Dp.call(e)},Ap=function(e){if(!e||"[object Object]"!==Dp.call(e))return!1;var t,n=Ep.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Ep.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Ep.call(e,t)},_p=function(e,t){Tp&&"__proto__"===t.name?Tp(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ip=function(e,t){if("__proto__"===t){if(!Ep.call(e,t))return;if(Op)return Op(e,t).value}return e[t]},Lp=function e(){var t,n,r,i,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)r=Ip(s,n),s!==(i=Ip(t,n))&&(u&&i&&(Ap(i)||(o=Np(i)))?(o?(o=!1,a=r&&Np(r)?r:[]):a=r&&Ap(r)?r:{},_p(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&_p(s,{name:n,newValue:i}));return s};function Pp(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.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 Rp(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function zp(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,f=r;if(i.field&&i.field!==n){const e=Pp(i.field,o,{cache:t},d);if(-1===e)return;f=Lp({qRow:a},e(s))}c[u]=Rp(i,f,{key:l})}function Fp(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,f=Object.keys(u),h=!!i[e].trackBy,p=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=Pp(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[t].qMatrix.length;c++){const v=a.qDataPages[t].qArea.qTop+c,b=Lp({qRow:v},o(a.qDataPages[t].qMatrix[c])),x=Rp(d,b,{key:s});if(!(d.filter&&!d.filter(b))){for(let e=0;e<f.length;e++){const r=u[f[e]];let i=r.fields||[r];r.fields&&(x[f[e]]=[]);for(let o=0;o<i.length;o++)zp({cache:n,f:l,mainCell:b,p:i[o],prop:f[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[f[e]]:x,targetProp:r.fields?o:f[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[f[e]].map(e=>e.value),n=x[f[e]].map(e=>e.label);x[f[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[f[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:g,tracker:m,trackType:p}),y.push(x)}}}const v=h?r.collect(g,{main:d,propsArr:f,props:u}):y;o=[...o,...v]}return o}function jp(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function Bp(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Vp)):void 0===t&&(t=Hp);for(var n,r,i,o,a,s=new Up(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Up(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Wp)}function Hp(e){return e.children}function Vp(e){return Array.isArray(e)?e[1]:null}function $p(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Wp(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Up(e){this.data=e,this.depth=this.height=0,this.parent=null}function Yp(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Up.prototype=Bp.prototype={constructor:Up,count:function(){return this.eachAfter(jp)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].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(),r=t.ancestors(),i=null;e=n.pop(),t=r.pop();for(;e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},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 Bp(this).eachBefore($p)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var Kp={depth:-1},Gp={},Xp={};function Jp(e){return e.id}function Zp(e){return e.parentId}function Qp(){var e,t=Jp,n=Zp;function r(r){var i,o,a,s,l,c,u,d,f=Array.from(r),h=t,p=n,m=new Map;if(null!=e){const t=f.map((t,n)=>function(e){e=`${e}`;let t=e.length;tm(e,t-1)&&!tm(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(em),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(em(e)),f.push(Xp));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],c=f[a]=new Up(o),null!=(u=h(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?Gp:c)),null!=(u=p(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=f[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===Gp)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===Xp&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(c=f[e]).data===Xp;--e)c.data=null}if(s.parent=Kp,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(Wp),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=Yp(e),r):t},r.parentId=function(e){return arguments.length?(n=Yp(e),r):n},r.path=function(t){return arguments.length?(e=Yp(t),r):e},r}function em(e){let t=e.length;if(t<2)return"";for(;--t>1&&!tm(e,t););return e.slice(0,t)}function tm(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function nm(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=nm(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=nm(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function rm(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...rm(e[i].children,t-1,n)]);return r}function im(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 r=Math.max(0,Math.min(100,t-e));return e=>rm(e.children,r-1,n)}return!1}const om=/^qDimensionInfo(?:\/(\d+))?/,am=/^\/?qMeasureInfo\/(\d+)/,sm=/\/qAttrExprInfo\/(\d+)/,lm=/\/qAttrDimInfo\/(\d+)/;function cm(e){const t=e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t);return t.filter(t=>t<e.qDimensionInfo.length)}function um(e,t){let n=t.cube;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,h=cm(n);return om.test(d)&&(i=!0,o=+om.exec(d)[1],d=r.replace(om,"")),am.test(d)&&("K"===n.qMode?c=+am.exec(d)[1]:f&&-1!==f.indexOf(-1)?(c=+am.exec(d)[1],u=0):u=+am.exec(d)[1],d=d.replace(am,"")),d&&(lm.exec(d)?s=+lm.exec(d)[1]:sm.exec(d)&&(a=+sm.exec(d)[1])),l=i?"S"===n.qMode?h[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function dm(e,t){let n,r,i=im(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function fm(e,t,n){let r=n.key;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function hm(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey;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 d=l[n];let f,h,p,m,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(h=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(p=g.map(f),f=null),h&&(y=g.map(h),h=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=p)):(p=i,y=i)),s.fields){const e=f?f(p):p;c.push(e),u.push(h&&null!=y?h(y):null!=y?y:String(e))}else{const n=f?f(p):p;o[t[e]]={value:n,label:h?h(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const pm=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=nm(r,e);return o&&o[0]?(t.tree=Bp(o[0],n.children||(e=>e[i])),t.tree):null};const mm=e=>{let t=e.propsArr,n=e.props,r=e.cube;e.cache;let i=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const a=n[t[e]],s=a.fields?a.fields:[a];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==o){const e=dm(i,um(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function gm(){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,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.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),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Cp({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]),c=Qp().id(e=>e.__id).parentId(e=>e.__parent)(l);return c}(t):pm(i,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"===i.qMode){let e=cm(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const s=r.normalizeConfig(Cp(Cp({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const f=a?um(a,{cube:i}):{fieldDepth:0};mm({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:f,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,r=l[u[e].depth].main,i=c[e],a=i.data,s=fm(r,a,{key:o});hm({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function ym(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!pm(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),u=r.normalizeConfig(i[a],t),d=u.props,f=u.main,h=Object.keys(d),p=um(c,{cube:s}),m=dm({fieldDepth:0},p),g=m.nodeFn,y=m.attrFn,v=m.valueFn;mm({propsArr:h,props:d,cube:s,cache:n,itemDepthObject:p,f:c});const b=!!i[a].trackBy,x=typeof i[a].trackBy,S={},w=[],M=g(n.tree),k=[];for(let e=0;e<M.length;e++){const t=M[e],n=y?y(v(t)):v(t);if(f.filter&&!f.filter(n))continue;const o=fm(f,n,{key:l});hm({propsArr:h,props:d,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[a],itemData:n,obj:o,target:w,tracker:S,trackType:x}),k.push(o)}const C=b?r.collect(w,{main:f,propsArr:h,props:d}):k;o=[...o,...C]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var vm=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),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=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}});function bm(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const xm={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"},Sm=/%\)?$/,wm=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Mm=/^\(oct\)/i,km=/^\(dec\)/i,Cm=/^\(hex\)/i,qm=/^\(bin\)/i,Em=/^\(rom\)/i,Dm=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Tm=/#|0/g;function Om(e,t,n,r){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(".",r||".")}function Nm(e,t,n){let r;return wm.test(t)?e=Om(e,Number(/\d{2}/.exec(t)[0]),t,n):Mm.test(t)?e=Om(e,8,t,n):km.test(t)?e=Om(e,10,t,n):Cm.test(t)?e=Om(e,16,t,n):qm.test(t)?e=Om(e,2,t,n):Em.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/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(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function Am(e,t,n){const r=bm(e);return n?r:new RegExp(r||"",t)}function _m(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=bm(m)),p&&(p=bm(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(Am(c,"g"),t)),u=n,n=".",u&&(a=a.replace(Am(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(Tm)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=Sm.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Am(t,null,!0),"|").concat(Am(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class Im{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return xm;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 Im(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Dm.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Dm.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Dm.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||_m(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&_m(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&_m(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);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=Nm(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 r,i,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&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.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=vm(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(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(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=vm(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Lm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),f=0,h=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(f>=r&&(delete u[d[h]],delete d[h],f--,h++),u[e]=t,d[f]=e,f++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),f=0,h=0},l.size=()=>f,l}function Pm(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Im(...t)}(i,e,t,n,r),a=Lm(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const Rm="D",zm="T",Fm="TS",jm="IV",Bm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Hm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Vm=["January","February","March","April","May","June","July","August","September","October","November","December"],$m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Wm(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Um(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Ym(e,t){let n,r=function(e){const t=e,n=24*Um(t),r=60*Um(n),i=60*Um(r),o=1e3*Um(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.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*i),/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:i,h:o,m:a,s:s,f:l,t:u}}class Km{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Bm,qDayNames:Hm,qLongMonthNames:Vm,qMonthNames:$m}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[zm]:r.qTimeFmt||"hh:mm:ss",[Rm]:r.qDateFmt||"YYYY-MM-DD",[Fm]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Km(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 r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,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)),r=Ym(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Wm("".concat(t.year).slice(-2),2),YYY:Wm("".concat(t.year).slice(-3),3),def:e=>Wm("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Wm("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Wm("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Wm("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Wm("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Wm("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Wm("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<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,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return s}}function Gm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Km(...t)}function Xm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Gm(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Lm(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==jm?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=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Gm(i,e,t),r=Lm(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function Jm(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Xm(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Pm(n,r,i,o,t)}function Zm(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",f=Jm(n,o),h="dimension"===l?"first":(e,t)=>f(t),p={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(p)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:h,formatter:()=>f,tags:()=>n.qTags};return p}function Qm(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Zm(Lp({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=Qm("qAttrDimInfo",t,n,a,Lp({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Qm("qAttrExprInfo",t,n,a,Lp({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Qm("qMeasureInfo",t,n,a,Lp({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function eg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=eg.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=ym,l.hierarchy=gm,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=Fp,l.pages=a.qDataPages,l.hierarchy=gm):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...Qm("qDimensionInfo",a,t,"",Lp({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...Qm("qMeasureInfo",a,t,"",Lp({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const f=e=>{e.forEach(e=>{o.allFields.push(e.instance),f(e.measures),f(e.attrDims),f(e.attrExps)})};return f(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=Zm(Cp({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const tg=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ng=/\/qDimensionInfo(?:\/(\d+))?/,rg=/\/qMeasureInfo\/(\d+)/,ig=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,og=/\/qAttrExprInfo\/(\d+)/,ag=/\/?qHyperCube/,sg=/\/?qTreeData/,lg=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),cg=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function ug(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;ag.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=lg):sg.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=cg);let s=!0;if(ng.test(e)&&(r=+ng.exec(e)[1]),rg.test(e)&&(i=+rg.exec(e)[1]),ig.test(e)){i=-1,r=0;const e=+ig.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(og.test(e)){const e=i;if(t){i=0;const a=nm(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+og.exec(n)[1]}else r>-1?(r=-1,i=+og.exec(n)[1]):i+=+og.exec(n)[1]+1}return tg.forEach(e=>{let t=qp(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){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!==i&&(i||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 dg(e){eg.util=e.data("matrix").util,e.data("q",eg),e.formatter("q-number",Pm),e.formatter("q-time",Xm)}dg.qBrushHelper=ug,dg.selections=ug;const fg={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function hg(e){return fg[e]||e}function pg(e){return function(t,n,r){let i,o,a,s,l=[],c=!0;function u(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=hg(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(r),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])}),l.push(t))}),i.gestures.forEach(t=>{const n=hg(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),c&&u()},off(){c=!1,d()},on(){c=!0,0===l.length&&u()},destroy(){d(),a&&a.destroy(),a=null,o=null,i=null}}}}function mg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gg(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var yg,vg={exports:{}};
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),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=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}});function bm(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const xm={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"},Sm=/%\)?$/,wm=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Mm=/^\(oct\)/i,km=/^\(dec\)/i,Cm=/^\(hex\)/i,qm=/^\(bin\)/i,Em=/^\(rom\)/i,Dm=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Tm=/#|0/g;function Om(e,t,n,r){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(".",r||".")}function Nm(e,t,n){let r;return wm.test(t)?e=Om(e,Number(/\d{2}/.exec(t)[0]),t,n):Mm.test(t)?e=Om(e,8,t,n):km.test(t)?e=Om(e,10,t,n):Cm.test(t)?e=Om(e,16,t,n):qm.test(t)?e=Om(e,2,t,n):Em.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/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(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function Am(e,t,n){const r=bm(e);return n?r:new RegExp(r||"",t)}function _m(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=bm(m)),p&&(p=bm(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(Am(c,"g"),t)),u=n,n=".",u&&(a=a.replace(Am(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(Tm)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=Sm.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Am(t,null,!0),"|").concat(Am(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class Im{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return xm;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 Im(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;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:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Dm.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Dm.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Dm.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||_m(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&_m(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&_m(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);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=Nm(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 r,i,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&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.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=vm(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(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(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=vm(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Lm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),f=0,h=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(f>=r&&(delete u[d[h]],delete d[h],f--,h++),u[e]=t,d[f]=e,f++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),f=0,h=0},l.size=()=>f,l}function Pm(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Im(...t)}(i,e,t,n,r),a=Lm(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const Rm="D",zm="T",Fm="TS",jm="IV",Bm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Hm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Vm=["January","February","March","April","May","June","July","August","September","October","November","December"],$m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Wm(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Um(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Ym(e,t){let n,r=function(e){const t=e,n=24*Um(t),r=60*Um(n),i=60*Um(r),o=1e3*Um(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.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*i),/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:i,h:o,m:a,s:s,f:l,t:u}}class Km{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Bm,qDayNames:Hm,qLongMonthNames:Vm,qMonthNames:$m}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),!t){t={[zm]:r.qTimeFmt||"hh:mm:ss",[Rm]:r.qDateFmt||"YYYY-MM-DD",[Fm]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new Km(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 r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,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)),r=Ym(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Wm("".concat(t.year).slice(-2),2),YYY:Wm("".concat(t.year).slice(-3),3),def:e=>Wm("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Wm("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Wm("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Wm("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Wm("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Wm("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Wm("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<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,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g"),s=t.replace(a,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r});return s}}function Gm(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Km(...t)}function Xm(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Gm(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Lm(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==jm?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=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Gm(i,e,t),r=Lm(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function Jm(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Xm(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Pm(n,r,i,o,t)}function Zm(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",f=Jm(n,o),h="dimension"===l?"first":(e,t)=>f(t),p={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(p)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:h,formatter:()=>f,tags:()=>n.qTags};return p}function Qm(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Zm(Lp({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=Qm("qAttrDimInfo",t,n,a,Lp({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Qm("qAttrExprInfo",t,n,a,Lp({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Qm("qMeasureInfo",t,n,a,Lp({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function eg(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=eg.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=ym,l.hierarchy=gm,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=Fp,l.pages=a.qDataPages,l.hierarchy=gm):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...Qm("qDimensionInfo",a,t,"",Lp({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...Qm("qMeasureInfo",a,t,"",Lp({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const f=e=>{e.forEach(e=>{o.allFields.push(e.instance),f(e.measures),f(e.attrDims),f(e.attrExps)})};return f(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=Zm(Cp({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const tg=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ng=/\/qDimensionInfo(?:\/(\d+))?/,rg=/\/qMeasureInfo\/(\d+)/,ig=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,og=/\/qAttrExprInfo\/(\d+)/,ag=/\/?qHyperCube/,sg=/\/?qTreeData/,lg=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),cg=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function ug(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;ag.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=lg):sg.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=cg);let s=!0;if(ng.test(e)&&(r=+ng.exec(e)[1]),rg.test(e)&&(i=+rg.exec(e)[1]),ig.test(e)){i=-1,r=0;const e=+ig.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(og.test(e)){const e=i;if(t){i=0;const a=nm(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+og.exec(n)[1]}else r>-1?(r=-1,i=+og.exec(n)[1]):i+=+og.exec(n)[1]+1}return tg.forEach(e=>{let t=qp(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,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(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){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!==i&&(i||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 dg(e){eg.util=e.data("matrix").util,e.data("q",eg),e.formatter("q-number",Pm),e.formatter("q-time",Xm)}dg.qBrushHelper=ug,dg.selections=ug;const fg={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function hg(e){return fg[e]||e}function pg(e){return function(t,n,r){let i,o,a,s,l=[],c=!0;function u(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=hg(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(r),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])}),l.push(t))}),i.gestures.forEach(t=>{const n=hg(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),c&&u()},off(){c=!1,d()},on(){c=!0,0===l.length&&u()},destroy(){d(),a&&a.destroy(),a=null,o=null,i=null}}}}function mg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gg(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch(e){}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var yg,vg={exports:{}};
10
10
  /*! Hammer.JS - v2.0.7 - 2016-04-22
11
11
  * http://hammerjs.github.io/
12
12
  *
@@ -106,4 +106,4 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.le
106
106
  }
107
107
  `),Cj.rippleVisible,Aj,550,({theme:e})=>e.transitions.easing.easeInOut,Cj.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Cj.child,Cj.childLeaving,_j,550,({theme:e})=>e.transitions.easing.easeInOut,Cj.childPulsate,Ij,({theme:e})=>e.transitions.easing.easeInOut),Rj=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:o}=n,a=dI(n,qj),[s,l]=k_.useState([]),c=k_.useRef(0),u=k_.useRef(null);k_.useEffect(()=>{u.current&&(u.current(),u.current=null)},[s]);const d=k_.useRef(!1),f=pz(),h=k_.useRef(null),p=k_.useRef(null),m=k_.useCallback(e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;l(e=>[...e,uP.jsx(Pj,{classes:{ripple:RR(i.ripple,Cj.ripple),rippleVisible:RR(i.rippleVisible,Cj.rippleVisible),ripplePulsate:RR(i.ripplePulsate,Cj.ripplePulsate),child:RR(i.child,Cj.child),childLeaving:RR(i.childLeaving,Cj.childLeaving),childPulsate:RR(i.childPulsate,Cj.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},c.current)]),c.current+=1,u.current=a},[i]),g=k_.useCallback((e={},t={},n=()=>{})=>{const{pulsate:i=!1,center:o=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&d.current)return void(d.current=!1);"touchstart"===(null==e?void 0:e.type)&&(d.current=!0);const s=a?null:p.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,g;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(o)g=Math.sqrt((2*l.width**2+l.height**2)/3),g%2==0&&(g+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;g=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===h.current&&(h.current=()=>{m({pulsate:i,rippleX:c,rippleY:u,rippleSize:g,cb:n})},f.start(80,()=>{h.current&&(h.current(),h.current=null)})):m({pulsate:i,rippleX:c,rippleY:u,rippleSize:g,cb:n})},[r,m,f]),y=k_.useCallback(()=>{g({},{pulsate:!0})},[g]),v=k_.useCallback((e,t)=>{if(f.clear(),"touchend"===(null==e?void 0:e.type)&&h.current)return h.current(),h.current=null,void f.start(0,()=>{v(e,t)});h.current=null,l(e=>e.length>0?e.slice(1):e),u.current=t},[f]);return k_.useImperativeHandle(t,()=>({pulsate:y,start:g,stop:v}),[y,g,v]),uP.jsx(Lj,uI({className:RR(Cj.root,i.root,o),ref:p},a,{children:uP.jsx(vj,{component:null,exit:!0,children:s})}))});function zj(e){return FR("MuiButtonBase",e)}const Fj=jR("MuiButtonBase",["root","disabled","focusVisible"]),jj=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Bj=PF("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Fj.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Hj=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:o,className:a,component:s="button",disabled:l=!1,disableRipple:c=!1,disableTouchRipple:u=!1,focusRipple:d=!1,LinkComponent:f="a",onBlur:h,onClick:p,onContextMenu:m,onDragLeave:g,onFocus:y,onFocusVisible:v,onKeyDown:b,onKeyUp:x,onMouseDown:S,onMouseLeave:w,onMouseUp:M,onTouchEnd:k,onTouchMove:C,onTouchStart:q,tabIndex:E=0,TouchRippleProps:D,touchRippleRef:T,type:O}=n,N=dI(n,jj),A=k_.useRef(null),_=k_.useRef(null),I=uz(_,T),{isFocusVisibleRef:L,onFocus:P,onBlur:R,ref:z}=Mz(),[F,j]=k_.useState(!1);l&&F&&j(!1),k_.useImperativeHandle(r,()=>({focusVisible:()=>{j(!0),A.current.focus()}}),[]);const[B,H]=k_.useState(!1);k_.useEffect(()=>{H(!0)},[]);const V=B&&!c&&!l;function $(e,t,n=u){return cz(r=>{t&&t(r);return!n&&_.current&&_.current[e](r),!0})}k_.useEffect(()=>{F&&d&&!c&&B&&_.current.pulsate()},[c,d,F,B]);const W=$("start",S),U=$("stop",m),Y=$("stop",g),K=$("stop",M),G=$("stop",e=>{F&&e.preventDefault(),w&&w(e)}),X=$("start",q),J=$("stop",k),Z=$("stop",C),Q=$("stop",e=>{R(e),!1===L.current&&j(!1),h&&h(e)},!1),ee=cz(e=>{A.current||(A.current=e.currentTarget),P(e),!0===L.current&&(j(!0),v&&v(e)),y&&y(e)}),te=()=>{const e=A.current;return s&&"button"!==s&&!("A"===e.tagName&&e.href)},ne=k_.useRef(!1),re=cz(e=>{d&&!ne.current&&F&&_.current&&" "===e.key&&(ne.current=!0,_.current.stop(e,()=>{_.current.start(e)})),e.target===e.currentTarget&&te()&&" "===e.key&&e.preventDefault(),b&&b(e),e.target===e.currentTarget&&te()&&"Enter"===e.key&&!l&&(e.preventDefault(),p&&p(e))}),ie=cz(e=>{d&&" "===e.key&&_.current&&F&&!e.defaultPrevented&&(ne.current=!1,_.current.stop(e,()=>{_.current.pulsate(e)})),x&&x(e),p&&e.target===e.currentTarget&&te()&&" "===e.key&&!e.defaultPrevented&&p(e)});let oe=s;"button"===oe&&(N.href||N.to)&&(oe=f);const ae={};"button"===oe?(ae.type=void 0===O?"button":O,ae.disabled=l):(N.href||N.to||(ae.role="button"),l&&(ae["aria-disabled"]=l));const se=uz(t,z,A),le=uI({},n,{centerRipple:i,component:s,disabled:l,disableRipple:c,disableTouchRipple:u,focusRipple:d,tabIndex:E,focusVisible:F}),ce=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=kz({root:["root",t&&"disabled",n&&"focusVisible"]},zj,i);return n&&r&&(o.root+=` ${r}`),o})(le);return uP.jsxs(Bj,uI({as:oe,className:RR(ce.root,a),ownerState:le,onBlur:Q,onClick:p,onContextMenu:U,onFocus:ee,onKeyDown:re,onKeyUp:ie,onMouseDown:W,onMouseLeave:G,onMouseUp:K,onDragLeave:Y,onTouchEnd:J,onTouchMove:Z,onTouchStart:X,ref:se,tabIndex:l?-1:E,type:O},ae,N,{children:[o,V?uP.jsx(Rj,uI({ref:I,center:i},D)):null]}))});function Vj(e){return FR("MuiTypography",e)}jR("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const $j=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],Wj=PF("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${DP(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>uI({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),Uj={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Yj={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Kj=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiTypography"}),r=(e=>Yj[e]||e)(n.color),i=AR(uI({},n,{color:r})),{align:o="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:c=!1,paragraph:u=!1,variant:d="body1",variantMapping:f=Uj}=i,h=dI(i,$j),p=uI({},i,{align:o,color:r,className:a,component:s,gutterBottom:l,noWrap:c,paragraph:u,variant:d,variantMapping:f}),m=s||(u?"p":f[d]||Uj[d])||"span",g=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=e;return kz({root:["root",o,"inherit"!==e.align&&`align${DP(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]},Vj,a)})(p);return uP.jsx(Wj,uI({as:m,ref:t,ownerState:p,className:RR(g.root,a)},h))});const Gj=k_.forwardRef(function(e,t){const{children:n,container:r,disablePortal:i=!1}=e,[o,a]=k_.useState(null),s=uz(k_.isValidElement(n)?Oz(n):null,t);if(ez(()=>{i||a(function(e){return"function"==typeof e?e():e}(r)||document.body)},[r,i]),ez(()=>{if(o&&!i)return oz(t,o),()=>{oz(t,null)}},[t,o,i]),i){if(k_.isValidElement(n)){const e={ref:s};return k_.cloneElement(n,e)}return uP.jsx(k_.Fragment,{children:n})}return uP.jsx(k_.Fragment,{children:o?rj.createPortal(n,o):o})}),Xj=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],Jj={entering:{opacity:1},entered:{opacity:1}},Zj=k_.forwardRef(function(e,t){const n=SF(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:o=!0,children:a,easing:s,in:l,onEnter:c,onEntered:u,onEntering:d,onExit:f,onExited:h,onExiting:p,style:m,timeout:g=r,TransitionComponent:y=fj}=e,v=dI(e,Xj),b=k_.useRef(null),x=uz(b,Oz(a),t),S=e=>t=>{if(e){const n=b.current;void 0===t?e(n):e(n,t)}},w=S(d),M=S((e,t)=>{bj(e);const r=xj({style:m,timeout:g,easing:s},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),c&&c(e,t)}),k=S(u),C=S(p),q=S(e=>{const t=xj({style:m,timeout:g,easing:s},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),f&&f(e)}),E=S(h);return uP.jsx(y,uI({appear:o,in:l,nodeRef:b,onEnter:M,onEntered:k,onEntering:w,onExit:q,onExited:E,onExiting:C,addEndListener:e=>{i&&i(b.current,e)},timeout:g},v,{children:(e,t)=>k_.cloneElement(a,uI({style:uI({opacity:0,visibility:"exited"!==e||l?void 0:"hidden"},Jj[e],m,a.props.style),ref:x},t))}))});function Qj(e){return FR("MuiBackdrop",e)}jR("MuiBackdrop",["root","invisible"]);const eB=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],tB=PF("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>uI({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),nB=k_.forwardRef(function(e,t){var n,r,i;const o=jF({props:e,name:"MuiBackdrop"}),{children:a,className:s,component:l="div",components:c={},componentsProps:u={},invisible:d=!1,open:f,slotProps:h={},slots:p={},TransitionComponent:m=Zj,transitionDuration:g}=o,y=dI(o,eB),v=uI({},o,{component:l,invisible:d}),b=(e=>{const{classes:t,invisible:n}=e;return kz({root:["root",n&&"invisible"]},Qj,t)})(v),x=null!=(n=h.root)?n:u.root;return uP.jsx(m,uI({in:f,timeout:g},y,{children:uP.jsx(tB,uI({"aria-hidden":!0},x,{as:null!=(r=null!=(i=p.root)?i:c.Root)?r:l,className:RR(b.root,s,null==x?void 0:x.className),ownerState:uI({},v,null==x?void 0:x.ownerState),classes:b,ref:t,children:a}))}))});function rB(e){return FR("MuiButton",e)}const iB=jR("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),oB=k_.createContext({}),aB=k_.createContext(void 0),sB=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],lB=e=>uI({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),cB=PF(Hj,{shouldForwardProp:e=>LF(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${DP(n.color)}`],t[`size${DP(n.size)}`],t[`${n.variant}Size${DP(n.size)}`],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const i="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],o="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return uI({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":uI({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Zz.alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===t.variant&&"inherit"!==t.color&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Zz.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===t.variant&&"inherit"!==t.color&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Zz.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===t.variant&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},"contained"===t.variant&&"inherit"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":uI({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${iB.focusVisible}`]:uI({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${iB.disabled}`]:uI({color:(e.vars||e).palette.action.disabled},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"contained"===t.variant&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},"text"===t.variant&&{padding:"6px 8px"},"text"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main},"outlined"===t.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${Zz.alpha(e.palette[t.color].main,.5)}`},"contained"===t.variant&&{color:e.vars?e.vars.palette.text.primary:null==(n=(r=e.palette).getContrastText)?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:i,boxShadow:(e.vars||e).shadows[2]},"contained"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},"inherit"===t.color&&{color:"inherit",borderColor:"currentColor"},"small"===t.size&&"text"===t.variant&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"text"===t.variant&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"outlined"===t.variant&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"outlined"===t.variant&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"contained"===t.variant&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"contained"===t.variant&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${iB.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${iB.disabled}`]:{boxShadow:"none"}}),uB=PF("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${DP(n.size)}`]]}})(({ownerState:e})=>uI({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},lB(e))),dB=PF("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${DP(n.size)}`]]}})(({ownerState:e})=>uI({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},lB(e))),fB=k_.forwardRef(function(e,t){const n=k_.useContext(oB),r=k_.useContext(aB),i=jF({props:QR(n,e),name:"MuiButton"}),{children:o,color:a="primary",component:s="button",className:l,disabled:c=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:h,fullWidth:p=!1,size:m="medium",startIcon:g,type:y,variant:v="text"}=i,b=dI(i,sB),x=uI({},i,{color:a,component:s,disabled:c,disableElevation:u,disableFocusRipple:d,fullWidth:p,size:m,type:y,variant:v}),S=(e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=e;return uI({},a,kz({root:["root",o,`${o}${DP(t)}`,`size${DP(i)}`,`${o}Size${DP(i)}`,`color${DP(t)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${DP(i)}`],endIcon:["icon","endIcon",`iconSize${DP(i)}`]},rB,a))})(x),w=g&&uP.jsx(uB,{className:S.startIcon,ownerState:x,children:g}),M=f&&uP.jsx(dB,{className:S.endIcon,ownerState:x,children:f}),k=r||"";return uP.jsxs(cB,uI({ownerState:x,className:RR(n.className,S.root,l,k),component:s,disabled:c,focusRipple:!d,focusVisibleClassName:RR(S.focusVisible,h),ref:t,type:y},b,{classes:S,children:[w,o,M]}))});function hB(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function pB(e){return parseInt(iz(e).getComputedStyle(e).paddingRight,10)||0}function mB(e,t,n,r,i){const o=[t,n,...r];[].forEach.call(e.children,e=>{const t=-1===o.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&hB(e,i)})}function gB(e,t){let n=-1;return e.some((e,r)=>!!t(e)&&(n=r,!0)),n}function yB(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(function(e){const t=rz(e);return t.body===e?iz(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){const e=function(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}(rz(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${pB(r)+e}px`;const t=rz(r).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${pB(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=rz(r).body;else{const t=r.parentElement,n=iz(r);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}const vB=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function bB(e){const t=[],n=[];return Array.from(e.querySelectorAll(vB)).forEach((e,r)=>{const i=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==i&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e))}(e)&&(0===i?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function xB(){return!0}function SB(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=bB,isEnabled:a=xB,open:s}=e,l=k_.useRef(!1),c=k_.useRef(null),u=k_.useRef(null),d=k_.useRef(null),f=k_.useRef(null),h=k_.useRef(!1),p=k_.useRef(null),m=uz(Oz(t),p),g=k_.useRef(null);k_.useEffect(()=>{s&&p.current&&(h.current=!n)},[n,s]),k_.useEffect(()=>{if(!s||!p.current)return;const e=rz(p.current);return p.current.contains(e.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),k_.useEffect(()=>{if(!s||!p.current)return;const e=rz(p.current),t=t=>{g.current=t,!r&&a()&&"Tab"===t.key&&e.activeElement===p.current&&t.shiftKey&&(l.current=!0,u.current&&u.current.focus())},n=()=>{const t=p.current;if(null===t)return;if(!e.hasFocus()||!a()||l.current)return void(l.current=!1);if(t.contains(e.activeElement))return;if(r&&e.activeElement!==c.current&&e.activeElement!==u.current)return;if(e.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!h.current)return;let n=[];if(e.activeElement!==c.current&&e.activeElement!==u.current||(n=o(p.current)),n.length>0){var i,s;const e=Boolean((null==(i=g.current)?void 0:i.shiftKey)&&"Tab"===(null==(s=g.current)?void 0:s.key)),t=n[0],r=n[n.length-1];"string"!=typeof t&&"string"!=typeof r&&(e?r.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);const i=setInterval(()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()},50);return()=>{clearInterval(i),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}},[n,r,i,a,s,o]);const y=e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0};return uP.jsxs(k_.Fragment,{children:[uP.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),k_.cloneElement(t,{ref:m,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0,f.current=e.target;const n=t.props.onFocus;n&&n(e)}}),uP.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}const wB=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&hB(e.modalRef,!1);const r=function(e){const t=[];return[].forEach.call(e.children,e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)}),t}(t);mB(t,e.mount,e.modalRef,r,!0);const i=gB(this.containers,e=>e.container===t);return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}mount(e,t){const n=gB(this.containers,t=>-1!==t.modals.indexOf(e)),r=this.containers[n];r.restore||(r.restore=yB(r,t))}remove(e,t=!0){const n=this.modals.indexOf(e);if(-1===n)return n;const r=gB(this.containers,t=>-1!==t.modals.indexOf(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&hB(e.modalRef,t),mB(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{const e=i.modals[i.modals.length-1];e.modalRef&&hB(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function MB(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=wB,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:d}=e,f=k_.useRef({}),h=k_.useRef(null),p=k_.useRef(null),m=uz(p,d),[g,y]=k_.useState(!u),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let b=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(b=!1);const x=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),S=()=>{i.mount(x(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},w=cz(()=>{const e=function(e){return"function"==typeof e?e():e}(t)||rz(h.current).body;i.add(x(),e),p.current&&S()}),M=k_.useCallback(()=>i.isTopModal(x()),[i]),k=cz(e=>{h.current=e,e&&(u&&M()?S():p.current&&hB(p.current,b))}),C=k_.useCallback(()=>{i.remove(x(),b)},[b,i]);k_.useEffect(()=>()=>{C()},[C]),k_.useEffect(()=>{u?w():v&&o||C()},[u,C,v,o,w]);const q=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),"Escape"===t.key&&229!==t.which&&M()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},E=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:(t={})=>{const n=qz(e);delete n.onTransitionEnter,delete n.onTransitionExited;const r=uI({},n,t);return uI({role:"presentation"},r,{onKeyDown:q(r),ref:m})},getBackdropProps:(e={})=>uI({"aria-hidden":!0},e,{onClick:E(e),open:u}),getTransitionProps:()=>({onEnter:nz(()=>{y(!1),a&&a()},null==l?void 0:l.props.onEnter),onExited:nz(()=>{y(!0),s&&s(),o&&C()},null==l?void 0:l.props.onExited)}),rootRef:m,portalRef:k,isTopModal:M,exited:g,hasTransition:v}}function kB(e){return FR("MuiModal",e)}jR("MuiModal",["root","hidden","backdrop"]);const CB=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],qB=PF("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>uI({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),EB=PF(nB,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),DB=k_.forwardRef(function(e,t){var n,r,i,o,a,s;const l=jF({name:"MuiModal",props:e}),{BackdropComponent:c=EB,BackdropProps:u,className:d,closeAfterTransition:f=!1,children:h,container:p,component:m,components:g={},componentsProps:y={},disableAutoFocus:v=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:w=!1,disableScrollLock:M=!1,hideBackdrop:k=!1,keepMounted:C=!1,onBackdropClick:q,open:E,slotProps:D,slots:T}=l,O=dI(l,CB),N=uI({},l,{closeAfterTransition:f,disableAutoFocus:v,disableEnforceFocus:b,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:w,disableScrollLock:M,hideBackdrop:k,keepMounted:C}),{getRootProps:A,getBackdropProps:_,getTransitionProps:I,portalRef:L,isTopModal:P,exited:R,hasTransition:z}=MB(uI({},N,{rootRef:t})),F=uI({},N,{exited:R}),j=(e=>{const{open:t,exited:n,classes:r}=e;return kz({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},kB,r)})(F),B={};if(void 0===h.props.tabIndex&&(B.tabIndex="-1"),z){const{onEnter:e,onExited:t}=I();B.onEnter=e,B.onExited=t}const H=null!=(n=null!=(r=null==T?void 0:T.root)?r:g.Root)?n:qB,V=null!=(i=null!=(o=null==T?void 0:T.backdrop)?o:g.Backdrop)?i:c,$=null!=(a=null==D?void 0:D.root)?a:y.root,W=null!=(s=null==D?void 0:D.backdrop)?s:y.backdrop,U=Tz({elementType:H,externalSlotProps:$,externalForwardedProps:O,getSlotProps:A,additionalProps:{ref:t,as:m},ownerState:F,className:RR(d,null==$?void 0:$.className,null==j?void 0:j.root,!F.open&&F.exited&&(null==j?void 0:j.hidden))}),Y=Tz({elementType:V,externalSlotProps:W,additionalProps:u,getSlotProps:e=>_(uI({},e,{onClick:t=>{q&&q(t),null!=e&&e.onClick&&e.onClick(t)}})),className:RR(null==W?void 0:W.className,null==u?void 0:u.className,null==j?void 0:j.backdrop),ownerState:F});return C||E||z&&!R?uP.jsx(Gj,{ref:L,container:p,disablePortal:S,children:uP.jsxs(H,uI({},U,{children:[!k&&c?uP.jsx(V,uI({},Y)):null,uP.jsx(SB,{disableEnforceFocus:b,disableAutoFocus:v,disableRestoreFocus:w,isEnabled:P,open:E,children:k_.cloneElement(h,B)})]}))}):null});function TB(e){return FR("MuiDivider",e)}jR("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const OB=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],NB=PF("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>uI({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:Zz.alpha(e.palette.divider,.08)},"inset"===t.variant&&{marginLeft:72},"middle"===t.variant&&"horizontal"===t.orientation&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},"middle"===t.variant&&"vertical"===t.orientation&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},"vertical"===t.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>uI({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>uI({},t.children&&"vertical"!==t.orientation&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}),({theme:e,ownerState:t})=>uI({},t.children&&"vertical"===t.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:e})=>uI({},"right"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),AB=PF("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>uI({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},"vertical"===t.orientation&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),_B=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiDivider"}),{absolute:r=!1,children:i,className:o,component:a=(i?"div":"hr"),flexItem:s=!1,light:l=!1,orientation:c="horizontal",role:u=("hr"!==a?"separator":void 0),textAlign:d="center",variant:f="fullWidth"}=n,h=dI(n,OB),p=uI({},n,{absolute:r,component:a,flexItem:s,light:l,orientation:c,role:u,textAlign:d,variant:f}),m=(e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=e;return kz({root:["root",t&&"absolute",l,o&&"light","vertical"===a&&"vertical",i&&"flexItem",n&&"withChildren",n&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},TB,r)})(p);return uP.jsx(NB,uI({as:a,className:RR(m.root,o),role:u,ref:t,ownerState:p},h,{children:i?uP.jsx(AB,{className:m.wrapper,ownerState:p,children:i}):null}))});_B.muiSkipListHighlight=!0;const IB=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function LB(e){return`scale(${e}, ${e**2})`}const PB={entering:{opacity:1,transform:LB(1)},entered:{opacity:1,transform:"none"}},RB="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),zB=k_.forwardRef(function(e,t){const{addEndListener:n,appear:r=!0,children:i,easing:o,in:a,onEnter:s,onEntered:l,onEntering:c,onExit:u,onExited:d,onExiting:f,style:h,timeout:p="auto",TransitionComponent:m=fj}=e,g=dI(e,IB),y=pz(),v=k_.useRef(),b=SF(),x=k_.useRef(null),S=uz(x,Oz(i),t),w=e=>t=>{if(e){const n=x.current;void 0===t?e(n):e(n,t)}},M=w(c),k=w((e,t)=>{bj(e);const{duration:n,delay:r,easing:i}=xj({style:h,timeout:p,easing:o},{mode:"enter"});let a;"auto"===p?(a=b.transitions.getAutoHeightDuration(e.clientHeight),v.current=a):a=n,e.style.transition=[b.transitions.create("opacity",{duration:a,delay:r}),b.transitions.create("transform",{duration:RB?a:.666*a,delay:r,easing:i})].join(","),s&&s(e,t)}),C=w(l),q=w(f),E=w(e=>{const{duration:t,delay:n,easing:r}=xj({style:h,timeout:p,easing:o},{mode:"exit"});let i;"auto"===p?(i=b.transitions.getAutoHeightDuration(e.clientHeight),v.current=i):i=t,e.style.transition=[b.transitions.create("opacity",{duration:i,delay:n}),b.transitions.create("transform",{duration:RB?i:.666*i,delay:RB?n:n||.333*i,easing:r})].join(","),e.style.opacity=0,e.style.transform=LB(.75),u&&u(e)}),D=w(d);return uP.jsx(m,uI({appear:r,in:a,nodeRef:x,onEnter:k,onEntered:C,onEntering:M,onExit:E,onExited:D,onExiting:q,addEndListener:e=>{"auto"===p&&y.start(v.current||0,e),n&&n(x.current,e)},timeout:"auto"===p?null:p},g,{children:(e,t)=>k_.cloneElement(i,uI({style:uI({opacity:0,transform:LB(.75),visibility:"exited"!==e||a?void 0:"hidden"},PB[e],h,i.props.style),ref:S},t))}))});zB.muiSupportAuto=!0;const FB=k_.createContext({});function jB(e){return FR("MuiList",e)}jR("MuiList",["root","padding","dense","subheader"]);const BB=["children","className","component","dense","disablePadding","subheader"],HB=PF("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>uI({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),VB=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiList"}),{children:r,className:i,component:o="ul",dense:a=!1,disablePadding:s=!1,subheader:l}=n,c=dI(n,BB),u=k_.useMemo(()=>({dense:a}),[a]),d=uI({},n,{component:o,dense:a,disablePadding:s}),f=(e=>{const{classes:t,disablePadding:n,dense:r,subheader:i}=e;return kz({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},jB,t)})(d);return uP.jsx(FB.Provider,{value:u,children:uP.jsxs(HB,uI({as:o,className:RR(f.root,i),ref:t,ownerState:d},c,{children:[l,r]}))})});function $B(e){return FR("MuiListItemButton",e)}const WB=jR("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),UB=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],YB=PF(Hj,{shouldForwardProp:e=>LF(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})(({theme:e,ownerState:t})=>uI({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${WB.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Zz.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${WB.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Zz.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${WB.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Zz.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Zz.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${WB.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${WB.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},"flex-start"===t.alignItems&&{alignItems:"flex-start"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.dense&&{paddingTop:4,paddingBottom:4})),KB=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiListItemButton"}),{alignItems:r="center",autoFocus:i=!1,component:o="div",children:a,dense:s=!1,disableGutters:l=!1,divider:c=!1,focusVisibleClassName:u,selected:d=!1,className:f}=n,h=dI(n,UB),p=k_.useContext(FB),m=k_.useMemo(()=>({dense:s||p.dense||!1,alignItems:r,disableGutters:l}),[r,p.dense,s,l]),g=k_.useRef(null);ez(()=>{i&&g.current&&g.current.focus()},[i]);const y=uI({},n,{alignItems:r,dense:m.dense,disableGutters:l,divider:c,selected:d}),v=(e=>{const{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=e;return uI({},n,kz({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},$B,n))})(y),b=uz(g,t);return uP.jsx(FB.Provider,{value:m,children:uP.jsx(YB,uI({ref:b,href:h.href||h.to,component:(h.href||h.to)&&"div"===o?"button":o,focusVisibleClassName:RR(v.focusVisible,u),ownerState:y,className:RR(v.root,f)},h,{classes:v,children:a}))})});function GB(e){return FR("MuiListItemIcon",e)}jR("MuiListItemIcon",["root","alignItemsFlexStart"]);const XB=["className"],JB=PF("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"flex-start"===n.alignItems&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>uI({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},"flex-start"===t.alignItems&&{marginTop:8})),ZB=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiListItemIcon"}),{className:r}=n,i=dI(n,XB),o=uI({},n,{alignItems:k_.useContext(FB).alignItems}),a=(e=>{const{alignItems:t,classes:n}=e;return kz({root:["root","flex-start"===t&&"alignItemsFlexStart"]},GB,n)})(o);return uP.jsx(JB,uI({className:RR(a.root,r),ownerState:o,ref:t},i))});function QB(e){return FR("MuiListItemText",e)}const eH=jR("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),tH=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],nH=PF("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${eH.primary}`]:t.primary},{[`& .${eH.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})(({ownerState:e})=>uI({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),rH=k_.forwardRef(function(e,t){const n=jF({props:e,name:"MuiListItemText"}),{children:r,className:i,disableTypography:o=!1,inset:a=!1,primary:s,primaryTypographyProps:l,secondary:c,secondaryTypographyProps:u}=n,d=dI(n,tH),{dense:f}=k_.useContext(FB);let h=null!=s?s:r,p=c;const m=uI({},n,{disableTypography:o,inset:a,primary:!!h,secondary:!!p,dense:f}),g=(e=>{const{classes:t,inset:n,primary:r,secondary:i,dense:o}=e;return kz({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},QB,t)})(m);return null==h||h.type===Kj||o||(h=uP.jsx(Kj,uI({variant:f?"body2":"body1",className:g.primary,component:null!=l&&l.variant?void 0:"span",display:"block"},l,{children:h}))),null==p||p.type===Kj||o||(p=uP.jsx(Kj,uI({variant:"body2",className:g.secondary,color:"text.secondary",display:"block"},u,{children:p}))),uP.jsxs(nH,uI({className:RR(g.root,i),ownerState:m,ref:t},d,{children:[h,p]}))});function iH(e){return FR("MuiPopover",e)}jR("MuiPopover",["root","paper"]);const oH=["onEntering"],aH=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],sH=["slotProps"];function lH(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function cH(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function uH(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?`${e}px`:e).join(" ")}function dH(e){return"function"==typeof e?e():e}const fH=PF(DB,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),hH=PF(kj,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),pH=k_.forwardRef(function(e,t){var n,r,i;const o=jF({props:e,name:"MuiPopover"}),{action:a,anchorEl:s,anchorOrigin:l={vertical:"top",horizontal:"left"},anchorPosition:c,anchorReference:u="anchorEl",children:d,className:f,container:h,elevation:p=8,marginThreshold:m=16,open:g,PaperProps:y={},slots:v,slotProps:b,transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:S=zB,transitionDuration:w="auto",TransitionProps:{onEntering:M}={},disableScrollLock:k=!1}=o,C=dI(o.TransitionProps,oH),q=dI(o,aH),E=null!=(n=null==b?void 0:b.paper)?n:y,D=k_.useRef(),T=uz(D,E.ref),O=uI({},o,{anchorOrigin:l,anchorReference:u,elevation:p,marginThreshold:m,externalPaperSlotProps:E,transformOrigin:x,TransitionComponent:S,transitionDuration:w,TransitionProps:C}),N=(e=>{const{classes:t}=e;return kz({root:["root"],paper:["paper"]},iH,t)})(O),A=k_.useCallback(()=>{if("anchorPosition"===u)return c;const e=dH(s),t=(e&&1===e.nodeType?e:rz(D.current).body).getBoundingClientRect();return{top:t.top+lH(t,l.vertical),left:t.left+cH(t,l.horizontal)}},[s,l.horizontal,l.vertical,c,u]),_=k_.useCallback(e=>({vertical:lH(e,x.vertical),horizontal:cH(e,x.horizontal)}),[x.horizontal,x.vertical]),I=k_.useCallback(e=>{const t={width:e.offsetWidth,height:e.offsetHeight},n=_(t);if("none"===u)return{top:null,left:null,transformOrigin:uH(n)};const r=A();let i=r.top-n.vertical,o=r.left-n.horizontal;const a=i+t.height,l=o+t.width,c=iz(dH(s)),d=c.innerHeight-m,f=c.innerWidth-m;if(null!==m&&i<m){const e=i-m;i-=e,n.vertical+=e}else if(null!==m&&a>d){const e=a-d;i-=e,n.vertical+=e}if(null!==m&&o<m){const e=o-m;o-=e,n.horizontal+=e}else if(l>f){const e=l-f;o-=e,n.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:uH(n)}},[s,u,A,_,m]),[L,P]=k_.useState(g),R=k_.useCallback(()=>{const e=D.current;if(!e)return;const t=I(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,P(!0)},[I]);k_.useEffect(()=>(k&&window.addEventListener("scroll",R),()=>window.removeEventListener("scroll",R)),[s,k,R]);k_.useEffect(()=>{g&&R()}),k_.useImperativeHandle(a,()=>g?{updatePosition:()=>{R()}}:null,[g,R]),k_.useEffect(()=>{if(!g)return;const e=function(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}(()=>{R()}),t=iz(s);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[s,g,R]);let z=w;"auto"!==w||S.muiSupportAuto||(z=void 0);const F=h||(s?rz(dH(s)).body:void 0),j=null!=(r=null==v?void 0:v.root)?r:fH,B=null!=(i=null==v?void 0:v.paper)?i:hH,H=Tz({elementType:B,externalSlotProps:uI({},E,{style:L?E.style:uI({},E.style,{opacity:0})}),additionalProps:{elevation:p,ref:T},ownerState:O,className:RR(N.paper,null==E?void 0:E.className)}),V=Tz({elementType:j,externalSlotProps:(null==b?void 0:b.root)||{},externalForwardedProps:q,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:F,open:g},ownerState:O,className:RR(N.root,f)}),{slotProps:$}=V,W=dI(V,sH);return uP.jsx(j,uI({},W,!Cz(j)&&{slotProps:$,disableScrollLock:k},{children:uP.jsx(S,uI({appear:!0,in:g,onEntering:(e,t)=>{M&&M(e,t),R()},onExited:()=>{P(!1)},timeout:z},C,{children:uP.jsx(B,uI({},H,{children:d}))}))}))});function mH(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gH(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function yH(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 r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(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 vH(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bH(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vH(Object(n),!0).forEach(function(t){yH(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vH(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xH(){
108
108
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
109
- var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return SH(c,"_invoke",function(n,r,i){var o,s,l,c=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,a}};function h(n,r){for(s=n,l=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,o=u[t],h=f.p,p=o[2];n>3?(i=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,f.v=r,f.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(SH(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,SH(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,SH(d,"constructor",c),SH(c,"constructor",l),l.displayName="GeneratorFunction",SH(c,i,"GeneratorFunction"),SH(d),SH(d,i,"Generator"),SH(d,r,function(){return this}),SH(d,"toString",function(){return"[object Generator]"}),(xH=function(){return{w:o,m:f}})()}function SH(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}SH=function(e,t,n,r){function o(t,n){SH(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},SH(e,t,n,r)}function wH(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 r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||CH(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 MH(e){return function(e){if(Array.isArray(e))return mH(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||CH(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 kH(e){return kH="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},kH(e)}function CH(e,t){if(e){if("string"==typeof e)return mH(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mH(e,t):void 0}}function qH(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var EH,DH,TH={exports:{}},OH={},NH=(DH||(DH=1,TH.exports=function(){if(EH)return OH;EH=1;var e=C_,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!o.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:i.current}}return OH.Fragment=n,OH.jsx=a,OH.jsxs=a,OH}()),TH.exports),AH=function(e){var t=e.className,n=e.title,r=e.path,i=e.fillRule;return NH.jsxs($F,{className:t,viewBox:"0 0 16 16",fontSize:"small",role:"img",style:{height:12,width:12},children:[NH.jsx("path",{d:r}),n?NH.jsx("title",{children:n}):void 0,i?NH.jsx("use",{fillRule:i}):void 0]})},_H={STYLE:{ELLIPSIS:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},FOCUS:{boxShadow:"inset 0 0 0 2px #177FE6"},ICONS:{COLOR:{PRIMARY:"rgba(89, 89, 89)",SECONDARY:"rgba(89, 89, 89, 0.8)",DISABLED:"rgba(89, 89, 89, 0.4)"}}}},IH={L:new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),R:new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),AL:new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]")},LH=function(e){return IH.L.test(e)},PH=function(e){return IH.R.test(e)||IH.AL.test(e)};function RH(e){for(var t,n=e?e.length:0,r=0;r<n;r++){if(t=e[r],LH(t))return"ltr";if(PH(t))return"rtl"}return"ltr"}var zH,FH,jH,BH,HH=PF(fB,{shouldForwardProp:function(e){return"direction"!==e&&"padding"!==e&&"styling"!==e}})(function(e){var t=e.direction,n=e.padding,r=e.styling,i=r.fontSize,o=r.fontFamily,a=r.color;return{fontWeight:"normal",lineHeight:"normal",fontSize:"".concat(i," !important"),fontFamily:"".concat(o," !important"),color:"".concat(a," !important"),height:"100%",minWidth:"0px",maxWidth:"640px",padding:n,"&:disabled":{color:a,opacity:1},"& .MuiButton-startIcon":{margin:"ltr"===t?"0 2px":void 0},"& .MuiButton-endIcon":{margin:"rtl"===t?"0 2px":void 0}}}),VH=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z",fillRule:"evenodd"})})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px"}}),$H=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5L8 9Z"})})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:_H.STYLE.ICONS.COLOR.DISABLED,opacity:.6}}}),WH=function(e){var t=e.isOpen,n=e.onClick,r=e.popoverId,i=e.source,o=i.styling,a=i.info.text,s=i.layout.direction,l=i.meta,c=l.allowed,u=l.hasAlternatives,d=l.hasCyclic,f=l.hasMultiple,h=l.index,p=l.isCyclic,m=l.isLocked,g=i.resources.translator,y=i.services.focus,v=i.settings.isDisabled,b=i.state.inSelections,x=!(!c.change||!u),S=!(!c.reload||!p),w=(x||S)&&!b&&!v(),M={pointerEvents:w?"auto":"none"},k=function(e){var t=e.allowed,n=e.canChange,r=e.canReload,i=e.direction,o=e.hasCyclic,a=e.isLocked,s={top:"8px",right:"6px",bottom:"8px",left:"6px"};if(!e.hasMultiple)return"".concat(s.top," ").concat(s.right," ").concat(s.bottom," ").concat(s.left);var l=o&&t.reload;return"ltr"===i&&(a?s.left="0px":r||!n&&l?s.left="4px":n||(s.left="2px"),n||r||(s.right="0px")),"rtl"===i&&(a?s.right="0px":r||!n&&l?s.right="4px":n||(s.right="2px"),n||r||(s.left="0px")),"".concat(s.top," ").concat(s.right," ").concat(s.bottom," ").concat(s.left)}({allowed:c,canChange:x,canReload:S,direction:s,hasCyclic:d,hasMultiple:f,isLocked:m}),C=yH(yH({},"rtl"===s?"endIcon":"startIcon",m&&NH.jsx(VH,{height:12})),"rtl"===s?"startIcon":"endIcon",(x||S)&&NH.jsx($H,{className:"".concat(b||v()?"disabled":"")})),q=k_.useRef(),E=k_.useRef();k_.useEffect(function(){t||y.shouldFor(h)&&(q.current.focus(),E.current.focusVisible())});var D=RH(a),T="Accessibility.".concat(w?"Alternative":"Normal",".Instructions");return NH.jsx(HH,bH(bH({action:E,"aria-describedby":r,"aria-label":g.get(T),color:"inherit",direction:s,disabled:!w||v()||b,onClick:function(e){w&&n(e)},padding:k,ref:q,style:M,styling:o.title,title:a},C),{},{children:NH.jsx("span",{dir:D,style:_H.STYLE.ELLIPSIS,children:a})}))},UH=function(e){var t=e.className,n=e.title;return NH.jsx(AH,{className:t,title:n,path:"M 6 2 h 10 V 1 H 6 Z m 5 5 h 5 V 6 h -5 Z m 5 5 h -5 v -1 h 5 Z M 5 10 h 1 v 2.663 a 3.5 3.5 0 1 0 -2.922 0.036 l -0.406 0.914 A 4.501 4.501 0 1 1 7.329 13 H 9 v 1 H 5 Z"})},YH=PF(fB,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e&&"styling"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast,i=e.styling.color;return{fontWeight:"normal",lineHeight:"normal",color:i,height:"24px",width:"24px",padding:0,marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px","&:disabled":{color:i,opacity:1}}}),KH=PF(UH,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast;return{color:_H.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px"}}),GH=PF(function(e){var t=e.className,n=e.title;return NH.jsx(AH,{className:t,title:n,path:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7Z"})},{})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,"&.disabled":{color:_H.STYLE.ICONS.COLOR.DISABLED}}}),XH=function(e){var t=e.source;if(!t.meta.isCyclic)return null;var n=wH(k_.useState(!1),2),r=n[0],i=n[1],o=t.styling,a=t.action.stepCycle,s=t.info,l=s.position,c=s.tooltip,u=t.layout.direction,d=t.meta,f=d.allowed,h=d.isFirst,p=d.isLast,m=t.settings.isDisabled,g=t.state.inSelections;return k_.useEffect(function(){r&&i(!1)},[l]),f.reload?NH.jsx(YH,{direction:u,disabled:r||g||m(),isFirst:h,isLast:p,onClick:function(){return i(!0),void a()},styling:o.title,title:c,variant:"outlined",children:NH.jsx(GH,{className:"".concat(r||g||m()?"disabled":"")})}):NH.jsx(KH,{direction:u,isFirst:h,isLast:p,style:{flexShrink:0},title:c})},JH=function(e){var t=e.className,n=e.title;return NH.jsx(AH,{className:t,title:n,path:"M7 4h9v1H7V4ZM9 8h7v1H9V8ZM11 12h5v1h-5v-1ZM1 4v3.526a3.5 3.5 0 0 0 3.5 3.5h2.31L5.22 9.402l.715-.7L8.7 11.527 5.935 14.35l-.714-.7 1.59-1.624H4.5a4.5 4.5 0 0 1-4.5-4.5V4h1Z"})},ZH=PF(fB,{shouldForwardProp:function(e){return"styling"!==e}})(function(e){var t=e.styling,n=t.fontSize,r=t.fontFamily,i=t.color;return{fontWeight:"normal",lineHeight:"normal",fontSize:"".concat(n," !important"),fontFamily:"".concat(r," !important"),color:"".concat(i," !important"),padding:"0px 5px",height:"100%",minWidth:"45px","&:disabled":{color:i}}}),QH={color:_H.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:_H.STYLE.ICONS.COLOR.DISABLED}},eV=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5 8.5 8z"})})(function(){return QH}),tV=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})(function(){return QH}),nV=PF(JH,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast;return{color:_H.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px"}}),rV=function(e){var t=e.source;if(!t.meta.isDrillDown)return null;var n=t.styling,r=t.action.drillUp,i=t.info,o=i.breadcrumbs,a=i.tooltip,s=t.layout.direction,l=t.meta,c=l.isFirst,u=l.isLast,d=t.settings.isDisabled,f=t.state.inSelections,h=d()||f?"disabled":null,p=yH({},"rtl"===s?"startIcon":"endIcon","rtl"===s?NH.jsx(tV,{className:h}):NH.jsx(eV,{className:h})),m=o.map(function(e,t){var i=RH(e);return NH.jsx(ZH,bH(bH({disabled:d()||f,onClick:function(){return function(e){r({steps:o.length-e})}(t)},styling:n.title,title:e},p),{},{children:NH.jsx("span",{dir:i,style:_H.STYLE.ELLIPSIS,children:e})}),"breadcrumb-".concat(e))});return NH.jsxs(NH.Fragment,{children:["rtl"===s?m.reverse():void 0,NH.jsx(nV,{direction:s,isFirst:c,isLast:u,style:{flexShrink:0},title:a}),"rtl"===s?void 0:m]})},iV=PF(KB,{shouldForwardProp:function(e){return"nested"!==e&&"rtl"!==e}})(function(e){var t=e.nested,n=e.rtl;return{padding:"4px ".concat(t&&n?"32px":"16px"," 4px ").concat(t&&!n?"32px":"16px"),"&:focus":bH({},_H.STYLE.FOCUS)}}),oV=PF(ZB)(function(){return{marginRight:0,justifyContent:"center"}}),aV=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2 3 3Z"})})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY}}),sV=PF(UH)(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY}}),lV=PF(JH)(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,fontWeight:600}}),cV=function(e){var t=e.meta;return e.selected?NH.jsx(aV,{height:12}):null!=t&&t.isCyclic?NH.jsx(sV,{height:12}):null!=t&&t.isDrillDown?NH.jsx(lV,{height:12}):void 0},uV=function(e){var t=e.id,n=e.meta,r=e.nested,i=e.onClick,o=e.selected,a=e.source,s=e.text,l=a.styling,c=a.settings.isRTL,u=bH({fontWeight:!n||n.isNormal?"normal":600,lineHeight:"normal",fontSize:l.popover.fontSize,fontFamily:l.popover.fontFamily,color:l.popover.color,textAlign:c?"end":"start"},_H.STYLE.ELLIPSIS),d=RH(s),f=NH.jsx(oV,{sx:c?{paddingRight:"12px"}:{paddingLeft:"12px"},children:cV({meta:n,selected:o})});return NH.jsx(C_.Fragment,{children:NH.jsxs(iV,{autoFocus:o,nested:r,onClick:function(e){return null==i?void 0:i(e)},rtl:c,title:s,children:[c&&f,NH.jsx(rH,{dir:d,primaryTypographyProps:{style:u},children:s}),!c&&f]})},t)},dV=PF(_B)(function(){return{marginTop:"-1px"}}),fV=function(e){var t=e.anchor,n=e.id,r=e.onClose,i=e.open,o=e.source,a=o.action,s=a.changeTo,l=a.drillUp,c=a.setActiveField,u=o.info,d=u.breadcrumbs,f=u.group,h=u.id,p=u.text,m=o.data.alternatives,g=o.meta,y=g.index,v=g.isCyclic,b=g.isDrillDown,x=o.resources.translator,S=o.services.focus,w={isChanging:!1},M=k_.useRef(),k=function(){var e,t=document.activeElement;null!=M&&null!==(e=M.current)&&void 0!==e&&e.contains(t)&&t.blur(),r()},C=v||b,q=NH.jsx(uV,{id:h,meta:o.meta,onClick:k,selected:!C,source:o,text:C?f.name:p},h),E=C&&f.items.map(function(e){return NH.jsx(uV,{id:e.id,nested:!0,onClick:function(t){return function(e,t){w.isChanging||(w.isChanging=!0,"keydown"!==e.type&&"keyup"!==e.type||S.queueFor(y),v&&c({fieldIndex:t.index}),b&&l({steps:d.length-t.index}))}(t,e)},selected:e.current,source:o,text:e.text})}),D=m.map(function(e,t){return NH.jsxs(C_.Fragment,{children:[NH.jsx(uV,{id:e.id,meta:e.meta,onClick:function(t){return n=t,r=e.id,void(w.isChanging||(w.isChanging=!0,"keydown"!==n.type&&"keyup"!==n.type||S.queueFor(y),s({id:r})));var n,r},source:o,text:e.text},e.id),t<m.length-1&&NH.jsx(dV,{},"divider-".concat(e.id))]},e.id)});return NH.jsx(pH,{anchorEl:t,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:n,onClose:k,open:i,ref:M,slotProps:{paper:{style:{minWidth:"250px",maxWidth:"640px",maxHeight:"300px"}}},transformOrigin:{vertical:"bottom",horizontal:"center"},children:NH.jsxs(VB,{"aria-label":x.get("Accessibility.Popover.Instructions"),dense:!0,children:[q,E,NH.jsx(dV,{},"divider-".concat(h)),D]})})},hV=function(e){var t=e.source,n=wH(k_.useState(null),2),r=n[0],i=n[1],o={id:r?"alternatives-popover":void 0,isOpen:Boolean(r)},a=t.layout.direction,s=t.meta.index,l=t.services.focus,c=function(){i(null)};k_.useEffect(function(){o.isOpen&&c()},[t.info.key]);var u=NH.jsx(XH,{source:t}),d=NH.jsx(rV,{source:t});return NH.jsxs(NH.Fragment,{children:["rtl"===a?void 0:d,"rtl"===a?void 0:u,NH.jsx(WH,{onClick:function(e){var t=e.currentTarget;t.classList.contains("qcm-focus-visible")&&l.queueFor(s),i(t)},isOpen:o.isOpen,popoverId:o.id,source:t}),NH.jsx(fV,{anchor:r,id:o.id,onClose:c,open:o.isOpen,source:t}),"rtl"===a?d:void 0,"rtl"===a?u:void 0]})},pV=function(){if(FH)return zH;FH=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=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 r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},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(r)return r(t,n).value}return t[n]};return zH=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},zH}(),mV=qH(pV),gV={},yV=qH((jH||(jH=1,BH=gV,(()=>{var e={370:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=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 r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(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(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](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 r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>De});var i=n(370),o=n.n(i);const a=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},s=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},l={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 c="".concat(" ","(").concat(" "),u="".concat(" ",")").concat(" ");function d(e){return c+e+u}function f(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,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=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((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function m(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 g(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function y(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function v(e){return void 0===e?")":", 0, ".concat(e,")")}function b(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(b("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(b("MaxString(".concat(t,")")),")'\"}")}function S(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=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(r&&1===r.length){var c=x(f(r[0],i),g(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var u=f(r[0],i),d=f(r[1],i),h=g(0),p=g(1),m=x(u,h),y=x(d,p);return"".concat(a,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function w(e){return"".concat(e,"(")}function M(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}const k={isFullRange:h,getNumDimensions:M,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=d(m(t));if(!n.showExcludedValues)return a;var s=S({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=g(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var u=g(0),f=g(1);return"If(Count(".concat(u,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return p(e,t)},getAboveCompPrefix:y,getAboveCompSuffix:v,getAboveComp:function(e,t,n,r){return y(e,t)+n+v(r)},getFunctionPrefix:w,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return w(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:S,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===M({properties:n,layout:r})},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),r=g(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(c);if(-1!==n){var r=t.indexOf(u);if(-1!==r)return t.substring(n+c.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:f,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=M({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:d,canExtract:function(e){var t=e.indexOf(c),n=e.indexOf(u);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:g,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=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});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=l.OPTIONS.find(function(t){return t.value===e.decomposition});return t?l.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(l.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return l.EXPRESSIONS[n]&&r.includes(l.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function q(e){return q="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},q(e)}var E=o().bind(null,!0),D={},T=Array.isArray;function O(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function N(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function _(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=N(e[n||t])?o:e[t],e=e[n||t]}}),e}function I(e,t){var n=!0;if(O(e)&&O(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){I(e[r],t[r])||(n=!1)}),n);if(T(e)&&T(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!I(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?E({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);I(o,a)||A(t,i)||(N(a)?r.push({op:"add",path:s,value:o}):O(o)&&O(a)?r=r.concat(D.generate(a,o,s)):T(o)&&T(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&N(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(I(t,i))return r;if(!N(t[0])&&N(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){N(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},D.apply=function(e,t){t.forEach(function(t){var n,r,i=_(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(T(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(T(a)&&T(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(r)||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(O(a)&&O(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),E(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=_(e,t.from);T(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(T(i)?i.splice(+o,1):delete i[o])})},D.clone=function(e){return E({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):E(e,t)};const L=D;var P="accumulation";function R(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var F={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const j={translationKey:"properties.modifier.accumulation",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=k.getNumStepComp(n,l),f=k.getAboveComp(n,l,u,d),h=k.getRangeComp("RangeSum",f);if(k.needDimension({modifier:n,properties:r,layout:i})){var p=k.getDimComp(c,1),m=k.getDimComp(c,0),g=k.getAggrComp(h,p,m);h=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return h},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,F)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(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(z(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(z(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(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=R(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=R(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=R(t,e);return o&&!o.disabled}}}};var B="movingAverage";function H(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function V(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const W={translationKey:"properties.modifier.movingAverage",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=k.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=k.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=k.getNumStepComp(r,c),p=k.getAboveComp(r,c,f,h);if(r.nullSuppression)t=k.getRangeComp("RangeAvg",p);else{var m=k.getRangeComp("RangeSum",p),g=function(e,t){var n=k.getRowNoComp(e,t);if(!k.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(k.needDimension({modifier:r,properties:i,layout:o})){var v=k.getDimComp(u,1),b=k.getDimComp(u,0),x=k.getAggrComp(y,v,b);y=r.showExcludedValues?k.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,$)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(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(V(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(V(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(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=H(t,e);return o&&!o.disabled}}}};var U="timeSeriesDecomposition";function Y(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;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:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?k.generateTSDExpression(n,t,r):t},extractInputExpression:k.extractInputExpression,initModifier:function(e,t){k.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=k.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(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:l.OPTIONS},steps:{refFn:function(t){return"".concat(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=Y(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=Y(t,e);return n&&!n.fullRange}}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=Y(t,e);return o&&!o.disabled}}}};var J="difference";function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===J)return r;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:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=k.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(k.needDimension({modifier:n,properties:r,layout:i})){var h=k.getDimComp(c,1),p=k.getDimComp(c,0),m=k.getAggrComp(f,h,p);f=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return f},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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(J))return!1;var o=function(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}(t,e);return o&&!o.disabled}}}};var te="normalization";function ne(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(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(k.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(k.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a,s){var l=ae(t),c=se(t,n,r),u=""===l&&""===c?"":l||c,d=le(i,o),f=ce(i,o,a),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=k.getDimDefWithWrapper(n);return t.join(", ")}(o);return s?"(If(".concat(e," < 0, null(), ").concat(e,"))/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," RangeMax( 0, ").concat(e,"), ").concat(h,"))"):"".concat(e,"/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," ").concat(e,", ").concat(h,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension,n.ignoreNegative)},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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(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 r=[{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 r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(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(re(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(re(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,r){return function(e,t,n,r){var i=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===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(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 k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="library id deleted",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId",ge="qDef.qLabel",ye="qDef.qLabelExpression",ve="qDef.base.qLabel",be="qDef.base.qLabelExpression",xe="qDef.qAggrFunc",Se="qDef.base.qAggrFunc",we="qDef.base";const Me={getExpression:function(e){var t=s(e,he);return void 0!==t?t:s(e,fe)},getExpressionRef:function(e){return void 0!==s(e,he)?he:fe},getLibraryIdRef:function(e){return s(e,me)?me:pe},getLibraryId:function(e){return s(e,me)||s(e,pe)},getLabelRef:function(e){return s(e,we)?ve:ge},getLabelExpressionRef:function(e){return s(e,we)?be:ye}};var ke={initBase:function(e,t){(t||ke.isValid(e))&&(a(e,he,s(e,fe)),a(e,me,s(e,pe)),a(e,ve,s(e,ge)),a(e,be,s(e,ye)))},restoreBase:function(e){ke.isValid(e)&&(a(e,fe,s(e,he)),a(e,pe,s(e,me)),a(e,ge,s(e,ve)),a(e,ye,s(e,be)),s(e,xe)&&s(e,Se)&&a(e,xe,s(e,Se)),delete e.qDef.base)},isValid:function(e){var t=s(e,he),n=s(e,me);return void 0!==t||void 0!==n}};const Ce=ke;function qe(e){return qe="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},qe(e)}var Ee={accumulation:j,movingAverage:W,difference:ee,normalization:ue,timeSeriesDecomposition:X};const De={modifiers:Ee,apply:Oe,applyModifiers:Ne,cleanUpMeasure:Ae,destroy:function(e){e&&Te[e.id]&&Te[e.id].masterItemSubscriber&&(Te[e.id].masterItemSubscriber&&Te[e.id].masterItemSubscriber.unsubscribe(),delete Te[e.id])},hasActiveModifiers:_e,getActiveModifier:Ie,initBase:Ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ee[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ee[e]&&Ee[e].isApplicable({properties:n,layout:r})})},measureBase:Me,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Re(e);$e({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ge({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Le};var Te={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,i=void 0!==r&&r,a=e.masterItem,l=!1;Te[t.id]=Te[t.id]||{isFirstTime:!0};var c=Te[t.id].isFirstTime;if(Te[t.id].isFirstTime=!1,n&&"object"===qe(n))return Ne({model:t,properties:n});var u=t?t.layout:void 0,d=s(u,"qSelectionInfo.qInSelections");if(i||d)return Promise.resolve(l);var f=s(u,"qHyperCube.qMeasureInfo"),h=Te[t.id].lastReloadTime;if(Te[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),_e({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ve({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:t,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return $e({modifiers:Re(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:a,isFirstTime:c})?t.getEffectiveProperties().then(function(e){var n=o()(!0,{},e);Fe(n);var r=Xe(n);return We({model:t}).then(function(i){return Ue({libraryIds:r,model:t}).then(function(r){return p&&function(e){var t=e.properties;Pe(t).forEach(function(e){return function(e){var t=e.measure;if(Ve({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(n++,"object"!==qe(Ee[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 r=Ee[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Be(t)&&k.simplifyExpression(t.qDef.base.qDef)!==k.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:n}),Ne({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})})}).catch(function(){return Promise.resolve(l)})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===qe(e.base)})}(f)?t.getEffectiveProperties().then(function(e){return function(e){var t=e.model,n=e.properties,r=Xe(n);return Je({model:t,libraryIds:r}).then(function(){var e=o()(!0,{},n);return Pe(n).forEach(function(e){return Ae(e)}),Ke({oldProperties:e,newProperties:n,model:t})})}({model:t,properties:e})}):Promise.resolve(l)}function Ne(e){var t=e.model,n=e.oldProperties,r=e.properties,i=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?o()(!0,{},r):r),Fe(r);var f=Xe(r);return Je({model:t,libraryIds:f,masterItem:c}).then(function(){return function(e){var t=e.measures,n=e.properties,r=e.model,i=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=Pe(n)),!t.length)return Promise.resolve();if(!i&&!_e({measures:t,properties:n}))return t.forEach(function(e){return Ae(e)}),Promise.resolve();var l=i?void 0:Xe(n);return We({model:r,dimensionAndFieldList:a}).then(function(e){return Ue({libraryIds:l,model:r,libraryItemsProps:i}).then(function(r){t.forEach(function(t){var i=t.qDef.modifiers;r&&$e({modifiers:i,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,i=e.dimensionAndFieldList,a=0;Ce.isValid(t)||Ce.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(a++,"object"!==qe(Ee[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ee[e.type].initModifier(e,t);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ee[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=t.qDef.base.qLabel||a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=t.qDef.base.qNumFormat||a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:i}):function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList;"function"==typeof Ee[n.type].updateModifier&&Ee[n.type].updateModifier(n,r.qHyperCubeDef);var a=Me.getExpression(t),s=""===a?a:Ee[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:i}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||Le(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Le(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}})}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),je(t)):Ae(t)})})})}({measures:i,properties:r,model:t,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Ke({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)})}).catch(function(){return Promise.resolve(!1)})}function Ae(e){!function(e){var t=Re(e);return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&!Ee[e.type]})}(e)?Ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,je(e)}function _e(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return $e({modifiers:Re(e),properties:n,layout:r})})}function Ie(e){var t=Re(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ee[r.type]&&!r.disabled)return r}}function Le(e){var t=Ie(e);return!t||Ee[t.type].enableTotalsFunction(e)}function Pe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Re(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ze(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Fe(e){Pe(e).forEach(function(e){return function(e){var t=Ie(e);t&&(void 0!==t.outputExpression&&ze(t)!==e.qDef.qDef?delete e.qDef.base:!Ce.isValid(e)&&t.base&&(e.qDef.base=o()(!0,{},t.base)))}(e)})}function je(e){var t=Re(e);Array.isArray(t)&&t.forEach(function(t){"object"===qe(t)&&(t.disabled||!Ee[t.type]&&ze(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Be(e){return e.base||e.qDef&&e.qDef.base}function He(e){var t=Be(e);return e.qLibraryId||t&&t.qLibraryId}function Ve(e){var t=e.measure,n=e.properties,r=e.layout;return!He(t)&&$e({modifiers:Re(t),properties:n,layout:r})}function $e(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==qe(e)||e.disabled||!Ee[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ee[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function We(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ue(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.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}).catch(function(){return null})}function Ye(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ke(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Ye)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&s(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):function(e,t,n){if(!e)return Promise.resolve();var r=L.generate(t,n);return o()(!0,t,n),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()}(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ge(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&Ee[e.type]&&Ee[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Xe(e){var t=Pe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=Re(t);if($e({modifiers:r,properties:e})){var o=He(t);o&&n.push(o),i=i||Ge({modifiers:r,properties:e})}}),s(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function Je(e){var t=e.model,n=e.libraryIds,r=e.masterItem;return!r&&r!==de&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Te[t.id].masterItemSubscriber=Te[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach(function(n){t[n]=s(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(){Object.keys(r).forEach(function(e){i[e]||o[e]||(r[e].listener.dispose(),r[e].unbindCloseListnener(),delete r[e])})}var d=function(e,t){return e.once("closed",t),function(){return e.removeListener("closed",t)}};function f(e,i){return t.app[i](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),unbindCloseListnener:d(t,function(){return e=t.id,n(de),delete r[e],void u();var e}),enabled:!1,properties:l(t.layout)}}).catch(function(){})}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),o={},t.forEach(function(e){o[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:a}),u(),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(f(e,"getMeasure"))}),Object.keys(o).forEach(function(e){o[e]&&!r[e]&&s.push(f(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose(),r[e].unbindCloseListnener()}),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Te[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}for(var Ze in BH.default=r.default,r)-1===["default"].indexOf(Ze)&&(BH[Ze]=r[Ze]);Object.defineProperty(BH,"__esModule",{value:!0})})()),gV));function vV(e){var t=e.model,n=e.properties;return e.noModelDependencies?yV.apply({model:t,properties:n}):t.modifiers?t.modifiers.apply({model:t,properties:n}):Promise.resolve()}function bV(e){return Array.isArray(e)}function xV(e){return null!=e&&!Array.isArray(e)&&"object"===kH(e)}function SV(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function wV(e){return void 0===e}function MV(e,t){if(xV(e)&&xV(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=Object.keys(e),r=0,i=n.length;r<i;r+=1)if(!MV(e[n[r]],t[n[r]]))return!1;return!0}if(bV(e)&&bV(t)){if(e.length!==t.length)return!1;for(var o=0,a=e.length;o<a;o+=1)if(!MV(e[o],t[o]))return!1;return!0}return e===t}function kV(e){var t=e.oldData,n=void 0===t?{}:t,r=e.newData,i=void 0===r?{}:r,o=e.basePath,a=void 0===o?"":o,s=[];return Object.keys(i).forEach(function(e){var t=function(e){return e?mV(!0,{},{value:e}).value:e}(i[e]),r=n[e],o="".concat(a,"/").concat(e);MV(t,r)||SV(i,e)||(wV(r)?s.push({op:"add",path:o,value:t}):xV(t)&&xV(r)?s.push.apply(s,MH(kV({oldData:r,newData:t,basePath:o}))):bV(t)&&bV(r)?s.push.apply(s,MH(function(e){var t=e.newArray,n=e.basePath,r=[];return MV(t,e.oldArray.slice())||(!wV(t[0])&&wV(t[0].qInfo)||0===t.length)&&r.push({op:"replace",path:n,value:t}),r}({oldArray:r,newArray:t,basePath:o}))):s.push({op:"replace",path:o,value:t}))}),Object.keys(n).forEach(function(e){wV(i[e])&&!SV(n,e)&&s.push({op:"remove",path:"".concat(a,"/").concat(e)})}),s}function CV(e){var t=e.model,n=kV({oldData:e.oldProperties,newData:e.newProperties});null!=t&&t.applyPatches&&null!=n&&n.length&&t.applyPatches(n.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),!0)}function qV(e){var t=e.properties,n=e.container,r=e.filtered,i=t.color;if(i){var o=i.auto,a=i.mode;if(!o){var s,l=r.map(function(e){var r;return null===(r=t.qHyperCubeDef[n][e])||void 0===r?void 0:r.qDef.cId}).filter(function(e){return void 0!==e}),c=t.qHyperCubeDef[n].filter(function(e){return!l.includes(e.qDef.cId)});if("byDimension"===a&&"qDimensions"===n){var u=i.byDimDef;if(!u)return;var d=void 0===u.activeDimensionIndex?-1:u.activeDimensionIndex;if(d<0)return;var f=c[d];if(!f)return;if(f.qLibraryId)i.byDimDef={type:"libraryItem",key:f.qLibraryId,label:f.qLibraryId,activeDimensionIndex:d};else{var h=f.qDef,p=h.qLabelExpression||h.qFieldLabels&&h.qFieldLabels[0]||h.qFieldDefs[0],m=(s=f.qDef.qFieldDefs[0]).split(" ").length>1&&"="!==s[0]&&"["!==s[0]?"[".concat(s,"]"):s;i.byDimDef={type:"expression",key:m,label:p||m,activeDimensionIndex:d}}}if("byMeasure"===a&&"qMeasures"===n){var g=i.byMeasureDef;if(!g)return;var y=void 0===g.activeMeasureIndex?-1:g.activeMeasureIndex;if(y<0)return;var v=c[y];if(!v)return;var b=yV.measureBase.getLibraryId(v);if(b){i.byMeasureDef={type:"libraryItem",key:b,label:b,activeMeasureIndex:y};var x=yV.hasActiveModifiers({measures:[v]})?v.qDef.qDef:void 0;x&&(i.byMeasureDef.expression=x)}else{var S=v.qDef;i.byMeasureDef={type:"expression",key:S.qDef,label:S.qLabelExpression||S.qLabel||S.qDef,activeMeasureIndex:y}}}}}}function EV(e){return DV.apply(this,arguments)}function DV(){var e;return e=xH().m(function e(t){var n,r,i,o,a,s,l,c,u,d,f,h,p,m;return xH().w(function(e){for(;;)switch(e.n){case 0:if(n=t.from,r=t.to,i=t.model,o=t.container,a=t.filtered,s=t.noModelDependencies,l=t.skipAttributeExpressions,c=t.onChange,i){e.n=1;break}return e.a(2);case 1:return e.n=2,i.getEffectiveProperties();case 2:return u=e.v,d=u.qHyperCubeDef[o].findIndex(function(e){return e.qDef.cId===n}),f=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o].findIndex(function(e){return e.qDef.cId===r}),h=mV(!0,{},u),p=h.qHyperCubeDef[o][d],(m=h.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o][f]).qAttributeDimensions=p.qAttributeDimensions,p.qAttributeDimensions=[],l||(m.qAttributeExpressions=p.qAttributeExpressions,p.qAttributeExpressions=[]),h.qHyperCubeDef[o][d]=m,h.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o][f]=p,c({fromItem:p,toItem:m,oldProperties:u,newProperties:h,model:i}),e.n=3,vV({model:i,properties:h,noModelDependencies:s});case 3:s?qV({properties:h,container:o,filtered:a}):i.colorSupport&&i.colorSupport.colorByUpdater(h,"qHyperCubeDef."),CV({model:i,oldProperties:u,newProperties:h});case 4:return e.a(2)}},e)}),DV=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){gH(o,r,i,a,s,"next",e)}function s(e){gH(o,r,i,a,s,"throw",e)}a(void 0)})},DV.apply(this,arguments)}function TV(e){var t=e.callbacks,n=e.data,r=e.resources,i=e.settings,o=t.onChange,a=n.infos,s=n.filtered,l=r.app,c=r.model,u=r.translator,d=i.noModelDependencies,f=i.skipAttributeExpressions;return a.map(function(e,t){var n=e.cId,r=e.qGrouping,i=e.qGroupFallbackTitles,a=e.qGroupPos,h=e.qFallbackTitle,p=e.qLocked,m=e.title,g="C"===r,y="H"===r,v="N"===r,b="number"==typeof e.explicitColumn?e.explicitColumn:t,x=function(t,n){g&&l&&l.getDimension&&l.getDimension(e.qLibraryId).then(function(e){null==e||e[t](n)}).catch(function(){})};return{meta:{isCyclic:g,isDrillDown:y,isLocked:!!p,isNormal:v},info:{id:n,key:"".concat(n,"-").concat(a),text:v?h:i[a],position:a,breadcrumbs:i.slice(0,e.qGroupPos),group:{name:m,items:i.slice(0,y?e.qGroupPos+1:i.length).map(function(e,t){return{id:"".concat(n,"-item-").concat(t),text:e,current:a===t,index:t}})},tooltip:v?void 0:u.get(g?"Tooltip.dimensions.cyclic":"Tooltip.dimensions.drilldown")},action:{changeTo:function(e){var t=e.id;return EV({from:n,to:t,container:"qDimensions",model:c,filtered:s,noModelDependencies:d,skipAttributeExpressions:f,onChange:o})},drillUp:function(e){var t=e.steps;y&&c&&(null==c||c.drillUp("/qHyperCubeDef",b,t))},stepCycle:function(){return x("stepCycle",1)},setActiveField:function(e){var t=e.fieldIndex;return x("setActiveField",t)}}}})}function OV(e){var t=e.callbacks,n=e.data,r=e.resources,i=e.settings,o=t.onChange,a=n.infos,s=n.filtered,l=r.model,c=i.noModelDependencies,u=i.skipAttributeExpressions;return a.map(function(e){var t=e.cId,n=e.qFallbackTitle;return{meta:{isNormal:!0},info:{id:t,key:t,text:n},action:{changeTo:function(e){var n=e.id;return EV({from:t,to:n,container:"qMeasures",model:l,filtered:s,noModelDependencies:c,skipAttributeExpressions:u,onChange:o})}}}})}function NV(e){var t=e.callbacks,n=e.data,r=e.dock,i=e.key,o=e.rect,a=e.resources,s=e.settings,l=e.state,c=e.styling,u=function(e){var t=e.dock,n=e.rect,r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"!==t&&"right"!==t||(r.width="".concat(n.height,"px"),r.height="".concat(n.width,"px"),r.transformOrigin="top left"),"left"===t&&(r.transform="rotate(-90deg) translate(-".concat(n.height,"px, 0)")),"right"===t&&(r.transform="rotate(90deg) translate(0, -".concat(n.width,"px)")),r}({dock:r,rect:o}),d=function(e){var t=e.callbacks,n=e.data,r=e.dock,i=e.key,o=e.resources,a=e.settings,s=e.state,l=e.styling,c=n.alternatives,u=n.infos,d=o.app,f=o.cache,h=o.model,p=a.isRTL,m=a.isSnapshot,g=a.noModelDependencies,y=a.type,v=function(e){var t=e.dock;return"top"!==t&&"bottom"!==t||!e.isRTL?"ltr":"rtl"}({dock:r,isRTL:p}),b=function(e){var t=e.cache,n="axis-title-auto-focus_"+e.key;return{queueFor:function(e){var r;return null==t||null===(r=t.set)||void 0===r?void 0:r.call(t,n,{focus:!0,index:e})},shouldFor:function(e){var r,i,o=null==t||null===(r=t.get)||void 0===r?void 0:r.call(t,n),a=!(null==o||!o.focus||(null==o?void 0:o.index)!==e);return a&&(null==t||null===(i=t.set)||void 0===i||i.call(t,n,{focus:!1})),a}}}({cache:f,key:i}),x=("dimension"===y?TV:OV)({callbacks:t,data:n,resources:o,settings:a});"rtl"===v&&x.reverse();var S={allowed:{change:g?!m:!(null==h||!h.modifiers||null==h||!h.colorSupport||m),reload:!!d&&!m},hasAlternatives:!!c.length,hasCyclic:x.some(function(e){return e.meta.isCyclic}),hasMultiple:u.length>1};return x.map(function(e,t){return bH(bH({data:n,layout:{direction:v},resources:{translator:o.translator},services:{focus:b},settings:a,state:s,styling:l},e),{},{meta:bH(bH(bH({},S),e.meta),{},{index:t,isFirst:0===t,isLast:t===x.length-1})})})}({callbacks:t,data:n,dock:r,key:i,resources:a,settings:s,state:l,styling:c});return NH.jsx("div",{style:u,children:d.map(function(e){return NH.jsxs(C_.Fragment,{children:[NH.jsx(hV,{source:e}),!e.meta.isLast&&NH.jsx("span",{dir:e.layout.direction,style:bH(bH({},c.title),{},{lineHeight:"normal"}),children:", "})]},e.info.id)})})}var AV,_V='"Source Sans Pro", "Arial", "sans-serif"',IV="12px",LV=function(e){var t=e.rect,n=e.state,r=e.settings,i=r.callbacks,o=r.data,a=r.key,s=r.layout,l=r.resources,c=r.settings,u=r.style;return NV({callbacks:i,data:o,dock:s.dock,key:a,rect:t,resources:l,settings:c,state:n,styling:u})},PV={renderer:"react",require:["renderer"],disableTriggers:!0,key:"axis-title",defaultSettings:{callbacks:{onChange:function(){}},data:{alternatives:[],infos:[],filtered:[]},resources:{app:void 0,cache:void 0,model:void 0,selections:void 0,translator:void 0},settings:{isDisabled:function(){return!1},isRTL:!1,isSnapshot:!1,noModelDependencies:!1,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:"#333",fontFamily:_V,fontSize:IV},popover:{color:"#595959CC",fontFamily:_V,fontSize:IV}}},preferredSize:function(){var e=this.settings,t=e.data,n=e.settings,r=e.style,i=t.alternatives,o=n.type,a=r.title,s=a.fontSize,l=a.fontFamily,c=i.length||"measure"!==o?28:20,u=this.registries.renderer("svg")().measureText({text:"M",fontSize:s,fontFamily:l}).height;return Math.max(c,u)},created:function(){var e=this;this.state={inSelections:!1},this.listeners={onSelectionsActivated:function(){e.state.inSelections=!0,e.renderer.render(LV(e))},onSelectionsDeactivated:function(){e.state.inSelections=!1}}},beforeMount:function(){var e=this.settings.resources.selections;e&&(e.addListener("activated",this.listeners.onSelectionsActivated),e.addListener("deactivated",this.listeners.onSelectionsDeactivated),e.addListener("canceled",this.listeners.onSelectionsDeactivated))},render:function(){return LV(this)},beforeUnmount:function(){var e=this.settings.resources.selections;e&&(e.removeListener("activated",this.listeners.onSelectionsActivated),e.removeListener("deactivated",this.listeners.onSelectionsDeactivated),e.removeListener("canceled",this.listeners.onSelectionsDeactivated))}},RV=function(e){var t=e.dock,n=e.settings.label,r="center"===t,i=r?{}:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};return NH.jsx("span",{style:i,title:n,children:r?n:"* ".concat(n)})},zV={renderer:"react",disableTriggers:!0,key:"disclaimer",defaultSettings:{settings:{isRTL:!1,label:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"'}},preferredSize:function(){return 22},render:function(){var e=this.rect,t=this.settings,n=t.layout,r=t.settings,i=t.style;return function(e){var t=e.dock,n=e.rect,r=e.settings,i=e.styling,o=function(e){var t=e.dock;return"top"!==t&&"bottom"!==t||!e.isRTL?"ltr":"rtl"}({dock:t,isRTL:r.isRTL}),a=function(e){var t=e.dock,n=e.rect,r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#404040",fontStyle:"italic",fontSize:"13px",fontFamily:e.styling.fontFamily};return"left"===t&&(r.width="".concat(n.height,"px"),r.transform="rotate(-90deg) translate(-".concat(n.height,"px, 0)"),r.transformOrigin="top left"),"right"===t&&(r.width="".concat(n.height,"px"),r.transform="rotate(90deg) translate(0, -".concat(n.width,"px)"),r.transformOrigin="top left"),"center"===t&&(r.width="".concat(n.width,"px"),r.height="".concat(n.height,"px"),r.color="#404040",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center"),"bottom"!==t&&"top"!==t||(r.justifyContent="flex-start",r.alignItems="flex-start"),r}({dock:t,rect:n,styling:i});return NH.jsx("div",{dir:o,style:a,children:NH.jsx(RV,{dock:t,settings:r})})}({dock:n.dock,rect:e,settings:r,styling:i})}},FV={},jV=function(){if(AV)return FV;AV=1;var e=ij;return FV.createRoot=e.createRoot,FV.hydrateRoot=e.hydrateRoot,FV}(),BV=bF({spacing:8,shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{standard:300,short:250,enteringScreen:225,shorter:200,leavingScreen:195,shortest:150,complex:375}},typography:{fontSize:14,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,htmlFontSize:14,fontFamily:"'Source Sans Pro', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif",button:{fontWeight:600,fontSize:14,textTransform:"none"}},shape:{borderRadius:3},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"qcm-focus-visible"}},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"qcm-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:141,borderRadius:3,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},text:{padding:"8px 16px","&:active":{backgroundColor:"rgba(0, 0, 0, 0.1)"},"&.Mui-focusVisible":{boxShadow:"inset 0 0 0 2px ".concat("#177FE6")}},outlined:{border:"1px solid rgba(0, 0, 0, 0.15)"},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"}},variants:[]},MuiList:{styleOverrides:{padding:{paddingTop:"0px",paddingBottom:"0px"}}},MuiListItemButton:{styleOverrides:{root:{fontSize:14,height:"32px"}}},MuiListItemIcon:{styleOverrides:{root:{color:"#404040",minWidth:"16px",marginRight:"16px"}}},MuiListItemText:{styleOverrides:{root:{fontSize:"12px"},primary:{fontSize:14,color:"#404040",lineHeight:"16px",fontWeight:600},secondary:{fontSize:12,color:"#737373",fontWeight:400,lineHeight:"16px"}}}}});function HV(e){var t={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}},n=e||{},r=n.x,i=n.y,o=n.width,a=n.height,s=n.scaleRatio,l=n.margin;return t.x=Number.isNaN(r)||void 0===r?t.x:r,t.y=Number.isNaN(i)||void 0===i?t.y:i,t.width=Number.isNaN(o)||void 0===o?t.width:o,t.height=Number.isNaN(a)||void 0===a?t.height:a,void 0!==s&&(t.scaleRatio.x=Number.isNaN(s.x)?t.scaleRatio.x:s.x,t.scaleRatio.y=Number.isNaN(s.y)?t.scaleRatio.y:s.y),void 0!==l&&(t.margin.left=Number.isNaN(l.left)?0:l.left,t.margin.top=Number.isNaN(l.top)?0:l.top),t}function VV(){var e={rendererBox:HV(),container:void 0,root:void 0},t=function(){var t,n;null===(t=e.root)||void 0===t||t.unmount(),null===(n=e.container)||void 0===n||null===(n=n.parentElement)||void 0===n||n.removeChild(e.container),e.container=void 0};return{size:function(t){return t&&(e.rendererBox=HV(t)),e.rendererBox},element:function(){return e.container},appendTo:function(t){return e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style["-webkit-font-smoothing"]="antialiased",e.container.style["-moz-osx-font-smoothing"]="antialiased",e.container.style.pointerEvents="none",e.root=jV.createRoot(e.container)),t.appendChild(e.container),e.container},setKey:function(t){e.container&&e.container.setAttribute("data-key",t)},render:function(t){if(!e.container)return!1;var n=e.rendererBox,r=n.scaleRatio.x,i=n.scaleRatio.y;return e.container.style.left="".concat(Math.round(n.margin.left+n.x*r),"px"),e.container.style.top="".concat(Math.round(n.margin.top+n.y*i),"px"),e.container.style.width="".concat(Math.round(n.width),"px"),e.container.style.height="".concat(Math.round(n.height),"px"),e.container.style.transform="scale(".concat(r,", ").concat(i,")"),e.container.style.transformOrigin="top left",e.root.render(function(e){var t=e.nodes;return NH.jsx(C_.StrictMode,{children:NH.jsx(zF,{theme:BV,children:t})})}({nodes:t})),!0},findShapes:function(){return[]},itemsAt:function(){return[]},clear:function(){t()},destroy:function(){t()}}}const $V={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",c=r,u=i,d=t<.5?90:-90;return o&&(s="y",l="x",c=i,u=r,d=t<.5?180:0),a(kg({},e,{[s]:n*c,[l]:u-Math.max(e.size/2,Math.min(t*u,u-e.size/2)),startAngle:d}))}};function WV({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,c=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,c=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let u=0;s?s.bandwidth?(u=s.bandwidth(),l-=u/2):u=c-l:u=1;const d=kg({},{major:l,majorEnd:c},r.minor.items[e]);i.forEach(t=>{d[t]=r[t].items[e]});const f=o?n:t,h=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:u,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:f}),p=(u-h)/2,m=p+d.major+h/2;return{item:d,boxCenter:m,boxWidth:h,boxPadding:p,rendWidth:t,rendHeight:n}}function UV({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=kg(!0,{},n||{},r||{}),c={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},u=i.major;let d;d="object"==typeof u&&"object"==typeof u.ref&&void 0!==u.ref.start&&void 0!==u.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:c,settings:kg(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof u&&void 0!==u.binStart&&void 0!==u.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:c,settings:kg(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:c,defaults:{major:.5},settings:{major:i.major}});const f=i.minor||{};let h;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:c,settings:kg(!0,{},{start:{scale:f.scale,ref:"start"},end:{scale:f.scale,ref:"end"},min:{scale:f.scale,ref:"min"},max:{scale:f.scale,ref:"max"},med:{scale:f.scale,ref:"med"}},f)})};for(let n=0,r=e.length;n<r;n++)h=e[n],p[h]=s.resolve({data:t,defaults:l[h],settings:i[h],scaled:c});return p}const YV=["oob"];const KV={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=UV({keys:YV,data:i,defaultSettings:{oob:$V.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:c,items:u}=l,d=function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=WV}){const l=[],{items:c}=r.major;for(let u=0,d=c.length;u<d;u++){const{item:d,boxCenter:f,rendWidth:h,rendHeight:p}=s({i:u,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),m=c[u].data,g=[];if(d.oob.show){g.push($V.createOob({oob:d.oob,dockValue:a,boxCenter:f,rendWidth:h,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:m,collider:{type:"bounds"},children:g};l.push(e)}}return l}({width:e,height:t,flipXY:r,resolved:l,keys:YV,symbol:s,dockValue:n});return d}},GV={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},XV=["hat"];function JV(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function ZV({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,c=i,u=e.hat.alignment||0;o&&(a="y",s="x",l=i,c=r,u=1-u);const d=(n+e.major)*l;let f=[{[a]:d,[s]:0+c},{[a]:d+t*u*l,[s]:8},{[a]:d+t*l,[s]:0+c},{[a]:d+t*l,[s]:0+c+10},{[a]:d,[s]:0+c+10}];const h=kg({},e.hat,{type:"path",d:JV(f)});f=[{[a]:d,[s]:0},{[a]:d+t*(1-u)*l,[s]:0+c-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[h,kg({},e.hat,{type:"path",d:JV(f)})]}const QV={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=UV({keys:XV,data:r,defaultSettings:GV,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a,c=function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=WV}){const a=[],{items:s}=r.major;for(let l=0,c=s.length;l<c;l++){const{item:c,boxWidth:u,boxPadding:d,rendWidth:f,rendHeight:h}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,m=[];c.hat.show&&m.push(...ZV({item:c,boxWidth:u,boxPadding:d,rendWidth:f,rendHeight:h,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:m};a.push(g)}return a}({width:e,height:t,flipXY:n,resolved:a,keys:XV});return c}};var e$={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};function t$(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map(t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}}),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:t$(i,t,n)},i}function n$(e){const t=e.scale("band");e.scale("group-by-measure",function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)}),s.splice(-1),i.domain(s),t$(i,a,l,e.invert)})}function r$(){const e=Sp();return e.use(dg),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",pg(e))};e.interaction("hammer",pg(Hammer))}(wg)),e.use(n$),e.renderer("react-qcm",VV),e.component("box-sliced-hat",QV),e.component("box-out-of-bounds",KV),e.component("disclaimer",zV),e.component("scrollbar",b_),e.component("scroll-hint",HO),e.component("reference-line-labels",UN),e.component("axis-overlay",dT.picassoComponents.axisOverlay),e.component("time-axis",dT.picassoComponents.timeAxis),e.component("space",e$),e.component("axis-title",PV),e.component("point-label",Sv),e.scale("q-time-axis",dT.picassoScales.time),e}const i$={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function o$(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const a$={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,c=o[t]*(n>l?1:n/l),u=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(c,n),width:Math.min(u,l)},r()):(e={height:c,width:u},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function s$(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await a$.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function l$(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",c=s.type||"media";let u=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){u=e;break}const d=r.data?.customTooltipAttrExps?.value||[];let f;if(-1!==u&&d[u]&&(f=d[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return s$(s,l,i);if("url"===c)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&o$(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await a$.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch{}else{const{height:e,width:t,imageError:n}=await a$.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,f);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&f&&f.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(o$(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await a$.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch{}return i}(i,n[u],l,f)}return[]}const c$={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(l$(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},u$={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await c$.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>c$.checkIfPromisesExist({customTooltipModel:e})};const d$=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:i$.CHART.CHART_PARENT_TYPE,qId:i$.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},f$=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:i$.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const h$={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=i$.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:i$.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await h$.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=i$.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=i$.CHART.STATE,o=d$(t,i),a=await e.createSessionObject(o),s=f$(t);if(a.id!==i$.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(i$.CHART.CONTAINER_ID),c={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:c,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch{await h$.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(h$.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(i$.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=i$.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function p$(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function m$(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=i$.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function g$(e){const t=m$();return e.filter(e=>t[e.id])}const y$={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=y$.getAttrExprData(a);o.length||n.length?u$.handlePromises({customTooltipModel:i,nodes:y$.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&h$.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>u$.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[i$.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[i$.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[i$.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(g$(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[i$.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[i$.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=p$(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===g$(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=p$(e)||[];[...i,t].forEach(e=>{const t=g$(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=m$(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:FT.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=FT.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function v$({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:y$,miniChartToken:{},embed:s}}function b$(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case i$.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case i$.CUSTOM.TITLE:case i$.CUSTOM.DESCRIPTION:case i$.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const x$={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>b$(t,e,r,n)}}};const S$={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[i$.CUSTOM.TITLE]:!0,[i$.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=y$.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===i$.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===i$.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>jT.getMeasure(e,t)),e,r)}};function w$({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(S$.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function M$(e){const t=i$.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function k$(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const C$={migrateProperties(e){const t=kg(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=k$(t);return r=function(e,t){return t.concat(e.map(e=>M$(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=M$(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(k$(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var q$={attrExpr:C$};const{CUSTOM:E$}=i$;function D$({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:c}){const u={properties:void 0},d=v$({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),f="rtl"===c.direction,h=()=>{const e=!!u.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{u.properties=e},isEnabled:()=>h(),hideBasic:()=>h()&&Jx(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=w$({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===E$.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===E$.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>y$.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>y$.getImageRow(e,{h:t,rtl:f}),addImages:({nodes:r})=>{const i=y$.getDataNodes(o,r),{attrExps:a}=y$.getAttrExprData(t);return u$.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(h()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>h$.createContainer({layout:t,ctx:{h:e,rtl:f}}),createLimitationRow:()=>y$.getFooterRow(a.get("properties.tooltip.notselectedmessage"),f),show:({nodes:e,properties:t})=>h$.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:f}),hasAlternateState:()=>!!d.miniChartToken?.alternateState,hide:()=>h$.hide({app:n,customTooltipModel:d}),destroy:()=>h$.destroyVisualization({customTooltipModel:d})}}}var T$=7005;const O$=e=>e.qError?.qErrorCode!==T$,N$=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&ST.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},A$=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ST.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ST.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},_$=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},I$=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,r=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===r.length){const r=n[0];return r.qLibraryId?t.getDimension(r.qLibraryId).then(e=>e.getLayout()).then(t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;A$(e,n)}return r}):t.getField(r.qDef.qFieldDefs[0]).then(t=>t.getCardinal().then(t=>(A$(e,t),r)),()=>r)}return N$(e),Promise.resolve()};function L$(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:r}}=e;t.length>1&&e.color?Qx(e,"color.persistent",!0):"byDimension"===r&&n.length>1?Qx(e,"color.mode","byMultiple"):"byExpression"===r&&0===n.length?Qx(e,"color.mode","primary"):0===t.length&&n.length>0&&(Qx(e,"color.byMeasureDef",void 0),Qx(e,"color.byDimDef",void 0),1===n.length&&"byExpression"!==r&&Qx(e,"color.mode","primary"))}const P$=(e,t)=>{L$(t),FO(e),y$.addCallbackCustomTooltip(t)},R$=e=>{L$(e)};function z$({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,r,i){let o;const a=i?.layout?i.layout.qHyperCube.qDimensionInfo.filter(e=>O$(e)).length:t.qHyperCubeDef.qDimensions.length;return r.isAutoChart&&n>a-1?o="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?o="Visualizations.Descriptions.Stack":(o="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):o="Visualizations.Descriptions.Bars",e.get(o)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),n?.app?I$(t,n.app).then(()=>(P$(e,t),e)):(_$(t),P$(e,t),e)),move(e,t,n){const r=n.layout.qHyperCube.qDimensionInfo.filter(e=>O$(e)).length;r>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),N$(t),L$(t),y$.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;L$(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),y$.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){y$.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>n?.app?I$(t,n.app).then(()=>(e.qSortBy.qSortByNumeric=-1,R$(t),e)):(_$(t),R$(t),e),move(e,t){N$(t),L$(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;L$(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function F$(e){return{properties:{version:"2.6.0",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[{path:"/qHyperCubeDef",...z$(e)}]}}}var j$={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_Group:{id:"Visualizations.Descriptions.Group",locale:{"de-DE":"Gruppe","en-US":"Group","es-ES":"Grupo","fr-FR":"Groupe","it-IT":"Gruppo","ja-JP":"グループ","ko-KR":"그룹","nl-NL":"Groep","pl-PL":"Grupa","pt-BR":"Grupo","ru-RU":"Группа","sv-SE":"Grupp","tr-TR":"Grup","zh-CN":"组","zh-TW":"群組"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};function B$({env:t}){const{flags:n}=t,r=t.anything?.sense?.isUnsupportedFeature,i=e.useTranslator();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(j$).forEach(t=>{e.add(j$[t])})}}(t.translator);const o=e.useEmbed(),a=e.useTheme(),[s,l]=e.useState(),c=e.useDeviceType(),u=e.useAppLayout(),{qLocaleInfo:d}=u;return e.useEffect(()=>{l({translator:i,theme:a,embed:o,deviceType:c,localeInfo:d,isUnsupportedFeature:r,flags:n})},[d,r,i.language(),a.name(),c]),s}function H$(){const[t]=e.useState(()=>eS()),[n]=e.useState(()=>function(e){var t=py({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0}));return{viewCache:t,viewState:n}}const V$="REJECTED",$$=()=>{},W$=2,U$=20,Y$=200,K$=10;var G$={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),c=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),u={qArea:{qHeight:s-a,qWidth:c-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)u.qMatrix.push(e.qMatrix[t].slice(l,c));return u},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-K$<=t.qTop,i=n.qLeft+n.qWidth+K$>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+K$>=t.qTop+t.qHeight,a=n.qLeft-K$<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var X$={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-K$<=t.qTop,i=n.qTop+n.qHeight+K$>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var J$={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const Z$="pages";const Q$="discretePan";function eW({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:Q$,pointers:1,threshold:10,enable(r,i){return this.started===Q$||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some(e=>e.key===n)}},events:{[`${Q$}start`](e){e.preventDefault(),this.started=Q$;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},[`${Q$}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${Q$}end`](e){e.preventDefault(),this.started=!1},[`${Q$}cancel`](e){e.preventDefault(),this.started=!1}}}}function tW({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter(e=>e.key===t);if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=100*Math.sign(-a);r.scroll(s)}}function nW({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(Y$,n));return{width:e,height:Math.max(U$,Math.min(n*W$,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function rW(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then(e=>{if(t.canceled||n)return t.reject(V$),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null})},i=e=>new Promise((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(V$),n=e})(a):r(a)});return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(V$),n=null)},i}const iW={command:{update:()=>{}}};function oW({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=iW,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:c}=t,u=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:c}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&c&&c();const u=r(l);return o(i(u)).then(n=>(s(n),e.add(n),t(n,l)))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:nW({layoutService:r}),request:c({definitionPath:o}),process:rW(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=rS((e,{onProcessing:t,onData:n})=>{u(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==V$)throw e})},50);return function(e,{onProcessing:t=$$,onDataPage:n=$$}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var aW={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var sW={inTotal:function({layoutService:e,getReducedCube:t}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const n=t();if(n){const[t]=Jx({qHyperCube:n},e.refs.dataPages);if(t)return t.qArea.qHeight}const[r]=e.getDataPages();if(r)return r.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function lW(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function cW(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function uW(e){return cW(e.qMatrix,e=>e[0].qElemNumber)-1}var dW={inTotal:function({layoutService:e}){const t=lW(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=lW(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=lW(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=uW(o),c=o.qArea.qHeight*i+l,u=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[u,n.inView>=n.inTotal?u+1:u+c/n.inView]}};const fW=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function hW(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return fW(e,n);const r=((e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n})(t.qMatrix,n);return r.successful?r.count:fW(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return fW(e,n);return cW(t.qMatrix.slice(0,r.qTop+1),e=>e[0].qElemNumber)-1}}}var pW={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=hW(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:c}=n,u=hW(t).area(e(),l,a.qArea),d=uW(a),f=a.qArea.qHeight+d,h=c===o?(r.inView-f)*s/i:(c+(a.qArea.qTop+u)*s)/i;return[h,r.inView>=r.inTotal?h+1:h+f/r.inView]}};function mW({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:c,maxDataRows:u}){const{DEFAULT:d,SQUEEZE:f,LABELLESS:h}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:m="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height,b=v/l>=f;switch(m){case"max":return Math.min(l,u);case"custom":return Math.min(g,u);default:return c?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:c,fontSize:u,tiltAngle:d}=s.settings.settings.labels,{height:f}=l({fontFamily:c,fontSize:u,text:"M"});if(!t)return f>o;const h=(90-d)*(Math.PI/180);return f>Math.cos(h)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:f,label:y})?v/d:l:v/d}}function gW({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:c,getReducedCube:u}){const{inTotal:d,area:f,scaleRange:h}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?aW:n?r?dW:pW:sW}({layoutService:r}),p=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,m=e=>e?p()/e:0,g=(e,t)=>-(e-t)*m(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=d({layoutService:r,getReducedCube:u});return{inTotal:l,inView:mW({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(1e4/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return m(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,g(n,r))),o=r?Math.abs(r*i/p()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return g(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:p(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>f({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=h({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:p(),upperBound:g(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&c?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=g(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*m(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(m(r)*n)}}}}function yW({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:c,renderer:u,areaBuffer:d,viewState:f,rtl:h,getReducedCube:p}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const m=gW({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:c,renderer:u,areaBuffer:d,rtl:h,getReducedCube:p}),g=()=>{const e=m.getItems();return n.set("items",e),e},y=({pixelOffset:e,items:t})=>{const r=m.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},v=e=>{const t=Date.now(),r=g(),a=y({pixelOffset:e,items:r}),s=m.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])})(s))return void((m.validate.offset({pixelOffset:e,items:r})||f.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item})));f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=g();n.set("itemSize",m.getItemSize({items:a}));const c=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=f.get("scrollOffset");if(void 0===n)return 1===t?m.getUpperBound({items:e}):0;if("number"==typeof n)return m.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return m.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),u=y({pixelOffset:c,items:a});f.preventSet("viewRange",m.getViewRange({pixelOffset:u.start.pixel,items:a}));const d=m.getArea({itemOffset:u.start.item,items:a});return new Promise(e=>{i(d,{onDataPage:()=>{n.set("scaleRange",m.getScaleRange({offsets:u.start,items:a})),f.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;v(t)},scrollToRelative(e){const t=n.get("items"),r=m.convert.relativeToPixelOffset({relativeOffset:e,items:t});v(r)}}}function vW({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:c,options:{definitionPath:u="/qHyperCubeDef",getRect:d,axisKey:f,renderer:h,areaBuffer:p,processDataPage:m=()=>{},getReducedCube:g=()=>{}}={}}){const y=eS(),v=function({qMode:e}){switch(e){case"K":return X$;case"T":return J$;default:return G$}}({qMode:i.getHyperCubeValue("qMode")}),b=function({state:e,contains:t}){return e.set(Z$,[]),{add:t=>{const n=e.get(Z$);n.length=0,n.push(t)},getCurrent:()=>e.get(Z$)[0],getAll:()=>e.get(Z$),contains:n=>t(e.get(Z$)[0],n)}}({state:y,contains:v.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:b,composition:v});const x=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),S=oW({dataStore:b,composition:v,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:u,processDataPage:m}),w=yW({chart:e,componentKey:n,state:y,dataStore:b,pageData:S,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:f,renderer:h,areaBuffer:x,viewState:l,rtl:c,getReducedCube:g}),M=function({layoutService:e,dataStore:t}){return function(n){const r=Jx(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:b}),k=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[eW({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:tW({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:c,scroller:w});return{interactions:k,query:{getCanScroll:()=>w.enabled(),getItemSize:()=>w.itemSize(),getScaleRange:()=>w.scaleRange(),getCurrentDataPage:()=>b.getCurrent()},command:{initialize:()=>w.initialize(),scrollTo:e=>w.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var bW="AVERAGE",xW="LINEAR",SW="POLYNOMIAL2",wW="POLYNOMIAL3",MW="POLYNOMIAL4",kW="EXPONENTIAL",CW="LOG",qW="POWER";function EW({dimValue:e,value:t,qTrendLine:n}){const{qType:r,qCoeff:i}=n,o={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(r){case wW:return o.y+=i[3]*t**3,o;case MW:return o.y+=i[4]*t**4+i[3]*t**3,o;default:return o}}var DW={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:EW,polynomial3:EW,polynomial4:EW,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function TW(e,t){const n=DW[t.qType.toLowerCase()],r=Math.max(1,e/500);let i=1/0,o=-1/0;for(let a=0;a<e;a+=r){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),o=Math.max(e,o)}return{min:i,max:o}}function OW(e){return DW[e.qType.toLowerCase()]}function NW(e,t){return e.meta.isContinuous?function(e,t){return{generate:(n,r,i)=>{const o=[],a=OW(n),s=t.get("zoom"),l=n.start??s.min,c=n.end??s.max,u=(c-l)/100,d=e.meta.isButterfly&&i>0;if(u>0){const e=e=>{const t=a({dimValue:e,value:e,qTrendLine:n});d&&(t.y=-t.y),t.layerId=r,t.measureIndex=i,t.dimValue=e,o.push(t)};let t=l;for(let n=l;n<=c;n+=u)e(n),t=n;t!==c&&e(c)}return o},calculate:(e,t)=>OW(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map(({y:e})=>e);return{min:Math.min(...n),max:Math.max(...n)}}}}(e,t):e.meta.mode.K?function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qData[0].qSubNodes,s=o.qArea.qTop,l=DW[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e],c=l({dimValue:o.qElemNo,value:e+s+1,qTrendLine:t});c.layerId=n,c.measureIndex=r,c.dimValue=o.qText,i.push(c)}return i},findMinMax:TW}}(e):function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qMatrix,s=o.qArea.qTop,l=DW[t.qType.toLowerCase()],c=e.meta.isButterfly&&r>0;for(let e=0;e<a.length;e++){const o=a[e][0],u=e+s+1,d=l({dimValue:o.qElemNumber,value:u,qTrendLine:t});c&&(d.y=-d.y),d.layerId=n,d.measureIndex=r,d.dimValue=o.qText,i.push(d)}return i},calculate:(e,t,n)=>(0,DW[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:TW}}(e)}var AW={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},_W={color:"#f93f17",index:9};const{isDark:IW}=zO,LW={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},PW=({layoutService:e,viewState:t,colorModel:n,chart:r,env:i,keys:{colorScale:o},isEnabled:a=()=>!1})=>{const{translator:s}=i,l=[LW],c=[],u=[],d=NW(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach((e,t)=>{Array.isArray(e.qTrendLines)&&(c.push(...e.qTrendLines),u.push(...e.qTrendLines.map(()=>t)))});const f=tS(e=>{const{style:t}=c[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=u[e],n=r.scale(o)(t);return IW(n)?function(e){const t=LO(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=LO(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(_W)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"});return{query:{hasTrendLines:()=>!!c.length&&a(),getData:()=>l,getStroke:f,getLineDash:e=>{const{style:t}=c[e]||{};return t?.lineDash},getLineThickness:e=>{const{style:t}=c[e]||{};return t?.lineThickness??2},getLabel:e=>(c[e]||{}).label,getType:e=>{const{qType:t}=c[e]||{};return s.get(AW.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return c.forEach(r=>{const i=d.findMinMax(e.meta.size.y,r);t=Math.min(i.min,t),n=Math.max(i.max,n)}),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const r=c[e];return d.calculate(r,t,n)}},command:{update:()=>{l.length=0,c.forEach((e,t)=>{const n=d.generate(e,t,u[t]);l.push(...n)})}}}};var RW={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const zW=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,FW=(e,{layoutService:t,trendLineModel:n,dockService:r,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];const o=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:r,dockService:i,animationsEnabled:o})=>{const a=zW(r);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:RW,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:({datum:e})=>n.query.getLineThickness(e.layer.value),stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:o,trackBy:GN.nonUpdatingNode.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:r,animationsEnabled:i}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:r,dockService:i})=>{const o=zW(r),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:o},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:RW,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:r});return[o,a]};function jW(e,t){const{getLabel:n,getType:r,getLineDash:i,getStroke:o}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:o(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:r(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function BW(e,{h:t,style:n}){return e.map(e=>{const r={style:{direction:"string"==typeof e.content?FT.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(r.colspan=e.colspan);const i=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map(t=>e("span",{style:t.style,direction:FT.detectTextDirection(t.content)},t.content))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",r,i)})}function HW(e,t){return({h:n,data:r,style:i})=>{const o=r[0].title,a=r.filter(e=>e.title===o),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:FT.detectTextDirection(t)},t);return e("tr",{},n)}(n,o),l=[s];if(a.slice(0,2).forEach(e=>{l.push(n("tr",{},BW(e.row,{h:n,style:i})))}),r.length>2){const i=r.length-2;l.push(...function(e,t,n,r){const i=t?t.get("Object.ChartTooltip.NMore",r):`+${r} more`,o=FT.detectTextDirection(i);return[e("tr",{},e("td",{style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:o},colspan:3},i))]}(n,e,t,i))}return l}}function VW(e,{trendLineModel:t,translator:n},r={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=r,o=LT({key:e.tooltip,rtl:i});return kg(!0,o,{settings:{extract:jW(e,t),content:HW(n,i),placement:"pointer",direction:r.rtl?"rtl":"ltr"}})}function $W(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function WW(e,{chart:t,viewState:n,trendLineModel:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=$W(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=r.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(r,a)=>{const l=$W(r,t),c=t.shapesAt(function(e){return{cx:e.x,cy:e.y,r:3}}(l),s);if(c.length){const r=function(e,t,n,r){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=r?1-i:i;const{min:o,max:a}=n.get("zoom");return o+(a-o)*i}(l,a,n,o),s=t.scale(e.majorInnerScale),u=(s?.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(r);c.forEach(e=>{e.data.dimValue.value=r,e.data.dimValue.label=u,e.data.minor.value=i(e.data.layer.value,r).y})}return c}}return n=>{const r=t.component(e.tooltip);if(r&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some(t=>t.key===e.tooltipOverlay))(n)){const e=l(n,r);return e.length?(r.emit("show",n,{nodes:e}),!0):(r.emit("hide"),!1)}return!1}}const UW=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},YW=e=>{UW(e),e.qMultiDimMode="Sum",e.qXColIx=0};function KW(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:r=!1}=e;return{show:(e,t,{layout:n})=>!CT.dimensionless(n)&&!CT.groupedByDimension(n)&&(r||!CT.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:AW.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(AW.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:AW.ADD_BUTTON,add:YW,globalChange:e=>{const t=Jx(e,"qHyperCubeDef.qMeasures",[]).reduce((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e),[]),r=(e=>!Jx(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach(e=>{e.qContinuousXAxis=r}),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:AW.TYPE,options:[{value:bW,translation:AW.TYPES.AVERAGE},{value:xW,translation:AW.TYPES.LINEAR},{value:SW,translation:AW.TYPES.POLYNOMIAL2},{value:wW,translation:AW.TYPES.POLYNOMIAL3},{value:MW,translation:AW.TYPES.POLYNOMIAL4},{value:kW,translation:AW.TYPES.EXPONENTIAL},{value:CW,translation:AW.TYPES.LOG},{value:qW,translation:AW.TYPES.POWER}],defaultValue:bW},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:_W,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:AW.STYLE.DASHED,type:"boolean",defaultValue:!0,change:UW}}}}var GW,XW;var JW=function(){if(XW)return GW;XW=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},GW=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,r,i,o,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(r=this._events[t],e.isUndefined(r))return!1;if(e.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];r.apply(this,o)}else if(e.isObject(r)){for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(i=(s=r.slice()).length,a=0;a<i;a++)s[a].apply(this,o)}return!0},t.prototype.addListener=function(n,r){var i;if(!e.isFunction(r))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(r.listener)?r.listener:r),this._events[n]?e.isObject(this._events[n])?this._events[n].push(r):this._events[n]=[this._events[n],r]:this._events[n]=r,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var r,i,o,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,i=-1,r===n||e.isFunction(r.listener)&&r.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(r)){for(a=o;a-- >0;)if(r[a]===n||r[a].listener&&r[a].listener===n){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,r;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(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],e.isFunction(r))this.removeListener(t,r);else if(Array.isArray(r))for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},GW}(),ZW=mg(JW);const QW={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function eU(){const[t]=e.useState({}),[n]=e.useState({}),r=function(){const t=e.useLayout(),n=e.useTranslator(),r=!!t?.qSelectionInfo?.qInSelections,i=!!t?.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,[o,a]=e.useState(!1),[s,l]=e.useState(!1),[c,u]=e.useState({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),d=e=>{l("boolean"==typeof e?e:!s)};return e.useAction(()=>(u({key:"lasso",action:d,enabled:()=>o,active:()=>s}),{key:"lasso",label:n.get(s?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:QW,hidden:!o||!r||i,active:s,action:d}),[r,i,s,o,n.language()]),{get:()=>c,setAllows:e=>{a(!!e)}}}(),[i,o]=e.useState();return e.useEffect(()=>{const e={};e.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:e,discrete:r}=t;return n.allowScroll&&(e?.meta.isContinuous||r?.query.getCanScroll())}},e.interact={key:"interact",isEnabled:!0,enabled:()=>n.allowInteract},e.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>n.allowTooltip},e.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>n.allowSelect},e.lasso=r.get(),Object.keys(e).forEach(t=>{return n=e[t],Object.keys(ZW.prototype).forEach(e=>{n[e]=ZW.prototype[e]}),ZW.init(n),n;var n}),o(e)},[]),e.useEffect(()=>{i&&r&&(i.lasso={...i.lasso,...r.get()})},[r]),{get:()=>i,setAllows:e=>{Object.assign(n,e),r.setAllows(e?.allowSelect)},setContext:e=>{Object.assign(t,e)},destroy:()=>{Object.keys(i).forEach(e=>i[e].removeAllListeners())}}}var tU={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},nU={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",MINI_BAR:"mini-marker",GHOST_BAR_OOB:"ghost-bar",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip-qcm",SPACE:"space",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"}};const rU=({layout:e})=>{const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==T$),n=e?.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==T$);return 1===(t?.length??0)&&2===(n?.length??0)};function iU(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(ET).then(e=>{const n=t.getHyperCubeValue("qMode"),r=t.getHyperCubeValue("qDimensionInfo"),i="K"===n&&r.length>1&&e[0]?.qIsReduced,o=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=i?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:o,qDimensionInfo:r.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:i?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),r=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:r,qWidth:e.length+i.length+r,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}function oU({enigma:e,layoutService:t,viewModel:n,definitionPath:r,reducedHyperCubePath:i},o={}){const a=iU(e,t,r),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),c=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,r=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return r.should=e=>t&&n&&1===e.qDimensionInfo.length,r}({layoutService:t}),u={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>u,update(e){var r;c.should(e)&&c(e),u.mode=kg(u.mode,t.meta),u.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,u.mode.isStackedByDimension=u.mode.isStacked&&(2===(r=e).qDimensionInfo.length&&2===r.qMeasureInfo.length),u.mode.isStackedByMeasure=u.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),u.fields={major:u.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:u.mode.isStackedByDimension?e.qMeasureInfo.map((e,t)=>`qMeasureInfo/${t}`):n.fields.minor},u.scales={major:nU.SCALE.REDUCED.MAJOR,minor:nU.SCALE.REDUCED.MINOR},u.cube=e,o.qDataPages=e.qDataPages},fetchMinMaxData(){if(o.qDataPages)return Promise.resolve(o.qDataPages);let n=a.settings();const r="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=kg(!0,{},n,{rect:{qHeight:r}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then(e=>e)},setSnapshotData(e){e.reducedHyperCube=u.cube}}}function aU({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:r,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&r({componentName:"continuousRangeBrush",brushName:!1})}function sU({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function lU({layoutService:e,node:t}){const{isGroupedByDimension:n,isStackedByDimension:r,isDimensionless:i}=e.meta;return n?`${t.data.label}, ${t.data.group.label}`:r?`${t.data.label}, ${t.data.stack.label}`:i?void 0:t.data.label}function cU({chart:e,actions:t,translator:n,rtl:r,viewState:i,viewModel:o,layoutService:a,dockService:s,colorService:l,themeService:c,trendLineModel:u,custom:d}){const{isTwoDimensional:f,isStacked:h,isGroupedByDimension:p,isGroupedByMeasure:m,isStackedByDimension:g,isStackedByMeasure:y}=a.meta,{fontFamily:v}=c.getStyles(),b=function({layoutService:e,dockService:t}){const{BAR_AXIS:n,BAR_OOB_MIN:r,BAR_OOB_MAX:i,GROUP_AXIS:o}=nU.COMPONENT,{isGrouped:a,isGroupedByDimension:s}=e.meta,{orientation:l}=t.meta.chart,c="vertical"===l;return[({chart:e,hovered:t,meta:l,collected:u,collectedBounds:d})=>{const[f]=t,{triggerer:h}=l;if(h===r||h===i)return{key:f.key,bounds:f.bounds};if(c&&(h===n||h===o)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===r||e.key===i)&&e.data.value===f.data.value&&e.data.group.value===f.data.group.value:(e.key===r||e.key===i)&&e.data.value===f.data.value),o=e.findShapes("path").find(e=>s&&h===n?e.key===i&&e.data.value===f.data.value&&e.data.group.value===f.data.group.value:e.key===i&&e.data.value===f.data.value);if(t)return a?{key:o?o.key:nU.COMPONENT.BAR,bounds:d}:{key:t.key,bounds:t.bounds}}if(!c){const t=!u.some(e=>e.bounds.height+e.bounds.width!==0);if(t){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===r||e.key===i)&&e.data.value===f.data.value&&e.data.group.value===f.data.group.value:(e.key===r||e.key===i)&&e.data.value===f.data.value);if(t)return{key:t.key,bounds:t.bounds}}}return!1},"collectible"]}({layoutService:a,dockService:s}),x=WW({majorInnerScale:nU.SCALE.MAIN.MAJOR_INNER,tooltip:nU.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:nU.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:e,viewState:i,trendLineModel:u,layoutService:a,rtl:r}),S=({collected:t,triggerer:n})=>{if(h){t.splice(0,t.length);const r=e.findShapes("container").filter(e=>e.key===nU.COMPONENT.BAR&&e.data?.stack.value===n.data.value).filter(e=>y?e.data?.value===n.data.value:e.data?.stack.value===n.data.value);r.forEach(e=>{if(e.children.length){const[n]=e.children;n.key=e.key,t.push(n)}else t.push(e)})}};return ik({chart:e,translator:n,config:{rtl:r,enable:()=>t.tooltip.enabled(),getColorSettings:()=>l.getMain().getSettings(),style:{fontFamily:v},main:{key:nU.COMPONENT.BASE_TOOLTIP,suppress:({event:e})=>x(e),getGroupByValue:({data:e})=>e.value,collectibles:[{key:nU.COMPONENT.BAR,type:"bar",major:({data:e,meta:t})=>m?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:p?t.triggerer===nU.COMPONENT.BAR_AXIS||t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.group.value]:e.group.value:g?e.stack.value:e.value},{key:`${nU.COMPONENT.GHOST_BAR_OOB}-min`,type:"bar",if:()=>!y&&!g,major:({data:e,meta:t})=>m?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:p?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX||t.triggerer===nU.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value},{key:`${nU.COMPONENT.GHOST_BAR_OOB}-max`,type:"bar",if:()=>!y&&!g,major:({data:e,meta:t})=>m?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:p?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX||t.triggerer===nU.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value}],triggers:[{keys:[nU.COMPONENT.BAR],collect:{from:"single"},placement:b},{keys:[nU.COMPONENT.BAR_AXIS],collect:{from:"dimension",by:({data:e})=>p?[e.value,e.group.value]:e.value,after:S},placement:b},{keys:[nU.COMPONENT.BAR_OOB_MIN,nU.COMPONENT.BAR_OOB_MAX],collect:{from:"dimension",by:({data:e})=>m?[e.value,e.measureIndex.value]:p?[e.value,e.group.value]:e.value,after:S},placement:b},{keys:[nU.COMPONENT.GROUP_AXIS],collect:{from:"dimension",by:({data:e})=>e.group.value},placement:b}],layout:{grouping:f,single:()=>!(!d.isEnabled()||!d.hasImages())||d.chart.isEnabled()},section:({h:t,nodes:n,dataset:r,formatter:i,create:s,util:l})=>{const[c]=n,{title:u,description:f,measures:h}=d.isEnabled()?d.getAttributes({dataset:r,nodes:[c]}):{},p=[];u&&p.push(s.text({value:u,style:{bold:!0},survive:{visibility:!0},visibility:{count:!1}})),f&&p.push(s.text({value:f,survive:{visibility:!0},visibility:{count:!1}}));const m=d.hideBasic();if(m&&!h.length&&(u||f)||p.push(s.text({value:lU({layoutService:a,node:c}),style:{bold:!0}})),!m){const t=void 0!==c.data.fill?.value?e.scale(nU.SCALE.MAIN.COLOR)(c.data.fill.value):void 0;p.push(s.color({nodes:n,property:nU.SCALE.MAIN.COLOR,fillColor:t})),p.push(...n.map(e=>function({viewModel:e,layoutService:t,formatter:n,create:r,util:i,node:o}){const{isStacked:a,isStackedByDimension:s}=t.meta;if(a){const t=n(nU.FORMATTER.MINOR),{segment:a}=o.data,l=s&&t?t(a.value):a.label;return r.measure({label:i.dataset.title(o.data.source.key,e.fields.minor[s?0:o.data.measureIndex.value]),value:!0===o.data.null?.value||"NaN"===l?"-":l})}const{data:l}=o,{end:c}=l,{key:u,field:d}=c.source;return r.measure({label:i.dataset.title(u,d),value:c.label})}({viewModel:o,layoutService:a,formatter:i,create:s,util:l,node:e})))}h&&p.push(...h.map(e=>s.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0,visibility:!0},visibility:{count:!1}}))),d.chart.isEnabled()&&(d.chart.hasLimitation()?(d.chart.destroy(),p.push(s.raw({value:d.chart.createLimitationRow(),survive:{visibility:!0},visibility:{count:!1}}))):p.push(s.raw({value:d.chart.createContainer({h:t}),survive:{visibility:!0},visibility:{count:!1}})));const{customTooltipImages:g}=c.data;return d.isEnabled()&&g&&p.push(...g.map(e=>s.raw({value:d.createImageRow({value:e,h:t}),survive:{visibility:!0},visibility:{count:!1}}))),p.filter(Boolean)},sections:({nodes:t,formatter:r,meta:i,create:o,sections:a})=>{if(!h||i.triggerer!==nU.COMPONENT.BAR_AXIS)return;const[s]=t,[l]=e.findShapes("container").filter(e=>e.key===nU.COMPONENT.STACK_TOTAL_BAR&&e.data&&e.data.value===s.data.stack.value);if(!l)return;const c=r(nU.FORMATTER.MINOR),u=[];if(l.data.sumOfPositives.value>0){const{value:e}=l.data.sumOfPositives;u.push(o.measure({label:n?n.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives",value:c?c(e):e,visibility:{force:!0}}))}if(l.data.sumOfNegatives.value<0){const{value:e}=l.data.sumOfNegatives;u.push(o.measure({label:n?n.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives",value:c?c(e):e,visibility:{force:!0}}))}a.unshift(o.section({content:[o.text({value:l.data.label,style:{bold:!0},visibility:{force:!0}}),...u]}),o.divider({visibility:{force:!0}}))},events:{tooltip:{beforeShow:({collectNodes:e})=>d.isEnabled()&&d.hasImages()?d.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{d.chart.isEnabled()&&!d.chart.hasLimitation()&&d.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{d.chart.isEnabled()&&d.chart.hasAlternateState()&&d.chart.hide()}}}},legend:{keys:{tooltip:nU.COMPONENT.LEGEND_CAT_TOOLTIP,component:nU.COMPONENT.LEGEND_COLOR_CAT}}}})}const uU={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:r}=n[t];return r},getDimensionSize(e){const t=e?.qCardinalities?.qHypercubeCardinal,{qLocked:n=0,qOption:r=0,qSelected:i=0}=e?.qStateCounts||{};return[void 0,0].includes(t)?n+r+i:t}};function dU({layoutService:e}){return function(e){var t,n=e.layout,r=e.config,i=void 0===r?{}:r,o={disclaimer:void 0,isSuppressing:!1,showDisclaimer:null!==(t=i.args)&&void 0!==t&&t.layoutService?i.args.layoutService.getLayoutValue("showDisclaimer"):null==n?void 0:n.showDisclaimer};return{initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).args;o.disclaimer=function(e){var t=e.args,n=e.disclaimers,r=[];return Object.keys(n).forEach(function(e){var i=Fx[e],o=n[e];o&&(o.condition||(null==i?void 0:i.condition)||jx)(t)&&r.push({key:(null==i?void 0:i.translationKey)||(null==i?void 0:i.key)||e,alignment:o.alignment||(null==i?void 0:i.alignment)||zx})}),r.find(function(e){return e.alignment===Rx})||r[0]}({args:py(py({layout:n},i.args),e),disclaimers:i.disclaimers||{}}),o.isSuppressing=!(!o.disclaimer||o.disclaimer.alignment!==Rx)},getDisclaimer:function(){return o.isSuppressing?o.disclaimer:!1===o.showDisclaimer?void 0:o.disclaimer},getHasSuppressingDisclaimer:function(){return o.isSuppressing}}}({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0,LimitedData:{condition:()=>{const{isContinuous:t,isTwoDimensional:n}=e.meta;if(!t||!n)return!1;const r=e.getLayout().qHyperCube.qDimensionInfo[1];return uU.getDimensionSize(r)>vT.maxNumberOfLines}},OnlyNegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.every(e=>{const{qMin:t,qMax:n}=e;return t<0&&n<0})}return!1},alignment:"center"},NegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.some(e=>{const{qMin:t}=e;return t<0})}return!1}}}}})}function fU({picasso:t,chart:n,environment:r,viewState:i,viewCache:o}){const a=e.useStaleLayout(),s=e.useModel(),l=e.useApp(),c=e.usePlugins(),u=e.useSelections(),d=e.useOptions(),[f,h]=e.useState(),[p,m]=e.useState(),[g,y]=e.useState(),v=e.useConstraints(),b=eU();return e.useEffect(()=>{if(!n)return()=>{};const e=b.get(),t=function({chart:e,actions:t,selections:n}){const r=e.scale(nU.SCALE.MAIN.MAJOR),i=mM({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:r,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:aU},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}});return i}({chart:n,actions:e,selections:u});return m(e),y(t),()=>{t.destroy(),b.destroy()}},[n]),e.useEffect(()=>{if(!v)return;const e={allowScroll:!v.active,allowInteract:!v.active,allowTooltip:!v.passive,allowSelect:!v.select&&!v.active};b.setAllows(e)},[v]),e.useEffect(()=>{if(!g||!r)return;const{theme:e,translator:u,localeInfo:f,flags:m,embed:y}=r,{direction:v="ltr"}=d,x="rtl"===v,S=lS({source:a,metaAdditionsFn:({layout:e})=>{const t=vT.canBeContinuous(e),n=CT.continuous({layout:e}),r=CT.dimensionless(e),i=rU({layout:e})&&"butterfly"===e?.barGrouping?.grouping;return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:vT.isTime(n,e),isDimensionless:r,isSimple:CT.simple(e),isGrouped:!i&&CT.grouped(e),isGroupedByMeasure:!i&&CT.groupedByMeasure(e),isGroupedByDimension:!i&&CT.groupedByDimension(e),isStacked:!i&&CT.stacked(e),isStackedByDimension:!i&&CT.stackedByDimension(e),isStackedByMeasure:!i&&CT.stackedByMeasure(e),isSnapshot:CT.snapshot(e),isButterfly:i}},experimental:{filter:!0}});g.setFilteredFields(S.meta.filteredFields);const w=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(S.getLayout())?lS({source:S.getLayout()}):void 0,M=function({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:a,options:d}),k=function({layoutService:e,viewCache:t,options:n}){const r={};return r.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map((e,t)=>`qDimensionInfo/${t}`),minor:e.getHyperCubeValue("qMeasureInfo").map((e,t)=>`qMeasureInfo/${t}`)};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),r.selectionDimensionIdx=(e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const r=e.qDimensionInfo[n];if(!(r.qLocked||r.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}})(e.getHyperCube()),r.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,r.selectionDimensionProp=e=>void 0===r.selectionDimensionIdx||void 0!==e&&r.selectionDimensionIdx!==e?{}:{selectionDimension:{field:r.selectionDimensionIdx}},r.animations={enabled:()=>!(!1===n.chartAnimations||r.animations.isPartialUpdating||r.animations.isSizeChanging||r.animations.hasSlicedHats||GN.propertiesHaveChanged({viewCache:t,layout:e.getLayout()})),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},r}({layoutService:S,viewCache:o,options:d}),C=Xx({chart:n,layoutService:S,config:{logicalSize:M,rtl:x},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),q=dU({layoutService:S}),E=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:wM(a),styles:void 0};return d.styles=CM({theme:t,id:i,transform:l,extend:u,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=CM({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:e,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]],resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),D=dT.model({model:s,layoutService:S,viewCache:o,viewState:i}),T=oU({enigma:s,layoutService:S,viewModel:k});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const r=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",r.scrollOffset),t.preventSet("legendScrollOffset",r.legendScrollOffset||0),r.zoom&&t.preventSet("zoom",r.zoom)}({layoutService:S,viewState:i,viewStateOptions:d?.viewState});const O=function({app:e,model:t,translator:n,picasso:r,localeInfo:i,theme:o,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:c}){const{isContinuous:u,isStacked:d}=s.meta,f={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const h=[],{isReduced:p}=c.model().mode,m=u||p||d,g=!u&&(p||d)&&l?l.getHyperCube():void 0,y=g?"legendCube":void 0;return f.main=Px({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:sU,key:nU.SCALE.MAIN.COLOR},createConfig:()=>({hc:m?g||s.getHyperCube():c.model().cube,source:m?y:"miniCube",theme:o})}),h.push(f.main.initialize()),u&&(f.mini=Px({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:sU,key:nU.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:o})}),h.push(f.mini.initialize())),Promise.all(h)},getMain:()=>f.main,getMini:()=>f.mini}}({picasso:t,model:s,app:l,translator:u,localeInfo:f,theme:e,continuousDataModel:D,layoutService:S,legendLayoutService:w,reducedDataModel:T}),N=function(e){var t,n=e.app,r=e.translator,i={initialized:!1,dimensions:[],measures:[]};return{initialize:(t=dy(gy().m(function e(t){var o,a,s,l,c,u,d;return gy().w(function(e){for(;;)switch(e.n){case 0:if(o=t.properties,!i.initialized){e.n=1;break}return e.a(2);case 1:return s=[Xv(a={app:n,translator:r,properties:o}),Qv(a)],e.n=2,Promise.all(s);case 2:l=e.v,c=vy(l,2),u=c[0],d=c[1],i.dimensions=u,i.measures=d,i.initialized=!0;case 3:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),getAlternatives:function(){return{dimensions:by(i.dimensions),measures:by(i.measures)}}}}({app:l,translator:u}),A=function({layoutService:e,themeService:t,colorService:n}){const r=t.getStyles(),i=t=>(e.getLayoutValue("components",[])||[]).find(e=>e.key===t),o=(e,t)=>{const r=n.getMain().getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=i("axis")?.axis?.title;return{fontFamily:e?.fontFamily??r.axis.title.fontFamily,fontSize:e?.fontSize??r.axis.title.fontSize,color:o(e?.color,r.axis.title.color)}}},label:{getStyle:()=>{const e=i("axis")?.axis?.label?.name;return{fill:o(e?.color,r.axis.label.name.color),fontSize:e?.fontSize??r.axis.label.name.fontSize,fontFamily:e?.fontFamily??r.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{const e=i("legend")?.legend?.title;return{fontFamily:e?.fontFamily??r.legend.title.fontFamily,fontSize:e?.fontSize??r.legend.title.fontSize,color:o(e?.color,r.legend.title.color)}}},label:{getStyle:()=>{const e=i("legend")?.legend?.label;return{fontFamily:e?.fontFamily??r.legend.label.fontFamily,fontSize:e?.fontSize??r.legend.label.fontSize,color:o(e?.color,r.legend.label.color)}}}},label:{getStyle:()=>{const e=i("label")?.label?.value;return{fill:o(e?.color,r.label.value.color),useContrastColor:e?.useContrastColor??!0,fontSize:e?.fontSize??r.label.value.fontSize,fontFamily:e?.fontFamily??r.label.value.fontFamily}}}}}({layoutService:S,themeService:E,colorService:O}),_=PW({layoutService:S,viewState:i,colorModel:{settings:()=>O.getMain().getSettings(),resolveUIColor:e=>O.getMain().getPaletteColor(e)},chart:n,env:r,keys:{colorScale:nU.SCALE.MAIN.COLOR},isEnabled:()=>!S.meta.isGroupedByDimension&&!S.meta.isDimensionless});q$.attrExpr.updateProperties(s,a);const I=v$({layout:a,app:l,model:s,picasso:t,chart:n,translator:u,localeInfo:f,embed:y}),L=D$({app:l,chart:n,embed:y,flags:m,layout:S.getLayout(),localeInfo:f,model:s,options:{direction:d.direction},picasso:t,translator:u}),P=cU({chart:n,actions:p,translator:u,rtl:x,viewState:i,viewModel:k,layoutService:S,dockService:C,colorService:O,themeService:E,trendLineModel:_,custom:L});let R;S.meta.isDiscrete&&(R=vW({chart:n,actions:p,componentKey:nU.COMPONENT.BAR,enigmaModel:s,layoutService:S,dockService:C,trendLineModel:_,itemWidths:tU,viewState:i,rtl:x,options:{axisKey:nU.COMPONENT.BAR_AXIS,renderer:t.renderer("svg")()}}));const z=nA({layoutService:S,discreteModel:R}),F=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:nU.SCALE.MAIN.MINOR,MAJOR:nU.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:nU.COMPONENT.BAR,BAR_AXIS:nU.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:nU.COLLECTION.MAIN}}}}(S),j=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return dy(gy().m(function e(){var r,a,s,l;return gy().w(function(e){for(;;)switch(e.n){case 0:if(!o.initialized){e.n=1;break}return e.a(2);case 1:return a=Promise.all(n.filter(function(e){return"custom-component"===e.info.type}).map(function(){var e=dy(gy().m(function e(n){var r;return gy().w(function(e){for(;;)switch(e.n){case 0:if(n.info.componentName){e.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return e.n=2,n.fn(py({},i));case 2:if("object"===xy(r=e.v)){e.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:t.component(n.info.componentName,r);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter(function(e){return"component-definition"===e.info.type}).map(function(e){return e.fn(py({},i))})),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(r=o.definitions).push.apply(r,by(l[1]));case 3:return e.a(2)}},e)}))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach(function(t){var n=vy(e.filter(function(e){return e.key&&e.key===t.key}),1)[0];if(n){var r=nb(!0,{},n.brush);nb(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===xy(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=cS({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=cS({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)}),e):e}}}({picassoInstance:t,plugins:c||[],pluginArgs:F});b.setContext({discrete:R,layoutService:S}),h({alternativeService:N,discrete:R,continuous:dT,legendLayoutService:w,layoutService:S,viewModel:k,dockService:C,themeService:E,styleService:A,continuousDataModel:D,reducedDataModel:T,colorService:O,trendLineModel:_,refLineModel:z,pluginService:j,customTooltipModel:I,tooltipService:P,selectionService:g,logicalSize:M,disclaimerService:q,customTooltipService:L})},[g,d,r,a]),f}function hU(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function pU(e){return e.some(hU)}function mU(e,t){let n=NaN,r=NaN;return e.forEach(e=>{pU(e)||e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),r=Number.isNaN(r)?e.qNum:Math.max(e.qNum,r))})}),{min:n,max:r}}function gU(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const r=e.getLayoutValue("measureAxis.minMax");e.meta.isButterfly||"min"!==r&&"minMax"!==r||(t=+e.getLayoutValue("measureAxis.min")),"max"!==r&&"minMax"!==r||(n=+e.getLayoutValue("measureAxis.max"),e.meta.isButterfly&&(t=-n))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function yU(e,t){let n=NaN,r=NaN;return e.forEach(e=>{if(!pU(e)){let i=0,o=0;e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?o+=e.qNum:i+=e.qNum)}),n=Number.isNaN(n)?i:Math.min(i,n),r=Number.isNaN(r)?o:Math.max(o,r)}}),{min:n,max:r}}function vU(e,t){const n={};e.forEach(e=>{if(!pU(e)){const r=e[0].qElemNumber;n[r]=n[r]?n[r]:{min:0,max:0,cId:r},e.slice(t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[r].max+=e.qNum:n[r].min+=e.qNum)})}});let r=NaN,i=NaN;return Object.keys(n).forEach(e=>{r=Number.isNaN(r)?n[e].min:Math.min(n[e].min,r),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)}),{min:r,max:i}}function bU(e){return"number"==typeof e&&!Number.isNaN(e)}function xU(e){const{meta:t}=e,n=e.getHyperCubeValue("qMeasureInfo");return t.isButterfly?{min:Math.min(0,bU(n[1].qMax)?-n[1].qMax:0),max:Math.max(0,bU(n[0].qMax)?n[0].qMax:0)}:{min:Math.min(...n.filter(e=>bU(e.qMin)).map(e=>e.qMin)),max:Math.max(...n.filter(e=>bU(e.qMax)).map(e=>e.qMax))}}const{isNumber:SU}=oN;function wU(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function MU(e){return!Number.isNaN(+e.qNum)}function kU(e){return e.qNum}function CU(e){return!Number.isNaN(+e.qNum)}function qU(e){return e.qNum}function EU(e,t){return e.push(...t),e}const{getValueWithOffset:DU,isNumber:TU}=oN;function OU(e,t){return Math.abs(e/t)<5||0===t}function NU({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:r=yU,stackedByDimensionExtractor:i=vU,straightExtractor:o=mU,measureInfoExtractor:a=xU,explicitExtractor:s=gU}=n,{meta:l}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:r,count:i}){let o,a;if(Array.isArray(n)?({min:o,max:a}=this.extractFromStacked(n)):({min:o,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();o=Number.isFinite(e)?Math.min(o,e):o,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(r),c=this.extractExplicit(),u=[0,o,a].filter(e=>TU(e));let d=Math.min(...u),f=Math.max(...u);d=OU(s,d)?Math.min(d,s):d,f=OU(l,f)?Math.max(f,l):f;const h=[c.explicitMin,c.explicitMax,d,f].filter(e=>TU(e));return o=Number.isNaN(c.explicitMin)?Math.min(...h):c.explicitMin,a=Number.isNaN(c.explicitMax)?Math.max(...h):c.explicitMax,o===a&&(Number.isNaN(c.explicitMin)?o=DU(o,-.2):Number.isNaN(c.explicitMax)&&(a=DU(a,.2))),{min:o,max:a,implicitMin:d,implicitMax:f,otherMin:s,otherMax:l,hasOtherMin:s<o,hasOtherMax:l>a,...c}},extractExplicit(){const{min:t,max:n,isExplicitMin:r,isExplicitMax:i}=s(e);return{hasExplicitMinMax:r||i,hasExplicitMin:r,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked:e=>function(e){return e.length?{min:Math.min(...e[0].qSubNodes.filter(e=>SU(e.qMinNeg)).map(e=>e.qMinNeg)),max:Math.max(...e[0].qSubNodes.filter(e=>SU(e.qMaxPos)).map(e=>e.qMaxPos))}:{min:0,max:0}}(e.length?e[0].qData:[]),extractFromStraight(t,n){const s=t.length?t[0].qMatrix:[];return l.isStackedByMeasure?r(s,n):l.isStackedByDimension?i(s,n):e.getHyperCubeValue("qHasOtherValues")?o(s,n):a(e)},extractOthers:e=>l.isStackedByDimension?function(e){const t=wU(Jx(e,"0.qData.0.qSubNodes",[]),hU,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):l.isGroupedByDimension?function(e){const t=Jx(e,"0.qMatrix",[]).filter(pU).reduce(EU,[]).filter(CU).map(qU);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=wU(Jx(e,"0.qMatrix",[]),pU,[]).filter(MU).map(kU);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function AU(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:r,getHyperCubeValue:i}=t,o=e=>!e.length&&r.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!r.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(r.isContinuous){const e=r.isStackedByDimension?s:t;return n.fetchMinMaxData().then(t=>({qDataPages:t,count:e}))}const c=r.isStackedByDimension?1:t;return e.fetchMinMaxData().then(e=>{if(o(e))return a(l);let t=[];return l&&(t=r.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:c,others:t}})}}}(e),n=NU(e);return t.resolve().then(e=>n.extract(e))}const _U="lasso",IU=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:_U,enable(e,n){if(this.started===_U||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==_U&&(i.actions.select.emit("start",_U),this.chart.component(e).emit("lassoStart",t),this.started=_U)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",_U),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const LU=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),c=o.hitRadius?o.hitRadius(a):0,u=c>0?{cx:n.x,cy:n.y,r:c}:n,d=o.shapesAt?o.shapesAt(u):this.chart.shapesAt(u,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),f=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&f&&f.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(f&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,f,{nodes:n,opts:o,customTooltipModel:e})}else f.emit("show",t,{nodes:d})}else h&&f.emit("hide")}}}};const PU=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const RU=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function zU(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:c=!1,multiple:u=!1,toLabel:d,onEdited:f}=e;return{key:t,type:"brush-range",layout:{dock:n.map(e=>`@${e}`).join(",")},on:f?{bubbleEnd(){f()}}:{},settings:{brush:c?{context:"selection",observe:!0}:"selection",scale:s,multiple:u,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=RU(e,t,"range");return{interactions:[e.onEdited?PU(e,t):null,r].filter(Boolean),components:[n]}}const FU={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},jU="inner-time-axis",BU="outer-time-axis";const HU={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const r=t?0:e.qDimensionInfo.length-1;n=uU.getMaxGlyphCount(e,r)}else e.qMeasureInfo.forEach(e=>{n=Math.max(n,e.qFallbackTitle.length)});return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?Jx(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=HU.getAxisData(e,t),r=!e.qDimensionInfo.length,i=r||t?void 0:e.qDimensionInfo.length-1,o=HU.getMajorAxisMaxGlyphCount(e,t),a=r?"qFallbackTitle":"qText";return AT.getAdjustedMaxGlyphCount(o,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=HU.getAxisData(e),n=uU.getMaxGlyphCount(e,0);return AT.getAdjustedMaxGlyphCount(n,t,0)}};var VU=3,$U=13;function WU(e,t,n,r){const{meta:i}=t.layoutService,o=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?o.push(...function(e,t,n,r){const{meta:i}=t.layoutService,{axis:o,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:c}=t.layoutService.getLayoutValue("gridLine",{}),u=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,f=FU[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,h={type:"grid-line",x:{},layout:{minimumLayoutMode:FU.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.lines.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}},p=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",r=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:o.line.major.color},minorGuideLine:{stroke:o.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:r},guideLine:{major:{justify:r},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isTime:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isTime:!0})}};u.push(kg(!0,{},d,{key:jU,scale:nU.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===c}},style:kg(!0,{},a,{line:{stroke:o.line.major.color},majorGuideLine:{stroke:o.line.minor.color},minorGuideLine:{stroke:o.line.major.color}})})),u.push(kg(!0,{},d,{key:BU,scale:nU.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),u.push({type:"axis-overlay",key:"outer-axis-overlay",scale:nU.SCALE.MAIN.MAJOR,layout:{dock:`@${BU}`,minimumLayoutMode:f}}),u.push({type:"axis-overlay",key:"inner-axis-overlay",scale:nU.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${jU}`,minimumLayoutMode:f}}),u.push(p)}return u.push(kg(!0,{},h,{key:"inner-time-grid",x:{scale:nU.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),u.push(kg(!0,{},h,{key:"outer-time-grid",x:{scale:nU.SCALE.MAIN.MAJOR}})),u}if(i.isContinuous){const e="continuous-axis";d&&(u.push({type:"axis",key:e,renderer:rA(),scale:nU.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:o.line.major.color},line:{show:!r},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isContinuous:!0})}}),u.push({type:"axis-overlay",key:"inner-axis-overlay",scale:nU.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:f}}),u.push(p)),u.push(kg(!0,{},h,{key:"continuous-grid",x:{scale:nU.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return u}(e,t,n,r)):o.push(...function(e,t,n,r){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,o=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),c="horizontal"===t.dockService.meta.major.orientation,u=c?e.dimensionAxis.label:"auto",d="horizontal"===u?void 0:t.dockService.meta.minor.size/4,f=t.styleService.axis.label.getStyle(),h={type:"axis",renderer:rA(),layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:FU[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:u,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...f},line:{show:!r,stroke:o.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isHorizontal:c})}};l&&a.push(kg(!0,{},h,{key:"group-axis",scale:nU.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":h.settings.labels.mode,maxGlyphCount:HU.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(c||!s)&&h.settings.line.show}}}));const p=HU.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(kg(!0,{},h,{key:nU.COMPONENT.BAR_AXIS,scale:nU.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:p,maxLengthPx:d,tiltThreshold:p>VU&&p<$U?1:void 0},line:{show:!(c&&l)&&h.settings.line.show}}})),c||2!==a.length?a:[a[1],a[0]]}(e,t,n,r));const l=t.themeService.getStyles(),c=t.styleService.axis.label.getStyle();return a&&o.push({type:"axis",key:"y-axis",renderer:rA(),formatter:nU.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:FU.measureAxis.minimumLayoutMode},scale:nU.SCALE.MAIN.MINOR,settings:{labels:{show:s,...c},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),o}var UU={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function YU({layoutService:e,discrete:t}){const{isContinuous:n,isGrouped:r}=e.meta,i=(e.getLayoutValue("components",[])||[]).filter(e=>"bar"===e.key)[0];if(i?.style?.width){const{style:e}=i;return e.strokeWidth&&"none"!==e.strokeWidth&&!n?function(){const n=UU.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),r=e.width+n;return r>1?e.width-(r-1):e.width}:e.width}return r?.9:.7}const{isNumber:KU}=oN,GU=["$year","$yearquarter","$quarter","$yearmonth","$month","$weeknumber","$yearweek","$week","$weekday","$day","$date"],XU={seconds:1/86400,minutes:1/1440,hours:1/24,days:1,weeks:7,months:365/12,quarters:91.25,years:365,number:1},JU={$date:1,$day:1,$weekday:1,$week:1,$yearweek:7,$weeknumber:1,$month:1,$yearmonth:365/12,$quarter:1,$yearquarter:91.25,$year:365},ZU=({data:e,layout:t})=>{const n=t.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;if("auto"!==n)return XU[n||"none"]||1;const r=t.qHyperCube?.qDimensionInfo?.[0]?.qTags||[];for(let e=0;e<GU.length;e+=1)if(-1!==r.indexOf(GU[e]))return JU[GU[e]]||1;return(({data:e,layout:t})=>{const n=(t.qHyperCube?.qDimensionInfo?.[0]?.qAttrExprInfo||[]).find(e=>"firstDimensionDiff"===e.id);let r=Number(n?.qFallbackTitle);if(KU(r))return r;const i=e.items.map(e=>e.timeStart.value);return r=aN.findMinPositiveDistance(i),r})({data:e,layout:t})};function QU({opts:e,MIN_BAR_WIDTH:t,isMiniChart:n=!1}){return({data:r,mainRect:i,maxBarWidth:o})=>{const{viewState:a,viewCache:s}=e,{min:l,max:c}=n?{min:s.get("continuousMin"),max:s.get("continuousMax")}:a.get("zoom"),u=Math.max(0,(({data:e,width:t,min:n,max:r,opts:i})=>{if(r===n)return t;const o=i.layoutService.getLayout(),a=(o.qHyperCube?.qDimensionInfo?.[0]?.continuous.stepSize||1)*ZU({data:e,layout:o});return a<=0?t:a/(r-n)*t})({data:r,width:i.width,min:l,max:c,opts:e}));return Math.max(t,Math.min(u,o))}}const eY={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function tY(e,t,n={}){const r=QU({opts:e,MIN_BAR_WIDTH:2});return({data:i})=>{const{chart:o,viewState:a,viewCache:s,layoutService:l,discrete:c}=e,u=o.component(t).rect;if(!i.items.length||!u)return 2;const{min:d,max:f}=a.get("zoom");if(n[[d,f]])return n[[d,f]];const h=l.getLayout();let p;n={};let m=eY[pT.getLayoutMode(u.width,Number.MAX_VALUE)];const g=h.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;if(g&&"none"!==g){m=u.width;p=YU({layoutService:l,discrete:c})*r({data:i,mainRect:u,maxBarWidth:m})}else{const e=Math.abs(f-d),t=Math.abs(s.get("continuousMax")-s.get("continuousMin"));if(0===t)return m;const n=function(e,t,n){return e*(1-n)+t*n}(2,m,1-Math.min(e/t/.2,1));p=Math.max(2,Math.min(m,n))}return n[[d,f]]=p,n[[d,f]]}}function nY(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r<=0}function rY(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r>=0}function iY(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r>0}function oY(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r<0}const aY="max",sY="min",lY={min:"Min",max:"Max"};function cY(e,t,n){return void 0===n?nY(e,t)||rY(e,t):n===aY?nY(e,t):rY(e,t)}function uY({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${lY[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===aY?e.implicitMax:e.implicitMin;return!cY(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function dY(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,dockService:o,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===aY?s.implicitMax:s.implicitMin;if(!cY(Number(l.toFixed(13)),s,n))return!1;const{orientation:c}=t.settings,u=n===aY?o.meta.minor.end:o.meta.minor.start;let d="end";r&&(d=n===aY?"sumOfPositives":"sumOfNegatives");const f=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:u},data:t.data,brush:t.brush,settings:{orientation:c,major:t.settings.major,minor:t.settings.minor,dockValue:DT.getDockValue(u),oob:kg({},t.settings.box,{fill:f.outOfRange.color,alignment:1,opacity:1,show:function(e){return!0!==e.datum.null?.value&&((!r||0!==e.datum[d].value)&&cY(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:GN.barOobs.compensateForLayoutChanges}}}function fY(e){return Math.min(Math.max(0,e),1)}const hY=(e,{chart:t,type:n,componentKey:r,collectionKey:i})=>{const{layoutService:o,dockService:a,viewCache:s}=e,{isStacked:l}=o.meta,c=s.get("minorMinMax"),{meta:u}=e.layoutService;if(!uY({minorMinMax:c,type:n}))return!1;let d;u.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:u.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);const f={type:"box",key:`${nU.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:nU.SCALE.MAIN.MAJOR,fn:d},minor:{scale:nU.SCALE.MAIN.MINOR,start:e=>fY(t.scale(nU.SCALE.MAIN.MINOR)(e?.datum?.start?.value||0)),end(e){const r=t.scale(nU.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r[n]();return fY(r(o))}},box:{width:YU({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const r=t.scale(nU.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r.max();return"max"===n?o>r.max():o<r.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}};return f};function pY(e,t){const{style:n,styleService:r,dockService:i}=t,o=r.label.getStyle(),a=o.useContrastColor&&!e.onBackground?function(e){return function(t){return zO.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):o.fill,s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function mY(e){return{placements:e.simplifiedPlacements.map(t=>pY(t,e)),label:e.label}}function gY(e,t){if(t){if(function(e,t){return nY(e,t)}(e,t))return-1;if(function(e,t){return rY(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function yY(e,t,n,r){const i=gY(e,r);let o="up";return"vertical"===t&&i<0?o="down":"horizontal"===t&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}function vY(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!r||!i&&!!n.showSegmentLabels}function bY(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!!r&&(!!i||!1!==n.showTotalLabels)}function xY(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function SY({layout:e,component:t,minorScale:n},r,i){if(!vY(e,r))return!1;const{viewModel:o,ds:a,viewCache:s,layoutService:l,dockService:c,themeService:u}=r,{meta:d}=l,f=s.get("minorMinMax"),h=u.getStyles(),p=r.styleService.label.getStyle();let m;!d.isStacked&&(m=d.isStacked?1:0);const g=0===m?1:0,y=d.isStacked?.5:1,v=o.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let x,S=-1;x=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>S?b(e.data.segment.value):""}:function(e){return e.data.end.label};const w={label:x,simplifiedPlacements:xY(m,g,y,d.isContinuous),style:h.label.value},M=[mY(kg(r,w))],k={component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>yY(e.data.end.value,c.meta.minor.orientation,i,f),labels:M,fontSize:parseInt(p.fontSize,10),fontFamily:p.fontFamily,linkData:GN.labels.linkData}}},C=[k],q={key:"bar-labels",type:"labels",renderer:rA(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:C},animations:{enabled:r.viewModel.animations.enabled,trackBy:GN.labels.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(q.beforeRender=()=>{S=function(e,t,n){const r="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),o=i&&i.rect?i.rect[r]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/o}(t,r,n)}),q}function wY(e,{fill:t}){return{[nU.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[nU.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const MY=1,kY=3;function CY(e){return e.getLayoutValue("gridLine.auto")}function qY(e){return!CY(e)&&e.getLayoutValue("gridLine.spacing")===MY}function EY(e){return!CY(e)&&e.getLayoutValue("gridLine.spacing")===kY}const DY=e=>({enabled:e.animations.enabled,trackBy:GN.lines.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}),TY=(e,{themeService:t,layoutService:n,dockService:r,viewModel:i})=>{if(!CY(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:o}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:FU.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!qY(n)||((e,t)=>t%2==0),stroke:o.line.major.color},minorTicks:{show:EY(n),stroke:o.line.minor.color},animations:DY(i)};return a["horizontal"===r.meta.major.orientation?"y":"x"]=nU.SCALE.MAIN.MINOR,a};function OY(e,t){const n=[TY(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:r})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const o=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:nU.SCALE.MAIN.MINOR,line:{stroke:o.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:nU.SCALE.MAIN.MINOR,lines:a,animations:DY(r)}})(t)),n}const NY="areaPan",AY=e=>({type:"Pan",key:"panorama",options:{event:NY,pointers:1,threshold:10,enable(t,n){return this.started===NY||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===nU.COMPONENT.BAR)}},events:{areaPanstart(t){t.preventDefault(),this.started=NY;const n=e.viewState.get("zoom");this[NY]={min:n.min,max:n.max,size:e.chart.component(nU.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:r,max:i,size:o}=this[NY],a=-t.deltaX/o;e.viewState.set("zoom",{min:Math.min(r+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function _Y(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=dT.event.onZoom({viewCache:n,viewState:r,chart:i},{threshold:100,rtl:o,targetKey:nU.COMPONENT.BAR}),s={last:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===nU.COMPONENT.BAR)},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function IY(e,t){const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=e.layoutService.meta.isContinuous?dT.event.onZoom({viewCache:n,viewState:r,chart:i},{rtl:o,threshold:50,targetKey:nU.COMPONENT.BAR}):void 0;return{type:"native",events:{wheel(t){let n,r=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter(e=>e.key===nU.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&a(i,Math.sign(-t.deltaY)),r=!0)}!r&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===nU.COMPONENT.LEGEND_COLOR_CAT),n&&(r=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),r&&t.preventDefault()}}}}const LY=(e,t,n)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...JA({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...n.gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[AY(e),_Y(e,t)]]});function PY(e,t){const n=e.tooltipService.getInteractions(),r=[LY(e,t,n),IY(e,t),JA({...e,componentKey:"scrollbar",rtl:t.rtl}).native,n.native];return e.layoutService.meta.isDiscrete&&r.push(e.discrete.interactions.native),r}const RY=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:GN.bars.compensateForLayoutChanges});function zY(e,t,{collectionKey:n}){const{continuousDataModel:r,reducedDataModel:i,colorService:o,layoutService:a,viewModel:s}=t,{meta:l}=a,c=a.getLayout(),u=c.qHyperCube.qDimensionInfo?.[0]?.continuous?.period,d=u&&"none"!==u,f=l.isContinuous&&d?function(e,t,n={}){const r=QU({opts:e,MIN_BAR_WIDTH:2,isMiniChart:!0});return({data:i})=>{const{chart:o,viewCache:a,layoutService:s,discrete:l}=e,c=o.component(t).rect;if(!i.items.length||!c)return 2;const u=a.get("continuousMin"),d=a.get("continuousMax");if(n[[u,d]])return n[[u,d]];const f=s.getLayout();let h;n={};let p=eY[pT.getLayoutMode(c.width,Number.MAX_VALUE)];const m=f.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;return m&&"none"!==m?(p=c.width,h=YU({layoutService:s,discrete:l})*r({data:i,mainRect:c,maxBarWidth:p}),n[[u,d]]=h,n[[u,d]]):2}}(t,nU.COMPONENT.MINI_BAR):2;return{type:"box",key:nU.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>r.getDimensionCardinality()>1,data:{collection:n},settings:{box:kg(!0,{},e.settings.box,{minWidthPx:f,fill:o.getMini().getColor(),strokeWidth:0}),major:kg(!0,{},e.settings.major,{scale:i.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:RY(s)}}const FY=(e,t,{collectionKey:n})=>{if(!zA({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return zY(e,t,{collectionKey:n});const{mode:r,scales:i}=t.reducedDataModel;let o;return r.isGroupedByDimension&&!r.isReduced?o=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:r.isGroupedByMeasure&&(o=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:nU.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:r.isReduced||r.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:o},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:RY(t.viewModel)}},{measureText:jY}=Sp.renderer("svg")();function BY(e,t,n){const r=function(e){const t=kg(!0,{},e);return delete t.data,t}(t.minor),i=function(e,t,{majorScaleInvert:n,maxPxStep:r,align:i,getProp:o}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map((e,t)=>({field:e,value:t})):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:r,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=kg(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=kg(!0,{},t,{min:()=>o("continuousMin"),max:()=>o("continuousMax")})),a}(e,t.major,n);return{reducedMinor:r,reducedMajor:i}}const HY=50,VY=100,$Y=200;function WY(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return HY;case 1:return VY;case 2:return $Y;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function UY(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function YY(e,t,n){return 0===t||0===e||t===n.length-1}function KY(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function GY(e,t,n,r,i){e.domain([t,n]),e.nice(10);const[o,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),c=function(e){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some(e=>0===e)}(s),u=c?YY:UY;s=s.filter(u),l&&!c&&!r&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(nU.FORMATTER.MINOR):void 0;return KY(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:o,roundedMax:a,ticks:s}}function XY(e,t,n,r,i,o,a,s){const l=o.formatter(nU.FORMATTER.MINOR),c=s.getStyles(),u="horizontal"===a.meta.major.orientation?"height":"width",d=e=>jY({text:e,fontSize:c.axis.label.name.fontSize,fontFamily:c.axis.label.name.fontFamily})[u];let[f,h]=e.domain(),p=e.ticks(r);function m(){const e=p.map(l);return!KY(e)&&function(e){const t=i/p.length;return Math.max(...e.map(d))<=t}(e)}for(let i=r-1;i>0&&!m();i--)e.domain([t,n]),e.nice(i),[f,h]=e.domain(),p=e.ticks(i);return{roundedMin:f,roundedMax:h,ticks:p}}const JY=(e,t)=>e.value-t.value,ZY=e=>({value:e,isMinor:!1}),QY=e=>({value:e,isMinor:!0});function eK(e,t,n){const r=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter(e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e)).length<=r}function tK({chart:e,viewCache:t,dockService:n,layoutService:r,themeService:i,viewModel:o,ds:a}){const{isButterfly:s}=r.meta,{explicitMin:l,explicitMax:c,hasExplicitMin:u,hasExplicitMax:d}=t.get("minorMinMax"),{min:f,max:h}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),p=s?Math.max(Math.abs(f),Math.abs(h)):h,m=s?-p:f,g=tS(()=>{const s=function(e,t,n){let r;return e?r=n.meta.chart.size:({rect:r}=t.component(nU.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?r.height:r.width}(t.get("isPreRender"),e,n),f=WY(s,r),h=function(e,t,n){const r=WC().domain([e,t]);return r.nice(n),r}(m,p,f);let g,y,v=[];"SPARK"===n.meta.chart.mode?({roundedMin:g,roundedMax:y}=function(e,t){return{roundedMin:e,roundedMax:t}}(m,p)):(({roundedMin:g,roundedMax:y,ticks:v}=XY(h,m,p,f,s,e,n,i)),eK(v,l,c)&&({roundedMin:g,roundedMax:y,ticks:v}=GY(h,m,p,u||d,e)));const b=function(e,t){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}(v,1);v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.unshift(t),n.filter(e=>e>=t)):n}(u,l,v),v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.push(t),n.filter(e=>e<=t)):n}(d,c,v);let x=function(e,t){return[...e.map(ZY),...t.map(QY)].sort(JY)}(v,b);if(r.meta.isButterfly){const e=o.fields.minor[0],t=void 0===e?void 0:a.field(e).formatter();"function"==typeof t&&(x=x.map(e=>({...e,label:t(Math.abs(e.value))})))}return{roundedMin:g,roundedMax:y,ticks:x}},()=>t.get("isPreRender"));return{values:()=>g().ticks,min:()=>u?l:g().roundedMin,max:()=>d?c:g().roundedMax}}function nK(e,{picasso:t,discrete:n,layoutService:r,dockService:i,viewModel:o,viewCache:a,reducedDataModel:s,colorService:l,themeService:c,viewState:u,chart:d,ds:f},{localeInfo:h,rtl:p}){const{meta:m}=r,{fields:g}=o,y=()=>{if("custom"!==r.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},v=!("none"===r.getLayoutValue("measureAxis.show"))?(b=i.meta.minor.orientation,x=i.meta.minor.dock,"vertical"===b?"near"===x||"left"===x?0:1:"near"===x||"bottom"===x?1:0):.5;var b,x;const S={},w="vertical"===i.meta.minor.orientation&&p,M=l.getMain().getScales(),k=l.getMini().getScales();if(Object.assign(S,M,{reducedFill:k.reducedFill}),S[nU.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:r,viewModel:i,layoutService:o,themeService:a,ds:s},{rtl:l}){const c=tK({chart:e,dockService:n,viewCache:r,layoutService:o,themeService:a,viewModel:i,ds:s}),u={invert:"vertical"===n.meta.minor.orientation||l,ticks:{values:c.values},minorTicks:{count:1},min:c.min,max:c.max};return o.meta.isStacked||(u.data={source:"qHyperCube",fields:t.minor}),u}({chart:d,viewModel:o,dockService:i,viewCache:a,layoutService:r,themeService:c,ds:f},{rtl:p}),m.isGroupedByDimension)[nU.SCALE.MAIN.MAJOR_INNER,nU.SCALE.MAIN.MAJOR].forEach((e,t)=>{S[e]={invert:w,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...o.selectionDimensionProp(t),group:m.isGroupedByDimension?{field:g.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:y,align:v}}),o.isDimensionLocked(0)||(S[nU.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(m.isGroupedByMeasure)S[nU.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:w,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:y,align:v};else if(m.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:r,viewCache:i,picasso:o,viewState:a,localeInfo:s,themeService:l}=e,c=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),u=o.formatter("q-time"),d=l.getStyles(),f=e=>jY({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const h={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),r=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),o=c().map(e=>e.qName);return[e,Number.parseFloat(r).toFixed(12),...o].toString()}};return{innerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:c,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:u,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:h},outerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:c,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:u,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:h}}}({picasso:t,localeInfo:h,viewState:u,viewModel:o,viewCache:a,themeService:c,layoutService:r},p);S[nU.SCALE.MAIN.MAJOR_INNER]=e,S[nU.SCALE.MAIN.MAJOR]=n}else m.isContinuous?S[nU.SCALE.MAIN.MAJOR]={type:"linear",invert:w,data:{extract:{key:"qHyperCube",field:g.majorNumeric}},ticks:{forceBounds:!0,count:u.get("zoom").min===u.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>u.get("zoom").min,max:()=>u.get("zoom").max}:S[nU.SCALE.MAIN.MAJOR]={invert:w,data:{extract:m.isDimensionless?g.minor.map((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n})):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:m.isDimensionless?"band":void 0,maxPxStep:y,align:v};const{reducedMinor:C,reducedMajor:q}=BY(s,{major:S[nU.SCALE.MAIN.MAJOR],minor:S[nU.SCALE.MAIN.MINOR]},{majorScaleInvert:w,maxPxStep:y,align:v,getProp:a.get});return m.isDiscrete&&(S[nU.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,m.isGroupedByDimension&&(S[nU.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),S[s.scales.major]=q,S[s.scales.minor]=C,S}function rK(e,t,n){const{actions:r,flags:i,layoutService:o,colorService:a}=e,s=(e,t)=>{const r={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return nU.COMPONENT.BAR===t[0].key?[{...r,data:["selectionDimension"]}]:[nU.COMPONENT.BAR_AXIS,nU.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...r,data:["selectionDimension","axisSelectionDimension"]}]:[r]},l=n=>n.some(e=>e.key===nU.COMPONENT.LEGEND_COLOR_CAT)?a.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n),c=[o.meta.isStackedByDimension&&o.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?nU.COMPONENT.STACK_TOTAL_BAR:nU.COMPONENT.BAR,nU.COMPONENT.BAR_AXIS,nU.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",nU.COMPONENT.LEGEND_COLOR_CAT];return i.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=c.actions)&&void 0!==e?e:Nv.ACTIONS,components:null!==(t=c.components)&&void 0!==t?t:Nv.COMPONENTS,events:{onSelectStart:null!==(n=null===(r=c.events)||void 0===r?void 0:r.onSelectStart)&&void 0!==n?n:Nv.EVENTS,onSelectEnd:null!==(i=null===(o=c.events)||void 0===o?void 0:o.onSelectEnd)&&void 0!==i?i:Nv.EVENTS},hitRadius:null!==(a=c.hitRadius)&&void 0!==a?a:Nv.HIT_RADIUS,isLocked:null!==(s=c.isLocked)&&void 0!==s?s:Nv.IS_LOCKED,shapesAt:c.shapesAt,targets:null!==(l=c.targets)&&void 0!==l?l:Nv.TARGETS}}(e);return{interactions:[_v(t)],components:[]}}({actions:r,components:s,isLocked:l,targets:c}):function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[LU(e,t)],components:[]}}({targets:c,components:s},{...e,isLocked:l})}function iK(e){const t=[e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?{key:nU.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:nU.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}];return e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=u.actions)&&void 0!==e?e:Tv.ACTIONS,componentKey:null!==(t=u.componentKey)&&void 0!==t?t:Tv.COMPONENT_KEY,components:null!==(n=u.components)&&void 0!==n?n:Tv.COMPONENTS,events:{onLassoStart:null!==(r=null===(i=u.events)||void 0===i?void 0:i.onLassoStart)&&void 0!==r?r:Tv.EVENTS,onLassoMove:null!==(o=null===(a=u.events)||void 0===a?void 0:a.onLassoMove)&&void 0!==o?o:Tv.EVENTS,onLassoEnd:null!==(s=null===(l=u.events)||void 0===l?void 0:l.onLassoEnd)&&void 0!==s?s:Tv.EVENTS},targetKeys:null!==(c=u.targetKeys)&&void 0!==c?c:Tv.TARGET_KEYS}}(e),n=function(e){var t=e.actions,n=e.componentKey,r=e.events,i=e.targetKeys;return{key:"event:lasso",type:"Pan",requireFailure:void 0,recognizeWith:void 0,options:{event:Ov,enable:function(e,n){return this.started===Ov||!n||!!(t.select.enabled()&&t.lasso.enabled()&&t.lasso.active())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(e){return-1!==i.indexOf(e.key)})}},events:fy(fy(fy({},"".concat(Ov,"start"),function(e){e.preventDefault(),this.started!==Ov&&(t.select.emit("start",Ov),this.chart.component(n).emit("lassoStart",e),this.started=Ov,r.onLassoStart({chart:this.chart}))}),"".concat(Ov,"move"),function(e){e.preventDefault(),this.chart.component(n).emit("lassoMove",e),r.onLassoMove({chart:this.chart})}),"".concat(Ov,"end"),function(e){e.preventDefault(),this.started=!1,this.chart.component(n).emit("lassoEnd",e),t.select.emit("end",Ov),r.onLassoEnd({chart:this.chart})})}}(t),r=function(e){return{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:e.components},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}}(t);return{interactions:[n],components:[r]}}({actions:e.actions,componentKey:"lasso",components:t,targetKeys:[nU.COMPONENT.BAR]}):function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[IU(n,t)],components:[r]}}({key:"lasso",componentTargetKey:nU.COMPONENT.BAR,components:t},e)}function oK(e){const t=[{key:nU.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}];return e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c,u,d,f,h,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=p.actions)&&void 0!==e?e:wv.ACTIONS,componentKey:null!==(t=p.componentKey)&&void 0!==t?t:wv.COMPONENT_KEY,components:null!==(n=p.components)&&void 0!==n?n:wv.COMPONENTS,dock:null!==(r=p.dock)&&void 0!==r?r:wv.DOCK,enable:null!==(i=p.enable)&&void 0!==i?i:wv.ENABLE,eventKey:null!==(o=p.eventKey)&&void 0!==o?o:wv.EVENT_KEY,events:{onRangeStart:null!==(a=null===(s=p.events)||void 0===s?void 0:s.onRangeStart)&&void 0!==a?a:wv.EVENTS,onRangeMove:null!==(l=null===(c=p.events)||void 0===c?void 0:c.onRangeMove)&&void 0!==l?l:wv.EVENTS,onRangeEnd:null!==(u=null===(d=p.events)||void 0===d?void 0:d.onRangeEnd)&&void 0!==u?u:wv.EVENTS},fillTargets:null!==(f=p.fillTargets)&&void 0!==f?f:wv.FILL_TARGETS,targets:null!==(h=p.targets)&&void 0!==h?h:wv.TARGETS}}(e),n=function(e){return kv({config:e,type:"area"})}(t),r=function(e){var t=e.componentKey,n=e.components,r=e.dock,i=e.fillTargets;return{key:t,type:"brush-area-dir",layout:{dock:e.targets.map(function(e){return"@".concat(e)}).join(",")},settings:{multiple:!0,brush:{components:n},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(t);return{interactions:[n],components:[r]}}({actions:e.actions,componentKey:"discreteRangeBrush",components:t,dock:e.dockService.meta.major.dock,eventKey:"discreteRange",fillTargets:["group-axis",nU.COMPONENT.BAR_AXIS],targets:["group-axis",nU.COMPONENT.BAR_AXIS,nU.COMPONENT.BAR]}):function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[RU(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:t,key:"discreteRangeBrush",targets:["group-axis",nU.COMPONENT.BAR_AXIS,nU.COMPONENT.BAR],fillTargets:["group-axis",nU.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function aK(e,t,n){const{selectionService:r}=e,{isUnsupportedFeature:i}=t,o=void 0===n,a=r.getIsSingleSelect(n),s=rK(e,o,a);if(o||a)return{components:[...s.components],gestures:[...s.interactions]};const l=iK(e),c=function(e,t){return e.layoutService.meta.isStacked||e.layoutService.meta.isButterfly||t?.("rangeSelections")?{components:[],interactions:[]}:e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Dv({actions:e.actions,componentKey:"measureRangeBrush",dock:e.dockService.meta.minor.dock,eventKey:"measureRange",fillTargets:["y-axis"],onEdited:()=>{e.actions.select.emit("end","measureRange")},scale:nU.SCALE.MAIN.MINOR,targets:["y-axis",nU.COMPONENT.BAR]}):zU({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",nU.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:nU.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),u=function(e){if(!e.layoutService.meta.isContinuous)return{components:[],interactions:[]};const t=({datum:t,data:n,scale:r})=>{const i=e.layoutService.meta.isTime?r.formatter():r.data().fields[0].formatter(),o=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||o?"":"<"}${i(t)}`};return e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Dv({actions:e.actions,componentKey:"continuousRangeBrush",dock:e.dockService.meta.major.dock,eventKey:"continuousRange",fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],multiple:!0,observeBrush:!0,scale:e.layoutService.meta.isTime?nU.SCALE.MAIN.MAJOR_INNER:nU.SCALE.MAIN.MAJOR,targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",nU.COMPONENT.BAR]:["continuous-axis",nU.COMPONENT.BAR],toLabel:t}):zU({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",nU.COMPONENT.BAR]:["continuous-axis",nU.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?nU.SCALE.MAIN.MAJOR_INNER:nU.SCALE.MAIN.MAJOR,toLabel:t},e)}(e),d=oK(e);return{components:[...s.components,...l.components,...c.components,...d.components,...u.components],gestures:[...l.interactions,...s.interactions,...c.interactions,...d.interactions,...u.interactions]}}const{isNumber:sK}=oN;function lK({layoutService:e,viewModel:t,dockService:n}){const{meta:r}=e;if(!r.isStackedByDimension||r.isContinuous)return!1;const{fields:i}=t,o=e.getLayoutValue("components",null),a=o?o.filter(e=>"bar"===e.key)[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>(e=>Number(e.filter(e=>sK(e.qMaxPos)).map(e=>e.qMaxPos).reduce((e,t)=>e+t,0).toFixed(13)))(e.qSubNodes)},end:{value:e=>sK(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0}}},{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>(e=>Number(e.filter(e=>sK(e.qMinNeg)).map(e=>e.qMinNeg).reduce((e,t)=>e+t,0).toFixed(13)))(e.qSubNodes)},end:{value:e=>sK(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0}}}]},settings:{major:{scale:nU.SCALE.MAIN.MAJOR},minor:{scale:nU.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:a?.style?.width&&a.style.width>0?a.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:GN.shadowBars.trackBy,compensateForLayoutChanges:GN.bars.compensateForLayoutChanges}}}const cK={min:"Min",max:"Max"};function uK(e,t,n){const r=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?iY(e,t)||oY(e,t):n===aY?iY(e,t):oY(e,t)}(Number(r.toFixed(13)),e,t)}function dK(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,layoutService:o,dockService:a}=e,s=i.get("minorMinMax"),l=n===aY;if(function(e,t){return!e[`hasOther${cK[t]}`]}(s,n)){if(function(e,t){return!e[`hasExplicit${cK[t]}`]}(s,n))return!1;if(uK(s,n,l))return!1}if(function(e,t,n){const r=n?e=>e<0:e=>e>0;return e[`hasExplicit${cK[t]}`]&&r(e[`explicit${cK[t]}`])}(s,n,l))return!1;let c="end";r&&(c=l?"sumOfPositives":"sumOfNegatives");const u=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>e.chart.scale(nU.SCALE.MAIN.MINOR)[n]()),d=l?e=>e.datum[c].value>u():e=>e.datum[c].value<u(),f=nU.COMPONENT.BAR,h=e.layoutService.getLayoutValue("components",[]),p=h?h.filter(e=>e.key===f)[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:l?a.meta.minor.end:a.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:kg({},t.settings.box,{fill:o.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:d,width:YU({layoutService:e.layoutService,discrete:e.discrete}),strokeWidth:p?.style?.strokeWidth?UU.BAR.STROKE.WIDTH[p.style.strokeWidth.toUpperCase()]:UU.BAR.STROKE.WIDTH.NONE,stroke:p?.style?.strokeColor?.color??UU.BAR.STROKE.COLOR})}}}function fK(e,{collectionKey:t},n){const{meta:r}=e.layoutService,{fields:i}=e.viewModel,o=r.isStackedByDimension&&!r.isContinuous?"qValue":"qNum";function a(t,n){const i=e.ds.field(t).raw(),a=e.ds.field(t).formatter(),s=ST.shouldUseFormat(i),l=r.isButterfly&&n>0;return{field:t,reduceLabel:"none",value:e=>"NaN"===e[o]?0:(e=>l&&0!==e?-e:e)(e[o]),label:e=>s?(e=>"NaN"===e[o]?"-":a(e[o]))(e):e.qText}}function s(e){if(!r.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[o]<0}}const l=r.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;function c(e){return{field:e,reduceLabel:"none",reduce:"first",value:l}}const u={key:t,data:{extract:i.minor.map((t,o)=>{const l=e.colorService.getMain().getDatumProps(o),u=e.colorService.getMini().getDatumProps(o),d=l[Object.keys(l)[0]],f=d?.field,h=f?{field:f,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,p={field:r.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:a(t,o),negative:s(t),null:c(t),segment:r.isStacked?a(t):void 0,group:r.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:r.isStacked?{field:i.majorStack}:void 0,measureIndex:r.isGroupedByDimension||r.isStackedByDimension?void 0:o,timeStart:r.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:r.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:h,...l,...u,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${o}`},customTooltipAttrExps:0!==r.dimensionCount?x$.getNode(e.layoutService.getLayout(),r):void 0}};return r.isDimensionless&&(p.value=o),void 0!==n&&(p.source=n),ST.deleteUndefinedProperties(p.props),p}),filter:r.isButterfly?e=>!e.negative.value:void 0}};return r.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}const{isNumber:hK}=oN;function pK({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:r}=e,{fields:i}=t;if(!r.isStacked)return!1;let o;return o=r.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"},null:{fields:t.minor.map(e=>({field:e})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(r,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>hK(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0},sumOfNegatives:{value:e=>hK(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every(e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue)}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t>0?e+t:e,0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t<0?e+t:e,0)},timeStart:n,timeEnd:n}}}(r,i),{key:n,data:{extract:o}}}const mK="main-collection",gK="stack-total-collection";function yK(e,{collectionKey:t}){const{layoutService:n,colorService:r,reducedDataModel:{fields:i,mode:o}}=e,{meta:a}=n,s=a.isStackedByDimension&&!a.isContinuous?"qValue":"qNum";function l(e,t){if(!a.isButterfly)return{field:e};const n=t>0;return{field:e,value:e=>"NaN"===e[s]?0:(e=>n&&0!==e?-e:e)(e[s])}}function c(e){if(!a.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[s]<0}}return{key:t,data:{extract:i.minor.map((e,t)=>{const n=o.isReduced?{}:r.getMain().getDatumProps(t),a={start:0,end:l(e,t),negative:c(e),group:{field:i.majorGroup},measureIndex:t,...n},s={source:"miniCube",field:o.isDimensionless?e:i.major,props:a};return o.isDimensionless&&(s.value=t),s}),filter:a.isButterfly?e=>!e.negative.value:void 0}}}const vK="mini-collection",bK="mini-stack-collection",xK="mini-continuous-collection",SK="miniCube",wK=(e,t)=>{const n=(e=>{const t=[fK(e,{collectionKey:mK})];return e.layoutService.meta.isStacked&&t.push(pK(e,{collectionKey:gK})),t})(t),r=((e,t)=>{const n=[];return zA({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(fK(t,{collectionKey:xK},SK)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map((e,t)=>{const o={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(o.timeStart={field:r.major,value:e=>e.qNum},o.timeEnd=o.timeStart),{source:"miniCube",field:r.major,props:o}}),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:bK})):n.push(yK(t,{collectionKey:vK}))),n})(0,t);return n.concat(r)};function MK(e,t,n,r){const i=[{position:e,onBackground:!0,justify:0,overflow:r}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function kK({layout:e,component:t},n,r){if(!bY(e,n))return!1;const{layoutService:i,chart:o,dockService:a,viewModel:s,themeService:l,styleService:c}=n,{meta:u}=i,d=!vY(e,n),f=l.getStyles(),h=c.label.getStyle(),p=h.useContrastColor;function m(e){const t=o.formatter(nU.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":m(e.data.sumOfPositives.value)},simplifiedPlacements:MK("outside",d,p,u.isContinuous),style:f.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":m(e.data.sumOfNegatives.value)},simplifiedPlacements:MK("opposite",d,p,u.isContinuous),style:f.label.value},v=[mY(kg(n,g)),mY(kg(n,y))];return{key:"stack-total-labels",type:"labels",renderer:rA(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>yY(e.data.sumOfPositives.value,a.meta.minor.orientation,r),labels:v,fontSize:parseInt(h.fontSize,10),fontFamily:h.fontFamily,linkData:GN.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:GN.labels.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}}}function CK(e,t,n){const r=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return r.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),r}function qK({layout:e,type:t},n){const{layoutService:r,viewCache:i,themeService:o,styleService:a}=n,{meta:s}=r,{isStacked:l}=s;if(!l&&!vY(e,n)||l&&!bY(e,n))return!1;const c=i.get("minorMinMax");if(!c.hasExplicitMinMax||t===aY&&0===c.max||t===sY&&0===c.min)return!1;if(!cY(t===aY?c.implicitMax:c.implicitMin,c,t))return!1;const u=o.getStyles(),d=a.label.getStyle();let f=e=>e.data.end.label;s.isStacked&&(f=t===aY?function(e){if(cY(e.data.sumOfNegatives.value,c,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,r=n.chart.formatter(nU.FORMATTER.MINOR);return r?r(t):t}return""}:function(e){if(cY(e.data.sumOfPositives.value,c,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,r=n.chart.formatter(nU.FORMATTER.MINOR);return r?r(t):t}return""});const h={label:f,simplifiedPlacements:CK("outside",0,s.isContinuous),styles:u},p={label:f,simplifiedPlacements:CK("opposite",0,s.isContinuous),styles:u},m=[mY(kg(n,h)),mY(kg(n,p))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y=[{component:`${nU.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:m,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:GN.labels.linkData}}}];return{key:`bar-oob-labels-${t}`,type:"labels",renderer:rA(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:y},animations:{enabled:n.viewModel.animations.enabled,trackBy:GN.labels.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}}}function EK(e){return"all"===e||"title"===e}function DK(e,t,n){if(!EK(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const r=t.alternativeService.getAlternatives(),{actions:i}=t,o=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"dimension-title",renderer:"react-qcm",layout:{minimumLayoutMode:FU[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},data:{infos:t.layoutService.getHyperCubeValue("qDimensionInfo"),alternatives:r.dimensions,filtered:t.layoutService.meta.filteredFields.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize}}}}function TK(e,t,n){if(!EK(e.measureAxis.show))return!1;const r=t.alternativeService.getAlternatives(),{actions:i}=t,o=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"measure-title",renderer:"react-qcm",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},data:{infos:t.layoutService.getHyperCubeValue("qMeasureInfo"),alternatives:r.measures,filtered:t.layoutService.meta.filteredFields.measures},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"measure"},style:{title:{color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize}}}}function OK({environment:e,rtl:t,refLineModel:n,layoutService:r,colorService:i,dockService:o,themeService:a,viewModel:s,chart:l}){const{theme:c,localeInfo:u}=e,d={resolveUIColor:i.getMain().getPaletteColor},f=a.getStyles(),h=s.animations.enabled;return[eA({refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:h,chart:l,scale:nU.SCALE.MAIN.MINOR,axis:"horizontal"===o.meta.major.orientation?"y":"x",key:nU.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:FU.refLines.minimumLayoutMode}),eA({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:h,chart:l,scale:nU.SCALE.MAIN.MAJOR,axis:"horizontal"===o.meta.major.orientation?"x":"y",rtl:t,key:nU.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:nU.COMPONENT.BAR,minimumLayoutMode:FU.refLines.minimumLayoutMode}),...tA({refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:h,dock:o.meta.minor.opposite,scale:nU.SCALE.MAIN.MINOR,style:f,formatter:nU.FORMATTER.MINOR,theme:c,localeInfo:u,rtl:t,key:nU.COMPONENT.MEASURE_REF_LINE_LABEL}),...tA({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:h,dock:o.meta.major.opposite,scale:nU.SCALE.MAIN.MAJOR,style:f,theme:c,localeInfo:u,rtl:t,key:nU.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function NK({dockService:e,layoutService:t,discrete:n,continuousDataModel:r,viewModel:i}){if(!!zA({layoutService:t}).none)return!1;const{rtl:o}=e.config,a="horizontal"===e.meta.chart.orientation,s=!a,{dock:l}=e.meta.major,{show:c}=t.getLayoutValue("dimensionAxis",{}),u="none"!==c;if(s&&u&&"bottom"===l)return!1;if(a&&u){if(!o&&"right"===l)return!1;if(o&&"left"===l)return!1}const d=o?"left":"right";return{type:"space",key:nU.COMPONENT.SPACE,layout:{dock:s?"bottom":d,minimumLayoutMode:"XSMALL"},show:()=>t.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{size:Math.max(6,Math.min(16,Math.floor(.025*e.meta.minor.size)))},animations:{enabled:i.animations.enabled,trackBy:()=>Math.random()}}}function AK({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,context:s,resources:l,viewCache:c}){const u=[],d=o.getLayoutValue("plugins");if(!Array.isArray(d)||0===d.length)return u;!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=ST.generateId)})}(d);const f=[],h=function(e){const t=[];return e.forEach(e=>{e?.type!==t[t.length-1]?.[0]?.type||"point"!==e?.type&&("line"!==e?.type||e?.showPoints||t[t.length-1]?.[0]?.showPoints)?t.push([e]):t[t.length-1].push(e)}),t}(d);return h.forEach((c,d)=>{const h=`points-addon-${d}`,p=`lines-addon-${d}`;switch(c[0]?.type){case"point":u.push(lA({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,mainComponentKey:nU.COMPONENT.BAR,data:c,key:h})),f.push({key:h,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":u.push(function({chart:e,chartModel:t,discreteModel:n,colorService:r,layoutService:i,dockService:o,rtl:a,majorScale:s,minorScale:l,mainComponentKey:c,data:u,key:d,scales:f={}}){if(!Array.isArray(u)||0===u.length)return!1;const h={resolveUIColor:r.getMain().getPaletteColor},p="horizontal"===o.meta.major.orientation,m=!(!p||!a),{canBeContinuous:g,isContinuous:y}=i.meta,v=i.getLayout(),b=CN.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:i}),x=[];u.forEach((e,t)=>{const n=(e?.points??[]).map((n,r)=>({...n,lineId:t,style:0===r?e.style:void 0}));x.push(...n)});const S={},w=[];u.forEach(e=>w.push(...(e?.points??[]).map(e=>e.dimensionValue))),w.forEach(e=>{b[e]&&(S[e]?(S[e].innerValues=b[e].innerValues,S[e].minOrder=Math.min(S[e].minOrder,b[e].minOrder),S[e].maxOrder=Math.max(S[e].maxOrder,b[e].maxOrder),S[e].isMinOrderOk=S[e].isMinOrderOk||b[e].isMinOrderOk,S[e].isMaxOrderOk=S[e].isMaxOrderOk||b[e].isMaxOrderOk):S[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},S[e].numInnerValues=(S[e].maxOrder||0)-(S[e].minOrder||0)+1)});const M=x[0];x.forEach(t=>{const n=aA({point:t,dimensionValueInfo:S,layoutService:i}),r=t?.scale,o=M?.scale,a=i?.meta?.isButterfly,s=i?.meta?.isStacked,l=S[t.dimensionValue]?.dataNode;let c=n;const u=o&&r&&o!==r,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(u)c=function(e,t,n){const r=t.min(),i=t.max(),o=n.min(),a=n.max();return i===r?o:o+(e-r)/(i-r)*(a-o)}(n,f[r]||e.scale(r),f[o]||e.scale(o));else if(d)c=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);c=e.reduce((e,n)=>{const r=n.qNum;return"number"==typeof r&&Math.sign(r)===t?e+r:e},0)}}t.validMeasureValue=c});const k={scale:s,fn:({datum:t})=>{const n=e.scale(s),r=t.value.dimensionValue;return y?n("string"==typeof r?""===r?void 0:+r:r):void 0!==S[r]?CN.getScaledPosition({scale:n,value:S[r].id,valueInfo:S[r],size:e.component(c)?.rect[p?"width":"height"],align:"center",invert:m,layoutService:i,isContinuous:y}):void 0}},C={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:x,settings:{connect:!0,coordinates:{major:p?k:C,minor:p?C:k,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"monotone",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>oA({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:GN.nonUpdatingNode.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:n,colorService:r,layoutService:o,dockService:a,rtl:s.rtl,majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,mainComponentKey:nU.COMPONENT.BAR,data:c,key:p})),c.forEach((c,d)=>{if(c?.showPoints&&c?.points){const h=`points-${d}-for-${p}`;u.push(lA({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,mainComponentKey:nU.COMPONENT.BAR,data:c.points,key:h})),f.push({key:h,lines:!0,labels:!0,duplicates:!0})}else c?.points&&f.push({key:p,lines:!0,labels:!1,duplicates:!0,points:c.points})})}}),u.push(function({layoutService:e,dockService:t,chartModel:n,themeService:r,configs:i,cache:o}){const a=e.getLayoutValue("plugins"),{rtl:s}=t.config,{orientation:l}=t.meta.major,{isOneDimensional:c,isStacked:u}=e.meta,d=r.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:rA(),settings:{all:!0,cache:o,configs:i,label:e=>e.value?.label?.value?e.value?.label?.value:u?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<a.length;t++){const n=a[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:c?e.value:e.major?.value,orientation:l,pointValue:e=>e.value?.validMeasureValue,rtl:s},style:d.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:GN.nonUpdatingNode.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}}}({layoutService:o,dockService:a,chartModel:t,themeService:i,configs:f,flags:l.flags,cache:c})),u}const _K=(e,t,n)=>{const{layoutService:r,dockService:i,colorService:o,chart:a,actions:s,discrete:l,continuousDataModel:c,reducedDataModel:u,viewModel:d,viewState:f,viewCache:h,themeService:p,refLineModel:m,pluginService:g,tooltipService:y,rtl:v,logicalSize:b,trendLineModel:x,disclaimerService:S}=t,{localeInfo:w}=n,M=function(e,t){const{disclaimerService:n,themeService:r,translator:i}=e,o=n.getDisclaimer();if(!o)return!1;const{fontFamily:a}=r.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:o.alignment},settings:{isRTL:t,label:i.get(`Object.Disclaimer.${o.key}`)},style:{fontFamily:a}}}(t,v);if(S.getHasSuppressingDisclaimer())return{components:[M]};const k=nK(e,t,{localeInfo:w,rtl:v}),C=!s?.interact?.enabled(),q=o.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:f,chart:a,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:s,navigationDisabled:C}),E=q.components[0];if(E){const{dock:e}=E.layout;if(k.fillRange&&(["right","left"].includes(e)||v)&&(k.fillRange.invert=!0),"legend-seq"===E.type&&void 0!==d.selectionDimensionIdx&&k.fillRange&&k.fillRange.min<k.fillRange.max){const e=t.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Dv({actions:s,bubblesPlacement:"outside",componentKey:"legendRangeBrush",dock:E.layout.dock,eventKey:"legendRange",fillTargets:[E.key],onEdited:()=>{s.select.emit("end","legendRange")},scale:"fillRange",targetFillSelector:'[id="legend-seq-ticks"]',targets:[E.key],targetSelector:'[id="legend-seq-target"]'}):zU({eventName:"legendRange",key:"legendRangeBrush",targets:[E.key],fillTargets:[E.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:E.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{s.select.emit("end","legendRange")}},t);q.components.push(...e.components),q.interactions.unshift(...e.interactions)}}else k.fillRange&&v&&(k.fillRange.invert=!0);const D=((e,{componentKey:t,collectionKey:n})=>{const{layoutService:r,colorService:i,dockService:o,discrete:a,viewModel:s}=e,{meta:l}=r,c=i.getMain().getPaletteColor;let u,d;l.isGroupedByDimension?u=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:l.isGroupedByMeasure&&(u=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let f=2;l.isContinuous?(d={start:"timeStart",end:"timeEnd"},f=tY(e,t)):l.isStacked&&(d="stack");const h=l.isStackedByDimension&&r.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,p=e=>!0===e.datum.null?.value,m=r.getLayoutValue("components",null),g=m?m.filter(e=>e.key===t)[0]:null,y=e=>{const t=e?.minWidthPx;return oN.isNumber(t)?t<=5?0:Math.min(2,t/10):0};return{key:t,type:"box",data:{collection:n},preferredSize:l.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:(()=>{if(h)return 0;if(!l.isContinuous)return 2;const e=r.getLayout(),t=e.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;return t&&"none"!==t?y:0})(),stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:nU.SCALE.MAIN.MAJOR,fn:u,ref:d},minor:{scale:nU.SCALE.MAIN.MINOR},orientation:o.meta.minor.orientation,box:{width:YU({layoutService:r,discrete:a}),minWidthPx:f,fill:i.getMain().getColor(),opacity:e=>p(e)?0:void 0,minHeightPx:function(e){return l.isStacked?.1:p(e)?.01:.3},strokeWidth:g?.style?.strokeWidth?UU.BAR.STROKE.WIDTH[g.style.strokeWidth.toUpperCase()]:UU.BAR.STROKE.WIDTH.NONE,stroke:g?.style?.strokeColor?.color?c(g?.style?.strokeColor):UU.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:s.animations.enabled,isMainComponent:!0,trackBy:GN.bars.trackBy,compensateForLayoutChanges:GN.bars.compensateForLayoutChanges}}})(t,{componentKey:nU.COMPONENT.BAR,collectionKey:nU.COLLECTION.MAIN}),T=((e,{componentKey:t,collectionKey:n})=>{const{meta:r}=e.layoutService;if(!r.isStacked)return!1;let i=2;r.isContinuous&&(i=tY(e,t));const o={key:t,type:"box",data:{collection:n},settings:{major:{scale:nU.SCALE.MAIN.MAJOR},minor:{scale:nU.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:YU({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>!0===e.data?.null?.value?0:1},inactive:{opacity:e=>!0===e.data?.null?.value?0:.3}}}]}};return r.isContinuous&&(o.settings.major.ref={start:"timeStart",end:"timeEnd"}),o})(t,{componentKey:nU.COMPONENT.STACK_TOTAL_BAR,collectionKey:nU.COLLECTION.STACK_TOTAL}),O=aK(t,n,d.selectionDimensionIdx),{isStacked:N}=r.meta;let A;A=u.mode.isContinuous?nU.COLLECTION.MINI_CONTINUOUS:N?nU.COLLECTION.MINI_STACK:nU.COLLECTION.MINI;const _=N?T:D,I=OY(0,t),L=[...I,dK(t,{barComponent:_,type:"max",isStacked:N}),dK(t,{barComponent:_,type:"min",isStacked:N}),dY(t,{barComponent:_,type:"max",isStacked:N}),dY(t,{barComponent:_,type:"min",isStacked:N}),hY(t,{chart:a,type:"max",collectionKey:N?nU.COLLECTION.STACK_TOTAL:nU.COLLECTION.MAIN}),hY(t,{chart:a,type:"min",collectionKey:N?nU.COLLECTION.STACK_TOTAL:nU.COLLECTION.MAIN}),...WU(e,t,v,!!I[0]),D,T,lK({layoutService:r,viewModel:d,dockService:i}),DK(e,t,v),TK(e,t,v),...OK({environment:n,rtl:v,refLineModel:m,layoutService:r,colorService:o,dockService:i,themeService:p,viewModel:d,chart:a}),VO({viewState:f,viewCache:h,layoutService:r,dockService:i,rtl:v}),NK({dockService:i,layoutService:r,discrete:l,continuousDataModel:c,viewModel:d}),FY(D,t,{collectionKey:A}),FA({layoutService:r,dockService:i,discrete:l,continuousDataModel:c,viewState:f,viewCache:h,themeService:p,rtl:v,deviceType:n.deviceType}),...FW({majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,tooltipOverlay:nU.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:r,trendLineModel:x,dockService:i,animationsEnabled:d.animations.enabled}),...q.components,SY({layout:e,component:nU.COMPONENT.BAR,minorScale:k.minor},t,v),kK({layout:e,component:nU.COMPONENT.STACK_TOTAL_BAR},t,v),qK({layout:e,type:"max"},t),qK({layout:e,type:"min"},t),...O.components,...y.getComponents(),!1!==e.showDisclaimer&&M,VW({tooltip:nU.COMPONENT.TREND_LINES_TOOLTIP,formatter:nU.FORMATTER.MINOR},t,{rtl:v}),...AK({chart:a,chartModel:{query:{animationsEnabled:d.animations.enabled}},discreteModel:l,colorService:o,themeService:p,layoutService:r,dockService:i,context:{},resources:t,viewCache:h})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(L);const P=[...q.interactions,...O.gestures].sort((e,t)=>(t.prio||0)-(e.prio||0));return{interactions:PY(t,{rtl:v,hammer:{gestures:P}}),scales:k,palettes:o.getMain().getPalettes(),components:g.extendComponents(L),strategy:mT(0,{logicalSize:b,minCenterRatio:0}),formatters:wY(t,k),collections:wK(0,t)}};function IK({picasso:t,chart:n,services:r,environment:i,viewState:o,viewCache:a,bootstrapped:s}){const{width:l,height:c}=e.useRect(),u=e.useModel(),d=e.useSelections(),f=e.useOptions(),[h,p]=e.useState(),[m,g]=e.useState(),[y,v]=e.useState(),[b,x]=e.useState(),S=e.useApp();function w(){if(!n.layoutComponents)return Promise.resolve();const{discrete:e,layoutService:s,viewModel:l}=r;a.set("isPreRender",!0);const c=function(e={}){const{alternativeService:s,selectionService:l,refLineModel:c,discrete:p,reducedDataModel:m,continuousDataModel:g,trendLineModel:y,pluginService:v,colorService:b,viewModel:x,dockService:w,themeService:M,customTooltipModel:k,layoutService:C,logicalSize:q,styleService:E,disclaimerService:D,tooltipService:T}=r,O=l.custom.getActions(),N=t.data("q")(h.prepPicassoDataSet()),A={picasso:t,ds:N,rtl:"rtl"===f?.direction,model:u,app:S,chart:n,actions:O,localeInfo:i.localeInfo,logicalSize:q,flags:i.flags,translator:i.translator,selections:d,isLocked:l.getIsSelectionLocked,viewCache:a,viewState:o,alternativeService:s,layoutService:C,dockService:w,viewModel:x,colorService:b,selectionService:l,themeService:M,trendLineModel:y,discrete:p,continuousDataModel:g,reducedDataModel:m.model(),customTooltipModel:k,debouncer:nS,refLineModel:c,pluginService:v,styleService:E,disclaimerService:D,tooltipService:T,...e};return _K(C.getLayout(),A,i)}(m);h.extractDataPages(),n.layoutComponents({settings:c,data:y}),a.set("isPreRender",!1),h.insertDataPages(),l.animations.hasSlicedHats=c.components.filter(e=>"box-sliced-hat"===e.type).length>0;const p=[];return 1!==c.components.length&&s.meta.isDiscrete&&p.push(e.command.initialize()),Promise.all(p)}const[[M,k]=[]]=e.usePromise(()=>{if(!(t&&n&&r&&i&&o&&a&&s))return Promise.resolve();const{alternativeService:e,layoutService:l,selectionService:c,refLineModel:u,discrete:d,continuous:f,reducedDataModel:h,continuousDataModel:p,trendLineModel:m,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b,customTooltipModel:S,disclaimerService:w,customTooltipService:M,tooltipService:k}=r;if(!c?.custom?.getActions())return Promise.resolve();const{properties:C}=s,q=C?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);q&&(S.useCustomTooltip=!1);const E=()=>{x(Date.now()),b.animations.isPartialUpdating=!0};o.onChanged("scrollOffset",()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),u&&u.update(),E()}),o.onChanged("legendScrollOffset",E),o.intercept("zoom",f.event.onZoomIntercept({viewCache:a})),o.onChanged("zoom",f.event.onZoomChange({layoutService:l,continuousDataModel:p},E)),c.setLayout(l.getLayout());const D=[];l.meta.isContinuous&&(p.update(l.getLayout()),D.push(p.initialFetch())),m.command.update(),D.push(h.fetch().then(({reducedCube:e})=>{h.update(e)})),M.setProperties(C),k.expando.set("properties",C),w.initialize(),D.push(Promise.resolve({properties:s.properties}));return Promise.all(D).then(t=>Promise.all([v.initialize(),y.initialize(),e.initialize({properties:C}),AU({reducedDataModel:h,layoutService:l,continuousDataModel:p,trendLineModel:m})]).then(e=>[t,e.pop()]))},[s]);e.useEffect(()=>{if(!r?.colorService?.getMain()||!k)return;const{layoutService:e,selectionService:t,reducedDataModel:n,continuousDataModel:o,trendLineModel:s,legendLayoutService:l,colorService:c,viewModel:u}=r;a.set("minorMinMax",k);const d=e.getHyperCube(),f=e.meta.isContinuous?o.getInitialCube():n.model().cube,{field:h}=c.getMain().getSettings(),m=!e.meta.isContinuous&&(n.model().mode.isReduced||e.meta.isStacked)&&l,y=m?l.getHyperCube():void 0;t.setBrushAliases({colorField:h,useLegendCube:m,legendAlias:`legendCube/${h}`});const v=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:r,layoutService:i,viewModel:o,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],c=[];const u=i.meta.isContinuous?[{key:o.fields.majorNumeric,from:i.meta.isStackedByDimension?o.fields.majorStack:o.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:u}}),prepPicassoData(i){const o=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:u}},{type:"q",key:"miniCube",data:t,config:{localeInfo:r,virtualFields:u}},...i];return n&&o.push({type:"q",key:"legendCube",data:n,config:{localeInfo:r,virtualFields:u}}),a.query.hasTrendLines()&&o.push({key:"trend",data:a.query.getData()}),o},extractDataPages(){l=e[s],c=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=c}}}({mainCube:d,miniCube:f,legendCube:y,localeInfo:i.localeInfo,layoutService:e,viewModel:u,trendLineModel:s}),b=M[M.length-1];g({localeInfo:i.localeInfo,...b}),p(v)},[k]),e.useEffect(()=>{if(!r||!m||!h)return;const e=r.colorService.getMain();if(!e)return;h.prepPicassoDataSet();const t=h.prepPicassoData(e.getData());v(t)},[m]),e.useEffect(()=>{r?.colorService?.getMain()&&n.update&&h&&y&&w().then(()=>{const{layoutService:e,discrete:t,legendLayoutService:i}=r;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([t.query.getCurrentDataPage()])}n.update(),GN.cacheProperties({viewCache:a,layout:e.getLayout()})})},[y]),e.useEffect(()=>{if(!(l&&c&&h&&n?.update&&r?.colorService.getMain()))return;const{viewModel:e}=r;e.animations.isSizeChanging=!0;const{dockService:t,themeService:o}=r;t.update({width:l,height:c}),o.setTheme(i.theme),w().then(()=>{n.update&&n.update()})},[l,c]),e.useEffect(()=>{if(!n?.update)return;const{viewModel:e}=r;n.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1},[b])}const LK=e=>"[object Object]"===Object.prototype.toString.call(e),PK=e=>Array.isArray(e);function RK(e,t){if(e===t)return!0;if(PK(e)){if(!PK(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!RK(e[n],t[n]))return!1;return!0}if(LK(e)){if(!LK(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!RK(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function zK({enable:t=!0}={}){const n=e.useModel(),r=()=>Date.now().toString()+Math.random(),[i,o]=e.useState(r()),a={properties:void 0};return e.useEffect(()=>{if(!n||!n.getEffectiveProperties||!t)return()=>{};const e=()=>{n.getEffectiveProperties().then(e=>{const t=kg(!0,{},e);if(!a.properties)return void(a.properties=t);const n=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=kg(!0,{},e),i=kg(!0,{},t);return n.exclude=!RK(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!RK(r,i),n}(a.properties,t);a.properties=t,n.exclude&&!n.properties&&o(r())})};return n.on("changed",e),e(),()=>{n.removeListener("changed",e)}},[t]),i}function FK({env:t,services:n}){const r=e.useApp(),i=e.useModel(),o=e.useRenderState(),a=zK({enable:!1===n?.layoutService?.meta?.isSnapshot}),[s,l]=e.usePromise(async()=>{if(!t||!n)return Promise.resolve();const{layoutService:e}=n,{isSnapshot:a,isStacked:s,isContinuous:l}=e.meta,c=[];return a||c.push(i.getEffectiveProperties()),Promise.all(c).then(async t=>{const n=t[0]||void 0;if(n?.qHyperCubeDef){const t=e.getLayout(),a=kg(!0,{},n),c=(({properties:e,layout:t,isStacked:n,isContinuous:r,model:i,layoutService:o})=>{const a=t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode),s=t.qHyperCube.qMeasureInfo.filter(e=>7005!==e.qError?.qErrorCode),l=kg(!0,{},e);return((e,t,n)=>{const{color:{mode:r}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===r&&t.length>1?n.color.mode="byMultiple":"byExpression"===r&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&"byExpression"!==r&&(n.color.mode="primary"))})(a,s,e),a.length>1&&n&&!r&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),a.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),i.colorSupport?.colorByUpdater?.(e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:r}=e.color||{};if("byExpression"===r){const r=t.getLayout();if("colorByExpression"===r.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:i,target:o}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:r,target:i}=n.reduce((e,n,r)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=r),void 0!==e.target||t.includes(r)||(e.target=r),e),{current:void 0,target:void 0});return{current:r,target:i}}({properties:e,filtered:n.measures});if(void 0===i)return;const a=e.qHyperCubeDef.qMeasures[i].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[i].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[o].qAttributeExpressions.splice(0,0,a)}}({properties:e,layoutService:o}),!GO.compare(l,e,!0)&&JSON.stringify(l)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)})({properties:n,layout:t,isStacked:s,isContinuous:l,model:i,layoutService:e});if(c)return o.pending(),(e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1)))(t)?i.setProperties(n).then(()=>{r.clearUndoBuffer()}):void await((e,t,n)=>{if(!e)return Promise.resolve();let r=GO.generate(t,n);return kg(!0,t,n),r&&r.length?(r=r.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(r,!0)):Promise.resolve()})(i,a,n);o.restore()}return{properties:n}})},[t,n,a]);if(l&&!l.isHandled)throw l;return s}var jK,BK={exports:{}};var HK=(jK||(jK=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=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 r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(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(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=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 r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(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(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ne});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];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 r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}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,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=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((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function h(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 v(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 b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=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(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),f=u(r[1],i),h=p(0),m=p(1),g=v(d,h),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const w={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(h(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===S({properties:n,layout:r})},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),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:h,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},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,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=S({properties:t,layout:n});return s>=i&&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 r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=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});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.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);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e){return k="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},k(e)}var C=t().bind(null,!0),q={},E=Array.isArray;function D(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function T(e){return void 0===e}function O(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function N(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=T(e[n||t])?o:e[t],e=e[n||t]}}),e}function A(e,t){var n=!0;if(D(e)&&D(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){A(e[r],t[r])||(n=!1)}),n);if(E(e)&&E(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}q.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);A(o,a)||O(t,i)||(T(a)?r.push({op:"add",path:s,value:o}):D(o)&&D(a)?r=r.concat(q.generate(a,o,s)):E(o)&&E(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&T(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(A(t,i))return r;if(!T(t[0])&&T(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(q.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){T(t[i])&&!O(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},q.apply=function(e,t){t.forEach(function(t){var n,r,i=N(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(E(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(E(a)&&E(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return M(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return M(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)?M(e,t):void 0}}(r)||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(D(a)&&D(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!O(n,e)&&delete n[e]}),C(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=N(e,t.from);E(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(E(i)?i.splice(+o,1):delete i[o])})},q.clone=function(e){return C({},e)},q.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):C(e,t)};const _=q,I=function(e,n,r){if(!e)return Promise.resolve();var i=_.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var L="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function R(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===L)return r;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:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=w.getNumStepComp(n,l),f=w.getAboveComp(n,l,u,d),h=w.getRangeComp("RangeSum",f);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(c,1),m=w.getDimComp(c,0),g=w.getAggrComp(h,p,m);h=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return h},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(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(R(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(R(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(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function B(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function H(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=w.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=w.getNumStepComp(r,c),p=w.getAboveComp(r,c,f,h);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:a})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,V)},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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(H(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(H(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(H(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(H(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=B(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=B(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(H(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(H(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=B(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?w.generateTSDExpression(n,t,r):t},extractInputExpression:w.extractInputExpression,initModifier:function(e,t){w.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=w.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!w.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 r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;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:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=w.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var h=w.getDimComp(c,1),p=w.getDimComp(c,0),m=w.getAggrComp(f,h,p);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(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(w.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(w.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(f,"))")}(u,d,n.field,n.value,f,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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(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 r=[{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 r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(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(re(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(re(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,r){return function(e,t,n,r){var i=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===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(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 w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,he);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,he)?he:fe},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,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",we="qDef.qLabelExpression",Me="qDef.base.qLabel",ke="qDef.base.qLabelExpression",Ce="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",Ee={initBase:function(e,t){(t||Ee.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Me,o(e,Se)),n(e,ke,o(e,we)))},restoreBase:function(e){Ee.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,Se,o(e,Me)),n(e,we,o(e,ke)),o(e,Ce)&&o(e,qe)&&n(e,Ce,o(e,qe)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const De=Ee;function Te(e){return Te="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},Te(e)}var Oe={accumulation:F,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:G};const Ne={modifiers:Oe,apply:_e,applyModifiers:Ie,cleanUpMeasure:Le,destroy:function(e){e&&Ae[e.id]&&Ae[e.id].masterItemSubscriber&&(Ae[e.id].masterItemSubscriber&&Ae[e.id].masterItemSubscriber.unsubscribe(),delete Ae[e.id])},hasActiveModifiers:Pe,getActiveModifier:Re,initBase:De.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Oe[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Oe[e]&&Oe[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:ze};var Ae={};function _e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ae[n.id]=Ae[n.id]||{isFirstTime:!0};var c=Ae[n.id].isFirstTime;if(Ae[n.id].isFirstTime=!1,r&&"object"===Te(r))return Ie({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(u,"qHyperCube.qMeasureInfo"),h=Ae[n.id].lastReloadTime;if(Ae[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:n,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||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:f,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);He(r);var i=Qe(r);return Ke({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){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,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Te(e)&&!e.disabled){if(n++,"object"!==Te(Oe[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 r=Oe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Ie({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Te(e.base)})}(f)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Le(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Ie(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),He(i);var f=Qe(i);return et({model:n,libraryIds:f,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Le(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;De.isValid(n)||De.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Te(e)&&!e.disabled){if(s++,"object"!==Te(Oe[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)");Oe[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Oe[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.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,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Oe[r.type].updateModifier&&Oe[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Oe[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,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:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Le(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Le(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===Te(e)&&!e.disabled&&!Oe[e.type]})}(e)?De.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:je(e),properties:n,layout:r})})}function Re(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Oe[r.type]&&!r.disabled)return r}}function ze(e){var t=Re(e);return!t||Oe[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 Be(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function He(e){Fe(e).forEach(function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&Be(n)!==e.qDef.qDef?delete e.qDef.base:!De.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ve(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===Te(t)&&(t.disabled||!Oe[t.type]&&Be(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,r=e.layout;return!We(t)&&Ye({modifiers:je(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Te(e)||e.disabled||!Oe[e.type])&&(void 0===i[e.type]&&(i[e.type]=Oe[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ge(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.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 Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):I(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Te(e)&&!e.disabled&&Oe[e.type]&&Oe[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ae[t.id].masterItemSubscriber=Ae[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},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(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[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;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return _e({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ae[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](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 r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="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},i(e)}n.d(r,{default:()=>He});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(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,r=new Array(t);n<t;n++)r[n]=e[n];return r}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,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}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,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var f=n(8),h=n.n(f);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=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},b=function(e){e.forEach(function(e){h().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var S=n(909),w=n.n(S);function M(e,t){var n=w()(!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 k(e,t){return w()(!0,{},t,e)}function C(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const T=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},O=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},N=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},A=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}}},_=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},I=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=M(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=M(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},L=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=k(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=k(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=C(a.max,i.dimensions.length,q),l=C(a.min,i.dimensions.length,0);return{maxDimensions:C(o.max,s,q),minDimensions:C(o.min,l,0),maxMeasures:s,minMeasures:l}},R=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=w()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".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)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=w()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=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>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return E(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 E(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)?E(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),r.dimensions.added(e,n)})}},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return D(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 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.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&h().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,r=e.viewDataMode,i=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:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,f=void 0===d||d,h=e.isHCModifierSupported,p=void 0===h||h,m={qChildren:[]},g=z({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,w=b.maxMeasures,M=b.minMeasures,k=l.defaultDimension,C=void 0===k?A():k,q=l.defaultMeasure,E=void 0===q?_():q;v.qDimensions.length=0,v.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:M})&&j({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:M,newHyperCubeDef:v}),I({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:v,defaultDimension:C}),L({exportFormat:t,maxMeasures:w,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),B({newProperties:g,dataDefinition:a,hypercubePath:c}),H({newProperties:g,dataDefinition:a,hypercubePath:c}),R({exportFormat:t,newHyperCubeDef:v}),O("qMaxStackedCells",y,v),O("qNoOfLeftDims",y,v),N("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),N("qMode",y,v,"S"),N("qReductionMode",y,v,"N"),N("qSortbyYValue",y,v),N("qIndentMode",y,v),N("qShowTotalsAbove",y,v),T(g,t,r),m.qProperty=g;var D=o.getValue(u||{},"support.modifiers");return V({measures:v.qMeasures,modifierTypes:D}),f&&$(m.qProperty,"storedFilters"),"S"===v.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,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function K(e,t){return e.length!==t}const G={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,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,r,i),K(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"}},X={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}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.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 X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=G.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 re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var h=G.create(G.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:h,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:h,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f})}n?(h.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(h)):l.qAttributeExpressions.push(h)}}}function ie(e,t,n,r){var i,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":i=function(e,t){return t?e.qLibraryId:h().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return h().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),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,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key: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)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=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"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=G.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,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 r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=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"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=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"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=G.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},he=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.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,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",c),G.moveByIdFromGroup(a,[],"qAttributeExpressions",c),G.moveByIdFromGroup(s,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,f=o.getValue(d,"visualization"),h=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,f),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:h});return g[p]?he({shouldUpdateColorBy:y,properties:d})&&pe(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(h),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||w()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||w()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.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:r})){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,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].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]&&w()(s,n.properties.measureAxes[t[0].axis])):w()(s,n.properties.measureAxes[0])}},Se=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}}},we={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=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:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function Me(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function ke(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Me(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ce(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Me(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var qe="qHyperCubeDef.qMeasures",Ee="conditionalColoring",De="measures",Te="qDef.conditionalColoring";const Oe={quarantine:function(e){ke({properties:e,arrayPath:qe,quarantineName:Ee,arrayName:De,itemPath:Te})},unquarantine:function(e){Ce({properties:e,arrayPath:qe,itemPath:Te,arrayName:De,quarantineName:Ee})}};var Ne="qHyperCubeDef.qMeasures",Ae="measures",_e="qHyperCubeDef.qDimensions",Ie="dimensions",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const Be={quarantine:function(e){ke({properties:e,arrayPath:Ne,quarantineName:je,arrayName:Ae,itemPath:Fe}),ke({properties:e,arrayPath:_e,quarantineName:je,arrayName:Ie,itemPath:Fe})},unquarantine:function(e){Ce({properties:e,arrayPath:Ne,quarantineName:je,arrayName:Ae,itemPath:Fe}),Ce({properties:e,arrayPath:_e,quarantineName:je,arrayName:Ie,itemPath:Fe})},quarantineAlternative:function(e){ke({properties:e,arrayPath:Le,quarantineName:je,arrayName:Pe,itemPath:Fe}),ke({properties:e,arrayPath:Re,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){Ce({properties:e,arrayPath:Le,quarantineName:je,arrayName:Pe,itemPath:Fe}),Ce({properties:e,arrayPath:Re,quarantineName:je,arrayName:ze,itemPath:Fe})}},He={hypercube:W,colorChart:ye,axisChart:we,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:ke,unquarantineArrayProp:Ce,conditionalColoring:Oe,conditionalShow:Be}})(),r.default})()}(BK)),BK.exports),VK=mg(HK);function $K(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter(e=>e.qError?.qErrorCode!==T$).length,r=t.layout.qHyperCube.qDimensionInfo.filter(e=>e.qError?.qErrorCode!==T$).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(r+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(r+n))))}}const WK=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],UK=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function YK(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?Iv:"".concat(Iv,".").concat(r),paths:Array.isArray(i)?i:[]}}({config:void 0===r?{}:r}),o=i.id,a=i.paths,s={};a.forEach(function(e){var r=e.split(".");Uv(r);for(var i=s,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=Hv({theme:t,translator:n,id:o,path:e}):void 0===i[l]&&(i[l]={}),i=i[l]}});var l=function(e){var t=e.split(".");Uv(t);for(var n=s,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return s.getDefaultValue=function(e){return l(e).getDefaultValue()},s.getOptions=function(e){return l(e).getOptions()},s}({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:t?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(WK).map(e=>WK[e]),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:r}=n,{barGrouping:i,qHyperCubeDef:o}=r,a=o.qMeasures.length,s=o.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return CT.continuous({properties:r})?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:UK("axis.title",r,e)}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:UK("axis.label.name",r,e)}}},labelSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...UK("label.value",r,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:UK("legend.title",r,e)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:UK("legend.label",r,e)}}}:void 0}}}function KK(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(WK).map(e=>WK[e]),schemaIgnore:!0,defaultValue:WK[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!CT.continuous({layout:t.layout}),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>((e,t)=>{const n=t.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==T$).length,r=t.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==T$).length,i="grouped"===e.barGrouping?.grouping&&r>0&&n+r>2;return CT.continuous({layout:t})?1:i?.9:.7})(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(IA.OPTIONS).map(e=>IA.OPTIONS[e]),schemaIgnore:!0,defaultValue:IA.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}function GK(e,t,n,r=!1){return r?KK(t):YK(e,t,n)}const XK=e=>e.qError?.qErrorCode!==T$,JK=(e,t)=>e?.qHyperCube[t].filter(e=>XK(e)),ZK=e=>{if(!e)return!1;const t=kg(!0,{},e);return t.qHyperCube.qMeasureInfo=JK(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=JK(e,"qDimensionInfo"),t&&!CT.continuous({layout:t})&&CT.stacked(t)},QK=({translator:e,flags:t,anything:n})=>{const r={type:"items",show:EA,items:{period:{translation:CA,type:"string",component:"dropdown",ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.period",show:EA,globalChange:OA,options:[{value:NA.AUTO,translation:qA.AUTO},{value:NA.SECONDS,translation:qA.SECONDS},{value:NA.MINUTES,translation:qA.MINUTES},{value:NA.HOURS,translation:qA.HOURS},{value:NA.DAYS,translation:qA.DAYS},{value:NA.WEEKS,translation:qA.WEEKS},{value:NA.MONTHS,translation:qA.MONTHS},{value:NA.YEARS,translation:qA.YEARS},{value:NA.NUMBER,translation:qA.NUMBER},{value:NA.NONE,translation:qA.NONE}],undefinedValue:NA.NONE,defaultValue:NA.AUTO,schemaIgnore:!0},stepSize:{translation:qA.TITLE,type:"number",defaultValue:AA,schemaIgnore:!0,show:DA,ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.stepSize",min:Number.EPSILON,rollbackInvalid:!0}}},i=n?.sense?.isUnsupportedFeature?.("continuousData"),o={items:{labels:{items:{header:{show:(e,t,n)=>JK(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!ZK(t.layout)&&JK(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>ZK(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showSegmentLabels,set(e,t,n,r,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>ZK(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showTotalLabels,set(e,t,n,r,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>JK(n.layout,"qDimensionInfo").length&&JK(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>JK(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},a=n?.sense?.theme,s={uses:"settings",items:{simpleStyling:GK(a,t,e,!0),simpleLabels:o,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{stylingPanel:GK(a,t,e,!1),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return rU({layout:t.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=JK(t.layout,"qMeasureInfo").length,r=JK(t.layout,"qDimensionInfo").length;return r>0&&n+r>2},globalChange(e,t,n){"butterfly"!==e.barGrouping.grouping||rU({layout:n.layout})||(e.barGrouping.grouping="stacked"),"butterfly"===e.barGrouping.grouping&&e.measureAxis&&"max"!==e.measureAxis.minMax&&!e.measureAxis.autoMinMax&&(e.measureAxis.minMax="max")},change(e,t,n){"butterfly"!==e.barGrouping.grouping||rU({layout:n.layout})||(e.barGrouping.grouping="stacked"),JK(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>CT.continuous({layout:n.layout}),convertFunctions:{get(e,t,n){const r="stacked";return"butterfly"===e(t.type)?rU({layout:n.layout})?e(t.type):r:CT.continuous({layout:n.layout})?r:e(t.type)},set(e,t,n){const r=TT(n.type,n);t(n.type,e,r)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>CT.continuous({layout:n.layout}),convertFunctions:(l="vertical",{get:(e,t,n)=>CT.continuous({layout:n.layout})?l:e(t.type),set(e,t,n){const r=TT(n.type,n);t(n.type,e,r)}})},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(IA.OPTIONS).map(e=>IA.OPTIONS[e]),defaultValue:IA.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!CT.continuous({layout:n.layout})}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(ZK(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&ZK(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&ZK(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:iA}},legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,t,n)=>!CT.continuous({layout:n.layout}),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const r=JK(n.layout,"qMeasureInfo").length,i=JK(n.layout,"qDimensionInfo").length,o=e.dimensionAxis.maxVisibleItems;return o<0||o>1e4/(i+r)},globalChange:$K,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null,continuousDimension:r},show:!i},othersGroup:{items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};var l;return s.items.measureAxis={uses:"axis.flippableMeasureAxis",items:{minMax:{items:{minMax:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&!e.measureAxis.autoMinMax},min:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&["min","minMax"].includes(e.measureAxis.minMax)&&!e.measureAxis.autoMinMax},max:{invalid:e=>e.measureAxis&&"minMax"===e.measureAxis.minMax?e.measureAxis.min>=e.measureAxis.max:!(!e.measureAxis||"max"!==e.measureAxis.minMax||"butterfly"!==e.barGrouping.grouping)&&e.measureAxis.max<=0}}}}},s},eG={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){FO(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:o}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&r.length>=1&&o>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},tG=({translator:e,flags:t})=>({type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"},plugins:xA({translator:e,pluginOptions:[{value:"point",translation:e.get("Visualizations.Descriptions.Point")},{value:"line",translation:e.get("Visualizations.Descriptions.Line")}],supportNewStyles:t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")})}}),nG=({translator:e,anything:t})=>({uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,n,r){if(t?.sense?.isUnsupportedFeature?.("includeZeroValues"))return!1;const i=((e,t)=>{const n=t.layout?.qHyperCube?.qDimensionInfo?.findIndex(e=>XK(e));return t.properties?.qHyperCubeDef?.qDimensions?.[n]===e})(e,n),o=CT.continuous({layout:r.layout});return!(i&&o)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},period:{type:"string",defaultValue:"auto",ref:"qDef.continuous.period",show:!1}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},trendLines:t?.sense?.isUnsupportedFeature?.("trendlines")?void 0:KW({translator:e,allowStackedByDimension:!0})}}}});function rG({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:nG({translator:e,anything:n}),sorting:eG,addons:tG({translator:e,flags:t}),settings:QK({translator:e,flags:t,anything:n})}}}const iG=e=>e.qError?.qErrorCode!==T$;function oG({flags:e}){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const r=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter(e=>iG(e)).length;return 1===r&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return rU({layout:t?.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=t.qHyperCube.qMeasureInfo.filter(e=>iG(e)).length,r=t.qHyperCube.qDimensionInfo.filter(e=>iG(e)).length;return n+r>2&&!CT.continuous({layout:t})&&(i=t,!(i?.qHyperCube?.qDimensionInfo?.filter(e=>iG(e)).length>1&&i?.qHyperCube?.isHCEnabled));var i},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!CT.continuous({layout:t})}}},color:{uses:"color"}}}}function aG(e){const t={},n=Jx(e,"components"),r=Jx(e,"dimensionAxis.axisDisplayMode"),i=Jx(e,"dimensionAxis.maxVisibleItems"),o=n?n.filter(e=>"bar"===e.key)[0]:void 0,a=Jx(e,"tooltip");if(o&&o.style&&Object.keys(o.style).forEach(e=>{t[`chart_style_${e}`]=o.style[e]}),i&&(t.chart_dimaxis_maxVisibleItems=i),r&&(t.chart_dimaxis_axisDisplayMode=r),a){t.chart_tooltip_custom=!a.auto;const e=Jx(a,"chart.object.refId");!a.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const sG=e=>!!(e&&e.qHyperCube.qSize.qcy>0),lG={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function cG(){const e=[];return Object.keys(lG).forEach(t=>{e.push(lG[t])}),e}function uG(e){return{definition:rG(e),softDefinition:oG(e),support:{snapshot:sG,export:sG,exportData:!0,sharing:sG,viewData:!0,effects:!0,modifiers:cG()},importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=VK.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:z$(e),defaultPropertyValues:a,hypercubePath:i,extension:r}),l=s.qProperty;return l.qHyperCubeDef.qDimensions.length>1&&"stacked"===l.barGrouping.grouping&&(l.qHyperCubeDef.qMode="K",l.qHyperCubeDef.qAlwaysFullyExpanded=!0),VK.conditionalShow.unquarantine(l),VK.conditionalShow.unquarantineAlternative(l),s},exportProperties:(e,t,n)=>{VK.conditionalShow.quarantine(e.qProperty),VK.conditionalShow.quarantineAlternative(e.qProperty);return VK.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(FO),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(FO)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:r,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:o}=n;(o||!o&&r)&&(e.scrollbar=IA.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:aG}}return function(t){const n=r$();return{qae:F$(t),ext:uG(t),component(){const r=B$({env:t}),{viewState:i,viewCache:o}=H$(),a=function({picasso:t}){const n=e.useElement(),r=e.useOptions(),[i,o]=e.useState();return e.useEffect(()=>{if(!t)return()=>{};n.style.overflow="hidden";const e=t({renderer:{prio:[r?.renderer||"canvas"]}}).chart({element:n,data:[],settings:{}});o(e);const{destroy:i}=e;return()=>{i()}},[r.renderer]),i}({picasso:n}),s=fU({picasso:n,chart:a,environment:r,viewState:i,viewCache:o}),l=FK({env:t,services:s});IK({picasso:n,chart:a,services:s,environment:r,viewState:i,viewCache:o,bootstrapped:l}),(({environment:t,services:n,chart:r,viewState:i,bootstrapped:o})=>{e.onTakeSnapshot(e=>{if(!t||!n||!o)return;const{layoutService:a,dockService:s,colorService:l,discrete:c,continuousDataModel:u,reducedDataModel:d}=n,{width:f,height:h}=s.meta.chart.size;if(e.snapshotData=e.snapshotData||{},e.snapshotData.content={size:{w:f,h:h}},a.meta.isSnapshot)return Promise.resolve();e.snapshotData.content.chartData={scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:qT(r,nU.COMPONENT.LEGEND_COLOR_CAT)};const{properties:p}=o,m=p?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return m&&(e.tooltip.auto=!0),a.meta.isDiscrete?(c.command.setSnapshotData(e),d.setSnapshotData(e)):u.setSnapshotData(e),l.getMain().getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}),e.useImperativeHandle(()=>({getViewState(){if(i&&r)return{scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:qT(r,nU.COMPONENT.LEGEND_COLOR_CAT)}}}),[i,r])})({environment:r,services:s,chart:a,viewState:i,bootstrapped:l})}}}});
109
+ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return SH(c,"_invoke",function(n,r,i){var o,s,l,c=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,a}};function h(n,r){for(s=n,l=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,o=u[t],h=f.p,p=o[2];n>3?(i=p===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=h&&((i=n<2&&h<o[1])?(s=0,f.v=r,f.n=o[1]):h<p&&(i=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,f.n=p,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(SH(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,SH(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,SH(d,"constructor",c),SH(c,"constructor",l),l.displayName="GeneratorFunction",SH(c,i,"GeneratorFunction"),SH(d),SH(d,i,"Generator"),SH(d,r,function(){return this}),SH(d,"toString",function(){return"[object Generator]"}),(xH=function(){return{w:o,m:f}})()}function SH(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}SH=function(e,t,n,r){function o(t,n){SH(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},SH(e,t,n,r)}function wH(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 r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||CH(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 MH(e){return function(e){if(Array.isArray(e))return mH(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||CH(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 kH(e){return kH="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},kH(e)}function CH(e,t){if(e){if("string"==typeof e)return mH(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mH(e,t):void 0}}function qH(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var EH,DH,TH={exports:{}},OH={},NH=(DH||(DH=1,TH.exports=function(){if(EH)return OH;EH=1;var e=C_,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!o.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:i.current}}return OH.Fragment=n,OH.jsx=a,OH.jsxs=a,OH}()),TH.exports),AH=function(e){var t=e.className,n=e.title,r=e.path,i=e.fillRule;return NH.jsxs($F,{className:t,viewBox:"0 0 16 16",fontSize:"small",role:"img",style:{height:12,width:12},children:[NH.jsx("path",{d:r}),n?NH.jsx("title",{children:n}):void 0,i?NH.jsx("use",{fillRule:i}):void 0]})},_H={STYLE:{ELLIPSIS:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},FOCUS:{boxShadow:"inset 0 0 0 2px #177FE6"},ICONS:{COLOR:{PRIMARY:"rgba(89, 89, 89)",SECONDARY:"rgba(89, 89, 89, 0.8)",DISABLED:"rgba(89, 89, 89, 0.4)"}}}},IH={L:new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),R:new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),AL:new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]")},LH=function(e){return IH.L.test(e)},PH=function(e){return IH.R.test(e)||IH.AL.test(e)};function RH(e){for(var t,n=e?e.length:0,r=0;r<n;r++){if(t=e[r],LH(t))return"ltr";if(PH(t))return"rtl"}return"ltr"}var zH,FH,jH,BH,HH=PF(fB,{shouldForwardProp:function(e){return"direction"!==e&&"padding"!==e&&"styling"!==e}})(function(e){var t=e.direction,n=e.padding,r=e.styling,i=r.fontSize,o=r.fontFamily,a=r.color;return{fontWeight:"normal",lineHeight:"normal",fontSize:"".concat(i," !important"),fontFamily:"".concat(o," !important"),color:"".concat(a," !important"),height:"100%",minWidth:"0px",maxWidth:"640px",padding:n,"&:disabled":{color:a,opacity:1},"& .MuiButton-startIcon":{margin:"ltr"===t?"0 2px":void 0},"& .MuiButton-endIcon":{margin:"rtl"===t?"0 2px":void 0}}}),VH=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z",fillRule:"evenodd"})})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px"}}),$H=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5L8 9Z"})})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:_H.STYLE.ICONS.COLOR.DISABLED,opacity:.6}}}),WH=function(e){var t=e.isOpen,n=e.onClick,r=e.popoverId,i=e.source,o=i.styling,a=i.info.text,s=i.layout.direction,l=i.meta,c=l.allowed,u=l.hasAlternatives,d=l.hasCyclic,f=l.hasMultiple,h=l.index,p=l.isCyclic,m=l.isLocked,g=i.resources.translator,y=i.services.focus,v=i.settings.isDisabled,b=i.state.inSelections,x=!(!c.change||!u),S=!(!c.reload||!p),w=(x||S)&&!b&&!v(),M={pointerEvents:w?"auto":"none"},k=function(e){var t=e.allowed,n=e.canChange,r=e.canReload,i=e.direction,o=e.hasCyclic,a=e.isLocked,s={top:"8px",right:"6px",bottom:"8px",left:"6px"};if(!e.hasMultiple)return"".concat(s.top," ").concat(s.right," ").concat(s.bottom," ").concat(s.left);var l=o&&t.reload;return"ltr"===i&&(a?s.left="0px":r||!n&&l?s.left="4px":n||(s.left="2px"),n||r||(s.right="0px")),"rtl"===i&&(a?s.right="0px":r||!n&&l?s.right="4px":n||(s.right="2px"),n||r||(s.left="0px")),"".concat(s.top," ").concat(s.right," ").concat(s.bottom," ").concat(s.left)}({allowed:c,canChange:x,canReload:S,direction:s,hasCyclic:d,hasMultiple:f,isLocked:m}),C=yH(yH({},"rtl"===s?"endIcon":"startIcon",m&&NH.jsx(VH,{height:12})),"rtl"===s?"startIcon":"endIcon",(x||S)&&NH.jsx($H,{className:"".concat(b||v()?"disabled":"")})),q=k_.useRef(),E=k_.useRef();k_.useEffect(function(){t||y.shouldFor(h)&&(q.current.focus(),E.current.focusVisible())});var D=RH(a),T="Accessibility.".concat(w?"Alternative":"Normal",".Instructions");return NH.jsx(HH,bH(bH({action:E,"aria-describedby":r,"aria-label":g.get(T),color:"inherit",direction:s,disabled:!w||v()||b,onClick:function(e){w&&n(e)},padding:k,ref:q,style:M,styling:o.title,title:a},C),{},{children:NH.jsx("span",{dir:D,style:_H.STYLE.ELLIPSIS,children:a})}))},UH=function(e){var t=e.className,n=e.title;return NH.jsx(AH,{className:t,title:n,path:"M 6 2 h 10 V 1 H 6 Z m 5 5 h 5 V 6 h -5 Z m 5 5 h -5 v -1 h 5 Z M 5 10 h 1 v 2.663 a 3.5 3.5 0 1 0 -2.922 0.036 l -0.406 0.914 A 4.501 4.501 0 1 1 7.329 13 H 9 v 1 H 5 Z"})},YH=PF(fB,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e&&"styling"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast,i=e.styling.color;return{fontWeight:"normal",lineHeight:"normal",color:i,height:"24px",width:"24px",padding:0,marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px","&:disabled":{color:i,opacity:1}}}),KH=PF(UH,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast;return{color:_H.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px"}}),GH=PF(function(e){var t=e.className,n=e.title;return NH.jsx(AH,{className:t,title:n,path:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7Z"})},{})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,"&.disabled":{color:_H.STYLE.ICONS.COLOR.DISABLED}}}),XH=function(e){var t=e.source;if(!t.meta.isCyclic)return null;var n=wH(k_.useState(!1),2),r=n[0],i=n[1],o=t.styling,a=t.action.stepCycle,s=t.info,l=s.position,c=s.tooltip,u=t.layout.direction,d=t.meta,f=d.allowed,h=d.isFirst,p=d.isLast,m=t.settings.isDisabled,g=t.state.inSelections;return k_.useEffect(function(){r&&i(!1)},[l]),f.reload?NH.jsx(YH,{direction:u,disabled:r||g||m(),isFirst:h,isLast:p,onClick:function(){return i(!0),void a()},styling:o.title,title:c,variant:"outlined",children:NH.jsx(GH,{className:"".concat(r||g||m()?"disabled":"")})}):NH.jsx(KH,{direction:u,isFirst:h,isLast:p,style:{flexShrink:0},title:c})},JH=function(e){var t=e.className,n=e.title;return NH.jsx(AH,{className:t,title:n,path:"M7 4h9v1H7V4ZM9 8h7v1H9V8ZM11 12h5v1h-5v-1ZM1 4v3.526a3.5 3.5 0 0 0 3.5 3.5h2.31L5.22 9.402l.715-.7L8.7 11.527 5.935 14.35l-.714-.7 1.59-1.624H4.5a4.5 4.5 0 0 1-4.5-4.5V4h1Z"})},ZH=PF(fB,{shouldForwardProp:function(e){return"styling"!==e}})(function(e){var t=e.styling,n=t.fontSize,r=t.fontFamily,i=t.color;return{fontWeight:"normal",lineHeight:"normal",fontSize:"".concat(n," !important"),fontFamily:"".concat(r," !important"),color:"".concat(i," !important"),padding:"0px 5px",height:"100%",minWidth:"45px","&:disabled":{color:i}}}),QH={color:_H.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:_H.STYLE.ICONS.COLOR.DISABLED}},eV=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5 8.5 8z"})})(function(){return QH}),tV=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"})})(function(){return QH}),nV=PF(JH,{shouldForwardProp:function(e){return"direction"!==e&&"isFirst"!==e&&"isLast"!==e}})(function(e){var t=e.direction,n=e.isFirst,r=e.isLast;return{color:_H.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==t||n?void 0:"4px",marginRight:"rtl"!==t||r?void 0:"4px"}}),rV=function(e){var t=e.source;if(!t.meta.isDrillDown)return null;var n=t.styling,r=t.action.drillUp,i=t.info,o=i.breadcrumbs,a=i.tooltip,s=t.layout.direction,l=t.meta,c=l.isFirst,u=l.isLast,d=t.settings.isDisabled,f=t.state.inSelections,h=d()||f?"disabled":null,p=yH({},"rtl"===s?"startIcon":"endIcon","rtl"===s?NH.jsx(tV,{className:h}):NH.jsx(eV,{className:h})),m=o.map(function(e,t){var i=RH(e);return NH.jsx(ZH,bH(bH({disabled:d()||f,onClick:function(){return function(e){r({steps:o.length-e})}(t)},styling:n.title,title:e},p),{},{children:NH.jsx("span",{dir:i,style:_H.STYLE.ELLIPSIS,children:e})}),"breadcrumb-".concat(e))});return NH.jsxs(NH.Fragment,{children:["rtl"===s?m.reverse():void 0,NH.jsx(nV,{direction:s,isFirst:c,isLast:u,style:{flexShrink:0},title:a}),"rtl"===s?void 0:m]})},iV=PF(KB,{shouldForwardProp:function(e){return"nested"!==e&&"rtl"!==e}})(function(e){var t=e.nested,n=e.rtl;return{padding:"4px ".concat(t&&n?"32px":"16px"," 4px ").concat(t&&!n?"32px":"16px"),"&:focus":bH({},_H.STYLE.FOCUS)}}),oV=PF(ZB)(function(){return{marginRight:0,justifyContent:"center"}}),aV=PF(function(e){var t=e.className;return NH.jsx(AH,{className:t,path:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2 3 3Z"})})(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY}}),sV=PF(UH)(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY}}),lV=PF(JH)(function(){return{color:_H.STYLE.ICONS.COLOR.SECONDARY,fontWeight:600}}),cV=function(e){var t=e.meta;return e.selected?NH.jsx(aV,{height:12}):null!=t&&t.isCyclic?NH.jsx(sV,{height:12}):null!=t&&t.isDrillDown?NH.jsx(lV,{height:12}):void 0},uV=function(e){var t=e.id,n=e.meta,r=e.nested,i=e.onClick,o=e.selected,a=e.source,s=e.text,l=a.styling,c=a.settings.isRTL,u=bH({fontWeight:!n||n.isNormal?"normal":600,lineHeight:"normal",fontSize:l.popover.fontSize,fontFamily:l.popover.fontFamily,color:l.popover.color,textAlign:c?"end":"start"},_H.STYLE.ELLIPSIS),d=RH(s),f=NH.jsx(oV,{sx:c?{paddingRight:"12px"}:{paddingLeft:"12px"},children:cV({meta:n,selected:o})});return NH.jsx(C_.Fragment,{children:NH.jsxs(iV,{autoFocus:o,nested:r,onClick:function(e){return null==i?void 0:i(e)},rtl:c,title:s,children:[c&&f,NH.jsx(rH,{dir:d,primaryTypographyProps:{style:u},children:s}),!c&&f]})},t)},dV=PF(_B)(function(){return{marginTop:"-1px"}}),fV=function(e){var t=e.anchor,n=e.id,r=e.onClose,i=e.open,o=e.source,a=o.action,s=a.changeTo,l=a.drillUp,c=a.setActiveField,u=o.info,d=u.breadcrumbs,f=u.group,h=u.id,p=u.text,m=o.data.alternatives,g=o.meta,y=g.index,v=g.isCyclic,b=g.isDrillDown,x=o.resources.translator,S=o.services.focus,w={isChanging:!1},M=k_.useRef(),k=function(){var e,t=document.activeElement;null!=M&&null!==(e=M.current)&&void 0!==e&&e.contains(t)&&t.blur(),r()},C=v||b,q=NH.jsx(uV,{id:h,meta:o.meta,onClick:k,selected:!C,source:o,text:C?f.name:p},h),E=C&&f.items.map(function(e){return NH.jsx(uV,{id:e.id,nested:!0,onClick:function(t){return function(e,t){w.isChanging||(w.isChanging=!0,"keydown"!==e.type&&"keyup"!==e.type||S.queueFor(y),v&&c({fieldIndex:t.index}),b&&l({steps:d.length-t.index}))}(t,e)},selected:e.current,source:o,text:e.text})}),D=m.map(function(e,t){return NH.jsxs(C_.Fragment,{children:[NH.jsx(uV,{id:e.id,meta:e.meta,onClick:function(t){return n=t,r=e.id,void(w.isChanging||(w.isChanging=!0,"keydown"!==n.type&&"keyup"!==n.type||S.queueFor(y),s({id:r})));var n,r},source:o,text:e.text},e.id),t<m.length-1&&NH.jsx(dV,{},"divider-".concat(e.id))]},e.id)});return NH.jsx(pH,{anchorEl:t,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:n,onClose:k,open:i,ref:M,slotProps:{paper:{style:{minWidth:"250px",maxWidth:"640px",maxHeight:"300px"}}},transformOrigin:{vertical:"bottom",horizontal:"center"},children:NH.jsxs(VB,{"aria-label":x.get("Accessibility.Popover.Instructions"),dense:!0,children:[q,E,NH.jsx(dV,{},"divider-".concat(h)),D]})})},hV=function(e){var t=e.source,n=wH(k_.useState(null),2),r=n[0],i=n[1],o={id:r?"alternatives-popover":void 0,isOpen:Boolean(r)},a=t.layout.direction,s=t.meta.index,l=t.services.focus,c=function(){i(null)};k_.useEffect(function(){o.isOpen&&c()},[t.info.key]);var u=NH.jsx(XH,{source:t}),d=NH.jsx(rV,{source:t});return NH.jsxs(NH.Fragment,{children:["rtl"===a?void 0:d,"rtl"===a?void 0:u,NH.jsx(WH,{onClick:function(e){var t=e.currentTarget;t.classList.contains("qcm-focus-visible")&&l.queueFor(s),i(t)},isOpen:o.isOpen,popoverId:o.id,source:t}),NH.jsx(fV,{anchor:r,id:o.id,onClose:c,open:o.isOpen,source:t}),"rtl"===a?d:void 0,"rtl"===a?u:void 0]})},pV=function(){if(FH)return zH;FH=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=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 r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},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(r)return r(t,n).value}return t[n]};return zH=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},zH}(),mV=qH(pV),gV={},yV=qH((jH||(jH=1,BH=gV,(()=>{var e={370:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=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 r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(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(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](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 r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>De});var i=n(370),o=n.n(i);const a=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},s=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},l={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 c="".concat(" ","(").concat(" "),u="".concat(" ",")").concat(" ");function d(e){return c+e+u}function f(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,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=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((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function h(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function m(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 g(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function y(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function v(e){return void 0===e?")":", 0, ".concat(e,")")}function b(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(b("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(b("MaxString(".concat(t,")")),")'\"}")}function S(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=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(r&&1===r.length){var c=x(f(r[0],i),g(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var u=f(r[0],i),d=f(r[1],i),h=g(0),p=g(1),m=x(u,h),y=x(d,p);return"".concat(a,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function w(e){return"".concat(e,"(")}function M(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}const k={isFullRange:h,getNumDimensions:M,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=d(m(t));if(!n.showExcludedValues)return a;var s=S({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=g(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var u=g(0),f=g(1);return"If(Count(".concat(u,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return p(e,t)},getAboveCompPrefix:y,getAboveCompSuffix:v,getAboveComp:function(e,t,n,r){return y(e,t)+n+v(r)},getFunctionPrefix:w,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return w(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:S,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===M({properties:n,layout:r})},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),r=g(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(c);if(-1!==n){var r=t.indexOf(u);if(-1!==r)return t.substring(n+c.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:f,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=M({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:d,canExtract:function(e){var t=e.indexOf(c),n=e.indexOf(u);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:g,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=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});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=l.OPTIONS.find(function(t){return t.value===e.decomposition});return t?l.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(l.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return l.EXPRESSIONS[n]&&r.includes(l.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function q(e){return q="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},q(e)}var E=o().bind(null,!0),D={},T=Array.isArray;function O(e){return null!=e&&!Array.isArray(e)&&"object"===q(e)}function N(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function _(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=N(e[n||t])?o:e[t],e=e[n||t]}}),e}function I(e,t){var n=!0;if(O(e)&&O(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){I(e[r],t[r])||(n=!1)}),n);if(T(e)&&T(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!I(e[r],t[r]))return!1;return!0}return e===t}D.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?E({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);I(o,a)||A(t,i)||(N(a)?r.push({op:"add",path:s,value:o}):O(o)&&O(a)?r=r.concat(D.generate(a,o,s)):T(o)&&T(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&N(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(I(t,i))return r;if(!N(t[0])&&N(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(D.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){N(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},D.apply=function(e,t){t.forEach(function(t){var n,r,i=_(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(T(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(T(a)&&T(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return C(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(r)||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(O(a)&&O(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),E(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=_(e,t.from);T(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(T(i)?i.splice(+o,1):delete i[o])})},D.clone=function(e){return E({},e)},D.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},D.updateObject=function(e,t){Object.keys(e).length?D.apply(e,D.generate(e,t)):E(e,t)};const L=D;var P="accumulation";function R(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var F={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const j={translationKey:"properties.modifier.accumulation",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=k.getNumStepComp(n,l),f=k.getAboveComp(n,l,u,d),h=k.getRangeComp("RangeSum",f);if(k.needDimension({modifier:n,properties:r,layout:i})){var p=k.getDimComp(c,1),m=k.getDimComp(c,0),g=k.getAggrComp(h,p,m);h=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return h},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,F)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(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(z(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(z(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(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=R(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=R(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=R(t,e);return o&&!o.disabled}}}};var B="movingAverage";function H(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===B)return n[r]}function V(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===B)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const W={translationKey:"properties.modifier.movingAverage",needDimension:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=k.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=k.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=k.getNumStepComp(r,c),p=k.getAboveComp(r,c,f,h);if(r.nullSuppression)t=k.getRangeComp("RangeAvg",p);else{var m=k.getRangeComp("RangeSum",p),g=function(e,t){var n=k.getRowNoComp(e,t);if(!k.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(k.needDimension({modifier:r,properties:i,layout:o})){var v=k.getDimComp(u,1),b=k.getDimComp(u,0),x=k.getAggrComp(y,v,b);y=r.showExcludedValues?k.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:k.extractInputExpression,initModifier:function(e){k.initModifier(e,$)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(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(V(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(V(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(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=H(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=H(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(B))return!1;var o=H(t,e);return o&&!o.disabled}}}};var U="timeSeriesDecomposition";function Y(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function K(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;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:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?k.generateTSDExpression(n,t,r):t},extractInputExpression:k.extractInputExpression,initModifier:function(e,t){k.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=k.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(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:l.OPTIONS},steps:{refFn:function(t){return"".concat(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=Y(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=Y(t,e);return n&&!n.fullRange}}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=Y(t,e);return o&&!o.disabled}}}};var J="difference";function Z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===J)return r;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:k.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=k.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(k.needDimension({modifier:n,properties:r,layout:i})){var h=k.getDimComp(c,1),p=k.getDimComp(c,0),m=k.getAggrComp(f,h,p);f=n.showExcludedValues?k.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return f},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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(J))return!1;var o=function(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}(t,e);return o&&!o.disabled}}}};var te="normalization";function ne(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(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(k.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(k.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return k.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:k.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=k.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=k.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a,s){var l=ae(t),c=se(t,n,r),u=""===l&&""===c?"":l||c,d=le(i,o),f=ce(i,o,a),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=k.getDimDefWithWrapper(n);return t.join(", ")}(o);return s?"(If(".concat(e," < 0, null(), ").concat(e,"))/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," RangeMax( 0, ").concat(e,"), ").concat(h,"))"):"".concat(e,"/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," ").concat(e,", ").concat(h,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension,n.ignoreNegative)},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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!k.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(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 r=[{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 r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(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(re(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(re(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,r){return function(e,t,n,r){var i=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===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(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 k.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}}},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="library id deleted",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId",ge="qDef.qLabel",ye="qDef.qLabelExpression",ve="qDef.base.qLabel",be="qDef.base.qLabelExpression",xe="qDef.qAggrFunc",Se="qDef.base.qAggrFunc",we="qDef.base";const Me={getExpression:function(e){var t=s(e,he);return void 0!==t?t:s(e,fe)},getExpressionRef:function(e){return void 0!==s(e,he)?he:fe},getLibraryIdRef:function(e){return s(e,me)?me:pe},getLibraryId:function(e){return s(e,me)||s(e,pe)},getLabelRef:function(e){return s(e,we)?ve:ge},getLabelExpressionRef:function(e){return s(e,we)?be:ye}};var ke={initBase:function(e,t){(t||ke.isValid(e))&&(a(e,he,s(e,fe)),a(e,me,s(e,pe)),a(e,ve,s(e,ge)),a(e,be,s(e,ye)))},restoreBase:function(e){ke.isValid(e)&&(a(e,fe,s(e,he)),a(e,pe,s(e,me)),a(e,ge,s(e,ve)),a(e,ye,s(e,be)),s(e,xe)&&s(e,Se)&&a(e,xe,s(e,Se)),delete e.qDef.base)},isValid:function(e){var t=s(e,he),n=s(e,me);return void 0!==t||void 0!==n}};const Ce=ke;function qe(e){return qe="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},qe(e)}var Ee={accumulation:j,movingAverage:W,difference:ee,normalization:ue,timeSeriesDecomposition:X};const De={modifiers:Ee,apply:Oe,applyModifiers:Ne,cleanUpMeasure:Ae,destroy:function(e){e&&Te[e.id]&&Te[e.id].masterItemSubscriber&&(Te[e.id].masterItemSubscriber&&Te[e.id].masterItemSubscriber.unsubscribe(),delete Te[e.id])},hasActiveModifiers:_e,getActiveModifier:Ie,initBase:Ce.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ee[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ee[e]&&Ee[e].isApplicable({properties:n,layout:r})})},measureBase:Me,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Re(e);$e({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ge({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Le};var Te={};function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,i=void 0!==r&&r,a=e.masterItem,l=!1;Te[t.id]=Te[t.id]||{isFirstTime:!0};var c=Te[t.id].isFirstTime;if(Te[t.id].isFirstTime=!1,n&&"object"===qe(n))return Ne({model:t,properties:n});var u=t?t.layout:void 0,d=s(u,"qSelectionInfo.qInSelections");if(i||d)return Promise.resolve(l);var f=s(u,"qHyperCube.qMeasureInfo"),h=Te[t.id].lastReloadTime;if(Te[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),_e({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return s(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ve({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:t,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return $e({modifiers:Re(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:a,isFirstTime:c})?t.getEffectiveProperties().then(function(e){var n=o()(!0,{},e);Fe(n);var r=Xe(n);return We({model:t}).then(function(i){return Ue({libraryIds:r,model:t}).then(function(r){return p&&function(e){var t=e.properties;Pe(t).forEach(function(e){return function(e){var t=e.measure;if(Ve({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(n++,"object"!==qe(Ee[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 r=Ee[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Be(t)&&k.simplifyExpression(t.qDef.base.qDef)!==k.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:n}),Ne({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})})}).catch(function(){return Promise.resolve(l)})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===qe(e.base)})}(f)?t.getEffectiveProperties().then(function(e){return function(e){var t=e.model,n=e.properties,r=Xe(n);return Je({model:t,libraryIds:r}).then(function(){var e=o()(!0,{},n);return Pe(n).forEach(function(e){return Ae(e)}),Ke({oldProperties:e,newProperties:n,model:t})})}({model:t,properties:e})}):Promise.resolve(l)}function Ne(e){var t=e.model,n=e.oldProperties,r=e.properties,i=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?o()(!0,{},r):r),Fe(r);var f=Xe(r);return Je({model:t,libraryIds:f,masterItem:c}).then(function(){return function(e){var t=e.measures,n=e.properties,r=e.model,i=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=Pe(n)),!t.length)return Promise.resolve();if(!i&&!_e({measures:t,properties:n}))return t.forEach(function(e){return Ae(e)}),Promise.resolve();var l=i?void 0:Xe(n);return We({model:r,dimensionAndFieldList:a}).then(function(e){return Ue({libraryIds:l,model:r,libraryItemsProps:i}).then(function(r){t.forEach(function(t){var i=t.qDef.modifiers;r&&$e({modifiers:i,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,i=e.dimensionAndFieldList,a=0;Ce.isValid(t)||Ce.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(a++,"object"!==qe(Ee[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ee[e.type].initModifier(e,t);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ee[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=t.qDef.base.qLabel||a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=t.qDef.base.qNumFormat||a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:i}):function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList;"function"==typeof Ee[n.type].updateModifier&&Ee[n.type].updateModifier(n,r.qHyperCubeDef);var a=Me.getExpression(t),s=""===a?a:Ee[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:i}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||Le(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Le(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}})}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),je(t)):Ae(t)})})})}({measures:i,properties:r,model:t,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Ke({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)})}).catch(function(){return Promise.resolve(!1)})}function Ae(e){!function(e){var t=Re(e);return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&!Ee[e.type]})}(e)?Ce.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,je(e)}function _e(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return $e({modifiers:Re(e),properties:n,layout:r})})}function Ie(e){var t=Re(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ee[r.type]&&!r.disabled)return r}}function Le(e){var t=Ie(e);return!t||Ee[t.type].enableTotalsFunction(e)}function Pe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Re(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ze(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Fe(e){Pe(e).forEach(function(e){return function(e){var t=Ie(e);t&&(void 0!==t.outputExpression&&ze(t)!==e.qDef.qDef?delete e.qDef.base:!Ce.isValid(e)&&t.base&&(e.qDef.base=o()(!0,{},t.base)))}(e)})}function je(e){var t=Re(e);Array.isArray(t)&&t.forEach(function(t){"object"===qe(t)&&(t.disabled||!Ee[t.type]&&ze(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Be(e){return e.base||e.qDef&&e.qDef.base}function He(e){var t=Be(e);return e.qLibraryId||t&&t.qLibraryId}function Ve(e){var t=e.measure,n=e.properties,r=e.layout;return!He(t)&&$e({modifiers:Re(t),properties:n,layout:r})}function $e(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==qe(e)||e.disabled||!Ee[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ee[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function We(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ue(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.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}).catch(function(){return null})}function Ye(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ke(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Ye)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&s(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):function(e,t,n){if(!e)return Promise.resolve();var r=L.generate(t,n);return o()(!0,t,n),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()}(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ge(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&Ee[e.type]&&Ee[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Xe(e){var t=Pe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=Re(t);if($e({modifiers:r,properties:e})){var o=He(t);o&&n.push(o),i=i||Ge({modifiers:r,properties:e})}}),s(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function Je(e){var t=e.model,n=e.libraryIds,r=e.masterItem;return!r&&r!==de&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Te[t.id].masterItemSubscriber=Te[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach(function(n){t[n]=s(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(){Object.keys(r).forEach(function(e){i[e]||o[e]||(r[e].listener.dispose(),r[e].unbindCloseListnener(),delete r[e])})}var d=function(e,t){return e.once("closed",t),function(){return e.removeListener("closed",t)}};function f(e,i){return t.app[i](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),unbindCloseListnener:d(t,function(){return e=t.id,n(de),delete r[e],void u();var e}),enabled:!1,properties:l(t.layout)}}).catch(function(){})}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),o={},t.forEach(function(e){o[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:a}),u(),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(f(e,"getMeasure"))}),Object.keys(o).forEach(function(e){o[e]&&!r[e]&&s.push(f(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose(),r[e].unbindCloseListnener()}),r={}}}}({model:t,callback:function(e){return Oe({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Te[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}for(var Ze in BH.default=r.default,r)-1===["default"].indexOf(Ze)&&(BH[Ze]=r[Ze]);Object.defineProperty(BH,"__esModule",{value:!0})})()),gV));function vV(e){var t=e.model,n=e.properties;return e.noModelDependencies?yV.apply({model:t,properties:n}):t.modifiers?t.modifiers.apply({model:t,properties:n}):Promise.resolve()}function bV(e){return Array.isArray(e)}function xV(e){return null!=e&&!Array.isArray(e)&&"object"===kH(e)}function SV(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function wV(e){return void 0===e}function MV(e,t){if(xV(e)&&xV(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n=Object.keys(e),r=0,i=n.length;r<i;r+=1)if(!MV(e[n[r]],t[n[r]]))return!1;return!0}if(bV(e)&&bV(t)){if(e.length!==t.length)return!1;for(var o=0,a=e.length;o<a;o+=1)if(!MV(e[o],t[o]))return!1;return!0}return e===t}function kV(e){var t=e.oldData,n=void 0===t?{}:t,r=e.newData,i=void 0===r?{}:r,o=e.basePath,a=void 0===o?"":o,s=[];return Object.keys(i).forEach(function(e){var t=function(e){return e?mV(!0,{},{value:e}).value:e}(i[e]),r=n[e],o="".concat(a,"/").concat(e);MV(t,r)||SV(i,e)||(wV(r)?s.push({op:"add",path:o,value:t}):xV(t)&&xV(r)?s.push.apply(s,MH(kV({oldData:r,newData:t,basePath:o}))):bV(t)&&bV(r)?s.push.apply(s,MH(function(e){var t=e.newArray,n=e.basePath,r=[];return MV(t,e.oldArray.slice())||(!wV(t[0])&&wV(t[0].qInfo)||0===t.length)&&r.push({op:"replace",path:n,value:t}),r}({oldArray:r,newArray:t,basePath:o}))):s.push({op:"replace",path:o,value:t}))}),Object.keys(n).forEach(function(e){wV(i[e])&&!SV(n,e)&&s.push({op:"remove",path:"".concat(a,"/").concat(e)})}),s}function CV(e){var t=e.model,n=kV({oldData:e.oldProperties,newData:e.newProperties});null!=t&&t.applyPatches&&null!=n&&n.length&&t.applyPatches(n.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),!0)}function qV(e){var t=e.properties,n=e.container,r=e.filtered,i=t.color;if(i){var o=i.auto,a=i.mode;if(!o){var s,l=r.map(function(e){var r;return null===(r=t.qHyperCubeDef[n][e])||void 0===r?void 0:r.qDef.cId}).filter(function(e){return void 0!==e}),c=t.qHyperCubeDef[n].filter(function(e){return!l.includes(e.qDef.cId)});if("byDimension"===a&&"qDimensions"===n){var u=i.byDimDef;if(!u)return;var d=void 0===u.activeDimensionIndex?-1:u.activeDimensionIndex;if(d<0)return;var f=c[d];if(!f)return;if(f.qLibraryId)i.byDimDef={type:"libraryItem",key:f.qLibraryId,label:f.qLibraryId,activeDimensionIndex:d};else{var h=f.qDef,p=h.qLabelExpression||h.qFieldLabels&&h.qFieldLabels[0]||h.qFieldDefs[0],m=(s=f.qDef.qFieldDefs[0]).split(" ").length>1&&"="!==s[0]&&"["!==s[0]?"[".concat(s,"]"):s;i.byDimDef={type:"expression",key:m,label:p||m,activeDimensionIndex:d}}}if("byMeasure"===a&&"qMeasures"===n){var g=i.byMeasureDef;if(!g)return;var y=void 0===g.activeMeasureIndex?-1:g.activeMeasureIndex;if(y<0)return;var v=c[y];if(!v)return;var b=yV.measureBase.getLibraryId(v);if(b){i.byMeasureDef={type:"libraryItem",key:b,label:b,activeMeasureIndex:y};var x=yV.hasActiveModifiers({measures:[v]})?v.qDef.qDef:void 0;x&&(i.byMeasureDef.expression=x)}else{var S=v.qDef;i.byMeasureDef={type:"expression",key:S.qDef,label:S.qLabelExpression||S.qLabel||S.qDef,activeMeasureIndex:y}}}}}}function EV(e){return DV.apply(this,arguments)}function DV(){var e;return e=xH().m(function e(t){var n,r,i,o,a,s,l,c,u,d,f,h,p,m;return xH().w(function(e){for(;;)switch(e.n){case 0:if(n=t.from,r=t.to,i=t.model,o=t.container,a=t.filtered,s=t.noModelDependencies,l=t.skipAttributeExpressions,c=t.onChange,i){e.n=1;break}return e.a(2);case 1:return e.n=2,i.getEffectiveProperties();case 2:return u=e.v,d=u.qHyperCubeDef[o].findIndex(function(e){return e.qDef.cId===n}),f=u.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o].findIndex(function(e){return e.qDef.cId===r}),h=mV(!0,{},u),p=h.qHyperCubeDef[o][d],(m=h.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o][f]).qAttributeDimensions=p.qAttributeDimensions,p.qAttributeDimensions=[],l||(m.qAttributeExpressions=p.qAttributeExpressions,p.qAttributeExpressions=[]),h.qHyperCubeDef[o][d]=m,h.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[o][f]=p,c({fromItem:p,toItem:m,oldProperties:u,newProperties:h,model:i}),e.n=3,vV({model:i,properties:h,noModelDependencies:s});case 3:s?qV({properties:h,container:o,filtered:a}):i.colorSupport&&i.colorSupport.colorByUpdater(h,"qHyperCubeDef."),CV({model:i,oldProperties:u,newProperties:h});case 4:return e.a(2)}},e)}),DV=function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){gH(o,r,i,a,s,"next",e)}function s(e){gH(o,r,i,a,s,"throw",e)}a(void 0)})},DV.apply(this,arguments)}function TV(e){var t=e.callbacks,n=e.data,r=e.resources,i=e.settings,o=t.onChange,a=n.infos,s=n.filtered,l=r.app,c=r.model,u=r.translator,d=i.noModelDependencies,f=i.skipAttributeExpressions;return a.map(function(e,t){var n=e.cId,r=e.qGrouping,i=e.qGroupFallbackTitles,a=e.qGroupPos,h=e.qFallbackTitle,p=e.qLocked,m=e.title,g="C"===r,y="H"===r,v="N"===r,b="number"==typeof e.explicitColumn?e.explicitColumn:t,x=function(t,n){g&&l&&l.getDimension&&l.getDimension(e.qLibraryId).then(function(e){null==e||e[t](n)}).catch(function(){})};return{meta:{isCyclic:g,isDrillDown:y,isLocked:!!p,isNormal:v},info:{id:n,key:"".concat(n,"-").concat(a),text:v?h:i[a],position:a,breadcrumbs:i.slice(0,e.qGroupPos),group:{name:m,items:i.slice(0,y?e.qGroupPos+1:i.length).map(function(e,t){return{id:"".concat(n,"-item-").concat(t),text:e,current:a===t,index:t}})},tooltip:v?void 0:u.get(g?"Tooltip.dimensions.cyclic":"Tooltip.dimensions.drilldown")},action:{changeTo:function(e){var t=e.id;return EV({from:n,to:t,container:"qDimensions",model:c,filtered:s,noModelDependencies:d,skipAttributeExpressions:f,onChange:o})},drillUp:function(e){var t=e.steps;y&&c&&(null==c||c.drillUp("/qHyperCubeDef",b,t))},stepCycle:function(){return x("stepCycle",1)},setActiveField:function(e){var t=e.fieldIndex;return x("setActiveField",t)}}}})}function OV(e){var t=e.callbacks,n=e.data,r=e.resources,i=e.settings,o=t.onChange,a=n.infos,s=n.filtered,l=r.model,c=i.noModelDependencies,u=i.skipAttributeExpressions;return a.map(function(e){var t=e.cId,n=e.qFallbackTitle;return{meta:{isNormal:!0},info:{id:t,key:t,text:n},action:{changeTo:function(e){var n=e.id;return EV({from:t,to:n,container:"qMeasures",model:l,filtered:s,noModelDependencies:c,skipAttributeExpressions:u,onChange:o})}}}})}function NV(e){var t=e.callbacks,n=e.data,r=e.dock,i=e.key,o=e.rect,a=e.resources,s=e.settings,l=e.state,c=e.styling,u=function(e){var t=e.dock,n=e.rect,r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"!==t&&"right"!==t||(r.width="".concat(n.height,"px"),r.height="".concat(n.width,"px"),r.transformOrigin="top left"),"left"===t&&(r.transform="rotate(-90deg) translate(-".concat(n.height,"px, 0)")),"right"===t&&(r.transform="rotate(90deg) translate(0, -".concat(n.width,"px)")),r}({dock:r,rect:o}),d=function(e){var t=e.callbacks,n=e.data,r=e.dock,i=e.key,o=e.resources,a=e.settings,s=e.state,l=e.styling,c=n.alternatives,u=n.infos,d=o.app,f=o.cache,h=o.model,p=a.isRTL,m=a.isSnapshot,g=a.noModelDependencies,y=a.type,v=function(e){var t=e.dock;return"top"!==t&&"bottom"!==t||!e.isRTL?"ltr":"rtl"}({dock:r,isRTL:p}),b=function(e){var t=e.cache,n="axis-title-auto-focus_"+e.key;return{queueFor:function(e){var r;return null==t||null===(r=t.set)||void 0===r?void 0:r.call(t,n,{focus:!0,index:e})},shouldFor:function(e){var r,i,o=null==t||null===(r=t.get)||void 0===r?void 0:r.call(t,n),a=!(null==o||!o.focus||(null==o?void 0:o.index)!==e);return a&&(null==t||null===(i=t.set)||void 0===i||i.call(t,n,{focus:!1})),a}}}({cache:f,key:i}),x=("dimension"===y?TV:OV)({callbacks:t,data:n,resources:o,settings:a});"rtl"===v&&x.reverse();var S={allowed:{change:g?!m:!(null==h||!h.modifiers||null==h||!h.colorSupport||m),reload:!!d&&!m},hasAlternatives:!!c.length,hasCyclic:x.some(function(e){return e.meta.isCyclic}),hasMultiple:u.length>1};return x.map(function(e,t){return bH(bH({data:n,layout:{direction:v},resources:{translator:o.translator},services:{focus:b},settings:a,state:s,styling:l},e),{},{meta:bH(bH(bH({},S),e.meta),{},{index:t,isFirst:0===t,isLast:t===x.length-1})})})}({callbacks:t,data:n,dock:r,key:i,resources:a,settings:s,state:l,styling:c});return NH.jsx("div",{style:u,children:d.map(function(e){return NH.jsxs(C_.Fragment,{children:[NH.jsx(hV,{source:e}),!e.meta.isLast&&NH.jsx("span",{dir:e.layout.direction,style:bH(bH({},c.title),{},{lineHeight:"normal"}),children:", "})]},e.info.id)})})}var AV,_V='"Source Sans Pro", "Arial", "sans-serif"',IV="12px",LV=function(e){var t=e.rect,n=e.state,r=e.settings,i=r.callbacks,o=r.data,a=r.key,s=r.layout,l=r.resources,c=r.settings,u=r.style;return NV({callbacks:i,data:o,dock:s.dock,key:a,rect:t,resources:l,settings:c,state:n,styling:u})},PV={renderer:"react",require:["renderer"],disableTriggers:!0,key:"axis-title",defaultSettings:{callbacks:{onChange:function(){}},data:{alternatives:[],infos:[],filtered:[]},resources:{app:void 0,cache:void 0,model:void 0,selections:void 0,translator:void 0},settings:{isDisabled:function(){return!1},isRTL:!1,isSnapshot:!1,noModelDependencies:!1,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:"#333",fontFamily:_V,fontSize:IV},popover:{color:"#595959CC",fontFamily:_V,fontSize:IV}}},preferredSize:function(){var e=this.settings,t=e.data,n=e.settings,r=e.style,i=t.alternatives,o=n.type,a=r.title,s=a.fontSize,l=a.fontFamily,c=i.length||"measure"!==o?28:20,u=this.registries.renderer("svg")().measureText({text:"M",fontSize:s,fontFamily:l}).height;return Math.max(c,u)},created:function(){var e=this;this.state={inSelections:!1},this.listeners={onSelectionsActivated:function(){e.state.inSelections=!0,e.renderer.render(LV(e))},onSelectionsDeactivated:function(){e.state.inSelections=!1}}},beforeMount:function(){var e=this.settings.resources.selections;e&&(e.addListener("activated",this.listeners.onSelectionsActivated),e.addListener("deactivated",this.listeners.onSelectionsDeactivated),e.addListener("canceled",this.listeners.onSelectionsDeactivated))},render:function(){return LV(this)},beforeUnmount:function(){var e=this.settings.resources.selections;e&&(e.removeListener("activated",this.listeners.onSelectionsActivated),e.removeListener("deactivated",this.listeners.onSelectionsDeactivated),e.removeListener("canceled",this.listeners.onSelectionsDeactivated))}},RV=function(e){var t=e.dock,n=e.settings.label,r="center"===t,i=r?{}:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};return NH.jsx("span",{style:i,title:n,children:r?n:"* ".concat(n)})},zV={renderer:"react",disableTriggers:!0,key:"disclaimer",defaultSettings:{settings:{isRTL:!1,label:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"'}},preferredSize:function(){return 22},render:function(){var e=this.rect,t=this.settings,n=t.layout,r=t.settings,i=t.style;return function(e){var t=e.dock,n=e.rect,r=e.settings,i=e.styling,o=function(e){var t=e.dock;return"top"!==t&&"bottom"!==t||!e.isRTL?"ltr":"rtl"}({dock:t,isRTL:r.isRTL}),a=function(e){var t=e.dock,n=e.rect,r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#404040",fontStyle:"italic",fontSize:"13px",fontFamily:e.styling.fontFamily};return"left"===t&&(r.width="".concat(n.height,"px"),r.transform="rotate(-90deg) translate(-".concat(n.height,"px, 0)"),r.transformOrigin="top left"),"right"===t&&(r.width="".concat(n.height,"px"),r.transform="rotate(90deg) translate(0, -".concat(n.width,"px)"),r.transformOrigin="top left"),"center"===t&&(r.width="".concat(n.width,"px"),r.height="".concat(n.height,"px"),r.color="#404040",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center"),"bottom"!==t&&"top"!==t||(r.justifyContent="flex-start",r.alignItems="flex-start"),r}({dock:t,rect:n,styling:i});return NH.jsx("div",{dir:o,style:a,children:NH.jsx(RV,{dock:t,settings:r})})}({dock:n.dock,rect:e,settings:r,styling:i})}},FV={},jV=function(){if(AV)return FV;AV=1;var e=ij;return FV.createRoot=e.createRoot,FV.hydrateRoot=e.hydrateRoot,FV}(),BV=bF({spacing:8,shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{standard:300,short:250,enteringScreen:225,shorter:200,leavingScreen:195,shortest:150,complex:375}},typography:{fontSize:14,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,htmlFontSize:14,fontFamily:"'Source Sans Pro', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif",button:{fontWeight:600,fontSize:14,textTransform:"none"}},shape:{borderRadius:3},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"qcm-focus-visible"}},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"qcm-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:141,borderRadius:3,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},text:{padding:"8px 16px","&:active":{backgroundColor:"rgba(0, 0, 0, 0.1)"},"&.Mui-focusVisible":{boxShadow:"inset 0 0 0 2px ".concat("#177FE6")}},outlined:{border:"1px solid rgba(0, 0, 0, 0.15)"},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"}},variants:[]},MuiList:{styleOverrides:{padding:{paddingTop:"0px",paddingBottom:"0px"}}},MuiListItemButton:{styleOverrides:{root:{fontSize:14,height:"32px"}}},MuiListItemIcon:{styleOverrides:{root:{color:"#404040",minWidth:"16px",marginRight:"16px"}}},MuiListItemText:{styleOverrides:{root:{fontSize:"12px"},primary:{fontSize:14,color:"#404040",lineHeight:"16px",fontWeight:600},secondary:{fontSize:12,color:"#737373",fontWeight:400,lineHeight:"16px"}}}}});function HV(e){var t={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}},n=e||{},r=n.x,i=n.y,o=n.width,a=n.height,s=n.scaleRatio,l=n.margin;return t.x=Number.isNaN(r)||void 0===r?t.x:r,t.y=Number.isNaN(i)||void 0===i?t.y:i,t.width=Number.isNaN(o)||void 0===o?t.width:o,t.height=Number.isNaN(a)||void 0===a?t.height:a,void 0!==s&&(t.scaleRatio.x=Number.isNaN(s.x)?t.scaleRatio.x:s.x,t.scaleRatio.y=Number.isNaN(s.y)?t.scaleRatio.y:s.y),void 0!==l&&(t.margin.left=Number.isNaN(l.left)?0:l.left,t.margin.top=Number.isNaN(l.top)?0:l.top),t}function VV(){var e={rendererBox:HV(),container:void 0,root:void 0},t=function(){var t,n;null===(t=e.root)||void 0===t||t.unmount(),null===(n=e.container)||void 0===n||null===(n=n.parentElement)||void 0===n||n.removeChild(e.container),e.container=void 0};return{size:function(t){return t&&(e.rendererBox=HV(t)),e.rendererBox},element:function(){return e.container},appendTo:function(t){return e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style["-webkit-font-smoothing"]="antialiased",e.container.style["-moz-osx-font-smoothing"]="antialiased",e.container.style.pointerEvents="none",e.root=jV.createRoot(e.container)),t.appendChild(e.container),e.container},setKey:function(t){e.container&&e.container.setAttribute("data-key",t)},render:function(t){if(!e.container)return!1;var n=e.rendererBox,r=n.scaleRatio.x,i=n.scaleRatio.y;return e.container.style.left="".concat(Math.round(n.margin.left+n.x*r),"px"),e.container.style.top="".concat(Math.round(n.margin.top+n.y*i),"px"),e.container.style.width="".concat(Math.round(n.width),"px"),e.container.style.height="".concat(Math.round(n.height),"px"),e.container.style.transform="scale(".concat(r,", ").concat(i,")"),e.container.style.transformOrigin="top left",e.root.render(function(e){var t=e.nodes;return NH.jsx(C_.StrictMode,{children:NH.jsx(zF,{theme:BV,children:t})})}({nodes:t})),!0},findShapes:function(){return[]},itemsAt:function(){return[]},clear:function(){t()},destroy:function(){t()}}}const $V={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",l="y",c=r,u=i,d=t<.5?90:-90;return o&&(s="y",l="x",c=i,u=r,d=t<.5?180:0),a(kg({},e,{[s]:n*c,[l]:u-Math.max(e.size/2,Math.min(t*u,u-e.size/2)),startAngle:d}))}};function WV({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,l=null,c=null;void 0!==r.major.settings.binStart?(l=r.major.items[e].binStart,c=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,l=s?r.major.items[e].major:0);let u=0;s?s.bandwidth?(u=s.bandwidth(),l-=u/2):u=c-l:u=1;const d=kg({},{major:l,majorEnd:c},r.minor.items[e]);i.forEach(t=>{d[t]=r[t].items[e]});const f=o?n:t,h=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:u,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:f}),p=(u-h)/2,m=p+d.major+h/2;return{item:d,boxCenter:m,boxWidth:h,boxPadding:p,rendWidth:t,rendHeight:n}}function UV({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const l=kg(!0,{},n||{},r||{}),c={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},u=i.major;let d;d="object"==typeof u&&"object"==typeof u.ref&&void 0!==u.ref.start&&void 0!==u.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:c,settings:kg(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof u&&void 0!==u.binStart&&void 0!==u.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:c,settings:kg(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:c,defaults:{major:.5},settings:{major:i.major}});const f=i.minor||{};let h;const p={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:c,settings:kg(!0,{},{start:{scale:f.scale,ref:"start"},end:{scale:f.scale,ref:"end"},min:{scale:f.scale,ref:"min"},max:{scale:f.scale,ref:"max"},med:{scale:f.scale,ref:"med"}},f)})};for(let n=0,r=e.length;n<r;n++)h=e[n],p[h]=s.resolve({data:t,defaults:l[h],settings:i[h],scaled:c});return p}const YV=["oob"];const KV={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=UV({keys:YV,data:i,defaultSettings:{oob:$V.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:c,items:u}=l,d=function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=WV}){const l=[],{items:c}=r.major;for(let u=0,d=c.length;u<d;u++){const{item:d,boxCenter:f,rendWidth:h,rendHeight:p}=s({i:u,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),m=c[u].data,g=[];if(d.oob.show){g.push($V.createOob({oob:d.oob,dockValue:a,boxCenter:f,rendWidth:h,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:m,collider:{type:"bounds"},children:g};l.push(e)}}return l}({width:e,height:t,flipXY:r,resolved:l,keys:YV,symbol:s,dockValue:n});return d}},GV={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},XV=["hat"];function JV(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function ZV({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",l=r,c=i,u=e.hat.alignment||0;o&&(a="y",s="x",l=i,c=r,u=1-u);const d=(n+e.major)*l;let f=[{[a]:d,[s]:0+c},{[a]:d+t*u*l,[s]:8},{[a]:d+t*l,[s]:0+c},{[a]:d+t*l,[s]:0+c+10},{[a]:d,[s]:0+c+10}];const h=kg({},e.hat,{type:"path",d:JV(f)});f=[{[a]:d,[s]:0},{[a]:d+t*(1-u)*l,[s]:0+c-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[h,kg({},e.hat,{type:"path",d:JV(f)})]}const QV={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=UV({keys:XV,data:r,defaultSettings:GV,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a,c=function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=WV}){const a=[],{items:s}=r.major;for(let l=0,c=s.length;l<c;l++){const{item:c,boxWidth:u,boxPadding:d,rendWidth:f,rendHeight:h}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,m=[];c.hat.show&&m.push(...ZV({item:c,boxWidth:u,boxPadding:d,rendWidth:f,rendHeight:h,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:m};a.push(g)}return a}({width:e,height:t,flipXY:n,resolved:a,keys:XV});return c}};var e$={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};function t$(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map(t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}}),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:t$(i,t,n)},i}function n$(e){const t=e.scale("band");e.scale("group-by-measure",function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)}),s.splice(-1),i.domain(s),t$(i,a,l,e.invert)})}function r$(){const e=Sp();return e.use(dg),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",pg(e))};e.interaction("hammer",pg(Hammer))}(wg)),e.use(n$),e.renderer("react-qcm",VV),e.component("box-sliced-hat",QV),e.component("box-out-of-bounds",KV),e.component("disclaimer",zV),e.component("scrollbar",b_),e.component("scroll-hint",HO),e.component("reference-line-labels",UN),e.component("axis-overlay",dT.picassoComponents.axisOverlay),e.component("time-axis",dT.picassoComponents.timeAxis),e.component("space",e$),e.component("axis-title",PV),e.component("point-label",Sv),e.scale("q-time-axis",dT.picassoScales.time),e}const i$={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function o$(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const a$={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,c=o[t]*(n>l?1:n/l),u=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(c,n),width:Math.min(u,l)},r()):(e={height:c,width:u},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function s$(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await a$.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function l$(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",c=s.type||"media";let u=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){u=e;break}const d=r.data?.customTooltipAttrExps?.value||[];let f;if(-1!==u&&d[u]&&(f=d[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return s$(s,l,i);if("url"===c)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&o$(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await a$.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch{}else{const{height:e,width:t,imageError:n}=await a$.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,f);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&f&&f.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(o$(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await a$.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch{}return i}(i,n[u],l,f)}return[]}const c$={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(l$(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},u$={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await c$.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>c$.checkIfPromisesExist({customTooltipModel:e})};const d$=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:i$.CHART.CHART_PARENT_TYPE,qId:i$.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},f$=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:i$.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const h$={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=i$.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:i$.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await h$.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=i$.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=i$.CHART.STATE,o=d$(t,i),a=await e.createSessionObject(o),s=f$(t);if(a.id!==i$.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(i$.CHART.CONTAINER_ID),c={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:c,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch{await h$.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(h$.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(i$.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=i$.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function p$(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function m$(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=i$.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function g$(e){const t=m$();return e.filter(e=>t[e.id])}const y$={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=y$.getAttrExprData(a);o.length||n.length?u$.handlePromises({customTooltipModel:i,nodes:y$.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&h$.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>u$.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[i$.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[i$.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[i$.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(g$(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[i$.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[i$.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=p$(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===g$(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=p$(e)||[];[...i,t].forEach(e=>{const t=g$(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=m$(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:FT.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=FT.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function v$({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:y$,miniChartToken:{},embed:s}}function b$(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case i$.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case i$.CUSTOM.TITLE:case i$.CUSTOM.DESCRIPTION:case i$.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const x$={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>b$(t,e,r,n)}}};const S$={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[i$.CUSTOM.TITLE]:!0,[i$.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=y$.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===i$.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===i$.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>jT.getMeasure(e,t)),e,r)}};function w$({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(S$.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function M$(e){const t=i$.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function k$(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const C$={migrateProperties(e){const t=kg(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=k$(t);return r=function(e,t){return t.concat(e.map(e=>M$(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=M$(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(k$(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var q$={attrExpr:C$};const{CUSTOM:E$}=i$;function D$({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:c}){const u={properties:void 0},d=v$({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),f="rtl"===c.direction,h=()=>{const e=!!u.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{u.properties=e},isEnabled:()=>h(),hideBasic:()=>h()&&Jx(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=w$({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===E$.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===E$.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>y$.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>y$.getImageRow(e,{h:t,rtl:f}),addImages:({nodes:r})=>{const i=y$.getDataNodes(o,r),{attrExps:a}=y$.getAttrExprData(t);return u$.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(h()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>h$.createContainer({layout:t,ctx:{h:e,rtl:f}}),createLimitationRow:()=>y$.getFooterRow(a.get("properties.tooltip.notselectedmessage"),f),show:({nodes:e,properties:t})=>h$.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:f}),hasAlternateState:()=>!!d.miniChartToken?.alternateState,hide:()=>h$.hide({app:n,customTooltipModel:d}),destroy:()=>h$.destroyVisualization({customTooltipModel:d})}}}var T$=7005;const O$=e=>e.qError?.qErrorCode!==T$,N$=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&ST.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},A$=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ST.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&ST.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},_$=e=>{if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))},I$=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,r=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===r.length){const r=n[0];return r.qLibraryId?t.getDimension(r.qLibraryId).then(e=>e.getLayout()).then(t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;A$(e,n)}return r}):t.getField(r.qDef.qFieldDefs[0]).then(t=>t.getCardinal().then(t=>(A$(e,t),r)),()=>r)}return N$(e),Promise.resolve()};function L$(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:r}}=e;t.length>1&&e.color?Qx(e,"color.persistent",!0):"byDimension"===r&&n.length>1?Qx(e,"color.mode","byMultiple"):"byExpression"===r&&0===n.length?Qx(e,"color.mode","primary"):0===t.length&&n.length>0&&(Qx(e,"color.byMeasureDef",void 0),Qx(e,"color.byDimDef",void 0),1===n.length&&"byExpression"!==r&&Qx(e,"color.mode","primary"))}const P$=(e,t)=>{L$(t),FO(e),y$.addCallbackCustomTooltip(t)},R$=e=>{L$(e)};function z$({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,r,i){let o;const a=i?.layout?i.layout.qHyperCube.qDimensionInfo.filter(e=>O$(e)).length:t.qHyperCubeDef.qDimensions.length;return r.isAutoChart&&n>a-1?o="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?o="Visualizations.Descriptions.Stack":(o="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):o="Visualizations.Descriptions.Bars",e.get(o)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),n?.app?I$(t,n.app).then(()=>(P$(e,t),e)):(_$(t),P$(e,t),e)),move(e,t,n){const r=n.layout.qHyperCube.qDimensionInfo.filter(e=>O$(e)).length;r>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),N$(t),L$(t),y$.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;L$(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),y$.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){y$.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>n?.app?I$(t,n.app).then(()=>(e.qSortBy.qSortByNumeric=-1,R$(t),e)):(_$(t),R$(t),e),move(e,t){N$(t),L$(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;L$(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function F$(e){return{properties:{version:"2.7.0",barGrouping:{grouping:"grouped"},color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}},data:{targets:[{path:"/qHyperCubeDef",...z$(e)}]}}}var j$={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_Group:{id:"Visualizations.Descriptions.Group",locale:{"de-DE":"Gruppe","en-US":"Group","es-ES":"Grupo","fr-FR":"Groupe","it-IT":"Gruppo","ja-JP":"グループ","ko-KR":"그룹","nl-NL":"Groep","pl-PL":"Grupa","pt-BR":"Grupo","ru-RU":"Группа","sv-SE":"Grupp","tr-TR":"Grup","zh-CN":"组","zh-TW":"群組"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};function B$({env:t}){const{flags:n}=t,r=t.anything?.sense?.isUnsupportedFeature,i=e.useTranslator();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(j$).forEach(t=>{e.add(j$[t])})}}(t.translator);const o=e.useEmbed(),a=e.useTheme(),[s,l]=e.useState(),c=e.useDeviceType(),u=e.useAppLayout(),{qLocaleInfo:d}=u;return e.useEffect(()=>{l({translator:i,theme:a,embed:o,deviceType:c,localeInfo:d,isUnsupportedFeature:r,flags:n})},[d,r,i.language(),a.name(),c]),s}function H$(){const[t]=e.useState(()=>eS()),[n]=e.useState(()=>function(e){var t=py({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({viewRange:[0,1],scrollOffset:void 0}));return{viewCache:t,viewState:n}}const V$="REJECTED",$$=()=>{},W$=2,U$=20,Y$=200,K$=10;var G$={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),c=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),u={qArea:{qHeight:s-a,qWidth:c-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)u.qMatrix.push(e.qMatrix[t].slice(l,c));return u},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-K$<=t.qTop,i=n.qLeft+n.qWidth+K$>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+K$>=t.qTop+t.qHeight,a=n.qLeft-K$<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var X$={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-K$<=t.qTop,i=n.qTop+n.qHeight+K$>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var J$={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const Z$="pages";const Q$="discretePan";function eW({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:Q$,pointers:1,threshold:10,enable(r,i){return this.started===Q$||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some(e=>e.key===n)}},events:{[`${Q$}start`](e){e.preventDefault(),this.started=Q$;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},[`${Q$}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${Q$}end`](e){e.preventDefault(),this.started=!1},[`${Q$}cancel`](e){e.preventDefault(),this.started=!1}}}}function tW({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter(e=>e.key===t);if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=100*Math.sign(-a);r.scroll(s)}}function nW({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(Y$,n));return{width:e,height:Math.max(U$,Math.min(n*W$,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function rW(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then(e=>{if(t.canceled||n)return t.reject(V$),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null})},i=e=>new Promise((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(V$),n=e})(a):r(a)});return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(V$),n=null)},i}const iW={command:{update:()=>{}}};function oW({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=iW,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:c}=t,u=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:c}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&c&&c();const u=r(l);return o(i(u)).then(n=>(s(n),e.add(n),t(n,l)))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:nW({layoutService:r}),request:c({definitionPath:o}),process:rW(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=rS((e,{onProcessing:t,onData:n})=>{u(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==V$)throw e})},50);return function(e,{onProcessing:t=$$,onDataPage:n=$$}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var aW={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var sW={inTotal:function({layoutService:e,getReducedCube:t}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const n=t();if(n){const[t]=Jx({qHyperCube:n},e.refs.dataPages);if(t)return t.qArea.qHeight}const[r]=e.getDataPages();if(r)return r.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function lW(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function cW(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function uW(e){return cW(e.qMatrix,e=>e[0].qElemNumber)-1}var dW={inTotal:function({layoutService:e}){const t=lW(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=lW(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=lW(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=uW(o),c=o.qArea.qHeight*i+l,u=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[u,n.inView>=n.inTotal?u+1:u+c/n.inView]}};const fW=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function hW(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return fW(e,n);const r=((e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n})(t.qMatrix,n);return r.successful?r.count:fW(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return fW(e,n);return cW(t.qMatrix.slice(0,r.qTop+1),e=>e[0].qElemNumber)-1}}}var pW={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=hW(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:c}=n,u=hW(t).area(e(),l,a.qArea),d=uW(a),f=a.qArea.qHeight+d,h=c===o?(r.inView-f)*s/i:(c+(a.qArea.qTop+u)*s)/i;return[h,r.inView>=r.inTotal?h+1:h+f/r.inView]}};function mW({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:c,maxDataRows:u}){const{DEFAULT:d,SQUEEZE:f,LABELLESS:h}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:m="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height;if(!v||!Number.isFinite(v))return 0;const b=v/l>=f;switch(m){case"max":return Math.min(l,u);case"custom":return Math.min(g,u);default:return c?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:c,fontSize:u,tiltAngle:d}=s.settings.settings.labels,{height:f}=l({fontFamily:c,fontSize:u,text:"M"});if(!t)return f>o;const h=(90-d)*(Math.PI/180);return f>Math.cos(h)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:f,label:y})?v/d:l:v/d}}function gW({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:c,getReducedCube:u}){const{inTotal:d,area:f,scaleRange:h}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?aW:n?r?dW:pW:sW}({layoutService:r}),p=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,m=e=>e?p()/e:0,g=(e,t)=>-(e-t)*m(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=d({layoutService:r,getReducedCube:u});return{inTotal:l,inView:mW({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(1e4/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return m(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,g(n,r))),o=r?Math.abs(r*i/p()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return g(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:p(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>f({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=h({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:p(),upperBound:g(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&c?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=g(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*m(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(m(r)*n)}}}}function yW({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:c,renderer:u,areaBuffer:d,viewState:f,rtl:h,getReducedCube:p}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const m=gW({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:c,renderer:u,areaBuffer:d,rtl:h,getReducedCube:p}),g=()=>{const e=m.getItems();return n.set("items",e),e},y=({pixelOffset:e,items:t})=>{const r=m.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},v=e=>{const t=Date.now(),r=g(),a=y({pixelOffset:e,items:r}),s=m.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])})(s))return void((m.validate.offset({pixelOffset:e,items:r})||f.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item})));f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=g();n.set("itemSize",m.getItemSize({items:a}));const c=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=f.get("scrollOffset");if(void 0===n)return 1===t?m.getUpperBound({items:e}):0;if("number"==typeof n)return m.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return m.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),u=y({pixelOffset:c,items:a});f.preventSet("viewRange",m.getViewRange({pixelOffset:u.start.pixel,items:a}));const d=m.getArea({itemOffset:u.start.item,items:a});return new Promise(e=>{i(d,{onDataPage:()=>{n.set("scaleRange",m.getScaleRange({offsets:u.start,items:a})),f.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;v(t)},scrollToRelative(e){const t=n.get("items"),r=m.convert.relativeToPixelOffset({relativeOffset:e,items:t});v(r)}}}function vW({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:c,options:{definitionPath:u="/qHyperCubeDef",getRect:d,axisKey:f,renderer:h,areaBuffer:p,processDataPage:m=()=>{},getReducedCube:g=()=>{}}={}}){const y=eS(),v=function({qMode:e}){switch(e){case"K":return X$;case"T":return J$;default:return G$}}({qMode:i.getHyperCubeValue("qMode")}),b=function({state:e,contains:t}){return e.set(Z$,[]),{add:t=>{const n=e.get(Z$);n.length=0,n.push(t)},getCurrent:()=>e.get(Z$)[0],getAll:()=>e.get(Z$),contains:n=>t(e.get(Z$)[0],n)}}({state:y,contains:v.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:b,composition:v});const x=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),S=oW({dataStore:b,composition:v,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:u,processDataPage:m}),w=yW({chart:e,componentKey:n,state:y,dataStore:b,pageData:S,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:f,renderer:h,areaBuffer:x,viewState:l,rtl:c,getReducedCube:g}),M=function({layoutService:e,dataStore:t}){return function(n){const r=Jx(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:b}),k=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[eW({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:tW({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:c,scroller:w});return{interactions:k,query:{getCanScroll:()=>w.enabled(),getItemSize:()=>w.itemSize(),getScaleRange:()=>w.scaleRange(),getCurrentDataPage:()=>b.getCurrent()},command:{initialize:()=>w.initialize(),scrollTo:e=>w.scrollToRelative(e),setSnapshotData:e=>M(e)}}}var bW="AVERAGE",xW="LINEAR",SW="POLYNOMIAL2",wW="POLYNOMIAL3",MW="POLYNOMIAL4",kW="EXPONENTIAL",CW="LOG",qW="POWER";function EW({dimValue:e,value:t,qTrendLine:n}){const{qType:r,qCoeff:i}=n,o={x:e,y:i[2]*t**2+i[1]*t+i[0]};switch(r){case wW:return o.y+=i[3]*t**3,o;case MW:return o.y+=i[4]*t**4+i[3]*t**3,o;default:return o}}var DW={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:EW,polynomial3:EW,polynomial4:EW,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function TW(e,t){const n=DW[t.qType.toLowerCase()],r=Math.max(1,e/500);let i=1/0,o=-1/0;for(let a=0;a<e;a+=r){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});i=Math.min(e,i),o=Math.max(e,o)}return{min:i,max:o}}function OW(e){return DW[e.qType.toLowerCase()]}function NW(e,t){return e.meta.isContinuous?function(e,t){return{generate:(n,r,i)=>{const o=[],a=OW(n),s=t.get("zoom"),l=n.start??s.min,c=n.end??s.max,u=(c-l)/100,d=e.meta.isButterfly&&i>0;if(u>0){const e=e=>{const t=a({dimValue:e,value:e,qTrendLine:n});d&&(t.y=-t.y),t.layerId=r,t.measureIndex=i,t.dimValue=e,o.push(t)};let t=l;for(let n=l;n<=c;n+=u)e(n),t=n;t!==c&&e(c)}return o},calculate:(e,t)=>OW(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map(({y:e})=>e);return{min:Math.min(...n),max:Math.max(...n)}}}}(e,t):e.meta.mode.K?function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qData[0].qSubNodes,s=o.qArea.qTop,l=DW[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const o=a[e],c=l({dimValue:o.qElemNo,value:e+s+1,qTrendLine:t});c.layerId=n,c.measureIndex=r,c.dimValue=o.qText,i.push(c)}return i},findMinMax:TW}}(e):function(e){return{generate:(t,n,r)=>{const i=[],o=e.getDataPages()[0],a=o.qMatrix,s=o.qArea.qTop,l=DW[t.qType.toLowerCase()],c=e.meta.isButterfly&&r>0;for(let e=0;e<a.length;e++){const o=a[e][0],u=e+s+1,d=l({dimValue:o.qElemNumber,value:u,qTrendLine:t});c&&(d.y=-d.y),d.layerId=n,d.measureIndex=r,d.dimValue=o.qText,i.push(d)}return i},calculate:(e,t,n)=>(0,DW[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:TW}}(e)}var AW={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},_W={color:"#f93f17",index:9};const{isDark:IW}=zO,LW={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},PW=({layoutService:e,viewState:t,colorModel:n,chart:r,env:i,keys:{colorScale:o},isEnabled:a=()=>!1})=>{const{translator:s}=i,l=[LW],c=[],u=[],d=NW(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach((e,t)=>{Array.isArray(e.qTrendLines)&&(c.push(...e.qTrendLines),u.push(...e.qTrendLines.map(()=>t)))});const f=tS(e=>{const{style:t}=c[e]||{},i=n.settings();if(t.autoColor){if("measure"===i.mode){const t=u[e],n=r.scale(o)(t);return IW(n)?function(e){const t=LO(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=LO(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(_W)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"});return{query:{hasTrendLines:()=>!!c.length&&a(),getData:()=>l,getStroke:f,getLineDash:e=>{const{style:t}=c[e]||{};return t?.lineDash},getLineThickness:e=>{const{style:t}=c[e]||{};return t?.lineThickness??2},getLabel:e=>(c[e]||{}).label,getType:e=>{const{qType:t}=c[e]||{};return s.get(AW.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return c.forEach(r=>{const i=d.findMinMax(e.meta.size.y,r);t=Math.min(i.min,t),n=Math.max(i.max,n)}),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const r=c[e];return d.calculate(r,t,n)}},command:{update:()=>{l.length=0,c.forEach((e,t)=>{const n=d.generate(e,t,u[t]);l.push(...n)})}}}};var RW={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const zW=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,FW=(e,{layoutService:t,trendLineModel:n,dockService:r,animationsEnabled:i})=>{if(!n.query.hasTrendLines())return[];const o=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:r,dockService:i,animationsEnabled:o})=>{const a=zW(r);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:RW,settings:{connect:!0,orientation:i.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:({datum:e})=>n.query.getLineThickness(e.layer.value),stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:o,trackBy:GN.nonUpdatingNode.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:r,animationsEnabled:i}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:r,dockService:i})=>{const o=zW(r),a="horizontal"===i.meta.major.orientation,s={scale:e,fn:o},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:RW,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:r});return[o,a]};function jW(e,t){const{getLabel:n,getType:r,getLineDash:i,getStroke:o}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:o(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":i(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:r(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function BW(e,{h:t,style:n}){return e.map(e=>{const r={style:{direction:"string"==typeof e.content?FT.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(r.colspan=e.colspan);const i=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map(t=>e("span",{style:t.style,direction:FT.detectTextDirection(t.content)},t.content))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",r,i)})}function HW(e,t){return({h:n,data:r,style:i})=>{const o=r[0].title,a=r.filter(e=>e.title===o),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:FT.detectTextDirection(t)},t);return e("tr",{},n)}(n,o),l=[s];if(a.slice(0,2).forEach(e=>{l.push(n("tr",{},BW(e.row,{h:n,style:i})))}),r.length>2){const i=r.length-2;l.push(...function(e,t,n,r){const i=t?t.get("Object.ChartTooltip.NMore",r):`+${r} more`,o=FT.detectTextDirection(i);return[e("tr",{},e("td",{style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:o},colspan:3},i))]}(n,e,t,i))}return l}}function VW(e,{trendLineModel:t,translator:n},r={}){if(!t.query.hasTrendLines())return!1;const{rtl:i}=r,o=LT({key:e.tooltip,rtl:i});return kg(!0,o,{settings:{extract:jW(e,t),content:HW(n,i),placement:"pointer",direction:r.rtl?"rtl":"ltr"}})}function $W(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function WW(e,{chart:t,viewState:n,trendLineModel:r,layoutService:i,rtl:o}){const{isContinuous:a}=i.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=$W(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:i}=r.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(r,a)=>{const l=$W(r,t),c=t.shapesAt(function(e){return{cx:e.x,cy:e.y,r:3}}(l),s);if(c.length){const r=function(e,t,n,r){let i=(e.x-t.rect.computed.x)/t.rect.computed.width;i=r?1-i:i;const{min:o,max:a}=n.get("zoom");return o+(a-o)*i}(l,a,n,o),s=t.scale(e.majorInnerScale),u=(s?.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(r);c.forEach(e=>{e.data.dimValue.value=r,e.data.dimValue.label=u,e.data.minor.value=i(e.data.layer.value,r).y})}return c}}return n=>{const r=t.component(e.tooltip);if(r&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some(t=>t.key===e.tooltipOverlay))(n)){const e=l(n,r);return e.length?(r.emit("show",n,{nodes:e}),!0):(r.emit("hide"),!1)}return!1}}const UW=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},YW=e=>{UW(e),e.qMultiDimMode="Sum",e.qXColIx=0};function KW(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:r=!1}=e;return{show:(e,t,{layout:n})=>!CT.dimensionless(n)&&!CT.groupedByDimension(n)&&(r||!CT.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:AW.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(AW.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:AW.ADD_BUTTON,add:YW,globalChange:e=>{const t=Jx(e,"qHyperCubeDef.qMeasures",[]).reduce((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e),[]),r=(e=>!Jx(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach(e=>{e.qContinuousXAxis=r}),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:AW.TYPE,options:[{value:bW,translation:AW.TYPES.AVERAGE},{value:xW,translation:AW.TYPES.LINEAR},{value:SW,translation:AW.TYPES.POLYNOMIAL2},{value:wW,translation:AW.TYPES.POLYNOMIAL3},{value:MW,translation:AW.TYPES.POLYNOMIAL4},{value:kW,translation:AW.TYPES.EXPONENTIAL},{value:CW,translation:AW.TYPES.LOG},{value:qW,translation:AW.TYPES.POWER}],defaultValue:bW},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:_W,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:AW.STYLE.DASHED,type:"boolean",defaultValue:!0,change:UW}}}}var GW,XW;var JW=function(){if(XW)return GW;XW=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},GW=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,r,i,o,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(r=this._events[t],e.isUndefined(r))return!1;if(e.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];r.apply(this,o)}else if(e.isObject(r)){for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(i=(s=r.slice()).length,a=0;a<i;a++)s[a].apply(this,o)}return!0},t.prototype.addListener=function(n,r){var i;if(!e.isFunction(r))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(r.listener)?r.listener:r),this._events[n]?e.isObject(this._events[n])?this._events[n].push(r):this._events[n]=[this._events[n],r]:this._events[n]=r,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var r,i,o,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,i=-1,r===n||e.isFunction(r.listener)&&r.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(r)){for(a=o;a-- >0;)if(r[a]===n||r[a].listener&&r[a].listener===n){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,r;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(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],e.isFunction(r))this.removeListener(t,r);else if(Array.isArray(r))for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},GW}(),ZW=mg(JW);const QW={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};function eU(){const[t]=e.useState({}),[n]=e.useState({}),r=function(){const t=e.useLayout(),n=e.useTranslator(),r=!!t?.qSelectionInfo?.qInSelections,i=!!t?.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,[o,a]=e.useState(!1),[s,l]=e.useState(!1),[c,u]=e.useState({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),d=e=>{l("boolean"==typeof e?e:!s)};return e.useAction(()=>(u({key:"lasso",action:d,enabled:()=>o,active:()=>s}),{key:"lasso",label:n.get(s?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:QW,hidden:!o||!r||i,active:s,action:d}),[r,i,s,o,n.language()]),{get:()=>c,setAllows:e=>{a(!!e)}}}(),[i,o]=e.useState();return e.useEffect(()=>{const e={};e.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:e,discrete:r}=t;return n.allowScroll&&(e?.meta.isContinuous||r?.query.getCanScroll())}},e.interact={key:"interact",isEnabled:!0,enabled:()=>n.allowInteract},e.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>n.allowTooltip},e.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>n.allowSelect},e.lasso=r.get(),Object.keys(e).forEach(t=>{return n=e[t],Object.keys(ZW.prototype).forEach(e=>{n[e]=ZW.prototype[e]}),ZW.init(n),n;var n}),o(e)},[]),e.useEffect(()=>{i&&r&&(i.lasso={...i.lasso,...r.get()})},[r]),{get:()=>i,setAllows:e=>{Object.assign(n,e),r.setAllows(e?.allowSelect)},setContext:e=>{Object.assign(t,e)},destroy:()=>{Object.keys(i).forEach(e=>i[e].removeAllListeners())}}}var tU={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},nU={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",MINI_BAR:"mini-marker",GHOST_BAR_OOB:"ghost-bar",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip-qcm",SPACE:"space",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"}};const rU=({layout:e})=>{const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==T$),n=e?.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==T$);return 1===(t?.length??0)&&2===(n?.length??0)};function iU(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(ET).then(e=>{const n=t.getHyperCubeValue("qMode"),r=t.getHyperCubeValue("qDimensionInfo"),i="K"===n&&r.length>1&&e[0]?.qIsReduced,o=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=i?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:o,qDimensionInfo:r.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:i?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),r=t.meta.isStacked&&e.length>1?1:0,i=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:r,qWidth:e.length+i.length+r,qHeight:Math.min(2e3,1e4/(i.length+1))},zoomLevel:-1,filter:"D1"}}}}function oU({enigma:e,layoutService:t,viewModel:n,definitionPath:r,reducedHyperCubePath:i},o={}){const a=iU(e,t,r),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,i),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),c=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,r=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return r.should=e=>t&&n&&1===e.qDimensionInfo.length,r}({layoutService:t}),u={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>u,update(e){var r;c.should(e)&&c(e),u.mode=kg(u.mode,t.meta),u.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,u.mode.isStackedByDimension=u.mode.isStacked&&(2===(r=e).qDimensionInfo.length&&2===r.qMeasureInfo.length),u.mode.isStackedByMeasure=u.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),u.fields={major:u.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:u.mode.isStackedByDimension?e.qMeasureInfo.map((e,t)=>`qMeasureInfo/${t}`):n.fields.minor},u.scales={major:nU.SCALE.REDUCED.MAJOR,minor:nU.SCALE.REDUCED.MINOR},u.cube=e,o.qDataPages=e.qDataPages},fetchMinMaxData(){if(o.qDataPages)return Promise.resolve(o.qDataPages);let n=a.settings();const r="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=kg(!0,{},n,{rect:{qHeight:r}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then(e=>e)},setSnapshotData(e){e.reducedHyperCube=u.cube}}}function aU({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:r,selectionInfo:i}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==i.event&&r({componentName:"continuousRangeBrush",brushName:!1})}function sU({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function lU({layoutService:e,node:t}){const{isGroupedByDimension:n,isStackedByDimension:r,isDimensionless:i}=e.meta;return n?`${t.data.label}, ${t.data.group.label}`:r?`${t.data.label}, ${t.data.stack.label}`:i?void 0:t.data.label}function cU({chart:e,actions:t,translator:n,rtl:r,viewState:i,viewModel:o,layoutService:a,dockService:s,colorService:l,themeService:c,trendLineModel:u,custom:d}){const{isTwoDimensional:f,isStacked:h,isGroupedByDimension:p,isGroupedByMeasure:m,isStackedByDimension:g,isStackedByMeasure:y}=a.meta,{fontFamily:v}=c.getStyles(),b=function({layoutService:e,dockService:t}){const{BAR_AXIS:n,BAR_OOB_MIN:r,BAR_OOB_MAX:i,GROUP_AXIS:o}=nU.COMPONENT,{isGrouped:a,isGroupedByDimension:s}=e.meta,{orientation:l}=t.meta.chart,c="vertical"===l;return[({chart:e,hovered:t,meta:l,collected:u,collectedBounds:d})=>{const[f]=t,{triggerer:h}=l;if(h===r||h===i)return{key:f.key,bounds:f.bounds};if(c&&(h===n||h===o)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===r||e.key===i)&&e.data.value===f.data.value&&e.data.group.value===f.data.group.value:(e.key===r||e.key===i)&&e.data.value===f.data.value),o=e.findShapes("path").find(e=>s&&h===n?e.key===i&&e.data.value===f.data.value&&e.data.group.value===f.data.group.value:e.key===i&&e.data.value===f.data.value);if(t)return a?{key:o?o.key:nU.COMPONENT.BAR,bounds:d}:{key:t.key,bounds:t.bounds}}if(!c){const t=!u.some(e=>e.bounds.height+e.bounds.width!==0);if(t){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===r||e.key===i)&&e.data.value===f.data.value&&e.data.group.value===f.data.group.value:(e.key===r||e.key===i)&&e.data.value===f.data.value);if(t)return{key:t.key,bounds:t.bounds}}}return!1},"collectible"]}({layoutService:a,dockService:s}),x=WW({majorInnerScale:nU.SCALE.MAIN.MAJOR_INNER,tooltip:nU.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:nU.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:e,viewState:i,trendLineModel:u,layoutService:a,rtl:r}),S=({collected:t,triggerer:n})=>{if(h){t.splice(0,t.length);const r=e.findShapes("container").filter(e=>e.key===nU.COMPONENT.BAR&&e.data?.stack.value===n.data.value).filter(e=>y?e.data?.value===n.data.value:e.data?.stack.value===n.data.value);r.forEach(e=>{if(e.children.length){const[n]=e.children;n.key=e.key,t.push(n)}else t.push(e)})}};return ik({chart:e,translator:n,config:{rtl:r,enable:()=>t.tooltip.enabled(),getColorSettings:()=>l.getMain().getSettings(),style:{fontFamily:v},main:{key:nU.COMPONENT.BASE_TOOLTIP,suppress:({event:e})=>x(e),getGroupByValue:({data:e})=>e.value,collectibles:[{key:nU.COMPONENT.BAR,type:"bar",major:({data:e,meta:t})=>m?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:p?t.triggerer===nU.COMPONENT.BAR_AXIS||t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.group.value]:e.group.value:g?e.stack.value:e.value},{key:`${nU.COMPONENT.GHOST_BAR_OOB}-min`,type:"bar",if:()=>!y&&!g,major:({data:e,meta:t})=>m?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:p?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX||t.triggerer===nU.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value},{key:`${nU.COMPONENT.GHOST_BAR_OOB}-max`,type:"bar",if:()=>!y&&!g,major:({data:e,meta:t})=>m?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:p?t.triggerer===nU.COMPONENT.BAR_OOB_MIN||t.triggerer===nU.COMPONENT.BAR_OOB_MAX||t.triggerer===nU.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value}],triggers:[{keys:[nU.COMPONENT.BAR],collect:{from:"single"},placement:b},{keys:[nU.COMPONENT.BAR_AXIS],collect:{from:"dimension",by:({data:e})=>p?[e.value,e.group.value]:e.value,after:S},placement:b},{keys:[nU.COMPONENT.BAR_OOB_MIN,nU.COMPONENT.BAR_OOB_MAX],collect:{from:"dimension",by:({data:e})=>m?[e.value,e.measureIndex.value]:p?[e.value,e.group.value]:e.value,after:S},placement:b},{keys:[nU.COMPONENT.GROUP_AXIS],collect:{from:"dimension",by:({data:e})=>e.group.value},placement:b}],layout:{grouping:f,single:()=>!(!d.isEnabled()||!d.hasImages())||d.chart.isEnabled()},section:({h:t,nodes:n,dataset:r,formatter:i,create:s,util:l})=>{const[c]=n,{title:u,description:f,measures:h}=d.isEnabled()?d.getAttributes({dataset:r,nodes:[c]}):{},p=[];u&&p.push(s.text({value:u,style:{bold:!0},survive:{visibility:!0},visibility:{count:!1}})),f&&p.push(s.text({value:f,survive:{visibility:!0},visibility:{count:!1}}));const m=d.hideBasic();if(m&&!h.length&&(u||f)||p.push(s.text({value:lU({layoutService:a,node:c}),style:{bold:!0}})),!m){const t=void 0!==c.data.fill?.value?e.scale(nU.SCALE.MAIN.COLOR)(c.data.fill.value):void 0;p.push(s.color({nodes:n,property:nU.SCALE.MAIN.COLOR,fillColor:t})),p.push(...n.map(e=>function({viewModel:e,layoutService:t,formatter:n,create:r,util:i,node:o}){const{isStacked:a,isStackedByDimension:s}=t.meta;if(a){const t=n(nU.FORMATTER.MINOR),{segment:a}=o.data,l=s&&t?t(a.value):a.label;return r.measure({label:i.dataset.title(o.data.source.key,e.fields.minor[s?0:o.data.measureIndex.value]),value:!0===o.data.null?.value||"NaN"===l?"-":l})}const{data:l}=o,{end:c}=l,{key:u,field:d}=c.source;return r.measure({label:i.dataset.title(u,d),value:c.label})}({viewModel:o,layoutService:a,formatter:i,create:s,util:l,node:e})))}h&&p.push(...h.map(e=>s.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0,visibility:!0},visibility:{count:!1}}))),d.chart.isEnabled()&&(d.chart.hasLimitation()?(d.chart.destroy(),p.push(s.raw({value:d.chart.createLimitationRow(),survive:{visibility:!0},visibility:{count:!1}}))):p.push(s.raw({value:d.chart.createContainer({h:t}),survive:{visibility:!0},visibility:{count:!1}})));const{customTooltipImages:g}=c.data;return d.isEnabled()&&g&&p.push(...g.map(e=>s.raw({value:d.createImageRow({value:e,h:t}),survive:{visibility:!0},visibility:{count:!1}}))),p.filter(Boolean)},sections:({nodes:t,formatter:r,meta:i,create:o,sections:a})=>{if(!h||i.triggerer!==nU.COMPONENT.BAR_AXIS)return;const[s]=t,[l]=e.findShapes("container").filter(e=>e.key===nU.COMPONENT.STACK_TOTAL_BAR&&e.data&&e.data.value===s.data.stack.value);if(!l)return;const c=r(nU.FORMATTER.MINOR),u=[];if(l.data.sumOfPositives.value>0){const{value:e}=l.data.sumOfPositives;u.push(o.measure({label:n?n.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives",value:c?c(e):e,visibility:{force:!0}}))}if(l.data.sumOfNegatives.value<0){const{value:e}=l.data.sumOfNegatives;u.push(o.measure({label:n?n.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives",value:c?c(e):e,visibility:{force:!0}}))}a.unshift(o.section({content:[o.text({value:l.data.label,style:{bold:!0},visibility:{force:!0}}),...u]}),o.divider({visibility:{force:!0}}))},events:{tooltip:{beforeShow:({collectNodes:e})=>d.isEnabled()&&d.hasImages()?d.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{d.chart.isEnabled()&&!d.chart.hasLimitation()&&d.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{d.chart.isEnabled()&&d.chart.hasAlternateState()&&d.chart.hide()}}}},legend:{keys:{tooltip:nU.COMPONENT.LEGEND_CAT_TOOLTIP,component:nU.COMPONENT.LEGEND_COLOR_CAT}}}})}const uU={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:r}=n[t];return r},getDimensionSize(e){const t=e?.qCardinalities?.qHypercubeCardinal,{qLocked:n=0,qOption:r=0,qSelected:i=0}=e?.qStateCounts||{};return[void 0,0].includes(t)?n+r+i:t}};function dU({layoutService:e}){return function(e){var t,n=e.layout,r=e.config,i=void 0===r?{}:r,o={disclaimer:void 0,isSuppressing:!1,showDisclaimer:null!==(t=i.args)&&void 0!==t&&t.layoutService?i.args.layoutService.getLayoutValue("showDisclaimer"):null==n?void 0:n.showDisclaimer};return{initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).args;o.disclaimer=function(e){var t=e.args,n=e.disclaimers,r=[];return Object.keys(n).forEach(function(e){var i=Fx[e],o=n[e];o&&(o.condition||(null==i?void 0:i.condition)||jx)(t)&&r.push({key:(null==i?void 0:i.translationKey)||(null==i?void 0:i.key)||e,alignment:o.alignment||(null==i?void 0:i.alignment)||zx})}),r.find(function(e){return e.alignment===Rx})||r[0]}({args:py(py({layout:n},i.args),e),disclaimers:i.disclaimers||{}}),o.isSuppressing=!(!o.disclaimer||o.disclaimer.alignment!==Rx)},getDisclaimer:function(){return o.isSuppressing?o.disclaimer:!1===o.showDisclaimer?void 0:o.disclaimer},getHasSuppressingDisclaimer:function(){return o.isSuppressing}}}({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0,LimitedData:{condition:()=>{const{isContinuous:t,isTwoDimensional:n}=e.meta;if(!t||!n)return!1;const r=e.getLayout().qHyperCube.qDimensionInfo[1];return uU.getDimensionSize(r)>vT.maxNumberOfLines}},OnlyNegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.every(e=>{const{qMin:t,qMax:n}=e;return t<0&&n<0})}return!1},alignment:"center"},NegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.some(e=>{const{qMin:t}=e;return t<0})}return!1}}}}})}function fU({picasso:t,chart:n,environment:r,viewState:i,viewCache:o}){const a=e.useStaleLayout(),s=e.useModel(),l=e.useApp(),c=e.usePlugins(),u=e.useSelections(),d=e.useOptions(),[f,h]=e.useState(),[p,m]=e.useState(),[g,y]=e.useState(),v=e.useConstraints(),b=eU();return e.useEffect(()=>{if(!n)return()=>{};const e=b.get(),t=function({chart:e,actions:t,selections:n}){const r=e.scale(nU.SCALE.MAIN.MAJOR),i=mM({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:r,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:aU},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}});return i}({chart:n,actions:e,selections:u});return m(e),y(t),()=>{t.destroy(),b.destroy()}},[n]),e.useEffect(()=>{if(!v)return;const e={allowScroll:!v.active,allowInteract:!v.active,allowTooltip:!v.passive,allowSelect:!v.select&&!v.active};b.setAllows(e)},[v]),e.useEffect(()=>{if(!g||!r)return;const{theme:e,translator:u,localeInfo:f,flags:m,embed:y}=r,{direction:v="ltr"}=d,x="rtl"===v,S=lS({source:a,metaAdditionsFn:({layout:e})=>{const t=vT.canBeContinuous(e),n=CT.continuous({layout:e}),r=CT.dimensionless(e),i=rU({layout:e})&&"butterfly"===e?.barGrouping?.grouping;return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:vT.isTime(n,e),isDimensionless:r,isSimple:CT.simple(e),isGrouped:!i&&CT.grouped(e),isGroupedByMeasure:!i&&CT.groupedByMeasure(e),isGroupedByDimension:!i&&CT.groupedByDimension(e),isStacked:!i&&CT.stacked(e),isStackedByDimension:!i&&CT.stackedByDimension(e),isStackedByMeasure:!i&&CT.stackedByMeasure(e),isSnapshot:CT.snapshot(e),isButterfly:i}},experimental:{filter:!0}});g.setFilteredFields(S.meta.filteredFields);const w=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(S.getLayout())?lS({source:S.getLayout()}):void 0,M=function({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:a,options:d}),k=function({layoutService:e,viewCache:t,options:n}){const r={};return r.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map((e,t)=>`qDimensionInfo/${t}`),minor:e.getHyperCubeValue("qMeasureInfo").map((e,t)=>`qMeasureInfo/${t}`)};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),r.selectionDimensionIdx=(e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const r=e.qDimensionInfo[n];if(!(r.qLocked||r.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}})(e.getHyperCube()),r.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,r.selectionDimensionProp=e=>void 0===r.selectionDimensionIdx||void 0!==e&&r.selectionDimensionIdx!==e?{}:{selectionDimension:{field:r.selectionDimensionIdx}},r.animations={enabled:()=>!(!1===n.chartAnimations||r.animations.isPartialUpdating||r.animations.isSizeChanging||r.animations.hasSlicedHats||GN.propertiesHaveChanged({viewCache:t,layout:e.getLayout()})),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},r}({layoutService:S,viewCache:o,options:d}),C=Xx({chart:n,layoutService:S,config:{logicalSize:M,rtl:x},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),q=dU({layoutService:S}),E=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:wM(a),styles:void 0};return d.styles=CM({theme:t,id:i,transform:l,extend:u,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=CM({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:e,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]],resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),D=dT.model({model:s,layoutService:S,viewCache:o,viewState:i}),T=oU({enigma:s,layoutService:S,viewModel:k});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const r=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",r.scrollOffset),t.preventSet("legendScrollOffset",r.legendScrollOffset||0),r.zoom&&t.preventSet("zoom",r.zoom)}({layoutService:S,viewState:i,viewStateOptions:d?.viewState});const O=function({app:e,model:t,translator:n,picasso:r,localeInfo:i,theme:o,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:c}){const{isContinuous:u,isStacked:d}=s.meta,f={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const h=[],{isReduced:p}=c.model().mode,m=u||p||d,g=!u&&(p||d)&&l?l.getHyperCube():void 0,y=g?"legendCube":void 0;return f.main=Px({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:sU,key:nU.SCALE.MAIN.COLOR},createConfig:()=>({hc:m?g||s.getHyperCube():c.model().cube,source:m?y:"miniCube",theme:o})}),h.push(f.main.initialize()),u&&(f.mini=Px({app:e,model:t,translator:n,picasso:r,layoutService:s,config:{localeInfo:i,auto:sU,key:nU.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:o})}),h.push(f.mini.initialize())),Promise.all(h)},getMain:()=>f.main,getMini:()=>f.mini}}({picasso:t,model:s,app:l,translator:u,localeInfo:f,theme:e,continuousDataModel:D,layoutService:S,legendLayoutService:w,reducedDataModel:T}),N=function(e){var t,n=e.app,r=e.translator,i={initialized:!1,dimensions:[],measures:[]};return{initialize:(t=dy(gy().m(function e(t){var o,a,s,l,c,u,d;return gy().w(function(e){for(;;)switch(e.n){case 0:if(o=t.properties,!i.initialized){e.n=1;break}return e.a(2);case 1:return s=[Xv(a={app:n,translator:r,properties:o}),Qv(a)],e.n=2,Promise.all(s);case 2:l=e.v,c=vy(l,2),u=c[0],d=c[1],i.dimensions=u,i.measures=d,i.initialized=!0;case 3:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),getAlternatives:function(){return{dimensions:by(i.dimensions),measures:by(i.measures)}}}}({app:l,translator:u}),A=function({layoutService:e,themeService:t,colorService:n}){const r=t.getStyles(),i=t=>(e.getLayoutValue("components",[])||[]).find(e=>e.key===t),o=(e,t)=>{const r=n.getMain().getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=i("axis")?.axis?.title;return{fontFamily:e?.fontFamily??r.axis.title.fontFamily,fontSize:e?.fontSize??r.axis.title.fontSize,color:o(e?.color,r.axis.title.color)}}},label:{getStyle:()=>{const e=i("axis")?.axis?.label?.name;return{fill:o(e?.color,r.axis.label.name.color),fontSize:e?.fontSize??r.axis.label.name.fontSize,fontFamily:e?.fontFamily??r.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{const e=i("legend")?.legend?.title;return{fontFamily:e?.fontFamily??r.legend.title.fontFamily,fontSize:e?.fontSize??r.legend.title.fontSize,color:o(e?.color,r.legend.title.color)}}},label:{getStyle:()=>{const e=i("legend")?.legend?.label;return{fontFamily:e?.fontFamily??r.legend.label.fontFamily,fontSize:e?.fontSize??r.legend.label.fontSize,color:o(e?.color,r.legend.label.color)}}}},label:{getStyle:()=>{const e=i("label")?.label?.value;return{fill:o(e?.color,r.label.value.color),useContrastColor:e?.useContrastColor??!0,fontSize:e?.fontSize??r.label.value.fontSize,fontFamily:e?.fontFamily??r.label.value.fontFamily}}}}}({layoutService:S,themeService:E,colorService:O}),_=PW({layoutService:S,viewState:i,colorModel:{settings:()=>O.getMain().getSettings(),resolveUIColor:e=>O.getMain().getPaletteColor(e)},chart:n,env:r,keys:{colorScale:nU.SCALE.MAIN.COLOR},isEnabled:()=>!S.meta.isGroupedByDimension&&!S.meta.isDimensionless});q$.attrExpr.updateProperties(s,a);const I=v$({layout:a,app:l,model:s,picasso:t,chart:n,translator:u,localeInfo:f,embed:y}),L=D$({app:l,chart:n,embed:y,flags:m,layout:S.getLayout(),localeInfo:f,model:s,options:{direction:d.direction},picasso:t,translator:u}),P=cU({chart:n,actions:p,translator:u,rtl:x,viewState:i,viewModel:k,layoutService:S,dockService:C,colorService:O,themeService:E,trendLineModel:_,custom:L});let R;S.meta.isDiscrete&&(R=vW({chart:n,actions:p,componentKey:nU.COMPONENT.BAR,enigmaModel:s,layoutService:S,dockService:C,trendLineModel:_,itemWidths:tU,viewState:i,rtl:x,options:{axisKey:nU.COMPONENT.BAR_AXIS,renderer:t.renderer("svg")()}}));const z=nA({layoutService:S,discreteModel:R}),F=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:nU.SCALE.MAIN.MINOR,MAJOR:nU.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:nU.COMPONENT.BAR,BAR_AXIS:nU.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:nU.COLLECTION.MAIN}}}}(S),j=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return dy(gy().m(function e(){var r,a,s,l;return gy().w(function(e){for(;;)switch(e.n){case 0:if(!o.initialized){e.n=1;break}return e.a(2);case 1:return a=Promise.all(n.filter(function(e){return"custom-component"===e.info.type}).map(function(){var e=dy(gy().m(function e(n){var r;return gy().w(function(e){for(;;)switch(e.n){case 0:if(n.info.componentName){e.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return e.n=2,n.fn(py({},i));case 2:if("object"===xy(r=e.v)){e.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:t.component(n.info.componentName,r);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter(function(e){return"component-definition"===e.info.type}).map(function(e){return e.fn(py({},i))})),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(r=o.definitions).push.apply(r,by(l[1]));case 3:return e.a(2)}},e)}))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach(function(t){var n=vy(e.filter(function(e){return e.key&&e.key===t.key}),1)[0];if(n){var r=nb(!0,{},n.brush);nb(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===xy(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=cS({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=cS({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)}),e):e}}}({picassoInstance:t,plugins:c||[],pluginArgs:F});b.setContext({discrete:R,layoutService:S}),h({alternativeService:N,discrete:R,continuous:dT,legendLayoutService:w,layoutService:S,viewModel:k,dockService:C,themeService:E,styleService:A,continuousDataModel:D,reducedDataModel:T,colorService:O,trendLineModel:_,refLineModel:z,pluginService:j,customTooltipModel:I,tooltipService:P,selectionService:g,logicalSize:M,disclaimerService:q,customTooltipService:L})},[g,d,r,a]),f}function hU(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function pU(e){return e.some(hU)}function mU(e,t){let n=NaN,r=NaN;return e.forEach(e=>{pU(e)||e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),r=Number.isNaN(r)?e.qNum:Math.max(e.qNum,r))})}),{min:n,max:r}}function gU(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const r=e.getLayoutValue("measureAxis.minMax");e.meta.isButterfly||"min"!==r&&"minMax"!==r||(t=+e.getLayoutValue("measureAxis.min")),"max"!==r&&"minMax"!==r||(n=+e.getLayoutValue("measureAxis.max"),e.meta.isButterfly&&(t=-n))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function yU(e,t){let n=NaN,r=NaN;return e.forEach(e=>{if(!pU(e)){let i=0,o=0;e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?o+=e.qNum:i+=e.qNum)}),n=Number.isNaN(n)?i:Math.min(i,n),r=Number.isNaN(r)?o:Math.max(o,r)}}),{min:n,max:r}}function vU(e,t){const n={};e.forEach(e=>{if(!pU(e)){const r=e[0].qElemNumber;n[r]=n[r]?n[r]:{min:0,max:0,cId:r},e.slice(t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[r].max+=e.qNum:n[r].min+=e.qNum)})}});let r=NaN,i=NaN;return Object.keys(n).forEach(e=>{r=Number.isNaN(r)?n[e].min:Math.min(n[e].min,r),i=Number.isNaN(i)?n[e].max:Math.max(n[e].max,i)}),{min:r,max:i}}function bU(e){return"number"==typeof e&&!Number.isNaN(e)}function xU(e){const{meta:t}=e,n=e.getHyperCubeValue("qMeasureInfo");return t.isButterfly?{min:Math.min(0,bU(n[1].qMax)?-n[1].qMax:0),max:Math.max(0,bU(n[0].qMax)?n[0].qMax:0)}:{min:Math.min(...n.filter(e=>bU(e.qMin)).map(e=>e.qMin)),max:Math.max(...n.filter(e=>bU(e.qMax)).map(e=>e.qMax))}}const{isNumber:SU}=oN;function wU(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function MU(e){return!Number.isNaN(+e.qNum)}function kU(e){return e.qNum}function CU(e){return!Number.isNaN(+e.qNum)}function qU(e){return e.qNum}function EU(e,t){return e.push(...t),e}const{getValueWithOffset:DU,isNumber:TU}=oN;function OU(e,t){return Math.abs(e/t)<5||0===t}function NU({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:r=yU,stackedByDimensionExtractor:i=vU,straightExtractor:o=mU,measureInfoExtractor:a=xU,explicitExtractor:s=gU}=n,{meta:l}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:r,count:i}){let o,a;if(Array.isArray(n)?({min:o,max:a}=this.extractFromStacked(n)):({min:o,max:a}=this.extractFromStraight(e,i)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();o=Number.isFinite(e)?Math.min(o,e):o,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(r),c=this.extractExplicit(),u=[0,o,a].filter(e=>TU(e));let d=Math.min(...u),f=Math.max(...u);d=OU(s,d)?Math.min(d,s):d,f=OU(l,f)?Math.max(f,l):f;const h=[c.explicitMin,c.explicitMax,d,f].filter(e=>TU(e));return o=Number.isNaN(c.explicitMin)?Math.min(...h):c.explicitMin,a=Number.isNaN(c.explicitMax)?Math.max(...h):c.explicitMax,o===a&&(Number.isNaN(c.explicitMin)?o=DU(o,-.2):Number.isNaN(c.explicitMax)&&(a=DU(a,.2))),{min:o,max:a,implicitMin:d,implicitMax:f,otherMin:s,otherMax:l,hasOtherMin:s<o,hasOtherMax:l>a,...c}},extractExplicit(){const{min:t,max:n,isExplicitMin:r,isExplicitMax:i}=s(e);return{hasExplicitMinMax:r||i,hasExplicitMin:r,hasExplicitMax:i,explicitMin:t,explicitMax:n}},extractFromStacked:e=>function(e){return e.length?{min:Math.min(...e[0].qSubNodes.filter(e=>SU(e.qMinNeg)).map(e=>e.qMinNeg)),max:Math.max(...e[0].qSubNodes.filter(e=>SU(e.qMaxPos)).map(e=>e.qMaxPos))}:{min:0,max:0}}(e.length?e[0].qData:[]),extractFromStraight(t,n){const s=t.length?t[0].qMatrix:[];return l.isStackedByMeasure?r(s,n):l.isStackedByDimension?i(s,n):e.getHyperCubeValue("qHasOtherValues")?o(s,n):a(e)},extractOthers:e=>l.isStackedByDimension?function(e){const t=wU(Jx(e,"0.qData.0.qSubNodes",[]),hU,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):l.isGroupedByDimension?function(e){const t=Jx(e,"0.qMatrix",[]).filter(pU).reduce(EU,[]).filter(CU).map(qU);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=wU(Jx(e,"0.qMatrix",[]),pU,[]).filter(MU).map(kU);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function AU(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:r,getHyperCubeValue:i}=t,o=e=>!e.length&&r.mode.K,a=e=>{const t=i("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=i("qMeasureInfo").length,s=i("qDimensionInfo").length,l=i("qHasOtherValues");if(!r.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(r.isContinuous){const e=r.isStackedByDimension?s:t;return n.fetchMinMaxData().then(t=>({qDataPages:t,count:e}))}const c=r.isStackedByDimension?1:t;return e.fetchMinMaxData().then(e=>{if(o(e))return a(l);let t=[];return l&&(t=r.mode.K?i("qStackedDataPages",[]):i("qDataPages",[])),{qDataPages:e,count:c,others:t}})}}}(e),n=NU(e);return t.resolve().then(e=>n.extract(e))}const _U="lasso",IU=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:_U,enable(e,n){if(this.started===_U||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==_U&&(i.actions.select.emit("start",_U),this.chart.component(e).emit("lassoStart",t),this.started=_U)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",_U),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const LU=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),c=o.hitRadius?o.hitRadius(a):0,u=c>0?{cx:n.x,cy:n.y,r:c}:n,d=o.shapesAt?o.shapesAt(u):this.chart.shapesAt(u,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),f=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&f&&f.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(f&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,f,{nodes:n,opts:o,customTooltipModel:e})}else f.emit("show",t,{nodes:d})}else h&&f.emit("hide")}}}};const PU=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const RU=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function zU(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:c=!1,multiple:u=!1,toLabel:d,onEdited:f}=e;return{key:t,type:"brush-range",layout:{dock:n.map(e=>`@${e}`).join(",")},on:f?{bubbleEnd(){f()}}:{},settings:{brush:c?{context:"selection",observe:!0}:"selection",scale:s,multiple:u,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=RU(e,t,"range");return{interactions:[e.onEdited?PU(e,t):null,r].filter(Boolean),components:[n]}}const FU={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},jU="inner-time-axis",BU="outer-time-axis";const HU={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const r=t?0:e.qDimensionInfo.length-1;n=uU.getMaxGlyphCount(e,r)}else e.qMeasureInfo.forEach(e=>{n=Math.max(n,e.qFallbackTitle.length)});return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?Jx(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=HU.getAxisData(e,t),r=!e.qDimensionInfo.length,i=r||t?void 0:e.qDimensionInfo.length-1,o=HU.getMajorAxisMaxGlyphCount(e,t),a=r?"qFallbackTitle":"qText";return AT.getAdjustedMaxGlyphCount(o,n,i,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=HU.getAxisData(e),n=uU.getMaxGlyphCount(e,0);return AT.getAdjustedMaxGlyphCount(n,t,0)}};var VU=3,$U=13;function WU(e,t,n,r){const{meta:i}=t.layoutService,o=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);i.isContinuous?o.push(...function(e,t,n,r){const{meta:i}=t.layoutService,{axis:o,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:c}=t.layoutService.getLayoutValue("gridLine",{}),u=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,f=FU[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,h={type:"grid-line",x:{},layout:{minimumLayoutMode:FU.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.lines.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}},p=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(i.isTime){if(d){const e=n?"end":"start",r=n?1:0,i="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:o.line.major.color},minorGuideLine:{stroke:o.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:i,justify:r},guideLine:{major:{justify:r},minor:{align:i}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isTime:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isTime:!0})}};u.push(kg(!0,{},d,{key:jU,scale:nU.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===c}},style:kg(!0,{},a,{line:{stroke:o.line.major.color},majorGuideLine:{stroke:o.line.minor.color},minorGuideLine:{stroke:o.line.major.color}})})),u.push(kg(!0,{},d,{key:BU,scale:nU.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),u.push({type:"axis-overlay",key:"outer-axis-overlay",scale:nU.SCALE.MAIN.MAJOR,layout:{dock:`@${BU}`,minimumLayoutMode:f}}),u.push({type:"axis-overlay",key:"inner-axis-overlay",scale:nU.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${jU}`,minimumLayoutMode:f}}),u.push(p)}return u.push(kg(!0,{},h,{key:"inner-time-grid",x:{scale:nU.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),u.push(kg(!0,{},h,{key:"outer-time-grid",x:{scale:nU.SCALE.MAIN.MAJOR}})),u}if(i.isContinuous){const e="continuous-axis";d&&(u.push({type:"axis",key:e,renderer:rA(),scale:nU.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:f},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:o.line.major.color},line:{show:!r},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isContinuous:!0})}}),u.push({type:"axis-overlay",key:"inner-axis-overlay",scale:nU.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:f}}),u.push(p)),u.push(kg(!0,{},h,{key:"continuous-grid",x:{scale:nU.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return u}(e,t,n,r)):o.push(...function(e,t,n,r){if("none"===e.dimensionAxis.show)return[];const{meta:i}=t.layoutService,o=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),c="horizontal"===t.dockService.meta.major.orientation,u=c?e.dimensionAxis.label:"auto",d="horizontal"===u?void 0:t.dockService.meta.minor.size/4,f=t.styleService.axis.label.getStyle(),h={type:"axis",renderer:rA(),layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:FU[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:u,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...f},line:{show:!r,stroke:o.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isHorizontal:c})}};l&&a.push(kg(!0,{},h,{key:"group-axis",scale:nU.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":h.settings.labels.mode,maxGlyphCount:HU.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(c||!s)&&h.settings.line.show}}}));const p=HU.getBarAxisMaxGlyphCount(e.qHyperCube,i.isStackedByDimension);return s&&a.push(kg(!0,{},h,{key:nU.COMPONENT.BAR_AXIS,scale:nU.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:p,maxLengthPx:d,tiltThreshold:p>VU&&p<$U?1:void 0},line:{show:!(c&&l)&&h.settings.line.show}}})),c||2!==a.length?a:[a[1],a[0]]}(e,t,n,r));const l=t.themeService.getStyles(),c=t.styleService.axis.label.getStyle();return a&&o.push({type:"axis",key:"y-axis",renderer:rA(),formatter:nU.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:FU.measureAxis.minimumLayoutMode},scale:nU.SCALE.MAIN.MINOR,settings:{labels:{show:s,...c},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:GN.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:GN.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),o}var UU={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function YU({layoutService:e,discrete:t}){const{isContinuous:n,isGrouped:r}=e.meta,i=(e.getLayoutValue("components",[])||[]).filter(e=>"bar"===e.key)[0];if(i?.style?.width){const{style:e}=i;return e.strokeWidth&&"none"!==e.strokeWidth&&!n?function(){const n=UU.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),r=e.width+n;return r>1?e.width-(r-1):e.width}:e.width}return r?.9:.7}const{isNumber:KU}=oN,GU=["$year","$yearquarter","$quarter","$yearmonth","$month","$weeknumber","$yearweek","$week","$weekday","$day","$date"],XU={seconds:1/86400,minutes:1/1440,hours:1/24,days:1,weeks:7,months:365/12,quarters:91.25,years:365,number:1},JU={$date:1,$day:1,$weekday:1,$week:1,$yearweek:7,$weeknumber:1,$month:1,$yearmonth:365/12,$quarter:1,$yearquarter:91.25,$year:365},ZU=({data:e,layout:t})=>{const n=t.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;if("auto"!==n)return XU[n||"none"]||1;const r=t.qHyperCube?.qDimensionInfo?.[0]?.qTags||[];for(let e=0;e<GU.length;e+=1)if(-1!==r.indexOf(GU[e]))return JU[GU[e]]||1;return(({data:e,layout:t})=>{const n=(t.qHyperCube?.qDimensionInfo?.[0]?.qAttrExprInfo||[]).find(e=>"firstDimensionDiff"===e.id);let r=Number(n?.qFallbackTitle);if(KU(r))return r;const i=e.items.map(e=>e.timeStart.value);return r=aN.findMinPositiveDistance(i),r})({data:e,layout:t})};function QU({opts:e,MIN_BAR_WIDTH:t,isMiniChart:n=!1}){return({data:r,mainRect:i,maxBarWidth:o})=>{const{viewState:a,viewCache:s}=e,{min:l,max:c}=n?{min:s.get("continuousMin"),max:s.get("continuousMax")}:a.get("zoom"),u=Math.max(0,(({data:e,width:t,min:n,max:r,opts:i})=>{if(r===n)return t;const o=i.layoutService.getLayout(),a=(o.qHyperCube?.qDimensionInfo?.[0]?.continuous.stepSize||1)*ZU({data:e,layout:o});return a<=0?t:a/(r-n)*t})({data:r,width:i.width,min:l,max:c,opts:e}));return Math.max(t,Math.min(u,o))}}const eY={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function tY(e,t,n={}){const r=QU({opts:e,MIN_BAR_WIDTH:2});return({data:i})=>{const{chart:o,viewState:a,viewCache:s,layoutService:l,discrete:c}=e,u=o.component(t).rect;if(!i.items.length||!u)return 2;const{min:d,max:f}=a.get("zoom");if(n[[d,f]])return n[[d,f]];const h=l.getLayout();let p;n={};let m=eY[pT.getLayoutMode(u.width,Number.MAX_VALUE)];const g=h.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;if(g&&"none"!==g){m=u.width;p=YU({layoutService:l,discrete:c})*r({data:i,mainRect:u,maxBarWidth:m})}else{const e=Math.abs(f-d),t=Math.abs(s.get("continuousMax")-s.get("continuousMin"));if(0===t)return m;const n=function(e,t,n){return e*(1-n)+t*n}(2,m,1-Math.min(e/t/.2,1));p=Math.max(2,Math.min(m,n))}return n[[d,f]]=p,n[[d,f]]}}function nY(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r<=0}function rY(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r>=0}function iY(e,t){const{hasExplicitMax:n,explicitMax:r}=t;return!!n&&e>r&&r>0}function oY(e,t){const{hasExplicitMin:n,explicitMin:r}=t;return!!n&&e<r&&r<0}const aY="max",sY="min",lY={min:"Min",max:"Max"};function cY(e,t,n){return void 0===n?nY(e,t)||rY(e,t):n===aY?nY(e,t):rY(e,t)}function uY({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${lY[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===aY?e.implicitMax:e.implicitMin;return!cY(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function dY(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,dockService:o,themeService:a}=e,s=i.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===aY?s.implicitMax:s.implicitMin;if(!cY(Number(l.toFixed(13)),s,n))return!1;const{orientation:c}=t.settings,u=n===aY?o.meta.minor.end:o.meta.minor.start;let d="end";r&&(d=n===aY?"sumOfPositives":"sumOfNegatives");const f=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:u},data:t.data,brush:t.brush,settings:{orientation:c,major:t.settings.major,minor:t.settings.minor,dockValue:DT.getDockValue(u),oob:kg({},t.settings.box,{fill:f.outOfRange.color,alignment:1,opacity:1,show:function(e){return!0!==e.datum.null?.value&&((!r||0!==e.datum[d].value)&&cY(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:GN.barOobs.compensateForLayoutChanges}}}function fY(e){return Math.min(Math.max(0,e),1)}const hY=(e,{chart:t,type:n,componentKey:r,collectionKey:i})=>{const{layoutService:o,dockService:a,viewCache:s}=e,{isStacked:l}=o.meta,c=s.get("minorMinMax"),{meta:u}=e.layoutService;if(!uY({minorMinMax:c,type:n}))return!1;let d;u.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:u.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);const f={type:"box",key:`${nU.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:i},settings:{orientation:a.meta.minor.orientation,major:{scale:nU.SCALE.MAIN.MAJOR,fn:d},minor:{scale:nU.SCALE.MAIN.MINOR,start:e=>fY(t.scale(nU.SCALE.MAIN.MINOR)(e?.datum?.start?.value||0)),end(e){const r=t.scale(nU.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r[n]();return fY(r(o))}},box:{width:YU({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const r=t.scale(nU.SCALE.MAIN.MINOR);let i="end";l&&(i="max"===n?"sumOfPositives":"sumOfNegatives");const o=e.datum[i]?e.datum[i].value:r.max();return"max"===n?o>r.max():o<r.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}};return f};function pY(e,t){const{style:n,styleService:r,dockService:i}=t,o=r.label.getStyle(),a=o.useContrastColor&&!e.onBackground?function(e){return function(t){return zO.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):o.fill,s="horizontal"===i.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function mY(e){return{placements:e.simplifiedPlacements.map(t=>pY(t,e)),label:e.label}}function gY(e,t){if(t){if(function(e,t){return nY(e,t)}(e,t))return-1;if(function(e,t){return rY(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function yY(e,t,n,r){const i=gY(e,r);let o="up";return"vertical"===t&&i<0?o="down":"horizontal"===t&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}function vY(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!r||!i&&!!n.showSegmentLabels}function bY(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:r,isContinuous:i}=t.layoutService.meta;return!!r&&(!!i||!1!==n.showTotalLabels)}function xY(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}function SY({layout:e,component:t,minorScale:n},r,i){if(!vY(e,r))return!1;const{viewModel:o,ds:a,viewCache:s,layoutService:l,dockService:c,themeService:u}=r,{meta:d}=l,f=s.get("minorMinMax"),h=u.getStyles(),p=r.styleService.label.getStyle();let m;!d.isStacked&&(m=d.isStacked?1:0);const g=0===m?1:0,y=d.isStacked?.5:1,v=o.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let x,S=-1;x=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>S?b(e.data.segment.value):""}:function(e){return e.data.end.label};const w={label:x,simplifiedPlacements:xY(m,g,y,d.isContinuous),style:h.label.value},M=[mY(kg(r,w))],k={component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>yY(e.data.end.value,c.meta.minor.orientation,i,f),labels:M,fontSize:parseInt(p.fontSize,10),fontFamily:p.fontFamily,linkData:GN.labels.linkData}}},C=[k],q={key:"bar-labels",type:"labels",renderer:rA(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:C},animations:{enabled:r.viewModel.animations.enabled,trackBy:GN.labels.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(q.beforeRender=()=>{S=function(e,t,n){const r="vertical"===t.dockService.meta.minor.orientation?"height":"width",i=t.chart.component(e),o=i&&i.rect?i.rect[r]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/o}(t,r,n)}),q}function wY(e,{fill:t}){return{[nU.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[nU.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const MY=1,kY=3;function CY(e){return e.getLayoutValue("gridLine.auto")}function qY(e){return!CY(e)&&e.getLayoutValue("gridLine.spacing")===MY}function EY(e){return!CY(e)&&e.getLayoutValue("gridLine.spacing")===kY}const DY=e=>({enabled:e.animations.enabled,trackBy:GN.lines.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}),TY=(e,{themeService:t,layoutService:n,dockService:r,viewModel:i})=>{if(!CY(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:o}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:FU.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!qY(n)||((e,t)=>t%2==0),stroke:o.line.major.color},minorTicks:{show:EY(n),stroke:o.line.minor.color},animations:DY(i)};return a["horizontal"===r.meta.major.orientation?"y":"x"]=nU.SCALE.MAIN.MINOR,a};function OY(e,t){const n=[TY(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:r})=>{const i=n.get("minorMinMax");if(i.min>0||i.max<0)return!1;const o=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:nU.SCALE.MAIN.MINOR,line:{stroke:o.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:nU.SCALE.MAIN.MINOR,lines:a,animations:DY(r)}})(t)),n}const NY="areaPan",AY=e=>({type:"Pan",key:"panorama",options:{event:NY,pointers:1,threshold:10,enable(t,n){return this.started===NY||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===nU.COMPONENT.BAR)}},events:{areaPanstart(t){t.preventDefault(),this.started=NY;const n=e.viewState.get("zoom");this[NY]={min:n.min,max:n.max,size:e.chart.component(nU.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:r,max:i,size:o}=this[NY],a=-t.deltaX/o;e.viewState.set("zoom",{min:Math.min(r+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(i+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function _Y(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=dT.event.onZoom({viewCache:n,viewState:r,chart:i},{threshold:100,rtl:o,targetKey:nU.COMPONENT.BAR}),s={last:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===nU.COMPONENT.BAR)},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function IY(e,t){const{viewCache:n,viewState:r,chart:i}=e,{rtl:o}=t,a=e.layoutService.meta.isContinuous?dT.event.onZoom({viewCache:n,viewState:r,chart:i},{rtl:o,threshold:50,targetKey:nU.COMPONENT.BAR}):void 0;return{type:"native",events:{wheel(t){let n,r=!1;if(e.actions.scroll.enabled()){const i={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(i).filter(e=>e.key===nU.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&a(i,Math.sign(-t.deltaY)),r=!0)}!r&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===nU.COMPONENT.LEGEND_COLOR_CAT),n&&(r=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,n))),r&&t.preventDefault()}}}}const LY=(e,t,n)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...JA({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...n.gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[AY(e),_Y(e,t)]]});function PY(e,t){const n=e.tooltipService.getInteractions(),r=[LY(e,t,n),IY(e,t),JA({...e,componentKey:"scrollbar",rtl:t.rtl}).native,n.native];return e.layoutService.meta.isDiscrete&&r.push(e.discrete.interactions.native),r}const RY=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:GN.bars.compensateForLayoutChanges});function zY(e,t,{collectionKey:n}){const{continuousDataModel:r,reducedDataModel:i,colorService:o,layoutService:a,viewModel:s}=t,{meta:l}=a,c=a.getLayout(),u=c.qHyperCube.qDimensionInfo?.[0]?.continuous?.period,d=u&&"none"!==u,f=l.isContinuous&&d?function(e,t,n={}){const r=QU({opts:e,MIN_BAR_WIDTH:2,isMiniChart:!0});return({data:i})=>{const{chart:o,viewCache:a,layoutService:s,discrete:l}=e,c=o.component(t).rect;if(!i.items.length||!c)return 2;const u=a.get("continuousMin"),d=a.get("continuousMax");if(n[[u,d]])return n[[u,d]];const f=s.getLayout();let h;n={};let p=eY[pT.getLayoutMode(c.width,Number.MAX_VALUE)];const m=f.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;return m&&"none"!==m?(p=c.width,h=YU({layoutService:s,discrete:l})*r({data:i,mainRect:c,maxBarWidth:p}),n[[u,d]]=h,n[[u,d]]):2}}(t,nU.COMPONENT.MINI_BAR):2;return{type:"box",key:nU.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>r.getDimensionCardinality()>1,data:{collection:n},settings:{box:kg(!0,{},e.settings.box,{minWidthPx:f,fill:o.getMini().getColor(),strokeWidth:0}),major:kg(!0,{},e.settings.major,{scale:i.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:RY(s)}}const FY=(e,t,{collectionKey:n})=>{if(!zA({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return zY(e,t,{collectionKey:n});const{mode:r,scales:i}=t.reducedDataModel;let o;return r.isGroupedByDimension&&!r.isReduced?o=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:r.isGroupedByMeasure&&(o=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:nU.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:r.isReduced||r.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:i.major,fn:o},minor:{scale:i.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:RY(t.viewModel)}},{measureText:jY}=Sp.renderer("svg")();function BY(e,t,n){const r=function(e){const t=kg(!0,{},e);return delete t.data,t}(t.minor),i=function(e,t,{majorScaleInvert:n,maxPxStep:r,align:i,getProp:o}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map((e,t)=>({field:e,value:t})):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:r,align:i};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=kg(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=kg(!0,{},t,{min:()=>o("continuousMin"),max:()=>o("continuousMax")})),a}(e,t.major,n);return{reducedMinor:r,reducedMajor:i}}const HY=50,VY=100,$Y=200;function WY(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return HY;case 1:return VY;case 2:return $Y;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function UY(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function YY(e,t,n){return 0===t||0===e||t===n.length-1}function KY(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function GY(e,t,n,r,i){e.domain([t,n]),e.nice(10);const[o,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),c=function(e){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some(e=>0===e)}(s),u=c?YY:UY;s=s.filter(u),l&&!c&&!r&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=i?i.formatter(nU.FORMATTER.MINOR):void 0;return KY(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:o,roundedMax:a,ticks:s}}function XY(e,t,n,r,i,o,a,s){const l=o.formatter(nU.FORMATTER.MINOR),c=s.getStyles(),u="horizontal"===a.meta.major.orientation?"height":"width",d=e=>jY({text:e,fontSize:c.axis.label.name.fontSize,fontFamily:c.axis.label.name.fontFamily})[u];let[f,h]=e.domain(),p=e.ticks(r);function m(){const e=p.map(l);return!KY(e)&&function(e){const t=i/p.length;return Math.max(...e.map(d))<=t}(e)}for(let i=r-1;i>0&&!m();i--)e.domain([t,n]),e.nice(i),[f,h]=e.domain(),p=e.ticks(i);return{roundedMin:f,roundedMax:h,ticks:p}}const JY=(e,t)=>e.value-t.value,ZY=e=>({value:e,isMinor:!1}),QY=e=>({value:e,isMinor:!0});function eK(e,t,n){const r=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter(e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e)).length<=r}function tK({chart:e,viewCache:t,dockService:n,layoutService:r,themeService:i,viewModel:o,ds:a}){const{isButterfly:s}=r.meta,{explicitMin:l,explicitMax:c,hasExplicitMin:u,hasExplicitMax:d}=t.get("minorMinMax"),{min:f,max:h}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),p=s?Math.max(Math.abs(f),Math.abs(h)):h,m=s?-p:f,g=tS(()=>{const s=function(e,t,n){let r;return e?r=n.meta.chart.size:({rect:r}=t.component(nU.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?r.height:r.width}(t.get("isPreRender"),e,n),f=WY(s,r),h=function(e,t,n){const r=WC().domain([e,t]);return r.nice(n),r}(m,p,f);let g,y,v=[];"SPARK"===n.meta.chart.mode?({roundedMin:g,roundedMax:y}=function(e,t){return{roundedMin:e,roundedMax:t}}(m,p)):(({roundedMin:g,roundedMax:y,ticks:v}=XY(h,m,p,f,s,e,n,i)),eK(v,l,c)&&({roundedMin:g,roundedMax:y,ticks:v}=GY(h,m,p,u||d,e)));const b=function(e,t){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}(v,1);v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.unshift(t),n.filter(e=>e>=t)):n}(u,l,v),v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.push(t),n.filter(e=>e<=t)):n}(d,c,v);let x=function(e,t){return[...e.map(ZY),...t.map(QY)].sort(JY)}(v,b);if(r.meta.isButterfly){const e=o.fields.minor[0],t=void 0===e?void 0:a.field(e).formatter();"function"==typeof t&&(x=x.map(e=>({...e,label:t(Math.abs(e.value))})))}return{roundedMin:g,roundedMax:y,ticks:x}},()=>t.get("isPreRender"));return{values:()=>g().ticks,min:()=>u?l:g().roundedMin,max:()=>d?c:g().roundedMax}}function nK(e,{picasso:t,discrete:n,layoutService:r,dockService:i,viewModel:o,viewCache:a,reducedDataModel:s,colorService:l,themeService:c,viewState:u,chart:d,ds:f},{localeInfo:h,rtl:p}){const{meta:m}=r,{fields:g}=o,y=()=>{if("custom"!==r.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,i.meta.chart.size["horizontal"===i.meta.major.orientation?"height":"width"]/4)},v=!("none"===r.getLayoutValue("measureAxis.show"))?(b=i.meta.minor.orientation,x=i.meta.minor.dock,"vertical"===b?"near"===x||"left"===x?0:1:"near"===x||"bottom"===x?1:0):.5;var b,x;const S={},w="vertical"===i.meta.minor.orientation&&p,M=l.getMain().getScales(),k=l.getMini().getScales();if(Object.assign(S,M,{reducedFill:k.reducedFill}),S[nU.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:r,viewModel:i,layoutService:o,themeService:a,ds:s},{rtl:l}){const c=tK({chart:e,dockService:n,viewCache:r,layoutService:o,themeService:a,viewModel:i,ds:s}),u={invert:"vertical"===n.meta.minor.orientation||l,ticks:{values:c.values},minorTicks:{count:1},min:c.min,max:c.max};return o.meta.isStacked||(u.data={source:"qHyperCube",fields:t.minor}),u}({chart:d,viewModel:o,dockService:i,viewCache:a,layoutService:r,themeService:c,ds:f},{rtl:p}),m.isGroupedByDimension)[nU.SCALE.MAIN.MAJOR_INNER,nU.SCALE.MAIN.MAJOR].forEach((e,t)=>{S[e]={invert:w,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...o.selectionDimensionProp(t),group:m.isGroupedByDimension?{field:g.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:y,align:v}}),o.isDimensionLocked(0)||(S[nU.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(m.isGroupedByMeasure)S[nU.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:w,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:y,align:v};else if(m.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:r,viewCache:i,picasso:o,viewState:a,localeInfo:s,themeService:l}=e,c=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),u=o.formatter("q-time"),d=l.getStyles(),f=e=>jY({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});i.set("qTimeAxisCache",[]);const h={get:(e,t=0)=>{const n=i.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{i.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),r=(n-t)/(i.get("continuousMax")-i.get("continuousMin")),o=c().map(e=>e.qName);return[e,Number.parseFloat(r).toFixed(12),...o].toString()}};return{innerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:c,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:u,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:h},outerTime:{data:{field:r.fields.majorNumeric},type:"q-time-axis",qAxis:c,field:r.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:u,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:f},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:h}}}({picasso:t,localeInfo:h,viewState:u,viewModel:o,viewCache:a,themeService:c,layoutService:r},p);S[nU.SCALE.MAIN.MAJOR_INNER]=e,S[nU.SCALE.MAIN.MAJOR]=n}else m.isContinuous?S[nU.SCALE.MAIN.MAJOR]={type:"linear",invert:w,data:{extract:{key:"qHyperCube",field:g.majorNumeric}},ticks:{forceBounds:!0,count:u.get("zoom").min===u.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>u.get("zoom").min,max:()=>u.get("zoom").max}:S[nU.SCALE.MAIN.MAJOR]={invert:w,data:{extract:m.isDimensionless?g.minor.map((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n})):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:m.isDimensionless?"band":void 0,maxPxStep:y,align:v};const{reducedMinor:C,reducedMajor:q}=BY(s,{major:S[nU.SCALE.MAIN.MAJOR],minor:S[nU.SCALE.MAIN.MINOR]},{majorScaleInvert:w,maxPxStep:y,align:v,getProp:a.get});return m.isDiscrete&&(S[nU.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,m.isGroupedByDimension&&(S[nU.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),S[s.scales.major]=q,S[s.scales.minor]=C,S}function rK(e,t,n){const{actions:r,flags:i,layoutService:o,colorService:a}=e,s=(e,t)=>{const r={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return nU.COMPONENT.BAR===t[0].key?[{...r,data:["selectionDimension"]}]:[nU.COMPONENT.BAR_AXIS,nU.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...r,data:["selectionDimension","axisSelectionDimension"]}]:[r]},l=n=>n.some(e=>e.key===nU.COMPONENT.LEGEND_COLOR_CAT)?a.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n),c=[o.meta.isStackedByDimension&&o.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?nU.COMPONENT.STACK_TOTAL_BAR:nU.COMPONENT.BAR,nU.COMPONENT.BAR_AXIS,nU.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",nU.COMPONENT.LEGEND_COLOR_CAT];return i.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=c.actions)&&void 0!==e?e:Nv.ACTIONS,components:null!==(t=c.components)&&void 0!==t?t:Nv.COMPONENTS,events:{onSelectStart:null!==(n=null===(r=c.events)||void 0===r?void 0:r.onSelectStart)&&void 0!==n?n:Nv.EVENTS,onSelectEnd:null!==(i=null===(o=c.events)||void 0===o?void 0:o.onSelectEnd)&&void 0!==i?i:Nv.EVENTS},hitRadius:null!==(a=c.hitRadius)&&void 0!==a?a:Nv.HIT_RADIUS,isLocked:null!==(s=c.isLocked)&&void 0!==s?s:Nv.IS_LOCKED,shapesAt:c.shapesAt,targets:null!==(l=c.targets)&&void 0!==l?l:Nv.TARGETS}}(e);return{interactions:[_v(t)],components:[]}}({actions:r,components:s,isLocked:l,targets:c}):function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[LU(e,t)],components:[]}}({targets:c,components:s},{...e,isLocked:l})}function iK(e){const t=[e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?{key:nU.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:nU.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}];return e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=u.actions)&&void 0!==e?e:Tv.ACTIONS,componentKey:null!==(t=u.componentKey)&&void 0!==t?t:Tv.COMPONENT_KEY,components:null!==(n=u.components)&&void 0!==n?n:Tv.COMPONENTS,events:{onLassoStart:null!==(r=null===(i=u.events)||void 0===i?void 0:i.onLassoStart)&&void 0!==r?r:Tv.EVENTS,onLassoMove:null!==(o=null===(a=u.events)||void 0===a?void 0:a.onLassoMove)&&void 0!==o?o:Tv.EVENTS,onLassoEnd:null!==(s=null===(l=u.events)||void 0===l?void 0:l.onLassoEnd)&&void 0!==s?s:Tv.EVENTS},targetKeys:null!==(c=u.targetKeys)&&void 0!==c?c:Tv.TARGET_KEYS}}(e),n=function(e){var t=e.actions,n=e.componentKey,r=e.events,i=e.targetKeys;return{key:"event:lasso",type:"Pan",requireFailure:void 0,recognizeWith:void 0,options:{event:Ov,enable:function(e,n){return this.started===Ov||!n||!!(t.select.enabled()&&t.lasso.enabled()&&t.lasso.active())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(e){return-1!==i.indexOf(e.key)})}},events:fy(fy(fy({},"".concat(Ov,"start"),function(e){e.preventDefault(),this.started!==Ov&&(t.select.emit("start",Ov),this.chart.component(n).emit("lassoStart",e),this.started=Ov,r.onLassoStart({chart:this.chart}))}),"".concat(Ov,"move"),function(e){e.preventDefault(),this.chart.component(n).emit("lassoMove",e),r.onLassoMove({chart:this.chart})}),"".concat(Ov,"end"),function(e){e.preventDefault(),this.started=!1,this.chart.component(n).emit("lassoEnd",e),t.select.emit("end",Ov),r.onLassoEnd({chart:this.chart})})}}(t),r=function(e){return{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:e.components},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}}(t);return{interactions:[n],components:[r]}}({actions:e.actions,componentKey:"lasso",components:t,targetKeys:[nU.COMPONENT.BAR]}):function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[IU(n,t)],components:[r]}}({key:"lasso",componentTargetKey:nU.COMPONENT.BAR,components:t},e)}function oK(e){const t=[{key:nU.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}];return e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){var t=function(){var e,t,n,r,i,o,a,s,l,c,u,d,f,h,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{actions:null!==(e=p.actions)&&void 0!==e?e:wv.ACTIONS,componentKey:null!==(t=p.componentKey)&&void 0!==t?t:wv.COMPONENT_KEY,components:null!==(n=p.components)&&void 0!==n?n:wv.COMPONENTS,dock:null!==(r=p.dock)&&void 0!==r?r:wv.DOCK,enable:null!==(i=p.enable)&&void 0!==i?i:wv.ENABLE,eventKey:null!==(o=p.eventKey)&&void 0!==o?o:wv.EVENT_KEY,events:{onRangeStart:null!==(a=null===(s=p.events)||void 0===s?void 0:s.onRangeStart)&&void 0!==a?a:wv.EVENTS,onRangeMove:null!==(l=null===(c=p.events)||void 0===c?void 0:c.onRangeMove)&&void 0!==l?l:wv.EVENTS,onRangeEnd:null!==(u=null===(d=p.events)||void 0===d?void 0:d.onRangeEnd)&&void 0!==u?u:wv.EVENTS},fillTargets:null!==(f=p.fillTargets)&&void 0!==f?f:wv.FILL_TARGETS,targets:null!==(h=p.targets)&&void 0!==h?h:wv.TARGETS}}(e),n=function(e){return kv({config:e,type:"area"})}(t),r=function(e){var t=e.componentKey,n=e.components,r=e.dock,i=e.fillTargets;return{key:t,type:"brush-area-dir",layout:{dock:e.targets.map(function(e){return"@".concat(e)}).join(",")},settings:{multiple:!0,brush:{components:n},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(t);return{interactions:[n],components:[r]}}({actions:e.actions,componentKey:"discreteRangeBrush",components:t,dock:e.dockService.meta.major.dock,eventKey:"discreteRange",fillTargets:["group-axis",nU.COMPONENT.BAR_AXIS],targets:["group-axis",nU.COMPONENT.BAR_AXIS,nU.COMPONENT.BAR]}):function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[RU(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:t,key:"discreteRangeBrush",targets:["group-axis",nU.COMPONENT.BAR_AXIS,nU.COMPONENT.BAR],fillTargets:["group-axis",nU.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function aK(e,t,n){const{selectionService:r}=e,{isUnsupportedFeature:i}=t,o=void 0===n,a=r.getIsSingleSelect(n),s=rK(e,o,a);if(o||a)return{components:[...s.components],gestures:[...s.interactions]};const l=iK(e),c=function(e,t){return e.layoutService.meta.isStacked||e.layoutService.meta.isButterfly||t?.("rangeSelections")?{components:[],interactions:[]}:e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Dv({actions:e.actions,componentKey:"measureRangeBrush",dock:e.dockService.meta.minor.dock,eventKey:"measureRange",fillTargets:["y-axis"],onEdited:()=>{e.actions.select.emit("end","measureRange")},scale:nU.SCALE.MAIN.MINOR,targets:["y-axis",nU.COMPONENT.BAR]}):zU({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",nU.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:nU.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,i),u=function(e){if(!e.layoutService.meta.isContinuous)return{components:[],interactions:[]};const t=({datum:t,data:n,scale:r})=>{const i=e.layoutService.meta.isTime?r.formatter():r.data().fields[0].formatter(),o=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||o?"":"<"}${i(t)}`};return e.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Dv({actions:e.actions,componentKey:"continuousRangeBrush",dock:e.dockService.meta.major.dock,eventKey:"continuousRange",fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],multiple:!0,observeBrush:!0,scale:e.layoutService.meta.isTime?nU.SCALE.MAIN.MAJOR_INNER:nU.SCALE.MAIN.MAJOR,targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",nU.COMPONENT.BAR]:["continuous-axis",nU.COMPONENT.BAR],toLabel:t}):zU({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",nU.COMPONENT.BAR]:["continuous-axis",nU.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?nU.SCALE.MAIN.MAJOR_INNER:nU.SCALE.MAIN.MAJOR,toLabel:t},e)}(e),d=oK(e);return{components:[...s.components,...l.components,...c.components,...d.components,...u.components],gestures:[...l.interactions,...s.interactions,...c.interactions,...d.interactions,...u.interactions]}}const{isNumber:sK}=oN;function lK({layoutService:e,viewModel:t,dockService:n}){const{meta:r}=e;if(!r.isStackedByDimension||r.isContinuous)return!1;const{fields:i}=t,o=e.getLayoutValue("components",null),a=o?o.filter(e=>"bar"===e.key)[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>(e=>Number(e.filter(e=>sK(e.qMaxPos)).map(e=>e.qMaxPos).reduce((e,t)=>e+t,0).toFixed(13)))(e.qSubNodes)},end:{value:e=>sK(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0}}},{field:i.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>(e=>Number(e.filter(e=>sK(e.qMinNeg)).map(e=>e.qMinNeg).reduce((e,t)=>e+t,0).toFixed(13)))(e.qSubNodes)},end:{value:e=>sK(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0}}}]},settings:{major:{scale:nU.SCALE.MAIN.MAJOR},minor:{scale:nU.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:a?.style?.width&&a.style.width>0?a.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:GN.shadowBars.trackBy,compensateForLayoutChanges:GN.bars.compensateForLayoutChanges}}}const cK={min:"Min",max:"Max"};function uK(e,t,n){const r=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?iY(e,t)||oY(e,t):n===aY?iY(e,t):oY(e,t)}(Number(r.toFixed(13)),e,t)}function dK(e,{barComponent:t,type:n,isStacked:r}){const{viewCache:i,layoutService:o,dockService:a}=e,s=i.get("minorMinMax"),l=n===aY;if(function(e,t){return!e[`hasOther${cK[t]}`]}(s,n)){if(function(e,t){return!e[`hasExplicit${cK[t]}`]}(s,n))return!1;if(uK(s,n,l))return!1}if(function(e,t,n){const r=n?e=>e<0:e=>e>0;return e[`hasExplicit${cK[t]}`]&&r(e[`explicit${cK[t]}`])}(s,n,l))return!1;let c="end";r&&(c=l?"sumOfPositives":"sumOfNegatives");const u=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>e.chart.scale(nU.SCALE.MAIN.MINOR)[n]()),d=l?e=>e.datum[c].value>u():e=>e.datum[c].value<u(),f=nU.COMPONENT.BAR,h=e.layoutService.getLayoutValue("components",[]),p=h?h.filter(e=>e.key===f)[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:l?a.meta.minor.end:a.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:kg({},t.settings.box,{fill:o.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:d,width:YU({layoutService:e.layoutService,discrete:e.discrete}),strokeWidth:p?.style?.strokeWidth?UU.BAR.STROKE.WIDTH[p.style.strokeWidth.toUpperCase()]:UU.BAR.STROKE.WIDTH.NONE,stroke:p?.style?.strokeColor?.color??UU.BAR.STROKE.COLOR})}}}function fK(e,{collectionKey:t},n){const{meta:r}=e.layoutService,{fields:i}=e.viewModel,o=r.isStackedByDimension&&!r.isContinuous?"qValue":"qNum";function a(t,n){const i=e.ds.field(t).raw(),a=e.ds.field(t).formatter(),s=ST.shouldUseFormat(i),l=r.isButterfly&&n>0;return{field:t,reduceLabel:"none",value:e=>"NaN"===e[o]?0:(e=>l&&0!==e?-e:e)(e[o]),label:e=>s?(e=>"NaN"===e[o]?"-":a(e[o]))(e):e.qText}}function s(e){if(!r.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[o]<0}}const l=r.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;function c(e){return{field:e,reduceLabel:"none",reduce:"first",value:l}}const u={key:t,data:{extract:i.minor.map((t,o)=>{const l=e.colorService.getMain().getDatumProps(o),u=e.colorService.getMini().getDatumProps(o),d=l[Object.keys(l)[0]],f=d?.field,h=f?{field:f,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,p={field:r.isDimensionless?t:i.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:a(t,o),negative:s(t),null:c(t),segment:r.isStacked?a(t):void 0,group:r.isGroupedByDimension?{field:i.majorGroup}:void 0,stack:r.isStacked?{field:i.majorStack}:void 0,measureIndex:r.isGroupedByDimension||r.isStackedByDimension?void 0:o,timeStart:r.isContinuous?{field:i.majorNumeric}:void 0,timeEnd:r.isContinuous?{field:i.majorNumeric}:void 0,fillTooltip:h,...l,...u,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${o}`},customTooltipAttrExps:0!==r.dimensionCount?x$.getNode(e.layoutService.getLayout(),r):void 0}};return r.isDimensionless&&(p.value=o),void 0!==n&&(p.source=n),ST.deleteUndefinedProperties(p.props),p}),filter:r.isButterfly?e=>!e.negative.value:void 0}};return r.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}const{isNumber:hK}=oN;function pK({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:r}=e,{fields:i}=t;if(!r.isStacked)return!1;let o;return o=r.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"},null:{fields:t.minor.map(e=>({field:e})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(r,i):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>hK(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0},sumOfNegatives:{value:e=>hK(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every(e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue)}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t>0?e+t:e,0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t<0?e+t:e,0)},timeStart:n,timeEnd:n}}}(r,i),{key:n,data:{extract:o}}}const mK="main-collection",gK="stack-total-collection";function yK(e,{collectionKey:t}){const{layoutService:n,colorService:r,reducedDataModel:{fields:i,mode:o}}=e,{meta:a}=n,s=a.isStackedByDimension&&!a.isContinuous?"qValue":"qNum";function l(e,t){if(!a.isButterfly)return{field:e};const n=t>0;return{field:e,value:e=>"NaN"===e[s]?0:(e=>n&&0!==e?-e:e)(e[s])}}function c(e){if(!a.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[s]<0}}return{key:t,data:{extract:i.minor.map((e,t)=>{const n=o.isReduced?{}:r.getMain().getDatumProps(t),a={start:0,end:l(e,t),negative:c(e),group:{field:i.majorGroup},measureIndex:t,...n},s={source:"miniCube",field:o.isDimensionless?e:i.major,props:a};return o.isDimensionless&&(s.value=t),s}),filter:a.isButterfly?e=>!e.negative.value:void 0}}}const vK="mini-collection",bK="mini-stack-collection",xK="mini-continuous-collection",SK="miniCube",wK=(e,t)=>{const n=(e=>{const t=[fK(e,{collectionKey:mK})];return e.layoutService.meta.isStacked&&t.push(pK(e,{collectionKey:gK})),t})(t),r=((e,t)=>{const n=[];return zA({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(fK(t,{collectionKey:xK},SK)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:r,mode:i}}=e;return{key:t,data:{extract:r.minor.map((e,t)=>{const o={end:{field:e,reduceLabel:"none"},...i.isStackedByMeasure&&!i.isReduced?n.getMain().getDatumProps(t):{}};return i.isContinuous&&(o.timeStart={field:r.major,value:e=>e.qNum},o.timeEnd=o.timeStart),{source:"miniCube",field:r.major,props:o}}),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:bK})):n.push(yK(t,{collectionKey:vK}))),n})(0,t);return n.concat(r)};function MK(e,t,n,r){const i=[{position:e,onBackground:!0,justify:0,overflow:r}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function kK({layout:e,component:t},n,r){if(!bY(e,n))return!1;const{layoutService:i,chart:o,dockService:a,viewModel:s,themeService:l,styleService:c}=n,{meta:u}=i,d=!vY(e,n),f=l.getStyles(),h=c.label.getStyle(),p=h.useContrastColor;function m(e){const t=o.formatter(nU.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":m(e.data.sumOfPositives.value)},simplifiedPlacements:MK("outside",d,p,u.isContinuous),style:f.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":m(e.data.sumOfNegatives.value)},simplifiedPlacements:MK("opposite",d,p,u.isContinuous),style:f.label.value},v=[mY(kg(n,g)),mY(kg(n,y))];return{key:"stack-total-labels",type:"labels",renderer:rA(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>yY(e.data.sumOfPositives.value,a.meta.minor.orientation,r),labels:v,fontSize:parseInt(h.fontSize,10),fontFamily:h.fontFamily,linkData:GN.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:GN.labels.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}}}function CK(e,t,n){const r=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return r.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),r}function qK({layout:e,type:t},n){const{layoutService:r,viewCache:i,themeService:o,styleService:a}=n,{meta:s}=r,{isStacked:l}=s;if(!l&&!vY(e,n)||l&&!bY(e,n))return!1;const c=i.get("minorMinMax");if(!c.hasExplicitMinMax||t===aY&&0===c.max||t===sY&&0===c.min)return!1;if(!cY(t===aY?c.implicitMax:c.implicitMin,c,t))return!1;const u=o.getStyles(),d=a.label.getStyle();let f=e=>e.data.end.label;s.isStacked&&(f=t===aY?function(e){if(cY(e.data.sumOfNegatives.value,c,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,r=n.chart.formatter(nU.FORMATTER.MINOR);return r?r(t):t}return""}:function(e){if(cY(e.data.sumOfPositives.value,c,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,r=n.chart.formatter(nU.FORMATTER.MINOR);return r?r(t):t}return""});const h={label:f,simplifiedPlacements:CK("outside",0,s.isContinuous),styles:u},p={label:f,simplifiedPlacements:CK("opposite",0,s.isContinuous),styles:u},m=[mY(kg(n,h)),mY(kg(n,p))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y=[{component:`${nU.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:m,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:GN.labels.linkData}}}];return{key:`bar-oob-labels-${t}`,type:"labels",renderer:rA(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:y},animations:{enabled:n.viewModel.animations.enabled,trackBy:GN.labels.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}}}function EK(e){return"all"===e||"title"===e}function DK(e,t,n){if(!EK(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const r=t.alternativeService.getAlternatives(),{actions:i}=t,o=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"dimension-title",renderer:"react-qcm",layout:{minimumLayoutMode:FU[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},data:{infos:t.layoutService.getHyperCubeValue("qDimensionInfo"),alternatives:r.dimensions,filtered:t.layoutService.meta.filteredFields.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize}}}}function TK(e,t,n){if(!EK(e.measureAxis.show))return!1;const r=t.alternativeService.getAlternatives(),{actions:i}=t,o=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"measure-title",renderer:"react-qcm",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},data:{infos:t.layoutService.getHyperCubeValue("qMeasureInfo"),alternatives:r.measures,filtered:t.layoutService.meta.filteredFields.measures},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!i?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"measure"},style:{title:{color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize}}}}function OK({environment:e,rtl:t,refLineModel:n,layoutService:r,colorService:i,dockService:o,themeService:a,viewModel:s,chart:l}){const{theme:c,localeInfo:u}=e,d={resolveUIColor:i.getMain().getPaletteColor},f=a.getStyles(),h=s.animations.enabled;return[eA({refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:h,chart:l,scale:nU.SCALE.MAIN.MINOR,axis:"horizontal"===o.meta.major.orientation?"y":"x",key:nU.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:FU.refLines.minimumLayoutMode}),eA({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,dockService:o,animationsEnabled:h,chart:l,scale:nU.SCALE.MAIN.MAJOR,axis:"horizontal"===o.meta.major.orientation?"x":"y",rtl:t,key:nU.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:nU.COMPONENT.BAR,minimumLayoutMode:FU.refLines.minimumLayoutMode}),...tA({refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:h,dock:o.meta.minor.opposite,scale:nU.SCALE.MAIN.MINOR,style:f,formatter:nU.FORMATTER.MINOR,theme:c,localeInfo:u,rtl:t,key:nU.COMPONENT.MEASURE_REF_LINE_LABEL}),...tA({isDimension:!0,refLineModel:n,layoutService:r,colorModel:d,animationsEnabled:h,dock:o.meta.major.opposite,scale:nU.SCALE.MAIN.MAJOR,style:f,theme:c,localeInfo:u,rtl:t,key:nU.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function NK({dockService:e,layoutService:t,discrete:n,continuousDataModel:r,viewModel:i}){if(!!zA({layoutService:t}).none)return!1;const{rtl:o}=e.config,a="horizontal"===e.meta.chart.orientation,s=!a,{dock:l}=e.meta.major,{show:c}=t.getLayoutValue("dimensionAxis",{}),u="none"!==c;if(s&&u&&"bottom"===l)return!1;if(a&&u){if(!o&&"right"===l)return!1;if(o&&"left"===l)return!1}const d=o?"left":"right";return{type:"space",key:nU.COMPONENT.SPACE,layout:{dock:s?"bottom":d,minimumLayoutMode:"XSMALL"},show:()=>t.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{size:Math.max(6,Math.min(16,Math.floor(.025*e.meta.minor.size)))},animations:{enabled:i.animations.enabled,trackBy:()=>Math.random()}}}function AK({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,context:s,resources:l,viewCache:c}){const u=[],d=o.getLayoutValue("plugins");if(!Array.isArray(d)||0===d.length)return u;!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=ST.generateId)})}(d);const f=[],h=function(e){const t=[];return e.forEach(e=>{e?.type!==t[t.length-1]?.[0]?.type||"point"!==e?.type&&("line"!==e?.type||e?.showPoints||t[t.length-1]?.[0]?.showPoints)?t.push([e]):t[t.length-1].push(e)}),t}(d);return h.forEach((c,d)=>{const h=`points-addon-${d}`,p=`lines-addon-${d}`;switch(c[0]?.type){case"point":u.push(lA({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,mainComponentKey:nU.COMPONENT.BAR,data:c,key:h})),f.push({key:h,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":u.push(function({chart:e,chartModel:t,discreteModel:n,colorService:r,layoutService:i,dockService:o,rtl:a,majorScale:s,minorScale:l,mainComponentKey:c,data:u,key:d,scales:f={}}){if(!Array.isArray(u)||0===u.length)return!1;const h={resolveUIColor:r.getMain().getPaletteColor},p="horizontal"===o.meta.major.orientation,m=!(!p||!a),{canBeContinuous:g,isContinuous:y}=i.meta,v=i.getLayout(),b=CN.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:i}),x=[];u.forEach((e,t)=>{const n=(e?.points??[]).map((n,r)=>({...n,lineId:t,style:0===r?e.style:void 0}));x.push(...n)});const S={},w=[];u.forEach(e=>w.push(...(e?.points??[]).map(e=>e.dimensionValue))),w.forEach(e=>{b[e]&&(S[e]?(S[e].innerValues=b[e].innerValues,S[e].minOrder=Math.min(S[e].minOrder,b[e].minOrder),S[e].maxOrder=Math.max(S[e].maxOrder,b[e].maxOrder),S[e].isMinOrderOk=S[e].isMinOrderOk||b[e].isMinOrderOk,S[e].isMaxOrderOk=S[e].isMaxOrderOk||b[e].isMaxOrderOk):S[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},S[e].numInnerValues=(S[e].maxOrder||0)-(S[e].minOrder||0)+1)});const M=x[0];x.forEach(t=>{const n=aA({point:t,dimensionValueInfo:S,layoutService:i}),r=t?.scale,o=M?.scale,a=i?.meta?.isButterfly,s=i?.meta?.isStacked,l=S[t.dimensionValue]?.dataNode;let c=n;const u=o&&r&&o!==r,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(u)c=function(e,t,n){const r=t.min(),i=t.max(),o=n.min(),a=n.max();return i===r?o:o+(e-r)/(i-r)*(a-o)}(n,f[r]||e.scale(r),f[o]||e.scale(o));else if(d)c=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);c=e.reduce((e,n)=>{const r=n.qNum;return"number"==typeof r&&Math.sign(r)===t?e+r:e},0)}}t.validMeasureValue=c});const k={scale:s,fn:({datum:t})=>{const n=e.scale(s),r=t.value.dimensionValue;return y?n("string"==typeof r?""===r?void 0:+r:r):void 0!==S[r]?CN.getScaledPosition({scale:n,value:S[r].id,valueInfo:S[r],size:e.component(c)?.rect[p?"width":"height"],align:"center",invert:m,layoutService:i,isContinuous:y}):void 0}},C={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:x,settings:{connect:!0,coordinates:{major:p?k:C,minor:p?C:k,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"monotone",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>oA({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:GN.nonUpdatingNode.trackBy,compensateForLayoutChanges:GN.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:n,colorService:r,layoutService:o,dockService:a,rtl:s.rtl,majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,mainComponentKey:nU.COMPONENT.BAR,data:c,key:p})),c.forEach((c,d)=>{if(c?.showPoints&&c?.points){const h=`points-${d}-for-${p}`;u.push(lA({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,mainComponentKey:nU.COMPONENT.BAR,data:c.points,key:h})),f.push({key:h,lines:!0,labels:!0,duplicates:!0})}else c?.points&&f.push({key:p,lines:!0,labels:!1,duplicates:!0,points:c.points})})}}),u.push(function({layoutService:e,dockService:t,chartModel:n,themeService:r,configs:i,cache:o}){const a=e.getLayoutValue("plugins"),{rtl:s}=t.config,{orientation:l}=t.meta.major,{isOneDimensional:c,isStacked:u}=e.meta,d=r.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:rA(),settings:{all:!0,cache:o,configs:i,label:e=>e.value?.label?.value?e.value?.label?.value:u?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<a.length;t++){const n=a[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:c?e.value:e.major?.value,orientation:l,pointValue:e=>e.value?.validMeasureValue,rtl:s},style:d.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:GN.nonUpdatingNode.trackBy,compensateForLayoutChanges:GN.labels.compensateForLayoutChanges}}}({layoutService:o,dockService:a,chartModel:t,themeService:i,configs:f,flags:l.flags,cache:c})),u}const _K=(e,t,n)=>{const{layoutService:r,dockService:i,colorService:o,chart:a,actions:s,discrete:l,continuousDataModel:c,reducedDataModel:u,viewModel:d,viewState:f,viewCache:h,themeService:p,refLineModel:m,pluginService:g,tooltipService:y,rtl:v,logicalSize:b,trendLineModel:x,disclaimerService:S}=t,{localeInfo:w}=n,M=function(e,t){const{disclaimerService:n,themeService:r,translator:i}=e,o=n.getDisclaimer();if(!o)return!1;const{fontFamily:a}=r.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:o.alignment},settings:{isRTL:t,label:i.get(`Object.Disclaimer.${o.key}`)},style:{fontFamily:a}}}(t,v);if(S.getHasSuppressingDisclaimer())return{components:[M]};const k=nK(e,t,{localeInfo:w,rtl:v}),C=!s?.interact?.enabled(),q=o.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:f,chart:a,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:s,navigationDisabled:C}),E=q.components[0];if(E){const{dock:e}=E.layout;if(k.fillRange&&(["right","left"].includes(e)||v)&&(k.fillRange.invert=!0),"legend-seq"===E.type&&void 0!==d.selectionDimensionIdx&&k.fillRange&&k.fillRange.min<k.fillRange.max){const e=t.flags.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Dv({actions:s,bubblesPlacement:"outside",componentKey:"legendRangeBrush",dock:E.layout.dock,eventKey:"legendRange",fillTargets:[E.key],onEdited:()=>{s.select.emit("end","legendRange")},scale:"fillRange",targetFillSelector:'[id="legend-seq-ticks"]',targets:[E.key],targetSelector:'[id="legend-seq-target"]'}):zU({eventName:"legendRange",key:"legendRangeBrush",targets:[E.key],fillTargets:[E.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:E.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{s.select.emit("end","legendRange")}},t);q.components.push(...e.components),q.interactions.unshift(...e.interactions)}}else k.fillRange&&v&&(k.fillRange.invert=!0);const D=((e,{componentKey:t,collectionKey:n})=>{const{layoutService:r,colorService:i,dockService:o,discrete:a,viewModel:s}=e,{meta:l}=r,c=i.getMain().getPaletteColor;let u,d;l.isGroupedByDimension?u=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:l.isGroupedByMeasure&&(u=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let f=2;l.isContinuous?(d={start:"timeStart",end:"timeEnd"},f=tY(e,t)):l.isStacked&&(d="stack");const h=l.isStackedByDimension&&r.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,p=e=>!0===e.datum.null?.value,m=r.getLayoutValue("components",null),g=m?m.filter(e=>e.key===t)[0]:null,y=e=>{const t=e?.minWidthPx;return oN.isNumber(t)?t<=5?0:Math.min(2,t/10):0};return{key:t,type:"box",data:{collection:n},preferredSize:l.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:(()=>{if(h)return 0;if(!l.isContinuous)return 2;const e=r.getLayout(),t=e.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;return t&&"none"!==t?y:0})(),stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:nU.SCALE.MAIN.MAJOR,fn:u,ref:d},minor:{scale:nU.SCALE.MAIN.MINOR},orientation:o.meta.minor.orientation,box:{width:YU({layoutService:r,discrete:a}),minWidthPx:f,fill:i.getMain().getColor(),opacity:e=>p(e)?0:void 0,minHeightPx:function(e){return l.isStacked?.1:p(e)?.01:.3},strokeWidth:g?.style?.strokeWidth?UU.BAR.STROKE.WIDTH[g.style.strokeWidth.toUpperCase()]:UU.BAR.STROKE.WIDTH.NONE,stroke:g?.style?.strokeColor?.color?c(g?.style?.strokeColor):UU.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:s.animations.enabled,isMainComponent:!0,trackBy:GN.bars.trackBy,compensateForLayoutChanges:GN.bars.compensateForLayoutChanges}}})(t,{componentKey:nU.COMPONENT.BAR,collectionKey:nU.COLLECTION.MAIN}),T=((e,{componentKey:t,collectionKey:n})=>{const{meta:r}=e.layoutService;if(!r.isStacked)return!1;let i=2;r.isContinuous&&(i=tY(e,t));const o={key:t,type:"box",data:{collection:n},settings:{major:{scale:nU.SCALE.MAIN.MAJOR},minor:{scale:nU.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:YU({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:i,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>!0===e.data?.null?.value?0:1},inactive:{opacity:e=>!0===e.data?.null?.value?0:.3}}}]}};return r.isContinuous&&(o.settings.major.ref={start:"timeStart",end:"timeEnd"}),o})(t,{componentKey:nU.COMPONENT.STACK_TOTAL_BAR,collectionKey:nU.COLLECTION.STACK_TOTAL}),O=aK(t,n,d.selectionDimensionIdx),{isStacked:N}=r.meta;let A;A=u.mode.isContinuous?nU.COLLECTION.MINI_CONTINUOUS:N?nU.COLLECTION.MINI_STACK:nU.COLLECTION.MINI;const _=N?T:D,I=OY(0,t),L=[...I,dK(t,{barComponent:_,type:"max",isStacked:N}),dK(t,{barComponent:_,type:"min",isStacked:N}),dY(t,{barComponent:_,type:"max",isStacked:N}),dY(t,{barComponent:_,type:"min",isStacked:N}),hY(t,{chart:a,type:"max",collectionKey:N?nU.COLLECTION.STACK_TOTAL:nU.COLLECTION.MAIN}),hY(t,{chart:a,type:"min",collectionKey:N?nU.COLLECTION.STACK_TOTAL:nU.COLLECTION.MAIN}),...WU(e,t,v,!!I[0]),D,T,lK({layoutService:r,viewModel:d,dockService:i}),DK(e,t,v),TK(e,t,v),...OK({environment:n,rtl:v,refLineModel:m,layoutService:r,colorService:o,dockService:i,themeService:p,viewModel:d,chart:a}),VO({viewState:f,viewCache:h,layoutService:r,dockService:i,rtl:v}),NK({dockService:i,layoutService:r,discrete:l,continuousDataModel:c,viewModel:d}),FY(D,t,{collectionKey:A}),FA({layoutService:r,dockService:i,discrete:l,continuousDataModel:c,viewState:f,viewCache:h,themeService:p,rtl:v,deviceType:n.deviceType}),...FW({majorScale:nU.SCALE.MAIN.MAJOR,minorScale:nU.SCALE.MAIN.MINOR,tooltipOverlay:nU.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:r,trendLineModel:x,dockService:i,animationsEnabled:d.animations.enabled}),...q.components,SY({layout:e,component:nU.COMPONENT.BAR,minorScale:k.minor},t,v),kK({layout:e,component:nU.COMPONENT.STACK_TOTAL_BAR},t,v),qK({layout:e,type:"max"},t),qK({layout:e,type:"min"},t),...O.components,...y.getComponents(),!1!==e.showDisclaimer&&M,VW({tooltip:nU.COMPONENT.TREND_LINES_TOOLTIP,formatter:nU.FORMATTER.MINOR},t,{rtl:v}),...AK({chart:a,chartModel:{query:{animationsEnabled:d.animations.enabled}},discreteModel:l,colorService:o,themeService:p,layoutService:r,dockService:i,context:{},resources:t,viewCache:h})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(L);const P=[...q.interactions,...O.gestures].sort((e,t)=>(t.prio||0)-(e.prio||0));return{interactions:PY(t,{rtl:v,hammer:{gestures:P}}),scales:k,palettes:o.getMain().getPalettes(),components:g.extendComponents(L),strategy:mT(0,{logicalSize:b,minCenterRatio:0}),formatters:wY(t,k),collections:wK(0,t)}};function IK({picasso:t,chart:n,services:r,environment:i,viewState:o,viewCache:a,bootstrapped:s}){const{width:l,height:c}=e.useRect(),u=e.useModel(),d=e.useSelections(),f=e.useOptions(),[h,p]=e.useState(),[m,g]=e.useState(),[y,v]=e.useState(),[b,x]=e.useState(),S=e.useApp();function w(){if(!n.layoutComponents)return Promise.resolve();const{discrete:e,layoutService:s,viewModel:l}=r;a.set("isPreRender",!0);const c=function(e={}){const{alternativeService:s,selectionService:l,refLineModel:c,discrete:p,reducedDataModel:m,continuousDataModel:g,trendLineModel:y,pluginService:v,colorService:b,viewModel:x,dockService:w,themeService:M,customTooltipModel:k,layoutService:C,logicalSize:q,styleService:E,disclaimerService:D,tooltipService:T}=r,O=l.custom.getActions(),N=t.data("q")(h.prepPicassoDataSet()),A={picasso:t,ds:N,rtl:"rtl"===f?.direction,model:u,app:S,chart:n,actions:O,localeInfo:i.localeInfo,logicalSize:q,flags:i.flags,translator:i.translator,selections:d,isLocked:l.getIsSelectionLocked,viewCache:a,viewState:o,alternativeService:s,layoutService:C,dockService:w,viewModel:x,colorService:b,selectionService:l,themeService:M,trendLineModel:y,discrete:p,continuousDataModel:g,reducedDataModel:m.model(),customTooltipModel:k,debouncer:nS,refLineModel:c,pluginService:v,styleService:E,disclaimerService:D,tooltipService:T,...e};return _K(C.getLayout(),A,i)}(m);h.extractDataPages(),n.layoutComponents({settings:c,data:y}),a.set("isPreRender",!1),h.insertDataPages(),l.animations.hasSlicedHats=c.components.filter(e=>"box-sliced-hat"===e.type).length>0;const p=[];return 1!==c.components.length&&s.meta.isDiscrete&&p.push(e.command.initialize()),Promise.all(p)}const[[M,k]=[]]=e.usePromise(()=>{if(!(t&&n&&r&&i&&o&&a&&s))return Promise.resolve();const{alternativeService:e,layoutService:l,selectionService:c,refLineModel:u,discrete:d,continuous:f,reducedDataModel:h,continuousDataModel:p,trendLineModel:m,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b,customTooltipModel:S,disclaimerService:w,customTooltipService:M,tooltipService:k}=r;if(!c?.custom?.getActions())return Promise.resolve();const{properties:C}=s,q=C?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);q&&(S.useCustomTooltip=!1);const E=()=>{x(Date.now()),b.animations.isPartialUpdating=!0};o.onChanged("scrollOffset",()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),u&&u.update(),E()}),o.onChanged("legendScrollOffset",E),o.intercept("zoom",f.event.onZoomIntercept({viewCache:a})),o.onChanged("zoom",f.event.onZoomChange({layoutService:l,continuousDataModel:p},E)),c.setLayout(l.getLayout());const D=[];l.meta.isContinuous&&(p.update(l.getLayout()),D.push(p.initialFetch())),m.command.update(),D.push(h.fetch().then(({reducedCube:e})=>{h.update(e)})),M.setProperties(C),k.expando.set("properties",C),w.initialize(),D.push(Promise.resolve({properties:s.properties}));return Promise.all(D).then(t=>Promise.all([v.initialize(),y.initialize(),e.initialize({properties:C}),AU({reducedDataModel:h,layoutService:l,continuousDataModel:p,trendLineModel:m})]).then(e=>[t,e.pop()]))},[s]);e.useEffect(()=>{if(!r?.colorService?.getMain()||!k)return;const{layoutService:e,selectionService:t,reducedDataModel:n,continuousDataModel:o,trendLineModel:s,legendLayoutService:l,colorService:c,viewModel:u}=r;a.set("minorMinMax",k);const d=e.getHyperCube(),f=e.meta.isContinuous?o.getInitialCube():n.model().cube,{field:h}=c.getMain().getSettings(),m=!e.meta.isContinuous&&(n.model().mode.isReduced||e.meta.isStacked)&&l,y=m?l.getHyperCube():void 0;t.setBrushAliases({colorField:h,useLegendCube:m,legendAlias:`legendCube/${h}`});const v=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:r,layoutService:i,viewModel:o,trendLineModel:a}){const s=i.refs.dataPages.split(".").pop();let l=[],c=[];const u=i.meta.isContinuous?[{key:o.fields.majorNumeric,from:i.meta.isStackedByDimension?o.fields.majorStack:o.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:u}}),prepPicassoData(i){const o=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:r,virtualFields:u}},{type:"q",key:"miniCube",data:t,config:{localeInfo:r,virtualFields:u}},...i];return n&&o.push({type:"q",key:"legendCube",data:n,config:{localeInfo:r,virtualFields:u}}),a.query.hasTrendLines()&&o.push({key:"trend",data:a.query.getData()}),o},extractDataPages(){l=e[s],c=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=c}}}({mainCube:d,miniCube:f,legendCube:y,localeInfo:i.localeInfo,layoutService:e,viewModel:u,trendLineModel:s}),b=M[M.length-1];g({localeInfo:i.localeInfo,...b}),p(v)},[k]),e.useEffect(()=>{if(!r||!m||!h)return;const e=r.colorService.getMain();if(!e)return;h.prepPicassoDataSet();const t=h.prepPicassoData(e.getData());v(t)},[m]),e.useEffect(()=>{r?.colorService?.getMain()&&n.update&&h&&y&&w().then(()=>{const{layoutService:e,discrete:t,legendLayoutService:i}=r;if(i){1===e.getLayoutValue("scrollStartPos")&&i.setDataPages([t.query.getCurrentDataPage()])}n.update(),GN.cacheProperties({viewCache:a,layout:e.getLayout()})})},[y]),e.useEffect(()=>{if(!(l&&c&&h&&n?.update&&r?.colorService.getMain()))return;const{viewModel:e}=r;e.animations.isSizeChanging=!0;const{dockService:t,themeService:o}=r;t.update({width:l,height:c}),o.setTheme(i.theme),w().then(()=>{n.update&&n.update()})},[l,c]),e.useEffect(()=>{if(!n?.update)return;const{viewModel:e}=r;n.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1},[b])}const LK=e=>"[object Object]"===Object.prototype.toString.call(e),PK=e=>Array.isArray(e);function RK(e,t){if(e===t)return!0;if(PK(e)){if(!PK(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!RK(e[n],t[n]))return!1;return!0}if(LK(e)){if(!LK(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!RK(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function zK({enable:t=!0}={}){const n=e.useModel(),r=()=>Date.now().toString()+Math.random(),[i,o]=e.useState(r()),a={properties:void 0};return e.useEffect(()=>{if(!n||!n.getEffectiveProperties||!t)return()=>{};const e=()=>{n.getEffectiveProperties().then(e=>{const t=kg(!0,{},e);if(!a.properties)return void(a.properties=t);const n=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=kg(!0,{},e),i=kg(!0,{},t);return n.exclude=!RK(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!RK(r,i),n}(a.properties,t);a.properties=t,n.exclude&&!n.properties&&o(r())})};return n.on("changed",e),e(),()=>{n.removeListener("changed",e)}},[t]),i}function FK({env:t,services:n}){const r=e.useApp(),i=e.useModel(),o=e.useRenderState(),a=zK({enable:!1===n?.layoutService?.meta?.isSnapshot}),[s,l]=e.usePromise(async()=>{if(!t||!n)return Promise.resolve();const{layoutService:e}=n,{isSnapshot:a,isStacked:s,isContinuous:l}=e.meta,c=[];return a||c.push(i.getEffectiveProperties()),Promise.all(c).then(async t=>{const n=t[0]||void 0;if(n?.qHyperCubeDef){const t=e.getLayout(),a=kg(!0,{},n),c=(({properties:e,layout:t,isStacked:n,isContinuous:r,model:i,layoutService:o})=>{const a=t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode),s=t.qHyperCube.qMeasureInfo.filter(e=>7005!==e.qError?.qErrorCode),l=kg(!0,{},e);return((e,t,n)=>{const{color:{mode:r}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===r&&t.length>1?n.color.mode="byMultiple":"byExpression"===r&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&"byExpression"!==r&&(n.color.mode="primary"))})(a,s,e),a.length>1&&n&&!r&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),a.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),i.colorSupport?.colorByUpdater?.(e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:r}=e.color||{};if("byExpression"===r){const r=t.getLayout();if("colorByExpression"===r.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:i,target:o}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:r,target:i}=n.reduce((e,n,r)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=r),void 0!==e.target||t.includes(r)||(e.target=r),e),{current:void 0,target:void 0});return{current:r,target:i}}({properties:e,filtered:n.measures});if(void 0===i)return;const a=e.qHyperCubeDef.qMeasures[i].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[i].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[o].qAttributeExpressions.splice(0,0,a)}}({properties:e,layoutService:o}),!GO.compare(l,e,!0)&&JSON.stringify(l)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)})({properties:n,layout:t,isStacked:s,isContinuous:l,model:i,layoutService:e});if(c)return o.pending(),(e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1)))(t)?i.setProperties(n).then(()=>{r.clearUndoBuffer()}):void await((e,t,n)=>{if(!e)return Promise.resolve();let r=GO.generate(t,n);return kg(!0,t,n),r&&r.length?(r=r.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(r,!0)):Promise.resolve()})(i,a,n);o.restore()}return{properties:n}})},[t,n,a]);if(l&&!l.isHandled)throw l;return s}var jK,BK={exports:{}};var HK=(jK||(jK=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=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 r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(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(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=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 r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(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(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Ne});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];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 r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}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,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=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((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function h(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 v(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 b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=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(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),f=u(r[1],i),h=p(0),m=p(1),g=v(d,h),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const w={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(h(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===S({properties:n,layout:r})},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),r=p(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:h,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},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,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=S({properties:t,layout:n});return s>=i&&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 r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=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});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.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);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k(e){return k="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},k(e)}var C=t().bind(null,!0),q={},E=Array.isArray;function D(e){return null!=e&&!Array.isArray(e)&&"object"===k(e)}function T(e){return void 0===e}function O(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function N(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=T(e[n||t])?o:e[t],e=e[n||t]}}),e}function A(e,t){var n=!0;if(D(e)&&D(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){A(e[r],t[r])||(n=!1)}),n);if(E(e)&&E(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!A(e[r],t[r]))return!1;return!0}return e===t}q.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);A(o,a)||O(t,i)||(T(a)?r.push({op:"add",path:s,value:o}):D(o)&&D(a)?r=r.concat(q.generate(a,o,s)):E(o)&&E(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&T(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(A(t,i))return r;if(!T(t[0])&&T(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(q.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){T(t[i])&&!O(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},q.apply=function(e,t){t.forEach(function(t){var n,r,i=N(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(E(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(E(a)&&E(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return M(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return M(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)?M(e,t):void 0}}(r)||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(D(a)&&D(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!O(n,e)&&delete n[e]}),C(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=N(e,t.from);E(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(E(i)?i.splice(+o,1):delete i[o])})},q.clone=function(e){return C({},e)},q.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},q.updateObject=function(e,t){Object.keys(e).length?q.apply(e,q.generate(e,t)):C(e,t)};const _=q,I=function(e,n,r){if(!e)return Promise.resolve();var i=_.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var L="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function R(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===L)return r;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:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=w.getNumStepComp(n,l),f=w.getAboveComp(n,l,u,d),h=w.getRangeComp("RangeSum",f);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(c,1),m=w.getDimComp(c,0),g=w.getAggrComp(h,p,m);h=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return h},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(R(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(R(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(R(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(R(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(R(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function B(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function H(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=w.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=w.getNumStepComp(r,c),p=w.getAboveComp(r,c,f,h);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var m=w.getRangeComp("RangeSum",p),g=function(e,t){var n=w.getRowNoComp(e,t);if(!w.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:a})){var v=w.getDimComp(u,1),b=w.getDimComp(u,0),x=w.getAggrComp(y,v,b);y=r.showExcludedValues?w.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,V)},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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(H(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(H(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(H(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(H(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=B(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=B(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(H(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(H(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=B(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?w.generateTSDExpression(n,t,r):t},extractInputExpression:w.extractInputExpression,initModifier:function(e,t){w.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=w.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!w.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 r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)return n[r]}function Z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===X)return r;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:w.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=w.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var h=w.getDimComp(c,1),p=w.getDimComp(c,0),m=w.getAggrComp(f,h,p);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Z(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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(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(w.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(w.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return w.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:w.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=w.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(f,"))")}(u,d,n.field,n.value,f,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!w.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(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 r=[{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 r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(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(re(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(re(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,r){return function(e,t,n,r){var i=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===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(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 w.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,he);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,he)?he:fe},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,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",we="qDef.qLabelExpression",Me="qDef.base.qLabel",ke="qDef.base.qLabelExpression",Ce="qDef.qAggrFunc",qe="qDef.base.qAggrFunc",Ee={initBase:function(e,t){(t||Ee.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,Me,o(e,Se)),n(e,ke,o(e,we)))},restoreBase:function(e){Ee.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,Se,o(e,Me)),n(e,we,o(e,ke)),o(e,Ce)&&o(e,qe)&&n(e,Ce,o(e,qe)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const De=Ee;function Te(e){return Te="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},Te(e)}var Oe={accumulation:F,movingAverage:$,difference:ee,normalization:ue,timeSeriesDecomposition:G};const Ne={modifiers:Oe,apply:_e,applyModifiers:Ie,cleanUpMeasure:Le,destroy:function(e){e&&Ae[e.id]&&Ae[e.id].masterItemSubscriber&&(Ae[e.id].masterItemSubscriber&&Ae[e.id].masterItemSubscriber.unsubscribe(),delete Ae[e.id])},hasActiveModifiers:Pe,getActiveModifier:Re,initBase:De.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Oe[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Oe[e]&&Oe[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:ze};var Ae={};function _e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ae[n.id]=Ae[n.id]||{isFirstTime:!0};var c=Ae[n.id].isFirstTime;if(Ae[n.id].isFirstTime=!1,r&&"object"===Te(r))return Ie({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(u,"qHyperCube.qMeasureInfo"),h=Ae[n.id].lastReloadTime;if(Ae[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:n,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||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:f,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);He(r);var i=Qe(r);return Ke({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){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,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Te(e)&&!e.disabled){if(n++,"object"!==Te(Oe[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 r=Oe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Ie({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Te(e.base)})}(f)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Le(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Ie(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),He(i);var f=Qe(i);return et({model:n,libraryIds:f,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Le(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;De.isValid(n)||De.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Te(e)&&!e.disabled){if(s++,"object"!==Te(Oe[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)");Oe[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Oe[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.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,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Oe[r.type].updateModifier&&Oe[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Oe[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,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:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Le(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Le(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===Te(e)&&!e.disabled&&!Oe[e.type]})}(e)?De.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:je(e),properties:n,layout:r})})}function Re(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Oe[r.type]&&!r.disabled)return r}}function ze(e){var t=Re(e);return!t||Oe[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 Be(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function He(e){Fe(e).forEach(function(e){return function(e){var n=Re(e);n&&(void 0!==n.outputExpression&&Be(n)!==e.qDef.qDef?delete e.qDef.base:!De.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ve(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===Te(t)&&(t.disabled||!Oe[t.type]&&Be(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,r=e.layout;return!We(t)&&Ye({modifiers:je(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Te(e)||e.disabled||!Oe[e.type])&&(void 0===i[e.type]&&(i[e.type]=Oe[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ge(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.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 Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):I(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Te(e)&&!e.disabled&&Oe[e.type]&&Oe[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Ze({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ae[t.id].masterItemSubscriber=Ae[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},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(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[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;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return _e({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ae[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](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 r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="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},i(e)}n.d(r,{default:()=>He});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(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,r=new Array(t);n<t;n++)r[n]=e[n];return r}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,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}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,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var f=n(8),h=n.n(f);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=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},b=function(e){e.forEach(function(e){h().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var S=n(909),w=n.n(S);function M(e,t){var n=w()(!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 k(e,t){return w()(!0,{},t,e)}function C(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var q=Math.pow(2,53)-1;function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const T=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},O=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},N=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},A=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}}},_=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},I=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=M(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=M(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},L=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=k(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=k(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=C(a.max,i.dimensions.length,q),l=C(a.min,i.dimensions.length,0);return{maxDimensions:C(o.max,s,q),minDimensions:C(o.min,l,0),maxMeasures:s,minMeasures:l}},R=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=w()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".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)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=w()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=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>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},B=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return E(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 E(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)?E(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),r.dimensions.added(e,n)})}},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return D(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 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.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&h().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,r=e.viewDataMode,i=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:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,f=void 0===d||d,h=e.isHCModifierSupported,p=void 0===h||h,m={qChildren:[]},g=z({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,w=b.maxMeasures,M=b.minMeasures,k=l.defaultDimension,C=void 0===k?A():k,q=l.defaultMeasure,E=void 0===q?_():q;v.qDimensions.length=0,v.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:M})&&j({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:w,minMeasures:M,newHyperCubeDef:v}),I({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:v,defaultDimension:C}),L({exportFormat:t,maxMeasures:w,minMeasures:M,newHyperCubeDef:v,defaultMeasure:E}),B({newProperties:g,dataDefinition:a,hypercubePath:c}),H({newProperties:g,dataDefinition:a,hypercubePath:c}),R({exportFormat:t,newHyperCubeDef:v}),O("qMaxStackedCells",y,v),O("qNoOfLeftDims",y,v),N("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),N("qMode",y,v,"S"),N("qReductionMode",y,v,"N"),N("qSortbyYValue",y,v),N("qIndentMode",y,v),N("qShowTotalsAbove",y,v),T(g,t,r),m.qProperty=g;var D=o.getValue(u||{},"support.modifiers");return V({measures:v.qMeasures,modifierTypes:D}),f&&$(m.qProperty,"storedFilters"),"S"===v.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,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function K(e,t){return e.length!==t}const G={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,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,r,i),K(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"}},X={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}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.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 X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=G.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 re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var h=G.create(G.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:h,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:h,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f})}n?(h.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(h)):l.qAttributeExpressions.push(h)}}}function ie(e,t,n,r){var i,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":i=function(e,t){return t?e.qLibraryId:h().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return h().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),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,r){var i=t.type,o=e.color,a=o.mode,s=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key: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)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=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"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=G.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,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 r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=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"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=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"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=G.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},he=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.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,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",c),G.moveByIdFromGroup(a,[],"qAttributeExpressions",c),G.moveByIdFromGroup(s,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,f=o.getValue(d,"visualization"),h=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,f),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:h});return g[p]?he({shouldUpdateColorBy:y,properties:d})&&pe(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(h),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||w()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||w()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.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:r})){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,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].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]&&w()(s,n.properties.measureAxes[t[0].axis])):w()(s,n.properties.measureAxes[0])}},Se=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}}},we={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=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:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function Me(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function ke(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Me(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ce(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Me(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var qe="qHyperCubeDef.qMeasures",Ee="conditionalColoring",De="measures",Te="qDef.conditionalColoring";const Oe={quarantine:function(e){ke({properties:e,arrayPath:qe,quarantineName:Ee,arrayName:De,itemPath:Te})},unquarantine:function(e){Ce({properties:e,arrayPath:qe,itemPath:Te,arrayName:De,quarantineName:Ee})}};var Ne="qHyperCubeDef.qMeasures",Ae="measures",_e="qHyperCubeDef.qDimensions",Ie="dimensions",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const Be={quarantine:function(e){ke({properties:e,arrayPath:Ne,quarantineName:je,arrayName:Ae,itemPath:Fe}),ke({properties:e,arrayPath:_e,quarantineName:je,arrayName:Ie,itemPath:Fe})},unquarantine:function(e){Ce({properties:e,arrayPath:Ne,quarantineName:je,arrayName:Ae,itemPath:Fe}),Ce({properties:e,arrayPath:_e,quarantineName:je,arrayName:Ie,itemPath:Fe})},quarantineAlternative:function(e){ke({properties:e,arrayPath:Le,quarantineName:je,arrayName:Pe,itemPath:Fe}),ke({properties:e,arrayPath:Re,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){Ce({properties:e,arrayPath:Le,quarantineName:je,arrayName:Pe,itemPath:Fe}),Ce({properties:e,arrayPath:Re,quarantineName:je,arrayName:ze,itemPath:Fe})}},He={hypercube:W,colorChart:ye,axisChart:we,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:ke,unquarantineArrayProp:Ce,conditionalColoring:Oe,conditionalShow:Be}})(),r.default})()}(BK)),BK.exports),VK=mg(HK);function $K(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter(e=>e.qError?.qErrorCode!==T$).length,r=t.layout.qHyperCube.qDimensionInfo.filter(e=>e.qError?.qErrorCode!==T$).length,i=e.dimensionAxis.maxVisibleItems;i<1?e.dimensionAxis.maxVisibleItems=10:i>1e4/(r+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(i,Math.floor(1e4/(r+n))))}}const WK=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],UK=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function YK(e,t,n){const r=function(e){var t=e.theme,n=e.translator,r=e.config,i=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?Iv:"".concat(Iv,".").concat(r),paths:Array.isArray(i)?i:[]}}({config:void 0===r?{}:r}),o=i.id,a=i.paths,s={};a.forEach(function(e){var r=e.split(".");Uv(r);for(var i=s,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=Hv({theme:t,translator:n,id:o,path:e}):void 0===i[l]&&(i[l]={}),i=i[l]}});var l=function(e){var t=e.split(".");Uv(t);for(var n=s,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return s.getDefaultValue=function(e){return l(e).getDefaultValue()},s.getOptions=function(e){return l(e).getOptions()},s}({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:t?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(WK).map(e=>WK[e]),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:r}=n,{barGrouping:i,qHyperCubeDef:o}=r,a=o.qMeasures.length,s=o.qDimensions.length,l="grouped"===i.grouping&&s>0&&a+s>2;return CT.continuous({properties:r})?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:UK("axis.title",r,e)}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:UK("axis.label.name",r,e)}}},labelSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...UK("label.value",r,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:UK("legend.title",r,e)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:UK("legend.label",r,e)}}}:void 0}}}function KK(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(WK).map(e=>WK[e]),schemaIgnore:!0,defaultValue:WK[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!CT.continuous({layout:t.layout}),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>((e,t)=>{const n=t.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==T$).length,r=t.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==T$).length,i="grouped"===e.barGrouping?.grouping&&r>0&&n+r>2;return CT.continuous({layout:t})?1:i?.9:.7})(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(IA.OPTIONS).map(e=>IA.OPTIONS[e]),schemaIgnore:!0,defaultValue:IA.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}function GK(e,t,n,r=!1){return r?KK(t):YK(e,t,n)}const XK=e=>e.qError?.qErrorCode!==T$,JK=(e,t)=>e?.qHyperCube[t].filter(e=>XK(e)),ZK=e=>{if(!e)return!1;const t=kg(!0,{},e);return t.qHyperCube.qMeasureInfo=JK(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=JK(e,"qDimensionInfo"),t&&!CT.continuous({layout:t})&&CT.stacked(t)},QK=({translator:e,flags:t,anything:n})=>{const r={type:"items",show:EA,items:{period:{translation:CA,type:"string",component:"dropdown",ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.period",show:EA,globalChange:OA,options:[{value:NA.AUTO,translation:qA.AUTO},{value:NA.SECONDS,translation:qA.SECONDS},{value:NA.MINUTES,translation:qA.MINUTES},{value:NA.HOURS,translation:qA.HOURS},{value:NA.DAYS,translation:qA.DAYS},{value:NA.WEEKS,translation:qA.WEEKS},{value:NA.MONTHS,translation:qA.MONTHS},{value:NA.YEARS,translation:qA.YEARS},{value:NA.NUMBER,translation:qA.NUMBER},{value:NA.NONE,translation:qA.NONE}],undefinedValue:NA.NONE,defaultValue:NA.AUTO,schemaIgnore:!0},stepSize:{translation:qA.TITLE,type:"number",defaultValue:AA,schemaIgnore:!0,show:DA,ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.stepSize",min:Number.EPSILON,rollbackInvalid:!0}}},i=n?.sense?.isUnsupportedFeature?.("continuousData"),o={items:{labels:{items:{header:{show:(e,t,n)=>JK(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!ZK(t.layout)&&JK(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>ZK(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showSegmentLabels,set(e,t,n,r,i){i.dataPoint.showSegmentLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>ZK(t.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.showLabels&&r.dataPoint.showTotalLabels,set(e,t,n,r,i){i.dataPoint.showTotalLabels=e,i.dataPoint.showLabels=i.dataPoint.showSegmentLabels||i.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>JK(n.layout,"qDimensionInfo").length&&JK(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>JK(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},a=n?.sense?.theme,s={uses:"settings",items:{simpleStyling:GK(a,t,e,!0),simpleLabels:o,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{stylingPanel:GK(a,t,e,!1),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return rU({layout:t.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=JK(t.layout,"qMeasureInfo").length,r=JK(t.layout,"qDimensionInfo").length;return r>0&&n+r>2},globalChange(e,t,n){"butterfly"!==e.barGrouping.grouping||rU({layout:n.layout})||(e.barGrouping.grouping="stacked"),"butterfly"===e.barGrouping.grouping&&e.measureAxis&&"max"!==e.measureAxis.minMax&&!e.measureAxis.autoMinMax&&(e.measureAxis.minMax="max")},change(e,t,n){"butterfly"!==e.barGrouping.grouping||rU({layout:n.layout})||(e.barGrouping.grouping="stacked"),JK(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>CT.continuous({layout:n.layout}),convertFunctions:{get(e,t,n){const r="stacked";return"butterfly"===e(t.type)?rU({layout:n.layout})?e(t.type):r:CT.continuous({layout:n.layout})?r:e(t.type)},set(e,t,n){const r=TT(n.type,n);t(n.type,e,r)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>CT.continuous({layout:n.layout}),convertFunctions:(l="vertical",{get:(e,t,n)=>CT.continuous({layout:n.layout})?l:e(t.type),set(e,t,n){const r=TT(n.type,n);t(n.type,e,r)}})},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(IA.OPTIONS).map(e=>IA.OPTIONS[e]),defaultValue:IA.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!CT.continuous({layout:n.layout})}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get(ZK(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&ZK(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&ZK(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:iA}},legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,t,n)=>!CT.continuous({layout:n.layout}),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const r=JK(n.layout,"qMeasureInfo").length,i=JK(n.layout,"qDimensionInfo").length,o=e.dimensionAxis.maxVisibleItems;return o<0||o>1e4/(i+r)},globalChange:$K,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null,continuousDimension:r},show:!i},othersGroup:{items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};var l;return s.items.measureAxis={uses:"axis.flippableMeasureAxis",items:{minMax:{items:{minMax:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&!e.measureAxis.autoMinMax},min:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&["min","minMax"].includes(e.measureAxis.minMax)&&!e.measureAxis.autoMinMax},max:{invalid:e=>e.measureAxis&&"minMax"===e.measureAxis.minMax?e.measureAxis.min>=e.measureAxis.max:!(!e.measureAxis||"max"!==e.measureAxis.minMax||"butterfly"!==e.barGrouping.grouping)&&e.measureAxis.max<=0}}}}},s},eG={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){FO(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i}=e.qHyperCubeDef,{qCardinal:o}=t.layout.qHyperCube.qDimensionInfo[0],a=i.length,s=[...Array(a).keys()];1===n.length&&r.length>=1&&o>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},tG=({translator:e,flags:t})=>({type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"},plugins:xA({translator:e,pluginOptions:[{value:"point",translation:e.get("Visualizations.Descriptions.Point")},{value:"line",translation:e.get("Visualizations.Descriptions.Line")}],supportNewStyles:t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")})}}),nG=({translator:e,anything:t})=>({uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,n,r){if(t?.sense?.isUnsupportedFeature?.("includeZeroValues"))return!1;const i=((e,t)=>{const n=t.layout?.qHyperCube?.qDimensionInfo?.findIndex(e=>XK(e));return t.properties?.qHyperCubeDef?.qDimensions?.[n]===e})(e,n),o=CT.continuous({layout:r.layout});return!(i&&o)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},period:{type:"string",defaultValue:"auto",ref:"qDef.continuous.period",show:!1}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},trendLines:t?.sense?.isUnsupportedFeature?.("trendlines")?void 0:KW({translator:e,allowStackedByDimension:!0})}}}});function rG({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:nG({translator:e,anything:n}),sorting:eG,addons:tG({translator:e,flags:t}),settings:QK({translator:e,flags:t,anything:n})}}}const iG=e=>e.qError?.qErrorCode!==T$;function oG({flags:e}){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const r=n.qHyperCube.qMeasureInfo.length,i=n.qHyperCube.qDimensionInfo.filter(e=>iG(e)).length;return 1===r&&2===i&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return rU({layout:t?.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=t.qHyperCube.qMeasureInfo.filter(e=>iG(e)).length,r=t.qHyperCube.qDimensionInfo.filter(e=>iG(e)).length;return n+r>2&&!CT.continuous({layout:t})&&(i=t,!(i?.qHyperCube?.qDimensionInfo?.filter(e=>iG(e)).length>1&&i?.qHyperCube?.isHCEnabled));var i},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!CT.continuous({layout:t})}}},color:{uses:"color"}}}}function aG(e){const t={},n=Jx(e,"components"),r=Jx(e,"dimensionAxis.axisDisplayMode"),i=Jx(e,"dimensionAxis.maxVisibleItems"),o=n?n.filter(e=>"bar"===e.key)[0]:void 0,a=Jx(e,"tooltip");if(o&&o.style&&Object.keys(o.style).forEach(e=>{t[`chart_style_${e}`]=o.style[e]}),i&&(t.chart_dimaxis_maxVisibleItems=i),r&&(t.chart_dimaxis_axisDisplayMode=r),a){t.chart_tooltip_custom=!a.auto;const e=Jx(a,"chart.object.refId");!a.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const sG=e=>!!(e&&e.qHyperCube.qSize.qcy>0),lG={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function cG(){const e=[];return Object.keys(lG).forEach(t=>{e.push(lG[t])}),e}function uG(e){return{definition:rG(e),softDefinition:oG(e),support:{snapshot:sG,export:sG,exportData:!0,sharing:sG,viewData:!0,effects:!0,modifiers:cG()},importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=VK.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:z$(e),defaultPropertyValues:a,hypercubePath:i,extension:r}),l=s.qProperty;return l.qHyperCubeDef.qDimensions.length>1&&"stacked"===l.barGrouping.grouping&&(l.qHyperCubeDef.qMode="K",l.qHyperCubeDef.qAlwaysFullyExpanded=!0),VK.conditionalShow.unquarantine(l),VK.conditionalShow.unquarantineAlternative(l),s},exportProperties:(e,t,n)=>{VK.conditionalShow.quarantine(e.qProperty),VK.conditionalShow.quarantineAlternative(e.qProperty);return VK.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(FO),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(FO)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:r,showMiniChartForContinuousAxis:i}=e;if(t||!1!==i)return;const{continuousAuto:o}=n;(o||!o&&r)&&(e.scrollbar=IA.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:aG}}return function(t){const n=r$();return{qae:F$(t),ext:uG(t),component(){const r=B$({env:t}),{viewState:i,viewCache:o}=H$(),a=function({picasso:t}){const n=e.useElement(),r=e.useOptions(),[i,o]=e.useState();return e.useEffect(()=>{if(!t)return()=>{};n.style.overflow="hidden";const e=t({renderer:{prio:[r?.renderer||"canvas"]}}).chart({element:n,data:[],settings:{}});o(e);const{destroy:i}=e;return()=>{i()}},[r.renderer]),i}({picasso:n}),s=fU({picasso:n,chart:a,environment:r,viewState:i,viewCache:o}),l=FK({env:t,services:s});IK({picasso:n,chart:a,services:s,environment:r,viewState:i,viewCache:o,bootstrapped:l}),(({environment:t,services:n,chart:r,viewState:i,bootstrapped:o})=>{e.onTakeSnapshot(e=>{if(!t||!n||!o)return;const{layoutService:a,dockService:s,colorService:l,discrete:c,continuousDataModel:u,reducedDataModel:d}=n,{width:f,height:h}=s.meta.chart.size;if(e.snapshotData=e.snapshotData||{},e.snapshotData.content={size:{w:f,h:h}},a.meta.isSnapshot)return Promise.resolve();e.snapshotData.content.chartData={scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:qT(r,nU.COMPONENT.LEGEND_COLOR_CAT)};const{properties:p}=o,m=p?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return m&&(e.tooltip.auto=!0),a.meta.isDiscrete?(c.command.setSnapshotData(e),d.setSnapshotData(e)):u.setSnapshotData(e),l.getMain().getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}),e.useImperativeHandle(()=>({getViewState(){if(i&&r)return{scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:qT(r,nU.COMPONENT.LEGEND_COLOR_CAT)}}}),[i,r])})({environment:r,services:s,chart:a,viewState:i,bootstrapped:l})}}}});