@nebula.js/sn-histogram 0.35.0 → 0.35.1

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,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-histogram v0.35.0
2
+ * @nebula.js/sn-histogram v0.35.1
3
3
  * Copyright (c) 2024 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -21,9 +21,9 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.le
21
21
  * http://hammerjs.github.io/
22
22
  *
23
23
  * Copyright (c) 2016 Jorik Tangelder;
24
- * Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,u=Math.abs,d=Date.now;function h(e,t,n){return setTimeout(v(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function g(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=g((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),y=g((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function b(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return typeof e==l?e.apply(t&&t[0]||i,t):e}function w(e,t){return e===i?t:e}function M(e,t,n){p(q(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){p(q(t),(function(t){e.removeEventListener(t,n,!1)}))}function _(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function q(e){return e.trim().split(/\s+/g)}function D(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function E(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];D(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function A(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var T=1;function N(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,O=A(t,"PointerEvent")!==i,I=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),P="touch",L="mouse",j=25,F=1,z=4,H=8,B=1,V=2,$=4,W=8,U=16,Y=V|$,K=W|U,X=Y|K,G=["x","y"],J=["clientX","clientY"];function Z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){x(e.options.enable,[e])&&n.handler(t)},this.init()}function Q(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=t&F&&r-o==0,a=t&(z|H)&&r-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=ee(t));o>1&&!n.firstMultiple?n.firstMultiple=ee(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,c=t.center=te(r);t.timeStamp=d(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=oe(l,c),t.distance=ie(l,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==F&&o.eventType!==z||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=re(t.deltaX,t.deltaY);var h=ne(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=u(h.x)>u(h.y)?h.x:h.y,t.scale=a?function(e,t){return ie(t[0],t[1],J)/ie(e[0],e[1],J)}(a.pointers,r):1,t.rotation=a?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=H&&(l>j||a.velocity===i)){var c=t.deltaX-a.deltaX,d=t.deltaY-a.deltaY,h=ne(l,c,d);r=h.x,o=h.y,n=u(h.x)>u(h.y)?h.x:h.y,s=re(c,d),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;_(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ee(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:d(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:c(n/t),y:c(r/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function re(e,t){return e===t?B:u(e)>=u(t)?e<0?V:$:t<0?W:U}function ie(e,t,n){n||(n=G);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function oe(e,t,n){n||(n=G);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(N(this.element),this.evWin,this.domHandler)}};var se={mousedown:F,mousemove:2,mouseup:z},ae="mousedown",le="mousemove mouseup";function ce(){this.evEl=ae,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}b(ce,Z,{handler:function(e){var t=se[e.type];t&F&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=z),this.pressed&&(t&z&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:L,srcEvent:e}))}});var ue={pointerdown:F,pointermove:2,pointerup:z,pointercancel:H,pointerout:H},de={2:P,3:"pen",4:L,5:"kinect"},he="pointerdown",fe="pointermove pointerup pointercancel";function pe(){this.evEl=he,this.evWin=fe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(he="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),b(pe,Z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=ue[r],o=de[e.pointerType]||e.pointerType,s=o==P,a=D(t,e.pointerId,"pointerId");i&F&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):i&(z|H)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var ge={touchstart:F,touchmove:2,touchend:z,touchcancel:H};function me(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function ye(e,t){var n=E(e.touches),r=E(e.changedTouches);return t&(z|H)&&(n=C(n.concat(r),"identifier",!0)),[n,r]}b(me,Z,{handler:function(e){var t=ge[e.type];if(t===F&&(this.started=!0),this.started){var n=ye.call(this,e,t);t&(z|H)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}}});var be={touchstart:F,touchmove:2,touchend:z,touchcancel:H},ve="touchstart touchmove touchend touchcancel";function xe(){this.evTarget=ve,this.targetIds={},Z.apply(this,arguments)}function we(e,t){var n=E(e.touches),r=this.targetIds;if(t&(2|F)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=E(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return _(e.target,l)})),t===F)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(z|H)&&delete r[s[i].identifier],i++;return a.length?[C(o.concat(a),"identifier",!0),a]:void 0}b(xe,Z,{handler:function(e){var t=be[e.type],n=we.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}});var Me=2500;function ke(){Z.apply(this,arguments);var e=v(this.handler,this);this.touch=new xe(this.manager,e),this.mouse=new ce(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function _e(e,t){e&F?(this.primaryTouch=t.changedPointers[0].identifier,Se.call(this,t)):e&(z|H)&&Se.call(this,t)}function Se(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),Me)}}function qe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}b(ke,Z,{handler:function(e,t,n){var r=n.pointerType==P,i=n.pointerType==L;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)_e.call(this,t,n);else if(i&&qe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var De=A(a.style,"touchAction"),Ee=De!==i,Ce="compute",Ae="auto",Te="manipulation",Ne="none",Re="pan-x",Oe="pan-y",Ie=function(){if(!Ee)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function Pe(e,t){this.manager=e,this.set(t)}Pe.prototype={set:function(e){e==Ce&&(e=this.compute()),Ee&&this.manager.element.style&&Ie[e]&&(this.manager.element.style[De]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){x(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,Ne))return Ne;var t=S(e,Re),n=S(e,Oe);if(t&&n)return Ne;if(t||n)return t?Re:Oe;if(S(e,Te))return Te;return Ae}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=S(r,Ne)&&!Ie[Ne],o=S(r,Oe)&&!Ie[Oe],s=S(r,Re)&&!Ie[Re];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&n&Y||s&&n&K?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Le=1,je=32;function Fe(e){this.options=o({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=Le,this.simultaneous={},this.requireFail=[]}function ze(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function He(e){return e==U?"down":e==W?"up":e==V?"left":e==$?"right":""}function Be(e,t){var n=t.manager;return n?n.get(e):e}function Ve(){Fe.apply(this,arguments)}function $e(){Ve.apply(this,arguments),this.pX=null,this.pY=null}function We(){Ve.apply(this,arguments)}function Ue(){Fe.apply(this,arguments),this._timer=null,this._input=null}function Ye(){Ve.apply(this,arguments)}function Ke(){Ve.apply(this,arguments)}function Xe(){Fe.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ge(e,t){return(t=t||{}).recognizers=w(t.recognizers,Ge.defaults.preset),new Je(e,t)}Fe.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Be(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Be(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===D(t,e=Be(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Be(e,this);var t=D(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+ze(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+ze(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=je},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(je|Le)))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!x(this.options.enable,[this,t]))return this.reset(),void(this.state=je);56&this.state&&(this.state=Le),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},b(Ve,Fe,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(n&H||!i)?16|t:r||i?n&z?8|t:2&t?4|t:2:je}}),b($e,Ve,{defaults:{event:"pan",threshold:10,pointers:1,direction:X},getTouchAction:function(){var e=this.options.direction,t=[];return e&Y&&t.push(Oe),e&K&&t.push(Re),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&Y?(i=0===o?B:o<0?V:$,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?B:s<0?W:U,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ve.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(We,Ve,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Ue,Fe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(z|H)&&!i)this.reset();else if(e.eventType&F)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&z)return 8;return je},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&z?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Ye,Ve,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(Ke,Ve,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&e.eventType&z},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(Xe,Fe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&F&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=z)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||ie(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return je},failTimeout:function(){return this._timer=h((function(){this.state=je}),this.options.interval,this),je},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ge.VERSION="2.0.7",Ge.defaults={domEvents:!1,touchAction:Ce,enable:!0,inputTarget:null,inputClass:null,preset:[[Ye,{enable:!1}],[We,{enable:!1},["rotate"]],[Ke,{direction:Y}],[$e,{direction:Y},["swipe"]],[Xe],[Xe,{event:"doubletap",taps:2},["tap"]],[Ue]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Je(e,t){var n;this.options=o({},Ge.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?pe:I?xe:R?ke:ce))(n,Q),this.touchAction=new Pe(this,this.options.touchAction),Ze(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ze(e,t){var n,r=e.element;r.style&&(p(e.options.cssProps,(function(i,o){n=A(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Je.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Fe)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=D(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return p(q(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(q(e),(function(e){t?n[e]&&n[e].splice(D(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Ge,{INPUT_START:F,INPUT_MOVE:2,INPUT_END:z,INPUT_CANCEL:H,STATE_POSSIBLE:Le,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:je,DIRECTION_NONE:B,DIRECTION_LEFT:V,DIRECTION_RIGHT:$,DIRECTION_UP:W,DIRECTION_DOWN:U,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:K,DIRECTION_ALL:X,Manager:Je,Input:Z,TouchAction:Pe,TouchInput:xe,MouseInput:ce,PointerEventInput:pe,TouchMouseInput:ke,SingleTouchInput:me,Recognizer:Fe,AttrRecognizer:Ve,Tap:Xe,Pan:$e,Swipe:Ke,Pinch:We,Rotate:Ye,Press:Ue,on:M,off:k,each:p,merge:y,extend:m,assign:o,inherit:b,bindFn:v,prefixed:A}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Ge,"function"==typeof i&&i.amd?i((function(){return Ge})):e.exports?e.exports=Ge:t.Hammer=Ge}(window,document)}(Em);var Cm=n(Em.exports);function Am(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var Tm={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function Nm(e){const t=jp();return t.renderer.prio([e||"canvas"]),t.use(_m),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",Dm(e))};e.interaction("hammer",Dm(Hammer))}(Cm)),t.use(Am),t.component("disclaimer",Tm),t}const Rm={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"}}]};var Om={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=u(d,n),d!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(d,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=u(d,n),d!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(d,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[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},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+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 s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];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 h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=y(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),h=u(r[1],i),f=p(0),g=p(1),m=y(d,f),b=y(h,g);return"".concat(s,"({1<").concat(m,",").concat(b,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function v(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=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(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var d=p(0),h=p(1);return"If(Count(".concat(d,") * Count(").concat(h,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:h,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return h(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(r)},getFunctionPrefix:v,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return v(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;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({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],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.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,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),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,"]")}};function M(e){return(M="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})(e)}var k=i.a.bind(null,!0),_={},S=Array.isArray;function q(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function D(e){return void 0===e}function E(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function C(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]=D(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(q(e)&&q(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(S(e)&&S(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}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?k({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);A(o,s)||E(t,i)||(D(s)?r.push({op:"add",path:a,value:o}):q(o)&&q(s)?r=r.concat(_.generate(s,o,a)):S(o)&&S(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&D(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(!D(t[0])&&D(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(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}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){D(t[i])&&!E(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},_.apply=function(e,t){t.forEach((function(t){var n,r=C(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(S(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var a,l=t.value.slice();o.length=0,(a=o).push.apply(a,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(q(o)&&q(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!E(n,e)&&delete n[e]})),k(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var c=C(e,t.from);S(r)?r.splice(+i,0,c.splice(+s,1)[0]):(r[i]=c[s],delete c[s])}else"remove"===t.op&&(S(r)?r.splice(+i,1):delete r[i])}))},_.clone=function(e){return k({},e)},_.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},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):k(e,t)};var T=_,N=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!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()},R="accumulation";function O(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function I(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===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={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,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=w.getNumStepComp(n,l),h=w.getAboveComp(n,l,u,d),f=w.getRangeComp("RangeSum",h);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(c,1),g=w.getDimComp(c,0),m=w.getAggrComp(f,p,g);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,P)},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(I(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(I(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(I(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(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=O(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=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(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(R))return!1;var o=O(t,e);return o&&!o.disabled}};return n}},j="movingAverage";function F(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]}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 H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={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,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,h=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),f=w.getNumStepComp(r,c),p=w.getAboveComp(r,c,h,f);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var g=w.getRangeComp("RangeSum",p),m=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(g," / ").concat(m)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var b=w.getDimComp(u,1),v=w.getDimComp(u,0),x=w.getAggrComp(y,b,v);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,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!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.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(z(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(z(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(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=F(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=F(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(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=F(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function W(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===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={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,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=w.getAboveComp(n,l,u),h="".concat(u," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),g=w.getAggrComp(h,f,p);h=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return h},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[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(W(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(W(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(W(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(V))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},K={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},X={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)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===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:X.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:X.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:X.DISREGARD_ALL_DIMENSIONS,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,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:K.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:K.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:K.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:X.DISREGARD_ALL_DIMENSIONS,selectionScope:K.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function se(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var ae={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,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,h=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=re(t),l=ie(t,n,r),c=""===a&&""===l?"":a||l,u=oe(i,o),d=se(i,o,s),h=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(h,"))")}(u,d,n.field,n.value,h,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[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(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(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 J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(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(J(t,e).dimensionalScope||0)===X.ONE_DIMENSION&&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(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:se},le={getExpression:function(e){return s(e,"qDef.base.qDef")||s(e,"qDef.qDef")},getExpressionRef:function(e){return s(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return s(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return s(e,"qDef.base.qLibraryId")||s(e,"qLibraryId")},getLabelRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ce={initBase:function(e,t){(t||ce.isValid(e))&&(o(e,"qDef.base.qDef",s(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",s(e,"qLibraryId")),o(e,"qDef.base.qLabel",s(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",s(e,"qDef.qLabelExpression")))},restoreBase:function(e){ce.isValid(e)&&(o(e,"qDef.qDef",s(e,"qDef.base.qDef")),o(e,"qLibraryId",s(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",s(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",s(e,"qDef.base.qLabelExpression")),s(e,"qDef.qAggrFunc")&&s(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",s(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=s(e,"qDef.base.qDef"),n=s(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ue=ce;function de(e){return(de="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})(e)}var he={accumulation:L,movingAverage:B,difference:Y,normalization:ae},fe=(t.default={modifiers:he,apply:pe,applyModifiers:ge,cleanUpMeasure:me,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:be,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return he[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return he[e]&&he[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);Ee({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Re({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:ve},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,a=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===de(n))return ge({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var d=s(c,"qHyperCube.qMeasureInfo"),h=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:d,layout:c})){var f=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 De({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:c,model:t,lastReloadTime:h});return f||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 Ee({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);ke(n);var r=Oe(n);return Ce({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(De({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(he[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=he[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),ge({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Oe(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return me(e)})),Ne({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),ke(r);var h=Oe(r);return Ie({model:t,libraryIds:h,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return me(e)})),Promise.resolve();var l=o?void 0:Oe(n);return Ce({model:r,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ee({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,a=0;ue.isValid(t)||ue.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===de(e)&&!e.disabled){if(a++,"object"!==de(he[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)");he[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=he[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||s.qMeasure.qLabel)&&(t.qDef.qLabel=s.qMeasure.qLabel),(t.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=s.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(t.qDef.qNumFormat=s.qMeasure.qNumFormat,t.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=s.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof he[n.type].updateModifier&&he[n.type].updateModifier(n,r.qHyperCubeDef);var s=le.getExpression(t),a=he[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=a,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||s,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||ve(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ve(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}),_e(t)):me(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:u,dimensionAndFieldList:d}).then((function(){return l?Ne({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function me(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!he[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,_e(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ee({modifiers:we(e),properties:n,layout:r})}))}function be(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(he[r.type]&&!r.disabled)return r}}function ve(e){var t=be(e);return!t||he[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Me(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function ke(e){xe(e).forEach((function(e){return function(e){var t=be(e);t&&(void 0!==t.outputExpression&&Me(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function _e(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!he[t.type]&&Me(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function qe(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function De(e){var t=e.measure,n=e.properties,r=e.layout;return!qe(t)&&Ee({modifiers:we(t),properties:n,layout:r})}function Ee(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!he[e.type])&&(void 0===i[e.type]&&(i[e.type]=he[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ce(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 s=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(s),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ne(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);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):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&he[e.type]&&he[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Oe(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(Ee({modifiers:r,properties:e})){var o=qe(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[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(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,s=e.dimensionLibraryIds,a=[];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:s}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=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)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}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})(e)}n.r(t);var 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 s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}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 r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(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 a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(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 a(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}var 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},h=n(1),f=n.n(h),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder: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())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude: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},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function g(e,t,n){var r,i,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}var m=n(0),y=n.n(m);function b(e,t){var n=y()(!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 v(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function M(e){return function(e){if(Array.isArray(e))return k(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 k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(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 _(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}var q={importCommonProperties: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},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension: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}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=b(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=b(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=v(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=v(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=x(s.max,i.dimensions.length,w),l=x(s.min,i.dimensions.length,0);return{maxDimensions:x(o.max,a,w),minDimensions:x(o.min,l,0),maxMeasures:a,minMeasures:l}},setInterColumnSortOrder: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))},createNewProperties: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=y()(!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=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=M(i.qDimensions);i.qDimensions=[],s.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=_(i.qMeasures);i.qMeasures=[],s.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function D(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)}var E={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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:s}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(g(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(g(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(g(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,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,h=void 0===d||d,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=q.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,b=o.getValue(m,c||"").qHyperCubeDef,v=q.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=v.maxDimensions,w=v.minDimensions,M=v.maxMeasures,k=v.minMeasures,_=l.defaultDimension,S=void 0===_?q.getDefaultDimension():_,E=l.defaultMeasure,C=void 0===E?q.getDefaultMeasure():E;b.qDimensions.length=0,b.qMeasures.length=0,q.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k})&&q.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:b}),q.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:b,defaultDimension:S}),q.addMeasures({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:b,defaultMeasure:C}),q.updateDimensionsOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),q.updateMeasuresOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),q.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:b}),q.copyPropertyIfExist("qMaxStackedCells",y,b),q.copyPropertyIfExist("qNoOfLeftDims",y,b),q.copyPropertyOrSetDefault("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),q.copyPropertyOrSetDefault("qMode",y,b,"S"),q.copyPropertyOrSetDefault("qReductionMode",y,b,"N"),q.copyPropertyOrSetDefault("qSortbyYValue",y,b),q.copyPropertyOrSetDefault("qIndentMode",y,b),q.copyPropertyOrSetDefault("qShowTotalsAbove",y,b),q.importCommonProperties(m,t,r),g.qProperty=m;var A=o.getValue(u||{},"support.modifiers");return q.restoreMeasuresModifiers({measures:b.qMeasures,modifierTypes:A}),h&&D(g.qProperty,"storedFilters"),"S"===b.qMode&&p&&D(g.qProperty,"dynamicScript"),g}},C={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var N={create:function(e,t){if(!e||!C[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 s=e[o][n],a=t.length;if(A(s,t,r,i),T(t,a))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"}},R={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}},O={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:I,"sn-scatter-plot":I,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.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 R.getNumDimensions(e)>=1}}}};function L(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 j(e,t){var n=N.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function F(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function z(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;j(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"),h=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=N.create(N.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,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=i,a.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.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 a}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(F(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:n||a,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=s)}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("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=N.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!s,s||r)),!!s}function W(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"),[]),s=o.getValue(e,"color.byDimDef");if(s&&F(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!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=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;z({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function U(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"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&F(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!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=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=N.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return V(e,H("measure",!!a,a||r[0])),!!a}(e,t))return;z({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty: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)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy: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))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,a):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?W(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:s,properties:e})?U(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"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,s)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression: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},addColorByExpression: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)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},K={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=E.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=N.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return N.moveByIdFromGroup(s,[],"qAttributeDimensions",c),N.moveByIdFromGroup(s,[],"qAttributeExpressions",c),N.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=E.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,h=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),g=o.getValue(d,"color.auto",""),m=Y.getCanColorBy(d,h),y=Y.shouldUpdateColorBy({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:d})&&Y.addColorByExpression(d):Y.switchToAutoColor(d),y&&Y.updateColorBy(d,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(d)&&Y.changeProperty(d,"color.persistent",!0),Y.deleteTotalMode(f),u}},X=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?D(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):D(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.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}}),X.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(s);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]&&y()(a,n.properties.measureAxes[t[0].axis])):y()(a,n.properties.measureAxes[0])}},setInterColumnSortOrder: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}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=K.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(g(a,"measureAxis.min","supportedAutoMinMax"),g(a,"measureAxis.max","supportedAutoMinMax")):(g(a,"measureAxis.min","unsupportedAutoMinMax"),g(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=K.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:d}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:s}),G.setInterColumnSortOrder(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Z(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Z(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:E,colorChart:K,axisChart:J,quarantineProperty:g,unquarantineProperty:D,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Om);var Im=n(Om.exports);const Pm={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(Pm);const Lm={version:"0.35.0",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:Pm.AUTO,binCount:"",binSize:Pm.BIN_SIZE,offset:Pm.OFFSET,countDistinct:Pm.COUNT_DISTINCT,binMode:Pm.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function jm(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Fm(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,s,a=[],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)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Hm(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 zm(e){return function(e){if(Array.isArray(e))return Bm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Hm(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 Hm(e,t){if(e){if("string"==typeof e)return Bm(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)?Bm(e,t):void 0}}function Bm(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}var Vm,$m=Object.prototype.hasOwnProperty,Wm=Object.prototype.toString,Um=Object.defineProperty,Ym=Object.getOwnPropertyDescriptor,Km=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Wm.call(e)},Xm=function(e){if(!e||"[object Object]"!==Wm.call(e))return!1;var t,n=$m.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&$m.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||$m.call(e,t)},Gm=function(e,t){Um&&"__proto__"===t.name?Um(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Jm=function(e,t){if("__proto__"===t){if(!$m.call(e,t))return;if(Ym)return Ym(e,t).value}return e[t]};function Zm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ey(){}Vm=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Jm(a,n),a!==(i=Jm(t,n))&&(u&&i&&(Xm(i)||(o=Km(i)))?(o?(o=!1,s=r&&Km(r)?r:[]):s=r&&Xm(r)?r:{},Gm(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Gm(a,{name:n,newValue:i}));return a},Vm&&Vm.__esModule&&Object.prototype.hasOwnProperty.call(Vm,"default")&&Vm.default;var ty=1/.7,ny="\\s*([+-]?\\d+)\\s*",ry="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",iy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oy=/^#([0-9a-f]{3,8})$/,sy=new RegExp(`^rgb\\(${ny},${ny},${ny}\\)$`),ay=new RegExp(`^rgb\\(${iy},${iy},${iy}\\)$`),ly=new RegExp(`^rgba\\(${ny},${ny},${ny},${ry}\\)$`),cy=new RegExp(`^rgba\\(${iy},${iy},${iy},${ry}\\)$`),uy=new RegExp(`^hsl\\(${ry},${iy},${iy}\\)$`),dy=new RegExp(`^hsla\\(${ry},${iy},${iy},${ry}\\)$`),hy={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 fy(){return this.rgb().formatHex()}function py(){return this.rgb().formatRgb()}function gy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=oy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?my(t):3===n?new xy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?yy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?yy(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=sy.exec(e))?new xy(t[1],t[2],t[3],1):(t=ay.exec(e))?new xy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ly.exec(e))?yy(t[1],t[2],t[3],t[4]):(t=cy.exec(e))?yy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=uy.exec(e))?qy(t[1],t[2]/100,t[3]/100,1):(t=dy.exec(e))?qy(t[1],t[2]/100,t[3]/100,t[4]):hy.hasOwnProperty(e)?my(hy[e]):"transparent"===e?new xy(NaN,NaN,NaN,0):null}function my(e){return new xy(e>>16&255,e>>8&255,255&e,1)}function yy(e,t,n,r){return r<=0&&(e=t=n=NaN),new xy(e,t,n,r)}function by(e){return e instanceof ey||(e=gy(e)),e?new xy((e=e.rgb()).r,e.g,e.b,e.opacity):new xy}function vy(e,t,n,r){return 1===arguments.length?by(e):new xy(e,t,n,null==r?1:r)}function xy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function wy(){return`#${Sy(this.r)}${Sy(this.g)}${Sy(this.b)}`}function My(){const e=ky(this.opacity);return`${1===e?"rgb(":"rgba("}${_y(this.r)}, ${_y(this.g)}, ${_y(this.b)}${1===e?")":`, ${e})`}`}function ky(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _y(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sy(e){return((e=_y(e))<16?"0":"")+e.toString(16)}function qy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ey(e,t,n,r)}function Dy(e){if(e instanceof Ey)return new Ey(e.h,e.s,e.l,e.opacity);if(e instanceof ey||(e=gy(e)),!e)return new Ey;if(e instanceof Ey)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),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Ey(s,a,l,e.opacity)}function Ey(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Cy(e){return(e=(e||0)%360)<0?e+360:e}function Ay(e){return Math.max(0,Math.min(1,e||0))}function Ty(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Zm(ey,gy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:fy,formatHex:fy,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Dy(this).formatHsl()},formatRgb:py,toString:py}),Zm(xy,vy,Qm(ey,{brighter(e){return e=null==e?ty:Math.pow(ty,e),new xy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new xy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xy(_y(this.r),_y(this.g),_y(this.b),ky(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:wy,formatHex:wy,formatHex8:function(){return`#${Sy(this.r)}${Sy(this.g)}${Sy(this.b)}${Sy(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:My,toString:My})),Zm(Ey,(function(e,t,n,r){return 1===arguments.length?Dy(e):new Ey(e,t,n,null==r?1:r)}),Qm(ey,{brighter(e){return e=null==e?ty:Math.pow(ty,e),new Ey(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ey(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 xy(Ty(e>=240?e-240:e+120,i,r),Ty(e,i,r),Ty(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ey(Cy(this.h),Ay(this.s),Ay(this.l),ky(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=ky(this.opacity);return`${1===e?"hsl(":"hsla("}${Cy(this.h)}, ${100*Ay(this.s)}%, ${100*Ay(this.l)}%${1===e?")":`, ${e})`}`}}));const Ny=Math.PI/180,Ry=180/Math.PI,Oy=4/29,Iy=6/29,Py=3*Iy*Iy;function Ly(e){if(e instanceof jy)return new jy(e.l,e.a,e.b,e.opacity);if(e instanceof Vy)return $y(e);e instanceof xy||(e=by(e));var t,n,r=By(e.r),i=By(e.g),o=By(e.b),s=Fy((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Fy((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Fy((.0139322*r+.0971045*i+.7141733*o)/.82521)),new jy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function jy(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Fy(e){return e>.008856451679035631?Math.pow(e,1/3):e/Py+Oy}function zy(e){return e>Iy?e*e*e:Py*(e-Oy)}function Hy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function By(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Vy(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function $y(e){if(isNaN(e.h))return new jy(e.l,0,0,e.opacity);var t=e.h*Ny;return new jy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Zm(jy,(function(e,t,n,r){return 1===arguments.length?Ly(e):new jy(e,t,n,null==r?1:r)}),Qm(ey,{brighter(e){return new jy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new jy(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new xy(Hy(3.1338561*(t=.96422*zy(t))-1.6168667*(e=1*zy(e))-.4906146*(n=.82521*zy(n))),Hy(-.9787684*t+1.9161415*e+.033454*n),Hy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Zm(Vy,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Vy)return new Vy(e.h,e.c,e.l,e.opacity);if(e instanceof jy||(e=Ly(e)),0===e.a&&0===e.b)return new Vy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ry;return new Vy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Vy(e,t,n,null==r?1:r)}),Qm(ey,{brighter(e){return new Vy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Vy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return $y(this).rgb()}}));var Wy=e=>()=>e;function Uy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Wy(isNaN(e)?t:e)}function Yy(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}!function e(t){var n=function(e){return 1==(e=+e)?Uy: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):Wy(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=vy(e)).r,(t=vy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Uy(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var Ky,Xy=["__proto__","constructor"];function Gy(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Xy.some((function(e){return r.includes(e)}))){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function Jy(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 Zy(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=eb)):void 0===t&&(t=Qy);for(var n,r,i,o,s,a=new rb(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new rb(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(nb)}function Qy(e){return e.children}function eb(e){return Array.isArray(e)?e[1]:null}function tb(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function nb(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function rb(e){this.data=e,this.depth=this.height=0,this.parent=null}rb.prototype=Zy.prototype={constructor:rb,count:function(){return this.eachAfter(Jy)},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,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,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;for(e=n.pop(),t=r.pop();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 Zy(this).eachBefore(tb)},[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)}},Ky=function(e){
24
+ * Licensed under the MIT license */!function(e){!function(t,n,r,i){var o,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,u=Math.abs,d=Date.now;function h(e,t,n){return setTimeout(v(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function g(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=g((function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e}),"extend","Use `assign`."),y=g((function(e,t){return m(e,t,!0)}),"merge","Use `assign`.");function b(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function x(e,t){return typeof e==l?e.apply(t&&t[0]||i,t):e}function w(e,t){return e===i?t:e}function M(e,t,n){p(q(t),(function(t){e.addEventListener(t,n,!1)}))}function k(e,t,n){p(q(t),(function(t){e.removeEventListener(t,n,!1)}))}function _(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function S(e,t){return e.indexOf(t)>-1}function q(e){return e.trim().split(/\s+/g)}function D(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function E(e){return Array.prototype.slice.call(e,0)}function C(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var s=t?e[o][t]:e[o];D(i,s)<0&&r.push(e[o]),i[o]=s,o++}return n&&(r=t?r.sort((function(e,n){return e[t]>n[t]})):r.sort()),r}function A(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),a=0;a<s.length;){if((r=(n=s[a])?n+o:t)in e)return r;a++}return i}var T=1;function N(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var R="ontouchstart"in t,O=A(t,"PointerEvent")!==i,I=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),P="touch",L="mouse",j=25,F=1,z=4,H=8,B=1,V=2,$=4,W=8,U=16,Y=V|$,K=W|U,X=Y|K,G=["x","y"],J=["clientX","clientY"];function Z(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){x(e.options.enable,[e])&&n.handler(t)},this.init()}function Q(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,s=t&F&&r-o==0,a=t&(z|H)&&r-o==0;n.isFirst=!!s,n.isFinal=!!a,s&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=ee(t));o>1&&!n.firstMultiple?n.firstMultiple=ee(t):1===o&&(n.firstMultiple=!1);var s=n.firstInput,a=n.firstMultiple,l=a?a.center:s.center,c=t.center=te(r);t.timeStamp=d(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=oe(l,c),t.distance=ie(l,c),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};t.eventType!==F&&o.eventType!==z||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y});t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=re(t.deltaX,t.deltaY);var h=ne(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=h.x,t.overallVelocityY=h.y,t.overallVelocity=u(h.x)>u(h.y)?h.x:h.y,t.scale=a?function(e,t){return ie(t[0],t[1],J)/ie(e[0],e[1],J)}(a.pointers,r):1,t.rotation=a?function(e,t){return oe(t[1],t[0],J)+oe(e[1],e[0],J)}(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,s,a=e.lastInterval||t,l=t.timeStamp-a.timeStamp;if(t.eventType!=H&&(l>j||a.velocity===i)){var c=t.deltaX-a.deltaX,d=t.deltaY-a.deltaY,h=ne(l,c,d);r=h.x,o=h.y,n=u(h.x)>u(h.y)?h.x:h.y,s=re(c,d),e.lastInterval=t}else n=a.velocity,r=a.velocityX,o=a.velocityY,s=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=s}(n,t);var f=e.element;_(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function ee(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:c(e.pointers[n].clientX),clientY:c(e.pointers[n].clientY)},n++;return{timeStamp:d(),pointers:t,center:te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function te(e){var t=e.length;if(1===t)return{x:c(e[0].clientX),y:c(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:c(n/t),y:c(r/t)}}function ne(e,t,n){return{x:t/e||0,y:n/e||0}}function re(e,t){return e===t?B:u(e)>=u(t)?e<0?V:$:t<0?W:U}function ie(e,t,n){n||(n=G);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function oe(e,t,n){n||(n=G);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(N(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(N(this.element),this.evWin,this.domHandler)}};var se={mousedown:F,mousemove:2,mouseup:z},ae="mousedown",le="mousemove mouseup";function ce(){this.evEl=ae,this.evWin=le,this.pressed=!1,Z.apply(this,arguments)}b(ce,Z,{handler:function(e){var t=se[e.type];t&F&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=z),this.pressed&&(t&z&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:L,srcEvent:e}))}});var ue={pointerdown:F,pointermove:2,pointerup:z,pointercancel:H,pointerout:H},de={2:P,3:"pen",4:L,5:"kinect"},he="pointerdown",fe="pointermove pointerup pointercancel";function pe(){this.evEl=he,this.evWin=fe,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(he="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),b(pe,Z,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=ue[r],o=de[e.pointerType]||e.pointerType,s=o==P,a=D(t,e.pointerId,"pointerId");i&F&&(0===e.button||s)?a<0&&(t.push(e),a=t.length-1):i&(z|H)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(a,1))}});var ge={touchstart:F,touchmove:2,touchend:z,touchcancel:H};function me(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}function ye(e,t){var n=E(e.touches),r=E(e.changedTouches);return t&(z|H)&&(n=C(n.concat(r),"identifier",!0)),[n,r]}b(me,Z,{handler:function(e){var t=ge[e.type];if(t===F&&(this.started=!0),this.started){var n=ye.call(this,e,t);t&(z|H)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}}});var be={touchstart:F,touchmove:2,touchend:z,touchcancel:H},ve="touchstart touchmove touchend touchcancel";function xe(){this.evTarget=ve,this.targetIds={},Z.apply(this,arguments)}function we(e,t){var n=E(e.touches),r=this.targetIds;if(t&(2|F)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,s=E(e.changedTouches),a=[],l=this.target;if(o=n.filter((function(e){return _(e.target,l)})),t===F)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<s.length;)r[s[i].identifier]&&a.push(s[i]),t&(z|H)&&delete r[s[i].identifier],i++;return a.length?[C(o.concat(a),"identifier",!0),a]:void 0}b(xe,Z,{handler:function(e){var t=be[e.type],n=we.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:P,srcEvent:e})}});var Me=2500;function ke(){Z.apply(this,arguments);var e=v(this.handler,this);this.touch=new xe(this.manager,e),this.mouse=new ce(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function _e(e,t){e&F?(this.primaryTouch=t.changedPointers[0].identifier,Se.call(this,t)):e&(z|H)&&Se.call(this,t)}function Se(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout((function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)}),Me)}}function qe(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),s=Math.abs(n-i.y);if(o<=25&&s<=25)return!0}return!1}b(ke,Z,{handler:function(e,t,n){var r=n.pointerType==P,i=n.pointerType==L;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)_e.call(this,t,n);else if(i&&qe.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var De=A(a.style,"touchAction"),Ee=De!==i,Ce="compute",Ae="auto",Te="manipulation",Ne="none",Re="pan-x",Oe="pan-y",Ie=function(){if(!Ee)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(r){e[r]=!n||t.CSS.supports("touch-action",r)})),e}();function Pe(e,t){this.manager=e,this.set(t)}Pe.prototype={set:function(e){e==Ce&&(e=this.compute()),Ee&&this.manager.element.style&&Ie[e]&&(this.manager.element.style[De]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return p(this.manager.recognizers,(function(t){x(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))})),function(e){if(S(e,Ne))return Ne;var t=S(e,Re),n=S(e,Oe);if(t&&n)return Ne;if(t||n)return t?Re:Oe;if(S(e,Te))return Te;return Ae}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=S(r,Ne)&&!Ie[Ne],o=S(r,Oe)&&!Ie[Oe],s=S(r,Re)&&!Ie[Re];if(i){var a=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return i||o&&n&Y||s&&n&K?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Le=1,je=32;function Fe(e){this.options=o({},this.defaults,e||{}),this.id=T++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=Le,this.simultaneous={},this.requireFail=[]}function ze(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function He(e){return e==U?"down":e==W?"up":e==V?"left":e==$?"right":""}function Be(e,t){var n=t.manager;return n?n.get(e):e}function Ve(){Fe.apply(this,arguments)}function $e(){Ve.apply(this,arguments),this.pX=null,this.pY=null}function We(){Ve.apply(this,arguments)}function Ue(){Fe.apply(this,arguments),this._timer=null,this._input=null}function Ye(){Ve.apply(this,arguments)}function Ke(){Ve.apply(this,arguments)}function Xe(){Fe.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function Ge(e,t){return(t=t||{}).recognizers=w(t.recognizers,Ge.defaults.preset),new Je(e,t)}Fe.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Be(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Be(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===D(t,e=Be(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Be(e,this);var t=D(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+ze(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+ze(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=je},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(je|Le)))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!x(this.options.enable,[this,t]))return this.reset(),void(this.state=je);56&this.state&&(this.state=Le),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},b(Ve,Fe,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(n&H||!i)?16|t:r||i?n&z?8|t:2&t?4|t:2:je}}),b($e,Ve,{defaults:{event:"pan",threshold:10,pointers:1,direction:X},getTouchAction:function(){var e=this.options.direction,t=[];return e&Y&&t.push(Oe),e&K&&t.push(Re),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,s=e.deltaY;return i&t.direction||(t.direction&Y?(i=0===o?B:o<0?V:$,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===s?B:s<0?W:U,n=s!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ve.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=He(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(We,Ve,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Ue,Fe,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ae]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(z|H)&&!i)this.reset();else if(e.eventType&F)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),t.time,this);else if(e.eventType&z)return 8;return je},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&z?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Ye,Ve,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ne]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(Ke,Ve,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Y|K,pointers:1},getTouchAction:function(){return $e.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Y|K)?t=e.overallVelocity:n&Y?t=e.overallVelocityX:n&K&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&u(t)>this.options.velocity&&e.eventType&z},emit:function(e){var t=He(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(Xe,Fe,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Te]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&F&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=z)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,s=!this.pCenter||ie(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,s&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),t.interval,this),2):8}return je},failTimeout:function(){return this._timer=h((function(){this.state=je}),this.options.interval,this),je},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),Ge.VERSION="2.0.7",Ge.defaults={domEvents:!1,touchAction:Ce,enable:!0,inputTarget:null,inputClass:null,preset:[[Ye,{enable:!1}],[We,{enable:!1},["rotate"]],[Ke,{direction:Y}],[$e,{direction:Y},["swipe"]],[Xe],[Xe,{event:"doubletap",taps:2},["tap"]],[Ue]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Je(e,t){var n;this.options=o({},Ge.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(O?pe:I?xe:R?ke:ce))(n,Q),this.touchAction=new Pe(this,this.options.touchAction),Ze(this,!0),p(this.options.recognizers,(function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])}),this)}function Ze(e,t){var n,r=e.element;r.style&&(p(e.options.cssProps,(function(i,o){n=A(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""})),t||(e.oldCssProps={}))}Je.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof Fe)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=D(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return p(q(e),(function(e){n[e]=n[e]||[],n[e].push(t)})),this}},off:function(e,t){if(e!==i){var n=this.handlers;return p(q(e),(function(e){t?n[e]&&n[e].splice(D(n[e],t),1):delete n[e]})),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&Ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(Ge,{INPUT_START:F,INPUT_MOVE:2,INPUT_END:z,INPUT_CANCEL:H,STATE_POSSIBLE:Le,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:je,DIRECTION_NONE:B,DIRECTION_LEFT:V,DIRECTION_RIGHT:$,DIRECTION_UP:W,DIRECTION_DOWN:U,DIRECTION_HORIZONTAL:Y,DIRECTION_VERTICAL:K,DIRECTION_ALL:X,Manager:Je,Input:Z,TouchAction:Pe,TouchInput:xe,MouseInput:ce,PointerEventInput:pe,TouchMouseInput:ke,SingleTouchInput:me,Recognizer:Fe,AttrRecognizer:Ve,Tap:Xe,Pan:$e,Swipe:Ke,Pinch:We,Rotate:Ye,Press:Ue,on:M,off:k,each:p,merge:y,extend:m,assign:o,inherit:b,bindFn:v,prefixed:A}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=Ge,"function"==typeof i&&i.amd?i((function(){return Ge})):e.exports?e.exports=Ge:t.Hammer=Ge}(window,document)}(Em);var Cm=n(Em.exports);function Am(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var Tm={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),s="center"===r?t:`* ${t}`,a="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:a,title:s},s))}};function Nm(e){const t=jp();return t.renderer.prio([e||"canvas"]),t.use(_m),t.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",Dm(e))};e.interaction("hammer",Dm(Hammer))}(Cm)),t.use(Am),t.component("disclaimer",Tm),t}const Rm={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"}}]};var Om={exports:{}};!function(e,t){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/conversion/",n(n.s=2)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=u(d,n),d!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(d,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(d,{name:n,newValue:i}));return d}},function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/qlik-modifiers/",n(n.s=1)}([function(e,t,n){var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(s)return s(e,t).value}return e[t]};e.exports=function e(){var t,n,r,i,o,s,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(null!=(t=arguments[h]))for(n in t)r=u(d,n),d!==(i=u(t,n))&&(p&&i&&(l(i)||(o=a(i)))?(o?(o=!1,s=r&&a(r)?r:[]):s=r&&l(r)?r:{},c(d,{name:n,newValue:e(p,s,i)})):void 0!==i&&c(d,{name:n,newValue:i}));return d}},function(e,t,n){n.r(t);var r=n(0),i=n.n(r),o=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],s=e;for(r=0;r<i.length-1;++r)void 0===s[i[r]]&&(s[i[r]]=Number.isNaN(+i[r+1])?{}:[]),s=s[i[r]];if(void 0!==n){var a=s[o];return s[o]=n,{updated:n,previous:a}}return delete s[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},a="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return a+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 s=r.qDerivedFieldData.qDerivedFieldLists[o],a=0;a<s.qFieldDefs.length;++a){var l=s.qFieldDefs[a];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 h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e).trim();return"="===t.substring(0,1)?t.substring(1).trim():t}function p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function g(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function m(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=MinString(").concat(t,"))' and Only({1}").concat(t,")<='$(=MaxString(").concat(t,"))'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,s=void 0===o?"Sum":o,a=e.valueComp,l=void 0===a?"0":a;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=y(u(r[0],i),p(0));return"".concat(s,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),h=u(r[1],i),f=p(0),g=p(1),m=y(d,f),b=y(h,g);return"".concat(s,"({1<").concat(m,",").concat(b,">}").concat(l,")")}return"".concat(s,"({1}").concat(l,")")}function v(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}var w={isFullRange:d,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,s=c(f(t));if(!n.showExcludedValues)return s;var a=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(s," + ").concat(a).concat(l,")")}if(r&&2===r.length){var d=p(0),h=p(1);return"If(Count(".concat(d,") * Count(").concat(h,") > 0, ").concat(s," + ").concat(a).concat(l,")")}return s},getRowNoComp:h,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return h(e,t)},getAboveCompPrefix:g,getAboveCompSuffix:m,getAboveComp:function(e,t,n,r){return g(e,t)+n+m(r)},getFunctionPrefix:v,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return v(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;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===x({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],")"):"",s=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(s,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(s,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(a);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+a.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,s=void 0===o?2:o;if(!t&&!n)return!0;var a=x({properties:t,layout:n});return a>=i&&a<=s},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(a),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,"]")}};function M(e){return(M="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})(e)}var k=i.a.bind(null,!0),_={},S=Array.isArray;function q(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function D(e){return void 0===e}function E(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function C(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]=D(e[n||t])?o:e[t],e=e[n||t]}})),e}function A(e,t){var n=!0;if(q(e)&&q(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(S(e)&&S(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}_.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?k({},{val:e}).val:e}(t[i]),s=e[i],a="".concat(n,"/").concat(i);A(o,s)||E(t,i)||(D(s)?r.push({op:"add",path:a,value:o}):q(o)&&q(s)?r=r.concat(_.generate(s,o,a)):S(o)&&S(s)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function s(e,t,n){if(e[n]&&D(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(!D(t[0])&&D(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var a=i.length-1;a>=0;a-=1)-1===(o=s(t,i[a].qInfo&&i[a].qInfo.qId,a))?(r.push({op:"remove",path:"".concat(n,"/").concat(a)}),i.splice(a,1)):r=r.concat(_.generate(i[a],t[o],"".concat(n,"/").concat(a)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=s(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}(s,o,a)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){D(t[i])&&!E(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},_.apply=function(e,t){t.forEach((function(t){var n,r=C(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&Number.isNaN(+i)?r[i]:r[+i]||r,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(r=null,o=e),"add"===t.op||"replace"===t.op)if(S(r))"-"===i&&(i=r.length),r.splice(+i,"add"===t.op?0:1,t.value);else if(S(o)&&S(t.value)){var a,l=t.value.slice();o.length=0,(a=o).push.apply(a,function(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}(l))}else if(q(o)&&q(t.value))n=o,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!E(n,e)&&delete n[e]})),k(o,t.value);else{if(!r)throw new Error("Patchee is not an object we can patch");r[i]=t.value}else if("move"===t.op){var c=C(e,t.from);S(r)?r.splice(+i,0,c.splice(+s,1)[0]):(r[i]=c[s],delete c[s])}else"remove"===t.op&&(S(r)?r.splice(+i,1):delete r[i])}))},_.clone=function(e){return k({},e)},_.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},_.updateObject=function(e,t){Object.keys(e).length?_.apply(e,_.generate(e,t)):k(e,t)};var T=_,N=function(e,t,n){if(!e)return Promise.resolve();var r=T.generate(t,n);return i()(!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()},R="accumulation";function O(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function I(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===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var P={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""},L={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,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=w.getNumStepComp(n,l),h=w.getAboveComp(n,l,u,d),f=w.getRangeComp("RangeSum",h);if(w.needDimension({modifier:n,properties:r,layout:i})){var p=w.getDimComp(c,1),g=w.getDimComp(c,0),m=w.getAggrComp(f,p,g);f=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:m}):m}return f},extractInputExpression:w.extractInputExpression,initModifier:function(e){w.initModifier(e,P)},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(I(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(I(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(I(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(I(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=O(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=O(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(I(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(R))return!1;var o=O(t,e);return o&&!o.disabled}};return n}},j="movingAverage";function F(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]}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 H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1},B={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,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=w.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,h=w.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),f=w.getNumStepComp(r,c),p=w.getAboveComp(r,c,h,f);if(r.nullSuppression)t=w.getRangeComp("RangeAvg",p);else{var g=w.getRangeComp("RangeSum",p),m=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(g," / ").concat(m)}var y=t;if(w.needDimension({modifier:r,properties:i,layout:o})){var b=w.getDimComp(u,1),v=w.getDimComp(u,0),x=w.getAggrComp(y,b,v);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,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!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.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(z(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(z(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(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=F(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=F(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(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=F(t,e);return o&&!o.disabled}};return n}},V="difference";function $(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function W(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===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var U={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""},Y={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,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=w.getAboveComp(n,l,u),h="".concat(u," - ").concat(d);if(w.needDimension({modifier:n,properties:r,layout:i})){var f=w.getDimComp(c,1),p=w.getDimComp(c,0),g=w.getAggrComp(h,f,p);h=n.showExcludedValues?w.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:g}):g}return h},initModifier:function(e){Object.keys(U).forEach((function(t){void 0===e[t]&&(e[t]=U[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(W(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(W(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(W(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(V))return!1;var o=$(t,e);return o&&!o.disabled}};return n}},K={CURRENT_SELECTION:0,SELECT_FIELD_VALUE:1,DISREGARD_SELECTION:2},X={ONE_DIMENSION:0,ALL_DIMENSIOANS:1,DISREGARD_ALL_DIMENSIONS:2},G="normalization";function J(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)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===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function Q(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}function ee(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:X.ONE_DIMENSION,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:X.ALL_DIMENSIOANS,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:X.DISREGARD_ALL_DIMENSIONS,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,n){if(e<2){var r=Q(t,0);t.splice(r,1)}return t}(i,o),function(e,t,n){if(0===e){var r=Q(t,1);t.splice(r,1)}return t}(J(e,r).selectionScope,o)}function te(e,t,n){var r=[{value:K.CURRENT_SELECTION,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:K.SELECT_FIELD_VALUE,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:K.DISREGARD_SELECTION,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return function(e,t,n){if(1===e){var r=Q(t,0);t.splice(r,1)}return t}(J(e,n).dimensionalScope,r)}var ne={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:X.DISREGARD_ALL_DIMENSIONS,selectionScope:K.DISREGARD_SELECTION};function re(e){return 2===e?"{1}":""}function ie(e,t,n){return 1===e?"{$<".concat(w.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function oe(e,t){return 0===e&&t>1||2===e?"Total":""}function se(e,t,n){return 0===e&&t>1?"<".concat(w.getDimDefWithWrapper(n),">"):""}var ae={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,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=w.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=w.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,h=n.dimensionalScope;return function(e,t,n,r,i,o,s){var a=re(t),l=ie(t,n,r),c=""===a&&""===l?"":a||l,u=oe(i,o),d=se(i,o,s),h=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(h,"))")}(u,d,n.field,n.value,h,l,n.primaryDimension)},initModifier:function(e){Object.keys(ne).forEach((function(t){void 0===e[t]&&(e[t]=ne[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(Z(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:K.DISREGARD_SELECTION,options:function(n){return te(n,t,e)}},field:{refFn:function(t){return"".concat(Z(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 J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},value:{refFn:function(t){return"".concat(Z(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return J(t,e).selectionScope===K.SELECT_FIELD_VALUE}},dimensionalScope:{refFn:function(t){return"".concat(Z(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:X.DISREGARD_ALL_DIMENSIONS,supportTooltip:!0,options:function(n,r){return ee(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(Z(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(J(t,e).dimensionalScope||0)===X.ONE_DIMENSION&&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(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:re,getFieldSelectionComp:ie,getTotalComp:oe,getSelectedDimComp:se},le={getExpression:function(e){return s(e,"qDef.base.qDef")||s(e,"qDef.qDef")},getExpressionRef:function(e){return s(e,"qDef.base.qDef")?"qDef.base.qDef":"qDef.qDef"},getLibraryIdRef:function(e){return s(e,"qDef.base.qLibraryId")?"qDef.base.qLibraryId":"qLibraryId"},getLibraryId:function(e){return s(e,"qDef.base.qLibraryId")||s(e,"qLibraryId")},getLabelRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return s(e,"qDef.base")?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}},ce={initBase:function(e,t){(t||ce.isValid(e))&&(o(e,"qDef.base.qDef",s(e,"qDef.qDef")),o(e,"qDef.base.qLibraryId",s(e,"qLibraryId")),o(e,"qDef.base.qLabel",s(e,"qDef.qLabel")),o(e,"qDef.base.qLabelExpression",s(e,"qDef.qLabelExpression")))},restoreBase:function(e){ce.isValid(e)&&(o(e,"qDef.qDef",s(e,"qDef.base.qDef")),o(e,"qLibraryId",s(e,"qDef.base.qLibraryId")),o(e,"qDef.qLabel",s(e,"qDef.base.qLabel")),o(e,"qDef.qLabelExpression",s(e,"qDef.base.qLabelExpression")),s(e,"qDef.qAggrFunc")&&s(e,"qDef.base.qAggrFunc")&&o(e,"qDef.qAggrFunc",s(e,"qDef.base.qAggrFunc")),delete e.qDef.base)},isValid:function(e){var t=s(e,"qDef.base.qDef"),n=s(e,"qDef.base.qLibraryId");return void 0!==t||void 0!==n}},ue=ce;function de(e){return(de="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})(e)}var he={accumulation:L,movingAverage:B,difference:Y,normalization:ae},fe=(t.default={modifiers:he,apply:pe,applyModifiers:ge,cleanUpMeasure:me,destroy:function(e){e&&fe[e.id]&&fe[e.id].masterItemSubscriber&&(fe[e.id].masterItemSubscriber&&fe[e.id].masterItemSubscriber.unsubscribe(),delete fe[e.id])},hasActiveModifiers:ye,getActiveModifier:be,initBase:ue.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return he[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return he[e]&&he[e].isApplicable({properties:n,layout:r})}))},measureBase:le,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=we(e);Ee({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Re({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:ve},{});function pe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,o=void 0!==r&&r,a=e.masterItem;fe[t.id]=fe[t.id]||{isFirstTime:!0};var l=fe[t.id].isFirstTime;if(fe[t.id].isFirstTime=!1,n&&"object"===de(n))return ge({model:t,properties:n});var c=t?t.layout:void 0,u=s(c,"qSelectionInfo.qInSelections");if(o||u)return Promise.resolve(!1);var d=s(c,"qHyperCube.qMeasureInfo"),h=fe[t.id].lastReloadTime;if(fe[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),ye({measures:d,layout:c})){var f=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 De({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:c,model:t,lastReloadTime:h});return f||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 Ee({modifiers:we(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:c,masterItem:a,isFirstTime:l})?t.getEffectiveProperties().then((function(e){var n=i()(!0,{},e);ke(n);var r=Oe(n);return Ce({model:t}).then((function(i){return Ae({libraryIds:r,model:t}).then((function(r){return f&&function(e){var t=e.properties;xe(t).forEach((function(e){return function(e){var t=e.measure;if(De({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===de(e)&&!e.disabled){if(n++,"object"!==de(he[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=he[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Se(t)&&w.simplifyExpression(t.qDef.base.qDef)!==w.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:n}),ge({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})}))}))})):Promise.resolve(!1)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===de(e.base)}))}(d)?t.getEffectiveProperties().then((function(e){return function(e){var t=e.model,n=e.properties,r=Oe(n);return Ie({model:t,libraryIds:r}).then((function(){var e=i()(!0,{},n);return xe(n).forEach((function(e){return me(e)})),Ne({oldProperties:e,newProperties:n,model:t})}))}({model:t,properties:e})})):Promise.resolve(!1)}function ge(e){var t=e.model,n=e.oldProperties,r=e.properties,o=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?i()(!0,{},r):r),ke(r);var h=Oe(r);return Ie({model:t,libraryIds:h,masterItem:c}).then((function(){return function(e){var t=e.measures,n=e.properties,r=e.model,o=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=xe(n)),!t.length)return Promise.resolve();if(!ye({measures:t,properties:n}))return t.forEach((function(e){return me(e)})),Promise.resolve();var l=o?void 0:Oe(n);return Ce({model:r,dimensionAndFieldList:a}).then((function(e){return Ae({libraryIds:l,model:r,libraryItemsProps:o}).then((function(r){t.forEach((function(t){Ee({modifiers:t.qDef.modifiers,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,o=e.dimensionAndFieldList,a=0;ue.isValid(t)||ue.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach((function(e){if("object"===de(e)&&!e.disabled){if(a++,"object"!==de(he[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)");he[e.type].initModifier(e);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList,s=e.libraryItemsProps[e.libraryId],a=s.qMeasure.qDef,l=he[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||s.qMeasure.qLabel)&&(t.qDef.qLabel=s.qMeasure.qLabel),(t.qDef.qLabelExpression||s.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=s.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&s.qMeasure.qNumFormat&&(t.qDef.qNumFormat=s.qMeasure.qNumFormat,t.qDef.isCustomFormatted=s.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=s.qMeasure.coloring,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:o}):function(e){var t=e.measure,n=e.modifier,r=e.properties,o=e.dimensionAndFieldList;"function"==typeof he[n.type].updateModifier&&he[n.type].updateModifier(n,r.qHyperCubeDef);var s=le.getExpression(t),a=he[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:o});n.outputExpression=a,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||s,n.base=i()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:o}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||ve(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ve(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}),_e(t)):me(t)}))}))}))}({measures:o,properties:r,model:t,libraryItemsProps:u,dimensionAndFieldList:d}).then((function(){return l?Ne({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)}))}))}function me(e){!function(e){var t=we(e);return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&!he[e.type]}))}(e)?ue.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,_e(e)}function ye(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ee({modifiers:we(e),properties:n,layout:r})}))}function be(e){var t=we(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(he[r.type]&&!r.disabled)return r}}function ve(e){var t=be(e);return!t||he[t.type].enableTotalsFunction(e)}function xe(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function we(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Me(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function ke(e){xe(e).forEach((function(e){return function(e){var t=be(e);t&&(void 0!==t.outputExpression&&Me(t)!==e.qDef.qDef?delete e.qDef.base:!ue.isValid(e)&&t.base&&(e.qDef.base=i()(!0,{},t.base)))}(e)}))}function _e(e){var t=we(e);Array.isArray(t)&&t.forEach((function(t){"object"===de(t)&&(t.disabled||!he[t.type]&&Me(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function Se(e){return e.base||e.qDef&&e.qDef.base}function qe(e){var t=Se(e);return e.qLibraryId||t&&t.qLibraryId}function De(e){var t=e.measure,n=e.properties,r=e.layout;return!qe(t)&&Ee({modifiers:we(t),properties:n,layout:r})}function Ee(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==de(e)||e.disabled||!he[e.type])&&(void 0===i[e.type]&&(i[e.type]=he[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ce(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 s=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(s),Promise.all(r).then((function(){return i}))}function Ae(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,s={},a=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){s[e]=t}))}));a.push(t)})),Promise.all(a).then((function(){return s}))}function Te(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ne(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Te)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Te);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):N(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Re(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===de(e)&&!e.disabled&&he[e.type]&&he[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Oe(e){var t=xe(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=we(t);if(Ee({modifiers:r,properties:e})){var o=qe(t);o&&n.push(o),i=i||Re({modifiers:r,properties:e})}})),s(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function Ie(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(fe[t.id].masterItemSubscriber=fe[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(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,s=e.dimensionLibraryIds,a=[];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:s}),Object.keys(r).forEach((function(e){i[e]||o[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&a.push(u(e,"getMeasure"))})),Object.keys(o).forEach((function(e){o[e]&&!r[e]&&a.push(u(e,"getDimension"))}))),Promise.all(a)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return pe({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),fe[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}}])},function(e,t,n){function r(e){var t=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)}(e%62),n=Math.floor(e/62);return n>0?r(n)+t:t}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})(e)}n.r(t);var 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 s=r[o];if(""!==s){if(void 0===i[s]||null===i[s])return n;i=i[s]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,s=0;s<r.length-1;++s){var a=r[s];void 0!==o[a]&&null!==o[a]||(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}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 r(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function s(e){return function(e){if(Array.isArray(e))return a(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 a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(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 a(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}var 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},h=n(1),f=n.n(h),p={addDimensions:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,s(r.qDimensions));var a,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(a=i.excludedDimensions).push.apply(a,s(l))},addMeasures:function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var s,a=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");a&&(s=i.excludedMeasures).push.apply(s,l(a))},setInterColumnSortOrder: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())},copyProperties:function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},updateLayoutExclude: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},storeMeasuresModifiers:function(e){e.forEach((function(e){f.a.cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))}};function g(e,t,n){var r,i,s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var a=o.getValue(e,"qLayoutExclude.quarantine");a[n]||(a[n]={}),a[n][t]=s}var m=n(0),y=n.n(m);function b(e,t){var n=y()(!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 v(e,t){return y()(!0,{},t,e)}function x(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var w=Math.pow(2,53)-1;function M(e){return function(e){if(Array.isArray(e))return k(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 k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(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 _(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}var q={importCommonProperties: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},copyPropertyIfExist:function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},copyPropertyOrSetDefault:function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},getDefaultDimension: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}}},getDefaultMeasure:function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},addDimensions:function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,s=e.defaultDimension,a=n.data[0];for(t=0;t<a.dimensions.length;++t){var l=b(a.dimensions[t],s);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<a.excludedDimensions.length;++t){var c=b(a.excludedDimensions[t],s);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},addMeasures:function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,s=e.defaultMeasure,a=n.data[0];for(t=0;t<a.measures.length;++t){var l=v(a.measures[t],s);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<a.excludedMeasures.length;++t){var c=v(a.excludedMeasures[t],s);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},getMaxMinDimensionMeasure:function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},s=r.measures||{max:0},a=x(s.max,i.dimensions.length,w),l=x(s.min,i.dimensions.length,0);return{maxDimensions:x(o.max,a,w),minDimensions:x(o.min,l,0),maxMeasures:a,minMeasures:l}},setInterColumnSortOrder: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))},createNewProperties: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=y()(!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=y()(!0,{},n,i)).components&&(i.components=[]),i},shouldInitLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=t.data[0];return s.dimensions.length>n&&n>0||s.measures.length>i&&i>0||s.excludedDimensions.length>0&&s.dimensions.length+s.excludedDimensions.length>r||s.excludedMeasures.length>0&&s.measures.length+s.excludedMeasures.length>o||!i&&s.measures.length>0||!n&&s.dimensions.length>0},initLayoutExclude:function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,s=e.newHyperCubeDef,a=t.data[0];s.qLayoutExclude||(s.qLayoutExclude={}),s.qLayoutExclude.qHyperCubeDef||(s.qLayoutExclude.qHyperCubeDef={}),(a.dimensions.length>n&&n>0||a.excludedDimensions&&a.excludedDimensions.length&&a.dimensions.length+a.excludedDimensions.length>r)&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(a.measures.length>i&&i>0||a.excludedMeasures&&a.excludedMeasures.length&&a.measures.length+a.excludedMeasures.length>o)&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&a.measures.length&&(s.qLayoutExclude.qHyperCubeDef.qMeasures||(s.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&a.dimensions.length&&(s.qLayoutExclude.qHyperCubeDef.qDimensions||(s.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},updateDimensionsOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.dimensions&&"function"==typeof n.dimensions.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=M(i.qDimensions);i.qDimensions=[],s.forEach((function(e){i.qDimensions.push(e),n.dimensions.added(e,t)}))}},updateMeasuresOnAdded:function(e){var t=e.newProperties,n=e.dataDefinition,r=e.hypercubePath;if(n.measures&&"function"==typeof n.measures.added){var i=o.getValue(t,r||"").qHyperCubeDef,s=_(i.qMeasures);i.qMeasures=[],s.forEach((function(e){i.qMeasures.push(e),n.measures.added(e,t)}))}},restoreMeasuresModifiers:function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f.a.isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))}};function D(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)}var E={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}(),s=t.qProperty,a=o.getValue(s,n||""),l=a.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),p.addDimensions({exportFormat:i,qHyperCubeDef:l}),p.addMeasures({exportFormat:i,qHyperCubeDef:l}),p.setInterColumnSortOrder({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,p.copyProperties({exportFormat:i,properties:s}),n&&(i.properties.qHyperCubeDef=l,delete a.qHyperCubeDef),p.updateLayoutExclude({exportFormat:i,properties:s}),r||p.storeMeasuresModifiers(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(g(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(g(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(g(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,s=void 0===i?{}:i,a=e.defaultPropertyValues,l=void 0===a?{}:a,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,h=void 0===d||d,f=e.isHCModifierSupported,p=void 0===f||f,g={qChildren:[]},m=q.createNewProperties({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,b=o.getValue(m,c||"").qHyperCubeDef,v=q.getMaxMinDimensionMeasure({exportFormat:t,dataDefinition:s}),x=v.maxDimensions,w=v.minDimensions,M=v.maxMeasures,k=v.minMeasures,_=l.defaultDimension,S=void 0===_?q.getDefaultDimension():_,E=l.defaultMeasure,C=void 0===E?q.getDefaultMeasure():E;b.qDimensions.length=0,b.qMeasures.length=0,q.shouldInitLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k})&&q.initLayoutExclude({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:M,minMeasures:k,newHyperCubeDef:b}),q.addDimensions({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:b,defaultDimension:S}),q.addMeasures({exportFormat:t,maxMeasures:M,minMeasures:k,newHyperCubeDef:b,defaultMeasure:C}),q.updateDimensionsOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),q.updateMeasuresOnAdded({newProperties:m,dataDefinition:s,hypercubePath:c}),q.setInterColumnSortOrder({exportFormat:t,newHyperCubeDef:b}),q.copyPropertyIfExist("qMaxStackedCells",y,b),q.copyPropertyIfExist("qNoOfLeftDims",y,b),q.copyPropertyOrSetDefault("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),q.copyPropertyOrSetDefault("qMode",y,b,"S"),q.copyPropertyOrSetDefault("qReductionMode",y,b,"N"),q.copyPropertyOrSetDefault("qSortbyYValue",y,b),q.copyPropertyOrSetDefault("qIndentMode",y,b),q.copyPropertyOrSetDefault("qShowTotalsAbove",y,b),q.importCommonProperties(m,t,r),g.qProperty=m;var A=o.getValue(u||{},"support.modifiers");return q.restoreMeasuresModifiers({measures:b.qMeasures,modifierTypes:A}),h&&D(g.qProperty,"storedFilters"),"S"===b.qMode&&p&&D(g.qProperty,"dynamicScript"),g}},C={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function A(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var s=e.splice(i,1);t.push(s[0])}return t}function T(e,t){return e.length!==t}var N={create:function(e,t){if(!e||!C[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 s=e[o][n],a=t.length;if(A(s,t,r,i),T(t,a))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"}},R={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}},O={colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>0&&R.getNumMeasures(e)<=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>0},expression:function(e){return R.getNumMeasures(e)>=1}}},I={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},P={scatterplot:I,"sn-scatter-plot":I,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return R.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)<=1},expression:function(e){return R.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return R.getNumDimensions(e)>=1},multiColor:function(e){return R.getNumMeasures(e)>1},measure:function(e){return R.getNumDimensions(e)>=1},expression:function(e){return R.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 R.getNumDimensions(e)>=1}}}};function L(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 j(e,t){var n=N.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)})),t.forEach((function(e){L(e,"qAttributeDimensions",n),L(e,"qAttributeExpressions",n)}))}function F(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function z(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,s=e.measures,a=e.label;j(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"),h=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var f=N.create(N.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,s=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=s)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.isDimension,o=e.qNumFormat,s=e.isCustomFormatted;i||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),o&&(t.qNumFormat=o,t.isCustomFormatted=s)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:h})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function H(e,t,n,r){var i,o,s,a={};switch(e){case"dimension":n.qLibraryId?(a.type="dimension",a.name=n.qLibraryId,a.id=n.qLibraryId):(a.type="field",t?(a.name=n.label||n.qDef,a.id=n.qDef):(a.name=n.qDef.qFieldDefs[0],a.label=(s=n.qDef).qLabelExpression?s.qLabelExpression:s.qFieldLabels&&s.qFieldLabels[0]?s.qFieldLabels[0]:s.qFieldDefs[0]));break;case"measure":(i=function(e,t){return t?e.qLibraryId:f.a.measureBase.getLibraryId(e)}(n,t))?(a.type="measure",a.name=i,a.id=i,(o=function(e,t){return f.a.hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r))&&(a.expression=o)):(a.type="expression",t?(a.name=n.label||n.qExpression,a.id=n.qExpression):(a.name=n.qDef.qDef,a.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 a}var B={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function V(e,t,n,r){var i=n?"expression":t.type,o=e.color,s=o.mode,a=R.getItemLabel(t);switch(F(e,a||""),i){case"field":s="byDimension",o.byDimDef={label:t.label||R.wrapFieldName(t.name),key:R.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":s="byMeasure",o.byMeasureDef={label:n||a,key:n||t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":s="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":s="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&B.useMasterNumberFormat(o.formatting)}r||(o.auto=!1,o.mode=s)}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("."),s=Number(i[1]),a=o.getValue(t,"layers.".concat(s,".type"));return 2===e.length&&"map"===r&&"point"===a}(n,e,t)?0:n.length-1],i=N.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return V(e,H("dimension",!!s,s||r)),!!s}function W(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"),[]),s=o.getValue(e,"color.byDimDef");if(s&&F(e,s.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(s))!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=H("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,V(e,i)}(e,t);else if(function(e){return!e||!e.key}(s)&&$(e,t))return;z({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}function U(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"),[]),s=o.getValue(e,"color.byMeasureDef");if(s&&F(e,s.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(s))!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=H("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,V(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(s,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],s=N.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(i.qAttributeExpressions,"id",s);return V(e,H("measure",!!a,a||r[0])),!!a}(e,t))return;z({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}var Y={changeProperty: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)},getCanColorBy:function(e,t){var n={primary:!0};if(e){var r=(P[t]||O).colorModeOptions||O.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},shouldUpdateColorBy: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))},updateColorBy:function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"color.auto"),i=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);r?j(i,a):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions;return!t&&"byDimension"===n&&r.length>0}({auto:r,colorMode:n,dimensions:i})?W(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,s=e.properties,a=o.getValue(s,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==a&&!i.length)}({auto:r,colorMode:n,dimensions:i,measures:s,properties:e})?U(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"),[]),s=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),j(r,s)}(e,t)},deleteTotalMode:function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},shouldAddColorByExpression: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},addColorByExpression: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)},switchToAutoColor:function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},shouldSwitchToColorPersistent:function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n}},K={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=E.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],s=o.dimensions.concat(o.excludedDimensions),a=o.measures.concat(o.excludedMeasures),l=N.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return N.moveByIdFromGroup(s,[],"qAttributeDimensions",c),N.moveByIdFromGroup(s,[],"qAttributeExpressions",c),N.moveByIdFromGroup(a,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,s=e.hypercubePath,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=E.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:s,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,h=o.getValue(d,"visualization"),f=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),g=o.getValue(d,"color.auto",""),m=Y.getCanColorBy(d,h),y=Y.shouldUpdateColorBy({canColorBy:m,autoColor:g,colorMode:p,dimensions:f});return m[p]?Y.shouldAddColorByExpression({shouldUpdateColorBy:y,properties:d})&&Y.addColorByExpression(d):Y.switchToAutoColor(d),y&&Y.updateColorBy(d,"qHyperCubeDef."),Y.shouldSwitchToColorPersistent(d)&&Y.changeProperty(d,"color.persistent",!0),Y.deleteTotalMode(f),u}},X=["bar","marker","line"],G={handleAutoMinMax:function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?D(n,"unsupportedAutoMinMax")||y()(n.measureAxis,t.measureAxis):D(n,"supportedAutoMinMax")||y()(n.measureAxis,t.measureAxis)},handleMeasuresAxis:function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,s=i.qHyperCubeDef,a=i.measureAxis;if(function(e){var t=e.exportFormat,n=e.initialProperties;return!(!t.properties.measureAxes||n.measureAxes||!n.measureAxis||void 0===n.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}}),X.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(s);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]&&y()(a,n.properties.measureAxes[t[0].axis])):y()(a,n.properties.measureAxes[0])}},setInterColumnSortOrder: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}}}},J={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,s=K.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),a=s.properties;return o?(g(a,"measureAxis.min","supportedAutoMinMax"),g(a,"measureAxis.max","supportedAutoMinMax")):(g(a,"measureAxis.min","unsupportedAutoMinMax"),g(a,"measureAxis.max","unsupportedAutoMinMax")),s},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,s=e.measureType,a=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=K.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:a,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return G.handleAutoMinMax({initialProperties:n,properties:d}),G.handleMeasuresAxis({exportFormat:t,initialProperties:n,properties:d,measureType:s}),G.setInterColumnSortOrder(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function Z(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Q(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,s);if(void 0!==a){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=Z(n,r,l);o.setValue(t,c,a),o.setValue(i,s,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}function ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,s=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,s=e.itemPath,a=o.getValue(i,"qDef.cId");if(a){var l=Z(n,r,a),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,s,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:s})}))}var te={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalColoring",arrayName:"measures",itemPath:"qDef.conditionalColoring"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",itemPath:"qDef.conditionalColoring",arrayName:"measures",quarantineName:"conditionalColoring"})}},ne={quarantine:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},unquarantine:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"measures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"dimensions",itemPath:"qCalcCondition"})},quarantineAlternative:function(e){Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),Q({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})},unquarantineAlternative:function(e){ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",quarantineName:"conditionalShowHide",arrayName:"alternativeMeasures",itemPath:"qCalcCondition"}),ee({properties:e,arrayPath:"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",quarantineName:"conditionalShowHide",arrayName:"alternativeDimensions",itemPath:"qCalcCondition"})}};t.default={hypercube:E,colorChart:K,axisChart:J,quarantineProperty:g,unquarantineProperty:D,quarantineArrayProp:Q,unquarantineArrayProp:ee,conditionalColoring:te,conditionalShow:ne}}])}(Om);var Im=n(Om.exports);const Pm={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(Pm);const Lm={version:"0.35.1",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:Pm.AUTO,binCount:"",binSize:Pm.BIN_SIZE,offset:Pm.OFFSET,countDistinct:Pm.COUNT_DISTINCT,binMode:Pm.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function jm(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function Fm(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,s,a=[],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)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||Hm(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 zm(e){return function(e){if(Array.isArray(e))return Bm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Hm(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 Hm(e,t){if(e){if("string"==typeof e)return Bm(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)?Bm(e,t):void 0}}function Bm(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}var Vm,$m=Object.prototype.hasOwnProperty,Wm=Object.prototype.toString,Um=Object.defineProperty,Ym=Object.getOwnPropertyDescriptor,Km=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Wm.call(e)},Xm=function(e){if(!e||"[object Object]"!==Wm.call(e))return!1;var t,n=$m.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&$m.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||$m.call(e,t)},Gm=function(e,t){Um&&"__proto__"===t.name?Um(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Jm=function(e,t){if("__proto__"===t){if(!$m.call(e,t))return;if(Ym)return Ym(e,t).value}return e[t]};function Zm(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Qm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ey(){}Vm=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Jm(a,n),a!==(i=Jm(t,n))&&(u&&i&&(Xm(i)||(o=Km(i)))?(o?(o=!1,s=r&&Km(r)?r:[]):s=r&&Xm(r)?r:{},Gm(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Gm(a,{name:n,newValue:i}));return a},Vm&&Vm.__esModule&&Object.prototype.hasOwnProperty.call(Vm,"default")&&Vm.default;var ty=1/.7,ny="\\s*([+-]?\\d+)\\s*",ry="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",iy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",oy=/^#([0-9a-f]{3,8})$/,sy=new RegExp(`^rgb\\(${ny},${ny},${ny}\\)$`),ay=new RegExp(`^rgb\\(${iy},${iy},${iy}\\)$`),ly=new RegExp(`^rgba\\(${ny},${ny},${ny},${ry}\\)$`),cy=new RegExp(`^rgba\\(${iy},${iy},${iy},${ry}\\)$`),uy=new RegExp(`^hsl\\(${ry},${iy},${iy}\\)$`),dy=new RegExp(`^hsla\\(${ry},${iy},${iy},${ry}\\)$`),hy={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 fy(){return this.rgb().formatHex()}function py(){return this.rgb().formatRgb()}function gy(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=oy.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?my(t):3===n?new xy(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?yy(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?yy(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=sy.exec(e))?new xy(t[1],t[2],t[3],1):(t=ay.exec(e))?new xy(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ly.exec(e))?yy(t[1],t[2],t[3],t[4]):(t=cy.exec(e))?yy(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=uy.exec(e))?qy(t[1],t[2]/100,t[3]/100,1):(t=dy.exec(e))?qy(t[1],t[2]/100,t[3]/100,t[4]):hy.hasOwnProperty(e)?my(hy[e]):"transparent"===e?new xy(NaN,NaN,NaN,0):null}function my(e){return new xy(e>>16&255,e>>8&255,255&e,1)}function yy(e,t,n,r){return r<=0&&(e=t=n=NaN),new xy(e,t,n,r)}function by(e){return e instanceof ey||(e=gy(e)),e?new xy((e=e.rgb()).r,e.g,e.b,e.opacity):new xy}function vy(e,t,n,r){return 1===arguments.length?by(e):new xy(e,t,n,null==r?1:r)}function xy(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function wy(){return`#${Sy(this.r)}${Sy(this.g)}${Sy(this.b)}`}function My(){const e=ky(this.opacity);return`${1===e?"rgb(":"rgba("}${_y(this.r)}, ${_y(this.g)}, ${_y(this.b)}${1===e?")":`, ${e})`}`}function ky(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function _y(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Sy(e){return((e=_y(e))<16?"0":"")+e.toString(16)}function qy(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ey(e,t,n,r)}function Dy(e){if(e instanceof Ey)return new Ey(e.h,e.s,e.l,e.opacity);if(e instanceof ey||(e=gy(e)),!e)return new Ey;if(e instanceof Ey)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),s=NaN,a=o-i,l=(o+i)/2;return a?(s=t===o?(n-r)/a+6*(n<r):n===o?(r-t)/a+2:(t-n)/a+4,a/=l<.5?o+i:2-o-i,s*=60):a=l>0&&l<1?0:s,new Ey(s,a,l,e.opacity)}function Ey(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Cy(e){return(e=(e||0)%360)<0?e+360:e}function Ay(e){return Math.max(0,Math.min(1,e||0))}function Ty(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Zm(ey,gy,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:fy,formatHex:fy,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Dy(this).formatHsl()},formatRgb:py,toString:py}),Zm(xy,vy,Qm(ey,{brighter(e){return e=null==e?ty:Math.pow(ty,e),new xy(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new xy(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xy(_y(this.r),_y(this.g),_y(this.b),ky(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:wy,formatHex:wy,formatHex8:function(){return`#${Sy(this.r)}${Sy(this.g)}${Sy(this.b)}${Sy(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:My,toString:My})),Zm(Ey,(function(e,t,n,r){return 1===arguments.length?Dy(e):new Ey(e,t,n,null==r?1:r)}),Qm(ey,{brighter(e){return e=null==e?ty:Math.pow(ty,e),new Ey(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Ey(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 xy(Ty(e>=240?e-240:e+120,i,r),Ty(e,i,r),Ty(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ey(Cy(this.h),Ay(this.s),Ay(this.l),ky(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=ky(this.opacity);return`${1===e?"hsl(":"hsla("}${Cy(this.h)}, ${100*Ay(this.s)}%, ${100*Ay(this.l)}%${1===e?")":`, ${e})`}`}}));const Ny=Math.PI/180,Ry=180/Math.PI,Oy=4/29,Iy=6/29,Py=3*Iy*Iy;function Ly(e){if(e instanceof jy)return new jy(e.l,e.a,e.b,e.opacity);if(e instanceof Vy)return $y(e);e instanceof xy||(e=by(e));var t,n,r=By(e.r),i=By(e.g),o=By(e.b),s=Fy((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=s:(t=Fy((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Fy((.0139322*r+.0971045*i+.7141733*o)/.82521)),new jy(116*s-16,500*(t-s),200*(s-n),e.opacity)}function jy(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Fy(e){return e>.008856451679035631?Math.pow(e,1/3):e/Py+Oy}function zy(e){return e>Iy?e*e*e:Py*(e-Oy)}function Hy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function By(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Vy(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function $y(e){if(isNaN(e.h))return new jy(e.l,0,0,e.opacity);var t=e.h*Ny;return new jy(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Zm(jy,(function(e,t,n,r){return 1===arguments.length?Ly(e):new jy(e,t,n,null==r?1:r)}),Qm(ey,{brighter(e){return new jy(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new jy(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new xy(Hy(3.1338561*(t=.96422*zy(t))-1.6168667*(e=1*zy(e))-.4906146*(n=.82521*zy(n))),Hy(-.9787684*t+1.9161415*e+.033454*n),Hy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Zm(Vy,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Vy)return new Vy(e.h,e.c,e.l,e.opacity);if(e instanceof jy||(e=Ly(e)),0===e.a&&0===e.b)return new Vy(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ry;return new Vy(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Vy(e,t,n,null==r?1:r)}),Qm(ey,{brighter(e){return new Vy(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Vy(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return $y(this).rgb()}}));var Wy=e=>()=>e;function Uy(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Wy(isNaN(e)?t:e)}function Yy(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var s=r[o];if(void 0===i[s])return n;i=i[s]}return i}!function e(t){var n=function(e){return 1==(e=+e)?Uy: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):Wy(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=vy(e)).r,(t=vy(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),s=Uy(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=s(t),e+""}}return r.gamma=e,r}(1);var Ky,Xy=["__proto__","constructor"];function Gy(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!Xy.some((function(e){return r.includes(e)}))){for(var o=e,s=0;s<r.length-1;++s){var a=r[s];void 0===o[a]&&(o[a]=Number.isNaN(+r[s+1])?{}:[]),o=o[a]}void 0!==n?o[i]=n:delete o[i]}}}function Jy(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 Zy(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=eb)):void 0===t&&(t=Qy);for(var n,r,i,o,s,a=new rb(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new rb(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(nb)}function Qy(e){return e.children}function eb(e){return Array.isArray(e)?e[1]:null}function tb(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function nb(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function rb(e){this.data=e,this.depth=this.height=0,this.parent=null}rb.prototype=Zy.prototype={constructor:rb,count:function(){return this.eachAfter(Jy)},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,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,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;for(e=n.pop(),t=r.pop();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 Zy(this).eachBefore(tb)},[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)}},Ky=function(e){
25
25
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
26
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,h):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)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(g="",y=(d=t[0]).length%l,h=d.length,v=0;v<h;v++)g+=d.charAt(v),!((v-y+1)%l)&&v<h-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Ky({exports:{}});var ib="'Source Sans Pro', 'Arial', 'sans-serif'",ob="#333333",sb="#595959",ab="#737373",lb="#cccccc",cb="#e6e6e6";function ub(e){var t={};return[].concat(zm(e),zm([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",sb],["object","axis.label.name","fontFamily",ib],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",lb],["object","axis.line.minor","color",cb],["object","axis.title","color"],["object","axis.title","fontFamily",ib],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",cb],["object","grid.line.major","color",lb],["object","grid.line.minor","color",cb],["object","label.value","color",sb],["object","label.value","fontFamily",ib],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",sb],[!1,"label.value","lightColor",cb],["object","outOfRange","color","#999"],["object","legend.title","color",ob],["object","legend.title","fontFamily",ib],["object","legend.title","fontSize","15px"],["object","legend.label","color",sb],["object","legend.label","fontFamily",ib],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",ob],["object","referenceLine.label.name","fontFamily",ib],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",cb],["object","referenceLine.outOfBounds","fontFamily",ib],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",ab,function(e){return"transparent"===e?ab:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var db=function(e){return e};function hb(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce((function(e,t){var n=Fm(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Fm(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],d=void 0===u?function(e){return e}:u,h=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||db)(d(h));Gy(s,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Fm(e,2),n=t[0],r=t[1];Gy(s,n,r)})),s}var fb=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],pb=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var gb=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function mb(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,zm(new Set([r].concat(zm(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(zm(o.map((function(e){return gb(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],zm(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?pb:fb}(i).map((function(e){return gb(e)}))))}function yb(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return mb({theme:t,translator:n,defaultValue:s(),flags:o})}}}var bb=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],vb=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function xb(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,zm(new Set([n].concat(zm(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(zm(r.map((function(e){return vb(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],zm(bb.map((function(e){return vb(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function wb(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:yb({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:xb({theme:t,translator:n,id:r,path:i})}}function Mb(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=wb({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var u=function(e){for(var t=e.split("."),n=c,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 c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var kb=Object.prototype.hasOwnProperty,_b=Object.prototype.toString,Sb=Object.defineProperty,qb=Object.getOwnPropertyDescriptor,Db=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===_b.call(e)},Eb=function(e){if(!e||"[object Object]"!==_b.call(e))return!1;var t,n=kb.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&kb.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||kb.call(e,t)},Cb=function(e,t){Sb&&"__proto__"===t.name?Sb(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ab=function(e,t){if("__proto__"===t){if(!kb.call(e,t))return;if(qb)return qb(e,t).value}return e[t]},Tb=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Ab(a,n),a!==(i=Ab(t,n))&&(u&&i&&(Eb(i)||(o=Db(i)))?(o?(o=!1,s=r&&Db(r)?r:[]):s=r&&Eb(r)?r:{},Cb(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Cb(a,{name:n,newValue:i}));return a},Nb=n(Tb);const Rb=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Ob=function(){};Ob.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Rb.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const Ib={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function Pb(){return Ib.id()}const Lb="scrollbar";function jb(e,t,n){return"y"===e?Fb(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Fb(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var zb={getAxisDock:jb,getOppositeAxisDock:function(e,t,n){return jb(e,"far"===t?"near":"far",n)},getYAxisDock:Fb};const Hb=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Bb=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Vb=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function $b(e){return Hb.test(e)}function Wb(e){return Bb.test(e)||Vb.test(e)}var Ub={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],$b(r))return"ltr";if(Wb(r))return"rtl"}return"ltr"}};var Yb={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return Nb(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Nb(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${Ub.lrm}(${n})${Ub.lrm}`:`${Ub.lrm}(${n})${Ub.lrm}`:!1!==e.showLabel?t:""}};const Kb={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};Kb.DEFAULT_CHART_ORIENTATION=Kb.HORIZONTAL;const Xb=100;function Gb(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||Kb.DEFAULT_CHART_ORIENTATION,s=o===Kb.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=Kb.SHOW_AXIS_LABELS_OPTIONS,u=Kb.SHOW_TITLE_OPTIONS,d=c.includes(r.show),h=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(d&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Nb(i,Kb.LAYOUTSETTINGS.measureAxis);const o=Zb(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),h&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Nb(r,Kb.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return Zb(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Nb(!0,i||{},{component:{ticks:{distance:r.spacing*Xb}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Nb(r,Kb.LAYOUTSETTINGS.dimensionAxis);const i=Qb(t,n);Nb(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Nb(r,Kb.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Qb(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Kb.HORIZONTAL?Kb.VERTICAL:Kb.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),g&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Nb(r,Kb.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=Nb({},Kb.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),Jb(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===Lb))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Lb).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Lb).emit("panStart",e)},pan(e){this.chart.component(Lb).emit("panMove",e)},panend(e){this.chart.component(Lb).emit("panEnd",e)},pancancel(e){this.chart.component(Lb).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=zb.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Nb(o,Kb.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Pb()}`,require:["renderer","chart"],dock:zb.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Nb(s,Kb.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=Nb(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=Yb.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=Yb.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Kb.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Nb(o,Kb.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,Qb(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Nb(o,Kb.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,Zb(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Nb(o,Kb.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,Qb(n,l).dock,n.isRtl)}n.brushActions&&Jb(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Jb(e,t){t.forEach((t=>{e.push(t)}))}function Zb(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Qb(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function ev(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Nb(!0,{},o,e||{})}function tv(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function nv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),d=t.theme.getStyle(n,"axis.title","fontFamily"),h=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:tv(t.flags),dock:zb.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:d,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:h,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Nb(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function rv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:zb.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Nb(!0,{},c,e||{})}ev.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=ev(Nb(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},ev.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return ev(Nb(!0,n,e||{}),t)},nv.xAxis=function(e,t){return nv(Nb(!0,{key:"x-axis",scale:"x"},e||{}),t)},nv.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:zb.getYAxisDock(n,r)};return nv(Nb(!0,i,e||{}),t)},rv.xAxisTitle=function(e,t){return rv(Nb(!0,{key:"x-axis-title"},e||{}),t)},rv.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:zb.getYAxisDock(n,r)||"left"};return rv(Nb(!0,i,e||{}),t)};var iv={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const ov={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function sv(){return ov}function av(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}sv.getLayoutModeKeys=function(){const e=[];let t;for(t in ov)e.push(t);return e};const lv={left:"left",right:"right",up:"top",down:"bottom"};function cv(e,t,n){switch(e){case"scale":return ev(t,n);case"measure-scale":return ev.measureScale(t,n);case"dimension-scale":return ev.dimensionScale(t,n);case"axis":return nv(t,n);case"box-marker":return function(e){return Nb(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Nb(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Nb(!0,{},o,e||{})}(t,n);case"text":return rv(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),Nb(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:iv.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:iv.getBublesAlign(s,a,l)}}};return Nb(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let d=!0;const h={type:"brush-area-dir",key:"area",displayOrder:99,dock:iv.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:iv.getBublesAlign(a,l,c),label:e=>d?(d=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(d=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{h.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Nb(!0,{},h,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),d=t.theme.getStyle(n,"legend.label","fontFamily"),h={key:"legend",type:"legend-cat",renderer:tv(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${lv[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:d,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return Nb(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function d(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const h={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:d(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Nb(!0,{},h,e)}(t,n);case"x-axis":return nv.xAxis(t,n);case"y-axis":return nv.yAxis(t,n);case"x-axis-title":return rv.xAxisTitle(t,n);case"y-axis-title":return rv.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Nb(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Nb(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Nb(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Nb(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:tv(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:av}]}}}]}};return Nb(!0,{},s,e||{})}(t,n);default:return}}function uv(e){this.options=e||{},this.settings={dockLayout:{layoutModes:sv()},components:[],scales:{}}}uv.prototype.addComponent=function(e,t,n){const r=cv(e,t,Nb(!0,{},this.options,n||{}));return this.settings.components.push(r),r},uv.prototype.addInteraction=function(e,t){const n=cv("interaction",e,Nb(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},uv.prototype.addScale=function(e,t,n){const r=cv(e,t,Nb(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},uv.prototype.getSettings=function(){return this.settings},uv.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},uv.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");Gb(t,n)}(e,this,t)},uv.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},uv.create=function(e){return new uv(e)},uv.createComponent=cv;const dv={CENTER:0,BOTTOM:1};var hv={DISCLAIMERS:[{label:"NoDataExist",alignment:dv.CENTER,default:!0},{label:"RequireNumericDimension",alignment:dv.CENTER,default:!1},{label:"OnlyNanData",alignment:dv.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:dv.CENTER,default:!1},{label:"LimitedData",alignment:dv.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:dv.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:dv.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:dv.BOTTOM,default:!1}],ALIGNMENT:dv};const fv={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,hv.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function pv(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function gv(e,t){return e&&t&&t[e]}function mv(e){this.environment=e,this.clear()}pv.prototype.isValidAndSupported=function(e,t){return gv(e.label,this.dataAttributes)&&(e.default||gv(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},pv.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},pv.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)})),n},mv.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},mv._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},mv.prototype.getComponentSettings=function(){var e,t;const{translator:n}=this.environment,r=Nb(!0,{},this.vizAttributes.supportedDisclaimers),i=new pv(hv.DISCLAIMERS,this.dataAttributes,r);let o,s;if(i.isAnyValidDisclaimer(hv.ALIGNMENT.CENTER))o=i.getMessage(hv.ALIGNMENT.CENTER,n),s="center";else{if(!i.isAnyValidDisclaimer(hv.ALIGNMENT.BOTTOM))return;o=i.getMessage(hv.ALIGNMENT.BOTTOM,n),s="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:s},settings:{label:o,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(t=e.options)||void 0===t?void 0:t.direction)}}},mv.prototype.set=function(e){if(this.clear(),!e)throw new Error(mv.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=fv.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},mv.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const yv=Ob.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new mv(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[uv.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),uv.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Nb(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Yy(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var bv={exports:{}};!function(e,n){e.exports=function(){function e(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 n(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:String(t)}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},d=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},h=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(d(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&d(r)?r:{},h(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&h(a,{name:n,newValue:i}));return a};function g(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function m(e,t,n){let{key:r}=n;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 y(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:d,columnOrder:h}=e,f=r;if(i.field&&i.field!==n){const e=g(i.field,s,{cache:t},h);if(-1===e)return;f=p({qRow:a},e(l))}u[d]=m(i,f,{key:c})}function b(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 s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),h=!!i[e].trackBy,f=typeof i[e].trackBy,b={},v=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=g(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let g=0;g<s.qDataPages[t].qMatrix.length;g++){const w=s.qDataPages[t].qArea.qTop+g,M=p({qRow:w},o(s.qDataPages[t].qMatrix[g])),k=m(u,M,{key:a});if(!u.filter||u.filter(M)){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(k[d[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:M,p:i[o],prop:d[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[g],sourceKey:a,target:r.fields?k[d[e]]:k,targetProp:r.fields?o:d[e],columnOrder:s.qColumnOrder});if(r.fields){const t=k[d[e]].map((e=>e.value)),n=k[d[e]].map((e=>e.label));k[d[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(k[d[e]].value)}}}h&&r.track({cfg:i[e],itemData:M,obj:k,target:v,tracker:b,trackType:f}),x.push(k)}}}const w=h?r.collect(v,{main:u,propsArr:d,props:c}):x;o=[...o,...w]}return o}function v(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 x(){return this.eachAfter(v)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function M(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function k(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function _(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function S(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}))}function q(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function D(e){for(var t=this,n=E(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}function E(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function C(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function N(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*R(){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)}function O(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new z(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new z(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(F)}function I(){return O(this).eachBefore(j)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function j(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function F(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function z(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}z.prototype=O.prototype={constructor:z,count:x,each:w,eachAfter:k,eachBefore:M,find:_,sum:S,sort:q,path:D,ancestors:C,descendants:A,leaves:T,links:N,copy:I,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,d,h=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=h.map(((t,n)=>X(e(t,n,r)))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),h.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=h.length;s<i;++s)o=h[s],c=h[s]=new z(o),null!=(u=f(o,s,r))&&(u+="")&&(d=c.id=u,g.set(d,g.has(d)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=h[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=h.length-1;e>=0&&(c=h[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(F),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Z(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=Z(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]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(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,...Q(e[i].children,t-1,n)]);return r}function ee(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=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;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))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,d=r;const h=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(d)&&(i=!0,o=+ne.exec(d)[1],d=r.replace(ne,"")),re.test(d)&&("K"===n.qMode?c=+re.exec(d)[1]:h&&-1!==h.indexOf(-1)?(c=+re.exec(d)[1],u=0):u=+re.exec(d)[1],d=d.replace(re,"")),d&&(oe.exec(d)?a=+oe.exec(d)[1]:ie.exec(d)&&(s=+ie.exec(d)[1])),l=i?"S"===n.qMode?f[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(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 ue(e,t,n){let{key:r}=n;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 de(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let h,f,p,g,m,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(h=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(g=d.accessor(r),Array.isArray(g)?(m=g.map(d.valueAccessor),d.attrAccessor&&(m=m.map(d.attrAccessor)),h&&(p=m.map(h),h=null),f&&(y=m.map(f),f=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(g)):d.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=h?h(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=h?h(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const he=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=O(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=se(e),i=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e])),u=K().id((e=>e.__id)).parentId((e=>e.__parent))(c);return u}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):he(o,r,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:u}=i.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),d=Object.keys(l);c[s]={propsArr:d,props:l,main:u};const h=a?le(a,{cube:o,cache:r}):{fieldDepth:0};pe({propsArr:d,props:l,cube:o,cache:r,itemDepthObject:h,f:a})}const u=a.copy().descendants(),d=a.descendants();for(let e=0;e<d.length;e++){const t=c[d[e].depth].propsArr,n=c[d[e].depth].props,r=c[d[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});de({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s,isTree:!0}),d[e].data=a}return a}function me(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!he(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:d}=r.normalizeConfig(i[s],t),h=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:g,valueFn:m}=ce({fieldDepth:0},f);pe({propsArr:h,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(d.filter&&!d.filter(n))continue;const o=ue(d,n,{key:l});de({propsArr:h,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),M.push(o)}const k=y?r.collect(x,{main:d,propsArr:h,props:u}):M;o=[...o,...k]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var be=ye((function(e){
26
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,h):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)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(g="",y=(d=t[0]).length%l,h=d.length,v=0;v<h;v++)g+=d.charAt(v),!((v-y+1)%l)&&v<h-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},Ky({exports:{}});var ib="'Source Sans Pro', 'Arial', 'sans-serif'",ob="#333333",sb="#595959",ab="#737373",lb="#cccccc",cb="#e6e6e6";function ub(e){var t={};return[].concat(zm(e),zm([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",sb],["object","axis.label.name","fontFamily",ib],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",lb],["object","axis.line.minor","color",cb],["object","axis.title","color"],["object","axis.title","fontFamily",ib],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",cb],["object","grid.line.major","color",lb],["object","grid.line.minor","color",cb],["object","label.value","color",sb],["object","label.value","fontFamily",ib],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",sb],[!1,"label.value","lightColor",cb],["object","outOfRange","color","#999"],["object","legend.title","color",ob],["object","legend.title","fontFamily",ib],["object","legend.title","fontSize","15px"],["object","legend.label","color",sb],["object","legend.label","fontFamily",ib],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",ob],["object","referenceLine.label.name","fontFamily",ib],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",cb],["object","referenceLine.outOfBounds","fontFamily",ib],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",ab,function(e){return"transparent"===e?ab:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var db=function(e){return e};function hb(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,s={},a=r.reduce((function(e,t){var n=Fm(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=Fm(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],d=void 0===u?function(e){return e}:u,h=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,s=void 0===o?void 0:o;if(!t||!1===n)return s;var a=t.getStyle(n,r,i);return void 0===a?s:a}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),f=(a["".concat(o,".").concat(l)]||db)(d(h));Gy(s,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=Fm(e,2),n=t[0],r=t[1];Gy(s,n,r)})),s}var fb=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],pb=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var gb=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function mb(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],s=t.getStyle("","","fontFamilies");return Array.isArray(s)&&s.length?o.push.apply(o,zm(new Set([r].concat(zm(s.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(zm(o.map((function(e){return gb(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],zm(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?pb:fb}(i).map((function(e){return gb(e)}))))}function yb(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,s=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return s()},getOptions:function(){return mb({theme:t,translator:n,defaultValue:s(),flags:o})}}}var bb=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],vb=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function xb(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,zm(new Set([n].concat(zm(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(zm(r.map((function(e){return vb(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],zm(bb.map((function(e){return vb(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function wb(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:yb({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:xb({theme:t,translator:n,id:r,path:i})}}function Mb(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,s=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),a=s.id,l=s.paths,c={};l.forEach((function(e){for(var r=e.split("."),i=c,s=0;s<r.length;s++){var l=r[s];s===r.length-1?i[l]=wb({theme:t,translator:n,id:a,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var u=function(e){for(var t=e.split("."),n=c,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 c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}var kb=Object.prototype.hasOwnProperty,_b=Object.prototype.toString,Sb=Object.defineProperty,qb=Object.getOwnPropertyDescriptor,Db=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===_b.call(e)},Eb=function(e){if(!e||"[object Object]"!==_b.call(e))return!1;var t,n=kb.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&kb.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||kb.call(e,t)},Cb=function(e,t){Sb&&"__proto__"===t.name?Sb(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Ab=function(e,t){if("__proto__"===t){if(!kb.call(e,t))return;if(qb)return qb(e,t).value}return e[t]},Tb=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Ab(a,n),a!==(i=Ab(t,n))&&(u&&i&&(Eb(i)||(o=Db(i)))?(o?(o=!1,s=r&&Db(r)?r:[]):s=r&&Eb(r)?r:{},Cb(a,{name:n,newValue:e(u,s,i)})):void 0!==i&&Cb(a,{name:n,newValue:i}));return a},Nb=n(Tb);const Rb=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Ob=function(){};Ob.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Rb.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const Ib={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function Pb(){return Ib.id()}const Lb="scrollbar";function jb(e,t,n){return"y"===e?Fb(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Fb(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var zb={getAxisDock:jb,getOppositeAxisDock:function(e,t,n){return jb(e,"far"===t?"near":"far",n)},getYAxisDock:Fb};const Hb=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Bb=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Vb=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function $b(e){return Hb.test(e)}function Wb(e){return Bb.test(e)||Vb.test(e)}var Ub={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],$b(r))return"ltr";if(Wb(r))return"rtl"}return"ltr"}};var Yb={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return Nb(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),Nb(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${Ub.lrm}(${n})${Ub.lrm}`:`${Ub.lrm}(${n})${Ub.lrm}`:!1!==e.showLabel?t:""}};const Kb={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};Kb.DEFAULT_CHART_ORIENTATION=Kb.HORIZONTAL;const Xb=100;function Gb(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||Kb.DEFAULT_CHART_ORIENTATION,s=o===Kb.HORIZONTAL,a=s?"x":"y",l=s?"y":"x",c=Kb.SHOW_AXIS_LABELS_OPTIONS,u=Kb.SHOW_TITLE_OPTIONS,d=c.includes(r.show),h=!!n.measureTitleText&&u.includes(r.show),f=n.includeDimensionAxis&&c.includes(i.show),p=n.includeDimensionAxis&&!!n.dimensionTitleText&&u.includes(i.show),g=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),m=n.refLines&&n.refLines.some((e=>e.show)),y=[];if(d&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=Nb(i,Kb.LAYOUTSETTINGS.measureAxis);const o=Zb(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,a,r),h&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=Nb(r,Kb.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return Zb(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,a),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=Nb(!0,i||{},{component:{ticks:{distance:r.spacing*Xb}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=Nb(r,Kb.LAYOUTSETTINGS.dimensionAxis);const i=Qb(t,n);Nb(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),p&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=Nb(r,Kb.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Qb(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Kb.HORIZONTAL?Kb.VERTICAL:Kb.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),g&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=Nb(r,Kb.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,a),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},s=Nb({},Kb.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",s,o),Jb(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===Lb))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Lb).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Lb).emit("panStart",e)},pan(e){this.chart.component(Lb).emit("panMove",e)},panend(e){this.chart.component(Lb).emit("panEnd",e)},pancancel(e){this.chart.component(Lb).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,s),m&&function(e,t,n,r){const i=zb.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=Nb(o,Kb.LAYOUTSETTINGS.refLines);let s={key:`ref-line-labels-${Pb()}`,require:["renderer","chart"],dock:zb.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=s.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const a=12;return o.required+a>100?o.required+a:Math.min(o.wanted+a,100)},lines:{x:[],y:[]}};s=Nb(s,Kb.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const a=r.refLineExpr&&r.refLineExpr.value,l=Nb(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),c=Yb.lineSettings({scale:"measure",dir:n,value:a},l);o.lines[n].push(c);const u=Yb.lineLabelSettings({scale:"measure",value:a,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?u.label.vAlign="near"===i?1:0:u.label.align="near"===i?0:1,s.lines[n].push(u)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",s,{})}(e,n,a,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Kb.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=Nb(o,Kb.LAYOUTSETTINGS.rangeDim);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.dimRange||{},s,Qb(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=Nb(o,Kb.LAYOUTSETTINGS.rangeMeasure);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,s)}(e,n.measureRange||{},s,Zb(n,a).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=Nb(o,Kb.LAYOUTSETTINGS.rangeMinor);const s={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,s)}(e,n.areaRange||{},s,Qb(n,l).dock,n.isRtl)}n.brushActions&&Jb(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function Jb(e,t){t.forEach((t=>{e.push(t)}))}function Zb(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Qb(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function ev(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return Nb(!0,{},o,e||{})}function tv(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function nv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.line.major","color"),a=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),c=t.theme.getStyle(n,"axis.label.name","color"),u=t.theme.getStyle(n,"axis.label.name","fontSize"),d=t.theme.getStyle(n,"axis.title","fontFamily"),h=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:tv(t.flags),dock:zb.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:a,fontFamily:d,fill:l},line:{show:!0,strokeWidth:1,stroke:s},labels:{fill:c,fontSize:u,fontFamily:h,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:s},minorTicks:{stroke:s}}},p=Nb(!0,{},f,e||{});return p.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),p}function rv(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,s=t.theme.getStyle(n,"axis.title","fontSize"),a=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),c={key:"text",type:"text",dock:zb.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:s,fontFamily:l,fill:a}}};return Nb(!0,{},c,e||{})}ev.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=ev(Nb(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},ev.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return ev(Nb(!0,n,e||{}),t)},nv.xAxis=function(e,t){return nv(Nb(!0,{key:"x-axis",scale:"x"},e||{}),t)},nv.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:zb.getYAxisDock(n,r)};return nv(Nb(!0,i,e||{}),t)},rv.xAxisTitle=function(e,t){return rv(Nb(!0,{key:"x-axis-title"},e||{}),t)},rv.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:zb.getYAxisDock(n,r)||"left"};return rv(Nb(!0,i,e||{}),t)};var iv={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const ov={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function sv(){return ov}function av(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}sv.getLayoutModeKeys=function(){const e=[];let t;for(t in ov)e.push(t);return e};const lv={left:"left",right:"right",up:"top",down:"bottom"};function cv(e,t,n){switch(e){case"scale":return ev(t,n);case"measure-scale":return ev.measureScale(t,n);case"dimension-scale":return ev.dimensionScale(t,n);case"axis":return nv(t,n);case"box-marker":return function(e){return Nb(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return Nb(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return Nb(!0,{},o,e||{})}(t,n);case"text":return rv(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),Nb(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,s=t&&t.isHorizontal,a=t&&t.dock,l=t&&t.isRtl,c={type:"brush-range",key:"range",displayOrder:99,dock:iv.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:iv.getBublesAlign(s,a,l)}}};return Nb(!0,{},c,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],s=t&&t.brushArea,a=t&&t.isHorizontal,l=t&&t.dock,c=t&&t.isRtl,u=t&&t.chartInstance;let d=!0;const h={type:"brush-area-dir",key:"area",displayOrder:99,dock:iv.getDock(r,s),settings:{brush:{components:[]},direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:iv.getBublesAlign(a,l,c),label:e=>d?(d=!1,u.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(d=!0,u.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{h.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),Nb(!0,{},h,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const s=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.title","fontFamily"),d=t.theme.getStyle(n,"legend.label","fontFamily"),h={key:"legend",type:"legend-cat",renderer:tv(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${lv[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:c,fontFamily:d,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(c,10)/4}},title:{show:t.showTitle,fontSize:a,fontFamily:u,fill:s}}};return Nb(!0,{},h,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),a=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),c=t.theme.getStyle(n,"legend.label","fontSize"),u=t.theme.getStyle(n,"legend.label","fontFamily");function d(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const h={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:d(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:s,fontFamily:a,fill:o},tick:{fill:l,fontSize:c,fontFamily:u}}};return Nb(!0,{},h,e)}(t,n);case"x-axis":return nv.xAxis(t,n);case"y-axis":return nv.yAxis(t,n);case"x-axis-title":return rv.xAxisTitle(t,n);case"y-axis-title":return rv.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return Nb(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return Nb(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return Nb(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return Nb(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),s={key:"labels",type:"labels",renderer:tv(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:av}]}}}]}};return Nb(!0,{},s,e||{})}(t,n);default:return}}function uv(e){this.options=e||{},this.settings={dockLayout:{layoutModes:sv()},components:[],scales:{}}}uv.prototype.addComponent=function(e,t,n){const r=cv(e,t,Nb(!0,{},this.options,n||{}));return this.settings.components.push(r),r},uv.prototype.addInteraction=function(e,t){const n=cv("interaction",e,Nb(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},uv.prototype.addScale=function(e,t,n){const r=cv(e,t,Nb(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},uv.prototype.getSettings=function(){return this.settings},uv.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},uv.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");Gb(t,n)}(e,this,t)},uv.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},uv.create=function(e){return new uv(e)},uv.createComponent=cv;const dv={CENTER:0,BOTTOM:1};var hv={DISCLAIMERS:[{label:"NoDataExist",alignment:dv.CENTER,default:!0},{label:"RequireNumericDimension",alignment:dv.CENTER,default:!1},{label:"OnlyNanData",alignment:dv.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:dv.CENTER,default:!1},{label:"LimitedData",alignment:dv.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:dv.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:dv.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:dv.BOTTOM,default:!1}],ALIGNMENT:dv};const fv={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,s,a;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,r=0;r<n;r++)if(s=Math.min(s,t[r].qMin),a=Math.max(a,t[r].qMax),s<=0&&a>=0)return!0;return s=i?e.min:s,a=o?e.max:a,s<=0&&a>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,hv.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function pv(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function gv(e,t){return e&&t&&t[e]}function mv(e){this.environment=e,this.clear()}pv.prototype.isValidAndSupported=function(e,t){return gv(e.label,this.dataAttributes)&&(e.default||gv(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},pv.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},pv.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)})),n},mv.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},mv._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},mv.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=Nb(!0,{},this.vizAttributes.supportedDisclaimers),r=new pv(hv.DISCLAIMERS,this.dataAttributes,n);let i,o;if(r.isAnyValidDisclaimer(hv.ALIGNMENT.CENTER))i=r.getMessage(hv.ALIGNMENT.CENTER,t),o="center";else{if(!r.isAnyValidDisclaimer(hv.ALIGNMENT.BOTTOM))return;i=r.getMessage(hv.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:i,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},mv.prototype.set=function(e){if(this.clear(),!e)throw new Error(mv.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=fv.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},mv.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const yv=Ob.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new mv(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[uv.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),uv.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=Nb(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},s=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Yy(e,t.replace(/\//g,"."))})));this.colorService&&s.push(...this.colorService.getData()),this.chartInstance.update({data:s,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var bv={exports:{}};!function(e,n){e.exports=function(){function e(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 n(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function r(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=i(e,"string");return"symbol"==typeof t?t:String(t)}var s=Object.prototype.hasOwnProperty,a=Object.prototype.toString,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},d=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=s.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&s.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||s.call(e,t)},h=function(e,t){l&&"__proto__"===t.name?l(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},f=function(e,t){if("__proto__"===t){if(!s.call(e,t))return;if(c)return c(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,c=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=f(a,n),a!==(i=f(t,n))&&(p&&i&&(d(i)||(o=u(i)))?(o?(o=!1,s=r&&u(r)?r:[]):s=r&&d(r)?r:{},h(a,{name:n,newValue:e(p,s,i)})):void 0!==i&&h(a,{name:n,newValue:i}));return a};function g(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let s=i.fields.indexOf(e),a=-1,l=-1;if(-1===s)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),a=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==a){s=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(s);-1!==e&&(s=e)}return s-=t.qArea.qLeft,s<0||s>=t.qArea.qWidth?-1:l>=0?e=>e[s].qAttrDims.qValues[l]:a>=0?e=>e[s].qAttrExps.qValues[a]:e=>e[s]}function m(e,t,n){let{key:r}=n;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 y(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:s,rowIdx:a,row:l,sourceKey:c,target:u,targetProp:d,columnOrder:h}=e,f=r;if(i.field&&i.field!==n){const e=g(i.field,s,{cache:t},h);if(-1===e)return;f=p({qRow:a},e(l))}u[d]=m(i,f,{key:c})}function b(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 s=t.raw(),a=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),h=!!i[e].trackBy,f=typeof i[e].trackBy,b={},v=[],x=[];for(let t=0;t<s.qDataPages.length;t++){const o=g(l,s.qDataPages[t],{cache:n},s.qColumnOrder);if(-1!==o)for(let g=0;g<s.qDataPages[t].qMatrix.length;g++){const w=s.qDataPages[t].qArea.qTop+g,M=p({qRow:w},o(s.qDataPages[t].qMatrix[g])),k=m(u,M,{key:a});if(!u.filter||u.filter(M)){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(k[d[e]]=[]);for(let o=0;o<i.length;o++)y({cache:n,f:l,mainCell:M,p:i[o],prop:d[e],props:c,page:s.qDataPages[t],rowIdx:w,row:s.qDataPages[t].qMatrix[g],sourceKey:a,target:r.fields?k[d[e]]:k,targetProp:r.fields?o:d[e],columnOrder:s.qColumnOrder});if(r.fields){const t=k[d[e]].map((e=>e.value)),n=k[d[e]].map((e=>e.label));k[d[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(k[d[e]].value)}}}h&&r.track({cfg:i[e],itemData:M,obj:k,target:v,tracker:b,trackType:f}),x.push(k)}}}const w=h?r.collect(v,{main:u,propsArr:d,props:c}):x;o=[...o,...w]}return o}function v(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 x(){return this.eachAfter(v)}function w(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function M(e,t){for(var n,r,i=this,o=[i],s=-1;i=o.pop();)if(e.call(t,i,++s,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function k(e,t){for(var n,r,i,o=this,s=[o],a=[],l=-1;o=s.pop();)if(a.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)s.push(n[r]);for(;o=a.pop();)e.call(t,o,++l,this);return this}function _(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function S(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}))}function q(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function D(e){for(var t=this,n=E(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}function E(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function C(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function A(){return Array.from(this)}function T(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function N(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*R(){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)}function O(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=L)):void 0===t&&(t=P);for(var n,r,i,o,s,a=new z(e),l=[a];n=l.pop();)if((i=t(n.data))&&(s=(i=Array.from(i)).length))for(n.children=i,o=s-1;o>=0;--o)l.push(r=i[o]=new z(i[o])),r.parent=n,r.depth=n.depth+1;return a.eachBefore(F)}function I(){return O(this).eachBefore(j)}function P(e){return e.children}function L(e){return Array.isArray(e)?e[1]:null}function j(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function F(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function z(e){this.data=e,this.depth=this.height=0,this.parent=null}function H(e){return null==e?null:B(e)}function B(e){if("function"!=typeof e)throw new Error;return e}z.prototype=O.prototype={constructor:z,count:x,each:w,eachAfter:k,eachBefore:M,find:_,sum:S,sort:q,path:D,ancestors:C,descendants:A,leaves:T,links:N,copy:I,[Symbol.iterator]:R};var V={depth:-1},$={},W={};function U(e){return e.id}function Y(e){return e.parentId}function K(){var e,t=U,n=Y;function r(r){var i,o,s,a,l,c,u,d,h=Array.from(r),f=t,p=n,g=new Map;if(null!=e){const t=h.map(((t,n)=>X(e(t,n,r)))),n=t.map(G),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(G(e)),h.push(W));f=(e,n)=>t[n],p=(e,t)=>n[t]}for(s=0,i=h.length;s<i;++s)o=h[s],c=h[s]=new z(o),null!=(u=f(o,s,r))&&(u+="")&&(d=c.id=u,g.set(d,g.has(d)?$:c)),null!=(u=p(o,s,r))&&(u+="")&&(c.parent=u);for(s=0;s<i;++s)if(u=(c=h[s]).parent){if(!(l=g.get(u)))throw new Error("missing: "+u);if(l===$)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(a)throw new Error("multiple roots");a=c}if(!a)throw new Error("no root");if(null!=e){for(;a.data===W&&1===a.children.length;)a=a.children[0],--i;for(let e=h.length-1;e>=0&&(c=h[e]).data===W;--e)c.data=null}if(a.parent=V,a.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(F),a.parent=null,i>0)throw new Error("cycle");return a}return r.id=function(e){return arguments.length?(t=H(e),r):t},r.parentId=function(e){return arguments.length?(n=H(e),r):n},r.path=function(t){return arguments.length?(e=H(t),r):e},r}function X(e){let t=(e=`${e}`).length;return J(e,t-1)&&!J(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function G(e){let t=e.length;if(t<2)return"";for(;--t>1&&!J(e,t););return e.slice(0,t)}function J(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(0==(1&n))return!0}return!1}function Z(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=Z(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]=Z(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function Q(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,...Q(e[i].children,t-1,n)]);return r}function ee(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=>Q(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;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))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function se(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function ae(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,s=-1,a=-1,l=-1,c=-1,u=-1,d=r;const h=n.qEffectiveInterColumnSortOrder,f=ae(n);return ne.test(d)&&(i=!0,o=+ne.exec(d)[1],d=r.replace(ne,"")),re.test(d)&&("K"===n.qMode?c=+re.exec(d)[1]:h&&-1!==h.indexOf(-1)?(c=+re.exec(d)[1],u=0):u=+re.exec(d)[1],d=d.replace(re,"")),d&&(oe.exec(d)?a=+oe.exec(d)[1]:ie.exec(d)&&(s=+ie.exec(d)[1])),l=i?"S"===n.qMode?f[o]:h?h.indexOf(o):o:h&&-1!==h.indexOf(-1)?h.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:a,attrIdx:s}}function ce(e,t){let n,r,i=ee(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 ue(e,t,n){let{key:r}=n;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 de(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields||[a];let c,u;a.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let h,f,p,g,m,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(h=e=>d.value(e,r)),"function"==typeof d.label&&(f=e=>d.label(e,r)),d.accessor?(g=d.accessor(r),Array.isArray(g)?(m=g.map(d.valueAccessor),d.attrAccessor&&(m=m.map(d.attrAccessor)),h&&(p=m.map(h),h=null),f&&(y=m.map(f),f=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(g)):d.valueAccessor(g),y=p)):(p=i,y=i)),a.fields){const e=h?h(p):p;c.push(e),u.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=h?h(p):p;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:s})}}c&&(o[t[e]]={value:"function"==typeof a.value?a.value(c,r):c,label:"function"==typeof a.label?a.label(u,r):u})}}const he=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Z(r,e);return o&&o[0]?(t.tree=O(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=se(e),i=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),s=e.fields().filter((e=>"measure"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",c=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],s="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);a[s]||(a[s]=n({__id:s,__parent:i,qValues:[]},t),c=!0),i=s}if(c)for(let e=0;e<s.length;e++){const t=r[s[e]];a[i].qValues.push(t)}}const c=Object.keys(a).map((e=>a[e])),u=K().id((e=>e.__id)).parentId((e=>e.__parent))(c);return u}const pe=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:s}=e;for(let e=0;e<t.length;e++){const a=n[t[e]],l=a.fields?a.fields:[a];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==s){const e=ce(o,le(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),s=t.key(),a="S"===o.qMode?fe(t):he(o,r,e);if(!a)return null;const l=a.height,c=[];for(let s=0;s<=l;s++){let a=null;if(s>0)if("S"===o.qMode){let e=ae(o)[s-1];a=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[s-1];s>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),a=r.fields[e]}const{props:l,main:u}=i.normalizeConfig(n(n({},e),{},{field:a?a.key():void 0}),t),d=Object.keys(l);c[s]={propsArr:d,props:l,main:u};const h=a?le(a,{cube:o,cache:r}):{fieldDepth:0};pe({propsArr:d,props:l,cube:o,cache:r,itemDepthObject:h,f:a})}const u=a.copy().descendants(),d=a.descendants();for(let e=0;e<d.length;e++){const t=c[d[e].depth].propsArr,n=c[d[e].depth].props,r=c[d[e].depth].main,i=u[e],o=i.data,a=ue(r,o,{key:s});de({propsArr:t,props:n,item:i,itemData:o,ret:a,sourceKey:s,isTree:!0}),d[e].data=a}return a}function me(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let s=0;s<i.length;s++)if(void 0!==i[s].field){const a=t.raw(),l=t.key();if(!he(a,n,e))continue;const c="object"==typeof i[s].field?i[s].field:t.field(i[s].field),{props:u,main:d}=r.normalizeConfig(i[s],t),h=Object.keys(u),f=le(c,{cube:a,cache:n}),{nodeFn:p,attrFn:g,valueFn:m}=ce({fieldDepth:0},f);pe({propsArr:h,props:u,cube:a,cache:n,itemDepthObject:f,f:c});const y=!!i[s].trackBy,b=typeof i[s].trackBy,v={},x=[],w=p(n.tree),M=[];for(let e=0;e<w.length;e++){const t=w[e],n=g?g(m(t)):m(t);if(d.filter&&!d.filter(n))continue;const o=ue(d,n,{key:l});de({propsArr:h,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[s],itemData:n,obj:o,target:x,tracker:v,trackType:b}),M.push(o)}const k=y?r.collect(x,{main:d,propsArr:h,props:u}):M;o=[...o,...k]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==t||"undefined"!=typeof self&&self;var be=ye((function(e){
27
27
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
28
- !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,h):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)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(g="",y=(d=t[0]).length%l,h=d.length,v=0;v<h;v++)g+=d.charAt(v),!((v-y+1)%l)&&v<h-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));const ve=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={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"},Me=/%\)?$/,ke=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,_e=/^\(oct\)/i,Se=/^\(dec\)/i,qe=/^\(hex\)/i,De=/^\(bin\)/i,Ee=/^\(rom\)/i,Ce=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(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 Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Re(e,t,n){let r;return ke.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):_e.test(t)?e=Te(e,8,t,n):Se.test(t)?e=Te(e,10,t,n):qe.test(t)?e=Te(e,16,t,n):De.test(t)?e=Te(e,2,t,n):Ee.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Oe(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Ie(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,d,h,f=e.pattern;r&&(e.abbreviate=!0),h=Ie(t,n),s=f.match(h),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Oe(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Oe(u,"g"),n)),d=s.match(/#/g),d=d?d.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=Me.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Oe(t,null,!0),"|").concat(Oe(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class je{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=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new je(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],Ce.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ce.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ce.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,d="",h="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Re(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(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-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.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=be(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+ve).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)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)/,""),h=""):(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)))),a=0;a<t;a++)l+="#";e=be(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new je(...t)}function ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=Fe(i,e,t,n,r),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Be={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(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"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=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(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/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:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".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}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),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={[Be.TIME]:r.qTimeFmt||"hh:mm:ss",[Be.DATE]:r.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(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=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(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 a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Be.INTERVAL?rt(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=tt(i,e,t),r=ze(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 ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(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",s=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,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",d="dimension"===a?"first":"avg",h=ot(t,i),f="dimension"===a?"first":(e,t)=>h(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:d,reduceLabel:f,formatter:()=>h,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=me,a.hierarchy=ge,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=b,a.pages=o.qDataPages,a.hierarchy=ge):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const d=e=>{e.forEach((e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)}))};return d(i.wrappedFields),(r.virtualFields||[]).forEach((t=>{const r=l.field(t.from),o=st(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)})),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,dt=/\/qMeasureInfo\/(\d+)/,ht=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,gt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):gt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),dt.test(e)&&(i=+dt.exec(e)[1]),ht.test(e)){i=-1,r=0;const e=+ht.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vt(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=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=bt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.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,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.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,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.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,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.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&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=vt,xt.selections=vt,xt}()}(bv);var vv=n(bv.exports);const xv={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const wv={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Mv(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),vv.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const s=xv.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let d=!1;function h(e){16===e.keyCode&&e.shiftKey!==d&&(d=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach((e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function g(){s.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{s.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=Nb(!0,{},wv,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach((e=>{e!==a&&e.brush.end()}))},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&g(),s.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),s=[]},u.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},u.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},u.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",h),document.addEventListener("keyup",h);const e=()=>{s.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,g(),document.removeEventListener("keydown",h),document.removeEventListener("keyup",h),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},u}class kv{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var _v={create:e=>e.selectionsApi?Mv(e):new kv};function Sv(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var qv={create:(...e)=>Sv(...e)},Dv={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const Ev=-3;const Cv=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=Av(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Av(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)e[n]===Ev&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const Tv="dist-flow-tooltip",Nv=`#${Tv}`;function Rv(){if(!document.querySelector(Nv)){const e=document.createElement("div");e.id=Tv,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function Ov({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Rv()},beforeUpdate(){Rv()},destroyed(){!function(){const e=document.querySelector(Nv);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Nv),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:Iv}=Ub;const Pv={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Dv.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:Iv(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:Iv(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:Iv(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:Iv(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function Lv(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Nb(!0,{},Pv,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:qv.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=Ov({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:Cv(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{s(r[e])})),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var jv={create:(e,t,n)=>Lv(e,t,n)};const Fv={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Fv.generateHash(t)}};const zv={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:Bv(t),dimensionExpressions:Hv(t),measureExpressions:e})))}};function Hv(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Bv(e){const t=function(e){return Yy(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Vv={},$v=Nb.bind(null,!0);function Wv(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Uv=Array.isArray,Yv=function(e){return void 0===e},Kv=function(e){return"function"==typeof e};function Xv(e,t){return Kv(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Gv(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Yv(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Jv(e,t){if(Wv(e)&&Wv(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Jv(e[n],t[n]))return!1;return!0}if(Uv(e)&&Uv(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Jv(e[n],t[n]))return!1;return!0}return e===t}Vv.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=$v({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;Jv(o,s)||Xv(t,i)||(Yv(s)?r.push({op:"add",path:a,value:o}):Wv(o)&&Wv(s)?r=r.concat(Vv.generate(s,o,a)):Uv(o)&&Uv(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Yv(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Jv(t,i))return r;if(null===t[0]||!Yv(t[0])&&Yv(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Vv.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Yv(t[i])&&!Xv(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Vv.apply=function(e,t){t.forEach((t=>{const n=Gv(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Uv(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Uv(i)&&Uv(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Wv(i)&&Wv(t.value)?(s=i,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!Xv(s,e)&&delete s[e]})),$v(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Gv(e,t.from);Uv(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Uv(n)?n.splice(+r,1):delete n[r]);var s}))},Vv.clone=function(e){return $v({},e)},Vv.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Vv.updateObject=function(e,t){Object.keys(e).length?Vv.apply(e,Vv.generate(e,t)):$v(e,t)};class Zv{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Vv.generate(e,t);return Nb(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Vv.generate(n,r);Vv.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Qv={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var ex={saveDerivedProperties:function(e,t,n,r){if(Qv.canModifyHardProperties(t))return e.setProperties(n);return new Zv(e).saveSoftProperties(r,n)}};var tx={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function nx(){this._generationInProgress=!1}function rx(e){tx.validate(e);const t=e.properties,n=Fv.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}nx.prototype.isDerivedUpToDate=rx,nx.prototype.updateDerivedProperties=function(e){if(tx.validate(e),this._generationInProgress)return Promise.resolve(!0);if(rx(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Nb(!0,{},e.properties),o=Nb(!0,{},i);return this._generationInProgress=!0,Fv.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>ex.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},nx.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return zv.getDefaultHashDataForHyperCube(e,t,n).then((e=>Nb(!0,r,e)))};const ix={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const ox={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(sx(o,!0),i);return s},createRegExp:sx};function sx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const ax={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?ix.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=lx(t,i,e);n[t]=r}))}return ox.replaceExpressionTokens(e,n)}};function lx(e,t,n){if(""===t)return"";const r=ox.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const cx={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach((e=>{o=px(e.match(fx("Dim"))),o.forEach((e=>{a.push(ux(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=px(e.match(fx("Mea"))),s.forEach((e=>{a.push(dx(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=Nb({},n,i),o=Nb(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${ax.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:ax.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>ux(e,n,r,t))),i=e.qMeasures.map((e=>dx(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function ux(e,t,n,r){if(e.qLibraryId)return hx(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function dx(e,t){return e.qLibraryId?hx(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function hx(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function fx(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function px(e){return e?e.map((e=>e.substr(6,1))):[]}function gx(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function mx(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const yx={getBinSize:function(e){return Yy(e,"bins.binSize",Pm.BIN_SIZE)},getDerivedBinSize:function(e){return Yy(e,"qUndoExclude.bins.binSize",Pm.BIN_SIZE)},getDerivedBinOffset:function(e){return Yy(e,"qUndoExclude.bins.offset",Pm.OFFSET)},getDerivedBinCount:function(e){const t=Yy(e,"qUndoExclude.bins.binCount",Pm.BIN_COUNT);return gx(t)?t<1?1:mx(t)?t:Math.ceil(t):Pm.BIN_COUNT},getBinCount:function(e){return Yy(e,"bins.binCount",void 0)},getBinOffset:function(e){return Yy(e,"bins.offset",Pm.OFFSET)},isAutoBin:function(e){return Yy(e,"bins.auto",Pm.AUTO)},isCountDistinct:function(e){return Yy(e,"bins.countDistinct",Pm.COUNT_DISTINCT)},getBinMode:function(e){return Yy(e,"bins.binMode",Pm.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},bx=Math.log(10),vx=1e-9,xx=[1,1.5,2,3,4,5,6,10],wx=[1,2,4,5,6,8,10],Mx=[2,4,5,10];function kx(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/bx),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function _x(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const Sx={calculateBinSize:function(e,t,n){return function(e,t,n){if(!gx(e)||!gx(t)||!gx(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,s,a,l,c,u,d,h,f,p,g=-1,m=xx;if(n=Math.max(1,n),t===e)if(0===t){if(s=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(s=t+vx,m=wx):s=Math.abs(t/n);else o=(t+=vx)-e,s=o/n;do{if(u=1,f=0,g>=0)for(d=1/Mx[g],h=1,m=[];h<=10;)m.push(Math.round(1e3*h)/1e3),h+=d;a=s;do{a=kx(a*u,m),l=Math.floor(Math.log(a)/bx),c=10**l,i=t===e?(Math.ceil(t/a)+Math.floor(n/2))*a:Math.ceil(t/a)*a,r=i-n*a;let o=0;for(p=c;(r>e||i<t)&&o<Mx.length;)r=Math.floor(e/p)*p,i=r+n*a,p=c/Mx[o++];l<1&&(c=10**(Math.abs(l)+1),i=Math.round(i*c)/c,r=Math.round(r*c)/c),u=1.1,f++}while((r>e||i<t)&&f<10);g++}while(_x(e,t,0,s,r,i)>0&&g<Mx.length);return{binCount:n,offset:r,binSize:a}}(e,t,n=function(e){return e<1?1:mx(e)?e:Math.ceil(e)}(n))}};const qx={getMappingValues:function(e){const t=yx.isAutoBin(e),n=yx.getBinMode(e);let r,i,o,s;const a=yx.isCountDistinct(e);return t||"maxCount"===n?(s=function(e){const t=Yy(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=gx(n)?n:1,r=gx(r)?r:1;const i=yx.getDerivedBinCount(e);return Sx.calculateBinSize(n,r,i)}(e),r=s.binSize,i=s.offset,o=s.binCount):(r=yx.getBinSize(e),i=yx.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:a}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const Dx={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=qx.getMappingValues(e),s=qx.getMappings(o),a=cx.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=cx.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,s),c=await a,u=await l;let d;d=yx.isAutoBin(e)?{qValueExpression:{qExpr:ax.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:c.dimensions[0],wrap:!0}})}}:"maxCount"===yx.getBinMode(e)&&yx.isEmpty(t.bins.binCount)?yx.getDerivedBinCount(e):t.bins.binCount,Gy(u,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),Gy(u,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),Gy(u,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),Gy(t,"qUndoExclude.box.qHyperCubeDef",u),Gy(t,"qUndoExclude.bins.binSize",o.binSize),Gy(t,"qUndoExclude.bins.offset",o.binOffset),Gy(t,"qUndoExclude.bins.binCount",d)}};var Ex={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var Cx={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Cm.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Ex.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Ex.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var Ax={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Cm.DIRECTION_HORIZONTAL:Cm.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ex.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ex.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function Tx(e,t){let n;return n="x-axis"===e?"horizontal"===t?Cm.DIRECTION_VERTICAL:Cm.DIRECTION_HORIZONTAL:"horizontal"===t?Cm.DIRECTION_HORIZONTAL:Cm.DIRECTION_VERTICAL,n}var Nx={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:Tx(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ex.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ex.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Rx={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Cm.DIRECTION_VERTICAL:Cm.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ex.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ex.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Ox={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Cm.DIRECTION_VERTICAL:Cm.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var Ix={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Ex.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var Px={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,d=!!e.selectionHandler&&e.selectionHandler.isOn(),h={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function M(){y("none"),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}return d&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}}}],v.unshift(Ix.callNavBtnGesture(x.isNavigationEnabled,u)),v.push(Cx.callLassoGesture(h,x,w)),a?l?(v.push(Rx.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Ax.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(Rx.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Nx.callAreaRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(v.push(Ax.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(Nx.callAreaRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Ox.callDragGesture(h,x,w,d,n)),e.scrollHandler.getScrollApi().on("update",M)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",M)},o}};const Lx=(e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r},jx=(e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),Fx=(e,t)=>(t.components||[]).find((t=>t.key===e)),zx=(e,t,n,r)=>{var i,o,s,a,l;const c=r.isEnabled("CLIENT_IM_3364")?null===(i=Fx("axis",n))||void 0===i?void 0:i.axis:{};return{text:{fontFamily:(null==c||null===(o=c.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==c||null===(s=c.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==c||null===(a=c.title)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color)||t.getStyle(e,"axis.title","color")}}},Hx=(e,t,n,r)=>{var i,o,s,a,l,c,u,d;const h=r.isEnabled("CLIENT_IM_3364")?null===(i=Fx("axis",n))||void 0===i?void 0:i.axis:{};return{labels:{fontFamily:(null==h||null===(o=h.label)||void 0===o||null===(s=o.name)||void 0===s?void 0:s.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==h||null===(a=h.label)||void 0===a||null===(l=a.name)||void 0===l?void 0:l.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==h||null===(c=h.label)||void 0===c||null===(u=c.name)||void 0===u||null===(d=u.fontColor)||void 0===d?void 0:d.color)||t.getStyle(e,"axis.label.name","color")}}},Bx=20;function Vx(e){const t=Yy(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(Bx,t)}const $x={createSettings:function(e){return{settings:{labels:{maxGlyphCount:Vx(e)}}}}};const Wx={createSettings:function(e){const t=yx.isAutoBin(e),n=yx.getBinMode(e),r=yx.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=yx.getDerivedBinOffset(e);i=t,o=t+yx.getDerivedBinCount(e)*r}else{const t=Yy(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},Ux={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Yx=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Kx=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Xx=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Gx=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Jx=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Zx=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Qx=Math.floor,ew=Math.round,tw=Ob.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,d,h=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof tw)h=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(d=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(d))h=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(d))h=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(d))h=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(d))h=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=ew(255*h),f=ew(255*f),p=ew(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=ew(255*h),f=ew(255*f),p=ew(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=ew(255*h),f=ew(255*f),p=ew(255*p),g=1}else Ux[d.toLowerCase()]?(n=d.toLowerCase(),h=Ux[n].r,f=Ux[n].g,p=Ux[n].b,g="number"==typeof Ux[n].a?Ux[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,h=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(h=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(h=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+h+f+p+g)&&(this._invalid=!0),this._r=Qx(h),this._g=Qx(f),this._b=Qx(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=tw.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=tw.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=tw.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=tw.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=tw.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=tw.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=tw.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=tw.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof tw||(e=new tw(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Qx(this._r+(e._r-this._r)*t),Qx(this._g+(e._g-this._g)*t),Qx(this._b+(e._b-this._b)*t),Qx(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new tw(r)}});tw.toRGB=function(e){if(e instanceof tw)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=tw.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},tw.toRGBA=function(e,t){if(e instanceof tw)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=tw.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},tw.toHex=function(e){let t,n,r;return e instanceof tw?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=tw.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},tw.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new tw(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},tw.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new tw(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),d=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+d)/2,u===d)n=0,o=0;else{switch(i=u-d,n=r>.5?i/(2-u-d):i/(u+d),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},tw.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new tw(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},tw.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof tw)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},tw.blend=function(e,t,n){const r=(16711680&(e=tw.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=tw.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},tw.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new tw(r,i,o,s)},tw.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Yx.test(e)||Kx.test(e)||Xx.test(e)||Gx.test(e)||Jx.test(e)||Zx.test(e)||Ux[e.toLowerCase()])},tw.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},tw.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},tw.isDark=function(){const e={getLuminance:tw.prototype.getLuminance,isInvalid:tw.prototype.isInvalid};return tw.prototype.init.apply(e,[].slice.call(arguments)),tw.prototype.isDark.call(e)},tw.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const nw={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new tw(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new tw(e);return 0===t.getAlpha()?this.DARK_GREY:tw.getBestContrast(t,new tw(nw.LIGHT_GREY),new tw(nw.DARK_GREY))},getBestContrast:(e,t,n)=>tw.getBestContrast(new tw(e),new tw(t),new tw(n)),getContrastingTransparent(e){const t=new tw(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const rw={createSettings:function(e,t,n,r,i,o){const{theme:s}=e.environment,a=s.getColorPickerColor(t.color.bar.paletteColor),l=yx.getDerivedBinSize(t),c=[],u=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(c.push(o.box.trigger),u.push.apply(u,o.box.consume)),c.push(n.trigger),{key:"box-marker",settings:{box:{fill:a,stroke:nw.getContrastingGrey(a).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:c,consume:u},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const iw={createSettings:function(e,t,n,r){const i=t.getStyles(),o=((e,t,n,r)=>{var i,o,s,a,l;const c=r.isEnabled("CLIENT_IM_3364")?null===(i=Fx("value",n))||void 0===i?void 0:i.label:{},u=(null==c||null===(o=c.value)||void 0===o?void 0:o.fontFamily)||t.label.value.fontFamily;let d=(null==c||null===(s=c.value)||void 0===s?void 0:s.fontSize)||t.label.value.fontSize;return d=parseFloat(d),{fontFamily:u,fontSize:d,fill:null==c||null===(a=c.value)||void 0===a||null===(l=a.fontColor)||void 0===l?void 0:l.color}})(0,i,e,r),s=o.fill||i.label.value.color;return{settings:{sources:[{strategy:{settings:{...o,labels:[{placements:[{fill:s},{fill:r.isEnabled("CLIENT_IM_3364")&&o.fill?s:e=>tw.isDark(e.node.attrs.fill)?i.label.value.lightColor:i.label.value.darkColor}]}]}}}]}}}},ow="object.histogram";function sw(e){return Yy(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const aw={createChartSettings:function(e,t){const n=e.isRtl(),r=Yy(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,s=uv.create({chartID:ow,theme:i,isRtl:n,flags:e.flags}),a=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:ub(s),styles:void 0};return d.styles=hb({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=hb({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},c={},u={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),c=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:sw(t)}),u=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const d={box:{}};e._tooltipHandler.isOn()&&(d.box=e._tooltipHandler.setUp({chartBuilder:s,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const h=function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t),f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(h),p={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Px.create(p,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),s.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:Wx.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:$x.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:zx(ow,i,t,e.flags),axisLabelStyle:Hx(ow,i,t,e.flags)});const g=s.getSettings(),m=rw.createSettings(e,t,l,c,u,d);if(s.addComponent("box-marker",m),t.dataPoint&&t.dataPoint.showLabels){const n=iw.createSettings(t,a,ow,e.flags);s.addComponent("labels",n)}return e.addSnapshotChartSettings(g,t),g.scales.rangeSelSettings={type:"linear",min:g.scales.dimension.min,max:g.scales.dimension.max,source:"qDimensionInfo/0"},g}};const lw=yv.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:s,renderState:a}){this._super(r,i,e,o,s),this.flags=t,this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new nx,this._selectionHandler=_v.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=jv.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return aw.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=Yy(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then((i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:qx.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then((o=>{if(t._destroyed)return Promise.reject();const s={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>Dx.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(s)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(s))}))))}))},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class cw{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var uw={onChangeCalcCond:function(e){var t,n;const r=null==e?void 0:e.qHyperCubeDef,i=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(n=t.box)||void 0===n?void 0:n.qHyperCubeDef;r&&i&&(i.qCalcCond=r.qCalcCond,i.qCalcCondition=r.qCalcCondition)}};const dw=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:n&&null!=n&&n.isEnabled("CLIENT_IM_3364")?{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}:void 0}),hw="maxCount",fw="size";function pw(e){return!(e.bins&&e.bins.auto)}function gw(e){return pw(e)&&e.bins.binMode===hw}function mw(e){var t,n;const{translator:r,flags:i}=e,o=null==e||null===(t=e.flags)||void 0===t?void 0:t.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),s=null==e||null===(n=e.flags)||void 0===n?void 0:n.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),a=e.anything.sense.theme,l={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=a.getDataColorSpecials(),t=a.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},c="object.histogram",u=jx(a,r,c,Mb,i),d=Lx(u,a,c),h={type:"items",translation:"properties.presentation",items:{styleEditor:o&&dw(s,d,null==e?void 0:e.flags),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},f={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.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.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.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"}}}}}}},p={uses:"settings",items:{simpleLabels:f,presentation:h,colors:l,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},g={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:uw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},m={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:hw,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:fw,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:hw,show:e=>pw(e)},y={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!pw(e)},mode:m,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return yx.isEmpty(r)?yx.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:gw},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=Yy(e,"bins.binCount"),n="object"==typeof t;return gw(e)&&!yx.isEmpty(t)&&!n&&!mx(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=Yy(e,"bins.binCount");return!!(gw(e)&&!yx.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>pw(e)&&e.bins.binMode===fw,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>pw(e)&&e.bins.binMode===fw,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===Yy(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===Yy(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=Yy(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=Yy(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=r.get("properties.histogram.staticMeasureName");return r.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},bins:y,addons:g,settings:p}}}var yw={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var bw={getExportRawDataOptions:function(e,t,n){return e.addItem({translation:"contextMenu.export",tid:"export",select(){n.show(t.model,"/qUndoExclude/box/qHyperCubeDef")}}),Promise.resolve()}};const vw="qUndoExclude.box";function xw(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:mw(e),softDefinition:yw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=jm(e);r.mapProperties();const s={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Im.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:s,hypercubePath:i})},exportProperties:(e,t,n)=>Im.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?vw:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=vw;return Im.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:bw.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator);const n=jm(t);return{qae:{properties:Lm,data:{targets:[n]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>Im.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:xw(t),component(){const n=e.useConstraints(),r=e.useElement(),o=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s})),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),s=o.options.renderer,a=e.useMemo((()=>Nm(s)),[s]),l=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Rm,hidden:!n||!s,active:i,action(){o((e=>!e))}})),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),c=e.useModel(),u=e.useSelections(),d=e.useStaleLayout(),h=e.useRenderState(),[f,p]=e.useState();e.useEffect((()=>{const e=i(r),n=new cw(c),s=u,d=new lw({$element:e,backendApi:n,environment:o,flags:t.flags,lasso:l,picasso:a,selectionsApi:s,renderState:h});return p(d),()=>{d.destroy()}}),[]);const[,g]=e.usePromise((async()=>{f&&(f.updateEnvironment(o),f.updateConstraints(n),await f.updateData(d),await f.paint())}),[d,f,o]);if(g)throw g;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),m=f,e.onTakeSnapshot((e=>{if(m)return m.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(m)return m.getViewState()}})),[m])}}}}));
28
+ !function(t,n){e.exports=n()}(0,(function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,s,a,l,c,u,d,h=e.length,f=e.search(/[0-9\-\+#]/),p=f>0?e.substring(0,f):"",g=e.split("").reverse().join(""),m=g.search(/[0-9\-\+#]/),y=h-m,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),x=m>0?e.substring(v,h):"";if(n=(t="-"===(e=e.substring(f,v)).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))+"",a=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=a)&&(t=(+t).toFixed(a+1)),u=e[0].split(o),e[0]=u.join(""),(s=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-s;)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(g="",y=(d=t[0]).length%l,h=d.length,v=0;v<h;v++)g+=d.charAt(v),!((v-y+1)%l)&&v<h-l&&(g+=o);t[0]=g}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}}))}));const ve=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const we={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"},Me=/%\)?$/,ke=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,_e=/^\(oct\)/i,Se=/^\(dec\)/i,qe=/^\(hex\)/i,De=/^\(bin\)/i,Ee=/^\(rom\)/i,Ce=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Ae=/#|0/g;function Te(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 Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,s=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),a=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<s.length;n++)if(s[n]<=i){r+=a[n],i-=s[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Re(e,t,n){let r;return ke.test(t)?e=Te(e,Number(/\d{2}/.exec(t)[0]),t,n):_e.test(t)?e=Te(e,8,t,n):Se.test(t)?e=Te(e,10,t,n):qe.test(t)?e=Te(e,16,t,n):De.test(t)?e=Te(e,2,t,n):Ee.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Oe(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Ie(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Pe(e,t){if(!e||!e.qNumericalAbbreviation)return we;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Le(e,t,n,r){let i,o,s,a,l,c,u,d,h,f=e.pattern;r&&(e.abbreviate=!0),h=Ie(t,n),s=f.match(h),s=s?s[0]:"",a=s?f.substr(0,f.indexOf(s)):f,l=s?f.substring(f.indexOf(s)+s.length):"",s||(s=f?"#":"##########"),t&&t===n&&(i=s.split(n),o=i.pop(),s=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(s=s.replace(Oe(c,"g"),t)),u=n,n=".",u&&(s=s.replace(Oe(u,"g"),n)),d=s.match(/#/g),d=d?d.length:0;const p=f.split(u);let g;p[1]&&(g=p[1].match(Ae)),e.prefix=a||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=g?g.length:2,e.percentage=Me.test(f),e.numericPattern=s||"",e.numericRegex=new RegExp("".concat(Oe(t,null,!0),"|").concat(Oe(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class je{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=Pe(e,this.patternSeparator),this.prepare()}clone(){const e=new je(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],Ce.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ce.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ce.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Le(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Le(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Le(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,s,a,l,c,u=this._prepared,d="",h="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,s=u.t,u.isFunctional)e=Re(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(a=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&a<t.length;)a++,o=t[a];a>0&&(r=t[a-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.toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=be(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+ve).toFixed(t).slice(2).replace(/0+$/,"");for(a=i.length;a<n;a++)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)/,""),h=""):(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)))),a=0;a<t;a++)l+="#";e=be(l,e)}e=e.replace(u.numericRegex,(e=>e===s?u.groupTemp:e===o?u.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+h+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function Fe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new je(...t)}function ze(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=(e=>e)}=t;let o,s,a=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return s=i(...arguments),o.has(s)?o.get(s):o.set(s,e(...arguments))}:t=>(s=i(t),o.has(s)?o.get(s):o.set(s,e(t))),o.set=(e,t)=>(c>=n&&(delete a[l[u]],delete l[u],c--,u++),a[e]=t,l[c]=e,c++,t),o.get=e=>a[e],o.has=e=>e in a,o.clear=()=>{a=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function He(e,t,n,r,i){const o=Fe(i,e,t,n,r),s=ze(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function a(e){return s(e)}return a.format=function(e,t,n,r){return s.clear(),o.format(t,e,n,r)},a.pattern=function(e){return e&&(s.clear(),o.pattern=e,o.prepare()),o.pattern},a}const Be={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Ve=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Ue=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ye=86400;function Ke(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Xe(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"}}function Ge(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Je(e){const t=e,n=24*Ge(t),r=60*Ge(n),i=60*Ge(r),o=1e3*Ge(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Ze(e,t){let n,r=Je(e),i=r.d,o=r.h,s=r.m,a=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(Ye*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(s+=60*o),/m+/gi.test(t)||(a+=60*s),/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:s,s:a,f:l,t:u}}function Qe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ke("".concat(t.year).slice(-2),2),YYY:Ke("".concat(t.year).slice(-3),3),def:e=>Ke("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ke("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ke("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ke("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ke("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ke("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ke("".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}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Ve,qDayNames:$e,qLongMonthNames:We,qMonthNames:Ue}),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={[Be.TIME]:r.qTimeFmt||"hh:mm:ss",[Be.DATE]:r.qDateFmt||"YYYY-MM-DD",[Be.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(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=Xe(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Ze(e,t));const i=Qe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const s=new RegExp(o.join("|"),"g"),a=t.replace(s,(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 a}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=ze(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==Be.INTERVAL?rt(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=tt(i,e,t),r=ze(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 ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(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",s=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,s=s&&-1===["M"].indexOf(e.qNumFormat.qType)):s=!0,(s||"U"===o)&&(n="#".concat(i,"##"),o="U"),He(n,r,i,o,t)}function st(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:s,type:a,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=s||("dimension"===a?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u=e=>(null==e?void 0:e.qText)||"",d="dimension"===a?"first":"avg",h=ot(t,i),f="dimension"===a?"first":(e,t)=>h(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>a,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:u,reduce:d,reduceLabel:f,formatter:()=>h,tags:()=>t.qTags};return p}function at(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const s="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),a={instance:st(p({id:"".concat(n?"".concat(n,"/"):"").concat(s),key:s,meta:t},i))};return a.attrDims=at("qAttrDimInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),a.attrExps=at("qAttrExprInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),a.measures=at("qMeasureInfo",t,n,s,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),a}))}function lt(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=lt.util,a={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,a),fields:()=>i.fields.slice(),extract:e=>a.extractor(e,l,i,s),hierarchy:e=>a.hierarchy(e,l,i,s),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(a.extractor=me,a.hierarchy=ge,a.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(a.extractor=b,a.pages=o.qDataPages,a.hierarchy=ge):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},l,i,s);const c="S"===o.qMode?e=>e.qElemNumber:void 0,u="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...at("qDimensionInfo",o,e,"",p({},a,{value:c,type:"dimension"}))),i.wrappedFields.push(...at("qMeasureInfo",o,e,"",p({},a,{value:u,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const d=e=>{e.forEach((e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)}))};return d(i.wrappedFields),(r.virtualFields||[]).forEach((t=>{const r=l.field(t.from),o=st(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>a.extractor({field:e},l,i,s),key:t.key,type:r.type(),localeInfo:a.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)})),i.allFields.push(...i.virtualFields),l}const ct=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ut=/\/qDimensionInfo(?:\/(\d+))?/,dt=/\/qMeasureInfo\/(\d+)/,ht=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,pt=/\/?qHyperCube/,gt=/\/?qTreeData/,mt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",s=e=>e;pt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),s=mt):gt.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),s=yt);let a=!0;if(ut.test(e)&&(r=+ut.exec(e)[1]),dt.test(e)&&(i=+dt.exec(e)[1]),ht.test(e)){i=-1,r=0;const e=+ht.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),a=!1}if(ft.test(e)){const e=i;if(t){i=0;const s=Z(o,t);i+=(s.qMeasureInfo||[]).length,r>-1?(i=s.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=s.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=s.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ct.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),a&&(n=s(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vt(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=[],s={},a=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=bt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,s.multiRangeSelectTreeDataValues||(s.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>s.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,s.rangeSelectHyperCubeValues||(s.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>s.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,s.selectHyperCubeContinuousRange||(s.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>s.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,a=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(s.selectPivotCells||(s.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||a>=o)&&o>-1?n.forEach((e=>{s.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:a-o})})):n.forEach((e=>{s.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!s.selectPivotCells.cells.length}}else s.selectHyperCubeCells||(s.selectHyperCubeCells={path:t.path,cols:[]}),s.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||s.selectHyperCubeCells.values)||(s.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!s.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&&a?[{method:"resetMadeSelections",params:[]}]:(s.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[s.rangeSelectHyperCubeValues.path,s.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),s.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[s.selectHyperCubeContinuousRange.path,s.selectHyperCubeContinuousRange.ranges]}),s.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[s.selectHyperCubeCells.path,s.selectHyperCubeCells.values,s.selectHyperCubeCells.cols]}),s.selectPivotCells&&o.push({method:"selectPivotCells",params:[s.selectPivotCells.path,s.selectPivotCells.cells]}),s.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[s.multiRangeSelectTreeDataValues.path,s.multiRangeSelectTreeDataValues.ranges]}),o);var c}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",He),e.formatter("q-time",it)}return xt.qBrushHelper=vt,xt.selections=vt,xt}()}(bv);var vv=n(bv.exports);const xv={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let s=0;const a=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),s++):a.push({key:t.key,value:t.value}))})),{items:a,itemsAreLocked:s>0&&s===t.length,lockedFields:o}}}};const wv={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Mv(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let s=[];const a={propertiesToRestore:{}};let l=!1;const c=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),vv.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const s=xv.brushInterceptors.filterValues(e,r),a=s.items;return t.isActive()||s.itemsAreLocked||!(o||a.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),a},r}(t,n,i),u={};let d=!1;function h(e){16===e.keyCode&&e.shiftKey!==d&&(d=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function p(){s.forEach((e=>{e.listeners.update=function(t,n){e.sleep||c.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function g(){s.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{s.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),u.setUp=function(e){u.tearDown();const t=this.setUpBrush(e);return l&&p(),t},u.setUpBrush=function(e){const n=Nb(!0,{},wv,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},a=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return a.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:c.toggleValues(e,a.brush,n.startOnEmptySelection)},a.brush.intercept("toggle-values",a.listeners.toggle),a.brush.intercept("add-values",a.listeners.toggle),a.brush.intercept("remove-values",a.listeners.toggle),a.brush.intercept("set-values",a.listeners.toggle),a.listeners.start=function(){s.length>1&&s.forEach((e=>{e!==a&&e.brush.end()}))},s.push(a),{trigger:i,consume:o}},u.setUpStart=function(){u.tearDown()},u.setUpDone=function(){l&&p()},u.tearDown=function(){l&&g(),s.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),s=[]},u.pauseEngineCalls=function(e){s.forEach((t=>{t.id===e&&(t.sleep=!0)}))},u.resumeEngineCalls=function(e,t){s.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},u.addComponent=function(e,t){s.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},u.on=function(){if(l)return;l=!0,p(),document.addEventListener("keydown",h),document.addEventListener("keyup",h);const e=()=>{s.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),a.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),a.unbindActivated=()=>{n.removeListener("activated",t)}},u.isOn=()=>l,u.off=function(){l&&(l=!1,g(),document.removeEventListener("keydown",h),document.removeEventListener("keyup",h),document.removeEventListener("keyup",f),a.unbindActivated(),a.unbindDeactivated())},u.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},u.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},u}class kv{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var _v={create:e=>e.selectionsApi?Mv(e):new kv};function Sv(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const s=e.brush(r),a={};function l(){if(o){e.component(i).emit("hide")}o=!1}return a.isOpen=function(){return o},a.closeTooltip=l,a.update=function(){const a=s.brushes(),c=e.getAffectedShapes(r,"and",n,t);a.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(c)):l()},a.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},a}var qv={create:(...e)=>Sv(...e)},Dv={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const Ev=-3;const Cv=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],s={rows:[]};if(e.labelData){const t=[],i=e.labelData;let a=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){a=!0;break}t.push(o.data[i[e]].value.qText)}if(a)return;s.header=e.headerResolver(t),s.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=Av(e,o);l&&s.rows.unshift(l),r.push(s)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Av(e,t){var n,r,i;const o=t.data.color,s=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!s||"color"===s.type||!o||!s.fieldType)return;const a=[];e.data.forEach((e=>{const n=t.data[e];n&&a.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)e[n]===Ev&&(t=n);return t}(a),{translator:c}=e,u=s.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:u,value:-1!==l?c.get("properties.dimensionLimits.others"):o.label}}const Tv="dist-flow-tooltip",Nv=`#${Tv}`;function Rv(){if(!document.querySelector(Nv)){const e=document.createElement("div");e.id=Tv,e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function Ov({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Rv()},beforeUpdate(){Rv()},destroyed(){!function(){const e=document.querySelector(Nv);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Nv),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:Iv}=Ub;const Pv={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Dv.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,s=[],a=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:a,fontWeight:"bold",direction:Iv(e.header)};s.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:a,direction:Iv(e.label)},c={...r.cell,textAlign:o?"left":"right",direction:Iv(e.value)};s.push(n("tr",null,n("td",{style:l},i),n("td",{style:c},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:a,direction:Iv(e)};s.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return s}};function Lv(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function s(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function a(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function c(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function u(){c();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=Nb(!0,{},Pv,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const a=function(e,t){return{brush:t.brush(e.contexts[0]),action:qv.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=a,i&&s(a);const c=Ov({key:o.tooltipKey,rtl:"rtl"===a.direction,fontFamily:a.theme.getStyle(n,"tooltip","fontFamily"),filter:(u=a.filterShapes,e=>u?u(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:Cv(a,o.dataPath)});var u;return o.chartBuilder.getSettings().components.push(c),{trigger:{on:a.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:c}},o.tearDown=function(){i&&a(),r=[]},o.closeTooltip=c,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{s(r[e])})),t&&t.on("mouseleave",u))},o.off=function(){i&&(i=!1,a(),t&&t.off("mouseleave",u),c())},o}var jv={create:(e,t,n)=>Lv(e,t,n)};const Fv={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Fv.generateHash(t)}};const zv={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:Bv(t),dimensionExpressions:Hv(t),measureExpressions:e})))}};function Hv(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Bv(e){const t=function(e){return Yy(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const Vv={},$v=Nb.bind(null,!0);function Wv(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Uv=Array.isArray,Yv=function(e){return void 0===e},Kv=function(e){return"function"==typeof e};function Xv(e,t){return Kv(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Gv(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Yv(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Jv(e,t){if(Wv(e)&&Wv(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Jv(e[n],t[n]))return!1;return!0}if(Uv(e)&&Uv(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Jv(e[n],t[n]))return!1;return!0}return e===t}Vv.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=$v({},{val:e}).val),e}(t[i]),s=e[i],a=`${n}/${i}`;Jv(o,s)||Xv(t,i)||(Yv(s)?r.push({op:"add",path:a,value:o}):Wv(o)&&Wv(s)?r=r.concat(Vv.generate(s,o,a)):Uv(o)&&Uv(s)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,s,a=-1;function l(e,t,n){if(e[n]&&Yv(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Jv(t,i))return r;if(null===t[0]||!Yv(t[0])&&Yv(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)a=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===a?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(Vv.generate(i[o],t[a],`${n}/${o}`));for(o=0,s=t.length;o<s;++o)a=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===a?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):a!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${a}`}),i.splice(o,0,i.splice(a,1)[0]));return r}(s,o,a)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Yv(t[i])&&!Xv(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},Vv.apply=function(e,t){t.forEach((t=>{const n=Gv(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Uv(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Uv(i)&&Uv(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Wv(i)&&Wv(t.value)?(s=i,Object.keys(s).forEach((e=>{Object.getOwnPropertyDescriptor(s,e).configurable&&!Xv(s,e)&&delete s[e]})),$v(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Gv(e,t.from);Uv(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Uv(n)?n.splice(+r,1):delete n[r]);var s}))},Vv.clone=function(e){return $v({},e)},Vv.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},Vv.updateObject=function(e,t){Object.keys(e).length?Vv.apply(e,Vv.generate(e,t)):$v(e,t)};class Zv{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=Vv.generate(e,t);return Nb(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=Vv.generate(n,r);Vv.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Qv={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var ex={saveDerivedProperties:function(e,t,n,r){if(Qv.canModifyHardProperties(t))return e.setProperties(n);return new Zv(e).saveSoftProperties(r,n)}};var tx={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function nx(){this._generationInProgress=!1}function rx(e){tx.validate(e);const t=e.properties,n=Fv.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}nx.prototype.isDerivedUpToDate=rx,nx.prototype.updateDerivedProperties=function(e){if(tx.validate(e),this._generationInProgress)return Promise.resolve(!0);if(rx(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=Nb(!0,{},e.properties),o=Nb(!0,{},i);return this._generationInProgress=!0,Fv.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>ex.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},nx.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return zv.getDefaultHashDataForHyperCube(e,t,n).then((e=>Nb(!0,r,e)))};const ix={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const ox={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,s=e;for(const e in t)i=t[e],o=r.start+e+r.end,s=s.replace(sx(o,!0),i);return s},createRegExp:sx};function sx(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const ax={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?ix.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=lx(t,i,e);n[t]=r}))}return ox.replaceExpressionTokens(e,n)}};function lx(e,t,n){if(""===t)return"";const r=ox.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const cx={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,s;const a=[];let l;e.forEach((e=>{o=px(e.match(fx("Dim"))),o.forEach((e=>{a.push(ux(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),s=px(e.match(fx("Mea"))),s.forEach((e=>{a.push(dx(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=a.length?Promise.all(a).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=Nb({},n,i),o=Nb(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${ax.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:ax.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>ux(e,n,r,t))),i=e.qMeasures.map((e=>dx(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function ux(e,t,n,r){if(e.qLibraryId)return hx(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function dx(e,t){return e.qLibraryId?hx(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function hx(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function fx(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function px(e){return e?e.map((e=>e.substr(6,1))):[]}function gx(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function mx(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const yx={getBinSize:function(e){return Yy(e,"bins.binSize",Pm.BIN_SIZE)},getDerivedBinSize:function(e){return Yy(e,"qUndoExclude.bins.binSize",Pm.BIN_SIZE)},getDerivedBinOffset:function(e){return Yy(e,"qUndoExclude.bins.offset",Pm.OFFSET)},getDerivedBinCount:function(e){const t=Yy(e,"qUndoExclude.bins.binCount",Pm.BIN_COUNT);return gx(t)?t<1?1:mx(t)?t:Math.ceil(t):Pm.BIN_COUNT},getBinCount:function(e){return Yy(e,"bins.binCount",void 0)},getBinOffset:function(e){return Yy(e,"bins.offset",Pm.OFFSET)},isAutoBin:function(e){return Yy(e,"bins.auto",Pm.AUTO)},isCountDistinct:function(e){return Yy(e,"bins.countDistinct",Pm.COUNT_DISTINCT)},getBinMode:function(e){return Yy(e,"bins.binMode",Pm.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},bx=Math.log(10),vx=1e-9,xx=[1,1.5,2,3,4,5,6,10],wx=[1,2,4,5,6,8,10],Mx=[2,4,5,10];function kx(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/bx),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function _x(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const Sx={calculateBinSize:function(e,t,n){return function(e,t,n){if(!gx(e)||!gx(t)||!gx(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,s,a,l,c,u,d,h,f,p,g=-1,m=xx;if(n=Math.max(1,n),t===e)if(0===t){if(s=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(s=t+vx,m=wx):s=Math.abs(t/n);else o=(t+=vx)-e,s=o/n;do{if(u=1,f=0,g>=0)for(d=1/Mx[g],h=1,m=[];h<=10;)m.push(Math.round(1e3*h)/1e3),h+=d;a=s;do{a=kx(a*u,m),l=Math.floor(Math.log(a)/bx),c=10**l,i=t===e?(Math.ceil(t/a)+Math.floor(n/2))*a:Math.ceil(t/a)*a,r=i-n*a;let o=0;for(p=c;(r>e||i<t)&&o<Mx.length;)r=Math.floor(e/p)*p,i=r+n*a,p=c/Mx[o++];l<1&&(c=10**(Math.abs(l)+1),i=Math.round(i*c)/c,r=Math.round(r*c)/c),u=1.1,f++}while((r>e||i<t)&&f<10);g++}while(_x(e,t,0,s,r,i)>0&&g<Mx.length);return{binCount:n,offset:r,binSize:a}}(e,t,n=function(e){return e<1?1:mx(e)?e:Math.ceil(e)}(n))}};const qx={getMappingValues:function(e){const t=yx.isAutoBin(e),n=yx.getBinMode(e);let r,i,o,s;const a=yx.isCountDistinct(e);return t||"maxCount"===n?(s=function(e){const t=Yy(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=gx(n)?n:1,r=gx(r)?r:1;const i=yx.getDerivedBinCount(e);return Sx.calculateBinSize(n,r,i)}(e),r=s.binSize,i=s.offset,o=s.binCount):(r=yx.getBinSize(e),i=yx.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:a}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const Dx={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=qx.getMappingValues(e),s=qx.getMappings(o),a=cx.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=cx.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,s),c=await a,u=await l;let d;d=yx.isAutoBin(e)?{qValueExpression:{qExpr:ax.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:c.dimensions[0],wrap:!0}})}}:"maxCount"===yx.getBinMode(e)&&yx.isEmpty(t.bins.binCount)?yx.getDerivedBinCount(e):t.bins.binCount,Gy(u,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),Gy(u,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),Gy(u,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),Gy(t,"qUndoExclude.box.qHyperCubeDef",u),Gy(t,"qUndoExclude.bins.binSize",o.binSize),Gy(t,"qUndoExclude.bins.offset",o.binOffset),Gy(t,"qUndoExclude.bins.binCount",d)}};var Ex={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var Cx={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:Cm.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Ex.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((s=n.handlers).selectionHandler.lassoState()&&!s.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var s},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Ex.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var Ax={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Cm.DIRECTION_HORIZONTAL:Cm.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const s="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ex.isOnComponentForRange(o,s,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!a,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ex.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function Tx(e,t){let n;return n="x-axis"===e?"horizontal"===t?Cm.DIRECTION_VERTICAL:Cm.DIRECTION_HORIZONTAL:"horizontal"===t?Cm.DIRECTION_HORIZONTAL:Cm.DIRECTION_VERTICAL,n}var Nx={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:Tx(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const s="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ex.isOnComponentForRange(o,s,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!a,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ex.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Rx={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?Cm.DIRECTION_VERTICAL:Cm.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const s="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],a=Ex.isOnComponentForRange(o,s,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!a,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Ex.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Ox={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?Cm.DIRECTION_VERTICAL:Cm.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var Ix={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Ex.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var Px={create:function(e,t,n,r,i){const o={};t=t||"vertical";const s=r.lassoBrushKey||"select",a=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,c=r.areaBrushKey||null,u=r.legendBrushKey||null,d=!!e.selectionHandler&&e.selectionHandler.isOn(),h={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},p="horizontal"===t,g=p?"y-axis":"x-axis",m=p?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=s;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=a;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=c}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return a?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},w={handlers:e,keys:r,isHorizontal:p,active:f,rangeSelStatus:i};function M(){y("none"),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}return d&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),h.majoring=!1,h.measureSelecting=!1,h.minoring=!1}}}],v.unshift(Ix.callNavBtnGesture(x.isNavigationEnabled,u)),v.push(Cx.callLassoGesture(h,x,w)),a?l?(v.push(Rx.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Ax.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(Rx.callDimensionRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(a,{id:"rangeDim",clear:"rangeClear"}),v.push(Nx.callAreaRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"})):(v.push(Ax.callMeasureRangeGesture(h,x,w,m)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(Nx.callAreaRangeGesture(h,x,w,g)),e.selectionHandler.addComponent(c,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Ox.callDragGesture(h,x,w,d,n)),e.scrollHandler.getScrollApi().on("update",M)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",M)},o}};const Lx=(e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r},jx=(e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}),Fx=(e,t)=>(t.components||[]).find((t=>t.key===e)),zx=(e,t,n,r)=>{var i,o,s,a;const l=r.isEnabled("CLIENT_IM_3364")?null===(i=Fx("axis",n))||void 0===i?void 0:i.axis:{};return{text:{fontFamily:(null==l||null===(o=l.title)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==l||null===(s=l.title)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==l||null===(a=l.title)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.title","color")}}},Hx=(e,t,n,r)=>{var i,o,s,a;const l=r.isEnabled("CLIENT_IM_3364")?null===(i=Fx("axis",n))||void 0===i?void 0:i.axis:{};return{labels:{fontFamily:(null==l||null===(o=l.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==l||null===(s=l.label)||void 0===s||null===(s=s.name)||void 0===s?void 0:s.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==l||null===(a=l.label)||void 0===a||null===(a=a.name)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.label.name","color")}}},Bx=20;function Vx(e){const t=Yy(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(Bx,t)}const $x={createSettings:function(e){return{settings:{labels:{maxGlyphCount:Vx(e)}}}}};const Wx={createSettings:function(e){const t=yx.isAutoBin(e),n=yx.getBinMode(e),r=yx.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=yx.getDerivedBinOffset(e);i=t,o=t+yx.getDerivedBinCount(e)*r}else{const t=Yy(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},Ux={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Yx=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,Kx=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Xx=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Gx=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Jx=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Zx=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Qx=Math.floor,ew=Math.round,tw=Ob.extend({init(){let e,t,n,r,i,o,s,a,l,c,u,d,h=0,f=0,p=0,g=1;if(this._invalid=!1,arguments[0]instanceof tw)h=arguments[0]._r,f=arguments[0]._g,p=arguments[0]._b,g=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(d=arguments[0],u=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(d))h=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10);else if(u=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(d))h=parseInt(u[1],10),f=parseInt(u[2],10),p=parseInt(u[3],10),g=parseFloat(u[4]);else if(u=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(d))h=parseInt(u[1],16),f=parseInt(u[2],16),p=parseInt(u[3],16),g=1;else if(u=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(d))h=parseInt(u[1]+u[1],16),f=parseInt(u[2]+u[2],16),p=parseInt(u[3]+u[3],16),g=1;else if(u=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=ew(255*h),f=ew(255*f),p=ew(255*p),g=1}else if(u=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),r=parseFloat(u[5]),g=parseFloat(u[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=r-.5*o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=ew(255*h),f=ew(255*f),p=ew(255*p)}else if(u=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(d)){switch(e=parseFloat(u[1]),t=parseFloat(u[3]),i=parseFloat(u[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,s=e/60,a=o*(1-Math.abs(s%2-1)),l=[],s=Math.floor(s),s){case 0:l=[o,a,0];break;case 1:l=[a,o,0];break;case 2:l=[0,o,a];break;case 3:l=[0,a,o];break;case 4:l=[a,0,o];break;case 5:l=[o,0,a];break;default:l=[0,0,0]}c=i-o,h=l[0]+c,f=l[1]+c,p=l[2]+c,h=ew(255*h),f=ew(255*f),p=ew(255*p),g=1}else Ux[d.toLowerCase()]?(n=d.toLowerCase(),h=Ux[n].r,f=Ux[n].g,p=Ux[n].b,g="number"==typeof Ux[n].a?Ux[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(g=(4278190080&arguments[0])>>>24,g/=255,h=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(h=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,p=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(h=arguments[0],f=arguments[1],p=arguments[2],g=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+h+f+p+g)&&(this._invalid=!0),this._r=Qx(h),this._g=Qx(f),this._b=Qx(p),this._a=g,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=tw.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=tw.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=tw.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=tw.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=tw.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=tw.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=tw.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=tw.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const s=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${s})`},isEqual(e){return e instanceof tw||(e=new tw(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Qx(this._r+(e._r-this._r)*t),Qx(this._g+(e._g-this._g)*t),Qx(this._b+(e._b-this._b)*t),Qx(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new tw(r)}});tw.toRGB=function(e){if(e instanceof tw)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=tw.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},tw.toRGBA=function(e,t){if(e instanceof tw)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=tw.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},tw.toHex=function(e){let t,n,r;return e instanceof tw?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=tw.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},tw.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new tw(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=Math.max(s,a,l),u=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(c+u)/2,c===u)n=0,o=0;else{switch(i=c-u,n=r>.5?i/(2-c-u):i/(c+u),c){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},tw.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new tw(e));const s=e._r/255,a=e._g/255,l=e._b/255,c=e._a,u=Math.max(s,a,l),d=Math.min(s,a,l);if(r=t?.21*s+.72*a+.07*l:(u+d)/2,u===d)n=0,o=0;else{switch(i=u-d,n=r>.5?i/(2-u-d):i/(u+d),u){case s:o=(a-l)/i+(a<l?6:0);break;case a:o=(l-s)/i+2;break;case l:o=(s-a)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${c})`},tw.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new tw(e));const i=e._r/255,o=e._g/255,s=e._b/255,a=Math.max(i,o,s),l=Math.min(i,o,s),c=a;if(a===l)t=0,r=0;else{switch(n=a-l,t=0===n?0:n/c,a){case i:r=(o-s)/n+(o<s?6:0);break;case o:r=(s-i)/n+2;break;case s:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*c}},tw.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof tw)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},tw.blend=function(e,t,n){const r=(16711680&(e=tw.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=tw.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},tw.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,s=e._a+(t._a-e._a)*n;return new tw(r,i,o,s)},tw.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Yx.test(e)||Kx.test(e)||Xx.test(e)||Gx.test(e)||Jx.test(e)||Zx.test(e)||Ux[e.toLowerCase()])},tw.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},tw.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},tw.isDark=function(){const e={getLuminance:tw.prototype.getLuminance,isInvalid:tw.prototype.isInvalid};return tw.prototype.init.apply(e,[].slice.call(arguments)),tw.prototype.isDark.call(e)},tw.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const nw={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new tw(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new tw(e);return 0===t.getAlpha()?this.DARK_GREY:tw.getBestContrast(t,new tw(nw.LIGHT_GREY),new tw(nw.DARK_GREY))},getBestContrast:(e,t,n)=>tw.getBestContrast(new tw(e),new tw(t),new tw(n)),getContrastingTransparent(e){const t=new tw(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const rw={createSettings:function(e,t,n,r,i,o){const{theme:s}=e.environment,a=s.getColorPickerColor(t.color.bar.paletteColor),l=yx.getDerivedBinSize(t),c=[],u=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(c.push(o.box.trigger),u.push.apply(u,o.box.consume)),c.push(n.trigger),{key:"box-marker",settings:{box:{fill:a,stroke:nw.getContrastingGrey(a).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:c,consume:u},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const iw={createSettings:function(e,t,n,r){const i=t.getStyles(),o=((e,t,n,r)=>{var i,o,s,a;const l=r.isEnabled("CLIENT_IM_3364")?null===(i=Fx("value",n))||void 0===i?void 0:i.label:{},c=(null==l||null===(o=l.value)||void 0===o?void 0:o.fontFamily)||t.label.value.fontFamily;let u=(null==l||null===(s=l.value)||void 0===s?void 0:s.fontSize)||t.label.value.fontSize;return u=parseFloat(u),{fontFamily:c,fontSize:u,fill:null==l||null===(a=l.value)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color}})(0,i,e,r),s=o.fill||i.label.value.color;return{settings:{sources:[{strategy:{settings:{...o,labels:[{placements:[{fill:s},{fill:r.isEnabled("CLIENT_IM_3364")&&o.fill?s:e=>tw.isDark(e.node.attrs.fill)?i.label.value.lightColor:i.label.value.darkColor}]}]}}}]}}}},ow="object.histogram";function sw(e){return Yy(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const aw={createChartSettings:function(e,t){const n=e.isRtl(),r=Yy(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,s=uv.create({chartID:ow,theme:i,isRtl:n,flags:e.flags}),a=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,s=void 0===o?[]:o,a=r.transform,l=void 0===a?[]:a,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:ub(s),styles:void 0};return d.styles=hb({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=hb({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},c={},u={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),c=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:sw(t)}),u=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const d={box:{}};e._tooltipHandler.isOn()&&(d.box=e._tooltipHandler.setUp({chartBuilder:s,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const h=function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t),f=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(h),p={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Px.create(p,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},f),s.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:Wx.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:$x.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:zx(ow,i,t,e.flags),axisLabelStyle:Hx(ow,i,t,e.flags)});const g=s.getSettings(),m=rw.createSettings(e,t,l,c,u,d);if(s.addComponent("box-marker",m),t.dataPoint&&t.dataPoint.showLabels){const n=iw.createSettings(t,a,ow,e.flags);s.addComponent("labels",n)}return e.addSnapshotChartSettings(g,t),g.scales.rangeSelSettings={type:"linear",min:g.scales.dimension.min,max:g.scales.dimension.max,source:"qDimensionInfo/0"},g}};const lw=yv.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:s,renderState:a}){this._super(r,i,e,o,s),this.flags=t,this.renderState=a,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new nx,this._selectionHandler=_v.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:s,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=jv.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return aw.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=Yy(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then((i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:qx.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then((o=>{if(t._destroyed)return Promise.reject();const s={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>Dx.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(s)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(s))}))))}))},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class cw{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var uw={onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(t=t.box)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)}};const dw=(e,t,n)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:n&&null!=n&&n.isEnabled("CLIENT_IM_3364")?{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}:void 0}),hw="maxCount",fw="size";function pw(e){return!(e.bins&&e.bins.auto)}function gw(e){return pw(e)&&e.bins.binMode===hw}function mw(e){var t,n;const{translator:r,flags:i}=e,o=null==e||null===(t=e.flags)||void 0===t?void 0:t.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),s=null==e||null===(n=e.flags)||void 0===n?void 0:n.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),a=e.anything.sense.theme,l={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=a.getDataColorSpecials(),t=a.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},c="object.histogram",u=jx(a,r,c,Mb,i),d=Lx(u,a,c),h={type:"items",translation:"properties.presentation",items:{styleEditor:o&&dw(s,d,null==e?void 0:e.flags),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},f={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.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.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.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"}}}}}}},p={uses:"settings",items:{simpleLabels:f,presentation:h,colors:l,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},g={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:uw.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},m={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:hw,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:fw,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:hw,show:e=>pw(e)},y={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!pw(e)},mode:m,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return yx.isEmpty(r)?yx.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:gw},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=Yy(e,"bins.binCount"),n="object"==typeof t;return gw(e)&&!yx.isEmpty(t)&&!n&&!mx(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=Yy(e,"bins.binCount");return!!(gw(e)&&!yx.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>pw(e)&&e.bins.binMode===fw,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>pw(e)&&e.bins.binMode===fw,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===Yy(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===Yy(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=Yy(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=Yy(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=r.get("properties.histogram.staticMeasureName");return r.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},bins:y,addons:g,settings:p}}}var yw={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var bw={getExportRawDataOptions:function(e,t,n){return e.addItem({translation:"contextMenu.export",tid:"export",select(){n.show(t.model,"/qUndoExclude/box/qHyperCubeDef")}}),Promise.resolve()}};const vw="qUndoExclude.box";function xw(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:mw(e),softDefinition:yw,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=jm(e);r.mapProperties();const s={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return Im.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:s,hypercubePath:i})},exportProperties:(e,t,n)=>Im.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?vw:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=vw;return Im.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:bw.getExportRawDataOptions}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(o).forEach((t=>{e.add(o[t])}))}}(t.translator);const n=jm(t);return{qae:{properties:Lm,data:{targets:[n]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>Im.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:xw(t),component(){const n=e.useConstraints(),r=e.useElement(),o=function(){const t=e.useApp(),n=e.useAppLayout(),r=e.useDeviceType(),i=e.useOptions(),o=e.useTheme(),s=e.useTranslator();return e.useMemo((()=>({app:t,appLayout:n,deviceType:r,options:i,theme:o,translator:s})),[t,n,i.direction,i.freeResize,s.language(),o.name(),r])}(),s=o.options.renderer,a=e.useMemo((()=>Nm(s)),[s]),l=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),s=!!e.useLayout().qSelectionInfo.qInSelections,[a]=e.useState((()=>({toggle(){o((e=>!e))}})));return e.useEffect((()=>{t&&r(!t.select&&!t.active)}),[t]),e.useAction((()=>({key:"lasso",label:"Lasso",icon:Rm,hidden:!n||!s,active:i,action(){o((e=>!e))}})),[s,i,n]),a.enabled=()=>n,a.active=()=>i,a}(),c=e.useModel(),u=e.useSelections(),d=e.useStaleLayout(),h=e.useRenderState(),[f,p]=e.useState();e.useEffect((()=>{const e=i(r),n=new cw(c),s=u,d=new lw({$element:e,backendApi:n,environment:o,flags:t.flags,lasso:l,picasso:a,selectionsApi:s,renderState:h});return p(d),()=>{d.destroy()}}),[]);const[,g]=e.usePromise((async()=>{f&&(f.updateEnvironment(o),f.updateConstraints(n),await f.updateData(d),await f.paint())}),[d,f,o]);if(g)throw g;var m;!function(t){const n=e.useRect(),r=e.useOptions(),i=e.useConstraints(),[,o]=e.usePromise((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(o)throw o}(f),m=f,e.onTakeSnapshot((e=>{if(m)return m.setSnapshotData(e)})),e.useImperativeHandle((()=>({getViewState(){if(m)return m.getViewState()}})),[m])}}}}));
29
29
  //# sourceMappingURL=sn-histogram.js.map